diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
index 9124973068..40e43f120b 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
@@ -219,10 +219,6 @@ public class Q00350_EnhanceYourWeapon extends Quest
String htmltext = getNoQuestMsg(player);
final QuestState qs = getQuestState(player, true);
if (qs.getState() == State.CREATED)
- {
- qs.set("cond", "0");
- }
- if (qs.getInt("cond") == 0)
{
htmltext = npc.getId() + "-01.htm";
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/others/FeedableBeasts.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/others/FeedableBeasts.java
index 5c468ae007..74356b6334 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/others/FeedableBeasts.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/others/FeedableBeasts.java
@@ -174,7 +174,7 @@ public class FeedableBeasts extends Quest
// TODO: no grendels?
GrowthCapableMob temp;
- //@formatter:off
+ // @formatter:off
final int[][] Kookabura_0_Gold = {{ 21452, 21453, 21454, 21455 }};
final int[][] Kookabura_0_Crystal = {{ 21456, 21457, 21458, 21459 }};
final int[][] Kookabura_1_Gold_1= {{ 21460, 21462 }};
@@ -199,7 +199,7 @@ public class FeedableBeasts extends Quest
final int[][] Cougar_1_Crystal_2 = {{ 21503,21505 }};
final int[][] Cougar_2_1 = {{ 21506, 21828 }, { 16015,16016 }};
final int[][] Cougar_2_2 = {{ 21507, 21829 }, { 16015,16016 }};
- //@formatter:on
+ // @formatter:on
// Alpen Kookabura
temp = new GrowthCapableMob(0, 100);
@@ -412,7 +412,7 @@ public class FeedableBeasts extends Quest
if ((st != null) && (Rnd.get(100) < 5) && !st.hasQuestItems(7185))
{
st.giveItems(7185, 1);
- st.set("cond", "2");
+ st.setCond(2);
}
// Also, perform a rare random chat
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/others/NewbieHelper/NewbieHelper.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/others/NewbieHelper/NewbieHelper.java
index a2e02dc006..8ba59299b3 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/others/NewbieHelper/NewbieHelper.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/others/NewbieHelper/NewbieHelper.java
@@ -44,12 +44,10 @@ public class NewbieHelper extends Quest
private static final int LICENSE_OF_MINER = 1498;
// Orc
private static final int VOUCHER_OF_FLAME = 1496;
-
// Items Reward
private static final int SOULSHOT_NOVICE = 5789;
private static final int SPIRITSHOT_NOVICE = 5790;
private static final int BLUE_GEM = 6353;
-
private static final Map _events = new HashMap<>();
static
{
@@ -60,7 +58,6 @@ public class NewbieHelper extends Quest
_events.put("30528_02", new Event("30528-03.htm", 115642, -178046, -941, LICENSE_OF_MINER, 0x35, SOULSHOT_NOVICE, 200, 0x00, 0, 0));
_events.put("30573_02", new Event("30573-03.htm", -45067, -113549, -235, VOUCHER_OF_FLAME, 0x31, SOULSHOT_NOVICE, 200, 0x2c, SOULSHOT_NOVICE, 200));
}
-
// @formatter:off
private static final Map _talks = new HashMap<>();
static
@@ -89,11 +86,8 @@ public class NewbieHelper extends Quest
public NewbieHelper()
{
super(-1, "ai/others");
-
addStartNpc(30009, 30019, 30131, 30400, 30530, 30575);
-
addTalkId(30009, 30019, 30131, 30400, 30530, 30575, 30008, 30017, 30129, 30370, 30528, 30573);
-
addFirstTalkId(new int[]
{
30009, // Newbie Helper - Human
@@ -116,7 +110,6 @@ public class NewbieHelper extends Quest
30528, // Foreman - Dwarf
30573 // Flame Guardian - Orc
});
-
addKillId(18342);
}
@@ -248,12 +241,12 @@ public class NewbieHelper extends Quest
{
String htmltext = "";
QuestState qs1 = player.getQuestState(getName());
- final QuestState qs2 = player.getQuestState(Tutorial.class.getSimpleName());
if (qs1 == null)
{
qs1 = newQuestState(player);
}
+ final QuestState qs2 = player.getQuestState(Tutorial.class.getSimpleName());
if ((qs2 == null) || Config.DISABLE_TUTORIAL)
{
npc.showChatWindow(player);
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/custom/KetraOrcSupport/KetraOrcSupport.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/custom/KetraOrcSupport/KetraOrcSupport.java
index 823ead33ae..f1d13cc8c3 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/custom/KetraOrcSupport/KetraOrcSupport.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/custom/KetraOrcSupport/KetraOrcSupport.java
@@ -50,9 +50,7 @@ public class KetraOrcSupport extends Quest
private static final int JAFF = 31374; // Warehouse Keeper
private static final int JUMARA = 31375; // Trader
private static final int KURFA = 31376; // Gate Keeper
-
private static final int HORN = 7186;
-
private static final int[] KETRAS =
{
21324,
@@ -77,44 +75,19 @@ public class KetraOrcSupport extends Quest
21348,
21349
};
-
private static final int[][] BUFF =
{
- {
- 4359,
- 2
- }, // Focus: Requires 2 Buffalo Horns
- {
- 4360,
- 2
- }, // Death Whisper: Requires 2 Buffalo Horns
- {
- 4345,
- 3
- }, // Might: Requires 3 Buffalo Horns
- {
- 4355,
- 3
- }, // Acumen: Requires 3 Buffalo Horns
- {
- 4352,
- 3
- }, // Berserker: Requires 3 Buffalo Horns
- {
- 4354,
- 3
- }, // Vampiric Rage: Requires 3 Buffalo Horns
- {
- 4356,
- 6
- }, // Empower: Requires 6 Buffalo Horns
- {
- 4357,
- 6
- }
- // Haste: Requires 6 Buffalo Horns
+ // @formatter:off
+ {4359, 2}, // Focus: Requires 2 Buffalo Horns
+ {4360, 2}, // Death Whisper: Requires 2 Buffalo Horns
+ {4345, 3}, // Might: Requires 3 Buffalo Horns
+ {4355, 3}, // Acumen: Requires 3 Buffalo Horns
+ {4352, 3}, // Berserker: Requires 3 Buffalo Horns
+ {4354, 3}, // Vampiric Rage: Requires 3 Buffalo Horns
+ {4356, 6}, // Empower: Requires 6 Buffalo Horns
+ {4357, 6}, // Haste: Requires 6 Buffalo Horns
+ // @formatter:on
};
-
private static final Skill VARKA_KETRA_PETRIFICATION = SkillTable.getInstance().getSkill(4578, 1);
/**
@@ -185,11 +158,15 @@ public class KetraOrcSupport extends Quest
switch (player.getAllianceWithVarkaKetra())
{
case 4:
+ {
htmltext = "31376-4.htm";
break;
+ }
case 5:
+ {
htmltext = "31376-5.htm";
break;
+ }
}
}
@@ -211,6 +188,7 @@ public class KetraOrcSupport extends Quest
switch (npc.getNpcId())
{
case KADUN:
+ {
if (allianceLevel > 0)
{
htmltext = "31370-friend.htm";
@@ -220,8 +198,9 @@ public class KetraOrcSupport extends Quest
htmltext = "31370-no.htm";
}
break;
-
+ }
case WAHKAN:
+ {
if (allianceLevel > 0)
{
htmltext = "31371-friend.htm";
@@ -231,8 +210,9 @@ public class KetraOrcSupport extends Quest
htmltext = "31371-no.htm";
}
break;
-
+ }
case ASEFA:
+ {
st.setState(State.STARTED);
if (allianceLevel < 1)
{
@@ -254,8 +234,9 @@ public class KetraOrcSupport extends Quest
}
}
break;
-
+ }
case ATAN:
+ {
if (player.getKarma() >= 1)
{
htmltext = "31373-pk.htm";
@@ -273,18 +254,24 @@ public class KetraOrcSupport extends Quest
htmltext = "31373-2.htm";
}
break;
-
+ }
case JAFF:
+ {
switch (allianceLevel)
{
case 1:
+ {
htmltext = "31374-1.htm";
break;
+ }
case 2:
case 3:
+ {
htmltext = "31374-2.htm";
break;
+ }
default:
+ {
if (allianceLevel <= 0)
{
htmltext = "31374-no.htm";
@@ -298,29 +285,40 @@ public class KetraOrcSupport extends Quest
htmltext = "31374-4.htm";
}
break;
+ }
}
break;
-
+ }
case JUMARA:
+ {
switch (allianceLevel)
{
case 2:
+ {
htmltext = "31375-1.htm";
break;
+ }
case 3:
case 4:
+ {
htmltext = "31375-2.htm";
break;
+ }
case 5:
+ {
htmltext = "31375-3.htm";
break;
+ }
default:
+ {
htmltext = "31375-no.htm";
break;
+ }
}
break;
-
+ }
case KURFA:
+ {
if (allianceLevel <= 0)
{
htmltext = "31376-no.htm";
@@ -338,6 +336,7 @@ public class KetraOrcSupport extends Quest
htmltext = "31376-3.htm";
}
break;
+ }
}
return htmltext;
@@ -376,6 +375,7 @@ public class KetraOrcSupport extends Quest
case HEAL_STATIC:
case BALANCE_LIFE:
case HOT:
+ {
for (WorldObject target : skill.getTargetList(caster))
{
// Character isn't existing, or is current caster, we drop check.
@@ -419,6 +419,7 @@ public class KetraOrcSupport extends Quest
}
}
break;
+ }
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/custom/VarkaSilenosSupport/VarkaSilenosSupport.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/custom/VarkaSilenosSupport/VarkaSilenosSupport.java
index f5ddaf1c48..e3c989f304 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/custom/VarkaSilenosSupport/VarkaSilenosSupport.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/custom/VarkaSilenosSupport/VarkaSilenosSupport.java
@@ -49,9 +49,7 @@ public class VarkaSilenosSupport extends Quest
private static final int HAGOS = 31381; // Warehouse Keeper
private static final int SHIKON = 31382; // Trader
private static final int TERANU = 31383; // Teleporter
-
private static final int SEED = 7187;
-
private static final int[] VARKAS =
{
21350,
@@ -76,44 +74,19 @@ public class VarkaSilenosSupport extends Quest
21374,
21375
};
-
private static final int[][] BUFF =
{
- {
- 4359,
- 2
- }, // Focus: Requires 2 Nepenthese Seeds
- {
- 4360,
- 2
- }, // Death Whisper: Requires 2 Nepenthese Seeds
- {
- 4345,
- 3
- }, // Might: Requires 3 Nepenthese Seeds
- {
- 4355,
- 3
- }, // Acumen: Requires 3 Nepenthese Seeds
- {
- 4352,
- 3
- }, // Berserker: Requires 3 Nepenthese Seeds
- {
- 4354,
- 3
- }, // Vampiric Rage: Requires 3 Nepenthese Seeds
- {
- 4356,
- 6
- }, // Empower: Requires 6 Nepenthese Seeds
- {
- 4357,
- 6
- }
- // Haste: Requires 6 Nepenthese Seeds
+ // @formatter:off
+ {4359, 2}, // Focus: Requires 2 Nepenthese Seeds
+ {4360, 2}, // Death Whisper: Requires 2 Nepenthese Seeds
+ {4345, 3}, // Might: Requires 3 Nepenthese Seeds
+ {4355, 3}, // Acumen: Requires 3 Nepenthese Seeds
+ {4352, 3}, // Berserker: Requires 3 Nepenthese Seeds
+ {4354, 3}, // Vampiric Rage: Requires 3 Nepenthese Seeds
+ {4356, 6}, // Empower: Requires 6 Nepenthese Seeds
+ {4357, 6}, // Haste: Requires 6 Nepenthese Seeds
+ // @formatter:on
};
-
private static final Skill VARKA_KETRA_PETRIFICATION = SkillTable.getInstance().getSkill(4578, 1);
/**
@@ -184,11 +157,15 @@ public class VarkaSilenosSupport extends Quest
switch (player.getAllianceWithVarkaKetra())
{
case -4:
+ {
htmltext = "31383-4.htm";
break;
+ }
case -5:
+ {
htmltext = "31383-5.htm";
break;
+ }
}
}
@@ -210,6 +187,7 @@ public class VarkaSilenosSupport extends Quest
switch (npc.getNpcId())
{
case ASHAS:
+ {
if (allianceLevel < 0)
{
htmltext = "31377-friend.htm";
@@ -219,8 +197,9 @@ public class VarkaSilenosSupport extends Quest
htmltext = "31377-no.htm";
}
break;
-
+ }
case NARAN:
+ {
if (allianceLevel < 0)
{
htmltext = "31378-friend.htm";
@@ -230,8 +209,9 @@ public class VarkaSilenosSupport extends Quest
htmltext = "31378-no.htm";
}
break;
-
+ }
case UDAN:
+ {
st.setState(State.STARTED);
if (allianceLevel > -1)
{
@@ -253,8 +233,9 @@ public class VarkaSilenosSupport extends Quest
}
}
break;
-
+ }
case DIYABU:
+ {
if (player.getKarma() >= 1)
{
htmltext = "31380-pk.htm";
@@ -272,18 +253,24 @@ public class VarkaSilenosSupport extends Quest
htmltext = "31380-2.htm";
}
break;
-
+ }
case HAGOS:
+ {
switch (allianceLevel)
{
case -1:
+ {
htmltext = "31381-1.htm";
break;
+ }
case -2:
case -3:
+ {
htmltext = "31381-2.htm";
break;
+ }
default:
+ {
if (allianceLevel >= 0)
{
htmltext = "31381-no.htm";
@@ -297,29 +284,40 @@ public class VarkaSilenosSupport extends Quest
htmltext = "31381-4.htm";
}
break;
+ }
}
break;
-
+ }
case SHIKON:
+ {
switch (allianceLevel)
{
case -2:
+ {
htmltext = "31382-1.htm";
break;
+ }
case -3:
case -4:
+ {
htmltext = "31382-2.htm";
break;
+ }
case -5:
+ {
htmltext = "31382-3.htm";
break;
+ }
default:
+ {
htmltext = "31382-no.htm";
break;
+ }
}
break;
-
+ }
case TERANU:
+ {
if (allianceLevel >= 0)
{
htmltext = "31383-no.htm";
@@ -337,6 +335,7 @@ public class VarkaSilenosSupport extends Quest
htmltext = "31383-3.htm";
}
break;
+ }
}
return htmltext;
@@ -375,6 +374,7 @@ public class VarkaSilenosSupport extends Quest
case HEAL_STATIC:
case BALANCE_LIFE:
case HOT:
+ {
for (WorldObject target : skill.getTargetList(caster))
{
// Character isn't existing, or is current caster, we drop check.
@@ -418,6 +418,7 @@ public class VarkaSilenosSupport extends Quest
}
}
break;
+ }
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q001_LettersOfLove/Q001_LettersOfLove.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q001_LettersOfLove/Q001_LettersOfLove.java
index 491afa51e5..2735d1c380 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q001_LettersOfLove/Q001_LettersOfLove.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q001_LettersOfLove/Q001_LettersOfLove.java
@@ -24,26 +24,22 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q001_LettersOfLove extends Quest
{
- // Npcs
+ // NPCs
private static final int DARIN = 30048;
private static final int ROXXY = 30006;
private static final int BAULRO = 30033;
-
// Items
private static final int DARIN_LETTER = 687;
private static final int ROXXY_KERCHIEF = 688;
private static final int DARIN_RECEIPT = 1079;
private static final int BAULRO_POTION = 1080;
-
// Reward
private static final int NECKLACE = 906;
public Q001_LettersOfLove()
{
super(1, "Letters of Love");
-
registerQuestItems(DARIN_LETTER, ROXXY_KERCHIEF, DARIN_RECEIPT, BAULRO_POTION);
-
addStartNpc(DARIN);
addTalkId(DARIN, ROXXY, BAULRO);
}
@@ -60,9 +56,7 @@ public class Q001_LettersOfLove extends Quest
if (event.equals("30048-06.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(DARIN_LETTER, 1);
}
@@ -82,14 +76,17 @@ public class Q001_LettersOfLove extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 2) ? "30048-01.htm" : "30048-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case DARIN:
+ {
if (cond == 1)
{
htmltext = "30048-07.htm";
@@ -97,7 +94,7 @@ public class Q001_LettersOfLove extends Quest
else if (cond == 2)
{
htmltext = "30048-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ROXXY_KERCHIEF, 1);
st.giveItems(DARIN_RECEIPT, 1);
@@ -115,12 +112,13 @@ public class Q001_LettersOfLove extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ROXXY:
+ {
if (cond == 1)
{
htmltext = "30006-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DARIN_LETTER, 1);
st.giveItems(ROXXY_KERCHIEF, 1);
@@ -134,12 +132,13 @@ public class Q001_LettersOfLove extends Quest
htmltext = "30006-03.htm";
}
break;
-
+ }
case BAULRO:
+ {
if (cond == 3)
{
htmltext = "30033-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DARIN_RECEIPT, 1);
st.giveItems(BAULRO_POTION, 1);
@@ -149,12 +148,15 @@ public class Q001_LettersOfLove extends Quest
htmltext = "30033-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q002_WhatWomenWant/Q002_WhatWomenWant.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q002_WhatWomenWant/Q002_WhatWomenWant.java
index 90d28bec04..3f7fb2faff 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q002_WhatWomenWant/Q002_WhatWomenWant.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q002_WhatWomenWant/Q002_WhatWomenWant.java
@@ -30,23 +30,19 @@ public class Q002_WhatWomenWant extends Quest
private static final int MIRABEL = 30146;
private static final int HERBIEL = 30150;
private static final int GREENIS = 30157;
-
// Items
private static final int ARUJIEN_LETTER_1 = 1092;
private static final int ARUJIEN_LETTER_2 = 1093;
private static final int ARUJIEN_LETTER_3 = 1094;
private static final int POETRY_BOOK = 689;
private static final int GREENIS_LETTER = 693;
-
// Rewards
private static final int MYSTICS_EARRING = 113;
public Q002_WhatWomenWant()
{
super(2, "What Women Want");
-
registerQuestItems(ARUJIEN_LETTER_1, ARUJIEN_LETTER_2, ARUJIEN_LETTER_3, POETRY_BOOK, GREENIS_LETTER);
-
addStartNpc(ARUJIEN);
addTalkId(ARUJIEN, MIRABEL, HERBIEL, GREENIS);
}
@@ -61,26 +57,30 @@ public class Q002_WhatWomenWant extends Quest
return htmltext;
}
- if (event.equals("30223-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ARUJIEN_LETTER_1, 1);
- }
- else if (event.equals("30223-08.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARUJIEN_LETTER_3, 1);
- st.giveItems(POETRY_BOOK, 1);
- }
- else if (event.equals("30223-09.htm"))
- {
- st.takeItems(ARUJIEN_LETTER_3, 1);
- st.rewardItems(57, 450);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30223-04.htm":
+ {
+ st.startQuest();
+ st.giveItems(ARUJIEN_LETTER_1, 1);
+ break;
+ }
+ case "30223-08.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARUJIEN_LETTER_3, 1);
+ st.giveItems(POETRY_BOOK, 1);
+ break;
+ }
+ case "30223-09.htm":
+ {
+ st.takeItems(ARUJIEN_LETTER_3, 1);
+ st.rewardItems(57, 450);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -99,6 +99,7 @@ public class Q002_WhatWomenWant extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() != Race.ELF) && (player.getRace() != Race.HUMAN))
{
htmltext = "30223-00.htm";
@@ -112,12 +113,14 @@ public class Q002_WhatWomenWant extends Quest
htmltext = "30223-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ARUJIEN:
+ {
if (st.hasQuestItems(ARUJIEN_LETTER_1))
{
htmltext = "30223-05.htm";
@@ -143,12 +146,13 @@ public class Q002_WhatWomenWant extends Quest
st.exitQuest(false);
}
break;
-
+ }
case MIRABEL:
+ {
if (cond == 1)
{
htmltext = "30146-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ARUJIEN_LETTER_1, 1);
st.giveItems(ARUJIEN_LETTER_2, 1);
@@ -158,12 +162,13 @@ public class Q002_WhatWomenWant extends Quest
htmltext = "30146-02.htm";
}
break;
-
+ }
case HERBIEL:
+ {
if (cond == 2)
{
htmltext = "30150-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ARUJIEN_LETTER_2, 1);
st.giveItems(ARUJIEN_LETTER_3, 1);
@@ -173,8 +178,9 @@ public class Q002_WhatWomenWant extends Quest
htmltext = "30150-02.htm";
}
break;
-
+ }
case GREENIS:
+ {
if (cond < 4)
{
htmltext = "30157-01.htm";
@@ -182,7 +188,7 @@ public class Q002_WhatWomenWant extends Quest
else if (cond == 4)
{
htmltext = "30157-02.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(POETRY_BOOK, 1);
st.giveItems(GREENIS_LETTER, 1);
@@ -192,12 +198,15 @@ public class Q002_WhatWomenWant extends Quest
htmltext = "30157-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q003_WillTheSealBeBroken/Q003_WillTheSealBeBroken.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q003_WillTheSealBeBroken/Q003_WillTheSealBeBroken.java
index fb65f9b929..06229bdcc8 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q003_WillTheSealBeBroken/Q003_WillTheSealBeBroken.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q003_WillTheSealBeBroken/Q003_WillTheSealBeBroken.java
@@ -29,19 +29,15 @@ public class Q003_WillTheSealBeBroken extends Quest
private static final int ONYX_BEAST_EYE = 1081;
private static final int TAINT_STONE = 1082;
private static final int SUCCUBUS_BLOOD = 1083;
-
// Reward
private static final int SCROLL_ENCHANT_ARMOR_D = 956;
public Q003_WillTheSealBeBroken()
{
super(3, "Will the Seal be Broken?");
-
registerQuestItems(ONYX_BEAST_EYE, TAINT_STONE, SUCCUBUS_BLOOD);
-
addStartNpc(30141); // Talloth
addTalkId(30141);
-
addKillId(20031, 20041, 20046, 20048, 20052, 20057);
}
@@ -57,9 +53,7 @@ public class Q003_WillTheSealBeBroken extends Quest
if (event.equals("30141-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -78,6 +72,7 @@ public class Q003_WillTheSealBeBroken extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30141-00.htm";
@@ -91,9 +86,10 @@ public class Q003_WillTheSealBeBroken extends Quest
htmltext = "30141-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30141-04.htm";
@@ -109,10 +105,12 @@ public class Q003_WillTheSealBeBroken extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -121,7 +119,7 @@ public class Q003_WillTheSealBeBroken extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -130,28 +128,32 @@ public class Q003_WillTheSealBeBroken extends Quest
switch (npc.getNpcId())
{
case 20031:
+ {
if (st.dropItemsAlways(ONYX_BEAST_EYE, 1, 1) && st.hasQuestItems(TAINT_STONE, SUCCUBUS_BLOOD))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20041:
case 20046:
+ {
if (st.dropItemsAlways(TAINT_STONE, 1, 1) && st.hasQuestItems(ONYX_BEAST_EYE, SUCCUBUS_BLOOD))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20048:
case 20052:
case 20057:
+ {
if (st.dropItemsAlways(SUCCUBUS_BLOOD, 1, 1) && st.hasQuestItems(ONYX_BEAST_EYE, TAINT_STONE))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q004_LongliveThePaagrioLord/Q004_LongliveThePaagrioLord.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q004_LongliveThePaagrioLord/Q004_LongliveThePaagrioLord.java
index ab622fdc27..34459fa8cc 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q004_LongliveThePaagrioLord/Q004_LongliveThePaagrioLord.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q004_LongliveThePaagrioLord/Q004_LongliveThePaagrioLord.java
@@ -43,9 +43,7 @@ public class Q004_LongliveThePaagrioLord extends Quest
public Q004_LongliveThePaagrioLord()
{
super(4, "Long live the Pa'agrio Lord!");
-
registerQuestItems(1541, 1542, 1543, 1544, 1545, 1546);
-
addStartNpc(30578); // Nakusin
addTalkId(30578, 30585, 30566, 30562, 30560, 30559, 30587);
}
@@ -62,9 +60,7 @@ public class Q004_LongliveThePaagrioLord extends Quest
if (event.equals("30578-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -83,6 +79,7 @@ public class Q004_LongliveThePaagrioLord extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30578-00.htm";
@@ -96,11 +93,11 @@ public class Q004_LongliveThePaagrioLord extends Quest
htmltext = "30578-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
-
if (npcId == NAKUSIN)
{
if (cond == 1)
@@ -140,7 +137,7 @@ public class Q004_LongliveThePaagrioLord extends Quest
if (count == 6)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -150,10 +147,12 @@ public class Q004_LongliveThePaagrioLord extends Quest
}
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q005_MinersFavor/Q005_MinersFavor.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q005_MinersFavor/Q005_MinersFavor.java
index 1470ace119..24e07aaf48 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q005_MinersFavor/Q005_MinersFavor.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q005_MinersFavor/Q005_MinersFavor.java
@@ -30,7 +30,6 @@ public class Q005_MinersFavor extends Quest
private static final int GARITA = 30518;
private static final int REED = 30520;
private static final int BRUNON = 30526;
-
// Items
private static final int BOLTERS_LIST = 1547;
private static final int MINING_BOOTS = 1548;
@@ -38,16 +37,13 @@ public class Q005_MinersFavor extends Quest
private static final int BOOMBOOM_POWDER = 1550;
private static final int REDSTONE_BEER = 1551;
private static final int BOLTERS_SMELLY_SOCKS = 1552;
-
// Reward
private static final int NECKLACE = 906;
public Q005_MinersFavor()
{
super(5, "Miner's Favor");
-
registerQuestItems(BOLTERS_LIST, MINING_BOOTS, MINERS_PICK, BOOMBOOM_POWDER, REDSTONE_BEER, BOLTERS_SMELLY_SOCKS);
-
addStartNpc(BOLTER);
addTalkId(BOLTER, SHARI, GARITA, REED, BRUNON);
}
@@ -64,9 +60,7 @@ public class Q005_MinersFavor extends Quest
if (event.equals("30554-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(BOLTERS_LIST, 1);
st.giveItems(BOLTERS_SMELLY_SOCKS, 1);
}
@@ -76,7 +70,7 @@ public class Q005_MinersFavor extends Quest
st.giveItems(MINERS_PICK, 1);
if (st.hasQuestItems(MINING_BOOTS, BOOMBOOM_POWDER, REDSTONE_BEER))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -101,14 +95,17 @@ public class Q005_MinersFavor extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 2) ? "30554-01.htm" : "30554-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BOLTER:
+ {
if (cond == 1)
{
htmltext = "30554-04.htm";
@@ -126,15 +123,16 @@ public class Q005_MinersFavor extends Quest
st.exitQuest(false);
}
break;
-
+ }
case SHARI:
+ {
if ((cond == 1) && !st.hasQuestItems(BOOMBOOM_POWDER))
{
htmltext = "30517-01.htm";
st.giveItems(BOOMBOOM_POWDER, 1);
if (st.hasQuestItems(MINING_BOOTS, MINERS_PICK, REDSTONE_BEER))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -147,15 +145,16 @@ public class Q005_MinersFavor extends Quest
htmltext = "30517-02.htm";
}
break;
-
+ }
case GARITA:
+ {
if ((cond == 1) && !st.hasQuestItems(MINING_BOOTS))
{
htmltext = "30518-01.htm";
st.giveItems(MINING_BOOTS, 1);
if (st.hasQuestItems(MINERS_PICK, BOOMBOOM_POWDER, REDSTONE_BEER))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -168,15 +167,16 @@ public class Q005_MinersFavor extends Quest
htmltext = "30518-02.htm";
}
break;
-
+ }
case REED:
+ {
if ((cond == 1) && !st.hasQuestItems(REDSTONE_BEER))
{
htmltext = "30520-01.htm";
st.giveItems(REDSTONE_BEER, 1);
if (st.hasQuestItems(MINING_BOOTS, MINERS_PICK, BOOMBOOM_POWDER))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -189,8 +189,9 @@ public class Q005_MinersFavor extends Quest
htmltext = "30520-02.htm";
}
break;
-
+ }
case BRUNON:
+ {
if ((cond == 1) && !st.hasQuestItems(MINERS_PICK))
{
htmltext = "30526-01.htm";
@@ -200,12 +201,15 @@ public class Q005_MinersFavor extends Quest
htmltext = "30526-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q006_StepIntoTheFuture/Q006_StepIntoTheFuture.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q006_StepIntoTheFuture/Q006_StepIntoTheFuture.java
index a9a4ac453e..3490e4b40a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q006_StepIntoTheFuture/Q006_StepIntoTheFuture.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q006_StepIntoTheFuture/Q006_StepIntoTheFuture.java
@@ -29,10 +29,8 @@ public class Q006_StepIntoTheFuture extends Quest
private static final int ROXXY = 30006;
private static final int BAULRO = 30033;
private static final int SIR_COLLIN = 30311;
-
// Items
private static final int BAULRO_LETTER = 7571;
-
// Rewards
private static final int MARK_TRAVELER = 7570;
private static final int SOE_GIRAN = 7559;
@@ -40,9 +38,7 @@ public class Q006_StepIntoTheFuture extends Quest
public Q006_StepIntoTheFuture()
{
super(6, "Step into the Future");
-
registerQuestItems(BAULRO_LETTER);
-
addStartNpc(ROXXY);
addTalkId(ROXXY, BAULRO, SIR_COLLIN);
}
@@ -57,37 +53,42 @@ public class Q006_StepIntoTheFuture extends Quest
return htmltext;
}
- if (event.equals("30006-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30033-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BAULRO_LETTER, 1);
- }
- else if (event.equals("30311-02.htm"))
- {
- if (st.hasQuestItems(BAULRO_LETTER))
+ case "30006-03.htm":
{
- st.set("cond", "3");
+ st.startQuest();
+ break;
+ }
+ case "30033-02.htm":
+ {
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BAULRO_LETTER, 1);
+ st.giveItems(BAULRO_LETTER, 1);
+ break;
}
- else
+ case "30311-02.htm":
{
- htmltext = "30311-03.htm";
+ if (st.hasQuestItems(BAULRO_LETTER))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BAULRO_LETTER, 1);
+ }
+ else
+ {
+ htmltext = "30311-03.htm";
+ }
+ break;
+ }
+ case "30006-06.htm":
+ {
+ st.giveItems(MARK_TRAVELER, 1);
+ st.rewardItems(SOE_GIRAN, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
}
- }
- else if (event.equals("30006-06.htm"))
- {
- st.giveItems(MARK_TRAVELER, 1);
- st.rewardItems(SOE_GIRAN, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
}
return htmltext;
@@ -106,6 +107,7 @@ public class Q006_StepIntoTheFuture extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() != Race.HUMAN) || (player.getLevel() < 3))
{
htmltext = "30006-01.htm";
@@ -115,12 +117,14 @@ public class Q006_StepIntoTheFuture extends Quest
htmltext = "30006-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ROXXY:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30006-04.htm";
@@ -130,8 +134,9 @@ public class Q006_StepIntoTheFuture extends Quest
htmltext = "30006-05.htm";
}
break;
-
+ }
case BAULRO:
+ {
if (cond == 1)
{
htmltext = "30033-01.htm";
@@ -145,8 +150,9 @@ public class Q006_StepIntoTheFuture extends Quest
htmltext = "30033-04.htm";
}
break;
-
+ }
case SIR_COLLIN:
+ {
if (cond == 2)
{
htmltext = "30311-01.htm";
@@ -156,12 +162,15 @@ public class Q006_StepIntoTheFuture extends Quest
htmltext = "30311-03a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q007_ATripBegins/Q007_ATripBegins.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q007_ATripBegins/Q007_ATripBegins.java
index e04b8d2a29..0583b4cf78 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q007_ATripBegins/Q007_ATripBegins.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q007_ATripBegins/Q007_ATripBegins.java
@@ -29,10 +29,8 @@ public class Q007_ATripBegins extends Quest
private static final int MIRABEL = 30146;
private static final int ARIEL = 30148;
private static final int ASTERIOS = 30154;
-
// Items
private static final int ARIEL_RECO = 7572;
-
// Rewards
private static final int MARK_TRAVELER = 7570;
private static final int SOE_GIRAN = 7559;
@@ -40,9 +38,7 @@ public class Q007_ATripBegins extends Quest
public Q007_ATripBegins()
{
super(7, "A Trip Begins");
-
registerQuestItems(ARIEL_RECO);
-
addStartNpc(MIRABEL);
addTalkId(MIRABEL, ARIEL, ASTERIOS);
}
@@ -57,30 +53,35 @@ public class Q007_ATripBegins extends Quest
return htmltext;
}
- if (event.equals("30146-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30148-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(ARIEL_RECO, 1);
- }
- else if (event.equals("30154-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARIEL_RECO, 1);
- }
- else if (event.equals("30146-06.htm"))
- {
- st.giveItems(MARK_TRAVELER, 1);
- st.rewardItems(SOE_GIRAN, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30146-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30148-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(ARIEL_RECO, 1);
+ break;
+ }
+ case "30154-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARIEL_RECO, 1);
+ break;
+ }
+ case "30146-06.htm":
+ {
+ st.giveItems(MARK_TRAVELER, 1);
+ st.rewardItems(SOE_GIRAN, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -99,6 +100,7 @@ public class Q007_ATripBegins extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30146-01.htm";
@@ -112,12 +114,14 @@ public class Q007_ATripBegins extends Quest
htmltext = "30146-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MIRABEL:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30146-04.htm";
@@ -127,8 +131,9 @@ public class Q007_ATripBegins extends Quest
htmltext = "30146-05.htm";
}
break;
-
+ }
case ARIEL:
+ {
if (cond == 1)
{
htmltext = "30148-01.htm";
@@ -138,8 +143,9 @@ public class Q007_ATripBegins extends Quest
htmltext = "30148-03.htm";
}
break;
-
+ }
case ASTERIOS:
+ {
if (cond == 2)
{
htmltext = "30154-01.htm";
@@ -149,12 +155,15 @@ public class Q007_ATripBegins extends Quest
htmltext = "30154-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q008_AnAdventureBegins/Q008_AnAdventureBegins.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q008_AnAdventureBegins/Q008_AnAdventureBegins.java
index 1b45d9b9d0..0ce7b35ef6 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q008_AnAdventureBegins/Q008_AnAdventureBegins.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q008_AnAdventureBegins/Q008_AnAdventureBegins.java
@@ -29,10 +29,8 @@ public class Q008_AnAdventureBegins extends Quest
private static final int JASMINE = 30134;
private static final int ROSELYN = 30355;
private static final int HARNE = 30144;
-
// Items
private static final int ROSELYN_NOTE = 7573;
-
// Rewards
private static final int SOE_GIRAN = 7559;
private static final int MARK_TRAVELER = 7570;
@@ -40,9 +38,7 @@ public class Q008_AnAdventureBegins extends Quest
public Q008_AnAdventureBegins()
{
super(8, "An Adventure Begins");
-
registerQuestItems(ROSELYN_NOTE);
-
addStartNpc(JASMINE);
addTalkId(JASMINE, ROSELYN, HARNE);
}
@@ -57,30 +53,35 @@ public class Q008_AnAdventureBegins extends Quest
return htmltext;
}
- if (event.equals("30134-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30355-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(ROSELYN_NOTE, 1);
- }
- else if (event.equals("30144-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROSELYN_NOTE, 1);
- }
- else if (event.equals("30134-06.htm"))
- {
- st.giveItems(MARK_TRAVELER, 1);
- st.rewardItems(SOE_GIRAN, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30134-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30355-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(ROSELYN_NOTE, 1);
+ break;
+ }
+ case "30144-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ROSELYN_NOTE, 1);
+ break;
+ }
+ case "30134-06.htm":
+ {
+ st.giveItems(MARK_TRAVELER, 1);
+ st.rewardItems(SOE_GIRAN, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -99,6 +100,7 @@ public class Q008_AnAdventureBegins extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getLevel() >= 3) && (player.getRace() == Race.DARK_ELF))
{
htmltext = "30134-02.htm";
@@ -108,12 +110,14 @@ public class Q008_AnAdventureBegins extends Quest
htmltext = "30134-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case JASMINE:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30134-04.htm";
@@ -123,8 +127,9 @@ public class Q008_AnAdventureBegins extends Quest
htmltext = "30134-05.htm";
}
break;
-
+ }
case ROSELYN:
+ {
if (cond == 1)
{
htmltext = "30355-01.htm";
@@ -134,8 +139,9 @@ public class Q008_AnAdventureBegins extends Quest
htmltext = "30355-03.htm";
}
break;
-
+ }
case HARNE:
+ {
if (cond == 2)
{
htmltext = "30144-01.htm";
@@ -145,12 +151,15 @@ public class Q008_AnAdventureBegins extends Quest
htmltext = "30144-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q009_IntoTheCityOfHumans/Q009_IntoTheCityOfHumans.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q009_IntoTheCityOfHumans/Q009_IntoTheCityOfHumans.java
index 9b89bea4ff..6d7cd45e0b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q009_IntoTheCityOfHumans/Q009_IntoTheCityOfHumans.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q009_IntoTheCityOfHumans/Q009_IntoTheCityOfHumans.java
@@ -29,7 +29,6 @@ public class Q009_IntoTheCityOfHumans extends Quest
private static final int PETUKAI = 30583;
private static final int TANAPI = 30571;
private static final int TAMIL = 30576;
-
// Rewards
private static final int MARK_OF_TRAVELER = 7570;
private static final int SOE_GIRAN = 7126;
@@ -37,7 +36,6 @@ public class Q009_IntoTheCityOfHumans extends Quest
public Q009_IntoTheCityOfHumans()
{
super(9, "Into the City of Humans");
-
addStartNpc(PETUKAI);
addTalkId(PETUKAI, TANAPI, TAMIL);
}
@@ -52,23 +50,27 @@ public class Q009_IntoTheCityOfHumans extends Quest
return htmltext;
}
- if (event.equals("30583-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30571-01.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30576-01.htm"))
- {
- st.giveItems(MARK_OF_TRAVELER, 1);
- st.rewardItems(SOE_GIRAN, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30583-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30571-01.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30576-01.htm":
+ {
+ st.giveItems(MARK_OF_TRAVELER, 1);
+ st.rewardItems(SOE_GIRAN, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -87,6 +89,7 @@ public class Q009_IntoTheCityOfHumans extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getLevel() >= 3) && (player.getRace() == Race.ORC))
{
htmltext = "30583-00.htm";
@@ -96,19 +99,22 @@ public class Q009_IntoTheCityOfHumans extends Quest
htmltext = "30583-00a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case PETUKAI:
+ {
if (cond == 1)
{
htmltext = "30583-01a.htm";
}
break;
-
+ }
case TANAPI:
+ {
if (cond == 1)
{
htmltext = "30571-00.htm";
@@ -118,19 +124,23 @@ public class Q009_IntoTheCityOfHumans extends Quest
htmltext = "30571-01a.htm";
}
break;
-
+ }
case TAMIL:
+ {
if (cond == 2)
{
htmltext = "30576-00.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q010_IntoTheWorld/Q010_IntoTheWorld.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q010_IntoTheWorld/Q010_IntoTheWorld.java
index 225da14143..5e4a5b16ac 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q010_IntoTheWorld/Q010_IntoTheWorld.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q010_IntoTheWorld/Q010_IntoTheWorld.java
@@ -27,11 +27,9 @@ public class Q010_IntoTheWorld extends Quest
{
// Items
private static final int VERY_EXPENSIVE_NECKLACE = 7574;
-
// Rewards
private static final int SOE_GIRAN = 7559;
private static final int MARK_OF_TRAVELER = 7570;
-
// NPCs
private static final int REED = 30520;
private static final int BALANKI = 30533;
@@ -40,9 +38,7 @@ public class Q010_IntoTheWorld extends Quest
public Q010_IntoTheWorld()
{
super(10, "Into the World");
-
registerQuestItems(VERY_EXPENSIVE_NECKLACE);
-
addStartNpc(BALANKI);
addTalkId(BALANKI, REED, GERALD);
}
@@ -57,35 +53,41 @@ public class Q010_IntoTheWorld extends Quest
return htmltext;
}
- if (event.equals("30533-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30520-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(VERY_EXPENSIVE_NECKLACE, 1);
- }
- else if (event.equals("30650-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VERY_EXPENSIVE_NECKLACE, 1);
- }
- else if (event.equals("30520-04.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30533-05.htm"))
- {
- st.giveItems(SOE_GIRAN, 1);
- st.rewardItems(MARK_OF_TRAVELER, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30533-02.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30520-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(VERY_EXPENSIVE_NECKLACE, 1);
+ break;
+ }
+ case "30650-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VERY_EXPENSIVE_NECKLACE, 1);
+ break;
+ }
+ case "30520-04.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30533-05.htm":
+ {
+ st.giveItems(SOE_GIRAN, 1);
+ st.rewardItems(MARK_OF_TRAVELER, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -104,6 +106,7 @@ public class Q010_IntoTheWorld extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getLevel() >= 3) && (player.getRace() == Race.DWARF))
{
htmltext = "30533-01.htm";
@@ -113,12 +116,14 @@ public class Q010_IntoTheWorld extends Quest
htmltext = "30533-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BALANKI:
+ {
if (cond < 4)
{
htmltext = "30533-03.htm";
@@ -128,8 +133,9 @@ public class Q010_IntoTheWorld extends Quest
htmltext = "30533-04.htm";
}
break;
-
+ }
case REED:
+ {
if (cond == 1)
{
htmltext = "30520-01.htm";
@@ -147,8 +153,9 @@ public class Q010_IntoTheWorld extends Quest
htmltext = "30520-04a.htm";
}
break;
-
+ }
case GERALD:
+ {
if (cond == 2)
{
htmltext = "30650-01.htm";
@@ -158,12 +165,15 @@ public class Q010_IntoTheWorld extends Quest
htmltext = "30650-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q011_SecretMeetingWithKetraOrcs/Q011_SecretMeetingWithKetraOrcs.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q011_SecretMeetingWithKetraOrcs/Q011_SecretMeetingWithKetraOrcs.java
index 4af39d9042..ef865f8576 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q011_SecretMeetingWithKetraOrcs/Q011_SecretMeetingWithKetraOrcs.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q011_SecretMeetingWithKetraOrcs/Q011_SecretMeetingWithKetraOrcs.java
@@ -24,20 +24,17 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q011_SecretMeetingWithKetraOrcs extends Quest
{
- // Npcs
+ // NPCs
private static final int CADMON = 31296;
private static final int LEON = 31256;
private static final int WAHKAN = 31371;
-
// Items
private static final int MUNITIONS_BOX = 7231;
public Q011_SecretMeetingWithKetraOrcs()
{
super(11, "Secret Meeting With Ketra Orcs");
-
registerQuestItems(MUNITIONS_BOX);
-
addStartNpc(CADMON);
addTalkId(CADMON, LEON, WAHKAN);
}
@@ -52,24 +49,28 @@ public class Q011_SecretMeetingWithKetraOrcs extends Quest
return htmltext;
}
- if (event.equals("31296-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31256-02.htm"))
- {
- st.giveItems(MUNITIONS_BOX, 1);
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31371-02.htm"))
- {
- st.takeItems(MUNITIONS_BOX, 1);
- st.rewardExpAndSp(79787, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31296-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31256-02.htm":
+ {
+ st.giveItems(MUNITIONS_BOX, 1);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31371-02.htm":
+ {
+ st.takeItems(MUNITIONS_BOX, 1);
+ st.rewardExpAndSp(79787, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -88,21 +89,25 @@ public class Q011_SecretMeetingWithKetraOrcs extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 74) ? "31296-02.htm" : "31296-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case CADMON:
+ {
if (cond == 1)
{
htmltext = "31296-04.htm";
}
break;
-
+ }
case LEON:
+ {
if (cond == 1)
{
htmltext = "31256-01.htm";
@@ -112,19 +117,23 @@ public class Q011_SecretMeetingWithKetraOrcs extends Quest
htmltext = "31256-03.htm";
}
break;
-
+ }
case WAHKAN:
+ {
if (cond == 2)
{
htmltext = "31371-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q012_SecretMeetingWithVarkaSilenos/Q012_SecretMeetingWithVarkaSilenos.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q012_SecretMeetingWithVarkaSilenos/Q012_SecretMeetingWithVarkaSilenos.java
index 41c2b05a45..6d846b576c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q012_SecretMeetingWithVarkaSilenos/Q012_SecretMeetingWithVarkaSilenos.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q012_SecretMeetingWithVarkaSilenos/Q012_SecretMeetingWithVarkaSilenos.java
@@ -28,16 +28,13 @@ public class Q012_SecretMeetingWithVarkaSilenos extends Quest
private static final int CADMON = 31296;
private static final int HELMUT = 31258;
private static final int NARAN_ASHANUK = 31378;
-
// Items
private static final int MUNITIONS_BOX = 7232;
public Q012_SecretMeetingWithVarkaSilenos()
{
super(12, "Secret Meeting With Varka Silenos");
-
registerQuestItems(MUNITIONS_BOX);
-
addStartNpc(CADMON);
addTalkId(CADMON, HELMUT, NARAN_ASHANUK);
}
@@ -52,24 +49,28 @@ public class Q012_SecretMeetingWithVarkaSilenos extends Quest
return htmltext;
}
- if (event.equals("31296-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31258-02.htm"))
- {
- st.giveItems(MUNITIONS_BOX, 1);
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31378-02.htm"))
- {
- st.takeItems(MUNITIONS_BOX, 1);
- st.rewardExpAndSp(79761, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31296-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31258-02.htm":
+ {
+ st.giveItems(MUNITIONS_BOX, 1);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31378-02.htm":
+ {
+ st.takeItems(MUNITIONS_BOX, 1);
+ st.rewardExpAndSp(79761, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -88,21 +89,25 @@ public class Q012_SecretMeetingWithVarkaSilenos extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 74) ? "31296-02.htm" : "31296-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case CADMON:
+ {
if (cond == 1)
{
htmltext = "31296-04.htm";
}
break;
-
+ }
case HELMUT:
+ {
if (cond == 1)
{
htmltext = "31258-01.htm";
@@ -112,19 +117,23 @@ public class Q012_SecretMeetingWithVarkaSilenos extends Quest
htmltext = "31258-03.htm";
}
break;
-
+ }
case NARAN_ASHANUK:
+ {
if (cond == 2)
{
htmltext = "31378-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q013_ParcelDelivery/Q013_ParcelDelivery.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q013_ParcelDelivery/Q013_ParcelDelivery.java
index 9475cbca48..01100aaff7 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q013_ParcelDelivery/Q013_ParcelDelivery.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q013_ParcelDelivery/Q013_ParcelDelivery.java
@@ -27,16 +27,13 @@ public class Q013_ParcelDelivery extends Quest
// NPCs
private static final int FUNDIN = 31274;
private static final int VULCAN = 31539;
-
// Item
private static final int PACKAGE = 7263;
public Q013_ParcelDelivery()
{
super(13, "Parcel Delivery");
-
registerQuestItems(PACKAGE);
-
addStartNpc(FUNDIN);
addTalkId(FUNDIN, VULCAN);
}
@@ -53,9 +50,7 @@ public class Q013_ParcelDelivery extends Quest
if (event.equals("31274-2.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(PACKAGE, 1);
}
else if (event.equals("31539-1.htm"))
@@ -82,25 +77,32 @@ public class Q013_ParcelDelivery extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 74) ? "31274-1.htm" : "31274-0.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case FUNDIN:
+ {
htmltext = "31274-2.htm";
break;
-
+ }
case VULCAN:
+ {
htmltext = "31539-0.htm";
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q014_WhereaboutsOfTheArchaeologist/Q014_WhereaboutsOfTheArchaeologist.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q014_WhereaboutsOfTheArchaeologist/Q014_WhereaboutsOfTheArchaeologist.java
index 60db27e7ba..a6b3f3c4be 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q014_WhereaboutsOfTheArchaeologist/Q014_WhereaboutsOfTheArchaeologist.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q014_WhereaboutsOfTheArchaeologist/Q014_WhereaboutsOfTheArchaeologist.java
@@ -27,16 +27,13 @@ public class Q014_WhereaboutsOfTheArchaeologist extends Quest
// NPCs
private static final int LIESEL = 31263;
private static final int GHOST_OF_ADVENTURER = 31538;
-
// Items
private static final int LETTER = 7253;
public Q014_WhereaboutsOfTheArchaeologist()
{
super(14, "Whereabouts of the Archaeologist");
-
registerQuestItems(LETTER);
-
addStartNpc(LIESEL);
addTalkId(LIESEL, GHOST_OF_ADVENTURER);
}
@@ -53,9 +50,7 @@ public class Q014_WhereaboutsOfTheArchaeologist extends Quest
if (event.equals("31263-2.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(LETTER, 1);
}
else if (event.equals("31538-1.htm"))
@@ -82,25 +77,32 @@ public class Q014_WhereaboutsOfTheArchaeologist extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 74) ? "31263-1.htm" : "31263-0.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case LIESEL:
+ {
htmltext = "31263-2.htm";
break;
-
+ }
case GHOST_OF_ADVENTURER:
+ {
htmltext = "31538-0.htm";
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q015_SweetWhispers/Q015_SweetWhispers.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q015_SweetWhispers/Q015_SweetWhispers.java
index 1d4e74e636..2513cabcd8 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q015_SweetWhispers/Q015_SweetWhispers.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q015_SweetWhispers/Q015_SweetWhispers.java
@@ -32,7 +32,6 @@ public class Q015_SweetWhispers extends Quest
public Q015_SweetWhispers()
{
super(15, "Sweet Whispers");
-
addStartNpc(VLADIMIR);
addTalkId(VLADIMIR, HIERARCH, MYSTERIOUS_NECRO);
}
@@ -47,22 +46,26 @@ public class Q015_SweetWhispers extends Quest
return htmltext;
}
- if (event.equals("31302-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31518-01.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31517-01.htm"))
- {
- st.rewardExpAndSp(60217, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31302-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31518-01.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31517-01.htm":
+ {
+ st.rewardExpAndSp(60217, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -81,18 +84,22 @@ public class Q015_SweetWhispers extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "31302-00a.htm" : "31302-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VLADIMIR:
+ {
htmltext = "31302-01a.htm";
break;
-
+ }
case MYSTERIOUS_NECRO:
+ {
if (cond == 1)
{
htmltext = "31518-00.htm";
@@ -102,19 +109,23 @@ public class Q015_SweetWhispers extends Quest
htmltext = "31518-01a.htm";
}
break;
-
+ }
case HIERARCH:
+ {
if (cond == 2)
{
htmltext = "31517-00.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q016_TheComingDarkness/Q016_TheComingDarkness.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q016_TheComingDarkness/Q016_TheComingDarkness.java
index c071211438..84e9786e5e 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q016_TheComingDarkness/Q016_TheComingDarkness.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q016_TheComingDarkness/Q016_TheComingDarkness.java
@@ -38,9 +38,7 @@ public class Q016_TheComingDarkness extends Quest
public Q016_TheComingDarkness()
{
super(16, "The Coming Darkness");
-
registerQuestItems(CRYSTAL_OF_SEAL);
-
addStartNpc(HIERARCH);
addTalkId(HIERARCH, EVIL_ALTAR_1, EVIL_ALTAR_2, EVIL_ALTAR_3, EVIL_ALTAR_4, EVIL_ALTAR_5);
}
@@ -55,42 +53,49 @@ public class Q016_TheComingDarkness extends Quest
return htmltext;
}
- if (event.equals("31517-2.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(CRYSTAL_OF_SEAL, 5);
- }
- else if (event.equals("31512-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRYSTAL_OF_SEAL, 1);
- }
- else if (event.equals("31513-1.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRYSTAL_OF_SEAL, 1);
- }
- else if (event.equals("31514-1.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRYSTAL_OF_SEAL, 1);
- }
- else if (event.equals("31515-1.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRYSTAL_OF_SEAL, 1);
- }
- else if (event.equals("31516-1.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRYSTAL_OF_SEAL, 1);
+ case "31517-2.htm":
+ {
+ st.startQuest();
+ st.giveItems(CRYSTAL_OF_SEAL, 5);
+ break;
+ }
+ case "31512-1.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRYSTAL_OF_SEAL, 1);
+ break;
+ }
+ case "31513-1.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRYSTAL_OF_SEAL, 1);
+ break;
+ }
+ case "31514-1.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRYSTAL_OF_SEAL, 1);
+ break;
+ }
+ case "31515-1.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRYSTAL_OF_SEAL, 1);
+ break;
+ }
+ case "31516-1.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRYSTAL_OF_SEAL, 1);
+ break;
+ }
}
return htmltext;
@@ -109,16 +114,19 @@ public class Q016_TheComingDarkness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 62) ? "31517-0a.htm" : "31517-0.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
switch (npcId)
{
case HIERARCH:
+ {
if (cond == 6)
{
htmltext = "31517-4.htm";
@@ -139,12 +147,13 @@ public class Q016_TheComingDarkness extends Quest
}
}
break;
-
+ }
case EVIL_ALTAR_1:
case EVIL_ALTAR_2:
case EVIL_ALTAR_3:
case EVIL_ALTAR_4:
case EVIL_ALTAR_5:
+ {
final int condAltar = npcId - 31511;
if (cond == condAltar)
{
@@ -162,12 +171,15 @@ public class Q016_TheComingDarkness extends Quest
htmltext = npcId + "-2.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q017_LightAndDarkness/Q017_LightAndDarkness.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q017_LightAndDarkness/Q017_LightAndDarkness.java
index a9c951d31d..2d1c289c07 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q017_LightAndDarkness/Q017_LightAndDarkness.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q017_LightAndDarkness/Q017_LightAndDarkness.java
@@ -24,22 +24,19 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q017_LightAndDarkness extends Quest
{
- // Items
- private static final int BLOOD_OF_SAINT = 7168;
-
// NPCs
private static final int HIERARCH = 31517;
private static final int SAINT_ALTAR_1 = 31508;
private static final int SAINT_ALTAR_2 = 31509;
private static final int SAINT_ALTAR_3 = 31510;
private static final int SAINT_ALTAR_4 = 31511;
+ // Items
+ private static final int BLOOD_OF_SAINT = 7168;
public Q017_LightAndDarkness()
{
super(17, "Light and Darkness");
-
registerQuestItems(BLOOD_OF_SAINT);
-
addStartNpc(HIERARCH);
addTalkId(HIERARCH, SAINT_ALTAR_1, SAINT_ALTAR_2, SAINT_ALTAR_3, SAINT_ALTAR_4);
}
@@ -54,63 +51,69 @@ public class Q017_LightAndDarkness extends Quest
return htmltext;
}
- if (event.equals("31517-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(BLOOD_OF_SAINT, 4);
- }
- else if (event.equals("31508-02.htm"))
- {
- if (st.hasQuestItems(BLOOD_OF_SAINT))
+ case "31517-04.htm":
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_OF_SAINT, 1);
+ st.startQuest();
+ st.giveItems(BLOOD_OF_SAINT, 4);
+ break;
}
- else
+ case "31508-02.htm":
{
- htmltext = "31508-03.htm";
+ if (st.hasQuestItems(BLOOD_OF_SAINT))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_OF_SAINT, 1);
+ }
+ else
+ {
+ htmltext = "31508-03.htm";
+ }
+ break;
}
- }
- else if (event.equals("31509-02.htm"))
- {
- if (st.hasQuestItems(BLOOD_OF_SAINT))
+ case "31509-02.htm":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_OF_SAINT, 1);
+ if (st.hasQuestItems(BLOOD_OF_SAINT))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_OF_SAINT, 1);
+ }
+ else
+ {
+ htmltext = "31509-03.htm";
+ }
+ break;
}
- else
+ case "31510-02.htm":
{
- htmltext = "31509-03.htm";
+ if (st.hasQuestItems(BLOOD_OF_SAINT))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_OF_SAINT, 1);
+ }
+ else
+ {
+ htmltext = "31510-03.htm";
+ }
+ break;
}
- }
- else if (event.equals("31510-02.htm"))
- {
- if (st.hasQuestItems(BLOOD_OF_SAINT))
+ case "31511-02.htm":
{
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_OF_SAINT, 1);
- }
- else
- {
- htmltext = "31510-03.htm";
- }
- }
- else if (event.equals("31511-02.htm"))
- {
- if (st.hasQuestItems(BLOOD_OF_SAINT))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_OF_SAINT, 1);
- }
- else
- {
- htmltext = "31511-03.htm";
+ if (st.hasQuestItems(BLOOD_OF_SAINT))
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_OF_SAINT, 1);
+ }
+ else
+ {
+ htmltext = "31511-03.htm";
+ }
+ break;
}
}
@@ -130,14 +133,17 @@ public class Q017_LightAndDarkness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 61) ? "31517-03.htm" : "31517-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HIERARCH:
+ {
if (cond == 5)
{
htmltext = "31517-07.htm";
@@ -158,8 +164,9 @@ public class Q017_LightAndDarkness extends Quest
}
}
break;
-
+ }
case SAINT_ALTAR_1:
+ {
if (cond == 1)
{
htmltext = "31508-01.htm";
@@ -169,8 +176,9 @@ public class Q017_LightAndDarkness extends Quest
htmltext = "31508-04.htm";
}
break;
-
+ }
case SAINT_ALTAR_2:
+ {
if (cond == 2)
{
htmltext = "31509-01.htm";
@@ -180,8 +188,9 @@ public class Q017_LightAndDarkness extends Quest
htmltext = "31509-04.htm";
}
break;
-
+ }
case SAINT_ALTAR_3:
+ {
if (cond == 3)
{
htmltext = "31510-01.htm";
@@ -191,8 +200,9 @@ public class Q017_LightAndDarkness extends Quest
htmltext = "31510-04.htm";
}
break;
-
+ }
case SAINT_ALTAR_4:
+ {
if (cond == 4)
{
htmltext = "31511-01.htm";
@@ -202,12 +212,15 @@ public class Q017_LightAndDarkness extends Quest
htmltext = "31511-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q018_MeetingWithTheGoldenRam/Q018_MeetingWithTheGoldenRam.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q018_MeetingWithTheGoldenRam/Q018_MeetingWithTheGoldenRam.java
index 9f714ad046..301a62b3ee 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q018_MeetingWithTheGoldenRam/Q018_MeetingWithTheGoldenRam.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q018_MeetingWithTheGoldenRam/Q018_MeetingWithTheGoldenRam.java
@@ -24,20 +24,18 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q018_MeetingWithTheGoldenRam extends Quest
{
- // Items
- private static final int SUPPLY_BOX = 7245;
-
// NPCs
private static final int DONAL = 31314;
private static final int DAISY = 31315;
private static final int ABERCROMBIE = 31555;
+ // Items
+ private static final int SUPPLY_BOX = 7245;
public Q018_MeetingWithTheGoldenRam()
{
super(18, "Meeting with the Golden Ram");
registerQuestItems(SUPPLY_BOX);
-
addStartNpc(DONAL);
addTalkId(DONAL, DAISY, ABERCROMBIE);
}
@@ -52,25 +50,29 @@ public class Q018_MeetingWithTheGoldenRam extends Quest
return htmltext;
}
- if (event.equals("31314-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31315-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(SUPPLY_BOX, 1);
- }
- else if (event.equals("31555-02.htm"))
- {
- st.takeItems(SUPPLY_BOX, 1);
- st.rewardItems(57, 15000);
- st.rewardExpAndSp(50000, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31314-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31315-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(SUPPLY_BOX, 1);
+ break;
+ }
+ case "31555-02.htm":
+ {
+ st.takeItems(SUPPLY_BOX, 1);
+ st.rewardItems(57, 15000);
+ st.rewardExpAndSp(50000, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -89,18 +91,22 @@ public class Q018_MeetingWithTheGoldenRam extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 66) ? "31314-02.htm" : "31314-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case DONAL:
+ {
htmltext = "31314-04.htm";
break;
-
+ }
case DAISY:
+ {
if (cond == 1)
{
htmltext = "31315-01.htm";
@@ -110,19 +116,23 @@ public class Q018_MeetingWithTheGoldenRam extends Quest
htmltext = "31315-03.htm";
}
break;
-
+ }
case ABERCROMBIE:
+ {
if (cond == 2)
{
htmltext = "31555-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q019_GoToThePastureland/Q019_GoToThePastureland.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q019_GoToThePastureland/Q019_GoToThePastureland.java
index 210cb3659c..650a217e45 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q019_GoToThePastureland/Q019_GoToThePastureland.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q019_GoToThePastureland/Q019_GoToThePastureland.java
@@ -24,19 +24,16 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q019_GoToThePastureland extends Quest
{
- // Items
- private static final int YOUNG_WILD_BEAST_MEAT = 7547;
-
// NPCs
private static final int VLADIMIR = 31302;
private static final int TUNATUN = 31537;
+ // Items
+ private static final int YOUNG_WILD_BEAST_MEAT = 7547;
public Q019_GoToThePastureland()
{
super(19, "Go to the Pastureland!");
-
registerQuestItems(YOUNG_WILD_BEAST_MEAT);
-
addStartNpc(VLADIMIR);
addTalkId(VLADIMIR, TUNATUN);
}
@@ -53,9 +50,7 @@ public class Q019_GoToThePastureland extends Quest
if (event.equals("31302-01.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(YOUNG_WILD_BEAST_MEAT, 1);
}
else if (event.equals("019_finish"))
@@ -89,10 +84,12 @@ public class Q019_GoToThePastureland extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 63) ? "31302-03.htm" : "31302-00.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case VLADIMIR:
@@ -104,10 +101,12 @@ public class Q019_GoToThePastureland extends Quest
break;
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q020_BringUpWithLove/Q020_BringUpWithLove.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q020_BringUpWithLove/Q020_BringUpWithLove.java
index c8d72609b3..d2a3647259 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q020_BringUpWithLove/Q020_BringUpWithLove.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q020_BringUpWithLove/Q020_BringUpWithLove.java
@@ -30,9 +30,7 @@ public class Q020_BringUpWithLove extends Quest
public Q020_BringUpWithLove()
{
super(20, "Bring Up With Love");
-
registerQuestItems(JEWEL_OF_INNOCENCE);
-
addStartNpc(31537); // Tunatun
addTalkId(31537);
}
@@ -49,9 +47,7 @@ public class Q020_BringUpWithLove extends Quest
if (event.equals("31537-09.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31537-12.htm"))
{
@@ -77,11 +73,13 @@ public class Q020_BringUpWithLove extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 65) ? "31537-02.htm" : "31537-01.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 2)
+ {
+ if (st.isCond(2))
{
htmltext = "31537-11.htm";
}
@@ -90,10 +88,12 @@ public class Q020_BringUpWithLove extends Quest
htmltext = "31537-10.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q021_HiddenTruth/Q021_HiddenTruth.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q021_HiddenTruth/Q021_HiddenTruth.java
index c978a00c47..5750423758 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q021_HiddenTruth/Q021_HiddenTruth.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q021_HiddenTruth/Q021_HiddenTruth.java
@@ -36,7 +36,6 @@ public class Q021_HiddenTruth extends Quest
private static final int DOMINIC = 31350;
private static final int BENEDICT = 31349;
private static final int INNOCENTIN = 31328;
-
// Items
private static final int CROSS_OF_EINHASAD = 7140;
private static final int CROSS_OF_EINHASAD_NEXT_QUEST = 7141;
@@ -54,9 +53,7 @@ public class Q021_HiddenTruth extends Quest
public Q021_HiddenTruth()
{
super(21, "Hidden Truth");
-
registerQuestItems(CROSS_OF_EINHASAD);
-
addStartNpc(MYSTERIOUS_WIZARD);
addTalkId(MYSTERIOUS_WIZARD, TOMBSTONE, VON_HELLMAN_DUKE, VON_HELLMAN_PAGE, BROKEN_BOOKSHELF, AGRIPEL, DOMINIC, BENEDICT, INNOCENTIN);
}
@@ -71,87 +68,94 @@ public class Q021_HiddenTruth extends Quest
return htmltext;
}
- if (event.equals("31522-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31523-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- spawnTheDuke(player);
- }
- else if (event.equals("31524-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- spawnThePage(player);
- }
- else if (event.equals("31526-08.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31526-14.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CROSS_OF_EINHASAD, 1);
- }
- else if (event.equals("1"))
- {
- _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[0]);
- _page.broadcastNpcSay("Follow me...");
- startQuestTimer("2", 5000, _page, player, false);
- return null;
- }
- else if (event.equals("2"))
- {
- _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[1]);
- startQuestTimer("3", 12000, _page, player, false);
- return null;
- }
- else if (event.equals("3"))
- {
- _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[2]);
- startQuestTimer("4", 18000, _page, player, false);
- return null;
- }
- else if (event.equals("4"))
- {
- st.set("end_walk", "1");
- _page.broadcastNpcSay("Please check this bookcase, " + player.getName() + ".");
- startQuestTimer("5", 47000, _page, player, false);
- return null;
- }
- else if (event.equals("5"))
- {
- _page.broadcastNpcSay("I'm confused! Maybe it's time to go back.");
- return null;
- }
- else if (event.equals("31328-05.htm"))
- {
- if (st.hasQuestItems(CROSS_OF_EINHASAD))
+ case "31522-02.htm":
{
- st.takeItems(CROSS_OF_EINHASAD, 1);
- st.giveItems(CROSS_OF_EINHASAD_NEXT_QUEST, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.startQuest();
+ break;
+ }
+ case "31523-03.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ spawnTheDuke(player);
+ break;
+ }
+ case "31524-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ spawnThePage(player);
+ break;
+ }
+ case "31526-08.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31526-14.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CROSS_OF_EINHASAD, 1);
+ break;
+ }
+ case "1":
+ {
+ _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[0]);
+ _page.broadcastNpcSay("Follow me...");
+ startQuestTimer("2", 5000, _page, player, false);
+ return null;
+ }
+ case "2":
+ {
+ _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[1]);
+ startQuestTimer("3", 12000, _page, player, false);
+ return null;
+ }
+ case "3":
+ {
+ _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[2]);
+ startQuestTimer("4", 18000, _page, player, false);
+ return null;
+ }
+ case "4":
+ {
+ st.set("end_walk", "1");
+ _page.broadcastNpcSay("Please check this bookcase, " + player.getName() + ".");
+ startQuestTimer("5", 47000, _page, player, false);
+ return null;
+ }
+ case "5":
+ {
+ _page.broadcastNpcSay("I'm confused! Maybe it's time to go back.");
+ return null;
+ }
+ case "31328-05.htm":
+ {
+ if (st.hasQuestItems(CROSS_OF_EINHASAD))
+ {
+ st.takeItems(CROSS_OF_EINHASAD, 1);
+ st.giveItems(CROSS_OF_EINHASAD_NEXT_QUEST, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
+ }
+ case "dukeDespawn":
+ {
+ _duke.deleteMe();
+ _duke = null;
+ return null;
+ }
+ case "pageDespawn":
+ {
+ _page.deleteMe();
+ _page = null;
+ return null;
}
- }
- else if (event.equals("dukeDespawn"))
- {
- _duke.deleteMe();
- _duke = null;
- return null;
- }
- else if (event.equals("pageDespawn"))
- {
- _page.deleteMe();
- _page = null;
- return null;
}
return htmltext;
@@ -170,18 +174,22 @@ public class Q021_HiddenTruth extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 63) ? "31522-03.htm" : "31522-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MYSTERIOUS_WIZARD:
+ {
htmltext = "31522-05.htm";
break;
-
+ }
case TOMBSTONE:
+ {
if (cond == 1)
{
htmltext = "31523-01.htm";
@@ -196,8 +204,9 @@ public class Q021_HiddenTruth extends Quest
htmltext = "31523-04.htm";
}
break;
-
+ }
case VON_HELLMAN_DUKE:
+ {
if (cond == 2)
{
htmltext = "31524-01.htm";
@@ -212,14 +221,15 @@ public class Q021_HiddenTruth extends Quest
htmltext = "31524-07a.htm";
}
break;
-
+ }
case VON_HELLMAN_PAGE:
+ {
if (cond == 3)
{
if (st.getInt("end_walk") == 1)
{
htmltext = "31525-02.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -232,12 +242,13 @@ public class Q021_HiddenTruth extends Quest
htmltext = "31525-02.htm";
}
break;
-
+ }
case BROKEN_BOOKSHELF:
+ {
if (((cond == 3) && (st.getInt("end_walk") == 1)) || (cond == 4))
{
htmltext = "31526-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
if (_page != null)
@@ -264,10 +275,11 @@ public class Q021_HiddenTruth extends Quest
htmltext = "31526-15.htm";
}
break;
-
+ }
case AGRIPEL:
case BENEDICT:
case DOMINIC:
+ {
if (((cond == 6) || (cond == 7)) && st.hasQuestItems(CROSS_OF_EINHASAD))
{
final int npcId = npc.getNpcId();
@@ -295,7 +307,7 @@ public class Q021_HiddenTruth extends Quest
if ((st.getInt(String.valueOf(npcId1)) == 1) && (st.getInt(String.valueOf(npcId2)) == 1))
{
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -307,17 +319,20 @@ public class Q021_HiddenTruth extends Quest
htmltext = npcId + "-01.htm";
}
break;
-
+ }
case INNOCENTIN:
+ {
if ((cond == 7) && st.hasQuestItems(CROSS_OF_EINHASAD))
{
htmltext = "31328-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
if (npc.getNpcId() == INNOCENTIN)
{
htmltext = "31328-06.htm";
@@ -327,6 +342,7 @@ public class Q021_HiddenTruth extends Quest
htmltext = getAlreadyCompletedMsg();
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q022_TragedyInVonHellmannForest/Q022_TragedyInVonHellmannForest.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q022_TragedyInVonHellmannForest/Q022_TragedyInVonHellmannForest.java
index 2f31ba52e2..2f3ab6066e 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q022_TragedyInVonHellmannForest/Q022_TragedyInVonHellmannForest.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q022_TragedyInVonHellmannForest/Q022_TragedyInVonHellmannForest.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.QuestTimer;
-import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.util.Util;
import quests.Q021_HiddenTruth.Q021_HiddenTruth;
@@ -38,7 +37,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
private static final int WELL = 31527;
private static final int GHOST_OF_PRIEST = 31528;
private static final int GHOST_OF_ADVENTURER = 31529;
- // Mobs
+ // Monsters
private static final int[] MOBS =
{
21553, // Trampled Man
@@ -66,7 +65,6 @@ public class Q022_TragedyInVonHellmannForest extends Quest
public Q022_TragedyInVonHellmannForest()
{
super(22, "Tragedy in von Hellmann Forest");
-
addKillId(MOBS);
addKillId(SOUL_OF_WELL);
addAttackId(SOUL_OF_WELL);
@@ -135,9 +133,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
{
if (qs.isCreated())
{
- qs.setState(State.STARTED);
- qs.set("cond", "1");
- qs.playSound(QuestState.SOUND_ACCEPT);
+ qs.startQuest();
htmltext = event;
}
break;
@@ -146,21 +142,21 @@ public class Q022_TragedyInVonHellmannForest extends Quest
{
if (!qs.hasQuestItems(CROSS_OF_EINHASAD))
{
- qs.set("cond", "2");
+ qs.setCond(2);
htmltext = event;
}
else
{
htmltext = "31334-06.htm";
- qs.set("cond", "3");
+ qs.setCond(3);
}
break;
}
case "31334-08.htm":
{
- if (qs.getInt("cond") == 3)
+ if (qs.isCond(3))
{
- qs.set("cond", "4");
+ qs.setCond(4);
qs.playSound(QuestState.SOUND_MIDDLE);
htmltext = event;
}
@@ -168,7 +164,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31334-13.htm":
{
- final int cond = qs.getInt("cond");
+ final int cond = qs.getCond();
if (((5 <= cond) && (cond <= 7)) && qs.hasQuestItems(CROSS_OF_EINHASAD))
{
if (_tifarenOwner == 0)
@@ -181,14 +177,14 @@ public class Q022_TragedyInVonHellmannForest extends Quest
if (((cond == 5) || (cond == 6)) && qs.hasQuestItems(LOST_SKULL_OF_ELF))
{
qs.takeItems(LOST_SKULL_OF_ELF, -1);
- qs.set("cond", "7");
+ qs.setCond(7);
qs.playSound(QuestState.SOUND_MIDDLE);
}
htmltext = event;
}
else
{
- qs.set("cond", "6");
+ qs.setCond(6);
htmltext = "31334-14.htm";
}
}
@@ -211,7 +207,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
qt.cancel();
npc.setScriptValue(0);
startQuestTimer("DESPAWN_GHOST2", 1000 * 3, npc, player);
- qs.set("cond", "8");
+ qs.setCond(8);
qs.playSound(QuestState.SOUND_MIDDLE);
htmltext = event;
}
@@ -229,7 +225,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31328-03.htm":
{
- if (qs.getInt("cond") == 8)
+ if (qs.isCond(8))
{
qs.takeItems(CROSS_OF_EINHASAD, -1);
@@ -239,10 +235,10 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31328-09.htm":
{
- if (qs.getInt("cond") == 8)
+ if (qs.isCond(8))
{
qs.giveItems(LETTER_OF_INNOCENTIN, 1);
- qs.set("cond", "9");
+ qs.setCond(9);
qs.playSound(QuestState.SOUND_MIDDLE);
htmltext = event;
}
@@ -250,10 +246,10 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31328-11.htm":
{
- if ((qs.getInt("cond") == 14) && qs.hasQuestItems(REPORT_BOX))
+ if (qs.isCond(14) && qs.hasQuestItems(REPORT_BOX))
{
qs.takeItems(REPORT_BOX, -1);
- qs.set("cond", "15");
+ qs.setCond(15);
qs.playSound(QuestState.SOUND_MIDDLE);
htmltext = event;
}
@@ -261,9 +257,9 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31328-19.htm":
{
- if (qs.getInt("cond") == 15)
+ if (qs.isCond(15))
{
- qs.set("cond", "16");
+ qs.setCond(16);
qs.playSound(QuestState.SOUND_MIDDLE);
htmltext = event;
}
@@ -271,7 +267,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31527-02.htm":
{
- if ((qs.getInt("cond") == 10) && (_soulWellNpc == null))
+ if (qs.isCond(10) && (_soulWellNpc == null))
{
_soulWellNpc = addSpawn(SOUL_OF_WELL, SOUL_WELL_LOC, true, 0);
startQuestTimer("activateSoulOfWell", 90000, _soulWellNpc, player);
@@ -304,7 +300,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31529-03.htm":
{
- if ((qs.getInt("cond") == 9) && qs.hasQuestItems(LETTER_OF_INNOCENTIN))
+ if (qs.isCond(9) && qs.hasQuestItems(LETTER_OF_INNOCENTIN))
{
qs.set("memoState", "8");
htmltext = event;
@@ -325,7 +321,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
if (qs.getInt("memoState") == 9)
{
qs.giveItems(JEWEL_OF_ADVENTURER_1, 1);
- qs.set("cond", "10");
+ qs.setCond(10);
qs.playSound(QuestState.SOUND_MIDDLE);
qs.set("memoState", "10");
htmltext = event;
@@ -345,7 +341,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
{
case TIFAREN:
{
- switch (qs.getInt("cond"))
+ switch (qs.getCond())
{
case 0:
{
@@ -401,7 +397,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
else
{
htmltext = "31334-16.htm";
- qs.set("cond", "6");
+ qs.setCond(6);
}
}
break;
@@ -431,14 +427,14 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case INNOCENTIN:
{
- switch (qs.getInt("cond"))
+ switch (qs.getCond())
{
case 2:
{
if (!qs.hasQuestItems(CROSS_OF_EINHASAD))
{
qs.giveItems(CROSS_OF_EINHASAD, 1);
- qs.set("cond", "3");
+ qs.setCond(3);
htmltext = "31328-01.htm";
}
break;
@@ -500,7 +496,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case WELL:
{
- switch (qs.getInt("cond"))
+ switch (qs.getCond())
{
case 10:
{
@@ -516,7 +512,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
if (qs.hasQuestItems(JEWEL_OF_ADVENTURER_2) && !qs.hasQuestItems(SEALED_REPORT_BOX))
{
qs.giveItems(SEALED_REPORT_BOX, 1);
- qs.set("cond", "13");
+ qs.setCond(13);
htmltext = "31527-04.htm";
}
break;
@@ -534,7 +530,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case GHOST_OF_ADVENTURER:
{
- switch (qs.getInt("cond"))
+ switch (qs.getCond())
{
case 9:
{
@@ -586,7 +582,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
if (qs.hasQuestItems(JEWEL_OF_ADVENTURER_2) && !qs.hasQuestItems(SEALED_REPORT_BOX))
{
htmltext = "31529-15.htm";
- qs.set("cond", "12");
+ qs.setCond(12);
}
break;
}
@@ -597,7 +593,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
qs.giveItems(REPORT_BOX, 1);
qs.takeItems(SEALED_REPORT_BOX, -1);
qs.takeItems(JEWEL_OF_ADVENTURER_2, -1);
- qs.set("cond", "14");
+ qs.setCond(14);
htmltext = "31529-16.htm";
}
break;
@@ -621,7 +617,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isSummon)
{
final QuestState qs = attacker.getQuestState(getName());
- if ((qs != null) && (qs.getInt("cond") == 10) && qs.hasQuestItems(JEWEL_OF_ADVENTURER_1))
+ if ((qs != null) && qs.isCond(10) && qs.hasQuestItems(JEWEL_OF_ADVENTURER_1))
{
if (qs.getInt("memoState") == 10)
{
@@ -631,7 +627,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
{
qs.takeItems(JEWEL_OF_ADVENTURER_1, -1);
qs.giveItems(JEWEL_OF_ADVENTURER_2, 1);
- qs.set("cond", "11");
+ qs.setCond(11);
}
}
return super.onAttack(npc, attacker, damage, isSummon);
@@ -649,10 +645,10 @@ public class Q022_TragedyInVonHellmannForest extends Quest
else
{
final QuestState qs = killer.getQuestState(getName());
- if ((qs != null) && (qs.getInt("cond") == 4) && qs.hasQuestItems(CROSS_OF_EINHASAD) && !qs.hasQuestItems(LOST_SKULL_OF_ELF) && (Rnd.get(100) < 10))
+ if ((qs != null) && qs.isCond(4) && qs.hasQuestItems(CROSS_OF_EINHASAD) && !qs.hasQuestItems(LOST_SKULL_OF_ELF) && (Rnd.get(100) < 10))
{
qs.giveItems(LOST_SKULL_OF_ELF, 1);
- qs.set("cond", "5");
+ qs.setCond(5);
}
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q023_LidiasHeart/Q023_LidiasHeart.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q023_LidiasHeart/Q023_LidiasHeart.java
index 245e00afeb..7a328fc142 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q023_LidiasHeart/Q023_LidiasHeart.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q023_LidiasHeart/Q023_LidiasHeart.java
@@ -64,105 +64,117 @@ public class Q023_LidiasHeart extends Quest
return htmltext;
}
- if (event.equals("31328-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(FOREST_OF_DEADMAN_MAP, 1);
- st.giveItems(SILVER_KEY, 1);
- }
- else if (event.equals("31328-06.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31526-05.htm"))
- {
- if (!st.hasQuestItems(LIDIA_HAIRPIN))
+ case "31328-02.htm":
{
- st.giveItems(LIDIA_HAIRPIN, 1);
- if (st.hasQuestItems(LIDIA_DIARY))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- }
+ st.startQuest();
+ st.giveItems(FOREST_OF_DEADMAN_MAP, 1);
+ st.giveItems(SILVER_KEY, 1);
+ break;
}
- }
- else if (event.equals("31526-11.htm"))
- {
- if (!st.hasQuestItems(LIDIA_DIARY))
+ case "31328-06.htm":
{
- st.giveItems(LIDIA_DIARY, 1);
- if (st.hasQuestItems(LIDIA_HAIRPIN))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- }
- }
- else if (event.equals("31328-11.htm"))
- {
- if (st.getInt("cond") < 5)
- {
- st.set("cond", "5");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("31328-19.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31524-04.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LIDIA_DIARY, 1);
- }
- else if (event.equals("31523-02.htm"))
- {
- if (_ghost == null)
+ case "31526-05.htm":
{
- _ghost = addSpawn(31524, 51432, -54570, -3136, 0, false, 60000);
- _ghost.broadcastNpcSay("Who awoke me?");
- startQuestTimer("ghost_cleanup", 58000, null, player, false);
+ if (!st.hasQuestItems(LIDIA_HAIRPIN))
+ {
+ st.giveItems(LIDIA_HAIRPIN, 1);
+ if (st.hasQuestItems(LIDIA_DIARY))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ }
+ break;
}
- }
- else if (event.equals("31523-05.htm"))
- {
- // Don't launch twice the same task...
- if (getQuestTimer("tomb_digger", null, player) == null)
+ case "31526-11.htm":
{
- startQuestTimer("tomb_digger", 10000, null, player, false);
+ if (!st.hasQuestItems(LIDIA_DIARY))
+ {
+ st.giveItems(LIDIA_DIARY, 1);
+ if (st.hasQuestItems(LIDIA_HAIRPIN))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ }
+ break;
+ }
+ case "31328-11.htm":
+ {
+ if (st.getCond() < 5)
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
+ }
+ case "31328-19.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31524-04.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LIDIA_DIARY, 1);
+ break;
+ }
+ case "31523-02.htm":
+ {
+ if (_ghost == null)
+ {
+ _ghost = addSpawn(31524, 51432, -54570, -3136, 0, false, 60000);
+ _ghost.broadcastNpcSay("Who awoke me?");
+ startQuestTimer("ghost_cleanup", 58000, null, player, false);
+ }
+ break;
+ }
+ case "31523-05.htm":
+ {
+ // Don't launch twice the same task...
+ if (getQuestTimer("tomb_digger", null, player) == null)
+ {
+ startQuestTimer("tomb_digger", 10000, null, player, false);
+ }
+ break;
+ }
+ case "tomb_digger":
+ {
+ htmltext = "31523-06.htm";
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(SILVER_KEY, 1);
+ break;
+ }
+ case "31530-02.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SILVER_KEY, 1);
+ st.giveItems(SILVER_SPEAR, 1);
+ break;
+ }
+ case "ghost_cleanup":
+ {
+ _ghost = null;
+ return null;
}
- }
- else if (event.equals("tomb_digger"))
- {
- htmltext = "31523-06.htm";
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(SILVER_KEY, 1);
- }
- else if (event.equals("31530-02.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SILVER_KEY, 1);
- st.giveItems(SILVER_SPEAR, 1);
- }
- else if (event.equals("ghost_cleanup"))
- {
- _ghost = null;
- return null;
}
return htmltext;
}
@@ -180,6 +192,7 @@ public class Q023_LidiasHeart extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
final QuestState st2 = player.getQuestState(Q022_TragedyInVonHellmannForest.class.getSimpleName());
if ((st2 != null) && st2.isCompleted())
{
@@ -197,12 +210,14 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31328-00.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case INNOCENTIN:
+ {
if (cond == 1)
{
htmltext = "31328-03.htm";
@@ -224,12 +239,13 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31328-21.htm";
}
break;
-
+ }
case BROKEN_BOOKSHELF:
+ {
if (cond == 2)
{
htmltext = "31526-00.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 3)
@@ -248,8 +264,9 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31526-13.htm";
}
break;
-
+ }
case GHOST_OF_VON_HELLMANN:
+ {
if (cond == 6)
{
htmltext = "31524-01.htm";
@@ -259,8 +276,9 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31524-05.htm";
}
break;
-
+ }
case TOMBSTONE:
+ {
if (cond == 6)
{
htmltext = (_ghost == null) ? "31523-01.htm" : "31523-03.htm";
@@ -274,12 +292,13 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31523-06.htm";
}
break;
-
+ }
case VIOLET:
+ {
if (cond == 8)
{
htmltext = "31386-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 9)
@@ -299,12 +318,13 @@ public class Q023_LidiasHeart extends Quest
else
{
htmltext = "31386-02.htm";
- st.set("cond", "9");
+ st.setCond(9);
}
}
break;
-
+ }
case BOX:
+ {
if (cond == 9)
{
htmltext = "31530-01.htm";
@@ -314,10 +334,12 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31530-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
if (npc.getNpcId() == VIOLET)
{
htmltext = "31386-04.htm";
@@ -327,6 +349,7 @@ public class Q023_LidiasHeart extends Quest
htmltext = getAlreadyCompletedMsg();
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForestOfTheDead/Q024_InhabitantsOfTheForestOfTheDead.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForestOfTheDead/Q024_InhabitantsOfTheForestOfTheDead.java
index e3ef4a3414..5b5047880d 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForestOfTheDead/Q024_InhabitantsOfTheForestOfTheDead.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForestOfTheDead/Q024_InhabitantsOfTheForestOfTheDead.java
@@ -67,105 +67,122 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
@Override
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{
- String htmltext = event;
QuestState st = player.getQuestState(getName());
if (st == null)
{
return event;
}
- if (event.equals("31389-03.htm"))
+
+ String htmltext = event;
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("state", "1");
- st.playSound("ItemSound.quest_accept");
- st.giveItems(FLOWER, 1);
- }
- else if (event.equals("31389-08.htm"))
- {
- st.set("state", "3");
- }
- else if (event.equals("31389-13.htm"))
- {
- st.set("cond", "3");
- st.set("state", "4");
- st.playSound("ItemSound.quest_middle");
- st.giveItems(SILVER_CROSS, 1);
- }
- else if (event.equals("31389-18.htm"))
- {
- st.playSound("InterfaceSound.charstat_open_01");
- }
- else if (event.equals("31389-19.htm"))
- {
- st.set("cond", "5");
- st.set("state", "5");
- st.takeItems(BROKEN_SILVER_CROSS, -1);
- st.playSound("ItemSound.quest_middle");
- }
- else if (event.equals("31522-03.htm"))
- {
- st.set("state", "12");
- st.takeItems(TOTEM, -1);
- }
- else if (event.equals("31522-08.htm"))
- {
- st.set("cond", "11");
- st.set("state", "13");
- st.playSound("ItemSound.quest_middle");
- }
- else if (event.equals("31522-17.htm"))
- {
- st.set("state", "14");
- }
- else if (event.equals("31522-21.htm"))
- {
- st.giveItems(SUSPICIOUS_TOTEM, 1);
- st.playSound("ItemSound.quest_finish");
- st.exitQuest(false);
- }
- else if (event.equals("31532-04.htm"))
- {
- st.set("cond", "6");
- st.set("state", "6");
- st.giveItems(LETTER, 1);
- st.playSound("ItemSound.quest_middle");
- }
- else if (event.equals("31532-06.htm"))
- {
- if (st.hasQuestItems(HAIRPIN))
+ case "31389-03.htm":
{
- st.set("state", "8");
- st.takeItems(LETTER, -1);
- st.takeItems(HAIRPIN, -1);
+ st.startQuest();
+ st.set("state", "1");
+ st.giveItems(FLOWER, 1);
+ break;
}
- else
+ case "31389-08.htm":
{
- st.set("cond", "7");
- st.set("state", "7");
- htmltext = "31532-07.htm";
+ st.set("state", "3");
+ break;
+ }
+ case "31389-13.htm":
+ {
+ st.setCond(3);
+ st.set("state", "4");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(SILVER_CROSS, 1);
+ break;
+ }
+ case "31389-18.htm":
+ {
+ st.playSound("InterfaceSound.charstat_open_01");
+ break;
+ }
+ case "31389-19.htm":
+ {
+ st.setCond(5);
+ st.set("state", "5");
+ st.takeItems(BROKEN_SILVER_CROSS, -1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31522-03.htm":
+ {
+ st.set("state", "12");
+ st.takeItems(TOTEM, -1);
+ break;
+ }
+ case "31522-08.htm":
+ {
+ st.setCond(11);
+ st.set("state", "13");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31522-17.htm":
+ {
+ st.set("state", "14");
+ break;
+ }
+ case "31522-21.htm":
+ {
+ st.giveItems(SUSPICIOUS_TOTEM, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "31532-04.htm":
+ {
+ st.setCond(6);
+ st.set("state", "6");
+ st.giveItems(LETTER, 1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31532-06.htm":
+ {
+ if (st.hasQuestItems(HAIRPIN))
+ {
+ st.set("state", "8");
+ st.takeItems(LETTER, -1);
+ st.takeItems(HAIRPIN, -1);
+ }
+ else
+ {
+ st.setCond(7);
+ st.set("state", "7");
+ htmltext = "31532-07.htm";
+ }
+ break;
+ }
+ case "31532-10.htm":
+ {
+ st.set("state", "9");
+ break;
+ }
+ case "31532-14.htm":
+ {
+ st.set("state", "10");
+ break;
+ }
+ case "31532-19.htm":
+ {
+ st.setCond(9);
+ st.set("state", "11");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31531-02.htm":
+ {
+ st.setCond(2);
+ st.set("state", "2");
+ st.takeItems(FLOWER, -1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("31532-10.htm"))
- {
- st.set("state", "9");
- }
- else if (event.equals("31532-14.htm"))
- {
- st.set("state", "10");
- }
- else if (event.equals("31532-19.htm"))
- {
- st.set("cond", "9");
- st.set("state", "11");
- st.playSound("ItemSound.quest_middle");
- }
- else if (event.equals("31531-02.htm"))
- {
- st.set("cond", "2");
- st.set("state", "2");
- st.takeItems(FLOWER, -1);
- st.playSound("ItemSound.quest_middle");
}
return htmltext;
@@ -175,15 +192,17 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
public String onTalk(NpcInstance npc, PlayerInstance player)
{
String htmltext = getNoQuestMsg();
- QuestState st = player.getQuestState(getName());
+ final QuestState st = player.getQuestState(getName());
if (st == null)
{
return htmltext;
}
+
switch (st.getState())
{
case State.CREATED:
- QuestState st2 = player.getQuestState(Q023_LidiasHeart.class.getSimpleName());
+ {
+ final QuestState st2 = player.getQuestState(Q023_LidiasHeart.class.getSimpleName());
if ((st2 != null) && st2.isCompleted() && (player.getLevel() >= 65))
{
htmltext = "31389-01.htm";
@@ -193,11 +212,14 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
htmltext = "31389-02.htm";
}
break;
+ }
case State.STARTED:
+ {
int state = st.getInt("state");
switch (npc.getNpcId())
{
case 31389:
+ {
if (state == 1)
{
htmltext = "31389-04.htm";
@@ -237,9 +259,9 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
if ((state == 7) && !st.hasQuestItems(HAIRPIN))
{
htmltext = "31389-21.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.giveItems(HAIRPIN, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
}
else if (((state == 7) && st.hasQuestItems(HAIRPIN)) || (state == 6))
{
@@ -249,7 +271,9 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
return htmltext;
}
+ }
case 31522:
+ {
if ((state == 11) && st.hasQuestItems(TOTEM))
{
htmltext = "31522-01.htm";
@@ -274,7 +298,9 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
return htmltext;
}
+ }
case 31531:
+ {
if ((state == 1) && st.hasQuestItems(FLOWER))
{
htmltext = "31531-01.htm";
@@ -287,7 +313,9 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
}
return htmltext;
+ }
case 31532:
+ {
if (state == 5)
{
htmltext = "31532-01.htm";
@@ -327,10 +355,15 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
return htmltext;
}
+ }
default:
+ {
return htmltext;
+ }
}
+ }
case State.COMPLETED:
+ {
if (npc.getNpcId() == 31522)
{
htmltext = "31522-22.htm";
@@ -339,6 +372,7 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
{
htmltext = getAlreadyCompletedMsg();
}
+ }
}
return htmltext;
@@ -359,7 +393,7 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
{
qs.takeItems(SILVER_CROSS, -1);
qs.giveItems(BROKEN_SILVER_CROSS, 1);
- qs.set("cond", "4");
+ qs.setCond(4);
for (PlayerInstance nearby : npc.getKnownList().getKnownPlayers().values())
{
nearby.sendPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "That sign!"));
@@ -372,7 +406,7 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isSummon)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "9");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 9);
if (partyMember == null)
{
return null;
@@ -385,7 +419,7 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
}
if (st.dropItems(TOTEM, 1, 1, 100000))
{
- st.set("cond", "10");
+ st.setCond(10);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java
index 74c41c00e5..652dfd0e6d 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java
@@ -55,7 +55,6 @@ public class Q025_HidingBehindTheTruth extends Quest
public Q025_HidingBehindTheTruth()
{
super(25, "Hiding Behind the Truth");
-
addStartNpc(BENEDICT);
addTalkId(AGRIPEL, BENEDICT, BOOKSHELF, BOOKSHELF2, BOOKSHELF3, WIZARD, LIDIA, TOMBSTONE, COFFIN);
addKillId(TRIOL);
@@ -76,9 +75,7 @@ public class Q025_HidingBehindTheTruth extends Quest
{
case "31349-02.htm":
{
- qs.playSound("ItemSound.quest_accept");
- qs.set("cond", "1");
- qs.setState(State.STARTED);
+ qs.startQuest();
break;
}
case "31349-03.htm":
@@ -89,15 +86,15 @@ public class Q025_HidingBehindTheTruth extends Quest
}
else
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "2");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(2);
}
break;
}
case "31349-10.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "4");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(4);
break;
}
case "31348-02.htm":
@@ -107,15 +104,15 @@ public class Q025_HidingBehindTheTruth extends Quest
}
case "31348-07.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "5");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(5);
qs.giveItems(GEMSTONE_KEY, 1);
break;
}
case "31522-04.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "6");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(6);
break;
}
case "31535-03.htm":
@@ -128,8 +125,8 @@ public class Q025_HidingBehindTheTruth extends Quest
triol.setRunning();
((Attackable) triol).addDamageHate(player, 0, 999);
triol.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "7");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(7);
}
else if (qs.getInt("step") == 2)
{
@@ -141,8 +138,8 @@ public class Q025_HidingBehindTheTruth extends Quest
{
qs.giveItems(CONTRACT, 1);
qs.takeItems(GEMSTONE_KEY, -1);
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "9");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(9);
break;
}
case "31532-02.htm":
@@ -152,27 +149,27 @@ public class Q025_HidingBehindTheTruth extends Quest
}
case "31532-06.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "11");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(11);
break;
}
case "31531-02.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "12");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(12);
qs.addSpawn(COFFIN, 60104, -35820, -664, 20000);
break;
}
case "31532-18.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "15");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(15);
break;
}
case "31522-12.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "16");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(16);
}
break;
case "31348-10.htm":
@@ -182,14 +179,14 @@ public class Q025_HidingBehindTheTruth extends Quest
}
case "31348-15.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "17");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(17);
break;
}
case "31348-16.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "18");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(18);
break;
}
case "31532-20.htm":
@@ -200,7 +197,7 @@ public class Q025_HidingBehindTheTruth extends Quest
qs.rewardExpAndSp(572277, 53750);
qs.unset("cond");
qs.exitQuest(true);
- qs.playSound("ItemSound.quest_finish");
+ qs.playSound(QuestState.SOUND_FINISH);
break;
}
case "31522-15.htm":
@@ -211,7 +208,7 @@ public class Q025_HidingBehindTheTruth extends Quest
qs.rewardExpAndSp(572277, 53750);
qs.unset("cond");
qs.exitQuest(true);
- qs.playSound("ItemSound.quest_finish");
+ qs.playSound(QuestState.SOUND_FINISH);
break;
}
}
@@ -231,7 +228,7 @@ public class Q025_HidingBehindTheTruth extends Quest
final int npcId = npc.getNpcId();
final int id = qs.getState();
- final int cond = qs.getInt("cond");
+ final int cond = qs.getCond();
if (id == State.COMPLETED)
{
htmltext = getAlreadyCompletedMsg();
@@ -276,8 +273,8 @@ public class Q025_HidingBehindTheTruth extends Quest
if (cond == 2)
{
htmltext = "31522-01.htm";
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "3");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(3);
qs.giveItems(SUSPICIOUS_TOTEM, 1);
}
else if (cond == 3)
@@ -295,8 +292,8 @@ public class Q025_HidingBehindTheTruth extends Quest
else if (cond == 9)
{
htmltext = "31522-05.htm";
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "10");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(10);
}
else if (cond == 10)
{
@@ -380,7 +377,7 @@ public class Q025_HidingBehindTheTruth extends Quest
else if (cond == 13)
{
htmltext = "31532-07.htm";
- qs.set("cond", "14");
+ qs.setCond(14);
qs.takeItems(DRESS, -1);
}
else if (cond == 14)
@@ -417,8 +414,8 @@ public class Q025_HidingBehindTheTruth extends Quest
{
htmltext = "31536-01.htm";
qs.giveItems(DRESS, 1);
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "13");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(13);
npc.deleteMe();
}
}
@@ -435,10 +432,10 @@ public class Q025_HidingBehindTheTruth extends Quest
return null;
}
- if ((qs.getState() == State.STARTED) && (qs.getInt("cond") == 7))
+ if ((qs.getState() == State.STARTED) && qs.isCond(7))
{
- qs.playSound("ItemSound.quest_itemget");
- qs.set("cond", "8");
+ qs.playSound(QuestState.SOUND_ITEMGET);
+ qs.setCond(8);
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "You've ended my immortal life! You've protected by the feudal lord, aren't you?"));
qs.giveItems(TOTEM_DOLL, 1);
qs.set("step", "2");
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q027_ChestCaughtWithABaitOfWind/Q027_ChestCaughtWithABaitOfWind.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q027_ChestCaughtWithABaitOfWind/Q027_ChestCaughtWithABaitOfWind.java
index e05247f7d4..c722f9963c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q027_ChestCaughtWithABaitOfWind/Q027_ChestCaughtWithABaitOfWind.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q027_ChestCaughtWithABaitOfWind/Q027_ChestCaughtWithABaitOfWind.java
@@ -55,38 +55,42 @@ public class Q027_ChestCaughtWithABaitOfWind extends Quest
return htmltext;
}
- if (event.equals("31570-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31570-07.htm"))
- {
- if (st.hasQuestItems(LARGE_BLUE_TREASURE_CHEST))
+ case "31570-04.htm":
{
- st.set("cond", "2");
- st.takeItems(LARGE_BLUE_TREASURE_CHEST, 1);
- st.giveItems(STRANGE_BLUEPRINT, 1);
+ st.startQuest();
+ break;
}
- else
+ case "31570-07.htm":
{
- htmltext = "31570-08.htm";
+ if (st.hasQuestItems(LARGE_BLUE_TREASURE_CHEST))
+ {
+ st.setCond(2);
+ st.takeItems(LARGE_BLUE_TREASURE_CHEST, 1);
+ st.giveItems(STRANGE_BLUEPRINT, 1);
+ }
+ else
+ {
+ htmltext = "31570-08.htm";
+ }
+ break;
}
- }
- else if (event.equals("31434-02.htm"))
- {
- if (st.hasQuestItems(STRANGE_BLUEPRINT))
+ case "31434-02.htm":
{
- htmltext = "31434-02.htm";
- st.takeItems(STRANGE_BLUEPRINT, 1);
- st.giveItems(BLACK_PEARL_RING, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = "31434-03.htm";
+ if (st.hasQuestItems(STRANGE_BLUEPRINT))
+ {
+ htmltext = "31434-02.htm";
+ st.takeItems(STRANGE_BLUEPRINT, 1);
+ st.giveItems(BLACK_PEARL_RING, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "31434-03.htm";
+ }
+ break;
}
}
@@ -106,6 +110,7 @@ public class Q027_ChestCaughtWithABaitOfWind extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 27)
{
htmltext = "31570-02.htm";
@@ -123,12 +128,14 @@ public class Q027_ChestCaughtWithABaitOfWind extends Quest
}
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LANOSCO:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(LARGE_BLUE_TREASURE_CHEST)) ? "31570-06.htm" : "31570-05.htm";
@@ -138,19 +145,23 @@ public class Q027_ChestCaughtWithABaitOfWind extends Quest
htmltext = "31570-09.htm";
}
break;
-
+ }
case SHALING:
+ {
if (cond == 2)
{
htmltext = "31434-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q028_ChestCaughtWithABaitOfIcyAir/Q028_ChestCaughtWithABaitOfIcyAir.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q028_ChestCaughtWithABaitOfIcyAir/Q028_ChestCaughtWithABaitOfIcyAir.java
index b8d395c70f..e17e87aa31 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q028_ChestCaughtWithABaitOfIcyAir/Q028_ChestCaughtWithABaitOfIcyAir.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q028_ChestCaughtWithABaitOfIcyAir/Q028_ChestCaughtWithABaitOfIcyAir.java
@@ -29,7 +29,6 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
// NPCs
private static final int OFULLE = 31572;
private static final int KIKI = 31442;
-
// Items
private static final int BIG_YELLOW_TREASURE_CHEST = 6503;
private static final int KIKI_LETTER = 7626;
@@ -38,9 +37,7 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
public Q028_ChestCaughtWithABaitOfIcyAir()
{
super(28, "Chest caught with a bait of icy air");
-
registerQuestItems(KIKI_LETTER);
-
addStartNpc(OFULLE);
addTalkId(OFULLE, KIKI);
}
@@ -55,38 +52,42 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
return htmltext;
}
- if (event.equals("31572-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31572-07.htm"))
- {
- if (st.hasQuestItems(BIG_YELLOW_TREASURE_CHEST))
+ case "31572-04.htm":
{
- st.set("cond", "2");
- st.takeItems(BIG_YELLOW_TREASURE_CHEST, 1);
- st.giveItems(KIKI_LETTER, 1);
+ st.startQuest();
+ break;
}
- else
+ case "31572-07.htm":
{
- htmltext = "31572-08.htm";
+ if (st.hasQuestItems(BIG_YELLOW_TREASURE_CHEST))
+ {
+ st.setCond(2);
+ st.takeItems(BIG_YELLOW_TREASURE_CHEST, 1);
+ st.giveItems(KIKI_LETTER, 1);
+ }
+ else
+ {
+ htmltext = "31572-08.htm";
+ }
+ break;
}
- }
- else if (event.equals("31442-02.htm"))
- {
- if (st.hasQuestItems(KIKI_LETTER))
+ case "31442-02.htm":
{
- htmltext = "31442-02.htm";
- st.takeItems(KIKI_LETTER, 1);
- st.giveItems(ELVEN_RING, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = "31442-03.htm";
+ if (st.hasQuestItems(KIKI_LETTER))
+ {
+ htmltext = "31442-02.htm";
+ st.takeItems(KIKI_LETTER, 1);
+ st.giveItems(ELVEN_RING, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "31442-03.htm";
+ }
+ break;
}
}
@@ -106,6 +107,7 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 36)
{
htmltext = "31572-02.htm";
@@ -123,12 +125,14 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
}
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case OFULLE:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(BIG_YELLOW_TREASURE_CHEST)) ? "31572-06.htm" : "31572-05.htm";
@@ -138,19 +142,23 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
htmltext = "31572-09.htm";
}
break;
-
+ }
case KIKI:
+ {
if (cond == 2)
{
htmltext = "31442-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q029_ChestCaughtWithABaitOfEarth/Q029_ChestCaughtWithABaitOfEarth.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q029_ChestCaughtWithABaitOfEarth/Q029_ChestCaughtWithABaitOfEarth.java
index 96ad700155..d39f993acf 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q029_ChestCaughtWithABaitOfEarth/Q029_ChestCaughtWithABaitOfEarth.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q029_ChestCaughtWithABaitOfEarth/Q029_ChestCaughtWithABaitOfEarth.java
@@ -29,7 +29,6 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
// NPCs
private static final int WILLIE = 31574;
private static final int ANABEL = 30909;
-
// Items
private static final int SMALL_PURPLE_TREASURE_CHEST = 6507;
private static final int SMALL_GLASS_BOX = 7627;
@@ -38,9 +37,7 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
public Q029_ChestCaughtWithABaitOfEarth()
{
super(29, "Chest caught with a bait of earth");
-
registerQuestItems(SMALL_GLASS_BOX);
-
addStartNpc(WILLIE);
addTalkId(WILLIE, ANABEL);
}
@@ -55,38 +52,42 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
return htmltext;
}
- if (event.equals("31574-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31574-07.htm"))
- {
- if (st.hasQuestItems(SMALL_PURPLE_TREASURE_CHEST))
+ case "31574-04.htm":
{
- st.set("cond", "2");
- st.takeItems(SMALL_PURPLE_TREASURE_CHEST, 1);
- st.giveItems(SMALL_GLASS_BOX, 1);
+ st.startQuest();
+ break;
}
- else
+ case "31574-07.htm":
{
- htmltext = "31574-08.htm";
+ if (st.hasQuestItems(SMALL_PURPLE_TREASURE_CHEST))
+ {
+ st.setCond(2);
+ st.takeItems(SMALL_PURPLE_TREASURE_CHEST, 1);
+ st.giveItems(SMALL_GLASS_BOX, 1);
+ }
+ else
+ {
+ htmltext = "31574-08.htm";
+ }
+ break;
}
- }
- else if (event.equals("30909-02.htm"))
- {
- if (st.hasQuestItems(SMALL_GLASS_BOX))
+ case "30909-02.htm":
{
- htmltext = "30909-02.htm";
- st.takeItems(SMALL_GLASS_BOX, 1);
- st.giveItems(PLATED_LEATHER_GLOVES, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = "30909-03.htm";
+ if (st.hasQuestItems(SMALL_GLASS_BOX))
+ {
+ htmltext = "30909-02.htm";
+ st.takeItems(SMALL_GLASS_BOX, 1);
+ st.giveItems(PLATED_LEATHER_GLOVES, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "30909-03.htm";
+ }
+ break;
}
}
@@ -106,6 +107,7 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 48)
{
htmltext = "31574-02.htm";
@@ -123,12 +125,14 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
}
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case WILLIE:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(SMALL_PURPLE_TREASURE_CHEST)) ? "31574-06.htm" : "31574-05.htm";
@@ -138,19 +142,23 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
htmltext = "31574-09.htm";
}
break;
-
+ }
case ANABEL:
+ {
if (cond == 2)
{
htmltext = "30909-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q030_ChestCaughtWithABaitOfFire/Q030_ChestCaughtWithABaitOfFire.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q030_ChestCaughtWithABaitOfFire/Q030_ChestCaughtWithABaitOfFire.java
index e13f7c8362..8b3c3b03ca 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q030_ChestCaughtWithABaitOfFire/Q030_ChestCaughtWithABaitOfFire.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q030_ChestCaughtWithABaitOfFire/Q030_ChestCaughtWithABaitOfFire.java
@@ -29,7 +29,6 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
// NPCs
private static final int LINNAEUS = 31577;
private static final int RUKAL = 30629;
-
// Items
private static final int RED_TREASURE_BOX = 6511;
private static final int MUSICAL_SCORE = 7628;
@@ -38,9 +37,7 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
public Q030_ChestCaughtWithABaitOfFire()
{
super(30, "Chest caught with a bait of fire");
-
registerQuestItems(MUSICAL_SCORE);
-
addStartNpc(LINNAEUS);
addTalkId(LINNAEUS, RUKAL);
}
@@ -55,38 +52,42 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
return htmltext;
}
- if (event.equals("31577-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31577-07.htm"))
- {
- if (st.hasQuestItems(RED_TREASURE_BOX))
+ case "31577-04.htm":
{
- st.set("cond", "2");
- st.takeItems(RED_TREASURE_BOX, 1);
- st.giveItems(MUSICAL_SCORE, 1);
+ st.startQuest();
+ break;
}
- else
+ case "31577-07.htm":
{
- htmltext = "31577-08.htm";
+ if (st.hasQuestItems(RED_TREASURE_BOX))
+ {
+ st.setCond(2);
+ st.takeItems(RED_TREASURE_BOX, 1);
+ st.giveItems(MUSICAL_SCORE, 1);
+ }
+ else
+ {
+ htmltext = "31577-08.htm";
+ }
+ break;
}
- }
- else if (event.equals("30629-02.htm"))
- {
- if (st.hasQuestItems(MUSICAL_SCORE))
+ case "30629-02.htm":
{
- htmltext = "30629-02.htm";
- st.takeItems(MUSICAL_SCORE, 1);
- st.giveItems(NECKLACE_OF_PROTECTION, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = "30629-03.htm";
+ if (st.hasQuestItems(MUSICAL_SCORE))
+ {
+ htmltext = "30629-02.htm";
+ st.takeItems(MUSICAL_SCORE, 1);
+ st.giveItems(NECKLACE_OF_PROTECTION, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "30629-03.htm";
+ }
+ break;
}
}
@@ -106,6 +107,7 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 60)
{
htmltext = "31577-02.htm";
@@ -123,12 +125,14 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
}
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LINNAEUS:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(RED_TREASURE_BOX)) ? "31577-06.htm" : "31577-05.htm";
@@ -138,19 +142,23 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
htmltext = "31577-09.htm";
}
break;
-
+ }
case RUKAL:
+ {
if (cond == 2)
{
htmltext = "30629-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q031_SecretBuriedInTheSwamp/Q031_SecretBuriedInTheSwamp.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q031_SecretBuriedInTheSwamp/Q031_SecretBuriedInTheSwamp.java
index c9b59f944d..e29e5dd22c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q031_SecretBuriedInTheSwamp/Q031_SecretBuriedInTheSwamp.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q031_SecretBuriedInTheSwamp/Q031_SecretBuriedInTheSwamp.java
@@ -24,9 +24,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q031_SecretBuriedInTheSwamp extends Quest
{
- // Item
- private static final int KRORIN_JOURNAL = 7252;
-
// NPCs
private static final int ABERCROMBIE = 31555;
private static final int FORGOTTEN_MONUMENT_1 = 31661;
@@ -34,13 +31,13 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
private static final int FORGOTTEN_MONUMENT_3 = 31663;
private static final int FORGOTTEN_MONUMENT_4 = 31664;
private static final int CORPSE_OF_DWARF = 31665;
+ // Item
+ private static final int KRORIN_JOURNAL = 7252;
public Q031_SecretBuriedInTheSwamp()
{
super(31, "Secret Buried in the Swamp");
-
registerQuestItems(KRORIN_JOURNAL);
-
addStartNpc(ABERCROMBIE);
addTalkId(ABERCROMBIE, CORPSE_OF_DWARF, FORGOTTEN_MONUMENT_1, FORGOTTEN_MONUMENT_2, FORGOTTEN_MONUMENT_3, FORGOTTEN_MONUMENT_4);
}
@@ -55,50 +52,59 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
return htmltext;
}
- if (event.equals("31555-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31665-01.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(KRORIN_JOURNAL, 1);
- }
- else if (event.equals("31555-04.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31661-01.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31662-01.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31663-01.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31664-01.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31555-07.htm"))
- {
- st.takeItems(KRORIN_JOURNAL, 1);
- st.rewardItems(57, 40000);
- st.rewardExpAndSp(130000, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31555-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31665-01.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(KRORIN_JOURNAL, 1);
+ break;
+ }
+ case "31555-04.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31661-01.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31662-01.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31663-01.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31664-01.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31555-07.htm":
+ {
+ st.takeItems(KRORIN_JOURNAL, 1);
+ st.rewardItems(57, 40000);
+ st.rewardExpAndSp(130000, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -117,14 +123,17 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 66) ? "31555-00a.htm" : "31555-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ABERCROMBIE:
+ {
if (cond == 1)
{
htmltext = "31555-02.htm";
@@ -142,8 +151,9 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31555-06.htm";
}
break;
-
+ }
case CORPSE_OF_DWARF:
+ {
if (cond == 1)
{
htmltext = "31665-00.htm";
@@ -153,8 +163,9 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31665-02.htm";
}
break;
-
+ }
case FORGOTTEN_MONUMENT_1:
+ {
if (cond == 3)
{
htmltext = "31661-00.htm";
@@ -164,8 +175,9 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31661-02.htm";
}
break;
-
+ }
case FORGOTTEN_MONUMENT_2:
+ {
if (cond == 4)
{
htmltext = "31662-00.htm";
@@ -175,8 +187,9 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31662-02.htm";
}
break;
-
+ }
case FORGOTTEN_MONUMENT_3:
+ {
if (cond == 5)
{
htmltext = "31663-00.htm";
@@ -186,8 +199,9 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31663-02.htm";
}
break;
-
+ }
case FORGOTTEN_MONUMENT_4:
+ {
if (cond == 6)
{
htmltext = "31664-00.htm";
@@ -197,12 +211,15 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31664-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q032_AnObviousLie/Q032_AnObviousLie.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q032_AnObviousLie/Q032_AnObviousLie.java
index 56958ee723..e67434b635 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q032_AnObviousLie/Q032_AnObviousLie.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q032_AnObviousLie/Q032_AnObviousLie.java
@@ -24,32 +24,27 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q032_AnObviousLie extends Quest
{
+ // NPCs
+ private static final int GENTLER = 30094;
+ private static final int MAXIMILIAN = 30120;
+ private static final int MIKI_THE_CAT = 31706;
// Items
private static final int SUEDE = 1866;
private static final int THREAD = 1868;
private static final int SPIRIT_ORE = 3031;
private static final int MAP = 7165;
private static final int MEDICINAL_HERB = 7166;
-
// Rewards
private static final int CAT_EARS = 6843;
private static final int RACOON_EARS = 7680;
private static final int RABBIT_EARS = 7683;
- // NPCs
- private static final int GENTLER = 30094;
- private static final int MAXIMILIAN = 30120;
- private static final int MIKI_THE_CAT = 31706;
-
public Q032_AnObviousLie()
{
super(32, "An Obvious Lie");
-
registerQuestItems(MAP, MEDICINAL_HERB);
-
addStartNpc(MAXIMILIAN);
addTalkId(MAXIMILIAN, GENTLER, MIKI_THE_CAT);
-
addKillId(20135); // Alligator
}
@@ -63,103 +58,115 @@ public class Q032_AnObviousLie extends Quest
return htmltext;
}
- if (event.equals("30120-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30094-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(MAP, 1);
- }
- else if (event.equals("31706-1.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAP, 1);
- }
- else if (event.equals("30094-4.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MEDICINAL_HERB, 20);
- }
- else if (event.equals("30094-7.htm"))
- {
- if (st.getQuestItemsCount(SPIRIT_ORE) < 500)
+ case "30120-1.htm":
{
- htmltext = "30094-5.htm";
+ st.startQuest();
+ break;
}
- else
+ case "30094-1.htm":
{
- st.set("cond", "6");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPIRIT_ORE, 500);
+ st.giveItems(MAP, 1);
+ break;
}
- }
- else if (event.equals("31706-4.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30094-10.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30094-13.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("cat"))
- {
- if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ case "31706-1.htm":
{
- htmltext = "30094-11.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAP, 1);
+ break;
}
- else
+ case "30094-4.htm":
{
- htmltext = "30094-14.htm";
- st.takeItems(SUEDE, 500);
- st.takeItems(THREAD, 1000);
- st.giveItems(CAT_EARS, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MEDICINAL_HERB, 20);
+ break;
}
- }
- else if (event.equals("racoon"))
- {
- if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ case "30094-7.htm":
{
- htmltext = "30094-11.htm";
+ if (st.getQuestItemsCount(SPIRIT_ORE) < 500)
+ {
+ htmltext = "30094-5.htm";
+ }
+ else
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPIRIT_ORE, 500);
+ }
+ break;
}
- else
+ case "31706-4.htm":
{
- htmltext = "30094-14.htm";
- st.takeItems(SUEDE, 500);
- st.takeItems(THREAD, 1000);
- st.giveItems(RACOON_EARS, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("rabbit"))
- {
- if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ case "30094-10.htm":
{
- htmltext = "30094-11.htm";
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- else
+ case "30094-13.htm":
{
- htmltext = "30094-14.htm";
- st.takeItems(SUEDE, 500);
- st.takeItems(THREAD, 1000);
- st.giveItems(RABBIT_EARS, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "cat":
+ {
+ if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ {
+ htmltext = "30094-11.htm";
+ }
+ else
+ {
+ htmltext = "30094-14.htm";
+ st.takeItems(SUEDE, 500);
+ st.takeItems(THREAD, 1000);
+ st.giveItems(CAT_EARS, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
+ }
+ case "racoon":
+ {
+ if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ {
+ htmltext = "30094-11.htm";
+ }
+ else
+ {
+ htmltext = "30094-14.htm";
+ st.takeItems(SUEDE, 500);
+ st.takeItems(THREAD, 1000);
+ st.giveItems(RACOON_EARS, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
+ }
+ case "rabbit":
+ {
+ if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ {
+ htmltext = "30094-11.htm";
+ }
+ else
+ {
+ htmltext = "30094-14.htm";
+ st.takeItems(SUEDE, 500);
+ st.takeItems(THREAD, 1000);
+ st.giveItems(RABBIT_EARS, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
}
}
@@ -179,18 +186,22 @@ public class Q032_AnObviousLie extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 45) ? "30120-0a.htm" : "30120-0.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MAXIMILIAN:
+ {
htmltext = "30120-2.htm";
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-0.htm";
@@ -220,8 +231,9 @@ public class Q032_AnObviousLie extends Quest
htmltext = ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500)) ? "30094-11.htm" : "30094-12.htm";
}
break;
-
+ }
case MIKI_THE_CAT:
+ {
if (cond == 2)
{
htmltext = "31706-0.htm";
@@ -239,12 +251,15 @@ public class Q032_AnObviousLie extends Quest
htmltext = "31706-5.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -253,7 +268,7 @@ public class Q032_AnObviousLie extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "3");
+ final QuestState st = checkPlayerCondition(player, npc, 3);
if (st == null)
{
return null;
@@ -261,7 +276,7 @@ public class Q032_AnObviousLie extends Quest
if (st.dropItemsAlways(MEDICINAL_HERB, 1, 20))
{
- st.set("cond", "4");
+ st.setCond(4);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q033_MakeAPairOfDressShoes/Q033_MakeAPairOfDressShoes.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q033_MakeAPairOfDressShoes/Q033_MakeAPairOfDressShoes.java
index 93f230e0e6..8301acece6 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q033_MakeAPairOfDressShoes/Q033_MakeAPairOfDressShoes.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q033_MakeAPairOfDressShoes/Q033_MakeAPairOfDressShoes.java
@@ -30,19 +30,16 @@ public class Q033_MakeAPairOfDressShoes extends Quest
private static final int WOODLEY = 30838;
private static final int IAN = 30164;
private static final int LEIKAR = 31520;
-
// Items
private static final int LEATHER = 1882;
private static final int THREAD = 1868;
private static final int ADENA = 57;
-
// Rewards
public static final int DRESS_SHOES_BOX = 7113;
public Q033_MakeAPairOfDressShoes()
{
super(33, "Make a Pair of Dress Shoes");
-
addStartNpc(WOODLEY);
addTalkId(WOODLEY, IAN, LEIKAR);
}
@@ -57,55 +54,62 @@ public class Q033_MakeAPairOfDressShoes extends Quest
return htmltext;
}
- if (event.equals("30838-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31520-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30838-3.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30838-5.htm"))
- {
- if ((st.getQuestItemsCount(LEATHER) >= 200) && (st.getQuestItemsCount(THREAD) >= 600) && (st.getQuestItemsCount(ADENA) >= 200000))
+ case "30838-1.htm":
{
- st.set("cond", "4");
+ st.startQuest();
+ break;
+ }
+ case "31520-1.htm":
+ {
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ADENA, 200000);
- st.takeItems(LEATHER, 200);
- st.takeItems(THREAD, 600);
+ break;
}
- else
+ case "30838-3.htm":
{
- htmltext = "30838-4a.htm";
- }
- }
- else if (event.equals("30164-1.htm"))
- {
- if (st.getQuestItemsCount(ADENA) >= 300000)
- {
- st.set("cond", "5");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ADENA, 300000);
+ break;
}
- else
+ case "30838-5.htm":
{
- htmltext = "30164-1a.htm";
+ if ((st.getQuestItemsCount(LEATHER) >= 200) && (st.getQuestItemsCount(THREAD) >= 600) && (st.getQuestItemsCount(ADENA) >= 200000))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ADENA, 200000);
+ st.takeItems(LEATHER, 200);
+ st.takeItems(THREAD, 600);
+ }
+ else
+ {
+ htmltext = "30838-4a.htm";
+ }
+ break;
+ }
+ case "30164-1.htm":
+ {
+ if (st.getQuestItemsCount(ADENA) >= 300000)
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ADENA, 300000);
+ }
+ else
+ {
+ htmltext = "30164-1a.htm";
+ }
+ break;
+ }
+ case "30838-7.htm":
+ {
+ st.giveItems(DRESS_SHOES_BOX, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
}
- }
- else if (event.equals("30838-7.htm"))
- {
- st.giveItems(DRESS_SHOES_BOX, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
}
return htmltext;
@@ -124,10 +128,11 @@ public class Q033_MakeAPairOfDressShoes extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 60)
{
final QuestState fwear = player.getQuestState(Q037_MakeFormalWear.class.getSimpleName());
- if ((fwear != null) && (fwear.getInt("cond") == 7))
+ if ((fwear != null) && fwear.isCond(7))
{
htmltext = "30838-0.htm";
}
@@ -141,12 +146,14 @@ public class Q033_MakeAPairOfDressShoes extends Quest
htmltext = "30838-0b.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case WOODLEY:
+ {
if (cond == 1)
{
htmltext = "30838-1.htm";
@@ -175,8 +182,9 @@ public class Q033_MakeAPairOfDressShoes extends Quest
htmltext = "30838-6.htm";
}
break;
-
+ }
case LEIKAR:
+ {
if (cond == 1)
{
htmltext = "31520-0.htm";
@@ -186,8 +194,9 @@ public class Q033_MakeAPairOfDressShoes extends Quest
htmltext = "31520-1a.htm";
}
break;
-
+ }
case IAN:
+ {
if (cond == 4)
{
htmltext = "30164-0.htm";
@@ -197,12 +206,15 @@ public class Q033_MakeAPairOfDressShoes extends Quest
htmltext = "30164-2.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q034_InSearchOfCloth/Q034_InSearchOfCloth.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q034_InSearchOfCloth/Q034_InSearchOfCloth.java
index 828dbb5dd6..e3d530a59b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q034_InSearchOfCloth/Q034_InSearchOfCloth.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q034_InSearchOfCloth/Q034_InSearchOfCloth.java
@@ -30,29 +30,23 @@ public class Q034_InSearchOfCloth extends Quest
private static final int RADIA = 30088;
private static final int RALFORD = 30165;
private static final int VARAN = 30294;
-
// Monsters
private static final int TRISALIM_SPIDER = 20560;
private static final int TRISALIM_TARANTULA = 20561;
-
// Items
private static final int SPINNERET = 7528;
private static final int SUEDE = 1866;
private static final int THREAD = 1868;
private static final int SPIDERSILK = 7161;
-
// Rewards
private static final int MYSTERIOUS_CLOTH = 7076;
public Q034_InSearchOfCloth()
{
super(34, "In Search of Cloth");
-
registerQuestItems(SPINNERET, SPIDERSILK);
-
addStartNpc(RADIA);
addTalkId(RADIA, RALFORD, VARAN);
-
addKillId(TRISALIM_SPIDER, TRISALIM_TARANTULA);
}
@@ -66,48 +60,55 @@ public class Q034_InSearchOfCloth extends Quest
return htmltext;
}
- if (event.equals("30088-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30294-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30088-3.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30165-1.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30165-3.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPINNERET, 10);
- st.giveItems(SPIDERSILK, 1);
- }
- else if (event.equals("30088-5.htm"))
- {
- if ((st.getQuestItemsCount(SUEDE) >= 3000) && (st.getQuestItemsCount(THREAD) >= 5000) && st.hasQuestItems(SPIDERSILK))
+ case "30088-1.htm":
{
- st.takeItems(SPIDERSILK, 1);
- st.takeItems(SUEDE, 3000);
- st.takeItems(THREAD, 5000);
- st.giveItems(MYSTERIOUS_CLOTH, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.startQuest();
+ break;
}
- else
+ case "30294-1.htm":
{
- htmltext = "30088-4a.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30088-3.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30165-1.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30165-3.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPINNERET, 10);
+ st.giveItems(SPIDERSILK, 1);
+ break;
+ }
+ case "30088-5.htm":
+ {
+ if ((st.getQuestItemsCount(SUEDE) >= 3000) && (st.getQuestItemsCount(THREAD) >= 5000) && st.hasQuestItems(SPIDERSILK))
+ {
+ st.takeItems(SPIDERSILK, 1);
+ st.takeItems(SUEDE, 3000);
+ st.takeItems(THREAD, 5000);
+ st.giveItems(MYSTERIOUS_CLOTH, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "30088-4a.htm";
+ }
+ break;
}
}
@@ -127,10 +128,11 @@ public class Q034_InSearchOfCloth extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 60)
{
final QuestState fwear = player.getQuestState(Q037_MakeFormalWear.class.getSimpleName());
- if ((fwear != null) && (fwear.getInt("cond") == 6))
+ if ((fwear != null) && fwear.isCond(6))
{
htmltext = "30088-0.htm";
}
@@ -144,12 +146,14 @@ public class Q034_InSearchOfCloth extends Quest
htmltext = "30088-0b.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case RADIA:
+ {
if (cond == 1)
{
htmltext = "30088-1a.htm";
@@ -174,8 +178,9 @@ public class Q034_InSearchOfCloth extends Quest
}
}
break;
-
+ }
case VARAN:
+ {
if (cond == 1)
{
htmltext = "30294-0.htm";
@@ -185,8 +190,9 @@ public class Q034_InSearchOfCloth extends Quest
htmltext = "30294-1a.htm";
}
break;
-
+ }
case RALFORD:
+ {
if (cond == 3)
{
htmltext = "30165-0.htm";
@@ -204,12 +210,15 @@ public class Q034_InSearchOfCloth extends Quest
htmltext = "30165-3a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -218,7 +227,7 @@ public class Q034_InSearchOfCloth extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "4");
+ final QuestState st = checkPlayerCondition(player, npc, 4);
if (st == null)
{
return null;
@@ -226,7 +235,7 @@ public class Q034_InSearchOfCloth extends Quest
if (st.dropItems(SPINNERET, 1, 10, 500000))
{
- st.set("cond", "5");
+ st.setCond(5);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q035_FindGlitteringJewelry/Q035_FindGlitteringJewelry.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q035_FindGlitteringJewelry/Q035_FindGlitteringJewelry.java
index b65447a9b4..21d45d1925 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q035_FindGlitteringJewelry/Q035_FindGlitteringJewelry.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q035_FindGlitteringJewelry/Q035_FindGlitteringJewelry.java
@@ -29,25 +29,20 @@ public class Q035_FindGlitteringJewelry extends Quest
// NPCs
private static final int ELLIE = 30091;
private static final int FELTON = 30879;
-
// Items
private static final int ROUGH_JEWEL = 7162;
private static final int ORIHARUKON = 1893;
private static final int SILVER_NUGGET = 1873;
private static final int THONS = 4044;
-
// Reward
private static final int JEWEL_BOX = 7077;
public Q035_FindGlitteringJewelry()
{
super(35, "Find Glittering Jewelry");
-
registerQuestItems(ROUGH_JEWEL);
-
addStartNpc(ELLIE);
addTalkId(ELLIE, FELTON);
-
addKillId(20135); // Alligator
}
@@ -61,37 +56,42 @@ public class Q035_FindGlitteringJewelry extends Quest
return htmltext;
}
- if (event.equals("30091-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30879-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30091-3.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROUGH_JEWEL, 10);
- }
- else if (event.equals("30091-5.htm"))
- {
- if ((st.getQuestItemsCount(ORIHARUKON) >= 5) && (st.getQuestItemsCount(SILVER_NUGGET) >= 500) && (st.getQuestItemsCount(THONS) >= 150))
+ case "30091-1.htm":
{
- st.takeItems(ORIHARUKON, 5);
- st.takeItems(SILVER_NUGGET, 500);
- st.takeItems(THONS, 150);
- st.giveItems(JEWEL_BOX, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.startQuest();
+ break;
}
- else
+ case "30879-1.htm":
{
- htmltext = "30091-4a.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30091-3.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ROUGH_JEWEL, 10);
+ break;
+ }
+ case "30091-5.htm":
+ {
+ if ((st.getQuestItemsCount(ORIHARUKON) >= 5) && (st.getQuestItemsCount(SILVER_NUGGET) >= 500) && (st.getQuestItemsCount(THONS) >= 150))
+ {
+ st.takeItems(ORIHARUKON, 5);
+ st.takeItems(SILVER_NUGGET, 500);
+ st.takeItems(THONS, 150);
+ st.giveItems(JEWEL_BOX, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "30091-4a.htm";
+ }
+ break;
}
}
@@ -111,10 +111,11 @@ public class Q035_FindGlitteringJewelry extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 60)
{
final QuestState fwear = player.getQuestState(Q037_MakeFormalWear.class.getSimpleName());
- if ((fwear != null) && (fwear.getInt("cond") == 6))
+ if ((fwear != null) && fwear.isCond(6))
{
htmltext = "30091-0.htm";
}
@@ -128,12 +129,14 @@ public class Q035_FindGlitteringJewelry extends Quest
htmltext = "30091-0b.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ELLIE:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30091-1a.htm";
@@ -147,8 +150,9 @@ public class Q035_FindGlitteringJewelry extends Quest
htmltext = ((st.getQuestItemsCount(ORIHARUKON) >= 5) && (st.getQuestItemsCount(SILVER_NUGGET) >= 500) && (st.getQuestItemsCount(THONS) >= 150)) ? "30091-4.htm" : "30091-4a.htm";
}
break;
-
+ }
case FELTON:
+ {
if (cond == 1)
{
htmltext = "30879-0.htm";
@@ -158,12 +162,15 @@ public class Q035_FindGlitteringJewelry extends Quest
htmltext = "30879-1a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -172,7 +179,7 @@ public class Q035_FindGlitteringJewelry extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -180,7 +187,7 @@ public class Q035_FindGlitteringJewelry extends Quest
if (st.dropItems(ROUGH_JEWEL, 1, 10, 500000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q036_MakeASewingKit/Q036_MakeASewingKit.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q036_MakeASewingKit/Q036_MakeASewingKit.java
index a9d67c413d..a335bfd69c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q036_MakeASewingKit/Q036_MakeASewingKit.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q036_MakeASewingKit/Q036_MakeASewingKit.java
@@ -30,19 +30,15 @@ public class Q036_MakeASewingKit extends Quest
private static final int REINFORCED_STEEL = 7163;
private static final int ARTISANS_FRAME = 1891;
private static final int ORIHARUKON = 1893;
-
// Reward
private static final int SEWING_KIT = 7078;
public Q036_MakeASewingKit()
{
super(36, "Make a Sewing Kit");
-
registerQuestItems(REINFORCED_STEEL);
-
addStartNpc(30847); // Ferris
addTalkId(30847);
-
addKillId(20566); // Iron Golem
}
@@ -56,31 +52,35 @@ public class Q036_MakeASewingKit extends Quest
return htmltext;
}
- if (event.equals("30847-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30847-3.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(REINFORCED_STEEL, 5);
- }
- else if (event.equals("30847-5.htm"))
- {
- if ((st.getQuestItemsCount(ORIHARUKON) >= 10) && (st.getQuestItemsCount(ARTISANS_FRAME) >= 10))
+ case "30847-1.htm":
{
- st.takeItems(ARTISANS_FRAME, 10);
- st.takeItems(ORIHARUKON, 10);
- st.giveItems(SEWING_KIT, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.startQuest();
+ break;
}
- else
+ case "30847-3.htm":
{
- htmltext = "30847-4a.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(REINFORCED_STEEL, 5);
+ break;
+ }
+ case "30847-5.htm":
+ {
+ if ((st.getQuestItemsCount(ORIHARUKON) >= 10) && (st.getQuestItemsCount(ARTISANS_FRAME) >= 10))
+ {
+ st.takeItems(ARTISANS_FRAME, 10);
+ st.takeItems(ORIHARUKON, 10);
+ st.giveItems(SEWING_KIT, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "30847-4a.htm";
+ }
+ break;
}
}
@@ -100,10 +100,11 @@ public class Q036_MakeASewingKit extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 60)
{
final QuestState fwear = player.getQuestState(Q037_MakeFormalWear.class.getSimpleName());
- if ((fwear != null) && (fwear.getInt("cond") == 6))
+ if ((fwear != null) && fwear.isCond(6))
{
htmltext = "30847-0.htm";
}
@@ -117,9 +118,10 @@ public class Q036_MakeASewingKit extends Quest
htmltext = "30847-0b.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30847-1a.htm";
@@ -133,10 +135,12 @@ public class Q036_MakeASewingKit extends Quest
htmltext = ((st.getQuestItemsCount(ORIHARUKON) < 10) || (st.getQuestItemsCount(ARTISANS_FRAME) < 10)) ? "30847-4a.htm" : "30847-4.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -145,7 +149,7 @@ public class Q036_MakeASewingKit extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -153,7 +157,7 @@ public class Q036_MakeASewingKit extends Quest
if (st.dropItems(REINFORCED_STEEL, 1, 5, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q037_MakeFormalWear/Q037_MakeFormalWear.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q037_MakeFormalWear/Q037_MakeFormalWear.java
index fece33173f..2b55637689 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q037_MakeFormalWear/Q037_MakeFormalWear.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q037_MakeFormalWear/Q037_MakeFormalWear.java
@@ -29,7 +29,6 @@ public class Q037_MakeFormalWear extends Quest
private static final int LEIKAR = 31520;
private static final int JEREMY = 31521;
private static final int MIST = 31627;
-
// Items
private static final int MYSTERIOUS_CLOTH = 7076;
private static final int JEWEL_BOX = 7077;
@@ -38,16 +37,13 @@ public class Q037_MakeFormalWear extends Quest
private static final int SIGNET_RING = 7164;
private static final int ICE_WINE = 7160;
private static final int BOX_OF_COOKIES = 7159;
-
// Reward
private static final int FORMAL_WEAR = 6408;
public Q037_MakeFormalWear()
{
super(37, "Make Formal Wear");
-
registerQuestItems(SIGNET_RING, ICE_WINE, BOX_OF_COOKIES);
-
addStartNpc(ALEXIS);
addTalkId(ALEXIS, LEIKAR, JEREMY, MIST);
}
@@ -62,57 +58,66 @@ public class Q037_MakeFormalWear extends Quest
return htmltext;
}
- if (event.equals("30842-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31520-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(SIGNET_RING, 1);
- }
- else if (event.equals("31521-1.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SIGNET_RING, 1);
- st.giveItems(ICE_WINE, 1);
- }
- else if (event.equals("31627-1.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ICE_WINE, 1);
- }
- else if (event.equals("31521-3.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BOX_OF_COOKIES, 1);
- }
- else if (event.equals("31520-3.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BOX_OF_COOKIES, 1);
- }
- else if (event.equals("31520-5.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JEWEL_BOX, 1);
- st.takeItems(MYSTERIOUS_CLOTH, 1);
- st.takeItems(SEWING_KIT, 1);
- }
- else if (event.equals("31520-7.htm"))
- {
- st.takeItems(DRESS_SHOES_BOX, 1);
- st.giveItems(FORMAL_WEAR, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30842-1.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31520-1.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(SIGNET_RING, 1);
+ break;
+ }
+ case "31521-1.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SIGNET_RING, 1);
+ st.giveItems(ICE_WINE, 1);
+ break;
+ }
+ case "31627-1.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ICE_WINE, 1);
+ break;
+ }
+ case "31521-3.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BOX_OF_COOKIES, 1);
+ break;
+ }
+ case "31520-3.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BOX_OF_COOKIES, 1);
+ break;
+ }
+ case "31520-5.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JEWEL_BOX, 1);
+ st.takeItems(MYSTERIOUS_CLOTH, 1);
+ st.takeItems(SEWING_KIT, 1);
+ break;
+ }
+ case "31520-7.htm":
+ {
+ st.takeItems(DRESS_SHOES_BOX, 1);
+ st.giveItems(FORMAL_WEAR, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -131,21 +136,25 @@ public class Q037_MakeFormalWear extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "30842-0a.htm" : "30842-0.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ALEXIS:
+ {
if (cond == 1)
{
htmltext = "30842-2.htm";
}
break;
-
+ }
case LEIKAR:
+ {
if (cond == 1)
{
htmltext = "31520-0.htm";
@@ -174,8 +183,9 @@ public class Q037_MakeFormalWear extends Quest
htmltext = (st.hasQuestItems(DRESS_SHOES_BOX)) ? "31520-6.htm" : "31520-5a.htm";
}
break;
-
+ }
case JEREMY:
+ {
if (st.hasQuestItems(SIGNET_RING))
{
htmltext = "31521-0.htm";
@@ -193,8 +203,9 @@ public class Q037_MakeFormalWear extends Quest
htmltext = "31521-3a.htm";
}
break;
-
+ }
case MIST:
+ {
if (cond == 3)
{
htmltext = "31627-0.htm";
@@ -204,12 +215,15 @@ public class Q037_MakeFormalWear extends Quest
htmltext = "31627-2.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q038_DragonFangs/Q038_DragonFangs.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q038_DragonFangs/Q038_DragonFangs.java
index d94f4b1355..3ec9979244 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q038_DragonFangs/Q038_DragonFangs.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q038_DragonFangs/Q038_DragonFangs.java
@@ -28,86 +28,45 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q038_DragonFangs extends Quest
{
+ // NPCs
+ private static final int LUIS = 30386;
+ private static final int IRIS = 30034;
+ private static final int ROHMER = 30344;
// Items
private static final int FEATHER_ORNAMENT = 7173;
private static final int TOOTH_OF_TOTEM = 7174;
private static final int TOOTH_OF_DRAGON = 7175;
private static final int LETTER_OF_IRIS = 7176;
private static final int LETTER_OF_ROHMER = 7177;
-
- // NPCs
- private static final int LUIS = 30386;
- private static final int IRIS = 30034;
- private static final int ROHMER = 30344;
-
// Reward { item, adena }
private static final int[][] REWARD =
{
- {
- 45,
- 5200
- },
- {
- 627,
- 1500
- },
- {
- 1123,
- 3200
- },
- {
- 605,
- 3200
- }
+ // @formatter:off
+ {45, 5200},
+ {627, 1500},
+ {1123, 3200},
+ {605, 3200}
+ // @formatter:on
};
-
// Droplist
private static final Map DROPLIST = new HashMap<>();
static
{
- DROPLIST.put(21100, new int[]
- {
- 1,
- FEATHER_ORNAMENT,
- 100,
- 1000000
- });
- DROPLIST.put(20357, new int[]
- {
- 1,
- FEATHER_ORNAMENT,
- 100,
- 1000000
- });
- DROPLIST.put(21101, new int[]
- {
- 6,
- TOOTH_OF_DRAGON,
- 50,
- 500000
- });
- DROPLIST.put(20356, new int[]
- {
- 6,
- TOOTH_OF_DRAGON,
- 50,
- 500000
- });
+ // @formatter:off
+ DROPLIST.put(21100, new int[]{1, FEATHER_ORNAMENT, 100, 1000000});
+ DROPLIST.put(20357, new int[]{1, FEATHER_ORNAMENT, 100, 1000000});
+ DROPLIST.put(21101, new int[]{6, TOOTH_OF_DRAGON, 50, 500000});
+ DROPLIST.put(20356, new int[]{6, TOOTH_OF_DRAGON, 50, 500000});
+ // @formatter:on
}
public Q038_DragonFangs()
{
super(38, "Dragon Fangs");
-
registerQuestItems(FEATHER_ORNAMENT, TOOTH_OF_TOTEM, TOOTH_OF_DRAGON, LETTER_OF_IRIS, LETTER_OF_ROHMER);
-
addStartNpc(LUIS);
addTalkId(LUIS, IRIS, ROHMER);
-
- for (int mob : DROPLIST.keySet())
- {
- addKillId(mob);
- }
+ addKillId(DROPLIST.keySet());
}
@Override
@@ -120,62 +79,69 @@ public class Q038_DragonFangs extends Quest
return htmltext;
}
- if (event.equals("30386-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30386-04.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(FEATHER_ORNAMENT, 100);
- st.giveItems(TOOTH_OF_TOTEM, 1);
- }
- else if (event.equals("30034-02a.htm"))
- {
- if (st.hasQuestItems(TOOTH_OF_TOTEM))
+ case "30386-02.htm":
{
- htmltext = "30034-02.htm";
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TOOTH_OF_TOTEM, 1);
- st.giveItems(LETTER_OF_IRIS, 1);
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30344-02a.htm"))
- {
- if (st.hasQuestItems(LETTER_OF_IRIS))
+ case "30386-04.htm":
{
- htmltext = "30344-02.htm";
- st.set("cond", "5");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_OF_IRIS, 1);
- st.giveItems(LETTER_OF_ROHMER, 1);
+ st.takeItems(FEATHER_ORNAMENT, 100);
+ st.giveItems(TOOTH_OF_TOTEM, 1);
+ break;
}
- }
- else if (event.equals("30034-04a.htm"))
- {
- if (st.hasQuestItems(LETTER_OF_ROHMER))
+ case "30034-02a.htm":
{
- htmltext = "30034-04.htm";
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_OF_ROHMER, 1);
+ if (st.hasQuestItems(TOOTH_OF_TOTEM))
+ {
+ htmltext = "30034-02.htm";
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TOOTH_OF_TOTEM, 1);
+ st.giveItems(LETTER_OF_IRIS, 1);
+ }
+ break;
}
- }
- else if (event.equals("30034-06a.htm"))
- {
- if (st.getQuestItemsCount(TOOTH_OF_DRAGON) >= 50)
+ case "30344-02a.htm":
{
- final int position = Rnd.get(REWARD.length);
- htmltext = "30034-06.htm";
- st.takeItems(TOOTH_OF_DRAGON, 50);
- st.giveItems(REWARD[position][0], 1);
- st.rewardItems(57, REWARD[position][1]);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ if (st.hasQuestItems(LETTER_OF_IRIS))
+ {
+ htmltext = "30344-02.htm";
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_OF_IRIS, 1);
+ st.giveItems(LETTER_OF_ROHMER, 1);
+ }
+ break;
+ }
+ case "30034-04a.htm":
+ {
+ if (st.hasQuestItems(LETTER_OF_ROHMER))
+ {
+ htmltext = "30034-04.htm";
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_OF_ROHMER, 1);
+ }
+ break;
+ }
+ case "30034-06a.htm":
+ {
+ if (st.getQuestItemsCount(TOOTH_OF_DRAGON) >= 50)
+ {
+ final int position = Rnd.get(REWARD.length);
+ htmltext = "30034-06.htm";
+ st.takeItems(TOOTH_OF_DRAGON, 50);
+ st.giveItems(REWARD[position][0], 1);
+ st.rewardItems(57, REWARD[position][1]);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
}
}
@@ -199,7 +165,7 @@ public class Q038_DragonFangs extends Quest
break;
case State.STARTED:
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LUIS:
@@ -271,9 +237,9 @@ public class Q038_DragonFangs extends Quest
}
final int[] droplist = DROPLIST.get(npc.getNpcId());
- if ((st.getInt("cond") == droplist[0]) && st.dropItems(droplist[1], 1, droplist[2], droplist[3]))
+ if (st.isCond(droplist[0]) && st.dropItems(droplist[1], 1, droplist[2], droplist[3]))
{
- st.set("cond", String.valueOf(droplist[0] + 1));
+ st.setCond(droplist[0] + 1);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q039_RedEyedInvaders/Q039_RedEyedInvaders.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q039_RedEyedInvaders/Q039_RedEyedInvaders.java
index e0cc882419..09221f8861 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q039_RedEyedInvaders/Q039_RedEyedInvaders.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q039_RedEyedInvaders/Q039_RedEyedInvaders.java
@@ -30,64 +30,34 @@ public class Q039_RedEyedInvaders extends Quest
// NPCs
private static final int BABENCO = 30334;
private static final int BATHIS = 30332;
-
- // Mobs
+ // Monsters
private static final int MAILLE_LIZARDMAN = 20919;
private static final int MAILLE_LIZARDMAN_SCOUT = 20920;
private static final int MAILLE_LIZARDMAN_GUARD = 20921;
private static final int ARANEID = 20925;
-
// Items
private static final int BLACK_BONE_NECKLACE = 7178;
private static final int RED_BONE_NECKLACE = 7179;
private static final int INCENSE_POUCH = 7180;
private static final int GEM_OF_MAILLE = 7181;
-
+ // @formatter:off
// First droplist
private static final Map FIRST_DP = new HashMap<>();
static
{
- FIRST_DP.put(MAILLE_LIZARDMAN_GUARD, new int[]
- {
- RED_BONE_NECKLACE,
- BLACK_BONE_NECKLACE
- });
- FIRST_DP.put(MAILLE_LIZARDMAN, new int[]
- {
- BLACK_BONE_NECKLACE,
- RED_BONE_NECKLACE
- });
- FIRST_DP.put(MAILLE_LIZARDMAN_SCOUT, new int[]
- {
- BLACK_BONE_NECKLACE,
- RED_BONE_NECKLACE
- });
+ FIRST_DP.put(MAILLE_LIZARDMAN_GUARD, new int[]{RED_BONE_NECKLACE, BLACK_BONE_NECKLACE});
+ FIRST_DP.put(MAILLE_LIZARDMAN, new int[]{BLACK_BONE_NECKLACE, RED_BONE_NECKLACE});
+ FIRST_DP.put(MAILLE_LIZARDMAN_SCOUT, new int[]{BLACK_BONE_NECKLACE, RED_BONE_NECKLACE});
}
-
// Second droplist
private static final Map SECOND_DP = new HashMap<>();
static
{
- SECOND_DP.put(ARANEID, new int[]
- {
- GEM_OF_MAILLE,
- INCENSE_POUCH,
- 500000
- });
- SECOND_DP.put(MAILLE_LIZARDMAN_GUARD, new int[]
- {
- INCENSE_POUCH,
- GEM_OF_MAILLE,
- 300000
- });
- SECOND_DP.put(MAILLE_LIZARDMAN_SCOUT, new int[]
- {
- INCENSE_POUCH,
- GEM_OF_MAILLE,
- 250000
- });
+ SECOND_DP.put(ARANEID, new int[]{GEM_OF_MAILLE, INCENSE_POUCH, 500000});
+ SECOND_DP.put(MAILLE_LIZARDMAN_GUARD, new int[]{INCENSE_POUCH, GEM_OF_MAILLE, 300000});
+ SECOND_DP.put(MAILLE_LIZARDMAN_SCOUT, new int[]{INCENSE_POUCH, GEM_OF_MAILLE, 250000});
}
-
+ // @formatter:on
// Rewards
private static final int GREEN_COLORED_LURE_HG = 6521;
private static final int BABY_DUCK_RODE = 6529;
@@ -96,12 +66,9 @@ public class Q039_RedEyedInvaders extends Quest
public Q039_RedEyedInvaders()
{
super(39, "Red-Eyed Invaders");
-
registerQuestItems(BLACK_BONE_NECKLACE, RED_BONE_NECKLACE, INCENSE_POUCH, GEM_OF_MAILLE);
-
addStartNpc(BABENCO);
addTalkId(BABENCO, BATHIS);
-
addKillId(MAILLE_LIZARDMAN, MAILLE_LIZARDMAN_SCOUT, MAILLE_LIZARDMAN_GUARD, ARANEID);
}
@@ -115,33 +82,38 @@ public class Q039_RedEyedInvaders extends Quest
return htmltext;
}
- if (event.equals("30334-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30332-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30332-3.htm"))
- {
- st.set("cond", "4");
- st.takeItems(BLACK_BONE_NECKLACE, -1);
- st.takeItems(RED_BONE_NECKLACE, -1);
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30332-5.htm"))
- {
- st.takeItems(INCENSE_POUCH, -1);
- st.takeItems(GEM_OF_MAILLE, -1);
- st.giveItems(GREEN_COLORED_LURE_HG, 60);
- st.giveItems(BABY_DUCK_RODE, 1);
- st.giveItems(FISHING_SHOT_NG, 500);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30334-1.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30332-1.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30332-3.htm":
+ {
+ st.setCond(4);
+ st.takeItems(BLACK_BONE_NECKLACE, -1);
+ st.takeItems(RED_BONE_NECKLACE, -1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30332-5.htm":
+ {
+ st.takeItems(INCENSE_POUCH, -1);
+ st.takeItems(GEM_OF_MAILLE, -1);
+ st.giveItems(GREEN_COLORED_LURE_HG, 60);
+ st.giveItems(BABY_DUCK_RODE, 1);
+ st.giveItems(FISHING_SHOT_NG, 500);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -160,18 +132,22 @@ public class Q039_RedEyedInvaders extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "30334-2.htm" : "30334-0.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BABENCO:
+ {
htmltext = "30334-3.htm";
break;
-
+ }
case BATHIS:
+ {
if (cond == 1)
{
htmltext = "30332-0.htm";
@@ -193,12 +169,15 @@ public class Q039_RedEyedInvaders extends Quest
htmltext = "30332-4.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -208,7 +187,7 @@ public class Q039_RedEyedInvaders extends Quest
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
final int npcId = npc.getNpcId();
- PlayerInstance partyMember = getRandomPartyMember(player, npc, "2");
+ PlayerInstance partyMember = getRandomPartyMember(player, npc, 2);
if ((partyMember != null) && (npcId != ARANEID))
{
final QuestState st = partyMember.getQuestState(getName());
@@ -220,12 +199,12 @@ public class Q039_RedEyedInvaders extends Quest
final int[] list = FIRST_DP.get(npcId);
if (st.dropItems(list[0], 1, 100, 500000) && (st.getQuestItemsCount(list[1]) == 100))
{
- st.set("cond", "3");
+ st.setCond(3);
}
}
else
{
- partyMember = getRandomPartyMember(player, npc, "4");
+ partyMember = getRandomPartyMember(player, npc, 4);
if ((partyMember != null) && (npcId != MAILLE_LIZARDMAN))
{
final QuestState st = partyMember.getQuestState(getName());
@@ -237,7 +216,7 @@ public class Q039_RedEyedInvaders extends Quest
final int[] list = SECOND_DP.get(npcId);
if (st.dropItems(list[0], 1, 30, list[2]) && (st.getQuestItemsCount(list[1]) == 30))
{
- st.set("cond", "5");
+ st.setCond(5);
}
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q042_HelpTheUncle/Q042_HelpTheUncle.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q042_HelpTheUncle/Q042_HelpTheUncle.java
index 4dc07a0770..6ab65bbd8a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q042_HelpTheUncle/Q042_HelpTheUncle.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q042_HelpTheUncle/Q042_HelpTheUncle.java
@@ -27,26 +27,21 @@ public class Q042_HelpTheUncle extends Quest
// NPCs
private static final int WATERS = 30828;
private static final int SOPHYA = 30735;
-
+ // Monsters
+ private static final int MONSTER_EYE_DESTROYER = 20068;
+ private static final int MONSTER_EYE_GAZER = 20266;
// Items
private static final int TRIDENT = 291;
private static final int MAP_PIECE = 7548;
private static final int MAP = 7549;
private static final int PET_TICKET = 7583;
- // Monsters
- private static final int MONSTER_EYE_DESTROYER = 20068;
- private static final int MONSTER_EYE_GAZER = 20266;
-
public Q042_HelpTheUncle()
{
super(42, "Help the Uncle!");
-
registerQuestItems(MAP_PIECE, MAP);
-
addStartNpc(WATERS);
addTalkId(WATERS, SOPHYA);
-
addKillId(MONSTER_EYE_DESTROYER, MONSTER_EYE_GAZER);
}
@@ -60,36 +55,45 @@ public class Q042_HelpTheUncle extends Quest
return htmltext;
}
- if (event.equals("30828-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30828-03.htm") && st.hasQuestItems(TRIDENT))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TRIDENT, 1);
- }
- else if (event.equals("30828-05.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAP_PIECE, 30);
- st.giveItems(MAP, 1);
- }
- else if (event.equals("30735-06.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAP, 1);
- }
- else if (event.equals("30828-07.htm"))
- {
- st.giveItems(PET_TICKET, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30828-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30828-03.htm":
+ {
+ if (st.hasQuestItems(TRIDENT))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TRIDENT, 1);
+ }
+ break;
+ }
+ case "30828-05.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAP_PIECE, 30);
+ st.giveItems(MAP, 1);
+ break;
+ }
+ case "30735-06.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAP, 1);
+ break;
+ }
+ case "30828-07.htm":
+ {
+ st.giveItems(PET_TICKET, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -108,14 +112,17 @@ public class Q042_HelpTheUncle extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 25) ? "30828-00a.htm" : "30828-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case WATERS:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(TRIDENT)) ? "30828-01a.htm" : "30828-02.htm";
@@ -137,8 +144,9 @@ public class Q042_HelpTheUncle extends Quest
htmltext = "30828-06.htm";
}
break;
-
+ }
case SOPHYA:
+ {
if (cond == 4)
{
htmltext = "30735-05.htm";
@@ -148,12 +156,15 @@ public class Q042_HelpTheUncle extends Quest
htmltext = "30735-06a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -162,7 +173,7 @@ public class Q042_HelpTheUncle extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -170,7 +181,7 @@ public class Q042_HelpTheUncle extends Quest
if (st.dropItemsAlways(MAP_PIECE, 1, 30))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q043_HelpTheSister/Q043_HelpTheSister.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q043_HelpTheSister/Q043_HelpTheSister.java
index 78b9b411d7..5217997f98 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q043_HelpTheSister/Q043_HelpTheSister.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q043_HelpTheSister/Q043_HelpTheSister.java
@@ -27,26 +27,21 @@ public class Q043_HelpTheSister extends Quest
// NPCs
private static final int COOPER = 30829;
private static final int GALLADUCCI = 30097;
-
+ // Monsters
+ private static final int SPECTER = 20171;
+ private static final int SORROW_MAIDEN = 20197;
// Items
private static final int CRAFTED_DAGGER = 220;
private static final int MAP_PIECE = 7550;
private static final int MAP = 7551;
private static final int PET_TICKET = 7584;
- // Monsters
- private static final int SPECTER = 20171;
- private static final int SORROW_MAIDEN = 20197;
-
public Q043_HelpTheSister()
{
super(43, "Help the Sister!");
-
registerQuestItems(MAP_PIECE, MAP);
-
addStartNpc(COOPER);
addTalkId(COOPER, GALLADUCCI);
-
addKillId(SPECTER, SORROW_MAIDEN);
}
@@ -60,36 +55,45 @@ public class Q043_HelpTheSister extends Quest
return htmltext;
}
- if (event.equals("30829-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30829-03.htm") && st.hasQuestItems(CRAFTED_DAGGER))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRAFTED_DAGGER, 1);
- }
- else if (event.equals("30829-05.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAP_PIECE, 30);
- st.giveItems(MAP, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAP, 1);
- }
- else if (event.equals("30829-07.htm"))
- {
- st.giveItems(PET_TICKET, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30829-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30829-03.htm":
+ {
+ if (st.hasQuestItems(CRAFTED_DAGGER))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRAFTED_DAGGER, 1);
+ }
+ break;
+ }
+ case "30829-05.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAP_PIECE, 30);
+ st.giveItems(MAP, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAP, 1);
+ break;
+ }
+ case "30829-07.htm":
+ {
+ st.giveItems(PET_TICKET, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -108,14 +112,17 @@ public class Q043_HelpTheSister extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 26) ? "30829-00a.htm" : "30829-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case COOPER:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(CRAFTED_DAGGER)) ? "30829-01a.htm" : "30829-02.htm";
@@ -137,8 +144,9 @@ public class Q043_HelpTheSister extends Quest
htmltext = "30829-06.htm";
}
break;
-
+ }
case GALLADUCCI:
+ {
if (cond == 4)
{
htmltext = "30097-05.htm";
@@ -148,12 +156,15 @@ public class Q043_HelpTheSister extends Quest
htmltext = "30097-06a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -162,7 +173,7 @@ public class Q043_HelpTheSister extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -170,7 +181,7 @@ public class Q043_HelpTheSister extends Quest
if (st.dropItemsAlways(MAP_PIECE, 1, 30))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q044_HelpTheSon/Q044_HelpTheSon.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q044_HelpTheSon/Q044_HelpTheSon.java
index 3f83b360bb..8ef336f2d7 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q044_HelpTheSon/Q044_HelpTheSon.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q044_HelpTheSon/Q044_HelpTheSon.java
@@ -24,30 +24,25 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q044_HelpTheSon extends Quest
{
- // Npcs
+ // NPCs
private static final int LUNDY = 30827;
private static final int DRIKUS = 30505;
-
+ // Monsters
+ private static final int MAILLE = 20919;
+ private static final int MAILLE_SCOUT = 20920;
+ private static final int MAILLE_GUARD = 20921;
// Items
private static final int WORK_HAMMER = 168;
private static final int GEMSTONE_FRAGMENT = 7552;
private static final int GEMSTONE = 7553;
private static final int PET_TICKET = 7585;
- // Monsters
- private static final int MAILLE = 20919;
- private static final int MAILLE_SCOUT = 20920;
- private static final int MAILLE_GUARD = 20921;
-
public Q044_HelpTheSon()
{
super(44, "Help the Son!");
-
registerQuestItems(GEMSTONE_FRAGMENT, GEMSTONE);
-
addStartNpc(LUNDY);
addTalkId(LUNDY, DRIKUS);
-
addKillId(MAILLE, MAILLE_SCOUT, MAILLE_GUARD);
}
@@ -61,36 +56,45 @@ public class Q044_HelpTheSon extends Quest
return htmltext;
}
- if (event.equals("30827-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30827-03.htm") && st.hasQuestItems(WORK_HAMMER))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WORK_HAMMER, 1);
- }
- else if (event.equals("30827-05.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_FRAGMENT, 30);
- st.giveItems(GEMSTONE, 1);
- }
- else if (event.equals("30505-06.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE, 1);
- }
- else if (event.equals("30827-07.htm"))
- {
- st.giveItems(PET_TICKET, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30827-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30827-03.htm":
+ {
+ if (st.hasQuestItems(WORK_HAMMER))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WORK_HAMMER, 1);
+ }
+ break;
+ }
+ case "30827-05.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_FRAGMENT, 30);
+ st.giveItems(GEMSTONE, 1);
+ break;
+ }
+ case "30505-06.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE, 1);
+ break;
+ }
+ case "30827-07.htm":
+ {
+ st.giveItems(PET_TICKET, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -109,14 +113,17 @@ public class Q044_HelpTheSon extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 24) ? "30827-00a.htm" : "30827-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LUNDY:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(WORK_HAMMER)) ? "30827-01a.htm" : "30827-02.htm";
@@ -138,8 +145,9 @@ public class Q044_HelpTheSon extends Quest
htmltext = "30827-06.htm";
}
break;
-
+ }
case DRIKUS:
+ {
if (cond == 4)
{
htmltext = "30505-05.htm";
@@ -149,12 +157,15 @@ public class Q044_HelpTheSon extends Quest
htmltext = "30505-06a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -163,7 +174,7 @@ public class Q044_HelpTheSon extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -171,7 +182,7 @@ public class Q044_HelpTheSon extends Quest
if (st.dropItemsAlways(GEMSTONE_FRAGMENT, 1, 30))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q045_ToTalkingIsland/Q045_ToTalkingIsland.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q045_ToTalkingIsland/Q045_ToTalkingIsland.java
index 2f93f4d3f5..c681299bf0 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q045_ToTalkingIsland/Q045_ToTalkingIsland.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q045_ToTalkingIsland/Q045_ToTalkingIsland.java
@@ -21,12 +21,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q045_ToTalkingIsland extends Quest
{
- // Npcs
+ // NPCs
private static final int GALLADUCCI = 30097;
private static final int GENTLER = 30094;
private static final int SANDRA = 30090;
private static final int DUSTIN = 30116;
-
// Items
private static final int ORDER_DOCUMENT_1 = 7563;
private static final int ORDER_DOCUMENT_2 = 7564;
@@ -40,9 +39,7 @@ public class Q045_ToTalkingIsland extends Quest
public Q045_ToTalkingIsland()
{
super(45, "To Talking Island");
-
registerQuestItems(ORDER_DOCUMENT_1, ORDER_DOCUMENT_2, ORDER_DOCUMENT_3, MAGIC_SWORD_HILT, GEMSTONE_POWDER, PURIFIED_MAGIC_NECKLACE);
-
addStartNpc(GALLADUCCI);
addTalkId(GALLADUCCI, GENTLER, SANDRA, DUSTIN);
}
@@ -57,55 +54,63 @@ public class Q045_ToTalkingIsland extends Quest
return htmltext;
}
- if (event.equals("30097-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_DOCUMENT_1, 1);
- }
- else if (event.equals("30094-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_1, 1);
- st.giveItems(MAGIC_SWORD_HILT, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAGIC_SWORD_HILT, 1);
- st.giveItems(ORDER_DOCUMENT_2, 1);
- }
- else if (event.equals("30090-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_2, 1);
- st.giveItems(GEMSTONE_POWDER, 1);
- }
- else if (event.equals("30097-09.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_POWDER, 1);
- st.giveItems(ORDER_DOCUMENT_3, 1);
- }
- else if (event.equals("30116-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_3, 1);
- st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
- }
- else if (event.equals("30097-12.htm"))
- {
- st.takeItems(MARK_OF_TRAVELER, -1);
- st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
- st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30097-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(ORDER_DOCUMENT_1, 1);
+ break;
+ }
+ case "30094-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_1, 1);
+ st.giveItems(MAGIC_SWORD_HILT, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAGIC_SWORD_HILT, 1);
+ st.giveItems(ORDER_DOCUMENT_2, 1);
+ break;
+ }
+ case "30090-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_2, 1);
+ st.giveItems(GEMSTONE_POWDER, 1);
+ break;
+ }
+ case "30097-09.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_POWDER, 1);
+ st.giveItems(ORDER_DOCUMENT_3, 1);
+ break;
+ }
+ case "30116-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_3, 1);
+ st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
+ break;
+ }
+ case "30097-12.htm":
+ {
+ st.takeItems(MARK_OF_TRAVELER, -1);
+ st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
+ st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -124,6 +129,7 @@ public class Q045_ToTalkingIsland extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() == Race.HUMAN) && (player.getLevel() >= 3))
{
if (st.hasQuestItems(MARK_OF_TRAVELER))
@@ -140,12 +146,14 @@ public class Q045_ToTalkingIsland extends Quest
htmltext = "30097-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLADUCCI:
+ {
if (cond == 1)
{
htmltext = "30097-04.htm";
@@ -171,8 +179,9 @@ public class Q045_ToTalkingIsland extends Quest
htmltext = "30097-11.htm";
}
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-01.htm";
@@ -182,8 +191,9 @@ public class Q045_ToTalkingIsland extends Quest
htmltext = "30094-03.htm";
}
break;
-
+ }
case SANDRA:
+ {
if (cond == 3)
{
htmltext = "30090-01.htm";
@@ -193,8 +203,9 @@ public class Q045_ToTalkingIsland extends Quest
htmltext = "30090-03.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 5)
{
htmltext = "30116-01.htm";
@@ -204,12 +215,15 @@ public class Q045_ToTalkingIsland extends Quest
htmltext = "30116-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q046_OnceMoreInTheArmsOfTheMotherTree/Q046_OnceMoreInTheArmsOfTheMotherTree.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q046_OnceMoreInTheArmsOfTheMotherTree/Q046_OnceMoreInTheArmsOfTheMotherTree.java
index b5a3db7797..5952a8521f 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q046_OnceMoreInTheArmsOfTheMotherTree/Q046_OnceMoreInTheArmsOfTheMotherTree.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q046_OnceMoreInTheArmsOfTheMotherTree/Q046_OnceMoreInTheArmsOfTheMotherTree.java
@@ -30,7 +30,6 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
private static final int GENTLER = 30094;
private static final int SANDRA = 30090;
private static final int DUSTIN = 30116;
-
// Items
private static final int ORDER_DOCUMENT_1 = 7563;
private static final int ORDER_DOCUMENT_2 = 7564;
@@ -44,9 +43,7 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
public Q046_OnceMoreInTheArmsOfTheMotherTree()
{
super(46, "Once More In the Arms of the Mother Tree");
-
registerQuestItems(ORDER_DOCUMENT_1, ORDER_DOCUMENT_2, ORDER_DOCUMENT_3, MAGIC_SWORD_HILT, GEMSTONE_POWDER, PURIFIED_MAGIC_NECKLACE);
-
addStartNpc(GALLADUCCI);
addTalkId(GALLADUCCI, GENTLER, SANDRA, DUSTIN);
}
@@ -61,55 +58,63 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
return htmltext;
}
- if (event.equals("30097-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_DOCUMENT_1, 1);
- }
- else if (event.equals("30094-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_1, 1);
- st.giveItems(MAGIC_SWORD_HILT, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAGIC_SWORD_HILT, 1);
- st.giveItems(ORDER_DOCUMENT_2, 1);
- }
- else if (event.equals("30090-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_2, 1);
- st.giveItems(GEMSTONE_POWDER, 1);
- }
- else if (event.equals("30097-09.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_POWDER, 1);
- st.giveItems(ORDER_DOCUMENT_3, 1);
- }
- else if (event.equals("30116-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_3, 1);
- st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
- }
- else if (event.equals("30097-12.htm"))
- {
- st.takeItems(MARK_OF_TRAVELER, -1);
- st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
- st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30097-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(ORDER_DOCUMENT_1, 1);
+ break;
+ }
+ case "30094-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_1, 1);
+ st.giveItems(MAGIC_SWORD_HILT, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAGIC_SWORD_HILT, 1);
+ st.giveItems(ORDER_DOCUMENT_2, 1);
+ break;
+ }
+ case "30090-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_2, 1);
+ st.giveItems(GEMSTONE_POWDER, 1);
+ break;
+ }
+ case "30097-09.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_POWDER, 1);
+ st.giveItems(ORDER_DOCUMENT_3, 1);
+ break;
+ }
+ case "30116-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_3, 1);
+ st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
+ break;
+ }
+ case "30097-12.htm":
+ {
+ st.takeItems(MARK_OF_TRAVELER, -1);
+ st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
+ st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -128,6 +133,7 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() == Race.ELF) && (player.getLevel() >= 3))
{
if (st.hasQuestItems(MARK_OF_TRAVELER))
@@ -144,12 +150,14 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
htmltext = "30097-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLADUCCI:
+ {
if (cond == 1)
{
htmltext = "30097-04.htm";
@@ -175,8 +183,9 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
htmltext = "30097-11.htm";
}
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-01.htm";
@@ -186,8 +195,9 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
htmltext = "30094-03.htm";
}
break;
-
+ }
case SANDRA:
+ {
if (cond == 3)
{
htmltext = "30090-01.htm";
@@ -197,8 +207,9 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
htmltext = "30090-03.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 5)
{
htmltext = "30116-01.htm";
@@ -208,12 +219,15 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
htmltext = "30116-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q047_IntoTheDarkForest/Q047_IntoTheDarkForest.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q047_IntoTheDarkForest/Q047_IntoTheDarkForest.java
index 1ba040fd6f..a02ce8334d 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q047_IntoTheDarkForest/Q047_IntoTheDarkForest.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q047_IntoTheDarkForest/Q047_IntoTheDarkForest.java
@@ -30,7 +30,6 @@ public class Q047_IntoTheDarkForest extends Quest
private static final int GENTLER = 30094;
private static final int SANDRA = 30090;
private static final int DUSTIN = 30116;
-
// Items
private static final int ORDER_DOCUMENT_1 = 7563;
private static final int ORDER_DOCUMENT_2 = 7564;
@@ -44,9 +43,7 @@ public class Q047_IntoTheDarkForest extends Quest
public Q047_IntoTheDarkForest()
{
super(47, "Into the Dark Forest");
-
registerQuestItems(ORDER_DOCUMENT_1, ORDER_DOCUMENT_2, ORDER_DOCUMENT_3, MAGIC_SWORD_HILT, GEMSTONE_POWDER, PURIFIED_MAGIC_NECKLACE);
-
addStartNpc(GALLADUCCI);
addTalkId(GALLADUCCI, SANDRA, DUSTIN, GENTLER);
}
@@ -61,55 +58,63 @@ public class Q047_IntoTheDarkForest extends Quest
return htmltext;
}
- if (event.equals("30097-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_DOCUMENT_1, 1);
- }
- else if (event.equals("30094-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_1, 1);
- st.giveItems(MAGIC_SWORD_HILT, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAGIC_SWORD_HILT, 1);
- st.giveItems(ORDER_DOCUMENT_2, 1);
- }
- else if (event.equals("30090-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_2, 1);
- st.giveItems(GEMSTONE_POWDER, 1);
- }
- else if (event.equals("30097-09.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_POWDER, 1);
- st.giveItems(ORDER_DOCUMENT_3, 1);
- }
- else if (event.equals("30116-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_3, 1);
- st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
- }
- else if (event.equals("30097-12.htm"))
- {
- st.takeItems(MARK_OF_TRAVELER, -1);
- st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
- st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30097-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(ORDER_DOCUMENT_1, 1);
+ break;
+ }
+ case "30094-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_1, 1);
+ st.giveItems(MAGIC_SWORD_HILT, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAGIC_SWORD_HILT, 1);
+ st.giveItems(ORDER_DOCUMENT_2, 1);
+ break;
+ }
+ case "30090-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_2, 1);
+ st.giveItems(GEMSTONE_POWDER, 1);
+ break;
+ }
+ case "30097-09.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_POWDER, 1);
+ st.giveItems(ORDER_DOCUMENT_3, 1);
+ break;
+ }
+ case "30116-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_3, 1);
+ st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
+ break;
+ }
+ case "30097-12.htm":
+ {
+ st.takeItems(MARK_OF_TRAVELER, -1);
+ st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
+ st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -128,6 +133,7 @@ public class Q047_IntoTheDarkForest extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() == Race.DARK_ELF) && (player.getLevel() >= 3))
{
if (st.hasQuestItems(MARK_OF_TRAVELER))
@@ -144,12 +150,14 @@ public class Q047_IntoTheDarkForest extends Quest
htmltext = "30097-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLADUCCI:
+ {
if (cond == 1)
{
htmltext = "30097-04.htm";
@@ -175,8 +183,9 @@ public class Q047_IntoTheDarkForest extends Quest
htmltext = "30097-11.htm";
}
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-01.htm";
@@ -186,8 +195,9 @@ public class Q047_IntoTheDarkForest extends Quest
htmltext = "30094-03.htm";
}
break;
-
+ }
case SANDRA:
+ {
if (cond == 3)
{
htmltext = "30090-01.htm";
@@ -197,8 +207,9 @@ public class Q047_IntoTheDarkForest extends Quest
htmltext = "30090-03.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 5)
{
htmltext = "30116-01.htm";
@@ -208,12 +219,15 @@ public class Q047_IntoTheDarkForest extends Quest
htmltext = "30116-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q048_ToTheImmortalPlateau/Q048_ToTheImmortalPlateau.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q048_ToTheImmortalPlateau/Q048_ToTheImmortalPlateau.java
index 1772cbb811..d92c97f567 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q048_ToTheImmortalPlateau/Q048_ToTheImmortalPlateau.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q048_ToTheImmortalPlateau/Q048_ToTheImmortalPlateau.java
@@ -30,7 +30,6 @@ public class Q048_ToTheImmortalPlateau extends Quest
private static final int GENTLER = 30094;
private static final int SANDRA = 30090;
private static final int DUSTIN = 30116;
-
// Items
private static final int ORDER_DOCUMENT_1 = 7563;
private static final int ORDER_DOCUMENT_2 = 7564;
@@ -44,9 +43,7 @@ public class Q048_ToTheImmortalPlateau extends Quest
public Q048_ToTheImmortalPlateau()
{
super(48, "To the Immortal Plateau");
-
registerQuestItems(ORDER_DOCUMENT_1, ORDER_DOCUMENT_2, ORDER_DOCUMENT_3, MAGIC_SWORD_HILT, GEMSTONE_POWDER, PURIFIED_MAGIC_NECKLACE);
-
addStartNpc(GALLADUCCI);
addTalkId(GALLADUCCI, SANDRA, DUSTIN, GENTLER);
}
@@ -61,55 +58,63 @@ public class Q048_ToTheImmortalPlateau extends Quest
return htmltext;
}
- if (event.equals("30097-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_DOCUMENT_1, 1);
- }
- else if (event.equals("30094-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_1, 1);
- st.giveItems(MAGIC_SWORD_HILT, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAGIC_SWORD_HILT, 1);
- st.giveItems(ORDER_DOCUMENT_2, 1);
- }
- else if (event.equals("30090-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_2, 1);
- st.giveItems(GEMSTONE_POWDER, 1);
- }
- else if (event.equals("30097-09.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_POWDER, 1);
- st.giveItems(ORDER_DOCUMENT_3, 1);
- }
- else if (event.equals("30116-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_3, 1);
- st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
- }
- else if (event.equals("30097-12.htm"))
- {
- st.takeItems(MARK_OF_TRAVELER, -1);
- st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
- st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30097-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(ORDER_DOCUMENT_1, 1);
+ break;
+ }
+ case "30094-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_1, 1);
+ st.giveItems(MAGIC_SWORD_HILT, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAGIC_SWORD_HILT, 1);
+ st.giveItems(ORDER_DOCUMENT_2, 1);
+ break;
+ }
+ case "30090-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_2, 1);
+ st.giveItems(GEMSTONE_POWDER, 1);
+ break;
+ }
+ case "30097-09.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_POWDER, 1);
+ st.giveItems(ORDER_DOCUMENT_3, 1);
+ break;
+ }
+ case "30116-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_3, 1);
+ st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
+ break;
+ }
+ case "30097-12.htm":
+ {
+ st.takeItems(MARK_OF_TRAVELER, -1);
+ st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
+ st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -128,6 +133,7 @@ public class Q048_ToTheImmortalPlateau extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() == Race.ORC) && (player.getLevel() >= 3))
{
if (st.hasQuestItems(MARK_OF_TRAVELER))
@@ -144,12 +150,14 @@ public class Q048_ToTheImmortalPlateau extends Quest
htmltext = "30097-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLADUCCI:
+ {
if (cond == 1)
{
htmltext = "30097-04.htm";
@@ -175,8 +183,9 @@ public class Q048_ToTheImmortalPlateau extends Quest
htmltext = "30097-11.htm";
}
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-01.htm";
@@ -186,8 +195,9 @@ public class Q048_ToTheImmortalPlateau extends Quest
htmltext = "30094-03.htm";
}
break;
-
+ }
case SANDRA:
+ {
if (cond == 3)
{
htmltext = "30090-01.htm";
@@ -197,8 +207,9 @@ public class Q048_ToTheImmortalPlateau extends Quest
htmltext = "30090-03.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 5)
{
htmltext = "30116-01.htm";
@@ -208,12 +219,15 @@ public class Q048_ToTheImmortalPlateau extends Quest
htmltext = "30116-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q049_TheRoadHome/Q049_TheRoadHome.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q049_TheRoadHome/Q049_TheRoadHome.java
index 0d15347c76..328b4903fc 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q049_TheRoadHome/Q049_TheRoadHome.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q049_TheRoadHome/Q049_TheRoadHome.java
@@ -30,7 +30,6 @@ public class Q049_TheRoadHome extends Quest
private static final int GENTLER = 30094;
private static final int SANDRA = 30090;
private static final int DUSTIN = 30116;
-
// Items
private static final int ORDER_DOCUMENT_1 = 7563;
private static final int ORDER_DOCUMENT_2 = 7564;
@@ -44,9 +43,7 @@ public class Q049_TheRoadHome extends Quest
public Q049_TheRoadHome()
{
super(49, "The Road Home");
-
registerQuestItems(ORDER_DOCUMENT_1, ORDER_DOCUMENT_2, ORDER_DOCUMENT_3, MAGIC_SWORD_HILT, GEMSTONE_POWDER, PURIFIED_MAGIC_NECKLACE);
-
addStartNpc(GALLADUCCI);
addTalkId(GALLADUCCI, GENTLER, SANDRA, DUSTIN);
}
@@ -61,55 +58,63 @@ public class Q049_TheRoadHome extends Quest
return htmltext;
}
- if (event.equals("30097-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_DOCUMENT_1, 1);
- }
- else if (event.equals("30094-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_1, 1);
- st.giveItems(MAGIC_SWORD_HILT, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAGIC_SWORD_HILT, 1);
- st.giveItems(ORDER_DOCUMENT_2, 1);
- }
- else if (event.equals("30090-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_2, 1);
- st.giveItems(GEMSTONE_POWDER, 1);
- }
- else if (event.equals("30097-09.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_POWDER, 1);
- st.giveItems(ORDER_DOCUMENT_3, 1);
- }
- else if (event.equals("30116-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_3, 1);
- st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
- }
- else if (event.equals("30097-12.htm"))
- {
- st.takeItems(MARK_OF_TRAVELER, -1);
- st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
- st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30097-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(ORDER_DOCUMENT_1, 1);
+ break;
+ }
+ case "30094-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_1, 1);
+ st.giveItems(MAGIC_SWORD_HILT, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAGIC_SWORD_HILT, 1);
+ st.giveItems(ORDER_DOCUMENT_2, 1);
+ break;
+ }
+ case "30090-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_2, 1);
+ st.giveItems(GEMSTONE_POWDER, 1);
+ break;
+ }
+ case "30097-09.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_POWDER, 1);
+ st.giveItems(ORDER_DOCUMENT_3, 1);
+ break;
+ }
+ case "30116-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_3, 1);
+ st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
+ break;
+ }
+ case "30097-12.htm":
+ {
+ st.takeItems(MARK_OF_TRAVELER, -1);
+ st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
+ st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -128,6 +133,7 @@ public class Q049_TheRoadHome extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() == Race.DWARF) && (player.getLevel() >= 3))
{
if (st.hasQuestItems(MARK_OF_TRAVELER))
@@ -144,12 +150,14 @@ public class Q049_TheRoadHome extends Quest
htmltext = "30097-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLADUCCI:
+ {
if (cond == 1)
{
htmltext = "30097-04.htm";
@@ -175,8 +183,9 @@ public class Q049_TheRoadHome extends Quest
htmltext = "30097-11.htm";
}
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-01.htm";
@@ -186,8 +195,9 @@ public class Q049_TheRoadHome extends Quest
htmltext = "30094-03.htm";
}
break;
-
+ }
case SANDRA:
+ {
if (cond == 3)
{
htmltext = "30090-01.htm";
@@ -197,8 +207,9 @@ public class Q049_TheRoadHome extends Quest
htmltext = "30090-03.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 5)
{
htmltext = "30116-01.htm";
@@ -208,12 +219,15 @@ public class Q049_TheRoadHome extends Quest
htmltext = "30116-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q050_LanoscosSpecialBait/Q050_LanoscosSpecialBait.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q050_LanoscosSpecialBait/Q050_LanoscosSpecialBait.java
index f40debe490..19e414fd6b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q050_LanoscosSpecialBait/Q050_LanoscosSpecialBait.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q050_LanoscosSpecialBait/Q050_LanoscosSpecialBait.java
@@ -26,19 +26,15 @@ public class Q050_LanoscosSpecialBait extends Quest
{
// Item
private static final int ESSENCE_OF_WIND = 7621;
-
// Reward
private static final int WIND_FISHING_LURE = 7610;
public Q050_LanoscosSpecialBait()
{
super(50, "Lanosco's Special Bait");
-
registerQuestItems(ESSENCE_OF_WIND);
-
addStartNpc(31570); // Lanosco
addTalkId(31570);
-
addKillId(21026); // Singing wind
}
@@ -54,9 +50,7 @@ public class Q050_LanoscosSpecialBait extends Quest
if (event.equals("31570-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31570-07.htm"))
{
@@ -83,16 +77,20 @@ public class Q050_LanoscosSpecialBait extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 27) ? "31570-02.htm" : "31570-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(ESSENCE_OF_WIND) == 100) ? "31570-04.htm" : "31570-05.htm";
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -101,7 +99,7 @@ public class Q050_LanoscosSpecialBait extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -109,7 +107,7 @@ public class Q050_LanoscosSpecialBait extends Quest
if (st.dropItems(ESSENCE_OF_WIND, 1, 100, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q051_OFullesSpecialBait/Q051_OFullesSpecialBait.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q051_OFullesSpecialBait/Q051_OFullesSpecialBait.java
index ab837bbb39..e374ee7874 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q051_OFullesSpecialBait/Q051_OFullesSpecialBait.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q051_OFullesSpecialBait/Q051_OFullesSpecialBait.java
@@ -26,19 +26,15 @@ public class Q051_OFullesSpecialBait extends Quest
{
// Item
private static final int LOST_BAIT = 7622;
-
// Reward
private static final int ICY_AIR_LURE = 7611;
public Q051_OFullesSpecialBait()
{
super(51, "O'Fulle's Special Bait");
-
registerQuestItems(LOST_BAIT);
-
addStartNpc(31572); // O'Fulle
addTalkId(31572);
-
addKillId(20552); // Fettered Soul
}
@@ -54,9 +50,7 @@ public class Q051_OFullesSpecialBait extends Quest
if (event.equals("31572-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31572-07.htm"))
{
@@ -83,16 +77,20 @@ public class Q051_OFullesSpecialBait extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 36) ? "31572-02.htm" : "31572-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(LOST_BAIT) == 100) ? "31572-04.htm" : "31572-05.htm";
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -101,7 +99,7 @@ public class Q051_OFullesSpecialBait extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -109,7 +107,7 @@ public class Q051_OFullesSpecialBait extends Quest
if (st.dropItemsAlways(LOST_BAIT, 1, 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q052_WilliesSpecialBait/Q052_WilliesSpecialBait.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q052_WilliesSpecialBait/Q052_WilliesSpecialBait.java
index 91cccf8b3e..c6d4bb43c3 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q052_WilliesSpecialBait/Q052_WilliesSpecialBait.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q052_WilliesSpecialBait/Q052_WilliesSpecialBait.java
@@ -26,19 +26,15 @@ public class Q052_WilliesSpecialBait extends Quest
{
// Item
private static final int TARLK_EYE = 7623;
-
// Reward
private static final int EARTH_FISHING_LURE = 7612;
public Q052_WilliesSpecialBait()
{
super(52, "Willie's Special Bait");
-
registerQuestItems(TARLK_EYE);
-
addStartNpc(31574); // Willie
addTalkId(31574);
-
addKillId(20573); // Tarlk Basilik
}
@@ -54,9 +50,7 @@ public class Q052_WilliesSpecialBait extends Quest
if (event.equals("31574-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31574-07.htm"))
{
@@ -83,16 +77,20 @@ public class Q052_WilliesSpecialBait extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 48) ? "31574-02.htm" : "31574-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(TARLK_EYE) == 100) ? "31574-04.htm" : "31574-05.htm";
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -101,7 +99,7 @@ public class Q052_WilliesSpecialBait extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -109,7 +107,7 @@ public class Q052_WilliesSpecialBait extends Quest
if (st.dropItems(TARLK_EYE, 1, 100, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q053_LinnaeusSpecialBait/Q053_LinnaeusSpecialBait.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q053_LinnaeusSpecialBait/Q053_LinnaeusSpecialBait.java
index 1e91c88ab3..e2ee0695f2 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q053_LinnaeusSpecialBait/Q053_LinnaeusSpecialBait.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q053_LinnaeusSpecialBait/Q053_LinnaeusSpecialBait.java
@@ -26,19 +26,15 @@ public class Q053_LinnaeusSpecialBait extends Quest
{
// Item
private static final int CRIMSON_DRAKE_HEART = 7624;
-
// Reward
private static final int FLAMING_FISHING_LURE = 7613;
public Q053_LinnaeusSpecialBait()
{
super(53, "Linnaeus' Special Bait");
-
registerQuestItems(CRIMSON_DRAKE_HEART);
-
addStartNpc(31577); // Linnaeus
addTalkId(31577);
-
addKillId(20670); // Crimson Drake
}
@@ -54,9 +50,7 @@ public class Q053_LinnaeusSpecialBait extends Quest
if (event.equals("31577-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31577-07.htm"))
{
@@ -83,16 +77,20 @@ public class Q053_LinnaeusSpecialBait extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "31577-02.htm" : "31577-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(CRIMSON_DRAKE_HEART) == 100) ? "31577-04.htm" : "31577-05.htm";
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -101,7 +99,7 @@ public class Q053_LinnaeusSpecialBait extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -109,7 +107,7 @@ public class Q053_LinnaeusSpecialBait extends Quest
if (st.dropItems(CRIMSON_DRAKE_HEART, 1, 100, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q101_SwordOfSolidarity/Q101_SwordOfSolidarity.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q101_SwordOfSolidarity/Q101_SwordOfSolidarity.java
index 862243f692..ef381812b4 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q101_SwordOfSolidarity/Q101_SwordOfSolidarity.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q101_SwordOfSolidarity/Q101_SwordOfSolidarity.java
@@ -29,7 +29,6 @@ public class Q101_SwordOfSolidarity extends Quest
// NPCs
private static final int ROIEN = 30008;
private static final int ALTRAN = 30283;
-
// Items
private static final int BROKEN_SWORD_HANDLE = 739;
private static final int BROKEN_BLADE_BOTTOM = 740;
@@ -37,7 +36,6 @@ public class Q101_SwordOfSolidarity extends Quest
private static final int ROIENS_LETTER = 796;
private static final int DIR_TO_RUINS = 937;
private static final int ALTRANS_NOTE = 742;
-
private static final int SWORD_OF_SOLIDARITY = 738;
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
@@ -51,12 +49,9 @@ public class Q101_SwordOfSolidarity extends Quest
public Q101_SwordOfSolidarity()
{
super(101, "Sword of Solidarity");
-
registerQuestItems(BROKEN_SWORD_HANDLE, BROKEN_BLADE_BOTTOM, BROKEN_BLADE_TOP);
-
addStartNpc(ROIEN);
addTalkId(ROIEN, ALTRAN);
-
addKillId(20361, 20362);
}
@@ -70,49 +65,51 @@ public class Q101_SwordOfSolidarity extends Quest
return htmltext;
}
- if (event.equals("30008-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ROIENS_LETTER, 1);
- }
- else if (event.equals("30283-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROIENS_LETTER, 1);
- st.giveItems(DIR_TO_RUINS, 1);
- }
- else if (event.equals("30283-06.htm"))
- {
- st.takeItems(BROKEN_SWORD_HANDLE, 1);
- st.giveItems(SWORD_OF_SOLIDARITY, 1);
- st.giveItems(LESSER_HEALING_POT, 100);
-
- if (player.isNewbie())
+ case "30008-03.htm":
{
- st.showQuestionMark(26);
- if (player.isMageClass())
- {
- st.playTutorialVoice("tutorial_voice_027");
- st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
- }
- else
- {
- st.playTutorialVoice("tutorial_voice_026");
- st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
- }
+ st.startQuest();
+ st.giveItems(ROIENS_LETTER, 1);
+ break;
+ }
+ case "30283-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ROIENS_LETTER, 1);
+ st.giveItems(DIR_TO_RUINS, 1);
+ break;
+ }
+ case "30283-06.htm":
+ {
+ st.takeItems(BROKEN_SWORD_HANDLE, 1);
+ st.giveItems(SWORD_OF_SOLIDARITY, 1);
+ st.giveItems(LESSER_HEALING_POT, 100);
+ if (player.isNewbie())
+ {
+ st.showQuestionMark(26);
+ if (player.isMageClass())
+ {
+ st.playTutorialVoice("tutorial_voice_027");
+ st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
+ }
+ else
+ {
+ st.playTutorialVoice("tutorial_voice_026");
+ st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
+ }
+ }
+ st.giveItems(ECHO_BATTLE, 10);
+ st.giveItems(ECHO_LOVE, 10);
+ st.giveItems(ECHO_SOLITUDE, 10);
+ st.giveItems(ECHO_FEAST, 10);
+ st.giveItems(ECHO_CELEBRATION, 10);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
}
-
- st.giveItems(ECHO_BATTLE, 10);
- st.giveItems(ECHO_LOVE, 10);
- st.giveItems(ECHO_SOLITUDE, 10);
- st.giveItems(ECHO_FEAST, 10);
- st.giveItems(ECHO_CELEBRATION, 10);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
}
return htmltext;
@@ -131,6 +128,7 @@ public class Q101_SwordOfSolidarity extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.HUMAN)
{
htmltext = "30008-01a.htm";
@@ -144,12 +142,14 @@ public class Q101_SwordOfSolidarity extends Quest
htmltext = "30008-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = (st.getInt("cond"));
+ {
+ final int cond = (st.getCond());
switch (npc.getNpcId())
{
case ROIEN:
+ {
if (cond == 1)
{
htmltext = "30008-04.htm";
@@ -165,7 +165,7 @@ public class Q101_SwordOfSolidarity extends Quest
else if (cond == 4)
{
htmltext = "30008-05.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALTRANS_NOTE, 1);
st.giveItems(BROKEN_SWORD_HANDLE, 1);
@@ -175,8 +175,9 @@ public class Q101_SwordOfSolidarity extends Quest
htmltext = "30008-05a.htm";
}
break;
-
+ }
case ALTRAN:
+ {
if (cond == 1)
{
htmltext = "30283-01.htm";
@@ -188,7 +189,7 @@ public class Q101_SwordOfSolidarity extends Quest
else if (cond == 3)
{
htmltext = "30283-04.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DIR_TO_RUINS, 1);
st.takeItems(BROKEN_BLADE_TOP, 1);
@@ -204,12 +205,15 @@ public class Q101_SwordOfSolidarity extends Quest
htmltext = "30283-05.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -218,7 +222,7 @@ public class Q101_SwordOfSolidarity extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -230,7 +234,7 @@ public class Q101_SwordOfSolidarity extends Quest
}
else if (st.dropItems(BROKEN_BLADE_BOTTOM, 1, 1, 200000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q102_SeaOfSporesFever/Q102_SeaOfSporesFever.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q102_SeaOfSporesFever/Q102_SeaOfSporesFever.java
index 4e29b6d68a..af1373979a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q102_SeaOfSporesFever/Q102_SeaOfSporesFever.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q102_SeaOfSporesFever/Q102_SeaOfSporesFever.java
@@ -26,6 +26,13 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q102_SeaOfSporesFever extends Quest
{
+ // NPCs
+ private static final int ALBERIUS = 30284;
+ private static final int COBENDELL = 30156;
+ private static final int BERROS = 30217;
+ private static final int VELTRESS = 30219;
+ private static final int RAYEN = 30221;
+ private static final int GARTRANDELL = 30285;
// Items
private static final int ALBERIUS_LETTER = 964;
private static final int EVERGREEN_AMULET = 965;
@@ -36,7 +43,6 @@ public class Q102_SeaOfSporesFever extends Quest
private static final int COBENDELL_MEDICINE_3 = 1132;
private static final int COBENDELL_MEDICINE_4 = 1133;
private static final int COBENDELL_MEDICINE_5 = 1134;
-
// Rewards
private static final int SPIRITSHOT_NO_GRADE = 2509;
private static final int SOULSHOT_NO_GRADE = 1835;
@@ -49,23 +55,12 @@ public class Q102_SeaOfSporesFever extends Quest
private static final int ECHO_FEAST = 4415;
private static final int ECHO_CELEBRATION = 4416;
- // NPCs
- private static final int ALBERIUS = 30284;
- private static final int COBENDELL = 30156;
- private static final int BERROS = 30217;
- private static final int VELTRESS = 30219;
- private static final int RAYEN = 30221;
- private static final int GARTRANDELL = 30285;
-
public Q102_SeaOfSporesFever()
{
super(102, "Sea of Spores Fever");
-
registerQuestItems(ALBERIUS_LETTER, EVERGREEN_AMULET, DRYAD_TEARS, COBENDELL_MEDICINE_1, COBENDELL_MEDICINE_2, COBENDELL_MEDICINE_3, COBENDELL_MEDICINE_4, COBENDELL_MEDICINE_5, ALBERIUS_LIST);
-
addStartNpc(ALBERIUS);
addTalkId(ALBERIUS, COBENDELL, BERROS, RAYEN, GARTRANDELL, VELTRESS);
-
addKillId(20013, 20019);
}
@@ -81,9 +76,7 @@ public class Q102_SeaOfSporesFever extends Quest
if (event.equals("30284-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(ALBERIUS_LETTER, 1);
}
@@ -103,6 +96,7 @@ public class Q102_SeaOfSporesFever extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30284-00.htm";
@@ -116,12 +110,14 @@ public class Q102_SeaOfSporesFever extends Quest
htmltext = "30284-07.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ALBERIUS:
+ {
if (cond == 1)
{
htmltext = "30284-03.htm";
@@ -133,7 +129,7 @@ public class Q102_SeaOfSporesFever extends Quest
else if (cond == 4)
{
htmltext = "30284-04.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.set("medicines", "4");
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(COBENDELL_MEDICINE_1, 1);
@@ -170,12 +166,13 @@ public class Q102_SeaOfSporesFever extends Quest
st.exitQuest(false);
}
break;
-
+ }
case COBENDELL:
+ {
if (cond == 1)
{
htmltext = "30156-03.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALBERIUS_LETTER, 1);
st.giveItems(EVERGREEN_AMULET, 1);
@@ -191,7 +188,7 @@ public class Q102_SeaOfSporesFever extends Quest
else if (cond == 3)
{
htmltext = "30156-05.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DRYAD_TEARS, -1);
st.takeItems(EVERGREEN_AMULET, 1);
@@ -206,44 +203,51 @@ public class Q102_SeaOfSporesFever extends Quest
htmltext = "30156-06.htm";
}
break;
-
+ }
case BERROS:
+ {
if (cond == 5)
{
htmltext = "30217-01.htm";
checkItem(st, COBENDELL_MEDICINE_2);
}
break;
-
+ }
case VELTRESS:
+ {
if (cond == 5)
{
htmltext = "30219-01.htm";
checkItem(st, COBENDELL_MEDICINE_3);
}
break;
-
+ }
case RAYEN:
+ {
if (cond == 5)
{
htmltext = "30221-01.htm";
checkItem(st, COBENDELL_MEDICINE_4);
}
break;
-
+ }
case GARTRANDELL:
+ {
if (cond == 5)
{
htmltext = "30285-01.htm";
checkItem(st, COBENDELL_MEDICINE_5);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -252,7 +256,7 @@ public class Q102_SeaOfSporesFever extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -260,7 +264,7 @@ public class Q102_SeaOfSporesFever extends Quest
if (st.dropItems(DRYAD_TEARS, 1, 10, 300000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
@@ -275,7 +279,7 @@ public class Q102_SeaOfSporesFever extends Quest
final int medicinesLeft = st.getInt("medicines") - 1;
if (medicinesLeft == 0)
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q103_SpiritOfCraftsman/Q103_SpiritOfCraftsman.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q103_SpiritOfCraftsman/Q103_SpiritOfCraftsman.java
index ffc93e27da..eb44fbd6ba 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q103_SpiritOfCraftsman/Q103_SpiritOfCraftsman.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q103_SpiritOfCraftsman/Q103_SpiritOfCraftsman.java
@@ -26,6 +26,10 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q103_SpiritOfCraftsman extends Quest
{
+ // NPCs
+ private static final int KARROD = 30307;
+ private static final int CECKTINON = 30132;
+ private static final int HARNE = 30144;
// Items
private static final int KARROD_LETTER = 968;
private static final int CECKTINON_VOUCHER_1 = 969;
@@ -35,7 +39,6 @@ public class Q103_SpiritOfCraftsman extends Quest
private static final int ZOMBIE_HEAD = 973;
private static final int STEELBENDER_HEAD = 974;
private static final int BONE_FRAGMENT = 1107;
-
// Rewards
private static final int SPIRITSHOT_NO_GRADE = 2509;
private static final int SOULSHOT_NO_GRADE = 1835;
@@ -49,20 +52,12 @@ public class Q103_SpiritOfCraftsman extends Quest
private static final int ECHO_FEAST = 4415;
private static final int ECHO_CELEBRATION = 4416;
- // NPCs
- private static final int KARROD = 30307;
- private static final int CECKTINON = 30132;
- private static final int HARNE = 30144;
-
public Q103_SpiritOfCraftsman()
{
super(103, "Spirit of Craftsman");
-
registerQuestItems(KARROD_LETTER, CECKTINON_VOUCHER_1, CECKTINON_VOUCHER_2, BONE_FRAGMENT, SOUL_CATCHER, PRESERVING_OIL, ZOMBIE_HEAD, STEELBENDER_HEAD);
-
addStartNpc(KARROD);
addTalkId(KARROD, CECKTINON, HARNE);
-
addKillId(20015, 20020, 20455, 20517, 20518);
}
@@ -78,9 +73,7 @@ public class Q103_SpiritOfCraftsman extends Quest
if (event.equals("30307-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(KARROD_LETTER, 1);
}
@@ -100,6 +93,7 @@ public class Q103_SpiritOfCraftsman extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30307-00.htm";
@@ -113,12 +107,14 @@ public class Q103_SpiritOfCraftsman extends Quest
htmltext = "30307-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case KARROD:
+ {
if (cond < 8)
{
htmltext = "30307-06.htm";
@@ -164,12 +160,13 @@ public class Q103_SpiritOfCraftsman extends Quest
st.exitQuest(false);
}
break;
-
+ }
case CECKTINON:
+ {
if (cond == 1)
{
htmltext = "30132-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KARROD_LETTER, 1);
st.giveItems(CECKTINON_VOUCHER_1, 1);
@@ -181,7 +178,7 @@ public class Q103_SpiritOfCraftsman extends Quest
else if (cond == 5)
{
htmltext = "30132-03.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SOUL_CATCHER, 1);
st.giveItems(PRESERVING_OIL, 1);
@@ -193,7 +190,7 @@ public class Q103_SpiritOfCraftsman extends Quest
else if (cond == 7)
{
htmltext = "30132-05.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ZOMBIE_HEAD, 1);
st.giveItems(STEELBENDER_HEAD, 1);
@@ -203,12 +200,13 @@ public class Q103_SpiritOfCraftsman extends Quest
htmltext = "30132-06.htm";
}
break;
-
+ }
case HARNE:
+ {
if (cond == 2)
{
htmltext = "30144-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CECKTINON_VOUCHER_1, 1);
st.giveItems(CECKTINON_VOUCHER_2, 1);
@@ -220,7 +218,7 @@ public class Q103_SpiritOfCraftsman extends Quest
else if (cond == 4)
{
htmltext = "30144-03.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CECKTINON_VOUCHER_2, 1);
st.takeItems(BONE_FRAGMENT, 10);
@@ -231,12 +229,15 @@ public class Q103_SpiritOfCraftsman extends Quest
htmltext = "30144-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -256,20 +257,23 @@ public class Q103_SpiritOfCraftsman extends Quest
case 20517:
case 20518:
case 20455:
- if ((st.getInt("cond") == 3) && st.dropItems(BONE_FRAGMENT, 1, 10, 300000))
+ {
+ if (st.isCond(3) && st.dropItems(BONE_FRAGMENT, 1, 10, 300000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case 20015:
case 20020:
- if ((st.getInt("cond") == 6) && st.dropItems(ZOMBIE_HEAD, 1, 1, 300000))
+ {
+ if (st.isCond(6) && st.dropItems(ZOMBIE_HEAD, 1, 1, 300000))
{
- st.set("cond", "7");
+ st.setCond(7);
st.takeItems(PRESERVING_OIL, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q104_SpiritOfMirrors/Q104_SpiritOfMirrors.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q104_SpiritOfMirrors/Q104_SpiritOfMirrors.java
index 8033a1841b..58ce71667b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q104_SpiritOfMirrors/Q104_SpiritOfMirrors.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q104_SpiritOfMirrors/Q104_SpiritOfMirrors.java
@@ -27,12 +27,16 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q104_SpiritOfMirrors extends Quest
{
+ // NPCs
+ private static final int GALLINT = 30017;
+ private static final int ARNOLD = 30041;
+ private static final int JOHNSTONE = 30043;
+ private static final int KENYOS = 30045;
// Items
private static final int GALLINS_OAK_WAND = 748;
private static final int WAND_SPIRITBOUND_1 = 1135;
private static final int WAND_SPIRITBOUND_2 = 1136;
private static final int WAND_SPIRITBOUND_3 = 1137;
-
// Rewards
private static final int SPIRITSHOT_NO_GRADE = 2509;
private static final int SOULSHOT_NO_GRADE = 1835;
@@ -46,18 +50,10 @@ public class Q104_SpiritOfMirrors extends Quest
private static final int ECHO_FEAST = 4415;
private static final int ECHO_CELEBRATION = 4416;
- // NPCs
- private static final int GALLINT = 30017;
- private static final int ARNOLD = 30041;
- private static final int JOHNSTONE = 30043;
- private static final int KENYOS = 30045;
-
public Q104_SpiritOfMirrors()
{
super(104, "Spirit of Mirrors");
-
registerQuestItems(GALLINS_OAK_WAND, WAND_SPIRITBOUND_1, WAND_SPIRITBOUND_2, WAND_SPIRITBOUND_3);
-
addStartNpc(GALLINT);
addTalkId(GALLINT, ARNOLD, JOHNSTONE, KENYOS);
@@ -76,9 +72,7 @@ public class Q104_SpiritOfMirrors extends Quest
if (event.equals("30017-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(GALLINS_OAK_WAND, 1);
st.giveItems(GALLINS_OAK_WAND, 1);
st.giveItems(GALLINS_OAK_WAND, 1);
@@ -100,6 +94,7 @@ public class Q104_SpiritOfMirrors extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.HUMAN)
{
htmltext = "30017-00.htm";
@@ -113,12 +108,14 @@ public class Q104_SpiritOfMirrors extends Quest
htmltext = "30017-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLINT:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30017-04.htm";
@@ -168,23 +165,27 @@ public class Q104_SpiritOfMirrors extends Quest
st.exitQuest(false);
}
break;
-
+ }
case KENYOS:
case JOHNSTONE:
case ARNOLD:
+ {
htmltext = npc.getNpcId() + "-01.htm";
if (cond == 1)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -210,7 +211,7 @@ public class Q104_SpiritOfMirrors extends Quest
st.giveItems(WAND_SPIRITBOUND_1, 1);
if (st.hasQuestItems(WAND_SPIRITBOUND_2, WAND_SPIRITBOUND_3))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -227,7 +228,7 @@ public class Q104_SpiritOfMirrors extends Quest
st.giveItems(WAND_SPIRITBOUND_2, 1);
if (st.hasQuestItems(WAND_SPIRITBOUND_1, WAND_SPIRITBOUND_3))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -244,7 +245,7 @@ public class Q104_SpiritOfMirrors extends Quest
st.giveItems(WAND_SPIRITBOUND_3, 1);
if (st.hasQuestItems(WAND_SPIRITBOUND_1, WAND_SPIRITBOUND_2))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q105_SkirmishWithTheOrcs/Q105_SkirmishWithTheOrcs.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q105_SkirmishWithTheOrcs/Q105_SkirmishWithTheOrcs.java
index e1673650d9..cc1c06d4c3 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q105_SkirmishWithTheOrcs/Q105_SkirmishWithTheOrcs.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q105_SkirmishWithTheOrcs/Q105_SkirmishWithTheOrcs.java
@@ -27,6 +27,15 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q105_SkirmishWithTheOrcs extends Quest
{
+ // Monster
+ private static final int KABOO_CHIEF_UOPH = 27059;
+ private static final int KABOO_CHIEF_KRACHA = 27060;
+ private static final int KABOO_CHIEF_BATOH = 27061;
+ private static final int KABOO_CHIEF_TANUKIA = 27062;
+ private static final int KABOO_CHIEF_TUREL = 27064;
+ private static final int KABOO_CHIEF_ROKO = 27065;
+ private static final int KABOO_CHIEF_KAMUT = 27067;
+ private static final int KABOO_CHIEF_MURTIKA = 27068;
// Item
private static final int KENDELL_ORDER_1 = 1836;
private static final int KENDELL_ORDER_2 = 1837;
@@ -38,17 +47,6 @@ public class Q105_SkirmishWithTheOrcs extends Quest
private static final int KENDELL_ORDER_8 = 1843;
private static final int KABOO_CHIEF_TORC_1 = 1844;
private static final int KABOO_CHIEF_TORC_2 = 1845;
-
- // Monster
- private static final int KABOO_CHIEF_UOPH = 27059;
- private static final int KABOO_CHIEF_KRACHA = 27060;
- private static final int KABOO_CHIEF_BATOH = 27061;
- private static final int KABOO_CHIEF_TANUKIA = 27062;
- private static final int KABOO_CHIEF_TUREL = 27064;
- private static final int KABOO_CHIEF_ROKO = 27065;
- private static final int KABOO_CHIEF_KAMUT = 27067;
- private static final int KABOO_CHIEF_MURTIKA = 27068;
-
// Rewards
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
@@ -63,12 +61,9 @@ public class Q105_SkirmishWithTheOrcs extends Quest
public Q105_SkirmishWithTheOrcs()
{
super(105, "Skirmish with the Orcs");
-
registerQuestItems(KENDELL_ORDER_1, KENDELL_ORDER_2, KENDELL_ORDER_3, KENDELL_ORDER_4, KENDELL_ORDER_5, KENDELL_ORDER_6, KENDELL_ORDER_7, KENDELL_ORDER_8, KABOO_CHIEF_TORC_1, KABOO_CHIEF_TORC_2);
-
addStartNpc(30218); // Kendell
addTalkId(30218);
-
addKillId(KABOO_CHIEF_UOPH, KABOO_CHIEF_KRACHA, KABOO_CHIEF_BATOH, KABOO_CHIEF_TANUKIA, KABOO_CHIEF_TUREL, KABOO_CHIEF_ROKO, KABOO_CHIEF_KAMUT, KABOO_CHIEF_MURTIKA);
}
@@ -84,11 +79,10 @@ public class Q105_SkirmishWithTheOrcs extends Quest
if (event.equals("30218-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(Rnd.get(1836, 1839), 1); // Kendell's orders 1 to 4.
}
+
return htmltext;
}
@@ -105,6 +99,7 @@ public class Q105_SkirmishWithTheOrcs extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30218-00.htm";
@@ -118,9 +113,10 @@ public class Q105_SkirmishWithTheOrcs extends Quest
htmltext = "30218-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30218-05.htm";
@@ -128,7 +124,7 @@ public class Q105_SkirmishWithTheOrcs extends Quest
else if (cond == 2)
{
htmltext = "30218-06.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KABOO_CHIEF_TORC_1, 1);
st.takeItems(KENDELL_ORDER_1, 1);
@@ -184,10 +180,12 @@ public class Q105_SkirmishWithTheOrcs extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -207,33 +205,37 @@ public class Q105_SkirmishWithTheOrcs extends Quest
case KABOO_CHIEF_KRACHA:
case KABOO_CHIEF_BATOH:
case KABOO_CHIEF_TANUKIA:
- if ((st.getInt("cond") == 1) && st.hasQuestItems(npc.getNpcId() - 25223)) // npcId - 25223 = itemId to verify.
+ {
+ if (st.isCond(1) && st.hasQuestItems(npc.getNpcId() - 25223)) // npcId - 25223 = itemId to verify.
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KABOO_CHIEF_TORC_1, 1);
}
break;
-
+ }
case KABOO_CHIEF_TUREL:
case KABOO_CHIEF_ROKO:
- if ((st.getInt("cond") == 3) && st.hasQuestItems(npc.getNpcId() - 25224)) // npcId - 25224 = itemId to verify.
+ {
+ if (st.isCond(3) && st.hasQuestItems(npc.getNpcId() - 25224)) // npcId - 25224 = itemId to verify.
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KABOO_CHIEF_TORC_2, 1);
}
break;
-
+ }
case KABOO_CHIEF_KAMUT:
case KABOO_CHIEF_MURTIKA:
- if ((st.getInt("cond") == 3) && st.hasQuestItems(npc.getNpcId() - 25225)) // npcId - 25225 = itemId to verify.
+ {
+ if (st.isCond(3) && st.hasQuestItems(npc.getNpcId() - 25225)) // npcId - 25225 = itemId to verify.
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KABOO_CHIEF_TORC_2, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q106_ForgottenTruth/Q106_ForgottenTruth.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q106_ForgottenTruth/Q106_ForgottenTruth.java
index 50522b42c5..b3763c633f 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q106_ForgottenTruth/Q106_ForgottenTruth.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q106_ForgottenTruth/Q106_ForgottenTruth.java
@@ -29,14 +29,12 @@ public class Q106_ForgottenTruth extends Quest
// NPCs
private static final int THIFIELL = 30358;
private static final int KARTIA = 30133;
-
// Items
private static final int ONYX_TALISMAN_1 = 984;
private static final int ONYX_TALISMAN_2 = 985;
private static final int ANCIENT_SCROLL = 986;
private static final int ANCIENT_CLAY_TABLET = 987;
private static final int KARTIA_TRANSLATION = 988;
-
// Rewards
private static final int SPIRITSHOT_NO_GRADE = 2509;
private static final int SOULSHOT_NO_GRADE = 1835;
@@ -53,12 +51,9 @@ public class Q106_ForgottenTruth extends Quest
public Q106_ForgottenTruth()
{
super(106, "Forgotten Truth");
-
registerQuestItems(ONYX_TALISMAN_1, ONYX_TALISMAN_2, ANCIENT_SCROLL, ANCIENT_CLAY_TABLET, KARTIA_TRANSLATION);
-
addStartNpc(THIFIELL);
addTalkId(THIFIELL, KARTIA);
-
addKillId(27070); // Tumran Orc Brigand
}
@@ -74,11 +69,10 @@ public class Q106_ForgottenTruth extends Quest
if (event.equals("30358-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(ONYX_TALISMAN_1, 1);
}
+
return htmltext;
}
@@ -95,6 +89,7 @@ public class Q106_ForgottenTruth extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30358-00.htm";
@@ -108,12 +103,14 @@ public class Q106_ForgottenTruth extends Quest
htmltext = "30358-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case THIFIELL:
+ {
if (cond == 1)
{
htmltext = "30358-06.htm";
@@ -167,12 +164,13 @@ public class Q106_ForgottenTruth extends Quest
st.exitQuest(false);
}
break;
-
+ }
case KARTIA:
+ {
if (cond == 1)
{
htmltext = "30133-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ONYX_TALISMAN_1, 1);
st.giveItems(ONYX_TALISMAN_2, 1);
@@ -184,7 +182,7 @@ public class Q106_ForgottenTruth extends Quest
else if (cond == 3)
{
htmltext = "30133-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ONYX_TALISMAN_2, 1);
st.takeItems(ANCIENT_SCROLL, 1);
@@ -196,12 +194,15 @@ public class Q106_ForgottenTruth extends Quest
htmltext = "30133-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -209,7 +210,7 @@ public class Q106_ForgottenTruth extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -221,7 +222,7 @@ public class Q106_ForgottenTruth extends Quest
}
else if (st.dropItems(ANCIENT_CLAY_TABLET, 1, 1, 200000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q107_MercilessPunishment/Q107_MercilessPunishment.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q107_MercilessPunishment/Q107_MercilessPunishment.java
index 169b9b8b65..a83db4bdbe 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q107_MercilessPunishment/Q107_MercilessPunishment.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q107_MercilessPunishment/Q107_MercilessPunishment.java
@@ -29,7 +29,6 @@ public class Q107_MercilessPunishment extends Quest
// NPCs
private static final int HATOS = 30568;
private static final int PARUGON = 30580;
-
// Items
private static final int HATOS_ORDER_1 = 1553;
private static final int HATOS_ORDER_2 = 1554;
@@ -37,7 +36,6 @@ public class Q107_MercilessPunishment extends Quest
private static final int LETTER_TO_HUMAN = 1557;
private static final int LETTER_TO_DARKELF = 1556;
private static final int LETTER_TO_ELF = 1558;
-
// Rewards
private static final int BUTCHER_SWORD = 1510;
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
@@ -52,12 +50,9 @@ public class Q107_MercilessPunishment extends Quest
public Q107_MercilessPunishment()
{
super(107, "Merciless Punishment");
-
registerQuestItems(HATOS_ORDER_1, HATOS_ORDER_2, HATOS_ORDER_3, LETTER_TO_HUMAN, LETTER_TO_DARKELF, LETTER_TO_ELF);
-
addStartNpc(HATOS);
addTalkId(HATOS, PARUGON);
-
addKillId(27041); // Baranka's Messenger
}
@@ -71,31 +66,36 @@ public class Q107_MercilessPunishment extends Quest
return htmltext;
}
- if (event.equals("30568-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(HATOS_ORDER_1, 1);
- }
- else if (event.equals("30568-06.htm"))
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
- }
- else if (event.equals("30568-07.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HATOS_ORDER_1, 1);
- st.giveItems(HATOS_ORDER_2, 1);
- }
- else if (event.equals("30568-09.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HATOS_ORDER_2, 1);
- st.giveItems(HATOS_ORDER_3, 1);
+ case "30568-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(HATOS_ORDER_1, 1);
+ break;
+ }
+ case "30568-06.htm":
+ {
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
+ }
+ case "30568-07.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HATOS_ORDER_1, 1);
+ st.giveItems(HATOS_ORDER_2, 1);
+ break;
+ }
+ case "30568-09.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HATOS_ORDER_2, 1);
+ st.giveItems(HATOS_ORDER_3, 1);
+ break;
+ }
}
return htmltext;
@@ -114,6 +114,7 @@ public class Q107_MercilessPunishment extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30568-00.htm";
@@ -127,12 +128,14 @@ public class Q107_MercilessPunishment extends Quest
htmltext = "30568-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HATOS:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30568-04.htm";
@@ -185,21 +188,25 @@ public class Q107_MercilessPunishment extends Quest
st.exitQuest(false);
}
break;
-
+ }
case PARUGON:
+ {
htmltext = "30580-01.htm";
if (cond == 1)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -214,22 +221,22 @@ public class Q107_MercilessPunishment extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond == 2)
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LETTER_TO_HUMAN, 1);
}
else if (cond == 4)
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LETTER_TO_DARKELF, 1);
}
else if (cond == 6)
{
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LETTER_TO_ELF, 1);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q108_JumbleTumbleDiamondFuss/Q108_JumbleTumbleDiamondFuss.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q108_JumbleTumbleDiamondFuss/Q108_JumbleTumbleDiamondFuss.java
index 718f397fc0..f3b391184d 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q108_JumbleTumbleDiamondFuss/Q108_JumbleTumbleDiamondFuss.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q108_JumbleTumbleDiamondFuss/Q108_JumbleTumbleDiamondFuss.java
@@ -35,7 +35,10 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
private static final int BRUNON = 30526;
private static final int MARON = 30529;
private static final int TOROCCO = 30555;
-
+ // Monsters
+ private static final int GOBLIN_BRIGAND_LEADER = 20323;
+ private static final int GOBLIN_BRIGAND_LIEUTENANT = 20324;
+ private static final int BLADE_BAT = 20480;
// Items
private static final int GOUPH_CONTRACT = 1559;
private static final int REEP_CONTRACT = 1560;
@@ -50,12 +53,6 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
private static final int BERRY_TART = 1569;
private static final int BAT_DIAGRAM = 1570;
private static final int STAR_DIAMOND = 1571;
-
- // Monsters
- private static final int GOBLIN_BRIGAND_LEADER = 20323;
- private static final int GOBLIN_BRIGAND_LIEUTENANT = 20324;
- private static final int BLADE_BAT = 20480;
-
// Rewards
private static final int SILVERSMITH_HAMMER = 1511;
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
@@ -66,48 +63,25 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
private static final int ECHO_FEAST = 4415;
private static final int ECHO_CELEBRATION = 4416;
private static final int LESSER_HEALING_POTION = 1060;
-
+ // @formatter:off
private static final int[][] LEADER_DROPLIST =
{
- {
- AQUAMARINE,
- 1,
- 10,
- 800000
- },
- {
- CHRYSOBERYL,
- 1,
- 10,
- 800000
- }
+ {AQUAMARINE, 1, 10, 800000},
+ {CHRYSOBERYL, 1, 10, 800000}
};
-
private static final int[][] LIEUTENANT_DROPLIST =
{
- {
- AQUAMARINE,
- 1,
- 10,
- 600000
- },
- {
- CHRYSOBERYL,
- 1,
- 10,
- 600000
- }
+ {AQUAMARINE, 1, 10, 600000},
+ {CHRYSOBERYL, 1, 10, 600000}
};
+ // @formatter:on
public Q108_JumbleTumbleDiamondFuss()
{
super(108, "Jumble, Tumble, Diamond Fuss");
-
registerQuestItems(GOUPH_CONTRACT, REEP_CONTRACT, ELVEN_WINE, BRUNON_DICE, BRUNON_CONTRACT, AQUAMARINE, CHRYSOBERYL, GEM_BOX, COAL_PIECE, BRUNON_LETTER, BERRY_TART, BAT_DIAGRAM, STAR_DIAMOND);
-
addStartNpc(GOUPH);
addTalkId(GOUPH, REEP, MURDOC, AIRY, BRUNON, MARON, TOROCCO);
-
addKillId(GOBLIN_BRIGAND_LEADER, GOBLIN_BRIGAND_LIEUTENANT, BLADE_BAT);
}
@@ -121,26 +95,30 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
return htmltext;
}
- if (event.equals("30523-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(GOUPH_CONTRACT, 1);
- }
- else if (event.equals("30555-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(REEP_CONTRACT, 1);
- st.giveItems(ELVEN_WINE, 1);
- }
- else if (event.equals("30526-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BRUNON_DICE, 1);
- st.giveItems(BRUNON_CONTRACT, 1);
+ case "30523-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(GOUPH_CONTRACT, 1);
+ break;
+ }
+ case "30555-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(REEP_CONTRACT, 1);
+ st.giveItems(ELVEN_WINE, 1);
+ break;
+ }
+ case "30526-02.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BRUNON_DICE, 1);
+ st.giveItems(BRUNON_CONTRACT, 1);
+ break;
+ }
}
return htmltext;
@@ -159,6 +137,7 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DWARF)
{
htmltext = "30523-00.htm";
@@ -172,12 +151,14 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30523-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GOUPH:
+ {
if (cond == 1)
{
htmltext = "30523-04.htm";
@@ -189,7 +170,7 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
else if (cond == 7)
{
htmltext = "30523-06.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GEM_BOX, 1);
st.giveItems(COAL_PIECE, 1);
@@ -230,12 +211,13 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
st.exitQuest(false);
}
break;
-
+ }
case REEP:
+ {
if (cond == 1)
{
htmltext = "30516-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GOUPH_CONTRACT, 1);
st.giveItems(REEP_CONTRACT, 1);
@@ -245,8 +227,9 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30516-02.htm";
}
break;
-
+ }
case TOROCCO:
+ {
if (cond == 2)
{
htmltext = "30555-01.htm";
@@ -264,12 +247,13 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30555-05.htm";
}
break;
-
+ }
case MARON:
+ {
if (cond == 3)
{
htmltext = "30529-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ELVEN_WINE, 1);
st.giveItems(BRUNON_DICE, 1);
@@ -283,8 +267,9 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30529-03.htm";
}
break;
-
+ }
case BRUNON:
+ {
if (cond == 4)
{
htmltext = "30526-01.htm";
@@ -296,7 +281,7 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
else if (cond == 6)
{
htmltext = "30526-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BRUNON_CONTRACT, 1);
st.takeItems(AQUAMARINE, -1);
@@ -310,7 +295,7 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
else if (cond == 8)
{
htmltext = "30526-06.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(COAL_PIECE, 1);
st.giveItems(BRUNON_LETTER, 1);
@@ -324,12 +309,13 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30526-08.htm";
}
break;
-
+ }
case MURDOC:
+ {
if (cond == 9)
{
htmltext = "30521-01.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BRUNON_LETTER, 1);
st.giveItems(BERRY_TART, 1);
@@ -343,12 +329,13 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30521-03.htm";
}
break;
-
+ }
case AIRY:
+ {
if (cond == 10)
{
htmltext = "30522-01.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BERRY_TART, 1);
st.giveItems(BAT_DIAGRAM, 1);
@@ -362,12 +349,15 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30522-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -384,26 +374,30 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
switch (npc.getNpcId())
{
case GOBLIN_BRIGAND_LEADER:
- if ((st.getInt("cond") == 5) && st.dropMultipleItems(LEADER_DROPLIST))
+ {
+ if (st.isCond(5) && st.dropMultipleItems(LEADER_DROPLIST))
{
- st.set("cond", "6");
+ st.setCond(6);
}
break;
-
+ }
case GOBLIN_BRIGAND_LIEUTENANT:
- if ((st.getInt("cond") == 5) && st.dropMultipleItems(LIEUTENANT_DROPLIST))
+ {
+ if (st.isCond(5) && st.dropMultipleItems(LIEUTENANT_DROPLIST))
{
- st.set("cond", "6");
+ st.setCond(6);
}
break;
-
+ }
case BLADE_BAT:
- if ((st.getInt("cond") == 11) && st.dropItems(STAR_DIAMOND, 1, 1, 200000))
+ {
+ if (st.isCond(11) && st.dropItems(STAR_DIAMOND, 1, 1, 200000))
{
st.takeItems(BAT_DIAGRAM, 1);
- st.set("cond", "12");
+ st.setCond(12);
}
break;
+ }
}
return null;
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q151_CureForFeverDisease/Q151_CureForFeverDisease.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q151_CureForFeverDisease/Q151_CureForFeverDisease.java
index bda0ac7012..7216a30fbd 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q151_CureForFeverDisease/Q151_CureForFeverDisease.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q151_CureForFeverDisease/Q151_CureForFeverDisease.java
@@ -24,23 +24,19 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q151_CureForFeverDisease extends Quest
{
+ // NPCs
+ private static final int ELIAS = 30050;
+ private static final int YOHANES = 30032;
// Items
private static final int POISON_SAC = 703;
private static final int FEVER_MEDICINE = 704;
- // NPCs
- private static final int ELIAS = 30050;
- private static final int YOHANES = 30032;
-
public Q151_CureForFeverDisease()
{
super(151, "Cure for Fever Disease");
-
registerQuestItems(FEVER_MEDICINE, POISON_SAC);
-
addStartNpc(ELIAS);
addTalkId(ELIAS, YOHANES);
-
addKillId(20103, 20106, 20108);
}
@@ -56,9 +52,7 @@ public class Q151_CureForFeverDisease extends Quest
if (event.equals("30050-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -77,14 +71,17 @@ public class Q151_CureForFeverDisease extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30050-01.htm" : "30050-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ELIAS:
+ {
if (cond == 1)
{
htmltext = "30050-04.htm";
@@ -102,12 +99,13 @@ public class Q151_CureForFeverDisease extends Quest
st.exitQuest(false);
}
break;
-
+ }
case YOHANES:
+ {
if (cond == 2)
{
htmltext = "30032-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(POISON_SAC, 1);
st.giveItems(FEVER_MEDICINE, 1);
@@ -117,12 +115,15 @@ public class Q151_CureForFeverDisease extends Quest
htmltext = "30032-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -131,7 +132,7 @@ public class Q151_CureForFeverDisease extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -139,7 +140,7 @@ public class Q151_CureForFeverDisease extends Quest
if (st.dropItems(POISON_SAC, 1, 1, 200000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q152_ShardsOfGolem/Q152_ShardsOfGolem.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q152_ShardsOfGolem/Q152_ShardsOfGolem.java
index 1b6d31a4dc..73f781a463 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q152_ShardsOfGolem/Q152_ShardsOfGolem.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q152_ShardsOfGolem/Q152_ShardsOfGolem.java
@@ -24,31 +24,25 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q152_ShardsOfGolem extends Quest
{
+ // NPCs
+ private static final int HARRIS = 30035;
+ private static final int ALTRAN = 30283;
+ // Monster
+ private static final int STONE_GOLEM = 20016;
// Items
private static final int HARRIS_RECEIPT_1 = 1008;
private static final int HARRIS_RECEIPT_2 = 1009;
private static final int GOLEM_SHARD = 1010;
private static final int TOOL_BOX = 1011;
-
// Reward
private static final int WOODEN_BREASTPLATE = 23;
- // NPCs
- private static final int HARRIS = 30035;
- private static final int ALTRAN = 30283;
-
- // Mob
- private static final int STONE_GOLEM = 20016;
-
public Q152_ShardsOfGolem()
{
super(152, "Shards of Golem");
-
registerQuestItems(HARRIS_RECEIPT_1, HARRIS_RECEIPT_2, GOLEM_SHARD, TOOL_BOX);
-
addStartNpc(HARRIS);
addTalkId(HARRIS, ALTRAN);
-
addKillId(STONE_GOLEM);
}
@@ -64,14 +58,12 @@ public class Q152_ShardsOfGolem extends Quest
if (event.equals("30035-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(HARRIS_RECEIPT_1, 1);
}
else if (event.equals("30283-02.htm"))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HARRIS_RECEIPT_1, 1);
st.giveItems(HARRIS_RECEIPT_2, 1);
@@ -93,14 +85,17 @@ public class Q152_ShardsOfGolem extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 10) ? "30035-01a.htm" : "30035-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HARRIS:
+ {
if (cond < 4)
{
htmltext = "30035-03.htm";
@@ -116,8 +111,9 @@ public class Q152_ShardsOfGolem extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ALTRAN:
+ {
if (cond == 1)
{
htmltext = "30283-01.htm";
@@ -129,7 +125,7 @@ public class Q152_ShardsOfGolem extends Quest
else if (cond == 3)
{
htmltext = "30283-04.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GOLEM_SHARD, -1);
st.giveItems(TOOL_BOX, 1);
@@ -139,12 +135,15 @@ public class Q152_ShardsOfGolem extends Quest
htmltext = "30283-05.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -153,7 +152,7 @@ public class Q152_ShardsOfGolem extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -161,7 +160,7 @@ public class Q152_ShardsOfGolem extends Quest
if (st.dropItems(GOLEM_SHARD, 1, 5, 300000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q153_DeliverGoods/Q153_DeliverGoods.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q153_DeliverGoods/Q153_DeliverGoods.java
index c5c33a23f0..9f74808f5d 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q153_DeliverGoods/Q153_DeliverGoods.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q153_DeliverGoods/Q153_DeliverGoods.java
@@ -29,7 +29,6 @@ public class Q153_DeliverGoods extends Quest
private static final int SILVIA = 30003;
private static final int ARNOLD = 30041;
private static final int RANT = 30054;
-
// Items
private static final int DELIVERY_LIST = 1012;
private static final int HEAVY_WOOD_BOX = 1013;
@@ -38,7 +37,6 @@ public class Q153_DeliverGoods extends Quest
private static final int JACKSON_RECEIPT = 1016;
private static final int SILVIA_RECEIPT = 1017;
private static final int RANT_RECEIPT = 1018;
-
// Rewards
private static final int SOULSHOT_NO_GRADE = 1835;
private static final int RING_OF_KNOWLEDGE = 875;
@@ -46,9 +44,7 @@ public class Q153_DeliverGoods extends Quest
public Q153_DeliverGoods()
{
super(153, "Deliver Goods");
-
registerQuestItems(DELIVERY_LIST, HEAVY_WOOD_BOX, CLOTH_BUNDLE, CLAY_POT, JACKSON_RECEIPT, SILVIA_RECEIPT, RANT_RECEIPT);
-
addStartNpc(ARNOLD);
addTalkId(JACKSON, SILVIA, ARNOLD, RANT);
}
@@ -65,9 +61,7 @@ public class Q153_DeliverGoods extends Quest
if (event.equals("30041-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(DELIVERY_LIST, 1);
st.giveItems(CLAY_POT, 1);
st.giveItems(CLOTH_BUNDLE, 1);
@@ -90,18 +84,21 @@ public class Q153_DeliverGoods extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 2) ? "30041-00.htm" : "30041-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case ARNOLD:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30041-03.htm";
}
- else if (st.getInt("cond") == 2)
+ else if (st.isCond(2))
{
htmltext = "30041-04.htm";
st.takeItems(DELIVERY_LIST, 1);
@@ -115,8 +112,9 @@ public class Q153_DeliverGoods extends Quest
st.exitQuest(false);
}
break;
-
+ }
case JACKSON:
+ {
if (st.hasQuestItems(HEAVY_WOOD_BOX))
{
htmltext = "30002-01.htm";
@@ -124,7 +122,7 @@ public class Q153_DeliverGoods extends Quest
st.giveItems(JACKSON_RECEIPT, 1);
if (st.hasQuestItems(SILVIA_RECEIPT, RANT_RECEIPT))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -137,8 +135,9 @@ public class Q153_DeliverGoods extends Quest
htmltext = "30002-02.htm";
}
break;
-
+ }
case SILVIA:
+ {
if (st.hasQuestItems(CLOTH_BUNDLE))
{
htmltext = "30003-01.htm";
@@ -147,7 +146,7 @@ public class Q153_DeliverGoods extends Quest
st.giveItems(SOULSHOT_NO_GRADE, 3);
if (st.hasQuestItems(JACKSON_RECEIPT, RANT_RECEIPT))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -160,8 +159,9 @@ public class Q153_DeliverGoods extends Quest
htmltext = "30003-02.htm";
}
break;
-
+ }
case RANT:
+ {
if (st.hasQuestItems(CLAY_POT))
{
htmltext = "30054-01.htm";
@@ -169,7 +169,7 @@ public class Q153_DeliverGoods extends Quest
st.giveItems(RANT_RECEIPT, 1);
if (st.hasQuestItems(JACKSON_RECEIPT, SILVIA_RECEIPT))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -182,12 +182,15 @@ public class Q153_DeliverGoods extends Quest
htmltext = "30054-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q154_SacrificeToTheSea/Q154_SacrificeToTheSea.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q154_SacrificeToTheSea/Q154_SacrificeToTheSea.java
index be3a429db3..0842c1bf7c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q154_SacrificeToTheSea/Q154_SacrificeToTheSea.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q154_SacrificeToTheSea/Q154_SacrificeToTheSea.java
@@ -28,24 +28,19 @@ public class Q154_SacrificeToTheSea extends Quest
private static final int ROCKSWELL = 30312;
private static final int CRISTEL = 30051;
private static final int ROLFE = 30055;
-
// Items
private static final int FOX_FUR = 1032;
private static final int FOX_FUR_YARN = 1033;
private static final int MAIDEN_DOLL = 1034;
-
// Reward
private static final int EARING = 113;
public Q154_SacrificeToTheSea()
{
super(154, "Sacrifice to the Sea");
-
registerQuestItems(FOX_FUR, FOX_FUR_YARN, MAIDEN_DOLL);
-
addStartNpc(ROCKSWELL);
addTalkId(ROCKSWELL, CRISTEL, ROLFE);
-
addKillId(20481, 20544, 20545); // Following Keltirs can be found near Talking Island.
}
@@ -61,9 +56,7 @@ public class Q154_SacrificeToTheSea extends Quest
if (event.equals("30312-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -82,14 +75,17 @@ public class Q154_SacrificeToTheSea extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 2) ? "30312-02.htm" : "30312-03.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ROCKSWELL:
+ {
if (cond == 1)
{
htmltext = "30312-05.htm";
@@ -112,8 +108,9 @@ public class Q154_SacrificeToTheSea extends Quest
st.exitQuest(false);
}
break;
-
+ }
case CRISTEL:
+ {
if (cond == 1)
{
htmltext = (st.hasQuestItems(FOX_FUR)) ? "30051-01.htm" : "30051-01a.htm";
@@ -121,7 +118,7 @@ public class Q154_SacrificeToTheSea extends Quest
else if (cond == 2)
{
htmltext = "30051-02.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FOX_FUR, -1);
st.giveItems(FOX_FUR_YARN, 1);
@@ -135,8 +132,9 @@ public class Q154_SacrificeToTheSea extends Quest
htmltext = "30051-04.htm";
}
break;
-
+ }
case ROLFE:
+ {
if (cond < 3)
{
htmltext = "30055-03.htm";
@@ -144,7 +142,7 @@ public class Q154_SacrificeToTheSea extends Quest
else if (cond == 3)
{
htmltext = "30055-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FOX_FUR_YARN, 1);
st.giveItems(MAIDEN_DOLL, 1);
@@ -154,12 +152,15 @@ public class Q154_SacrificeToTheSea extends Quest
htmltext = "30055-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -168,7 +169,7 @@ public class Q154_SacrificeToTheSea extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -176,7 +177,7 @@ public class Q154_SacrificeToTheSea extends Quest
if (st.dropItems(FOX_FUR, 1, 10, 400000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q155_FindSirWindawood/Q155_FindSirWindawood.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q155_FindSirWindawood/Q155_FindSirWindawood.java
index c7d1d293a0..15577464b1 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q155_FindSirWindawood/Q155_FindSirWindawood.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q155_FindSirWindawood/Q155_FindSirWindawood.java
@@ -24,20 +24,17 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q155_FindSirWindawood extends Quest
{
+ // NPCs
+ private static final int ABELLOS = 30042;
+ private static final int WINDAWOOD = 30311;
// Items
private static final int OFFICIAL_LETTER = 1019;
private static final int HASTE_POTION = 734;
- // NPCs
- private static final int ABELLOS = 30042;
- private static final int WINDAWOOD = 30311;
-
public Q155_FindSirWindawood()
{
super(155, "Find Sir Windawood");
-
registerQuestItems(OFFICIAL_LETTER);
-
addStartNpc(ABELLOS);
addTalkId(WINDAWOOD, ABELLOS);
}
@@ -54,9 +51,7 @@ public class Q155_FindSirWindawood extends Quest
if (event.equals("30042-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(OFFICIAL_LETTER, 1);
}
@@ -76,17 +71,21 @@ public class Q155_FindSirWindawood extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 3) ? "30042-01a.htm" : "30042-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case ABELLOS:
+ {
htmltext = "30042-03.htm";
break;
-
+ }
case WINDAWOOD:
+ {
if (st.hasQuestItems(OFFICIAL_LETTER))
{
htmltext = "30311-01.htm";
@@ -96,12 +95,15 @@ public class Q155_FindSirWindawood extends Quest
st.exitQuest(false);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q156_MillenniumLove/Q156_MillenniumLove.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q156_MillenniumLove/Q156_MillenniumLove.java
index 562d2196e6..2aae7b0bfd 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q156_MillenniumLove/Q156_MillenniumLove.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q156_MillenniumLove/Q156_MillenniumLove.java
@@ -24,20 +24,17 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q156_MillenniumLove extends Quest
{
+ // NPCs
+ private static final int LILITH = 30368;
+ private static final int BAENEDES = 30369;
// Items
private static final int LILITH_LETTER = 1022;
private static final int THEON_DIARY = 1023;
- // NPCs
- private static final int LILITH = 30368;
- private static final int BAENEDES = 30369;
-
public Q156_MillenniumLove()
{
super(156, "Millennium Love");
-
registerQuestItems(LILITH_LETTER, THEON_DIARY);
-
addStartNpc(LILITH);
addTalkId(LILITH, BAENEDES);
}
@@ -52,26 +49,30 @@ public class Q156_MillenniumLove extends Quest
return htmltext;
}
- if (event.equals("30368-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LILITH_LETTER, 1);
- }
- else if (event.equals("30369-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LILITH_LETTER, 1);
- st.giveItems(THEON_DIARY, 1);
- }
- else if (event.equals("30369-03.htm"))
- {
- st.takeItems(LILITH_LETTER, 1);
- st.rewardExpAndSp(3000, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30368-04.htm":
+ {
+ st.startQuest();
+ st.giveItems(LILITH_LETTER, 1);
+ break;
+ }
+ case "30369-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LILITH_LETTER, 1);
+ st.giveItems(THEON_DIARY, 1);
+ break;
+ }
+ case "30369-03.htm":
+ {
+ st.takeItems(LILITH_LETTER, 1);
+ st.rewardExpAndSp(3000, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -90,13 +91,16 @@ public class Q156_MillenniumLove extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30368-00.htm" : "30368-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case LILITH:
+ {
if (st.hasQuestItems(LILITH_LETTER))
{
htmltext = "30368-05.htm";
@@ -111,8 +115,9 @@ public class Q156_MillenniumLove extends Quest
st.exitQuest(false);
}
break;
-
+ }
case BAENEDES:
+ {
if (st.hasQuestItems(LILITH_LETTER))
{
htmltext = "30369-01.htm";
@@ -122,12 +127,15 @@ public class Q156_MillenniumLove extends Quest
htmltext = "30369-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q157_RecoverSmuggledGoods/Q157_RecoverSmuggledGoods.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q157_RecoverSmuggledGoods/Q157_RecoverSmuggledGoods.java
index 1ce5911bb4..19d0ad82e1 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q157_RecoverSmuggledGoods/Q157_RecoverSmuggledGoods.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q157_RecoverSmuggledGoods/Q157_RecoverSmuggledGoods.java
@@ -26,19 +26,15 @@ public class Q157_RecoverSmuggledGoods extends Quest
{
// Item
private static final int ADAMANTITE_ORE = 1024;
-
// Reward
private static final int BUCKLER = 20;
public Q157_RecoverSmuggledGoods()
{
super(157, "Recover Smuggled Goods");
-
registerQuestItems(ADAMANTITE_ORE);
-
addStartNpc(30005); // Wilford
addTalkId(30005);
-
addKillId(20121); // Toad
}
@@ -54,9 +50,7 @@ public class Q157_RecoverSmuggledGoods extends Quest
if (event.equals("30005-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -75,11 +69,13 @@ public class Q157_RecoverSmuggledGoods extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 5) ? "30005-02.htm" : "30005-03.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30005-06.htm";
@@ -93,10 +89,12 @@ public class Q157_RecoverSmuggledGoods extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -104,7 +102,7 @@ public class Q157_RecoverSmuggledGoods extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -112,7 +110,7 @@ public class Q157_RecoverSmuggledGoods extends Quest
if (st.dropItems(ADAMANTITE_ORE, 1, 20, 400000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q158_SeedOfEvil/Q158_SeedOfEvil.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q158_SeedOfEvil/Q158_SeedOfEvil.java
index 9854896c87..e8e4864534 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q158_SeedOfEvil/Q158_SeedOfEvil.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q158_SeedOfEvil/Q158_SeedOfEvil.java
@@ -26,19 +26,15 @@ public class Q158_SeedOfEvil extends Quest
{
// Item
private static final int CLAY_TABLET = 1025;
-
// Reward
private static final int ENCHANT_ARMOR_D = 956;
public Q158_SeedOfEvil()
{
super(158, "Seed of Evil");
-
registerQuestItems(CLAY_TABLET);
-
addStartNpc(30031); // Biotin
addTalkId(30031);
-
addKillId(27016); // Nerkas
}
@@ -54,9 +50,7 @@ public class Q158_SeedOfEvil extends Quest
if (event.equals("30031-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -75,10 +69,12 @@ public class Q158_SeedOfEvil extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 21) ? "30031-02.htm" : "30031-03.htm";
break;
-
+ }
case State.STARTED:
+ {
if (!st.hasQuestItems(CLAY_TABLET))
{
htmltext = "30031-05.htm";
@@ -92,10 +88,12 @@ public class Q158_SeedOfEvil extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -104,13 +102,13 @@ public class Q158_SeedOfEvil extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
}
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(CLAY_TABLET, 1);
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q159_ProtectTheWaterSource/Q159_ProtectTheWaterSource.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q159_ProtectTheWaterSource/Q159_ProtectTheWaterSource.java
index 7a6ffaa31d..2fb36e875a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q159_ProtectTheWaterSource/Q159_ProtectTheWaterSource.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q159_ProtectTheWaterSource/Q159_ProtectTheWaterSource.java
@@ -33,12 +33,9 @@ public class Q159_ProtectTheWaterSource extends Quest
public Q159_ProtectTheWaterSource()
{
super(159, "Protect the Water Source");
-
registerQuestItems(PLAGUE_DUST, HYACINTH_CHARM_1, HYACINTH_CHARM_2);
-
addStartNpc(30154); // Asterios
addTalkId(30154);
-
addKillId(27017); // Plague Zombie
}
@@ -54,9 +51,7 @@ public class Q159_ProtectTheWaterSource extends Quest
if (event.equals("30154-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(HYACINTH_CHARM_1, 1);
}
@@ -76,6 +71,7 @@ public class Q159_ProtectTheWaterSource extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30154-00.htm";
@@ -89,9 +85,10 @@ public class Q159_ProtectTheWaterSource extends Quest
htmltext = "30154-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30154-05.htm";
@@ -99,7 +96,7 @@ public class Q159_ProtectTheWaterSource extends Quest
else if (cond == 2)
{
htmltext = "30154-06.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PLAGUE_DUST, -1);
st.takeItems(HYACINTH_CHARM_1, 1);
@@ -119,10 +116,12 @@ public class Q159_ProtectTheWaterSource extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -137,13 +136,13 @@ public class Q159_ProtectTheWaterSource extends Quest
return null;
}
- if ((st.getInt("cond") == 1) && st.dropItems(PLAGUE_DUST, 1, 1, 400000))
+ if (st.isCond(1) && st.dropItems(PLAGUE_DUST, 1, 1, 400000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
- else if ((st.getInt("cond") == 3) && st.dropItems(PLAGUE_DUST, 1, 5, 400000))
+ else if (st.isCond(2) && st.dropItems(PLAGUE_DUST, 1, 5, 400000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q160_NerupasRequest/Q160_NerupasRequest.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q160_NerupasRequest/Q160_NerupasRequest.java
index 1f7a97aeb2..dc66232ac7 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q160_NerupasRequest/Q160_NerupasRequest.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q160_NerupasRequest/Q160_NerupasRequest.java
@@ -25,27 +25,23 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q160_NerupasRequest extends Quest
{
- // Items
- private static final int SILVERY_SPIDERSILK = 1026;
- private static final int UNOREN_RECEIPT = 1027;
- private static final int CREAMEES_TICKET = 1028;
- private static final int NIGHTSHADE_LEAF = 1029;
-
- // Reward
- private static final int LESSER_HEALING_POTION = 1060;
-
// NPCs
private static final int NERUPA = 30370;
private static final int UNOREN = 30147;
private static final int CREAMEES = 30149;
private static final int JULIA = 30152;
+ // Items
+ private static final int SILVERY_SPIDERSILK = 1026;
+ private static final int UNOREN_RECEIPT = 1027;
+ private static final int CREAMEES_TICKET = 1028;
+ private static final int NIGHTSHADE_LEAF = 1029;
+ // Reward
+ private static final int LESSER_HEALING_POTION = 1060;
public Q160_NerupasRequest()
{
super(160, "Nerupa's Request");
-
registerQuestItems(SILVERY_SPIDERSILK, UNOREN_RECEIPT, CREAMEES_TICKET, NIGHTSHADE_LEAF);
-
addStartNpc(NERUPA);
addTalkId(NERUPA, UNOREN, CREAMEES, JULIA);
}
@@ -62,9 +58,7 @@ public class Q160_NerupasRequest extends Quest
if (event.equals("30370-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(SILVERY_SPIDERSILK, 1);
}
@@ -84,6 +78,7 @@ public class Q160_NerupasRequest extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30370-00.htm";
@@ -97,12 +92,14 @@ public class Q160_NerupasRequest extends Quest
htmltext = "30370-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NERUPA:
+ {
if (cond < 4)
{
htmltext = "30370-05.htm";
@@ -117,12 +114,13 @@ public class Q160_NerupasRequest extends Quest
st.exitQuest(false);
}
break;
-
+ }
case UNOREN:
+ {
if (cond == 1)
{
htmltext = "30147-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SILVERY_SPIDERSILK, 1);
st.giveItems(UNOREN_RECEIPT, 1);
@@ -136,12 +134,13 @@ public class Q160_NerupasRequest extends Quest
htmltext = "30147-03.htm";
}
break;
-
+ }
case CREAMEES:
+ {
if (cond == 2)
{
htmltext = "30149-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(UNOREN_RECEIPT, 1);
st.giveItems(CREAMEES_TICKET, 1);
@@ -155,12 +154,13 @@ public class Q160_NerupasRequest extends Quest
htmltext = "30149-03.htm";
}
break;
-
+ }
case JULIA:
+ {
if (cond == 3)
{
htmltext = "30152-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CREAMEES_TICKET, 1);
st.giveItems(NIGHTSHADE_LEAF, 1);
@@ -170,12 +170,15 @@ public class Q160_NerupasRequest extends Quest
htmltext = "30152-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q161_FruitOfTheMotherTree/Q161_FruitOfTheMotherTree.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q161_FruitOfTheMotherTree/Q161_FruitOfTheMotherTree.java
index 342366e225..b267153ac9 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q161_FruitOfTheMotherTree/Q161_FruitOfTheMotherTree.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q161_FruitOfTheMotherTree/Q161_FruitOfTheMotherTree.java
@@ -28,7 +28,6 @@ public class Q161_FruitOfTheMotherTree extends Quest
// NPCs
private static final int ANDELLIA = 30362;
private static final int THALIA = 30371;
-
// Items
private static final int ANDELLIA_LETTER = 1036;
private static final int MOTHERTREE_FRUIT = 1037;
@@ -36,9 +35,7 @@ public class Q161_FruitOfTheMotherTree extends Quest
public Q161_FruitOfTheMotherTree()
{
super(161, "Fruit of the Mothertree");
-
registerQuestItems(ANDELLIA_LETTER, MOTHERTREE_FRUIT);
-
addStartNpc(ANDELLIA);
addTalkId(ANDELLIA, THALIA);
}
@@ -55,9 +52,7 @@ public class Q161_FruitOfTheMotherTree extends Quest
if (event.equals("30362-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(ANDELLIA_LETTER, 1);
}
@@ -77,6 +72,7 @@ public class Q161_FruitOfTheMotherTree extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30362-00.htm";
@@ -90,12 +86,14 @@ public class Q161_FruitOfTheMotherTree extends Quest
htmltext = "30362-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ANDELLIA:
+ {
if (cond == 1)
{
htmltext = "30362-05.htm";
@@ -110,12 +108,13 @@ public class Q161_FruitOfTheMotherTree extends Quest
st.exitQuest(false);
}
break;
-
+ }
case THALIA:
+ {
if (cond == 1)
{
htmltext = "30371-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ANDELLIA_LETTER, 1);
st.giveItems(MOTHERTREE_FRUIT, 1);
@@ -125,12 +124,15 @@ public class Q161_FruitOfTheMotherTree extends Quest
htmltext = "30371-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q162_CurseOfTheUndergroundFortress/Q162_CurseOfTheUndergroundFortress.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q162_CurseOfTheUndergroundFortress/Q162_CurseOfTheUndergroundFortress.java
index 363474b94e..fc771663fc 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q162_CurseOfTheUndergroundFortress/Q162_CurseOfTheUndergroundFortress.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q162_CurseOfTheUndergroundFortress/Q162_CurseOfTheUndergroundFortress.java
@@ -35,14 +35,11 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
private static final int DUNGEON_SKELETON_ARCHER = 20463;
private static final int DUNGEON_SKELETON = 20464;
private static final int DREAD_SOLDIER = 20504;
-
// Items
private static final int BONE_FRAGMENT = 1158;
private static final int ELF_SKULL = 1159;
-
// Rewards
private static final int BONE_SHIELD = 625;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -58,12 +55,9 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
public Q162_CurseOfTheUndergroundFortress()
{
super(162, "Curse of the Underground Fortress");
-
registerQuestItems(BONE_FRAGMENT, ELF_SKULL);
-
addStartNpc(30147); // Unoren
addTalkId(30147);
-
addKillId(SHADE_HORROR, DARK_TERROR, MIST_TERROR, DUNGEON_SKELETON_ARCHER, DUNGEON_SKELETON, DREAD_SOLDIER);
}
@@ -79,9 +73,7 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
if (event.equals("30147-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -100,6 +92,7 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() == Race.DARK_ELF)
{
htmltext = "30147-00.htm";
@@ -113,9 +106,10 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
htmltext = "30147-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30147-05.htm";
@@ -131,10 +125,12 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -143,33 +139,35 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
}
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case DUNGEON_SKELETON:
case DUNGEON_SKELETON_ARCHER:
case DREAD_SOLDIER:
+ {
if (st.dropItems(BONE_FRAGMENT, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(ELF_SKULL) >= 3))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case SHADE_HORROR:
case DARK_TERROR:
case MIST_TERROR:
+ {
if (st.dropItems(ELF_SKULL, 1, 3, CHANCES.get(npcId)) && (st.getQuestItemsCount(BONE_FRAGMENT) >= 10))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q163_LegacyOfThePoet/Q163_LegacyOfThePoet.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q163_LegacyOfThePoet/Q163_LegacyOfThePoet.java
index ff7dcc1683..ec7888a762 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q163_LegacyOfThePoet/Q163_LegacyOfThePoet.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q163_LegacyOfThePoet/Q163_LegacyOfThePoet.java
@@ -27,7 +27,6 @@ public class Q163_LegacyOfThePoet extends Quest
{
// NPC
private static final int STARDEN = 30220;
-
// Items
private static final int[] RUMIELS_POEMS =
{
@@ -36,45 +35,23 @@ public class Q163_LegacyOfThePoet extends Quest
1040,
1041
};
-
// Droplist
private static final int[][] DROPLIST =
{
- {
- RUMIELS_POEMS[0],
- 1,
- 1,
- 100000
- },
- {
- RUMIELS_POEMS[1],
- 1,
- 1,
- 200000
- },
- {
- RUMIELS_POEMS[2],
- 1,
- 1,
- 200000
- },
- {
- RUMIELS_POEMS[3],
- 1,
- 1,
- 400000
- }
+ // @formatter:off
+ {RUMIELS_POEMS[0], 1, 1, 100000},
+ {RUMIELS_POEMS[1], 1, 1, 200000},
+ {RUMIELS_POEMS[2], 1, 1, 200000},
+ {RUMIELS_POEMS[3], 1, 1, 400000}
+ // @formatter:on
};
public Q163_LegacyOfThePoet()
{
super(163, "Legacy of the Poet");
-
registerQuestItems(RUMIELS_POEMS);
-
addStartNpc(STARDEN);
addTalkId(STARDEN);
-
addKillId(20372, 20373);
}
@@ -90,9 +67,7 @@ public class Q163_LegacyOfThePoet extends Quest
if (event.equals("30220-07.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -111,6 +86,7 @@ public class Q163_LegacyOfThePoet extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() == Race.DARK_ELF)
{
htmltext = "30220-00.htm";
@@ -124,17 +100,16 @@ public class Q163_LegacyOfThePoet extends Quest
htmltext = "30220-03.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 2)
+ {
+ if (st.isCond(2))
{
htmltext = "30220-09.htm";
-
for (int poem : RUMIELS_POEMS)
{
st.takeItems(poem, -1);
}
-
st.rewardItems(57, 13890);
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(false);
@@ -144,10 +119,12 @@ public class Q163_LegacyOfThePoet extends Quest
htmltext = "30220-08.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -156,7 +133,7 @@ public class Q163_LegacyOfThePoet extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -164,7 +141,7 @@ public class Q163_LegacyOfThePoet extends Quest
if (st.dropMultipleItems(DROPLIST))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q164_BloodFiend/Q164_BloodFiend.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q164_BloodFiend/Q164_BloodFiend.java
index 25b024b909..cbe83a4750 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q164_BloodFiend/Q164_BloodFiend.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q164_BloodFiend/Q164_BloodFiend.java
@@ -31,12 +31,9 @@ public class Q164_BloodFiend extends Quest
public Q164_BloodFiend()
{
super(164, "Blood Fiend");
-
registerQuestItems(KIRUNAK_SKULL);
-
addStartNpc(30149);
addTalkId(30149);
-
addKillId(27021);
}
@@ -52,9 +49,7 @@ public class Q164_BloodFiend extends Quest
if (event.equals("30149-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -73,6 +68,7 @@ public class Q164_BloodFiend extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() == Race.DARK_ELF)
{
htmltext = "30149-00.htm";
@@ -86,8 +82,9 @@ public class Q164_BloodFiend extends Quest
htmltext = "30149-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (st.hasQuestItems(KIRUNAK_SKULL))
{
htmltext = "30149-06.htm";
@@ -101,10 +98,12 @@ public class Q164_BloodFiend extends Quest
htmltext = "30149-05.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -113,13 +112,13 @@ public class Q164_BloodFiend extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
}
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KIRUNAK_SKULL, 1);
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q165_ShilensHunt/Q165_ShilensHunt.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q165_ShilensHunt/Q165_ShilensHunt.java
index 19960206ce..ebd8e6d8fb 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q165_ShilensHunt/Q165_ShilensHunt.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q165_ShilensHunt/Q165_ShilensHunt.java
@@ -33,11 +33,9 @@ public class Q165_ShilensHunt extends Quest
private static final int YOUNG_BROWN_KELTIR = 20529;
private static final int BROWN_KELTIR = 20532;
private static final int ELDER_BROWN_KELTIR = 20536;
-
// Items
private static final int DARK_BEZOAR = 1160;
private static final int LESSER_HEALING_POTION = 1060;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -51,12 +49,9 @@ public class Q165_ShilensHunt extends Quest
public Q165_ShilensHunt()
{
super(165, "Shilen's Hunt");
-
registerQuestItems(DARK_BEZOAR);
-
addStartNpc(30348); // Nelsya
addTalkId(30348);
-
addKillId(ASHEN_WOLF, YOUNG_BROWN_KELTIR, BROWN_KELTIR, ELDER_BROWN_KELTIR);
}
@@ -72,9 +67,7 @@ public class Q165_ShilensHunt extends Quest
if (event.equals("30348-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -93,6 +86,7 @@ public class Q165_ShilensHunt extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30348-00.htm";
@@ -106,8 +100,9 @@ public class Q165_ShilensHunt extends Quest
htmltext = "30348-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(DARK_BEZOAR) >= 13)
{
htmltext = "30348-05.htm";
@@ -122,10 +117,12 @@ public class Q165_ShilensHunt extends Quest
htmltext = "30348-04.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -134,7 +131,7 @@ public class Q165_ShilensHunt extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -142,7 +139,7 @@ public class Q165_ShilensHunt extends Quest
if (st.dropItems(DARK_BEZOAR, 1, 13, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q166_MassOfDarkness/Q166_MassOfDarkness.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q166_MassOfDarkness/Q166_MassOfDarkness.java
index af246dd166..ba4c593f86 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q166_MassOfDarkness/Q166_MassOfDarkness.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q166_MassOfDarkness/Q166_MassOfDarkness.java
@@ -30,7 +30,6 @@ public class Q166_MassOfDarkness extends Quest
private static final int IRIA = 30135;
private static final int DORANKUS = 30139;
private static final int TRUDY = 30143;
-
// Items
private static final int UNDRIAS_LETTER = 1088;
private static final int CEREMONIAL_DAGGER = 1089;
@@ -40,9 +39,7 @@ public class Q166_MassOfDarkness extends Quest
public Q166_MassOfDarkness()
{
super(166, "Mass of Darkness");
-
registerQuestItems(UNDRIAS_LETTER, CEREMONIAL_DAGGER, DREVIANT_WINE, GARMIEL_SCRIPTURE);
-
addStartNpc(UNDRIAS);
addTalkId(UNDRIAS, IRIA, DORANKUS, TRUDY);
}
@@ -59,9 +56,7 @@ public class Q166_MassOfDarkness extends Quest
if (event.equals("30130-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(UNDRIAS_LETTER, 1);
}
@@ -81,6 +76,7 @@ public class Q166_MassOfDarkness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30130-00.htm";
@@ -94,12 +90,14 @@ public class Q166_MassOfDarkness extends Quest
htmltext = "30130-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case UNDRIAS:
+ {
if (cond == 1)
{
htmltext = "30130-05.htm";
@@ -117,15 +115,16 @@ public class Q166_MassOfDarkness extends Quest
st.exitQuest(false);
}
break;
-
+ }
case IRIA:
+ {
if ((cond == 1) && !st.hasQuestItems(CEREMONIAL_DAGGER))
{
htmltext = "30135-01.htm";
st.giveItems(CEREMONIAL_DAGGER, 1);
if (st.hasQuestItems(DREVIANT_WINE, GARMIEL_SCRIPTURE))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -138,15 +137,16 @@ public class Q166_MassOfDarkness extends Quest
htmltext = "30135-02.htm";
}
break;
-
+ }
case DORANKUS:
+ {
if ((cond == 1) && !st.hasQuestItems(DREVIANT_WINE))
{
htmltext = "30139-01.htm";
st.giveItems(DREVIANT_WINE, 1);
if (st.hasQuestItems(CEREMONIAL_DAGGER, GARMIEL_SCRIPTURE))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -159,15 +159,16 @@ public class Q166_MassOfDarkness extends Quest
htmltext = "30139-02.htm";
}
break;
-
+ }
case TRUDY:
+ {
if ((cond == 1) && !st.hasQuestItems(GARMIEL_SCRIPTURE))
{
htmltext = "30143-01.htm";
st.giveItems(GARMIEL_SCRIPTURE, 1);
if (st.hasQuestItems(CEREMONIAL_DAGGER, DREVIANT_WINE))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -180,12 +181,15 @@ public class Q166_MassOfDarkness extends Quest
htmltext = "30143-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q167_DwarvenKinship/Q167_DwarvenKinship.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q167_DwarvenKinship/Q167_DwarvenKinship.java
index 7fedfd46d6..846e76fb98 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q167_DwarvenKinship/Q167_DwarvenKinship.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q167_DwarvenKinship/Q167_DwarvenKinship.java
@@ -24,21 +24,18 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q167_DwarvenKinship extends Quest
{
- // Items
- private static final int CARLON_LETTER = 1076;
- private static final int NORMAN_LETTER = 1106;
-
// NPCs
private static final int CARLON = 30350;
private static final int NORMAN = 30210;
private static final int HAPROCK = 30255;
+ // Items
+ private static final int CARLON_LETTER = 1076;
+ private static final int NORMAN_LETTER = 1106;
public Q167_DwarvenKinship()
{
super(167, "Dwarven Kinship");
-
registerQuestItems(CARLON_LETTER, NORMAN_LETTER);
-
addStartNpc(CARLON);
addTalkId(CARLON, HAPROCK, NORMAN);
}
@@ -53,33 +50,38 @@ public class Q167_DwarvenKinship extends Quest
return htmltext;
}
- if (event.equals("30350-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(CARLON_LETTER, 1);
- }
- else if (event.equals("30255-03.htm"))
- {
- st.set("cond", "2");
- st.takeItems(CARLON_LETTER, 1);
- st.giveItems(NORMAN_LETTER, 1);
- st.rewardItems(57, 2000);
- }
- else if (event.equals("30255-04.htm"))
- {
- st.takeItems(CARLON_LETTER, 1);
- st.rewardItems(57, 3000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else if (event.equals("30210-02.htm"))
- {
- st.takeItems(NORMAN_LETTER, 1);
- st.rewardItems(57, 20000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30350-04.htm":
+ {
+ st.startQuest();
+ st.giveItems(CARLON_LETTER, 1);
+ break;
+ }
+ case "30255-03.htm":
+ {
+ st.setCond(2);
+ st.takeItems(CARLON_LETTER, 1);
+ st.giveItems(NORMAN_LETTER, 1);
+ st.rewardItems(57, 2000);
+ break;
+ }
+ case "30255-04.htm":
+ {
+ st.takeItems(CARLON_LETTER, 1);
+ st.rewardItems(57, 3000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "30210-02.htm":
+ {
+ st.takeItems(NORMAN_LETTER, 1);
+ st.rewardItems(57, 20000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -98,21 +100,25 @@ public class Q167_DwarvenKinship extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30350-02.htm" : "30350-03.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case CARLON:
+ {
if (cond == 1)
{
htmltext = "30350-05.htm";
}
break;
-
+ }
case HAPROCK:
+ {
if (cond == 1)
{
htmltext = "30255-01.htm";
@@ -122,19 +128,23 @@ public class Q167_DwarvenKinship extends Quest
htmltext = "30255-05.htm";
}
break;
-
+ }
case NORMAN:
+ {
if (cond == 2)
{
htmltext = "30210-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q168_DeliverSupplies/Q168_DeliverSupplies.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q168_DeliverSupplies/Q168_DeliverSupplies.java
index b17bac0bed..7a44b024eb 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q168_DeliverSupplies/Q168_DeliverSupplies.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q168_DeliverSupplies/Q168_DeliverSupplies.java
@@ -25,6 +25,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q168_DeliverSupplies extends Quest
{
+ // NPCs
+ private static final int JENNA = 30349;
+ private static final int ROSELYN = 30355;
+ private static final int KRISTIN = 30357;
+ private static final int HARANT = 30360;
// Items
private static final int JENNA_LETTER = 1153;
private static final int SENTRY_BLADE_1 = 1154;
@@ -32,18 +37,10 @@ public class Q168_DeliverSupplies extends Quest
private static final int SENTRY_BLADE_3 = 1156;
private static final int OLD_BRONZE_SWORD = 1157;
- // NPCs
- private static final int JENNA = 30349;
- private static final int ROSELYN = 30355;
- private static final int KRISTIN = 30357;
- private static final int HARANT = 30360;
-
public Q168_DeliverSupplies()
{
super(168, "Deliver Supplies");
-
registerQuestItems(JENNA_LETTER, SENTRY_BLADE_1, SENTRY_BLADE_2, SENTRY_BLADE_3, OLD_BRONZE_SWORD);
-
addStartNpc(JENNA);
addTalkId(JENNA, ROSELYN, KRISTIN, HARANT);
}
@@ -60,9 +57,7 @@ public class Q168_DeliverSupplies extends Quest
if (event.equals("30349-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(JENNA_LETTER, 1);
}
@@ -82,6 +77,7 @@ public class Q168_DeliverSupplies extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30349-00.htm";
@@ -95,12 +91,14 @@ public class Q168_DeliverSupplies extends Quest
htmltext = "30349-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case JENNA:
+ {
if (cond == 1)
{
htmltext = "30349-04.htm";
@@ -108,7 +106,7 @@ public class Q168_DeliverSupplies extends Quest
else if (cond == 2)
{
htmltext = "30349-05.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SENTRY_BLADE_1, 1);
}
@@ -125,12 +123,13 @@ public class Q168_DeliverSupplies extends Quest
st.exitQuest(false);
}
break;
-
+ }
case HARANT:
+ {
if (cond == 1)
{
htmltext = "30360-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(JENNA_LETTER, 1);
st.giveItems(SENTRY_BLADE_1, 1);
@@ -142,8 +141,9 @@ public class Q168_DeliverSupplies extends Quest
htmltext = "30360-02.htm";
}
break;
-
+ }
case ROSELYN:
+ {
if (cond == 3)
{
if (st.hasQuestItems(SENTRY_BLADE_2))
@@ -153,7 +153,7 @@ public class Q168_DeliverSupplies extends Quest
st.giveItems(OLD_BRONZE_SWORD, 1);
if (st.getQuestItemsCount(OLD_BRONZE_SWORD) == 2)
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -167,8 +167,9 @@ public class Q168_DeliverSupplies extends Quest
htmltext = "30355-02.htm";
}
break;
-
+ }
case KRISTIN:
+ {
if (cond == 3)
{
if (st.hasQuestItems(SENTRY_BLADE_3))
@@ -178,7 +179,7 @@ public class Q168_DeliverSupplies extends Quest
st.giveItems(OLD_BRONZE_SWORD, 1);
if (st.getQuestItemsCount(OLD_BRONZE_SWORD) == 2)
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -192,12 +193,15 @@ public class Q168_DeliverSupplies extends Quest
htmltext = "30357-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q169_OffspringOfNightmares/Q169_OffspringOfNightmares.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q169_OffspringOfNightmares/Q169_OffspringOfNightmares.java
index 4cd5825fd5..afecc85d74 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q169_OffspringOfNightmares/Q169_OffspringOfNightmares.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q169_OffspringOfNightmares/Q169_OffspringOfNightmares.java
@@ -33,12 +33,9 @@ public class Q169_OffspringOfNightmares extends Quest
public Q169_OffspringOfNightmares()
{
super(169, "Offspring of Nightmares");
-
registerQuestItems(CRACKED_SKULL, PERFECT_SKULL);
-
addStartNpc(30145); // Vlasty
addTalkId(30145);
-
addKillId(20105, 20025);
}
@@ -54,9 +51,7 @@ public class Q169_OffspringOfNightmares extends Quest
if (event.equals("30145-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30145-08.htm"))
{
@@ -85,6 +80,7 @@ public class Q169_OffspringOfNightmares extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30145-00.htm";
@@ -98,9 +94,10 @@ public class Q169_OffspringOfNightmares extends Quest
htmltext = "30145-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
if (st.hasQuestItems(CRACKED_SKULL))
@@ -117,10 +114,12 @@ public class Q169_OffspringOfNightmares extends Quest
htmltext = "30145-07.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -135,9 +134,9 @@ public class Q169_OffspringOfNightmares extends Quest
return null;
}
- if ((st.getInt("cond") == 1) && st.dropItems(PERFECT_SKULL, 1, 1, 200000))
+ if (st.isCond(1) && st.dropItems(PERFECT_SKULL, 1, 1, 200000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
else
{
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q170_DangerousSeduction/Q170_DangerousSeduction.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q170_DangerousSeduction/Q170_DangerousSeduction.java
index a6a03d1cc5..69ff6d1356 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q170_DangerousSeduction/Q170_DangerousSeduction.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q170_DangerousSeduction/Q170_DangerousSeduction.java
@@ -31,12 +31,9 @@ public class Q170_DangerousSeduction extends Quest
public Q170_DangerousSeduction()
{
super(170, "Dangerous Seduction");
-
registerQuestItems(NIGHTMARE_CRYSTAL);
-
addStartNpc(30305); // Vellior
addTalkId(30305);
-
addKillId(27022); // Merkenis
}
@@ -52,9 +49,7 @@ public class Q170_DangerousSeduction extends Quest
if (event.equals("30305-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -73,6 +68,7 @@ public class Q170_DangerousSeduction extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30305-00.htm";
@@ -86,8 +82,9 @@ public class Q170_DangerousSeduction extends Quest
htmltext = "30305-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (st.hasQuestItems(NIGHTMARE_CRYSTAL))
{
htmltext = "30305-06.htm";
@@ -101,10 +98,12 @@ public class Q170_DangerousSeduction extends Quest
htmltext = "30305-05.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -113,13 +112,13 @@ public class Q170_DangerousSeduction extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
}
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(NIGHTMARE_CRYSTAL, 1);
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q171_ActsOfEvil/Q171_ActsOfEvil.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q171_ActsOfEvil/Q171_ActsOfEvil.java
index ac681b5c39..4016860bb8 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q171_ActsOfEvil/Q171_ActsOfEvil.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q171_ActsOfEvil/Q171_ActsOfEvil.java
@@ -28,6 +28,13 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q171_ActsOfEvil extends Quest
{
+ // NPCs
+ private static final int ALVAH = 30381;
+ private static final int ARODIN = 30207;
+ private static final int TYRA = 30420;
+ private static final int ROLENTO = 30437;
+ private static final int NETI = 30425;
+ private static final int BURAI = 30617;
// Items
private static final int BLADE_MOLD = 4239;
private static final int TYRA_BILL = 4240;
@@ -40,15 +47,6 @@ public class Q171_ActsOfEvil extends Quest
private static final int CERTIFICATE = 4247;
private static final int CARGO_BOX = 4248;
private static final int OL_MAHUM_HEAD = 4249;
-
- // NPCs
- private static final int ALVAH = 30381;
- private static final int ARODIN = 30207;
- private static final int TYRA = 30420;
- private static final int ROLENTO = 30437;
- private static final int NETI = 30425;
- private static final int BURAI = 30617;
-
// Turek Orcs drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -62,12 +60,9 @@ public class Q171_ActsOfEvil extends Quest
public Q171_ActsOfEvil()
{
super(171, "Acts of Evil");
-
registerQuestItems(BLADE_MOLD, TYRA_BILL, RANGER_REPORT_1, RANGER_REPORT_2, RANGER_REPORT_3, RANGER_REPORT_4, WEAPON_TRADE_CONTRACT, ATTACK_DIRECTIVES, CERTIFICATE, CARGO_BOX, OL_MAHUM_HEAD);
-
addStartNpc(ALVAH);
addTalkId(ALVAH, ARODIN, TYRA, ROLENTO, NETI, BURAI);
-
addKillId(20496, 20497, 20498, 20499, 20062, 20064, 20066, 20438);
}
@@ -81,42 +76,49 @@ public class Q171_ActsOfEvil extends Quest
return htmltext;
}
- if (event.equals("30381-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30207-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30381-04.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30381-07.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WEAPON_TRADE_CONTRACT, 1);
- }
- else if (event.equals("30437-03.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CARGO_BOX, 1);
- st.giveItems(CERTIFICATE, 1);
- }
- else if (event.equals("30617-04.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ATTACK_DIRECTIVES, 1);
- st.takeItems(CARGO_BOX, 1);
- st.takeItems(CERTIFICATE, 1);
+ case "30381-02.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30207-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30381-04.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30381-07.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WEAPON_TRADE_CONTRACT, 1);
+ break;
+ }
+ case "30437-03.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CARGO_BOX, 1);
+ st.giveItems(CERTIFICATE, 1);
+ break;
+ }
+ case "30617-04.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ATTACK_DIRECTIVES, 1);
+ st.takeItems(CARGO_BOX, 1);
+ st.takeItems(CERTIFICATE, 1);
+ break;
+ }
}
return htmltext;
@@ -135,14 +137,17 @@ public class Q171_ActsOfEvil extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 27) ? "30381-01a.htm" : "30381-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ALVAH:
+ {
if (cond < 4)
{
htmltext = "30381-02a.htm";
@@ -156,7 +161,7 @@ public class Q171_ActsOfEvil extends Quest
if (st.hasQuestItems(RANGER_REPORT_1, RANGER_REPORT_2, RANGER_REPORT_3, RANGER_REPORT_4))
{
htmltext = "30381-05.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RANGER_REPORT_1, 1);
st.takeItems(RANGER_REPORT_2, 1);
@@ -191,8 +196,9 @@ public class Q171_ActsOfEvil extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ARODIN:
+ {
if (cond == 1)
{
htmltext = "30207-01.htm";
@@ -206,7 +212,7 @@ public class Q171_ActsOfEvil extends Quest
if (st.hasQuestItems(TYRA_BILL))
{
htmltext = "30207-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TYRA_BILL, 1);
}
@@ -220,14 +226,15 @@ public class Q171_ActsOfEvil extends Quest
htmltext = "30207-03a.htm";
}
break;
-
+ }
case TYRA:
+ {
if (cond == 2)
{
if (st.getQuestItemsCount(BLADE_MOLD) >= 20)
{
htmltext = "30420-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BLADE_MOLD, -1);
st.giveItems(TYRA_BILL, 1);
@@ -246,12 +253,13 @@ public class Q171_ActsOfEvil extends Quest
htmltext = "30420-02.htm";
}
break;
-
+ }
case NETI:
+ {
if (cond == 7)
{
htmltext = "30425-01.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond > 7)
@@ -259,8 +267,9 @@ public class Q171_ActsOfEvil extends Quest
htmltext = "30425-02.htm";
}
break;
-
+ }
case ROLENTO:
+ {
if (cond == 8)
{
htmltext = "30437-01.htm";
@@ -270,8 +279,9 @@ public class Q171_ActsOfEvil extends Quest
htmltext = "30437-03a.htm";
}
break;
-
+ }
case BURAI:
+ {
if ((cond == 9) && st.hasQuestItems(CERTIFICATE, CARGO_BOX, ATTACK_DIRECTIVES))
{
htmltext = "30617-01.htm";
@@ -281,7 +291,7 @@ public class Q171_ActsOfEvil extends Quest
if (st.getQuestItemsCount(OL_MAHUM_HEAD) >= 30)
{
htmltext = "30617-05.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(OL_MAHUM_HEAD, -1);
st.rewardItems(57, 8000);
@@ -292,12 +302,15 @@ public class Q171_ActsOfEvil extends Quest
}
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -313,14 +326,14 @@ public class Q171_ActsOfEvil extends Quest
}
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case 20496:
case 20497:
case 20498:
case 20499:
- if ((st.getInt("cond") == 2) && !st.dropItems(BLADE_MOLD, 1, 20, CHANCES.get(npcId)))
+ {
+ if (st.isCond(2) && !st.dropItems(BLADE_MOLD, 1, 20, CHANCES.get(npcId)))
{
final int count = st.getQuestItemsCount(BLADE_MOLD);
if ((count == 5) || ((count >= 10) && (Rnd.get(100) < 25)))
@@ -329,10 +342,11 @@ public class Q171_ActsOfEvil extends Quest
}
}
break;
-
+ }
case 20062:
case 20064:
- if (st.getInt("cond") == 5)
+ {
+ if (st.isCond(5))
{
if (!st.hasQuestItems(RANGER_REPORT_1))
{
@@ -359,22 +373,25 @@ public class Q171_ActsOfEvil extends Quest
}
}
break;
-
+ }
case 20438:
- if ((st.getInt("cond") == 6) && (Rnd.get(100) < 10) && !st.hasQuestItems(WEAPON_TRADE_CONTRACT, ATTACK_DIRECTIVES))
+ {
+ if (st.isCond(6) && (Rnd.get(100) < 10) && !st.hasQuestItems(WEAPON_TRADE_CONTRACT, ATTACK_DIRECTIVES))
{
st.playSound(QuestState.SOUND_ITEMGET);
st.giveItems(WEAPON_TRADE_CONTRACT, 1);
st.giveItems(ATTACK_DIRECTIVES, 1);
}
break;
-
+ }
case 20066:
- if (st.getInt("cond") == 10)
+ {
+ if (st.isCond(10))
{
st.dropItems(OL_MAHUM_HEAD, 1, 30, 500000);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q211_TrialOfTheChallenger/Q211_TrialOfTheChallenger.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q211_TrialOfTheChallenger/Q211_TrialOfTheChallenger.java
index 690e85dfa3..6544e2b474 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q211_TrialOfTheChallenger/Q211_TrialOfTheChallenger.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q211_TrialOfTheChallenger/Q211_TrialOfTheChallenger.java
@@ -27,13 +27,23 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q211_TrialOfTheChallenger extends Quest
{
+ // NPCs
+ private static final int FILAUR = 30535;
+ private static final int KASH = 30644;
+ private static final int MARTIEN = 30645;
+ private static final int RALDO = 30646;
+ private static final int CHEST_OF_SHYSLASSYS = 30647;
+ // Monsters
+ private static final int SHYSLASSYS = 27110;
+ private static final int GORR = 27112;
+ private static final int BARAHAM = 27113;
+ private static final int SUCCUBUS_QUEEN = 27114;
// Items
private static final int LETTER_OF_KASH = 2628;
private static final int WATCHER_EYE_1 = 2629;
private static final int WATCHER_EYE_2 = 2630;
private static final int SCROLL_OF_SHYSLASSYS = 2631;
private static final int BROKEN_KEY = 2632;
-
// Rewards
private static final int ADENA = 57;
private static final int ELVEN_NECKLACE_BEADS = 1904;
@@ -47,28 +57,12 @@ public class Q211_TrialOfTheChallenger extends Quest
private static final int MARK_OF_CHALLENGER = 2627;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int FILAUR = 30535;
- private static final int KASH = 30644;
- private static final int MARTIEN = 30645;
- private static final int RALDO = 30646;
- private static final int CHEST_OF_SHYSLASSYS = 30647;
-
- // Monsters
- private static final int SHYSLASSYS = 27110;
- private static final int GORR = 27112;
- private static final int BARAHAM = 27113;
- private static final int SUCCUBUS_QUEEN = 27114;
-
public Q211_TrialOfTheChallenger()
{
super(211, "Trial of the Challenger");
-
registerQuestItems(LETTER_OF_KASH, WATCHER_EYE_1, WATCHER_EYE_2, SCROLL_OF_SHYSLASSYS, BROKEN_KEY);
-
addStartNpc(KASH);
addTalkId(FILAUR, KASH, MARTIEN, RALDO, CHEST_OF_SHYSLASSYS);
-
addKillId(SHYSLASSYS, GORR, BARAHAM, SUCCUBUS_QUEEN);
}
@@ -82,73 +76,74 @@ public class Q211_TrialOfTheChallenger extends Quest
return htmltext;
}
- // KASH
- if (event.equals("30644-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
- if (!player.getVariables().getBoolean("secondClassChange35", false))
+ case "30644-05.htm":
{
- htmltext = "30644-05a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange35", true);
- }
- }
- // MARTIEN
- else if (event.equals("30645-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_OF_KASH, 1);
- }
- // RALDO
- else if (event.equals("30646-04.htm") || event.equals("30646-06.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WATCHER_EYE_2, 1);
- }
- // CHEST_OF_SHYSLASSYS
- else if (event.equals("30647-04.htm"))
- {
- if (st.hasQuestItems(BROKEN_KEY))
- {
- if (Rnd.get(10) < 2)
+ st.startQuest();
+ if (!player.getVariables().getBoolean("secondClassChange35", false))
{
- htmltext = "30647-03.htm";
- st.playSound(QuestState.SOUND_JACKPOT);
- st.takeItems(BROKEN_KEY, 1);
- final int chance = Rnd.get(100);
- if (chance > 90)
+ htmltext = "30644-05a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange35", true);
+ }
+ break;
+ }
+ case "30645-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_OF_KASH, 1);
+ break;
+ }
+ case "30646-04.htm":
+ case "30646-06.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WATCHER_EYE_2, 1);
+ break;
+ }
+ case "30647-04.htm":
+ {
+ if (st.hasQuestItems(BROKEN_KEY))
+ {
+ if (Rnd.get(10) < 2)
{
- st.rewardItems(BRIGANDINE_GAUNTLETS_PATTERN, 1);
- st.rewardItems(IRON_BOOTS_DESIGN, 1);
- st.rewardItems(MANTICOR_SKIN_GAITERS_PATTERN, 1);
- st.rewardItems(MITHRIL_SCALE_GAITERS_MATERIAL, 1);
- st.rewardItems(RIP_GAUNTLETS_PATTERN, 1);
- }
- else if (chance > 70)
- {
- st.rewardItems(ELVEN_NECKLACE_BEADS, 1);
- st.rewardItems(TOME_OF_BLOOD_PAGE, 1);
- }
- else if (chance > 40)
- {
- st.rewardItems(WHITE_TUNIC_PATTERN, 1);
+ htmltext = "30647-03.htm";
+ st.playSound(QuestState.SOUND_JACKPOT);
+ st.takeItems(BROKEN_KEY, 1);
+ final int chance = Rnd.get(100);
+ if (chance > 90)
+ {
+ st.rewardItems(BRIGANDINE_GAUNTLETS_PATTERN, 1);
+ st.rewardItems(IRON_BOOTS_DESIGN, 1);
+ st.rewardItems(MANTICOR_SKIN_GAITERS_PATTERN, 1);
+ st.rewardItems(MITHRIL_SCALE_GAITERS_MATERIAL, 1);
+ st.rewardItems(RIP_GAUNTLETS_PATTERN, 1);
+ }
+ else if (chance > 70)
+ {
+ st.rewardItems(ELVEN_NECKLACE_BEADS, 1);
+ st.rewardItems(TOME_OF_BLOOD_PAGE, 1);
+ }
+ else if (chance > 40)
+ {
+ st.rewardItems(WHITE_TUNIC_PATTERN, 1);
+ }
+ else
+ {
+ st.rewardItems(IRON_BOOTS_DESIGN, 1);
+ }
}
else
{
- st.rewardItems(IRON_BOOTS_DESIGN, 1);
+ htmltext = "30647-02.htm";
+ st.takeItems(BROKEN_KEY, 1);
+ st.rewardItems(ADENA, Rnd.get(1, 1000));
}
}
- else
- {
- htmltext = "30647-02.htm";
- st.takeItems(BROKEN_KEY, 1);
- st.rewardItems(ADENA, Rnd.get(1, 1000));
- }
+ break;
}
}
@@ -168,6 +163,7 @@ public class Q211_TrialOfTheChallenger extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.WARRIOR) && (player.getClassId() != ClassId.ELVEN_KNIGHT) && (player.getClassId() != ClassId.PALUS_KNIGHT) && (player.getClassId() != ClassId.ORC_RAIDER) && (player.getClassId() != ClassId.ORC_MONK))
{
htmltext = "30644-02.htm";
@@ -181,12 +177,14 @@ public class Q211_TrialOfTheChallenger extends Quest
htmltext = "30644-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case KASH:
+ {
if (cond == 1)
{
htmltext = "30644-06.htm";
@@ -194,7 +192,7 @@ public class Q211_TrialOfTheChallenger extends Quest
else if (cond == 2)
{
htmltext = "30644-07.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SCROLL_OF_SHYSLASSYS, 1);
st.giveItems(LETTER_OF_KASH, 1);
@@ -208,12 +206,14 @@ public class Q211_TrialOfTheChallenger extends Quest
htmltext = "30644-09.htm";
}
break;
-
+ }
case CHEST_OF_SHYSLASSYS:
+ {
htmltext = "30647-01.htm";
break;
-
+ }
case MARTIEN:
+ {
if (cond == 3)
{
htmltext = "30645-01.htm";
@@ -225,7 +225,7 @@ public class Q211_TrialOfTheChallenger extends Quest
else if (cond == 5)
{
htmltext = "30645-04.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(WATCHER_EYE_1, 1);
}
@@ -242,8 +242,9 @@ public class Q211_TrialOfTheChallenger extends Quest
htmltext = "30645-06.htm";
}
break;
-
+ }
case RALDO:
+ {
if (cond == 7)
{
htmltext = "30646-01.htm";
@@ -263,14 +264,15 @@ public class Q211_TrialOfTheChallenger extends Quest
st.exitQuest(false);
}
break;
-
+ }
case FILAUR:
+ {
if (cond == 8)
{
if (player.getLevel() >= 36)
{
htmltext = "30535-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -288,12 +290,15 @@ public class Q211_TrialOfTheChallenger extends Quest
htmltext = "30535-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -311,39 +316,44 @@ public class Q211_TrialOfTheChallenger extends Quest
switch (npc.getNpcId())
{
case SHYSLASSYS:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(BROKEN_KEY, 1);
st.giveItems(SCROLL_OF_SHYSLASSYS, 1);
addSpawn(CHEST_OF_SHYSLASSYS, npc, false, 200000);
}
break;
-
+ }
case GORR:
- if ((st.getInt("cond") == 4) && st.dropItemsAlways(WATCHER_EYE_1, 1, 1))
+ {
+ if (st.isCond(4) && st.dropItemsAlways(WATCHER_EYE_1, 1, 1))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case BARAHAM:
- if ((st.getInt("cond") == 6) && st.dropItemsAlways(WATCHER_EYE_2, 1, 1))
+ {
+ if (st.isCond(6) && st.dropItemsAlways(WATCHER_EYE_2, 1, 1))
{
- st.set("cond", "7");
+ st.setCond(7);
}
addSpawn(RALDO, npc, false, 100000);
break;
-
+ }
case SUCCUBUS_QUEEN:
- if (st.getInt("cond") == 9)
+ {
+ if (st.isCond(9))
{
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
}
addSpawn(RALDO, npc, false, 100000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q212_TrialOfDuty/Q212_TrialOfDuty.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q212_TrialOfDuty/Q212_TrialOfDuty.java
index 562744385e..b3362c5b6c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q212_TrialOfDuty/Q212_TrialOfDuty.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q212_TrialOfDuty/Q212_TrialOfDuty.java
@@ -28,6 +28,14 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q212_TrialOfDuty extends Quest
{
+ // NPCs
+ private static final int HANNAVALT = 30109;
+ private static final int DUSTIN = 30116;
+ private static final int SIR_COLLIN = 30311;
+ private static final int SIR_ARON = 30653;
+ private static final int SIR_KIEL = 30654;
+ private static final int SILVERSHADOW = 30655;
+ private static final int SPIRIT_TALIANUS = 30656;
// Items
private static final int LETTER_OF_DUSTIN = 2634;
private static final int KNIGHTS_TEAR = 2635;
@@ -43,29 +51,16 @@ public class Q212_TrialOfDuty extends Quest
private static final int ATHEBALDT_SHIN = 2645;
private static final int LETTER_OF_WINDAWOOD = 2646;
private static final int OLD_KNIGHT_SWORD = 3027;
-
// Rewards
private static final int MARK_OF_DUTY = 2633;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int HANNAVALT = 30109;
- private static final int DUSTIN = 30116;
- private static final int SIR_COLLIN = 30311;
- private static final int SIR_ARON = 30653;
- private static final int SIR_KIEL = 30654;
- private static final int SILVERSHADOW = 30655;
- private static final int SPIRIT_TALIANUS = 30656;
-
public Q212_TrialOfDuty()
{
super(212, "Trial of Duty");
-
registerQuestItems(LETTER_OF_DUSTIN, KNIGHTS_TEAR, MIRROR_OF_ORPIC, TEAR_OF_CONFESSION, REPORT_PIECE_1, REPORT_PIECE_2, TEAR_OF_LOYALTY, MILITAS_ARTICLE, SAINTS_ASHES_URN, ATHEBALDT_SKULL, ATHEBALDT_RIBS, ATHEBALDT_SHIN, LETTER_OF_WINDAWOOD, OLD_KNIGHT_SWORD);
-
addStartNpc(HANNAVALT);
addTalkId(HANNAVALT, DUSTIN, SIR_COLLIN, SIR_ARON, SIR_KIEL, SILVERSHADOW, SPIRIT_TALIANUS);
-
addKillId(20144, 20190, 20191, 20200, 20201, 20270, 27119, 20577, 20578, 20579, 20580, 20581, 20582);
}
@@ -81,10 +76,7 @@ public class Q212_TrialOfDuty extends Quest
if (event.equals("30109-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
+ st.startQuest();
if (!player.getVariables().getBoolean("secondClassChange35", false))
{
htmltext = "30109-04a.htm";
@@ -94,7 +86,7 @@ public class Q212_TrialOfDuty extends Quest
}
else if (event.equals("30116-05.htm"))
{
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TEAR_OF_LOYALTY, 1);
}
@@ -115,6 +107,7 @@ public class Q212_TrialOfDuty extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.KNIGHT) && (player.getClassId() != ClassId.ELVEN_KNIGHT) && (player.getClassId() != ClassId.PALUS_KNIGHT))
{
htmltext = "30109-02.htm";
@@ -128,12 +121,14 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30109-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HANNAVALT:
+ {
if (cond == 18)
{
htmltext = "30109-05.htm";
@@ -149,12 +144,13 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30109-04a.htm";
}
break;
-
+ }
case SIR_ARON:
+ {
if (cond == 1)
{
htmltext = "30653-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(OLD_KNIGHT_SWORD, 1);
}
@@ -165,7 +161,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 3)
{
htmltext = "30653-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KNIGHTS_TEAR, 1);
st.takeItems(OLD_KNIGHT_SWORD, 1);
@@ -175,12 +171,13 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30653-04.htm";
}
break;
-
+ }
case SIR_KIEL:
+ {
if (cond == 4)
{
htmltext = "30654-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
@@ -190,7 +187,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 6)
{
htmltext = "30654-03.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(MIRROR_OF_ORPIC, 1);
}
@@ -201,7 +198,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 9)
{
htmltext = "30654-05.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TEAR_OF_CONFESSION, 1);
}
@@ -210,12 +207,13 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30654-06.htm";
}
break;
-
+ }
case SPIRIT_TALIANUS:
+ {
if (cond == 8)
{
htmltext = "30656-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MIRROR_OF_ORPIC, 1);
st.takeItems(REPORT_PIECE_2, 1);
@@ -225,8 +223,9 @@ public class Q212_TrialOfDuty extends Quest
npc.deleteMe();
}
break;
-
+ }
case SILVERSHADOW:
+ {
if (cond == 10)
{
if (player.getLevel() < 35)
@@ -236,7 +235,7 @@ public class Q212_TrialOfDuty extends Quest
else
{
htmltext = "30655-02.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -247,7 +246,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 12)
{
htmltext = "30655-04.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MILITAS_ARTICLE, -1);
st.giveItems(TEAR_OF_LOYALTY, 1);
@@ -257,8 +256,9 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30655-05.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 13)
{
htmltext = "30116-01.htm";
@@ -270,7 +270,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 15)
{
htmltext = "30116-07.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ATHEBALDT_SKULL, 1);
st.takeItems(ATHEBALDT_RIBS, 1);
@@ -284,7 +284,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 17)
{
htmltext = "30116-08.htm";
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LETTER_OF_WINDAWOOD, 1);
st.giveItems(LETTER_OF_DUSTIN, 1);
@@ -294,12 +294,13 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30116-10.htm";
}
break;
-
+ }
case SIR_COLLIN:
+ {
if (cond == 16)
{
htmltext = "30311-01.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SAINTS_ASHES_URN, 1);
st.giveItems(LETTER_OF_WINDAWOOD, 1);
@@ -309,12 +310,15 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30311-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -329,63 +333,68 @@ public class Q212_TrialOfDuty extends Quest
return null;
}
- final int cond = st.getInt("cond");
switch (npc.getNpcId())
{
case 20190:
case 20191:
- if ((cond == 2) && (Rnd.get(10) < 1))
+ {
+ if (st.isCond(2) && (Rnd.get(10) < 1))
{
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
addSpawn(27119, npc, false, 120000);
}
break;
-
+ }
case 27119:
- if ((cond == 2) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == OLD_KNIGHT_SWORD))
+ {
+ if (st.isCond(2) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == OLD_KNIGHT_SWORD))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KNIGHTS_TEAR, 1);
}
break;
-
+ }
case 20201:
case 20200:
- if ((cond == 5) && st.dropItemsAlways(REPORT_PIECE_1, 1, 10))
+ {
+ if (st.isCond(5) && st.dropItemsAlways(REPORT_PIECE_1, 1, 10))
{
- st.set("cond", "6");
+ st.setCond(6);
st.takeItems(REPORT_PIECE_1, -1);
st.giveItems(REPORT_PIECE_2, 1);
}
break;
-
+ }
case 20144:
- if (((cond == 7) || (cond == 8)) && (Rnd.get(100) < 33))
+ {
+ if ((st.isCond(7) || st.isCond(8)) && (Rnd.get(100) < 33))
{
- if (cond == 7)
+ if (st.isCond(7))
{
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
}
addSpawn(30656, npc, false, 300000);
}
break;
-
+ }
case 20577:
case 20578:
case 20579:
case 20580:
case 20581:
case 20582:
- if ((cond == 11) && st.dropItemsAlways(MILITAS_ARTICLE, 1, 20))
+ {
+ if (st.isCond(11) && st.dropItemsAlways(MILITAS_ARTICLE, 1, 20))
{
- st.set("cond", "12");
+ st.setCond(12);
}
break;
-
+ }
case 20270:
- if ((cond == 14) && Rnd.nextBoolean())
+ {
+ if (st.isCond(14) && Rnd.nextBoolean())
{
if (!st.hasQuestItems(ATHEBALDT_SKULL))
{
@@ -399,12 +408,13 @@ public class Q212_TrialOfDuty extends Quest
}
else if (!st.hasQuestItems(ATHEBALDT_SHIN))
{
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(ATHEBALDT_SHIN, 1);
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q213_TrialOfTheSeeker/Q213_TrialOfTheSeeker.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q213_TrialOfTheSeeker/Q213_TrialOfTheSeeker.java
index 0564dc02b0..06c7e9cee4 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q213_TrialOfTheSeeker/Q213_TrialOfTheSeeker.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q213_TrialOfTheSeeker/Q213_TrialOfTheSeeker.java
@@ -26,6 +26,23 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q213_TrialOfTheSeeker extends Quest
{
+ // NPCs
+ private static final int TERRY = 30064;
+ private static final int DUFNER = 30106;
+ private static final int BRUNON = 30526;
+ private static final int VIKTOR = 30684;
+ private static final int MARINA = 30715;
+ // Monsters
+ private static final int NEER_GHOUL_BERSERKER = 20198;
+ private static final int ANT_CAPTAIN = 20080;
+ private static final int OL_MAHUM_CAPTAIN = 20211;
+ private static final int TURAK_BUGBEAR_WARRIOR = 20249;
+ private static final int TUREK_ORC_WARLORD = 20495;
+ private static final int MEDUSA = 20158;
+ private static final int ANT_WARRIOR_CAPTAIN = 20088;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int BREKA_ORC_OVERLORD = 20270;
+ private static final int LETO_LIZARDMAN_WARRIOR = 20580;
// Items
private static final int DUFNER_LETTER = 2647;
private static final int TERRY_ORDER_1 = 2648;
@@ -53,39 +70,16 @@ public class Q213_TrialOfTheSeeker extends Quest
private static final int ABYSS_RUNESTONE_3 = 2670;
private static final int ABYSS_RUNESTONE_4 = 2671;
private static final int TERRY_REPORT = 2672;
-
// Rewards
private static final int MARK_OF_SEEKER = 2673;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int TERRY = 30064;
- private static final int DUFNER = 30106;
- private static final int BRUNON = 30526;
- private static final int VIKTOR = 30684;
- private static final int MARINA = 30715;
-
- // Monsters
- private static final int NEER_GHOUL_BERSERKER = 20198;
- private static final int ANT_CAPTAIN = 20080;
- private static final int OL_MAHUM_CAPTAIN = 20211;
- private static final int TURAK_BUGBEAR_WARRIOR = 20249;
- private static final int TUREK_ORC_WARLORD = 20495;
- private static final int MEDUSA = 20158;
- private static final int ANT_WARRIOR_CAPTAIN = 20088;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int BREKA_ORC_OVERLORD = 20270;
- private static final int LETO_LIZARDMAN_WARRIOR = 20580;
-
public Q213_TrialOfTheSeeker()
{
super(213, "Trial of the Seeker");
-
registerQuestItems(DUFNER_LETTER, TERRY_ORDER_1, TERRY_ORDER_2, TERRY_LETTER, VIKTOR_LETTER, HAWKEYE_LETTER, MYSTERIOUS_RUNESTONE, OL_MAHUM_RUNESTONE, TUREK_RUNESTONE, ANT_RUNESTONE, TURAK_BUGBEAR_RUNESTONE, TERRY_BOX, VIKTOR_REQUEST, MEDUSA_SCALES, SHILEN_RUNESTONE, ANALYSIS_REQUEST, MARINA_LETTER, EXPERIMENT_TOOLS, ANALYSIS_RESULT, TERRY_ORDER_3, LIST_OF_HOST, ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_3, ABYSS_RUNESTONE_4, TERRY_REPORT);
-
addStartNpc(DUFNER);
addTalkId(TERRY, DUFNER, BRUNON, VIKTOR, MARINA);
-
addKillId(NEER_GHOUL_BERSERKER, ANT_CAPTAIN, OL_MAHUM_CAPTAIN, TURAK_BUGBEAR_WARRIOR, TUREK_ORC_WARLORD, ANT_WARRIOR_CAPTAIN, MARSH_STAKATO_DRONE, BREKA_ORC_OVERLORD, LETO_LIZARDMAN_WARRIOR, MEDUSA);
}
@@ -99,108 +93,114 @@ public class Q213_TrialOfTheSeeker extends Quest
return htmltext;
}
- // DUFNER
- if (event.equals("30106-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(DUFNER_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange35", false))
+ case "30106-05.htm":
{
- htmltext = "30106-05a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange35", true);
+ st.startQuest();
+ st.giveItems(DUFNER_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange35", false))
+ {
+ htmltext = "30106-05a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange35", true);
+ }
+ break;
}
- }
- // TERRY
- else if (event.equals("30064-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(DUFNER_LETTER, 1);
- st.giveItems(TERRY_ORDER_1, 1);
- }
- else if (event.equals("30064-06.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MYSTERIOUS_RUNESTONE, 1);
- st.takeItems(TERRY_ORDER_1, 1);
- st.giveItems(TERRY_ORDER_2, 1);
- }
- else if (event.equals("30064-10.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ANT_RUNESTONE, 1);
- st.takeItems(OL_MAHUM_RUNESTONE, 1);
- st.takeItems(TURAK_BUGBEAR_RUNESTONE, 1);
- st.takeItems(TUREK_RUNESTONE, 1);
- st.takeItems(TERRY_ORDER_2, 1);
- st.giveItems(TERRY_BOX, 1);
- st.giveItems(TERRY_LETTER, 1);
- }
- else if (event.equals("30064-18.htm"))
- {
- if (player.getLevel() < 36)
+ case "30064-03.htm":
{
- htmltext = "30064-17.htm";
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(ANALYSIS_RESULT, 1);
- st.giveItems(TERRY_ORDER_3, 1);
- }
- else
- {
- st.set("cond", "16");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ANALYSIS_RESULT, 1);
- st.giveItems(LIST_OF_HOST, 1);
+ st.takeItems(DUFNER_LETTER, 1);
+ st.giveItems(TERRY_ORDER_1, 1);
+ break;
+ }
+ case "30064-06.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MYSTERIOUS_RUNESTONE, 1);
+ st.takeItems(TERRY_ORDER_1, 1);
+ st.giveItems(TERRY_ORDER_2, 1);
+ break;
+ }
+ case "30064-10.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ANT_RUNESTONE, 1);
+ st.takeItems(OL_MAHUM_RUNESTONE, 1);
+ st.takeItems(TURAK_BUGBEAR_RUNESTONE, 1);
+ st.takeItems(TUREK_RUNESTONE, 1);
+ st.takeItems(TERRY_ORDER_2, 1);
+ st.giveItems(TERRY_BOX, 1);
+ st.giveItems(TERRY_LETTER, 1);
+ break;
+ }
+ case "30064-18.htm":
+ {
+ if (player.getLevel() < 36)
+ {
+ htmltext = "30064-17.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(ANALYSIS_RESULT, 1);
+ st.giveItems(TERRY_ORDER_3, 1);
+ }
+ else
+ {
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ANALYSIS_RESULT, 1);
+ st.giveItems(LIST_OF_HOST, 1);
+ }
+ break;
+ }
+ case "30684-05.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TERRY_LETTER, 1);
+ st.giveItems(VIKTOR_LETTER, 1);
+ break;
+ }
+ case "30684-11.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TERRY_LETTER, 1);
+ st.takeItems(TERRY_BOX, 1);
+ st.takeItems(HAWKEYE_LETTER, 1);
+ st.takeItems(VIKTOR_LETTER, 1);
+ st.giveItems(VIKTOR_REQUEST, 1);
+ break;
+ }
+ case "30684-15.htm":
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VIKTOR_REQUEST, 1);
+ st.takeItems(MEDUSA_SCALES, 10);
+ st.giveItems(ANALYSIS_REQUEST, 1);
+ st.giveItems(SHILEN_RUNESTONE, 1);
+ break;
+ }
+ case "30715-02.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SHILEN_RUNESTONE, 1);
+ st.takeItems(ANALYSIS_REQUEST, 1);
+ st.giveItems(MARINA_LETTER, 1);
+ break;
+ }
+ case "30715-05.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(EXPERIMENT_TOOLS, 1);
+ st.giveItems(ANALYSIS_RESULT, 1);
+ break;
}
- }
- // VIKTOR
- else if (event.equals("30684-05.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TERRY_LETTER, 1);
- st.giveItems(VIKTOR_LETTER, 1);
- }
- else if (event.equals("30684-11.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TERRY_LETTER, 1);
- st.takeItems(TERRY_BOX, 1);
- st.takeItems(HAWKEYE_LETTER, 1);
- st.takeItems(VIKTOR_LETTER, 1);
- st.giveItems(VIKTOR_REQUEST, 1);
- }
- else if (event.equals("30684-15.htm"))
- {
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VIKTOR_REQUEST, 1);
- st.takeItems(MEDUSA_SCALES, 10);
- st.giveItems(ANALYSIS_REQUEST, 1);
- st.giveItems(SHILEN_RUNESTONE, 1);
- }
- // MARINA
- else if (event.equals("30715-02.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SHILEN_RUNESTONE, 1);
- st.takeItems(ANALYSIS_REQUEST, 1);
- st.giveItems(MARINA_LETTER, 1);
- }
- else if (event.equals("30715-05.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(EXPERIMENT_TOOLS, 1);
- st.giveItems(ANALYSIS_RESULT, 1);
}
return htmltext;
@@ -219,6 +219,7 @@ public class Q213_TrialOfTheSeeker extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() == ClassId.ROGUE) || (player.getClassId() == ClassId.ELVEN_SCOUT) || (player.getClassId() == ClassId.ASSASSIN))
{
htmltext = (player.getLevel() < 35) ? "30106-02.htm" : "30106-03.htm";
@@ -228,12 +229,14 @@ public class Q213_TrialOfTheSeeker extends Quest
htmltext = "30106-00.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case DUFNER:
+ {
if (cond == 1)
{
htmltext = "30106-06.htm";
@@ -256,8 +259,9 @@ public class Q213_TrialOfTheSeeker extends Quest
}
}
break;
-
+ }
case TERRY:
+ {
if (cond == 1)
{
htmltext = "30064-01.htm";
@@ -285,7 +289,7 @@ public class Q213_TrialOfTheSeeker extends Quest
else if (cond == 7)
{
htmltext = "30064-12.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(VIKTOR_LETTER, 1);
st.giveItems(HAWKEYE_LETTER, 1);
@@ -311,7 +315,7 @@ public class Q213_TrialOfTheSeeker extends Quest
else
{
htmltext = "30064-21.htm";
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TERRY_ORDER_3, 1);
st.giveItems(LIST_OF_HOST, 1);
@@ -340,8 +344,9 @@ public class Q213_TrialOfTheSeeker extends Quest
}
}
break;
-
+ }
case VIKTOR:
+ {
if (cond == 6)
{
htmltext = "30684-01.htm";
@@ -371,8 +376,9 @@ public class Q213_TrialOfTheSeeker extends Quest
htmltext = "30684-17.htm";
}
break;
-
+ }
case MARINA:
+ {
if (cond == 11)
{
htmltext = "30715-01.htm";
@@ -390,12 +396,13 @@ public class Q213_TrialOfTheSeeker extends Quest
htmltext = "30715-06.htm";
}
break;
-
+ }
case BRUNON:
+ {
if (cond == 12)
{
htmltext = "30526-01.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MARINA_LETTER, 1);
st.giveItems(EXPERIMENT_TOOLS, 1);
@@ -405,12 +412,15 @@ public class Q213_TrialOfTheSeeker extends Quest
htmltext = "30526-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -425,79 +435,88 @@ public class Q213_TrialOfTheSeeker extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case NEER_GHOUL_BERSERKER:
- if ((cond == 2) && st.dropItems(MYSTERIOUS_RUNESTONE, 1, 1, 100000))
+ {
+ if (st.isCond(2) && st.dropItems(MYSTERIOUS_RUNESTONE, 1, 1, 100000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case ANT_CAPTAIN:
- if ((cond == 4) && st.dropItems(ANT_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(OL_MAHUM_RUNESTONE, TURAK_BUGBEAR_RUNESTONE, TUREK_RUNESTONE))
+ {
+ if (st.isCond(4) && st.dropItems(ANT_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(OL_MAHUM_RUNESTONE, TURAK_BUGBEAR_RUNESTONE, TUREK_RUNESTONE))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case OL_MAHUM_CAPTAIN:
- if ((cond == 4) && st.dropItems(OL_MAHUM_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, TURAK_BUGBEAR_RUNESTONE, TUREK_RUNESTONE))
+ {
+ if (st.isCond(4) && st.dropItems(OL_MAHUM_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, TURAK_BUGBEAR_RUNESTONE, TUREK_RUNESTONE))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case TURAK_BUGBEAR_WARRIOR:
- if ((cond == 4) && st.dropItems(TURAK_BUGBEAR_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, OL_MAHUM_RUNESTONE, TUREK_RUNESTONE))
+ {
+ if (st.isCond(4) && st.dropItems(TURAK_BUGBEAR_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, OL_MAHUM_RUNESTONE, TUREK_RUNESTONE))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case TUREK_ORC_WARLORD:
- if ((cond == 4) && st.dropItems(TUREK_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, OL_MAHUM_RUNESTONE, TURAK_BUGBEAR_RUNESTONE))
+ {
+ if (st.isCond(4) && st.dropItems(TUREK_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, OL_MAHUM_RUNESTONE, TURAK_BUGBEAR_RUNESTONE))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case MEDUSA:
- if ((cond == 9) && st.dropItems(MEDUSA_SCALES, 1, 10, 300000))
+ {
+ if (st.isCond(9) && st.dropItems(MEDUSA_SCALES, 1, 10, 300000))
{
- st.set("cond", "10");
+ st.setCond(10);
}
break;
-
+ }
case MARSH_STAKATO_DRONE:
- if (((cond == 15) || (cond == 16)) && st.dropItems(ABYSS_RUNESTONE_1, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_3, ABYSS_RUNESTONE_4))
+ {
+ if ((st.isCond(15) || st.isCond(16)) && st.dropItems(ABYSS_RUNESTONE_1, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_3, ABYSS_RUNESTONE_4))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case BREKA_ORC_OVERLORD:
- if (((cond == 15) || (cond == 16)) && st.dropItems(ABYSS_RUNESTONE_2, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_3, ABYSS_RUNESTONE_4))
+ {
+ if ((st.isCond(15) || st.isCond(16)) && st.dropItems(ABYSS_RUNESTONE_2, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_3, ABYSS_RUNESTONE_4))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case ANT_WARRIOR_CAPTAIN:
- if (((cond == 15) || (cond == 16)) && st.dropItems(ABYSS_RUNESTONE_3, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_4))
+ {
+ if ((st.isCond(15) || st.isCond(16)) && st.dropItems(ABYSS_RUNESTONE_3, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_4))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case LETO_LIZARDMAN_WARRIOR:
- if (((cond == 15) || (cond == 16)) && st.dropItems(ABYSS_RUNESTONE_4, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_3))
+ {
+ if ((st.isCond(15) || st.isCond(16)) && st.dropItems(ABYSS_RUNESTONE_4, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_3))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q214_TrialOfTheScholar/Q214_TrialOfTheScholar.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q214_TrialOfTheScholar/Q214_TrialOfTheScholar.java
index 9d8210b1cf..2e2593a422 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q214_TrialOfTheScholar/Q214_TrialOfTheScholar.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q214_TrialOfTheScholar/Q214_TrialOfTheScholar.java
@@ -26,6 +26,32 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q214_TrialOfTheScholar extends Quest
{
+ // NPCs
+ private static final int SYLVAIN = 30070;
+ private static final int LUCAS = 30071;
+ private static final int VALKON = 30103;
+ private static final int DIETER = 30111;
+ private static final int JUREK = 30115;
+ private static final int EDROC = 30230;
+ private static final int RAUT = 30316;
+ private static final int POITAN = 30458;
+ private static final int MIRIEN = 30461;
+ private static final int MARIA = 30608;
+ private static final int CRETA = 30609;
+ private static final int CRONOS = 30610;
+ private static final int TRIFF = 30611;
+ private static final int CASIAN = 30612;
+ // Monsters
+ private static final int MONSTER_EYE_DESTROYER = 20068;
+ private static final int MEDUSA = 20158;
+ private static final int GHOUL = 20201;
+ private static final int SHACKLE_1 = 20235;
+ private static final int SHACKLE_2 = 20279;
+ private static final int BREKA_ORC_SHAMAN = 20269;
+ private static final int FETTERED_SOUL = 20552;
+ private static final int GRANDIS = 20554;
+ private static final int ENCHANTED_GARGOYLE = 20567;
+ private static final int LETO_LIZARDMAN_WARRIOR = 20580;
// Items
private static final int MIRIEN_SIGIL_1 = 2675;
private static final int MIRIEN_SIGIL_2 = 2676;
@@ -72,48 +98,16 @@ public class Q214_TrialOfTheScholar extends Quest
private static final int FETTERED_SOUL_ICHOR = 2718;
private static final int ENCHANTED_GARGOYLE_NAIL = 2719;
private static final int SYMBOL_OF_CRONOS = 2720;
-
// Rewards
private static final int MARK_OF_SCHOLAR = 2674;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int SYLVAIN = 30070;
- private static final int LUCAS = 30071;
- private static final int VALKON = 30103;
- private static final int DIETER = 30111;
- private static final int JUREK = 30115;
- private static final int EDROC = 30230;
- private static final int RAUT = 30316;
- private static final int POITAN = 30458;
- private static final int MIRIEN = 30461;
- private static final int MARIA = 30608;
- private static final int CRETA = 30609;
- private static final int CRONOS = 30610;
- private static final int TRIFF = 30611;
- private static final int CASIAN = 30612;
-
- // Monsters
- private static final int MONSTER_EYE_DESTROYER = 20068;
- private static final int MEDUSA = 20158;
- private static final int GHOUL = 20201;
- private static final int SHACKLE_1 = 20235;
- private static final int SHACKLE_2 = 20279;
- private static final int BREKA_ORC_SHAMAN = 20269;
- private static final int FETTERED_SOUL = 20552;
- private static final int GRANDIS = 20554;
- private static final int ENCHANTED_GARGOYLE = 20567;
- private static final int LETO_LIZARDMAN_WARRIOR = 20580;
-
public Q214_TrialOfTheScholar()
{
super(214, "Trial of the Scholar");
-
registerQuestItems(MIRIEN_SIGIL_1, MIRIEN_SIGIL_2, MIRIEN_SIGIL_3, MIRIEN_INSTRUCTION, MARIA_LETTER_1, MARIA_LETTER_2, LUCAS_LETTER, LUCILLA_HANDBAG, CRETA_LETTER_1, CRETA_PAINTING_1, CRETA_PAINTING_2, CRETA_PAINTING_3, BROWN_SCROLL_SCRAP, CRYSTAL_OF_PURITY_1, HIGH_PRIEST_SIGIL, GRAND_MAGISTER_SIGIL, CRONOS_SIGIL, SYLVAIN_LETTER, SYMBOL_OF_SYLVAIN, JUREK_LIST, MONSTER_EYE_DESTROYER_SKIN, SHAMAN_NECKLACE, SHACKLE_SCALP, SYMBOL_OF_JUREK, CRONOS_LETTER, DIETER_KEY, CRETA_LETTER_2, DIETER_LETTER, DIETER_DIARY, RAUT_LETTER_ENVELOPE, TRIFF_RING, SCRIPTURE_CHAPTER_1, SCRIPTURE_CHAPTER_2, SCRIPTURE_CHAPTER_3, SCRIPTURE_CHAPTER_4, VALKON_REQUEST, POITAN_NOTES, STRONG_LIQUOR, CRYSTAL_OF_PURITY_2, CASIAN_LIST, GHOUL_SKIN, MEDUSA_BLOOD, FETTERED_SOUL_ICHOR, ENCHANTED_GARGOYLE_NAIL, SYMBOL_OF_CRONOS);
-
addStartNpc(MIRIEN);
addTalkId(MIRIEN, SYLVAIN, LUCAS, VALKON, DIETER, JUREK, EDROC, RAUT, POITAN, MARIA, CRETA, CRONOS, TRIFF, CASIAN);
-
addKillId(MONSTER_EYE_DESTROYER, MEDUSA, GHOUL, SHACKLE_1, SHACKLE_2, BREKA_ORC_SHAMAN, FETTERED_SOUL, GRANDIS, ENCHANTED_GARGOYLE, LETO_LIZARDMAN_WARRIOR);
}
@@ -127,193 +121,201 @@ public class Q214_TrialOfTheScholar extends Quest
return htmltext;
}
- // MIRIEN
- if (event.equals("30461-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(MIRIEN_SIGIL_1, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange35", false))
+ case "30461-04.htm":
{
- htmltext = "30461-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange35", true);
+ st.startQuest();
+ st.giveItems(MIRIEN_SIGIL_1, 1);
+ if (!player.getVariables().getBoolean("secondClassChange35", false))
+ {
+ htmltext = "30461-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange35", true);
+ }
+ break;
}
- }
- else if (event.equals("30461-09.htm"))
- {
- if (player.getLevel() < 36)
+ case "30461-09.htm":
+ {
+ if (player.getLevel() < 36)
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(MIRIEN_INSTRUCTION, 1);
+ }
+ else
+ {
+ htmltext = "30461-10.htm";
+ st.setCond(19);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MIRIEN_SIGIL_2, 1);
+ st.takeItems(SYMBOL_OF_JUREK, 1);
+ st.giveItems(MIRIEN_SIGIL_3, 1);
+ }
+ break;
+ }
+ case "30070-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(HIGH_PRIEST_SIGIL, 1);
+ st.giveItems(SYLVAIN_LETTER, 1);
+ break;
+ }
+ case "30608-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SYLVAIN_LETTER, 1);
+ st.giveItems(MARIA_LETTER_1, 1);
+ break;
+ }
+ case "30608-08.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRETA_LETTER_1, 1);
+ st.giveItems(LUCILLA_HANDBAG, 1);
+ break;
+ }
+ case "30608-14.htm":
+ {
+ st.setCond(13);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BROWN_SCROLL_SCRAP, -1);
+ st.takeItems(CRETA_PAINTING_3, 1);
+ st.giveItems(CRYSTAL_OF_PURITY_1, 1);
+ break;
+ }
+ case "30115-03.htm":
+ {
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(GRAND_MAGISTER_SIGIL, 1);
+ st.giveItems(JUREK_LIST, 1);
+ break;
+ }
+ case "30071-04.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRETA_PAINTING_2, 1);
+ st.giveItems(CRETA_PAINTING_3, 1);
+ break;
+ }
+ case "30609-05.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MARIA_LETTER_2, 1);
+ st.giveItems(CRETA_LETTER_1, 1);
+ break;
+ }
+ case "30609-09.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LUCILLA_HANDBAG, 1);
+ st.giveItems(CRETA_PAINTING_1, 1);
+ break;
+ }
+ case "30609-14.htm":
+ {
+ st.setCond(22);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(DIETER_KEY, 1);
+ st.giveItems(CRETA_LETTER_2, 1);
+ break;
+ }
+ case "30610-10.htm":
+ {
+ st.setCond(20);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CRONOS_LETTER, 1);
+ st.giveItems(CRONOS_SIGIL, 1);
+ break;
+ }
+ case "30610-14.htm":
+ {
+ st.setCond(31);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRONOS_SIGIL, 1);
+ st.takeItems(DIETER_DIARY, 1);
+ st.takeItems(SCRIPTURE_CHAPTER_1, 1);
+ st.takeItems(SCRIPTURE_CHAPTER_2, 1);
+ st.takeItems(SCRIPTURE_CHAPTER_3, 1);
+ st.takeItems(SCRIPTURE_CHAPTER_4, 1);
+ st.takeItems(TRIFF_RING, 1);
+ st.giveItems(SYMBOL_OF_CRONOS, 1);
+ break;
+ }
+ case "30111-05.htm":
+ {
+ st.setCond(21);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRONOS_LETTER, 1);
+ st.giveItems(DIETER_KEY, 1);
+ break;
+ }
+ case "30111-09.htm":
+ {
+ st.setCond(23);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRETA_LETTER_2, 1);
+ st.giveItems(DIETER_DIARY, 1);
+ st.giveItems(DIETER_LETTER, 1);
+ break;
+ }
+ case "30230-02.htm":
+ {
+ st.setCond(24);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(DIETER_LETTER, 1);
+ st.giveItems(RAUT_LETTER_ENVELOPE, 1);
+ break;
+ }
+ case "30316-02.htm":
+ {
+ st.setCond(25);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RAUT_LETTER_ENVELOPE, 1);
+ st.giveItems(SCRIPTURE_CHAPTER_1, 1);
+ st.giveItems(STRONG_LIQUOR, 1);
+ break;
+ }
+ case "30611-04.htm":
+ {
+ st.setCond(26);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(STRONG_LIQUOR, 1);
+ st.giveItems(TRIFF_RING, 1);
+ break;
+ }
+ case "30103-04.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(MIRIEN_INSTRUCTION, 1);
+ st.giveItems(VALKON_REQUEST, 1);
+ break;
}
- else
+ case "30612-04.htm":
{
- htmltext = "30461-10.htm";
- st.set("cond", "19");
+ st.setCond(28);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MIRIEN_SIGIL_2, 1);
- st.takeItems(SYMBOL_OF_JUREK, 1);
- st.giveItems(MIRIEN_SIGIL_3, 1);
+ st.giveItems(CASIAN_LIST, 1);
+ break;
+ }
+ case "30612-07.htm":
+ {
+ st.setCond(30);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CASIAN_LIST, 1);
+ st.takeItems(ENCHANTED_GARGOYLE_NAIL, -1);
+ st.takeItems(FETTERED_SOUL_ICHOR, -1);
+ st.takeItems(GHOUL_SKIN, -1);
+ st.takeItems(MEDUSA_BLOOD, -1);
+ st.takeItems(POITAN_NOTES, 1);
+ st.giveItems(SCRIPTURE_CHAPTER_4, 1);
+ break;
}
- }
- // SYLVAIN
- else if (event.equals("30070-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(HIGH_PRIEST_SIGIL, 1);
- st.giveItems(SYLVAIN_LETTER, 1);
- }
- // MARIA
- else if (event.equals("30608-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SYLVAIN_LETTER, 1);
- st.giveItems(MARIA_LETTER_1, 1);
- }
- else if (event.equals("30608-08.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRETA_LETTER_1, 1);
- st.giveItems(LUCILLA_HANDBAG, 1);
- }
- else if (event.equals("30608-14.htm"))
- {
- st.set("cond", "13");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BROWN_SCROLL_SCRAP, -1);
- st.takeItems(CRETA_PAINTING_3, 1);
- st.giveItems(CRYSTAL_OF_PURITY_1, 1);
- }
- // JUREK
- else if (event.equals("30115-03.htm"))
- {
- st.set("cond", "16");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(GRAND_MAGISTER_SIGIL, 1);
- st.giveItems(JUREK_LIST, 1);
- }
- // LUCAS
- else if (event.equals("30071-04.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRETA_PAINTING_2, 1);
- st.giveItems(CRETA_PAINTING_3, 1);
- }
- // CRETA
- else if (event.equals("30609-05.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MARIA_LETTER_2, 1);
- st.giveItems(CRETA_LETTER_1, 1);
- }
- else if (event.equals("30609-09.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LUCILLA_HANDBAG, 1);
- st.giveItems(CRETA_PAINTING_1, 1);
- }
- else if (event.equals("30609-14.htm"))
- {
- st.set("cond", "22");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(DIETER_KEY, 1);
- st.giveItems(CRETA_LETTER_2, 1);
- }
- // CRONOS
- else if (event.equals("30610-10.htm"))
- {
- st.set("cond", "20");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CRONOS_LETTER, 1);
- st.giveItems(CRONOS_SIGIL, 1);
- }
- else if (event.equals("30610-14.htm"))
- {
- st.set("cond", "31");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRONOS_SIGIL, 1);
- st.takeItems(DIETER_DIARY, 1);
- st.takeItems(SCRIPTURE_CHAPTER_1, 1);
- st.takeItems(SCRIPTURE_CHAPTER_2, 1);
- st.takeItems(SCRIPTURE_CHAPTER_3, 1);
- st.takeItems(SCRIPTURE_CHAPTER_4, 1);
- st.takeItems(TRIFF_RING, 1);
- st.giveItems(SYMBOL_OF_CRONOS, 1);
- }
- // DIETER
- else if (event.equals("30111-05.htm"))
- {
- st.set("cond", "21");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRONOS_LETTER, 1);
- st.giveItems(DIETER_KEY, 1);
- }
- else if (event.equals("30111-09.htm"))
- {
- st.set("cond", "23");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRETA_LETTER_2, 1);
- st.giveItems(DIETER_DIARY, 1);
- st.giveItems(DIETER_LETTER, 1);
- }
- // EDROC
- else if (event.equals("30230-02.htm"))
- {
- st.set("cond", "24");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(DIETER_LETTER, 1);
- st.giveItems(RAUT_LETTER_ENVELOPE, 1);
- }
- // RAUT
- else if (event.equals("30316-02.htm"))
- {
- st.set("cond", "25");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RAUT_LETTER_ENVELOPE, 1);
- st.giveItems(SCRIPTURE_CHAPTER_1, 1);
- st.giveItems(STRONG_LIQUOR, 1);
- }
- // TRIFF
- else if (event.equals("30611-04.htm"))
- {
- st.set("cond", "26");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(STRONG_LIQUOR, 1);
- st.giveItems(TRIFF_RING, 1);
- }
- // VALKON
- else if (event.equals("30103-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(VALKON_REQUEST, 1);
- }
- // CASIAN
- else if (event.equals("30612-04.htm"))
- {
- st.set("cond", "28");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CASIAN_LIST, 1);
- }
- else if (event.equals("30612-07.htm"))
- {
- st.set("cond", "30");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CASIAN_LIST, 1);
- st.takeItems(ENCHANTED_GARGOYLE_NAIL, -1);
- st.takeItems(FETTERED_SOUL_ICHOR, -1);
- st.takeItems(GHOUL_SKIN, -1);
- st.takeItems(MEDUSA_BLOOD, -1);
- st.takeItems(POITAN_NOTES, 1);
- st.giveItems(SCRIPTURE_CHAPTER_4, 1);
}
return htmltext;
@@ -332,6 +334,7 @@ public class Q214_TrialOfTheScholar extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.WIZARD) && (player.getClassId() != ClassId.ELVEN_WIZARD) && (player.getClassId() != ClassId.DARK_WIZARD))
{
htmltext = "30461-01.htm";
@@ -345,12 +348,14 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30461-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MIRIEN:
+ {
if (cond < 14)
{
htmltext = "30461-05.htm";
@@ -358,7 +363,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 14)
{
htmltext = "30461-06.htm";
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MIRIEN_SIGIL_1, 1);
st.takeItems(SYMBOL_OF_SYLVAIN, 1);
@@ -383,7 +388,7 @@ public class Q214_TrialOfTheScholar extends Quest
else
{
htmltext = "30461-12.htm";
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MIRIEN_INSTRUCTION, 1);
st.takeItems(MIRIEN_SIGIL_2, 1);
@@ -408,8 +413,9 @@ public class Q214_TrialOfTheScholar extends Quest
st.exitQuest(false);
}
break;
-
+ }
case SYLVAIN:
+ {
if (cond == 1)
{
htmltext = "30070-01.htm";
@@ -421,7 +427,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 13)
{
htmltext = "30070-04.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CRYSTAL_OF_PURITY_1, 1);
st.takeItems(HIGH_PRIEST_SIGIL, 1);
@@ -436,8 +442,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30070-06.htm";
}
break;
-
+ }
case MARIA:
+ {
if (cond == 2)
{
htmltext = "30608-01.htm";
@@ -449,7 +456,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 4)
{
htmltext = "30608-04.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LUCAS_LETTER, 1);
st.giveItems(MARIA_LETTER_2, 1);
@@ -469,7 +476,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 8)
{
htmltext = "30608-10.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CRETA_PAINTING_1, 1);
st.giveItems(CRETA_PAINTING_2, 1);
@@ -481,7 +488,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 10)
{
htmltext = "30608-12.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 11)
@@ -515,8 +522,9 @@ public class Q214_TrialOfTheScholar extends Quest
}
}
break;
-
+ }
case JUREK:
+ {
if (cond == 15)
{
htmltext = "30115-01.htm";
@@ -528,7 +536,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 17)
{
htmltext = "30115-05.htm";
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GRAND_MAGISTER_SIGIL, 1);
st.takeItems(JUREK_LIST, 1);
@@ -546,12 +554,13 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30115-07.htm";
}
break;
-
+ }
case LUCAS:
+ {
if (cond == 3)
{
htmltext = "30071-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MARIA_LETTER_1, 1);
st.giveItems(LUCAS_LETTER, 1);
@@ -577,8 +586,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30071-07.htm";
}
break;
-
+ }
case CRETA:
+ {
if (cond == 5)
{
htmltext = "30609-01.htm";
@@ -608,8 +618,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30609-15.htm";
}
break;
-
+ }
case CRONOS:
+ {
if (cond == 19)
{
htmltext = "30610-01.htm";
@@ -627,8 +638,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30610-15.htm";
}
break;
-
+ }
case DIETER:
+ {
if (cond == 20)
{
htmltext = "30111-01.htm";
@@ -658,8 +670,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30111-15.htm";
}
break;
-
+ }
case EDROC:
+ {
if (cond == 23)
{
htmltext = "30230-01.htm";
@@ -673,8 +686,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30230-04.htm";
}
break;
-
+ }
case RAUT:
+ {
if (cond == 24)
{
htmltext = "30316-01.htm";
@@ -688,8 +702,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30316-05.htm";
}
break;
-
+ }
case TRIFF:
+ {
if (cond == 25)
{
htmltext = "30611-01.htm";
@@ -699,8 +714,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30611-05.htm";
}
break;
-
+ }
case VALKON:
+ {
if (st.hasQuestItems(TRIFF_RING))
{
if (!st.hasQuestItems(SCRIPTURE_CHAPTER_2))
@@ -730,8 +746,9 @@ public class Q214_TrialOfTheScholar extends Quest
}
}
break;
-
+ }
case POITAN:
+ {
if ((cond == 26) || (cond == 27))
{
if (!st.hasQuestItems(POITAN_NOTES))
@@ -754,8 +771,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30458-04.htm";
}
break;
-
+ }
case CASIAN:
+ {
if (((cond == 26) || (cond == 27)) && st.hasQuestItems(POITAN_NOTES))
{
if (st.hasQuestItems(SCRIPTURE_CHAPTER_1, SCRIPTURE_CHAPTER_2, SCRIPTURE_CHAPTER_3))
@@ -767,7 +785,7 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30612-01.htm";
if (cond == 26)
{
- st.set("cond", "27");
+ st.setCond(27);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -785,12 +803,15 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30612-08.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -808,68 +829,78 @@ public class Q214_TrialOfTheScholar extends Quest
switch (npc.getNpcId())
{
case LETO_LIZARDMAN_WARRIOR:
- if ((st.getInt("cond") == 11) && st.dropItems(BROWN_SCROLL_SCRAP, 1, 5, 500000))
+ {
+ if (st.isCond(11) && st.dropItems(BROWN_SCROLL_SCRAP, 1, 5, 500000))
{
- st.set("cond", "12");
+ st.setCond(12);
}
break;
-
+ }
case SHACKLE_1:
case SHACKLE_2:
- if ((st.getInt("cond") == 16) && st.dropItems(SHACKLE_SCALP, 1, 2, 500000) && (st.getQuestItemsCount(MONSTER_EYE_DESTROYER_SKIN) == 5) && (st.getQuestItemsCount(SHAMAN_NECKLACE) == 5))
+ {
+ if (st.isCond(16) && st.dropItems(SHACKLE_SCALP, 1, 2, 500000) && (st.getQuestItemsCount(MONSTER_EYE_DESTROYER_SKIN) == 5) && (st.getQuestItemsCount(SHAMAN_NECKLACE) == 5))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case MONSTER_EYE_DESTROYER:
- if ((st.getInt("cond") == 16) && st.dropItems(MONSTER_EYE_DESTROYER_SKIN, 1, 5, 500000) && (st.getQuestItemsCount(SHACKLE_SCALP) == 2) && (st.getQuestItemsCount(SHAMAN_NECKLACE) == 5))
+ {
+ if (st.isCond(16) && st.dropItems(MONSTER_EYE_DESTROYER_SKIN, 1, 5, 500000) && (st.getQuestItemsCount(SHACKLE_SCALP) == 2) && (st.getQuestItemsCount(SHAMAN_NECKLACE) == 5))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case BREKA_ORC_SHAMAN:
- if ((st.getInt("cond") == 16) && st.dropItems(SHAMAN_NECKLACE, 1, 5, 500000) && (st.getQuestItemsCount(SHACKLE_SCALP) == 2) && (st.getQuestItemsCount(MONSTER_EYE_DESTROYER_SKIN) == 5))
+ {
+ if (st.isCond(16) && st.dropItems(SHAMAN_NECKLACE, 1, 5, 500000) && (st.getQuestItemsCount(SHACKLE_SCALP) == 2) && (st.getQuestItemsCount(MONSTER_EYE_DESTROYER_SKIN) == 5))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case GRANDIS:
+ {
if (st.hasQuestItems(TRIFF_RING))
{
st.dropItems(SCRIPTURE_CHAPTER_3, 1, 1, 300000);
}
break;
-
+ }
case MEDUSA:
- if ((st.getInt("cond") == 28) && st.dropItemsAlways(MEDUSA_BLOOD, 1, 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
+ {
+ if (st.isCond(28) && st.dropItemsAlways(MEDUSA_BLOOD, 1, 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
{
- st.set("cond", "29");
+ st.setCond(29);
}
break;
-
+ }
case GHOUL:
- if ((st.getInt("cond") == 28) && st.dropItemsAlways(GHOUL_SKIN, 1, 10) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
+ {
+ if (st.isCond(28) && st.dropItemsAlways(GHOUL_SKIN, 1, 10) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
{
- st.set("cond", "29");
+ st.setCond(29);
}
break;
-
+ }
case FETTERED_SOUL:
- if ((st.getInt("cond") == 28) && st.dropItemsAlways(FETTERED_SOUL_ICHOR, 1, 5) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
+ {
+ if (st.isCond(28) && st.dropItemsAlways(FETTERED_SOUL_ICHOR, 1, 5) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
{
- st.set("cond", "29");
+ st.setCond(29);
}
break;
-
+ }
case ENCHANTED_GARGOYLE:
- if ((st.getInt("cond") == 28) && st.dropItemsAlways(ENCHANTED_GARGOYLE_NAIL, 1, 5) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5))
+ {
+ if (st.isCond(28) && st.dropItemsAlways(ENCHANTED_GARGOYLE_NAIL, 1, 5) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5))
{
- st.set("cond", "29");
+ st.setCond(29);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q215_TrialOfThePilgrim/Q215_TrialOfThePilgrim.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q215_TrialOfThePilgrim/Q215_TrialOfThePilgrim.java
index 7137211f43..74e97410ec 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q215_TrialOfThePilgrim/Q215_TrialOfThePilgrim.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q215_TrialOfThePilgrim/Q215_TrialOfThePilgrim.java
@@ -27,6 +27,22 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q215_TrialOfThePilgrim extends Quest
{
+ // NPCs
+ private static final int SANTIAGO = 30648;
+ private static final int TANAPI = 30571;
+ private static final int ANCESTOR_MARTANKUS = 30649;
+ private static final int GAURI_TWINKLEROCK = 30550;
+ private static final int DORF = 30651;
+ private static final int GERALD = 30650;
+ private static final int PRIMOS = 30117;
+ private static final int PETRON = 30036;
+ private static final int ANDELLIA = 30362;
+ private static final int URUHA = 30652;
+ private static final int CASIAN = 30612;
+ // Monsters
+ private static final int LAVA_SALAMANDER = 27116;
+ private static final int NAHIR = 27117;
+ private static final int BLACK_WILLOW = 27118;
// Items
private static final int BOOK_OF_SAGE = 2722;
private static final int VOUCHER_OF_TRIAL = 2723;
@@ -40,38 +56,16 @@ public class Q215_TrialOfThePilgrim extends Quest
private static final int BOOK_OF_DARKNESS = 2731;
private static final int DEBRIS_OF_WILLOW = 2732;
private static final int TAG_OF_RUMOR = 2733;
-
// Rewards
private static final int MARK_OF_PILGRIM = 2721;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int SANTIAGO = 30648;
- private static final int TANAPI = 30571;
- private static final int ANCESTOR_MARTANKUS = 30649;
- private static final int GAURI_TWINKLEROCK = 30550;
- private static final int DORF = 30651;
- private static final int GERALD = 30650;
- private static final int PRIMOS = 30117;
- private static final int PETRON = 30036;
- private static final int ANDELLIA = 30362;
- private static final int URUHA = 30652;
- private static final int CASIAN = 30612;
-
- // Monsters
- private static final int LAVA_SALAMANDER = 27116;
- private static final int NAHIR = 27117;
- private static final int BLACK_WILLOW = 27118;
-
public Q215_TrialOfThePilgrim()
{
super(215, "Trial of the Pilgrim");
-
registerQuestItems(BOOK_OF_SAGE, VOUCHER_OF_TRIAL, SPIRIT_OF_FLAME, ESSENCE_OF_FLAME, BOOK_OF_GERALD, GRAY_BADGE, PICTURE_OF_NAHIR, HAIR_OF_NAHIR, STATUE_OF_EINHASAD, BOOK_OF_DARKNESS, DEBRIS_OF_WILLOW, TAG_OF_RUMOR);
-
addStartNpc(SANTIAGO);
addTalkId(SANTIAGO, TANAPI, ANCESTOR_MARTANKUS, GAURI_TWINKLEROCK, DORF, GERALD, PRIMOS, PETRON, ANDELLIA, URUHA, CASIAN);
-
addKillId(LAVA_SALAMANDER, NAHIR, BLACK_WILLOW);
}
@@ -79,64 +73,69 @@ public class Q215_TrialOfThePilgrim extends Quest
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{
String htmltext = event;
-
final QuestState st = player.getQuestState(getName());
if (st == null)
{
return htmltext;
}
- if (event.equals("30648-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(VOUCHER_OF_TRIAL, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange35", false))
+ case "30648-04.htm":
{
- htmltext = "30648-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange35", true);
+ st.startQuest();
+ st.giveItems(VOUCHER_OF_TRIAL, 1);
+ if (!player.getVariables().getBoolean("secondClassChange35", false))
+ {
+ htmltext = "30648-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange35", true);
+ }
+ break;
}
- }
- else if (event.equals("30649-04.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ESSENCE_OF_FLAME, 1);
- st.giveItems(SPIRIT_OF_FLAME, 1);
- }
- else if (event.equals("30650-02.htm"))
- {
- if (st.getQuestItemsCount(57) >= 100000)
+ case "30649-04.htm":
{
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(57, 100000);
- st.giveItems(BOOK_OF_GERALD, 1);
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ESSENCE_OF_FLAME, 1);
+ st.giveItems(SPIRIT_OF_FLAME, 1);
+ break;
}
- else
+ case "30650-02.htm":
{
- htmltext = "30650-03.htm";
+ if (st.getQuestItemsCount(57) >= 100000)
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(57, 100000);
+ st.giveItems(BOOK_OF_GERALD, 1);
+ }
+ else
+ {
+ htmltext = "30650-03.htm";
+ }
+ break;
+ }
+ case "30652-02.htm":
+ {
+ st.setCond(15);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(DEBRIS_OF_WILLOW, 1);
+ st.giveItems(BOOK_OF_DARKNESS, 1);
+ break;
+ }
+ case "30362-04.htm":
+ {
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30362-05.htm":
+ {
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BOOK_OF_DARKNESS, 1);
+ break;
}
- }
- else if (event.equals("30652-02.htm"))
- {
- st.set("cond", "15");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(DEBRIS_OF_WILLOW, 1);
- st.giveItems(BOOK_OF_DARKNESS, 1);
- }
- else if (event.equals("30362-04.htm"))
- {
- st.set("cond", "16");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30362-05.htm"))
- {
- st.set("cond", "16");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BOOK_OF_DARKNESS, 1);
}
return htmltext;
@@ -155,6 +154,7 @@ public class Q215_TrialOfThePilgrim extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.CLERIC) && (player.getClassId() != ClassId.ORACLE) && (player.getClassId() != ClassId.SHILLIEN_ORACLE) && (player.getClassId() != ClassId.ORC_SHAMAN))
{
htmltext = "30648-02.htm";
@@ -168,12 +168,14 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30648-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SANTIAGO:
+ {
if (cond < 17)
{
htmltext = "30648-09.htm";
@@ -189,12 +191,13 @@ public class Q215_TrialOfThePilgrim extends Quest
st.exitQuest(false);
}
break;
-
+ }
case TANAPI:
+ {
if (cond == 1)
{
htmltext = "30571-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(VOUCHER_OF_TRIAL, 1);
}
@@ -208,17 +211,18 @@ public class Q215_TrialOfThePilgrim extends Quest
if (cond == 5)
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
break;
-
+ }
case ANCESTOR_MARTANKUS:
+ {
if (cond == 2)
{
htmltext = "30649-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 3)
@@ -230,12 +234,13 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30649-03.htm";
}
break;
-
+ }
case GAURI_TWINKLEROCK:
+ {
if (cond == 6)
{
htmltext = "30550-01.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(TAG_OF_RUMOR, 1);
}
@@ -244,12 +249,13 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30550-02.htm";
}
break;
-
+ }
case DORF:
+ {
if (cond == 7)
{
htmltext = (!st.hasQuestItems(BOOK_OF_GERALD)) ? "30651-01.htm" : "30651-02.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TAG_OF_RUMOR, 1);
st.giveItems(GRAY_BADGE, 1);
@@ -259,8 +265,9 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30651-03.htm";
}
break;
-
+ }
case GERALD:
+ {
if ((cond == 7) && !st.hasQuestItems(BOOK_OF_GERALD))
{
htmltext = "30650-01.htm";
@@ -273,12 +280,13 @@ public class Q215_TrialOfThePilgrim extends Quest
st.giveItems(57, 100000);
}
break;
-
+ }
case PRIMOS:
+ {
if (cond == 8)
{
htmltext = "30117-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond > 8)
@@ -286,12 +294,13 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30117-02.htm";
}
break;
-
+ }
case PETRON:
+ {
if (cond == 9)
{
htmltext = "30036-01.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(PICTURE_OF_NAHIR, 1);
}
@@ -302,7 +311,7 @@ public class Q215_TrialOfThePilgrim extends Quest
else if (cond == 11)
{
htmltext = "30036-03.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HAIR_OF_NAHIR, 1);
st.takeItems(PICTURE_OF_NAHIR, 1);
@@ -313,8 +322,9 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30036-04.htm";
}
break;
-
+ }
case ANDELLIA:
+ {
if (cond == 12)
{
if (player.getLevel() < 36)
@@ -324,7 +334,7 @@ public class Q215_TrialOfThePilgrim extends Quest
else
{
htmltext = "30362-01.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -345,8 +355,9 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30362-06.htm";
}
break;
-
+ }
case URUHA:
+ {
if (cond == 14)
{
htmltext = "30652-01.htm";
@@ -356,12 +367,13 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30652-03.htm";
}
break;
-
+ }
case CASIAN:
+ {
if (cond == 16)
{
htmltext = "30612-01.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BOOK_OF_DARKNESS, 1);
st.takeItems(GRAY_BADGE, 1);
@@ -374,12 +386,15 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30612-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -397,25 +412,29 @@ public class Q215_TrialOfThePilgrim extends Quest
switch (npc.getNpcId())
{
case LAVA_SALAMANDER:
- if ((st.getInt("cond") == 3) && st.dropItems(ESSENCE_OF_FLAME, 1, 1, 200000))
+ {
+ if (st.isCond(3) && st.dropItems(ESSENCE_OF_FLAME, 1, 1, 200000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case NAHIR:
- if ((st.getInt("cond") == 10) && st.dropItems(HAIR_OF_NAHIR, 1, 1, 200000))
+ {
+ if (st.isCond(10) && st.dropItems(HAIR_OF_NAHIR, 1, 1, 200000))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case BLACK_WILLOW:
- if ((st.getInt("cond") == 13) && st.dropItems(DEBRIS_OF_WILLOW, 1, 1, 200000))
+ {
+ if (st.isCond(13) && st.dropItems(DEBRIS_OF_WILLOW, 1, 1, 200000))
{
- st.set("cond", "14");
+ st.setCond(14);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q216_TrialOfTheGuildsman/Q216_TrialOfTheGuildsman.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q216_TrialOfTheGuildsman/Q216_TrialOfTheGuildsman.java
index 3077419680..d9c8b131ad 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q216_TrialOfTheGuildsman/Q216_TrialOfTheGuildsman.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q216_TrialOfTheGuildsman/Q216_TrialOfTheGuildsman.java
@@ -27,6 +27,26 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q216_TrialOfTheGuildsman extends Quest
{
+ // NPCs
+ private static final int VALKON = 30103;
+ private static final int NORMAN = 30210;
+ private static final int ALTRAN = 30283;
+ private static final int PINTER = 30298;
+ private static final int DUNING = 30688;
+ // Monsters
+ private static final int ANT = 20079;
+ private static final int ANT_CAPTAIN = 20080;
+ private static final int GRANITE_GOLEM = 20083;
+ private static final int MANDRAGORA_SPROUT = 20154;
+ private static final int MANDRAGORA_SAPLING = 20155;
+ private static final int MANDRAGORA_BLOSSOM = 20156;
+ private static final int SILENOS = 20168;
+ private static final int STRAIN = 20200;
+ private static final int GHOUL = 20201;
+ private static final int DEAD_SEEKER = 20202;
+ private static final int BREKA_ORC_SHAMAN = 20269;
+ private static final int BREKA_ORC_OVERLORD = 20270;
+ private static final int BREKA_ORC_WARRIOR = 20271;
// Items
private static final int RECIPE_JOURNEYMAN_RING = 3024;
private static final int RECIPE_AMBER_BEAD = 3025;
@@ -50,42 +70,16 @@ public class Q216_TrialOfTheGuildsman extends Quest
private static final int AMBER_LUMP = 3137;
private static final int JOURNEYMAN_DECO_BEADS = 3138;
private static final int JOURNEYMAN_RING = 3139;
-
// Rewards
private static final int MARK_OF_GUILDSMAN = 3119;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int VALKON = 30103;
- private static final int NORMAN = 30210;
- private static final int ALTRAN = 30283;
- private static final int PINTER = 30298;
- private static final int DUNING = 30688;
-
- // Monsters
- private static final int ANT = 20079;
- private static final int ANT_CAPTAIN = 20080;
- private static final int GRANITE_GOLEM = 20083;
- private static final int MANDRAGORA_SPROUT = 20154;
- private static final int MANDRAGORA_SAPLING = 20155;
- private static final int MANDRAGORA_BLOSSOM = 20156;
- private static final int SILENOS = 20168;
- private static final int STRAIN = 20200;
- private static final int GHOUL = 20201;
- private static final int DEAD_SEEKER = 20202;
- private static final int BREKA_ORC_SHAMAN = 20269;
- private static final int BREKA_ORC_OVERLORD = 20270;
- private static final int BREKA_ORC_WARRIOR = 20271;
-
public Q216_TrialOfTheGuildsman()
{
super(216, "Trial of the Guildsman");
-
registerQuestItems(RECIPE_JOURNEYMAN_RING, RECIPE_AMBER_BEAD, VALKON_RECOMMENDATION, MANDRAGORA_BERRY, ALTRAN_INSTRUCTIONS, ALTRAN_RECOMMENDATION_1, ALTRAN_RECOMMENDATION_2, NORMAN_INSTRUCTIONS, NORMAN_RECEIPT, DUNING_INSTRUCTIONS, DUNING_KEY, NORMAN_LIST, GRAY_BONE_POWDER, GRANITE_WHETSTONE, RED_PIGMENT, BRAIDED_YARN, JOURNEYMAN_GEM, PINTER_INSTRUCTIONS, AMBER_BEAD, AMBER_LUMP, JOURNEYMAN_DECO_BEADS, JOURNEYMAN_RING);
-
addStartNpc(VALKON);
addTalkId(VALKON, NORMAN, ALTRAN, PINTER, DUNING);
-
addKillId(ANT, ANT_CAPTAIN, GRANITE_GOLEM, MANDRAGORA_SPROUT, MANDRAGORA_SAPLING, MANDRAGORA_BLOSSOM, SILENOS, STRAIN, GHOUL, DEAD_SEEKER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, BREKA_ORC_WARRIOR);
}
@@ -93,94 +87,103 @@ public class Q216_TrialOfTheGuildsman extends Quest
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{
String htmltext = event;
-
final QuestState st = player.getQuestState(getName());
if (st == null)
{
return htmltext;
}
- if (event.equals("30103-06.htm"))
+ switch (event)
{
- if (st.getQuestItemsCount(57) >= 2000)
+ case "30103-06.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.takeItems(57, 2000);
- st.giveItems(VALKON_RECOMMENDATION, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange35", false))
+ if (st.getQuestItemsCount(57) >= 2000)
{
- htmltext = "30103-06d.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange35", true);
+ st.startQuest();
+ st.takeItems(57, 2000);
+ st.giveItems(VALKON_RECOMMENDATION, 1);
+
+ if (!player.getVariables().getBoolean("secondClassChange35", false))
+ {
+ htmltext = "30103-06d.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange35", true);
+ }
}
+ else
+ {
+ htmltext = "30103-05a.htm";
+ }
+ break;
}
- else
+ case "30103-06c.htm":
+ case "30103-07c.htm":
{
- htmltext = "30103-05a.htm";
+ if (st.getCond() < 3)
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
}
- }
- else if (event.equals("30103-06c.htm") || event.equals("30103-07c.htm"))
- {
- if (st.getInt("cond") < 3)
+ case "30103-09a.htm":
+ case "30103-09b.htm":
{
- st.set("cond", "3");
+ st.takeItems(ALTRAN_INSTRUCTIONS, 1);
+ st.takeItems(JOURNEYMAN_RING, -1);
+ st.giveItems(MARK_OF_GUILDSMAN, 1);
+ st.rewardExpAndSp(80993, 12250);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "30210-04.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(ALTRAN_RECOMMENDATION_1, 1);
+ st.giveItems(NORMAN_INSTRUCTIONS, 1);
+ st.giveItems(NORMAN_RECEIPT, 1);
+ break;
+ }
+ case "30210-10.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(NORMAN_LIST, 1);
+ break;
+ }
+ case "30283-03.htm":
+ {
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MANDRAGORA_BERRY, 1);
+ st.takeItems(VALKON_RECOMMENDATION, 1);
+ st.giveItems(ALTRAN_INSTRUCTIONS, 1);
+ st.giveItems(ALTRAN_RECOMMENDATION_1, 1);
+ st.giveItems(ALTRAN_RECOMMENDATION_2, 1);
+ st.giveItems(RECIPE_JOURNEYMAN_RING, 1);
+ break;
}
- }
- else if (event.equals("30103-09a.htm") || event.equals("30103-09b.htm"))
- {
- st.takeItems(ALTRAN_INSTRUCTIONS, 1);
- st.takeItems(JOURNEYMAN_RING, -1);
- st.giveItems(MARK_OF_GUILDSMAN, 1);
- st.rewardExpAndSp(80993, 12250);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else if (event.equals("30210-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(ALTRAN_RECOMMENDATION_1, 1);
- st.giveItems(NORMAN_INSTRUCTIONS, 1);
- st.giveItems(NORMAN_RECEIPT, 1);
- }
- else if (event.equals("30210-10.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(NORMAN_LIST, 1);
- }
- else if (event.equals("30283-03.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MANDRAGORA_BERRY, 1);
- st.takeItems(VALKON_RECOMMENDATION, 1);
- st.giveItems(ALTRAN_INSTRUCTIONS, 1);
- st.giveItems(ALTRAN_RECOMMENDATION_1, 1);
- st.giveItems(ALTRAN_RECOMMENDATION_2, 1);
- st.giveItems(RECIPE_JOURNEYMAN_RING, 1);
- }
- else if (event.equals("30298-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(ALTRAN_RECOMMENDATION_2, 1);
- st.giveItems(PINTER_INSTRUCTIONS, 1);
-
- // Artisan receives a recipe to craft Amber Beads, while spoiler case is handled in onKill section.
- if (player.getClassId() == ClassId.ARTISAN)
+ case "30298-04.htm":
{
- htmltext = "30298-05.htm";
- st.giveItems(RECIPE_AMBER_BEAD, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(ALTRAN_RECOMMENDATION_2, 1);
+ st.giveItems(PINTER_INSTRUCTIONS, 1);
+ // Artisan receives a recipe to craft Amber Beads, while spoiler case is handled in onKill section.
+ if (player.getClassId() == ClassId.ARTISAN)
+ {
+ htmltext = "30298-05.htm";
+ st.giveItems(RECIPE_AMBER_BEAD, 1);
+ }
+ break;
+ }
+ case "30688-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(NORMAN_RECEIPT, 1);
+ st.giveItems(DUNING_INSTRUCTIONS, 1);
+ break;
}
- }
- else if (event.equals("30688-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(NORMAN_RECEIPT, 1);
- st.giveItems(DUNING_INSTRUCTIONS, 1);
}
return htmltext;
@@ -199,6 +202,7 @@ public class Q216_TrialOfTheGuildsman extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.SCAVENGER) && (player.getClassId() != ClassId.ARTISAN))
{
htmltext = "30103-01.htm";
@@ -212,12 +216,14 @@ public class Q216_TrialOfTheGuildsman extends Quest
htmltext = "30103-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VALKON:
+ {
if (cond == 1)
{
htmltext = "30103-06c.htm";
@@ -235,14 +241,15 @@ public class Q216_TrialOfTheGuildsman extends Quest
htmltext = (st.getQuestItemsCount(JOURNEYMAN_RING) == 7) ? "30103-09.htm" : "30103-08.htm";
}
break;
-
+ }
case ALTRAN:
+ {
if (cond < 4)
{
htmltext = "30283-01.htm";
if (cond == 1)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -255,8 +262,9 @@ public class Q216_TrialOfTheGuildsman extends Quest
htmltext = "30283-04.htm";
}
break;
-
+ }
case NORMAN:
+ {
if (cond == 5)
{
if (st.hasQuestItems(ALTRAN_RECOMMENDATION_1))
@@ -292,7 +300,7 @@ public class Q216_TrialOfTheGuildsman extends Quest
if (st.getQuestItemsCount(JOURNEYMAN_DECO_BEADS) == 7)
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -307,8 +315,9 @@ public class Q216_TrialOfTheGuildsman extends Quest
}
}
break;
-
+ }
case DUNING:
+ {
if (cond == 5)
{
if (st.hasQuestItems(NORMAN_RECEIPT))
@@ -334,8 +343,9 @@ public class Q216_TrialOfTheGuildsman extends Quest
}
}
break;
-
+ }
case PINTER:
+ {
if (cond == 5)
{
if (st.hasQuestItems(ALTRAN_RECOMMENDATION_2))
@@ -357,7 +367,7 @@ public class Q216_TrialOfTheGuildsman extends Quest
if (st.getQuestItemsCount(JOURNEYMAN_GEM) == 7)
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -372,12 +382,15 @@ public class Q216_TrialOfTheGuildsman extends Quest
htmltext = "30298-08.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -397,61 +410,66 @@ public class Q216_TrialOfTheGuildsman extends Quest
case MANDRAGORA_SPROUT:
case MANDRAGORA_SAPLING:
case MANDRAGORA_BLOSSOM:
- if ((st.getInt("cond") == 3) && st.dropItemsAlways(MANDRAGORA_BERRY, 1, 1))
+ {
+ if (st.isCond(3) && st.dropItemsAlways(MANDRAGORA_BERRY, 1, 1))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case BREKA_ORC_WARRIOR:
case BREKA_ORC_OVERLORD:
case BREKA_ORC_SHAMAN:
+ {
if (st.hasQuestItems(DUNING_INSTRUCTIONS))
{
st.dropItemsAlways(DUNING_KEY, 1, 30);
}
break;
-
+ }
case GHOUL:
case STRAIN:
+ {
if (st.hasQuestItems(NORMAN_LIST))
{
st.dropItemsAlways(GRAY_BONE_POWDER, 5, 70);
}
break;
-
+ }
case GRANITE_GOLEM:
+ {
if (st.hasQuestItems(NORMAN_LIST))
{
st.dropItemsAlways(GRANITE_WHETSTONE, 7, 70);
}
break;
-
+ }
case DEAD_SEEKER:
+ {
if (st.hasQuestItems(NORMAN_LIST))
{
st.dropItemsAlways(RED_PIGMENT, 7, 70);
}
break;
-
+ }
case SILENOS:
+ {
if (st.hasQuestItems(NORMAN_LIST))
{
st.dropItemsAlways(BRAIDED_YARN, 10, 70);
}
break;
-
+ }
case ANT:
case ANT_CAPTAIN:
- if (st.hasQuestItems(PINTER_INSTRUCTIONS))
+ {
+ // Different cases if player is a wannabe BH or WS.
+ if (st.hasQuestItems(PINTER_INSTRUCTIONS) && st.dropItemsAlways(AMBER_BEAD, ((player.getClassId() == ClassId.SCAVENGER) && (npc.getSpoiledBy() == player.getObjectId())) ? 10 : 5, 70) && (player.getClassId() == ClassId.ARTISAN) && Rnd.nextBoolean())
{
- // Different cases if player is a wannabe BH or WS.
- if (st.dropItemsAlways(AMBER_BEAD, ((player.getClassId() == ClassId.SCAVENGER) && (npc.getSpoiledBy() == player.getObjectId())) ? 10 : 5, 70) && (player.getClassId() == ClassId.ARTISAN) && Rnd.nextBoolean())
- {
- st.giveItems(AMBER_LUMP, 1);
- }
+ st.giveItems(AMBER_LUMP, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q217_TestimonyOfTrust/Q217_TestimonyOfTrust.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q217_TestimonyOfTrust/Q217_TestimonyOfTrust.java
index 7e9557da9c..e274023430 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q217_TestimonyOfTrust/Q217_TestimonyOfTrust.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q217_TestimonyOfTrust/Q217_TestimonyOfTrust.java
@@ -27,6 +27,36 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q217_TestimonyOfTrust extends Quest
{
+ // NPCs
+ private static final int HOLLINT = 30191;
+ private static final int ASTERIOS = 30154;
+ private static final int THIFIELL = 30358;
+ private static final int CLAYTON = 30464;
+ private static final int SERESIN = 30657;
+ private static final int KAKAI = 30565;
+ private static final int MANAKIA = 30515;
+ private static final int LOCKIRIN = 30531;
+ private static final int NIKOLA = 30621;
+ private static final int BIOTIN = 30031;
+ // Monsters
+ private static final int DRYAD = 20013;
+ private static final int DRYAD_ELDER = 20019;
+ private static final int LIREIN = 20036;
+ private static final int LIREIN_ELDER = 20044;
+ private static final int ACTEA_OF_VERDANT_WILDS = 27121;
+ private static final int LUELL_OF_ZEPHYR_WINDS = 27120;
+ private static final int GUARDIAN_BASILIK = 20550;
+ private static final int ANT_RECRUIT = 20082;
+ private static final int ANT_PATROL = 20084;
+ private static final int ANT_GUARD = 20086;
+ private static final int ANT_SOLDIER = 20087;
+ private static final int ANT_WARRIOR_CAPTAIN = 20088;
+ private static final int MARSH_STAKATO = 20157;
+ private static final int MARSH_STAKATO_WORKER = 20230;
+ private static final int MARSH_STAKATO_SOLDIER = 20232;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int WINDSUS = 20553;
+ private static final int PORTA = 20213;
// Items
private static final int LETTER_TO_ELF = 2735;
private static final int LETTER_TO_DARK_ELF = 2736;
@@ -55,52 +85,16 @@ public class Q217_TestimonyOfTrust extends Quest
private static final int LETTER_TO_NIKOLA = 2759;
private static final int ORDER_OF_NIKOLA = 2760;
private static final int HEARTSTONE_OF_PORTA = 2761;
-
// Rewards
private static final int MARK_OF_TRUST = 2734;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int HOLLINT = 30191;
- private static final int ASTERIOS = 30154;
- private static final int THIFIELL = 30358;
- private static final int CLAYTON = 30464;
- private static final int SERESIN = 30657;
- private static final int KAKAI = 30565;
- private static final int MANAKIA = 30515;
- private static final int LOCKIRIN = 30531;
- private static final int NIKOLA = 30621;
- private static final int BIOTIN = 30031;
-
- // Monsters
- private static final int DRYAD = 20013;
- private static final int DRYAD_ELDER = 20019;
- private static final int LIREIN = 20036;
- private static final int LIREIN_ELDER = 20044;
- private static final int ACTEA_OF_VERDANT_WILDS = 27121;
- private static final int LUELL_OF_ZEPHYR_WINDS = 27120;
- private static final int GUARDIAN_BASILIK = 20550;
- private static final int ANT_RECRUIT = 20082;
- private static final int ANT_PATROL = 20084;
- private static final int ANT_GUARD = 20086;
- private static final int ANT_SOLDIER = 20087;
- private static final int ANT_WARRIOR_CAPTAIN = 20088;
- private static final int MARSH_STAKATO = 20157;
- private static final int MARSH_STAKATO_WORKER = 20230;
- private static final int MARSH_STAKATO_SOLDIER = 20232;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int WINDSUS = 20553;
- private static final int PORTA = 20213;
-
public Q217_TestimonyOfTrust()
{
super(217, "Testimony of Trust");
-
registerQuestItems(LETTER_TO_ELF, LETTER_TO_DARK_ELF, LETTER_TO_DWARF, LETTER_TO_ORC, LETTER_TO_SERESIN, SCROLL_OF_DARK_ELF_TRUST, SCROLL_OF_ELF_TRUST, SCROLL_OF_DWARF_TRUST, SCROLL_OF_ORC_TRUST, RECOMMENDATION_OF_HOLLINT, ORDER_OF_ASTERIOS, BREATH_OF_WINDS, SEED_OF_VERDURE, LETTER_FROM_THIFIELL, BLOOD_GUARDIAN_BASILIK, GIANT_APHID, STAKATO_FLUIDS, BASILIK_PLASMA, HONEY_DEW, STAKATO_ICHOR, ORDER_OF_CLAYTON, PARASITE_OF_LOTA, LETTER_TO_MANAKIA, LETTER_OF_MANAKIA, LETTER_TO_NIKOLA, ORDER_OF_NIKOLA, HEARTSTONE_OF_PORTA);
-
addStartNpc(HOLLINT);
addTalkId(HOLLINT, ASTERIOS, THIFIELL, CLAYTON, SERESIN, KAKAI, MANAKIA, LOCKIRIN, NIKOLA, BIOTIN);
-
addKillId(DRYAD, DRYAD_ELDER, LIREIN, LIREIN_ELDER, ACTEA_OF_VERDANT_WILDS, LUELL_OF_ZEPHYR_WINDS, GUARDIAN_BASILIK, ANT_RECRUIT, ANT_PATROL, ANT_GUARD, ANT_SOLDIER, ANT_WARRIOR_CAPTAIN, MARSH_STAKATO, MARSH_STAKATO_WORKER, MARSH_STAKATO_SOLDIER, MARSH_STAKATO_DRONE, WINDSUS, PORTA);
}
@@ -108,87 +102,94 @@ public class Q217_TestimonyOfTrust extends Quest
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{
String htmltext = event;
-
final QuestState st = player.getQuestState(getName());
if (st == null)
{
return htmltext;
}
- if (event.equals("30191-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LETTER_TO_ELF, 1);
- st.giveItems(LETTER_TO_DARK_ELF, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange37", false))
+ case "30191-04.htm":
{
- htmltext = "30191-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
- player.getVariables().set("secondClassChange37", true);
- }
- }
- else if (event.equals("30154-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_ELF, 1);
- st.giveItems(ORDER_OF_ASTERIOS, 1);
- }
- else if (event.equals("30358-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_DARK_ELF, 1);
- st.giveItems(LETTER_FROM_THIFIELL, 1);
- }
- else if (event.equals("30515-02.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_MANAKIA, 1);
- }
- else if (event.equals("30531-02.htm"))
- {
- st.set("cond", "18");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_DWARF, 1);
- st.giveItems(LETTER_TO_NIKOLA, 1);
- }
- else if (event.equals("30565-02.htm"))
- {
- st.set("cond", "13");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_ORC, 1);
- st.giveItems(LETTER_TO_MANAKIA, 1);
- }
- else if (event.equals("30621-02.htm"))
- {
- st.set("cond", "19");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_NIKOLA, 1);
- st.giveItems(ORDER_OF_NIKOLA, 1);
- }
- else if (event.equals("30657-03.htm"))
- {
- if (player.getLevel() < 38)
- {
- htmltext = "30657-02.htm";
- if (st.getInt("cond") == 10)
+ st.startQuest();
+ st.giveItems(LETTER_TO_ELF, 1);
+ st.giveItems(LETTER_TO_DARK_ELF, 1);
+ if (!player.getVariables().getBoolean("secondClassChange37", false))
{
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_MIDDLE);
+ htmltext = "30191-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
+ player.getVariables().set("secondClassChange37", true);
}
+ break;
}
- else
+ case "30154-03.htm":
{
- st.set("cond", "12");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_SERESIN, 1);
- st.giveItems(LETTER_TO_DWARF, 1);
- st.giveItems(LETTER_TO_ORC, 1);
+ st.takeItems(LETTER_TO_ELF, 1);
+ st.giveItems(ORDER_OF_ASTERIOS, 1);
+ break;
+ }
+ case "30358-02.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_DARK_ELF, 1);
+ st.giveItems(LETTER_FROM_THIFIELL, 1);
+ break;
+ }
+ case "30515-02.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_MANAKIA, 1);
+ break;
+ }
+ case "30531-02.htm":
+ {
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_DWARF, 1);
+ st.giveItems(LETTER_TO_NIKOLA, 1);
+ break;
+ }
+ case "30565-02.htm":
+ {
+ st.setCond(13);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_ORC, 1);
+ st.giveItems(LETTER_TO_MANAKIA, 1);
+ break;
+ }
+ case "30621-02.htm":
+ {
+ st.setCond(19);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_NIKOLA, 1);
+ st.giveItems(ORDER_OF_NIKOLA, 1);
+ break;
+ }
+ case "30657-03.htm":
+ {
+ if (player.getLevel() < 38)
+ {
+ htmltext = "30657-02.htm";
+ if (st.isCond(10))
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ }
+ else
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_SERESIN, 1);
+ st.giveItems(LETTER_TO_DWARF, 1);
+ st.giveItems(LETTER_TO_ORC, 1);
+ }
+ break;
}
}
@@ -208,6 +209,7 @@ public class Q217_TestimonyOfTrust extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId().level() != 1)
{
htmltext = "30191-01a.htm";
@@ -225,12 +227,14 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30191-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HOLLINT:
+ {
if (cond < 9)
{
htmltext = "30191-08.htm";
@@ -238,7 +242,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 9)
{
htmltext = "30191-05.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SCROLL_OF_DARK_ELF_TRUST, 1);
st.takeItems(SCROLL_OF_ELF_TRUST, 1);
@@ -251,7 +255,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 22)
{
htmltext = "30191-06.htm";
- st.set("cond", "23");
+ st.setCond(23);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SCROLL_OF_DWARF_TRUST, 1);
st.takeItems(SCROLL_OF_ORC_TRUST, 1);
@@ -262,8 +266,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30191-07.htm";
}
break;
-
+ }
case ASTERIOS:
+ {
if (cond == 1)
{
htmltext = "30154-01.htm";
@@ -275,7 +280,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 3)
{
htmltext = "30154-05.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BREATH_OF_WINDS, 1);
st.takeItems(SEED_OF_VERDURE, 1);
@@ -287,8 +292,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30154-06.htm";
}
break;
-
+ }
case THIFIELL:
+ {
if (cond == 4)
{
htmltext = "30358-01.htm";
@@ -300,7 +306,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 8)
{
htmltext = "30358-03.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BASILIK_PLASMA, 1);
st.takeItems(HONEY_DEW, 1);
@@ -312,12 +318,13 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30358-04.htm";
}
break;
-
+ }
case CLAYTON:
+ {
if (cond == 5)
{
htmltext = "30464-01.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LETTER_FROM_THIFIELL, 1);
st.giveItems(ORDER_OF_CLAYTON, 1);
@@ -331,14 +338,15 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30464-03.htm";
if (cond == 7)
{
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ORDER_OF_CLAYTON, 1);
}
}
break;
-
+ }
case SERESIN:
+ {
if ((cond == 10) || (cond == 11))
{
htmltext = "30657-01.htm";
@@ -352,8 +360,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30657-05.htm";
}
break;
-
+ }
case KAKAI:
+ {
if (cond == 12)
{
htmltext = "30565-01.htm";
@@ -365,7 +374,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 16)
{
htmltext = "30565-04.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LETTER_OF_MANAKIA, 1);
st.giveItems(SCROLL_OF_ORC_TRUST, 1);
@@ -375,8 +384,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30565-05.htm";
}
break;
-
+ }
case MANAKIA:
+ {
if (cond == 13)
{
htmltext = "30515-01.htm";
@@ -388,7 +398,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 15)
{
htmltext = "30515-04.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PARASITE_OF_LOTA, -1);
st.giveItems(LETTER_OF_MANAKIA, 1);
@@ -398,8 +408,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30515-05.htm";
}
break;
-
+ }
case LOCKIRIN:
+ {
if (cond == 17)
{
htmltext = "30531-01.htm";
@@ -411,7 +422,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 21)
{
htmltext = "30531-04.htm";
- st.set("cond", "22");
+ st.setCond(22);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SCROLL_OF_DWARF_TRUST, 1);
}
@@ -420,8 +431,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30531-05.htm";
}
break;
-
+ }
case NIKOLA:
+ {
if (cond == 18)
{
htmltext = "30621-01.htm";
@@ -433,7 +445,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 20)
{
htmltext = "30621-04.htm";
- st.set("cond", "21");
+ st.setCond(21);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HEARTSTONE_OF_PORTA, -1);
st.takeItems(ORDER_OF_NIKOLA, 1);
@@ -443,8 +455,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30621-05.htm";
}
break;
-
+ }
case BIOTIN:
+ {
if (cond == 23)
{
htmltext = "30031-01.htm";
@@ -456,12 +469,15 @@ public class Q217_TestimonyOfTrust extends Quest
st.exitQuest(false);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -476,34 +492,36 @@ public class Q217_TestimonyOfTrust extends Quest
return null;
}
- final int npcId = npc.getNpcId();
- switch (npcId)
+ switch (npc.getNpcId())
{
case DRYAD:
case DRYAD_ELDER:
- if ((st.getInt("cond") == 2) && !st.hasQuestItems(SEED_OF_VERDURE) && (Rnd.get(100) < 33))
+ {
+ if (st.isCond(2) && !st.hasQuestItems(SEED_OF_VERDURE) && (Rnd.get(100) < 33))
{
addSpawn(ACTEA_OF_VERDANT_WILDS, npc, true, 200000);
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
}
break;
-
+ }
case LIREIN:
case LIREIN_ELDER:
- if ((st.getInt("cond") == 2) && !st.hasQuestItems(BREATH_OF_WINDS) && (Rnd.get(100) < 33))
+ {
+ if (st.isCond(2) && !st.hasQuestItems(BREATH_OF_WINDS) && (Rnd.get(100) < 33))
{
addSpawn(LUELL_OF_ZEPHYR_WINDS, npc, true, 200000);
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
}
break;
-
+ }
case ACTEA_OF_VERDANT_WILDS:
- if ((st.getInt("cond") == 2) && !st.hasQuestItems(SEED_OF_VERDURE))
+ {
+ if (st.isCond(2) && !st.hasQuestItems(SEED_OF_VERDURE))
{
st.giveItems(SEED_OF_VERDURE, 1);
if (st.hasQuestItems(BREATH_OF_WINDS))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -512,14 +530,15 @@ public class Q217_TestimonyOfTrust extends Quest
}
}
break;
-
+ }
case LUELL_OF_ZEPHYR_WINDS:
- if ((st.getInt("cond") == 2) && !st.hasQuestItems(BREATH_OF_WINDS))
+ {
+ if (st.isCond(2) && !st.hasQuestItems(BREATH_OF_WINDS))
{
st.giveItems(BREATH_OF_WINDS, 1);
if (st.hasQuestItems(SEED_OF_VERDURE))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -528,66 +547,72 @@ public class Q217_TestimonyOfTrust extends Quest
}
}
break;
-
+ }
case MARSH_STAKATO:
case MARSH_STAKATO_WORKER:
case MARSH_STAKATO_SOLDIER:
case MARSH_STAKATO_DRONE:
- if ((st.getInt("cond") == 6) && !st.hasQuestItems(STAKATO_ICHOR) && st.dropItemsAlways(STAKATO_FLUIDS, 1, 10))
+ {
+ if (st.isCond(6) && !st.hasQuestItems(STAKATO_ICHOR) && st.dropItemsAlways(STAKATO_FLUIDS, 1, 10))
{
st.takeItems(STAKATO_FLUIDS, -1);
st.giveItems(STAKATO_ICHOR, 1);
if (st.hasQuestItems(BASILIK_PLASMA, HONEY_DEW))
{
- st.set("cond", "7");
+ st.setCond(7);
}
}
break;
-
+ }
case ANT_RECRUIT:
case ANT_PATROL:
case ANT_GUARD:
case ANT_SOLDIER:
case ANT_WARRIOR_CAPTAIN:
- if ((st.getInt("cond") == 6) && !st.hasQuestItems(HONEY_DEW) && st.dropItemsAlways(GIANT_APHID, 1, 10))
+ {
+ if (st.isCond(6) && !st.hasQuestItems(HONEY_DEW) && st.dropItemsAlways(GIANT_APHID, 1, 10))
{
st.takeItems(GIANT_APHID, -1);
st.giveItems(HONEY_DEW, 1);
if (st.hasQuestItems(BASILIK_PLASMA, STAKATO_ICHOR))
{
- st.set("cond", "7");
+ st.setCond(7);
}
}
break;
-
+ }
case GUARDIAN_BASILIK:
- if ((st.getInt("cond") == 6) && !st.hasQuestItems(BASILIK_PLASMA) && st.dropItemsAlways(BLOOD_GUARDIAN_BASILIK, 1, 10))
+ {
+ if (st.isCond(6) && !st.hasQuestItems(BASILIK_PLASMA) && st.dropItemsAlways(BLOOD_GUARDIAN_BASILIK, 1, 10))
{
st.takeItems(BLOOD_GUARDIAN_BASILIK, -1);
st.giveItems(BASILIK_PLASMA, 1);
if (st.hasQuestItems(HONEY_DEW, STAKATO_ICHOR))
{
- st.set("cond", "7");
+ st.setCond(7);
}
}
break;
-
+ }
case WINDSUS:
- if ((st.getInt("cond") == 14) && st.dropItems(PARASITE_OF_LOTA, 1, 10, 500000))
+ {
+ if (st.isCond(14) && st.dropItems(PARASITE_OF_LOTA, 1, 10, 500000))
{
- st.set("cond", "15");
+ st.setCond(15);
}
break;
-
+ }
case PORTA:
- if ((st.getInt("cond") == 19) && st.dropItemsAlways(HEARTSTONE_OF_PORTA, 1, 10))
+ {
+ if (st.isCond(19) && st.dropItemsAlways(HEARTSTONE_OF_PORTA, 1, 10))
{
- st.set("cond", "20");
+ st.setCond(20);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q218_TestimonyOfLife/Q218_TestimonyOfLife.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q218_TestimonyOfLife/Q218_TestimonyOfLife.java
index 8ccb482186..899ac5dc89 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q218_TestimonyOfLife/Q218_TestimonyOfLife.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q218_TestimonyOfLife/Q218_TestimonyOfLife.java
@@ -36,7 +36,6 @@ public class Q218_TestimonyOfLife extends Quest
private static final int ARKENIA = 30419;
private static final int CARDIEN = 30460;
private static final int ISAEL = 30655;
-
// Items
private static final int TALINS_SPEAR = 3026;
private static final int CARDIEN_LETTER = 3141;
@@ -64,7 +63,6 @@ public class Q218_TestimonyOfLife extends Quest
private static final int WYRM_TALON = 3163;
private static final int SPIDER_ICHOR = 3164;
private static final int HARPY_DOWN = 3165;
-
private static final int[] TALINS_PIECES =
{
3166,
@@ -74,7 +72,6 @@ public class Q218_TestimonyOfLife extends Quest
3170,
3171
};
-
// Rewards
private static final int MARK_OF_LIFE = 3140;
private static final int DIMENSIONAL_DIAMOND = 7562;
@@ -82,12 +79,9 @@ public class Q218_TestimonyOfLife extends Quest
public Q218_TestimonyOfLife()
{
super(218, "Testimony of Life");
-
registerQuestItems(TALINS_SPEAR, CARDIEN_LETTER, CAMOMILE_CHARM, HIERARCH_LETTER, MOONFLOWER_CHARM, GRAIL_DIAGRAM, THALIA_LETTER_1, THALIA_LETTER_2, THALIA_INSTRUCTIONS, PUSHKIN_LIST, PURE_MITHRIL_CUP, ARKENIA_CONTRACT, ARKENIA_INSTRUCTIONS, ADONIUS_LIST, ANDARIEL_SCRIPTURE_COPY, STARDUST, ISAEL_INSTRUCTIONS, ISAEL_LETTER, GRAIL_OF_PURITY, TEARS_OF_UNICORN, WATER_OF_LIFE, PURE_MITHRIL_ORE, ANT_SOLDIER_ACID, WYRM_TALON, SPIDER_ICHOR, HARPY_DOWN, 3166, 3167, 3168, 3169, 3170, 3171);
-
addStartNpc(CARDIEN);
addTalkId(ASTERIOS, PUSHKIN, THALIA, ADONIUS, ARKENIA, CARDIEN, ISAEL);
-
addKillId(20145, 20176, 20233, 27077, 20550, 20581, 20582, 20082, 20084, 20086, 20087, 20088);
}
@@ -101,90 +95,98 @@ public class Q218_TestimonyOfLife extends Quest
return htmltext;
}
- if (event.equals("30460-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(CARDIEN_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange37", false))
+ case "30460-04.htm":
{
- htmltext = "30460-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
- player.getVariables().set("secondClassChange37", true);
+ st.startQuest();
+ st.giveItems(CARDIEN_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange37", false))
+ {
+ htmltext = "30460-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
+ player.getVariables().set("secondClassChange37", true);
+ }
+ break;
}
- }
- else if (event.equals("30154-07.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CARDIEN_LETTER, 1);
- st.giveItems(HIERARCH_LETTER, 1);
- st.giveItems(MOONFLOWER_CHARM, 1);
- }
- else if (event.equals("30371-03.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HIERARCH_LETTER, 1);
- st.giveItems(GRAIL_DIAGRAM, 1);
- }
- else if (event.equals("30371-11.htm"))
- {
- st.takeItems(STARDUST, 1);
- st.playSound(QuestState.SOUND_MIDDLE);
-
- if (player.getLevel() < 38)
+ case "30154-07.htm":
{
- htmltext = "30371-10.htm";
- st.set("cond", "13");
- st.giveItems(THALIA_INSTRUCTIONS, 1);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CARDIEN_LETTER, 1);
+ st.giveItems(HIERARCH_LETTER, 1);
+ st.giveItems(MOONFLOWER_CHARM, 1);
+ break;
}
- else
+ case "30371-03.htm":
{
- st.set("cond", "14");
- st.giveItems(THALIA_LETTER_2, 1);
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HIERARCH_LETTER, 1);
+ st.giveItems(GRAIL_DIAGRAM, 1);
+ break;
+ }
+ case "30371-11.htm":
+ {
+ st.takeItems(STARDUST, 1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ if (player.getLevel() < 38)
+ {
+ htmltext = "30371-10.htm";
+ st.setCond(13);
+ st.giveItems(THALIA_INSTRUCTIONS, 1);
+ }
+ else
+ {
+ st.setCond(14);
+ st.giveItems(THALIA_LETTER_2, 1);
+ }
+ break;
+ }
+ case "30300-06.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GRAIL_DIAGRAM, 1);
+ st.giveItems(PUSHKIN_LIST, 1);
+ break;
+ }
+ case "30300-10.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PUSHKIN_LIST, 1);
+ st.takeItems(ANT_SOLDIER_ACID, -1);
+ st.takeItems(PURE_MITHRIL_ORE, -1);
+ st.takeItems(WYRM_TALON, -1);
+ st.giveItems(PURE_MITHRIL_CUP, 1);
+ break;
+ }
+ case "30419-04.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(THALIA_LETTER_1, 1);
+ st.giveItems(ARKENIA_CONTRACT, 1);
+ st.giveItems(ARKENIA_INSTRUCTIONS, 1);
+ break;
+ }
+ case "30375-02.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARKENIA_INSTRUCTIONS, 1);
+ st.giveItems(ADONIUS_LIST, 1);
+ break;
+ }
+ case "30655-02.htm":
+ {
+ st.setCond(15);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(THALIA_LETTER_2, 1);
+ st.giveItems(ISAEL_INSTRUCTIONS, 1);
+ break;
}
- }
- else if (event.equals("30300-06.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GRAIL_DIAGRAM, 1);
- st.giveItems(PUSHKIN_LIST, 1);
- }
- else if (event.equals("30300-10.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PUSHKIN_LIST, 1);
- st.takeItems(ANT_SOLDIER_ACID, -1);
- st.takeItems(PURE_MITHRIL_ORE, -1);
- st.takeItems(WYRM_TALON, -1);
- st.giveItems(PURE_MITHRIL_CUP, 1);
- }
- else if (event.equals("30419-04.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(THALIA_LETTER_1, 1);
- st.giveItems(ARKENIA_CONTRACT, 1);
- st.giveItems(ARKENIA_INSTRUCTIONS, 1);
- }
- else if (event.equals("30375-02.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARKENIA_INSTRUCTIONS, 1);
- st.giveItems(ADONIUS_LIST, 1);
- }
- else if (event.equals("30655-02.htm"))
- {
- st.set("cond", "15");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(THALIA_LETTER_2, 1);
- st.giveItems(ISAEL_INSTRUCTIONS, 1);
}
return htmltext;
@@ -203,6 +205,7 @@ public class Q218_TestimonyOfLife extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30460-01.htm";
@@ -216,12 +219,14 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30460-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ASTERIOS:
+ {
if (cond == 1)
{
htmltext = "30154-01.htm";
@@ -233,7 +238,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 20)
{
htmltext = "30154-09.htm";
- st.set("cond", "21");
+ st.setCond(21);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MOONFLOWER_CHARM, 1);
st.takeItems(WATER_OF_LIFE, 1);
@@ -244,8 +249,9 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30154-10.htm";
}
break;
-
+ }
case PUSHKIN:
+ {
if (cond == 3)
{
htmltext = "30300-01.htm";
@@ -267,8 +273,9 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30300-12.htm";
}
break;
-
+ }
case THALIA:
+ {
if (cond == 2)
{
htmltext = "30371-01.htm";
@@ -284,7 +291,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 6)
{
htmltext = "30371-06.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PURE_MITHRIL_CUP, 1);
st.giveItems(THALIA_LETTER_1, 1);
@@ -310,7 +317,7 @@ public class Q218_TestimonyOfLife extends Quest
else
{
htmltext = "30371-13.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(THALIA_INSTRUCTIONS, 1);
st.giveItems(THALIA_LETTER_2, 1);
@@ -327,7 +334,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 17)
{
htmltext = "30371-16.htm";
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ISAEL_LETTER, 1);
st.giveItems(GRAIL_OF_PURITY, 1);
@@ -339,7 +346,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 19)
{
htmltext = "30371-18.htm";
- st.set("cond", "20");
+ st.setCond(20);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TEARS_OF_UNICORN, 1);
st.giveItems(WATER_OF_LIFE, 1);
@@ -349,8 +356,9 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30371-19.htm";
}
break;
-
+ }
case ADONIUS:
+ {
if (cond == 8)
{
htmltext = "30375-01.htm";
@@ -362,7 +370,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 10)
{
htmltext = "30375-04.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ADONIUS_LIST, 1);
st.takeItems(HARPY_DOWN, -1);
@@ -378,8 +386,9 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30375-06.htm";
}
break;
-
+ }
case ARKENIA:
+ {
if (cond == 7)
{
htmltext = "30419-01.htm";
@@ -391,7 +400,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 11)
{
htmltext = "30419-06.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ANDARIEL_SCRIPTURE_COPY, 1);
st.takeItems(ARKENIA_CONTRACT, 1);
@@ -406,8 +415,9 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30419-08.htm";
}
break;
-
+ }
case CARDIEN:
+ {
if (cond == 1)
{
htmltext = "30460-05.htm";
@@ -427,8 +437,9 @@ public class Q218_TestimonyOfLife extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ISAEL:
+ {
if (cond == 14)
{
htmltext = "30655-01.htm";
@@ -442,7 +453,7 @@ public class Q218_TestimonyOfLife extends Quest
if (st.hasQuestItems(TALINS_PIECES))
{
htmltext = "30655-04.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
for (int itemId : TALINS_PIECES)
@@ -468,13 +479,16 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30655-06.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -492,58 +506,65 @@ public class Q218_TestimonyOfLife extends Quest
switch (npc.getNpcId())
{
case 20550:
- if ((st.getInt("cond") == 4) && st.dropItems(PURE_MITHRIL_ORE, 1, 10, 500000) && (st.getQuestItemsCount(WYRM_TALON) >= 20) && (st.getQuestItemsCount(ANT_SOLDIER_ACID) >= 20))
+ {
+ if (st.isCond(4) && st.dropItems(PURE_MITHRIL_ORE, 1, 10, 500000) && (st.getQuestItemsCount(WYRM_TALON) >= 20) && (st.getQuestItemsCount(ANT_SOLDIER_ACID) >= 20))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case 20176:
- if ((st.getInt("cond") == 4) && st.dropItems(WYRM_TALON, 1, 20, 500000) && (st.getQuestItemsCount(PURE_MITHRIL_ORE) >= 10) && (st.getQuestItemsCount(ANT_SOLDIER_ACID) >= 20))
+ {
+ if (st.isCond(4) && st.dropItems(WYRM_TALON, 1, 20, 500000) && (st.getQuestItemsCount(PURE_MITHRIL_ORE) >= 10) && (st.getQuestItemsCount(ANT_SOLDIER_ACID) >= 20))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case 20082:
case 20084:
case 20086:
case 20087:
case 20088:
- if ((st.getInt("cond") == 4) && st.dropItems(ANT_SOLDIER_ACID, 1, 20, 800000) && (st.getQuestItemsCount(PURE_MITHRIL_ORE) >= 10) && (st.getQuestItemsCount(WYRM_TALON) >= 20))
+ {
+ if (st.isCond(4) && st.dropItems(ANT_SOLDIER_ACID, 1, 20, 800000) && (st.getQuestItemsCount(PURE_MITHRIL_ORE) >= 10) && (st.getQuestItemsCount(WYRM_TALON) >= 20))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case 20233:
- if ((st.getInt("cond") == 9) && st.dropItems(SPIDER_ICHOR, 1, 20, 500000) && (st.getQuestItemsCount(HARPY_DOWN) >= 20))
+ {
+ if (st.isCond(9) && st.dropItems(SPIDER_ICHOR, 1, 20, 500000) && (st.getQuestItemsCount(HARPY_DOWN) >= 20))
{
- st.set("cond", "10");
+ st.setCond(10);
}
break;
-
+ }
case 20145:
- if ((st.getInt("cond") == 9) && st.dropItems(HARPY_DOWN, 1, 20, 500000) && (st.getQuestItemsCount(SPIDER_ICHOR) >= 20))
+ {
+ if (st.isCond(9) && st.dropItems(HARPY_DOWN, 1, 20, 500000) && (st.getQuestItemsCount(SPIDER_ICHOR) >= 20))
{
- st.set("cond", "10");
+ st.setCond(10);
}
break;
-
+ }
case 27077:
- if ((st.getInt("cond") == 18) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == TALINS_SPEAR))
+ {
+ if (st.isCond(18) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == TALINS_SPEAR))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GRAIL_OF_PURITY, 1);
st.takeItems(TALINS_SPEAR, 1);
st.giveItems(TEARS_OF_UNICORN, 1);
}
break;
-
+ }
case 20581:
case 20582:
- if ((st.getInt("cond") == 15) && Rnd.nextBoolean())
+ {
+ if (st.isCond(15) && Rnd.nextBoolean())
{
for (int itemId : TALINS_PIECES)
{
@@ -554,10 +575,11 @@ public class Q218_TestimonyOfLife extends Quest
return null;
}
}
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q219_TestimonyOfFate/Q219_TestimonyOfFate.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q219_TestimonyOfFate/Q219_TestimonyOfFate.java
index 271bbf6c26..816e52f4ec 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q219_TestimonyOfFate/Q219_TestimonyOfFate.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q219_TestimonyOfFate/Q219_TestimonyOfFate.java
@@ -40,7 +40,22 @@ public class Q219_TestimonyOfFate extends Quest
private static final int ARKENIA = 30419;
private static final int BLOODY_PIXY = 31845;
private static final int BLIGHT_TREANT = 31850;
-
+ // Monsters
+ private static final int HANGMAN_TREE = 20144;
+ private static final int MARSH_STAKATO = 20157;
+ private static final int MEDUSA = 20158;
+ private static final int TYRANT = 20192;
+ private static final int TYRANT_KINGPIN = 20193;
+ private static final int DEAD_SEEKER = 20202;
+ private static final int MARSH_STAKATO_WORKER = 20230;
+ private static final int MARSH_STAKATO_SOLDIER = 20232;
+ private static final int MARSH_SPIDER = 20233;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int BREKA_ORC_OVERLORD = 20270;
+ private static final int GRANDIS = 20554;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int KARUL_BUGBEAR = 20600;
+ private static final int BLACK_WILLOW_LURKER = 27079;
// Items
private static final int KAIRA_LETTER = 3173;
private static final int METHEUS_FUNERAL_JAR = 3174;
@@ -72,28 +87,9 @@ public class Q219_TestimonyOfFate extends Quest
private static final int BLACK_WILLOW_LEAF = 3200;
private static final int BLIGHT_TREANT_SAP = 3201;
private static final int ARKENIA_LETTER = 3202;
-
// Rewards
private static final int MARK_OF_FATE = 3172;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // Monsters
- private static final int HANGMAN_TREE = 20144;
- private static final int MARSH_STAKATO = 20157;
- private static final int MEDUSA = 20158;
- private static final int TYRANT = 20192;
- private static final int TYRANT_KINGPIN = 20193;
- private static final int DEAD_SEEKER = 20202;
- private static final int MARSH_STAKATO_WORKER = 20230;
- private static final int MARSH_STAKATO_SOLDIER = 20232;
- private static final int MARSH_SPIDER = 20233;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int BREKA_ORC_OVERLORD = 20270;
- private static final int GRANDIS = 20554;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int KARUL_BUGBEAR = 20600;
- private static final int BLACK_WILLOW_LURKER = 27079;
-
// Cond 6 drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -112,12 +108,9 @@ public class Q219_TestimonyOfFate extends Quest
public Q219_TestimonyOfFate()
{
super(219, "Testimony of Fate");
-
registerQuestItems(KAIRA_LETTER, METHEUS_FUNERAL_JAR, KASANDRA_REMAINS, HERBALISM_TEXTBOOK, IXIA_LIST, MEDUSA_ICHOR, MARSH_SPIDER_FLUIDS, DEAD_SEEKER_DUNG, TYRANT_BLOOD, NIGHTSHADE_ROOT, BELLADONNA, ALDER_SKULL_1, ALDER_SKULL_2, ALDER_RECEIPT, REVELATIONS_MANUSCRIPT, KAIRA_RECOMMENDATION, KAIRA_INSTRUCTIONS, PALUS_CHARM, THIFIELL_LETTER, ARKENIA_NOTE, PIXY_GARNET, GRANDIS_SKULL, KARUL_BUGBEAR_SKULL, BREKA_OVERLORD_SKULL, LETO_OVERLORD_SKULL, RED_FAIRY_DUST, BLIGHT_TREANT_SEED, BLACK_WILLOW_LEAF, BLIGHT_TREANT_SAP, ARKENIA_LETTER);
-
addStartNpc(KAIRA);
addTalkId(KAIRA, METHEUS, IXIA, ALDER_SPIRIT, ROA, NORMAN, THIFIELL, ARKENIA, BLOODY_PIXY, BLIGHT_TREANT);
-
addKillId(HANGMAN_TREE, MARSH_STAKATO, MEDUSA, TYRANT, TYRANT_KINGPIN, DEAD_SEEKER, MARSH_STAKATO_WORKER, MARSH_STAKATO_SOLDIER, MARSH_SPIDER, MARSH_STAKATO_DRONE, BREKA_ORC_OVERLORD, GRANDIS, LETO_LIZARDMAN_OVERLORD, KARUL_BUGBEAR, BLACK_WILLOW_LURKER);
}
@@ -131,69 +124,75 @@ public class Q219_TestimonyOfFate extends Quest
return htmltext;
}
- if (event.equals("30476-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(KAIRA_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange37", false))
+ case "30476-05.htm":
{
- htmltext = "30476-05a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
- player.getVariables().set("secondClassChange37", true);
+ st.startQuest();
+ st.giveItems(KAIRA_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange37", false))
+ {
+ htmltext = "30476-05a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
+ player.getVariables().set("secondClassChange37", true);
+ }
+ break;
}
- }
- else if (event.equals("30114-04.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ALDER_SKULL_2, 1);
- st.giveItems(ALDER_RECEIPT, 1);
- }
- else if (event.equals("30476-12.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
-
- if (player.getLevel() < 38)
+ case "30114-04.htm":
{
- htmltext = "30476-13.htm";
- st.set("cond", "14");
- st.giveItems(KAIRA_INSTRUCTIONS, 1);
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ALDER_SKULL_2, 1);
+ st.giveItems(ALDER_RECEIPT, 1);
+ break;
}
- else
+ case "30476-12.htm":
{
- st.set("cond", "15");
- st.takeItems(REVELATIONS_MANUSCRIPT, 1);
- st.giveItems(KAIRA_RECOMMENDATION, 1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ if (player.getLevel() < 38)
+ {
+ htmltext = "30476-13.htm";
+ st.setCond(14);
+ st.giveItems(KAIRA_INSTRUCTIONS, 1);
+ }
+ else
+ {
+ st.setCond(15);
+ st.takeItems(REVELATIONS_MANUSCRIPT, 1);
+ st.giveItems(KAIRA_RECOMMENDATION, 1);
+ }
+ break;
+ }
+ case "30419-02.htm":
+ {
+ st.setCond(17);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(THIFIELL_LETTER, 1);
+ st.giveItems(ARKENIA_NOTE, 1);
+ break;
+ }
+ case "31845-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(PIXY_GARNET, 1);
+ break;
+ }
+ case "31850-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(BLIGHT_TREANT_SEED, 1);
+ break;
+ }
+ case "30419-05.htm":
+ {
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARKENIA_NOTE, 1);
+ st.takeItems(BLIGHT_TREANT_SAP, 1);
+ st.takeItems(RED_FAIRY_DUST, 1);
+ st.giveItems(ARKENIA_LETTER, 1);
+ break;
}
- }
- else if (event.equals("30419-02.htm"))
- {
- st.set("cond", "17");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(THIFIELL_LETTER, 1);
- st.giveItems(ARKENIA_NOTE, 1);
- }
- else if (event.equals("31845-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(PIXY_GARNET, 1);
- }
- else if (event.equals("31850-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(BLIGHT_TREANT_SEED, 1);
- }
- else if (event.equals("30419-05.htm"))
- {
- st.set("cond", "18");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARKENIA_NOTE, 1);
- st.takeItems(BLIGHT_TREANT_SAP, 1);
- st.takeItems(RED_FAIRY_DUST, 1);
- st.giveItems(ARKENIA_LETTER, 1);
}
return htmltext;
@@ -212,6 +211,7 @@ public class Q219_TestimonyOfFate extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30476-02.htm";
@@ -225,12 +225,14 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30476-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case KAIRA:
+ {
if (cond == 1)
{
htmltext = "30476-06.htm";
@@ -246,7 +248,7 @@ public class Q219_TestimonyOfFate extends Quest
else if (cond == 9)
{
htmltext = "30476-09.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALDER_SKULL_1, 1);
addSpawn(ALDER_SPIRIT, player, false, 0);
@@ -268,7 +270,7 @@ public class Q219_TestimonyOfFate extends Quest
else
{
htmltext = "30476-12.htm";
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KAIRA_INSTRUCTIONS, 1);
st.takeItems(REVELATIONS_MANUSCRIPT, 1);
@@ -284,12 +286,13 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30476-17.htm";
}
break;
-
+ }
case METHEUS:
+ {
if (cond == 1)
{
htmltext = "30614-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KAIRA_LETTER, 1);
st.giveItems(METHEUS_FUNERAL_JAR, 1);
@@ -301,8 +304,8 @@ public class Q219_TestimonyOfFate extends Quest
else if (cond == 3)
{
htmltext = "30614-03.htm";
- st.set("cond", "4");
- st.set("cond", "5");
+ st.setCond(4);
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KASANDRA_REMAINS, 1);
st.giveItems(HERBALISM_TEXTBOOK, 1);
@@ -314,7 +317,7 @@ public class Q219_TestimonyOfFate extends Quest
else if (cond == 8)
{
htmltext = "30614-05.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BELLADONNA, 1);
st.giveItems(ALDER_SKULL_1, 1);
@@ -324,12 +327,13 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30614-06.htm";
}
break;
-
+ }
case IXIA:
+ {
if (cond == 5)
{
htmltext = "30463-01.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HERBALISM_TEXTBOOK, 1);
st.giveItems(IXIA_LIST, 1);
@@ -341,7 +345,7 @@ public class Q219_TestimonyOfFate extends Quest
else if (cond == 7)
{
htmltext = "30463-03.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(IXIA_LIST, 1);
st.takeItems(DEAD_SEEKER_DUNG, -1);
@@ -360,19 +364,21 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30463-05.htm";
}
break;
-
+ }
case ALDER_SPIRIT:
+ {
if (cond == 10)
{
htmltext = "30613-01.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(ALDER_SKULL_2, 1);
npc.deleteMe();
}
break;
-
+ }
case ROA:
+ {
if (cond == 11)
{
htmltext = "30114-01.htm";
@@ -386,12 +392,13 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30114-06.htm";
}
break;
-
+ }
case NORMAN:
+ {
if (cond == 12)
{
htmltext = "30210-01.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALDER_RECEIPT, 1);
st.giveItems(REVELATIONS_MANUSCRIPT, 1);
@@ -401,12 +408,13 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30210-02.htm";
}
break;
-
+ }
case THIFIELL:
+ {
if (cond == 15)
{
htmltext = "30358-01.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KAIRA_RECOMMENDATION, 1);
st.giveItems(PALUS_CHARM, 1);
@@ -432,8 +440,9 @@ public class Q219_TestimonyOfFate extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ARKENIA:
+ {
if (cond == 16)
{
htmltext = "30419-01.htm";
@@ -447,8 +456,9 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30419-06.htm";
}
break;
-
+ }
case BLOODY_PIXY:
+ {
if (cond == 17)
{
if (st.hasQuestItems(PIXY_GARNET))
@@ -483,8 +493,9 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "31845-05.htm";
}
break;
-
+ }
case BLIGHT_TREANT:
+ {
if (cond == 17)
{
if (st.hasQuestItems(BLIGHT_TREANT_SEED))
@@ -516,12 +527,15 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "31850-05.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -541,88 +555,100 @@ public class Q219_TestimonyOfFate extends Quest
switch (npcId)
{
case HANGMAN_TREE:
- if (st.getInt("cond") == 2)
+ {
+ if (st.isCond(2))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(METHEUS_FUNERAL_JAR, 1);
st.giveItems(KASANDRA_REMAINS, 1);
}
break;
-
+ }
case DEAD_SEEKER:
- if ((st.getInt("cond") == 6) && st.dropItems(DEAD_SEEKER_DUNG, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
+ {
+ if (st.isCond(6) && st.dropItems(DEAD_SEEKER_DUNG, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case TYRANT:
case TYRANT_KINGPIN:
- if ((st.getInt("cond") == 6) && st.dropItems(TYRANT_BLOOD, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
+ {
+ if (st.isCond(6) && st.dropItems(TYRANT_BLOOD, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case MEDUSA:
- if ((st.getInt("cond") == 6) && st.dropItems(MEDUSA_ICHOR, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
+ {
+ if (st.isCond(6) && st.dropItems(MEDUSA_ICHOR, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case MARSH_STAKATO:
case MARSH_STAKATO_WORKER:
case MARSH_STAKATO_SOLDIER:
case MARSH_STAKATO_DRONE:
- if ((st.getInt("cond") == 6) && st.dropItems(NIGHTSHADE_ROOT, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
+ {
+ if (st.isCond(6) && st.dropItems(NIGHTSHADE_ROOT, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case MARSH_SPIDER:
- if ((st.getInt("cond") == 6) && st.dropItems(MARSH_SPIDER_FLUIDS, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10))
+ {
+ if (st.isCond(6) && st.dropItems(MARSH_SPIDER_FLUIDS, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case GRANDIS:
+ {
if (st.hasQuestItems(PIXY_GARNET))
{
st.dropItemsAlways(GRANDIS_SKULL, 1, 10);
}
break;
-
+ }
case LETO_LIZARDMAN_OVERLORD:
+ {
if (st.hasQuestItems(PIXY_GARNET))
{
st.dropItemsAlways(LETO_OVERLORD_SKULL, 1, 10);
}
break;
-
+ }
case BREKA_ORC_OVERLORD:
+ {
if (st.hasQuestItems(PIXY_GARNET))
{
st.dropItemsAlways(BREKA_OVERLORD_SKULL, 1, 10);
}
break;
-
+ }
case KARUL_BUGBEAR:
+ {
if (st.hasQuestItems(PIXY_GARNET))
{
st.dropItemsAlways(KARUL_BUGBEAR_SKULL, 1, 10);
}
break;
-
+ }
case BLACK_WILLOW_LURKER:
+ {
if (st.hasQuestItems(BLIGHT_TREANT_SEED))
{
st.dropItemsAlways(BLACK_WILLOW_LEAF, 1, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q220_TestimonyOfGlory/Q220_TestimonyOfGlory.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q220_TestimonyOfGlory/Q220_TestimonyOfGlory.java
index 7e88416047..d2cf4be3d6 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q220_TestimonyOfGlory/Q220_TestimonyOfGlory.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q220_TestimonyOfGlory/Q220_TestimonyOfGlory.java
@@ -26,6 +26,38 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q220_TestimonyOfGlory extends Quest
{
+ // NPCs
+ private static final int KASMAN = 30501;
+ private static final int VOKIAN = 30514;
+ private static final int MANAKIA = 30515;
+ private static final int KAKAI = 30565;
+ private static final int TANAPI = 30571;
+ private static final int VOLTAR = 30615;
+ private static final int KEPRA = 30616;
+ private static final int BURAI = 30617;
+ private static final int HARAK = 30618;
+ private static final int DRIKO = 30619;
+ private static final int CHIANTA = 30642;
+ // Monsters
+ private static final int TYRANT = 20192;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int GUARDIAN_BASILISK = 20550;
+ private static final int MANASHEN_GARGOYLE = 20563;
+ private static final int TIMAK_ORC = 20583;
+ private static final int TIMAK_ORC_ARCHER = 20584;
+ private static final int TIMAK_ORC_SOLDIER = 20585;
+ private static final int TIMAK_ORC_WARRIOR = 20586;
+ private static final int TIMAK_ORC_SHAMAN = 20587;
+ private static final int TIMAK_ORC_OVERLORD = 20588;
+ private static final int TAMLIN_ORC = 20601;
+ private static final int TAMLIN_ORC_ARCHER = 20602;
+ private static final int RAGNA_ORC_OVERLORD = 20778;
+ private static final int RAGNA_ORC_SEER = 20779;
+ private static final int PASHIKA_SON_OF_VOLTAR = 27080;
+ private static final int VULTUS_SON_OF_VOLTAR = 27081;
+ private static final int ENKU_ORC_OVERLORD = 27082;
+ private static final int MAKUM_BUGBEAR_THUG = 27083;
+ private static final int REVENANT_OF_TANTOS_CHIEF = 27086;
// Items
private static final int VOKIAN_ORDER_1 = 3204;
private static final int MANASHEN_SHARD = 3205;
@@ -61,45 +93,9 @@ public class Q220_TestimonyOfGlory extends Quest
private static final int TANAPI_ORDER = 3235;
private static final int SCEPTER_OF_TANTOS = 3236;
private static final int RITUAL_BOX = 3237;
-
// Rewards
private static final int MARK_OF_GLORY = 3203;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // NPCs
- private static final int KASMAN = 30501;
- private static final int VOKIAN = 30514;
- private static final int MANAKIA = 30515;
- private static final int KAKAI = 30565;
- private static final int TANAPI = 30571;
- private static final int VOLTAR = 30615;
- private static final int KEPRA = 30616;
- private static final int BURAI = 30617;
- private static final int HARAK = 30618;
- private static final int DRIKO = 30619;
- private static final int CHIANTA = 30642;
-
- // Monsters
- private static final int TYRANT = 20192;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int GUARDIAN_BASILISK = 20550;
- private static final int MANASHEN_GARGOYLE = 20563;
- private static final int TIMAK_ORC = 20583;
- private static final int TIMAK_ORC_ARCHER = 20584;
- private static final int TIMAK_ORC_SOLDIER = 20585;
- private static final int TIMAK_ORC_WARRIOR = 20586;
- private static final int TIMAK_ORC_SHAMAN = 20587;
- private static final int TIMAK_ORC_OVERLORD = 20588;
- private static final int TAMLIN_ORC = 20601;
- private static final int TAMLIN_ORC_ARCHER = 20602;
- private static final int RAGNA_ORC_OVERLORD = 20778;
- private static final int RAGNA_ORC_SEER = 20779;
- private static final int PASHIKA_SON_OF_VOLTAR = 27080;
- private static final int VULTUS_SON_OF_VOLTAR = 27081;
- private static final int ENKU_ORC_OVERLORD = 27082;
- private static final int MAKUM_BUGBEAR_THUG = 27083;
- private static final int REVENANT_OF_TANTOS_CHIEF = 27086;
-
// Checks & Instances
private static boolean _sonsOfVoltar = false;
private static boolean _enkuOrcOverlords = false;
@@ -108,12 +104,9 @@ public class Q220_TestimonyOfGlory extends Quest
public Q220_TestimonyOfGlory()
{
super(220, "Testimony of Glory");
-
registerQuestItems(VOKIAN_ORDER_1, MANASHEN_SHARD, TYRANT_TALON, GUARDIAN_BASILISK_FANG, VOKIAN_ORDER_2, NECKLACE_OF_AUTHORITY, CHIANTA_ORDER_1, SCEPTER_OF_BREKA, SCEPTER_OF_ENKU, SCEPTER_OF_VUKU, SCEPTER_OF_TUREK, SCEPTER_OF_TUNATH, CHIANTA_ORDER_2, CHIANTA_ORDER_3, TAMLIN_ORC_SKULL, TIMAK_ORC_HEAD, SCEPTER_BOX, PASHIKA_HEAD, VULTUS_HEAD, GLOVE_OF_VOLTAR, ENKU_OVERLORD_HEAD, GLOVE_OF_KEPRA, MAKUM_BUGBEAR_HEAD, GLOVE_OF_BURAI, MANAKIA_LETTER_1, MANAKIA_LETTER_2, KASMAN_LETTER_1, KASMAN_LETTER_2, KASMAN_LETTER_3, DRIKO_CONTRACT, STAKATO_DRONE_HUSK, TANAPI_ORDER, SCEPTER_OF_TANTOS, RITUAL_BOX);
-
addStartNpc(VOKIAN);
addTalkId(KASMAN, VOKIAN, MANAKIA, KAKAI, TANAPI, VOLTAR, KEPRA, BURAI, HARAK, DRIKO, CHIANTA);
-
addAttackId(RAGNA_ORC_OVERLORD, RAGNA_ORC_SEER, REVENANT_OF_TANTOS_CHIEF);
addKillId(TYRANT, MARSH_STAKATO_DRONE, GUARDIAN_BASILISK, MANASHEN_GARGOYLE, TIMAK_ORC, TIMAK_ORC_ARCHER, TIMAK_ORC_SOLDIER, TIMAK_ORC_WARRIOR, TIMAK_ORC_SHAMAN, TIMAK_ORC_OVERLORD, TAMLIN_ORC, TAMLIN_ORC_ARCHER, RAGNA_ORC_OVERLORD, RAGNA_ORC_SEER, PASHIKA_SON_OF_VOLTAR, VULTUS_SON_OF_VOLTAR, ENKU_ORC_OVERLORD, MAKUM_BUGBEAR_THUG, REVENANT_OF_TANTOS_CHIEF);
}
@@ -128,225 +121,238 @@ public class Q220_TestimonyOfGlory extends Quest
return htmltext;
}
- // VOKIAN
- if (event.equals("30514-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(VOKIAN_ORDER_1, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange37", false))
+ case "30514-05.htm":
{
- htmltext = "30514-05a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
- player.getVariables().set("secondClassChange37", true);
+ st.startQuest();
+ st.giveItems(VOKIAN_ORDER_1, 1);
+ if (!player.getVariables().getBoolean("secondClassChange37", false))
+ {
+ htmltext = "30514-05a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
+ player.getVariables().set("secondClassChange37", true);
+ }
+ break;
}
- }
- // CHIANTA
- else if (event.equals("30642-03.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VOKIAN_ORDER_2, 1);
- st.giveItems(CHIANTA_ORDER_1, 1);
- }
- else if (event.equals("30642-07.htm"))
- {
- st.takeItems(CHIANTA_ORDER_1, 1);
- st.takeItems(KASMAN_LETTER_1, 1);
- st.takeItems(MANAKIA_LETTER_1, 1);
- st.takeItems(MANAKIA_LETTER_2, 1);
- st.takeItems(SCEPTER_OF_BREKA, 1);
- st.takeItems(SCEPTER_OF_ENKU, 1);
- st.takeItems(SCEPTER_OF_TUNATH, 1);
- st.takeItems(SCEPTER_OF_TUREK, 1);
- st.takeItems(SCEPTER_OF_VUKU, 1);
-
- if (player.getLevel() >= 37)
+ case "30642-03.htm":
{
- st.set("cond", "6");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CHIANTA_ORDER_3, 1);
+ st.takeItems(VOKIAN_ORDER_2, 1);
+ st.giveItems(CHIANTA_ORDER_1, 1);
+ break;
}
- else
+ case "30642-07.htm":
+ {
+ st.takeItems(CHIANTA_ORDER_1, 1);
+ st.takeItems(KASMAN_LETTER_1, 1);
+ st.takeItems(MANAKIA_LETTER_1, 1);
+ st.takeItems(MANAKIA_LETTER_2, 1);
+ st.takeItems(SCEPTER_OF_BREKA, 1);
+ st.takeItems(SCEPTER_OF_ENKU, 1);
+ st.takeItems(SCEPTER_OF_TUNATH, 1);
+ st.takeItems(SCEPTER_OF_TUREK, 1);
+ st.takeItems(SCEPTER_OF_VUKU, 1);
+ if (player.getLevel() >= 37)
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CHIANTA_ORDER_3, 1);
+ }
+ else
+ {
+ htmltext = "30642-06.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(CHIANTA_ORDER_2, 1);
+ }
+ break;
+ }
+ case "30501-02.htm":
+ {
+ if (!st.hasQuestItems(SCEPTER_OF_VUKU))
+ {
+ if (st.hasQuestItems(KASMAN_LETTER_1))
+ {
+ htmltext = "30501-04.htm";
+ }
+ else
+ {
+ htmltext = "30501-03.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(KASMAN_LETTER_1, 1);
+ }
+ st.addRadar(-2150, 124443, -3724);
+ }
+ break;
+ }
+ case "30501-05.htm":
+ {
+ if (!st.hasQuestItems(SCEPTER_OF_TUREK))
+ {
+ if (st.hasQuestItems(KASMAN_LETTER_2))
+ {
+ htmltext = "30501-07.htm";
+ }
+ else
+ {
+ htmltext = "30501-06.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(KASMAN_LETTER_2, 1);
+ }
+ st.addRadar(-94294, 110818, -3563);
+ }
+ break;
+ }
+ case "30501-08.htm":
+ {
+ if (!st.hasQuestItems(SCEPTER_OF_TUNATH))
+ {
+ if (st.hasQuestItems(KASMAN_LETTER_3))
+ {
+ htmltext = "30501-10.htm";
+ }
+ else
+ {
+ htmltext = "30501-09.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(KASMAN_LETTER_3, 1);
+ }
+ st.addRadar(-55217, 200628, -3724);
+ }
+ break;
+ }
+ case "30515-02.htm":
+ {
+ if (!st.hasQuestItems(SCEPTER_OF_BREKA))
+ {
+ if (st.hasQuestItems(MANAKIA_LETTER_1))
+ {
+ htmltext = "30515-04.htm";
+ }
+ else
+ {
+ htmltext = "30515-03.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(MANAKIA_LETTER_1, 1);
+ }
+ st.addRadar(80100, 119991, -2264);
+ }
+ break;
+ }
+ case "30515-05.htm":
+ {
+ if (!st.hasQuestItems(SCEPTER_OF_ENKU))
+ {
+ if (st.hasQuestItems(MANAKIA_LETTER_2))
+ {
+ htmltext = "30515-07.htm";
+ }
+ else
+ {
+ htmltext = "30515-06.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(MANAKIA_LETTER_2, 1);
+ }
+ st.addRadar(19815, 189703, -3032);
+ }
+ break;
+ }
+ case "30615-04.htm":
{
- htmltext = "30642-06.htm";
st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(CHIANTA_ORDER_2, 1);
+ st.takeItems(MANAKIA_LETTER_1, 1);
+ st.giveItems(GLOVE_OF_VOLTAR, 1);
+ if (!_sonsOfVoltar)
+ {
+ addSpawn(PASHIKA_SON_OF_VOLTAR, 80117, 120039, -2259, 0, false, 200000);
+ addSpawn(VULTUS_SON_OF_VOLTAR, 80058, 120038, -2259, 0, false, 200000);
+ _sonsOfVoltar = true;
+
+ // Resets Sons Of Voltar
+ startQuestTimer("voltar_sons_cleanup", 201000, null, player, false);
+ }
+ break;
}
- }
- // KASMAN
- else if (event.equals("30501-02.htm") && !st.hasQuestItems(SCEPTER_OF_VUKU))
- {
- if (st.hasQuestItems(KASMAN_LETTER_1))
+ case "30616-05.htm":
{
- htmltext = "30501-04.htm";
- }
- else
- {
- htmltext = "30501-03.htm";
st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(KASMAN_LETTER_1, 1);
+ st.takeItems(MANAKIA_LETTER_2, 1);
+ st.giveItems(GLOVE_OF_KEPRA, 1);
+ if (!_enkuOrcOverlords)
+ {
+ addSpawn(ENKU_ORC_OVERLORD, 19894, 189743, -3074, 0, false, 200000);
+ addSpawn(ENKU_ORC_OVERLORD, 19869, 189800, -3059, 0, false, 200000);
+ addSpawn(ENKU_ORC_OVERLORD, 19818, 189818, -3047, 0, false, 200000);
+ addSpawn(ENKU_ORC_OVERLORD, 19753, 189837, -3027, 0, false, 200000);
+ _enkuOrcOverlords = true;
+
+ // Resets Enku Orc Overlords
+ startQuestTimer("enku_orcs_cleanup", 201000, null, player, false);
+ }
+ break;
}
- st.addRadar(-2150, 124443, -3724);
- }
- else if (event.equals("30501-05.htm") && !st.hasQuestItems(SCEPTER_OF_TUREK))
- {
- if (st.hasQuestItems(KASMAN_LETTER_2))
+ case "30617-04.htm":
{
- htmltext = "30501-07.htm";
- }
- else
- {
- htmltext = "30501-06.htm";
st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(KASMAN_LETTER_2, 1);
+ st.takeItems(KASMAN_LETTER_2, 1);
+ st.giveItems(GLOVE_OF_BURAI, 1);
+ if (!_makumBugbearThugs)
+ {
+ addSpawn(MAKUM_BUGBEAR_THUG, -94292, 110781, -3701, 0, false, 200000);
+ addSpawn(MAKUM_BUGBEAR_THUG, -94293, 110861, -3701, 0, false, 200000);
+ _makumBugbearThugs = true;
+
+ // Resets Makum Bugbear Thugs
+ startQuestTimer("makum_bugbears_cleanup", 201000, null, player, false);
+ }
+ break;
}
- st.addRadar(-94294, 110818, -3563);
- }
- else if (event.equals("30501-08.htm") && !st.hasQuestItems(SCEPTER_OF_TUNATH))
- {
- if (st.hasQuestItems(KASMAN_LETTER_3))
+ case "30618-03.htm":
{
- htmltext = "30501-10.htm";
+ st.takeItems(KASMAN_LETTER_3, 1);
+ st.giveItems(SCEPTER_OF_TUNATH, 1);
+ if (st.hasQuestItems(SCEPTER_OF_BREKA, SCEPTER_OF_ENKU, SCEPTER_OF_VUKU, SCEPTER_OF_TUREK))
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
}
- else
+ case "30619-03.htm":
{
- htmltext = "30501-09.htm";
st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(KASMAN_LETTER_3, 1);
+ st.takeItems(KASMAN_LETTER_1, 1);
+ st.giveItems(DRIKO_CONTRACT, 1);
+ break;
}
- st.addRadar(-55217, 200628, -3724);
- }
- // MANAKIA
- else if (event.equals("30515-02.htm") && !st.hasQuestItems(SCEPTER_OF_BREKA))
- {
- if (st.hasQuestItems(MANAKIA_LETTER_1))
+ case "30571-03.htm":
{
- htmltext = "30515-04.htm";
- }
- else
- {
- htmltext = "30515-03.htm";
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(MANAKIA_LETTER_1, 1);
- }
- st.addRadar(80100, 119991, -2264);
- }
- else if (event.equals("30515-05.htm") && !st.hasQuestItems(SCEPTER_OF_ENKU))
- {
- if (st.hasQuestItems(MANAKIA_LETTER_2))
- {
- htmltext = "30515-07.htm";
- }
- else
- {
- htmltext = "30515-06.htm";
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(MANAKIA_LETTER_2, 1);
- }
- st.addRadar(19815, 189703, -3032);
- }
- // VOLTAR
- else if (event.equals("30615-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(MANAKIA_LETTER_1, 1);
- st.giveItems(GLOVE_OF_VOLTAR, 1);
-
- if (!_sonsOfVoltar)
- {
- addSpawn(PASHIKA_SON_OF_VOLTAR, 80117, 120039, -2259, 0, false, 200000);
- addSpawn(VULTUS_SON_OF_VOLTAR, 80058, 120038, -2259, 0, false, 200000);
- _sonsOfVoltar = true;
-
- // Resets Sons Of Voltar
- startQuestTimer("voltar_sons_cleanup", 201000, null, player, false);
- }
- }
- // KEPRA
- else if (event.equals("30616-05.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(MANAKIA_LETTER_2, 1);
- st.giveItems(GLOVE_OF_KEPRA, 1);
-
- if (!_enkuOrcOverlords)
- {
- addSpawn(ENKU_ORC_OVERLORD, 19894, 189743, -3074, 0, false, 200000);
- addSpawn(ENKU_ORC_OVERLORD, 19869, 189800, -3059, 0, false, 200000);
- addSpawn(ENKU_ORC_OVERLORD, 19818, 189818, -3047, 0, false, 200000);
- addSpawn(ENKU_ORC_OVERLORD, 19753, 189837, -3027, 0, false, 200000);
- _enkuOrcOverlords = true;
-
- // Resets Enku Orc Overlords
- startQuestTimer("enku_orcs_cleanup", 201000, null, player, false);
- }
- }
- // BURAI
- else if (event.equals("30617-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(KASMAN_LETTER_2, 1);
- st.giveItems(GLOVE_OF_BURAI, 1);
-
- if (!_makumBugbearThugs)
- {
- addSpawn(MAKUM_BUGBEAR_THUG, -94292, 110781, -3701, 0, false, 200000);
- addSpawn(MAKUM_BUGBEAR_THUG, -94293, 110861, -3701, 0, false, 200000);
- _makumBugbearThugs = true;
-
- // Resets Makum Bugbear Thugs
- startQuestTimer("makum_bugbears_cleanup", 201000, null, player, false);
- }
- }
- // HARAK
- else if (event.equals("30618-03.htm"))
- {
- st.takeItems(KASMAN_LETTER_3, 1);
- st.giveItems(SCEPTER_OF_TUNATH, 1);
-
- if (st.hasQuestItems(SCEPTER_OF_BREKA, SCEPTER_OF_ENKU, SCEPTER_OF_VUKU, SCEPTER_OF_TUREK))
- {
- st.set("cond", "5");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SCEPTER_BOX, 1);
+ st.giveItems(TANAPI_ORDER, 1);
+ break;
}
- else
+ case "voltar_sons_cleanup":
{
- st.playSound(QuestState.SOUND_ITEMGET);
+ _sonsOfVoltar = false;
+ return null;
+ }
+ case "enku_orcs_cleanup":
+ {
+ _enkuOrcOverlords = false;
+ return null;
+ }
+ case "makum_bugbears_cleanup":
+ {
+ _makumBugbearThugs = false;
+ return null;
}
- }
- // DRIKO
- else if (event.equals("30619-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(KASMAN_LETTER_1, 1);
- st.giveItems(DRIKO_CONTRACT, 1);
- }
- // TANAPI
- else if (event.equals("30571-03.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SCEPTER_BOX, 1);
- st.giveItems(TANAPI_ORDER, 1);
- }
- // Clean ups
- else if (event.equals("voltar_sons_cleanup"))
- {
- _sonsOfVoltar = false;
- return null;
- }
- else if (event.equals("enku_orcs_cleanup"))
- {
- _enkuOrcOverlords = false;
- return null;
- }
- else if (event.equals("makum_bugbears_cleanup"))
- {
- _makumBugbearThugs = false;
- return null;
}
return htmltext;
@@ -365,6 +371,7 @@ public class Q220_TestimonyOfGlory extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30514-01.htm";
@@ -382,12 +389,14 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30514-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VOKIAN:
+ {
if (cond == 1)
{
htmltext = "30514-06.htm";
@@ -395,7 +404,7 @@ public class Q220_TestimonyOfGlory extends Quest
else if (cond == 2)
{
htmltext = "30514-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GUARDIAN_BASILISK_FANG, 10);
st.takeItems(MANASHEN_SHARD, 10);
@@ -413,8 +422,9 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30514-10.htm";
}
break;
-
+ }
case CHIANTA:
+ {
if (cond == 3)
{
htmltext = "30642-01.htm";
@@ -430,7 +440,7 @@ public class Q220_TestimonyOfGlory extends Quest
if (player.getLevel() >= 37)
{
htmltext = "30642-09.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CHIANTA_ORDER_2, 1);
st.giveItems(CHIANTA_ORDER_3, 1);
@@ -452,7 +462,7 @@ public class Q220_TestimonyOfGlory extends Quest
else if (cond == 7)
{
htmltext = "30642-11.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CHIANTA_ORDER_3, 1);
st.takeItems(NECKLACE_OF_AUTHORITY, 1);
@@ -469,8 +479,9 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30642-13.htm";
}
break;
-
+ }
case KASMAN:
+ {
if (st.hasQuestItems(CHIANTA_ORDER_1))
{
htmltext = "30501-01.htm";
@@ -480,8 +491,9 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30501-11.htm";
}
break;
-
+ }
case MANAKIA:
+ {
if (st.hasQuestItems(CHIANTA_ORDER_1))
{
htmltext = "30515-01.htm";
@@ -491,8 +503,9 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30515-08.htm";
}
break;
-
+ }
case VOLTAR:
+ {
if (cond > 3)
{
if (st.hasQuestItems(MANAKIA_LETTER_1))
@@ -522,7 +535,7 @@ public class Q220_TestimonyOfGlory extends Quest
if (st.hasQuestItems(SCEPTER_OF_ENKU, SCEPTER_OF_VUKU, SCEPTER_OF_TUREK, SCEPTER_OF_TUNATH))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -544,8 +557,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case KEPRA:
+ {
if (cond > 3)
{
if (st.hasQuestItems(MANAKIA_LETTER_2))
@@ -577,7 +591,7 @@ public class Q220_TestimonyOfGlory extends Quest
if (st.hasQuestItems(SCEPTER_OF_BREKA, SCEPTER_OF_VUKU, SCEPTER_OF_TUREK, SCEPTER_OF_TUNATH))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -599,8 +613,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case BURAI:
+ {
if (cond > 3)
{
if (st.hasQuestItems(KASMAN_LETTER_2))
@@ -630,7 +645,7 @@ public class Q220_TestimonyOfGlory extends Quest
if (st.hasQuestItems(SCEPTER_OF_BREKA, SCEPTER_OF_VUKU, SCEPTER_OF_ENKU, SCEPTER_OF_TUNATH))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -652,8 +667,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case HARAK:
+ {
if (cond > 3)
{
if (st.hasQuestItems(KASMAN_LETTER_3))
@@ -675,8 +691,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case DRIKO:
+ {
if (cond > 3)
{
if (st.hasQuestItems(KASMAN_LETTER_1))
@@ -695,7 +712,7 @@ public class Q220_TestimonyOfGlory extends Quest
if (st.hasQuestItems(SCEPTER_OF_BREKA, SCEPTER_OF_TUREK, SCEPTER_OF_ENKU, SCEPTER_OF_TUNATH))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -722,8 +739,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case TANAPI:
+ {
if (cond == 8)
{
htmltext = "30571-01.htm";
@@ -735,7 +753,7 @@ public class Q220_TestimonyOfGlory extends Quest
else if (cond == 10)
{
htmltext = "30571-05.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SCEPTER_OF_TANTOS, 1);
st.takeItems(TANAPI_ORDER, 1);
@@ -746,8 +764,9 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30571-06.htm";
}
break;
-
+ }
case KAKAI:
+ {
if ((cond > 7) && (cond < 11))
{
htmltext = "30565-01.htm";
@@ -763,12 +782,15 @@ public class Q220_TestimonyOfGlory extends Quest
st.exitQuest(false);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -783,21 +805,21 @@ public class Q220_TestimonyOfGlory extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case RAGNA_ORC_OVERLORD:
case RAGNA_ORC_SEER:
- if ((cond == 9) && npc.isScriptValue(0))
+ {
+ if (st.isCond(9) && npc.isScriptValue(0))
{
npc.broadcastNpcSay("Is it a lackey of Kakai?!");
npc.setScriptValue(1);
}
break;
-
+ }
case REVENANT_OF_TANTOS_CHIEF:
- if (cond == 9)
+ {
+ if (st.isCond(9))
{
if (npc.isScriptValue(0))
{
@@ -811,6 +833,7 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
+ }
}
return null;
@@ -825,39 +848,42 @@ public class Q220_TestimonyOfGlory extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case TYRANT:
- if ((cond == 1) && st.dropItems(TYRANT_TALON, 1, 10, 500000) && ((st.getQuestItemsCount(GUARDIAN_BASILISK_FANG) + st.getQuestItemsCount(MANASHEN_SHARD)) == 20))
+ {
+ if (st.isCond(1) && st.dropItems(TYRANT_TALON, 1, 10, 500000) && ((st.getQuestItemsCount(GUARDIAN_BASILISK_FANG) + st.getQuestItemsCount(MANASHEN_SHARD)) == 20))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case GUARDIAN_BASILISK:
- if ((cond == 1) && st.dropItems(GUARDIAN_BASILISK_FANG, 1, 10, 500000) && ((st.getQuestItemsCount(TYRANT_TALON) + st.getQuestItemsCount(MANASHEN_SHARD)) == 20))
+ {
+ if (st.isCond(1) && st.dropItems(GUARDIAN_BASILISK_FANG, 1, 10, 500000) && ((st.getQuestItemsCount(TYRANT_TALON) + st.getQuestItemsCount(MANASHEN_SHARD)) == 20))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case MANASHEN_GARGOYLE:
- if ((cond == 1) && st.dropItems(MANASHEN_SHARD, 1, 10, 750000) && ((st.getQuestItemsCount(TYRANT_TALON) + st.getQuestItemsCount(GUARDIAN_BASILISK_FANG)) == 20))
+ {
+ if (st.isCond(1) && st.dropItems(MANASHEN_SHARD, 1, 10, 750000) && ((st.getQuestItemsCount(TYRANT_TALON) + st.getQuestItemsCount(GUARDIAN_BASILISK_FANG)) == 20))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case MARSH_STAKATO_DRONE:
+ {
if (st.hasQuestItems(DRIKO_CONTRACT))
{
st.dropItems(STAKATO_DRONE_HUSK, 1, 30, 750000);
}
break;
-
+ }
case PASHIKA_SON_OF_VOLTAR:
+ {
if (st.hasQuestItems(GLOVE_OF_VOLTAR) && !st.hasQuestItems(PASHIKA_HEAD))
{
st.giveItems(PASHIKA_HEAD, 1);
@@ -872,8 +898,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case VULTUS_SON_OF_VOLTAR:
+ {
if (st.hasQuestItems(GLOVE_OF_VOLTAR) && !st.hasQuestItems(VULTUS_HEAD))
{
st.giveItems(VULTUS_HEAD, 1);
@@ -888,63 +915,71 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case ENKU_ORC_OVERLORD:
+ {
if (st.hasQuestItems(GLOVE_OF_KEPRA) && st.dropItemsAlways(ENKU_OVERLORD_HEAD, 1, 4))
{
st.takeItems(GLOVE_OF_KEPRA, 1);
}
break;
-
+ }
case MAKUM_BUGBEAR_THUG:
+ {
if (st.hasQuestItems(GLOVE_OF_BURAI) && st.dropItemsAlways(MAKUM_BUGBEAR_HEAD, 1, 2))
{
st.takeItems(GLOVE_OF_BURAI, 1);
}
break;
-
+ }
case TIMAK_ORC:
case TIMAK_ORC_ARCHER:
case TIMAK_ORC_SOLDIER:
case TIMAK_ORC_WARRIOR:
case TIMAK_ORC_SHAMAN:
case TIMAK_ORC_OVERLORD:
- if ((cond == 6) && st.dropItems(TIMAK_ORC_HEAD, 1, 20, 500000 + ((npc.getNpcId() - 20583) * 100000)) && (st.getQuestItemsCount(TAMLIN_ORC_SKULL) == 20))
+ {
+ if (st.isCond(6) && st.dropItems(TIMAK_ORC_HEAD, 1, 20, 500000 + ((npc.getNpcId() - 20583) * 100000)) && (st.getQuestItemsCount(TAMLIN_ORC_SKULL) == 20))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case TAMLIN_ORC:
- if ((cond == 6) && st.dropItems(TAMLIN_ORC_SKULL, 1, 20, 500000) && (st.getQuestItemsCount(TIMAK_ORC_HEAD) == 20))
+ {
+ if (st.isCond(6) && st.dropItems(TAMLIN_ORC_SKULL, 1, 20, 500000) && (st.getQuestItemsCount(TIMAK_ORC_HEAD) == 20))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case TAMLIN_ORC_ARCHER:
- if ((cond == 6) && st.dropItems(TAMLIN_ORC_SKULL, 1, 20, 600000) && (st.getQuestItemsCount(TIMAK_ORC_HEAD) == 20))
+ {
+ if (st.isCond(6) && st.dropItems(TAMLIN_ORC_SKULL, 1, 20, 600000) && (st.getQuestItemsCount(TIMAK_ORC_HEAD) == 20))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case RAGNA_ORC_OVERLORD:
case RAGNA_ORC_SEER:
- if (cond == 9)
+ {
+ if (st.isCond(9))
{
npc.broadcastNpcSay("Too late!");
addSpawn(REVENANT_OF_TANTOS_CHIEF, npc, true, 200000);
}
break;
-
+ }
case REVENANT_OF_TANTOS_CHIEF:
- if ((cond == 9) && st.dropItemsAlways(SCEPTER_OF_TANTOS, 1, 1))
+ {
+ if (st.isCond(9) && st.dropItemsAlways(SCEPTER_OF_TANTOS, 1, 1))
{
- st.set("cond", "10");
+ st.setCond(10);
npc.broadcastNpcSay("I'll get revenge someday!!");
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q221_TestimonyOfProsperity/Q221_TestimonyOfProsperity.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q221_TestimonyOfProsperity/Q221_TestimonyOfProsperity.java
index f43e7f395b..898f58f02b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q221_TestimonyOfProsperity/Q221_TestimonyOfProsperity.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q221_TestimonyOfProsperity/Q221_TestimonyOfProsperity.java
@@ -26,12 +26,44 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q221_TestimonyOfProsperity extends Quest
{
+ // NPCs
+ private static final int WILFORD = 30005;
+ private static final int PARMAN = 30104;
+ private static final int LILITH = 30368;
+ private static final int BRIGHT = 30466;
+ private static final int SHARI = 30517;
+ private static final int MION = 30519;
+ private static final int LOCKIRIN = 30531;
+ private static final int SPIRON = 30532;
+ private static final int BALANKI = 30533;
+ private static final int KEEF = 30534;
+ private static final int FILAUR = 30535;
+ private static final int ARIN = 30536;
+ private static final int MARYSE_REDBONNET = 30553;
+ private static final int BOLTER = 30554;
+ private static final int TOROCCO = 30555;
+ private static final int TOMA = 30556;
+ private static final int PIOTUR = 30597;
+ private static final int EMILY = 30620;
+ private static final int NIKOLA = 30621;
+ private static final int BOX_OF_TITAN = 30622;
+ // Monsters
+ private static final int MANDRAGORA_SPROUT_1 = 20223;
+ private static final int MANDRAGORA_SPROUT_2 = 20154;
+ private static final int MANDRAGORA_SAPLING = 20155;
+ private static final int MANDRAGORA_BLOSSOM = 20156;
+ private static final int MARSH_STAKATO = 20157;
+ private static final int GIANT_CRIMSON_ANT = 20228;
+ private static final int MARSH_STAKATO_WORKER = 20230;
+ private static final int TOAD_LORD = 20231;
+ private static final int MARSH_STAKATO_SOLDIER = 20232;
+ private static final int MARSH_SPIDER = 20233;
+ private static final int MARSH_STAKATO_DRONE = 20234;
// Items
private static final int ADENA = 57;
private static final int ANIMAL_SKIN = 1867;
private static final int RECIPE_TITAN_KEY = 3023;
private static final int KEY_OF_TITAN = 3030;
-
private static final int RING_OF_TESTIMONY_1 = 3239;
private static final int RING_OF_TESTIMONY_2 = 3240;
private static final int OLD_ACCOUNT_BOOK = 3241;
@@ -70,55 +102,16 @@ public class Q221_TestimonyOfProsperity extends Quest
private static final int TOAD_LORD_SAC = 3274;
private static final int SPIDER_THORN = 3275;
private static final int CRYSTAL_BROOCH = 3428;
-
// Rewards
private static final int MARK_OF_PROSPERITY = 3238;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int WILFORD = 30005;
- private static final int PARMAN = 30104;
- private static final int LILITH = 30368;
- private static final int BRIGHT = 30466;
- private static final int SHARI = 30517;
- private static final int MION = 30519;
- private static final int LOCKIRIN = 30531;
- private static final int SPIRON = 30532;
- private static final int BALANKI = 30533;
- private static final int KEEF = 30534;
- private static final int FILAUR = 30535;
- private static final int ARIN = 30536;
- private static final int MARYSE_REDBONNET = 30553;
- private static final int BOLTER = 30554;
- private static final int TOROCCO = 30555;
- private static final int TOMA = 30556;
- private static final int PIOTUR = 30597;
- private static final int EMILY = 30620;
- private static final int NIKOLA = 30621;
- private static final int BOX_OF_TITAN = 30622;
-
- // Monsters
- private static final int MANDRAGORA_SPROUT_1 = 20223;
- private static final int MANDRAGORA_SPROUT_2 = 20154;
- private static final int MANDRAGORA_SAPLING = 20155;
- private static final int MANDRAGORA_BLOSSOM = 20156;
- private static final int MARSH_STAKATO = 20157;
- private static final int GIANT_CRIMSON_ANT = 20228;
- private static final int MARSH_STAKATO_WORKER = 20230;
- private static final int TOAD_LORD = 20231;
- private static final int MARSH_STAKATO_SOLDIER = 20232;
- private static final int MARSH_SPIDER = 20233;
- private static final int MARSH_STAKATO_DRONE = 20234;
-
public Q221_TestimonyOfProsperity()
{
super(221, "Testimony of Prosperity");
-
registerQuestItems(RING_OF_TESTIMONY_1, RING_OF_TESTIMONY_2, OLD_ACCOUNT_BOOK, BLESSED_SEED, EMILY_RECIPE, LILITH_ELVEN_WAFER, MAPHR_TABLET_FRAGMENT, COLLECTION_LICENSE, LOCKIRIN_NOTICE_1, LOCKIRIN_NOTICE_2, LOCKIRIN_NOTICE_3, LOCKIRIN_NOTICE_4, LOCKIRIN_NOTICE_5, CONTRIBUTION_OF_SHARI, CONTRIBUTION_OF_MION, CONTRIBUTION_OF_MARYSE, MARYSE_REQUEST, CONTRIBUTION_OF_TOMA, RECEIPT_OF_BOLTER, RECEIPT_OF_CONTRIBUTION_1, RECEIPT_OF_CONTRIBUTION_2, RECEIPT_OF_CONTRIBUTION_3, RECEIPT_OF_CONTRIBUTION_4, RECEIPT_OF_CONTRIBUTION_5, PROCURATION_OF_TOROCCO, BRIGHT_LIST, MANDRAGORA_PETAL, CRIMSON_MOSS, MANDRAGORA_BOUQUET, PARMAN_INSTRUCTIONS, PARMAN_LETTER, CLAY_DOUGH, PATTERN_OF_KEYHOLE, NIKOLAS_LIST, STAKATO_SHELL, TOAD_LORD_SAC, SPIDER_THORN, CRYSTAL_BROOCH);
-
addStartNpc(PARMAN);
addTalkId(WILFORD, PARMAN, LILITH, BRIGHT, SHARI, MION, LOCKIRIN, SPIRON, BALANKI, KEEF, FILAUR, ARIN, MARYSE_REDBONNET, BOLTER, TOROCCO, TOMA, PIOTUR, EMILY, NIKOLA, BOX_OF_TITAN);
-
addKillId(MANDRAGORA_SPROUT_1, MANDRAGORA_SAPLING, MANDRAGORA_BLOSSOM, MARSH_STAKATO, MANDRAGORA_SPROUT_2, GIANT_CRIMSON_ANT, MARSH_STAKATO_WORKER, TOAD_LORD, MARSH_STAKATO_SOLDIER, MARSH_SPIDER, MARSH_STAKATO_DRONE);
}
@@ -132,158 +125,163 @@ public class Q221_TestimonyOfProsperity extends Quest
return htmltext;
}
- // PARMAN
- if (event.equals("30104-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(RING_OF_TESTIMONY_1, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange37", false))
+ case "30104-04.htm":
{
- htmltext = "30104-04e.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
- player.getVariables().set("secondClassChange37", true);
+ st.startQuest();
+ st.giveItems(RING_OF_TESTIMONY_1, 1);
+ if (!player.getVariables().getBoolean("secondClassChange37", false))
+ {
+ htmltext = "30104-04e.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
+ player.getVariables().set("secondClassChange37", true);
+ }
+ break;
}
- }
- else if (event.equals("30104-07.htm"))
- {
- st.takeItems(BLESSED_SEED, 1);
- st.takeItems(EMILY_RECIPE, 1);
- st.takeItems(LILITH_ELVEN_WAFER, 1);
- st.takeItems(OLD_ACCOUNT_BOOK, 1);
- st.takeItems(RING_OF_TESTIMONY_1, 1);
- st.playSound(QuestState.SOUND_MIDDLE);
-
- if (player.getLevel() < 38)
+ case "30104-07.htm":
{
- st.set("cond", "3");
- st.giveItems(PARMAN_INSTRUCTIONS, 1);
- }
- else
- {
- htmltext = "30104-08.htm";
- st.set("cond", "4");
- st.giveItems(PARMAN_LETTER, 1);
- st.giveItems(RING_OF_TESTIMONY_2, 1);
- }
- }
- // LOCKIRIN
- else if (event.equals("30531-02.htm") && st.hasQuestItems(COLLECTION_LICENSE))
- {
- htmltext = "30531-04.htm";
- }
- else if (event.equals("30531-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(COLLECTION_LICENSE, 1);
- st.giveItems(LOCKIRIN_NOTICE_1, 1);
- st.giveItems(LOCKIRIN_NOTICE_2, 1);
- st.giveItems(LOCKIRIN_NOTICE_3, 1);
- st.giveItems(LOCKIRIN_NOTICE_4, 1);
- st.giveItems(LOCKIRIN_NOTICE_5, 1);
- }
- // KEEF
- else if (event.equals("30534-03a.htm") && (st.getQuestItemsCount(ADENA) >= 5000))
- {
- htmltext = "30534-03b.htm";
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(ADENA, 5000);
- st.takeItems(PROCURATION_OF_TOROCCO, 1);
- st.giveItems(RECEIPT_OF_CONTRIBUTION_3, 1);
- }
- // WILFORD
- else if (event.equals("30005-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(CRYSTAL_BROOCH, 1);
- }
- // BRIGHT
- else if (event.equals("30466-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(BRIGHT_LIST, 1);
- }
- // TOROCCO
- else if (event.equals("30555-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(PROCURATION_OF_TOROCCO, 1);
- }
- // LILITH
- else if (event.equals("30368-03.htm"))
- {
- st.takeItems(CRYSTAL_BROOCH, 1);
- st.giveItems(LILITH_ELVEN_WAFER, 1);
-
- if (st.hasQuestItems(BLESSED_SEED, OLD_ACCOUNT_BOOK, EMILY_RECIPE))
- {
- st.set("cond", "2");
+ st.takeItems(BLESSED_SEED, 1);
+ st.takeItems(EMILY_RECIPE, 1);
+ st.takeItems(LILITH_ELVEN_WAFER, 1);
+ st.takeItems(OLD_ACCOUNT_BOOK, 1);
+ st.takeItems(RING_OF_TESTIMONY_1, 1);
st.playSound(QuestState.SOUND_MIDDLE);
+ if (player.getLevel() < 38)
+ {
+ st.setCond(3);
+ st.giveItems(PARMAN_INSTRUCTIONS, 1);
+ }
+ else
+ {
+ htmltext = "30104-08.htm";
+ st.setCond(4);
+ st.giveItems(PARMAN_LETTER, 1);
+ st.giveItems(RING_OF_TESTIMONY_2, 1);
+ }
+ break;
}
- else
+ case "30531-02.htm":
+ {
+ if (st.hasQuestItems(COLLECTION_LICENSE))
+ {
+ htmltext = "30531-04.htm";
+ }
+ break;
+ }
+ case "30531-03.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(COLLECTION_LICENSE, 1);
+ st.giveItems(LOCKIRIN_NOTICE_1, 1);
+ st.giveItems(LOCKIRIN_NOTICE_2, 1);
+ st.giveItems(LOCKIRIN_NOTICE_3, 1);
+ st.giveItems(LOCKIRIN_NOTICE_4, 1);
+ st.giveItems(LOCKIRIN_NOTICE_5, 1);
+ break;
}
- }
- // PIOTUR
- else if (event.equals("30597-02.htm"))
- {
- st.giveItems(BLESSED_SEED, 1);
-
- if (st.hasQuestItems(OLD_ACCOUNT_BOOK, EMILY_RECIPE, LILITH_ELVEN_WAFER))
+ case "30534-03a.htm":
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
+ if (st.getQuestItemsCount(ADENA) >= 5000)
+ {
+ htmltext = "30534-03b.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(ADENA, 5000);
+ st.takeItems(PROCURATION_OF_TOROCCO, 1);
+ st.giveItems(RECEIPT_OF_CONTRIBUTION_3, 1);
+ }
+ break;
}
- else
+ case "30005-04.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(CRYSTAL_BROOCH, 1);
+ break;
}
- }
- // EMILY
- else if (event.equals("30620-03.htm"))
- {
- st.takeItems(MANDRAGORA_BOUQUET, 1);
- st.giveItems(EMILY_RECIPE, 1);
-
- if (st.hasQuestItems(BLESSED_SEED, OLD_ACCOUNT_BOOK, LILITH_ELVEN_WAFER))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else
+ case "30466-03.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(BRIGHT_LIST, 1);
+ break;
+ }
+ case "30555-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(PROCURATION_OF_TOROCCO, 1);
+ break;
+ }
+ case "30368-03.htm":
+ {
+ st.takeItems(CRYSTAL_BROOCH, 1);
+ st.giveItems(LILITH_ELVEN_WAFER, 1);
+ if (st.hasQuestItems(BLESSED_SEED, OLD_ACCOUNT_BOOK, EMILY_RECIPE))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
+ }
+ case "30597-02.htm":
+ {
+ st.giveItems(BLESSED_SEED, 1);
+ if (st.hasQuestItems(OLD_ACCOUNT_BOOK, EMILY_RECIPE, LILITH_ELVEN_WAFER))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
+ }
+ case "30620-03.htm":
+ {
+ st.takeItems(MANDRAGORA_BOUQUET, 1);
+ st.giveItems(EMILY_RECIPE, 1);
+ if (st.hasQuestItems(BLESSED_SEED, OLD_ACCOUNT_BOOK, LILITH_ELVEN_WAFER))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
+ }
+ case "30621-04.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CLAY_DOUGH, 1);
+ break;
+ }
+ case "30622-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CLAY_DOUGH, 1);
+ st.giveItems(PATTERN_OF_KEYHOLE, 1);
+ break;
+ }
+ case "30622-04.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KEY_OF_TITAN, 1);
+ st.takeItems(NIKOLAS_LIST, 1);
+ st.takeItems(RECIPE_TITAN_KEY, 1);
+ st.takeItems(STAKATO_SHELL, 20);
+ st.takeItems(SPIDER_THORN, 10);
+ st.takeItems(TOAD_LORD_SAC, 10);
+ st.giveItems(MAPHR_TABLET_FRAGMENT, 1);
+ break;
}
- }
- // NIKOLA
- else if (event.equals("30621-04.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CLAY_DOUGH, 1);
- }
- // BOX OF TITAN
- else if (event.equals("30622-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CLAY_DOUGH, 1);
- st.giveItems(PATTERN_OF_KEYHOLE, 1);
- }
- else if (event.equals("30622-04.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KEY_OF_TITAN, 1);
- st.takeItems(NIKOLAS_LIST, 1);
- st.takeItems(RECIPE_TITAN_KEY, 1);
- st.takeItems(STAKATO_SHELL, 20);
- st.takeItems(SPIDER_THORN, 10);
- st.takeItems(TOAD_LORD_SAC, 10);
- st.giveItems(MAPHR_TABLET_FRAGMENT, 1);
}
return htmltext;
@@ -302,6 +300,7 @@ public class Q221_TestimonyOfProsperity extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DWARF)
{
htmltext = "30104-01.htm";
@@ -319,12 +318,14 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30104-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case PARMAN:
+ {
if (cond == 1)
{
htmltext = "30104-05.htm";
@@ -342,7 +343,7 @@ public class Q221_TestimonyOfProsperity extends Quest
else
{
htmltext = "30104-10.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PARMAN_INSTRUCTIONS, 1);
st.giveItems(PARMAN_LETTER, 1);
@@ -369,8 +370,9 @@ public class Q221_TestimonyOfProsperity extends Quest
st.exitQuest(false);
}
break;
-
+ }
case LOCKIRIN:
+ {
if ((cond == 1) || (cond == 2))
{
if (st.hasQuestItems(COLLECTION_LICENSE))
@@ -388,7 +390,7 @@ public class Q221_TestimonyOfProsperity extends Quest
if (st.hasQuestItems(BLESSED_SEED, EMILY_RECIPE, LILITH_ELVEN_WAFER))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -411,8 +413,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30531-07.htm";
}
break;
-
+ }
case SPIRON:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(LOCKIRIN_NOTICE_1))
@@ -434,8 +437,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case BALANKI:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(LOCKIRIN_NOTICE_2))
@@ -458,8 +462,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case KEEF:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(LOCKIRIN_NOTICE_3))
@@ -478,8 +483,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case FILAUR:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(LOCKIRIN_NOTICE_4))
@@ -501,8 +507,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case ARIN:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(LOCKIRIN_NOTICE_5))
@@ -524,8 +531,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case SHARI:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(CONTRIBUTION_OF_SHARI))
@@ -540,8 +548,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case MION:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(CONTRIBUTION_OF_MION))
@@ -556,8 +565,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case MARYSE_REDBONNET:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(MARYSE_REQUEST))
@@ -587,8 +597,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case TOROCCO:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(PROCURATION_OF_TOROCCO))
@@ -601,8 +612,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case BOLTER:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(RECEIPT_OF_BOLTER))
@@ -617,8 +629,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case TOMA:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(CONTRIBUTION_OF_TOMA))
@@ -633,8 +646,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case PIOTUR:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = (st.hasQuestItems(BLESSED_SEED)) ? "30597-03.htm" : "30597-01.htm";
@@ -644,8 +658,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30597-04.htm";
}
break;
-
+ }
case WILFORD:
+ {
if ((cond == 1) || (cond == 2))
{
if (st.hasQuestItems(LILITH_ELVEN_WAFER))
@@ -662,8 +677,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30005-07.htm";
}
break;
-
+ }
case LILITH:
+ {
if ((cond == 1) || (cond == 2))
{
if (st.hasQuestItems(CRYSTAL_BROOCH))
@@ -680,8 +696,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30368-05.htm";
}
break;
-
+ }
case BRIGHT:
+ {
if ((cond == 1) || (cond == 2))
{
if (st.hasQuestItems(EMILY_RECIPE))
@@ -718,8 +735,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30466-08.htm";
}
break;
-
+ }
case EMILY:
+ {
if ((cond == 1) || (cond == 2))
{
if (st.hasQuestItems(EMILY_RECIPE))
@@ -736,8 +754,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30620-05.htm";
}
break;
-
+ }
case NIKOLA:
+ {
if (cond == 4)
{
htmltext = "30621-01.htm";
@@ -751,7 +770,7 @@ public class Q221_TestimonyOfProsperity extends Quest
else if (cond == 6)
{
htmltext = "30621-06.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PATTERN_OF_KEYHOLE, 1);
st.giveItems(NIKOLAS_LIST, 1);
@@ -766,8 +785,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30621-09.htm";
}
break;
-
+ }
case BOX_OF_TITAN:
+ {
if (cond == 5)
{
htmltext = "30622-01.htm";
@@ -781,12 +801,15 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30622-05.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -801,86 +824,96 @@ public class Q221_TestimonyOfProsperity extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case MANDRAGORA_SPROUT_1:
+ {
if (st.hasQuestItems(BRIGHT_LIST))
{
st.dropItems(MANDRAGORA_PETAL, 1, 20, 300000);
}
break;
-
+ }
case MANDRAGORA_SPROUT_2:
+ {
if (st.hasQuestItems(BRIGHT_LIST))
{
st.dropItems(MANDRAGORA_PETAL, 1, 20, 600000);
}
break;
-
+ }
case MANDRAGORA_SAPLING:
+ {
if (st.hasQuestItems(BRIGHT_LIST))
{
st.dropItems(MANDRAGORA_PETAL, 1, 20, 800000);
}
break;
-
+ }
case MANDRAGORA_BLOSSOM:
+ {
if (st.hasQuestItems(BRIGHT_LIST))
{
st.dropItemsAlways(MANDRAGORA_PETAL, 1, 20);
}
break;
-
+ }
case GIANT_CRIMSON_ANT:
+ {
if (st.hasQuestItems(BRIGHT_LIST))
{
st.dropItemsAlways(CRIMSON_MOSS, 1, 10);
}
break;
-
+ }
case MARSH_STAKATO:
- if ((cond == 7) && st.dropItems(STAKATO_SHELL, 1, 20, 200000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
+ {
+ if (st.isCond(7) && st.dropItems(STAKATO_SHELL, 1, 20, 200000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
-
+ }
case MARSH_STAKATO_WORKER:
- if ((cond == 7) && st.dropItems(STAKATO_SHELL, 1, 20, 300000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
+ {
+ if (st.isCond(7) && st.dropItems(STAKATO_SHELL, 1, 20, 300000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
-
+ }
case MARSH_STAKATO_SOLDIER:
- if ((cond == 7) && st.dropItems(STAKATO_SHELL, 1, 20, 500000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
+ {
+ if (st.isCond(7) && st.dropItems(STAKATO_SHELL, 1, 20, 500000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
-
+ }
case MARSH_STAKATO_DRONE:
- if ((cond == 7) && st.dropItems(STAKATO_SHELL, 1, 20, 600000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
+ {
+ if (st.isCond(7) && st.dropItems(STAKATO_SHELL, 1, 20, 600000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
-
+ }
case TOAD_LORD:
- if ((cond == 7) && st.dropItems(TOAD_LORD_SAC, 1, 10, 200000) && ((st.getQuestItemsCount(STAKATO_SHELL) + st.getQuestItemsCount(SPIDER_THORN)) == 30))
+ {
+ if (st.isCond(7) && st.dropItems(TOAD_LORD_SAC, 1, 10, 200000) && ((st.getQuestItemsCount(STAKATO_SHELL) + st.getQuestItemsCount(SPIDER_THORN)) == 30))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
-
+ }
case MARSH_SPIDER:
- if ((cond == 7) && st.dropItems(SPIDER_THORN, 1, 10, 200000) && ((st.getQuestItemsCount(STAKATO_SHELL) + st.getQuestItemsCount(TOAD_LORD_SAC)) == 30))
+ {
+ if (st.isCond(7) && st.dropItems(SPIDER_THORN, 1, 10, 200000) && ((st.getQuestItemsCount(STAKATO_SHELL) + st.getQuestItemsCount(TOAD_LORD_SAC)) == 30))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q222_TestOfTheDuelist/Q222_TestOfTheDuelist.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q222_TestOfTheDuelist/Q222_TestOfTheDuelist.java
index 89e9543960..6c8a2f4772 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q222_TestOfTheDuelist/Q222_TestOfTheDuelist.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q222_TestOfTheDuelist/Q222_TestOfTheDuelist.java
@@ -28,7 +28,22 @@ public class Q222_TestOfTheDuelist extends Quest
{
// NPC
private static final int KAIEN = 30623;
-
+ // Monsters
+ private static final int PUNCHER = 20085;
+ private static final int NOBLE_ANT_LEADER = 20090;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int DEAD_SEEKER = 20202;
+ private static final int BREKA_ORC_OVERLORD = 20270;
+ private static final int FETTERED_SOUL = 20552;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int ENCHANTED_MONSTEREYE = 20564;
+ private static final int TAMLIN_ORC = 20601;
+ private static final int TAMLIN_ORC_ARCHER = 20602;
+ private static final int EXCURO = 20214;
+ private static final int KRATOR = 20217;
+ private static final int GRANDIS = 20554;
+ private static final int TIMAK_ORC_OVERLORD = 20588;
+ private static final int LAKIN = 20604;
// Items
private static final int ORDER_GLUDIO = 2763;
private static final int ORDER_DION = 2764;
@@ -51,37 +66,16 @@ public class Q222_TestOfTheDuelist extends Quest
private static final int GRANDIS_SKIN = 2781;
private static final int TIMAK_ORC_BELT = 2782;
private static final int LAKIN_MACE = 2783;
-
// Rewards
private static final int MARK_OF_DUELIST = 2762;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // Monsters
- private static final int PUNCHER = 20085;
- private static final int NOBLE_ANT_LEADER = 20090;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int DEAD_SEEKER = 20202;
- private static final int BREKA_ORC_OVERLORD = 20270;
- private static final int FETTERED_SOUL = 20552;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int ENCHANTED_MONSTEREYE = 20564;
- private static final int TAMLIN_ORC = 20601;
- private static final int TAMLIN_ORC_ARCHER = 20602;
- private static final int EXCURO = 20214;
- private static final int KRATOR = 20217;
- private static final int GRANDIS = 20554;
- private static final int TIMAK_ORC_OVERLORD = 20588;
- private static final int LAKIN = 20604;
-
public Q222_TestOfTheDuelist()
{
super(222, "Test of the Duelist");
-
registerQuestItems(ORDER_GLUDIO, ORDER_DION, ORDER_GIRAN, ORDER_OREN, ORDER_ADEN, FINAL_ORDER, PUNCHER_SHARD, NOBLE_ANT_FEELER, DRONE_CHITIN, DEAD_SEEKER_FANG, OVERLORD_NECKLACE, FETTERED_SOUL_CHAIN, CHIEF_AMULET, ENCHANTED_EYE_MEAT, TAMRIN_ORC_RING, TAMRIN_ORC_ARROW, EXCURO_SKIN, KRATOR_SHARD, GRANDIS_SKIN, TIMAK_ORC_BELT, LAKIN_MACE);
-
addStartNpc(KAIEN);
addTalkId(KAIEN);
-
addKillId(PUNCHER, NOBLE_ANT_LEADER, MARSH_STAKATO_DRONE, DEAD_SEEKER, BREKA_ORC_OVERLORD, FETTERED_SOUL, LETO_LIZARDMAN_OVERLORD, ENCHANTED_MONSTEREYE, TAMLIN_ORC, TAMLIN_ORC_ARCHER, EXCURO, KRATOR, GRANDIS, TIMAK_ORC_OVERLORD, LAKIN);
}
@@ -95,57 +89,60 @@ public class Q222_TestOfTheDuelist extends Quest
return htmltext;
}
- if (event.equals("30623-04.htm"))
+ switch (event)
{
- if (player.getRace() == Race.ORC)
+ case "30623-04.htm":
{
- htmltext = "30623-05.htm";
+ if (player.getRace() == Race.ORC)
+ {
+ htmltext = "30623-05.htm";
+ }
+ break;
}
- }
- else if (event.equals("30623-07.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_GLUDIO, 1);
- st.giveItems(ORDER_DION, 1);
- st.giveItems(ORDER_GIRAN, 1);
- st.giveItems(ORDER_OREN, 1);
- st.giveItems(ORDER_ADEN, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30623-07.htm":
{
- htmltext = "30623-07a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.setCond(2);
+ st.giveItems(ORDER_GLUDIO, 1);
+ st.giveItems(ORDER_DION, 1);
+ st.giveItems(ORDER_GIRAN, 1);
+ st.giveItems(ORDER_OREN, 1);
+ st.giveItems(ORDER_ADEN, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30623-07a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- else if (event.equals("30623-16.htm"))
- {
- if (st.getInt("cond") == 3)
+ case "30623-16.htm":
{
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
-
- st.takeItems(ORDER_GLUDIO, 1);
- st.takeItems(ORDER_DION, 1);
- st.takeItems(ORDER_GIRAN, 1);
- st.takeItems(ORDER_OREN, 1);
- st.takeItems(ORDER_ADEN, 1);
-
- st.takeItems(PUNCHER_SHARD, -1);
- st.takeItems(NOBLE_ANT_FEELER, -1);
- st.takeItems(DRONE_CHITIN, -1);
- st.takeItems(DEAD_SEEKER_FANG, -1);
- st.takeItems(OVERLORD_NECKLACE, -1);
- st.takeItems(FETTERED_SOUL_CHAIN, -1);
- st.takeItems(CHIEF_AMULET, -1);
- st.takeItems(ENCHANTED_EYE_MEAT, -1);
- st.takeItems(TAMRIN_ORC_RING, -1);
- st.takeItems(TAMRIN_ORC_ARROW, -1);
-
- st.giveItems(FINAL_ORDER, 1);
+ if (st.isCond(3))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+
+ st.takeItems(ORDER_GLUDIO, 1);
+ st.takeItems(ORDER_DION, 1);
+ st.takeItems(ORDER_GIRAN, 1);
+ st.takeItems(ORDER_OREN, 1);
+ st.takeItems(ORDER_ADEN, 1);
+
+ st.takeItems(PUNCHER_SHARD, -1);
+ st.takeItems(NOBLE_ANT_FEELER, -1);
+ st.takeItems(DRONE_CHITIN, -1);
+ st.takeItems(DEAD_SEEKER_FANG, -1);
+ st.takeItems(OVERLORD_NECKLACE, -1);
+ st.takeItems(FETTERED_SOUL_CHAIN, -1);
+ st.takeItems(CHIEF_AMULET, -1);
+ st.takeItems(ENCHANTED_EYE_MEAT, -1);
+ st.takeItems(TAMRIN_ORC_RING, -1);
+ st.takeItems(TAMRIN_ORC_ARROW, -1);
+
+ st.giveItems(FINAL_ORDER, 1);
+ }
+ break;
}
}
@@ -165,6 +162,7 @@ public class Q222_TestOfTheDuelist extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
final int classId = player.getClassId().getId();
if ((classId != 0x01) && (classId != 0x2f) && (classId != 0x13) && (classId != 0x20))
{
@@ -179,9 +177,10 @@ public class Q222_TestOfTheDuelist extends Quest
htmltext = "30623-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 2)
{
htmltext = "30623-07a.htm";
@@ -210,10 +209,12 @@ public class Q222_TestOfTheDuelist extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -228,119 +229,136 @@ public class Q222_TestOfTheDuelist extends Quest
return null;
}
- if (st.getInt("cond") == 2)
+ if (st.isCond(2))
{
switch (npc.getNpcId())
{
case PUNCHER:
+ {
if (st.dropItemsAlways(PUNCHER_SHARD, 1, 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case NOBLE_ANT_LEADER:
+ {
if (st.dropItemsAlways(NOBLE_ANT_FEELER, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case MARSH_STAKATO_DRONE:
+ {
if (st.dropItemsAlways(DRONE_CHITIN, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case DEAD_SEEKER:
+ {
if (st.dropItemsAlways(DEAD_SEEKER_FANG, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case BREKA_ORC_OVERLORD:
+ {
if (st.dropItemsAlways(OVERLORD_NECKLACE, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case FETTERED_SOUL:
+ {
if (st.dropItemsAlways(FETTERED_SOUL_CHAIN, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case LETO_LIZARDMAN_OVERLORD:
+ {
if (st.dropItemsAlways(CHIEF_AMULET, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case ENCHANTED_MONSTEREYE:
+ {
if (st.dropItemsAlways(ENCHANTED_EYE_MEAT, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case TAMLIN_ORC:
+ {
if (st.dropItemsAlways(TAMRIN_ORC_RING, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case TAMLIN_ORC_ARCHER:
+ {
if (st.dropItemsAlways(TAMRIN_ORC_ARROW, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
+ }
}
}
- else if (st.getInt("cond") == 4)
+ else if (st.isCond(4))
{
switch (npc.getNpcId())
{
case EXCURO:
+ {
if (st.dropItemsAlways(EXCURO_SKIN, 1, 3) && (st.getQuestItemsCount(KRATOR_SHARD) >= 3) && (st.getQuestItemsCount(LAKIN_MACE) >= 3) && (st.getQuestItemsCount(GRANDIS_SKIN) >= 3) && (st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case KRATOR:
+ {
if (st.dropItemsAlways(KRATOR_SHARD, 1, 3) && (st.getQuestItemsCount(EXCURO_SKIN) >= 3) && (st.getQuestItemsCount(LAKIN_MACE) >= 3) && (st.getQuestItemsCount(GRANDIS_SKIN) >= 3) && (st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case LAKIN:
+ {
if (st.dropItemsAlways(LAKIN_MACE, 1, 3) && (st.getQuestItemsCount(EXCURO_SKIN) >= 3) && (st.getQuestItemsCount(KRATOR_SHARD) >= 3) && (st.getQuestItemsCount(GRANDIS_SKIN) >= 3) && (st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case GRANDIS:
+ {
if (st.dropItemsAlways(GRANDIS_SKIN, 1, 3) && (st.getQuestItemsCount(EXCURO_SKIN) >= 3) && (st.getQuestItemsCount(KRATOR_SHARD) >= 3) && (st.getQuestItemsCount(LAKIN_MACE) >= 3) && (st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case TIMAK_ORC_OVERLORD:
+ {
if (st.dropItemsAlways(TIMAK_ORC_BELT, 1, 3) && (st.getQuestItemsCount(EXCURO_SKIN) >= 3) && (st.getQuestItemsCount(KRATOR_SHARD) >= 3) && (st.getQuestItemsCount(LAKIN_MACE) >= 3) && (st.getQuestItemsCount(GRANDIS_SKIN) >= 3))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
+ }
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q223_TestOfTheChampion/Q223_TestOfTheChampion.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q223_TestOfTheChampion/Q223_TestOfTheChampion.java
index c30dbb79cb..2fb4ff1562 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q223_TestOfTheChampion/Q223_TestOfTheChampion.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q223_TestOfTheChampion/Q223_TestOfTheChampion.java
@@ -30,6 +30,25 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q223_TestOfTheChampion extends Quest
{
+ // NPCs
+ private static final int ASCALON = 30624;
+ private static final int GROOT = 30093;
+ private static final int MOUEN = 30196;
+ private static final int MASON = 30625;
+ // Monsters
+ private static final int HARPY = 20145;
+ private static final int HARPY_MATRIARCH = 27088;
+ private static final int MEDUSA = 20158;
+ private static final int WINDSUS = 20553;
+ private static final int ROAD_COLLECTOR = 27089;
+ private static final int ROAD_SCAVENGER = 20551;
+ private static final int LETO_LIZARDMAN = 20577;
+ private static final int LETO_LIZARDMAN_ARCHER = 20578;
+ private static final int LETO_LIZARDMAN_SOLDIER = 20579;
+ private static final int LETO_LIZARDMAN_WARRIOR = 20580;
+ private static final int LETO_LIZARDMAN_SHAMAN = 20581;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int BLOODY_AXE_ELITE = 20780;
// Items
private static final int ASCALON_LETTER_1 = 3277;
private static final int MASON_LETTER = 3278;
@@ -47,41 +66,16 @@ public class Q223_TestOfTheChampion extends Quest
private static final int BLOODY_AXE_HEAD = 3290;
private static final int ROAD_RATMAN_HEAD = 3291;
private static final int LETO_LIZARDMAN_FANG = 3292;
-
// Rewards
private static final int MARK_OF_CHAMPION = 3276;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int ASCALON = 30624;
- private static final int GROOT = 30093;
- private static final int MOUEN = 30196;
- private static final int MASON = 30625;
-
- // Monsters
- private static final int HARPY = 20145;
- private static final int HARPY_MATRIARCH = 27088;
- private static final int MEDUSA = 20158;
- private static final int WINDSUS = 20553;
- private static final int ROAD_COLLECTOR = 27089;
- private static final int ROAD_SCAVENGER = 20551;
- private static final int LETO_LIZARDMAN = 20577;
- private static final int LETO_LIZARDMAN_ARCHER = 20578;
- private static final int LETO_LIZARDMAN_SOLDIER = 20579;
- private static final int LETO_LIZARDMAN_WARRIOR = 20580;
- private static final int LETO_LIZARDMAN_SHAMAN = 20581;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int BLOODY_AXE_ELITE = 20780;
-
public Q223_TestOfTheChampion()
{
super(223, "Test of the Champion");
-
registerQuestItems(MASON_LETTER, MEDUSA_VENOM, WINDSUS_BILE, WHITE_ROSE_INSIGNIA, HARPY_EGG, GROOT_LETTER, MOUEN_LETTER, ASCALON_LETTER_1, IRON_ROSE_RING, BLOODY_AXE_HEAD, ASCALON_LETTER_2, ASCALON_LETTER_3, MOUEN_ORDER_1, ROAD_RATMAN_HEAD, MOUEN_ORDER_2, LETO_LIZARDMAN_FANG);
-
addStartNpc(ASCALON);
addTalkId(ASCALON, GROOT, MOUEN, MASON);
-
addAttackId(HARPY, ROAD_SCAVENGER);
addKillId(HARPY, MEDUSA, HARPY_MATRIARCH, ROAD_COLLECTOR, ROAD_SCAVENGER, WINDSUS, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, BLOODY_AXE_ELITE);
}
@@ -96,62 +90,69 @@ public class Q223_TestOfTheChampion extends Quest
return htmltext;
}
- if (event.equals("30624-06.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ASCALON_LETTER_1, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30624-06.htm":
{
- htmltext = "30624-06a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(ASCALON_LETTER_1, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30624-06a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
+ }
+ case "30624-10.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MASON_LETTER, 1);
+ st.giveItems(ASCALON_LETTER_2, 1);
+ break;
+ }
+ case "30624-14.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GROOT_LETTER, 1);
+ st.giveItems(ASCALON_LETTER_3, 1);
+ break;
+ }
+ case "30625-03.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ASCALON_LETTER_1, 1);
+ st.giveItems(IRON_ROSE_RING, 1);
+ break;
+ }
+ case "30093-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ASCALON_LETTER_2, 1);
+ st.giveItems(WHITE_ROSE_INSIGNIA, 1);
+ break;
+ }
+ case "30196-03.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ASCALON_LETTER_3, 1);
+ st.giveItems(MOUEN_ORDER_1, 1);
+ break;
+ }
+ case "30196-06.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MOUEN_ORDER_1, 1);
+ st.takeItems(ROAD_RATMAN_HEAD, 1);
+ st.giveItems(MOUEN_ORDER_2, 1);
+ break;
}
- }
- else if (event.equals("30624-10.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MASON_LETTER, 1);
- st.giveItems(ASCALON_LETTER_2, 1);
- }
- else if (event.equals("30624-14.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GROOT_LETTER, 1);
- st.giveItems(ASCALON_LETTER_3, 1);
- }
- else if (event.equals("30625-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ASCALON_LETTER_1, 1);
- st.giveItems(IRON_ROSE_RING, 1);
- }
- else if (event.equals("30093-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ASCALON_LETTER_2, 1);
- st.giveItems(WHITE_ROSE_INSIGNIA, 1);
- }
- else if (event.equals("30196-03.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ASCALON_LETTER_3, 1);
- st.giveItems(MOUEN_ORDER_1, 1);
- }
- else if (event.equals("30196-06.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MOUEN_ORDER_1, 1);
- st.takeItems(ROAD_RATMAN_HEAD, 1);
- st.giveItems(MOUEN_ORDER_2, 1);
}
return htmltext;
@@ -170,6 +171,7 @@ public class Q223_TestOfTheChampion extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
final ClassId classId = player.getClassId();
if ((classId != ClassId.WARRIOR) && (classId != ClassId.ORC_RAIDER))
{
@@ -184,12 +186,14 @@ public class Q223_TestOfTheChampion extends Quest
htmltext = (classId == ClassId.WARRIOR) ? "30624-03.htm" : "30624-04.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ASCALON:
+ {
if (cond == 1)
{
htmltext = "30624-07.htm";
@@ -233,8 +237,9 @@ public class Q223_TestOfTheChampion extends Quest
st.exitQuest(false);
}
break;
-
+ }
case MASON:
+ {
if (cond == 1)
{
htmltext = "30625-01.htm";
@@ -246,7 +251,7 @@ public class Q223_TestOfTheChampion extends Quest
else if (cond == 3)
{
htmltext = "30625-05.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BLOODY_AXE_HEAD, -1);
st.takeItems(IRON_ROSE_RING, 1);
@@ -261,8 +266,9 @@ public class Q223_TestOfTheChampion extends Quest
htmltext = "30625-07.htm";
}
break;
-
+ }
case GROOT:
+ {
if (cond == 5)
{
htmltext = "30093-01.htm";
@@ -274,7 +280,7 @@ public class Q223_TestOfTheChampion extends Quest
else if (cond == 7)
{
htmltext = "30093-04.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(WHITE_ROSE_INSIGNIA, 1);
st.takeItems(HARPY_EGG, -1);
@@ -291,8 +297,9 @@ public class Q223_TestOfTheChampion extends Quest
htmltext = "30093-06.htm";
}
break;
-
+ }
case MOUEN:
+ {
if (cond == 9)
{
htmltext = "30196-01.htm";
@@ -312,7 +319,7 @@ public class Q223_TestOfTheChampion extends Quest
else if (cond == 13)
{
htmltext = "30196-08.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LETO_LIZARDMAN_FANG, -1);
st.takeItems(MOUEN_ORDER_2, 1);
@@ -323,12 +330,15 @@ public class Q223_TestOfTheChampion extends Quest
htmltext = "30196-09.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -346,7 +356,8 @@ public class Q223_TestOfTheChampion extends Quest
switch (npc.getNpcId())
{
case HARPY: // Possibility to spawn an HARPY _MATRIARCH.
- if ((st.getInt("cond") == 6) && Rnd.nextBoolean() && !npc.isScriptValue(1))
+ {
+ if (st.isCond(6) && Rnd.nextBoolean() && !npc.isScriptValue(1))
{
final Creature originalKiller = isPet ? attacker.getPet() : attacker;
@@ -362,9 +373,10 @@ public class Q223_TestOfTheChampion extends Quest
npc.setScriptValue(1);
}
break;
-
+ }
case ROAD_SCAVENGER: // Possibility to spawn a Road Collector.
- if ((st.getInt("cond") == 10) && Rnd.nextBoolean() && !npc.isScriptValue(1))
+ {
+ if (st.isCond(10) && Rnd.nextBoolean() && !npc.isScriptValue(1))
{
final Creature originalKiller = isPet ? attacker.getPet() : attacker;
@@ -380,6 +392,7 @@ public class Q223_TestOfTheChampion extends Quest
npc.setScriptValue(1);
}
break;
+ }
}
return null;
@@ -395,57 +408,63 @@ public class Q223_TestOfTheChampion extends Quest
}
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case BLOODY_AXE_ELITE:
- if ((st.getInt("cond") == 2) && st.dropItemsAlways(BLOODY_AXE_HEAD, 1, 100))
+ {
+ if (st.isCond(2) && st.dropItemsAlways(BLOODY_AXE_HEAD, 1, 100))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case HARPY:
case HARPY_MATRIARCH:
- if ((st.getInt("cond") == 6) && st.dropItems(HARPY_EGG, 1, 30, 500000) && (st.getQuestItemsCount(MEDUSA_VENOM) == 30) && (st.getQuestItemsCount(WINDSUS_BILE) == 30))
+ {
+ if (st.isCond(6) && st.dropItems(HARPY_EGG, 1, 30, 500000) && (st.getQuestItemsCount(MEDUSA_VENOM) == 30) && (st.getQuestItemsCount(WINDSUS_BILE) == 30))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case MEDUSA:
- if ((st.getInt("cond") == 6) && st.dropItems(MEDUSA_VENOM, 1, 30, 500000) && (st.getQuestItemsCount(HARPY_EGG) == 30) && (st.getQuestItemsCount(WINDSUS_BILE) == 30))
+ {
+ if (st.isCond(6) && st.dropItems(MEDUSA_VENOM, 1, 30, 500000) && (st.getQuestItemsCount(HARPY_EGG) == 30) && (st.getQuestItemsCount(WINDSUS_BILE) == 30))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case WINDSUS:
- if ((st.getInt("cond") == 6) && st.dropItems(WINDSUS_BILE, 1, 30, 500000) && (st.getQuestItemsCount(HARPY_EGG) == 30) && (st.getQuestItemsCount(MEDUSA_VENOM) == 30))
+ {
+ if (st.isCond(6) && st.dropItems(WINDSUS_BILE, 1, 30, 500000) && (st.getQuestItemsCount(HARPY_EGG) == 30) && (st.getQuestItemsCount(MEDUSA_VENOM) == 30))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case ROAD_COLLECTOR:
case ROAD_SCAVENGER:
- if ((st.getInt("cond") == 10) && st.dropItemsAlways(ROAD_RATMAN_HEAD, 1, 100))
+ {
+ if (st.isCond(10) && st.dropItemsAlways(ROAD_RATMAN_HEAD, 1, 100))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case LETO_LIZARDMAN:
case LETO_LIZARDMAN_ARCHER:
case LETO_LIZARDMAN_SOLDIER:
case LETO_LIZARDMAN_WARRIOR:
case LETO_LIZARDMAN_SHAMAN:
case LETO_LIZARDMAN_OVERLORD:
- if ((st.getInt("cond") == 12) && st.dropItems(LETO_LIZARDMAN_FANG, 1, 100, 500000 + (100000 * (npcId - 20577))))
+ {
+ if (st.isCond(12) && st.dropItems(LETO_LIZARDMAN_FANG, 1, 100, 500000 + (100000 * (npcId - 20577))))
{
- st.set("cond", "13");
+ st.setCond(13);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q224_TestOfSagittarius/Q224_TestOfSagittarius.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q224_TestOfSagittarius/Q224_TestOfSagittarius.java
index 380c530f96..c4efa3a651 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q224_TestOfSagittarius/Q224_TestOfSagittarius.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q224_TestOfSagittarius/Q224_TestOfSagittarius.java
@@ -28,35 +28,12 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q224_TestOfSagittarius extends Quest
{
- // Items
- private static final int BERNARD_INTRODUCTION = 3294;
- private static final int HAMIL_LETTER_1 = 3295;
- private static final int HAMIL_LETTER_2 = 3296;
- private static final int HAMIL_LETTER_3 = 3297;
- private static final int HUNTER_RUNE_1 = 3298;
- private static final int HUNTER_RUNE_2 = 3299;
- private static final int TALISMAN_OF_KADESH = 3300;
- private static final int TALISMAN_OF_SNAKE = 3301;
- private static final int MITHRIL_CLIP = 3302;
- private static final int STAKATO_CHITIN = 3303;
- private static final int REINFORCED_BOWSTRING = 3304;
- private static final int MANASHEN_HORN = 3305;
- private static final int BLOOD_OF_LIZARDMAN = 3306;
-
- private static final int CRESCENT_MOON_BOW = 3028;
- private static final int WOODEN_ARROW = 17;
-
- // Rewards
- private static final int MARK_OF_SAGITTARIUS = 3293;
- private static final int DIMENSIONAL_DIAMOND = 7562;
-
// NPCs
private static final int BERNARD = 30702;
private static final int HAMIL = 30626;
private static final int SIR_ARON_TANFORD = 30653;
private static final int VOKIAN = 30514;
private static final int GAUEN = 30717;
-
// Monsters
private static final int ANT = 20079;
private static final int ANT_CAPTAIN = 20080;
@@ -81,16 +58,32 @@ public class Q224_TestOfSagittarius extends Quest
private static final int LETO_LIZARDMAN_SHAMAN = 20581;
private static final int LETO_LIZARDMAN_OVERLORD = 20582;
private static final int SERPENT_DEMON_KADESH = 27090;
+ // Items
+ private static final int BERNARD_INTRODUCTION = 3294;
+ private static final int HAMIL_LETTER_1 = 3295;
+ private static final int HAMIL_LETTER_2 = 3296;
+ private static final int HAMIL_LETTER_3 = 3297;
+ private static final int HUNTER_RUNE_1 = 3298;
+ private static final int HUNTER_RUNE_2 = 3299;
+ private static final int TALISMAN_OF_KADESH = 3300;
+ private static final int TALISMAN_OF_SNAKE = 3301;
+ private static final int MITHRIL_CLIP = 3302;
+ private static final int STAKATO_CHITIN = 3303;
+ private static final int REINFORCED_BOWSTRING = 3304;
+ private static final int MANASHEN_HORN = 3305;
+ private static final int BLOOD_OF_LIZARDMAN = 3306;
+ private static final int CRESCENT_MOON_BOW = 3028;
+ private static final int WOODEN_ARROW = 17;
+ // Rewards
+ private static final int MARK_OF_SAGITTARIUS = 3293;
+ private static final int DIMENSIONAL_DIAMOND = 7562;
public Q224_TestOfSagittarius()
{
super(224, "Test of Sagittarius");
-
registerQuestItems(BERNARD_INTRODUCTION, HAMIL_LETTER_1, HAMIL_LETTER_2, HAMIL_LETTER_3, HUNTER_RUNE_1, HUNTER_RUNE_2, TALISMAN_OF_KADESH, TALISMAN_OF_SNAKE, MITHRIL_CLIP, STAKATO_CHITIN, REINFORCED_BOWSTRING, MANASHEN_HORN, BLOOD_OF_LIZARDMAN, CRESCENT_MOON_BOW);
-
addStartNpc(BERNARD);
addTalkId(BERNARD, HAMIL, SIR_ARON_TANFORD, VOKIAN, GAUEN);
-
addKillId(ANT, ANT_CAPTAIN, ANT_OVERSEER, ANT_RECRUIT, ANT_PATROL, ANT_GUARD, NOBLE_ANT, NOBLE_ANT_LEADER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, MARSH_STAKATO_WORKER, MARSH_STAKATO_SOLDIER, MARSH_STAKATO_DRONE, MARSH_SPIDER, ROAD_SCAVENGER, MANASHEN_GARGOYLE, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, SERPENT_DEMON_KADESH);
}
@@ -104,49 +97,50 @@ public class Q224_TestOfSagittarius extends Quest
return htmltext;
}
- // BERNARD
- if (event.equals("30702-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(BERNARD_INTRODUCTION, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30702-04.htm":
{
- htmltext = "30702-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(BERNARD_INTRODUCTION, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30702-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
+ }
+ case "30626-03.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BERNARD_INTRODUCTION, 1);
+ st.giveItems(HAMIL_LETTER_1, 1);
+ break;
+ }
+ case "30626-07.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HUNTER_RUNE_1, 10);
+ st.giveItems(HAMIL_LETTER_2, 1);
+ break;
+ }
+ case "30653-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HAMIL_LETTER_1, 1);
+ break;
+ }
+ case "30514-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HAMIL_LETTER_2, 1);
+ break;
}
- }
- // HAMIL
- else if (event.equals("30626-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BERNARD_INTRODUCTION, 1);
- st.giveItems(HAMIL_LETTER_1, 1);
- }
- else if (event.equals("30626-07.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HUNTER_RUNE_1, 10);
- st.giveItems(HAMIL_LETTER_2, 1);
- }
- // SIR_ARON_TANFORD
- else if (event.equals("30653-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HAMIL_LETTER_1, 1);
- }
- // VOKIAN
- else if (event.equals("30514-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HAMIL_LETTER_2, 1);
}
return htmltext;
@@ -165,6 +159,7 @@ public class Q224_TestOfSagittarius extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.ROGUE) && (player.getClassId() != ClassId.ELVEN_SCOUT) && (player.getClassId() != ClassId.ASSASSIN))
{
htmltext = "30702-02.htm";
@@ -178,16 +173,19 @@ public class Q224_TestOfSagittarius extends Quest
htmltext = "30702-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BERNARD:
+ {
htmltext = "30702-05.htm";
break;
-
+ }
case HAMIL:
+ {
if (cond == 1)
{
htmltext = "30626-01.htm";
@@ -207,7 +205,7 @@ public class Q224_TestOfSagittarius extends Quest
else if (cond == 8)
{
htmltext = "30626-09.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HUNTER_RUNE_2, 10);
st.giveItems(HAMIL_LETTER_3, 1);
@@ -219,7 +217,7 @@ public class Q224_TestOfSagittarius extends Quest
else if (cond == 12)
{
htmltext = "30626-11.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 13)
@@ -239,8 +237,9 @@ public class Q224_TestOfSagittarius extends Quest
st.exitQuest(false);
}
break;
-
+ }
case SIR_ARON_TANFORD:
+ {
if (cond == 2)
{
htmltext = "30653-01.htm";
@@ -250,8 +249,9 @@ public class Q224_TestOfSagittarius extends Quest
htmltext = "30653-03.htm";
}
break;
-
+ }
case VOKIAN:
+ {
if (cond == 5)
{
htmltext = "30514-01.htm";
@@ -263,7 +263,7 @@ public class Q224_TestOfSagittarius extends Quest
else if (cond == 7)
{
htmltext = "30514-04.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TALISMAN_OF_SNAKE, 1);
}
@@ -272,12 +272,13 @@ public class Q224_TestOfSagittarius extends Quest
htmltext = "30514-05.htm";
}
break;
-
+ }
case GAUEN:
+ {
if (cond == 9)
{
htmltext = "30717-01.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HAMIL_LETTER_3, 1);
}
@@ -288,7 +289,7 @@ public class Q224_TestOfSagittarius extends Quest
else if (cond == 11)
{
htmltext = "30717-02.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MANASHEN_HORN, 1);
st.takeItems(MITHRIL_CLIP, 1);
@@ -302,12 +303,15 @@ public class Q224_TestOfSagittarius extends Quest
htmltext = "30717-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -332,58 +336,65 @@ public class Q224_TestOfSagittarius extends Quest
case ANT_GUARD:
case NOBLE_ANT:
case NOBLE_ANT_LEADER:
- if ((st.getInt("cond") == 3) && st.dropItems(HUNTER_RUNE_1, 1, 10, 500000))
+ {
+ if (st.isCond(3) && st.dropItems(HUNTER_RUNE_1, 1, 10, 500000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case BREKA_ORC_SHAMAN:
case BREKA_ORC_OVERLORD:
- if ((st.getInt("cond") == 6) && st.dropItems(HUNTER_RUNE_2, 1, 10, 500000))
+ {
+ if (st.isCond(6) && st.dropItems(HUNTER_RUNE_2, 1, 10, 500000))
{
- st.set("cond", "7");
+ st.setCond(7);
st.giveItems(TALISMAN_OF_SNAKE, 1);
}
break;
-
+ }
case MARSH_STAKATO_WORKER:
case MARSH_STAKATO_SOLDIER:
case MARSH_STAKATO_DRONE:
- if ((st.getInt("cond") == 10) && st.dropItems(STAKATO_CHITIN, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, MITHRIL_CLIP, REINFORCED_BOWSTRING))
+ {
+ if (st.isCond(10) && st.dropItems(STAKATO_CHITIN, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, MITHRIL_CLIP, REINFORCED_BOWSTRING))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case MARSH_SPIDER:
- if ((st.getInt("cond") == 10) && st.dropItems(REINFORCED_BOWSTRING, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, MITHRIL_CLIP, STAKATO_CHITIN))
+ {
+ if (st.isCond(10) && st.dropItems(REINFORCED_BOWSTRING, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, MITHRIL_CLIP, STAKATO_CHITIN))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case ROAD_SCAVENGER:
- if ((st.getInt("cond") == 10) && st.dropItems(MITHRIL_CLIP, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, REINFORCED_BOWSTRING, STAKATO_CHITIN))
+ {
+ if (st.isCond(10) && st.dropItems(MITHRIL_CLIP, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, REINFORCED_BOWSTRING, STAKATO_CHITIN))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case MANASHEN_GARGOYLE:
- if ((st.getInt("cond") == 10) && st.dropItems(MANASHEN_HORN, 1, 1, 100000) && st.hasQuestItems(REINFORCED_BOWSTRING, MITHRIL_CLIP, STAKATO_CHITIN))
+ {
+ if (st.isCond(10) && st.dropItems(MANASHEN_HORN, 1, 1, 100000) && st.hasQuestItems(REINFORCED_BOWSTRING, MITHRIL_CLIP, STAKATO_CHITIN))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case LETO_LIZARDMAN:
case LETO_LIZARDMAN_ARCHER:
case LETO_LIZARDMAN_SOLDIER:
case LETO_LIZARDMAN_WARRIOR:
case LETO_LIZARDMAN_SHAMAN:
case LETO_LIZARDMAN_OVERLORD:
- if (st.getInt("cond") == 13)
+ {
+ if (st.isCond(13))
{
if (((st.getQuestItemsCount(BLOOD_OF_LIZARDMAN) - 120) * 5) > Rnd.get(100))
{
@@ -397,13 +408,14 @@ public class Q224_TestOfSagittarius extends Quest
}
}
break;
-
+ }
case SERPENT_DEMON_KADESH:
- if (st.getInt("cond") == 13)
+ {
+ if (st.isCond(13))
{
if (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == CRESCENT_MOON_BOW)
{
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(TALISMAN_OF_KADESH, 1);
}
@@ -413,6 +425,7 @@ public class Q224_TestOfSagittarius extends Quest
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q225_TestOfTheSearcher/Q225_TestOfTheSearcher.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q225_TestOfTheSearcher/Q225_TestOfTheSearcher.java
index db96684e37..ebb71f3033 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q225_TestOfTheSearcher/Q225_TestOfTheSearcher.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q225_TestOfTheSearcher/Q225_TestOfTheSearcher.java
@@ -26,6 +26,22 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q225_TestOfTheSearcher extends Quest
{
+ // NPCs
+ private static final int ALEX = 30291;
+ private static final int TYRA = 30420;
+ private static final int TREE = 30627;
+ private static final int STRONG_WOODEN_CHEST = 30628;
+ private static final int LUTHER = 30690;
+ private static final int LEIRYNN = 30728;
+ private static final int BORYS = 30729;
+ private static final int JAX = 30730;
+ // Monsters
+ private static final int HANGMAN_TREE = 20144;
+ private static final int ROAD_SCAVENGER = 20551;
+ private static final int GIANT_FUNGUS = 20555;
+ private static final int DELU_LIZARDMAN_SHAMAN = 20781;
+ private static final int DELU_CHIEF_KALKIS = 27093;
+ private static final int NEER_BODYGUARD = 27092;
// Items
private static final int LUTHER_LETTER = 2784;
private static final int ALEX_WARRANT = 2785;
@@ -52,40 +68,18 @@ public class Q225_TestOfTheSearcher extends Quest
private static final int RUSTED_KEY = 2806;
private static final int GOLD_BAR = 2807;
private static final int ALEX_RECOMMEND = 2808;
-
// Rewards
private static final int MARK_OF_SEARCHER = 2809;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // NPCs
- private static final int ALEX = 30291;
- private static final int TYRA = 30420;
- private static final int TREE = 30627;
- private static final int STRONG_WOODEN_CHEST = 30628;
- private static final int LUTHER = 30690;
- private static final int LEIRYNN = 30728;
- private static final int BORYS = 30729;
- private static final int JAX = 30730;
-
- // Monsters
- private static final int HANGMAN_TREE = 20144;
- private static final int ROAD_SCAVENGER = 20551;
- private static final int GIANT_FUNGUS = 20555;
- private static final int DELU_LIZARDMAN_SHAMAN = 20781;
- private static final int DELU_CHIEF_KALKIS = 27093;
- private static final int NEER_BODYGUARD = 27092;
-
+ // Misc
private static NpcInstance _strongWoodenChest; // Used to avoid to spawn multiple instances.
public Q225_TestOfTheSearcher()
{
super(225, "Test of the Searcher");
-
registerQuestItems(LUTHER_LETTER, ALEX_WARRANT, LEIRYNN_ORDER_1, DELU_TOTEM, LEIRYNN_ORDER_2, CHIEF_KALKI_FANG, LEIRYNN_REPORT, STRANGE_MAP, LAMBERT_MAP, ALEX_LETTER, ALEX_ORDER, WINE_CATALOG, TYRA_CONTRACT, RED_SPORE_DUST, MALRUKIAN_WINE, OLD_ORDER, JAX_DIARY, TORN_MAP_PIECE_1, TORN_MAP_PIECE_2, SOLT_MAP, MAKEL_MAP, COMBINED_MAP, RUSTED_KEY, GOLD_BAR, ALEX_RECOMMEND);
-
addStartNpc(LUTHER);
addTalkId(ALEX, TYRA, TREE, STRONG_WOODEN_CHEST, LUTHER, LEIRYNN, BORYS, JAX);
-
addAttackId(DELU_LIZARDMAN_SHAMAN);
addKillId(HANGMAN_TREE, ROAD_SCAVENGER, GIANT_FUNGUS, DELU_LIZARDMAN_SHAMAN, DELU_CHIEF_KALKIS, NEER_BODYGUARD);
}
@@ -100,90 +94,89 @@ public class Q225_TestOfTheSearcher extends Quest
return htmltext;
}
- // LUTHER
- if (event.equals("30690-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LUTHER_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30690-05.htm":
{
- htmltext = "30690-05a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
- }
- }
- // ALEX
- else if (event.equals("30291-07.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LEIRYNN_REPORT, 1);
- st.takeItems(STRANGE_MAP, 1);
- st.giveItems(ALEX_LETTER, 1);
- st.giveItems(ALEX_ORDER, 1);
- st.giveItems(LAMBERT_MAP, 1);
- }
- // TYRA
- else if (event.equals("30420-01a.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WINE_CATALOG, 1);
- st.giveItems(TYRA_CONTRACT, 1);
- }
- // JAX
- else if (event.equals("30730-01d.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(OLD_ORDER, 1);
- st.giveItems(JAX_DIARY, 1);
- }
- // TREE
- else if (event.equals("30627-01a.htm"))
- {
- if (_strongWoodenChest == null)
- {
- if (st.getInt("cond") == 16)
+ st.startQuest();
+ st.giveItems(LUTHER_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
{
- st.set("cond", "17");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(RUSTED_KEY, 1);
+ htmltext = "30690-05a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
}
-
- _strongWoodenChest = addSpawn(STRONG_WOODEN_CHEST, 10098, 157287, -2406, 0, false, 0);
- startQuestTimer("chest_despawn", 300000, null, player, false);
+ break;
}
- }
- // STRONG WOODEN CHEST
- else if (event.equals("30628-01a.htm"))
- {
- if (!st.hasQuestItems(RUSTED_KEY))
+ case "30291-07.htm":
{
- htmltext = "30628-02.htm";
- }
- else
- {
- st.set("cond", "18");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RUSTED_KEY, -1);
- st.giveItems(GOLD_BAR, 20);
-
+ st.takeItems(LEIRYNN_REPORT, 1);
+ st.takeItems(STRANGE_MAP, 1);
+ st.giveItems(ALEX_LETTER, 1);
+ st.giveItems(ALEX_ORDER, 1);
+ st.giveItems(LAMBERT_MAP, 1);
+ break;
+ }
+ case "30420-01a.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WINE_CATALOG, 1);
+ st.giveItems(TYRA_CONTRACT, 1);
+ break;
+ }
+ case "30730-01d.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(OLD_ORDER, 1);
+ st.giveItems(JAX_DIARY, 1);
+ break;
+ }
+ case "30627-01a.htm":
+ {
+ if (_strongWoodenChest == null)
+ {
+ if (st.isCond(16))
+ {
+ st.setCond(17);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(RUSTED_KEY, 1);
+ }
+
+ _strongWoodenChest = addSpawn(STRONG_WOODEN_CHEST, 10098, 157287, -2406, 0, false, 0);
+ startQuestTimer("chest_despawn", 300000, null, player, false);
+ }
+ break;
+ }
+ case "30628-01a.htm":
+ {
+ if (!st.hasQuestItems(RUSTED_KEY))
+ {
+ htmltext = "30628-02.htm";
+ }
+ else
+ {
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RUSTED_KEY, -1);
+ st.giveItems(GOLD_BAR, 20);
+
+ _strongWoodenChest.deleteMe();
+ _strongWoodenChest = null;
+ cancelQuestTimer("chest_despawn", null, player);
+ }
+ break;
+ }
+ case "chest_despawn":
+ {
_strongWoodenChest.deleteMe();
_strongWoodenChest = null;
- cancelQuestTimer("chest_despawn", null, player);
+ return null;
}
}
- // STRONG WOODEN CHEST DESPAWN
- else if (event.equals("chest_despawn"))
- {
- _strongWoodenChest.deleteMe();
- _strongWoodenChest = null;
- return null;
- }
return htmltext;
}
@@ -201,6 +194,7 @@ public class Q225_TestOfTheSearcher extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.ROGUE) && (player.getClassId() != ClassId.ELVEN_SCOUT) && (player.getClassId() != ClassId.ASSASSIN) && (player.getClassId() != ClassId.SCAVENGER))
{
htmltext = "30690-01.htm";
@@ -214,12 +208,14 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = (player.getClassId() == ClassId.SCAVENGER) ? "30690-04.htm" : "30690-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LUTHER:
+ {
if (cond == 1)
{
htmltext = "30690-06.htm";
@@ -239,12 +235,13 @@ public class Q225_TestOfTheSearcher extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ALEX:
+ {
if (cond == 1)
{
htmltext = "30291-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LUTHER_LETTER, 1);
st.giveItems(ALEX_WARRANT, 1);
@@ -276,7 +273,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 18)
{
htmltext = "30291-11.htm";
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALEX_ORDER, 1);
st.takeItems(COMBINED_MAP, 1);
@@ -288,12 +285,13 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = "30291-12.htm";
}
break;
-
+ }
case LEIRYNN:
+ {
if (cond == 2)
{
htmltext = "30728-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALEX_WARRANT, 1);
st.giveItems(LEIRYNN_ORDER_1, 1);
@@ -305,7 +303,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 4)
{
htmltext = "30728-03.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DELU_TOTEM, -1);
st.takeItems(LEIRYNN_ORDER_1, 1);
@@ -318,7 +316,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 6)
{
htmltext = "30728-05.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CHIEF_KALKI_FANG, 1);
st.takeItems(LEIRYNN_ORDER_2, 1);
@@ -333,12 +331,13 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = "30728-07.htm";
}
break;
-
+ }
case BORYS:
+ {
if (cond == 8)
{
htmltext = "30729-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALEX_LETTER, 1);
st.giveItems(WINE_CATALOG, 1);
@@ -350,7 +349,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 12)
{
htmltext = "30729-03.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MALRUKIAN_WINE, 1);
st.takeItems(WINE_CATALOG, 1);
@@ -365,8 +364,9 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = "30729-05.htm";
}
break;
-
+ }
case TYRA:
+ {
if (cond == 9)
{
htmltext = "30420-01.htm";
@@ -378,7 +378,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 11)
{
htmltext = "30420-03.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RED_SPORE_DUST, -1);
st.takeItems(TYRA_CONTRACT, 1);
@@ -389,8 +389,9 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = "30420-04.htm";
}
break;
-
+ }
case JAX:
+ {
if (cond == 13)
{
htmltext = "30730-01.htm";
@@ -402,7 +403,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 15)
{
htmltext = "30730-03.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LAMBERT_MAP, 1);
st.takeItems(MAKEL_MAP, 1);
@@ -415,26 +416,31 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = "30730-04.htm";
}
break;
-
+ }
case TREE:
+ {
if ((cond == 16) || (cond == 17))
{
htmltext = "30627-01.htm";
}
break;
-
+ }
case STRONG_WOODEN_CHEST:
+ {
if (cond == 17)
{
htmltext = "30628-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -462,11 +468,11 @@ public class Q225_TestOfTheSearcher extends Quest
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
QuestState st;
-
switch (npc.getNpcId())
{
case DELU_LIZARDMAN_SHAMAN:
- st = checkPlayerCondition(player, npc, "cond", "3");
+ {
+ st = checkPlayerCondition(player, npc, 3);
if (st == null)
{
return null;
@@ -474,25 +480,27 @@ public class Q225_TestOfTheSearcher extends Quest
if (st.dropItemsAlways(DELU_TOTEM, 1, 10))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case DELU_CHIEF_KALKIS:
- st = checkPlayerCondition(player, npc, "cond", "5");
+ {
+ st = checkPlayerCondition(player, npc, 5);
if (st == null)
{
return null;
}
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(CHIEF_KALKI_FANG, 1);
st.giveItems(STRANGE_MAP, 1);
break;
-
+ }
case GIANT_FUNGUS:
- st = checkPlayerCondition(player, npc, "cond", "10");
+ {
+ st = checkPlayerCondition(player, npc, 10);
if (st == null)
{
return null;
@@ -500,12 +508,13 @@ public class Q225_TestOfTheSearcher extends Quest
if (st.dropItemsAlways(RED_SPORE_DUST, 1, 10))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case ROAD_SCAVENGER:
- st = checkPlayerCondition(player, npc, "cond", "14");
+ {
+ st = checkPlayerCondition(player, npc, 14);
if (st == null)
{
return null;
@@ -518,13 +527,14 @@ public class Q225_TestOfTheSearcher extends Quest
if (st.hasQuestItems(MAKEL_MAP))
{
- st.set("cond", "15");
+ st.setCond(15);
}
}
break;
-
+ }
case HANGMAN_TREE:
- st = checkPlayerCondition(player, npc, "cond", "14");
+ {
+ st = checkPlayerCondition(player, npc, 14);
if (st == null)
{
return null;
@@ -537,10 +547,11 @@ public class Q225_TestOfTheSearcher extends Quest
if (st.hasQuestItems(SOLT_MAP))
{
- st.set("cond", "15");
+ st.setCond(15);
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q226_TestOfTheHealer/Q226_TestOfTheHealer.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q226_TestOfTheHealer/Q226_TestOfTheHealer.java
index b34624f2f8..43ea779f86 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q226_TestOfTheHealer/Q226_TestOfTheHealer.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q226_TestOfTheHealer/Q226_TestOfTheHealer.java
@@ -27,22 +27,6 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q226_TestOfTheHealer extends Quest
{
- // Items
- private static final int REPORT_OF_PERRIN = 2810;
- private static final int KRISTINA_LETTER = 2811;
- private static final int PICTURE_OF_WINDY = 2812;
- private static final int GOLDEN_STATUE = 2813;
- private static final int WINDY_PEBBLES = 2814;
- private static final int ORDER_OF_SORIUS = 2815;
- private static final int SECRET_LETTER_1 = 2816;
- private static final int SECRET_LETTER_2 = 2817;
- private static final int SECRET_LETTER_3 = 2818;
- private static final int SECRET_LETTER_4 = 2819;
-
- // Rewards
- private static final int MARK_OF_HEALER = 2820;
- private static final int DIMENSIONAL_DIAMOND = 7562;
-
// NPCs
private static final int BANDELLOS = 30473;
private static final int SORIUS = 30327;
@@ -57,7 +41,6 @@ public class Q226_TestOfTheHealer extends Quest
private static final int KAIN_FLYING_KNIFE = 30664;
private static final int KRISTINA = 30665;
private static final int DAURIN_HAMMERCRUSH = 30674;
-
// Monsters
private static final int LETO_LIZARDMAN_LEADER = 27123;
private static final int LETO_LIZARDMAN_ASSASSIN = 27124;
@@ -65,19 +48,30 @@ public class Q226_TestOfTheHealer extends Quest
private static final int LETO_LIZARDMAN_WIZARD = 27126;
private static final int LETO_LIZARDMAN_LORD = 27127;
private static final int TATOMA = 27134;
-
+ // Items
+ private static final int REPORT_OF_PERRIN = 2810;
+ private static final int KRISTINA_LETTER = 2811;
+ private static final int PICTURE_OF_WINDY = 2812;
+ private static final int GOLDEN_STATUE = 2813;
+ private static final int WINDY_PEBBLES = 2814;
+ private static final int ORDER_OF_SORIUS = 2815;
+ private static final int SECRET_LETTER_1 = 2816;
+ private static final int SECRET_LETTER_2 = 2817;
+ private static final int SECRET_LETTER_3 = 2818;
+ private static final int SECRET_LETTER_4 = 2819;
+ // Rewards
+ private static final int MARK_OF_HEALER = 2820;
+ private static final int DIMENSIONAL_DIAMOND = 7562;
+ // Misc
private NpcInstance _tatoma;
private NpcInstance _letoLeader;
public Q226_TestOfTheHealer()
{
super(226, "Test of the Healer");
-
registerQuestItems(REPORT_OF_PERRIN, KRISTINA_LETTER, PICTURE_OF_WINDY, GOLDEN_STATUE, WINDY_PEBBLES, ORDER_OF_SORIUS, SECRET_LETTER_1, SECRET_LETTER_2, SECRET_LETTER_3, SECRET_LETTER_4);
-
addStartNpc(BANDELLOS);
addTalkId(BANDELLOS, SORIUS, ALLANA, PERRIN, GUPU, ORPHAN_GIRL, WINDY_SHAORING, MYSTERIOUS_DARKELF, PIPER_LONGBOW, SLEIN_SHINING_BLADE, KAIN_FLYING_KNIFE, KRISTINA, DAURIN_HAMMERCRUSH);
-
addKillId(LETO_LIZARDMAN_LEADER, LETO_LIZARDMAN_ASSASSIN, LETO_LIZARDMAN_SNIPER, LETO_LIZARDMAN_WIZARD, LETO_LIZARDMAN_LORD, TATOMA);
}
@@ -91,110 +85,110 @@ public class Q226_TestOfTheHealer extends Quest
return htmltext;
}
- // BANDELLOS
- if (event.equals("30473-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(REPORT_OF_PERRIN, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30473-04.htm":
{
- htmltext = "30473-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(REPORT_OF_PERRIN, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30473-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- else if (event.equals("30473-09.htm"))
- {
- st.takeItems(GOLDEN_STATUE, 1);
- st.giveItems(MARK_OF_HEALER, 1);
- st.rewardExpAndSp(134839, 50000);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- // PERRIN
- else if (event.equals("30428-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
-
- if (_tatoma == null)
+ case "30473-09.htm":
{
- _tatoma = addSpawn(TATOMA, -93254, 147559, -2679, 0, false, 0);
- startQuestTimer("tatoma_despawn", 200000, null, player, false);
+ st.takeItems(GOLDEN_STATUE, 1);
+ st.giveItems(MARK_OF_HEALER, 1);
+ st.rewardExpAndSp(134839, 50000);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
}
- }
- // GUPU
- else if (event.equals("30658-02.htm"))
- {
- if (st.getQuestItemsCount(57) >= 100000)
+ case "30428-02.htm":
{
- st.set("cond", "7");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(57, 100000);
- st.giveItems(PICTURE_OF_WINDY, 1);
+ if (_tatoma == null)
+ {
+ _tatoma = addSpawn(TATOMA, -93254, 147559, -2679, 0, false, 0);
+ startQuestTimer("tatoma_despawn", 200000, null, player, false);
+ }
+ break;
}
- else
+ case "30658-02.htm":
{
- htmltext = "30658-05.htm";
+ if (st.getQuestItemsCount(57) >= 100000)
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(57, 100000);
+ st.giveItems(PICTURE_OF_WINDY, 1);
+ }
+ else
+ {
+ htmltext = "30658-05.htm";
+ }
+ break;
}
- }
- else if (event.equals("30658-03.htm"))
- {
- st.set("gupu", "1");
- }
- else if (event.equals("30658-07.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // WINDY SHAORING
- else if (event.equals("30660-03.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PICTURE_OF_WINDY, 1);
- st.giveItems(WINDY_PEBBLES, 1);
- }
- // DAURIN HAMMERCRUSH
- else if (event.equals("30674-02.htm"))
- {
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_BEFORE_BATTLE);
- st.takeItems(ORDER_OF_SORIUS, 1);
-
- if (_letoLeader == null)
+ case "30658-03.htm":
{
- _letoLeader = addSpawn(LETO_LIZARDMAN_LEADER, -97441, 106585, -3405, 0, false, 0);
- startQuestTimer("leto_leader_despawn", 200000, null, player, false);
+ st.set("gupu", "1");
+ break;
+ }
+ case "30658-07.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30660-03.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PICTURE_OF_WINDY, 1);
+ st.giveItems(WINDY_PEBBLES, 1);
+ break;
+ }
+ case "30674-02.htm":
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_BEFORE_BATTLE);
+ st.takeItems(ORDER_OF_SORIUS, 1);
+ if (_letoLeader == null)
+ {
+ _letoLeader = addSpawn(LETO_LIZARDMAN_LEADER, -97441, 106585, -3405, 0, false, 0);
+ startQuestTimer("leto_leader_despawn", 200000, null, player, false);
+ }
+ break;
+ }
+ case "30665-02.htm":
+ {
+ st.setCond(22);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SECRET_LETTER_1, 1);
+ st.takeItems(SECRET_LETTER_2, 1);
+ st.takeItems(SECRET_LETTER_3, 1);
+ st.takeItems(SECRET_LETTER_4, 1);
+ st.giveItems(KRISTINA_LETTER, 1);
+ break;
+ }
+ case "tatoma_despawn":
+ {
+ _tatoma.deleteMe();
+ _tatoma = null;
+ return null;
+ }
+ case "leto_leader_despawn":
+ {
+ _letoLeader.deleteMe();
+ _letoLeader = null;
+ return null;
}
- }
- // KRISTINA
- else if (event.equals("30665-02.htm"))
- {
- st.set("cond", "22");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SECRET_LETTER_1, 1);
- st.takeItems(SECRET_LETTER_2, 1);
- st.takeItems(SECRET_LETTER_3, 1);
- st.takeItems(SECRET_LETTER_4, 1);
- st.giveItems(KRISTINA_LETTER, 1);
- }
- // DESPAWNS
- else if (event.equals("tatoma_despawn"))
- {
- _tatoma.deleteMe();
- _tatoma = null;
- return null;
- }
- else if (event.equals("leto_leader_despawn"))
- {
- _letoLeader.deleteMe();
- _letoLeader = null;
- return null;
}
return htmltext;
@@ -213,6 +207,7 @@ public class Q226_TestOfTheHealer extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.KNIGHT) && (player.getClassId() != ClassId.ELVEN_KNIGHT) && (player.getClassId() != ClassId.CLERIC) && (player.getClassId() != ClassId.ORACLE))
{
htmltext = "30473-01.htm";
@@ -226,12 +221,14 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30473-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BANDELLOS:
+ {
if (cond < 23)
{
htmltext = "30473-05.htm";
@@ -253,8 +250,9 @@ public class Q226_TestOfTheHealer extends Quest
}
}
break;
-
+ }
case PERRIN:
+ {
if (cond < 3)
{
htmltext = "30428-01.htm";
@@ -262,7 +260,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 3)
{
htmltext = "30428-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REPORT_OF_PERRIN, 1);
}
@@ -271,16 +269,18 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30428-04.htm";
}
break;
-
+ }
case ORPHAN_GIRL:
+ {
htmltext = "30659-0" + Rnd.get(1, 5) + ".htm";
break;
-
+ }
case ALLANA:
+ {
if (cond == 4)
{
htmltext = "30424-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond > 4)
@@ -288,18 +288,19 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30424-02.htm";
}
break;
-
+ }
case GUPU:
+ {
if ((st.getInt("gupu") == 1) && (cond != 9))
{
htmltext = "30658-07.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
{
htmltext = "30658-01.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 6)
@@ -322,8 +323,9 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30658-07.htm";
}
break;
-
+ }
case WINDY_SHAORING:
+ {
if (cond == 7)
{
htmltext = "30660-01.htm";
@@ -333,12 +335,13 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30660-04.htm";
}
break;
-
+ }
case SORIUS:
+ {
if (cond == 9)
{
htmltext = "30327-01.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(ORDER_OF_SORIUS, 1);
}
@@ -349,7 +352,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 22)
{
htmltext = "30327-03.htm";
- st.set("cond", "23");
+ st.setCond(23);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KRISTINA_LETTER, 1);
}
@@ -358,8 +361,9 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30327-04.htm";
}
break;
-
+ }
case DAURIN_HAMMERCRUSH:
+ {
if (cond == 10)
{
htmltext = "30674-01.htm";
@@ -376,7 +380,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 12)
{
htmltext = "30674-03.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond > 12)
@@ -384,10 +388,11 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30674-04.htm";
}
break;
-
+ }
case PIPER_LONGBOW:
case SLEIN_SHINING_BLADE:
case KAIN_FLYING_KNIFE:
+ {
if ((cond == 13) || (cond == 14))
{
htmltext = npc.getNpcId() + "-01.htm";
@@ -399,16 +404,17 @@ public class Q226_TestOfTheHealer extends Quest
else if ((cond > 18) && (cond < 22))
{
htmltext = npc.getNpcId() + "-03.htm";
- st.set("cond", "21");
+ st.setCond(21);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
-
+ }
case MYSTERIOUS_DARKELF:
+ {
if (cond == 13)
{
htmltext = "30661-01.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
addSpawn(LETO_LIZARDMAN_ASSASSIN, player, true, 0);
addSpawn(LETO_LIZARDMAN_ASSASSIN, player, true, 0);
@@ -421,7 +427,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 15)
{
htmltext = "30661-02.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
addSpawn(LETO_LIZARDMAN_SNIPER, player, true, 0);
addSpawn(LETO_LIZARDMAN_SNIPER, player, true, 0);
@@ -434,7 +440,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 17)
{
htmltext = "30661-03.htm";
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
addSpawn(LETO_LIZARDMAN_WIZARD, player, true, 0);
addSpawn(LETO_LIZARDMAN_WIZARD, player, true, 0);
@@ -447,7 +453,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 19)
{
htmltext = "30661-04.htm";
- st.set("cond", "20");
+ st.setCond(20);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if ((cond == 20) || (cond == 21))
@@ -455,8 +461,9 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30661-04.htm";
}
break;
-
+ }
case KRISTINA:
+ {
if ((cond > 18) && (cond < 22))
{
htmltext = "30665-01.htm";
@@ -470,12 +477,15 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30665-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -490,56 +500,62 @@ public class Q226_TestOfTheHealer extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case TATOMA:
+ {
if ((cond == 1) || (cond == 2))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
_tatoma = null;
cancelQuestTimer("tatoma_despawn", null, player);
break;
-
+ }
case LETO_LIZARDMAN_LEADER:
+ {
if ((cond == 10) || (cond == 11))
{
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SECRET_LETTER_1, 1);
}
_letoLeader = null;
cancelQuestTimer("leto_leader_despawn", null, player);
break;
-
+ }
case LETO_LIZARDMAN_ASSASSIN:
+ {
if ((cond == 13) || (cond == 14))
{
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SECRET_LETTER_2, 1);
}
break;
-
+ }
case LETO_LIZARDMAN_SNIPER:
+ {
if ((cond == 15) || (cond == 16))
{
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SECRET_LETTER_3, 1);
}
break;
-
+ }
case LETO_LIZARDMAN_LORD:
+ {
if ((cond == 17) || (cond == 18))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SECRET_LETTER_4, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q227_TestOfTheReformer/Q227_TestOfTheReformer.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q227_TestOfTheReformer/Q227_TestOfTheReformer.java
index 1af359dc11..35a9ee11b4 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q227_TestOfTheReformer/Q227_TestOfTheReformer.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q227_TestOfTheReformer/Q227_TestOfTheReformer.java
@@ -29,6 +29,26 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q227_TestOfTheReformer extends Quest
{
+ // NPCs
+ private static final int PUPINA = 30118;
+ private static final int SLA = 30666;
+ private static final int RAMUS = 30667;
+ private static final int KATARI = 30668;
+ private static final int KAKAN = 30669;
+ private static final int NYAKURI = 30670;
+ private static final int OL_MAHUM_PILGRIM = 30732;
+ // Monsters
+ private static final int MISERY_SKELETON = 20022;
+ private static final int SKELETON_ARCHER = 20100;
+ private static final int SKELETON_MARKSMAN = 20102;
+ private static final int SKELETON_LORD = 20104;
+ private static final int SILENT_HORROR = 20404;
+ private static final int NAMELESS_REVENANT = 27099;
+ private static final int ARURAUNE = 27128;
+ private static final int OL_MAHUM_INSPECTOR = 27129;
+ private static final int OL_MAHUM_BETRAYER = 27130;
+ private static final int CRIMSON_WEREWOLF = 27131;
+ private static final int KRUDEL_LIZARDMAN = 27132;
// Items
private static final int BOOK_OF_REFORM = 2822;
private static final int LETTER_OF_INTRODUCTION = 2823;
@@ -49,57 +69,27 @@ public class Q227_TestOfTheReformer extends Quest
private static final int BONE_FRAGMENT_8 = 2838;
private static final int BONE_FRAGMENT_9 = 2839;
private static final int KAKAN_LETTER = 3037;
-
// Rewards
private static final int MARK_OF_REFORMER = 2821;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // NPCs
- private static final int PUPINA = 30118;
- private static final int SLA = 30666;
- private static final int RAMUS = 30667;
- private static final int KATARI = 30668;
- private static final int KAKAN = 30669;
- private static final int NYAKURI = 30670;
- private static final int OL_MAHUM_PILGRIM = 30732;
-
- // Monsters
- private static final int MISERY_SKELETON = 20022;
- private static final int SKELETON_ARCHER = 20100;
- private static final int SKELETON_MARKSMAN = 20102;
- private static final int SKELETON_LORD = 20104;
- private static final int SILENT_HORROR = 20404;
- private static final int NAMELESS_REVENANT = 27099;
- private static final int ARURAUNE = 27128;
- private static final int OL_MAHUM_INSPECTOR = 27129;
- private static final int OL_MAHUM_BETRAYER = 27130;
- private static final int CRIMSON_WEREWOLF = 27131;
- private static final int KRUDEL_LIZARDMAN = 27132;
-
// Checks & Instances
private static long _timer;
-
+ // Misc
private static NpcInstance _olMahumInspector;
private static NpcInstance _olMahumPilgrim;
private static NpcInstance _olMahumBetrayer;
-
private static boolean _crimsonWerewolf = false;
private static boolean _krudelLizardman = false;
// Allowed skills when attacking Crimson Werewolf
- /*
- * private static final int[] ALLOWED_SKILLS = { 1031, 1069, 1164, 1168, 1147, 1177, 1184, 1201, 1206 };
- */
+ // private static final int[] ALLOWED_SKILLS = { 1031, 1069, 1164, 1168, 1147, 1177, 1184, 1201, 1206 };
public Q227_TestOfTheReformer()
{
super(227, "Test of the Reformer");
-
registerQuestItems(BOOK_OF_REFORM, LETTER_OF_INTRODUCTION, SLA_LETTER, GREETINGS, OL_MAHUM_MONEY, KATARI_LETTER, NYAKURI_LETTER, UNDEAD_LIST, RAMUS_LETTER, RIPPED_DIARY, HUGE_NAIL, LETTER_OF_BETRAYER, BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_7, BONE_FRAGMENT_8, BONE_FRAGMENT_9, KAKAN_LETTER);
-
addStartNpc(PUPINA);
addTalkId(PUPINA, SLA, RAMUS, KATARI, KAKAN, NYAKURI, OL_MAHUM_PILGRIM);
-
addAttackId(NAMELESS_REVENANT, CRIMSON_WEREWOLF);
addKillId(MISERY_SKELETON, SKELETON_ARCHER, SKELETON_MARKSMAN, SKELETON_LORD, SILENT_HORROR, NAMELESS_REVENANT, ARURAUNE, OL_MAHUM_INSPECTOR, OL_MAHUM_BETRAYER, CRIMSON_WEREWOLF, KRUDEL_LIZARDMAN);
}
@@ -114,123 +104,117 @@ public class Q227_TestOfTheReformer extends Quest
return htmltext;
}
- // PUPINA
- if (event.equals("30118-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(BOOK_OF_REFORM, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30118-04.htm":
{
- htmltext = "30118-04b.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(BOOK_OF_REFORM, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30118-04b.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- else if (event.equals("30118-06.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BOOK_OF_REFORM, 1);
- st.takeItems(HUGE_NAIL, 1);
- st.giveItems(LETTER_OF_INTRODUCTION, 1);
- }
- // SLA
- else if (event.equals("30666-04.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_OF_INTRODUCTION, 1);
- st.giveItems(SLA_LETTER, 1);
- }
- // KAKAN
- else if (event.equals("30669-03.htm"))
- {
- if (st.getInt("cond") != 12)
+ case "30118-06.htm":
{
- st.set("cond", "12");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BOOK_OF_REFORM, 1);
+ st.takeItems(HUGE_NAIL, 1);
+ st.giveItems(LETTER_OF_INTRODUCTION, 1);
+ break;
}
-
- if (!_crimsonWerewolf)
+ case "30666-04.htm":
{
- addSpawn(CRIMSON_WEREWOLF, -9382, -89852, -2333, 0, false, 299000);
- _crimsonWerewolf = true;
-
- // Resets Crimson Werewolf
- startQuestTimer("werewolf_cleanup", 300000, null, player, false);
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_OF_INTRODUCTION, 1);
+ st.giveItems(SLA_LETTER, 1);
+ break;
}
- }
- // NYAKURI
- else if (event.equals("30670-03.htm"))
- {
- st.set("cond", "15");
- st.playSound(QuestState.SOUND_MIDDLE);
- if (!_krudelLizardman)
+ case "30669-03.htm":
{
- addSpawn(KRUDEL_LIZARDMAN, 126019, -179983, -1781, 0, false, 299000);
- _krudelLizardman = true;
-
- // Resets Krudel Lizardman
- startQuestTimer("lizardman_cleanup", 300000, null, player, false);
- }
- }
- // Despawns Crimson Werewolf
- else if (event.equals("werewolf_despawn"))
- {
- npc.abortAttack();
- npc.broadcastNpcSay("Cowardly guy!");
- npc.decayMe();
- _crimsonWerewolf = false;
- cancelQuestTimer("werewolf_cleanup", null, player);
- return null;
- }
- // Despawns
- else if (event.equals("ol_mahums_despawn"))
- {
- _timer++;
-
- if ((st.getInt("cond") == 8) || (_timer >= 60))
- {
- if (_olMahumPilgrim != null)
+ if (!st.isCond(12))
{
- _olMahumPilgrim.deleteMe();
- _olMahumPilgrim = null;
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
}
-
- if (_olMahumInspector != null)
+ if (!_crimsonWerewolf)
{
- _olMahumInspector.deleteMe();
- _olMahumInspector = null;
+ addSpawn(CRIMSON_WEREWOLF, -9382, -89852, -2333, 0, false, 299000);
+ _crimsonWerewolf = true;
+
+ // Resets Crimson Werewolf
+ startQuestTimer("werewolf_cleanup", 300000, null, player, false);
}
- cancelQuestTimer("ol_mahums_despawn", null, player);
- _timer = 0;
+ break;
}
-
- return null;
- }
- else if (event.equals("betrayer_despawn"))
- {
- if (_olMahumBetrayer != null)
+ case "30670-03.htm":
{
- _olMahumBetrayer.deleteMe();
- _olMahumBetrayer = null;
+ st.setCond(15);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ if (!_krudelLizardman)
+ {
+ addSpawn(KRUDEL_LIZARDMAN, 126019, -179983, -1781, 0, false, 299000);
+ _krudelLizardman = true;
+
+ // Resets Krudel Lizardman
+ startQuestTimer("lizardman_cleanup", 300000, null, player, false);
+ }
+ break;
+ }
+ case "werewolf_despawn":
+ {
+ npc.abortAttack();
+ npc.broadcastNpcSay("Cowardly guy!");
+ npc.decayMe();
+ _crimsonWerewolf = false;
+ cancelQuestTimer("werewolf_cleanup", null, player);
+ return null;
+ }
+ case "ol_mahums_despawn":
+ {
+ _timer++;
+ if (st.isCond(8) || (_timer >= 60))
+ {
+ if (_olMahumPilgrim != null)
+ {
+ _olMahumPilgrim.deleteMe();
+ _olMahumPilgrim = null;
+ }
+
+ if (_olMahumInspector != null)
+ {
+ _olMahumInspector.deleteMe();
+ _olMahumInspector = null;
+ }
+ cancelQuestTimer("ol_mahums_despawn", null, player);
+ _timer = 0;
+ }
+ return null;
+ }
+ case "betrayer_despawn":
+ {
+ if (_olMahumBetrayer != null)
+ {
+ _olMahumBetrayer.deleteMe();
+ _olMahumBetrayer = null;
+ }
+ return null;
+ }
+ case "werewolf_cleanup":
+ {
+ _crimsonWerewolf = false;
+ return null;
+ }
+ case "lizardman_cleanup":
+ {
+ _krudelLizardman = false;
+ return null;
}
-
- return null;
- }
- // Clean ups
- else if (event.equals("werewolf_cleanup"))
- {
- _crimsonWerewolf = false;
- return null;
- }
- else if (event.equals("lizardman_cleanup"))
- {
- _krudelLizardman = false;
- return null;
}
return htmltext;
@@ -249,6 +233,7 @@ public class Q227_TestOfTheReformer extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() == ClassId.CLERIC) || (player.getClassId() == ClassId.SHILLIEN_ORACLE))
{
htmltext = (player.getLevel() < 39) ? "30118-01.htm" : "30118-03.htm";
@@ -258,12 +243,14 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30118-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case PUPINA:
+ {
if (cond < 3)
{
htmltext = "30118-04a.htm";
@@ -277,8 +264,9 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30118-07.htm";
}
break;
-
+ }
case SLA:
+ {
if (cond == 4)
{
htmltext = "30666-01.htm";
@@ -290,7 +278,7 @@ public class Q227_TestOfTheReformer extends Quest
else if (cond == 10)
{
htmltext = "30666-06.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(OL_MAHUM_MONEY, 1);
st.giveItems(GREETINGS, 3);
@@ -313,15 +301,16 @@ public class Q227_TestOfTheReformer extends Quest
st.exitQuest(false);
}
break;
-
+ }
case KATARI:
+ {
if ((cond == 5) || (cond == 6))
{
htmltext = "30668-01.htm";
if (cond == 5)
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SLA_LETTER, 1);
}
@@ -371,7 +360,7 @@ public class Q227_TestOfTheReformer extends Quest
else if (cond == 9)
{
htmltext = "30668-03.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LETTER_OF_BETRAYER, 1);
st.giveItems(KATARI_LETTER, 1);
@@ -381,18 +370,20 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30668-04.htm";
}
break;
-
+ }
case OL_MAHUM_PILGRIM:
+ {
if (cond == 7)
{
htmltext = "30732-01.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(OL_MAHUM_MONEY, 1);
}
break;
-
+ }
case KAKAN:
+ {
if ((cond == 11) || (cond == 12))
{
htmltext = "30669-01.htm";
@@ -400,7 +391,7 @@ public class Q227_TestOfTheReformer extends Quest
else if (cond == 13)
{
htmltext = "30669-04.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GREETINGS, 1);
st.giveItems(KAKAN_LETTER, 1);
@@ -410,8 +401,9 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30669-04.htm";
}
break;
-
+ }
case NYAKURI:
+ {
if ((cond == 14) || (cond == 15))
{
htmltext = "30670-01.htm";
@@ -419,7 +411,7 @@ public class Q227_TestOfTheReformer extends Quest
else if (cond == 16)
{
htmltext = "30670-04.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GREETINGS, 1);
st.giveItems(NYAKURI_LETTER, 1);
@@ -429,12 +421,13 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30670-04.htm";
}
break;
-
+ }
case RAMUS:
+ {
if (cond == 17)
{
htmltext = "30667-01.htm";
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GREETINGS, 1);
st.giveItems(UNDEAD_LIST, 1);
@@ -446,7 +439,7 @@ public class Q227_TestOfTheReformer extends Quest
else if (cond == 19)
{
htmltext = "30667-03.htm";
- st.set("cond", "20");
+ st.setCond(20);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BONE_FRAGMENT_4, 1);
st.takeItems(BONE_FRAGMENT_5, 1);
@@ -461,12 +454,15 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30667-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -481,18 +477,20 @@ public class Q227_TestOfTheReformer extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NAMELESS_REVENANT:
+ {
// TODO: if (((cond == 1) || (cond == 2)) && (skill != null) && (skill.getId() == 1031))
if ((cond == 1) || (cond == 2))
{
npc.setScriptValue(1);
}
break;
-
+ }
case CRIMSON_WEREWOLF:
+ {
// TODO: if ((cond == 12) && !npc.isScriptValue(1) && ((skill == null) || !ArraysUtil.contains(ALLOWED_SKILLS, skill.getId())))
if ((cond == 12) && !npc.isScriptValue(1))
{
@@ -500,6 +498,7 @@ public class Q227_TestOfTheReformer extends Quest
startQuestTimer("werewolf_despawn", 1000, npc, attacker, false);
}
break;
+ }
}
return null;
@@ -514,74 +513,81 @@ public class Q227_TestOfTheReformer extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NAMELESS_REVENANT:
+ {
if (((cond == 1) || (cond == 2)) && npc.isScriptValue(1) && st.dropItemsAlways(RIPPED_DIARY, 1, 7))
{
- st.set("cond", "2");
+ st.setCond(2);
st.takeItems(RIPPED_DIARY, -1);
addSpawn(ARURAUNE, npc, false, 300000);
}
break;
-
+ }
case ARURAUNE:
+ {
if (cond == 2)
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HUGE_NAIL, 1);
npc.broadcastNpcSay("The concealed truth will always be revealed...!");
}
break;
-
+ }
case OL_MAHUM_INSPECTOR:
+ {
if (cond == 6)
{
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
-
+ }
case OL_MAHUM_BETRAYER:
+ {
if (cond == 8)
{
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LETTER_OF_BETRAYER, 1);
cancelQuestTimer("betrayer_despawn", null, player);
_olMahumBetrayer = null;
}
break;
-
+ }
case CRIMSON_WEREWOLF:
+ {
if (cond == 12)
{
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
cancelQuestTimer("werewolf_cleanup", null, player);
_crimsonWerewolf = false;
}
break;
-
+ }
case KRUDEL_LIZARDMAN:
+ {
if (cond == 15)
{
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
cancelQuestTimer("lizardman_cleanup", null, player);
_krudelLizardman = false;
}
break;
-
+ }
case SILENT_HORROR:
+ {
if ((cond == 18) && !st.hasQuestItems(BONE_FRAGMENT_4))
{
st.giveItems(BONE_FRAGMENT_4, 1);
if (st.hasQuestItems(BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_7, BONE_FRAGMENT_8))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -590,14 +596,15 @@ public class Q227_TestOfTheReformer extends Quest
}
}
break;
-
+ }
case SKELETON_LORD:
+ {
if ((cond == 18) && !st.hasQuestItems(BONE_FRAGMENT_5))
{
st.giveItems(BONE_FRAGMENT_5, 1);
if (st.hasQuestItems(BONE_FRAGMENT_4, BONE_FRAGMENT_6, BONE_FRAGMENT_7, BONE_FRAGMENT_8))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -606,14 +613,15 @@ public class Q227_TestOfTheReformer extends Quest
}
}
break;
-
+ }
case SKELETON_MARKSMAN:
+ {
if ((cond == 18) && !st.hasQuestItems(BONE_FRAGMENT_6))
{
st.giveItems(BONE_FRAGMENT_6, 1);
if (st.hasQuestItems(BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_7, BONE_FRAGMENT_8))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -622,14 +630,15 @@ public class Q227_TestOfTheReformer extends Quest
}
}
break;
-
+ }
case MISERY_SKELETON:
+ {
if ((cond == 18) && !st.hasQuestItems(BONE_FRAGMENT_7))
{
st.giveItems(BONE_FRAGMENT_7, 1);
if (st.hasQuestItems(BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_8))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -638,14 +647,15 @@ public class Q227_TestOfTheReformer extends Quest
}
}
break;
-
+ }
case SKELETON_ARCHER:
+ {
if ((cond == 18) && !st.hasQuestItems(BONE_FRAGMENT_8))
{
st.giveItems(BONE_FRAGMENT_8, 1);
if (st.hasQuestItems(BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_7))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -654,6 +664,7 @@ public class Q227_TestOfTheReformer extends Quest
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q228_TestOfMagus/Q228_TestOfMagus.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q228_TestOfMagus/Q228_TestOfMagus.java
index 58c47ac955..e25c3a8f17 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q228_TestOfMagus/Q228_TestOfMagus.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q228_TestOfMagus/Q228_TestOfMagus.java
@@ -26,6 +26,30 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q228_TestOfMagus extends Quest
{
+ // NPCs
+ private static final int PARINA = 30391;
+ private static final int EARTH_SNAKE = 30409;
+ private static final int FLAME_SALAMANDER = 30411;
+ private static final int WIND_SYLPH = 30412;
+ private static final int WATER_UNDINE = 30413;
+ private static final int CASIAN = 30612;
+ private static final int RUKAL = 30629;
+ // Monsters
+ private static final int HARPY = 20145;
+ private static final int MARSH_STAKATO = 20157;
+ private static final int WYRM = 20176;
+ private static final int MARSH_STAKATO_WORKER = 20230;
+ private static final int TOAD_LORD = 20231;
+ private static final int MARSH_STAKATO_SOLDIER = 20232;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int WINDSUS = 20553;
+ private static final int ENCHANTED_MONSTEREYE = 20564;
+ private static final int ENCHANTED_STONE_GOLEM = 20565;
+ private static final int ENCHANTED_IRON_GOLEM = 20566;
+ private static final int SINGING_FLOWER_PHANTASM = 27095;
+ private static final int SINGING_FLOWER_NIGHTMARE = 27096;
+ private static final int SINGING_FLOWER_DARKLING = 27097;
+ private static final int GHOST_FIRE = 27098;
// Items
private static final int RUKAL_LETTER = 2841;
private static final int PARINA_LETTER = 2842;
@@ -50,46 +74,16 @@ public class Q228_TestOfMagus extends Quest
private static final int SYLPH_CHARM = 2861;
private static final int UNDINE_CHARM = 2862;
private static final int SERPENT_CHARM = 2863;
-
// Rewards
private static final int MARK_OF_MAGUS = 2840;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int PARINA = 30391;
- private static final int EARTH_SNAKE = 30409;
- private static final int FLAME_SALAMANDER = 30411;
- private static final int WIND_SYLPH = 30412;
- private static final int WATER_UNDINE = 30413;
- private static final int CASIAN = 30612;
- private static final int RUKAL = 30629;
-
- // Monsters
- private static final int HARPY = 20145;
- private static final int MARSH_STAKATO = 20157;
- private static final int WYRM = 20176;
- private static final int MARSH_STAKATO_WORKER = 20230;
- private static final int TOAD_LORD = 20231;
- private static final int MARSH_STAKATO_SOLDIER = 20232;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int WINDSUS = 20553;
- private static final int ENCHANTED_MONSTEREYE = 20564;
- private static final int ENCHANTED_STONE_GOLEM = 20565;
- private static final int ENCHANTED_IRON_GOLEM = 20566;
- private static final int SINGING_FLOWER_PHANTASM = 27095;
- private static final int SINGING_FLOWER_NIGHTMARE = 27096;
- private static final int SINGING_FLOWER_DARKLING = 27097;
- private static final int GHOST_FIRE = 27098;
-
public Q228_TestOfMagus()
{
super(228, "Test of Magus");
-
registerQuestItems(RUKAL_LETTER, PARINA_LETTER, LILAC_CHARM, GOLDEN_SEED_1, GOLDEN_SEED_2, GOLDEN_SEED_3, SCORE_OF_ELEMENTS, DAZZLING_DROP, FLAME_CRYSTAL, HARPY_FEATHER, WYRM_WINGBONE, WINDSUS_MANE, EN_MONSTEREYE_SHELL, EN_STONEGOLEM_POWDER, EN_IRONGOLEM_SCRAP, TONE_OF_WATER, TONE_OF_FIRE, TONE_OF_WIND, TONE_OF_EARTH, SALAMANDER_CHARM, SYLPH_CHARM, UNDINE_CHARM, SERPENT_CHARM);
-
addStartNpc(RUKAL);
addTalkId(PARINA, EARTH_SNAKE, FLAME_SALAMANDER, WIND_SYLPH, WATER_UNDINE, CASIAN, RUKAL);
-
addKillId(HARPY, MARSH_STAKATO, WYRM, MARSH_STAKATO_WORKER, TOAD_LORD, MARSH_STAKATO_SOLDIER, MARSH_STAKATO_DRONE, WINDSUS, ENCHANTED_MONSTEREYE, ENCHANTED_STONE_GOLEM, ENCHANTED_IRON_GOLEM, SINGING_FLOWER_PHANTASM, SINGING_FLOWER_NIGHTMARE, SINGING_FLOWER_DARKLING, GHOST_FIRE);
}
@@ -103,58 +97,59 @@ public class Q228_TestOfMagus extends Quest
return htmltext;
}
- // RUKAL
- if (event.equals("30629-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(RUKAL_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30629-04.htm":
{
- htmltext = "30629-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(RUKAL_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30629-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
+ }
+ case "30629-10.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GOLDEN_SEED_1, 1);
+ st.takeItems(GOLDEN_SEED_2, 1);
+ st.takeItems(GOLDEN_SEED_3, 1);
+ st.takeItems(LILAC_CHARM, 1);
+ st.giveItems(SCORE_OF_ELEMENTS, 1);
+ break;
+ }
+ case "30391-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RUKAL_LETTER, 1);
+ st.giveItems(PARINA_LETTER, 1);
+ break;
+ }
+ case "30612-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PARINA_LETTER, 1);
+ st.giveItems(LILAC_CHARM, 1);
+ break;
+ }
+ case "30412-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(SYLPH_CHARM, 1);
+ break;
+ }
+ case "30409-03.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(SERPENT_CHARM, 1);
+ break;
}
- }
- else if (event.equals("30629-10.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GOLDEN_SEED_1, 1);
- st.takeItems(GOLDEN_SEED_2, 1);
- st.takeItems(GOLDEN_SEED_3, 1);
- st.takeItems(LILAC_CHARM, 1);
- st.giveItems(SCORE_OF_ELEMENTS, 1);
- }
- // PARINA
- else if (event.equals("30391-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RUKAL_LETTER, 1);
- st.giveItems(PARINA_LETTER, 1);
- }
- // CASIAN
- else if (event.equals("30612-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PARINA_LETTER, 1);
- st.giveItems(LILAC_CHARM, 1);
- }
- // WIND SYLPH
- else if (event.equals("30412-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(SYLPH_CHARM, 1);
- }
- // EARTH SNAKE
- else if (event.equals("30409-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(SERPENT_CHARM, 1);
}
return htmltext;
@@ -173,6 +168,7 @@ public class Q228_TestOfMagus extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.WIZARD) && (player.getClassId() != ClassId.ELVEN_WIZARD) && (player.getClassId() != ClassId.DARK_WIZARD))
{
htmltext = "30629-01.htm";
@@ -186,12 +182,14 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30629-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case RUKAL:
+ {
if (cond == 1)
{
htmltext = "30629-05.htm";
@@ -227,8 +225,9 @@ public class Q228_TestOfMagus extends Quest
st.exitQuest(false);
}
break;
-
+ }
case PARINA:
+ {
if (cond == 1)
{
htmltext = "30391-01.htm";
@@ -246,8 +245,9 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30391-05.htm";
}
break;
-
+ }
case CASIAN:
+ {
if (cond == 2)
{
htmltext = "30612-01.htm";
@@ -265,8 +265,9 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30612-05.htm";
}
break;
-
+ }
case WATER_UNDINE:
+ {
if (cond == 5)
{
if (st.hasQuestItems(UNDINE_CHARM))
@@ -284,7 +285,7 @@ public class Q228_TestOfMagus extends Quest
if (st.hasQuestItems(TONE_OF_FIRE, TONE_OF_WIND, TONE_OF_EARTH))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -309,8 +310,9 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30413-04.htm";
}
break;
-
+ }
case FLAME_SALAMANDER:
+ {
if (cond == 5)
{
if (st.hasQuestItems(SALAMANDER_CHARM))
@@ -328,7 +330,7 @@ public class Q228_TestOfMagus extends Quest
if (st.hasQuestItems(TONE_OF_WATER, TONE_OF_WIND, TONE_OF_EARTH))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -352,8 +354,9 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30411-04.htm";
}
break;
-
+ }
case WIND_SYLPH:
+ {
if (cond == 5)
{
if (st.hasQuestItems(SYLPH_CHARM))
@@ -373,7 +376,7 @@ public class Q228_TestOfMagus extends Quest
if (st.hasQuestItems(TONE_OF_WATER, TONE_OF_FIRE, TONE_OF_EARTH))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -396,8 +399,9 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30412-05.htm";
}
break;
-
+ }
case EARTH_SNAKE:
+ {
if (cond == 5)
{
if (st.hasQuestItems(SERPENT_CHARM))
@@ -417,7 +421,7 @@ public class Q228_TestOfMagus extends Quest
if (st.hasQuestItems(TONE_OF_WATER, TONE_OF_FIRE, TONE_OF_WIND))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -440,12 +444,15 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30409-06.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -460,47 +467,50 @@ public class Q228_TestOfMagus extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
+ final int cond = st.getCond();
if (cond == 3)
{
switch (npc.getNpcId())
{
case SINGING_FLOWER_PHANTASM:
+ {
if (!st.hasQuestItems(GOLDEN_SEED_1))
{
npc.broadcastNpcSay("I am a tree of nothing... a tree... that knows where to return...");
st.dropItemsAlways(GOLDEN_SEED_1, 1, 1);
if (st.hasQuestItems(GOLDEN_SEED_2, GOLDEN_SEED_3))
{
- st.set("cond", "4");
+ st.setCond(4);
}
}
break;
-
+ }
case SINGING_FLOWER_NIGHTMARE:
+ {
if (!st.hasQuestItems(GOLDEN_SEED_2))
{
npc.broadcastNpcSay("I am a creature that shows the truth of the place deep in my heart...");
st.dropItemsAlways(GOLDEN_SEED_2, 1, 1);
if (st.hasQuestItems(GOLDEN_SEED_1, GOLDEN_SEED_3))
{
- st.set("cond", "4");
+ st.setCond(4);
}
}
break;
-
+ }
case SINGING_FLOWER_DARKLING:
+ {
if (!st.hasQuestItems(GOLDEN_SEED_3))
{
npc.broadcastNpcSay("I am a mirror of darkness... a virtual image of darkness...");
st.dropItemsAlways(GOLDEN_SEED_3, 1, 1);
if (st.hasQuestItems(GOLDEN_SEED_1, GOLDEN_SEED_2))
{
- st.set("cond", "4");
+ st.setCond(4);
}
}
break;
+ }
}
}
else if (cond == 5)
@@ -508,76 +518,87 @@ public class Q228_TestOfMagus extends Quest
switch (npc.getNpcId())
{
case GHOST_FIRE:
+ {
if (st.hasQuestItems(SALAMANDER_CHARM))
{
st.dropItems(FLAME_CRYSTAL, 1, 5, 500000);
}
break;
-
+ }
case TOAD_LORD:
case MARSH_STAKATO:
case MARSH_STAKATO_WORKER:
+ {
if (st.hasQuestItems(UNDINE_CHARM))
{
st.dropItems(DAZZLING_DROP, 1, 20, 300000);
}
break;
-
+ }
case MARSH_STAKATO_SOLDIER:
+ {
if (st.hasQuestItems(UNDINE_CHARM))
{
st.dropItems(DAZZLING_DROP, 1, 20, 400000);
}
break;
-
+ }
case MARSH_STAKATO_DRONE:
+ {
if (st.hasQuestItems(UNDINE_CHARM))
{
st.dropItems(DAZZLING_DROP, 1, 20, 500000);
}
break;
-
+ }
case HARPY:
+ {
if (st.hasQuestItems(SYLPH_CHARM))
{
st.dropItemsAlways(HARPY_FEATHER, 1, 20);
}
break;
-
+ }
case WYRM:
+ {
if (st.hasQuestItems(SYLPH_CHARM))
{
st.dropItems(WYRM_WINGBONE, 1, 10, 500000);
}
break;
-
+ }
case WINDSUS:
+ {
if (st.hasQuestItems(SYLPH_CHARM))
{
st.dropItems(WINDSUS_MANE, 1, 10, 500000);
}
break;
-
+ }
case ENCHANTED_MONSTEREYE:
+ {
if (st.hasQuestItems(SERPENT_CHARM))
{
st.dropItemsAlways(EN_MONSTEREYE_SHELL, 1, 10);
}
break;
-
+ }
case ENCHANTED_STONE_GOLEM:
+ {
if (st.hasQuestItems(SERPENT_CHARM))
{
st.dropItemsAlways(EN_STONEGOLEM_POWDER, 1, 10);
}
break;
-
+ }
case ENCHANTED_IRON_GOLEM:
+ {
if (st.hasQuestItems(SERPENT_CHARM))
{
st.dropItemsAlways(EN_IRONGOLEM_SCRAP, 1, 10);
}
break;
+ }
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q229_TestOfWitchcraft/Q229_TestOfWitchcraft.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q229_TestOfWitchcraft/Q229_TestOfWitchcraft.java
index 354b564b17..e90f4b5592 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q229_TestOfWitchcraft/Q229_TestOfWitchcraft.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q229_TestOfWitchcraft/Q229_TestOfWitchcraft.java
@@ -26,6 +26,33 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q229_TestOfWitchcraft extends Quest
{
+ // NPCs
+ private static final int LARA = 30063;
+ private static final int ALEXANDRIA = 30098;
+ private static final int IKER = 30110;
+ private static final int VADIN = 30188;
+ private static final int NESTLE = 30314;
+ private static final int SIR_KLAUS_VASPER = 30417;
+ private static final int LEOPOLD = 30435;
+ private static final int KAIRA = 30476;
+ private static final int ORIM = 30630;
+ private static final int RODERIK = 30631;
+ private static final int ENDRIGO = 30632;
+ private static final int EVERT = 30633;
+ // Monsters
+ private static final int DIRE_WYRM = 20557;
+ private static final int ENCHANTED_STONE_GOLEM = 20565;
+ private static final int LETO_LIZARDMAN = 20577;
+ private static final int LETO_LIZARDMAN_ARCHER = 20578;
+ private static final int LETO_LIZARDMAN_SOLDIER = 20579;
+ private static final int LETO_LIZARDMAN_WARRIOR = 20580;
+ private static final int LETO_LIZARDMAN_SHAMAN = 20581;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int TAMLIN_ORC = 20601;
+ private static final int TAMLIN_ORC_ARCHER = 20602;
+ private static final int NAMELESS_REVENANT = 27099;
+ private static final int SKELETAL_MERCENARY = 27100;
+ private static final int DREVANUL_PRINCE_ZERUEL = 27101;
// Items
private static final int ORIM_DIAGRAM = 3308;
private static final int ALEXANDRIA_BOOK = 3309;
@@ -56,53 +83,19 @@ public class Q229_TestOfWitchcraft extends Quest
private static final int ZERUEL_BIND_CRYSTAL = 3334;
private static final int BRIMSTONE_2 = 3335;
private static final int SWORD_OF_BINDING = 3029;
-
// Rewards
private static final int MARK_OF_WITCHCRAFT = 3307;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // NPCs
- private static final int LARA = 30063;
- private static final int ALEXANDRIA = 30098;
- private static final int IKER = 30110;
- private static final int VADIN = 30188;
- private static final int NESTLE = 30314;
- private static final int SIR_KLAUS_VASPER = 30417;
- private static final int LEOPOLD = 30435;
- private static final int KAIRA = 30476;
- private static final int ORIM = 30630;
- private static final int RODERIK = 30631;
- private static final int ENDRIGO = 30632;
- private static final int EVERT = 30633;
-
- // Monsters
- private static final int DIRE_WYRM = 20557;
- private static final int ENCHANTED_STONE_GOLEM = 20565;
- private static final int LETO_LIZARDMAN = 20577;
- private static final int LETO_LIZARDMAN_ARCHER = 20578;
- private static final int LETO_LIZARDMAN_SOLDIER = 20579;
- private static final int LETO_LIZARDMAN_WARRIOR = 20580;
- private static final int LETO_LIZARDMAN_SHAMAN = 20581;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int TAMLIN_ORC = 20601;
- private static final int TAMLIN_ORC_ARCHER = 20602;
- private static final int NAMELESS_REVENANT = 27099;
- private static final int SKELETAL_MERCENARY = 27100;
- private static final int DREVANUL_PRINCE_ZERUEL = 27101;
-
- // Checks
+ // Misc
private static boolean _drevanulPrinceZeruel = false;
private static boolean _swordOfBinding = false;
public Q229_TestOfWitchcraft()
{
super(229, "Test of Witchcraft");
-
registerQuestItems(ORIM_DIAGRAM, ALEXANDRIA_BOOK, IKER_LIST, DIRE_WYRM_FANG, LETO_LIZARDMAN_CHARM, EN_GOLEM_HEARTSTONE, LARA_MEMO, NESTLE_MEMO, LEOPOLD_JOURNAL, AKLANTOTH_GEM_1, AKLANTOTH_GEM_2, AKLANTOTH_GEM_3, AKLANTOTH_GEM_4, AKLANTOTH_GEM_5, AKLANTOTH_GEM_6, BRIMSTONE_1, ORIM_INSTRUCTIONS, ORIM_LETTER_1, ORIM_LETTER_2, SIR_VASPER_LETTER, VADIN_CRUCIFIX, TAMLIN_ORC_AMULET, VADIN_SANCTIONS, IKER_AMULET, SOULTRAP_CRYSTAL, PURGATORY_KEY, ZERUEL_BIND_CRYSTAL, BRIMSTONE_2, SWORD_OF_BINDING);
-
addStartNpc(ORIM);
addTalkId(LARA, ALEXANDRIA, IKER, VADIN, NESTLE, SIR_KLAUS_VASPER, LEOPOLD, KAIRA, ORIM, RODERIK, ENDRIGO, EVERT);
-
addAttackId(NAMELESS_REVENANT, SKELETAL_MERCENARY, DREVANUL_PRINCE_ZERUEL);
addKillId(DIRE_WYRM, ENCHANTED_STONE_GOLEM, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, TAMLIN_ORC, TAMLIN_ORC_ARCHER, NAMELESS_REVENANT, SKELETAL_MERCENARY, DREVANUL_PRINCE_ZERUEL);
}
@@ -117,160 +110,159 @@ public class Q229_TestOfWitchcraft extends Quest
return htmltext;
}
- // ORIM
- if (event.equals("30630-08.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORIM_DIAGRAM, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30630-08.htm":
{
- htmltext = "30630-08a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(ORIM_DIAGRAM, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30630-08a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- else if (event.equals("30630-14.htm"))
- {
- st.set("cond", "4");
- st.unset("gem456");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(AKLANTOTH_GEM_1, 1);
- st.takeItems(AKLANTOTH_GEM_2, 1);
- st.takeItems(AKLANTOTH_GEM_3, 1);
- st.takeItems(AKLANTOTH_GEM_4, 1);
- st.takeItems(AKLANTOTH_GEM_5, 1);
- st.takeItems(AKLANTOTH_GEM_6, 1);
- st.takeItems(ALEXANDRIA_BOOK, 1);
- st.giveItems(BRIMSTONE_1, 1);
- addSpawn(DREVANUL_PRINCE_ZERUEL, 70381, 109638, -3726, 0, false, 120000);
- }
- else if (event.equals("30630-16.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BRIMSTONE_1, 1);
- st.giveItems(ORIM_INSTRUCTIONS, 1);
- st.giveItems(ORIM_LETTER_1, 1);
- st.giveItems(ORIM_LETTER_2, 1);
- }
- else if (event.equals("30630-22.htm"))
- {
- st.takeItems(IKER_AMULET, 1);
- st.takeItems(ORIM_INSTRUCTIONS, 1);
- st.takeItems(PURGATORY_KEY, 1);
- st.takeItems(SWORD_OF_BINDING, 1);
- st.takeItems(ZERUEL_BIND_CRYSTAL, 1);
- st.giveItems(MARK_OF_WITCHCRAFT, 1);
- st.rewardExpAndSp(139796, 40000);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- // ALEXANDRIA
- else if (event.equals("30098-03.htm"))
- {
- st.set("cond", "2");
- st.set("gem456", "1");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORIM_DIAGRAM, 1);
- st.giveItems(ALEXANDRIA_BOOK, 1);
- }
- // IKER
- else if (event.equals("30110-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(IKER_LIST, 1);
- }
- else if (event.equals("30110-08.htm"))
- {
- st.takeItems(ORIM_LETTER_2, 1);
- st.giveItems(IKER_AMULET, 1);
- st.giveItems(SOULTRAP_CRYSTAL, 1);
-
- if (st.hasQuestItems(SWORD_OF_BINDING))
+ case "30630-14.htm":
{
- st.set("cond", "7");
+ st.setCond(4);
+ st.unset("gem456");
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(AKLANTOTH_GEM_1, 1);
+ st.takeItems(AKLANTOTH_GEM_2, 1);
+ st.takeItems(AKLANTOTH_GEM_3, 1);
+ st.takeItems(AKLANTOTH_GEM_4, 1);
+ st.takeItems(AKLANTOTH_GEM_5, 1);
+ st.takeItems(AKLANTOTH_GEM_6, 1);
+ st.takeItems(ALEXANDRIA_BOOK, 1);
+ st.giveItems(BRIMSTONE_1, 1);
+ addSpawn(DREVANUL_PRINCE_ZERUEL, 70381, 109638, -3726, 0, false, 120000);
+ break;
}
- else
+ case "30630-16.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BRIMSTONE_1, 1);
+ st.giveItems(ORIM_INSTRUCTIONS, 1);
+ st.giveItems(ORIM_LETTER_1, 1);
+ st.giveItems(ORIM_LETTER_2, 1);
+ break;
+ }
+ case "30630-22.htm":
+ {
+ st.takeItems(IKER_AMULET, 1);
+ st.takeItems(ORIM_INSTRUCTIONS, 1);
+ st.takeItems(PURGATORY_KEY, 1);
+ st.takeItems(SWORD_OF_BINDING, 1);
+ st.takeItems(ZERUEL_BIND_CRYSTAL, 1);
+ st.giveItems(MARK_OF_WITCHCRAFT, 1);
+ st.rewardExpAndSp(139796, 40000);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "30098-03.htm":
+ {
+ st.setCond(2);
+ st.set("gem456", "1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORIM_DIAGRAM, 1);
+ st.giveItems(ALEXANDRIA_BOOK, 1);
+ break;
+ }
+ case "30110-03.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(IKER_LIST, 1);
+ break;
}
- }
- // KAIRA
- else if (event.equals("30476-02.htm"))
- {
- st.giveItems(AKLANTOTH_GEM_2, 1);
-
- if (st.hasQuestItems(AKLANTOTH_GEM_1, AKLANTOTH_GEM_3) && (st.getInt("gem456") == 6))
+ case "30110-08.htm":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORIM_LETTER_2, 1);
+ st.giveItems(IKER_AMULET, 1);
+ st.giveItems(SOULTRAP_CRYSTAL, 1);
+ if (st.hasQuestItems(SWORD_OF_BINDING))
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
}
- else
+ case "30476-02.htm":
+ {
+ st.giveItems(AKLANTOTH_GEM_2, 1);
+ if (st.hasQuestItems(AKLANTOTH_GEM_1, AKLANTOTH_GEM_3) && (st.getInt("gem456") == 6))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
+ }
+ case "30063-02.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(LARA_MEMO, 1);
+ break;
}
- }
- // LARA
- else if (event.equals("30063-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(LARA_MEMO, 1);
- }
- // NESTLE
- else if (event.equals("30314-02.htm"))
- {
- st.set("gem456", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(NESTLE_MEMO, 1);
- }
- // LEOPOLD
- else if (event.equals("30435-02.htm"))
- {
- st.set("gem456", "3");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(NESTLE_MEMO, 1);
- st.giveItems(LEOPOLD_JOURNAL, 1);
- }
- // SIR KLAUS VASPER
- else if (event.equals("30417-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(ORIM_LETTER_1, 1);
- st.giveItems(SIR_VASPER_LETTER, 1);
- }
- // EVERT
- else if (event.equals("30633-02.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BRIMSTONE_2, 1);
-
- if (!_drevanulPrinceZeruel)
+ case "30314-02.htm":
{
- addSpawn(DREVANUL_PRINCE_ZERUEL, 13395, 169807, -3708, 0, false, 299000);
- _drevanulPrinceZeruel = true;
-
- // Resets Drevanul Prince Zeruel
- startQuestTimer("zeruel_cleanup", 300000, null, player, false);
+ st.set("gem456", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(NESTLE_MEMO, 1);
+ break;
+ }
+ case "30435-02.htm":
+ {
+ st.set("gem456", "3");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(NESTLE_MEMO, 1);
+ st.giveItems(LEOPOLD_JOURNAL, 1);
+ break;
+ }
+ case "30417-03.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(ORIM_LETTER_1, 1);
+ st.giveItems(SIR_VASPER_LETTER, 1);
+ break;
+ }
+ case "30633-02.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BRIMSTONE_2, 1);
+ if (!_drevanulPrinceZeruel)
+ {
+ addSpawn(DREVANUL_PRINCE_ZERUEL, 13395, 169807, -3708, 0, false, 299000);
+ _drevanulPrinceZeruel = true;
+
+ // Resets Drevanul Prince Zeruel
+ startQuestTimer("zeruel_cleanup", 300000, null, player, false);
+ }
+ break;
+ }
+ case "zeruel_despawn":
+ {
+ npc.abortAttack();
+ npc.decayMe();
+ return null;
+ }
+ case "zeruel_cleanup":
+ {
+ _drevanulPrinceZeruel = false;
+ return null;
}
- }
- // Despawns Drevanul Prince Zeruel
- else if (event.equals("zeruel_despawn"))
- {
- npc.abortAttack();
- npc.decayMe();
- return null;
- }
- // Drevanul Prince Zeruel's reset
- else if (event.equals("zeruel_cleanup"))
- {
- _drevanulPrinceZeruel = false;
- return null;
}
return htmltext;
@@ -289,6 +281,7 @@ public class Q229_TestOfWitchcraft extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.KNIGHT) && (player.getClassId() != ClassId.WIZARD) && (player.getClassId() != ClassId.PALUS_KNIGHT))
{
htmltext = "30630-01.htm";
@@ -302,14 +295,15 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = (player.getClassId() == ClassId.WIZARD) ? "30630-03.htm" : "30630-05.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
final int gem456 = st.getInt("gem456");
-
switch (npc.getNpcId())
{
case ORIM:
+ {
if (cond == 1)
{
htmltext = "30630-09.htm";
@@ -337,7 +331,7 @@ public class Q229_TestOfWitchcraft extends Quest
else if (cond == 7)
{
htmltext = "30630-18.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if ((cond == 8) || (cond == 9))
@@ -349,8 +343,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30630-19.htm";
}
break;
-
+ }
case ALEXANDRIA:
+ {
if (cond == 1)
{
htmltext = "30098-01.htm";
@@ -364,8 +359,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30098-05.htm";
}
break;
-
+ }
case KAIRA:
+ {
if (st.hasQuestItems(AKLANTOTH_GEM_2))
{
htmltext = "30476-03.htm";
@@ -379,8 +375,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30476-04.htm";
}
break;
-
+ }
case IKER:
+ {
if (st.hasQuestItems(AKLANTOTH_GEM_1))
{
htmltext = "30110-06.htm";
@@ -402,7 +399,7 @@ public class Q229_TestOfWitchcraft extends Quest
if (st.hasQuestItems(AKLANTOTH_GEM_2, AKLANTOTH_GEM_3) && (gem456 == 6))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -428,8 +425,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30110-10.htm";
}
break;
-
+ }
case LARA:
+ {
if (st.hasQuestItems(AKLANTOTH_GEM_3))
{
htmltext = "30063-04.htm";
@@ -447,16 +445,18 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30063-05.htm";
}
break;
-
+ }
case RODERIK:
case ENDRIGO:
+ {
if (st.hasAtLeastOneQuestItem(LARA_MEMO, AKLANTOTH_GEM_3))
{
htmltext = npc.getNpcId() + "-01.htm";
}
break;
-
+ }
case NESTLE:
+ {
if (gem456 == 1)
{
htmltext = "30314-01.htm";
@@ -470,8 +470,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30314-04.htm";
}
break;
-
+ }
case LEOPOLD:
+ {
if (gem456 == 2)
{
htmltext = "30435-01.htm";
@@ -489,8 +490,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30435-05.htm";
}
break;
-
+ }
case SIR_KLAUS_VASPER:
+ {
if (st.hasAtLeastOneQuestItem(SIR_VASPER_LETTER, VADIN_CRUCIFIX))
{
htmltext = "30417-04.htm";
@@ -503,7 +505,7 @@ public class Q229_TestOfWitchcraft extends Quest
if (st.hasQuestItems(SOULTRAP_CRYSTAL))
{
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -520,8 +522,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30417-06.htm";
}
break;
-
+ }
case VADIN:
+ {
if (st.hasQuestItems(SIR_VASPER_LETTER))
{
htmltext = "30188-01.htm";
@@ -553,8 +556,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30188-05.htm";
}
break;
-
+ }
case EVERT:
+ {
if ((cond == 7) || (cond == 8))
{
htmltext = "30633-01.htm";
@@ -577,12 +581,15 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30633-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -597,30 +604,31 @@ public class Q229_TestOfWitchcraft extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case NAMELESS_REVENANT:
+ {
if (st.hasQuestItems(LARA_MEMO) && !npc.isScriptValue(1))
{
npc.setScriptValue(1);
npc.broadcastNpcSay("I absolutely cannot give it to you! It is my precious jewel!");
}
break;
-
+ }
case SKELETAL_MERCENARY:
+ {
if ((st.getInt("gem456") > 2) && (st.getInt("gem456") < 6) && !npc.isScriptValue(1))
{
npc.setScriptValue(1);
npc.broadcastNpcSay("I absolutely cannot give it to you! It is my precious jewel!");
}
break;
-
+ }
case DREVANUL_PRINCE_ZERUEL:
- if ((cond == 4) && !npc.isScriptValue(1))
+ {
+ if (st.isCond(4) && !npc.isScriptValue(1))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
npc.setScriptValue(1);
@@ -628,7 +636,7 @@ public class Q229_TestOfWitchcraft extends Quest
startQuestTimer("zeruel_despawn", 1000, npc, attacker, false);
}
- else if ((cond == 9) && _drevanulPrinceZeruel)
+ else if (st.isCond(9) && _drevanulPrinceZeruel)
{
if (attacker.getInventory().getPaperdollItemId(7) == SWORD_OF_BINDING)
{
@@ -646,6 +654,7 @@ public class Q229_TestOfWitchcraft extends Quest
}
}
break;
+ }
}
return null;
@@ -660,47 +669,53 @@ public class Q229_TestOfWitchcraft extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case DIRE_WYRM:
+ {
if (st.hasQuestItems(IKER_LIST))
{
st.dropItemsAlways(DIRE_WYRM_FANG, 1, 20);
}
break;
-
+ }
case ENCHANTED_STONE_GOLEM:
+ {
if (st.hasQuestItems(IKER_LIST))
{
st.dropItemsAlways(EN_GOLEM_HEARTSTONE, 1, 20);
}
break;
-
+ }
case LETO_LIZARDMAN:
case LETO_LIZARDMAN_ARCHER:
+ {
if (st.hasQuestItems(IKER_LIST))
{
st.dropItems(LETO_LIZARDMAN_CHARM, 1, 20, 500000);
}
break;
+ }
case LETO_LIZARDMAN_SOLDIER:
case LETO_LIZARDMAN_WARRIOR:
+ {
if (st.hasQuestItems(IKER_LIST))
{
st.dropItems(LETO_LIZARDMAN_CHARM, 1, 20, 600000);
}
break;
+ }
case LETO_LIZARDMAN_SHAMAN:
case LETO_LIZARDMAN_OVERLORD:
+ {
if (st.hasQuestItems(IKER_LIST))
{
st.dropItems(LETO_LIZARDMAN_CHARM, 1, 20, 700000);
}
break;
-
+ }
case NAMELESS_REVENANT:
+ {
if (st.hasQuestItems(LARA_MEMO))
{
st.takeItems(LARA_MEMO, 1);
@@ -708,7 +723,7 @@ public class Q229_TestOfWitchcraft extends Quest
if (st.hasQuestItems(AKLANTOTH_GEM_1, AKLANTOTH_GEM_2) && (st.getInt("gem456") == 6))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -717,8 +732,9 @@ public class Q229_TestOfWitchcraft extends Quest
}
}
break;
-
+ }
case SKELETAL_MERCENARY:
+ {
final int gem456 = st.getInt("gem456");
if (gem456 == 3)
{
@@ -740,7 +756,7 @@ public class Q229_TestOfWitchcraft extends Quest
if (st.hasQuestItems(AKLANTOTH_GEM_1, AKLANTOTH_GEM_2, AKLANTOTH_GEM_3))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -749,21 +765,23 @@ public class Q229_TestOfWitchcraft extends Quest
}
}
break;
-
+ }
case TAMLIN_ORC:
case TAMLIN_ORC_ARCHER:
+ {
if (st.hasQuestItems(VADIN_CRUCIFIX))
{
st.dropItems(TAMLIN_ORC_AMULET, 1, 20, 500000);
}
break;
-
+ }
case DREVANUL_PRINCE_ZERUEL:
- if ((cond == 9) && _drevanulPrinceZeruel)
+ {
+ if (st.isCond(9) && _drevanulPrinceZeruel)
{
if (_swordOfBinding)
{
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_ITEMGET);
st.takeItems(BRIMSTONE_2, 1);
st.takeItems(SOULTRAP_CRYSTAL, 1);
@@ -775,6 +793,7 @@ public class Q229_TestOfWitchcraft extends Quest
_drevanulPrinceZeruel = false;
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q230_TestOfTheSummoner/Q230_TestOfTheSummoner.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q230_TestOfTheSummoner/Q230_TestOfTheSummoner.java
index 277010ab82..a08ee472d8 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q230_TestOfTheSummoner/Q230_TestOfTheSummoner.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q230_TestOfTheSummoner/Q230_TestOfTheSummoner.java
@@ -34,6 +34,44 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q230_TestOfTheSummoner extends Quest
{
+ // NPCs
+ private static final int LARA = 30063;
+ private static final int GALATEA = 30634;
+ private static final int ALMORS = 30635;
+ private static final int CAMONIELL = 30636;
+ private static final int BELTHUS = 30637;
+ private static final int BASILLA = 30638;
+ private static final int CELESTIEL = 30639;
+ private static final int BRYNTHEA = 30640;
+ // Monsters
+ private static final int NOBLE_ANT = 20089;
+ private static final int NOBLE_ANT_LEADER = 20090;
+ private static final int WYRM = 20176;
+ private static final int TYRANT = 20192;
+ private static final int TYRANT_KINGPIN = 20193;
+ private static final int BREKA_ORC = 20267;
+ private static final int BREKA_ORC_ARCHER = 20268;
+ private static final int BREKA_ORC_SHAMAN = 20269;
+ private static final int BREKA_ORC_OVERLORD = 20270;
+ private static final int BREKA_ORC_WARRIOR = 20271;
+ private static final int FETTERED_SOUL = 20552;
+ private static final int WINDSUS = 20553;
+ private static final int GIANT_FUNGUS = 20555;
+ private static final int MANASHEN_GARGOYLE = 20563;
+ private static final int LETO_LIZARDMAN = 20577;
+ private static final int LETO_LIZARDMAN_ARCHER = 20578;
+ private static final int LETO_LIZARDMAN_SOLDIER = 20579;
+ private static final int LETO_LIZARDMAN_WARRIOR = 20580;
+ private static final int LETO_LIZARDMAN_SHAMAN = 20581;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int KARUL_BUGBEAR = 20600;
+ // Quest Monsters
+ private static final int PAKO_THE_CAT = 27102;
+ private static final int UNICORN_RACER = 27103;
+ private static final int SHADOW_TUREN = 27104;
+ private static final int MIMI_THE_CAT = 27105;
+ private static final int UNICORN_PHANTASM = 27106;
+ private static final int SILHOUETTE_TILFO = 27107;
// Items
private static final int LETO_LIZARDMAN_AMULET = 3337;
private static final int SAC_OF_REDSPORES = 3338;
@@ -88,79 +126,19 @@ public class Q230_TestOfTheSummoner extends Quest
private static final int CRYSTAL_OF_FOUL_6 = 3387;
private static final int CRYSTAL_OF_DEFEAT_6 = 3388;
private static final int CRYSTAL_OF_VICTORY_6 = 3389;
-
// Rewards
private static final int MARK_OF_SUMMONER = 3336;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // Npcs
- private static final int LARA = 30063;
- private static final int GALATEA = 30634;
- private static final int ALMORS = 30635;
- private static final int CAMONIELL = 30636;
- private static final int BELTHUS = 30637;
- private static final int BASILLA = 30638;
- private static final int CELESTIEL = 30639;
- private static final int BRYNTHEA = 30640;
-
- // Monsters
- private static final int NOBLE_ANT = 20089;
- private static final int NOBLE_ANT_LEADER = 20090;
- private static final int WYRM = 20176;
- private static final int TYRANT = 20192;
- private static final int TYRANT_KINGPIN = 20193;
- private static final int BREKA_ORC = 20267;
- private static final int BREKA_ORC_ARCHER = 20268;
- private static final int BREKA_ORC_SHAMAN = 20269;
- private static final int BREKA_ORC_OVERLORD = 20270;
- private static final int BREKA_ORC_WARRIOR = 20271;
- private static final int FETTERED_SOUL = 20552;
- private static final int WINDSUS = 20553;
- private static final int GIANT_FUNGUS = 20555;
- private static final int MANASHEN_GARGOYLE = 20563;
- private static final int LETO_LIZARDMAN = 20577;
- private static final int LETO_LIZARDMAN_ARCHER = 20578;
- private static final int LETO_LIZARDMAN_SOLDIER = 20579;
- private static final int LETO_LIZARDMAN_WARRIOR = 20580;
- private static final int LETO_LIZARDMAN_SHAMAN = 20581;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int KARUL_BUGBEAR = 20600;
-
- // Quest Monsters
- private static final int PAKO_THE_CAT = 27102;
- private static final int UNICORN_RACER = 27103;
- private static final int SHADOW_TUREN = 27104;
- private static final int MIMI_THE_CAT = 27105;
- private static final int UNICORN_PHANTASM = 27106;
- private static final int SILHOUETTE_TILFO = 27107;
-
+ // Other
private static final int[][] LARA_LISTS = new int[][]
{
- {
- LARA_LIST_1,
- SAC_OF_REDSPORES,
- LETO_LIZARDMAN_AMULET
- },
- {
- LARA_LIST_2,
- KARUL_BUGBEAR_TOTEM,
- SHARDS_OF_MANASHEN
- },
- {
- LARA_LIST_3,
- CRIMSON_BLOODSTONE,
- BREKA_ORC_TOTEM
- },
- {
- LARA_LIST_4,
- TUSK_OF_WINDSUS,
- TALONS_OF_TYRANT
- },
- {
- LARA_LIST_5,
- WINGS_OF_DRONEANT,
- FANGS_OF_WYRM
- }
+ // @formatter:off
+ {LARA_LIST_1, SAC_OF_REDSPORES, LETO_LIZARDMAN_AMULET},
+ {LARA_LIST_2, KARUL_BUGBEAR_TOTEM, SHARDS_OF_MANASHEN},
+ {LARA_LIST_3, CRIMSON_BLOODSTONE, BREKA_ORC_TOTEM},
+ {LARA_LIST_4, TUSK_OF_WINDSUS, TALONS_OF_TYRANT},
+ {LARA_LIST_5, WINGS_OF_DRONEANT, FANGS_OF_WYRM}
+ // @formatter:on
};
private static final Map _duelsInProgress = new ConcurrentHashMap<>();
@@ -168,12 +146,9 @@ public class Q230_TestOfTheSummoner extends Quest
public Q230_TestOfTheSummoner()
{
super(230, "Test of the Summoner");
-
registerQuestItems(LETO_LIZARDMAN_AMULET, SAC_OF_REDSPORES, KARUL_BUGBEAR_TOTEM, SHARDS_OF_MANASHEN, BREKA_ORC_TOTEM, CRIMSON_BLOODSTONE, TALONS_OF_TYRANT, WINGS_OF_DRONEANT, TUSK_OF_WINDSUS, FANGS_OF_WYRM, LARA_LIST_1, LARA_LIST_2, LARA_LIST_3, LARA_LIST_4, LARA_LIST_5, GALATEA_LETTER, BEGINNER_ARCANA, ALMORS_ARCANA, CAMONIELL_ARCANA, BELTHUS_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA, CRYSTAL_OF_PROGRESS_1, CRYSTAL_OF_INPROGRESS_1, CRYSTAL_OF_FOUL_1, CRYSTAL_OF_DEFEAT_1, CRYSTAL_OF_VICTORY_1, CRYSTAL_OF_PROGRESS_2, CRYSTAL_OF_INPROGRESS_2, CRYSTAL_OF_FOUL_2, CRYSTAL_OF_DEFEAT_2, CRYSTAL_OF_VICTORY_2, CRYSTAL_OF_PROGRESS_3, CRYSTAL_OF_INPROGRESS_3, CRYSTAL_OF_FOUL_3, CRYSTAL_OF_DEFEAT_3, CRYSTAL_OF_VICTORY_3, CRYSTAL_OF_PROGRESS_4, CRYSTAL_OF_INPROGRESS_4, CRYSTAL_OF_FOUL_4, CRYSTAL_OF_DEFEAT_4, CRYSTAL_OF_VICTORY_4, CRYSTAL_OF_PROGRESS_5, CRYSTAL_OF_INPROGRESS_5, CRYSTAL_OF_FOUL_5, CRYSTAL_OF_DEFEAT_5, CRYSTAL_OF_VICTORY_5, CRYSTAL_OF_PROGRESS_6, CRYSTAL_OF_INPROGRESS_6, CRYSTAL_OF_FOUL_6, CRYSTAL_OF_DEFEAT_6, CRYSTAL_OF_VICTORY_6);
-
addStartNpc(GALATEA);
addTalkId(GALATEA, ALMORS, CAMONIELL, BELTHUS, BASILLA, CELESTIEL, BRYNTHEA, LARA);
-
addKillId(NOBLE_ANT, NOBLE_ANT_LEADER, WYRM, TYRANT, TYRANT_KINGPIN, BREKA_ORC, BREKA_ORC_ARCHER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, BREKA_ORC_WARRIOR, FETTERED_SOUL, WINDSUS, GIANT_FUNGUS, MANASHEN_GARGOYLE, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, KARUL_BUGBEAR, PAKO_THE_CAT, UNICORN_RACER, SHADOW_TUREN, MIMI_THE_CAT, UNICORN_PHANTASM, SILHOUETTE_TILFO);
addAttackId(PAKO_THE_CAT, UNICORN_RACER, SHADOW_TUREN, MIMI_THE_CAT, UNICORN_PHANTASM, SILHOUETTE_TILFO);
}
@@ -181,173 +156,171 @@ public class Q230_TestOfTheSummoner extends Quest
@Override
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{
- String htmltext = event;
final QuestState st = player.getQuestState(getName());
if (st == null)
{
return null;
}
+ String htmltext = event;
- // GALATEA
- if (event.equals("30634-08.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("Belthus", "1");
- st.set("Brynthea", "1");
- st.set("Celestiel", "1");
- st.set("Camoniell", "1");
- st.set("Basilla", "1");
- st.set("Almors", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(GALATEA_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30634-08.htm":
{
- htmltext = "30634-08a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.set("Belthus", "1");
+ st.set("Brynthea", "1");
+ st.set("Celestiel", "1");
+ st.set("Camoniell", "1");
+ st.set("Basilla", "1");
+ st.set("Almors", "1");
+ st.giveItems(GALATEA_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30634-08a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- // LARA
- else if (event.equals("30063-02.htm")) // Lara first time to give a list out
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GALATEA_LETTER, 1);
-
- final int random = Rnd.get(5);
-
- st.giveItems(LARA_LISTS[random][0], 1);
- st.set("Lara", String.valueOf(random + 1)); // avoid 0
- }
- else if (event.equals("30063-04.htm")) // Lara later to give a list out
- {
- final int random = Rnd.get(5);
-
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(LARA_LISTS[random][0], 1);
- st.set("Lara", String.valueOf(random + 1));
- }
- // ALMORS
- else if (event.equals("30635-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30063-02.htm":
{
- htmltext = "30635-03.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GALATEA_LETTER, 1);
+ final int random = Rnd.get(5);
+ st.giveItems(LARA_LISTS[random][0], 1);
+ st.set("Lara", String.valueOf(random + 1)); // avoid 0
+ break;
}
- }
- else if (event.equals("30635-04.htm"))
- {
- st.set("Almors", "2"); // set state ready to fight
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_1, -1); // just in case he cheated or lost
- st.takeItems(CRYSTAL_OF_DEFEAT_1, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_1, 1); // give Starting Crystal
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
- }
- // CAMONIELL
- else if (event.equals("30636-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30063-04.htm":
{
- htmltext = "30636-03.htm";
+ final int random = Rnd.get(5);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(LARA_LISTS[random][0], 1);
+ st.set("Lara", String.valueOf(random + 1));
+ break;
}
- }
- else if (event.equals("30636-04.htm"))
- {
- st.set("Camoniell", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_2, -1);
- st.takeItems(CRYSTAL_OF_DEFEAT_2, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_2, 1);
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
- }
- // BELTHUS
- else if (event.equals("30637-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30635-02.htm":
{
- htmltext = "30637-03.htm";
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30635-03.htm";
+ }
+ break;
}
- }
- else if (event.equals("30637-04.htm"))
- {
- st.set("Belthus", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_3, -1);
- st.takeItems(CRYSTAL_OF_DEFEAT_3, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_3, 1);
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
- }
- // BASILLA
- else if (event.equals("30638-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30635-04.htm":
{
- htmltext = "30638-03.htm";
+ st.set("Almors", "2"); // set state ready to fight
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_1, -1); // just in case he cheated or lost
+ st.takeItems(CRYSTAL_OF_DEFEAT_1, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_1, 1); // give Starting Crystal
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
}
- }
- else if (event.equals("30638-04.htm"))
- {
- st.set("Basilla", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_4, -1);
- st.takeItems(CRYSTAL_OF_DEFEAT_4, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_4, 1);
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
- }
- // CELESTIEL
- else if (event.equals("30639-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30636-02.htm":
{
- htmltext = "30639-03.htm";
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30636-03.htm";
+ }
+ break;
}
- }
- else if (event.equals("30639-04.htm"))
- {
- st.set("Celestiel", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_5, -1);
- st.takeItems(CRYSTAL_OF_DEFEAT_5, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_5, 1);
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
- }
- // BRYNTHEA
- else if (event.equals("30640-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30636-04.htm":
{
- htmltext = "30640-03.htm";
+ st.set("Camoniell", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_2, -1);
+ st.takeItems(CRYSTAL_OF_DEFEAT_2, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_2, 1);
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
+ }
+ case "30637-02.htm":
+ {
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30637-03.htm";
+ }
+ break;
+ }
+ case "30637-04.htm":
+ {
+ st.set("Belthus", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_3, -1);
+ st.takeItems(CRYSTAL_OF_DEFEAT_3, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_3, 1);
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
+ }
+ case "30638-02.htm":
+ {
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30638-03.htm";
+ }
+ break;
+ }
+ case "30638-04.htm":
+ {
+ st.set("Basilla", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_4, -1);
+ st.takeItems(CRYSTAL_OF_DEFEAT_4, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_4, 1);
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
+ }
+ case "30639-02.htm":
+ {
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30639-03.htm";
+ }
+ break;
+ }
+ case "30639-04.htm":
+ {
+ st.set("Celestiel", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_5, -1);
+ st.takeItems(CRYSTAL_OF_DEFEAT_5, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_5, 1);
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
+ }
+ case "30640-02.htm":
+ {
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30640-03.htm";
+ }
+ break;
+ }
+ case "30640-04.htm":
+ {
+ st.set("Brynthea", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_6, -1);
+ st.takeItems(CRYSTAL_OF_DEFEAT_6, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_6, 1);
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
}
- }
- else if (event.equals("30640-04.htm"))
- {
- st.set("Brynthea", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_6, -1);
- st.takeItems(CRYSTAL_OF_DEFEAT_6, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_6, 1);
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
}
return htmltext;
@@ -363,12 +336,12 @@ public class Q230_TestOfTheSummoner extends Quest
return htmltext;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
-
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.WIZARD) && (player.getClassId() != ClassId.ELVEN_WIZARD) && (player.getClassId() != ClassId.DARK_WIZARD))
{
htmltext = "30634-01.htm";
@@ -382,11 +355,13 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30634-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npcId)
{
case LARA:
+ {
if (cond == 1)
{
htmltext = "30063-01.htm";
@@ -407,7 +382,7 @@ public class Q230_TestOfTheSummoner extends Quest
else
{
htmltext = "30063-06.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.unset("Lara");
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(laraPart[0], 1);
@@ -418,8 +393,9 @@ public class Q230_TestOfTheSummoner extends Quest
}
}
break;
-
+ }
case GALATEA:
+ {
if (cond == 1)
{
htmltext = "30634-09.htm";
@@ -450,8 +426,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ALMORS:
+ {
final int almorsStat = st.getInt("Almors");
if (almorsStat == 1)
{
@@ -482,7 +459,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(CAMONIELL_ARCANA, BELTHUS_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -495,8 +472,9 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30635-10.htm";
}
break;
-
+ }
case CAMONIELL:
+ {
final int camoniellStat = st.getInt("Camoniell");
if (camoniellStat == 1)
{
@@ -527,7 +505,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(ALMORS_ARCANA, BELTHUS_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -540,8 +518,9 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30636-10.htm";
}
break;
-
+ }
case BELTHUS:
+ {
final int belthusStat = st.getInt("Belthus");
if (belthusStat == 1)
{
@@ -572,7 +551,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(ALMORS_ARCANA, CAMONIELL_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -585,8 +564,9 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30637-10.htm";
}
break;
-
+ }
case BASILLA:
+ {
final int basillaStat = st.getInt("Basilla");
if (basillaStat == 1)
{
@@ -617,7 +597,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(ALMORS_ARCANA, CAMONIELL_ARCANA, BELTHUS_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -630,8 +610,9 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30638-10.htm";
}
break;
-
+ }
case CELESTIEL:
+ {
final int celestielStat = st.getInt("Celestiel");
if (celestielStat == 1)
{
@@ -662,7 +643,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(ALMORS_ARCANA, CAMONIELL_ARCANA, BELTHUS_ARCANA, BASILLIA_ARCANA, BRYNTHEA_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -675,8 +656,9 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30639-10.htm";
}
break;
-
+ }
case BRYNTHEA:
+ {
final int bryntheaStat = st.getInt("Brynthea");
if (bryntheaStat == 1)
{
@@ -707,7 +689,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(ALMORS_ARCANA, CAMONIELL_ARCANA, BELTHUS_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -720,12 +702,15 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30640-10.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -747,6 +732,7 @@ public class Q230_TestOfTheSummoner extends Quest
switch (((NpcInstance) killer).getNpcId())
{
case PAKO_THE_CAT:
+ {
if (st.getInt("Almors") == 3)
{
st.set("Almors", "4");
@@ -754,8 +740,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_1, 1);
}
break;
-
+ }
case UNICORN_RACER:
+ {
if (st.getInt("Camoniell") == 3)
{
st.set("Camoniell", "4");
@@ -763,8 +750,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_2, 1);
}
break;
-
+ }
case SHADOW_TUREN:
+ {
if (st.getInt("Belthus") == 3)
{
st.set("Belthus", "4");
@@ -772,8 +760,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_3, 1);
}
break;
-
+ }
case MIMI_THE_CAT:
+ {
if (st.getInt("Basilla") == 3)
{
st.set("Basilla", "4");
@@ -781,8 +770,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_4, 1);
}
break;
-
+ }
case UNICORN_PHANTASM:
+ {
if (st.getInt("Celestiel") == 3)
{
st.set("Celestiel", "4");
@@ -790,8 +780,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_5, 1);
}
break;
-
+ }
case SILHOUETTE_TILFO:
+ {
if (st.getInt("Brynthea") == 3)
{
st.set("Brynthea", "4");
@@ -799,6 +790,7 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_6, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q231_TestOfTheMaestro/Q231_TestOfTheMaestro.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q231_TestOfTheMaestro/Q231_TestOfTheMaestro.java
index ed41e38f3a..fc4f258011 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q231_TestOfTheMaestro/Q231_TestOfTheMaestro.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q231_TestOfTheMaestro/Q231_TestOfTheMaestro.java
@@ -28,6 +28,24 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q231_TestOfTheMaestro extends Quest
{
+ // NPCs
+ private static final int LOCKIRIN = 30531;
+ private static final int SPIRON = 30532;
+ private static final int BALANKI = 30533;
+ private static final int KEEF = 30534;
+ private static final int FILAUR = 30535;
+ private static final int ARIN = 30536;
+ private static final int TOMA = 30556;
+ private static final int CROTO = 30671;
+ private static final int DUBABAH = 30672;
+ private static final int LORAIN = 30673;
+ // Monsters
+ private static final int KING_BUGBEAR = 20150;
+ private static final int GIANT_MIST_LEECH = 20225;
+ private static final int STINGER_WASP = 20229;
+ private static final int MARSH_SPIDER = 20233;
+ private static final int EVIL_EYE_LORD = 27133;
+ // Items
private static final int RECOMMENDATION_OF_BALANKI = 2864;
private static final int RECOMMENDATION_OF_FILAUR = 2865;
private static final int RECOMMENDATION_OF_ARIN = 2866;
@@ -43,39 +61,16 @@ public class Q231_TestOfTheMaestro extends Quest
private static final int MARSH_SPIDER_WEB = 2877;
private static final int BLOOD_OF_LEECH = 2878;
private static final int BROKEN_TELEPORT_DEVICE = 2916;
-
// Rewards
private static final int MARK_OF_MAESTRO = 2867;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int LOCKIRIN = 30531;
- private static final int SPIRON = 30532;
- private static final int BALANKI = 30533;
- private static final int KEEF = 30534;
- private static final int FILAUR = 30535;
- private static final int ARIN = 30536;
- private static final int TOMA = 30556;
- private static final int CROTO = 30671;
- private static final int DUBABAH = 30672;
- private static final int LORAIN = 30673;
-
- // Monsters
- private static final int KING_BUGBEAR = 20150;
- private static final int GIANT_MIST_LEECH = 20225;
- private static final int STINGER_WASP = 20229;
- private static final int MARSH_SPIDER = 20233;
- private static final int EVIL_EYE_LORD = 27133;
-
public Q231_TestOfTheMaestro()
{
super(231, "Test of the Maestro");
-
registerQuestItems(RECOMMENDATION_OF_BALANKI, RECOMMENDATION_OF_FILAUR, RECOMMENDATION_OF_ARIN, LETTER_OF_SOLDER_DETACHMENT, PAINT_OF_KAMURU, NECKLACE_OF_KAMURU, PAINT_OF_TELEPORT_DEVICE, TELEPORT_DEVICE, ARCHITECTURE_OF_KRUMA, REPORT_OF_KRUMA, INGREDIENTS_OF_ANTIDOTE, STINGER_WASP_NEEDLE, MARSH_SPIDER_WEB, BLOOD_OF_LEECH, BROKEN_TELEPORT_DEVICE);
-
addStartNpc(LOCKIRIN);
addTalkId(LOCKIRIN, SPIRON, BALANKI, KEEF, FILAUR, ARIN, TOMA, CROTO, DUBABAH, LORAIN);
-
addKillId(GIANT_MIST_LEECH, STINGER_WASP, MARSH_SPIDER, EVIL_EYE_LORD);
}
@@ -89,66 +84,63 @@ public class Q231_TestOfTheMaestro extends Quest
return htmltext;
}
- // LOCKIRIN
- if (event.equals("30531-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30531-04.htm":
{
- htmltext = "30531-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30531-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
+ }
+ case "30533-02.htm":
+ {
+ st.set("bCond", "1");
+ break;
+ }
+ case "30671-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(PAINT_OF_KAMURU, 1);
+ break;
+ }
+ case "30556-05.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(PAINT_OF_TELEPORT_DEVICE, 1);
+ st.giveItems(BROKEN_TELEPORT_DEVICE, 1);
+ player.teleToLocation(140352, -194133, -3146);
+ startQuestTimer("spawn_bugbears", 5000, null, player, false);
+ break;
+ }
+ case "30673-04.htm":
+ {
+ st.set("fCond", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BLOOD_OF_LEECH, -1);
+ st.takeItems(INGREDIENTS_OF_ANTIDOTE, 1);
+ st.takeItems(MARSH_SPIDER_WEB, -1);
+ st.takeItems(STINGER_WASP_NEEDLE, -1);
+ st.giveItems(REPORT_OF_KRUMA, 1);
+ break;
+ }
+ case "spawn_bugbears":
+ {
+ final Attackable bugbear1 = (Attackable) addSpawn(KING_BUGBEAR, 140333, -194153, -3138, 0, false, 200000);
+ bugbear1.addDamageHate(player, 0, 999);
+ bugbear1.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
+ final Attackable bugbear2 = (Attackable) addSpawn(KING_BUGBEAR, 140395, -194147, -3146, 0, false, 200000);
+ bugbear2.addDamageHate(player, 0, 999);
+ bugbear2.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
+ final Attackable bugbear3 = (Attackable) addSpawn(KING_BUGBEAR, 140304, -194082, -3157, 0, false, 200000);
+ bugbear3.addDamageHate(player, 0, 999);
+ bugbear3.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
+ return null;
}
- }
- // BALANKI
- else if (event.equals("30533-02.htm"))
- {
- st.set("bCond", "1");
- }
- else if (event.equals("30671-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(PAINT_OF_KAMURU, 1);
- }
- // TOMA
- else if (event.equals("30556-05.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(PAINT_OF_TELEPORT_DEVICE, 1);
- st.giveItems(BROKEN_TELEPORT_DEVICE, 1);
- player.teleToLocation(140352, -194133, -3146);
- startQuestTimer("spawn_bugbears", 5000, null, player, false);
- }
- // LORAIN
- else if (event.equals("30673-04.htm"))
- {
- st.set("fCond", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BLOOD_OF_LEECH, -1);
- st.takeItems(INGREDIENTS_OF_ANTIDOTE, 1);
- st.takeItems(MARSH_SPIDER_WEB, -1);
- st.takeItems(STINGER_WASP_NEEDLE, -1);
- st.giveItems(REPORT_OF_KRUMA, 1);
- }
- // Spawns 3 King Bugbears
- else if (event.equals("spawn_bugbears"))
- {
- final Attackable bugbear1 = (Attackable) addSpawn(KING_BUGBEAR, 140333, -194153, -3138, 0, false, 200000);
- bugbear1.addDamageHate(player, 0, 999);
- bugbear1.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
-
- final Attackable bugbear2 = (Attackable) addSpawn(KING_BUGBEAR, 140395, -194147, -3146, 0, false, 200000);
- bugbear2.addDamageHate(player, 0, 999);
- bugbear2.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
-
- final Attackable bugbear3 = (Attackable) addSpawn(KING_BUGBEAR, 140304, -194082, -3157, 0, false, 200000);
- bugbear3.addDamageHate(player, 0, 999);
- bugbear3.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
-
- return null;
}
return htmltext;
@@ -167,6 +159,7 @@ public class Q231_TestOfTheMaestro extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId() != ClassId.ARTISAN)
{
htmltext = "30531-01.htm";
@@ -180,12 +173,14 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30531-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case LOCKIRIN:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30531-05.htm";
@@ -203,18 +198,20 @@ public class Q231_TestOfTheMaestro extends Quest
st.exitQuest(false);
}
break;
-
+ }
case SPIRON:
+ {
htmltext = "30532-01.htm";
break;
-
+ }
case KEEF:
+ {
htmltext = "30534-01.htm";
break;
-
- // Part 1
+ }
case BALANKI:
- int bCond = st.getInt("bCond");
+ {
+ final int bCond = st.getInt("bCond");
if (bCond == 0)
{
htmltext = "30533-01.htm";
@@ -232,7 +229,7 @@ public class Q231_TestOfTheMaestro extends Quest
if (st.hasQuestItems(RECOMMENDATION_OF_ARIN, RECOMMENDATION_OF_FILAUR))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -245,9 +242,10 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30533-05.htm";
}
break;
-
+ }
case CROTO:
- bCond = st.getInt("bCond");
+ {
+ final int bCond = st.getInt("bCond");
if (bCond == 1)
{
if (!st.hasQuestItems(PAINT_OF_KAMURU))
@@ -273,14 +271,15 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30671-05.htm";
}
break;
-
+ }
case DUBABAH:
+ {
htmltext = "30672-01.htm";
break;
-
- // Part 2
+ }
case ARIN:
- int aCond = st.getInt("aCond");
+ {
+ final int aCond = st.getInt("aCond");
if (aCond == 0)
{
htmltext = "30536-01.htm";
@@ -300,7 +299,7 @@ public class Q231_TestOfTheMaestro extends Quest
if (st.hasQuestItems(RECOMMENDATION_OF_BALANKI, RECOMMENDATION_OF_FILAUR))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -313,9 +312,10 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30536-04.htm";
}
break;
-
+ }
case TOMA:
- aCond = st.getInt("aCond");
+ {
+ final int aCond = st.getInt("aCond");
if (aCond == 1)
{
if (!st.hasQuestItems(BROKEN_TELEPORT_DEVICE))
@@ -336,10 +336,10 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30556-07.htm";
}
break;
-
- // Part 3
+ }
case FILAUR:
- int fCond = st.getInt("fCond");
+ {
+ final int fCond = st.getInt("fCond");
if (fCond == 0)
{
htmltext = "30535-01.htm";
@@ -360,7 +360,7 @@ public class Q231_TestOfTheMaestro extends Quest
if (st.hasQuestItems(RECOMMENDATION_OF_BALANKI, RECOMMENDATION_OF_ARIN))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -373,9 +373,10 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30535-04.htm";
}
break;
-
+ }
case LORAIN:
- fCond = st.getInt("fCond");
+ {
+ final int fCond = st.getInt("fCond");
if (fCond == 1)
{
if (!st.hasQuestItems(REPORT_OF_KRUMA))
@@ -402,12 +403,15 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30673-05.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -416,7 +420,7 @@ public class Q231_TestOfTheMaestro extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -425,32 +429,37 @@ public class Q231_TestOfTheMaestro extends Quest
switch (npc.getNpcId())
{
case GIANT_MIST_LEECH:
+ {
if (st.hasQuestItems(INGREDIENTS_OF_ANTIDOTE))
{
st.dropItemsAlways(BLOOD_OF_LEECH, 1, 10);
}
break;
-
+ }
case STINGER_WASP:
+ {
if (st.hasQuestItems(INGREDIENTS_OF_ANTIDOTE))
{
st.dropItemsAlways(STINGER_WASP_NEEDLE, 1, 10);
}
break;
-
+ }
case MARSH_SPIDER:
+ {
if (st.hasQuestItems(INGREDIENTS_OF_ANTIDOTE))
{
st.dropItemsAlways(MARSH_SPIDER_WEB, 1, 10);
}
break;
-
+ }
case EVIL_EYE_LORD:
+ {
if (st.hasQuestItems(PAINT_OF_KAMURU))
{
st.dropItemsAlways(NECKLACE_OF_KAMURU, 1, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q232_TestOfTheLord/Q232_TestOfTheLord.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q232_TestOfTheLord/Q232_TestOfTheLord.java
index e0825c47e7..2a66b64d96 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q232_TestOfTheLord/Q232_TestOfTheLord.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q232_TestOfTheLord/Q232_TestOfTheLord.java
@@ -40,7 +40,6 @@ public class Q232_TestOfTheLord extends Quest
private static final int CHIANTA = 30642;
private static final int FIRST_ORC = 30643;
private static final int ANCESTOR_MARTANKUS = 30649;
-
// Items
private static final int ORDEAL_NECKLACE = 3391;
private static final int VARKEES_CHARM = 3392;
@@ -69,22 +68,18 @@ public class Q232_TestOfTheLord extends Quest
private static final int RAGNA_CHIEF_NOTICE = 3415;
private static final int BONE_ARROW = 1341;
private static final int IMMORTAL_FLAME = 3416;
-
// Rewards
private static final int MARK_LORD = 3390;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
+ // Misc
private static NpcInstance _firstOrc; // Used to avoid to spawn multiple instances.
public Q232_TestOfTheLord()
{
super(232, "Test of the Lord");
-
registerQuestItems(VARKEES_CHARM, TANTUS_CHARM, HATOS_CHARM, TAKUNA_CHARM, CHIANTA_CHARM, MANAKIAS_ORDERS, BREKA_ORC_FANG, MANAKIAS_AMULET, HUGE_ORC_FANG, SUMARIS_LETTER, URUTU_BLADE, TIMAK_ORC_SKULL, SWORD_INTO_SKULL, NERUGA_AXE_BLADE, AXE_OF_CEREMONY, MARSH_SPIDER_FEELER, MARSH_SPIDER_FEET, HANDIWORK_SPIDER_BROOCH, MONSTEREYE_CORNEA, MONSTEREYE_WOODCARVING, BEAR_FANG_NECKLACE, MARTANKUS_CHARM, RAGNA_ORC_HEAD, RAGNA_ORC_HEAD, IMMORTAL_FLAME);
-
addStartNpc(KAKAI);
addTalkId(KAKAI, CHIANTA, HATOS, SOMAK, SUMARI, TAKUNA, TANTUS, JAKAL, VARKEES, MANAKIA, ANCESTOR_MARTANKUS, FIRST_ORC);
-
addKillId(20233, 20269, 20270, 20564, 20583, 20584, 20585, 20586, 20587, 20588, 20778, 20779);
}
@@ -98,89 +93,101 @@ public class Q232_TestOfTheLord extends Quest
return htmltext;
}
- if (event.equals("30565-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDEAL_NECKLACE, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30565-05.htm":
{
- htmltext = "30565-05b.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(ORDEAL_NECKLACE, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30565-05b.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- else if (event.equals("30565-08.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SWORD_INTO_SKULL, 1);
- st.takeItems(AXE_OF_CEREMONY, 1);
- st.takeItems(MONSTEREYE_WOODCARVING, 1);
- st.takeItems(HANDIWORK_SPIDER_BROOCH, 1);
- st.takeItems(ORDEAL_NECKLACE, 1);
- st.takeItems(HUGE_ORC_FANG, 1);
- st.giveItems(BEAR_FANG_NECKLACE, 1);
- }
- else if (event.equals("30566-02.htm"))
- {
- st.giveItems(VARKEES_CHARM, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30567-02.htm"))
- {
- st.giveItems(TANTUS_CHARM, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30558-02.htm"))
- {
- st.takeItems(57, 1000);
- st.giveItems(NERUGA_AXE_BLADE, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30568-02.htm"))
- {
- st.giveItems(HATOS_CHARM, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30641-02.htm"))
- {
- st.giveItems(TAKUNA_CHARM, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30642-02.htm"))
- {
- st.giveItems(CHIANTA_CHARM, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30643-02.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- startQuestTimer("f_orc_despawn", 10000, null, player, false);
- }
- else if (event.equals("30649-04.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BEAR_FANG_NECKLACE, 1);
- st.giveItems(MARTANKUS_CHARM, 1);
- }
- else if (event.equals("30649-07.htm"))
- {
- if (_firstOrc == null)
+ case "30565-08.htm":
{
- _firstOrc = addSpawn(FIRST_ORC, 21036, -107690, -3038, 200000, false, 0);
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SWORD_INTO_SKULL, 1);
+ st.takeItems(AXE_OF_CEREMONY, 1);
+ st.takeItems(MONSTEREYE_WOODCARVING, 1);
+ st.takeItems(HANDIWORK_SPIDER_BROOCH, 1);
+ st.takeItems(ORDEAL_NECKLACE, 1);
+ st.takeItems(HUGE_ORC_FANG, 1);
+ st.giveItems(BEAR_FANG_NECKLACE, 1);
+ break;
}
- }
- else if (event.equals("f_orc_despawn"))
- {
- if (_firstOrc != null)
+ case "30566-02.htm":
{
- _firstOrc.deleteMe();
- _firstOrc = null;
+ st.giveItems(VARKEES_CHARM, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30567-02.htm":
+ {
+ st.giveItems(TANTUS_CHARM, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30558-02.htm":
+ {
+ st.takeItems(57, 1000);
+ st.giveItems(NERUGA_AXE_BLADE, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30568-02.htm":
+ {
+ st.giveItems(HATOS_CHARM, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30641-02.htm":
+ {
+ st.giveItems(TAKUNA_CHARM, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30642-02.htm":
+ {
+ st.giveItems(CHIANTA_CHARM, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30643-02.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ startQuestTimer("f_orc_despawn", 10000, null, player, false);
+ break;
+ }
+ case "30649-04.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BEAR_FANG_NECKLACE, 1);
+ st.giveItems(MARTANKUS_CHARM, 1);
+ break;
+ }
+ case "30649-07.htm":
+ {
+ if (_firstOrc == null)
+ {
+ _firstOrc = addSpawn(FIRST_ORC, 21036, -107690, -3038, 200000, false, 0);
+ }
+ break;
+ }
+ case "f_orc_despawn":
+ {
+ if (_firstOrc != null)
+ {
+ _firstOrc.deleteMe();
+ _firstOrc = null;
+ }
+ break;
}
}
@@ -200,6 +207,7 @@ public class Q232_TestOfTheLord extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30565-01.htm";
@@ -217,12 +225,14 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30565-04.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VARKEES:
+ {
if (st.hasQuestItems(HUGE_ORC_FANG))
{
htmltext = "30566-05.htm";
@@ -238,7 +248,7 @@ public class Q232_TestOfTheLord extends Quest
if (st.hasQuestItems(SWORD_INTO_SKULL, AXE_OF_CEREMONY, MONSTEREYE_WOODCARVING, HANDIWORK_SPIDER_BROOCH, ORDEAL_NECKLACE))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -256,8 +266,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30566-01.htm";
}
break;
-
+ }
case MANAKIA:
+ {
if (st.hasQuestItems(HUGE_ORC_FANG))
{
htmltext = "30515-05.htm";
@@ -288,8 +299,9 @@ public class Q232_TestOfTheLord extends Quest
st.playSound(QuestState.SOUND_ITEMGET);
}
break;
-
+ }
case TANTUS:
+ {
if (st.hasQuestItems(AXE_OF_CEREMONY))
{
htmltext = "30567-05.htm";
@@ -306,7 +318,7 @@ public class Q232_TestOfTheLord extends Quest
if (st.hasQuestItems(SWORD_INTO_SKULL, MONSTEREYE_WOODCARVING, HANDIWORK_SPIDER_BROOCH, ORDEAL_NECKLACE, HUGE_ORC_FANG))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -324,8 +336,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30567-01.htm";
}
break;
-
+ }
case JAKAL:
+ {
if (st.hasQuestItems(AXE_OF_CEREMONY))
{
htmltext = "30558-05.htm";
@@ -346,8 +359,9 @@ public class Q232_TestOfTheLord extends Quest
}
}
break;
-
+ }
case HATOS:
+ {
if (st.hasQuestItems(SWORD_INTO_SKULL))
{
htmltext = "30568-05.htm";
@@ -364,7 +378,7 @@ public class Q232_TestOfTheLord extends Quest
if (st.hasQuestItems(AXE_OF_CEREMONY, MONSTEREYE_WOODCARVING, HANDIWORK_SPIDER_BROOCH, ORDEAL_NECKLACE, HUGE_ORC_FANG))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -382,8 +396,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30568-01.htm";
}
break;
-
+ }
case SUMARI:
+ {
if (st.hasQuestItems(URUTU_BLADE))
{
htmltext = "30564-03.htm";
@@ -399,8 +414,9 @@ public class Q232_TestOfTheLord extends Quest
st.playSound(QuestState.SOUND_ITEMGET);
}
break;
-
+ }
case SOMAK:
+ {
if (st.hasQuestItems(SWORD_INTO_SKULL))
{
htmltext = "30510-03.htm";
@@ -417,8 +433,9 @@ public class Q232_TestOfTheLord extends Quest
st.playSound(QuestState.SOUND_ITEMGET);
}
break;
-
+ }
case TAKUNA:
+ {
if (st.hasQuestItems(HANDIWORK_SPIDER_BROOCH))
{
htmltext = "30641-05.htm";
@@ -435,7 +452,7 @@ public class Q232_TestOfTheLord extends Quest
if (st.hasQuestItems(SWORD_INTO_SKULL, AXE_OF_CEREMONY, MONSTEREYE_WOODCARVING, ORDEAL_NECKLACE, HUGE_ORC_FANG))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -453,8 +470,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30641-01.htm";
}
break;
-
+ }
case CHIANTA:
+ {
if (st.hasQuestItems(MONSTEREYE_WOODCARVING))
{
htmltext = "30642-05.htm";
@@ -470,7 +488,7 @@ public class Q232_TestOfTheLord extends Quest
if (st.hasQuestItems(SWORD_INTO_SKULL, AXE_OF_CEREMONY, HANDIWORK_SPIDER_BROOCH, ORDEAL_NECKLACE, HUGE_ORC_FANG))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -488,8 +506,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30642-01.htm";
}
break;
-
+ }
case KAKAI:
+ {
if (cond == 1)
{
htmltext = "30565-06.htm";
@@ -518,8 +537,9 @@ public class Q232_TestOfTheLord extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ANCESTOR_MARTANKUS:
+ {
if (cond == 3)
{
htmltext = "30649-01.htm";
@@ -531,7 +551,7 @@ public class Q232_TestOfTheLord extends Quest
else if (cond == 5)
{
htmltext = "30649-06.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MARTANKUS_CHARM, 1);
@@ -548,8 +568,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30649-08.htm";
}
break;
-
+ }
case FIRST_ORC:
+ {
if (cond == 6)
{
htmltext = "30643-01.htm";
@@ -559,12 +580,15 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30643-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -582,59 +606,67 @@ public class Q232_TestOfTheLord extends Quest
switch (npc.getNpcId())
{
case 20564:
+ {
if (st.hasQuestItems(CHIANTA_CHARM))
{
st.dropItemsAlways(MONSTEREYE_CORNEA, 1, 20);
}
break;
-
+ }
case 20583:
case 20584:
case 20585:
+ {
if (st.hasQuestItems(HATOS_CHARM))
{
st.dropItems(TIMAK_ORC_SKULL, 1, 10, 710000);
}
break;
-
+ }
case 20586:
+ {
if (st.hasQuestItems(HATOS_CHARM))
{
st.dropItems(TIMAK_ORC_SKULL, 1, 10, 810000);
}
break;
-
+ }
case 20587:
case 20588:
+ {
if (st.hasQuestItems(HATOS_CHARM))
{
st.dropItemsAlways(TIMAK_ORC_SKULL, 1, 10);
}
break;
-
+ }
case 20233:
+ {
if (st.hasQuestItems(TAKUNA_CHARM))
{
st.dropItemsAlways((st.getQuestItemsCount(MARSH_SPIDER_FEELER) >= 10) ? MARSH_SPIDER_FEET : MARSH_SPIDER_FEELER, 1, 10);
}
break;
-
+ }
case 20269:
+ {
if (st.hasQuestItems(MANAKIAS_ORDERS))
{
st.dropItems(BREKA_ORC_FANG, 1, 20, 410000);
}
break;
-
+ }
case 20270:
+ {
if (st.hasQuestItems(MANAKIAS_ORDERS))
{
st.dropItems(BREKA_ORC_FANG, 1, 20, 510000);
}
break;
-
+ }
case 20778:
case 20779:
+ {
if (st.hasQuestItems(MARTANKUS_CHARM))
{
if (!st.hasQuestItems(RAGNA_CHIEF_NOTICE))
@@ -644,12 +676,13 @@ public class Q232_TestOfTheLord extends Quest
}
else if (!st.hasQuestItems(RAGNA_ORC_HEAD))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(RAGNA_ORC_HEAD, 1);
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q233_TestOfTheWarSpirit/Q233_TestOfTheWarSpirit.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q233_TestOfTheWarSpirit/Q233_TestOfTheWarSpirit.java
index 0ba374d1a9..8cdf59b75d 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q233_TestOfTheWarSpirit/Q233_TestOfTheWarSpirit.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q233_TestOfTheWarSpirit/Q233_TestOfTheWarSpirit.java
@@ -28,6 +28,27 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q233_TestOfTheWarSpirit extends Quest
{
+ // NPCs
+ private static final int VIVYAN = 30030;
+ private static final int SARIEN = 30436;
+ private static final int RACOY = 30507;
+ private static final int SOMAK = 30510;
+ private static final int MANAKIA = 30515;
+ private static final int ORIM = 30630;
+ private static final int ANCESTOR_MARTANKUS = 30649;
+ private static final int PEKIRON = 30682;
+ // Monsters
+ private static final int NOBLE_ANT = 20089;
+ private static final int NOBLE_ANT_LEADER = 20090;
+ private static final int MEDUSA = 20158;
+ private static final int PORTA = 20213;
+ private static final int EXCURO = 20214;
+ private static final int MORDEO = 20215;
+ private static final int LETO_LIZARDMAN_SHAMAN = 20581;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int TAMLIN_ORC = 20601;
+ private static final int TAMLIN_ORC_ARCHER = 20602;
+ private static final int STENOA_GORGON_QUEEN = 27108;
// Items
private static final int VENDETTA_TOTEM = 2880;
private static final int TAMLIN_ORC_HEAD = 2881;
@@ -64,40 +85,14 @@ public class Q233_TestOfTheWarSpirit extends Quest
private static final int TONAR_REMAINS_2 = 2912;
private static final int HERMODT_REMAINS_2 = 2913;
private static final int KIRUNA_REMAINS_2 = 2914;
-
// Rewards
private static final int MARK_OF_WARSPIRIT = 2879;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int VIVYAN = 30030;
- private static final int SARIEN = 30436;
- private static final int RACOY = 30507;
- private static final int SOMAK = 30510;
- private static final int MANAKIA = 30515;
- private static final int ORIM = 30630;
- private static final int ANCESTOR_MARTANKUS = 30649;
- private static final int PEKIRON = 30682;
-
- // Monsters
- private static final int NOBLE_ANT = 20089;
- private static final int NOBLE_ANT_LEADER = 20090;
- private static final int MEDUSA = 20158;
- private static final int PORTA = 20213;
- private static final int EXCURO = 20214;
- private static final int MORDEO = 20215;
- private static final int LETO_LIZARDMAN_SHAMAN = 20581;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int TAMLIN_ORC = 20601;
- private static final int TAMLIN_ORC_ARCHER = 20602;
- private static final int STENOA_GORGON_QUEEN = 27108;
-
public Q233_TestOfTheWarSpirit()
{
super(233, "Test of the War Spirit");
-
registerQuestItems(VENDETTA_TOTEM, TAMLIN_ORC_HEAD, WARSPIRIT_TOTEM, ORIM_CONTRACT, PORTA_EYE, EXCURO_SCALE, MORDEO_TALON, BRAKI_REMAINS_1, PEKIRON_TOTEM, TONAR_SKULL, TONAR_RIBBONE, TONAR_SPINE, TONAR_ARMBONE, TONAR_THIGHBONE, TONAR_REMAINS_1, MANAKIA_TOTEM, HERMODT_SKULL, HERMODT_RIBBONE, HERMODT_SPINE, HERMODT_ARMBONE, HERMODT_THIGHBONE, HERMODT_REMAINS_1, RACOY_TOTEM, VIVYAN_LETTER, INSECT_DIAGRAM_BOOK, KIRUNA_SKULL, KIRUNA_RIBBONE, KIRUNA_SPINE, KIRUNA_ARMBONE, KIRUNA_THIGHBONE, KIRUNA_REMAINS_1, BRAKI_REMAINS_2, TONAR_REMAINS_2, HERMODT_REMAINS_2, KIRUNA_REMAINS_2);
-
addStartNpc(SOMAK);
addTalkId(SOMAK, VIVYAN, SARIEN, RACOY, MANAKIA, ORIM, ANCESTOR_MARTANKUS, PEKIRON);
addKillId(NOBLE_ANT, NOBLE_ANT_LEADER, MEDUSA, PORTA, EXCURO, MORDEO, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, TAMLIN_ORC, TAMLIN_ORC_ARCHER, STENOA_GORGON_QUEEN);
@@ -113,64 +108,64 @@ public class Q233_TestOfTheWarSpirit extends Quest
return htmltext;
}
- // SOMAK
- if (event.equals("30510-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30510-05.htm":
{
- htmltext = "30510-05e.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30510-05e.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
+ }
+ case "30630-04.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(ORIM_CONTRACT, 1);
+ break;
+ }
+ case "30507-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(RACOY_TOTEM, 1);
+ break;
+ }
+ case "30030-04.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(VIVYAN_LETTER, 1);
+ break;
+ }
+ case "30682-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(PEKIRON_TOTEM, 1);
+ break;
+ }
+ case "30515-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(MANAKIA_TOTEM, 1);
+ break;
+ }
+ case "30649-03.htm":
+ {
+ st.takeItems(TAMLIN_ORC_HEAD, -1);
+ st.takeItems(WARSPIRIT_TOTEM, -1);
+ st.takeItems(BRAKI_REMAINS_2, -1);
+ st.takeItems(HERMODT_REMAINS_2, -1);
+ st.takeItems(KIRUNA_REMAINS_2, -1);
+ st.takeItems(TONAR_REMAINS_2, -1);
+ st.giveItems(MARK_OF_WARSPIRIT, 1);
+ st.rewardExpAndSp(63483, 17500);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
}
- }
- // ORIM
- else if (event.equals("30630-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(ORIM_CONTRACT, 1);
- }
- // RACOY
- else if (event.equals("30507-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(RACOY_TOTEM, 1);
- }
- // VIVYAN
- else if (event.equals("30030-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(VIVYAN_LETTER, 1);
- }
- // PEKIRON
- else if (event.equals("30682-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(PEKIRON_TOTEM, 1);
- }
- // MANAKIA
- else if (event.equals("30515-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(MANAKIA_TOTEM, 1);
- }
- // ANCESTOR MARTANKUS
- else if (event.equals("30649-03.htm"))
- {
- st.takeItems(TAMLIN_ORC_HEAD, -1);
- st.takeItems(WARSPIRIT_TOTEM, -1);
- st.takeItems(BRAKI_REMAINS_2, -1);
- st.takeItems(HERMODT_REMAINS_2, -1);
- st.takeItems(KIRUNA_REMAINS_2, -1);
- st.takeItems(TONAR_REMAINS_2, -1);
- st.giveItems(MARK_OF_WARSPIRIT, 1);
- st.rewardExpAndSp(63483, 17500);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
}
return htmltext;
@@ -189,6 +184,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId() == ClassId.ORC_SHAMAN)
{
htmltext = (player.getLevel() < 39) ? "30510-03.htm" : "30510-04.htm";
@@ -198,12 +194,14 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = (player.getRace() == Race.ORC) ? "30510-02.htm" : "30510-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SOMAK:
+ {
if (cond == 1)
{
htmltext = "30510-06.htm";
@@ -211,7 +209,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
else if (cond == 2)
{
htmltext = "30510-07.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BRAKI_REMAINS_1, 1);
st.takeItems(HERMODT_REMAINS_1, 1);
@@ -226,7 +224,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
else if (cond == 4)
{
htmltext = "30510-09.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(VENDETTA_TOTEM, 1);
st.giveItems(BRAKI_REMAINS_2, 1);
@@ -240,8 +238,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30510-10.htm";
}
break;
-
+ }
case ORIM:
+ {
if ((cond == 1) && !st.hasQuestItems(BRAKI_REMAINS_1))
{
if (!st.hasQuestItems(ORIM_CONTRACT))
@@ -259,7 +258,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
if (st.hasQuestItems(HERMODT_REMAINS_1, KIRUNA_REMAINS_1, TONAR_REMAINS_1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -277,8 +276,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30630-07.htm";
}
break;
-
+ }
case RACOY:
+ {
if ((cond == 1) && !st.hasQuestItems(KIRUNA_REMAINS_1))
{
if (!st.hasQuestItems(RACOY_TOTEM))
@@ -305,7 +305,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
if (st.hasQuestItems(BRAKI_REMAINS_1, HERMODT_REMAINS_1, TONAR_REMAINS_1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -328,8 +328,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30507-07.htm";
}
break;
-
+ }
case VIVYAN:
+ {
if ((cond == 1) && st.hasQuestItems(RACOY_TOTEM))
{
if (st.hasQuestItems(VIVYAN_LETTER))
@@ -350,8 +351,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30030-07.htm";
}
break;
-
+ }
case SARIEN:
+ {
if ((cond == 1) && st.hasQuestItems(RACOY_TOTEM))
{
if (st.hasQuestItems(VIVYAN_LETTER))
@@ -371,8 +373,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30436-03.htm";
}
break;
-
+ }
case PEKIRON:
+ {
if ((cond == 1) && !st.hasQuestItems(TONAR_REMAINS_1))
{
if (!st.hasQuestItems(PEKIRON_TOTEM))
@@ -392,7 +395,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
if (st.hasQuestItems(BRAKI_REMAINS_1, HERMODT_REMAINS_1, KIRUNA_REMAINS_1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -410,8 +413,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30682-05.htm";
}
break;
-
+ }
case MANAKIA:
+ {
if ((cond == 1) && !st.hasQuestItems(HERMODT_REMAINS_1))
{
if (!st.hasQuestItems(MANAKIA_TOTEM))
@@ -431,7 +435,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
if (st.hasQuestItems(BRAKI_REMAINS_1, KIRUNA_REMAINS_1, TONAR_REMAINS_1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -449,19 +453,23 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30515-05.htm";
}
break;
-
+ }
case ANCESTOR_MARTANKUS:
+ {
if (cond == 5)
{
htmltext = "30649-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -479,28 +487,32 @@ public class Q233_TestOfTheWarSpirit extends Quest
switch (npc.getNpcId())
{
case PORTA:
+ {
if (st.hasQuestItems(ORIM_CONTRACT))
{
st.dropItemsAlways(PORTA_EYE, 1, 10);
}
break;
-
+ }
case EXCURO:
+ {
if (st.hasQuestItems(ORIM_CONTRACT))
{
st.dropItemsAlways(EXCURO_SCALE, 1, 10);
}
break;
-
+ }
case MORDEO:
+ {
if (st.hasQuestItems(ORIM_CONTRACT))
{
st.dropItemsAlways(MORDEO_TALON, 1, 10);
}
break;
-
+ }
case NOBLE_ANT:
case NOBLE_ANT_LEADER:
+ {
if (st.hasQuestItems(INSECT_DIAGRAM_BOOK))
{
final int rndAnt = Rnd.get(100);
@@ -532,9 +544,10 @@ public class Q233_TestOfTheWarSpirit extends Quest
}
}
break;
-
+ }
case LETO_LIZARDMAN_SHAMAN:
case LETO_LIZARDMAN_OVERLORD:
+ {
if (st.hasQuestItems(PEKIRON_TOTEM) && Rnd.nextBoolean())
{
if (!st.hasQuestItems(TONAR_SKULL))
@@ -559,8 +572,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
}
}
break;
-
+ }
case MEDUSA:
+ {
if (st.hasQuestItems(MANAKIA_TOTEM) && Rnd.nextBoolean())
{
if (!st.hasQuestItems(HERMODT_RIBBONE))
@@ -581,21 +595,24 @@ public class Q233_TestOfTheWarSpirit extends Quest
}
}
break;
-
+ }
case STENOA_GORGON_QUEEN:
+ {
if (st.hasQuestItems(MANAKIA_TOTEM))
{
st.dropItemsAlways(HERMODT_SKULL, 1, 1);
}
break;
-
+ }
case TAMLIN_ORC:
case TAMLIN_ORC_ARCHER:
+ {
if (st.hasQuestItems(VENDETTA_TOTEM) && st.dropItems(TAMLIN_ORC_HEAD, 1, 13, 500000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q234_FatesWhisper/Q234_FatesWhisper.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q234_FatesWhisper/Q234_FatesWhisper.java
index 7641b90a71..1f2db3c5d5 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q234_FatesWhisper/Q234_FatesWhisper.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q234_FatesWhisper/Q234_FatesWhisper.java
@@ -34,19 +34,14 @@ public class Q234_FatesWhisper extends Quest
private static final int KERMON_INFERNIUM_SCEPTER = 4667;
private static final int GOLKONDA_INFERNIUM_SCEPTER = 4668;
private static final int HALLATE_INFERNIUM_SCEPTER = 4669;
-
private static final int INFERNIUM_VARNISH = 4672;
private static final int REORIN_HAMMER = 4670;
private static final int REORIN_MOLD = 4671;
-
private static final int PIPETTE_KNIFE = 4665;
private static final int RED_PIPETTE_KNIFE = 4673;
-
private static final int CRYSTAL_B = 1460;
-
// Reward
private static final int STAR_OF_DESTINY = 5011;
-
// Chest Spawn
private static final Map CHEST_SPAWN = new HashMap<>();
static
@@ -56,7 +51,6 @@ public class Q234_FatesWhisper extends Quest
CHEST_SPAWN.put(25126, 31029);
CHEST_SPAWN.put(25220, 31030);
}
-
// Weapons
private static final Map WEAPONS = new HashMap<>();
static
@@ -79,15 +73,11 @@ public class Q234_FatesWhisper extends Quest
public Q234_FatesWhisper()
{
super(234, "Fate's Whisper");
-
registerQuestItems(PIPETTE_KNIFE, RED_PIPETTE_KNIFE);
-
addStartNpc(31002);
addTalkId(31002, 30182, 30847, 30178, 30833, 31028, 31029, 31030, 31027);
-
// The 4 bosses which spawn chests
addKillId(25035, 25054, 25126, 25220);
-
// Baium
addAttackId(29020);
}
@@ -104,9 +94,7 @@ public class Q234_FatesWhisper extends Quest
if (event.equals("31002-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30182-01c.htm"))
{
@@ -115,12 +103,12 @@ public class Q234_FatesWhisper extends Quest
}
else if (event.equals("30178-01a.htm"))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (event.equals("30833-01b.htm"))
{
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(PIPETTE_KNIFE, 1);
}
@@ -183,14 +171,17 @@ public class Q234_FatesWhisper extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 75) ? "31002-01.htm" : "31002-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case 31002:
+ {
if (cond == 1)
{
if (!st.hasQuestItems(REIRIA_SOUL_ORB))
@@ -200,7 +191,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "31002-05.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REIRIA_SOUL_ORB, 1);
}
@@ -214,7 +205,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "31002-06.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GOLKONDA_INFERNIUM_SCEPTER, 1);
st.takeItems(HALLATE_INFERNIUM_SCEPTER, 1);
@@ -230,7 +221,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "31002-07.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(INFERNIUM_VARNISH, 1);
}
@@ -244,7 +235,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "31002-08.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REORIN_HAMMER, 1);
}
@@ -256,7 +247,7 @@ public class Q234_FatesWhisper extends Quest
else if (cond == 8)
{
htmltext = "31002-09.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REORIN_MOLD, 1);
}
@@ -269,7 +260,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "31002-BGradeList.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CRYSTAL_B, 984);
}
@@ -290,15 +281,17 @@ public class Q234_FatesWhisper extends Quest
}
}
break;
-
+ }
case 30182:
+ {
if (cond == 3)
{
htmltext = (!st.hasQuestItems(INFERNIUM_VARNISH)) ? "30182-01.htm" : "30182-02.htm";
}
break;
-
+ }
case 30847:
+ {
if ((cond == 4) && !st.hasQuestItems(REORIN_HAMMER))
{
htmltext = "30847-01.htm";
@@ -310,8 +303,9 @@ public class Q234_FatesWhisper extends Quest
htmltext = "30847-02.htm";
}
break;
-
+ }
case 30178:
+ {
if (cond == 5)
{
htmltext = "30178-01.htm";
@@ -321,8 +315,9 @@ public class Q234_FatesWhisper extends Quest
htmltext = "30178-02.htm";
}
break;
-
+ }
case 30833:
+ {
if (cond == 6)
{
htmltext = "30833-01.htm";
@@ -336,7 +331,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "30833-03.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RED_PIPETTE_KNIFE, 1);
st.giveItems(REORIN_MOLD, 1);
@@ -347,8 +342,9 @@ public class Q234_FatesWhisper extends Quest
htmltext = "30833-04.htm";
}
break;
-
+ }
case 31027:
+ {
if ((cond == 1) && !st.hasQuestItems(REIRIA_SOUL_ORB))
{
htmltext = "31027-01.htm";
@@ -360,10 +356,11 @@ public class Q234_FatesWhisper extends Quest
htmltext = "31027-02.htm";
}
break;
-
+ }
case 31028:
case 31029:
case 31030:
+ {
final int itemId = npc.getNpcId() - 26361;
if ((cond == 2) && !st.hasQuestItems(itemId))
{
@@ -376,12 +373,15 @@ public class Q234_FatesWhisper extends Quest
htmltext = npc.getNpcId() + "-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -390,7 +390,7 @@ public class Q234_FatesWhisper extends Quest
@Override
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
{
- final QuestState st = checkPlayerCondition(attacker, npc, "cond", "7");
+ final QuestState st = checkPlayerCondition(attacker, npc, 7);
if (st == null)
{
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q235_MimirsElixir/Q235_MimirsElixir.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q235_MimirsElixir/Q235_MimirsElixir.java
index 7c691dfe3a..f16a8d0ea8 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q235_MimirsElixir/Q235_MimirsElixir.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q235_MimirsElixir/Q235_MimirsElixir.java
@@ -26,6 +26,10 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q235_MimirsElixir extends Quest
{
+ // NPCs
+ private static final int JOAN = 30718;
+ private static final int LADD = 30721;
+ private static final int MIXING_URN = 31149;
// Items
private static final int STAR_OF_DESTINY = 5011;
private static final int PURE_SILVER = 6320;
@@ -34,24 +38,15 @@ public class Q235_MimirsElixir extends Quest
private static final int BLOOD_FIRE = 6318;
private static final int MIMIR_ELIXIR = 6319;
private static final int MAGISTER_MIXING_STONE = 5905;
-
// Reward
private static final int SCROLL_ENCHANT_WEAPON_A = 729;
- // NPCs
- private static final int JOAN = 30718;
- private static final int LADD = 30721;
- private static final int MIXING_URN = 31149;
-
public Q235_MimirsElixir()
{
super(235, "Mimir's Elixir");
-
registerQuestItems(PURE_SILVER, TRUE_GOLD, SAGE_STONE, BLOOD_FIRE, MAGISTER_MIXING_STONE, MIMIR_ELIXIR);
-
addStartNpc(LADD);
addTalkId(LADD, JOAN, MIXING_URN);
-
addKillId(20965, 21090);
}
@@ -65,76 +60,92 @@ public class Q235_MimirsElixir extends Quest
return htmltext;
}
- if (event.equals("30721-06.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30721-12.htm") && st.hasQuestItems(TRUE_GOLD))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(MAGISTER_MIXING_STONE, 1);
- }
- else if (event.equals("30721-16.htm") && st.hasQuestItems(MIMIR_ELIXIR))
- {
- player.broadcastPacket(new MagicSkillUse(player, player, 4339, 1, 1, 1));
- st.takeItems(MAGISTER_MIXING_STONE, -1);
- st.takeItems(MIMIR_ELIXIR, -1);
- st.takeItems(STAR_OF_DESTINY, -1);
- st.giveItems(SCROLL_ENCHANT_WEAPON_A, 1);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else if (event.equals("30718-03.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31149-02.htm"))
- {
- if (!st.hasQuestItems(MAGISTER_MIXING_STONE))
+ case "30721-06.htm":
{
- htmltext = "31149-havent.htm";
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("31149-03.htm"))
- {
- if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER))
+ case "30721-12.htm":
{
- htmltext = "31149-havent.htm";
+ if (st.hasQuestItems(TRUE_GOLD))
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(MAGISTER_MIXING_STONE, 1);
+ }
+ break;
}
- }
- else if (event.equals("31149-05.htm"))
- {
- if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD))
+ case "30721-16.htm":
{
- htmltext = "31149-havent.htm";
+ if (st.hasQuestItems(MIMIR_ELIXIR))
+ {
+ player.broadcastPacket(new MagicSkillUse(player, player, 4339, 1, 1, 1));
+ st.takeItems(MAGISTER_MIXING_STONE, -1);
+ st.takeItems(MIMIR_ELIXIR, -1);
+ st.takeItems(STAR_OF_DESTINY, -1);
+ st.giveItems(SCROLL_ENCHANT_WEAPON_A, 1);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
}
- }
- else if (event.equals("31149-07.htm"))
- {
- if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD, BLOOD_FIRE))
+ case "30718-03.htm":
{
- htmltext = "31149-havent.htm";
- }
- }
- else if (event.equals("31149-success.htm"))
- {
- if (st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD, BLOOD_FIRE))
- {
- st.set("cond", "8");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PURE_SILVER, -1);
- st.takeItems(TRUE_GOLD, -1);
- st.takeItems(BLOOD_FIRE, -1);
- st.giveItems(MIMIR_ELIXIR, 1);
+ break;
}
- else
+ case "31149-02.htm":
{
- htmltext = "31149-havent.htm";
+ if (!st.hasQuestItems(MAGISTER_MIXING_STONE))
+ {
+ htmltext = "31149-havent.htm";
+ }
+ break;
+ }
+ case "31149-03.htm":
+ {
+ if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER))
+ {
+ htmltext = "31149-havent.htm";
+ }
+ break;
+ }
+ case "31149-05.htm":
+ {
+ if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD))
+ {
+ htmltext = "31149-havent.htm";
+ }
+ break;
+ }
+ case "31149-07.htm":
+ {
+ if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD, BLOOD_FIRE))
+ {
+ htmltext = "31149-havent.htm";
+ }
+ break;
+ }
+ case "31149-success.htm":
+ {
+ if (st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD, BLOOD_FIRE))
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PURE_SILVER, -1);
+ st.takeItems(TRUE_GOLD, -1);
+ st.takeItems(BLOOD_FIRE, -1);
+ st.giveItems(MIMIR_ELIXIR, 1);
+ }
+ else
+ {
+ htmltext = "31149-havent.htm";
+ }
+ break;
}
}
@@ -154,6 +165,7 @@ public class Q235_MimirsElixir extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 75)
{
htmltext = "30721-01b.htm";
@@ -167,18 +179,20 @@ public class Q235_MimirsElixir extends Quest
htmltext = "30721-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LADD:
+ {
if (cond == 1)
{
if (st.hasQuestItems(PURE_SILVER))
{
htmltext = "30721-08.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -203,8 +217,9 @@ public class Q235_MimirsElixir extends Quest
htmltext = "30721-14.htm";
}
break;
-
+ }
case JOAN:
+ {
if (cond == 2)
{
htmltext = "30718-01.htm";
@@ -216,7 +231,7 @@ public class Q235_MimirsElixir extends Quest
else if ((cond == 4) && st.hasQuestItems(SAGE_STONE))
{
htmltext = "30718-05.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SAGE_STONE, -1);
st.giveItems(TRUE_GOLD, 1);
@@ -226,17 +241,21 @@ public class Q235_MimirsElixir extends Quest
htmltext = "30718-06.htm";
}
break;
-
+ }
// The urn gives the same first htm. Bypasses' events will do all the job.
case MIXING_URN:
+ {
htmltext = "31149-01.htm";
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -254,18 +273,21 @@ public class Q235_MimirsElixir extends Quest
switch (npc.getNpcId())
{
case 20965:
- if ((st.getInt("cond") == 3) && st.dropItems(SAGE_STONE, 1, 1, 200000))
+ {
+ if (st.isCond(3) && st.dropItems(SAGE_STONE, 1, 1, 200000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case 21090:
- if ((st.getInt("cond") == 6) && st.dropItems(BLOOD_FIRE, 1, 1, 200000))
+ {
+ if (st.isCond(6) && st.dropItems(BLOOD_FIRE, 1, 1, 200000))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q241_PossessorOfAPreciousSoul/Q241_PossessorOfAPreciousSoul.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q241_PossessorOfAPreciousSoul/Q241_PossessorOfAPreciousSoul.java
index 3507f5c562..878d2f01d2 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q241_PossessorOfAPreciousSoul/Q241_PossessorOfAPreciousSoul.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q241_PossessorOfAPreciousSoul/Q241_PossessorOfAPreciousSoul.java
@@ -37,7 +37,6 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
private static final int KASSANDRA = 31743;
private static final int CARADINE = 31740;
private static final int NOEL = 31272;
-
// Monsters
private static final int BARAHAM = 27113;
private static final int MALRUK_SUCCUBUS_1 = 20244;
@@ -49,7 +48,6 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
private static final int SPLINTER_STAKATO_SOLDIER = 21510;
private static final int SPLINTER_STAKATO_DRONE_1 = 21511;
private static final int SPLINTER_STAKATO_DRONE_2 = 21512;
-
// Items
private static final int LEGEND_OF_SEVENTEEN = 7587;
private static final int MALRUK_SUCCUBUS_CLAW = 7597;
@@ -64,12 +62,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
public Q241_PossessorOfAPreciousSoul()
{
super(241, "Possessor of a Precious Soul - 1");
-
registerQuestItems(LEGEND_OF_SEVENTEEN, MALRUK_SUCCUBUS_CLAW, ECHO_CRYSTAL, POETRY_BOOK, CRIMSON_MOSS, RAHORAKTI_MEDICINE);
-
addStartNpc(TALIEN);
addTalkId(TALIEN, GABRIELLE, GILMORE, KANTABILON, STEDMIEL, VIRGIL, OGMAR, RAHORAKTI, KASSANDRA, CARADINE, NOEL);
-
addKillId(BARAHAM, MALRUK_SUCCUBUS_1, MALRUK_SUCCUBUS_2, MALRUK_SUCCUBUS_TUREN_1, MALRUK_SUCCUBUS_TUREN_2, SPLINTER_STAKATO, SPLINTER_STAKATO_WALKER, SPLINTER_STAKATO_SOLDIER, SPLINTER_STAKATO_DRONE_1, SPLINTER_STAKATO_DRONE_2);
}
@@ -83,132 +78,141 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
return htmltext;
}
- // Talien
- if (event.equals("31739-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31739-07.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LEGEND_OF_SEVENTEEN, 1);
- }
- else if (event.equals("31739-10.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ECHO_CRYSTAL, 1);
- }
- else if (event.equals("31739-13.htm"))
- {
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(POETRY_BOOK, 1);
- }
- // Gabrielle
- else if (event.equals("30753-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Gilmore
- else if (event.equals("30754-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Kantabilon
- else if (event.equals("31042-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31042-05.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MALRUK_SUCCUBUS_CLAW, -1);
- st.giveItems(ECHO_CRYSTAL, 1);
- }
- // Stedmiel
- else if (event.equals("30692-02.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(POETRY_BOOK, 1);
- }
- // Virgil
- else if (event.equals("31742-02.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31742-05.htm"))
- {
- st.set("cond", "18");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Ogmar
- else if (event.equals("31744-02.htm"))
- {
- st.set("cond", "13");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Rahorakti
- else if (event.equals("31336-02.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31336-05.htm"))
- {
- st.set("cond", "16");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRIMSON_MOSS, -1);
- st.giveItems(RAHORAKTI_MEDICINE, 1);
- }
- // Kassandra
- else if (event.equals("31743-02.htm"))
- {
- st.set("cond", "17");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RAHORAKTI_MEDICINE, 1);
- }
- // Caradine
- else if (event.equals("31740-02.htm"))
- {
- st.set("cond", "19");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31740-05.htm"))
- {
- st.giveItems(VIRGIL_LETTER, 1);
- st.rewardExpAndSp(263043, 0);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- // Noel
- else if (event.equals("31272-02.htm"))
- {
- st.set("cond", "20");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31272-05.htm"))
- {
- if (st.hasQuestItems(HELLFIRE_OIL) && (st.getQuestItemsCount(LUNARGENT) >= 5))
+ case "31739-03.htm":
{
- st.set("cond", "21");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LUNARGENT, 5);
- st.takeItems(HELLFIRE_OIL, 1);
+ st.startQuest();
+ break;
}
- else
+ case "31739-07.htm":
{
- htmltext = "31272-07.htm";
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LEGEND_OF_SEVENTEEN, 1);
+ break;
+ }
+ case "31739-10.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ECHO_CRYSTAL, 1);
+ break;
+ }
+ case "31739-13.htm":
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(POETRY_BOOK, 1);
+ break;
+ }
+ case "30753-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30754-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31042-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31042-05.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MALRUK_SUCCUBUS_CLAW, -1);
+ st.giveItems(ECHO_CRYSTAL, 1);
+ break;
+ }
+ case "30692-02.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(POETRY_BOOK, 1);
+ break;
+ }
+ case "31742-02.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31742-05.htm":
+ {
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31744-02.htm":
+ {
+ st.setCond(13);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31336-02.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31336-05.htm":
+ {
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRIMSON_MOSS, -1);
+ st.giveItems(RAHORAKTI_MEDICINE, 1);
+ break;
+ }
+ case "31743-02.htm":
+ {
+ st.setCond(17);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RAHORAKTI_MEDICINE, 1);
+ break;
+ }
+ case "31740-02.htm":
+ {
+ st.setCond(19);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31740-05.htm":
+ {
+ st.giveItems(VIRGIL_LETTER, 1);
+ st.rewardExpAndSp(263043, 0);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "31272-02.htm":
+ {
+ st.setCond(20);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31272-05.htm":
+ {
+ if (st.hasQuestItems(HELLFIRE_OIL) && (st.getQuestItemsCount(LUNARGENT) >= 5))
+ {
+ st.setCond(21);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LUNARGENT, 5);
+ st.takeItems(HELLFIRE_OIL, 1);
+ }
+ else
+ {
+ htmltext = "31272-07.htm";
+ }
+ break;
}
}
return htmltext;
@@ -227,19 +231,22 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (!player.isSubClassActive() || (player.getLevel() < 50)) ? "31739-02.htm" : "31739-01.htm";
break;
-
+ }
case State.STARTED:
+ {
if (!player.isSubClassActive())
{
break;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case TALIEN:
+ {
if (cond == 1)
{
htmltext = "31739-04.htm";
@@ -273,8 +280,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31739-14.htm";
}
break;
-
+ }
case GABRIELLE:
+ {
if (cond == 1)
{
htmltext = "30753-01.htm";
@@ -284,8 +292,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "30753-03.htm";
}
break;
-
+ }
case GILMORE:
+ {
if (cond == 2)
{
htmltext = "30754-01.htm";
@@ -295,8 +304,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "30754-03.htm";
}
break;
-
+ }
case KANTABILON:
+ {
if (cond == 5)
{
htmltext = "31042-01.htm";
@@ -314,8 +324,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31042-06.htm";
}
break;
-
+ }
case STEDMIEL:
+ {
if (cond == 9)
{
htmltext = "30692-01.htm";
@@ -325,8 +336,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "30692-03.htm";
}
break;
-
+ }
case VIRGIL:
+ {
if (cond == 11)
{
htmltext = "31742-01.htm";
@@ -344,8 +356,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31742-06.htm";
}
break;
-
+ }
case OGMAR:
+ {
if (cond == 12)
{
htmltext = "31744-01.htm";
@@ -355,8 +368,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31744-03.htm";
}
break;
-
+ }
case RAHORAKTI:
+ {
if (cond == 13)
{
htmltext = "31336-01.htm";
@@ -374,8 +388,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31336-06.htm";
}
break;
-
+ }
case KASSANDRA:
+ {
if (cond == 16)
{
htmltext = "31743-01.htm";
@@ -385,8 +400,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31743-03.htm";
}
break;
-
+ }
case CARADINE:
+ {
if (cond == 18)
{
htmltext = "31740-01.htm";
@@ -400,8 +416,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31740-04.htm";
}
break;
-
+ }
case NOEL:
+ {
if (cond == 19)
{
htmltext = "31272-01.htm";
@@ -422,12 +439,15 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31272-06.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -444,40 +464,45 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
switch (npc.getNpcId())
{
case BARAHAM:
- if (st.getInt("cond") == 3)
+ {
+ if (st.isCond(3))
{
- st.set("cond", "4");
+ st.setCond(4);
st.giveItems(LEGEND_OF_SEVENTEEN, 1);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
-
+ }
case MALRUK_SUCCUBUS_1:
case MALRUK_SUCCUBUS_2:
- if ((st.getInt("cond") == 6) && st.dropItems(MALRUK_SUCCUBUS_CLAW, 1, 10, 100000))
+ {
+ if (st.isCond(6) && st.dropItems(MALRUK_SUCCUBUS_CLAW, 1, 10, 100000))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case MALRUK_SUCCUBUS_TUREN_1:
case MALRUK_SUCCUBUS_TUREN_2:
- if ((st.getInt("cond") == 6) && st.dropItems(MALRUK_SUCCUBUS_CLAW, 1, 10, 120000))
+ {
+ if (st.isCond(6) && st.dropItems(MALRUK_SUCCUBUS_CLAW, 1, 10, 120000))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case SPLINTER_STAKATO:
case SPLINTER_STAKATO_WALKER:
case SPLINTER_STAKATO_SOLDIER:
case SPLINTER_STAKATO_DRONE_1:
case SPLINTER_STAKATO_DRONE_2:
- if ((st.getInt("cond") == 14) && st.dropItems(CRIMSON_MOSS, 1, 5, 100000))
+ {
+ if (st.isCond(14) && st.dropItems(CRIMSON_MOSS, 1, 5, 100000))
{
- st.set("cond", "15");
+ st.setCond(15);
}
break;
+ }
}
return null;
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q242_PossessorOfAPreciousSoul/Q242_PossessorOfAPreciousSoul.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q242_PossessorOfAPreciousSoul/Q242_PossessorOfAPreciousSoul.java
index fac7457703..6c51e414f7 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q242_PossessorOfAPreciousSoul/Q242_PossessorOfAPreciousSoul.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q242_PossessorOfAPreciousSoul/Q242_PossessorOfAPreciousSoul.java
@@ -36,28 +36,23 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
private static final int CORNERSTONE = 31748;
private static final int FALLEN_UNICORN = 31746;
private static final int PURE_UNICORN = 31747;
-
// Monsters
private static final int RESTRAINER_OF_GLORY = 27317;
-
// Items
private static final int VIRGIL_LETTER = 7677;
private static final int GOLDEN_HAIR = 7590;
private static final int SORCERY_INGREDIENT = 7596;
private static final int ORB_OF_BINDING = 7595;
private static final int CARADINE_LETTER = 7678;
-
+ // Misc
private static boolean _unicorn = false;
public Q242_PossessorOfAPreciousSoul()
{
super(242, "Possessor of a Precious Soul - 2");
-
registerQuestItems(GOLDEN_HAIR, SORCERY_INGREDIENT, ORB_OF_BINDING);
-
addStartNpc(VIRGIL);
addTalkId(VIRGIL, KASSANDRA, OGMAR, MYSTERIOUS_KNIGHT, ANGEL_CORPSE, KALIS, MATILD, CORNERSTONE, FALLEN_UNICORN, PURE_UNICORN);
-
addKillId(RESTRAINER_OF_GLORY);
}
@@ -71,102 +66,103 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
return htmltext;
}
- // Kasandra
- if (event.equals("31743-05.htm"))
+ switch (event)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Ogmar
- else if (event.equals("31744-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Mysterious Knight
- else if (event.equals("31751-02.htm"))
- {
- st.set("cond", "4");
- st.set("angel", "0");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Kalis
- else if (event.equals("30759-02.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30759-05.htm"))
- {
- if (st.hasQuestItems(SORCERY_INGREDIENT))
+ case "31743-05.htm":
{
- st.set("orb", "0");
- st.set("cornerstone", "0");
- st.set("cond", "9");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GOLDEN_HAIR, 1);
- st.takeItems(SORCERY_INGREDIENT, 1);
+ break;
}
- else
+ case "31744-02.htm":
{
- st.set("cond", "7");
- htmltext = "30759-02.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- // Matild
- else if (event.equals("30738-02.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(SORCERY_INGREDIENT, 1);
- }
- // Cornerstone
- else if (event.equals("31748-03.htm"))
- {
- if (st.hasQuestItems(ORB_OF_BINDING))
+ case "31751-02.htm":
{
- npc.doDie(npc);
- st.takeItems(ORB_OF_BINDING, 1);
-
- int cornerstones = st.getInt("cornerstone");
- cornerstones++;
- if (cornerstones == 4)
+ st.setCond(4);
+ st.set("angel", "0");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30759-02.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30759-05.htm":
+ {
+ if (st.hasQuestItems(SORCERY_INGREDIENT))
{
- st.unset("orb");
- st.unset("cornerstone");
- st.set("cond", "10");
+ st.set("orb", "0");
+ st.set("cornerstone", "0");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GOLDEN_HAIR, 1);
+ st.takeItems(SORCERY_INGREDIENT, 1);
}
else
{
- st.set("cornerstone", Integer.toString(cornerstones));
+ st.setCond(7);
+ htmltext = "30759-02.htm";
}
+ break;
}
- else
+ case "30738-02.htm":
{
- htmltext = null;
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(SORCERY_INGREDIENT, 1);
+ break;
+ }
+ case "31748-03.htm":
+ {
+ if (st.hasQuestItems(ORB_OF_BINDING))
+ {
+ npc.doDie(npc);
+ st.takeItems(ORB_OF_BINDING, 1);
+
+ int cornerstones = st.getInt("cornerstone");
+ cornerstones++;
+ if (cornerstones == 4)
+ {
+ st.unset("orb");
+ st.unset("cornerstone");
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.set("cornerstone", Integer.toString(cornerstones));
+ }
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
+ }
+ case "spu":
+ {
+ addSpawn(PURE_UNICORN, 85884, -76588, -3470, 0, false, 0);
+ return null;
+ }
+ case "dspu":
+ {
+ npc.getSpawn().stopRespawn();
+ npc.deleteMe();
+ startQuestTimer("sfu", 2000, null, player, false);
+ return null;
+ }
+ case "sfu":
+ {
+ final NpcInstance unicorn = addSpawn(FALLEN_UNICORN, 85884, -76588, -3470, 0, false, 0);
+ unicorn.getSpawn().startRespawn();
+ return null;
}
- }
- // Spawn Pure Unicorn
- else if (event.equals("spu"))
- {
- addSpawn(PURE_UNICORN, 85884, -76588, -3470, 0, false, 0);
- return null;
- }
- // Despawn Pure Unicorn
- else if (event.equals("dspu"))
- {
- npc.getSpawn().stopRespawn();
- npc.deleteMe();
- startQuestTimer("sfu", 2000, null, player, false);
- return null;
- }
- // Spawn Fallen Unicorn
- else if (event.equals("sfu"))
- {
- final NpcInstance unicorn = addSpawn(FALLEN_UNICORN, 85884, -76588, -3470, 0, false, 0);
- unicorn.getSpawn().startRespawn();
- return null;
}
return htmltext;
@@ -185,6 +181,7 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (st.hasQuestItems(VIRGIL_LETTER))
{
if (!player.isSubClassActive() || (player.getLevel() < 60))
@@ -193,25 +190,25 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
}
else
{
- htmltext = "31742-03.htm";
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.takeItems(VIRGIL_LETTER, 1);
+ htmltext = "31742-03.htm";
}
}
break;
-
+ }
case State.STARTED:
+ {
if (!player.isSubClassActive())
{
break;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VIRGIL:
+ {
if (cond == 1)
{
htmltext = "31742-04.htm";
@@ -221,8 +218,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31742-05.htm";
}
break;
-
+ }
case KASSANDRA:
+ {
if (cond == 1)
{
htmltext = "31743-01.htm";
@@ -241,8 +239,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
st.exitQuest(false);
}
break;
-
+ }
case OGMAR:
+ {
if (cond == 2)
{
htmltext = "31744-01.htm";
@@ -252,8 +251,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31744-03.htm";
}
break;
-
+ }
case MYSTERIOUS_KNIGHT:
+ {
if (cond == 3)
{
htmltext = "31751-01.htm";
@@ -267,13 +267,13 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
if (st.hasQuestItems(GOLDEN_HAIR))
{
htmltext = "31751-04.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
{
htmltext = "31751-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
}
}
else if (cond == 6)
@@ -281,8 +281,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31751-05.htm";
}
break;
-
+ }
case ANGEL_CORPSE:
+ {
if (cond == 4)
{
npc.doDie(npc);
@@ -293,7 +294,7 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
{
htmltext = "31752-02.htm";
st.unset("angel");
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(GOLDEN_HAIR, 1);
}
@@ -308,8 +309,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31752-01.htm";
}
break;
-
+ }
case KALIS:
+ {
if (cond == 6)
{
htmltext = "30759-01.htm";
@@ -327,7 +329,7 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
else
{
htmltext = "30759-03.htm";
- st.set("cond", "7");
+ st.setCond(7);
}
}
else if (cond == 9)
@@ -335,8 +337,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "30759-06.htm";
}
break;
-
+ }
case MATILD:
+ {
if (cond == 7)
{
htmltext = "30738-01.htm";
@@ -346,8 +349,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "30738-03.htm";
}
break;
-
+ }
case CORNERSTONE:
+ {
if (cond == 9)
{
if (st.hasQuestItems(ORB_OF_BINDING))
@@ -360,8 +364,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
}
}
break;
-
+ }
case FALLEN_UNICORN:
+ {
if (cond == 9)
{
htmltext = "31746-01.htm";
@@ -378,11 +383,12 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31746-02.htm";
}
break;
-
+ }
case PURE_UNICORN:
+ {
if (cond == 10)
{
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
if (_unicorn) // Global variable check to prevent multiple spawns
{
@@ -396,12 +402,15 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31747-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -409,7 +418,7 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "9");
+ final QuestState st = checkPlayerCondition(player, npc, 9);
if ((st == null) || !player.isSubClassActive())
{
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q246_PossessorOfAPreciousSoul/Q246_PossessorOfAPreciousSoul.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q246_PossessorOfAPreciousSoul/Q246_PossessorOfAPreciousSoul.java
index e00cf5ee5f..8728cd40d7 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q246_PossessorOfAPreciousSoul/Q246_PossessorOfAPreciousSoul.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q246_PossessorOfAPreciousSoul/Q246_PossessorOfAPreciousSoul.java
@@ -30,7 +30,10 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
private static final int CARADINE = 31740;
private static final int OSSIAN = 31741;
private static final int LADD = 30721;
-
+ // Monsters
+ private static final int PILGRIM_OF_SPLENDOR = 21541;
+ private static final int JUDGE_OF_SPLENDOR = 21544;
+ private static final int BARAKIEL = 25325;
// Items
private static final int WATERBINDER = 7591;
private static final int EVERGREEN = 7592;
@@ -39,20 +42,12 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
private static final int CARADINE_LETTER_1 = 7678;
private static final int CARADINE_LETTER_2 = 7679;
- // Mobs
- private static final int PILGRIM_OF_SPLENDOR = 21541;
- private static final int JUDGE_OF_SPLENDOR = 21544;
- private static final int BARAKIEL = 25325;
-
public Q246_PossessorOfAPreciousSoul()
{
super(246, "Possessor of a Precious Soul - 3");
-
registerQuestItems(WATERBINDER, EVERGREEN, RAIN_SONG, RELIC_BOX);
-
addStartNpc(CARADINE);
addTalkId(CARADINE, OSSIAN, LADD);
-
addKillId(PILGRIM_OF_SPLENDOR, JUDGE_OF_SPLENDOR, BARAKIEL);
}
@@ -66,63 +61,66 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
return htmltext;
}
- // Caradine
- if (event.equals("31740-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.takeItems(CARADINE_LETTER_1, 1);
- }
- // Ossian
- else if (event.equals("31741-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31741-05.htm"))
- {
- if (st.hasQuestItems(WATERBINDER, EVERGREEN))
+ case "31740-04.htm":
{
- st.set("cond", "4");
+ st.startQuest();
+ st.takeItems(CARADINE_LETTER_1, 1);
+ break;
+ }
+ case "31741-02.htm":
+ {
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WATERBINDER, 1);
- st.takeItems(EVERGREEN, 1);
+ break;
}
- else
+ case "31741-05.htm":
{
- htmltext = null;
+ if (st.hasQuestItems(WATERBINDER, EVERGREEN))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WATERBINDER, 1);
+ st.takeItems(EVERGREEN, 1);
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
}
- }
- else if (event.equals("31741-08.htm"))
- {
- if (st.hasQuestItems(RAIN_SONG))
+ case "31741-08.htm":
{
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RAIN_SONG, 1);
- st.giveItems(RELIC_BOX, 1);
+ if (st.hasQuestItems(RAIN_SONG))
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RAIN_SONG, 1);
+ st.giveItems(RELIC_BOX, 1);
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
}
- else
+ case "30721-02.htm":
{
- htmltext = null;
- }
- }
- // Ladd
- else if (event.equals("30721-02.htm"))
- {
- if (st.hasQuestItems(RELIC_BOX))
- {
- st.takeItems(RELIC_BOX, 1);
- st.giveItems(CARADINE_LETTER_2, 1);
- st.rewardExpAndSp(719843, 0);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = null;
+ if (st.hasQuestItems(RELIC_BOX))
+ {
+ st.takeItems(RELIC_BOX, 1);
+ st.giveItems(CARADINE_LETTER_2, 1);
+ st.rewardExpAndSp(719843, 0);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
}
}
@@ -142,29 +140,33 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (st.hasQuestItems(CARADINE_LETTER_1))
{
htmltext = (!player.isSubClassActive() || (player.getLevel() < 65)) ? "31740-02.htm" : "31740-01.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (!player.isSubClassActive())
{
break;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case CARADINE:
+ {
if (cond == 1)
{
htmltext = "31740-05.htm";
}
break;
-
+ }
case OSSIAN:
+ {
if (cond == 1)
{
htmltext = "31741-01.htm";
@@ -196,19 +198,23 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
htmltext = "31741-09.htm";
}
break;
-
+ }
case LADD:
+ {
if ((cond == 6) && st.hasQuestItems(RELIC_BOX))
{
htmltext = "30721-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -219,7 +225,7 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
final int npcId = npc.getNpcId();
if (npcId == BARAKIEL)
{
- for (PlayerInstance plr : getPartyMembers(player, npc, "cond", "4"))
+ for (PlayerInstance plr : getPartyMembers(player, npc, 4))
{
if (!plr.isSubClassActive())
{
@@ -229,7 +235,7 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
final QuestState st = plr.getQuestState(getName());
if (!st.hasQuestItems(RAIN_SONG))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(RAIN_SONG, 1);
}
@@ -242,7 +248,7 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
return null;
}
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -260,7 +266,7 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
}
else
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q247_PossessorOfAPreciousSoul/Q247_PossessorOfAPreciousSoul.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q247_PossessorOfAPreciousSoul/Q247_PossessorOfAPreciousSoul.java
index 9f0a69894f..0a67a1b1e1 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q247_PossessorOfAPreciousSoul/Q247_PossessorOfAPreciousSoul.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q247_PossessorOfAPreciousSoul/Q247_PossessorOfAPreciousSoul.java
@@ -28,7 +28,6 @@ public class Q247_PossessorOfAPreciousSoul extends Quest
// NPCs
private static final int CARADINE = 31740;
private static final int LADY_OF_THE_LAKE = 31745;
-
// Items
private static final int CARADINE_LETTER = 7679;
private static final int NOBLESS_TIARA = 7694;
@@ -36,7 +35,6 @@ public class Q247_PossessorOfAPreciousSoul extends Quest
public Q247_PossessorOfAPreciousSoul()
{
super(247, "Possessor of a Precious Soul - 4");
-
addStartNpc(CARADINE);
addTalkId(CARADINE, LADY_OF_THE_LAKE);
}
@@ -51,28 +49,30 @@ public class Q247_PossessorOfAPreciousSoul extends Quest
return htmltext;
}
- // Caradine
- if (event.equals("31740-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.takeItems(CARADINE_LETTER, 1);
- }
- else if (event.equals("31740-05.htm"))
- {
- st.set("cond", "2");
- player.teleToLocation(143209, 43968, -3038);
- }
- // Lady of the lake
- else if (event.equals("31745-05.htm"))
- {
- player.setNoble(true);
- st.giveItems(NOBLESS_TIARA, 1);
- st.rewardExpAndSp(93836, 0);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31740-03.htm":
+ {
+ st.startQuest();
+ st.takeItems(CARADINE_LETTER, 1);
+ break;
+ }
+ case "31740-05.htm":
+ {
+ st.setCond(2);
+ player.teleToLocation(143209, 43968, -3038);
+ break;
+ }
+ case "31745-05.htm":
+ {
+ player.setNoble(true);
+ st.giveItems(NOBLESS_TIARA, 1);
+ st.rewardExpAndSp(93836, 0);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -91,22 +91,25 @@ public class Q247_PossessorOfAPreciousSoul extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (st.hasQuestItems(CARADINE_LETTER))
{
htmltext = (!player.isSubClassActive() || (player.getLevel() < 75)) ? "31740-02.htm" : "31740-01.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (!player.isSubClassActive())
{
break;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case CARADINE:
+ {
if (cond == 1)
{
htmltext = "31740-04.htm";
@@ -116,19 +119,23 @@ public class Q247_PossessorOfAPreciousSoul extends Quest
htmltext = "31740-06.htm";
}
break;
-
+ }
case LADY_OF_THE_LAKE:
+ {
if (cond == 2)
{
htmltext = (player.getLevel() < 75) ? "31745-06.htm" : "31745-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q257_TheGuardIsBusy/Q257_TheGuardIsBusy.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q257_TheGuardIsBusy/Q257_TheGuardIsBusy.java
index 07841b7adb..3940a9f94e 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q257_TheGuardIsBusy/Q257_TheGuardIsBusy.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q257_TheGuardIsBusy/Q257_TheGuardIsBusy.java
@@ -29,7 +29,6 @@ public class Q257_TheGuardIsBusy extends Quest
private static final int ORC_AMULET = 752;
private static final int ORC_NECKLACE = 1085;
private static final int WEREWOLF_FANG = 1086;
-
// Newbie Items
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
@@ -37,12 +36,9 @@ public class Q257_TheGuardIsBusy extends Quest
public Q257_TheGuardIsBusy()
{
super(257, "The Guard is Busy");
-
registerQuestItems(ORC_AMULET, ORC_NECKLACE, WEREWOLF_FANG, GLUDIO_LORD_MARK);
-
addStartNpc(30039); // Gilbert
addTalkId(30039);
-
addKillId(20006, 20093, 20096, 20098, 20130, 20131, 20132, 20342, 20343);
}
@@ -58,9 +54,7 @@ public class Q257_TheGuardIsBusy extends Quest
if (event.equals("30039-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(GLUDIO_LORD_MARK, 1);
}
else if (event.equals("30039-05.htm"))
@@ -86,10 +80,12 @@ public class Q257_TheGuardIsBusy extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 6) ? "30039-01.htm" : "30039-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int amulets = st.getQuestItemsCount(ORC_AMULET);
final int necklaces = st.getQuestItemsCount(ORC_NECKLACE);
final int fangs = st.getQuestItemsCount(WEREWOLF_FANG);
@@ -132,6 +128,7 @@ public class Q257_TheGuardIsBusy extends Quest
}
}
break;
+ }
}
return htmltext;
@@ -151,26 +148,32 @@ public class Q257_TheGuardIsBusy extends Quest
case 20006:
case 20130:
case 20131:
+ {
st.dropItems(ORC_AMULET, 1, 0, 500000);
break;
-
+ }
case 20093:
case 20096:
case 20098:
+ {
st.dropItems(ORC_NECKLACE, 1, 0, 500000);
break;
-
+ }
case 20342:
+ {
st.dropItems(WEREWOLF_FANG, 1, 0, 200000);
break;
-
+ }
case 20343:
+ {
st.dropItems(WEREWOLF_FANG, 1, 0, 400000);
break;
-
+ }
case 20132:
+ {
st.dropItems(WEREWOLF_FANG, 1, 0, 500000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q258_BringWolfPelts/Q258_BringWolfPelts.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q258_BringWolfPelts/Q258_BringWolfPelts.java
index 905fe8405f..c7c814d38c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q258_BringWolfPelts/Q258_BringWolfPelts.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q258_BringWolfPelts/Q258_BringWolfPelts.java
@@ -27,7 +27,6 @@ public class Q258_BringWolfPelts extends Quest
{
// Item
private static final int WOLF_PELT = 702;
-
// Rewards
private static final int COTTON_SHIRT = 390;
private static final int LEATHER_PANTS = 29;
@@ -38,12 +37,9 @@ public class Q258_BringWolfPelts extends Quest
public Q258_BringWolfPelts()
{
super(258, "Bring Wolf Pelts");
-
registerQuestItems(WOLF_PELT);
-
addStartNpc(30001); // Lector
addTalkId(30001);
-
addKillId(20120, 20442); // Wolf, Elder Wolf
}
@@ -59,9 +55,7 @@ public class Q258_BringWolfPelts extends Quest
if (event.equals("30001-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -80,10 +74,12 @@ public class Q258_BringWolfPelts extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 3) ? "30001-01.htm" : "30001-02.htm";
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(WOLF_PELT) < 40)
{
htmltext = "30001-05.htm";
@@ -129,6 +125,7 @@ public class Q258_BringWolfPelts extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -137,7 +134,7 @@ public class Q258_BringWolfPelts extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -145,7 +142,7 @@ public class Q258_BringWolfPelts extends Quest
if (st.dropItemsAlways(WOLF_PELT, 1, 40))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q259_RanchersPlea/Q259_RanchersPlea.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q259_RanchersPlea/Q259_RanchersPlea.java
index 3e132e334b..8e02f4e5bd 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q259_RanchersPlea/Q259_RanchersPlea.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q259_RanchersPlea/Q259_RanchersPlea.java
@@ -27,15 +27,12 @@ public class Q259_RanchersPlea extends Quest
// NPCs
private static final int EDMOND = 30497;
private static final int MARIUS = 30405;
-
// Monsters
private static final int GIANT_SPIDER = 20103;
private static final int TALON_SPIDER = 20106;
private static final int BLADE_SPIDER = 20108;
-
// Items
private static final int GIANT_SPIDER_SKIN = 1495;
-
// Rewards
private static final int ADENA = 57;
private static final int HEALING_POTION = 1061;
@@ -44,12 +41,9 @@ public class Q259_RanchersPlea extends Quest
public Q259_RanchersPlea()
{
super(259, "Rancher's Plea");
-
registerQuestItems(GIANT_SPIDER_SKIN);
-
addStartNpc(EDMOND);
addTalkId(EDMOND, MARIUS);
-
addKillId(GIANT_SPIDER, TALON_SPIDER, BLADE_SPIDER);
}
@@ -63,46 +57,52 @@ public class Q259_RanchersPlea extends Quest
return htmltext;
}
- if (event.equals("30497-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30497-06.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30405-04.htm"))
- {
- if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ case "30497-03.htm":
{
- st.takeItems(GIANT_SPIDER_SKIN, 10);
- st.rewardItems(HEALING_POTION, 1);
+ st.startQuest();
+ break;
}
- else
+ case "30497-06.htm":
{
- htmltext = "Incorrect item count";
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30405-05.htm"))
- {
- if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ case "30405-04.htm":
{
- st.takeItems(GIANT_SPIDER_SKIN, 10);
- st.rewardItems(WOODEN_ARROW, 50);
+ if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ {
+ st.takeItems(GIANT_SPIDER_SKIN, 10);
+ st.rewardItems(HEALING_POTION, 1);
+ }
+ else
+ {
+ htmltext = "Incorrect item count";
+ }
+ break;
}
- else
+ case "30405-05.htm":
{
- htmltext = "Incorrect item count";
+ if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ {
+ st.takeItems(GIANT_SPIDER_SKIN, 10);
+ st.rewardItems(WOODEN_ARROW, 50);
+ }
+ else
+ {
+ htmltext = "Incorrect item count";
+ }
+ break;
}
- }
- else if (event.equals("30405-07.htm"))
- {
- if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ case "30405-07.htm":
{
- htmltext = "30405-06.htm";
+ if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ {
+ htmltext = "30405-06.htm";
+ }
+ break;
}
}
@@ -122,14 +122,17 @@ public class Q259_RanchersPlea extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30497-01.htm" : "30497-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int count = st.getQuestItemsCount(GIANT_SPIDER_SKIN);
switch (npc.getNpcId())
{
case EDMOND:
+ {
if (count == 0)
{
htmltext = "30497-04.htm";
@@ -141,12 +144,15 @@ public class Q259_RanchersPlea extends Quest
st.rewardItems(ADENA, ((count >= 10) ? 250 : 0) + (count * 25));
}
break;
-
+ }
case MARIUS:
+ {
htmltext = (count < 10) ? "30405-01.htm" : "30405-02.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q260_HuntTheOrcs/Q260_HuntTheOrcs.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q260_HuntTheOrcs/Q260_HuntTheOrcs.java
index 49cb535810..20688c6d5f 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q260_HuntTheOrcs/Q260_HuntTheOrcs.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q260_HuntTheOrcs/Q260_HuntTheOrcs.java
@@ -27,11 +27,6 @@ public class Q260_HuntTheOrcs extends Quest
{
// NPC
private static final int RAYEN = 30221;
-
- // Items
- private static final int ORC_AMULET = 1114;
- private static final int ORC_NECKLACE = 1115;
-
// Monsters
private static final int KABOO_ORC = 20468;
private static final int KABOO_ORC_ARCHER = 20469;
@@ -39,16 +34,16 @@ public class Q260_HuntTheOrcs extends Quest
private static final int KABOO_ORC_FIGHTER = 20471;
private static final int KABOO_ORC_FIGHTER_LEADER = 20472;
private static final int KABOO_ORC_FIGHTER_LIEUTENANT = 20473;
+ // Items
+ private static final int ORC_AMULET = 1114;
+ private static final int ORC_NECKLACE = 1115;
public Q260_HuntTheOrcs()
{
super(260, "Hunt the Orcs");
-
registerQuestItems(ORC_AMULET, ORC_NECKLACE);
-
addStartNpc(RAYEN);
addTalkId(RAYEN);
-
addKillId(KABOO_ORC, KABOO_ORC_ARCHER, KABOO_ORC_GRUNT, KABOO_ORC_FIGHTER, KABOO_ORC_FIGHTER_LEADER, KABOO_ORC_FIGHTER_LIEUTENANT);
}
@@ -64,9 +59,7 @@ public class Q260_HuntTheOrcs extends Quest
if (event.equals("30221-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30221-06.htm"))
{
@@ -90,6 +83,7 @@ public class Q260_HuntTheOrcs extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30221-00.htm";
@@ -103,8 +97,9 @@ public class Q260_HuntTheOrcs extends Quest
htmltext = "30221-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int amulet = st.getQuestItemsCount(ORC_AMULET);
final int necklace = st.getQuestItemsCount(ORC_NECKLACE);
@@ -120,6 +115,7 @@ public class Q260_HuntTheOrcs extends Quest
st.rewardItems(57, (amulet * 5) + (necklace * 15));
}
break;
+ }
}
return htmltext;
@@ -139,14 +135,17 @@ public class Q260_HuntTheOrcs extends Quest
case KABOO_ORC:
case KABOO_ORC_GRUNT:
case KABOO_ORC_ARCHER:
+ {
st.dropItems(ORC_AMULET, 1, 0, 500000);
break;
-
+ }
case KABOO_ORC_FIGHTER:
case KABOO_ORC_FIGHTER_LEADER:
case KABOO_ORC_FIGHTER_LIEUTENANT:
+ {
st.dropItems(ORC_NECKLACE, 1, 0, 500000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q261_CollectorsDream/Q261_CollectorsDream.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q261_CollectorsDream/Q261_CollectorsDream.java
index 26a7557263..0e336e553b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q261_CollectorsDream/Q261_CollectorsDream.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q261_CollectorsDream/Q261_CollectorsDream.java
@@ -30,12 +30,9 @@ public class Q261_CollectorsDream extends Quest
public Q261_CollectorsDream()
{
super(261, "Collector's Dream");
-
registerQuestItems(GIANT_SPIDER_LEG);
-
addStartNpc(30222); // Alshupes
addTalkId(30222);
-
addKillId(20308, 20460, 20466);
}
@@ -51,9 +48,7 @@ public class Q261_CollectorsDream extends Quest
if (event.equals("30222-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -72,11 +67,13 @@ public class Q261_CollectorsDream extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30222-01.htm" : "30222-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 2)
+ {
+ if (st.isCond(2))
{
htmltext = "30222-05.htm";
st.takeItems(GIANT_SPIDER_LEG, -1);
@@ -90,10 +87,12 @@ public class Q261_CollectorsDream extends Quest
htmltext = "30222-04.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -102,7 +101,7 @@ public class Q261_CollectorsDream extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -110,7 +109,7 @@ public class Q261_CollectorsDream extends Quest
if (st.dropItemsAlways(GIANT_SPIDER_LEG, 1, 8))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q262_TradeWithTheIvoryTower/Q262_TradeWithTheIvoryTower.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q262_TradeWithTheIvoryTower/Q262_TradeWithTheIvoryTower.java
index 211b3e1033..da68b6d668 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q262_TradeWithTheIvoryTower/Q262_TradeWithTheIvoryTower.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q262_TradeWithTheIvoryTower/Q262_TradeWithTheIvoryTower.java
@@ -30,12 +30,9 @@ public class Q262_TradeWithTheIvoryTower extends Quest
public Q262_TradeWithTheIvoryTower()
{
super(262, "Trade with the Ivory Tower");
-
registerQuestItems(FUNGUS_SAC);
-
addStartNpc(30137); // Vollodos
addTalkId(30137);
-
addKillId(20400, 20007);
}
@@ -51,9 +48,7 @@ public class Q262_TradeWithTheIvoryTower extends Quest
if (event.equals("30137-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -72,10 +67,12 @@ public class Q262_TradeWithTheIvoryTower extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 8) ? "30137-01.htm" : "30137-02.htm";
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(FUNGUS_SAC) < 10)
{
htmltext = "30137-04.htm";
@@ -89,6 +86,7 @@ public class Q262_TradeWithTheIvoryTower extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -97,7 +95,7 @@ public class Q262_TradeWithTheIvoryTower extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -105,7 +103,7 @@ public class Q262_TradeWithTheIvoryTower extends Quest
if (st.dropItems(FUNGUS_SAC, 1, 10, (npc.getNpcId() == 20400) ? 400000 : 300000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q263_OrcSubjugation/Q263_OrcSubjugation.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q263_OrcSubjugation/Q263_OrcSubjugation.java
index 34294ecd79..5b06a40745 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q263_OrcSubjugation/Q263_OrcSubjugation.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q263_OrcSubjugation/Q263_OrcSubjugation.java
@@ -32,12 +32,9 @@ public class Q263_OrcSubjugation extends Quest
public Q263_OrcSubjugation()
{
super(263, "Orc Subjugation");
-
registerQuestItems(ORC_AMULET, ORC_NECKLACE);
-
addStartNpc(30346); // Kayleen
addTalkId(30346);
-
addKillId(20385, 20386, 20387, 20388);
}
@@ -53,9 +50,7 @@ public class Q263_OrcSubjugation extends Quest
if (event.equals("30346-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30346-06.htm"))
{
@@ -79,6 +74,7 @@ public class Q263_OrcSubjugation extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30346-00.htm";
@@ -92,11 +88,11 @@ public class Q263_OrcSubjugation extends Quest
htmltext = "30346-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int amulet = st.getQuestItemsCount(ORC_AMULET);
final int necklace = st.getQuestItemsCount(ORC_NECKLACE);
-
if ((amulet == 0) && (necklace == 0))
{
htmltext = "30346-04.htm";
@@ -109,6 +105,7 @@ public class Q263_OrcSubjugation extends Quest
st.rewardItems(57, (amulet * 20) + (necklace * 30));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q264_KeenClaws/Q264_KeenClaws.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q264_KeenClaws/Q264_KeenClaws.java
index f545e97a0b..f658492085 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q264_KeenClaws/Q264_KeenClaws.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q264_KeenClaws/Q264_KeenClaws.java
@@ -27,7 +27,6 @@ public class Q264_KeenClaws extends Quest
{
// Item
private static final int WOLF_CLAW = 1367;
-
// Rewards
private static final int LEATHER_SANDALS = 36;
private static final int WOODEN_HELMET = 43;
@@ -39,12 +38,9 @@ public class Q264_KeenClaws extends Quest
public Q264_KeenClaws()
{
super(264, "Keen Claws");
-
registerQuestItems(WOLF_CLAW);
-
addStartNpc(30136); // Payne
addTalkId(30136);
-
addKillId(20003, 20456); // Goblin, Wolf
}
@@ -60,9 +56,7 @@ public class Q264_KeenClaws extends Quest
if (event.equals("30136-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -81,10 +75,12 @@ public class Q264_KeenClaws extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 3) ? "30136-01.htm" : "30136-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int count = st.getQuestItemsCount(WOLF_CLAW);
if (count < 50)
{
@@ -131,6 +127,7 @@ public class Q264_KeenClaws extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -139,7 +136,7 @@ public class Q264_KeenClaws extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -149,12 +146,12 @@ public class Q264_KeenClaws extends Quest
{
if (st.dropItems(WOLF_CLAW, Rnd.nextBoolean() ? 2 : 4, 50, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
}
else if (st.dropItemsAlways(WOLF_CLAW, (Rnd.get(5) < 4) ? 1 : 2, 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q265_ChainsOfSlavery/Q265_ChainsOfSlavery.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q265_ChainsOfSlavery/Q265_ChainsOfSlavery.java
index 005007b773..5a15772c0a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q265_ChainsOfSlavery/Q265_ChainsOfSlavery.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q265_ChainsOfSlavery/Q265_ChainsOfSlavery.java
@@ -27,7 +27,6 @@ public class Q265_ChainsOfSlavery extends Quest
{
// Item
private static final int SHACKLE = 1368;
-
// Newbie Items
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
@@ -35,12 +34,9 @@ public class Q265_ChainsOfSlavery extends Quest
public Q265_ChainsOfSlavery()
{
super(265, "Chains of Slavery");
-
registerQuestItems(SHACKLE);
-
addStartNpc(30357); // Kristin
addTalkId(30357);
-
addKillId(20004, 20005);
}
@@ -56,9 +52,7 @@ public class Q265_ChainsOfSlavery extends Quest
if (event.equals("30357-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30357-06.htm"))
{
@@ -82,6 +76,7 @@ public class Q265_ChainsOfSlavery extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30357-00.htm";
@@ -95,8 +90,9 @@ public class Q265_ChainsOfSlavery extends Quest
htmltext = "30357-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int shackles = st.getQuestItemsCount(SHACKLE);
if (shackles == 0)
{
@@ -132,6 +128,7 @@ public class Q265_ChainsOfSlavery extends Quest
}
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q266_PleasOfPixies/Q266_PleasOfPixies.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q266_PleasOfPixies/Q266_PleasOfPixies.java
index 6344f42d3d..6b3f77fc13 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q266_PleasOfPixies/Q266_PleasOfPixies.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q266_PleasOfPixies/Q266_PleasOfPixies.java
@@ -28,7 +28,6 @@ public class Q266_PleasOfPixies extends Quest
{
// Items
private static final int PREDATOR_FANG = 1334;
-
// Rewards
private static final int GLASS_SHARD = 1336;
private static final int EMERALD = 1337;
@@ -38,12 +37,9 @@ public class Q266_PleasOfPixies extends Quest
public Q266_PleasOfPixies()
{
super(266, "Pleas of Pixies");
-
registerQuestItems(PREDATOR_FANG);
-
addStartNpc(31852); // Murika
addTalkId(31852);
-
addKillId(20525, 20530, 20534, 20537);
}
@@ -59,9 +55,7 @@ public class Q266_PleasOfPixies extends Quest
if (event.equals("31852-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -80,6 +74,7 @@ public class Q266_PleasOfPixies extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "31852-00.htm";
@@ -93,8 +88,9 @@ public class Q266_PleasOfPixies extends Quest
htmltext = "31852-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(PREDATOR_FANG) < 100)
{
htmltext = "31852-04.htm";
@@ -127,6 +123,7 @@ public class Q266_PleasOfPixies extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -135,7 +132,7 @@ public class Q266_PleasOfPixies extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -144,32 +141,37 @@ public class Q266_PleasOfPixies extends Quest
switch (npc.getNpcId())
{
case 20525:
+ {
if (st.dropItemsAlways(PREDATOR_FANG, Rnd.get(2, 3), 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20530:
+ {
if (st.dropItems(PREDATOR_FANG, 1, 100, 800000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20534:
+ {
if (st.dropItems(PREDATOR_FANG, (Rnd.get(3) == 0) ? 1 : 2, 100, 600000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20537:
+ {
if (st.dropItemsAlways(PREDATOR_FANG, 2, 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q267_WrathOfVerdure/Q267_WrathOfVerdure.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q267_WrathOfVerdure/Q267_WrathOfVerdure.java
index 235691109b..4c2148da19 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q267_WrathOfVerdure/Q267_WrathOfVerdure.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q267_WrathOfVerdure/Q267_WrathOfVerdure.java
@@ -27,19 +27,15 @@ public class Q267_WrathOfVerdure extends Quest
{
// Items
private static final int GOBLIN_CLUB = 1335;
-
// Reward
private static final int SILVERY_LEAF = 1340;
public Q267_WrathOfVerdure()
{
super(267, "Wrath of Verdure");
-
registerQuestItems(GOBLIN_CLUB);
-
addStartNpc(31853); // Bremec
addTalkId(31853);
-
addKillId(20325); // Goblin
}
@@ -55,9 +51,7 @@ public class Q267_WrathOfVerdure extends Quest
if (event.equals("31853-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31853-06.htm"))
{
@@ -81,6 +75,7 @@ public class Q267_WrathOfVerdure extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "31853-00.htm";
@@ -94,8 +89,9 @@ public class Q267_WrathOfVerdure extends Quest
htmltext = "31853-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int count = st.getQuestItemsCount(GOBLIN_CLUB);
if (count > 0)
{
@@ -108,6 +104,7 @@ public class Q267_WrathOfVerdure extends Quest
htmltext = "31853-04.htm";
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q271_ProofOfValor/Q271_ProofOfValor.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q271_ProofOfValor/Q271_ProofOfValor.java
index 27e30c84f7..c25c2cf44f 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q271_ProofOfValor/Q271_ProofOfValor.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q271_ProofOfValor/Q271_ProofOfValor.java
@@ -28,7 +28,6 @@ public class Q271_ProofOfValor extends Quest
{
// Item
private static final int KASHA_WOLF_FANG = 1473;
-
// Rewards
private static final int NECKLACE_OF_VALOR = 1507;
private static final int NECKLACE_OF_COURAGE = 1506;
@@ -36,12 +35,9 @@ public class Q271_ProofOfValor extends Quest
public Q271_ProofOfValor()
{
super(271, "Proof of Valor");
-
registerQuestItems(KASHA_WOLF_FANG);
-
addStartNpc(30577); // Rukain
addTalkId(30577);
-
addKillId(20475); // Kasha Wolf
}
@@ -57,10 +53,7 @@ public class Q271_ProofOfValor extends Quest
if (event.equals("30577-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
+ st.startQuest();
if (st.hasAtLeastOneQuestItem(NECKLACE_OF_COURAGE, NECKLACE_OF_VALOR))
{
htmltext = "30577-07.htm";
@@ -83,6 +76,7 @@ public class Q271_ProofOfValor extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30577-00.htm";
@@ -96,9 +90,10 @@ public class Q271_ProofOfValor extends Quest
htmltext = (st.hasAtLeastOneQuestItem(NECKLACE_OF_COURAGE, NECKLACE_OF_VALOR)) ? "30577-06.htm" : "30577-02.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = (st.hasAtLeastOneQuestItem(NECKLACE_OF_COURAGE, NECKLACE_OF_VALOR)) ? "30577-07.htm" : "30577-04.htm";
}
@@ -111,6 +106,7 @@ public class Q271_ProofOfValor extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -119,7 +115,7 @@ public class Q271_ProofOfValor extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -127,7 +123,7 @@ public class Q271_ProofOfValor extends Quest
if (st.dropItemsAlways(KASHA_WOLF_FANG, (Rnd.get(4) == 0) ? 2 : 1, 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q272_WrathOfAncestors/Q272_WrathOfAncestors.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q272_WrathOfAncestors/Q272_WrathOfAncestors.java
index da4faba0b7..1a87c17b61 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q272_WrathOfAncestors/Q272_WrathOfAncestors.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q272_WrathOfAncestors/Q272_WrathOfAncestors.java
@@ -31,12 +31,9 @@ public class Q272_WrathOfAncestors extends Quest
public Q272_WrathOfAncestors()
{
super(272, "Wrath of Ancestors");
-
registerQuestItems(GRAVE_ROBBERS_HEAD);
-
addStartNpc(30572); // Livina
addTalkId(30572);
-
addKillId(20319, 20320); // Goblin Grave Robber, Goblin Tomb Raider Leader
}
@@ -52,9 +49,7 @@ public class Q272_WrathOfAncestors extends Quest
if (event.equals("30572-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -73,6 +68,7 @@ public class Q272_WrathOfAncestors extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30572-00.htm";
@@ -86,9 +82,10 @@ public class Q272_WrathOfAncestors extends Quest
htmltext = "30572-02.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30572-04.htm";
}
@@ -101,6 +98,7 @@ public class Q272_WrathOfAncestors extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -109,7 +107,7 @@ public class Q272_WrathOfAncestors extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -117,7 +115,7 @@ public class Q272_WrathOfAncestors extends Quest
if (st.dropItemsAlways(GRAVE_ROBBERS_HEAD, 1, 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q273_InvadersOfTheHolyLand/Q273_InvadersOfTheHolyLand.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q273_InvadersOfTheHolyLand/Q273_InvadersOfTheHolyLand.java
index 5de2188aa8..eddb655374 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q273_InvadersOfTheHolyLand/Q273_InvadersOfTheHolyLand.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q273_InvadersOfTheHolyLand/Q273_InvadersOfTheHolyLand.java
@@ -29,19 +29,15 @@ public class Q273_InvadersOfTheHolyLand extends Quest
// Items
private static final int BLACK_SOULSTONE = 1475;
private static final int RED_SOULSTONE = 1476;
-
// Reward
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
public Q273_InvadersOfTheHolyLand()
{
super(273, "Invaders of the Holy Land");
-
registerQuestItems(BLACK_SOULSTONE, RED_SOULSTONE);
-
addStartNpc(30566); // Varkees
addTalkId(30566);
-
addKillId(20311, 20312, 20313);
}
@@ -57,9 +53,7 @@ public class Q273_InvadersOfTheHolyLand extends Quest
if (event.equals("30566-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30566-07.htm"))
{
@@ -83,6 +77,7 @@ public class Q273_InvadersOfTheHolyLand extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30566-00.htm";
@@ -96,8 +91,9 @@ public class Q273_InvadersOfTheHolyLand extends Quest
htmltext = "30566-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int red = st.getQuestItemsCount(RED_SOULSTONE);
final int black = st.getQuestItemsCount(BLACK_SOULSTONE);
if ((red + black) == 0)
@@ -127,6 +123,7 @@ public class Q273_InvadersOfTheHolyLand extends Quest
}
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q274_SkirmishWithTheWerewolves/Q274_SkirmishWithTheWerewolves.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q274_SkirmishWithTheWerewolves/Q274_SkirmishWithTheWerewolves.java
index 09f617a69d..13310add62 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q274_SkirmishWithTheWerewolves/Q274_SkirmishWithTheWerewolves.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q274_SkirmishWithTheWerewolves/Q274_SkirmishWithTheWerewolves.java
@@ -29,7 +29,6 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
// Needed items
private static final int NECKLACE_OF_VALOR = 1507;
private static final int NECKLACE_OF_COURAGE = 1506;
-
// Items
private static final int MARAKU_WEREWOLF_HEAD = 1477;
private static final int MARAKU_WOLFMEN_TOTEM = 1501;
@@ -37,12 +36,9 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
public Q274_SkirmishWithTheWerewolves()
{
super(274, "Skirmish with the Werewolves");
-
registerQuestItems(MARAKU_WEREWOLF_HEAD, MARAKU_WOLFMEN_TOTEM);
-
addStartNpc(30569);
addTalkId(30569);
-
addKillId(20363, 20364);
}
@@ -58,9 +54,7 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
if (event.equals("30569-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -79,6 +73,7 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30569-00.htm";
@@ -96,9 +91,10 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
htmltext = "30569-07.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30569-04.htm";
}
@@ -114,6 +110,7 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -122,7 +119,7 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -130,7 +127,7 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
if (st.dropItemsAlways(MARAKU_WEREWOLF_HEAD, 1, 40))
{
- st.set("cond", "2");
+ st.setCond(2);
}
if (Rnd.get(100) < 6)
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q275_DarkWingedSpies/Q275_DarkWingedSpies.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q275_DarkWingedSpies/Q275_DarkWingedSpies.java
index 8035db79f5..e13520cd6c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q275_DarkWingedSpies/Q275_DarkWingedSpies.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q275_DarkWingedSpies/Q275_DarkWingedSpies.java
@@ -29,7 +29,6 @@ public class Q275_DarkWingedSpies extends Quest
// Monsters
private static final int DARKWING_BAT = 20316;
private static final int VARANGKA_TRACKER = 27043;
-
// Items
private static final int DARKWING_BAT_FANG = 1478;
private static final int VARANGKA_PARASITE = 1479;
@@ -37,12 +36,9 @@ public class Q275_DarkWingedSpies extends Quest
public Q275_DarkWingedSpies()
{
super(275, "Dark Winged Spies");
-
registerQuestItems(DARKWING_BAT_FANG, VARANGKA_PARASITE);
-
addStartNpc(30567); // Tantus
addTalkId(30567);
-
addKillId(DARKWING_BAT, VARANGKA_TRACKER);
}
@@ -58,9 +54,7 @@ public class Q275_DarkWingedSpies extends Quest
if (event.equals("30567-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -79,6 +73,7 @@ public class Q275_DarkWingedSpies extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30567-00.htm";
@@ -92,9 +87,10 @@ public class Q275_DarkWingedSpies extends Quest
htmltext = "30567-02.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30567-04.htm";
}
@@ -108,6 +104,7 @@ public class Q275_DarkWingedSpies extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -116,7 +113,7 @@ public class Q275_DarkWingedSpies extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -125,9 +122,10 @@ public class Q275_DarkWingedSpies extends Quest
switch (npc.getNpcId())
{
case DARKWING_BAT:
+ {
if (st.dropItemsAlways(DARKWING_BAT_FANG, 1, 70))
{
- st.set("cond", "2");
+ st.setCond(2);
}
else if ((Rnd.get(100) < 10) && (st.getQuestItemsCount(DARKWING_BAT_FANG) > 10) && (st.getQuestItemsCount(DARKWING_BAT_FANG) < 66))
{
@@ -136,17 +134,19 @@ public class Q275_DarkWingedSpies extends Quest
st.giveItems(VARANGKA_PARASITE, 1);
}
break;
-
+ }
case VARANGKA_TRACKER:
+ {
if (st.hasQuestItems(VARANGKA_PARASITE))
{
st.takeItems(VARANGKA_PARASITE, -1);
if (st.dropItemsAlways(DARKWING_BAT_FANG, 5, 70))
{
- st.set("cond", "2");
+ st.setCond(2);
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q276_TotemOfTheHestui/Q276_TotemOfTheHestui.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q276_TotemOfTheHestui/Q276_TotemOfTheHestui.java
index 6f2b59b60e..3b9f972e9c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q276_TotemOfTheHestui/Q276_TotemOfTheHestui.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q276_TotemOfTheHestui/Q276_TotemOfTheHestui.java
@@ -29,7 +29,6 @@ public class Q276_TotemOfTheHestui extends Quest
// Items
private static final int KASHA_PARASITE = 1480;
private static final int KASHA_CRYSTAL = 1481;
-
// Rewards
private static final int HESTUI_TOTEM = 1500;
private static final int LEATHER_PANTS = 29;
@@ -37,12 +36,9 @@ public class Q276_TotemOfTheHestui extends Quest
public Q276_TotemOfTheHestui()
{
super(276, "Totem of the Hestui");
-
registerQuestItems(KASHA_PARASITE, KASHA_CRYSTAL);
-
addStartNpc(30571); // Tanapi
addTalkId(30571);
-
addKillId(20479, 27044);
}
@@ -58,9 +54,7 @@ public class Q276_TotemOfTheHestui extends Quest
if (event.equals("30571-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -79,6 +73,7 @@ public class Q276_TotemOfTheHestui extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30571-00.htm";
@@ -92,9 +87,10 @@ public class Q276_TotemOfTheHestui extends Quest
htmltext = "30571-02.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30571-04.htm";
}
@@ -109,6 +105,7 @@ public class Q276_TotemOfTheHestui extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -117,7 +114,7 @@ public class Q276_TotemOfTheHestui extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -128,6 +125,7 @@ public class Q276_TotemOfTheHestui extends Quest
switch (npc.getNpcId())
{
case 20479:
+ {
final int count = st.getQuestItemsCount(KASHA_PARASITE);
final int random = Rnd.get(100);
if ((count >= 79) || ((count >= 69) && (random <= 20)) || ((count >= 59) && (random <= 15)) || ((count >= 49) && (random <= 10)) || ((count >= 39) && (random < 2)))
@@ -140,12 +138,14 @@ public class Q276_TotemOfTheHestui extends Quest
st.dropItemsAlways(KASHA_PARASITE, 1, 0);
}
break;
-
+ }
case 27044:
- st.set("cond", "2");
+ {
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KASHA_CRYSTAL, 1);
break;
+ }
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q277_GatekeepersOffering/Q277_GatekeepersOffering.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q277_GatekeepersOffering/Q277_GatekeepersOffering.java
index 41ad19534c..88ba6da0bd 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q277_GatekeepersOffering/Q277_GatekeepersOffering.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q277_GatekeepersOffering/Q277_GatekeepersOffering.java
@@ -26,17 +26,14 @@ public class Q277_GatekeepersOffering extends Quest
{
// Item
private static final int STARSTONE = 1572;
-
// Reward
private static final int GATEKEEPER_CHARM = 1658;
public Q277_GatekeepersOffering()
{
super(277, "Gatekeeper's Offering");
-
addStartNpc(30576); // Tamil
addTalkId(30576);
-
addKillId(20333); // Graystone Golem
}
@@ -52,9 +49,7 @@ public class Q277_GatekeepersOffering extends Quest
if (event.equals("30576-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -73,11 +68,13 @@ public class Q277_GatekeepersOffering extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30576-01.htm" : "30576-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30576-04.htm";
}
@@ -90,6 +87,7 @@ public class Q277_GatekeepersOffering extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -98,7 +96,7 @@ public class Q277_GatekeepersOffering extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -106,7 +104,7 @@ public class Q277_GatekeepersOffering extends Quest
if (st.dropItems(STARSTONE, 1, 20, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q291_RevengeOfTheRedbonnet/Q291_RevengeOfTheRedbonnet.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q291_RevengeOfTheRedbonnet/Q291_RevengeOfTheRedbonnet.java
index 7d6dbe4c61..56678073b2 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q291_RevengeOfTheRedbonnet/Q291_RevengeOfTheRedbonnet.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q291_RevengeOfTheRedbonnet/Q291_RevengeOfTheRedbonnet.java
@@ -27,7 +27,6 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
{
// Quest items
private static final int BLACK_WOLF_PELT = 1482;
-
// Rewards
private static final int SCROLL_OF_ESCAPE = 736;
private static final int GRANDMA_PEARL = 1502;
@@ -38,12 +37,9 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
public Q291_RevengeOfTheRedbonnet()
{
super(291, "Revenge of the Redbonnet");
-
registerQuestItems(BLACK_WOLF_PELT);
-
addStartNpc(30553); // Maryse Redbonnet
addTalkId(30553);
-
addKillId(20317);
}
@@ -59,9 +55,7 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
if (event.equals("30553-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -80,11 +74,13 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 4) ? "30553-01.htm" : "30553-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30553-04.htm";
@@ -117,6 +113,7 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -125,7 +122,7 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -133,7 +130,7 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
if (st.dropItemsAlways(BLACK_WOLF_PELT, 1, 40))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q292_BrigandsSweep/Q292_BrigandsSweep.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q292_BrigandsSweep/Q292_BrigandsSweep.java
index 4f1f82c045..bb0af18073 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q292_BrigandsSweep/Q292_BrigandsSweep.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q292_BrigandsSweep/Q292_BrigandsSweep.java
@@ -29,7 +29,12 @@ public class Q292_BrigandsSweep extends Quest
// NPCs
private static final int SPIRON = 30532;
private static final int BALANKI = 30533;
-
+ // Monsters
+ private static final int GOBLIN_BRIGAND = 20322;
+ private static final int GOBLIN_BRIGAND_LEADER = 20323;
+ private static final int GOBLIN_BRIGAND_LIEUTENANT = 20324;
+ private static final int GOBLIN_SNOOPER = 20327;
+ private static final int GOBLIN_LORD = 20528;
// Items
private static final int GOBLIN_NECKLACE = 1483;
private static final int GOBLIN_PENDANT = 1484;
@@ -37,22 +42,12 @@ public class Q292_BrigandsSweep extends Quest
private static final int SUSPICIOUS_MEMO = 1486;
private static final int SUSPICIOUS_CONTRACT = 1487;
- // Monsters
- private static final int GOBLIN_BRIGAND = 20322;
- private static final int GOBLIN_BRIGAND_LEADER = 20323;
- private static final int GOBLIN_BRIGAND_LIEUTENANT = 20324;
- private static final int GOBLIN_SNOOPER = 20327;
- private static final int GOBLIN_LORD = 20528;
-
public Q292_BrigandsSweep()
{
super(292, "Brigands Sweep");
-
registerQuestItems(GOBLIN_NECKLACE, GOBLIN_PENDANT, GOBLIN_LORD_PENDANT, SUSPICIOUS_MEMO, SUSPICIOUS_CONTRACT);
-
addStartNpc(SPIRON);
addTalkId(SPIRON, BALANKI);
-
addKillId(GOBLIN_BRIGAND, GOBLIN_BRIGAND_LEADER, GOBLIN_BRIGAND_LIEUTENANT, GOBLIN_SNOOPER, GOBLIN_LORD);
}
@@ -68,9 +63,7 @@ public class Q292_BrigandsSweep extends Quest
if (event.equals("30532-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30532-06.htm"))
{
@@ -94,6 +87,7 @@ public class Q292_BrigandsSweep extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DWARF)
{
htmltext = "30532-00.htm";
@@ -107,11 +101,13 @@ public class Q292_BrigandsSweep extends Quest
htmltext = "30532-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case SPIRON:
+ {
final int goblinNecklaces = st.getQuestItemsCount(GOBLIN_NECKLACE);
final int goblinPendants = st.getQuestItemsCount(GOBLIN_PENDANT);
final int goblinLordPendants = st.getQuestItemsCount(GOBLIN_LORD_PENDANT);
@@ -149,15 +145,16 @@ public class Q292_BrigandsSweep extends Quest
st.takeItems(GOBLIN_LORD_PENDANT, -1);
if (hasContract)
{
- st.set("cond", "1");
+ st.setCond(1);
st.takeItems(SUSPICIOUS_CONTRACT, -1);
}
st.rewardItems(57, ((12 * goblinNecklaces) + (36 * goblinPendants) + (33 * goblinLordPendants) + (countAll >= 10 ? 1000 : 0) + ((hasContract) ? 1120 : 0)));
}
break;
-
+ }
case BALANKI:
+ {
if (!st.hasQuestItems(SUSPICIOUS_CONTRACT))
{
htmltext = "30533-01.htm";
@@ -165,13 +162,15 @@ public class Q292_BrigandsSweep extends Quest
else
{
htmltext = "30533-02.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.takeItems(SUSPICIOUS_CONTRACT, -1);
st.rewardItems(57, 1500);
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -194,21 +193,25 @@ public class Q292_BrigandsSweep extends Quest
case GOBLIN_BRIGAND:
case GOBLIN_SNOOPER:
case GOBLIN_BRIGAND_LIEUTENANT:
+ {
st.dropItemsAlways(GOBLIN_NECKLACE, 1, 0);
break;
-
+ }
case GOBLIN_BRIGAND_LEADER:
+ {
st.dropItemsAlways(GOBLIN_PENDANT, 1, 0);
break;
-
+ }
case GOBLIN_LORD:
+ {
st.dropItemsAlways(GOBLIN_LORD_PENDANT, 1, 0);
break;
+ }
}
}
- else if ((chance > 4) && (st.getInt("cond") == 1) && st.dropItemsAlways(SUSPICIOUS_MEMO, 1, 3))
+ else if ((chance > 4) && st.isCond(1) && st.dropItemsAlways(SUSPICIOUS_MEMO, 1, 3))
{
- st.set("cond", "2");
+ st.setCond(2);
st.takeItems(SUSPICIOUS_MEMO, -1);
st.giveItems(SUSPICIOUS_CONTRACT, 1);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q293_TheHiddenVeins/Q293_TheHiddenVeins.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q293_TheHiddenVeins/Q293_TheHiddenVeins.java
index b9b5aec1b4..4f22adb6e3 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q293_TheHiddenVeins/Q293_TheHiddenVeins.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q293_TheHiddenVeins/Q293_TheHiddenVeins.java
@@ -26,32 +26,26 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q293_TheHiddenVeins extends Quest
{
+ // NPCs
+ private static final int FILAUR = 30535;
+ private static final int CHINCHIRIN = 30539;
+ // Monsters
+ private static final int UTUKU_ORC = 20446;
+ private static final int UTUKU_ARCHER = 20447;
+ private static final int UTUKU_GRUNT = 20448;
// Items
private static final int CHRYSOLITE_ORE = 1488;
private static final int TORN_MAP_FRAGMENT = 1489;
private static final int HIDDEN_VEIN_MAP = 1490;
-
// Reward
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
- // NPCs
- private static final int FILAUR = 30535;
- private static final int CHINCHIRIN = 30539;
-
- // Mobs
- private static final int UTUKU_ORC = 20446;
- private static final int UTUKU_ARCHER = 20447;
- private static final int UTUKU_GRUNT = 20448;
-
public Q293_TheHiddenVeins()
{
super(293, "The Hidden Veins");
-
registerQuestItems(CHRYSOLITE_ORE, TORN_MAP_FRAGMENT, HIDDEN_VEIN_MAP);
-
addStartNpc(FILAUR);
addTalkId(FILAUR, CHINCHIRIN);
-
addKillId(UTUKU_ORC, UTUKU_ARCHER, UTUKU_GRUNT);
}
@@ -65,25 +59,29 @@ public class Q293_TheHiddenVeins extends Quest
return htmltext;
}
- if (event.equals("30535-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30535-06.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30539-02.htm"))
- {
- if (st.getQuestItemsCount(TORN_MAP_FRAGMENT) >= 4)
+ case "30535-03.htm":
{
- htmltext = "30539-03.htm";
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(TORN_MAP_FRAGMENT, 4);
- st.giveItems(HIDDEN_VEIN_MAP, 1);
+ st.startQuest();
+ break;
+ }
+ case "30535-06.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30539-02.htm":
+ {
+ if (st.getQuestItemsCount(TORN_MAP_FRAGMENT) >= 4)
+ {
+ htmltext = "30539-03.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(TORN_MAP_FRAGMENT, 4);
+ st.giveItems(HIDDEN_VEIN_MAP, 1);
+ }
+ break;
}
}
@@ -103,6 +101,7 @@ public class Q293_TheHiddenVeins extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DWARF)
{
htmltext = "30535-00.htm";
@@ -116,11 +115,13 @@ public class Q293_TheHiddenVeins extends Quest
htmltext = "30535-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case FILAUR:
+ {
final int chrysoliteOres = st.getQuestItemsCount(CHRYSOLITE_ORE);
final int hiddenVeinMaps = st.getQuestItemsCount(HIDDEN_VEIN_MAP);
if ((chrysoliteOres + hiddenVeinMaps) == 0)
@@ -157,12 +158,15 @@ public class Q293_TheHiddenVeins extends Quest
}
}
break;
-
+ }
case CHINCHIRIN:
+ {
htmltext = "30539-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q294_CovertBusiness/Q294_CovertBusiness.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q294_CovertBusiness/Q294_CovertBusiness.java
index 605150c977..1ab6db4cb1 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q294_CovertBusiness/Q294_CovertBusiness.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q294_CovertBusiness/Q294_CovertBusiness.java
@@ -28,19 +28,15 @@ public class Q294_CovertBusiness extends Quest
{
// Item
private static final int BAT_FANG = 1491;
-
// Reward
private static final int RING_OF_RACCOON = 1508;
public Q294_CovertBusiness()
{
super(294, "Covert Business");
-
registerQuestItems(BAT_FANG);
-
addStartNpc(30534); // Keef
addTalkId(30534);
-
addKillId(20370, 20480); // Barded Bat, Blade Bat
}
@@ -56,9 +52,7 @@ public class Q294_CovertBusiness extends Quest
if (event.equals("30534-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -77,6 +71,7 @@ public class Q294_CovertBusiness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DWARF)
{
htmltext = "30534-00.htm";
@@ -90,9 +85,10 @@ public class Q294_CovertBusiness extends Quest
htmltext = "30534-02.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30534-04.htm";
}
@@ -106,6 +102,7 @@ public class Q294_CovertBusiness extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -114,7 +111,7 @@ public class Q294_CovertBusiness extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -139,7 +136,7 @@ public class Q294_CovertBusiness extends Quest
if (st.dropItemsAlways(BAT_FANG, count, 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q295_DreamingOfTheSkies/Q295_DreamingOfTheSkies.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q295_DreamingOfTheSkies/Q295_DreamingOfTheSkies.java
index 43dd39f420..6a64450b7f 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q295_DreamingOfTheSkies/Q295_DreamingOfTheSkies.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q295_DreamingOfTheSkies/Q295_DreamingOfTheSkies.java
@@ -27,19 +27,15 @@ public class Q295_DreamingOfTheSkies extends Quest
{
// Item
private static final int FLOATING_STONE = 1492;
-
// Reward
private static final int RING_OF_FIREFLY = 1509;
public Q295_DreamingOfTheSkies()
{
super(295, "Dreaming of the Skies");
-
registerQuestItems(FLOATING_STONE);
-
addStartNpc(30536); // Arin
addTalkId(30536);
-
addKillId(20153); // Magical Weaver
}
@@ -55,9 +51,7 @@ public class Q295_DreamingOfTheSkies extends Quest
if (event.equals("30536-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -76,11 +70,13 @@ public class Q295_DreamingOfTheSkies extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 11) ? "30536-01.htm" : "30536-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30536-04.htm";
}
@@ -104,6 +100,7 @@ public class Q295_DreamingOfTheSkies extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -112,7 +109,7 @@ public class Q295_DreamingOfTheSkies extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -120,7 +117,7 @@ public class Q295_DreamingOfTheSkies extends Quest
if (st.dropItemsAlways(FLOATING_STONE, (Rnd.get(100) > 25) ? 1 : 2, 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q296_TarantulasSpiderSilk/Q296_TarantulasSpiderSilk.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q296_TarantulasSpiderSilk/Q296_TarantulasSpiderSilk.java
index a9ebae0c5b..9ba767096c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q296_TarantulasSpiderSilk/Q296_TarantulasSpiderSilk.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q296_TarantulasSpiderSilk/Q296_TarantulasSpiderSilk.java
@@ -28,11 +28,9 @@ public class Q296_TarantulasSpiderSilk extends Quest
// NPCs
private static final int MION = 30519;
private static final int DEFENDER_NATHAN = 30548;
-
// Quest Items
private static final int TARANTULA_SPIDER_SILK = 1493;
private static final int TARANTULA_SPINNERETTE = 1494;
-
// Items
private static final int RING_OF_RACCOON = 1508;
private static final int RING_OF_FIREFLY = 1509;
@@ -40,12 +38,9 @@ public class Q296_TarantulasSpiderSilk extends Quest
public Q296_TarantulasSpiderSilk()
{
super(296, "Tarantula's Spider Silk");
-
registerQuestItems(TARANTULA_SPIDER_SILK, TARANTULA_SPINNERETTE);
-
addStartNpc(MION);
addTalkId(MION, DEFENDER_NATHAN);
-
addKillId(20394, 20403, 20508); // Crimson Tarantula, Hunter Tarantula, Plunder arantula
}
@@ -59,34 +54,38 @@ public class Q296_TarantulasSpiderSilk extends Quest
return htmltext;
}
- if (event.equals("30519-03.htm"))
+ switch (event)
{
- if (st.hasAtLeastOneQuestItem(RING_OF_RACCOON, RING_OF_FIREFLY))
+ case "30519-03.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ if (st.hasAtLeastOneQuestItem(RING_OF_RACCOON, RING_OF_FIREFLY))
+ {
+ st.startQuest();
+ }
+ else
+ {
+ htmltext = "30519-03a.htm";
+ }
+ break;
}
- else
+ case "30519-06.htm":
{
- htmltext = "30519-03a.htm";
- }
- }
- else if (event.equals("30519-06.htm"))
- {
- st.takeItems(TARANTULA_SPIDER_SILK, -1);
- st.takeItems(TARANTULA_SPINNERETTE, -1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30548-02.htm"))
- {
- final int count = st.getQuestItemsCount(TARANTULA_SPINNERETTE);
- if (count > 0)
- {
- htmltext = "30548-03.htm";
+ st.takeItems(TARANTULA_SPIDER_SILK, -1);
st.takeItems(TARANTULA_SPINNERETTE, -1);
- st.giveItems(TARANTULA_SPIDER_SILK, count * (15 + Rnd.get(10)));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30548-02.htm":
+ {
+ final int count = st.getQuestItemsCount(TARANTULA_SPINNERETTE);
+ if (count > 0)
+ {
+ htmltext = "30548-03.htm";
+ st.takeItems(TARANTULA_SPINNERETTE, -1);
+ st.giveItems(TARANTULA_SPIDER_SILK, count * (15 + Rnd.get(10)));
+ }
+ break;
}
}
@@ -106,13 +105,16 @@ public class Q296_TarantulasSpiderSilk extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30519-01.htm" : "30519-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case MION:
+ {
final int count = st.getQuestItemsCount(TARANTULA_SPIDER_SILK);
if (count == 0)
{
@@ -125,12 +127,15 @@ public class Q296_TarantulasSpiderSilk extends Quest
st.rewardItems(57, ((count >= 10) ? 2000 : 0) + (count * 30));
}
break;
-
+ }
case DEFENDER_NATHAN:
+ {
htmltext = "30548-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q297_GatekeepersFavor/Q297_GatekeepersFavor.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q297_GatekeepersFavor/Q297_GatekeepersFavor.java
index dd84b1609a..fcec2706cb 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q297_GatekeepersFavor/Q297_GatekeepersFavor.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q297_GatekeepersFavor/Q297_GatekeepersFavor.java
@@ -26,19 +26,15 @@ public class Q297_GatekeepersFavor extends Quest
{
// Item
private static final int STARSTONE = 1573;
-
// Reward
private static final int GATEKEEPER_TOKEN = 1659;
public Q297_GatekeepersFavor()
{
super(297, "Gatekeeper's Favor");
-
registerQuestItems(STARSTONE);
-
addStartNpc(30540); // Wirphy
addTalkId(30540);
-
addKillId(20521); // Whinstone Golem
}
@@ -54,9 +50,7 @@ public class Q297_GatekeepersFavor extends Quest
if (event.equals("30540-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -75,11 +69,13 @@ public class Q297_GatekeepersFavor extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30540-01.htm" : "30540-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30540-04.htm";
}
@@ -92,6 +88,7 @@ public class Q297_GatekeepersFavor extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -100,7 +97,7 @@ public class Q297_GatekeepersFavor extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -108,7 +105,7 @@ public class Q297_GatekeepersFavor extends Quest
if (st.dropItems(STARSTONE, 1, 20, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q298_LizardmensConspiracy/Q298_LizardmensConspiracy.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q298_LizardmensConspiracy/Q298_LizardmensConspiracy.java
index 4aebfcd145..1c6b2b5bf9 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q298_LizardmensConspiracy/Q298_LizardmensConspiracy.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q298_LizardmensConspiracy/Q298_LizardmensConspiracy.java
@@ -27,7 +27,6 @@ public class Q298_LizardmensConspiracy extends Quest
// NPCs
private static final int PRAGA = 30333;
private static final int ROHMER = 30344;
-
// Items
private static final int PATROL_REPORT = 7182;
private static final int WHITE_GEM = 7183;
@@ -36,12 +35,9 @@ public class Q298_LizardmensConspiracy extends Quest
public Q298_LizardmensConspiracy()
{
super(298, "Lizardmen's Conspiracy");
-
registerQuestItems(PATROL_REPORT, WHITE_GEM, RED_GEM);
-
addStartNpc(PRAGA);
addTalkId(PRAGA, ROHMER);
-
addKillId(20926, 20927, 20922, 20923, 20924);
}
@@ -55,29 +51,33 @@ public class Q298_LizardmensConspiracy extends Quest
return htmltext;
}
- if (event.equals("30333-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(PATROL_REPORT, 1);
- }
- else if (event.equals("30344-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PATROL_REPORT, 1);
- }
- else if (event.equals("30344-4.htm"))
- {
- if (st.getInt("cond") == 3)
+ case "30333-1.htm":
{
- htmltext = "30344-3.htm";
- st.takeItems(WHITE_GEM, -1);
- st.takeItems(RED_GEM, -1);
- st.rewardExpAndSp(0, 42000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.startQuest();
+ st.giveItems(PATROL_REPORT, 1);
+ break;
+ }
+ case "30344-1.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PATROL_REPORT, 1);
+ break;
+ }
+ case "30344-4.htm":
+ {
+ if (st.isCond(3))
+ {
+ htmltext = "30344-3.htm";
+ st.takeItems(WHITE_GEM, -1);
+ st.takeItems(RED_GEM, -1);
+ st.rewardExpAndSp(0, 42000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ break;
}
}
@@ -97,18 +97,22 @@ public class Q298_LizardmensConspiracy extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 25) ? "30333-0b.htm" : "30333-0a.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case PRAGA:
+ {
htmltext = "30333-2.htm";
break;
-
+ }
case ROHMER:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = (st.hasQuestItems(PATROL_REPORT)) ? "30344-0.htm" : "30344-0a.htm";
}
@@ -117,8 +121,10 @@ public class Q298_LizardmensConspiracy extends Quest
htmltext = "30344-2.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -127,7 +133,7 @@ public class Q298_LizardmensConspiracy extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "2");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 2);
if (partyMember == null)
{
return null;
@@ -142,33 +148,38 @@ public class Q298_LizardmensConspiracy extends Quest
switch (npc.getNpcId())
{
case 20922:
+ {
if (st.dropItems(WHITE_GEM, 1, 50, 400000) && (st.getQuestItemsCount(RED_GEM) >= 50))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20923:
+ {
if (st.dropItems(WHITE_GEM, 1, 50, 450000) && (st.getQuestItemsCount(RED_GEM) >= 50))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20924:
+ {
if (st.dropItems(WHITE_GEM, 1, 50, 350000) && (st.getQuestItemsCount(RED_GEM) >= 50))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20926:
case 20927:
+ {
if (st.dropItems(RED_GEM, 1, 50, 400000) && (st.getQuestItemsCount(WHITE_GEM) >= 50))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q299_GatherIngredientsForPie/Q299_GatherIngredientsForPie.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q299_GatherIngredientsForPie/Q299_GatherIngredientsForPie.java
index 4eb3c5a46e..d1cc4409bc 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q299_GatherIngredientsForPie/Q299_GatherIngredientsForPie.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q299_GatherIngredientsForPie/Q299_GatherIngredientsForPie.java
@@ -28,7 +28,6 @@ public class Q299_GatherIngredientsForPie extends Quest
private static final int LARA = 30063;
private static final int BRIGHT = 30466;
private static final int EMILY = 30620;
-
// Items
private static final int FRUIT_BASKET = 7136;
private static final int AVELLAN_SPICE = 7137;
@@ -37,12 +36,9 @@ public class Q299_GatherIngredientsForPie extends Quest
public Q299_GatherIngredientsForPie()
{
super(299, "Gather Ingredients for Pie");
-
registerQuestItems(FRUIT_BASKET, AVELLAN_SPICE, HONEY_POUCH);
-
addStartNpc(EMILY);
addTalkId(EMILY, LARA, BRIGHT);
-
addKillId(20934, 20935); // Wasp Worker, Wasp Leader
}
@@ -56,49 +52,56 @@ public class Q299_GatherIngredientsForPie extends Quest
return htmltext;
}
- if (event.equals("30620-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30620-3.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HONEY_POUCH, -1);
- }
- else if (event.equals("30063-1.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(AVELLAN_SPICE, 1);
- }
- else if (event.equals("30620-5.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(AVELLAN_SPICE, 1);
- }
- else if (event.equals("30466-1.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(FRUIT_BASKET, 1);
- }
- else if (event.equals("30620-7a.htm"))
- {
- if (st.hasQuestItems(FRUIT_BASKET))
+ case "30620-1.htm":
{
- htmltext = "30620-7.htm";
- st.takeItems(FRUIT_BASKET, 1);
- st.rewardItems(57, 25000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.startQuest();
+ break;
}
- else
+ case "30620-3.htm":
{
- st.set("cond", "5");
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HONEY_POUCH, -1);
+ break;
+ }
+ case "30063-1.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(AVELLAN_SPICE, 1);
+ break;
+ }
+ case "30620-5.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(AVELLAN_SPICE, 1);
+ break;
+ }
+ case "30466-1.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(FRUIT_BASKET, 1);
+ break;
+ }
+ case "30620-7a.htm":
+ {
+ if (st.hasQuestItems(FRUIT_BASKET))
+ {
+ htmltext = "30620-7.htm";
+ st.takeItems(FRUIT_BASKET, 1);
+ st.rewardItems(57, 25000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ st.setCond(5);
+ }
+ break;
}
}
@@ -118,14 +121,17 @@ public class Q299_GatherIngredientsForPie extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 34) ? "30620-0a.htm" : "30620-0.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case EMILY:
+ {
if (cond == 1)
{
htmltext = "30620-1a.htm";
@@ -167,8 +173,9 @@ public class Q299_GatherIngredientsForPie extends Quest
htmltext = "30620-6.htm";
}
break;
-
+ }
case LARA:
+ {
if (cond == 3)
{
htmltext = "30063-0.htm";
@@ -178,8 +185,9 @@ public class Q299_GatherIngredientsForPie extends Quest
htmltext = "30063-1a.htm";
}
break;
-
+ }
case BRIGHT:
+ {
if (cond == 5)
{
htmltext = "30466-0.htm";
@@ -189,8 +197,10 @@ public class Q299_GatherIngredientsForPie extends Quest
htmltext = "30466-1a.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -199,7 +209,7 @@ public class Q299_GatherIngredientsForPie extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -213,7 +223,7 @@ public class Q299_GatherIngredientsForPie extends Quest
if (st.dropItems(HONEY_POUCH, 1, 100, (npc.getNpcId() == 20934) ? 571000 : 625000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q300_HuntingLetoLizardman/Q300_HuntingLetoLizardman.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q300_HuntingLetoLizardman/Q300_HuntingLetoLizardman.java
index 9e2458cf7d..316866f05d 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q300_HuntingLetoLizardman/Q300_HuntingLetoLizardman.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q300_HuntingLetoLizardman/Q300_HuntingLetoLizardman.java
@@ -28,16 +28,14 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q300_HuntingLetoLizardman extends Quest
{
- // Item
- private static final int BRACELET = 7139;
-
// Monsters
private static final int LETO_LIZARDMAN = 20577;
private static final int LETO_LIZARDMAN_ARCHER = 20578;
private static final int LETO_LIZARDMAN_SOLDIER = 20579;
private static final int LETO_LIZARDMAN_WARRIOR = 20580;
private static final int LETO_LIZARDMAN_OVERLORD = 20582;
-
+ // Item
+ private static final int BRACELET = 7139;
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -52,12 +50,9 @@ public class Q300_HuntingLetoLizardman extends Quest
public Q300_HuntingLetoLizardman()
{
super(300, "Hunting Leto Lizardman");
-
registerQuestItems(BRACELET);
-
addStartNpc(30126); // Rath
addTalkId(30126);
-
addKillId(LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_OVERLORD);
}
@@ -73,34 +68,29 @@ public class Q300_HuntingLetoLizardman extends Quest
if (event.equals("30126-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
- else if (event.equals("30126-05.htm"))
+ else if (event.equals("30126-05.htm") && (st.getQuestItemsCount(BRACELET) >= 60))
{
- if (st.getQuestItemsCount(BRACELET) >= 60)
+ htmltext = "30126-06.htm";
+ st.takeItems(BRACELET, -1);
+
+ final int luck = Rnd.get(3);
+ if (luck == 0)
{
- htmltext = "30126-06.htm";
- st.takeItems(BRACELET, -1);
-
- final int luck = Rnd.get(3);
- if (luck == 0)
- {
- st.rewardItems(57, 30000);
- }
- else if (luck == 1)
- {
- st.rewardItems(1867, 50);
- }
- else if (luck == 2)
- {
- st.rewardItems(1872, 50);
- }
-
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.rewardItems(57, 30000);
}
+ else if (luck == 1)
+ {
+ st.rewardItems(1867, 50);
+ }
+ else if (luck == 2)
+ {
+ st.rewardItems(1872, 50);
+ }
+
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
}
return htmltext;
@@ -119,12 +109,15 @@ public class Q300_HuntingLetoLizardman extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 34) ? "30126-01.htm" : "30126-02.htm";
break;
-
+ }
case State.STARTED:
- htmltext = (st.getInt("cond") == 1) ? "30126-04a.htm" : "30126-04.htm";
+ {
+ htmltext = st.isCond(1) ? "30126-04a.htm" : "30126-04.htm";
break;
+ }
}
return htmltext;
@@ -133,7 +126,7 @@ public class Q300_HuntingLetoLizardman extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -147,7 +140,7 @@ public class Q300_HuntingLetoLizardman extends Quest
if (st.dropItems(BRACELET, 1, 60, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q303_CollectArrowheads/Q303_CollectArrowheads.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q303_CollectArrowheads/Q303_CollectArrowheads.java
index 69926d1130..b3310701bf 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q303_CollectArrowheads/Q303_CollectArrowheads.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q303_CollectArrowheads/Q303_CollectArrowheads.java
@@ -30,12 +30,9 @@ public class Q303_CollectArrowheads extends Quest
public Q303_CollectArrowheads()
{
super(303, "Collect Arrowheads");
-
registerQuestItems(ORCISH_ARROWHEAD);
-
addStartNpc(30029); // Minia
addTalkId(30029);
-
addKillId(20361);
}
@@ -51,9 +48,7 @@ public class Q303_CollectArrowheads extends Quest
if (event.equals("30029-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -72,11 +67,13 @@ public class Q303_CollectArrowheads extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 10) ? "30029-01.htm" : "30029-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30029-04.htm";
}
@@ -90,6 +87,7 @@ public class Q303_CollectArrowheads extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -98,7 +96,7 @@ public class Q303_CollectArrowheads extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -106,7 +104,7 @@ public class Q303_CollectArrowheads extends Quest
if (st.dropItems(ORCISH_ARROWHEAD, 1, 10, 400000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q306_CrystalsOfFireAndIce/Q306_CrystalsOfFireAndIce.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q306_CrystalsOfFireAndIce/Q306_CrystalsOfFireAndIce.java
index ebf3626493..cdb3c62779 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q306_CrystalsOfFireAndIce/Q306_CrystalsOfFireAndIce.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q306_CrystalsOfFireAndIce/Q306_CrystalsOfFireAndIce.java
@@ -31,47 +31,22 @@ public class Q306_CrystalsOfFireAndIce extends Quest
// Droplist (npcId, itemId, chance)
private static final int[][] DROPLIST =
{
- {
- 20109,
- FLAME_SHARD,
- 300000
- },
- {
- 20110,
- ICE_SHARD,
- 300000
- },
- {
- 20112,
- FLAME_SHARD,
- 400000
- },
- {
- 20113,
- ICE_SHARD,
- 400000
- },
- {
- 20114,
- FLAME_SHARD,
- 500000
- },
- {
- 20115,
- ICE_SHARD,
- 500000
- }
+ // @formatter:off
+ {20109, FLAME_SHARD, 300000},
+ {20110, ICE_SHARD, 300000},
+ {20112, FLAME_SHARD, 400000},
+ {20113, ICE_SHARD, 400000},
+ {20114, FLAME_SHARD, 500000},
+ {20115, ICE_SHARD, 500000}
+ // @formatter:on
};
public Q306_CrystalsOfFireAndIce()
{
super(306, "Crystals of Fire and Ice");
-
registerQuestItems(FLAME_SHARD, ICE_SHARD);
-
addStartNpc(30004); // Katerina
addTalkId(30004);
-
addKillId(20109, 20110, 20112, 20113, 20114, 20115);
}
@@ -87,9 +62,7 @@ public class Q306_CrystalsOfFireAndIce extends Quest
if (event.equals("30004-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30004-06.htm"))
{
@@ -113,10 +86,12 @@ public class Q306_CrystalsOfFireAndIce extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 17) ? "30004-01.htm" : "30004-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int totalItems = st.getQuestItemsCount(FLAME_SHARD) + st.getQuestItemsCount(ICE_SHARD);
if (totalItems == 0)
{
@@ -130,6 +105,7 @@ public class Q306_CrystalsOfFireAndIce extends Quest
st.rewardItems(57, (30 * totalItems) + ((totalItems > 10) ? 5000 : 0));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q313_CollectSpores/Q313_CollectSpores.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q313_CollectSpores/Q313_CollectSpores.java
index c49500ae1a..e79fcffd60 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q313_CollectSpores/Q313_CollectSpores.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q313_CollectSpores/Q313_CollectSpores.java
@@ -30,12 +30,9 @@ public class Q313_CollectSpores extends Quest
public Q313_CollectSpores()
{
super(313, "Collect Spores");
-
registerQuestItems(SPORE_SAC);
-
addStartNpc(30150); // Herbiel
addTalkId(30150);
-
addKillId(20509); // Spore Fungus
}
@@ -51,9 +48,7 @@ public class Q313_CollectSpores extends Quest
if (event.equals("30150-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -72,11 +67,13 @@ public class Q313_CollectSpores extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 8) ? "30150-02.htm" : "30150-03.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30150-06.htm";
}
@@ -89,6 +86,7 @@ public class Q313_CollectSpores extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -97,7 +95,7 @@ public class Q313_CollectSpores extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -105,7 +103,7 @@ public class Q313_CollectSpores extends Quest
if (st.dropItems(SPORE_SAC, 1, 10, 400000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q316_DestroyPlagueCarriers/Q316_DestroyPlagueCarriers.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q316_DestroyPlagueCarriers/Q316_DestroyPlagueCarriers.java
index 8b4f94890d..a4a9de00c4 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q316_DestroyPlagueCarriers/Q316_DestroyPlagueCarriers.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q316_DestroyPlagueCarriers/Q316_DestroyPlagueCarriers.java
@@ -25,24 +25,20 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q316_DestroyPlagueCarriers extends Quest
{
- // Items
- private static final int WERERAT_FANG = 1042;
- private static final int VAROOL_FOULCLAW_FANG = 1043;
-
// Monsters
private static final int SUKAR_WERERAT = 20040;
private static final int SUKAR_WERERAT_LEADER = 20047;
private static final int VAROOL_FOULCLAW = 27020;
+ // Items
+ private static final int WERERAT_FANG = 1042;
+ private static final int VAROOL_FOULCLAW_FANG = 1043;
public Q316_DestroyPlagueCarriers()
{
super(316, "Destroy Plague Carriers");
-
registerQuestItems(WERERAT_FANG, VAROOL_FOULCLAW_FANG);
-
addStartNpc(30155); // Ellenia
addTalkId(30155);
-
addKillId(SUKAR_WERERAT, SUKAR_WERERAT_LEADER, VAROOL_FOULCLAW);
}
@@ -58,9 +54,7 @@ public class Q316_DestroyPlagueCarriers extends Quest
if (event.equals("30155-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30155-08.htm"))
{
@@ -84,6 +78,7 @@ public class Q316_DestroyPlagueCarriers extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30155-00.htm";
@@ -97,8 +92,9 @@ public class Q316_DestroyPlagueCarriers extends Quest
htmltext = "30155-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int ratFangs = st.getQuestItemsCount(WERERAT_FANG);
final int varoolFangs = st.getQuestItemsCount(VAROOL_FOULCLAW_FANG);
if ((ratFangs + varoolFangs) == 0)
@@ -113,6 +109,7 @@ public class Q316_DestroyPlagueCarriers extends Quest
st.rewardItems(57, (ratFangs * 30) + (varoolFangs * 10000) + ((ratFangs > 10) ? 5000 : 0));
}
break;
+ }
}
return htmltext;
@@ -131,12 +128,15 @@ public class Q316_DestroyPlagueCarriers extends Quest
{
case SUKAR_WERERAT:
case SUKAR_WERERAT_LEADER:
+ {
st.dropItems(WERERAT_FANG, 1, 0, 400000);
break;
-
+ }
case VAROOL_FOULCLAW:
+ {
st.dropItems(VAROOL_FOULCLAW_FANG, 1, 1, 200000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q317_CatchTheWind/Q317_CatchTheWind.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q317_CatchTheWind/Q317_CatchTheWind.java
index 5481de4f0b..8a29a98c9a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q317_CatchTheWind/Q317_CatchTheWind.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q317_CatchTheWind/Q317_CatchTheWind.java
@@ -30,12 +30,9 @@ public class Q317_CatchTheWind extends Quest
public Q317_CatchTheWind()
{
super(317, "Catch the Wind");
-
registerQuestItems(WIND_SHARD);
-
addStartNpc(30361); // Rizraell
addTalkId(30361);
-
addKillId(20036, 20044);
}
@@ -51,9 +48,7 @@ public class Q317_CatchTheWind extends Quest
if (event.equals("30361-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30361-08.htm"))
{
@@ -77,10 +72,12 @@ public class Q317_CatchTheWind extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 18) ? "30361-02.htm" : "30361-03.htm";
break;
-
+ }
case State.STARTED:
+ {
final int shards = st.getQuestItemsCount(WIND_SHARD);
if (shards == 0)
{
@@ -93,6 +90,7 @@ public class Q317_CatchTheWind extends Quest
st.rewardItems(57, (40 * shards) + (shards >= 10 ? 2988 : 0));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q319_ScentOfDeath/Q319_ScentOfDeath.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q319_ScentOfDeath/Q319_ScentOfDeath.java
index 094be2398b..c25c2bcfee 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q319_ScentOfDeath/Q319_ScentOfDeath.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q319_ScentOfDeath/Q319_ScentOfDeath.java
@@ -30,12 +30,9 @@ public class Q319_ScentOfDeath extends Quest
public Q319_ScentOfDeath()
{
super(319, "Scent of Death");
-
registerQuestItems(ZOMBIE_SKIN);
-
addStartNpc(30138); // Minaless
addTalkId(30138);
-
addKillId(20015, 20020);
}
@@ -51,9 +48,7 @@ public class Q319_ScentOfDeath extends Quest
if (event.equals("30138-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -72,11 +67,13 @@ public class Q319_ScentOfDeath extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 11) ? "30138-02.htm" : "30138-03.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30138-05.htm";
}
@@ -90,6 +87,7 @@ public class Q319_ScentOfDeath extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
}
@@ -97,7 +95,7 @@ public class Q319_ScentOfDeath extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -105,7 +103,7 @@ public class Q319_ScentOfDeath extends Quest
if (st.dropItems(ZOMBIE_SKIN, 1, 5, 200000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q320_BonesTellTheFuture/Q320_BonesTellTheFuture.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q320_BonesTellTheFuture/Q320_BonesTellTheFuture.java
index 73053ab432..7463537a41 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q320_BonesTellTheFuture/Q320_BonesTellTheFuture.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q320_BonesTellTheFuture/Q320_BonesTellTheFuture.java
@@ -31,12 +31,9 @@ public class Q320_BonesTellTheFuture extends Quest
public Q320_BonesTellTheFuture()
{
super(320, "Bones Tell the Future");
-
registerQuestItems(BONE_FRAGMENT);
-
addStartNpc(30359); // Kaitar
addTalkId(30359);
-
addKillId(20517, 20518);
}
@@ -52,9 +49,7 @@ public class Q320_BonesTellTheFuture extends Quest
if (event.equals("30359-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return event;
@@ -73,6 +68,7 @@ public class Q320_BonesTellTheFuture extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30359-00.htm";
@@ -86,9 +82,10 @@ public class Q320_BonesTellTheFuture extends Quest
htmltext = "30359-03.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30359-05.htm";
}
@@ -101,6 +98,7 @@ public class Q320_BonesTellTheFuture extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -109,7 +107,7 @@ public class Q320_BonesTellTheFuture extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -117,7 +115,7 @@ public class Q320_BonesTellTheFuture extends Quest
if (st.dropItems(BONE_FRAGMENT, 1, 10, (npc.getNpcId() == 20517) ? 180000 : 200000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q324_SweetestVenom/Q324_SweetestVenom.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q324_SweetestVenom/Q324_SweetestVenom.java
index 00200ae22d..bd88c14d01 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q324_SweetestVenom/Q324_SweetestVenom.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q324_SweetestVenom/Q324_SweetestVenom.java
@@ -29,7 +29,6 @@ public class Q324_SweetestVenom extends Quest
{
// Item
private static final int VENOM_SAC = 1077;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -42,12 +41,9 @@ public class Q324_SweetestVenom extends Quest
public Q324_SweetestVenom()
{
super(324, "Sweetest Venom");
-
registerQuestItems(VENOM_SAC);
-
addStartNpc(30351); // Astaron
addTalkId(30351);
-
addKillId(20034, 20038, 20043);
}
@@ -63,9 +59,7 @@ public class Q324_SweetestVenom extends Quest
if (event.equals("30351-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -84,11 +78,13 @@ public class Q324_SweetestVenom extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 18) ? "30351-02.htm" : "30351-03.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30351-05.htm";
}
@@ -101,6 +97,7 @@ public class Q324_SweetestVenom extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -109,7 +106,7 @@ public class Q324_SweetestVenom extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -117,7 +114,7 @@ public class Q324_SweetestVenom extends Quest
if (st.dropItems(VENOM_SAC, 1, 10, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q325_GrimCollector/Q325_GrimCollector.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q325_GrimCollector/Q325_GrimCollector.java
index 3b21cd7ca1..a43422a83e 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q325_GrimCollector/Q325_GrimCollector.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q325_GrimCollector/Q325_GrimCollector.java
@@ -31,6 +31,10 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q325_GrimCollector extends Quest
{
+ // NPCs
+ private static final int CURTIS = 30336;
+ private static final int VARSAK = 30342;
+ private static final int SAMED = 30434;
// Items
private static final int ANATOMY_DIAGRAM = 1349;
private static final int ZOMBIE_HEAD = 1350;
@@ -42,12 +46,7 @@ public class Q325_GrimCollector extends Quest
private static final int ARM_BONE = 1356;
private static final int THIGH_BONE = 1357;
private static final int COMPLETE_SKELETON = 1358;
-
- // NPCs
- private static final int CURTIS = 30336;
- private static final int VARSAK = 30342;
- private static final int SAMED = 30434;
-
+ // Drops
private static final Map> DROPLIST = new HashMap<>();
static
{
@@ -66,16 +65,10 @@ public class Q325_GrimCollector extends Quest
public Q325_GrimCollector()
{
super(325, "Grim Collector");
-
registerQuestItems(ZOMBIE_HEAD, ZOMBIE_HEART, ZOMBIE_LIVER, SKULL, RIB_BONE, SPINE, ARM_BONE, THIGH_BONE, COMPLETE_SKELETON, ANATOMY_DIAGRAM);
-
addStartNpc(CURTIS);
addTalkId(CURTIS, VARSAK, SAMED);
-
- for (int npcId : DROPLIST.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(DROPLIST.keySet());
}
private static int getNumberOfPieces(QuestState st)
@@ -123,60 +116,67 @@ public class Q325_GrimCollector extends Quest
return htmltext;
}
- if (event.equals("30336-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30434-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(ANATOMY_DIAGRAM, 1);
- }
- else if (event.equals("30434-06.htm"))
- {
- st.takeItems(ANATOMY_DIAGRAM, -1);
- payback(st);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30434-07.htm"))
- {
- payback(st);
- }
- else if (event.equals("30434-09.htm"))
- {
- final int skeletons = st.getQuestItemsCount(COMPLETE_SKELETON);
- if (skeletons > 0)
+ case "30336-03.htm":
{
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(COMPLETE_SKELETON, -1);
- st.rewardItems(57, 543 + (341 * skeletons));
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30342-03.htm"))
- {
- if (!st.hasQuestItems(SPINE, ARM_BONE, SKULL, RIB_BONE, THIGH_BONE))
+ case "30434-03.htm":
{
- htmltext = "30342-02.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(ANATOMY_DIAGRAM, 1);
+ break;
}
- else
+ case "30434-06.htm":
{
- st.takeItems(SPINE, 1);
- st.takeItems(SKULL, 1);
- st.takeItems(ARM_BONE, 1);
- st.takeItems(RIB_BONE, 1);
- st.takeItems(THIGH_BONE, 1);
-
- if (Rnd.get(10) < 9)
+ st.takeItems(ANATOMY_DIAGRAM, -1);
+ payback(st);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30434-07.htm":
+ {
+ payback(st);
+ break;
+ }
+ case "30434-09.htm":
+ {
+ final int skeletons = st.getQuestItemsCount(COMPLETE_SKELETON);
+ if (skeletons > 0)
{
- st.giveItems(COMPLETE_SKELETON, 1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(COMPLETE_SKELETON, -1);
+ st.rewardItems(57, 543 + (341 * skeletons));
+ }
+ break;
+ }
+ case "30342-03.htm":
+ {
+ if (!st.hasQuestItems(SPINE, ARM_BONE, SKULL, RIB_BONE, THIGH_BONE))
+ {
+ htmltext = "30342-02.htm";
}
else
{
- htmltext = "30342-04.htm";
+ st.takeItems(SPINE, 1);
+ st.takeItems(SKULL, 1);
+ st.takeItems(ARM_BONE, 1);
+ st.takeItems(RIB_BONE, 1);
+ st.takeItems(THIGH_BONE, 1);
+
+ if (Rnd.get(10) < 9)
+ {
+ st.giveItems(COMPLETE_SKELETON, 1);
+ }
+ else
+ {
+ htmltext = "30342-04.htm";
+ }
}
+ break;
}
}
@@ -196,17 +196,21 @@ public class Q325_GrimCollector extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30336-01.htm" : "30336-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case CURTIS:
+ {
htmltext = (!st.hasQuestItems(ANATOMY_DIAGRAM)) ? "30336-04.htm" : "30336-05.htm";
break;
-
+ }
case SAMED:
+ {
if (!st.hasQuestItems(ANATOMY_DIAGRAM))
{
htmltext = "30434-01.htm";
@@ -223,12 +227,15 @@ public class Q325_GrimCollector extends Quest
}
}
break;
-
+ }
case VARSAK:
+ {
htmltext = "30342-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q326_VanquishRemnants/Q326_VanquishRemnants.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q326_VanquishRemnants/Q326_VanquishRemnants.java
index 4c2725b06e..8718706951 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q326_VanquishRemnants/Q326_VanquishRemnants.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q326_VanquishRemnants/Q326_VanquishRemnants.java
@@ -28,19 +28,15 @@ public class Q326_VanquishRemnants extends Quest
private static final int RED_CROSS_BADGE = 1359;
private static final int BLUE_CROSS_BADGE = 1360;
private static final int BLACK_CROSS_BADGE = 1361;
-
// Reward
private static final int BLACK_LION_MARK = 1369;
public Q326_VanquishRemnants()
{
super(326, "Vanquish Remnants");
-
registerQuestItems(RED_CROSS_BADGE, BLUE_CROSS_BADGE, BLACK_CROSS_BADGE);
-
addStartNpc(30435); // Leopold
addTalkId(30435);
-
addKillId(20053, 20437, 20058, 20436, 20061, 20439, 20063, 20066, 20438);
}
@@ -56,9 +52,7 @@ public class Q326_VanquishRemnants extends Quest
if (event.equals("30435-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30435-07.htm"))
{
@@ -82,10 +76,12 @@ public class Q326_VanquishRemnants extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 21) ? "30435-01.htm" : "30435-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int redBadges = st.getQuestItemsCount(RED_CROSS_BADGE);
final int blueBadges = st.getQuestItemsCount(BLUE_CROSS_BADGE);
final int blackBadges = st.getQuestItemsCount(BLACK_CROSS_BADGE);
@@ -119,6 +115,7 @@ public class Q326_VanquishRemnants extends Quest
htmltext = "30435-04.htm";
}
break;
+ }
}
return htmltext;
@@ -138,20 +135,24 @@ public class Q326_VanquishRemnants extends Quest
case 20053:
case 20437:
case 20058:
+ {
st.dropItems(RED_CROSS_BADGE, 1, 0, 330000);
break;
-
+ }
case 20436:
case 20061:
case 20439:
case 20063:
+ {
st.dropItems(BLUE_CROSS_BADGE, 1, 0, 160000);
break;
-
+ }
case 20066:
case 20438:
+ {
st.dropItems(BLACK_CROSS_BADGE, 1, 0, 120000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q327_RecoverTheFarmland/Q327_RecoverTheFarmland.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q327_RecoverTheFarmland/Q327_RecoverTheFarmland.java
index 8807f8a48a..db82cc673a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q327_RecoverTheFarmland/Q327_RecoverTheFarmland.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q327_RecoverTheFarmland/Q327_RecoverTheFarmland.java
@@ -28,6 +28,20 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q327_RecoverTheFarmland extends Quest
{
+ // NPCs
+ private static final int LEIKAN = 30382;
+ private static final int PIOTUR = 30597;
+ private static final int IRIS = 30034;
+ private static final int ASHA = 30313;
+ private static final int NESTLE = 30314;
+ // Monsters
+ private static final int TUREK_ORC_WARLORD = 20495;
+ private static final int TUREK_ORC_ARCHER = 20496;
+ private static final int TUREK_ORC_SKIRMISHER = 20497;
+ private static final int TUREK_ORC_SUPPLIER = 20498;
+ private static final int TUREK_ORC_FOOTMAN = 20499;
+ private static final int TUREK_ORC_SENTINEL = 20500;
+ private static final int TUREK_ORC_SHAMAN = 20501;
// Items
private static final int LEIKAN_LETTER = 5012;
private static final int TUREK_DOGTAG = 1846;
@@ -40,7 +54,6 @@ public class Q327_RecoverTheFarmland extends Quest
private static final int ANCIENT_BRASS_TIARA = 1853;
private static final int ANCIENT_BRONZE_MIRROR = 1854;
private static final int ANCIENT_JADE_NECKLACE = 1855;
-
// Rewards
private static final int ADENA = 57;
private static final int SOULSHOT_D = 1463;
@@ -50,63 +63,19 @@ public class Q327_RecoverTheFarmland extends Quest
private static final int POTION_OF_ALACRITY = 735;
private static final int SCROLL_OF_ESCAPE = 736;
private static final int SCROLL_OF_RESURRECTION = 737;
-
- // NPCs
- private static final int LEIKAN = 30382;
- private static final int PIOTUR = 30597;
- private static final int IRIS = 30034;
- private static final int ASHA = 30313;
- private static final int NESTLE = 30314;
-
- // Monsters
- private static final int TUREK_ORC_WARLORD = 20495;
- private static final int TUREK_ORC_ARCHER = 20496;
- private static final int TUREK_ORC_SKIRMISHER = 20497;
- private static final int TUREK_ORC_SUPPLIER = 20498;
- private static final int TUREK_ORC_FOOTMAN = 20499;
- private static final int TUREK_ORC_SENTINEL = 20500;
- private static final int TUREK_ORC_SHAMAN = 20501;
-
// Chances
private static final int[][] DROPLIST =
{
- {
- TUREK_ORC_ARCHER,
- 140000,
- TUREK_DOGTAG
- },
- {
- TUREK_ORC_SKIRMISHER,
- 70000,
- TUREK_DOGTAG
- },
- {
- TUREK_ORC_SUPPLIER,
- 120000,
- TUREK_DOGTAG
- },
- {
- TUREK_ORC_FOOTMAN,
- 100000,
- TUREK_DOGTAG
- },
- {
- TUREK_ORC_SENTINEL,
- 80000,
- TUREK_DOGTAG
- },
- {
- TUREK_ORC_SHAMAN,
- 90000,
- TUREK_MEDALLION
- },
- {
- TUREK_ORC_WARLORD,
- 180000,
- TUREK_MEDALLION
- }
+ // @formatter:off
+ {TUREK_ORC_ARCHER, 140000, TUREK_DOGTAG},
+ {TUREK_ORC_SKIRMISHER, 70000, TUREK_DOGTAG},
+ {TUREK_ORC_SUPPLIER, 120000, TUREK_DOGTAG},
+ {TUREK_ORC_FOOTMAN, 100000, TUREK_DOGTAG},
+ {TUREK_ORC_SENTINEL, 80000, TUREK_DOGTAG},
+ {TUREK_ORC_SHAMAN, 90000, TUREK_MEDALLION},
+ {TUREK_ORC_WARLORD, 180000, TUREK_MEDALLION}
+ // @formatter:on
};
-
// Exp
private static final Map EXP_REWARD = new HashMap<>();
static
@@ -120,12 +89,9 @@ public class Q327_RecoverTheFarmland extends Quest
public Q327_RecoverTheFarmland()
{
super(327, "Recover the Farmland");
-
registerQuestItems(LEIKAN_LETTER);
-
addStartNpc(LEIKAN, PIOTUR);
addTalkId(LEIKAN, PIOTUR, IRIS, ASHA, NESTLE);
-
addKillId(TUREK_ORC_WARLORD, TUREK_ORC_ARCHER, TUREK_ORC_SKIRMISHER, TUREK_ORC_SUPPLIER, TUREK_ORC_FOOTMAN, TUREK_ORC_SENTINEL, TUREK_ORC_SHAMAN);
}
@@ -139,229 +105,243 @@ public class Q327_RecoverTheFarmland extends Quest
return htmltext;
}
- // Piotur
- if (event.equals("30597-03.htm") && (st.getInt("cond") < 1))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30597-06.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- // Leikan
- else if (event.equals("30382-03.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LEIKAN_LETTER, 1);
- }
- // Asha
- else if (event.equals("30313-02.htm"))
- {
- if (st.getQuestItemsCount(CLAY_URN_FRAGMENT) >= 5)
+ case "30597-03.htm":
{
- st.takeItems(CLAY_URN_FRAGMENT, 5);
- if (Rnd.get(6) < 5)
+ if ((st.getCond() < 1))
{
- htmltext = "30313-03.htm";
- st.rewardItems(ANCIENT_CLAY_URN, 1);
+ st.startQuest();
+ }
+ break;
+ }
+ case "30597-06.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30382-03.htm":
+ {
+ st.startQuest();
+ st.setCond(2);
+ st.giveItems(LEIKAN_LETTER, 1);
+ break;
+ }
+ case "30313-02.htm":
+ {
+ if (st.getQuestItemsCount(CLAY_URN_FRAGMENT) >= 5)
+ {
+ st.takeItems(CLAY_URN_FRAGMENT, 5);
+ if (Rnd.get(6) < 5)
+ {
+ htmltext = "30313-03.htm";
+ st.rewardItems(ANCIENT_CLAY_URN, 1);
+ }
+ else
+ {
+ htmltext = "30313-10.htm";
+ }
+ }
+ break;
+ }
+ case "30313-04.htm":
+ {
+ if (st.getQuestItemsCount(BRASS_TRINKET_PIECE) >= 5)
+ {
+ st.takeItems(BRASS_TRINKET_PIECE, 5);
+ if (Rnd.get(7) < 6)
+ {
+ htmltext = "30313-05.htm";
+ st.rewardItems(ANCIENT_BRASS_TIARA, 1);
+ }
+ else
+ {
+ htmltext = "30313-10.htm";
+ }
+ }
+ break;
+ }
+ case "30313-06.htm":
+ {
+ if (st.getQuestItemsCount(BRONZE_MIRROR_PIECE) >= 5)
+ {
+ st.takeItems(BRONZE_MIRROR_PIECE, 5);
+ if (Rnd.get(7) < 6)
+ {
+ htmltext = "30313-07.htm";
+ st.rewardItems(ANCIENT_BRONZE_MIRROR, 1);
+ }
+ else
+ {
+ htmltext = "30313-10.htm";
+ }
+ }
+ break;
+ }
+ case "30313-08.htm":
+ {
+ if (st.getQuestItemsCount(JADE_NECKLACE_BEAD) >= 5)
+ {
+ st.takeItems(JADE_NECKLACE_BEAD, 5);
+ if (Rnd.get(8) < 7)
+ {
+ htmltext = "30313-09.htm";
+ st.rewardItems(ANCIENT_JADE_NECKLACE, 1);
+ }
+ else
+ {
+ htmltext = "30313-10.htm";
+ }
+ }
+ break;
+ }
+ case "30034-03.htm":
+ {
+ final int n = st.getQuestItemsCount(CLAY_URN_FRAGMENT);
+ if (n == 0)
+ {
+ htmltext = "30034-02.htm";
}
else
{
- htmltext = "30313-10.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CLAY_URN_FRAGMENT, n);
+ st.rewardExpAndSp(n * 307, 0);
}
+ break;
}
- }
- else if (event.equals("30313-04.htm"))
- {
- if (st.getQuestItemsCount(BRASS_TRINKET_PIECE) >= 5)
+ case "30034-04.htm":
{
- st.takeItems(BRASS_TRINKET_PIECE, 5);
- if (Rnd.get(7) < 6)
+ final int n = st.getQuestItemsCount(BRASS_TRINKET_PIECE);
+ if (n == 0)
{
- htmltext = "30313-05.htm";
- st.rewardItems(ANCIENT_BRASS_TIARA, 1);
+ htmltext = "30034-02.htm";
}
else
{
- htmltext = "30313-10.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BRASS_TRINKET_PIECE, n);
+ st.rewardExpAndSp(n * 368, 0);
}
+ break;
}
- }
- else if (event.equals("30313-06.htm"))
- {
- if (st.getQuestItemsCount(BRONZE_MIRROR_PIECE) >= 5)
+ case "30034-05.htm":
{
- st.takeItems(BRONZE_MIRROR_PIECE, 5);
- if (Rnd.get(7) < 6)
+ final int n = st.getQuestItemsCount(BRONZE_MIRROR_PIECE);
+ if (n == 0)
{
- htmltext = "30313-07.htm";
- st.rewardItems(ANCIENT_BRONZE_MIRROR, 1);
+ htmltext = "30034-02.htm";
}
else
{
- htmltext = "30313-10.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BRONZE_MIRROR_PIECE, n);
+ st.rewardExpAndSp(n * 368, 0);
}
+ break;
}
- }
- else if (event.equals("30313-08.htm"))
- {
- if (st.getQuestItemsCount(JADE_NECKLACE_BEAD) >= 5)
+ case "30034-06.htm":
{
- st.takeItems(JADE_NECKLACE_BEAD, 5);
- if (Rnd.get(8) < 7)
+ final int n = st.getQuestItemsCount(JADE_NECKLACE_BEAD);
+ if (n == 0)
{
- htmltext = "30313-09.htm";
- st.rewardItems(ANCIENT_JADE_NECKLACE, 1);
+ htmltext = "30034-02.htm";
}
else
{
- htmltext = "30313-10.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(JADE_NECKLACE_BEAD, n);
+ st.rewardExpAndSp(n * 430, 0);
}
+ break;
}
- }
- // Iris
- else if (event.equals("30034-03.htm"))
- {
- final int n = st.getQuestItemsCount(CLAY_URN_FRAGMENT);
- if (n == 0)
+ case "30034-07.htm":
{
- htmltext = "30034-02.htm";
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CLAY_URN_FRAGMENT, n);
- st.rewardExpAndSp(n * 307, 0);
- }
- }
- else if (event.equals("30034-04.htm"))
- {
- final int n = st.getQuestItemsCount(BRASS_TRINKET_PIECE);
- if (n == 0)
- {
- htmltext = "30034-02.htm";
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BRASS_TRINKET_PIECE, n);
- st.rewardExpAndSp(n * 368, 0);
- }
- }
- else if (event.equals("30034-05.htm"))
- {
- final int n = st.getQuestItemsCount(BRONZE_MIRROR_PIECE);
- if (n == 0)
- {
- htmltext = "30034-02.htm";
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BRONZE_MIRROR_PIECE, n);
- st.rewardExpAndSp(n * 368, 0);
- }
- }
- else if (event.equals("30034-06.htm"))
- {
- final int n = st.getQuestItemsCount(JADE_NECKLACE_BEAD);
- if (n == 0)
- {
- htmltext = "30034-02.htm";
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(JADE_NECKLACE_BEAD, n);
- st.rewardExpAndSp(n * 430, 0);
- }
- }
- else if (event.equals("30034-07.htm"))
- {
- boolean isRewarded = false;
- for (int i = 1852; i < 1856; i++)
- {
- final int n = st.getQuestItemsCount(i);
- if (n > 0)
+ boolean isRewarded = false;
+ for (int i = 1852; i < 1856; i++)
{
- st.takeItems(i, n);
- st.rewardExpAndSp(n * EXP_REWARD.get(i), 0);
- isRewarded = true;
+ final int n = st.getQuestItemsCount(i);
+ if (n > 0)
+ {
+ st.takeItems(i, n);
+ st.rewardExpAndSp(n * EXP_REWARD.get(i), 0);
+ isRewarded = true;
+ }
}
- }
- if (!isRewarded)
- {
- htmltext = "30034-02.htm";
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- }
- // Nestle
- else if (event.equals("30314-03.htm"))
- {
- if (!st.hasQuestItems(ANCIENT_CLAY_URN))
- {
- htmltext = "30314-07.htm";
- }
- else
- {
- st.takeItems(ANCIENT_CLAY_URN, 1);
- st.rewardItems(SOULSHOT_D, 70 + Rnd.get(41));
- }
- }
- else if (event.equals("30314-04.htm"))
- {
- if (!st.hasQuestItems(ANCIENT_BRASS_TIARA))
- {
- htmltext = "30314-07.htm";
- }
- else
- {
- st.takeItems(ANCIENT_BRASS_TIARA, 1);
- final int rnd = Rnd.get(100);
- if (rnd < 40)
+ if (!isRewarded)
{
- st.rewardItems(HEALING_POTION, 1);
- }
- else if (rnd < 84)
- {
- st.rewardItems(HASTE_POTION, 1);
+ htmltext = "30034-02.htm";
}
else
{
- st.rewardItems(POTION_OF_ALACRITY, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
}
+ break;
}
- }
- else if (event.equals("30314-05.htm"))
- {
- if (!st.hasQuestItems(ANCIENT_BRONZE_MIRROR))
+ case "30314-03.htm":
{
- htmltext = "30314-07.htm";
+ if (!st.hasQuestItems(ANCIENT_CLAY_URN))
+ {
+ htmltext = "30314-07.htm";
+ }
+ else
+ {
+ st.takeItems(ANCIENT_CLAY_URN, 1);
+ st.rewardItems(SOULSHOT_D, 70 + Rnd.get(41));
+ }
+ break;
}
- else
+ case "30314-04.htm":
{
- st.takeItems(ANCIENT_BRONZE_MIRROR, 1);
- st.rewardItems((Rnd.get(100) < 59) ? SCROLL_OF_ESCAPE : SCROLL_OF_RESURRECTION, 1);
+ if (!st.hasQuestItems(ANCIENT_BRASS_TIARA))
+ {
+ htmltext = "30314-07.htm";
+ }
+ else
+ {
+ st.takeItems(ANCIENT_BRASS_TIARA, 1);
+ final int rnd = Rnd.get(100);
+ if (rnd < 40)
+ {
+ st.rewardItems(HEALING_POTION, 1);
+ }
+ else if (rnd < 84)
+ {
+ st.rewardItems(HASTE_POTION, 1);
+ }
+ else
+ {
+ st.rewardItems(POTION_OF_ALACRITY, 1);
+ }
+ }
+ break;
}
- }
- else if (event.equals("30314-06.htm"))
- {
- if (!st.hasQuestItems(ANCIENT_JADE_NECKLACE))
+ case "30314-05.htm":
{
- htmltext = "30314-07.htm";
+ if (!st.hasQuestItems(ANCIENT_BRONZE_MIRROR))
+ {
+ htmltext = "30314-07.htm";
+ }
+ else
+ {
+ st.takeItems(ANCIENT_BRONZE_MIRROR, 1);
+ st.rewardItems((Rnd.get(100) < 59) ? SCROLL_OF_ESCAPE : SCROLL_OF_RESURRECTION, 1);
+ }
+ break;
}
- else
+ case "30314-06.htm":
{
- st.takeItems(ANCIENT_JADE_NECKLACE, 1);
- st.rewardItems(SPIRITSHOT_D, 50 + Rnd.get(41));
+ if (!st.hasQuestItems(ANCIENT_JADE_NECKLACE))
+ {
+ htmltext = "30314-07.htm";
+ }
+ else
+ {
+ st.takeItems(ANCIENT_JADE_NECKLACE, 1);
+ st.rewardItems(SPIRITSHOT_D, 50 + Rnd.get(41));
+ }
+ break;
}
}
@@ -381,14 +361,17 @@ public class Q327_RecoverTheFarmland extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = npc.getNpcId() + ((player.getLevel() < 25) ? "-01.htm" : "-02.htm");
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case PIOTUR:
+ {
if (!st.hasQuestItems(LEIKAN_LETTER))
{
if (st.hasAtLeastOneQuestItem(TUREK_DOGTAG, TUREK_MEDALLION))
@@ -397,7 +380,7 @@ public class Q327_RecoverTheFarmland extends Quest
if (cond < 4)
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
@@ -415,13 +398,14 @@ public class Q327_RecoverTheFarmland extends Quest
else
{
htmltext = "30597-03a.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LEIKAN_LETTER, 1);
}
break;
-
+ }
case LEIKAN:
+ {
if (cond == 2)
{
htmltext = "30382-04.htm";
@@ -429,7 +413,7 @@ public class Q327_RecoverTheFarmland extends Quest
else if ((cond == 3) || (cond == 4))
{
htmltext = "30382-05.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
@@ -437,12 +421,15 @@ public class Q327_RecoverTheFarmland extends Quest
htmltext = "30382-05.htm";
}
break;
-
+ }
default:
+ {
htmltext = npc.getNpcId() + "-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q328_SenseForBusiness/Q328_SenseForBusiness.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q328_SenseForBusiness/Q328_SenseForBusiness.java
index 20fb529034..6ac792457e 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q328_SenseForBusiness/Q328_SenseForBusiness.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q328_SenseForBusiness/Q328_SenseForBusiness.java
@@ -32,7 +32,6 @@ public class Q328_SenseForBusiness extends Quest
private static final int MONSTER_EYE_LENS = 1366;
private static final int MONSTER_EYE_CARCASS = 1347;
private static final int BASILISK_GIZZARD = 1348;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -48,12 +47,9 @@ public class Q328_SenseForBusiness extends Quest
public Q328_SenseForBusiness()
{
super(328, "Sense for Business");
-
registerQuestItems(MONSTER_EYE_LENS, MONSTER_EYE_CARCASS, BASILISK_GIZZARD);
-
addStartNpc(30436); // Sarien
addTalkId(30436);
-
addKillId(20055, 20059, 20067, 20068, 20070, 20072);
}
@@ -69,9 +65,7 @@ public class Q328_SenseForBusiness extends Quest
if (event.equals("30436-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30436-06.htm"))
{
@@ -95,10 +89,12 @@ public class Q328_SenseForBusiness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 21) ? "30436-01.htm" : "30436-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int carcasses = st.getQuestItemsCount(MONSTER_EYE_CARCASS);
final int lenses = st.getQuestItemsCount(MONSTER_EYE_LENS);
final int gizzards = st.getQuestItemsCount(BASILISK_GIZZARD);
@@ -116,6 +112,7 @@ public class Q328_SenseForBusiness extends Quest
st.rewardItems(57, (25 * carcasses) + (1000 * lenses) + (60 * gizzards) + ((all >= 10) ? 618 : 0));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q329_CuriosityOfADwarf/Q329_CuriosityOfADwarf.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q329_CuriosityOfADwarf/Q329_CuriosityOfADwarf.java
index 48f7234fd0..afdfa134ed 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q329_CuriosityOfADwarf/Q329_CuriosityOfADwarf.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q329_CuriosityOfADwarf/Q329_CuriosityOfADwarf.java
@@ -32,10 +32,8 @@ public class Q329_CuriosityOfADwarf extends Quest
public Q329_CuriosityOfADwarf()
{
super(329, "Curiosity of a Dwarf");
-
addStartNpc(30437); // Rolento
addTalkId(30437);
-
addKillId(20083, 20085); // Granite golem, Puncher
}
@@ -51,9 +49,7 @@ public class Q329_CuriosityOfADwarf extends Quest
if (event.equals("30437-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30437-06.htm"))
{
@@ -77,10 +73,12 @@ public class Q329_CuriosityOfADwarf extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 33) ? "30437-01.htm" : "30437-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int golem = st.getQuestItemsCount(GOLEM_HEARTSTONE);
final int broken = st.getQuestItemsCount(BROKEN_HEARTSTONE);
if ((golem + broken) == 0)
@@ -95,6 +93,7 @@ public class Q329_CuriosityOfADwarf extends Quest
st.rewardItems(57, (broken * 50) + (golem * 1000) + (((golem + broken) > 10) ? 1183 : 0));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q330_AdeptOfTaste/Q330_AdeptOfTaste.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q330_AdeptOfTaste/Q330_AdeptOfTaste.java
index 1a612e8f47..e42430a16b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q330_AdeptOfTaste/Q330_AdeptOfTaste.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q330_AdeptOfTaste/Q330_AdeptOfTaste.java
@@ -36,7 +36,6 @@ public class Q330_AdeptOfTaste extends Quest
private static final int PANO = 30078;
private static final int MIRIEN = 30461;
private static final int JONAS = 30469;
-
// Items
private static final int INGREDIENT_LIST = 1420;
private static final int SONIA_BOTANY_BOOK = 1421;
@@ -70,57 +69,30 @@ public class Q330_AdeptOfTaste extends Quest
private static final int MIRIEN_REVIEW_3 = 1449;
private static final int MIRIEN_REVIEW_4 = 1450;
private static final int MIRIEN_REVIEW_5 = 1451;
-
// Rewards
private static final int JONAS_SALAD_RECIPE = 1455;
private static final int JONAS_SAUCE_RECIPE = 1456;
private static final int JONAS_STEAK_RECIPE = 1457;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
{
- CHANCES.put(20204, new int[]
- {
- 92,
- 100
- });
- CHANCES.put(20229, new int[]
- {
- 80,
- 95
- });
- CHANCES.put(20223, new int[]
- {
- 70,
- 77
- });
- CHANCES.put(20154, new int[]
- {
- 70,
- 77
- });
- CHANCES.put(20155, new int[]
- {
- 87,
- 96
- });
- CHANCES.put(20156, new int[]
- {
- 77,
- 85
- });
+ // @formatter:off
+ CHANCES.put(20204, new int[]{92, 100});
+ CHANCES.put(20229, new int[]{80, 95});
+ CHANCES.put(20223, new int[]{70, 77});
+ CHANCES.put(20154, new int[]{70, 77});
+ CHANCES.put(20155, new int[]{87, 96});
+ CHANCES.put(20156, new int[]{77, 85});
+ // @formatter:on
}
public Q330_AdeptOfTaste()
{
super(330, "Adept of Taste");
-
registerQuestItems(INGREDIENT_LIST, RED_MANDRAGORA_SAP, WHITE_MANDRAGORA_SAP, HONEY, GOLDEN_HONEY, DIONIAN_POTATO, GREEN_MOSS_BUNDLE, BROWN_MOSS_BUNDLE, MONSTER_EYE_MEAT, MIRIEN_REVIEW_1, MIRIEN_REVIEW_2, MIRIEN_REVIEW_3, MIRIEN_REVIEW_4, MIRIEN_REVIEW_5, JONAS_STEAK_DISH_1, JONAS_STEAK_DISH_2, JONAS_STEAK_DISH_3, JONAS_STEAK_DISH_4, JONAS_STEAK_DISH_5, SONIA_BOTANY_BOOK, RED_MANDRAGORA_ROOT, WHITE_MANDRAGORA_ROOT, JACOB_INSECT_BOOK, NECTAR, ROYAL_JELLY, PANO_CONTRACT, HOBGOBLIN_AMULET, GLYVKA_BOTANY_BOOK, GREEN_MARSH_MOSS, BROWN_MARSH_MOSS, ROLANT_CREATURE_BOOK, MONSTER_EYE_BODY);
-
addStartNpc(JONAS); // Jonas
addTalkId(JONAS, SONIA, GLYVKA, ROLLANT, JACOB, PANO, MIRIEN);
-
addKillId(20147, 20154, 20155, 20156, 20204, 20223, 20226, 20228, 20229, 20265, 20266);
}
@@ -134,36 +106,41 @@ public class Q330_AdeptOfTaste extends Quest
return htmltext;
}
- if (event.equals("30469-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(INGREDIENT_LIST, 1);
- }
- else if (event.equals("30062-05.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(SONIA_BOTANY_BOOK, 1);
- st.takeItems(RED_MANDRAGORA_ROOT, -1);
- st.takeItems(WHITE_MANDRAGORA_ROOT, -1);
- st.giveItems(RED_MANDRAGORA_SAP, 1);
- }
- else if (event.equals("30073-05.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(JACOB_INSECT_BOOK, 1);
- st.takeItems(NECTAR, -1);
- st.takeItems(ROYAL_JELLY, -1);
- st.giveItems(HONEY, 1);
- }
- else if (event.equals("30067-05.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(GLYVKA_BOTANY_BOOK, 1);
- st.takeItems(GREEN_MARSH_MOSS, -1);
- st.takeItems(BROWN_MARSH_MOSS, -1);
- st.giveItems(GREEN_MOSS_BUNDLE, 1);
+ case "30469-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(INGREDIENT_LIST, 1);
+ break;
+ }
+ case "30062-05.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(SONIA_BOTANY_BOOK, 1);
+ st.takeItems(RED_MANDRAGORA_ROOT, -1);
+ st.takeItems(WHITE_MANDRAGORA_ROOT, -1);
+ st.giveItems(RED_MANDRAGORA_SAP, 1);
+ break;
+ }
+ case "30073-05.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(JACOB_INSECT_BOOK, 1);
+ st.takeItems(NECTAR, -1);
+ st.takeItems(ROYAL_JELLY, -1);
+ st.giveItems(HONEY, 1);
+ break;
+ }
+ case "30067-05.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(GLYVKA_BOTANY_BOOK, 1);
+ st.takeItems(GREEN_MARSH_MOSS, -1);
+ st.takeItems(BROWN_MARSH_MOSS, -1);
+ st.giveItems(GREEN_MOSS_BUNDLE, 1);
+ break;
+ }
}
return htmltext;
@@ -182,13 +159,16 @@ public class Q330_AdeptOfTaste extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 24) ? "30469-01.htm" : "30469-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case JONAS:
+ {
if (st.hasQuestItems(INGREDIENT_LIST))
{
if (!hasAllIngredients(st))
@@ -273,8 +253,9 @@ public class Q330_AdeptOfTaste extends Quest
st.exitQuest(true);
}
break;
-
+ }
case MIRIEN:
+ {
if (st.hasQuestItems(INGREDIENT_LIST))
{
htmltext = "30461-01.htm";
@@ -318,8 +299,9 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30461-04.htm";
}
break;
-
+ }
case SONIA:
+ {
if (!st.hasQuestItems(RED_MANDRAGORA_SAP) && !st.hasQuestItems(WHITE_MANDRAGORA_SAP))
{
if (!st.hasQuestItems(SONIA_BOTANY_BOOK))
@@ -354,8 +336,9 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30062-07.htm";
}
break;
-
+ }
case JACOB:
+ {
if (!st.hasQuestItems(HONEY) && !st.hasQuestItems(GOLDEN_HONEY))
{
if (!st.hasQuestItems(JACOB_INSECT_BOOK))
@@ -393,8 +376,9 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30073-07.htm";
}
break;
-
+ }
case PANO:
+ {
if (!st.hasQuestItems(DIONIAN_POTATO))
{
if (!st.hasQuestItems(PANO_CONTRACT))
@@ -424,8 +408,9 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30078-04.htm";
}
break;
-
+ }
case GLYVKA:
+ {
if (!st.hasQuestItems(GREEN_MOSS_BUNDLE) && !st.hasQuestItems(BROWN_MOSS_BUNDLE))
{
if (!st.hasQuestItems(GLYVKA_BOTANY_BOOK))
@@ -460,8 +445,9 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30067-07.htm";
}
break;
-
+ }
case ROLLANT:
+ {
if (!st.hasQuestItems(MONSTER_EYE_MEAT))
{
if (!st.hasQuestItems(ROLANT_CREATURE_BOOK))
@@ -491,8 +477,10 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30069-04.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -508,46 +496,51 @@ public class Q330_AdeptOfTaste extends Quest
}
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case 20265:
+ {
if (st.hasQuestItems(ROLANT_CREATURE_BOOK))
{
st.dropItems(MONSTER_EYE_BODY, (Rnd.get(97) < 77) ? 2 : 3, 30, 970000);
}
break;
-
+ }
case 20266:
+ {
if (st.hasQuestItems(ROLANT_CREATURE_BOOK))
{
st.dropItemsAlways(MONSTER_EYE_BODY, (Rnd.get(10) < 7) ? 1 : 2, 30);
}
break;
-
+ }
case 20226:
+ {
if (st.hasQuestItems(GLYVKA_BOTANY_BOOK))
{
st.dropItems(((Rnd.get(96) < 87) ? GREEN_MARSH_MOSS : BROWN_MARSH_MOSS), 1, 20, 960000);
}
break;
-
+ }
case 20228:
+ {
if (st.hasQuestItems(GLYVKA_BOTANY_BOOK))
{
st.dropItemsAlways(((Rnd.get(10) < 9) ? GREEN_MARSH_MOSS : BROWN_MARSH_MOSS), 1, 20);
}
break;
-
+ }
case 20147:
+ {
if (st.hasQuestItems(PANO_CONTRACT))
{
st.dropItemsAlways(HOBGOBLIN_AMULET, 1, 30);
}
break;
-
+ }
case 20204:
case 20229:
+ {
if (st.hasQuestItems(JACOB_INSECT_BOOK))
{
final int random = Rnd.get(100);
@@ -562,11 +555,12 @@ public class Q330_AdeptOfTaste extends Quest
}
}
break;
-
+ }
case 20223:
case 20154:
case 20155:
case 20156:
+ {
if (st.hasQuestItems(SONIA_BOTANY_BOOK))
{
final int random = Rnd.get(100);
@@ -577,6 +571,7 @@ public class Q330_AdeptOfTaste extends Quest
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q331_ArrowOfVengeance/Q331_ArrowOfVengeance.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q331_ArrowOfVengeance/Q331_ArrowOfVengeance.java
index db313cf134..75f92a983b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q331_ArrowOfVengeance/Q331_ArrowOfVengeance.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q331_ArrowOfVengeance/Q331_ArrowOfVengeance.java
@@ -32,12 +32,9 @@ public class Q331_ArrowOfVengeance extends Quest
public Q331_ArrowOfVengeance()
{
super(331, "Arrow of Vengeance");
-
registerQuestItems(HARPY_FEATHER, MEDUSA_VENOM, WYRM_TOOTH);
-
addStartNpc(30125); // Belton
addTalkId(30125);
-
addKillId(20145, 20158, 20176);
}
@@ -53,9 +50,7 @@ public class Q331_ArrowOfVengeance extends Quest
if (event.equals("30125-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30125-06.htm"))
{
@@ -79,10 +74,12 @@ public class Q331_ArrowOfVengeance extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 32) ? "30125-01.htm" : "30125-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int harpyFeather = st.getQuestItemsCount(HARPY_FEATHER);
final int medusaVenom = st.getQuestItemsCount(MEDUSA_VENOM);
final int wyrmTooth = st.getQuestItemsCount(WYRM_TOOTH);
@@ -107,6 +104,7 @@ public class Q331_ArrowOfVengeance extends Quest
htmltext = "30125-04.htm";
}
break;
+ }
}
return htmltext;
@@ -124,16 +122,20 @@ public class Q331_ArrowOfVengeance extends Quest
switch (npc.getNpcId())
{
case 20145:
+ {
st.dropItems(HARPY_FEATHER, 1, 0, 500000);
break;
-
+ }
case 20158:
+ {
st.dropItems(MEDUSA_VENOM, 1, 0, 500000);
break;
-
+ }
case 20176:
+ {
st.dropItems(WYRM_TOOTH, 1, 0, 500000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q333_HuntOfTheBlackLion/Q333_HuntOfTheBlackLion.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q333_HuntOfTheBlackLion/Q333_HuntOfTheBlackLion.java
index 40b2af2da9..67112b5dad 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q333_HuntOfTheBlackLion/Q333_HuntOfTheBlackLion.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q333_HuntOfTheBlackLion/Q333_HuntOfTheBlackLion.java
@@ -32,10 +32,8 @@ public class Q333_HuntOfTheBlackLion extends Quest
private static final int UNDRIAS = 30130;
private static final int LOCKIRIN = 30531;
private static final int MORGAN = 30737;
-
// Needs for start
private static final int BLACK_LION_MARK = 1369;
-
// Quest items
private static final int LION_CLAW = 3675;
private static final int LION_EYE = 3676;
@@ -48,7 +46,6 @@ public class Q333_HuntOfTheBlackLion extends Quest
private static final int SOPHYA_LETTER_2 = 3672;
private static final int SOPHYA_LETTER_3 = 3673;
private static final int SOPHYA_LETTER_4 = 3674;
-
private static final int CARGO_BOX_1 = 3440;
private static final int CARGO_BOX_2 = 3441;
private static final int CARGO_BOX_3 = 3442;
@@ -76,7 +73,6 @@ public class Q333_HuntOfTheBlackLion extends Quest
private static final int TABLET_FRAGMENT_3 = 3464;
private static final int TABLET_FRAGMENT_4 = 3465;
private static final int COMPLETE_TABLET = 3466;
-
// Neutral items
private static final int ADENA = 57;
private static final int SWIFT_ATTACK_POTION = 735;
@@ -84,173 +80,41 @@ public class Q333_HuntOfTheBlackLion extends Quest
private static final int HEALING_POTION = 1061;
private static final int SOULSHOT_D = 1463;
private static final int SPIRITSHOT_D = 2510;
-
// Tabs: Part, NpcId, ItemId, Item Chance, Box Id, Box Chance
private static final int[][] DROPLIST =
{
+ // @formatter:off
// Part #1 - Execution Ground
- {
- SOPHYA_LETTER_1,
- 20160,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 90000
- }, // Neer Crawler
- {
- SOPHYA_LETTER_1,
- 20171,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 60000
- }, // Specter
- {
- SOPHYA_LETTER_1,
- 20197,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 70000
- }, // Sorrow Maiden
- {
- SOPHYA_LETTER_1,
- 20198,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 80000
- }, // Neer Ghoul Berserker
- {
- SOPHYA_LETTER_1,
- 20200,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 100000
- }, // Strain
- {
- SOPHYA_LETTER_1,
- 20201,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 110000
- }, // Ghoul
-
+ {SOPHYA_LETTER_1, 20160, UNDEAD_ASH, 500000, CARGO_BOX_1, 90000}, // Neer Crawler
+ {SOPHYA_LETTER_1, 20171, UNDEAD_ASH, 500000, CARGO_BOX_1, 60000}, // Specter
+ {SOPHYA_LETTER_1, 20197, UNDEAD_ASH, 500000, CARGO_BOX_1, 70000}, // Sorrow Maiden
+ {SOPHYA_LETTER_1, 20198, UNDEAD_ASH, 500000, CARGO_BOX_1, 80000}, // Neer Ghoul Berserker
+ {SOPHYA_LETTER_1, 20200, UNDEAD_ASH, 500000, CARGO_BOX_1, 100000}, // Strain
+ {SOPHYA_LETTER_1, 20201, UNDEAD_ASH, 500000, CARGO_BOX_1, 110000}, // Ghoul
// Part #2 - Partisan Hideaway
- {
- SOPHYA_LETTER_2,
- 20207,
- BLOODY_AXE_INSIGNIA,
- 500000,
- CARGO_BOX_2,
- 60000
- }, // Ol Mahum Guerilla
- {
- SOPHYA_LETTER_2,
- 20208,
- BLOODY_AXE_INSIGNIA,
- 500000,
- CARGO_BOX_2,
- 70000
- }, // Ol Mahum Raider
- {
- SOPHYA_LETTER_2,
- 20209,
- BLOODY_AXE_INSIGNIA,
- 500000,
- CARGO_BOX_2,
- 80000
- }, // Ol Mahum Marksman
- {
- SOPHYA_LETTER_2,
- 20210,
- BLOODY_AXE_INSIGNIA,
- 500000,
- CARGO_BOX_2,
- 90000
- }, // Ol Mahum Sergeant
- {
- SOPHYA_LETTER_2,
- 20211,
- BLOODY_AXE_INSIGNIA,
- 500000,
- CARGO_BOX_2,
- 100000
- }, // Ol Mahum Captain
-
+ {SOPHYA_LETTER_2, 20207, BLOODY_AXE_INSIGNIA, 500000, CARGO_BOX_2, 60000}, // Ol Mahum Guerilla
+ {SOPHYA_LETTER_2, 20208, BLOODY_AXE_INSIGNIA, 500000, CARGO_BOX_2, 70000}, // Ol Mahum Raider
+ {SOPHYA_LETTER_2, 20209, BLOODY_AXE_INSIGNIA, 500000, CARGO_BOX_2, 80000}, // Ol Mahum Marksman
+ {SOPHYA_LETTER_2, 20210, BLOODY_AXE_INSIGNIA, 500000, CARGO_BOX_2, 90000}, // Ol Mahum Sergeant
+ {SOPHYA_LETTER_2, 20211, BLOODY_AXE_INSIGNIA, 500000, CARGO_BOX_2, 100000}, // Ol Mahum Captain
// Part #3 - Near Giran Town
- {
- SOPHYA_LETTER_3,
- 20251,
- DELU_FANG,
- 500000,
- CARGO_BOX_3,
- 100000
- }, // Delu Lizardman
- {
- SOPHYA_LETTER_3,
- 20252,
- DELU_FANG,
- 500000,
- CARGO_BOX_3,
- 110000
- }, // Delu Lizardman Scout
- {
- SOPHYA_LETTER_3,
- 20253,
- DELU_FANG,
- 500000,
- CARGO_BOX_3,
- 120000
- }, // Delu Lizardman Warrior
-
+ {SOPHYA_LETTER_3, 20251, DELU_FANG, 500000, CARGO_BOX_3, 100000}, // Delu Lizardman
+ {SOPHYA_LETTER_3, 20252, DELU_FANG, 500000, CARGO_BOX_3, 110000}, // Delu Lizardman Scout
+ {SOPHYA_LETTER_3, 20253, DELU_FANG, 500000, CARGO_BOX_3, 120000}, // Delu Lizardman Warrior
// Part #4 - Cruma Area
- {
- SOPHYA_LETTER_4,
- 20157,
- STAKATO_TALON,
- 500000,
- CARGO_BOX_4,
- 100000
- }, // Marsh Stakato
- {
- SOPHYA_LETTER_4,
- 20230,
- STAKATO_TALON,
- 500000,
- CARGO_BOX_4,
- 110000
- }, // Marsh Stakato Worker
- {
- SOPHYA_LETTER_4,
- 20232,
- STAKATO_TALON,
- 500000,
- CARGO_BOX_4,
- 120000
- }, // Marsh Stakato Soldier
- {
- SOPHYA_LETTER_4,
- 20234,
- STAKATO_TALON,
- 500000,
- CARGO_BOX_4,
- 130000
- }
- // Marsh Stakato Drone
+ {SOPHYA_LETTER_4, 20157, STAKATO_TALON, 500000, CARGO_BOX_4, 100000}, // Marsh Stakato
+ {SOPHYA_LETTER_4, 20230, STAKATO_TALON, 500000, CARGO_BOX_4, 110000}, // Marsh Stakato Worker
+ {SOPHYA_LETTER_4, 20232, STAKATO_TALON, 500000, CARGO_BOX_4, 120000}, // Marsh Stakato Soldier
+ {SOPHYA_LETTER_4, 20234, STAKATO_TALON, 500000, CARGO_BOX_4, 130000}, // Marsh Stakato Drone
+ // @formatter:on
};
public Q333_HuntOfTheBlackLion()
{
super(333, "Hunt of the Black Lion");
-
registerQuestItems(LION_CLAW, LION_EYE, GUILD_COIN, UNDEAD_ASH, BLOODY_AXE_INSIGNIA, DELU_FANG, STAKATO_TALON, SOPHYA_LETTER_1, SOPHYA_LETTER_2, SOPHYA_LETTER_3, SOPHYA_LETTER_4);
-
addStartNpc(SOPHYA);
addTalkId(SOPHYA, REDFOOT, RUPIO, UNDRIAS, LOCKIRIN, MORGAN);
-
for (int[] i : DROPLIST)
{
addKillId(i[1]);
@@ -267,492 +131,514 @@ public class Q333_HuntOfTheBlackLion extends Quest
return htmltext;
}
- if (event.equals("30735-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30735-10.htm"))
- {
- if (!st.hasQuestItems(SOPHYA_LETTER_1))
+ case "30735-04.htm":
{
- st.giveItems(SOPHYA_LETTER_1, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30735-11.htm"))
- {
- if (!st.hasQuestItems(SOPHYA_LETTER_2))
+ case "30735-10.htm":
{
- st.giveItems(SOPHYA_LETTER_2, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ if (!st.hasQuestItems(SOPHYA_LETTER_1))
+ {
+ st.giveItems(SOPHYA_LETTER_1, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
}
- }
- else if (event.equals("30735-12.htm"))
- {
- if (!st.hasQuestItems(SOPHYA_LETTER_3))
+ case "30735-11.htm":
{
- st.giveItems(SOPHYA_LETTER_3, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ if (!st.hasQuestItems(SOPHYA_LETTER_2))
+ {
+ st.giveItems(SOPHYA_LETTER_2, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
}
- }
- else if (event.equals("30735-13.htm"))
- {
- if (!st.hasQuestItems(SOPHYA_LETTER_4))
+ case "30735-12.htm":
{
- st.giveItems(SOPHYA_LETTER_4, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ if (!st.hasQuestItems(SOPHYA_LETTER_3))
+ {
+ st.giveItems(SOPHYA_LETTER_3, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
}
- }
- else if (event.equals("30735-16.htm"))
- {
- if (st.getQuestItemsCount(LION_CLAW) > 9)
+ case "30735-13.htm":
{
- st.takeItems(LION_CLAW, 10);
-
- final int eyes = st.getQuestItemsCount(LION_EYE);
- if (eyes < 5)
+ if (!st.hasQuestItems(SOPHYA_LETTER_4))
{
- htmltext = "30735-17a.htm";
-
- st.giveItems(LION_EYE, 1);
-
- final int random = Rnd.get(100);
- if (random < 25)
- {
- st.giveItems(HEALING_POTION, 20);
- }
- else if (random < 50)
- {
- st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 50 : 100);
- }
- else if (random < 75)
- {
- st.giveItems(SCROLL_OF_ESCAPE, 20);
- }
- else
- {
- st.giveItems(SWIFT_ATTACK_POTION, 3);
- }
- }
- else if (eyes < 9)
- {
- htmltext = "30735-18b.htm";
-
- st.giveItems(LION_EYE, 1);
-
- final int random = Rnd.get(100);
- if (random < 25)
- {
- st.giveItems(HEALING_POTION, 25);
- }
- else if (random < 50)
- {
- st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 100 : 200);
- }
- else if (random < 75)
- {
- st.giveItems(SCROLL_OF_ESCAPE, 20);
- }
- else
- {
- st.giveItems(SWIFT_ATTACK_POTION, 3);
- }
- }
- else
- {
- htmltext = "30735-19b.htm";
-
- final int random = Rnd.get(100);
- if (random < 25)
- {
- st.giveItems(HEALING_POTION, 50);
- }
- else if (random < 50)
- {
- st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 200 : 400);
- }
- else if (random < 75)
- {
- st.giveItems(SCROLL_OF_ESCAPE, 30);
- }
- else
- {
- st.giveItems(SWIFT_ATTACK_POTION, 4);
- }
+ st.giveItems(SOPHYA_LETTER_4, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
}
+ break;
}
- }
- else if (event.equals("30735-20.htm"))
- {
- st.takeItems(SOPHYA_LETTER_1, -1);
- st.takeItems(SOPHYA_LETTER_2, -1);
- st.takeItems(SOPHYA_LETTER_3, -1);
- st.takeItems(SOPHYA_LETTER_4, -1);
- }
- else if (event.equals("30735-26.htm"))
- {
- st.takeItems(LION_CLAW, -1);
- st.takeItems(LION_EYE, -1);
- st.takeItems(GUILD_COIN, -1);
- st.takeItems(BLACK_LION_MARK, -1);
- st.takeItems(SOPHYA_LETTER_1, -1);
- st.takeItems(SOPHYA_LETTER_2, -1);
- st.takeItems(SOPHYA_LETTER_3, -1);
- st.takeItems(SOPHYA_LETTER_4, -1);
- st.giveItems(ADENA, 12400);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30736-03.htm"))
- {
- final boolean cargo1 = st.hasQuestItems(CARGO_BOX_1);
- final boolean cargo2 = st.hasQuestItems(CARGO_BOX_2);
- final boolean cargo3 = st.hasQuestItems(CARGO_BOX_3);
- final boolean cargo4 = st.hasQuestItems(CARGO_BOX_4);
- if ((cargo1 || cargo2 || cargo3 || cargo4) && (player.getAdena() > 649))
+ case "30735-16.htm":
{
- st.takeItems(ADENA, 650);
-
- if (cargo1)
+ if (st.getQuestItemsCount(LION_CLAW) > 9)
{
- st.takeItems(CARGO_BOX_1, 1);
- }
- else if (cargo2)
- {
- st.takeItems(CARGO_BOX_2, 1);
- }
- else if (cargo3)
- {
- st.takeItems(CARGO_BOX_3, 1);
- }
- else
- {
- st.takeItems(CARGO_BOX_4, 1);
- }
-
- final int i0 = Rnd.get(100);
- final int i1 = Rnd.get(100);
- if (i0 < 40)
- {
- if (i1 < 33)
- {
- htmltext = "30736-04a.htm";
- st.giveItems(GLUDIO_APPLE, 1);
- }
- else if (i1 < 66)
- {
- htmltext = "30736-04b.htm";
- st.giveItems(CORN_MEAL, 1);
- }
- else
- {
- htmltext = "30736-04c.htm";
- st.giveItems(WOLF_PELTS, 1);
- }
- }
- else if (i0 < 60)
- {
- if (i1 < 33)
- {
- htmltext = "30736-04d.htm";
- st.giveItems(MOONSTONE, 1);
- }
- else if (i1 < 66)
- {
- htmltext = "30736-04e.htm";
- st.giveItems(GLUDIO_WHEAT_FLOWER, 1);
- }
- else
- {
- htmltext = "30736-04f.htm";
- st.giveItems(SPIDERSILK_ROPE, 1);
- }
- }
- else if (i0 < 70)
- {
- if (i1 < 33)
- {
- htmltext = "30736-04g.htm";
- st.giveItems(ALEXANDRITE, 1);
- }
- else if (i1 < 66)
- {
- htmltext = "30736-04h.htm";
- st.giveItems(SILVER_TEA, 1);
- }
- else
- {
- htmltext = "30736-04i.htm";
- st.giveItems(GOLEM_PART, 1);
- }
- }
- else if (i0 < 75)
- {
- if (i1 < 33)
- {
- htmltext = "30736-04j.htm";
- st.giveItems(FIRE_EMERALD, 1);
- }
- else if (i1 < 66)
- {
- htmltext = "30736-04k.htm";
- st.giveItems(SILK_FROCK, 1);
- }
- else
- {
- htmltext = "30736-04l.htm";
- st.giveItems(PORCELAN_URN, 1);
- }
- }
- else if (i0 < 76)
- {
- htmltext = "30736-04m.htm";
- st.giveItems(IMPERIAL_DIAMOND, 1);
- }
- else if (Rnd.nextBoolean())
- {
- htmltext = "30736-04n.htm";
+ st.takeItems(LION_CLAW, 10);
- if (i1 < 25)
+ final int eyes = st.getQuestItemsCount(LION_EYE);
+ if (eyes < 5)
{
- st.giveItems(STATUE_SHILIEN_HEAD, 1);
+ htmltext = "30735-17a.htm";
+
+ st.giveItems(LION_EYE, 1);
+
+ final int random = Rnd.get(100);
+ if (random < 25)
+ {
+ st.giveItems(HEALING_POTION, 20);
+ }
+ else if (random < 50)
+ {
+ st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 50 : 100);
+ }
+ else if (random < 75)
+ {
+ st.giveItems(SCROLL_OF_ESCAPE, 20);
+ }
+ else
+ {
+ st.giveItems(SWIFT_ATTACK_POTION, 3);
+ }
}
- else if (i1 < 50)
+ else if (eyes < 9)
{
- st.giveItems(STATUE_SHILIEN_TORSO, 1);
- }
- else if (i1 < 75)
- {
- st.giveItems(STATUE_SHILIEN_ARM, 1);
+ htmltext = "30735-18b.htm";
+
+ st.giveItems(LION_EYE, 1);
+
+ final int random = Rnd.get(100);
+ if (random < 25)
+ {
+ st.giveItems(HEALING_POTION, 25);
+ }
+ else if (random < 50)
+ {
+ st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 100 : 200);
+ }
+ else if (random < 75)
+ {
+ st.giveItems(SCROLL_OF_ESCAPE, 20);
+ }
+ else
+ {
+ st.giveItems(SWIFT_ATTACK_POTION, 3);
+ }
}
else
{
- st.giveItems(STATUE_SHILIEN_LEG, 1);
+ htmltext = "30735-19b.htm";
+
+ final int random = Rnd.get(100);
+ if (random < 25)
+ {
+ st.giveItems(HEALING_POTION, 50);
+ }
+ else if (random < 50)
+ {
+ st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 200 : 400);
+ }
+ else if (random < 75)
+ {
+ st.giveItems(SCROLL_OF_ESCAPE, 30);
+ }
+ else
+ {
+ st.giveItems(SWIFT_ATTACK_POTION, 4);
+ }
}
}
- else
+ break;
+ }
+ case "30735-20.htm":
+ {
+ st.takeItems(SOPHYA_LETTER_1, -1);
+ st.takeItems(SOPHYA_LETTER_2, -1);
+ st.takeItems(SOPHYA_LETTER_3, -1);
+ st.takeItems(SOPHYA_LETTER_4, -1);
+ break;
+ }
+ case "30735-26.htm":
+ {
+ st.takeItems(LION_CLAW, -1);
+ st.takeItems(LION_EYE, -1);
+ st.takeItems(GUILD_COIN, -1);
+ st.takeItems(BLACK_LION_MARK, -1);
+ st.takeItems(SOPHYA_LETTER_1, -1);
+ st.takeItems(SOPHYA_LETTER_2, -1);
+ st.takeItems(SOPHYA_LETTER_3, -1);
+ st.takeItems(SOPHYA_LETTER_4, -1);
+ st.giveItems(ADENA, 12400);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30736-03.htm":
+ {
+ final boolean cargo1 = st.hasQuestItems(CARGO_BOX_1);
+ final boolean cargo2 = st.hasQuestItems(CARGO_BOX_2);
+ final boolean cargo3 = st.hasQuestItems(CARGO_BOX_3);
+ final boolean cargo4 = st.hasQuestItems(CARGO_BOX_4);
+ if ((cargo1 || cargo2 || cargo3 || cargo4) && (player.getAdena() > 649))
{
- htmltext = "30736-04o.htm";
+ st.takeItems(ADENA, 650);
- if (i1 < 25)
+ if (cargo1)
{
- st.giveItems(TABLET_FRAGMENT_1, 1);
+ st.takeItems(CARGO_BOX_1, 1);
}
- else if (i1 < 50)
+ else if (cargo2)
{
- st.giveItems(TABLET_FRAGMENT_2, 1);
+ st.takeItems(CARGO_BOX_2, 1);
}
- else if (i1 < 75)
+ else if (cargo3)
{
- st.giveItems(TABLET_FRAGMENT_3, 1);
+ st.takeItems(CARGO_BOX_3, 1);
}
else
{
- st.giveItems(TABLET_FRAGMENT_4, 1);
+ st.takeItems(CARGO_BOX_4, 1);
}
- }
- }
- else
- {
- htmltext = "30736-05.htm";
- }
- }
- else if (event.equals("30736-07.htm"))
- {
- final int state = st.getInt("state");
- if (player.getAdena() > (200 + (state * 200)))
- {
- if (state < 3)
- {
+
final int i0 = Rnd.get(100);
- if (i0 < 5)
+ final int i1 = Rnd.get(100);
+ if (i0 < 40)
{
- htmltext = "30736-08a.htm";
- }
- else if (i0 < 10)
- {
- htmltext = "30736-08b.htm";
- }
- else if (i0 < 15)
- {
- htmltext = "30736-08c.htm";
- }
- else if (i0 < 20)
- {
- htmltext = "30736-08d.htm";
- }
- else if (i0 < 25)
- {
- htmltext = "30736-08e.htm";
- }
- else if (i0 < 30)
- {
- htmltext = "30736-08f.htm";
- }
- else if (i0 < 35)
- {
- htmltext = "30736-08g.htm";
- }
- else if (i0 < 40)
- {
- htmltext = "30736-08h.htm";
- }
- else if (i0 < 45)
- {
- htmltext = "30736-08i.htm";
- }
- else if (i0 < 50)
- {
- htmltext = "30736-08j.htm";
- }
- else if (i0 < 55)
- {
- htmltext = "30736-08k.htm";
+ if (i1 < 33)
+ {
+ htmltext = "30736-04a.htm";
+ st.giveItems(GLUDIO_APPLE, 1);
+ }
+ else if (i1 < 66)
+ {
+ htmltext = "30736-04b.htm";
+ st.giveItems(CORN_MEAL, 1);
+ }
+ else
+ {
+ htmltext = "30736-04c.htm";
+ st.giveItems(WOLF_PELTS, 1);
+ }
}
else if (i0 < 60)
{
- htmltext = "30736-08l.htm";
- }
- else if (i0 < 65)
- {
- htmltext = "30736-08m.htm";
+ if (i1 < 33)
+ {
+ htmltext = "30736-04d.htm";
+ st.giveItems(MOONSTONE, 1);
+ }
+ else if (i1 < 66)
+ {
+ htmltext = "30736-04e.htm";
+ st.giveItems(GLUDIO_WHEAT_FLOWER, 1);
+ }
+ else
+ {
+ htmltext = "30736-04f.htm";
+ st.giveItems(SPIDERSILK_ROPE, 1);
+ }
}
else if (i0 < 70)
{
- htmltext = "30736-08n.htm";
+ if (i1 < 33)
+ {
+ htmltext = "30736-04g.htm";
+ st.giveItems(ALEXANDRITE, 1);
+ }
+ else if (i1 < 66)
+ {
+ htmltext = "30736-04h.htm";
+ st.giveItems(SILVER_TEA, 1);
+ }
+ else
+ {
+ htmltext = "30736-04i.htm";
+ st.giveItems(GOLEM_PART, 1);
+ }
}
else if (i0 < 75)
{
- htmltext = "30736-08o.htm";
+ if (i1 < 33)
+ {
+ htmltext = "30736-04j.htm";
+ st.giveItems(FIRE_EMERALD, 1);
+ }
+ else if (i1 < 66)
+ {
+ htmltext = "30736-04k.htm";
+ st.giveItems(SILK_FROCK, 1);
+ }
+ else
+ {
+ htmltext = "30736-04l.htm";
+ st.giveItems(PORCELAN_URN, 1);
+ }
}
- else if (i0 < 80)
+ else if (i0 < 76)
{
- htmltext = "30736-08p.htm";
+ htmltext = "30736-04m.htm";
+ st.giveItems(IMPERIAL_DIAMOND, 1);
}
- else if (i0 < 85)
+ else if (Rnd.nextBoolean())
{
- htmltext = "30736-08q.htm";
- }
- else if (i0 < 90)
- {
- htmltext = "30736-08r.htm";
- }
- else if (i0 < 95)
- {
- htmltext = "30736-08s.htm";
+ htmltext = "30736-04n.htm";
+
+ if (i1 < 25)
+ {
+ st.giveItems(STATUE_SHILIEN_HEAD, 1);
+ }
+ else if (i1 < 50)
+ {
+ st.giveItems(STATUE_SHILIEN_TORSO, 1);
+ }
+ else if (i1 < 75)
+ {
+ st.giveItems(STATUE_SHILIEN_ARM, 1);
+ }
+ else
+ {
+ st.giveItems(STATUE_SHILIEN_LEG, 1);
+ }
}
else
{
- htmltext = "30736-08t.htm";
+ htmltext = "30736-04o.htm";
+
+ if (i1 < 25)
+ {
+ st.giveItems(TABLET_FRAGMENT_1, 1);
+ }
+ else if (i1 < 50)
+ {
+ st.giveItems(TABLET_FRAGMENT_2, 1);
+ }
+ else if (i1 < 75)
+ {
+ st.giveItems(TABLET_FRAGMENT_3, 1);
+ }
+ else
+ {
+ st.giveItems(TABLET_FRAGMENT_4, 1);
+ }
+ }
+ }
+ else
+ {
+ htmltext = "30736-05.htm";
+ }
+ break;
+ }
+ case "30736-07.htm":
+ {
+ final int state = st.getInt("state");
+ if (player.getAdena() > (200 + (state * 200)))
+ {
+ if (state < 3)
+ {
+ final int i0 = Rnd.get(100);
+ if (i0 < 5)
+ {
+ htmltext = "30736-08a.htm";
+ }
+ else if (i0 < 10)
+ {
+ htmltext = "30736-08b.htm";
+ }
+ else if (i0 < 15)
+ {
+ htmltext = "30736-08c.htm";
+ }
+ else if (i0 < 20)
+ {
+ htmltext = "30736-08d.htm";
+ }
+ else if (i0 < 25)
+ {
+ htmltext = "30736-08e.htm";
+ }
+ else if (i0 < 30)
+ {
+ htmltext = "30736-08f.htm";
+ }
+ else if (i0 < 35)
+ {
+ htmltext = "30736-08g.htm";
+ }
+ else if (i0 < 40)
+ {
+ htmltext = "30736-08h.htm";
+ }
+ else if (i0 < 45)
+ {
+ htmltext = "30736-08i.htm";
+ }
+ else if (i0 < 50)
+ {
+ htmltext = "30736-08j.htm";
+ }
+ else if (i0 < 55)
+ {
+ htmltext = "30736-08k.htm";
+ }
+ else if (i0 < 60)
+ {
+ htmltext = "30736-08l.htm";
+ }
+ else if (i0 < 65)
+ {
+ htmltext = "30736-08m.htm";
+ }
+ else if (i0 < 70)
+ {
+ htmltext = "30736-08n.htm";
+ }
+ else if (i0 < 75)
+ {
+ htmltext = "30736-08o.htm";
+ }
+ else if (i0 < 80)
+ {
+ htmltext = "30736-08p.htm";
+ }
+ else if (i0 < 85)
+ {
+ htmltext = "30736-08q.htm";
+ }
+ else if (i0 < 90)
+ {
+ htmltext = "30736-08r.htm";
+ }
+ else if (i0 < 95)
+ {
+ htmltext = "30736-08s.htm";
+ }
+ else
+ {
+ htmltext = "30736-08t.htm";
+ }
+
+ st.takeItems(ADENA, 200 + (state * 200));
+ st.set("state", String.valueOf(state + 1));
+ }
+ else
+ {
+ htmltext = "30736-08.htm";
+ }
+ }
+ break;
+ }
+ case "30471-03.htm":
+ {
+ if (st.hasQuestItems(STATUE_SHILIEN_HEAD, STATUE_SHILIEN_TORSO, STATUE_SHILIEN_ARM, STATUE_SHILIEN_LEG))
+ {
+ st.takeItems(STATUE_SHILIEN_HEAD, 1);
+ st.takeItems(STATUE_SHILIEN_TORSO, 1);
+ st.takeItems(STATUE_SHILIEN_ARM, 1);
+ st.takeItems(STATUE_SHILIEN_LEG, 1);
+
+ if (Rnd.nextBoolean())
+ {
+ htmltext = "30471-04.htm";
+ st.giveItems(COMPLETE_STATUE, 1);
+ }
+ else
+ {
+ htmltext = "30471-05.htm";
+ }
+ }
+ break;
+ }
+ case "30471-06.htm":
+ {
+ if (st.hasQuestItems(TABLET_FRAGMENT_1, TABLET_FRAGMENT_2, TABLET_FRAGMENT_3, TABLET_FRAGMENT_4))
+ {
+ st.takeItems(TABLET_FRAGMENT_1, 1);
+ st.takeItems(TABLET_FRAGMENT_2, 1);
+ st.takeItems(TABLET_FRAGMENT_3, 1);
+ st.takeItems(TABLET_FRAGMENT_4, 1);
+
+ if (Rnd.nextBoolean())
+ {
+ htmltext = "30471-07.htm";
+ st.giveItems(COMPLETE_TABLET, 1);
+ }
+ else
+ {
+ htmltext = "30471-08.htm";
+ }
+ }
+ break;
+ }
+ case "30130-04.htm":
+ {
+ if (st.hasQuestItems(COMPLETE_STATUE))
+ {
+ st.takeItems(COMPLETE_STATUE, 1);
+ st.giveItems(ADENA, 30000);
+ }
+ break;
+ }
+ case "30531-04.htm":
+ {
+ if (st.hasQuestItems(COMPLETE_TABLET))
+ {
+ st.takeItems(COMPLETE_TABLET, 1);
+ st.giveItems(ADENA, 30000);
+ }
+ break;
+ }
+ case "30737-06.htm":
+ {
+ final boolean cargo1 = st.hasQuestItems(CARGO_BOX_1);
+ final boolean cargo2 = st.hasQuestItems(CARGO_BOX_2);
+ final boolean cargo3 = st.hasQuestItems(CARGO_BOX_3);
+ final boolean cargo4 = st.hasQuestItems(CARGO_BOX_4);
+ if (cargo1 || cargo2 || cargo3 || cargo4)
+ {
+ if (cargo1)
+ {
+ st.takeItems(CARGO_BOX_1, 1);
+ }
+ else if (cargo2)
+ {
+ st.takeItems(CARGO_BOX_2, 1);
+ }
+ else if (cargo3)
+ {
+ st.takeItems(CARGO_BOX_3, 1);
+ }
+ else
+ {
+ st.takeItems(CARGO_BOX_4, 1);
}
- st.takeItems(ADENA, 200 + (state * 200));
- st.set("state", String.valueOf(state + 1));
- }
- else
- {
- htmltext = "30736-08.htm";
- }
- }
- }
- else if (event.equals("30471-03.htm"))
- {
- if (st.hasQuestItems(STATUE_SHILIEN_HEAD, STATUE_SHILIEN_TORSO, STATUE_SHILIEN_ARM, STATUE_SHILIEN_LEG))
- {
- st.takeItems(STATUE_SHILIEN_HEAD, 1);
- st.takeItems(STATUE_SHILIEN_TORSO, 1);
- st.takeItems(STATUE_SHILIEN_ARM, 1);
- st.takeItems(STATUE_SHILIEN_LEG, 1);
-
- if (Rnd.nextBoolean())
- {
- htmltext = "30471-04.htm";
- st.giveItems(COMPLETE_STATUE, 1);
- }
- else
- {
- htmltext = "30471-05.htm";
- }
- }
- }
- else if (event.equals("30471-06.htm"))
- {
- if (st.hasQuestItems(TABLET_FRAGMENT_1, TABLET_FRAGMENT_2, TABLET_FRAGMENT_3, TABLET_FRAGMENT_4))
- {
- st.takeItems(TABLET_FRAGMENT_1, 1);
- st.takeItems(TABLET_FRAGMENT_2, 1);
- st.takeItems(TABLET_FRAGMENT_3, 1);
- st.takeItems(TABLET_FRAGMENT_4, 1);
-
- if (Rnd.nextBoolean())
- {
- htmltext = "30471-07.htm";
- st.giveItems(COMPLETE_TABLET, 1);
- }
- else
- {
- htmltext = "30471-08.htm";
- }
- }
- }
- else if (event.equals("30130-04.htm") && st.hasQuestItems(COMPLETE_STATUE))
- {
- st.takeItems(COMPLETE_STATUE, 1);
- st.giveItems(ADENA, 30000);
- }
- else if (event.equals("30531-04.htm") && st.hasQuestItems(COMPLETE_TABLET))
- {
- st.takeItems(COMPLETE_TABLET, 1);
- st.giveItems(ADENA, 30000);
- }
- else if (event.equals("30737-06.htm"))
- {
- final boolean cargo1 = st.hasQuestItems(CARGO_BOX_1);
- final boolean cargo2 = st.hasQuestItems(CARGO_BOX_2);
- final boolean cargo3 = st.hasQuestItems(CARGO_BOX_3);
- final boolean cargo4 = st.hasQuestItems(CARGO_BOX_4);
- if (cargo1 || cargo2 || cargo3 || cargo4)
- {
- if (cargo1)
- {
- st.takeItems(CARGO_BOX_1, 1);
- }
- else if (cargo2)
- {
- st.takeItems(CARGO_BOX_2, 1);
- }
- else if (cargo3)
- {
- st.takeItems(CARGO_BOX_3, 1);
- }
- else
- {
- st.takeItems(CARGO_BOX_4, 1);
- }
-
- final int coins = st.getQuestItemsCount(GUILD_COIN);
- if (coins < 40)
- {
- htmltext = "30737-03.htm";
- st.giveItems(ADENA, 100);
- }
- else if (coins < 80)
- {
- htmltext = "30737-04.htm";
- st.giveItems(ADENA, 200);
- }
- else
- {
- htmltext = "30737-05.htm";
- st.giveItems(ADENA, 300);
- }
-
- if (coins < 80)
- {
- st.giveItems(GUILD_COIN, 1);
+ final int coins = st.getQuestItemsCount(GUILD_COIN);
+ if (coins < 40)
+ {
+ htmltext = "30737-03.htm";
+ st.giveItems(ADENA, 100);
+ }
+ else if (coins < 80)
+ {
+ htmltext = "30737-04.htm";
+ st.giveItems(ADENA, 200);
+ }
+ else
+ {
+ htmltext = "30737-05.htm";
+ st.giveItems(ADENA, 300);
+ }
+
+ if (coins < 80)
+ {
+ st.giveItems(GUILD_COIN, 1);
+ }
}
+ break;
}
}
@@ -772,6 +658,7 @@ public class Q333_HuntOfTheBlackLion extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 25)
{
htmltext = "30735-01.htm";
@@ -785,11 +672,13 @@ public class Q333_HuntOfTheBlackLion extends Quest
htmltext = "30735-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case SOPHYA:
+ {
if (!st.hasAtLeastOneQuestItem(SOPHYA_LETTER_1, SOPHYA_LETTER_2, SOPHYA_LETTER_3, SOPHYA_LETTER_4))
{
htmltext = "30735-14.htm";
@@ -827,12 +716,14 @@ public class Q333_HuntOfTheBlackLion extends Quest
}
}
break;
-
+ }
case REDFOOT:
+ {
htmltext = st.hasAtLeastOneQuestItem(CARGO_BOX_1, CARGO_BOX_2, CARGO_BOX_3, CARGO_BOX_4) ? "30736-02.htm" : "30736-01.htm";
break;
-
+ }
case RUPIO:
+ {
if (st.hasQuestItems(STATUE_SHILIEN_HEAD, STATUE_SHILIEN_TORSO, STATUE_SHILIEN_ARM, STATUE_SHILIEN_LEG) || st.hasQuestItems(TABLET_FRAGMENT_1, TABLET_FRAGMENT_2, TABLET_FRAGMENT_3, TABLET_FRAGMENT_4))
{
htmltext = "30471-02.htm";
@@ -842,8 +733,9 @@ public class Q333_HuntOfTheBlackLion extends Quest
htmltext = "30471-01.htm";
}
break;
-
+ }
case UNDRIAS:
+ {
if (!st.hasQuestItems(COMPLETE_STATUE))
{
htmltext = st.hasQuestItems(STATUE_SHILIEN_HEAD, STATUE_SHILIEN_TORSO, STATUE_SHILIEN_ARM, STATUE_SHILIEN_LEG) ? "30130-02.htm" : "30130-01.htm";
@@ -853,8 +745,9 @@ public class Q333_HuntOfTheBlackLion extends Quest
htmltext = "30130-03.htm";
}
break;
-
+ }
case LOCKIRIN:
+ {
if (!st.hasQuestItems(COMPLETE_TABLET))
{
htmltext = st.hasQuestItems(TABLET_FRAGMENT_1, TABLET_FRAGMENT_2, TABLET_FRAGMENT_3, TABLET_FRAGMENT_4) ? "30531-02.htm" : "30531-01.htm";
@@ -864,12 +757,15 @@ public class Q333_HuntOfTheBlackLion extends Quest
htmltext = "30531-03.htm";
}
break;
-
+ }
case MORGAN:
+ {
htmltext = st.hasAtLeastOneQuestItem(CARGO_BOX_1, CARGO_BOX_2, CARGO_BOX_3, CARGO_BOX_4) ? "30737-02.htm" : "30737-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q334_TheWishingPotion/Q334_TheWishingPotion.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q334_TheWishingPotion/Q334_TheWishingPotion.java
index 5207ae5767..9aa1a05fce 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q334_TheWishingPotion/Q334_TheWishingPotion.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q334_TheWishingPotion/Q334_TheWishingPotion.java
@@ -99,7 +99,6 @@ public class Q334_TheWishingPotion extends Quest
public Q334_TheWishingPotion()
{
super(334, "The Wishing Potion");
-
addStartNpc(ALCHEMIST_MATILD);
addTalkId(ALCHEMIST_MATILD, TORAI, WISDOM_CHEST, RUPINA);
registerQuestItems(ALCHEMY_TEXT_ID, SECRET_BOOK_ID, AMBER_SCALE_ID, WIND_SOULSTONE_ID, GLASS_EYE_ID, HORROR_ECTOPLASM_ID, SILENOS_HORN_ID, ANT_SOLDIER_APHID_ID, TYRANTS_CHITIN_ID, BUGBEAR_BLOOD_ID);
@@ -113,10 +112,10 @@ public class Q334_TheWishingPotion extends Quest
{
if ((st.getQuestItemsCount(AMBER_SCALE_ID) == 1) && (st.getQuestItemsCount(WIND_SOULSTONE_ID) == 1) && (st.getQuestItemsCount(GLASS_EYE_ID) == 1) && (st.getQuestItemsCount(HORROR_ECTOPLASM_ID) == 1) && (st.getQuestItemsCount(SILENOS_HORN_ID) == 1) && (st.getQuestItemsCount(ANT_SOLDIER_APHID_ID) == 1) && (st.getQuestItemsCount(TYRANTS_CHITIN_ID) == 1) && (st.getQuestItemsCount(BUGBEAR_BLOOD_ID) == 1))
{
- st.set("cond", "4");
+ st.setCond(4);
return true;
}
- st.set("cond", "3");
+ st.setCond(3);
return false;
}
@@ -130,176 +129,186 @@ public class Q334_TheWishingPotion extends Quest
return htmltext;
}
- if ("30738-03.htm".equalsIgnoreCase(event))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.giveItems(ALCHEMY_TEXT_ID, 1);
- }
- else if ("30738-06.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) == 0)
+ case "30738-03.htm":
{
- st.takeItems(ALCHEMY_TEXT_ID, -1);
- st.takeItems(SECRET_BOOK_ID, -1);
- if (st.getQuestItemsCount(POTION_RECIPE_1_ID) == 0)
+ st.startQuest();
+ st.giveItems(ALCHEMY_TEXT_ID, 1);
+ break;
+ }
+ case "30738-06.htm":
+ {
+ if (st.getQuestItemsCount(WISH_POTION_ID) == 0)
{
- st.giveItems(POTION_RECIPE_1_ID, 1);
+ st.takeItems(ALCHEMY_TEXT_ID, -1);
+ st.takeItems(SECRET_BOOK_ID, -1);
+ if (st.getQuestItemsCount(POTION_RECIPE_1_ID) == 0)
+ {
+ st.giveItems(POTION_RECIPE_1_ID, 1);
+ }
+ if (st.getQuestItemsCount(POTION_RECIPE_2_ID) == 0)
+ {
+ st.giveItems(POTION_RECIPE_2_ID, 1);
+ }
+ if (st.getQuestItemsCount(MATILDS_ORB_ID) == 0)
+ {
+ htmltext = "30738-06.htm";
+ }
+ else
+ {
+ htmltext = "30738-12.htm";
+ }
+ st.setCond(3);
}
- if (st.getQuestItemsCount(POTION_RECIPE_2_ID) == 0)
+ else if ((st.getQuestItemsCount(MATILDS_ORB_ID) >= 1) && (st.getQuestItemsCount(WISH_POTION_ID) >= 1))
{
- st.giveItems(POTION_RECIPE_2_ID, 1);
+ htmltext = "30738-13.htm";
}
- if (st.getQuestItemsCount(MATILDS_ORB_ID) == 0)
+ break;
+ }
+ case "30738-10.htm":
+ {
+ if (checkIngr(st))
{
- htmltext = "30738-06.htm";
+ st.playSound(QuestState.SOUND_FINISH);
+ st.takeItems(ALCHEMY_TEXT_ID, -1);
+ st.takeItems(SECRET_BOOK_ID, -1);
+ st.takeItems(POTION_RECIPE_1_ID, -1);
+ st.takeItems(POTION_RECIPE_2_ID, -1);
+ st.takeItems(AMBER_SCALE_ID, -1);
+ st.takeItems(WIND_SOULSTONE_ID, -1);
+ st.takeItems(GLASS_EYE_ID, -1);
+ st.takeItems(HORROR_ECTOPLASM_ID, -1);
+ st.takeItems(SILENOS_HORN_ID, -1);
+ st.takeItems(ANT_SOLDIER_APHID_ID, -1);
+ st.takeItems(TYRANTS_CHITIN_ID, -1);
+ st.takeItems(BUGBEAR_BLOOD_ID, -1);
+ if (st.getQuestItemsCount(MATILDS_ORB_ID) == 0)
+ {
+ st.giveItems(MATILDS_ORB_ID, 1);
+ }
+ st.giveItems(WISH_POTION_ID, 1);
+ st.setCond(0);
}
else
{
- htmltext = "30738-12.htm";
+ htmltext = "You don't have required items";
}
- st.set("cond", "3");
+ break;
}
- else if ((st.getQuestItemsCount(MATILDS_ORB_ID) >= 1) && (st.getQuestItemsCount(WISH_POTION_ID) >= 1))
+ case "30738-14.htm":
{
- htmltext = "30738-13.htm";
- }
- }
- else if ("30738-10.htm".equalsIgnoreCase(event))
- {
- if (checkIngr(st))
- {
- st.playSound("ItemSound.quest_finish");
- st.takeItems(ALCHEMY_TEXT_ID, -1);
- st.takeItems(SECRET_BOOK_ID, -1);
- st.takeItems(POTION_RECIPE_1_ID, -1);
- st.takeItems(POTION_RECIPE_2_ID, -1);
- st.takeItems(AMBER_SCALE_ID, -1);
- st.takeItems(WIND_SOULSTONE_ID, -1);
- st.takeItems(GLASS_EYE_ID, -1);
- st.takeItems(HORROR_ECTOPLASM_ID, -1);
- st.takeItems(SILENOS_HORN_ID, -1);
- st.takeItems(ANT_SOLDIER_APHID_ID, -1);
- st.takeItems(TYRANTS_CHITIN_ID, -1);
- st.takeItems(BUGBEAR_BLOOD_ID, -1);
- if (st.getQuestItemsCount(MATILDS_ORB_ID) == 0)
+ if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
{
- st.giveItems(MATILDS_ORB_ID, 1);
+ htmltext = "30738-15.htm";
}
- st.giveItems(WISH_POTION_ID, 1);
- st.set("cond", "0");
+ break;
}
- else
+ case "30738-16.htm":
{
- htmltext = "You don't have required items";
- }
- }
- else if ("30738-14.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
- {
- htmltext = "30738-15.htm";
- }
- }
- else if ("30738-16.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
- {
- st.takeItems(WISH_POTION_ID, 1);
- if (Rnd.get(100) < 50)
+ if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
{
- st.addSpawn(SUCCUBUS_OF_SEDUCTION);
- st.addSpawn(SUCCUBUS_OF_SEDUCTION);
- st.addSpawn(SUCCUBUS_OF_SEDUCTION);
+ st.takeItems(WISH_POTION_ID, 1);
+ if (Rnd.get(100) < 50)
+ {
+ st.addSpawn(SUCCUBUS_OF_SEDUCTION);
+ st.addSpawn(SUCCUBUS_OF_SEDUCTION);
+ st.addSpawn(SUCCUBUS_OF_SEDUCTION);
+ }
+ else
+ {
+ st.addSpawn(RUPINA);
+ }
}
else
{
- st.addSpawn(RUPINA);
+ htmltext = "30738-14.htm";
}
+ break;
}
- else
+ case "30738-17.htm":
{
- htmltext = "30738-14.htm";
- }
- }
- else if ("30738-17.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
- {
- st.takeItems(WISH_POTION_ID, 1);
- final int WISH_CHANCE = Rnd.get(100) + 1;
- if (WISH_CHANCE <= 33)
+ if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
{
- st.addSpawn(GRIMA);
- st.addSpawn(GRIMA);
- st.addSpawn(GRIMA);
- }
- else if (WISH_CHANCE >= 66)
- {
- st.giveItems(57, 10000);
- }
- else if (Rnd.get(100) < 2)
- {
- st.giveItems(57, (Rnd.get(10) + 1) * 1000000);
+ st.takeItems(WISH_POTION_ID, 1);
+ final int WISH_CHANCE = Rnd.get(100) + 1;
+ if (WISH_CHANCE <= 33)
+ {
+ st.addSpawn(GRIMA);
+ st.addSpawn(GRIMA);
+ st.addSpawn(GRIMA);
+ }
+ else if (WISH_CHANCE >= 66)
+ {
+ st.giveItems(57, 10000);
+ }
+ else if (Rnd.get(100) < 2)
+ {
+ st.giveItems(57, (Rnd.get(10) + 1) * 1000000);
+ }
+ else
+ {
+ st.addSpawn(GRIMA);
+ st.addSpawn(GRIMA);
+ st.addSpawn(GRIMA);
+ }
}
else
{
- st.addSpawn(GRIMA);
- st.addSpawn(GRIMA);
- st.addSpawn(GRIMA);
+ htmltext = "30738-14.htm";
}
+ break;
}
- else
+ case "30738-18.htm":
{
- htmltext = "30738-14.htm";
- }
- }
- else if ("30738-18.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
- {
- st.takeItems(WISH_POTION_ID, 1);
- final int WISH_CHANCE = Rnd.get(100) + 1;
- if (WISH_CHANCE <= 33)
+ if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
{
- st.giveItems(CERTIFICATE_OF_ROYALTY_ID, 1);
- }
- else if (WISH_CHANCE >= 66)
- {
- st.giveItems(ANCIENT_CROWN_ID, 1);
+ st.takeItems(WISH_POTION_ID, 1);
+ final int WISH_CHANCE = Rnd.get(100) + 1;
+ if (WISH_CHANCE <= 33)
+ {
+ st.giveItems(CERTIFICATE_OF_ROYALTY_ID, 1);
+ }
+ else if (WISH_CHANCE >= 66)
+ {
+ st.giveItems(ANCIENT_CROWN_ID, 1);
+ }
+ else
+ {
+ st.addSpawn(SANCHES);
+ }
}
else
{
- st.addSpawn(SANCHES);
+ htmltext = "30738-14.htm";
}
+ break;
}
- else
+ case "30738-19.htm":
{
- htmltext = "30738-14.htm";
- }
- }
- else if ("30738-19.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
- {
- st.takeItems(3467, 1);
- final int WISH_CHANCE = Rnd.get(100) + 1;
- if (WISH_CHANCE <= 33)
+ if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
{
- st.giveItems(SPELLBOOK_ICEBOLT_ID, 1);
- }
- else if (WISH_CHANCE <= 66)
- {
- st.giveItems(SPELLBOOK_BATTLEHEAL_ID, 1);
+ st.takeItems(3467, 1);
+ final int WISH_CHANCE = Rnd.get(100) + 1;
+ if (WISH_CHANCE <= 33)
+ {
+ st.giveItems(SPELLBOOK_ICEBOLT_ID, 1);
+ }
+ else if (WISH_CHANCE <= 66)
+ {
+ st.giveItems(SPELLBOOK_BATTLEHEAL_ID, 1);
+ }
+ else
+ {
+ st.addSpawn(WISDOM_CHEST);
+ }
}
else
{
- st.addSpawn(WISDOM_CHEST);
+ htmltext = "30738-14.htm";
}
- }
- else
- {
- htmltext = "30738-14.htm";
+ break;
}
}
return htmltext;
@@ -320,7 +329,7 @@ public class Q334_TheWishingPotion extends Quest
int cond = 0;
if (id != 0)
{
- cond = st.getInt("cond");
+ cond = st.getCond();
}
switch (npcId)
{
@@ -339,7 +348,7 @@ public class Q334_TheWishingPotion extends Quest
}
else if (st.getQuestItemsCount(3467) == 0)
{
- st.set("cond", "3");
+ st.setCond(3);
if (st.getQuestItemsCount(POTION_RECIPE_1_ID) == 0)
{
st.giveItems(POTION_RECIPE_1_ID, 1);
@@ -444,7 +453,7 @@ public class Q334_TheWishingPotion extends Quest
}
final int npcId = npc.getNpcId();
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
for (int[] element : DROPLIST_COND)
{
if ((cond == element[0]) && (npcId == element[2]) && ((element[3] == 0) || (st.getQuestItemsCount(element[3]) > 0)))
@@ -465,7 +474,7 @@ public class Q334_TheWishingPotion extends Quest
}
if ((element[1] != cond) && (element[1] != 0))
{
- st.set("cond", "" + element[1]);
+ st.setCond(element[1]);
st.setState(State.STARTED);
}
}
@@ -474,12 +483,12 @@ public class Q334_TheWishingPotion extends Quest
final int dropChance = Rnd.get(100) + 1;
if ((npcId == SUCCUBUS_OF_SEDUCTION) && (dropChance <= DROP_CHANCE_FORBIDDEN_LOVE_SCROLL_ID))
{
- st.playSound("ItemSound.quest_itemget");
+ st.playSound(QuestState.SOUND_ITEMGET);
st.giveItems(FORBIDDEN_LOVE_SCROLL_ID, 1);
}
else if ((npcId == GRIMA) && (dropChance <= DROP_CHANCE_GOLD_BAR_ID))
{
- st.playSound("ItemSound.quest_itemget");
+ st.playSound(QuestState.SOUND_ITEMGET);
st.giveItems(GOLD_BAR_ID, Rnd.get(5) + 1);
}
else if ((npcId == SANCHES) && (Rnd.get(100) < 50))
@@ -512,7 +521,7 @@ public class Q334_TheWishingPotion extends Quest
{
st.giveItems(DEMONS_TUNIC_ID, 1);
}
- st.playSound("ItemSound.quest_itemget");
+ st.playSound(QuestState.SOUND_ITEMGET);
}
return null;
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q335_TheSongOfTheHunter/Q335_TheSongOfTheHunter.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q335_TheSongOfTheHunter/Q335_TheSongOfTheHunter.java
index 68ae78577a..e482970dcf 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q335_TheSongOfTheHunter/Q335_TheSongOfTheHunter.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q335_TheSongOfTheHunter/Q335_TheSongOfTheHunter.java
@@ -153,7 +153,6 @@ public class Q335_TheSongOfTheHunter extends Quest
public Q335_TheSongOfTheHunter()
{
super(335, "Song of the Hunter");
-
addStartNpc(GREY);
addTalkId(GREY, CYBELLIN, TOR);
addKillId(BREKA_OVERLORD_HAKA);
@@ -229,7 +228,7 @@ public class Q335_TheSongOfTheHunter extends Quest
registerQuestItems(questItems.stream().mapToInt(i -> i).toArray());
}
- private static int CalcItemsConds(QuestState st, int[][][] itemConds)
+ private static int calcItemsConds(QuestState st, int[][][] itemConds)
{
int result = 0;
for (int[][] itemCond : itemConds)
@@ -247,7 +246,7 @@ public class Q335_TheSongOfTheHunter extends Quest
return result;
}
- private void DelItemsConds(QuestState st, int[][][] itemConds)
+ private void delItemsConds(QuestState st, int[][][] itemConds)
{
for (int[][] itemCond : itemConds)
{
@@ -258,7 +257,7 @@ public class Q335_TheSongOfTheHunter extends Quest
}
}
- private static int Get_Blood_Crystal_Level(QuestState st)
+ private static int getBloodCrystalLevel(QuestState st)
{
for (int i = Q_BLOOD_CRYSTAL.length - 1; i >= 0; --i)
{
@@ -270,7 +269,7 @@ public class Q335_TheSongOfTheHunter extends Quest
return -1;
}
- private static boolean Blood_Crystal2Adena(QuestState st, int bloodCrystalLevel)
+ private static boolean bloodCrystal2Adena(QuestState st, int bloodCrystalLevel)
{
if (bloodCrystalLevel < 2)
{
@@ -284,7 +283,7 @@ public class Q335_TheSongOfTheHunter extends Quest
return true;
}
- private void GenList(QuestState st)
+ private void genList(QuestState st)
{
// final int grade_c = 12;
// final int grade_b = 6;
@@ -356,7 +355,7 @@ public class Q335_TheSongOfTheHunter extends Quest
}
}
- private static String FormatList(QuestState st, Request[] requests)
+ private static String formatList(QuestState st, Request[] requests)
{
String result = "Guild Member Tor:
%reply%
%reply%
%reply%
%reply%
%reply%
";
final int[] listpacked = unpackInt(st.getInt("list"), 5);
@@ -368,7 +367,7 @@ public class Q335_TheSongOfTheHunter extends Quest
return result;
}
- private static Request GetCurrentRequest(QuestState st, Request[] requests)
+ private static Request getCurrentRequest(QuestState st, Request[] requests)
{
for (Request r : requests)
{
@@ -418,22 +417,20 @@ public class Q335_TheSongOfTheHunter extends Quest
{
st.giveItems(TEST_INSTRUCTIONS1, 1);
}
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound("ItemSound.quest_accept");
+ st.startQuest();
}
}
else if ("30744_09.htm".equals(htmltext))
{
if (state == 2)
{
- if (GetCurrentRequest(st, REQUESTS1) != null)
+ if (getCurrentRequest(st, REQUESTS1) != null)
{
return "30744_09a.htm";
}
if (st.getQuestItemsCount(TEST_INSTRUCTIONS2) == 0)
{
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(TEST_INSTRUCTIONS2, 1);
}
}
@@ -447,7 +444,7 @@ public class Q335_TheSongOfTheHunter extends Quest
st.giveItems(57, 20000);
htmltext = "30744_17.htm";
}
- st.playSound("ItemSound.quest_finish");
+ st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
}
}
@@ -471,18 +468,15 @@ public class Q335_TheSongOfTheHunter extends Quest
{
st.takeItems(i, -1);
}
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(Q_BLOOD_CRYSTAL[1], 1);
}
}
else if ("30746_06.htm".equals(htmltext))
{
- if (state == 2)
+ if ((state == 2) && !bloodCrystal2Adena(st, getBloodCrystalLevel(st)))
{
- if (!Blood_Crystal2Adena(st, Get_Blood_Crystal_Level(st)))
- {
- return null;
- }
+ return null;
}
}
else if ("30746_10.htm".equals(htmltext))
@@ -499,12 +493,9 @@ public class Q335_TheSongOfTheHunter extends Quest
}
else if ("30745_02.htm".equals(htmltext))
{
- if (state == 2)
+ if ((state == 2) && (st.getQuestItemsCount(TEST_INSTRUCTIONS2) > 0))
{
- if (st.getQuestItemsCount(TEST_INSTRUCTIONS2) > 0)
- {
- return "30745_03.htm";
- }
+ return "30745_03.htm";
}
}
else if ("30745_05b.htm".equals(htmltext))
@@ -531,13 +522,13 @@ public class Q335_TheSongOfTheHunter extends Quest
{
if ("30745-list1".equals(htmltext))
{
- GenList(st);
- return FormatList(st, REQUESTS1);
+ genList(st);
+ return formatList(st, REQUESTS1);
}
if ("30745-list2".equals(htmltext))
{
- GenList(st);
- return FormatList(st, REQUESTS2);
+ genList(st);
+ return formatList(st, REQUESTS2);
}
if (htmltext.startsWith("30745-request-"))
{
@@ -581,34 +572,40 @@ public class Q335_TheSongOfTheHunter extends Quest
{
return getNoQuestMsg();
}
+
if (st.getPlayer().getLevel() < 35)
{
st.exitQuest(true);
return "30744_01.htm";
}
- st.set("cond", "0");
+
+ st.setCond(0);
st.unset("list");
return "30744_02.htm";
}
+
if (_state != 2)
{
return getNoQuestMsg();
}
+
if (npcId == GREY)
{
if (st.getQuestItemsCount(TEST_INSTRUCTIONS1) > 0)
{
- if (CalcItemsConds(st, ITEMS_1ST_CIRCLE) < 3)
+ if (calcItemsConds(st, ITEMS_1ST_CIRCLE) < 3)
{
return "30744_05.htm";
}
- DelItemsConds(st, ITEMS_1ST_CIRCLE);
+
+ delItemsConds(st, ITEMS_1ST_CIRCLE);
st.takeItems(TEST_INSTRUCTIONS1, -1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(CIRCLE_HUNTER_LICENSE1, 1);
- st.set("cond", "2");
+ st.setCond(2);
return "30744_06.htm";
}
+
if (st.getQuestItemsCount(CIRCLE_HUNTER_LICENSE1) > 0)
{
if (st.getPlayer().getLevel() < 45)
@@ -620,18 +617,19 @@ public class Q335_TheSongOfTheHunter extends Quest
return "30744_08.htm";
}
}
+
if (st.getQuestItemsCount(TEST_INSTRUCTIONS2) > 0)
{
- if (CalcItemsConds(st, ITEMS_2ND_CIRCLE) < 3)
+ if (calcItemsConds(st, ITEMS_2ND_CIRCLE) < 3)
{
return "30744_11.htm";
}
- DelItemsConds(st, ITEMS_2ND_CIRCLE);
+ delItemsConds(st, ITEMS_2ND_CIRCLE);
st.takeItems(TEST_INSTRUCTIONS2, -1);
st.takeItems(CIRCLE_HUNTER_LICENSE1, -1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(CIRCLE_HUNTER_LICENSE2, 1);
- st.set("cond", "3");
+ st.setCond(3);
return "30744_12.htm";
}
else if (st.getQuestItemsCount(CIRCLE_HUNTER_LICENSE2) > 0)
@@ -649,24 +647,24 @@ public class Q335_TheSongOfTheHunter extends Quest
{
return "30746_02.htm";
}
- final int Blood_Crystal_Level = Get_Blood_Crystal_Level(st);
- if (Blood_Crystal_Level == -1)
+ final int bloodCrystalLevel = getBloodCrystalLevel(st);
+ if (bloodCrystalLevel == -1)
{
return "30746_08.htm";
}
- if (Blood_Crystal_Level == 0)
+ if (bloodCrystalLevel == 0)
{
return "30746_09.htm";
}
- if (Blood_Crystal_Level == 1)
+ if (bloodCrystalLevel == 1)
{
return "30746_04.htm";
}
- if ((Blood_Crystal_Level > 1) && (Blood_Crystal_Level < 10))
+ if ((bloodCrystalLevel > 1) && (bloodCrystalLevel < 10))
{
return "30746_05.htm";
}
- if ((Blood_Crystal_Level == 10) && Blood_Crystal2Adena(st, Blood_Crystal_Level))
+ if ((bloodCrystalLevel == 10) && bloodCrystal2Adena(st, bloodCrystalLevel))
{
return "30746_05a.htm";
}
@@ -679,10 +677,10 @@ public class Q335_TheSongOfTheHunter extends Quest
}
if (st.getQuestItemsCount(CIRCLE_HUNTER_LICENSE1) > 0)
{
- final Request request = GetCurrentRequest(st, REQUESTS1);
+ final Request request = getCurrentRequest(st, REQUESTS1);
if (request != null)
{
- return request.Complete(st) ? "30745_06a.htm" : "30745_05.htm";
+ return request.complete(st) ? "30745_06a.htm" : "30745_05.htm";
}
if (st.getPlayer().getLevel() < 45)
{
@@ -692,12 +690,12 @@ public class Q335_TheSongOfTheHunter extends Quest
}
else if (st.getQuestItemsCount(CIRCLE_HUNTER_LICENSE2) > 0)
{
- final Request request = GetCurrentRequest(st, REQUESTS2);
+ final Request request = getCurrentRequest(st, REQUESTS2);
if (request == null)
{
return "30745_03b.htm";
}
- return request.Complete(st) ? "30745_06b.htm" : "30745_05.htm";
+ return request.complete(st) ? "30745_06b.htm" : "30745_05.htm";
}
}
return getNoQuestMsg();
@@ -716,6 +714,7 @@ public class Q335_TheSongOfTheHunter extends Quest
{
return null;
}
+
final int npcId = npc.getNpcId();
int[][][] itemsCircle = null;
if (st.getQuestItemsCount(TEST_INSTRUCTIONS1) > 0)
@@ -852,8 +851,8 @@ public class Q335_TheSongOfTheHunter extends Quest
{
if ((st.getQuestItemsCount(CYBELLINS_REQUEST) > 0) && (st.getPlayer().getActiveWeaponItem() != null) && (st.getPlayer().getActiveWeaponItem().getItemId() == 3471))
{
- final int Blood_Crystal_Level = Get_Blood_Crystal_Level(st);
- if ((Blood_Crystal_Level > 0) && (Blood_Crystal_Level < 10))
+ final int bloodCrystalLevel = getBloodCrystalLevel(st);
+ if ((bloodCrystalLevel > 0) && (bloodCrystalLevel < 10))
{
for (int lizardmen_id : Q_BLOOD_CRYSTAL_LIZARDMEN)
{
@@ -861,9 +860,9 @@ public class Q335_TheSongOfTheHunter extends Quest
{
if (Rnd.get(100) < 50)
{
- st.takeItems(Q_BLOOD_CRYSTAL[Blood_Crystal_Level], -1);
- st.playSound((Blood_Crystal_Level < 6) ? "ItemSound.quest_middle" : "ItemSound.quest_jackpot");
- st.giveItems(Q_BLOOD_CRYSTAL[Blood_Crystal_Level + 1], 1);
+ st.takeItems(Q_BLOOD_CRYSTAL[bloodCrystalLevel], -1);
+ st.playSound((bloodCrystalLevel < 6) ? QuestState.SOUND_MIDDLE : QuestState.SOUND_JACKPOT);
+ st.giveItems(Q_BLOOD_CRYSTAL[bloodCrystalLevel + 1], 1);
}
else
{
@@ -877,10 +876,10 @@ public class Q335_TheSongOfTheHunter extends Quest
}
}
}
- Request request = GetCurrentRequest(st, REQUESTS1);
+ Request request = getCurrentRequest(st, REQUESTS1);
if (request == null)
{
- request = GetCurrentRequest(st, REQUESTS2);
+ request = getCurrentRequest(st, REQUESTS2);
}
if (request != null)
{
@@ -955,15 +954,16 @@ public class Q335_TheSongOfTheHunter extends Quest
return this;
}
- public boolean Complete(QuestState st)
+ public boolean complete(QuestState st)
{
if (st.getQuestItemsCount(request_item) < request_count)
{
return false;
}
+
st.takeItems(request_id, -1);
st.takeItems(request_item, -1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LAUREL_LEAF_PIN, 1);
st.giveItems(57, reward_adena);
st.unset("list");
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q336_CoinsOfMagic/Q336_CoinsOfMagic.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q336_CoinsOfMagic/Q336_CoinsOfMagic.java
index 60bf92a330..6c70474654 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q336_CoinsOfMagic/Q336_CoinsOfMagic.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q336_CoinsOfMagic/Q336_CoinsOfMagic.java
@@ -154,46 +154,44 @@ public class Q336_CoinsOfMagic extends Quest
return htmltext;
}
- final int cond = st.getInt("cond");
- if ("30702-06.htm".equalsIgnoreCase(event))
+ final int cond = st.getCond();
+ if ("30702-06.htm".equals(event))
{
if (cond < 7)
{
- st.set("cond", "7");
- st.playSound("ItemSound.quest_accept");
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_ACCEPT);
}
}
- else if ("30232-22.htm".equalsIgnoreCase(event))
+ else if ("30232-22.htm".equals(event))
{
if (cond < 6)
{
- st.set("cond", "6");
+ st.setCond(6);
}
}
- else if ("30232-23.htm".equalsIgnoreCase(event))
+ else if ("30232-23.htm".equals(event))
{
if (cond < 5)
{
- st.set("cond", "5");
+ st.setCond(5);
}
}
- else if ("30702-02.htm".equalsIgnoreCase(event))
+ else if ("30702-02.htm".equals(event))
{
- st.set("cond", "2");
+ st.setCond(2);
}
- else if ("30232-05.htm".equalsIgnoreCase(event))
+ else if ("30232-05.htm".equals(event))
{
- st.setState(State.STARTED);
- st.playSound("ItemSound.quest_accept");
+ st.startQuest();
st.giveItems(COIN_DIAGRAM, 1);
- st.set("cond", "1");
}
- else if ("30232-04.htm".equalsIgnoreCase(event) || "30232-18a.htm".equalsIgnoreCase(event))
+ else if ("30232-04.htm".equals(event) || "30232-18a.htm".equals(event))
{
st.exitQuest(true);
- st.playSound("ItemSound.quest_giveup");
+ st.playSound(QuestState.SOUND_GIVEUP);
}
- else if ("raise".equalsIgnoreCase(event))
+ else if ("raise".equals(event))
{
htmltext = promote(st);
}
@@ -230,11 +228,11 @@ public class Q336_CoinsOfMagic extends Quest
st.set("grade", "" + (grade - 1));
if (grade == 3)
{
- st.set("cond", "9");
+ st.setCond(9);
}
else if (grade == 2)
{
- st.set("cond", "11");
+ st.setCond(11);
}
st.playSound("ItemSound.quest_fanfare_middle");
}
@@ -243,11 +241,11 @@ public class Q336_CoinsOfMagic extends Quest
html = "30232-" + (16 - grade) + ".htm";
if (grade == 3)
{
- st.set("cond", "8");
+ st.setCond(8);
}
else if (grade == 2)
{
- st.set("cond", "9");
+ st.setCond(9);
}
}
}
@@ -291,7 +289,7 @@ public class Q336_CoinsOfMagic extends Quest
st.takeItems(COIN_DIAGRAM, -1);
st.giveItems(MEMBERSHIP_3, 1);
st.set("grade", "3");
- st.set("cond", "4");
+ st.setCond(4);
st.playSound("ItemSound.quest_fanfare_middle");
htmltext = "30232-07.htm";
}
@@ -350,19 +348,20 @@ public class Q336_CoinsOfMagic extends Quest
return null;
}
- final int cond = st.getInt("cond");
- final int grade = st.getInt("grade");
- final int chance = (npc.getLevel() + (grade * 3)) - 20;
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
if ((npcId == HARIT_LIZARDMAN_MATRIARCH) || (npcId == HARIT_LIZARDMAN_SHAMAN))
{
if ((cond == 2) && (Rnd.get(1000) < 63))
{
st.giveItems(KALDIS_COIN, 1);
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
}
+
+ final int grade = st.getInt("grade");
+ final int chance = (npc.getLevel() + (grade * 3)) - 20;
for (int[] e : DROPLIST)
{
if (e[0] == npcId)
@@ -374,6 +373,7 @@ public class Q336_CoinsOfMagic extends Quest
return null;
}
}
+
for (int u : MONSTERS)
{
if (u == npcId)
@@ -385,6 +385,7 @@ public class Q336_CoinsOfMagic extends Quest
return null;
}
}
+
return null;
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q337_AudienceWithTheLandDragon/Q337_AudienceWithTheLandDragon.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q337_AudienceWithTheLandDragon/Q337_AudienceWithTheLandDragon.java
index 62c4354b7f..b92b2d2c0e 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q337_AudienceWithTheLandDragon/Q337_AudienceWithTheLandDragon.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q337_AudienceWithTheLandDragon/Q337_AudienceWithTheLandDragon.java
@@ -27,11 +27,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q337_AudienceWithTheLandDragon extends Quest
{
- // Variables
- private static boolean _jewel1 = false;
- private static boolean _jewel2 = false;
- private static boolean _jewel3 = false;
-
// NPCs
private static final int GABRIELLE = 30753;
private static final int ORVEN = 30857; // 1
@@ -42,8 +37,7 @@ public class Q337_AudienceWithTheLandDragon extends Quest
private static final int HELTON = 30678; // 2nd abyssal
private static final int GILMORE = 30754; // 3rd abyssal
private static final int THEODRIC = 30755;
-
- // Mobs
+ // Monsters
private static final int BLOOD_QUEEN = 18001; // 1
private static final int SACRIFICE_OF_THE_SACRIFICED = 27171; // 1
private static final int HARIT_LIZARDMAN_SHAMAN = 20644; // 2
@@ -63,7 +57,6 @@ public class Q337_AudienceWithTheLandDragon extends Quest
private static final int CAVE_KEEPER_2 = 20277;
private static final int ABYSSAL_JEWEL_3 = 27167;
private static final int JEWEL_GUARDIAN_PYTON = 27170;
-
// Items
private static final int FEATHER_OF_GABRIELLE = 3852;
private static final int MARK_OF_WATCHMAN = 3864;
@@ -80,92 +73,31 @@ public class Q337_AudienceWithTheLandDragon extends Quest
private static final int HERALD_OF_SLAYER = 3890;
private static final int THIRD_FRAGMENT_OF_ABYSS_JEWEL = 3861; // 3rd abyssal
private static final int PORTAL_STONE = 3865;
-
- /**
- * 0..npcId, 1..cond, 2..cond2, 3..chance, 4..itemId
- */
+ // Variables
+ private static boolean _jewel1 = false;
+ private static boolean _jewel2 = false;
+ private static boolean _jewel3 = false;
+ // @formatter:off
private static final int[][] DROPS_ON_KILL =
{
- {
- SACRIFICE_OF_THE_SACRIFICED,
- 1,
- 1,
- REMAINS_OF_SACRIFIED
- },
- {
- HARIT_LIZARDMAN_ZEALOT,
- 1,
- 2,
- TOTEM_OF_LAND_DRAGON
- },
- {
- KRANROT,
- 1,
- 3,
- KRANROT_SKIN
- },
- {
- HAMRUT,
- 1,
- 3,
- HAMRUT_LEG
- },
- {
- MARSH_DRAKE,
- 1,
- 4,
- MARSH_DRAKE_TALONS
- },
- {
- MARSH_STALKER,
- 1,
- 4,
- MARSH_STALKER_HORN
- },
- {
- JEWEL_GUARDIAN_MARA,
- 2,
- 5,
- MARA_FANG
- },
- {
- JEWEL_GUARDIAN_MUSFEL,
- 2,
- 6,
- MUSFEL_FANG
- }
+ // 0..npcId, 1..cond, 2..cond2, 3..chance, 4..itemId
+ {SACRIFICE_OF_THE_SACRIFICED, 1, 1, REMAINS_OF_SACRIFIED},
+ {HARIT_LIZARDMAN_ZEALOT, 1, 2, TOTEM_OF_LAND_DRAGON},
+ {KRANROT, 1, 3, KRANROT_SKIN},
+ {HAMRUT, 1, 3, HAMRUT_LEG},
+ {MARSH_DRAKE, 1, 4, MARSH_DRAKE_TALONS},
+ {MARSH_STALKER, 1, 4, MARSH_STALKER_HORN},
+ {JEWEL_GUARDIAN_MARA, 2, 5, MARA_FANG},
+ {JEWEL_GUARDIAN_MUSFEL, 2, 6, MUSFEL_FANG}
};
-
- /**
- * 0..npcId, 1..cond, 2..cond2, 3..itemId, 4..amount of mobs, 5..mob
- */
private static final int[][] DROP_ON_ATTACK =
{
- {
- ABYSSAL_JEWEL_1,
- 2,
- 5,
- FIRST_FRAGMENT_OF_ABYSS_JEWEL,
- 20,
- JEWEL_GUARDIAN_MARA
- },
- {
- ABYSSAL_JEWEL_2,
- 2,
- 6,
- SECOND_FRAGMENT_OF_ABYSS_JEWEL,
- 20,
- JEWEL_GUARDIAN_MUSFEL
- },
- {
- ABYSSAL_JEWEL_3,
- 4,
- 7,
- THIRD_FRAGMENT_OF_ABYSS_JEWEL,
- 3,
- JEWEL_GUARDIAN_PYTON
- },
+ // 0..npcId, 1..cond, 2..cond2, 3..itemId, 4..amount of mobs, 5..mob
+ {ABYSSAL_JEWEL_1, 2, 5, FIRST_FRAGMENT_OF_ABYSS_JEWEL, 20, JEWEL_GUARDIAN_MARA},
+ {ABYSSAL_JEWEL_2, 2, 6, SECOND_FRAGMENT_OF_ABYSS_JEWEL, 20, JEWEL_GUARDIAN_MUSFEL},
+ {ABYSSAL_JEWEL_3, 4, 7, THIRD_FRAGMENT_OF_ABYSS_JEWEL, 3, JEWEL_GUARDIAN_PYTON},
};
+ // @formatter:on
public Q337_AudienceWithTheLandDragon()
{
@@ -190,47 +122,49 @@ public class Q337_AudienceWithTheLandDragon extends Quest
return htmltext;
}
- // Gabrielle
- if (event.equals("30753-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("drop1", "1");
- st.set("drop2", "1");
- st.set("drop3", "1");
- st.set("drop4", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(FEATHER_OF_GABRIELLE, 1);
- }
- else if (event.equals("30753-09.htm"))
- {
- if (st.getQuestItemsCount(MARK_OF_WATCHMAN) >= 4)
+ case "30753-05.htm":
{
- st.set("cond", "2");
- st.set("drop5", "2");
- st.set("drop6", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MARK_OF_WATCHMAN, 4);
+ st.startQuest();
+ st.set("drop1", "1");
+ st.set("drop2", "1");
+ st.set("drop3", "1");
+ st.set("drop4", "1");
+ st.giveItems(FEATHER_OF_GABRIELLE, 1);
+ break;
}
- else
+ case "30753-09.htm":
{
- htmltext = null;
+ if (st.getQuestItemsCount(MARK_OF_WATCHMAN) >= 4)
+ {
+ st.setCond(2);
+ st.set("drop5", "2");
+ st.set("drop6", "2");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MARK_OF_WATCHMAN, 4);
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
}
- }
- // Theodric
- else if (event.equals("30755-05.htm"))
- {
- if (st.hasQuestItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL))
+ case "30755-05.htm":
{
- st.takeItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL, 1);
- st.takeItems(HERALD_OF_SLAYER, 1);
- st.giveItems(PORTAL_STONE, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else
- {
- htmltext = null;
+ if (st.hasQuestItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL))
+ {
+ st.takeItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL, 1);
+ st.takeItems(HERALD_OF_SLAYER, 1);
+ st.giveItems(PORTAL_STONE, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
}
}
@@ -250,14 +184,17 @@ public class Q337_AudienceWithTheLandDragon extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 50) ? "30753-02.htm" : "30753-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GABRIELLE:
+ {
if (cond == 1)
{
htmltext = (st.getQuestItemsCount(MARK_OF_WATCHMAN) < 4) ? "30753-06.htm" : "30753-08.htm";
@@ -271,7 +208,7 @@ public class Q337_AudienceWithTheLandDragon extends Quest
else
{
htmltext = "30753-11.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FEATHER_OF_GABRIELLE, 1);
st.takeItems(MARK_OF_WATCHMAN, 1);
@@ -287,8 +224,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = "30753-13.htm";
}
break;
-
+ }
case ORVEN:
+ {
if (cond == 1)
{
if (st.getInt("drop1") == 1)
@@ -316,8 +254,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case KENDRA:
+ {
if (cond == 1)
{
if (st.getInt("drop2") == 1)
@@ -345,8 +284,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case CHAKIRIS:
+ {
if (cond == 1)
{
if (st.getInt("drop3") == 1)
@@ -375,8 +315,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case KAIENA:
+ {
if (cond == 1)
{
if (st.getInt("drop4") == 1)
@@ -405,18 +346,21 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case MOKE:
+ {
if (cond == 2)
{
switch (st.getInt("drop5"))
{
case 2:
+ {
htmltext = "30498-01.htm";
st.set("drop5", "1");
break;
-
+ }
case 1:
+ {
if (st.hasQuestItems(FIRST_FRAGMENT_OF_ABYSS_JEWEL, MARA_FANG))
{
htmltext = "30498-03.htm";
@@ -431,8 +375,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = "30498-02.htm";
}
break;
-
+ }
case 0:
+ {
if (st.getQuestItemsCount(MARK_OF_WATCHMAN) < 2)
{
htmltext = "30498-04.htm";
@@ -442,21 +387,25 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = "30498-05.htm";
}
break;
+ }
}
}
break;
-
+ }
case HELTON:
+ {
if (cond == 2)
{
switch (st.getInt("drop6"))
{
case 2:
+ {
htmltext = "30678-01.htm";
st.set("drop6", "1");
break;
-
+ }
case 1:
+ {
if (st.hasQuestItems(SECOND_FRAGMENT_OF_ABYSS_JEWEL, MUSFEL_FANG))
{
htmltext = "30678-03.htm";
@@ -471,8 +420,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = "30678-02.htm";
}
break;
-
+ }
case 0:
+ {
if (st.getQuestItemsCount(MARK_OF_WATCHMAN) < 2)
{
htmltext = "30678-04.htm";
@@ -482,11 +432,13 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = "30678-05.htm";
}
break;
+ }
}
}
break;
-
+ }
case GILMORE:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30754-01.htm";
@@ -494,7 +446,7 @@ public class Q337_AudienceWithTheLandDragon extends Quest
else if (cond == 3)
{
htmltext = "30754-02.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.set("drop7", "1");
st.playSound(QuestState.SOUND_MIDDLE);
}
@@ -503,8 +455,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = (!st.hasQuestItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL)) ? "30754-04.htm" : "30754-05.htm";
}
break;
-
+ }
case THEODRIC:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30755-01.htm";
@@ -518,8 +471,10 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = (!st.hasQuestItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL)) ? "30755-03.htm" : "30755-04.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -542,7 +497,7 @@ public class Q337_AudienceWithTheLandDragon extends Quest
continue;
}
- if (npcInfo[1] != st.getInt("cond"))
+ if (npcInfo[1] != st.getCond())
{
break;
}
@@ -637,9 +592,8 @@ public class Q337_AudienceWithTheLandDragon extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case SACRIFICE_OF_THE_SACRIFICED: // Orven's request
@@ -650,6 +604,7 @@ public class Q337_AudienceWithTheLandDragon extends Quest
case MARSH_STALKER:
case JEWEL_GUARDIAN_MARA:// Moke's request
case JEWEL_GUARDIAN_MUSFEL:// Helton's request
+ {
for (int[] npcInfo : DROPS_ON_KILL)
{
if (npcInfo[0] != npcId)
@@ -669,8 +624,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
break;
}
break;
-
+ }
case BLOOD_QUEEN:// Orven's request
+ {
if ((cond == 1) && (st.getInt("drop1") == 1) && !st.hasQuestItems(REMAINS_OF_SACRIFIED))
{
for (int i = 0; i < 8; i++)
@@ -679,9 +635,10 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case HARIT_LIZARDMAN_SHAMAN:// Kendra's request
case HARIT_LIZARDMAN_MATRIARCH:
+ {
if ((cond == 1) && (Rnd.get(5) == 0) && (st.getInt("drop2") == 1) && !st.hasQuestItems(TOTEM_OF_LAND_DRAGON))
{
for (int i = 0; i < 3; i++)
@@ -690,16 +647,18 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case CAVE_MAIDEN_1:// Gilmore's request
case CAVE_MAIDEN_2:
case CAVE_KEEPER_1:
case CAVE_KEEPER_2:
+ {
if ((cond == 4) && (Rnd.get(5) == 0) && !st.hasQuestItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL))
{
addSpawn(ABYSSAL_JEWEL_3, npc.getX() + Rnd.get(-50, 50), npc.getY() + Rnd.get(-50, 50), npc.getZ(), npc.getHeading(), true, 60000);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q338_AlligatorHunter/Q338_AlligatorHunter.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q338_AlligatorHunter/Q338_AlligatorHunter.java
index e9e21fdc53..8328f342b5 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q338_AlligatorHunter/Q338_AlligatorHunter.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q338_AlligatorHunter/Q338_AlligatorHunter.java
@@ -30,12 +30,9 @@ public class Q338_AlligatorHunter extends Quest
public Q338_AlligatorHunter()
{
super(338, "Alligator Hunter");
-
registerQuestItems(ALLIGATOR_PELT);
-
addStartNpc(30892); // Enverun
addTalkId(30892);
-
addKillId(20135); // Alligator
}
@@ -49,28 +46,31 @@ public class Q338_AlligatorHunter extends Quest
return htmltext;
}
- if (event.equals("30892-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30892-05.htm"))
- {
- final int pelts = st.getQuestItemsCount(ALLIGATOR_PELT);
- int reward = pelts * 60;
- if (pelts > 10)
+ case "30892-02.htm":
{
- reward += 3430;
+ st.startQuest();
+ break;
+ }
+ case "30892-05.htm":
+ {
+ final int pelts = st.getQuestItemsCount(ALLIGATOR_PELT);
+ int reward = pelts * 60;
+ if (pelts > 10)
+ {
+ reward += 3430;
+ }
+ st.takeItems(ALLIGATOR_PELT, -1);
+ st.rewardItems(57, reward);
+ break;
+ }
+ case "30892-08.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
-
- st.takeItems(ALLIGATOR_PELT, -1);
- st.rewardItems(57, reward);
- }
- else if (event.equals("30892-08.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -89,12 +89,15 @@ public class Q338_AlligatorHunter extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 40) ? "30892-00.htm" : "30892-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(ALLIGATOR_PELT)) ? "30892-03.htm" : "30892-04.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q340_SubjugationOfLizardmen/Q340_SubjugationOfLizardmen.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q340_SubjugationOfLizardmen/Q340_SubjugationOfLizardmen.java
index 0f2de7e55f..78ba2d02f7 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q340_SubjugationOfLizardmen/Q340_SubjugationOfLizardmen.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q340_SubjugationOfLizardmen/Q340_SubjugationOfLizardmen.java
@@ -29,7 +29,6 @@ public class Q340_SubjugationOfLizardmen extends Quest
private static final int ADONIUS = 30375;
private static final int LEVIAN = 30037;
private static final int CHEST = 30989;
-
// Items
private static final int CARGO = 4255;
private static final int HOLY = 4256;
@@ -39,12 +38,9 @@ public class Q340_SubjugationOfLizardmen extends Quest
public Q340_SubjugationOfLizardmen()
{
super(340, "Subjugation of Lizardmen");
-
registerQuestItems(CARGO, HOLY, ROSARY, TOTEM);
-
addStartNpc(WEISZ);
addTalkId(WEISZ, ADONIUS, LEVIAN, CHEST);
-
addKillId(20008, 20010, 20014, 20024, 20027, 20030, 25146);
}
@@ -58,44 +54,52 @@ public class Q340_SubjugationOfLizardmen extends Quest
return htmltext;
}
- if (event.equals("30385-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30385-07.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CARGO, -1);
- }
- else if (event.equals("30385-09.htm"))
- {
- st.takeItems(CARGO, -1);
- st.rewardItems(57, 4090);
- }
- else if (event.equals("30385-10.htm"))
- {
- st.takeItems(CARGO, -1);
- st.rewardItems(57, 4090);
- st.exitQuest(true);
- }
- else if (event.equals("30375-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30037-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30989-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(TOTEM, 1);
+ case "30385-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30385-07.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CARGO, -1);
+ break;
+ }
+ case "30385-09.htm":
+ {
+ st.takeItems(CARGO, -1);
+ st.rewardItems(57, 4090);
+ break;
+ }
+ case "30385-10.htm":
+ {
+ st.takeItems(CARGO, -1);
+ st.rewardItems(57, 4090);
+ st.exitQuest(true);
+ break;
+ }
+ case "30375-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30037-02.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30989-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(TOTEM, 1);
+ break;
+ }
}
return htmltext;
@@ -114,14 +118,17 @@ public class Q340_SubjugationOfLizardmen extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 17) ? "30385-01.htm" : "30385-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case WEISZ:
+ {
if (cond == 1)
{
htmltext = (st.getQuestItemsCount(CARGO) < 30) ? "30385-05.htm" : "30385-06.htm";
@@ -138,8 +145,9 @@ public class Q340_SubjugationOfLizardmen extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ADONIUS:
+ {
if (cond == 2)
{
htmltext = "30375-01.htm";
@@ -149,7 +157,7 @@ public class Q340_SubjugationOfLizardmen extends Quest
if (st.hasQuestItems(ROSARY, HOLY))
{
htmltext = "30375-04.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HOLY, -1);
st.takeItems(ROSARY, -1);
@@ -164,8 +172,9 @@ public class Q340_SubjugationOfLizardmen extends Quest
htmltext = "30375-05.htm";
}
break;
-
+ }
case LEVIAN:
+ {
if (cond == 4)
{
htmltext = "30037-01.htm";
@@ -177,7 +186,7 @@ public class Q340_SubjugationOfLizardmen extends Quest
else if (cond == 6)
{
htmltext = "30037-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TOTEM, -1);
}
@@ -186,8 +195,9 @@ public class Q340_SubjugationOfLizardmen extends Quest
htmltext = "30037-05.htm";
}
break;
-
+ }
case CHEST:
+ {
if (cond == 5)
{
htmltext = "30989-01.htm";
@@ -197,12 +207,15 @@ public class Q340_SubjugationOfLizardmen extends Quest
htmltext = "30989-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -220,38 +233,44 @@ public class Q340_SubjugationOfLizardmen extends Quest
switch (npc.getNpcId())
{
case 20008:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
st.dropItems(CARGO, 1, 30, 500000);
}
break;
-
+ }
case 20010:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
st.dropItems(CARGO, 1, 30, 520000);
}
break;
-
+ }
case 20014:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
st.dropItems(CARGO, 1, 30, 550000);
}
break;
-
+ }
case 20024:
case 20027:
case 20030:
- if ((st.getInt("cond") == 3) && st.dropItems(HOLY, 1, 1, 100000))
+ {
+ if (st.isCond(3) && st.dropItems(HOLY, 1, 1, 100000))
{
st.dropItems(ROSARY, 1, 1, 100000);
}
break;
-
+ }
case 25146:
+ {
addSpawn(CHEST, npc, false, 30000);
break;
+ }
}
return null;
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q341_HuntingForWildBeasts/Q341_HuntingForWildBeasts.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q341_HuntingForWildBeasts/Q341_HuntingForWildBeasts.java
index d5b53ece3c..0ca919731a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q341_HuntingForWildBeasts/Q341_HuntingForWildBeasts.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q341_HuntingForWildBeasts/Q341_HuntingForWildBeasts.java
@@ -29,7 +29,6 @@ public class Q341_HuntingForWildBeasts extends Quest
{
// Item
private static final int BEAR_SKIN = 4259;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -43,12 +42,9 @@ public class Q341_HuntingForWildBeasts extends Quest
public Q341_HuntingForWildBeasts()
{
super(341, "Hunting for Wild Beasts");
-
registerQuestItems(BEAR_SKIN);
-
addStartNpc(30078); // Pano
addTalkId(30078);
-
addKillId(20021, 20203, 20310, 20335);
}
@@ -64,9 +60,7 @@ public class Q341_HuntingForWildBeasts extends Quest
if (event.equals("30078-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -85,10 +79,12 @@ public class Q341_HuntingForWildBeasts extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "30078-00.htm" : "30078-01.htm";
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(BEAR_SKIN) < 20)
{
htmltext = "30078-03.htm";
@@ -102,6 +98,7 @@ public class Q341_HuntingForWildBeasts extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q343_UnderTheShadowOfTheIvoryTower/Q343_UnderTheShadowOfTheIvoryTower.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q343_UnderTheShadowOfTheIvoryTower/Q343_UnderTheShadowOfTheIvoryTower.java
index fd1d6cad82..6087af2fde 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q343_UnderTheShadowOfTheIvoryTower/Q343_UnderTheShadowOfTheIvoryTower.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q343_UnderTheShadowOfTheIvoryTower/Q343_UnderTheShadowOfTheIvoryTower.java
@@ -85,9 +85,7 @@ public class Q343_UnderTheShadowOfTheIvoryTower extends Quest
{
case "30834-03.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound("ItemSound.quest_accept");
+ st.startQuest();
break;
}
case "30834-08.htm":
@@ -105,7 +103,7 @@ public class Q343_UnderTheShadowOfTheIvoryTower extends Quest
}
case "30834-09.htm":
{
- st.playSound("ItemSound.quest_finish");
+ st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
break;
}
@@ -440,7 +438,7 @@ public class Q343_UnderTheShadowOfTheIvoryTower extends Quest
if (Rnd.get(100) < CHANCE)
{
st.giveItems(ORB, 1);
- st.playSound("ItemSound.quest_itemget");
+ st.playSound(QuestState.SOUND_ITEMGET);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q344_1000YearsTheEndOfLamentation/Q344_1000YearsTheEndOfLamentation.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q344_1000YearsTheEndOfLamentation/Q344_1000YearsTheEndOfLamentation.java
index ef1a953952..d4a772e702 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q344_1000YearsTheEndOfLamentation/Q344_1000YearsTheEndOfLamentation.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q344_1000YearsTheEndOfLamentation/Q344_1000YearsTheEndOfLamentation.java
@@ -34,14 +34,12 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
private static final int ORVEN = 30857;
private static final int KAIEN = 30623;
private static final int GARVARENTZ = 30704;
-
// Items
private static final int ARTICLE_DEAD_HERO = 4269;
private static final int OLD_KEY = 4270;
private static final int OLD_HILT = 4271;
private static final int OLD_TOTEM = 4272;
private static final int CRUCIFIX = 4273;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -61,12 +59,9 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
public Q344_1000YearsTheEndOfLamentation()
{
super(344, "1000 years, the End of Lamentation");
-
registerQuestItems(ARTICLE_DEAD_HERO, OLD_KEY, OLD_HILT, OLD_TOTEM, CRUCIFIX);
-
addStartNpc(GILMORE);
addTalkId(GILMORE, RODEMAI, ORVEN, GARVARENTZ, KAIEN);
-
addKillId(20236, 20237, 20238, 20239, 20240, 20272, 20273, 20274, 20275, 20276);
}
@@ -80,71 +75,76 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
return htmltext;
}
- if (event.equals("30754-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30754-07.htm"))
- {
- if (st.get("success") != null)
+ case "30754-04.htm":
{
- st.set("cond", "1");
- st.unset("success");
- st.playSound(QuestState.SOUND_MIDDLE);
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30754-08.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30754-06.htm"))
- {
- if (!st.hasQuestItems(ARTICLE_DEAD_HERO))
+ case "30754-07.htm":
{
- htmltext = "30754-06a.htm";
- }
- else
- {
- final int amount = st.getQuestItemsCount(ARTICLE_DEAD_HERO);
-
- st.takeItems(ARTICLE_DEAD_HERO, -1);
- st.giveItems(57, amount * 60);
-
- // Special item, % based on actual number of qItems.
- if (Rnd.get(1000) < Math.min(10, Math.max(1, amount / 10)))
+ if (st.get("success") != null)
{
- htmltext = "30754-10.htm";
+ st.setCond(1);
+ st.unset("success");
+ st.playSound(QuestState.SOUND_MIDDLE);
}
+ break;
}
- }
- else if (event.equals("30754-11.htm"))
- {
- final int random = Rnd.get(4);
- if (random < 1)
+ case "30754-08.htm":
{
- htmltext = "30754-12.htm";
- st.giveItems(OLD_KEY, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- else if (random < 2)
+ case "30754-06.htm":
{
- htmltext = "30754-13.htm";
- st.giveItems(OLD_HILT, 1);
+ if (!st.hasQuestItems(ARTICLE_DEAD_HERO))
+ {
+ htmltext = "30754-06a.htm";
+ }
+ else
+ {
+ final int amount = st.getQuestItemsCount(ARTICLE_DEAD_HERO);
+
+ st.takeItems(ARTICLE_DEAD_HERO, -1);
+ st.giveItems(57, amount * 60);
+
+ // Special item, % based on actual number of qItems.
+ if (Rnd.get(1000) < Math.min(10, Math.max(1, amount / 10)))
+ {
+ htmltext = "30754-10.htm";
+ }
+ }
+ break;
}
- else if (random < 3)
+ case "30754-11.htm":
{
- htmltext = "30754-14.htm";
- st.giveItems(OLD_TOTEM, 1);
+ final int random = Rnd.get(4);
+ if (random < 1)
+ {
+ htmltext = "30754-12.htm";
+ st.giveItems(OLD_KEY, 1);
+ }
+ else if (random < 2)
+ {
+ htmltext = "30754-13.htm";
+ st.giveItems(OLD_HILT, 1);
+ }
+ else if (random < 3)
+ {
+ htmltext = "30754-14.htm";
+ st.giveItems(OLD_TOTEM, 1);
+ }
+ else
+ {
+ st.giveItems(CRUCIFIX, 1);
+ }
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- else
- {
- st.giveItems(CRUCIFIX, 1);
- }
-
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
}
return htmltext;
@@ -163,14 +163,17 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 48) ? "30754-01.htm" : "30754-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GILMORE:
+ {
if (cond == 1)
{
htmltext = (st.hasQuestItems(ARTICLE_DEAD_HERO)) ? "30754-05.htm" : "30754-09.htm";
@@ -180,8 +183,9 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
htmltext = (st.get("success") != null) ? "30754-16.htm" : "30754-15.htm";
}
break;
-
+ }
default:
+ {
if (cond == 2)
{
if (st.get("success") != null)
@@ -195,8 +199,10 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
}
}
break;
+ }
}
break;
+ }
}
return htmltext;
}
@@ -206,6 +212,7 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
switch (npcId)
{
case ORVEN:
+ {
if (st.hasQuestItems(CRUCIFIX))
{
st.set("success", "1");
@@ -226,8 +233,9 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
}
}
break;
-
+ }
case GARVARENTZ:
+ {
if (st.hasQuestItems(OLD_TOTEM))
{
st.set("success", "1");
@@ -248,8 +256,9 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
}
}
break;
-
+ }
case KAIEN:
+ {
if (st.hasQuestItems(OLD_HILT))
{
st.set("success", "1");
@@ -274,8 +283,9 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
}
}
break;
-
+ }
case RODEMAI:
+ {
if (st.hasQuestItems(OLD_KEY))
{
st.set("success", "1");
@@ -296,13 +306,14 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
}
}
break;
+ }
}
}
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q345_MethodToRaiseTheDead/Q345_MethodToRaiseTheDead.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q345_MethodToRaiseTheDead/Q345_MethodToRaiseTheDead.java
index a40cc9c8c9..f52f45713b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q345_MethodToRaiseTheDead/Q345_MethodToRaiseTheDead.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q345_MethodToRaiseTheDead/Q345_MethodToRaiseTheDead.java
@@ -25,6 +25,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q345_MethodToRaiseTheDead extends Quest
{
+ // NPCs
+ private static final int XENOVIA = 30912;
+ private static final int DOROTHY = 30970;
+ private static final int ORPHEUS = 30971;
+ private static final int MEDIUM_JAR = 30973;
// Items
private static final int VICTIM_ARM_BONE = 4274;
private static final int VICTIM_THIGH_BONE = 4275;
@@ -33,13 +38,6 @@ public class Q345_MethodToRaiseTheDead extends Quest
private static final int VICTIM_SPINE = 4278;
private static final int USELESS_BONE_PIECES = 4280;
private static final int POWDER_TO_SUMMON_DEAD_SOULS = 4281;
-
- // NPCs
- private static final int XENOVIA = 30912;
- private static final int DOROTHY = 30970;
- private static final int ORPHEUS = 30971;
- private static final int MEDIUM_JAR = 30973;
-
// Rewards
private static final int BILL_OF_IASON_HEINE = 4310;
private static final int IMPERIAL_DIAMOND = 3456;
@@ -47,12 +45,9 @@ public class Q345_MethodToRaiseTheDead extends Quest
public Q345_MethodToRaiseTheDead()
{
super(345, "Method to Raise the Dead");
-
registerQuestItems(VICTIM_ARM_BONE, VICTIM_THIGH_BONE, VICTIM_SKULL, VICTIM_RIB_BONE, VICTIM_SPINE, POWDER_TO_SUMMON_DEAD_SOULS, USELESS_BONE_PIECES);
-
addStartNpc(DOROTHY);
addTalkId(DOROTHY, XENOVIA, MEDIUM_JAR, ORPHEUS);
-
addKillId(20789, 20791);
}
@@ -66,77 +61,84 @@ public class Q345_MethodToRaiseTheDead extends Quest
return htmltext;
}
- if (event.equals("30970-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30970-06.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30912-04.htm"))
- {
- if (player.getAdena() >= 1000)
+ case "30970-03.htm":
{
- htmltext = "30912-03.htm";
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(57, 1000);
- st.giveItems(POWDER_TO_SUMMON_DEAD_SOULS, 1);
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30973-04.htm"))
- {
- if (st.getInt("cond") == 3)
+ case "30970-06.htm":
{
- final int chance = Rnd.get(3);
- if (chance == 0)
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30912-04.htm":
+ {
+ if (player.getAdena() >= 1000)
{
- st.set("cond", "6");
- htmltext = "30973-02a.htm";
+ htmltext = "30912-03.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(57, 1000);
+ st.giveItems(POWDER_TO_SUMMON_DEAD_SOULS, 1);
}
- else if (chance == 1)
+ break;
+ }
+ case "30973-04.htm":
+ {
+ if (st.isCond(3))
{
- st.set("cond", "6");
- htmltext = "30973-02b.htm";
+ final int chance = Rnd.get(3);
+ if (chance == 0)
+ {
+ st.setCond(6);
+ htmltext = "30973-02a.htm";
+ }
+ else if (chance == 1)
+ {
+ st.setCond(6);
+ htmltext = "30973-02b.htm";
+ }
+ else
+ {
+ st.setCond(7);
+ htmltext = "30973-02c.htm";
+ }
+
+ st.takeItems(POWDER_TO_SUMMON_DEAD_SOULS, -1);
+ st.takeItems(VICTIM_ARM_BONE, -1);
+ st.takeItems(VICTIM_THIGH_BONE, -1);
+ st.takeItems(VICTIM_SKULL, -1);
+ st.takeItems(VICTIM_RIB_BONE, -1);
+ st.takeItems(VICTIM_SPINE, -1);
+
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
+ }
+ case "30971-02a.htm":
+ {
+ if (st.hasQuestItems(USELESS_BONE_PIECES))
+ {
+ htmltext = "30971-02.htm";
+ }
+ break;
+ }
+ case "30971-03.htm":
+ {
+ if (st.hasQuestItems(USELESS_BONE_PIECES))
+ {
+ final int amount = st.getQuestItemsCount(USELESS_BONE_PIECES) * 104;
+ st.takeItems(USELESS_BONE_PIECES, -1);
+ st.rewardItems(57, amount);
}
else
{
- st.set("cond", "7");
- htmltext = "30973-02c.htm";
+ htmltext = "30971-02a.htm";
}
-
- st.takeItems(POWDER_TO_SUMMON_DEAD_SOULS, -1);
- st.takeItems(VICTIM_ARM_BONE, -1);
- st.takeItems(VICTIM_THIGH_BONE, -1);
- st.takeItems(VICTIM_SKULL, -1);
- st.takeItems(VICTIM_RIB_BONE, -1);
- st.takeItems(VICTIM_SPINE, -1);
-
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- }
- else if (event.equals("30971-02a.htm"))
- {
- if (st.hasQuestItems(USELESS_BONE_PIECES))
- {
- htmltext = "30971-02.htm";
- }
- }
- else if (event.equals("30971-03.htm"))
- {
- if (st.hasQuestItems(USELESS_BONE_PIECES))
- {
- final int amount = st.getQuestItemsCount(USELESS_BONE_PIECES) * 104;
- st.takeItems(USELESS_BONE_PIECES, -1);
- st.rewardItems(57, amount);
- }
- else
- {
- htmltext = "30971-02a.htm";
+ break;
}
}
@@ -156,14 +158,17 @@ public class Q345_MethodToRaiseTheDead extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 35) ? "30970-00.htm" : "30970-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case DOROTHY:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(VICTIM_ARM_BONE, VICTIM_THIGH_BONE, VICTIM_SKULL, VICTIM_RIB_BONE, VICTIM_SPINE)) ? "30970-04.htm" : "30970-05.htm";
@@ -209,8 +214,9 @@ public class Q345_MethodToRaiseTheDead extends Quest
st.exitQuest(true);
}
break;
-
+ }
case XENOVIA:
+ {
if (cond == 2)
{
htmltext = "30912-01.htm";
@@ -220,16 +226,20 @@ public class Q345_MethodToRaiseTheDead extends Quest
htmltext = "30912-06.htm";
}
break;
-
+ }
case MEDIUM_JAR:
+ {
htmltext = "30973-01.htm";
break;
-
+ }
case ORPHEUS:
+ {
htmltext = "30971-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -238,7 +248,7 @@ public class Q345_MethodToRaiseTheDead extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q347_GoGetTheCalculator/Q347_GoGetTheCalculator.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q347_GoGetTheCalculator/Q347_GoGetTheCalculator.java
index d428335dc0..d97daa55e2 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q347_GoGetTheCalculator/Q347_GoGetTheCalculator.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q347_GoGetTheCalculator/Q347_GoGetTheCalculator.java
@@ -29,7 +29,6 @@ public class Q347_GoGetTheCalculator extends Quest
private static final int SILVERA = 30527;
private static final int SPIRON = 30532;
private static final int BALANKI = 30533;
-
// Items
private static final int GEMSTONE_BEAST_CRYSTAL = 4286;
private static final int CALCULATOR_QUEST = 4285;
@@ -38,12 +37,9 @@ public class Q347_GoGetTheCalculator extends Quest
public Q347_GoGetTheCalculator()
{
super(347, "Go Get the Calculator");
-
registerQuestItems(GEMSTONE_BEAST_CRYSTAL, CALCULATOR_QUEST);
-
addStartNpc(BRUNON);
addTalkId(BRUNON, SILVERA, SPIRON, BALANKI);
-
addKillId(20540);
}
@@ -57,57 +53,62 @@ public class Q347_GoGetTheCalculator extends Quest
return htmltext;
}
- if (event.equals("30526-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30533-03.htm"))
- {
- if (st.getQuestItemsCount(57) >= 100)
+ case "30526-05.htm":
{
- htmltext = "30533-02.htm";
- st.takeItems(57, 100);
-
- if (st.getInt("cond") == 3)
+ st.startQuest();
+ break;
+ }
+ case "30533-03.htm":
+ {
+ if (st.getQuestItemsCount(57) >= 100)
{
- st.set("cond", "4");
+ htmltext = "30533-02.htm";
+ st.takeItems(57, 100);
+
+ if (st.isCond(3))
+ {
+ st.setCond(4);
+ }
+ else
+ {
+ st.setCond(2);
+ }
+
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
+ }
+ case "30532-02.htm":
+ {
+ if (st.isCond(2))
+ {
+ st.setCond(4);
}
else
{
- st.set("cond", "2");
+ st.setCond(3);
}
-
st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("30532-02.htm"))
- {
- if (st.getInt("cond") == 2)
+ case "30526-08.htm":
{
- st.set("cond", "4");
+ st.takeItems(CALCULATOR_QUEST, -1);
+ st.giveItems(CALCULATOR_REAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- else
+ case "30526-09.htm":
{
- st.set("cond", "3");
+ st.takeItems(CALCULATOR_QUEST, -1);
+ st.rewardItems(57, 1000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
-
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30526-08.htm"))
- {
- st.takeItems(CALCULATOR_QUEST, -1);
- st.giveItems(CALCULATOR_REAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30526-09.htm"))
- {
- st.takeItems(CALCULATOR_QUEST, -1);
- st.rewardItems(57, 1000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -126,26 +127,32 @@ public class Q347_GoGetTheCalculator extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 12) ? "30526-00.htm" : "30526-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BRUNON:
+ {
htmltext = (!st.hasQuestItems(CALCULATOR_QUEST)) ? "30526-06.htm" : "30526-07.htm";
break;
-
+ }
case SPIRON:
+ {
htmltext = (cond < 4) ? "30532-01.htm" : "30532-05.htm";
break;
-
+ }
case BALANKI:
+ {
htmltext = (cond < 4) ? "30533-01.htm" : "30533-04.htm";
break;
-
+ }
case SILVERA:
+ {
if (cond < 4)
{
htmltext = "30527-00.htm";
@@ -153,7 +160,7 @@ public class Q347_GoGetTheCalculator extends Quest
else if (cond == 4)
{
htmltext = "30527-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
@@ -165,7 +172,7 @@ public class Q347_GoGetTheCalculator extends Quest
else
{
htmltext = "30527-03.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.takeItems(GEMSTONE_BEAST_CRYSTAL, -1);
st.giveItems(CALCULATOR_QUEST, 1);
st.playSound(QuestState.SOUND_MIDDLE);
@@ -176,8 +183,10 @@ public class Q347_GoGetTheCalculator extends Quest
htmltext = "30527-04.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -186,7 +195,7 @@ public class Q347_GoGetTheCalculator extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "5");
+ final QuestState st = checkPlayerCondition(player, npc, 5);
if (st == null)
{
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q348_AnArrogantSearch/Q348_AnArrogantSearch.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q348_AnArrogantSearch/Q348_AnArrogantSearch.java
index 23d08c591a..b9bca8e5c3 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q348_AnArrogantSearch/Q348_AnArrogantSearch.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q348_AnArrogantSearch/Q348_AnArrogantSearch.java
@@ -25,6 +25,29 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q348_AnArrogantSearch extends Quest
{
+ // NPCs
+ private static final int HANELLIN = 30864;
+ private static final int CLAUDIA_ATHEBALDT = 31001;
+ private static final int MARTIEN = 30645;
+ private static final int HARNE = 30144;
+ private static final int ARK_GUARDIAN_CORPSE = 30980;
+ private static final int HOLY_ARK_OF_SECRECY_1 = 30977;
+ private static final int HOLY_ARK_OF_SECRECY_2 = 30978;
+ private static final int HOLY_ARK_OF_SECRECY_3 = 30979;
+ private static final int GUSTAV_ATHEBALDT = 30760;
+ private static final int HARDIN = 30832;
+ private static final int IASON_HEINE = 30969;
+ // Monsters
+ private static final int LESSER_GIANT_MAGE = 20657;
+ private static final int LESSER_GIANT_ELDER = 20658;
+ private static final int PLATINUM_TRIBE_SHAMAN = 20828;
+ private static final int PLATINUM_TRIBE_OVERLORD = 20829;
+ private static final int GUARDIAN_ANGEL = 20859;
+ private static final int SEAL_ANGEL = 20860;
+ // Quest Monsters
+ private static final int ANGEL_KILLER = 27184;
+ private static final int ARK_GUARDIAN_ELBEROTH = 27182;
+ private static final int ARK_GUARDIAN_SHADOW_FANG = 27183;
// Items
private static final int TITAN_POWERSTONE = 4287;
private static final int HANELLIN_FIRST_LETTER = 4288;
@@ -39,36 +62,8 @@ public class Q348_AnArrogantSearch extends Quest
private static final int WHITE_FABRIC_TRIBE = 4294;
private static final int WHITE_FABRIC_ANGELS = 5232;
private static final int BLOODED_FABRIC = 4295;
-
private static final int ANTIDOTE = 1831;
private static final int HEALING_POTION = 1061;
-
- // NPCs
- private static final int HANELLIN = 30864;
- private static final int CLAUDIA_ATHEBALDT = 31001;
- private static final int MARTIEN = 30645;
- private static final int HARNE = 30144;
- private static final int ARK_GUARDIAN_CORPSE = 30980;
- private static final int HOLY_ARK_OF_SECRECY_1 = 30977;
- private static final int HOLY_ARK_OF_SECRECY_2 = 30978;
- private static final int HOLY_ARK_OF_SECRECY_3 = 30979;
- private static final int GUSTAV_ATHEBALDT = 30760;
- private static final int HARDIN = 30832;
- private static final int IASON_HEINE = 30969;
-
- // Monsters
- private static final int LESSER_GIANT_MAGE = 20657;
- private static final int LESSER_GIANT_ELDER = 20658;
- private static final int PLATINUM_TRIBE_SHAMAN = 20828;
- private static final int PLATINUM_TRIBE_OVERLORD = 20829;
- private static final int GUARDIAN_ANGEL = 20859;
- private static final int SEAL_ANGEL = 20860;
-
- // Quest Monsters
- private static final int ANGEL_KILLER = 27184;
- private static final int ARK_GUARDIAN_ELBEROTH = 27182;
- private static final int ARK_GUARDIAN_SHADOW_FANG = 27183;
-
// NPCs instances, in order to avoid infinite instances creation speaking to chests.
private NpcInstance _elberoth;
private NpcInstance _shadowFang;
@@ -77,15 +72,11 @@ public class Q348_AnArrogantSearch extends Quest
public Q348_AnArrogantSearch()
{
super(348, "An Arrogant Search");
-
registerQuestItems(TITAN_POWERSTONE, HANELLIN_FIRST_LETTER, HANELLIN_SECOND_LETTER, HANELLIN_THIRD_LETTER, FIRST_KEY_OF_ARK, SECOND_KEY_OF_ARK, THIRD_KEY_OF_ARK, BOOK_OF_SAINT, BLOOD_OF_SAINT, BOUGH_OF_SAINT, WHITE_FABRIC_TRIBE, WHITE_FABRIC_ANGELS);
-
addStartNpc(HANELLIN);
addTalkId(HANELLIN, CLAUDIA_ATHEBALDT, MARTIEN, HARNE, HOLY_ARK_OF_SECRECY_1, HOLY_ARK_OF_SECRECY_2, HOLY_ARK_OF_SECRECY_3, ARK_GUARDIAN_CORPSE, GUSTAV_ATHEBALDT, HARDIN, IASON_HEINE);
-
addSpawnId(ARK_GUARDIAN_ELBEROTH, ARK_GUARDIAN_SHADOW_FANG, ANGEL_KILLER);
addAttackId(ARK_GUARDIAN_ELBEROTH, ARK_GUARDIAN_SHADOW_FANG, ANGEL_KILLER, PLATINUM_TRIBE_SHAMAN, PLATINUM_TRIBE_OVERLORD);
-
addKillId(LESSER_GIANT_MAGE, LESSER_GIANT_ELDER, ARK_GUARDIAN_ELBEROTH, ARK_GUARDIAN_SHADOW_FANG, ANGEL_KILLER, PLATINUM_TRIBE_SHAMAN, PLATINUM_TRIBE_OVERLORD, GUARDIAN_ANGEL, SEAL_ANGEL);
}
@@ -99,63 +90,73 @@ public class Q348_AnArrogantSearch extends Quest
return htmltext;
}
- if (event.equals("30864-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("cond", "2");
- st.set("points", "0");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30864-09.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TITAN_POWERSTONE, 1);
- }
- else if (event.equals("30864-17.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(HANELLIN_FIRST_LETTER, 1);
- st.giveItems(HANELLIN_SECOND_LETTER, 1);
- st.giveItems(HANELLIN_THIRD_LETTER, 1);
- }
- else if (event.equals("30864-36.htm"))
- {
- st.set("cond", "24");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.rewardItems(57, Rnd.get(1, 2) * 12000);
- }
- else if (event.equals("30864-37.htm"))
- {
- st.set("cond", "25");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30864-51.htm"))
- {
- st.set("cond", "26");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(WHITE_FABRIC_ANGELS, (st.hasQuestItems(BLOODED_FABRIC)) ? 9 : 10);
- }
- else if (event.equals("30864-58.htm"))
- {
- st.set("cond", "27");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30864-57.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30864-56.htm"))
- {
- st.set("cond", "29");
- st.set("gustav", "0"); // st.unset doesn't work.
- st.set("hardin", "0");
- st.set("iason", "0");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(WHITE_FABRIC_ANGELS, 10);
+ case "30864-05.htm":
+ {
+ st.startQuest();
+ st.setCond(2);
+ st.set("points", "0");
+ break;
+ }
+ case "30864-09.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TITAN_POWERSTONE, 1);
+ break;
+ }
+ case "30864-17.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(HANELLIN_FIRST_LETTER, 1);
+ st.giveItems(HANELLIN_SECOND_LETTER, 1);
+ st.giveItems(HANELLIN_THIRD_LETTER, 1);
+ break;
+ }
+ case "30864-36.htm":
+ {
+ st.setCond(24);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.rewardItems(57, Rnd.get(1, 2) * 12000);
+ break;
+ }
+ case "30864-37.htm":
+ {
+ st.setCond(25);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30864-51.htm":
+ {
+ st.setCond(26);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(WHITE_FABRIC_ANGELS, (st.hasQuestItems(BLOODED_FABRIC)) ? 9 : 10);
+ break;
+ }
+ case "30864-58.htm":
+ {
+ st.setCond(27);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30864-57.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30864-56.htm":
+ {
+ st.setCond(29);
+ st.set("gustav", "0"); // st.unset doesn't work.
+ st.set("hardin", "0");
+ st.set("iason", "0");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(WHITE_FABRIC_ANGELS, 10);
+ break;
+ }
}
return htmltext;
@@ -174,6 +175,7 @@ public class Q348_AnArrogantSearch extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (st.hasQuestItems(BLOODED_FABRIC))
{
htmltext = "30864-00.htm";
@@ -187,12 +189,14 @@ public class Q348_AnArrogantSearch extends Quest
htmltext = "30864-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HANELLIN:
+ {
if (cond == 1)
{
htmltext = "30864-02.htm";
@@ -212,7 +216,7 @@ public class Q348_AnArrogantSearch extends Quest
else if (cond == 21)
{
htmltext = "30864-29.htm";
- st.set("cond", "22");
+ st.setCond(22);
st.takeItems(BOOK_OF_SAINT, 1);
st.takeItems(BLOOD_OF_SAINT, 1);
st.takeItems(BOUGH_OF_SAINT, 1);
@@ -282,7 +286,7 @@ public class Q348_AnArrogantSearch extends Quest
if ((st.getInt("gustav") + st.getInt("hardin") + st.getInt("iason")) == 3)
{
htmltext = "30864-60.htm";
- st.set("cond", "28");
+ st.setCond(28);
st.rewardItems(57, 49000);
st.playSound(QuestState.SOUND_MIDDLE);
}
@@ -322,8 +326,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case GUSTAV_ATHEBALDT:
+ {
if (cond == 27)
{
if ((st.getQuestItemsCount(BLOODED_FABRIC) >= 3) && (st.getInt("gustav") == 0))
@@ -343,8 +348,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case HARDIN:
+ {
if (cond == 27)
{
if (st.hasQuestItems(BLOODED_FABRIC) && (st.getInt("hardin") == 0))
@@ -364,8 +370,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case IASON_HEINE:
+ {
if (cond == 27)
{
if ((st.getQuestItemsCount(BLOODED_FABRIC) >= 6) && (st.getInt("iason") == 0))
@@ -385,8 +392,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case HARNE:
+ {
if ((cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BLOOD_OF_SAINT))
@@ -394,7 +402,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(HANELLIN_FIRST_LETTER))
{
htmltext = "30144-01.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HANELLIN_FIRST_LETTER, 1);
st.addRadar(-418, 44174, -3568);
@@ -415,8 +423,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case CLAUDIA_ATHEBALDT:
+ {
if ((cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BOOK_OF_SAINT))
@@ -424,7 +433,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(HANELLIN_SECOND_LETTER))
{
htmltext = "31001-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HANELLIN_SECOND_LETTER, 1);
st.addRadar(181472, 7158, -2725);
@@ -445,8 +454,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case MARTIEN:
+ {
if ((cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BOUGH_OF_SAINT))
@@ -454,7 +464,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(HANELLIN_THIRD_LETTER))
{
htmltext = "30645-01.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HANELLIN_THIRD_LETTER, 1);
st.addRadar(50693, 158674, 376);
@@ -475,8 +485,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case ARK_GUARDIAN_CORPSE:
+ {
if (!st.hasQuestItems(HANELLIN_FIRST_LETTER) && (cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(FIRST_KEY_OF_ARK) && !st.hasQuestItems(BLOOD_OF_SAINT))
@@ -489,9 +500,9 @@ public class Q348_AnArrogantSearch extends Quest
_angelKiller = addSpawn(ANGEL_KILLER, npc, false, 0);
}
- if (st.getInt("cond") != 18)
+ if (!st.isCond(18))
{
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -510,8 +521,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case HOLY_ARK_OF_SECRECY_1:
+ {
if (!st.hasQuestItems(HANELLIN_FIRST_LETTER) && (cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BLOOD_OF_SAINT))
@@ -519,7 +531,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(FIRST_KEY_OF_ARK))
{
htmltext = "30977-02.htm";
- st.set("cond", "20");
+ st.setCond(20);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FIRST_KEY_OF_ARK, 1);
@@ -527,7 +539,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(BOOK_OF_SAINT, BOUGH_OF_SAINT))
{
- st.set("cond", "21");
+ st.setCond(21);
}
}
else
@@ -541,8 +553,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case HOLY_ARK_OF_SECRECY_2:
+ {
if (!st.hasQuestItems(HANELLIN_SECOND_LETTER) && (cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BOOK_OF_SAINT))
@@ -558,7 +571,7 @@ public class Q348_AnArrogantSearch extends Quest
else
{
htmltext = "30978-02.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SECOND_KEY_OF_ARK, 1);
@@ -566,7 +579,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(BLOOD_OF_SAINT, BOUGH_OF_SAINT))
{
- st.set("cond", "21");
+ st.setCond(21);
}
}
}
@@ -576,8 +589,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case HOLY_ARK_OF_SECRECY_3:
+ {
if (!st.hasQuestItems(HANELLIN_THIRD_LETTER) && (cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BOUGH_OF_SAINT))
@@ -593,7 +607,7 @@ public class Q348_AnArrogantSearch extends Quest
else
{
htmltext = "30979-02.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(THIRD_KEY_OF_ARK, 1);
@@ -601,7 +615,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(BLOOD_OF_SAINT, BOOK_OF_SAINT))
{
- st.set("cond", "21");
+ st.setCond(21);
}
}
}
@@ -611,8 +625,10 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -624,16 +640,20 @@ public class Q348_AnArrogantSearch extends Quest
switch (npc.getNpcId())
{
case ARK_GUARDIAN_ELBEROTH:
+ {
npc.broadcastNpcSay("This does not belong to you. Take your hands out!");
break;
-
+ }
case ARK_GUARDIAN_SHADOW_FANG:
+ {
npc.broadcastNpcSay("I don't believe it! Grrr!");
break;
-
+ }
case ANGEL_KILLER:
+ {
npc.broadcastNpcSay("I have the key, do you wish to steal it?");
break;
+ }
}
return null;
}
@@ -650,22 +670,25 @@ public class Q348_AnArrogantSearch extends Quest
switch (npc.getNpcId())
{
case ARK_GUARDIAN_ELBEROTH:
+ {
if (npc.isScriptValue(0))
{
npc.broadcastNpcSay("...I feel very sorry, but I have taken your life.");
npc.setScriptValue(1);
}
break;
-
+ }
case ARK_GUARDIAN_SHADOW_FANG:
+ {
if (npc.isScriptValue(0))
{
npc.broadcastNpcSay("I will cover this mountain with your blood!");
npc.setScriptValue(1);
}
break;
-
+ }
case ANGEL_KILLER:
+ {
if (npc.isScriptValue(0))
{
npc.broadcastNpcSay("Haha.. Really amusing! As for the key, search the corpse!");
@@ -678,17 +701,18 @@ public class Q348_AnArrogantSearch extends Quest
npc.broadcastNpcSay("Can't get rid of you... Did you get the key from the corpse?");
npc.decayMe();
- st.set("cond", "19");
+ st.setCond(19);
st.set("angelkiller", "1");
st.playSound(QuestState.SOUND_MIDDLE);
_angelKiller = null;
}
break;
-
+ }
case PLATINUM_TRIBE_OVERLORD:
case PLATINUM_TRIBE_SHAMAN:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (((cond == 24) || (cond == 25)) && st.hasQuestItems(WHITE_FABRIC_TRIBE))
{
final int points = st.getInt("points") + ((npc.getNpcId() == PLATINUM_TRIBE_SHAMAN) ? 60 : 70);
@@ -715,6 +739,7 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
+ }
}
return null;
@@ -729,42 +754,45 @@ public class Q348_AnArrogantSearch extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LESSER_GIANT_ELDER:
case LESSER_GIANT_MAGE:
+ {
if (cond == 2)
{
st.dropItems(TITAN_POWERSTONE, 1, 1, 100000);
}
break;
-
+ }
case ARK_GUARDIAN_ELBEROTH:
+ {
if ((cond >= 5) && (cond <= 22) && !st.hasQuestItems(SECOND_KEY_OF_ARK))
{
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SECOND_KEY_OF_ARK, 1);
npc.broadcastNpcSay("Oh, dull-witted.. God, they...");
}
_elberoth = null;
break;
-
+ }
case ARK_GUARDIAN_SHADOW_FANG:
+ {
if ((cond >= 5) && (cond <= 22) && !st.hasQuestItems(THIRD_KEY_OF_ARK))
{
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(THIRD_KEY_OF_ARK, 1);
npc.broadcastNpcSay("You do not know.. Seven seals are.. coughs");
}
_shadowFang = null;
break;
-
+ }
case PLATINUM_TRIBE_OVERLORD:
case PLATINUM_TRIBE_SHAMAN:
+ {
if (((cond == 24) || (cond == 25)) && st.hasQuestItems(WHITE_FABRIC_TRIBE))
{
final int points = st.getInt("points") + ((npc.getNpcId() == PLATINUM_TRIBE_SHAMAN) ? 600 : 700);
@@ -791,9 +819,10 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case SEAL_ANGEL:
case GUARDIAN_ANGEL:
+ {
if (((cond == 26) || (cond == 29)) && (Rnd.get(4) < 1) && st.hasQuestItems(WHITE_FABRIC_ANGELS))
{
st.playSound(QuestState.SOUND_ITEMGET);
@@ -801,10 +830,12 @@ public class Q348_AnArrogantSearch extends Quest
st.giveItems(BLOODED_FABRIC, 1);
}
break;
-
+ }
case ANGEL_KILLER:
+ {
_angelKiller = null;
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q350_EnhanceYourWeapon/Q350_EnhanceYourWeapon.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q350_EnhanceYourWeapon/Q350_EnhanceYourWeapon.java
index 6151eceeaf..2538b64c8a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q350_EnhanceYourWeapon/Q350_EnhanceYourWeapon.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q350_EnhanceYourWeapon/Q350_EnhanceYourWeapon.java
@@ -43,7 +43,6 @@ public class Q350_EnhanceYourWeapon extends Quest
public Q350_EnhanceYourWeapon()
{
super(350, "Enhance Your Weapon");
-
addStartNpc(NPCS);
addTalkId(NPCS);
}
@@ -64,9 +63,7 @@ public class Q350_EnhanceYourWeapon extends Quest
case "30856-04.htm":
case "30194-04.htm":
{
- qs.set("cond", "1");
- qs.setState(State.STARTED);
- qs.playSound("ItemSound.quest_accept");
+ qs.startQuest();
break;
}
case "30115-09.htm":
@@ -113,10 +110,6 @@ public class Q350_EnhanceYourWeapon extends Quest
final int npcId = npc.getNpcId();
final int id = qs.getState();
if (id == State.CREATED)
- {
- qs.set("cond", "0");
- }
- if (qs.getInt("cond") == 0)
{
htmltext = npcId + "-01.htm";
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q351_BlackSwan/Q351_BlackSwan.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q351_BlackSwan/Q351_BlackSwan.java
index af7ccc6af8..6a3bd2ab8a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q351_BlackSwan/Q351_BlackSwan.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q351_BlackSwan/Q351_BlackSwan.java
@@ -29,7 +29,6 @@ public class Q351_BlackSwan extends Quest
private static final int GOSTA = 30916;
private static final int IASON_HEINE = 30969;
private static final int ROMAN = 30897;
-
// Items
private static final int ORDER_OF_GOSTA = 4296;
private static final int LIZARD_FANG = 4297;
@@ -39,12 +38,9 @@ public class Q351_BlackSwan extends Quest
public Q351_BlackSwan()
{
super(351, "Black Swan");
-
registerQuestItems(ORDER_OF_GOSTA, BARREL_OF_LEAGUE, LIZARD_FANG);
-
addStartNpc(GOSTA);
addTalkId(GOSTA, IASON_HEINE, ROMAN);
-
addKillId(20784, 20785, 21639, 21640);
}
@@ -58,50 +54,55 @@ public class Q351_BlackSwan extends Quest
return htmltext;
}
- if (event.equals("30916-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_OF_GOSTA, 1);
- }
- else if (event.equals("30969-02a.htm"))
- {
- final int lizardFangs = st.getQuestItemsCount(LIZARD_FANG);
- if (lizardFangs > 0)
+ case "30916-03.htm":
{
- htmltext = "30969-02.htm";
-
- st.takeItems(LIZARD_FANG, -1);
- st.rewardItems(57, lizardFangs * 20);
+ st.startQuest();
+ st.giveItems(ORDER_OF_GOSTA, 1);
+ break;
}
- }
- else if (event.equals("30969-03a.htm"))
- {
- final int barrels = st.getQuestItemsCount(BARREL_OF_LEAGUE);
- if (barrels > 0)
+ case "30969-02a.htm":
{
- htmltext = "30969-03.htm";
-
- st.takeItems(BARREL_OF_LEAGUE, -1);
- st.rewardItems(BILL_OF_IASON_HEINE, barrels);
-
- // Heine explains than player can speak with Roman in order to exchange bills for rewards.
- if (st.getInt("cond") == 1)
+ final int lizardFangs = st.getQuestItemsCount(LIZARD_FANG);
+ if (lizardFangs > 0)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
+ htmltext = "30969-02.htm";
+
+ st.takeItems(LIZARD_FANG, -1);
+ st.rewardItems(57, lizardFangs * 20);
}
+ break;
}
- }
- else if (event.equals("30969-06.htm"))
- {
- // If no more quest items finish the quest for real, else send a "Return" type HTM.
- if (!st.hasQuestItems(BARREL_OF_LEAGUE, LIZARD_FANG))
+ case "30969-03a.htm":
{
- htmltext = "30969-07.htm";
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ final int barrels = st.getQuestItemsCount(BARREL_OF_LEAGUE);
+ if (barrels > 0)
+ {
+ htmltext = "30969-03.htm";
+
+ st.takeItems(BARREL_OF_LEAGUE, -1);
+ st.rewardItems(BILL_OF_IASON_HEINE, barrels);
+
+ // Heine explains than player can speak with Roman in order to exchange bills for rewards.
+ if (st.isCond(1))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ }
+ break;
+ }
+ case "30969-06.htm":
+ {
+ // If no more quest items finish the quest for real, else send a "Return" type HTM.
+ if (!st.hasQuestItems(BARREL_OF_LEAGUE, LIZARD_FANG))
+ {
+ htmltext = "30969-07.htm";
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ break;
}
}
@@ -121,25 +122,32 @@ public class Q351_BlackSwan extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 32) ? "30916-00.htm" : "30916-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case GOSTA:
+ {
htmltext = "30916-04.htm";
break;
-
+ }
case IASON_HEINE:
+ {
htmltext = "30969-01.htm";
break;
-
+ }
case ROMAN:
+ {
htmltext = (st.hasQuestItems(BILL_OF_IASON_HEINE)) ? "30897-01.htm" : "30897-02.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q352_HelpRoodRaiseANewPet/Q352_HelpRoodRaiseANewPet.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q352_HelpRoodRaiseANewPet/Q352_HelpRoodRaiseANewPet.java
index 93c0e0a330..65dfb0ab02 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q352_HelpRoodRaiseANewPet/Q352_HelpRoodRaiseANewPet.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q352_HelpRoodRaiseANewPet/Q352_HelpRoodRaiseANewPet.java
@@ -32,12 +32,9 @@ public class Q352_HelpRoodRaiseANewPet extends Quest
public Q352_HelpRoodRaiseANewPet()
{
super(352, "Help Rood Raise A New Pet!");
-
registerQuestItems(LIENRIK_EGG_1, LIENRIK_EGG_2);
-
addStartNpc(31067); // Rood
addTalkId(31067);
-
addKillId(20786, 20787, 21644, 21645);
}
@@ -53,9 +50,7 @@ public class Q352_HelpRoodRaiseANewPet extends Quest
if (event.equals("31067-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31067-09.htm"))
{
@@ -79,10 +74,12 @@ public class Q352_HelpRoodRaiseANewPet extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 39) ? "31067-00.htm" : "31067-01.htm";
break;
-
+ }
case State.STARTED:
+ {
final int eggs1 = st.getQuestItemsCount(LIENRIK_EGG_1);
final int eggs2 = st.getQuestItemsCount(LIENRIK_EGG_2);
if ((eggs1 + eggs2) == 0)
@@ -116,6 +113,7 @@ public class Q352_HelpRoodRaiseANewPet extends Quest
}
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q353_PowerOfDarkness/Q353_PowerOfDarkness.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q353_PowerOfDarkness/Q353_PowerOfDarkness.java
index d3795d465b..861b3ea446 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q353_PowerOfDarkness/Q353_PowerOfDarkness.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q353_PowerOfDarkness/Q353_PowerOfDarkness.java
@@ -30,12 +30,9 @@ public class Q353_PowerOfDarkness extends Quest
public Q353_PowerOfDarkness()
{
super(353, "Power of Darkness");
-
registerQuestItems(STONE);
-
addStartNpc(31044); // Galman
addTalkId(31044);
-
addKillId(20244, 20245, 20283, 20284);
}
@@ -51,9 +48,7 @@ public class Q353_PowerOfDarkness extends Quest
if (event.equals("31044-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31044-08.htm"))
{
@@ -77,10 +72,12 @@ public class Q353_PowerOfDarkness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 55) ? "31044-01.htm" : "31044-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int stones = st.getQuestItemsCount(STONE);
if (stones == 0)
{
@@ -93,6 +90,7 @@ public class Q353_PowerOfDarkness extends Quest
st.rewardItems(57, 2500 + (230 * stones));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q354_ConquestOfAlligatorIsland/Q354_ConquestOfAlligatorIsland.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q354_ConquestOfAlligatorIsland/Q354_ConquestOfAlligatorIsland.java
index 242323263f..ab4279c2e0 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q354_ConquestOfAlligatorIsland/Q354_ConquestOfAlligatorIsland.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q354_ConquestOfAlligatorIsland/Q354_ConquestOfAlligatorIsland.java
@@ -31,111 +31,26 @@ public class Q354_ConquestOfAlligatorIsland extends Quest
private static final int ALLIGATOR_TOOTH = 5863;
private static final int TORN_MAP_FRAGMENT = 5864;
private static final int PIRATE_TREASURE_MAP = 5915;
-
+ // Drops
private static final Map DROPLIST = new HashMap<>();
static
{
- DROPLIST.put(20804, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 490000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Crokian Lad
- DROPLIST.put(20805, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 560000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Dailaon Lad
- DROPLIST.put(20806, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 500000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Crokian Lad Warrior
- DROPLIST.put(20807, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 600000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Farhite Lad
- DROPLIST.put(20808, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 690000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Nos Lad
- DROPLIST.put(20991, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 600000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Swamp Tribe
+ // @formatter:off
+ DROPLIST.put(20804, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 490000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Crokian Lad
+ DROPLIST.put(20805, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 560000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Dailaon Lad
+ DROPLIST.put(20806, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 500000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Crokian Lad Warrior
+ DROPLIST.put(20807, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 600000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Farhite Lad
+ DROPLIST.put(20808, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 690000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Nos Lad
+ DROPLIST.put(20991, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 600000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Swamp Tribe
+ // @formatter:on
}
public Q354_ConquestOfAlligatorIsland()
{
super(354, "Conquest of Alligator Island");
-
registerQuestItems(ALLIGATOR_TOOTH, TORN_MAP_FRAGMENT);
-
addStartNpc(30895); // Kluck
addTalkId(30895);
-
addKillId(20804, 20805, 20806, 20807, 20808, 20991);
}
@@ -149,53 +64,59 @@ public class Q354_ConquestOfAlligatorIsland extends Quest
return htmltext;
}
- if (event.equals("30895-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30895-03.htm"))
- {
- if (st.hasQuestItems(TORN_MAP_FRAGMENT))
+ case "30895-02.htm":
{
- htmltext = "30895-03a.htm";
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30895-05.htm"))
- {
- final int amount = st.getQuestItemsCount(ALLIGATOR_TOOTH);
- if (amount > 0)
+ case "30895-03.htm":
{
- int reward = (amount * 220) + 3100;
- if (amount >= 100)
+ if (st.hasQuestItems(TORN_MAP_FRAGMENT))
{
- reward += 7600;
- htmltext = "30895-05b.htm";
+ htmltext = "30895-03a.htm";
}
- else
- {
- htmltext = "30895-05a.htm";
- }
-
- st.takeItems(ALLIGATOR_TOOTH, -1);
- st.rewardItems(57, reward);
+ break;
}
- }
- else if (event.equals("30895-07.htm"))
- {
- if (st.getQuestItemsCount(TORN_MAP_FRAGMENT) >= 10)
+ case "30895-05.htm":
{
- htmltext = "30895-08.htm";
- st.takeItems(TORN_MAP_FRAGMENT, 10);
- st.giveItems(PIRATE_TREASURE_MAP, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ final int amount = st.getQuestItemsCount(ALLIGATOR_TOOTH);
+ if (amount > 0)
+ {
+ int reward = (amount * 220) + 3100;
+ if (amount >= 100)
+ {
+ reward += 7600;
+ htmltext = "30895-05b.htm";
+ }
+ else
+ {
+ htmltext = "30895-05a.htm";
+ }
+
+ st.takeItems(ALLIGATOR_TOOTH, -1);
+ st.rewardItems(57, reward);
+ }
+ break;
+ }
+ case "30895-07.htm":
+ {
+ if (st.getQuestItemsCount(TORN_MAP_FRAGMENT) >= 10)
+ {
+ htmltext = "30895-08.htm";
+ st.takeItems(TORN_MAP_FRAGMENT, 10);
+ st.giveItems(PIRATE_TREASURE_MAP, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
+ }
+ case "30895-09.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30895-09.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -214,12 +135,15 @@ public class Q354_ConquestOfAlligatorIsland extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 38) ? "30895-00.htm" : "30895-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(TORN_MAP_FRAGMENT)) ? "30895-03a.htm" : "30895-03.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q355_FamilyHonor/Q355_FamilyHonor.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q355_FamilyHonor/Q355_FamilyHonor.java
index 1332c97c62..dd4843df06 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q355_FamilyHonor/Q355_FamilyHonor.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q355_FamilyHonor/Q355_FamilyHonor.java
@@ -31,13 +31,11 @@ public class Q355_FamilyHonor extends Quest
// NPCs
private static final int GALIBREDO = 30181;
private static final int PATRIN = 30929;
-
// Monsters
private static final int TIMAK_ORC_TROOP_LEADER = 20767;
private static final int TIMAK_ORC_TROOP_SHAMAN = 20768;
private static final int TIMAK_ORC_TROOP_WARRIOR = 20769;
private static final int TIMAK_ORC_TROOP_ARCHER = 20770;
-
// Items
private static final int GALIBREDO_BUST = 4252;
private static final int WORK_OF_BERONA = 4350;
@@ -45,42 +43,24 @@ public class Q355_FamilyHonor extends Quest
private static final int STATUE_ORIGINAL = 4352;
private static final int STATUE_REPLICA = 4353;
private static final int STATUE_FORGERY = 4354;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
{
- CHANCES.put(TIMAK_ORC_TROOP_LEADER, new int[]
- {
- 44,
- 54
- });
- CHANCES.put(TIMAK_ORC_TROOP_SHAMAN, new int[]
- {
- 36,
- 45
- });
- CHANCES.put(TIMAK_ORC_TROOP_WARRIOR, new int[]
- {
- 35,
- 43
- });
- CHANCES.put(TIMAK_ORC_TROOP_ARCHER, new int[]
- {
- 32,
- 42
- });
+ // @formatter:off
+ CHANCES.put(TIMAK_ORC_TROOP_LEADER, new int[]{44, 54});
+ CHANCES.put(TIMAK_ORC_TROOP_SHAMAN, new int[]{36, 45});
+ CHANCES.put(TIMAK_ORC_TROOP_WARRIOR, new int[]{35, 43});
+ CHANCES.put(TIMAK_ORC_TROOP_ARCHER, new int[]{32, 42});
+ // @formatter:on
}
public Q355_FamilyHonor()
{
super(355, "Family Honor");
-
registerQuestItems(GALIBREDO_BUST);
-
addStartNpc(GALIBREDO);
addTalkId(GALIBREDO, PATRIN);
-
addKillId(TIMAK_ORC_TROOP_LEADER, TIMAK_ORC_TROOP_SHAMAN, TIMAK_ORC_TROOP_WARRIOR, TIMAK_ORC_TROOP_ARCHER);
}
@@ -94,67 +74,72 @@ public class Q355_FamilyHonor extends Quest
return htmltext;
}
- if (event.equals("30181-2.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30181-4b.htm"))
- {
- final int count = st.getQuestItemsCount(GALIBREDO_BUST);
- if (count > 0)
+ case "30181-2.htm":
{
- htmltext = "30181-4.htm";
-
- int reward = 2800 + (count * 120);
- if (count >= 100)
- {
- htmltext = "30181-4a.htm";
- reward += 5000;
- }
-
- st.takeItems(GALIBREDO_BUST, count);
- st.rewardItems(57, reward);
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30929-7.htm"))
- {
- if (st.hasQuestItems(WORK_OF_BERONA))
+ case "30181-4b.htm":
{
- st.takeItems(WORK_OF_BERONA, 1);
-
- final int appraising = Rnd.get(100);
- if (appraising < 20)
+ final int count = st.getQuestItemsCount(GALIBREDO_BUST);
+ if (count > 0)
{
- htmltext = "30929-2.htm";
- }
- else if (appraising < 40)
- {
- htmltext = "30929-3.htm";
- st.giveItems(STATUE_REPLICA, 1);
- }
- else if (appraising < 60)
- {
- htmltext = "30929-4.htm";
- st.giveItems(STATUE_ORIGINAL, 1);
- }
- else if (appraising < 80)
- {
- htmltext = "30929-5.htm";
- st.giveItems(STATUE_FORGERY, 1);
- }
- else
- {
- htmltext = "30929-6.htm";
- st.giveItems(STATUE_PROTOTYPE, 1);
+ htmltext = "30181-4.htm";
+
+ int reward = 2800 + (count * 120);
+ if (count >= 100)
+ {
+ htmltext = "30181-4a.htm";
+ reward += 5000;
+ }
+
+ st.takeItems(GALIBREDO_BUST, count);
+ st.rewardItems(57, reward);
}
+ break;
+ }
+ case "30929-7.htm":
+ {
+ if (st.hasQuestItems(WORK_OF_BERONA))
+ {
+ st.takeItems(WORK_OF_BERONA, 1);
+
+ final int appraising = Rnd.get(100);
+ if (appraising < 20)
+ {
+ htmltext = "30929-2.htm";
+ }
+ else if (appraising < 40)
+ {
+ htmltext = "30929-3.htm";
+ st.giveItems(STATUE_REPLICA, 1);
+ }
+ else if (appraising < 60)
+ {
+ htmltext = "30929-4.htm";
+ st.giveItems(STATUE_ORIGINAL, 1);
+ }
+ else if (appraising < 80)
+ {
+ htmltext = "30929-5.htm";
+ st.giveItems(STATUE_FORGERY, 1);
+ }
+ else
+ {
+ htmltext = "30929-6.htm";
+ st.giveItems(STATUE_PROTOTYPE, 1);
+ }
+ }
+ break;
+ }
+ case "30181-6.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30181-6.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -173,21 +158,27 @@ public class Q355_FamilyHonor extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 36) ? "30181-0a.htm" : "30181-0.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case GALIBREDO:
+ {
htmltext = (st.hasQuestItems(GALIBREDO_BUST)) ? "30181-3a.htm" : "30181-3.htm";
break;
-
+ }
case PATRIN:
+ {
htmltext = "30929-0.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q356_DigUpTheSeaOfSpores/Q356_DigUpTheSeaOfSpores.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q356_DigUpTheSeaOfSpores/Q356_DigUpTheSeaOfSpores.java
index c661de36fd..5eef2a4ed5 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q356_DigUpTheSeaOfSpores/Q356_DigUpTheSeaOfSpores.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q356_DigUpTheSeaOfSpores/Q356_DigUpTheSeaOfSpores.java
@@ -27,7 +27,6 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
// Items
private static final int HERB_SPORE = 5866;
private static final int CARN_SPORE = 5865;
-
// Monsters
private static final int ROTTING_TREE = 20558;
private static final int SPORE_ZOMBIE = 20562;
@@ -35,12 +34,9 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
public Q356_DigUpTheSeaOfSpores()
{
super(356, "Dig Up the Sea of Spores!");
-
registerQuestItems(HERB_SPORE, CARN_SPORE);
-
addStartNpc(30717); // Gauen
addTalkId(30717);
-
addKillId(ROTTING_TREE, SPORE_ZOMBIE);
}
@@ -54,37 +50,43 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
return htmltext;
}
- if (event.equals("30717-06.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30717-17.htm"))
- {
- st.takeItems(HERB_SPORE, -1);
- st.takeItems(CARN_SPORE, -1);
- st.rewardItems(57, 20950);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30717-14.htm"))
- {
- st.takeItems(HERB_SPORE, -1);
- st.takeItems(CARN_SPORE, -1);
- st.rewardExpAndSp(35000, 2600);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30717-12.htm"))
- {
- st.takeItems(HERB_SPORE, -1);
- st.rewardExpAndSp(24500, 0);
- }
- else if (event.equals("30717-13.htm"))
- {
- st.takeItems(CARN_SPORE, -1);
- st.rewardExpAndSp(0, 1820);
+ case "30717-06.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30717-17.htm":
+ {
+ st.takeItems(HERB_SPORE, -1);
+ st.takeItems(CARN_SPORE, -1);
+ st.rewardItems(57, 20950);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30717-14.htm":
+ {
+ st.takeItems(HERB_SPORE, -1);
+ st.takeItems(CARN_SPORE, -1);
+ st.rewardExpAndSp(35000, 2600);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30717-12.htm":
+ {
+ st.takeItems(HERB_SPORE, -1);
+ st.rewardExpAndSp(24500, 0);
+ break;
+ }
+ case "30717-13.htm":
+ {
+ st.takeItems(CARN_SPORE, -1);
+ st.rewardExpAndSp(0, 1820);
+ break;
+ }
}
return htmltext;
@@ -103,11 +105,13 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 43) ? "30717-01.htm" : "30717-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30717-07.htm";
@@ -132,6 +136,8 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
htmltext = "30717-10.htm";
}
break;
+ }
+
}
return htmltext;
@@ -146,24 +152,27 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond < 3)
{
switch (npc.getNpcId())
{
case ROTTING_TREE:
+ {
if (st.dropItems(HERB_SPORE, 1, 50, 630000))
{
- st.set("cond", (cond == 2) ? "3" : "2");
+ st.setCond((cond == 2) ? 3 : 2);
}
break;
-
+ }
case SPORE_ZOMBIE:
+ {
if (st.dropItems(CARN_SPORE, 1, 50, 760000))
{
- st.set("cond", (cond == 2) ? "3" : "2");
+ st.setCond((cond == 2) ? 3 : 2);
}
break;
+ }
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q357_WarehouseKeepersAmbition/Q357_WarehouseKeepersAmbition.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q357_WarehouseKeepersAmbition/Q357_WarehouseKeepersAmbition.java
index 8465411533..5950adde9e 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q357_WarehouseKeepersAmbition/Q357_WarehouseKeepersAmbition.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q357_WarehouseKeepersAmbition/Q357_WarehouseKeepersAmbition.java
@@ -27,15 +27,13 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q357_WarehouseKeepersAmbition extends Quest
{
- // Item
- private static final int JADE_CRYSTAL = 5867;
-
// Monsters
private static final int FOREST_RUNNER = 20594;
private static final int FLINE_ELDER = 20595;
private static final int LIELE_ELDER = 20596;
private static final int VALLEY_TREANT_ELDER = 20597;
-
+ // Item
+ private static final int JADE_CRYSTAL = 5867;
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -49,12 +47,9 @@ public class Q357_WarehouseKeepersAmbition extends Quest
public Q357_WarehouseKeepersAmbition()
{
super(357, "Warehouse Keeper's Ambition");
-
registerQuestItems(JADE_CRYSTAL);
-
addStartNpc(30686); // Silva
addTalkId(30686);
-
addKillId(FOREST_RUNNER, FLINE_ELDER, LIELE_ELDER, VALLEY_TREANT_ELDER);
}
@@ -68,35 +63,39 @@ public class Q357_WarehouseKeepersAmbition extends Quest
return htmltext;
}
- if (event.equals("30686-2.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30686-7.htm"))
- {
- final int count = st.getQuestItemsCount(JADE_CRYSTAL);
- if (count == 0)
+ case "30686-2.htm":
{
- htmltext = "30686-4.htm";
+ st.startQuest();
+ break;
}
- else
+ case "30686-7.htm":
{
- int reward = (count * 425) + 3500;
- if (count >= 100)
+ final int count = st.getQuestItemsCount(JADE_CRYSTAL);
+ if (count == 0)
{
- reward += 7400;
+ htmltext = "30686-4.htm";
}
-
- st.takeItems(JADE_CRYSTAL, -1);
- st.rewardItems(57, reward);
+ else
+ {
+ int reward = (count * 425) + 3500;
+ if (count >= 100)
+ {
+ reward += 7400;
+ }
+
+ st.takeItems(JADE_CRYSTAL, -1);
+ st.rewardItems(57, reward);
+ }
+ break;
+ }
+ case "30686-8.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30686-8.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -115,12 +114,15 @@ public class Q357_WarehouseKeepersAmbition extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 47) ? "30686-0a.htm" : "30686-0.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (!st.hasQuestItems(JADE_CRYSTAL)) ? "30686-4.htm" : "30686-6.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q358_IllegitimateChildOfAGoddess/Q358_IllegitimateChildOfAGoddess.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q358_IllegitimateChildOfAGoddess/Q358_IllegitimateChildOfAGoddess.java
index abce5ebf37..f3f0582357 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q358_IllegitimateChildOfAGoddess/Q358_IllegitimateChildOfAGoddess.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q358_IllegitimateChildOfAGoddess/Q358_IllegitimateChildOfAGoddess.java
@@ -27,7 +27,6 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
{
// Item
private static final int SCALE = 5868;
-
// Reward
private static final int[] REWARD =
{
@@ -44,12 +43,9 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
public Q358_IllegitimateChildOfAGoddess()
{
super(358, "Illegitimate Child of A Goddess");
-
registerQuestItems(SCALE);
-
addStartNpc(30862); // Oltlin
addTalkId(30862);
-
addKillId(20672, 20673); // Trives, Falibati
}
@@ -65,9 +61,7 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
if (event.equals("30862-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -86,11 +80,13 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 63) ? "30862-01.htm" : "30862-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30862-06.htm";
}
@@ -103,6 +99,7 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -111,7 +108,7 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -119,7 +116,7 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
if (st.dropItems(SCALE, 1, 108, (npc.getNpcId() == 20672) ? 680000 : 660000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q359_ForSleeplessDeadmen/Q359_ForSleeplessDeadmen.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q359_ForSleeplessDeadmen/Q359_ForSleeplessDeadmen.java
index 219e534282..780943f7c0 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q359_ForSleeplessDeadmen/Q359_ForSleeplessDeadmen.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q359_ForSleeplessDeadmen/Q359_ForSleeplessDeadmen.java
@@ -28,14 +28,12 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q359_ForSleeplessDeadmen extends Quest
{
- // Item
- private static final int REMAINS = 5869;
-
// Monsters
private static final int DOOM_SERVANT = 21006;
private static final int DOOM_GUARD = 21007;
private static final int DOOM_ARCHER = 21008;
-
+ // Item
+ private static final int REMAINS = 5869;
// Reward
private static final int[] REWARD =
{
@@ -48,7 +46,6 @@ public class Q359_ForSleeplessDeadmen extends Quest
5494,
5495
};
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -61,12 +58,9 @@ public class Q359_ForSleeplessDeadmen extends Quest
public Q359_ForSleeplessDeadmen()
{
super(359, "For Sleepless Deadmen");
-
registerQuestItems(REMAINS);
-
addStartNpc(30857); // Orven
addTalkId(30857);
-
addKillId(DOOM_SERVANT, DOOM_GUARD, DOOM_ARCHER);
}
@@ -82,9 +76,7 @@ public class Q359_ForSleeplessDeadmen extends Quest
if (event.equals("30857-06.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30857-10.htm"))
{
@@ -109,11 +101,13 @@ public class Q359_ForSleeplessDeadmen extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "30857-01.htm" : "30857-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30857-07.htm";
@@ -121,7 +115,7 @@ public class Q359_ForSleeplessDeadmen extends Quest
else if (cond == 2)
{
htmltext = "30857-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REMAINS, -1);
}
@@ -130,6 +124,7 @@ public class Q359_ForSleeplessDeadmen extends Quest
htmltext = "30857-09.htm";
}
break;
+ }
}
return htmltext;
@@ -138,7 +133,7 @@ public class Q359_ForSleeplessDeadmen extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -146,7 +141,7 @@ public class Q359_ForSleeplessDeadmen extends Quest
if (st.dropItems(REMAINS, 1, 60, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q360_PlunderTheirSupplies/Q360_PlunderTheirSupplies.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q360_PlunderTheirSupplies/Q360_PlunderTheirSupplies.java
index e4610f13db..5bc3c16a60 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q360_PlunderTheirSupplies/Q360_PlunderTheirSupplies.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q360_PlunderTheirSupplies/Q360_PlunderTheirSupplies.java
@@ -28,48 +28,21 @@ public class Q360_PlunderTheirSupplies extends Quest
private static final int SUPPLY_ITEM = 5872;
private static final int SUSPICIOUS_DOCUMENT = 5871;
private static final int RECIPE_OF_SUPPLY = 5870;
-
+ // Drops
private static final int[][][] DROPLIST =
{
- {
- {
- SUSPICIOUS_DOCUMENT,
- 1,
- 0,
- 50000
- },
- {
- SUPPLY_ITEM,
- 1,
- 0,
- 500000
- }
- },
- {
- {
- SUSPICIOUS_DOCUMENT,
- 1,
- 0,
- 50000
- },
- {
- SUPPLY_ITEM,
- 1,
- 0,
- 660000
- }
- }
+ // @formatter:off
+ {{SUSPICIOUS_DOCUMENT, 1, 0, 50000},{SUPPLY_ITEM, 1, 0, 500000}},
+ {{SUSPICIOUS_DOCUMENT, 1, 0, 50000},{SUPPLY_ITEM, 1, 0, 660000}}
+ // @formatter:on
};
public Q360_PlunderTheirSupplies()
{
super(360, "Plunder Their Supplies");
-
registerQuestItems(RECIPE_OF_SUPPLY, SUPPLY_ITEM, SUSPICIOUS_DOCUMENT);
-
addStartNpc(30873); // Coleman
addTalkId(30873);
-
addKillId(20666, 20669);
}
@@ -85,9 +58,7 @@ public class Q360_PlunderTheirSupplies extends Quest
if (event.equals("30873-2.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30873-6.htm"))
{
@@ -114,10 +85,12 @@ public class Q360_PlunderTheirSupplies extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 52) ? "30873-0a.htm" : "30873-0.htm";
break;
-
+ }
case State.STARTED:
+ {
final int supplyItems = st.getQuestItemsCount(SUPPLY_ITEM);
if (supplyItems == 0)
{
@@ -132,6 +105,7 @@ public class Q360_PlunderTheirSupplies extends Quest
st.rewardItems(57, reward);
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q362_BardsMandolin/Q362_BardsMandolin.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q362_BardsMandolin/Q362_BardsMandolin.java
index 4144562309..e0c0428a75 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q362_BardsMandolin/Q362_BardsMandolin.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q362_BardsMandolin/Q362_BardsMandolin.java
@@ -24,22 +24,19 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q362_BardsMandolin extends Quest
{
- // Items
- private static final int SWAN_FLUTE = 4316;
- private static final int SWAN_LETTER = 4317;
-
// NPCs
private static final int SWAN = 30957;
private static final int NANARIN = 30956;
private static final int GALION = 30958;
private static final int WOODROW = 30837;
+ // Items
+ private static final int SWAN_FLUTE = 4316;
+ private static final int SWAN_LETTER = 4317;
public Q362_BardsMandolin()
{
super(362, "Bard's Mandolin");
-
registerQuestItems(SWAN_FLUTE, SWAN_LETTER);
-
addStartNpc(SWAN);
addTalkId(SWAN, NANARIN, GALION, WOODROW);
}
@@ -56,9 +53,7 @@ public class Q362_BardsMandolin extends Quest
if (event.equals("30957-3.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30957-7.htm") || event.equals("30957-8.htm"))
{
@@ -84,14 +79,17 @@ public class Q362_BardsMandolin extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30957-2.htm" : "30957-1.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SWAN:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30957-4.htm";
@@ -99,7 +97,7 @@ public class Q362_BardsMandolin extends Quest
else if (cond == 3)
{
htmltext = "30957-5.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SWAN_LETTER, 1);
}
@@ -112,12 +110,13 @@ public class Q362_BardsMandolin extends Quest
htmltext = "30957-6.htm";
}
break;
-
+ }
case WOODROW:
+ {
if (cond == 1)
{
htmltext = "30837-1.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 2)
@@ -129,12 +128,13 @@ public class Q362_BardsMandolin extends Quest
htmltext = "30837-3.htm";
}
break;
-
+ }
case GALION:
+ {
if (cond == 2)
{
htmltext = "30958-1.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_ITEMGET);
st.giveItems(SWAN_FLUTE, 1);
}
@@ -143,12 +143,13 @@ public class Q362_BardsMandolin extends Quest
htmltext = "30958-2.htm";
}
break;
-
+ }
case NANARIN:
+ {
if (cond == 4)
{
htmltext = "30956-1.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SWAN_FLUTE, 1);
st.takeItems(SWAN_LETTER, 1);
@@ -158,8 +159,10 @@ public class Q362_BardsMandolin extends Quest
htmltext = "30956-2.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q363_SorrowfulSoundOfFlute/Q363_SorrowfulSoundOfFlute.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q363_SorrowfulSoundOfFlute/Q363_SorrowfulSoundOfFlute.java
index f9d0bd8dcb..2fbe54d5e9 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q363_SorrowfulSoundOfFlute/Q363_SorrowfulSoundOfFlute.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q363_SorrowfulSoundOfFlute/Q363_SorrowfulSoundOfFlute.java
@@ -32,21 +32,17 @@ public class Q363_SorrowfulSoundOfFlute extends Quest
private static final int HOLVAS = 30058;
private static final int BARBADO = 30959;
private static final int POITAN = 30458;
-
- // Item
+ // Items
private static final int NANARIN_FLUTE = 4319;
private static final int BLACK_BEER = 4320;
private static final int CLOTHES = 4318;
-
// Reward
private static final int THEME_OF_SOLITUDE = 4420;
public Q363_SorrowfulSoundOfFlute()
{
super(363, "Sorrowful Sound of Flute");
-
registerQuestItems(NANARIN_FLUTE, BLACK_BEER, CLOTHES);
-
addStartNpc(NANARIN);
addTalkId(NANARIN, OPIX, ALDO, RANSPO, HOLVAS, BARBADO, POITAN);
}
@@ -61,29 +57,34 @@ public class Q363_SorrowfulSoundOfFlute extends Quest
return htmltext;
}
- if (event.equals("30956-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30956-05.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CLOTHES, 1);
- }
- else if (event.equals("30956-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(NANARIN_FLUTE, 1);
- }
- else if (event.equals("30956-07.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BLACK_BEER, 1);
+ case "30956-02.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30956-05.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CLOTHES, 1);
+ break;
+ }
+ case "30956-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(NANARIN_FLUTE, 1);
+ break;
+ }
+ case "30956-07.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BLACK_BEER, 1);
+ break;
+ }
}
return htmltext;
@@ -102,14 +103,17 @@ public class Q363_SorrowfulSoundOfFlute extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30956-03.htm" : "30956-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NANARIN:
+ {
if (cond == 1)
{
htmltext = "30956-02.htm";
@@ -138,24 +142,26 @@ public class Q363_SorrowfulSoundOfFlute extends Quest
st.exitQuest(true);
}
break;
-
+ }
case OPIX:
case POITAN:
case ALDO:
case RANSPO:
case HOLVAS:
+ {
htmltext = npc.getNpcId() + "-01.htm";
if (cond == 1)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
-
+ }
case BARBADO:
+ {
if (cond == 3)
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
if (st.hasQuestItems(NANARIN_FLUTE))
@@ -177,7 +183,10 @@ public class Q363_SorrowfulSoundOfFlute extends Quest
htmltext = "30959-03.htm";
}
break;
+ }
}
+ break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q364_JovialAccordion/Q364_JovialAccordion.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q364_JovialAccordion/Q364_JovialAccordion.java
index f560b77242..60e8383217 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q364_JovialAccordion/Q364_JovialAccordion.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q364_JovialAccordion/Q364_JovialAccordion.java
@@ -32,7 +32,6 @@ public class Q364_JovialAccordion extends Quest
private static final int XABER = 30075;
private static final int CLOTH_CHEST = 30961;
private static final int BEER_CHEST = 30960;
-
// Items
private static final int KEY_1 = 4323;
private static final int KEY_2 = 4324;
@@ -43,9 +42,7 @@ public class Q364_JovialAccordion extends Quest
public Q364_JovialAccordion()
{
super(364, "Jovial Accordion");
-
registerQuestItems(KEY_1, KEY_2, STOLEN_BEER, STOLEN_CLOTHES);
-
addStartNpc(BARBADO);
addTalkId(BARBADO, SWAN, SABRIN, XABER, CLOTH_CHEST, BEER_CHEST);
}
@@ -60,44 +57,49 @@ public class Q364_JovialAccordion extends Quest
return htmltext;
}
- if (event.equals("30959-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("items", "0");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30957-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(KEY_1, 1);
- st.giveItems(KEY_2, 1);
- }
- else if (event.equals("30960-04.htm"))
- {
- if (st.hasQuestItems(KEY_2))
+ case "30959-02.htm":
{
- st.takeItems(KEY_2, 1);
- if (Rnd.nextBoolean())
- {
- htmltext = "30960-02.htm";
- st.giveItems(STOLEN_BEER, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
+ st.startQuest();
+ st.set("items", "0");
+ break;
}
- }
- else if (event.equals("30961-04.htm"))
- {
- if (st.hasQuestItems(KEY_1))
+ case "30957-02.htm":
{
- st.takeItems(KEY_1, 1);
- if (Rnd.nextBoolean())
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(KEY_1, 1);
+ st.giveItems(KEY_2, 1);
+ break;
+ }
+ case "30960-04.htm":
+ {
+ if (st.hasQuestItems(KEY_2))
{
- htmltext = "30961-02.htm";
- st.giveItems(STOLEN_CLOTHES, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(KEY_2, 1);
+ if (Rnd.nextBoolean())
+ {
+ htmltext = "30960-02.htm";
+ st.giveItems(STOLEN_BEER, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
}
+ break;
+ }
+ case "30961-04.htm":
+ {
+ if (st.hasQuestItems(KEY_1))
+ {
+ st.takeItems(KEY_1, 1);
+ if (Rnd.nextBoolean())
+ {
+ htmltext = "30961-02.htm";
+ st.giveItems(STOLEN_CLOTHES, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ }
+ break;
}
}
@@ -117,16 +119,18 @@ public class Q364_JovialAccordion extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30959-00.htm" : "30959-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
final int stolenItems = st.getInt("items");
-
switch (npc.getNpcId())
{
case BARBADO:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30959-03.htm";
@@ -139,8 +143,9 @@ public class Q364_JovialAccordion extends Quest
st.exitQuest(true);
}
break;
-
+ }
case SWAN:
+ {
if (cond == 1)
{
htmltext = "30957-01.htm";
@@ -149,7 +154,7 @@ public class Q364_JovialAccordion extends Quest
{
if (stolenItems > 0)
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
if (stolenItems == 2)
@@ -181,24 +186,27 @@ public class Q364_JovialAccordion extends Quest
htmltext = "30957-07.htm";
}
break;
-
+ }
case BEER_CHEST:
+ {
htmltext = "30960-03.htm";
if ((cond == 2) && st.hasQuestItems(KEY_2))
{
htmltext = "30960-01.htm";
}
break;
-
+ }
case CLOTH_CHEST:
+ {
htmltext = "30961-03.htm";
if ((cond == 2) && st.hasQuestItems(KEY_1))
{
htmltext = "30961-01.htm";
}
break;
-
+ }
case SABRIN:
+ {
if (st.hasQuestItems(STOLEN_BEER))
{
htmltext = "30060-01.htm";
@@ -211,8 +219,9 @@ public class Q364_JovialAccordion extends Quest
htmltext = "30060-02.htm";
}
break;
-
+ }
case XABER:
+ {
if (st.hasQuestItems(STOLEN_CLOTHES))
{
htmltext = "30075-01.htm";
@@ -225,8 +234,10 @@ public class Q364_JovialAccordion extends Quest
htmltext = "30075-02.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q365_DevilsLegacy/Q365_DevilsLegacy.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q365_DevilsLegacy/Q365_DevilsLegacy.java
index a176c5b792..e21bdfc863 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q365_DevilsLegacy/Q365_DevilsLegacy.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q365_DevilsLegacy/Q365_DevilsLegacy.java
@@ -30,19 +30,15 @@ public class Q365_DevilsLegacy extends Quest
// NPCs
private static final int RANDOLF = 30095;
private static final int COLLOB = 30092;
-
// Item
private static final int PIRATE_TREASURE_CHEST = 5873;
public Q365_DevilsLegacy()
{
super(365, "Devil's Legacy");
-
registerQuestItems(PIRATE_TREASURE_CHEST);
-
addStartNpc(RANDOLF);
addTalkId(RANDOLF, COLLOB);
-
addKillId(20836, 20845, 21629, 21630); // Pirate Zombie && Pirate Zombie Captain.
}
@@ -56,104 +52,108 @@ public class Q365_DevilsLegacy extends Quest
return htmltext;
}
- if (event.equals("30095-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30095-06.htm"))
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
- }
- else if (event.equals("30092-05.htm"))
- {
- if (!st.hasQuestItems(PIRATE_TREASURE_CHEST))
+ case "30095-02.htm":
{
- htmltext = "30092-02.htm";
+ st.startQuest();
+ break;
}
- else if (st.getQuestItemsCount(57) < 600)
+ case "30095-06.htm":
{
- htmltext = "30092-03.htm";
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
}
- else
+ case "30092-05.htm":
{
- st.takeItems(PIRATE_TREASURE_CHEST, 1);
- st.takeItems(57, 600);
-
- int i0;
- if (Rnd.get(100) < 80)
+ if (!st.hasQuestItems(PIRATE_TREASURE_CHEST))
{
- i0 = Rnd.get(100);
- if (i0 < 1)
- {
- st.giveItems(955, 1);
- }
- else if (i0 < 4)
- {
- st.giveItems(956, 1);
- }
- else if (i0 < 36)
- {
- st.giveItems(1868, 1);
- }
- else if (i0 < 68)
- {
- st.giveItems(1884, 1);
- }
- else
- {
- st.giveItems(1872, 1);
- }
-
- htmltext = "30092-05.htm";
+ htmltext = "30092-02.htm";
+ }
+ else if (st.getQuestItemsCount(57) < 600)
+ {
+ htmltext = "30092-03.htm";
}
else
{
- i0 = Rnd.get(1000);
- if (i0 < 10)
+ st.takeItems(PIRATE_TREASURE_CHEST, 1);
+ st.takeItems(57, 600);
+
+ int i0;
+ if (Rnd.get(100) < 80)
{
- st.giveItems(951, 1);
- }
- else if (i0 < 40)
- {
- st.giveItems(952, 1);
- }
- else if (i0 < 60)
- {
- st.giveItems(955, 1);
- }
- else if (i0 < 260)
- {
- st.giveItems(956, 1);
- }
- else if (i0 < 445)
- {
- st.giveItems(1879, 1);
- }
- else if (i0 < 630)
- {
- st.giveItems(1880, 1);
- }
- else if (i0 < 815)
- {
- st.giveItems(1882, 1);
+ i0 = Rnd.get(100);
+ if (i0 < 1)
+ {
+ st.giveItems(955, 1);
+ }
+ else if (i0 < 4)
+ {
+ st.giveItems(956, 1);
+ }
+ else if (i0 < 36)
+ {
+ st.giveItems(1868, 1);
+ }
+ else if (i0 < 68)
+ {
+ st.giveItems(1884, 1);
+ }
+ else
+ {
+ st.giveItems(1872, 1);
+ }
+
+ htmltext = "30092-05.htm";
}
else
{
- st.giveItems(1881, 1);
- }
-
- htmltext = "30092-06.htm";
-
- // Curse effect !
- final Skill skill = SkillTable.getInstance().getSkill(4082, 1);
- if ((skill != null) && (player.getFirstEffect(skill) == null))
- {
- skill.applyEffects(npc, player);
+ i0 = Rnd.get(1000);
+ if (i0 < 10)
+ {
+ st.giveItems(951, 1);
+ }
+ else if (i0 < 40)
+ {
+ st.giveItems(952, 1);
+ }
+ else if (i0 < 60)
+ {
+ st.giveItems(955, 1);
+ }
+ else if (i0 < 260)
+ {
+ st.giveItems(956, 1);
+ }
+ else if (i0 < 445)
+ {
+ st.giveItems(1879, 1);
+ }
+ else if (i0 < 630)
+ {
+ st.giveItems(1880, 1);
+ }
+ else if (i0 < 815)
+ {
+ st.giveItems(1882, 1);
+ }
+ else
+ {
+ st.giveItems(1881, 1);
+ }
+
+ htmltext = "30092-06.htm";
+
+ // Curse effect !
+ final Skill skill = SkillTable.getInstance().getSkill(4082, 1);
+ if ((skill != null) && (player.getFirstEffect(skill) == null))
+ {
+ skill.applyEffects(npc, player);
+ }
}
}
+ break;
}
}
@@ -173,13 +173,16 @@ public class Q365_DevilsLegacy extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 39) ? "30095-00.htm" : "30095-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case RANDOLF:
+ {
if (!st.hasQuestItems(PIRATE_TREASURE_CHEST))
{
htmltext = "30095-03.htm";
@@ -194,11 +197,15 @@ public class Q365_DevilsLegacy extends Quest
st.rewardItems(57, reward + 19800);
}
break;
-
+ }
case COLLOB:
+ {
htmltext = "30092-01.htm";
break;
+ }
}
+ break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q366_SilverHairedShaman/Q366_SilverHairedShaman.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q366_SilverHairedShaman/Q366_SilverHairedShaman.java
index 24492569b7..d3dbdd9a86 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q366_SilverHairedShaman/Q366_SilverHairedShaman.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q366_SilverHairedShaman/Q366_SilverHairedShaman.java
@@ -29,10 +29,8 @@ public class Q366_SilverHairedShaman extends Quest
{
// NPC
private static final int DIETER = 30111;
-
// Item
private static final int HAIR = 5874;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -45,12 +43,9 @@ public class Q366_SilverHairedShaman extends Quest
public Q366_SilverHairedShaman()
{
super(366, "Silver Haired Shaman");
-
registerQuestItems(HAIR);
-
addStartNpc(DIETER);
addTalkId(DIETER);
-
addKillId(20986, 20987, 20988);
}
@@ -66,9 +61,7 @@ public class Q366_SilverHairedShaman extends Quest
if (event.equals("30111-2.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30111-6.htm"))
{
@@ -92,10 +85,12 @@ public class Q366_SilverHairedShaman extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 48) ? "30111-0.htm" : "30111-1.htm";
break;
-
+ }
case State.STARTED:
+ {
final int count = st.getQuestItemsCount(HAIR);
if (count == 0)
{
@@ -108,6 +103,7 @@ public class Q366_SilverHairedShaman extends Quest
st.rewardItems(57, 12070 + (500 * count));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q367_ElectrifyingRecharge/Q367_ElectrifyingRecharge.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q367_ElectrifyingRecharge/Q367_ElectrifyingRecharge.java
index 86b51da8d5..fff40ddbb3 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q367_ElectrifyingRecharge/Q367_ElectrifyingRecharge.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q367_ElectrifyingRecharge/Q367_ElectrifyingRecharge.java
@@ -28,7 +28,8 @@ public class Q367_ElectrifyingRecharge extends Quest
{
// NPCs
private static final int LORAIN = 30673;
-
+ // Monsters
+ private static final int CATHEROK = 21035;
// Item
private static final int LORAIN_LAMP = 5875;
private static final int TITAN_LAMP_1 = 5876;
@@ -36,7 +37,6 @@ public class Q367_ElectrifyingRecharge extends Quest
private static final int TITAN_LAMP_3 = 5878;
private static final int TITAN_LAMP_4 = 5879;
private static final int TITAN_LAMP_5 = 5880;
-
// Reward
private static final int[] REWARD =
{
@@ -54,18 +54,12 @@ public class Q367_ElectrifyingRecharge extends Quest
4564
};
- // Mobs
- private static final int CATHEROK = 21035;
-
public Q367_ElectrifyingRecharge()
{
super(367, "Electrifying Recharge!");
-
registerQuestItems(LORAIN_LAMP, TITAN_LAMP_1, TITAN_LAMP_2, TITAN_LAMP_3, TITAN_LAMP_4, TITAN_LAMP_5);
-
addStartNpc(LORAIN);
addTalkId(LORAIN);
-
addSpellFinishedId(CATHEROK);
}
@@ -79,28 +73,33 @@ public class Q367_ElectrifyingRecharge extends Quest
return htmltext;
}
- if (event.equals("30673-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LORAIN_LAMP, 1);
- }
- else if (event.equals("30673-09.htm"))
- {
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LORAIN_LAMP, 1);
- }
- else if (event.equals("30673-08.htm"))
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
- }
- else if (event.equals("30673-07.htm"))
- {
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LORAIN_LAMP, 1);
+ case "30673-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(LORAIN_LAMP, 1);
+ break;
+ }
+ case "30673-09.htm":
+ {
+ st.playSound(QuestState.SOUND_ACCEPT);
+ st.giveItems(LORAIN_LAMP, 1);
+ break;
+ }
+ case "30673-08.htm":
+ {
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
+ }
+ case "30673-07.htm":
+ {
+ st.setCond(1);
+ st.playSound(QuestState.SOUND_ACCEPT);
+ st.giveItems(LORAIN_LAMP, 1);
+ break;
+ }
}
return htmltext;
}
@@ -118,11 +117,13 @@ public class Q367_ElectrifyingRecharge extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 37) ? "30673-02.htm" : "30673-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
if (st.hasQuestItems(5880))
@@ -160,6 +161,7 @@ public class Q367_ElectrifyingRecharge extends Quest
st.playSound(QuestState.SOUND_FINISH);
}
break;
+ }
}
return htmltext;
}
@@ -167,28 +169,25 @@ public class Q367_ElectrifyingRecharge extends Quest
@Override
public String onSpellFinished(NpcInstance npc, PlayerInstance player, Skill skill)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
}
- if (skill.getId() == 4072)
+ if ((skill.getId() == 4072) && st.hasQuestItems(LORAIN_LAMP))
{
- if (st.hasQuestItems(LORAIN_LAMP))
+ final int randomItem = Rnd.get(5876, 5880);
+ st.takeItems(LORAIN_LAMP, 1);
+ st.giveItems(randomItem, 1);
+ if (randomItem == 5879)
{
- final int randomItem = Rnd.get(5876, 5880);
- st.takeItems(LORAIN_LAMP, 1);
- st.giveItems(randomItem, 1);
- if (randomItem == 5879)
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- }
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q368_TrespassingIntoTheSacredArea/Q368_TrespassingIntoTheSacredArea.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q368_TrespassingIntoTheSacredArea/Q368_TrespassingIntoTheSacredArea.java
index 4f3809c869..1b346ff172 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q368_TrespassingIntoTheSacredArea/Q368_TrespassingIntoTheSacredArea.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q368_TrespassingIntoTheSacredArea/Q368_TrespassingIntoTheSacredArea.java
@@ -29,10 +29,8 @@ public class Q368_TrespassingIntoTheSacredArea extends Quest
{
// NPC
private static final int RESTINA = 30926;
-
// Item
private static final int FANG = 5881;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -46,12 +44,9 @@ public class Q368_TrespassingIntoTheSacredArea extends Quest
public Q368_TrespassingIntoTheSacredArea()
{
super(368, "Trespassing into the Sacred Area");
-
registerQuestItems(FANG);
-
addStartNpc(RESTINA);
addTalkId(RESTINA);
-
addKillId(20794, 20795, 20796, 20797);
}
@@ -67,9 +62,7 @@ public class Q368_TrespassingIntoTheSacredArea extends Quest
if (event.equals("30926-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30926-05.htm"))
{
@@ -93,10 +86,12 @@ public class Q368_TrespassingIntoTheSacredArea extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 36) ? "30926-01a.htm" : "30926-01.htm";
break;
-
+ }
case State.STARTED:
+ {
final int fangs = st.getQuestItemsCount(FANG);
if (fangs == 0)
{
@@ -110,6 +105,7 @@ public class Q368_TrespassingIntoTheSacredArea extends Quest
st.rewardItems(57, reward);
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q369_CollectorOfJewels/Q369_CollectorOfJewels.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q369_CollectorOfJewels/Q369_CollectorOfJewels.java
index 95e0b0f5ef..b40e25ff8c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q369_CollectorOfJewels/Q369_CollectorOfJewels.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q369_CollectorOfJewels/Q369_CollectorOfJewels.java
@@ -29,63 +29,32 @@ public class Q369_CollectorOfJewels extends Quest
{
// NPC
private static final int NELL = 30376;
-
// Items
private static final int FLARE_SHARD = 5882;
private static final int FREEZING_SHARD = 5883;
-
// Reward
private static final int ADENA = 57;
-
// Droplist
private static final Map DROPLIST = new HashMap<>();
static
{
- DROPLIST.put(20609, new int[]
- {
- FLARE_SHARD,
- 630000
- });
- DROPLIST.put(20612, new int[]
- {
- FLARE_SHARD,
- 770000
- });
- DROPLIST.put(20749, new int[]
- {
- FLARE_SHARD,
- 850000
- });
- DROPLIST.put(20616, new int[]
- {
- FREEZING_SHARD,
- 600000
- });
- DROPLIST.put(20619, new int[]
- {
- FREEZING_SHARD,
- 730000
- });
- DROPLIST.put(20747, new int[]
- {
- FREEZING_SHARD,
- 850000
- });
+ // @formatter:off
+ DROPLIST.put(20609, new int[]{FLARE_SHARD, 630000});
+ DROPLIST.put(20612, new int[]{FLARE_SHARD, 770000});
+ DROPLIST.put(20749, new int[]{FLARE_SHARD, 850000});
+ DROPLIST.put(20616, new int[]{FREEZING_SHARD, 600000});
+ DROPLIST.put(20619, new int[]{FREEZING_SHARD, 730000});
+ DROPLIST.put(20747, new int[]{FREEZING_SHARD, 850000});
+ // @formatter:on
}
public Q369_CollectorOfJewels()
{
super(369, "Collector of Jewels");
-
registerQuestItems(FLARE_SHARD, FREEZING_SHARD);
-
addStartNpc(NELL);
addTalkId(NELL);
-
- for (int mob : DROPLIST.keySet())
- {
- addKillId(mob);
- }
+ addKillId(DROPLIST.keySet());
}
@Override
@@ -98,20 +67,24 @@ public class Q369_CollectorOfJewels extends Quest
return htmltext;
}
- if (event.equals("30376-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30376-07.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30376-08.htm"))
- {
- st.exitQuest(true);
- st.playSound(QuestState.SOUND_FINISH);
+ case "30376-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30376-07.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30376-08.htm":
+ {
+ st.exitQuest(true);
+ st.playSound(QuestState.SOUND_FINISH);
+ break;
+ }
}
return htmltext;
@@ -130,11 +103,13 @@ public class Q369_CollectorOfJewels extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 25) ? "30376-01.htm" : "30376-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
final int flare = st.getQuestItemsCount(FLARE_SHARD);
final int freezing = st.getQuestItemsCount(FREEZING_SHARD);
if (cond == 1)
@@ -144,7 +119,7 @@ public class Q369_CollectorOfJewels extends Quest
else if ((cond == 2) && (flare >= 50) && (freezing >= 50))
{
htmltext = "30376-05.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FLARE_SHARD, -1);
st.takeItems(FREEZING_SHARD, -1);
@@ -164,6 +139,7 @@ public class Q369_CollectorOfJewels extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -184,18 +160,18 @@ public class Q369_CollectorOfJewels extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
final int[] drop = DROPLIST.get(npc.getNpcId());
if (cond == 1)
{
if (st.dropItems(drop[0], 1, 50, drop[1]) && (st.getQuestItemsCount((drop[0] == FLARE_SHARD) ? FREEZING_SHARD : FLARE_SHARD) >= 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
}
else if ((cond == 3) && st.dropItems(drop[0], 1, 200, drop[1]) && (st.getQuestItemsCount((drop[0] == FLARE_SHARD) ? FREEZING_SHARD : FLARE_SHARD) >= 200))
{
- st.set("cond", "4");
+ st.setCond(4);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q370_AnElderSowsSeeds/Q370_AnElderSowsSeeds.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q370_AnElderSowsSeeds/Q370_AnElderSowsSeeds.java
index ea8902cda8..2960f6b45c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q370_AnElderSowsSeeds/Q370_AnElderSowsSeeds.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q370_AnElderSowsSeeds/Q370_AnElderSowsSeeds.java
@@ -29,14 +29,12 @@ public class Q370_AnElderSowsSeeds extends Quest
{
// NPC
private static final int CASIAN = 30612;
-
// Items
private static final int SPELLBOOK_PAGE = 5916;
private static final int CHAPTER_OF_FIRE = 5917;
private static final int CHAPTER_OF_WATER = 5918;
private static final int CHAPTER_OF_WIND = 5919;
private static final int CHAPTER_OF_EARTH = 5920;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -51,12 +49,9 @@ public class Q370_AnElderSowsSeeds extends Quest
public Q370_AnElderSowsSeeds()
{
super(370, "An Elder Sows Seeds");
-
registerQuestItems(SPELLBOOK_PAGE, CHAPTER_OF_FIRE, CHAPTER_OF_WATER, CHAPTER_OF_WIND, CHAPTER_OF_EARTH);
-
addStartNpc(CASIAN);
addTalkId(CASIAN);
-
addKillId(20082, 20084, 20086, 20089, 20090);
}
@@ -70,28 +65,32 @@ public class Q370_AnElderSowsSeeds extends Quest
return htmltext;
}
- if (event.equals("30612-3.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30612-6.htm"))
- {
- if (st.hasQuestItems(CHAPTER_OF_FIRE, CHAPTER_OF_WATER, CHAPTER_OF_WIND, CHAPTER_OF_EARTH))
+ case "30612-3.htm":
{
- htmltext = "30612-8.htm";
- st.takeItems(CHAPTER_OF_FIRE, 1);
- st.takeItems(CHAPTER_OF_WATER, 1);
- st.takeItems(CHAPTER_OF_WIND, 1);
- st.takeItems(CHAPTER_OF_EARTH, 1);
- st.rewardItems(57, 3600);
+ st.startQuest();
+ break;
+ }
+ case "30612-6.htm":
+ {
+ if (st.hasQuestItems(CHAPTER_OF_FIRE, CHAPTER_OF_WATER, CHAPTER_OF_WIND, CHAPTER_OF_EARTH))
+ {
+ htmltext = "30612-8.htm";
+ st.takeItems(CHAPTER_OF_FIRE, 1);
+ st.takeItems(CHAPTER_OF_WATER, 1);
+ st.takeItems(CHAPTER_OF_WIND, 1);
+ st.takeItems(CHAPTER_OF_EARTH, 1);
+ st.rewardItems(57, 3600);
+ }
+ break;
+ }
+ case "30612-9.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30612-9.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -110,12 +109,15 @@ public class Q370_AnElderSowsSeeds extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 28) ? "30612-0a.htm" : "30612-0.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = "30612-4.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q371_ShriekOfGhosts/Q371_ShriekOfGhosts.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q371_ShriekOfGhosts/Q371_ShriekOfGhosts.java
index 12eddea0eb..b1c354d4d2 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q371_ShriekOfGhosts/Q371_ShriekOfGhosts.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q371_ShriekOfGhosts/Q371_ShriekOfGhosts.java
@@ -31,41 +31,26 @@ public class Q371_ShriekOfGhosts extends Quest
// NPCs
private static final int REVA = 30867;
private static final int PATRIN = 30929;
-
// Item
private static final int URN = 5903;
private static final int PORCELAIN = 6002;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
{
- CHANCES.put(20818, new int[]
- {
- 38,
- 43
- });
- CHANCES.put(20820, new int[]
- {
- 48,
- 56
- });
- CHANCES.put(20824, new int[]
- {
- 50,
- 58
- });
+ // @formatter:off
+ CHANCES.put(20818, new int[]{38, 43});
+ CHANCES.put(20820, new int[]{48, 56});
+ CHANCES.put(20824, new int[]{50, 58});
+ // @formatter:on
}
public Q371_ShriekOfGhosts()
{
super(371, "Shriek of Ghosts");
-
registerQuestItems(URN, PORCELAIN);
-
addStartNpc(REVA);
addTalkId(REVA, PATRIN);
-
addKillId(20818, 20820, 20824);
}
@@ -79,69 +64,74 @@ public class Q371_ShriekOfGhosts extends Quest
return htmltext;
}
- if (event.equals("30867-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30867-07.htm"))
- {
- int urns = st.getQuestItemsCount(URN);
- if (urns > 0)
+ case "30867-03.htm":
{
- st.takeItems(URN, urns);
- if (urns >= 100)
+ st.startQuest();
+ break;
+ }
+ case "30867-07.htm":
+ {
+ int urns = st.getQuestItemsCount(URN);
+ if (urns > 0)
{
- urns += 13;
- htmltext = "30867-08.htm";
+ st.takeItems(URN, urns);
+ if (urns >= 100)
+ {
+ urns += 13;
+ htmltext = "30867-08.htm";
+ }
+ else
+ {
+ urns += 7;
+ }
+ st.rewardItems(57, urns * 1000);
+ }
+ break;
+ }
+ case "30867-10.htm":
+ {
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
+ }
+ case "APPR":
+ {
+ if (st.hasQuestItems(PORCELAIN))
+ {
+ final int chance = Rnd.get(100);
+ st.takeItems(PORCELAIN, 1);
+ if (chance < 2)
+ {
+ st.giveItems(6003, 1);
+ htmltext = "30929-03.htm";
+ }
+ else if (chance < 32)
+ {
+ st.giveItems(6004, 1);
+ htmltext = "30929-04.htm";
+ }
+ else if (chance < 62)
+ {
+ st.giveItems(6005, 1);
+ htmltext = "30929-05.htm";
+ }
+ else if (chance < 77)
+ {
+ st.giveItems(6006, 1);
+ htmltext = "30929-06.htm";
+ }
+ else
+ {
+ htmltext = "30929-07.htm";
+ }
}
else
{
- urns += 7;
+ htmltext = "30929-02.htm";
}
- st.rewardItems(57, urns * 1000);
- }
- }
- else if (event.equals("30867-10.htm"))
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
- }
- else if (event.equals("APPR"))
- {
- if (st.hasQuestItems(PORCELAIN))
- {
- final int chance = Rnd.get(100);
- st.takeItems(PORCELAIN, 1);
- if (chance < 2)
- {
- st.giveItems(6003, 1);
- htmltext = "30929-03.htm";
- }
- else if (chance < 32)
- {
- st.giveItems(6004, 1);
- htmltext = "30929-04.htm";
- }
- else if (chance < 62)
- {
- st.giveItems(6005, 1);
- htmltext = "30929-05.htm";
- }
- else if (chance < 77)
- {
- st.giveItems(6006, 1);
- htmltext = "30929-06.htm";
- }
- else
- {
- htmltext = "30929-07.htm";
- }
- }
- else
- {
- htmltext = "30929-02.htm";
+ break;
}
}
@@ -161,13 +151,16 @@ public class Q371_ShriekOfGhosts extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 59) ? "30867-01.htm" : "30867-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case REVA:
+ {
if (st.hasQuestItems(URN))
{
htmltext = (st.hasQuestItems(PORCELAIN)) ? "30867-05.htm" : "30867-04.htm";
@@ -177,12 +170,15 @@ public class Q371_ShriekOfGhosts extends Quest
htmltext = "30867-06.htm";
}
break;
-
+ }
case PATRIN:
+ {
htmltext = "30929-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q372_LegacyOfInsolence/Q372_LegacyOfInsolence.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q372_LegacyOfInsolence/Q372_LegacyOfInsolence.java
index 806663138b..db91834aa2 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q372_LegacyOfInsolence/Q372_LegacyOfInsolence.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q372_LegacyOfInsolence/Q372_LegacyOfInsolence.java
@@ -31,262 +31,50 @@ public class Q372_LegacyOfInsolence extends Quest
private static final int HOLLY = 30839;
private static final int CLAUDIA = 31001;
private static final int DESMOND = 30855;
-
// Monsters
private static final int[][] MONSTERS_DROPS =
{
- { // npcId
- 20817,
- 20821,
- 20825,
- 20829,
- 21069,
- 21063
- }, // parchment (red, blue, black, white)
- {
- 5966,
- 5966,
- 5966,
- 5967,
- 5968,
- 5969
- }, // rate
- {
- 300000,
- 400000,
- 460000,
- 400000,
- 250000,
- 250000
- }
+ // @formatter:off
+ {20817, 20821, 20825, 20829, 21069, 21063}, // npcId
+ {5966, 5966, 5966, 5967, 5968, 5969}, // parchment (red, blue, black, white)
+ {300000, 400000, 460000, 400000, 250000, 250000}// rate
};
-
// Items
private static final int[][] SCROLLS =
{
- // Walderal => 13 blueprints => parts, recipes.
- {
- 5989,
- 6001
- },
- // Holly -> 5x Imperial Genealogy -> Dark Crystal parts/Adena
- {
- 5984,
- 5988
- },
- // Patrin -> 5x Ancient Epic -> Tallum parts/Adena
- {
- 5979,
- 5983
- },
- // Claudia -> 7x Revelation of the Seals -> Nightmare parts/Adena
- {
- 5972,
- 5978
- },
- // Desmond -> 7x Revelation of the Seals -> Majestic parts/Adena
- {
- 5972,
- 5978
- }
+ {5989, 6001}, // Walderal => 13 blueprints => parts, recipes.
+ {5984, 5988}, // Holly -> 5x Imperial Genealogy -> Dark Crystal parts/Adena
+ {5979, 5983}, // Patrin -> 5x Ancient Epic -> Tallum parts/Adena
+ {5972, 5978}, // Claudia -> 7x Revelation of the Seals -> Nightmare parts/Adena
+ {5972, 5978}, // Desmond -> 7x Revelation of the Seals -> Majestic parts/Adena
};
-
// Rewards matrice.
private static final int[][][] REWARDS_MATRICE =
{
// Walderal DC choice
- {
- {
- 13,
- 5496
- },
- {
- 26,
- 5508
- },
- {
- 40,
- 5525
- },
- {
- 58,
- 5368
- },
- {
- 76,
- 5392
- },
- {
- 100,
- 5426
- }
- },
+ {{13, 5496},{26, 5508},{40, 5525},{58, 5368},{76, 5392},{100, 5426}},
// Walderal Tallum choice
- {
- {
- 13,
- 5497
- },
- {
- 26,
- 5509
- },
- {
- 40,
- 5526
- },
- {
- 58,
- 5370
- },
- {
- 76,
- 5394
- },
- {
- 100,
- 5428
- }
- },
+ {{13, 5497},{26, 5509},{40, 5526},{58, 5370},{76, 5394},{100, 5428}},
// Walderal NM choice
- {
- {
- 20,
- 5502
- },
- {
- 40,
- 5514
- },
- {
- 58,
- 5527
- },
- {
- 73,
- 5380
- },
- {
- 87,
- 5404
- },
- {
- 100,
- 5430
- }
- },
+ {{20, 5502},{40, 5514},{58, 5527},{73, 5380},{87, 5404},{100, 5430}},
// Walderal Maja choice
- {
- {
- 20,
- 5503
- },
- {
- 40,
- 5515
- },
- {
- 58,
- 5528
- },
- {
- 73,
- 5382
- },
- {
- 87,
- 5406
- },
- {
- 100,
- 5432
- }
- },
+ {{20, 5503},{40, 5515},{58, 5528},{73, 5382},{87, 5406},{100, 5432}},
// Holly DC parts + adenas.
- {
- {
- 33,
- 5496
- },
- {
- 66,
- 5508
- },
- {
- 89,
- 5525
- },
- {
- 100,
- 57
- }
- },
+ {{33, 5496},{66, 5508},{89, 5525},{100, 57}},
// Patrin Tallum parts + adenas.
- {
- {
- 33,
- 5497
- },
- {
- 66,
- 5509
- },
- {
- 89,
- 5526
- },
- {
- 100,
- 57
- }
- },
+ {{33, 5497},{66, 5509},{89, 5526},{100, 57}},
// Claudia NM parts + adenas.
- {
- {
- 35,
- 5502
- },
- {
- 70,
- 5514
- },
- {
- 87,
- 5527
- },
- {
- 100,
- 57
- }
- },
+ {{35, 5502},{70, 5514},{87, 5527},{100, 57}},
// Desmond Maja choice
- {
- {
- 35,
- 5503
- },
- {
- 70,
- 5515
- },
- {
- 87,
- 5528
- },
- {
- 100,
- 57
- }
- }
+ {{35, 5503},{70, 5515},{87, 5528},{100, 57}}
+ // @formatter:on
};
public Q372_LegacyOfInsolence()
{
super(372, "Legacy of Insolence");
-
addStartNpc(WALDERAL);
addTalkId(WALDERAL, PATRIN, HOLLY, CLAUDIA, DESMOND);
-
addKillId(MONSTERS_DROPS[0]);
}
@@ -302,15 +90,13 @@ public class Q372_LegacyOfInsolence extends Quest
if (event.equals("30844-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30844-05b.htm"))
{
- if (st.getInt("cond") == 1)
+ if (st.isCond(1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -351,33 +137,42 @@ public class Q372_LegacyOfInsolence extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 59) ? "30844-01.htm" : "30844-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case WALDERAL:
+ {
htmltext = "30844-05.htm";
break;
-
+ }
case HOLLY:
+ {
htmltext = checkAndRewardItems(st, 1, 4, HOLLY);
break;
-
+ }
case PATRIN:
+ {
htmltext = checkAndRewardItems(st, 2, 5, PATRIN);
break;
-
+ }
case CLAUDIA:
+ {
htmltext = checkAndRewardItems(st, 3, 6, CLAUDIA);
break;
-
+ }
case DESMOND:
+ {
htmltext = checkAndRewardItems(st, 4, 7, DESMOND);
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q373_SupplierOfReagents/Q373_SupplierOfReagents.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q373_SupplierOfReagents/Q373_SupplierOfReagents.java
index dd93eb9f63..3935bf27a8 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q373_SupplierOfReagents/Q373_SupplierOfReagents.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q373_SupplierOfReagents/Q373_SupplierOfReagents.java
@@ -28,14 +28,9 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q373_SupplierOfReagents extends Quest
{
- // Variables
- private static final String INGREDIENT = "ingredient";
- private static final String CATALYST = "catalyst";
-
// NPCs
private static final int WESLEY = 30166;
private static final int URN = 31149;
-
// Monsters
private static final int CRENDION = 20813;
private static final int HALLATE_MAID = 20822;
@@ -44,11 +39,9 @@ public class Q373_SupplierOfReagents extends Quest
private static final int PLATINUM_GUARDIAN_SHAMAN = 21066;
private static final int LAVA_WYRM = 21111;
private static final int HAMES_ORC_SHAMAN = 21115;
-
// Quest items
private static final int MIXING_STONE = 5904;
private static final int MIXING_MANUAL = 6317;
-
// Items - pouches
private static final int REAGENT_POUCH_1 = 6007;
private static final int REAGENT_POUCH_2 = 6008;
@@ -83,6 +76,9 @@ public class Q373_SupplierOfReagents extends Quest
private static final int HELLFIRE_OIL = 6033;
private static final int NIGHTMARE_OIL = 6034;
private static final int PURE_SILVER = 6320;
+ // Variables
+ private static final String INGREDIENT = "ingredient";
+ private static final String CATALYST = "catalyst";
/**
* This droplist defines the npcId, the item dropped and the luck.
@@ -99,177 +95,51 @@ public class Q373_SupplierOfReagents extends Quest
private static final Map DROPLIST = new HashMap<>();
static
{
- DROPLIST.put(PLATINUM_GUARDIAN_SHAMAN, new int[]
- {
- REAGENT_BOX,
- 442000,
- 0
- });
- DROPLIST.put(HAMES_ORC_SHAMAN, new int[]
- {
- REAGENT_POUCH_3,
- 470000,
- 0
- });
- DROPLIST.put(PLATINUM_TRIBE_SHAMAN, new int[]
- {
- REAGENT_POUCH_2,
- QUICKSILVER,
- 680,
- 1000
- });
- DROPLIST.put(HALLATE_MAID, new int[]
- {
- REAGENT_POUCH_1,
- VOLCANIC_ASH,
- 664,
- 844
- });
- DROPLIST.put(HALLATE_GUARDIAN, new int[]
- {
- DEMONS_BLOOD,
- MOONSTONE_SHARD,
- 729,
- 833
- });
- DROPLIST.put(CRENDION, new int[]
- {
- ROTTEN_BONE,
- QUICKSILVER,
- 618,
- 1000
- });
- DROPLIST.put(LAVA_WYRM, new int[]
- {
- WYRMS_BLOOD,
- LAVA_STONE,
- 505,
- 750
- });
+ // @formatter:off
+ DROPLIST.put(PLATINUM_GUARDIAN_SHAMAN, new int[]{REAGENT_BOX, 442000, 0});
+ DROPLIST.put(HAMES_ORC_SHAMAN, new int[]{REAGENT_POUCH_3, 470000, 0});
+ DROPLIST.put(PLATINUM_TRIBE_SHAMAN, new int[]{REAGENT_POUCH_2, QUICKSILVER, 680, 1000});
+ DROPLIST.put(HALLATE_MAID, new int[]{REAGENT_POUCH_1, VOLCANIC_ASH, 664, 844});
+ DROPLIST.put(HALLATE_GUARDIAN, new int[]{DEMONS_BLOOD, MOONSTONE_SHARD, 729, 833});
+ DROPLIST.put(CRENDION, new int[]{ROTTEN_BONE, QUICKSILVER, 618, 1000});
+ DROPLIST.put(LAVA_WYRM, new int[]{WYRMS_BLOOD, LAVA_STONE, 505, 750});
+ // @formatter:n
}
-
private static final int[][] FORMULAS =
{
- {
- 10,
- WYRMS_BLOOD,
- BLOOD_ROOT,
- DRACOPLASM
- },
- {
- 10,
- LAVA_STONE,
- VOLCANIC_ASH,
- MAGMA_DUST
- },
- {
- 10,
- MOONSTONE_SHARD,
- VOLCANIC_ASH,
- MOON_DUST
- },
- {
- 10,
- ROTTEN_BONE,
- BLOOD_ROOT,
- NECROPLASM
- },
- {
- 10,
- DEMONS_BLOOD,
- BLOOD_ROOT,
- DEMONPLASM
- },
- {
- 10,
- INFERNIUM_ORE,
- VOLCANIC_ASH,
- INFERNO_DUST
- },
- {
- 10,
- DRACOPLASM,
- QUICKSILVER,
- DRACONIC_ESSENCE
- },
- {
- 10,
- MAGMA_DUST,
- SULFUR,
- FIRE_ESSENCE
- },
- {
- 10,
- MOON_DUST,
- QUICKSILVER,
- LUNARGENT
- },
- {
- 10,
- NECROPLASM,
- QUICKSILVER,
- MIDNIGHT_OIL
- },
- {
- 10,
- DEMONPLASM,
- SULFUR,
- DEMONIC_ESSENCE
- },
- {
- 10,
- INFERNO_DUST,
- SULFUR,
- ABYSS_OIL
- },
- {
- 1,
- FIRE_ESSENCE,
- DEMONIC_ESSENCE,
- HELLFIRE_OIL
- },
- {
- 1,
- LUNARGENT,
- MIDNIGHT_OIL,
- NIGHTMARE_OIL
- },
- {
- 1,
- LUNARGENT,
- QUICKSILVER,
- PURE_SILVER
- }
+ // @formatter:off
+ {10, WYRMS_BLOOD, BLOOD_ROOT, DRACOPLASM},
+ {10, LAVA_STONE, VOLCANIC_ASH, MAGMA_DUST},
+ {10, MOONSTONE_SHARD, VOLCANIC_ASH, MOON_DUST},
+ {10, ROTTEN_BONE, BLOOD_ROOT, NECROPLASM},
+ {10, DEMONS_BLOOD, BLOOD_ROOT, DEMONPLASM},
+ {10, INFERNIUM_ORE, VOLCANIC_ASH, INFERNO_DUST},
+ {10, DRACOPLASM, QUICKSILVER, DRACONIC_ESSENCE},
+ {10, MAGMA_DUST, SULFUR, FIRE_ESSENCE},
+ {10, MOON_DUST, QUICKSILVER, LUNARGENT},
+ {10, NECROPLASM, QUICKSILVER, MIDNIGHT_OIL},
+ {10, DEMONPLASM, SULFUR, DEMONIC_ESSENCE},
+ {10, INFERNO_DUST, SULFUR, ABYSS_OIL},
+ {1, FIRE_ESSENCE, DEMONIC_ESSENCE, HELLFIRE_OIL},
+ {1, LUNARGENT, MIDNIGHT_OIL, NIGHTMARE_OIL},
+ {1, LUNARGENT, QUICKSILVER, PURE_SILVER}
+ // @formatter:on
};
-
private static final int[][] TEMPERATURES =
{
- {
- 1,
- 100,
- 1
- },
- {
- 2,
- 45,
- 3
- },
- {
- 3,
- 15,
- 5
- }
+ // @formatter:off
+ {1, 100, 1},
+ {2, 45, 3},
+ {3, 15, 5}
+ // @formatter:on
};
public Q373_SupplierOfReagents()
{
super(373, "Supplier of Reagents");
-
registerQuestItems(MIXING_STONE, MIXING_MANUAL);
-
addStartNpc(WESLEY);
addTalkId(WESLEY, URN);
-
addKillId(CRENDION, HALLATE_MAID, HALLATE_GUARDIAN, PLATINUM_TRIBE_SHAMAN, PLATINUM_GUARDIAN_SHAMAN, LAVA_WYRM, HAMES_ORC_SHAMAN);
}
@@ -286,10 +156,7 @@ public class Q373_SupplierOfReagents extends Quest
// Wesley
if (event.equals("30166-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
+ st.startQuest();
st.giveItems(MIXING_STONE, 1);
st.giveItems(MIXING_MANUAL, 1);
}
@@ -399,10 +266,12 @@ public class Q373_SupplierOfReagents extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 57) ? "30166-01.htm" : "30166-02.htm";
break;
-
+ }
case State.STARTED:
+ {
if (npc.getNpcId() == WESLEY)
{
htmltext = "30166-05.htm";
@@ -412,6 +281,7 @@ public class Q373_SupplierOfReagents extends Quest
htmltext = "31149-01.htm";
}
break;
+ }
}
return htmltext;
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q374_WhisperOfDreams_Part1/Q374_WhisperOfDreams_Part1.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q374_WhisperOfDreams_Part1/Q374_WhisperOfDreams_Part1.java
index f1287f3afa..b8fec818b2 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q374_WhisperOfDreams_Part1/Q374_WhisperOfDreams_Part1.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q374_WhisperOfDreams_Part1/Q374_WhisperOfDreams_Part1.java
@@ -27,57 +27,32 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
// NPCs
private static final int MANAKIA = 30515;
private static final int TORAI = 30557;
-
// Monsters
private static final int CAVE_BEAST = 20620;
private static final int DEATH_WAVE = 20621;
-
// Items
private static final int CAVE_BEAST_TOOTH = 5884;
private static final int DEATH_WAVE_LIGHT = 5885;
private static final int SEALED_MYSTERIOUS_STONE = 5886;
private static final int MYSTERIOUS_STONE = 5887;
-
// Rewards
private static final int[][] REWARDS =
{
- {
- 5486,
- 3,
- 2950
- }, // Dark Crystal, 3x, 2950 adena
- {
- 5487,
- 2,
- 18050
- }, // Nightmare, 2x, 18050 adena
- {
- 5488,
- 2,
- 18050
- }, // Majestic, 2x, 18050 adena
- {
- 5485,
- 4,
- 10450
- }, // Tallum Tunic, 4, 10450 adena
- {
- 5489,
- 6,
- 15550
- }
- // Tallum Stockings, 6, 15550 adena
+ // @formatter:off
+ {5486, 3, 2950}, // Dark Crystal, 3x, 2950 adena
+ {5487, 2, 18050}, // Nightmare, 2x, 18050 adena
+ {5488, 2, 18050}, // Majestic, 2x, 18050 adena
+ {5485, 4, 10450}, // Tallum Tunic, 4, 10450 adena
+ {5489, 6, 15550}, // Tallum Stockings, 6, 15550 adena
+ // @formatter:on
};
public Q374_WhisperOfDreams_Part1()
{
super(374, "Whisper of Dreams, Part 1");
-
registerQuestItems(DEATH_WAVE_LIGHT, CAVE_BEAST_TOOTH, SEALED_MYSTERIOUS_STONE, MYSTERIOUS_STONE);
-
addStartNpc(MANAKIA);
addTalkId(MANAKIA, TORAI);
-
addKillId(CAVE_BEAST, DEATH_WAVE);
}
@@ -94,10 +69,8 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
// Manakia
if (event.equals("30515-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
+ st.startQuest();
st.set("condStone", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
}
else if (event.startsWith("30515-06-"))
{
@@ -127,9 +100,9 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
// Torai
else if (event.equals("30557-02.htm"))
{
- if ((st.getInt("cond") == 2) && st.hasQuestItems(SEALED_MYSTERIOUS_STONE))
+ if (st.isCond(2) && st.hasQuestItems(SEALED_MYSTERIOUS_STONE))
{
- st.set("cond", "3");
+ st.setCond(3);
st.takeItems(SEALED_MYSTERIOUS_STONE, -1);
st.giveItems(MYSTERIOUS_STONE, 1);
st.playSound(QuestState.SOUND_MIDDLE);
@@ -155,14 +128,17 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 56) ? "30515-01.htm" : "30515-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MANAKIA:
+ {
if (!(st.hasQuestItems(SEALED_MYSTERIOUS_STONE)))
{
if ((st.getQuestItemsCount(CAVE_BEAST_TOOTH) >= 65) && (st.getQuestItemsCount(DEATH_WAVE_LIGHT) >= 65))
@@ -179,7 +155,7 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
if (cond == 1)
{
htmltext = "30515-09.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -188,15 +164,18 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
}
}
break;
-
+ }
case TORAI:
+ {
if ((cond == 2) && st.hasQuestItems(SEALED_MYSTERIOUS_STONE))
{
htmltext = "30557-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -221,7 +200,7 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
st.dropItems((npc.getNpcId() == CAVE_BEAST) ? CAVE_BEAST_TOOTH : DEATH_WAVE_LIGHT, 1, 65, 500000);
// Drop sealed mysterious stone to party member who still need it.
- partyMember = getRandomPartyMember(player, npc, "condStone", "1");
+ partyMember = getRandomPartyMember(player, "condStone", "1");
if (partyMember == null)
{
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q375_WhisperOfDreams_Part2/Q375_WhisperOfDreams_Part2.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q375_WhisperOfDreams_Part2/Q375_WhisperOfDreams_Part2.java
index 38ebc1a527..5aaabdafc6 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q375_WhisperOfDreams_Part2/Q375_WhisperOfDreams_Part2.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q375_WhisperOfDreams_Part2/Q375_WhisperOfDreams_Part2.java
@@ -27,16 +27,13 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
{
// NPCs
private static final int MANAKIA = 30515;
-
// Monsters
private static final int KARIK = 20629;
private static final int CAVE_HOWLER = 20624;
-
// Items
private static final int MYSTERIOUS_STONE = 5887;
private static final int KARIK_HORN = 5888;
private static final int CAVE_HOWLER_SKULL = 5889;
-
// Rewards : A grade robe recipes
private static final int[] REWARDS =
{
@@ -48,12 +45,9 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
public Q375_WhisperOfDreams_Part2()
{
super(375, "Whisper of Dreams, Part 2");
-
registerQuestItems(KARIK_HORN, CAVE_HOWLER_SKULL);
-
addStartNpc(MANAKIA);
addTalkId(MANAKIA);
-
addKillId(KARIK, CAVE_HOWLER);
}
@@ -70,9 +64,7 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
// Manakia
if (event.equals("30515-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.takeItems(MYSTERIOUS_STONE, 1);
}
else if (event.equals("30515-07.htm"))
@@ -97,10 +89,12 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (!st.hasQuestItems(MYSTERIOUS_STONE) || (player.getLevel() < 60)) ? "30515-01.htm" : "30515-02.htm";
break;
-
+ }
case State.STARTED:
+ {
if ((st.getQuestItemsCount(KARIK_HORN) >= 100) && (st.getQuestItemsCount(CAVE_HOWLER_SKULL) >= 100))
{
htmltext = "30515-05.htm";
@@ -114,6 +108,7 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
htmltext = "30515-04.htm";
}
break;
+ }
}
return htmltext;
}
@@ -137,12 +132,15 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
switch (npc.getNpcId())
{
case KARIK:
+ {
st.dropItemsAlways(KARIK_HORN, 1, 100);
break;
-
+ }
case CAVE_HOWLER:
+ {
st.dropItems(CAVE_HOWLER_SKULL, 1, 100, 900000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q376_ExplorationOfTheGiantsCave_Part1/Q376_ExplorationOfTheGiantsCave_Part1.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q376_ExplorationOfTheGiantsCave_Part1/Q376_ExplorationOfTheGiantsCave_Part1.java
index 619c8d9810..76007b0853 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q376_ExplorationOfTheGiantsCave_Part1/Q376_ExplorationOfTheGiantsCave_Part1.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q376_ExplorationOfTheGiantsCave_Part1/Q376_ExplorationOfTheGiantsCave_Part1.java
@@ -36,74 +36,38 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
private static final int DICTIONARY_INTERMEDIATE = 5892;
private static final int[][] BOOKS =
{
+ // @formatter:off
// medical theory -> tallum tunic, tallum stockings
- {
- 5937,
- 5938,
- 5939,
- 5940,
- 5941
- },
+ {5937, 5938, 5939, 5940, 5941},
// architecture -> dark crystal leather, tallum leather
- {
- 5932,
- 5933,
- 5934,
- 5935,
- 5936
- },
+ {5932, 5933, 5934, 5935, 5936},
// golem plans -> dark crystal breastplate, tallum plate
- {
- 5922,
- 5923,
- 5924,
- 5925,
- 5926
- },
+ {5922, 5923, 5924, 5925, 5926},
// basics of magic -> dark crystal gaiters, dark crystal leggings
- {
- 5927,
- 5928,
- 5929,
- 5930,
- 5931
- }
+ {5927, 5928, 5929, 5930, 5931}
+ // @formatter:on
};
-
// Rewards
private static final int[][] RECIPES =
{
+ // @formatter:off
// medical theory -> tallum tunic, tallum stockings
- {
- 5346,
- 5354
- },
+ {5346, 5354},
// architecture -> dark crystal leather, tallum leather
- {
- 5332,
- 5334
- },
+ {5332, 5334},
// golem plans -> dark crystal breastplate, tallum plate
- {
- 5416,
- 5418
- },
+ {5416, 5418},
// basics of magic -> dark crystal gaiters, dark crystal leggings
- {
- 5424,
- 5340
- }
+ {5424, 5340}
+ // @formatter:on
};
public Q376_ExplorationOfTheGiantsCave_Part1()
{
super(376, "Exploration of the Giants' Cave, Part 1");
-
registerQuestItems(DICTIONARY_BASIC, MYSTERIOUS_BOOK);
-
addStartNpc(SOBLING);
addTalkId(SOBLING, CLIFF);
-
addKillId(20647, 20648, 20649, 20650);
}
@@ -117,31 +81,34 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
return htmltext;
}
- // Sobling
- if (event.equals("31147-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("condBook", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(DICTIONARY_BASIC, 1);
- }
- else if (event.equals("31147-04.htm"))
- {
- htmltext = checkItems(st);
- }
- else if (event.equals("31147-09.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- // Cliff
- else if (event.equals("30182-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MYSTERIOUS_BOOK, -1);
- st.giveItems(DICTIONARY_INTERMEDIATE, 1);
+ case "31147-03.htm":
+ {
+ st.startQuest();
+ st.set("condBook", "1");
+ st.giveItems(DICTIONARY_BASIC, 1);
+ break;
+ }
+ case "31147-04.htm":
+ {
+ htmltext = checkItems(st);
+ break;
+ }
+ case "31147-09.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30182-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MYSTERIOUS_BOOK, -1);
+ st.giveItems(DICTIONARY_INTERMEDIATE, 1);
+ break;
+ }
}
return htmltext;
@@ -160,18 +127,22 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 51) ? "31147-01.htm" : "31147-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SOBLING:
+ {
htmltext = checkItems(st);
break;
-
+ }
case CLIFF:
+ {
if ((cond == 2) && st.hasQuestItems(MYSTERIOUS_BOOK))
{
htmltext = "30182-01.htm";
@@ -181,8 +152,10 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
htmltext = "30182-03.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -207,7 +180,7 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
st.dropItems(PARCHMENT, 1, 0, 20000);
// Drop mysterious book to person who still need it
- partyMember = getRandomPartyMember(player, npc, "condBook", "1");
+ partyMember = getRandomPartyMember(player, "condBook", "1");
if (partyMember == null)
{
return null;
@@ -231,10 +204,10 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
{
if (st.hasQuestItems(MYSTERIOUS_BOOK))
{
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond == 1)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
return "31147-07.htm";
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q377_ExplorationOfTheGiantsCave_Part2/Q377_ExplorationOfTheGiantsCave_Part2.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q377_ExplorationOfTheGiantsCave_Part2/Q377_ExplorationOfTheGiantsCave_Part2.java
index f236c0c8a5..19773e8d4a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q377_ExplorationOfTheGiantsCave_Part2/Q377_ExplorationOfTheGiantsCave_Part2.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q377_ExplorationOfTheGiantsCave_Part2/Q377_ExplorationOfTheGiantsCave_Part2.java
@@ -28,49 +28,31 @@ public class Q377_ExplorationOfTheGiantsCave_Part2 extends Quest
// Items
private static final int ANCIENT_BOOK = 5955;
private static final int DICTIONARY_INTERMEDIATE = 5892;
-
private static final int[][] BOOKS =
{
+ // @formatter:off
// science & technology -> majestic leather, leather armor of nightmare
- {
- 5945,
- 5946,
- 5947,
- 5948,
- 5949
- },
+ {5945, 5946, 5947, 5948, 5949},
// culture -> armor of nightmare, majestic plate
- {
- 5950,
- 5951,
- 5952,
- 5953,
- 5954
- }
+ {5950, 5951, 5952, 5953, 5954}
+ // @formatter:on
};
-
// Rewards
private static final int[][] RECIPES =
{
+ // @formatter:off
// science & technology -> majestic leather, leather armor of nightmare
- {
- 5338,
- 5336
- },
+ {5338, 5336},
// culture -> armor of nightmare, majestic plate
- {
- 5420,
- 5422
- }
+ {5420, 5422}
+ // @formatter:on
};
public Q377_ExplorationOfTheGiantsCave_Part2()
{
super(377, "Exploration of Giants Cave, Part 2");
-
addStartNpc(31147); // Sobling
addTalkId(31147);
-
addKillId(20654, 20656, 20657, 20658);
}
@@ -84,20 +66,24 @@ public class Q377_ExplorationOfTheGiantsCave_Part2 extends Quest
return htmltext;
}
- if (event.equals("31147-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31147-04.htm"))
- {
- htmltext = checkItems(st);
- }
- else if (event.equals("31147-07.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ case "31147-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31147-04.htm":
+ {
+ htmltext = checkItems(st);
+ break;
+ }
+ case "31147-07.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
}
return htmltext;
@@ -116,12 +102,15 @@ public class Q377_ExplorationOfTheGiantsCave_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() < 57) || !st.hasQuestItems(DICTIONARY_INTERMEDIATE)) ? "31147-01.htm" : "31147-02.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = checkItems(st);
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q378_MagnificentFeast/Q378_MagnificentFeast.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q378_MagnificentFeast/Q378_MagnificentFeast.java
index 900602a615..ca9a2715b1 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q378_MagnificentFeast/Q378_MagnificentFeast.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q378_MagnificentFeast/Q378_MagnificentFeast.java
@@ -29,7 +29,6 @@ public class Q378_MagnificentFeast extends Quest
{
// NPC
private static final int RANSPO = 30594;
-
// Items
private static final int WINE_15 = 5956;
private static final int WINE_30 = 5957;
@@ -39,71 +38,26 @@ public class Q378_MagnificentFeast extends Quest
private static final int SAUCE_RECIPE = 1456;
private static final int STEAK_RECIPE = 1457;
private static final int RITRON_DESSERT = 5959;
-
// Rewards
private static final Map REWARDS = new HashMap<>();
static
{
- REWARDS.put("9", new int[]
- {
- 847,
- 1,
- 5700
- });
- REWARDS.put("10", new int[]
- {
- 846,
- 2,
- 0
- });
- REWARDS.put("12", new int[]
- {
- 909,
- 1,
- 25400
- });
- REWARDS.put("17", new int[]
- {
- 846,
- 2,
- 1200
- });
- REWARDS.put("18", new int[]
- {
- 879,
- 1,
- 6900
- });
- REWARDS.put("20", new int[]
- {
- 890,
- 2,
- 8500
- });
- REWARDS.put("33", new int[]
- {
- 879,
- 1,
- 8100
- });
- REWARDS.put("34", new int[]
- {
- 910,
- 1,
- 0
- });
- REWARDS.put("36", new int[]
- {
- 848,
- 1,
- 2200
- });
+ // @formatter:off
+ REWARDS.put("9", new int[]{847, 1, 5700});
+ REWARDS.put("10", new int[]{846, 2, 0});
+ REWARDS.put("12", new int[]{909, 1, 25400});
+ REWARDS.put("17", new int[]{846, 2, 1200});
+ REWARDS.put("18", new int[]{879, 1, 6900});
+ REWARDS.put("20", new int[]{890, 2, 8500});
+ REWARDS.put("33", new int[]{879, 1, 8100});
+ REWARDS.put("34", new int[]{910, 1, 0});
+ REWARDS.put("36", new int[]{848, 1, 2200});
+ // @formatter:on
}
public Q378_MagnificentFeast()
{
super(378, "Magnificent Feast");
-
addStartNpc(RANSPO);
addTalkId(RANSPO);
}
@@ -118,75 +72,78 @@ public class Q378_MagnificentFeast extends Quest
return htmltext;
}
- if (event.equals("30594-2.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30594-4a.htm"))
- {
- if (st.hasQuestItems(WINE_15))
+ case "30594-2.htm":
{
- st.set("cond", "2");
- st.set("score", "1");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WINE_15, 1);
+ st.startQuest();
+ break;
}
- else
+ case "30594-4a.htm":
{
- htmltext = "30594-4.htm";
+ if (st.hasQuestItems(WINE_15))
+ {
+ st.setCond(2);
+ st.set("score", "1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WINE_15, 1);
+ }
+ else
+ {
+ htmltext = "30594-4.htm";
+ }
+ break;
}
- }
- else if (event.equals("30594-4b.htm"))
- {
- if (st.hasQuestItems(WINE_30))
+ case "30594-4b.htm":
{
- st.set("cond", "2");
- st.set("score", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WINE_30, 1);
+ if (st.hasQuestItems(WINE_30))
+ {
+ st.setCond(2);
+ st.set("score", "2");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WINE_30, 1);
+ }
+ else
+ {
+ htmltext = "30594-4.htm";
+ }
+ break;
}
- else
+ case "30594-4c.htm":
{
- htmltext = "30594-4.htm";
+ if (st.hasQuestItems(WINE_60))
+ {
+ st.setCond(2);
+ st.set("score", "4");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WINE_60, 1);
+ }
+ else
+ {
+ htmltext = "30594-4.htm";
+ }
+ break;
}
- }
- else if (event.equals("30594-4c.htm"))
- {
- if (st.hasQuestItems(WINE_60))
+ case "30594-6.htm":
{
- st.set("cond", "2");
- st.set("score", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WINE_60, 1);
+ if (st.hasQuestItems(MUSICAL_SCORE))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MUSICAL_SCORE, 1);
+ }
+ else
+ {
+ htmltext = "30594-5.htm";
+ }
+ break;
}
- else
- {
- htmltext = "30594-4.htm";
- }
- }
- else if (event.equals("30594-6.htm"))
- {
- if (st.hasQuestItems(MUSICAL_SCORE))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MUSICAL_SCORE, 1);
- }
- else
- {
- htmltext = "30594-5.htm";
- }
- }
- else
- {
- final int score = st.getInt("score");
- if (event.equals("30594-8a.htm"))
+ case "30594-8a.htm":
{
if (st.hasQuestItems(SALAD_RECIPE))
{
- st.set("cond", "4");
+ st.setCond(4);
+ final int score = st.getInt("score");
st.set("score", String.valueOf(score + 8));
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SALAD_RECIPE, 1);
@@ -195,12 +152,14 @@ public class Q378_MagnificentFeast extends Quest
{
htmltext = "30594-8.htm";
}
+ break;
}
- else if (event.equals("30594-8b.htm"))
+ case "30594-8b.htm":
{
if (st.hasQuestItems(SAUCE_RECIPE))
{
- st.set("cond", "4");
+ st.setCond(4);
+ final int score = st.getInt("score");
st.set("score", String.valueOf(score + 16));
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SAUCE_RECIPE, 1);
@@ -209,12 +168,14 @@ public class Q378_MagnificentFeast extends Quest
{
htmltext = "30594-8.htm";
}
+ break;
}
- else if (event.equals("30594-8c.htm"))
+ case "30594-8c.htm":
{
if (st.hasQuestItems(STEAK_RECIPE))
{
- st.set("cond", "4");
+ st.setCond(4);
+ final int score = st.getInt("score");
st.set("score", String.valueOf(score + 32));
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(STEAK_RECIPE, 1);
@@ -223,6 +184,7 @@ public class Q378_MagnificentFeast extends Quest
{
htmltext = "30594-8.htm";
}
+ break;
}
}
@@ -242,11 +204,13 @@ public class Q378_MagnificentFeast extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "30594-0.htm" : "30594-1.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30594-3.htm";
@@ -283,6 +247,8 @@ public class Q378_MagnificentFeast extends Quest
htmltext = "30594-9.htm";
}
}
+ break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q379_FantasyWine/Q379_FantasyWine.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q379_FantasyWine/Q379_FantasyWine.java
index 6d89ca2d77..e52faf5046 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q379_FantasyWine/Q379_FantasyWine.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q379_FantasyWine/Q379_FantasyWine.java
@@ -27,11 +27,9 @@ public class Q379_FantasyWine extends Quest
{
// NPCs
private static final int HARLAN = 30074;
-
// Monsters
private static final int ENKU_CHAMPION = 20291;
private static final int ENKU_SHAMAN = 20292;
-
// Items
private static final int LEAF = 5893;
private static final int STONE = 5894;
@@ -39,12 +37,9 @@ public class Q379_FantasyWine extends Quest
public Q379_FantasyWine()
{
super(379, "Fantasy Wine");
-
registerQuestItems(LEAF, STONE);
-
addStartNpc(HARLAN);
addTalkId(HARLAN);
-
addKillId(ENKU_CHAMPION, ENKU_SHAMAN);
}
@@ -58,40 +53,42 @@ public class Q379_FantasyWine extends Quest
return htmltext;
}
- if (event.equals("30074-3.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30074-6.htm"))
- {
- st.takeItems(LEAF, 80);
- st.takeItems(STONE, 100);
-
- final int rand = Rnd.get(10);
- if (rand < 3)
+ case "30074-3.htm":
{
- htmltext = "30074-6.htm";
- st.giveItems(5956, 1);
+ st.startQuest();
+ break;
}
- else if (rand < 9)
+ case "30074-6.htm":
{
- htmltext = "30074-7.htm";
- st.giveItems(5957, 1);
+ st.takeItems(LEAF, 80);
+ st.takeItems(STONE, 100);
+ final int rand = Rnd.get(10);
+ if (rand < 3)
+ {
+ htmltext = "30074-6.htm";
+ st.giveItems(5956, 1);
+ }
+ else if (rand < 9)
+ {
+ htmltext = "30074-7.htm";
+ st.giveItems(5957, 1);
+ }
+ else
+ {
+ htmltext = "30074-8.htm";
+ st.giveItems(5958, 1);
+ }
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- else
+ case "30074-2a.htm":
{
- htmltext = "30074-8.htm";
- st.giveItems(5958, 1);
+ st.exitQuest(true);
+ break;
}
-
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30074-2a.htm"))
- {
- st.exitQuest(true);
}
return htmltext;
@@ -110,10 +107,12 @@ public class Q379_FantasyWine extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "30074-0a.htm" : "30074-0.htm";
break;
-
+ }
case State.STARTED:
+ {
final int leaf = st.getQuestItemsCount(LEAF);
final int stone = st.getQuestItemsCount(STONE);
if ((leaf == 80) && (stone == 100))
@@ -133,6 +132,7 @@ public class Q379_FantasyWine extends Quest
htmltext = "30074-4.htm";
}
break;
+ }
}
return htmltext;
@@ -151,12 +151,12 @@ public class Q379_FantasyWine extends Quest
{
if (st.dropItemsAlways(LEAF, 1, 80) && (st.getQuestItemsCount(STONE) >= 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
}
else if (st.dropItemsAlways(STONE, 1, 100) && (st.getQuestItemsCount(LEAF) >= 80))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q380_BringOutTheFlavorOfIngredients/Q380_BringOutTheFlavorOfIngredients.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q380_BringOutTheFlavorOfIngredients/Q380_BringOutTheFlavorOfIngredients.java
index 85788c7ac7..9869c9e4a2 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q380_BringOutTheFlavorOfIngredients/Q380_BringOutTheFlavorOfIngredients.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q380_BringOutTheFlavorOfIngredients/Q380_BringOutTheFlavorOfIngredients.java
@@ -29,13 +29,11 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
private static final int DIRE_WOLF = 20205;
private static final int KADIF_WEREWOLF = 20206;
private static final int GIANT_MIST_LEECH = 20225;
-
// Items
private static final int RITRON_FRUIT = 5895;
private static final int MOON_FACE_FLOWER = 5896;
private static final int LEECH_FLUIDS = 5897;
private static final int ANTIDOTE = 1831;
-
// Rewards
private static final int RITRON_JELLY = 5960;
private static final int JELLY_RECIPE = 5959;
@@ -43,12 +41,9 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
public Q380_BringOutTheFlavorOfIngredients()
{
super(380, "Bring Out the Flavor of Ingredients!");
-
registerQuestItems(RITRON_FRUIT, MOON_FACE_FLOWER, LEECH_FLUIDS);
-
addStartNpc(30069); // Rollant
addTalkId(30069);
-
addKillId(DIRE_WOLF, KADIF_WEREWOLF, GIANT_MIST_LEECH);
}
@@ -64,9 +59,7 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
if (event.equals("30069-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30069-12.htm"))
{
@@ -91,11 +84,13 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 24) ? "30069-00.htm" : "30069-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30069-06.htm";
@@ -105,7 +100,7 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
if (st.getQuestItemsCount(ANTIDOTE) >= 2)
{
htmltext = "30069-07.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RITRON_FRUIT, -1);
st.takeItems(MOON_FACE_FLOWER, -1);
@@ -120,19 +115,19 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
else if (cond == 3)
{
htmltext = "30069-08.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 4)
{
htmltext = "30069-09.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
{
htmltext = "30069-10.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 6)
@@ -150,6 +145,7 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
}
}
break;
+ }
}
return htmltext;
@@ -158,7 +154,7 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -169,21 +165,21 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
case DIRE_WOLF:
if (st.dropItems(RITRON_FRUIT, 1, 4, 100000) && (st.getQuestItemsCount(MOON_FACE_FLOWER) == 20) && (st.getQuestItemsCount(LEECH_FLUIDS) == 10))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
case KADIF_WEREWOLF:
if (st.dropItems(MOON_FACE_FLOWER, 1, 20, 500000) && (st.getQuestItemsCount(RITRON_FRUIT) == 4) && (st.getQuestItemsCount(LEECH_FLUIDS) == 10))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
case GIANT_MIST_LEECH:
if (st.dropItems(LEECH_FLUIDS, 1, 10, 500000) && (st.getQuestItemsCount(RITRON_FRUIT) == 4) && (st.getQuestItemsCount(MOON_FACE_FLOWER) == 20))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q381_LetsBecomeARoyalMember/Q381_LetsBecomeARoyalMember.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q381_LetsBecomeARoyalMember/Q381_LetsBecomeARoyalMember.java
index 301e32e615..afbe457bf1 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q381_LetsBecomeARoyalMember/Q381_LetsBecomeARoyalMember.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q381_LetsBecomeARoyalMember/Q381_LetsBecomeARoyalMember.java
@@ -27,25 +27,20 @@ public class Q381_LetsBecomeARoyalMember extends Quest
// NPCs
private static final int SORINT = 30232;
private static final int SANDRA = 30090;
-
// Items
private static final int KAIL_COIN = 5899;
private static final int COIN_ALBUM = 5900;
private static final int GOLDEN_CLOVER_COIN = 7569;
private static final int COIN_COLLECTOR_MEMBERSHIP = 3813;
-
// Reward
private static final int ROYAL_MEMBERSHIP = 5898;
public Q381_LetsBecomeARoyalMember()
{
super(381, "Let's Become a Royal Member!");
-
registerQuestItems(KAIL_COIN, GOLDEN_CLOVER_COIN);
-
addStartNpc(SORINT);
addTalkId(SORINT, SANDRA);
-
addKillId(21018, 27316);
}
@@ -65,9 +60,7 @@ public class Q381_LetsBecomeARoyalMember extends Quest
}
else if (event.equals("30232-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -86,13 +79,16 @@ public class Q381_LetsBecomeARoyalMember extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() < 55) || !st.hasQuestItems(COIN_COLLECTOR_MEMBERSHIP)) ? "30232-02.htm" : "30232-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case SORINT:
+ {
if (!st.hasQuestItems(KAIL_COIN))
{
htmltext = "30232-04.htm";
@@ -111,8 +107,9 @@ public class Q381_LetsBecomeARoyalMember extends Quest
st.exitQuest(true);
}
break;
-
+ }
case SANDRA:
+ {
if (!st.hasQuestItems(COIN_ALBUM))
{
if (st.getInt("aCond") == 0)
@@ -138,8 +135,10 @@ public class Q381_LetsBecomeARoyalMember extends Quest
htmltext = "30090-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q382_KailsMagicCoin/Q382_KailsMagicCoin.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q382_KailsMagicCoin/Q382_KailsMagicCoin.java
index 8679cb4eb7..1aad918bca 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q382_KailsMagicCoin/Q382_KailsMagicCoin.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q382_KailsMagicCoin/Q382_KailsMagicCoin.java
@@ -30,7 +30,6 @@ public class Q382_KailsMagicCoin extends Quest
private static final int FALLEN_ORC_ARCHER = 21019;
private static final int FALLEN_ORC_SHAMAN = 21020;
private static final int FALLEN_ORC_CAPTAIN = 21022;
-
// Items
private static final int ROYAL_MEMBERSHIP = 5898;
private static final int SILVER_BASILISK = 5961;
@@ -40,12 +39,9 @@ public class Q382_KailsMagicCoin extends Quest
public Q382_KailsMagicCoin()
{
super(382, "Kail's Magic Coin");
-
registerQuestItems(SILVER_BASILISK, GOLD_GOLEM, BLOOD_DRAGON);
-
addStartNpc(30687); // Vergara
addTalkId(30687);
-
addKillId(FALLEN_ORC, FALLEN_ORC_ARCHER, FALLEN_ORC_SHAMAN, FALLEN_ORC_CAPTAIN);
}
@@ -61,9 +57,7 @@ public class Q382_KailsMagicCoin extends Quest
if (event.equals("30687-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -82,12 +76,15 @@ public class Q382_KailsMagicCoin extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() < 55) || !st.hasQuestItems(ROYAL_MEMBERSHIP)) ? "30687-01.htm" : "30687-02.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = "30687-04.htm";
break;
+ }
}
return htmltext;
@@ -96,7 +93,7 @@ public class Q382_KailsMagicCoin extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -105,20 +102,25 @@ public class Q382_KailsMagicCoin extends Quest
switch (npc.getNpcId())
{
case FALLEN_ORC:
+ {
st.dropItems(SILVER_BASILISK, 1, 0, 100000);
break;
-
+ }
case FALLEN_ORC_ARCHER:
+ {
st.dropItems(GOLD_GOLEM, 1, 0, 100000);
break;
-
+ }
case FALLEN_ORC_SHAMAN:
+ {
st.dropItems(BLOOD_DRAGON, 1, 0, 100000);
break;
-
+ }
case FALLEN_ORC_CAPTAIN:
+ {
st.dropItems(5961 + Rnd.get(3), 1, 0, 100000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q383_SearchingForTreasure/Q383_SearchingForTreasure.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q383_SearchingForTreasure/Q383_SearchingForTreasure.java
index f7593320bd..2d95800ff4 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q383_SearchingForTreasure/Q383_SearchingForTreasure.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q383_SearchingForTreasure/Q383_SearchingForTreasure.java
@@ -28,7 +28,6 @@ public class Q383_SearchingForTreasure extends Quest
// NPCs
private static final int ESPEN = 30890;
private static final int PIRATE_CHEST = 31148;
-
// Items
private static final int PIRATE_TREASURE_MAP = 5915;
private static final int THIEF_KEY = 1661;
@@ -36,7 +35,6 @@ public class Q383_SearchingForTreasure extends Quest
public Q383_SearchingForTreasure()
{
super(383, "Searching for Treasure");
-
addStartNpc(ESPEN);
addTalkId(ESPEN, PIRATE_CHEST);
}
@@ -51,194 +49,199 @@ public class Q383_SearchingForTreasure extends Quest
return htmltext;
}
- if (event.equals("30890-04.htm"))
+ switch (event)
{
- // Sell the map.
- if (st.hasQuestItems(PIRATE_TREASURE_MAP))
+ case "30890-04.htm":
{
- st.takeItems(PIRATE_TREASURE_MAP, 1);
- st.rewardItems(57, 1000);
- }
- else
- {
- htmltext = "30890-06.htm";
- }
- }
- else if (event.equals("30890-07.htm"))
- {
- // Listen the story.
- if (st.hasQuestItems(PIRATE_TREASURE_MAP))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else
- {
- htmltext = "30890-06.htm";
- }
- }
- else if (event.equals("30890-11.htm"))
- {
- // Decipher the map.
- if (st.hasQuestItems(PIRATE_TREASURE_MAP))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PIRATE_TREASURE_MAP, 1);
- }
- else
- {
- htmltext = "30890-06.htm";
- }
- }
- else if (event.equals("31148-02.htm"))
- {
- if (st.hasQuestItems(THIEF_KEY))
- {
- st.takeItems(THIEF_KEY, 1);
-
- // Adena reward.
- int i1 = 0;
- int i0 = Rnd.get(100);
- if (i0 < 5)
+ // Sell the map.
+ if (st.hasQuestItems(PIRATE_TREASURE_MAP))
{
- st.giveItems(2450, 1);
- }
- else if (i0 < 6)
- {
- st.giveItems(2451, 1);
- }
- else if (i0 < 18)
- {
- st.giveItems(956, 1);
- }
- else if (i0 < 28)
- {
- st.giveItems(952, 1);
+ st.takeItems(PIRATE_TREASURE_MAP, 1);
+ st.rewardItems(57, 1000);
}
else
{
- i1 += 500;
+ htmltext = "30890-06.htm";
}
-
- i0 = Rnd.get(1000);
- if (i0 < 25)
- {
- st.giveItems(4481, 1);
- }
- else if (i0 < 50)
- {
- st.giveItems(4482, 1);
- }
- else if (i0 < 75)
- {
- st.giveItems(4483, 1);
- }
- else if (i0 < 100)
- {
- st.giveItems(4484, 1);
- }
- else if (i0 < 125)
- {
- st.giveItems(4485, 1);
- }
- else if (i0 < 150)
- {
- st.giveItems(4486, 1);
- }
- else if (i0 < 175)
- {
- st.giveItems(4487, 1);
- }
- else if (i0 < 200)
- {
- st.giveItems(4488, 1);
- }
- else if (i0 < 225)
- {
- st.giveItems(4489, 1);
- }
- else if (i0 < 250)
- {
- st.giveItems(4490, 1);
- }
- else if (i0 < 275)
- {
- st.giveItems(4491, 1);
- }
- else if (i0 < 300)
- {
- st.giveItems(4492, 1);
- }
- else
- {
- i1 += 300;
- }
-
- i0 = Rnd.get(100);
- if (i0 < 4)
- {
- st.giveItems(1337, 1);
- }
- else if (i0 < 8)
- {
- st.giveItems(1338, 2);
- }
- else if (i0 < 12)
- {
- st.giveItems(1339, 2);
- }
- else if (i0 < 16)
- {
- st.giveItems(3447, 2);
- }
- else if (i0 < 20)
- {
- st.giveItems(3450, 1);
- }
- else if (i0 < 25)
- {
- st.giveItems(3453, 1);
- }
- else if (i0 < 27)
- {
- st.giveItems(3456, 1);
- }
- else
- {
- i1 += 500;
- }
-
- i0 = Rnd.get(100);
- if (i0 < 20)
- {
- st.giveItems(4408, 1);
- }
- else if (i0 < 40)
- {
- st.giveItems(4409, 1);
- }
- else if (i0 < 60)
- {
- st.giveItems(4418, 1);
- }
- else if (i0 < 80)
- {
- st.giveItems(4419, 1);
- }
- else
- {
- i1 += 500;
- }
-
- st.rewardItems(57, i1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ break;
}
- else
+ case "30890-07.htm":
{
- htmltext = "31148-03.htm";
+ // Listen the story.
+ if (st.hasQuestItems(PIRATE_TREASURE_MAP))
+ {
+ st.startQuest();
+ }
+ else
+ {
+ htmltext = "30890-06.htm";
+ }
+ break;
+ }
+ case "30890-11.htm":
+ {
+ // Decipher the map.
+ if (st.hasQuestItems(PIRATE_TREASURE_MAP))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PIRATE_TREASURE_MAP, 1);
+ }
+ else
+ {
+ htmltext = "30890-06.htm";
+ }
+ break;
+ }
+ case "31148-02.htm":
+ {
+ if (st.hasQuestItems(THIEF_KEY))
+ {
+ st.takeItems(THIEF_KEY, 1);
+
+ // Adena reward.
+ int i1 = 0;
+ int i0 = Rnd.get(100);
+ if (i0 < 5)
+ {
+ st.giveItems(2450, 1);
+ }
+ else if (i0 < 6)
+ {
+ st.giveItems(2451, 1);
+ }
+ else if (i0 < 18)
+ {
+ st.giveItems(956, 1);
+ }
+ else if (i0 < 28)
+ {
+ st.giveItems(952, 1);
+ }
+ else
+ {
+ i1 += 500;
+ }
+
+ i0 = Rnd.get(1000);
+ if (i0 < 25)
+ {
+ st.giveItems(4481, 1);
+ }
+ else if (i0 < 50)
+ {
+ st.giveItems(4482, 1);
+ }
+ else if (i0 < 75)
+ {
+ st.giveItems(4483, 1);
+ }
+ else if (i0 < 100)
+ {
+ st.giveItems(4484, 1);
+ }
+ else if (i0 < 125)
+ {
+ st.giveItems(4485, 1);
+ }
+ else if (i0 < 150)
+ {
+ st.giveItems(4486, 1);
+ }
+ else if (i0 < 175)
+ {
+ st.giveItems(4487, 1);
+ }
+ else if (i0 < 200)
+ {
+ st.giveItems(4488, 1);
+ }
+ else if (i0 < 225)
+ {
+ st.giveItems(4489, 1);
+ }
+ else if (i0 < 250)
+ {
+ st.giveItems(4490, 1);
+ }
+ else if (i0 < 275)
+ {
+ st.giveItems(4491, 1);
+ }
+ else if (i0 < 300)
+ {
+ st.giveItems(4492, 1);
+ }
+ else
+ {
+ i1 += 300;
+ }
+
+ i0 = Rnd.get(100);
+ if (i0 < 4)
+ {
+ st.giveItems(1337, 1);
+ }
+ else if (i0 < 8)
+ {
+ st.giveItems(1338, 2);
+ }
+ else if (i0 < 12)
+ {
+ st.giveItems(1339, 2);
+ }
+ else if (i0 < 16)
+ {
+ st.giveItems(3447, 2);
+ }
+ else if (i0 < 20)
+ {
+ st.giveItems(3450, 1);
+ }
+ else if (i0 < 25)
+ {
+ st.giveItems(3453, 1);
+ }
+ else if (i0 < 27)
+ {
+ st.giveItems(3456, 1);
+ }
+ else
+ {
+ i1 += 500;
+ }
+
+ i0 = Rnd.get(100);
+ if (i0 < 20)
+ {
+ st.giveItems(4408, 1);
+ }
+ else if (i0 < 40)
+ {
+ st.giveItems(4409, 1);
+ }
+ else if (i0 < 60)
+ {
+ st.giveItems(4418, 1);
+ }
+ else if (i0 < 80)
+ {
+ st.giveItems(4419, 1);
+ }
+ else
+ {
+ i1 += 500;
+ }
+
+ st.rewardItems(57, i1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "31148-03.htm";
+ }
+ break;
}
}
@@ -258,14 +261,17 @@ public class Q383_SearchingForTreasure extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() < 42) || !st.hasQuestItems(PIRATE_TREASURE_MAP)) ? "30890-01.htm" : "30890-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ESPEN:
+ {
if (cond == 1)
{
htmltext = "30890-07a.htm";
@@ -275,15 +281,18 @@ public class Q383_SearchingForTreasure extends Quest
htmltext = "30890-12.htm";
}
break;
-
+ }
case PIRATE_CHEST:
+ {
if (cond == 2)
{
htmltext = "31148-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q384_WarehouseKeepersPastime/Q384_WarehouseKeepersPastime.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q384_WarehouseKeepersPastime/Q384_WarehouseKeepersPastime.java
index 6c89f5d941..e774460fea 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q384_WarehouseKeepersPastime/Q384_WarehouseKeepersPastime.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q384_WarehouseKeepersPastime/Q384_WarehouseKeepersPastime.java
@@ -33,10 +33,8 @@ public class Q384_WarehouseKeepersPastime extends Quest
// NPCs
private static final int CLIFF = 30182;
private static final int BAXT = 30685;
-
// Items
private static final int MEDAL = 5964;
-
private static final Map CHANCES = new HashMap<>();
static
{
@@ -67,160 +65,58 @@ public class Q384_WarehouseKeepersPastime extends Quest
CHANCES.put(20677, 340000); // Tulben
CHANCES.put(20605, 150000); // Weird Drake
}
-
+ // @formatter:off
private static final int[][] MATRICE_3X3_LINES = new int[][]
{
- {
- 1,
- 2,
- 3
- },
- {
- 4,
- 5,
- 6
- },
- {
- 7,
- 8,
- 9
- },
- {
- 1,
- 4,
- 7
- },
- {
- 2,
- 5,
- 8
- },
- {
- 3,
- 6,
- 9
- },
- {
- 1,
- 5,
- 9
- },
- {
- 3,
- 5,
- 7
- }
+ {1, 2, 3},
+ {4, 5, 6},
+ {7, 8, 9},
+ {1, 4, 7},
+ {2, 5, 8},
+ {3, 6, 9},
+ {1, 5, 9},
+ {3, 5, 7}
};
-
private static final int[][] _rewards_10_win =
{
- {
- 16,
- 1888
- }, // Synthetic Cokes
- {
- 32,
- 1887
- }, // Varnish of Purity
- {
- 50,
- 1894
- }, // Crafted Leather
- {
- 80,
- 952
- }, // Scroll: Enchant Armor (C)
- {
- 89,
- 1890
- }, // Mithril Alloy
- {
- 98,
- 1893
- }, // Oriharukon
- {
- 100,
- 951
- }
- // Scroll: Enchant Weapon (C)
+ {16, 1888}, // Synthetic Cokes
+ {32, 1887}, // Varnish of Purity
+ {50, 1894}, // Crafted Leather
+ {80, 952}, // Scroll: Enchant Armor (C)
+ {89, 1890}, // Mithril Alloy
+ {98, 1893}, // Oriharukon
+ {100, 951} // Scroll: Enchant Weapon (C)
};
-
private static final int[][] _rewards_10_lose =
{
- {
- 50,
- 4041
- }, // Mold Hardener
- {
- 80,
- 952
- }, // Scroll: Enchant Armor (C)
- {
- 98,
- 1892
- }, // Blacksmith's Frame
- {
- 100,
- 917
- }
- // Necklace of Mermaid
+ {50, 4041}, // Mold Hardener
+ {80, 952}, // Scroll: Enchant Armor (C)
+ {98, 1892}, // Blacksmith's Frame
+ {100, 917} // Necklace of Mermaid
};
-
private static final int[][] _rewards_100_win =
{
- {
- 50,
- 883
- }, // Aquastone Ring
- {
- 80,
- 951
- }, // Scroll: Enchant Weapon (C)
- {
- 98,
- 852
- }, // Moonstone Earring
- {
- 100,
- 401
- }
- // Drake Leather Armor
+ {50, 883}, // Aquastone Ring
+ {80, 951}, // Scroll: Enchant Weapon (C)
+ {98, 852}, // Moonstone Earring
+ {100, 401} // Drake Leather Armor
};
-
private static final int[][] _rewards_100_lose =
{
- {
- 50,
- 951
- }, // Scroll: Enchant Weapon (C)
- {
- 80,
- 500
- }, // Great Helmet
- {
- 98,
- 2437
- }, // Drake Leather Boots
- {
- 100,
- 135
- }
- // Samurai Longsword
+ {50, 951}, // Scroll: Enchant Weapon (C)
+ {80, 500}, // Great Helmet
+ {98, 2437}, // Drake Leather Boots
+ {100, 135} // Samurai Longsword
};
+ // @formatter:on
public Q384_WarehouseKeepersPastime()
{
super(384, "Warehouse Keeper's Pastime");
-
registerQuestItems(MEDAL);
-
addStartNpc(CLIFF);
addTalkId(CLIFF, BAXT);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -236,9 +132,7 @@ public class Q384_WarehouseKeepersPastime extends Quest
final int npcId = npc.getNpcId();
if (event.equals("30182-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals(npcId + "-08.htm"))
{
@@ -318,7 +212,7 @@ public class Q384_WarehouseKeepersPastime extends Quest
String playerChoice = playerArray.concat(number);
// Transform the generated board (9 string length) into a 2d matrice (3x3 int).
- String[] board = ((String) st.get("board")).split("");
+ String[] board = st.get("board").split("");
// test for all line combination
int winningLines = 0;
@@ -445,8 +339,8 @@ public class Q384_WarehouseKeepersPastime extends Quest
private static final String fillBoard(QuestState st, String htmltext)
{
String result = htmltext;
- String playerArray = (String) st.get("playerArray");
- String[] board = ((String) st.get("board")).split("");
+ String playerArray = st.get("playerArray");
+ String[] board = st.get("board").split("");
for (int i = 1; i < 10; ++i)
{
result = result.replace("", playerArray.contains(board[i - 1]) ? board[i - 1] : "?");
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q385_YokeOfThePast/Q385_YokeOfThePast.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q385_YokeOfThePast/Q385_YokeOfThePast.java
index 970103230f..0e5b10c9e8 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q385_YokeOfThePast/Q385_YokeOfThePast.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q385_YokeOfThePast/Q385_YokeOfThePast.java
@@ -60,13 +60,10 @@ public class Q385_YokeOfThePast extends Quest
31125,
31126
};
-
// Item
private static final int ANCIENT_SCROLL = 5902;
-
// Reward
private static final int BLANK_SCROLL = 5965;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -117,16 +114,10 @@ public class Q385_YokeOfThePast extends Quest
public Q385_YokeOfThePast()
{
super(385, "Yoke of the Past");
-
registerQuestItems(ANCIENT_SCROLL);
-
addStartNpc(GATEKEEPER_ZIGGURAT);
addTalkId(GATEKEEPER_ZIGGURAT);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -141,9 +132,7 @@ public class Q385_YokeOfThePast extends Quest
if (event.equals("05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("10.htm"))
{
@@ -167,10 +156,12 @@ public class Q385_YokeOfThePast extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "02.htm" : "01.htm";
break;
-
+ }
case State.STARTED:
+ {
if (!st.hasQuestItems(ANCIENT_SCROLL))
{
htmltext = "08.htm";
@@ -183,6 +174,7 @@ public class Q385_YokeOfThePast extends Quest
st.rewardItems(BLANK_SCROLL, count);
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q386_StolenDignity/Q386_StolenDignity.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q386_StolenDignity/Q386_StolenDignity.java
index 302bb20a85..5084898b2c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q386_StolenDignity/Q386_StolenDignity.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q386_StolenDignity/Q386_StolenDignity.java
@@ -91,46 +91,16 @@ public class Q386_StolenDignity extends Quest
};
public static final int[][] MATRICE_3X3_LINES = new int[][]
{
- {
- 1,
- 2,
- 3
- },
- {
- 4,
- 5,
- 6
- },
- {
- 7,
- 8,
- 9
- },
- {
- 1,
- 4,
- 7
- },
- {
- 2,
- 5,
- 8
- },
- {
- 3,
- 6,
- 9
- },
- {
- 1,
- 5,
- 9
- },
- {
- 3,
- 5,
- 7
- }
+ // @formatter:off
+ {1, 2, 3},
+ {4, 5, 6},
+ {7, 8, 9},
+ {1, 4, 7},
+ {2, 5, 8},
+ {3, 6, 9},
+ {1, 5, 9},
+ {3, 5, 7}
+ // @formatter:on
};
public Q386_StolenDignity()
@@ -173,19 +143,17 @@ public class Q386_StolenDignity extends Quest
QuestState st = player.getQuestState("Q386_StolenDignity");
if (st == null)
{
- return event;
+ return htmltext;
}
if (event.equals("30843-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
+ st.startQuest();
st.set("state", "1");
- st.playSound("ItemSound.quest_accept");
}
else if (event.equals("30843-08.htm"))
{
- st.playSound("ItemSound.quest_giveup");
+ st.playSound(QuestState.SOUND_GIVEUP);
st.exitQuest(true);
}
else if (event.equals("30843-12.htm"))
@@ -212,7 +180,7 @@ public class Q386_StolenDignity extends Quest
if (event.startsWith("select_2-"))
{
number = event.substring(9);
- playerArray = (String) st.get("playerArray");
+ playerArray = st.get("playerArray");
if (playerArray.contains(number))
{
htmltext = fillBoard(st, getHtmlText("30843-" + (13 + (2 * playerArray.length())) + ".htm"));
@@ -226,7 +194,7 @@ public class Q386_StolenDignity extends Quest
else if (event.startsWith("select_3-"))
{
number = event.substring(9);
- playerArray = (String) st.get("playerArray");
+ playerArray = st.get("playerArray");
if (playerArray.contains(number))
{
htmltext = fillBoard(st, getHtmlText("30843-25.htm"));
@@ -234,7 +202,7 @@ public class Q386_StolenDignity extends Quest
else
{
String playerChoice = playerArray.concat(number);
- String[] board = ((String) st.get("board")).split("");
+ String[] board = st.get("board").split("");
int winningLines = 0;
int[][] var11 = MATRICE_3X3_LINES;
int var12 = var11.length;
@@ -300,8 +268,8 @@ public class Q386_StolenDignity extends Quest
private static final String fillBoard(QuestState st, String htmltext)
{
String result = htmltext;
- String playerArray = (String) st.get("playerArray");
- String[] board = ((String) st.get("board")).split("");
+ String playerArray = st.get("playerArray");
+ String[] board = st.get("board").split("");
for (int i = 1; i < 10; ++i)
{
result = result.replace("", playerArray.contains(board[i - 1]) ? board[i - 1] : "?");
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q401_PathToAWarrior/Q401_PathToAWarrior.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q401_PathToAWarrior/Q401_PathToAWarrior.java
index c483605e44..4f6bc9fb6c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q401_PathToAWarrior/Q401_PathToAWarrior.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q401_PathToAWarrior/Q401_PathToAWarrior.java
@@ -36,7 +36,6 @@ public class Q401_PathToAWarrior extends Quest
private static final int SIMPLON_LETTER = 1143;
private static final int POISON_SPIDER_LEG = 1144;
private static final int MEDALLION_OF_WARRIOR = 1145;
-
// NPCs
private static final int AURON = 30010;
private static final int SIMPLON = 30253;
@@ -44,12 +43,9 @@ public class Q401_PathToAWarrior extends Quest
public Q401_PathToAWarrior()
{
super(401, "Path to a Warrior");
-
registerQuestItems(AURON_LETTER, WARRIOR_GUILD_MARK, RUSTED_BRONZE_SWORD_1, RUSTED_BRONZE_SWORD_2, RUSTED_BRONZE_SWORD_3, SIMPLON_LETTER, POISON_SPIDER_LEG);
-
addStartNpc(AURON);
addTalkId(AURON, SIMPLON);
-
addKillId(20035, 20038, 20042, 20043);
}
@@ -80,21 +76,19 @@ public class Q401_PathToAWarrior extends Quest
}
else if (event.equals("30010-06.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(AURON_LETTER, 1);
}
else if (event.equals("30253-02.htm"))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(AURON_LETTER, 1);
st.giveItems(WARRIOR_GUILD_MARK, 1);
}
else if (event.equals("30010-11.htm"))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RUSTED_BRONZE_SWORD_2, 1);
st.takeItems(SIMPLON_LETTER, 1);
@@ -117,14 +111,17 @@ public class Q401_PathToAWarrior extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30010-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case AURON:
+ {
if (cond == 1)
{
htmltext = "30010-07.htm";
@@ -153,8 +150,9 @@ public class Q401_PathToAWarrior extends Quest
st.exitQuest(true);
}
break;
-
+ }
case SIMPLON:
+ {
if (cond == 1)
{
htmltext = "30253-01.htm";
@@ -173,7 +171,7 @@ public class Q401_PathToAWarrior extends Quest
else if (cond == 3)
{
htmltext = "30253-04.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RUSTED_BRONZE_SWORD_1, 10);
st.takeItems(WARRIOR_GUILD_MARK, 1);
@@ -185,8 +183,10 @@ public class Q401_PathToAWarrior extends Quest
htmltext = "30253-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -205,19 +205,22 @@ public class Q401_PathToAWarrior extends Quest
{
case 20035:
case 20042:
- if ((st.getInt("cond") == 2) && st.dropItems(RUSTED_BRONZE_SWORD_1, 1, 10, 400000))
+ {
+ if (st.isCond(2) && st.dropItems(RUSTED_BRONZE_SWORD_1, 1, 10, 400000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20038:
case 20043:
- if ((st.getInt("cond") == 5) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == RUSTED_BRONZE_SWORD_3) && st.dropItemsAlways(POISON_SPIDER_LEG, 1, 20))
+ {
+ if (st.isCond(5) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == RUSTED_BRONZE_SWORD_3) && st.dropItemsAlways(POISON_SPIDER_LEG, 1, 20))
{
- st.set("cond", "6");
+ st.setCond(6);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q402_PathToAHumanKnight/Q402_PathToAHumanKnight.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q402_PathToAHumanKnight/Q402_PathToAHumanKnight.java
index 4eea580428..a120a9fb3b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q402_PathToAHumanKnight/Q402_PathToAHumanKnight.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q402_PathToAHumanKnight/Q402_PathToAHumanKnight.java
@@ -26,6 +26,16 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q402_PathToAHumanKnight extends Quest
{
+ // NPCs
+ private static final int SIR_KLAUS_VASPER = 30417;
+ private static final int BATHIS = 30332;
+ private static final int RAYMOND = 30289;
+ private static final int BEZIQUE = 30379;
+ private static final int LEVIAN = 30037;
+ private static final int GILBERT = 30039;
+ private static final int BIOTIN = 30031;
+ private static final int SIR_AARON_TANFORD = 30653;
+ private static final int SIR_COLLIN_WINDAWOOD = 30311;
// Items
private static final int SWORD_OF_RITUAL = 1161;
private static final int COIN_OF_LORDS_1 = 1162;
@@ -48,26 +58,12 @@ public class Q402_PathToAHumanKnight extends Quest
private static final int HORRIBLE_SKULL = 1179;
private static final int MARK_OF_ESQUIRE = 1271;
- // NPCs
- private static final int SIR_KLAUS_VASPER = 30417;
- private static final int BATHIS = 30332;
- private static final int RAYMOND = 30289;
- private static final int BEZIQUE = 30379;
- private static final int LEVIAN = 30037;
- private static final int GILBERT = 30039;
- private static final int BIOTIN = 30031;
- private static final int SIR_AARON_TANFORD = 30653;
- private static final int SIR_COLLIN_WINDAWOOD = 30311;
-
public Q402_PathToAHumanKnight()
{
super(402, "Path to a Human Knight");
-
registerQuestItems(MARK_OF_ESQUIRE, COIN_OF_LORDS_1, COIN_OF_LORDS_2, COIN_OF_LORDS_3, COIN_OF_LORDS_4, COIN_OF_LORDS_5, COIN_OF_LORDS_6, GLUDIO_GUARD_MARK_1, BUGBEAR_NECKLACE, EINHASAD_CHURCH_MARK_1, EINHASAD_CRUCIFIX, GLUDIO_GUARD_MARK_2, SPIDER_LEG, EINHASAD_CHURCH_MARK_2, LIZARDMAN_TOTEM, GLUDIO_GUARD_MARK_3, GIANT_SPIDER_HUSK, EINHASAD_CHURCH_MARK_3, LIZARDMAN_TOTEM, GLUDIO_GUARD_MARK_3, GIANT_SPIDER_HUSK, EINHASAD_CHURCH_MARK_3, HORRIBLE_SKULL);
-
addStartNpc(SIR_KLAUS_VASPER);
addTalkId(SIR_KLAUS_VASPER, BATHIS, RAYMOND, BEZIQUE, LEVIAN, GILBERT, BIOTIN, SIR_AARON_TANFORD, SIR_COLLIN_WINDAWOOD);
-
addKillId(20775, 27024, 20038, 20043, 20050, 20030, 20027, 20024, 20103, 20106, 20108, 20404);
}
@@ -81,73 +77,84 @@ public class Q402_PathToAHumanKnight extends Quest
return htmltext;
}
- if (event.equals("30417-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.FIGHTER)
+ case "30417-05.htm":
{
- htmltext = (player.getClassId() == ClassId.KNIGHT) ? "30417-02a.htm" : "30417-03.htm";
+ if (player.getClassId() != ClassId.FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.KNIGHT) ? "30417-02a.htm" : "30417-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30417-02.htm";
+ }
+ else if (st.hasQuestItems(SWORD_OF_RITUAL))
+ {
+ htmltext = "30417-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30417-08.htm":
{
- htmltext = "30417-02.htm";
+ st.startQuest();
+ st.giveItems(MARK_OF_ESQUIRE, 1);
+ break;
}
- else if (st.hasQuestItems(SWORD_OF_RITUAL))
+ case "30332-02.htm":
{
- htmltext = "30417-04.htm";
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(GLUDIO_GUARD_MARK_1, 1);
+ break;
+ }
+ case "30289-03.htm":
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(EINHASAD_CHURCH_MARK_1, 1);
+ break;
+ }
+ case "30379-02.htm":
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(GLUDIO_GUARD_MARK_2, 1);
+ break;
+ }
+ case "30037-02.htm":
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(EINHASAD_CHURCH_MARK_2, 1);
+ break;
+ }
+ case "30039-02.htm":
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(GLUDIO_GUARD_MARK_3, 1);
+ break;
+ }
+ case "30031-02.htm":
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(EINHASAD_CHURCH_MARK_3, 1);
+ break;
+ }
+ case "30417-13.htm":
+ case "30417-14.htm":
+ {
+ final int coinCount = st.getQuestItemsCount(COIN_OF_LORDS_1) + st.getQuestItemsCount(COIN_OF_LORDS_2) + st.getQuestItemsCount(COIN_OF_LORDS_3) + st.getQuestItemsCount(COIN_OF_LORDS_4) + st.getQuestItemsCount(COIN_OF_LORDS_5) + st.getQuestItemsCount(COIN_OF_LORDS_6);
+ st.takeItems(COIN_OF_LORDS_1, -1);
+ st.takeItems(COIN_OF_LORDS_2, -1);
+ st.takeItems(COIN_OF_LORDS_3, -1);
+ st.takeItems(COIN_OF_LORDS_4, -1);
+ st.takeItems(COIN_OF_LORDS_5, -1);
+ st.takeItems(COIN_OF_LORDS_6, -1);
+ st.takeItems(MARK_OF_ESQUIRE, 1);
+ st.giveItems(SWORD_OF_RITUAL, 1);
+ st.rewardExpAndSp(3200, 1500 + (1920 * (coinCount - 3)));
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30417-08.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(MARK_OF_ESQUIRE, 1);
- }
- else if (event.equals("30332-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(GLUDIO_GUARD_MARK_1, 1);
- }
- else if (event.equals("30289-03.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(EINHASAD_CHURCH_MARK_1, 1);
- }
- else if (event.equals("30379-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(GLUDIO_GUARD_MARK_2, 1);
- }
- else if (event.equals("30037-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(EINHASAD_CHURCH_MARK_2, 1);
- }
- else if (event.equals("30039-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(GLUDIO_GUARD_MARK_3, 1);
- }
- else if (event.equals("30031-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(EINHASAD_CHURCH_MARK_3, 1);
- }
- else if (event.equals("30417-13.htm") || event.equals("30417-14.htm"))
- {
- final int coinCount = st.getQuestItemsCount(COIN_OF_LORDS_1) + st.getQuestItemsCount(COIN_OF_LORDS_2) + st.getQuestItemsCount(COIN_OF_LORDS_3) + st.getQuestItemsCount(COIN_OF_LORDS_4) + st.getQuestItemsCount(COIN_OF_LORDS_5) + st.getQuestItemsCount(COIN_OF_LORDS_6);
- st.takeItems(COIN_OF_LORDS_1, -1);
- st.takeItems(COIN_OF_LORDS_2, -1);
- st.takeItems(COIN_OF_LORDS_3, -1);
- st.takeItems(COIN_OF_LORDS_4, -1);
- st.takeItems(COIN_OF_LORDS_5, -1);
- st.takeItems(COIN_OF_LORDS_6, -1);
- st.takeItems(MARK_OF_ESQUIRE, 1);
- st.giveItems(SWORD_OF_RITUAL, 1);
- st.rewardExpAndSp(3200, 1500 + (1920 * (coinCount - 3)));
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -166,13 +173,16 @@ public class Q402_PathToAHumanKnight extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30417-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case SIR_KLAUS_VASPER:
+ {
final int coins = st.getQuestItemsCount(COIN_OF_LORDS_1) + st.getQuestItemsCount(COIN_OF_LORDS_2) + st.getQuestItemsCount(COIN_OF_LORDS_3) + st.getQuestItemsCount(COIN_OF_LORDS_4) + st.getQuestItemsCount(COIN_OF_LORDS_5) + st.getQuestItemsCount(COIN_OF_LORDS_6);
if (coins < 3)
{
@@ -203,8 +213,9 @@ public class Q402_PathToAHumanKnight extends Quest
st.exitQuest(true);
}
break;
-
+ }
case BATHIS:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_1))
{
htmltext = "30332-05.htm";
@@ -229,8 +240,9 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30332-01.htm";
}
break;
-
+ }
case RAYMOND:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_2))
{
htmltext = "30289-06.htm";
@@ -255,8 +267,9 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30289-01.htm";
}
break;
-
+ }
case BEZIQUE:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_3))
{
htmltext = "30379-05.htm";
@@ -281,8 +294,9 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30379-01.htm";
}
break;
-
+ }
case LEVIAN:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_4))
{
htmltext = "30037-05.htm";
@@ -307,8 +321,9 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30037-01.htm";
}
break;
-
+ }
case GILBERT:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_5))
{
htmltext = "30039-05.htm";
@@ -333,8 +348,9 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30039-01.htm";
}
break;
-
+ }
case BIOTIN:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_6))
{
htmltext = "30031-05.htm";
@@ -359,12 +375,15 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30031-01.htm";
}
break;
-
+ }
case SIR_AARON_TANFORD:
+ {
htmltext = "30653-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -382,52 +401,59 @@ public class Q402_PathToAHumanKnight extends Quest
switch (npc.getNpcId())
{
case 20775: // Bugbear Raider
+ {
if (st.hasQuestItems(GLUDIO_GUARD_MARK_1))
{
st.dropItemsAlways(BUGBEAR_NECKLACE, 1, 10);
}
break;
-
+ }
case 27024: // Undead Priest
+ {
if (st.hasQuestItems(EINHASAD_CHURCH_MARK_1))
{
st.dropItems(EINHASAD_CRUCIFIX, 1, 12, 500000);
}
break;
-
+ }
case 20038: // Poison Spider
case 20043: // Arachnid Tracker
case 20050: // Arachnid Predator
+ {
if (st.hasQuestItems(GLUDIO_GUARD_MARK_2))
{
st.dropItemsAlways(SPIDER_LEG, 1, 20);
}
break;
-
+ }
case 20030: // Langk Lizardman
case 20027: // Langk Lizardman Scout
case 20024: // Langk Lizardman Warrior
+ {
if (st.hasQuestItems(EINHASAD_CHURCH_MARK_2))
{
st.dropItems(LIZARDMAN_TOTEM, 1, 20, 500000);
}
break;
-
+ }
case 20103: // Giant Spider
case 20106: // Talon Spider
case 20108: // Blade Spider
+ {
if (st.hasQuestItems(GLUDIO_GUARD_MARK_3))
{
st.dropItems(GIANT_SPIDER_HUSK, 1, 20, 400000);
}
break;
-
+ }
case 20404: // Silent Horror
+ {
if (st.hasQuestItems(EINHASAD_CHURCH_MARK_3))
{
st.dropItems(HORRIBLE_SKULL, 1, 10, 400000);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q403_PathToARogue/Q403_PathToARogue.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q403_PathToARogue/Q403_PathToARogue.java
index 800efdc1b2..ced966044a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q403_PathToARogue/Q403_PathToARogue.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q403_PathToARogue/Q403_PathToARogue.java
@@ -28,6 +28,9 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q403_PathToARogue extends Quest
{
+ // NPCs
+ private static final int BEZIQUE = 30379;
+ private static final int NETI = 30425;
// Items
private static final int BEZIQUE_LETTER = 1180;
private static final int NETI_BOW = 1181;
@@ -41,19 +44,12 @@ public class Q403_PathToARogue extends Quest
private static final int STOLEN_NECKLACE = 1189;
private static final int BEZIQUE_RECOMMENDATION = 1190;
- // NPCs
- private static final int BEZIQUE = 30379;
- private static final int NETI = 30425;
-
public Q403_PathToARogue()
{
super(403, "Path to a Rogue");
-
registerQuestItems(BEZIQUE_LETTER, NETI_BOW, NETI_DAGGER, SPARTOI_BONES, HORSESHOE_OF_LIGHT, MOST_WANTED_LIST, STOLEN_JEWELRY, STOLEN_TOMES, STOLEN_RING, STOLEN_NECKLACE);
-
addStartNpc(BEZIQUE);
addTalkId(BEZIQUE, NETI);
-
addKillId(20035, 20042, 20045, 20051, 20054, 20060, 27038);
}
@@ -67,35 +63,39 @@ public class Q403_PathToARogue extends Quest
return htmltext;
}
- if (event.equals("30379-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.FIGHTER)
+ case "30379-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ROGUE) ? "30379-02a.htm" : "30379-02.htm";
+ if (player.getClassId() != ClassId.FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ROGUE) ? "30379-02a.htm" : "30379-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30379-02.htm";
+ }
+ else if (st.hasQuestItems(BEZIQUE_RECOMMENDATION))
+ {
+ htmltext = "30379-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30379-06.htm":
{
- htmltext = "30379-02.htm";
+ st.startQuest();
+ st.giveItems(BEZIQUE_LETTER, 1);
+ break;
}
- else if (st.hasQuestItems(BEZIQUE_RECOMMENDATION))
+ case "30425-05.htm":
{
- htmltext = "30379-04.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(NETI_BOW, 1);
+ st.giveItems(NETI_DAGGER, 1);
+ break;
}
}
- else if (event.equals("30379-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(BEZIQUE_LETTER, 1);
- }
- else if (event.equals("30425-05.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(NETI_BOW, 1);
- st.giveItems(NETI_DAGGER, 1);
- }
return htmltext;
}
@@ -113,14 +113,17 @@ public class Q403_PathToARogue extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30379-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BEZIQUE:
+ {
if (cond == 1)
{
htmltext = "30379-07.htm";
@@ -132,7 +135,7 @@ public class Q403_PathToARogue extends Quest
else if (cond == 4)
{
htmltext = "30379-08.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HORSESHOE_OF_LIGHT, 1);
st.giveItems(MOST_WANTED_LIST, 1);
@@ -157,8 +160,9 @@ public class Q403_PathToARogue extends Quest
st.exitQuest(true);
}
break;
-
+ }
case NETI:
+ {
if (cond == 1)
{
htmltext = "30425-01.htm";
@@ -170,7 +174,7 @@ public class Q403_PathToARogue extends Quest
else if (cond == 3)
{
htmltext = "30425-07.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SPARTOI_BONES, 10);
st.giveItems(HORSESHOE_OF_LIGHT, 1);
@@ -180,8 +184,10 @@ public class Q403_PathToARogue extends Quest
htmltext = "30425-08.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -207,29 +213,33 @@ public class Q403_PathToARogue extends Quest
case 20035:
case 20045:
case 20051:
- if ((st.getInt("cond") == 2) && st.dropItems(SPARTOI_BONES, 1, 10, 200000))
+ {
+ if (st.isCond(2) && st.dropItems(SPARTOI_BONES, 1, 10, 200000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20042:
- if ((st.getInt("cond") == 2) && st.dropItems(SPARTOI_BONES, 1, 10, 300000))
+ {
+ if (st.isCond(2) && st.dropItems(SPARTOI_BONES, 1, 10, 300000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20054:
case 20060:
- if ((st.getInt("cond") == 2) && st.dropItems(SPARTOI_BONES, 1, 10, 800000))
+ {
+ if (st.isCond(2) && st.dropItems(SPARTOI_BONES, 1, 10, 800000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 27038:
- if (st.getInt("cond") == 5)
+ {
+ if (st.isCond(5))
{
final int randomItem = Rnd.get(STOLEN_JEWELRY, STOLEN_NECKLACE);
if (!st.hasQuestItems(randomItem))
@@ -237,7 +247,7 @@ public class Q403_PathToARogue extends Quest
st.giveItems(randomItem, 1);
if (st.hasQuestItems(STOLEN_JEWELRY, STOLEN_TOMES, STOLEN_RING, STOLEN_NECKLACE))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -247,6 +257,7 @@ public class Q403_PathToARogue extends Quest
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q404_PathToAHumanWizard/Q404_PathToAHumanWizard.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q404_PathToAHumanWizard/Q404_PathToAHumanWizard.java
index 5bdf286cb0..10d140fabd 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q404_PathToAHumanWizard/Q404_PathToAHumanWizard.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q404_PathToAHumanWizard/Q404_PathToAHumanWizard.java
@@ -26,6 +26,13 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q404_PathToAHumanWizard extends Quest
{
+ // NPCs
+ private static final int PARINA = 30391;
+ private static final int EARTH_SNAKE = 30409;
+ private static final int WASTELAND_LIZARDMAN = 30410;
+ private static final int FLAME_SALAMANDER = 30411;
+ private static final int WIND_SYLPH = 30412;
+ private static final int WATER_UNDINE = 30413;
// Items
private static final int MAP_OF_LUSTER = 1280;
private static final int KEY_OF_FLAME = 1281;
@@ -41,23 +48,12 @@ public class Q404_PathToAHumanWizard extends Quest
private static final int EARTH_RING = 1291;
private static final int BEAD_OF_SEASON = 1292;
- // NPCs
- private static final int PARINA = 30391;
- private static final int EARTH_SNAKE = 30409;
- private static final int WASTELAND_LIZARDMAN = 30410;
- private static final int FLAME_SALAMANDER = 30411;
- private static final int WIND_SYLPH = 30412;
- private static final int WATER_UNDINE = 30413;
-
public Q404_PathToAHumanWizard()
{
super(404, "Path to a Human Wizard");
-
registerQuestItems(MAP_OF_LUSTER, KEY_OF_FLAME, FLAME_EARING, BROKEN_BRONZE_MIRROR, WIND_FEATHER, WIND_BANGEL, RAMA_DIARY, SPARKLE_PEBBLE, WATER_NECKLACE, RUST_GOLD_COIN, RED_SOIL, EARTH_RING);
-
addStartNpc(PARINA);
addTalkId(PARINA, EARTH_SNAKE, WASTELAND_LIZARDMAN, FLAME_SALAMANDER, WIND_SYLPH, WATER_UNDINE);
-
addKillId(20021, 20359, 27030);
}
@@ -73,13 +69,11 @@ public class Q404_PathToAHumanWizard extends Quest
if (event.equals("30391-08.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30410-03.htm"))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BROKEN_BRONZE_MIRROR, 1);
st.giveItems(WIND_FEATHER, 1);
@@ -98,10 +92,11 @@ public class Q404_PathToAHumanWizard extends Quest
return htmltext;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId() != ClassId.MAGE)
{
htmltext = (player.getClassId() == ClassId.WIZARD) ? "30391-02a.htm" : "30391-01.htm";
@@ -119,11 +114,13 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30391-04.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case PARINA:
+ {
if (cond < 13)
{
htmltext = "30391-05.htm";
@@ -142,12 +139,13 @@ public class Q404_PathToAHumanWizard extends Quest
st.exitQuest(true);
}
break;
-
+ }
case FLAME_SALAMANDER:
+ {
if (cond == 1)
{
htmltext = "30411-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(MAP_OF_LUSTER, 1);
}
@@ -158,7 +156,7 @@ public class Q404_PathToAHumanWizard extends Quest
else if (cond == 3)
{
htmltext = "30411-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KEY_OF_FLAME, 1);
st.takeItems(MAP_OF_LUSTER, 1);
@@ -169,12 +167,13 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30411-04.htm";
}
break;
-
+ }
case WIND_SYLPH:
+ {
if (cond == 4)
{
htmltext = "30412-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(BROKEN_BRONZE_MIRROR, 1);
}
@@ -185,7 +184,7 @@ public class Q404_PathToAHumanWizard extends Quest
else if (cond == 6)
{
htmltext = "30412-03.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(WIND_FEATHER, 1);
st.giveItems(WIND_BANGEL, 1);
@@ -195,8 +194,9 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30412-04.htm";
}
break;
-
+ }
case WASTELAND_LIZARDMAN:
+ {
if (cond == 5)
{
htmltext = "30410-01.htm";
@@ -206,12 +206,13 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30410-04.htm";
}
break;
-
+ }
case WATER_UNDINE:
+ {
if (cond == 7)
{
htmltext = "30413-01.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(RAMA_DIARY, 1);
}
@@ -222,7 +223,7 @@ public class Q404_PathToAHumanWizard extends Quest
else if (cond == 9)
{
htmltext = "30413-03.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RAMA_DIARY, 1);
st.takeItems(SPARKLE_PEBBLE, -1);
@@ -233,12 +234,13 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30413-04.htm";
}
break;
-
+ }
case EARTH_SNAKE:
+ {
if (cond == 10)
{
htmltext = "30409-01.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(RUST_GOLD_COIN, 1);
}
@@ -249,7 +251,7 @@ public class Q404_PathToAHumanWizard extends Quest
else if (cond == 12)
{
htmltext = "30409-03.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RED_SOIL, 1);
st.takeItems(RUST_GOLD_COIN, 1);
@@ -260,8 +262,10 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30409-04.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -279,25 +283,29 @@ public class Q404_PathToAHumanWizard extends Quest
switch (npc.getNpcId())
{
case 20359: // Ratman Warrior
- if ((st.getInt("cond") == 2) && st.dropItems(KEY_OF_FLAME, 1, 1, 800000))
+ {
+ if (st.isCond(2) && st.dropItems(KEY_OF_FLAME, 1, 1, 800000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 27030: // Water Seer
- if ((st.getInt("cond") == 8) && st.dropItems(SPARKLE_PEBBLE, 1, 2, 800000))
+ {
+ if (st.isCond(8) && st.dropItems(SPARKLE_PEBBLE, 1, 2, 800000))
{
- st.set("cond", "9");
+ st.setCond(9);
}
break;
-
+ }
case 20021: // Red Bear
- if ((st.getInt("cond") == 11) && st.dropItems(RED_SOIL, 1, 1, 200000))
+ {
+ if (st.isCond(11) && st.dropItems(RED_SOIL, 1, 1, 200000))
{
- st.set("cond", "12");
+ st.setCond(12);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q405_PathToACleric/Q405_PathToACleric.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q405_PathToACleric/Q405_PathToACleric.java
index bbf39e4eaf..243e4e3236 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q405_PathToACleric/Q405_PathToACleric.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q405_PathToACleric/Q405_PathToACleric.java
@@ -26,6 +26,13 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q405_PathToACleric extends Quest
{
+ // NPCs
+ private static final int GALLINT = 30017;
+ private static final int ZIGAUNT = 30022;
+ private static final int VIVYAN = 30030;
+ private static final int PRAGA = 30333;
+ private static final int SIMPLON = 30253;
+ private static final int LIONEL = 30408;
// Items
private static final int LETTER_OF_ORDER_1 = 1191;
private static final int LETTER_OF_ORDER_2 = 1192;
@@ -37,27 +44,15 @@ public class Q405_PathToACleric extends Quest
private static final int PENDANT_OF_MOTHER = 1198;
private static final int NECKLACE_OF_MOTHER = 1199;
private static final int LIONEL_COVENANT = 1200;
-
- // NPCs
- private static final int GALLINT = 30017;
- private static final int ZIGAUNT = 30022;
- private static final int VIVYAN = 30030;
- private static final int PRAGA = 30333;
- private static final int SIMPLON = 30253;
- private static final int LIONEL = 30408;
-
// Reward
private static final int MARK_OF_FATE = 1201;
public Q405_PathToACleric()
{
super(405, "Path to a Cleric");
-
registerQuestItems(LETTER_OF_ORDER_1, BOOK_OF_SIMPLON, BOOK_OF_PRAGA, BOOK_OF_VIVYAN, NECKLACE_OF_MOTHER, PENDANT_OF_MOTHER, LETTER_OF_ORDER_2, LIONEL_BOOK, CERTIFICATE_OF_GALLINT, LIONEL_COVENANT);
-
addStartNpc(ZIGAUNT);
addTalkId(ZIGAUNT, SIMPLON, PRAGA, VIVYAN, LIONEL, GALLINT);
-
addKillId(20029, 20026);
}
@@ -73,9 +68,7 @@ public class Q405_PathToACleric extends Quest
if (event.equals("30022-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(LETTER_OF_ORDER_1, 1);
}
@@ -95,6 +88,7 @@ public class Q405_PathToACleric extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId() != ClassId.MAGE)
{
htmltext = (player.getClassId() == ClassId.CLERIC) ? "30022-02a.htm" : "30022-02.htm";
@@ -112,12 +106,14 @@ public class Q405_PathToACleric extends Quest
htmltext = "30022-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ZIGAUNT:
+ {
if (cond == 1)
{
htmltext = "30022-06.htm";
@@ -125,7 +121,7 @@ public class Q405_PathToACleric extends Quest
else if (cond == 2)
{
htmltext = "30022-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BOOK_OF_PRAGA, 1);
st.takeItems(BOOK_OF_VIVYAN, 1);
@@ -149,8 +145,9 @@ public class Q405_PathToACleric extends Quest
st.exitQuest(true);
}
break;
-
+ }
case SIMPLON:
+ {
if ((cond == 1) && !st.hasQuestItems(BOOK_OF_SIMPLON))
{
htmltext = "30253-01.htm";
@@ -162,8 +159,9 @@ public class Q405_PathToACleric extends Quest
htmltext = "30253-02.htm";
}
break;
-
+ }
case PRAGA:
+ {
if (cond == 1)
{
if (!st.hasQuestItems(BOOK_OF_PRAGA) && !st.hasQuestItems(NECKLACE_OF_MOTHER) && st.hasQuestItems(BOOK_OF_SIMPLON))
@@ -185,7 +183,7 @@ public class Q405_PathToACleric extends Quest
if (st.hasQuestItems(BOOK_OF_VIVYAN))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -199,8 +197,9 @@ public class Q405_PathToACleric extends Quest
htmltext = "30333-04.htm";
}
break;
-
+ }
case VIVYAN:
+ {
if ((cond == 1) && !st.hasQuestItems(BOOK_OF_VIVYAN) && st.hasQuestItems(BOOK_OF_SIMPLON))
{
htmltext = "30030-01.htm";
@@ -208,7 +207,7 @@ public class Q405_PathToACleric extends Quest
if (st.hasQuestItems(BOOK_OF_PRAGA))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -221,8 +220,9 @@ public class Q405_PathToACleric extends Quest
htmltext = "30030-02.htm";
}
break;
-
+ }
case LIONEL:
+ {
if (cond < 3)
{
htmltext = "30408-02.htm";
@@ -230,7 +230,7 @@ public class Q405_PathToACleric extends Quest
else if (cond == 3)
{
htmltext = "30408-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LIONEL_BOOK, 1);
}
@@ -241,7 +241,7 @@ public class Q405_PathToACleric extends Quest
else if (cond == 5)
{
htmltext = "30408-04.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CERTIFICATE_OF_GALLINT, 1);
st.giveItems(LIONEL_COVENANT, 1);
@@ -251,12 +251,13 @@ public class Q405_PathToACleric extends Quest
htmltext = "30408-05.htm";
}
break;
-
+ }
case GALLINT:
+ {
if (cond == 4)
{
htmltext = "30017-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LIONEL_BOOK, 1);
st.giveItems(CERTIFICATE_OF_GALLINT, 1);
@@ -266,8 +267,10 @@ public class Q405_PathToACleric extends Quest
htmltext = "30017-02.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -276,7 +279,7 @@ public class Q405_PathToACleric extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q406_PathToAnElvenKnight/Q406_PathToAnElvenKnight.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q406_PathToAnElvenKnight/Q406_PathToAnElvenKnight.java
index bab071b340..f7545930f6 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q406_PathToAnElvenKnight/Q406_PathToAnElvenKnight.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q406_PathToAnElvenKnight/Q406_PathToAnElvenKnight.java
@@ -26,6 +26,9 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q406_PathToAnElvenKnight extends Quest
{
+ // NPCs
+ private static final int SORIUS = 30327;
+ private static final int KLUTO = 30317;
// Items
private static final int SORIUS_LETTER = 1202;
private static final int KLUTO_BOX = 1203;
@@ -34,19 +37,12 @@ public class Q406_PathToAnElvenKnight extends Quest
private static final int EMERALD_PIECE = 1206;
private static final int KLUTO_MEMO = 1276;
- // NPCs
- private static final int SORIUS = 30327;
- private static final int KLUTO = 30317;
-
public Q406_PathToAnElvenKnight()
{
super(406, "Path to an Elven Knight");
-
registerQuestItems(SORIUS_LETTER, KLUTO_BOX, TOPAZ_PIECE, EMERALD_PIECE, KLUTO_MEMO);
-
addStartNpc(SORIUS);
addTalkId(SORIUS, KLUTO);
-
addKillId(20035, 20042, 20045, 20051, 20054, 20060, 20782);
}
@@ -60,34 +56,38 @@ public class Q406_PathToAnElvenKnight extends Quest
return htmltext;
}
- if (event.equals("30327-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.ELVEN_FIGHTER)
+ case "30327-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ELVEN_KNIGHT) ? "30327-02a.htm" : "30327-02.htm";
+ if (player.getClassId() != ClassId.ELVEN_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ELVEN_KNIGHT) ? "30327-02a.htm" : "30327-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30327-03.htm";
+ }
+ else if (st.hasQuestItems(ELVEN_KNIGHT_BROOCH))
+ {
+ htmltext = "30327-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30327-06.htm":
{
- htmltext = "30327-03.htm";
+ st.startQuest();
+ break;
}
- else if (st.hasQuestItems(ELVEN_KNIGHT_BROOCH))
+ case "30317-02.htm":
{
- htmltext = "30327-04.htm";
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SORIUS_LETTER, 1);
+ st.giveItems(KLUTO_MEMO, 1);
+ break;
}
}
- else if (event.equals("30327-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30317-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SORIUS_LETTER, 1);
- st.giveItems(KLUTO_MEMO, 1);
- }
return htmltext;
}
@@ -105,14 +105,17 @@ public class Q406_PathToAnElvenKnight extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30327-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SORIUS:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(TOPAZ_PIECE)) ? "30327-07.htm" : "30327-08.htm";
@@ -120,7 +123,7 @@ public class Q406_PathToAnElvenKnight extends Quest
else if (cond == 2)
{
htmltext = "30327-09.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SORIUS_LETTER, 1);
}
@@ -140,8 +143,9 @@ public class Q406_PathToAnElvenKnight extends Quest
st.exitQuest(true);
}
break;
-
+ }
case KLUTO:
+ {
if (cond == 3)
{
htmltext = "30317-01.htm";
@@ -153,7 +157,7 @@ public class Q406_PathToAnElvenKnight extends Quest
else if (cond == 5)
{
htmltext = "30317-05.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(EMERALD_PIECE, -1);
st.takeItems(TOPAZ_PIECE, -1);
@@ -164,8 +168,10 @@ public class Q406_PathToAnElvenKnight extends Quest
htmltext = "30317-06.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -188,18 +194,21 @@ public class Q406_PathToAnElvenKnight extends Quest
case 20051:
case 20054:
case 20060:
- if ((st.getInt("cond") == 1) && st.dropItems(TOPAZ_PIECE, 1, 20, 700000))
+ {
+ if (st.isCond(1) && st.dropItems(TOPAZ_PIECE, 1, 20, 700000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20782:
- if ((st.getInt("cond") == 4) && st.dropItems(EMERALD_PIECE, 1, 20, 500000))
+ {
+ if (st.isCond(4) && st.dropItems(EMERALD_PIECE, 1, 20, 500000))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q407_PathToAnElvenScout/Q407_PathToAnElvenScout.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q407_PathToAnElvenScout/Q407_PathToAnElvenScout.java
index 80533f1c06..9348342b8b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q407_PathToAnElvenScout/Q407_PathToAnElvenScout.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q407_PathToAnElvenScout/Q407_PathToAnElvenScout.java
@@ -26,6 +26,11 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q407_PathToAnElvenScout extends Quest
{
+ // NPCs
+ private static final int REISA = 30328;
+ private static final int BABENCO = 30334;
+ private static final int MORETTI = 30337;
+ private static final int PRIAS = 30426;
// Items
private static final int REISA_LETTER = 1207;
private static final int PRIAS_TORN_LETTER_1 = 1208;
@@ -39,21 +44,12 @@ public class Q407_PathToAnElvenScout extends Quest
private static final int REISA_RECOMMENDATION = 1217;
private static final int RUSTED_KEY = 1293;
- // NPCs
- private static final int REISA = 30328;
- private static final int BABENCO = 30334;
- private static final int MORETTI = 30337;
- private static final int PRIAS = 30426;
-
public Q407_PathToAnElvenScout()
{
super(407, "Path to an Elven Scout");
-
registerQuestItems(REISA_LETTER, PRIAS_TORN_LETTER_1, PRIAS_TORN_LETTER_2, PRIAS_TORN_LETTER_3, PRIAS_TORN_LETTER_4, MORETTI_HERB, MORETTI_LETTER, PRIAS_LETTER, HONORARY_GUARD, RUSTED_KEY);
-
addStartNpc(REISA);
addTalkId(REISA, MORETTI, BABENCO, PRIAS);
-
addKillId(20053, 27031);
}
@@ -83,15 +79,13 @@ public class Q407_PathToAnElvenScout extends Quest
}
else
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(REISA_LETTER, 1);
}
}
else if (event.equals("30337-03.htm"))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REISA_LETTER, -1);
}
@@ -112,14 +106,17 @@ public class Q407_PathToAnElvenScout extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30328-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case REISA:
+ {
if (cond == 1)
{
htmltext = "30328-06.htm";
@@ -139,8 +136,9 @@ public class Q407_PathToAnElvenScout extends Quest
st.exitQuest(true);
}
break;
-
+ }
case MORETTI:
+ {
if (cond == 1)
{
htmltext = "30337-01.htm";
@@ -152,7 +150,7 @@ public class Q407_PathToAnElvenScout extends Quest
else if (cond == 3)
{
htmltext = "30337-06.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PRIAS_TORN_LETTER_1, -1);
st.takeItems(PRIAS_TORN_LETTER_2, -1);
@@ -168,7 +166,7 @@ public class Q407_PathToAnElvenScout extends Quest
else if ((cond == 7) && st.hasQuestItems(PRIAS_LETTER))
{
htmltext = "30337-07.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PRIAS_LETTER, -1);
st.giveItems(HONORARY_GUARD, 1);
@@ -178,19 +176,21 @@ public class Q407_PathToAnElvenScout extends Quest
htmltext = "30337-08.htm";
}
break;
-
+ }
case BABENCO:
+ {
if (cond == 2)
{
htmltext = "30334-01.htm";
}
break;
-
+ }
case PRIAS:
+ {
if (cond == 4)
{
htmltext = "30426-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
@@ -200,7 +200,7 @@ public class Q407_PathToAnElvenScout extends Quest
else if (cond == 6)
{
htmltext = "30426-02.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RUSTED_KEY, -1);
st.takeItems(MORETTI_HERB, -1);
@@ -212,8 +212,10 @@ public class Q407_PathToAnElvenScout extends Quest
htmltext = "30426-04.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -228,7 +230,7 @@ public class Q407_PathToAnElvenScout extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (npc.getNpcId() == 20053)
{
if (cond == 2)
@@ -250,7 +252,7 @@ public class Q407_PathToAnElvenScout extends Quest
}
else if (!st.hasQuestItems(PRIAS_TORN_LETTER_4))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(PRIAS_TORN_LETTER_4, 1);
}
@@ -258,7 +260,7 @@ public class Q407_PathToAnElvenScout extends Quest
}
else if (((cond == 4) || (cond == 5)) && st.dropItems(RUSTED_KEY, 1, 1, 600000))
{
- st.set("cond", "6");
+ st.setCond(6);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q408_PathToAnElvenWizard/Q408_PathToAnElvenWizard.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q408_PathToAnElvenWizard/Q408_PathToAnElvenWizard.java
index 3f9658f669..f14c552c2d 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q408_PathToAnElvenWizard/Q408_PathToAnElvenWizard.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q408_PathToAnElvenWizard/Q408_PathToAnElvenWizard.java
@@ -26,6 +26,11 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q408_PathToAnElvenWizard extends Quest
{
+ // NPCs
+ private static final int ROSELLA = 30414;
+ private static final int GREENIS = 30157;
+ private static final int THALIA = 30371;
+ private static final int NORTHWIND = 30423;
// Items
private static final int ROSELLA_LETTER = 1218;
private static final int RED_DOWN = 1219;
@@ -42,21 +47,12 @@ public class Q408_PathToAnElvenWizard extends Quest
private static final int SAP_OF_THE_MOTHER_TREE = 1273;
private static final int LUCKY_POTPOURRI = 1274;
- // NPCs
- private static final int ROSELLA = 30414;
- private static final int GREENIS = 30157;
- private static final int THALIA = 30371;
- private static final int NORTHWIND = 30423;
-
public Q408_PathToAnElvenWizard()
{
super(408, "Path to an Elven Wizard");
-
registerQuestItems(ROSELLA_LETTER, RED_DOWN, MAGICAL_POWERS_RUBY, PURE_AQUAMARINE, APPETIZING_APPLE, GOLD_LEAVES, IMMORTAL_LOVE, AMETHYST, NOBILITY_AMETHYST, FERTILITY_PERIDOT, CHARM_OF_GRAIN, SAP_OF_THE_MOTHER_TREE, LUCKY_POTPOURRI);
-
addStartNpc(ROSELLA);
addTalkId(ROSELLA, GREENIS, THALIA, NORTHWIND);
-
addKillId(20047, 20019, 20466);
}
@@ -70,75 +66,82 @@ public class Q408_PathToAnElvenWizard extends Quest
return htmltext;
}
- if (event.equals("30414-06.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.ELVEN_MAGE)
+ case "30414-06.htm":
{
- htmltext = (player.getClassId() == ClassId.ELVEN_WIZARD) ? "30414-02a.htm" : "30414-03.htm";
+ if (player.getClassId() != ClassId.ELVEN_MAGE)
+ {
+ htmltext = (player.getClassId() == ClassId.ELVEN_WIZARD) ? "30414-02a.htm" : "30414-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30414-04.htm";
+ }
+ else if (st.hasQuestItems(ETERNITY_DIAMOND))
+ {
+ htmltext = "30414-05.htm";
+ }
+ else
+ {
+ st.startQuest();
+ st.giveItems(FERTILITY_PERIDOT, 1);
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30414-07.htm":
{
- htmltext = "30414-04.htm";
+ if (!st.hasQuestItems(MAGICAL_POWERS_RUBY))
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(ROSELLA_LETTER, 1);
+ }
+ else
+ {
+ htmltext = "30414-10.htm";
+ }
+ break;
}
- else if (st.hasQuestItems(ETERNITY_DIAMOND))
+ case "30414-14.htm":
{
- htmltext = "30414-05.htm";
+ if (!st.hasQuestItems(PURE_AQUAMARINE))
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(APPETIZING_APPLE, 1);
+ }
+ else
+ {
+ htmltext = "30414-13.htm";
+ }
+ break;
}
- else
+ case "30414-18.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(FERTILITY_PERIDOT, 1);
+ if (!st.hasQuestItems(NOBILITY_AMETHYST))
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(IMMORTAL_LOVE, 1);
+ }
+ else
+ {
+ htmltext = "30414-17.htm";
+ }
+ break;
}
- }
- else if (event.equals("30414-07.htm"))
- {
- if (!st.hasQuestItems(MAGICAL_POWERS_RUBY))
+ case "30157-02.htm":
{
st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(ROSELLA_LETTER, 1);
+ st.takeItems(ROSELLA_LETTER, 1);
+ st.giveItems(CHARM_OF_GRAIN, 1);
+ break;
}
- else
- {
- htmltext = "30414-10.htm";
- }
- }
- else if (event.equals("30414-14.htm"))
- {
- if (!st.hasQuestItems(PURE_AQUAMARINE))
+ case "30371-02.htm":
{
st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(APPETIZING_APPLE, 1);
+ st.takeItems(APPETIZING_APPLE, 1);
+ st.giveItems(SAP_OF_THE_MOTHER_TREE, 1);
+ break;
}
- else
- {
- htmltext = "30414-13.htm";
- }
- }
- else if (event.equals("30414-18.htm"))
- {
- if (!st.hasQuestItems(NOBILITY_AMETHYST))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(IMMORTAL_LOVE, 1);
- }
- else
- {
- htmltext = "30414-17.htm";
- }
- }
- else if (event.equals("30157-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROSELLA_LETTER, 1);
- st.giveItems(CHARM_OF_GRAIN, 1);
- }
- else if (event.equals("30371-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(APPETIZING_APPLE, 1);
- st.giveItems(SAP_OF_THE_MOTHER_TREE, 1);
}
return htmltext;
@@ -157,13 +160,16 @@ public class Q408_PathToAnElvenWizard extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30414-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case ROSELLA:
+ {
if (st.hasQuestItems(MAGICAL_POWERS_RUBY, NOBILITY_AMETHYST, PURE_AQUAMARINE))
{
htmltext = "30414-24.htm";
@@ -227,8 +233,9 @@ public class Q408_PathToAnElvenWizard extends Quest
htmltext = "30414-11.htm";
}
break;
-
+ }
case GREENIS:
+ {
if (st.hasQuestItems(ROSELLA_LETTER))
{
htmltext = "30157-01.htm";
@@ -246,8 +253,9 @@ public class Q408_PathToAnElvenWizard extends Quest
htmltext = "30157-03.htm";
}
break;
-
+ }
case THALIA:
+ {
if (st.hasQuestItems(APPETIZING_APPLE))
{
htmltext = "30371-01.htm";
@@ -265,8 +273,9 @@ public class Q408_PathToAnElvenWizard extends Quest
htmltext = "30371-03.htm";
}
break;
-
+ }
case NORTHWIND:
+ {
if (st.hasQuestItems(IMMORTAL_LOVE))
{
htmltext = "30423-01.htm";
@@ -287,8 +296,10 @@ public class Q408_PathToAnElvenWizard extends Quest
htmltext = "30423-02.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -306,25 +317,29 @@ public class Q408_PathToAnElvenWizard extends Quest
switch (npc.getNpcId())
{
case 20019:
+ {
if (st.hasQuestItems(SAP_OF_THE_MOTHER_TREE))
{
st.dropItems(GOLD_LEAVES, 1, 5, 400000);
}
break;
-
+ }
case 20047:
+ {
if (st.hasQuestItems(LUCKY_POTPOURRI))
{
st.dropItems(AMETHYST, 1, 2, 400000);
}
break;
-
+ }
case 20466:
+ {
if (st.hasQuestItems(CHARM_OF_GRAIN))
{
st.dropItems(RED_DOWN, 1, 5, 700000);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q409_PathToAnElvenOracle/Q409_PathToAnElvenOracle.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q409_PathToAnElvenOracle/Q409_PathToAnElvenOracle.java
index ffad6c7b37..fa3f153d48 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q409_PathToAnElvenOracle/Q409_PathToAnElvenOracle.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q409_PathToAnElvenOracle/Q409_PathToAnElvenOracle.java
@@ -26,6 +26,10 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q409_PathToAnElvenOracle extends Quest
{
+ // NPCs
+ private static final int MANUEL = 30293;
+ private static final int ALLANA = 30424;
+ private static final int PERRIN = 30428;
// Items
private static final int CRYSTAL_MEDALLION = 1231;
private static final int SWINDLER_MONEY = 1232;
@@ -35,20 +39,12 @@ public class Q409_PathToAnElvenOracle extends Quest
private static final int HALF_OF_DIARY = 1236;
private static final int TAMIL_NECKLACE = 1275;
- // NPCs
- private static final int MANUEL = 30293;
- private static final int ALLANA = 30424;
- private static final int PERRIN = 30428;
-
public Q409_PathToAnElvenOracle()
{
super(409, "Path to an Elven Oracle");
-
registerQuestItems(CRYSTAL_MEDALLION, SWINDLER_MONEY, ALLANA_DIARY, LIZARD_CAPTAIN_ORDER, HALF_OF_DIARY, TAMIL_NECKLACE);
-
addStartNpc(MANUEL);
addTalkId(MANUEL, ALLANA, PERRIN);
-
addKillId(27032, 27033, 27034, 27035);
}
@@ -62,25 +58,28 @@ public class Q409_PathToAnElvenOracle extends Quest
return htmltext;
}
- if (event.equals("30293-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(CRYSTAL_MEDALLION, 1);
- }
- else if (event.equals("spawn_lizards"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- addSpawn(27032, -92319, 154235, -3284, 2000, false, 0);
- addSpawn(27033, -92361, 154190, -3284, 2000, false, 0);
- addSpawn(27034, -92375, 154278, -3278, 2000, false, 0);
- return null;
- }
- else if (event.equals("30428-06.htm"))
- {
- addSpawn(27035, -93194, 147587, -2672, 2000, false, 0);
+ case "30293-05.htm":
+ {
+ st.startQuest();
+ st.giveItems(CRYSTAL_MEDALLION, 1);
+ break;
+ }
+ case "spawn_lizards":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ addSpawn(27032, -92319, 154235, -3284, 2000, false, 0);
+ addSpawn(27033, -92361, 154190, -3284, 2000, false, 0);
+ addSpawn(27034, -92375, 154278, -3278, 2000, false, 0);
+ return null;
+ }
+ case "30428-06.htm":
+ {
+ addSpawn(27035, -93194, 147587, -2672, 2000, false, 0);
+ break;
+ }
}
return htmltext;
@@ -99,6 +98,7 @@ public class Q409_PathToAnElvenOracle extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId() != ClassId.ELVEN_MAGE)
{
htmltext = (player.getClassId() == ClassId.ORACLE) ? "30293-02a.htm" : "30293-02.htm";
@@ -116,12 +116,14 @@ public class Q409_PathToAnElvenOracle extends Quest
htmltext = "30293-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MANUEL:
+ {
if (cond == 1)
{
htmltext = "30293-06.htm";
@@ -148,8 +150,9 @@ public class Q409_PathToAnElvenOracle extends Quest
st.exitQuest(true);
}
break;
-
+ }
case ALLANA:
+ {
if (cond == 1)
{
htmltext = "30424-01.htm";
@@ -157,7 +160,7 @@ public class Q409_PathToAnElvenOracle extends Quest
else if (cond == 3)
{
htmltext = "30424-02.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HALF_OF_DIARY, 1);
}
@@ -172,7 +175,7 @@ public class Q409_PathToAnElvenOracle extends Quest
else if (cond == 6)
{
htmltext = "30424-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HALF_OF_DIARY, -1);
st.giveItems(ALLANA_DIARY, 1);
@@ -182,8 +185,9 @@ public class Q409_PathToAnElvenOracle extends Quest
htmltext = "30424-05.htm";
}
break;
-
+ }
case PERRIN:
+ {
if (cond == 4)
{
htmltext = "30428-01.htm";
@@ -191,7 +195,7 @@ public class Q409_PathToAnElvenOracle extends Quest
else if (cond == 5)
{
htmltext = "30428-04.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TAMIL_NECKLACE, -1);
st.giveItems(SWINDLER_MONEY, 1);
@@ -201,8 +205,10 @@ public class Q409_PathToAnElvenOracle extends Quest
htmltext = "30428-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -219,16 +225,16 @@ public class Q409_PathToAnElvenOracle extends Quest
if (npc.getNpcId() == 27035)
{
- if (st.getInt("cond") == 4)
+ if (st.isCond(4))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(TAMIL_NECKLACE, 1);
}
}
- else if (st.getInt("cond") == 2)
+ else if (st.isCond(2))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LIZARD_CAPTAIN_ORDER, 1);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q410_PathToAPalusKnight/Q410_PathToAPalusKnight.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q410_PathToAPalusKnight/Q410_PathToAPalusKnight.java
index 64e404a463..95f1760940 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q410_PathToAPalusKnight/Q410_PathToAPalusKnight.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q410_PathToAPalusKnight/Q410_PathToAPalusKnight.java
@@ -26,6 +26,13 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q410_PathToAPalusKnight extends Quest
{
+ // NPCs
+ private static final int KALINTA = 30422;
+ private static final int VIRGIL = 30329;
+ // Monsters
+ private static final int POISON_SPIDER = 20038;
+ private static final int ARACHNID_TRACKER = 20043;
+ private static final int LYCANTHROPE = 20049;
// Items
private static final int PALUS_TALISMAN = 1237;
private static final int LYCANTHROPE_SKULL = 1238;
@@ -36,24 +43,12 @@ public class Q410_PathToAPalusKnight extends Quest
private static final int COFFIN_OF_ETERNAL_REST = 1243;
private static final int GAZE_OF_ABYSS = 1244;
- // NPCs
- private static final int KALINTA = 30422;
- private static final int VIRGIL = 30329;
-
- // Monsters
- private static final int POISON_SPIDER = 20038;
- private static final int ARACHNID_TRACKER = 20043;
- private static final int LYCANTHROPE = 20049;
-
public Q410_PathToAPalusKnight()
{
super(410, "Path to a Palus Knight");
-
registerQuestItems(PALUS_TALISMAN, LYCANTHROPE_SKULL, VIRGIL_LETTER, MORTE_TALISMAN, PREDATOR_CARAPACE, ARACHNID_TRACKER_SILK, COFFIN_OF_ETERNAL_REST);
-
addStartNpc(VIRGIL);
addTalkId(VIRGIL, KALINTA);
-
addKillId(POISON_SPIDER, ARACHNID_TRACKER, LYCANTHROPE);
}
@@ -67,51 +62,57 @@ public class Q410_PathToAPalusKnight extends Quest
return htmltext;
}
- if (event.equals("30329-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DARK_FIGHTER)
+ case "30329-05.htm":
{
- htmltext = (player.getClassId() == ClassId.PALUS_KNIGHT) ? "30329-02a.htm" : "30329-03.htm";
+ if (player.getClassId() != ClassId.DARK_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.PALUS_KNIGHT) ? "30329-02a.htm" : "30329-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30329-02.htm";
+ }
+ else if (st.hasQuestItems(GAZE_OF_ABYSS))
+ {
+ htmltext = "30329-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30329-06.htm":
{
- htmltext = "30329-02.htm";
+ st.startQuest();
+ st.giveItems(PALUS_TALISMAN, 1);
+ break;
}
- else if (st.hasQuestItems(GAZE_OF_ABYSS))
+ case "30329-10.htm":
{
- htmltext = "30329-04.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LYCANTHROPE_SKULL, -1);
+ st.takeItems(PALUS_TALISMAN, 1);
+ st.giveItems(VIRGIL_LETTER, 1);
+ break;
+ }
+ case "30422-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VIRGIL_LETTER, 1);
+ st.giveItems(MORTE_TALISMAN, 1);
+ break;
+ }
+ case "30422-06.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARACHNID_TRACKER_SILK, -1);
+ st.takeItems(MORTE_TALISMAN, 1);
+ st.takeItems(PREDATOR_CARAPACE, -1);
+ st.giveItems(COFFIN_OF_ETERNAL_REST, 1);
+ break;
}
- }
- else if (event.equals("30329-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(PALUS_TALISMAN, 1);
- }
- else if (event.equals("30329-10.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LYCANTHROPE_SKULL, -1);
- st.takeItems(PALUS_TALISMAN, 1);
- st.giveItems(VIRGIL_LETTER, 1);
- }
- else if (event.equals("30422-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VIRGIL_LETTER, 1);
- st.giveItems(MORTE_TALISMAN, 1);
- }
- else if (event.equals("30422-06.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARACHNID_TRACKER_SILK, -1);
- st.takeItems(MORTE_TALISMAN, 1);
- st.takeItems(PREDATOR_CARAPACE, -1);
- st.giveItems(COFFIN_OF_ETERNAL_REST, 1);
}
return htmltext;
@@ -130,14 +131,17 @@ public class Q410_PathToAPalusKnight extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30329-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VIRGIL:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(LYCANTHROPE_SKULL)) ? "30329-07.htm" : "30329-08.htm";
@@ -161,8 +165,9 @@ public class Q410_PathToAPalusKnight extends Quest
st.exitQuest(true);
}
break;
-
+ }
case KALINTA:
+ {
if (cond == 3)
{
htmltext = "30422-01.htm";
@@ -187,8 +192,10 @@ public class Q410_PathToAPalusKnight extends Quest
htmltext = "30422-06.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -206,25 +213,29 @@ public class Q410_PathToAPalusKnight extends Quest
switch (npc.getNpcId())
{
case LYCANTHROPE:
- if ((st.getInt("cond") == 1) && st.dropItemsAlways(LYCANTHROPE_SKULL, 1, 13))
+ {
+ if (st.isCond(1) && st.dropItemsAlways(LYCANTHROPE_SKULL, 1, 13))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case ARACHNID_TRACKER:
- if ((st.getInt("cond") == 4) && st.dropItemsAlways(ARACHNID_TRACKER_SILK, 1, 5) && st.hasQuestItems(PREDATOR_CARAPACE))
+ {
+ if (st.isCond(4) && st.dropItemsAlways(ARACHNID_TRACKER_SILK, 1, 5) && st.hasQuestItems(PREDATOR_CARAPACE))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case POISON_SPIDER:
- if ((st.getInt("cond") == 4) && st.dropItemsAlways(PREDATOR_CARAPACE, 1, 1) && (st.getQuestItemsCount(ARACHNID_TRACKER_SILK) == 5))
+ {
+ if (st.isCond(4) && st.dropItemsAlways(PREDATOR_CARAPACE, 1, 1) && (st.getQuestItemsCount(ARACHNID_TRACKER_SILK) == 5))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q411_PathToAnAssassin/Q411_PathToAnAssassin.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q411_PathToAnAssassin/Q411_PathToAnAssassin.java
index ae8e69c1e6..fbcc0fd217 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q411_PathToAnAssassin/Q411_PathToAnAssassin.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q411_PathToAnAssassin/Q411_PathToAnAssassin.java
@@ -26,6 +26,10 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q411_PathToAnAssassin extends Quest
{
+ // NPCs
+ private static final int TRISKEL = 30416;
+ private static final int ARKENIA = 30419;
+ private static final int LEIKAN = 30382;
// Items
private static final int SHILEN_CALL = 1245;
private static final int ARKENIA_LETTER = 1246;
@@ -35,20 +39,12 @@ public class Q411_PathToAnAssassin extends Quest
private static final int ARKENIA_RECOMMENDATION = 1251;
private static final int IRON_HEART = 1252;
- // NPCs
- private static final int TRISKEL = 30416;
- private static final int ARKENIA = 30419;
- private static final int LEIKAN = 30382;
-
public Q411_PathToAnAssassin()
{
super(411, "Path to an Assassin");
-
registerQuestItems(SHILEN_CALL, ARKENIA_LETTER, LEIKAN_NOTE, MOONSTONE_BEAST_MOLAR, SHILEN_TEARS, ARKENIA_RECOMMENDATION);
-
addStartNpc(TRISKEL);
addTalkId(TRISKEL, ARKENIA, LEIKAN);
-
addKillId(27036, 20369);
}
@@ -62,41 +58,45 @@ public class Q411_PathToAnAssassin extends Quest
return htmltext;
}
- if (event.equals("30416-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DARK_FIGHTER)
+ case "30416-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ASSASSIN) ? "30416-02a.htm" : "30416-02.htm";
+ if (player.getClassId() != ClassId.DARK_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ASSASSIN) ? "30416-02a.htm" : "30416-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30416-03.htm";
+ }
+ else if (st.hasQuestItems(IRON_HEART))
+ {
+ htmltext = "30416-04.htm";
+ }
+ else
+ {
+ st.startQuest();
+ st.giveItems(SHILEN_CALL, 1);
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30419-05.htm":
{
- htmltext = "30416-03.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SHILEN_CALL, 1);
+ st.giveItems(ARKENIA_LETTER, 1);
+ break;
}
- else if (st.hasQuestItems(IRON_HEART))
+ case "30382-03.htm":
{
- htmltext = "30416-04.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARKENIA_LETTER, 1);
+ st.giveItems(LEIKAN_NOTE, 1);
+ break;
}
- else
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(SHILEN_CALL, 1);
- }
- }
- else if (event.equals("30419-05.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SHILEN_CALL, 1);
- st.giveItems(ARKENIA_LETTER, 1);
- }
- else if (event.equals("30382-03.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARKENIA_LETTER, 1);
- st.giveItems(LEIKAN_NOTE, 1);
}
return htmltext;
@@ -115,14 +115,17 @@ public class Q411_PathToAnAssassin extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30416-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case TRISKEL:
+ {
if (cond == 1)
{
htmltext = "30416-11.htm";
@@ -154,8 +157,9 @@ public class Q411_PathToAnAssassin extends Quest
st.exitQuest(true);
}
break;
-
+ }
case ARKENIA:
+ {
if (cond == 1)
{
htmltext = "30419-01.htm";
@@ -175,7 +179,7 @@ public class Q411_PathToAnAssassin extends Quest
else if (cond == 6)
{
htmltext = "30419-08.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SHILEN_TEARS, -1);
st.giveItems(ARKENIA_RECOMMENDATION, 1);
@@ -185,8 +189,9 @@ public class Q411_PathToAnAssassin extends Quest
htmltext = "30419-09.htm";
}
break;
-
+ }
case LEIKAN:
+ {
if (cond == 2)
{
htmltext = "30382-01.htm";
@@ -198,7 +203,7 @@ public class Q411_PathToAnAssassin extends Quest
else if (cond == 4)
{
htmltext = "30382-07.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MOONSTONE_BEAST_MOLAR, -1);
st.takeItems(LEIKAN_NOTE, -1);
@@ -212,8 +217,10 @@ public class Q411_PathToAnAssassin extends Quest
htmltext = "30382-08.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -230,14 +237,14 @@ public class Q411_PathToAnAssassin extends Quest
if (npc.getNpcId() == 20369)
{
- if ((st.getInt("cond") == 3) && st.dropItemsAlways(MOONSTONE_BEAST_MOLAR, 1, 10))
+ if (st.isCond(3) && st.dropItemsAlways(MOONSTONE_BEAST_MOLAR, 1, 10))
{
- st.set("cond", "4");
+ st.setCond(4);
}
}
- else if (st.getInt("cond") == 5)
+ else if (st.isCond(5))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SHILEN_TEARS, 1);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q412_PathToADarkWizard/Q412_PathToADarkWizard.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q412_PathToADarkWizard/Q412_PathToADarkWizard.java
index dc08c6df65..be048bc93c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q412_PathToADarkWizard/Q412_PathToADarkWizard.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q412_PathToADarkWizard/Q412_PathToADarkWizard.java
@@ -26,6 +26,11 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q412_PathToADarkWizard extends Quest
{
+ // NPCs
+ private static final int VARIKA = 30421;
+ private static final int CHARKEREN = 30415;
+ private static final int ANNIKA = 30418;
+ private static final int ARKENIA = 30419;
// Items
private static final int SEED_OF_ANGER = 1253;
private static final int SEED_OF_DESPAIR = 1254;
@@ -40,21 +45,12 @@ public class Q412_PathToADarkWizard extends Quest
private static final int CANDLE = 1278;
private static final int HUB_SCENT = 1279;
- // NPCs
- private static final int VARIKA = 30421;
- private static final int CHARKEREN = 30415;
- private static final int ANNIKA = 30418;
- private static final int ARKENIA = 30419;
-
public Q412_PathToADarkWizard()
{
super(412, "Path to a Dark Wizard");
-
registerQuestItems(SEED_OF_ANGER, SEED_OF_DESPAIR, SEED_OF_HORROR, SEED_OF_LUNACY, FAMILY_REMAINS, VARIKA_LIQUOR, KNEE_BONE, HEART_OF_LUNACY, LUCKY_KEY, CANDLE, HUB_SCENT);
-
addStartNpc(VARIKA);
addTalkId(VARIKA, CHARKEREN, ANNIKA, ARKENIA);
-
addKillId(20015, 20022, 20045, 20517, 20518);
}
@@ -68,70 +64,77 @@ public class Q412_PathToADarkWizard extends Quest
return htmltext;
}
- if (event.equals("30421-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DARK_MAGE)
+ case "30421-05.htm":
{
- htmltext = (player.getClassId() == ClassId.DARK_WIZARD) ? "30421-02a.htm" : "30421-03.htm";
+ if (player.getClassId() != ClassId.DARK_MAGE)
+ {
+ htmltext = (player.getClassId() == ClassId.DARK_WIZARD) ? "30421-02a.htm" : "30421-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30421-02.htm";
+ }
+ else if (st.hasQuestItems(JEWEL_OF_DARKNESS))
+ {
+ htmltext = "30421-04.htm";
+ }
+ else
+ {
+ st.startQuest();
+ st.giveItems(SEED_OF_DESPAIR, 1);
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30421-07.htm":
{
- htmltext = "30421-02.htm";
+ if (st.hasQuestItems(SEED_OF_ANGER))
+ {
+ htmltext = "30421-06.htm";
+ }
+ else if (st.hasQuestItems(LUCKY_KEY))
+ {
+ htmltext = "30421-08.htm";
+ }
+ else if (st.getQuestItemsCount(FAMILY_REMAINS) == 3)
+ {
+ htmltext = "30421-18.htm";
+ }
+ break;
}
- else if (st.hasQuestItems(JEWEL_OF_DARKNESS))
+ case "30421-10.htm":
{
- htmltext = "30421-04.htm";
+ if (st.hasQuestItems(SEED_OF_HORROR))
+ {
+ htmltext = "30421-09.htm";
+ }
+ else if (st.getQuestItemsCount(KNEE_BONE) == 2)
+ {
+ htmltext = "30421-19.htm";
+ }
+ break;
}
- else
+ case "30421-13.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(SEED_OF_DESPAIR, 1);
+ if (st.hasQuestItems(SEED_OF_LUNACY))
+ {
+ htmltext = "30421-12.htm";
+ }
+ break;
}
- }
- else if (event.equals("30421-07.htm"))
- {
- if (st.hasQuestItems(SEED_OF_ANGER))
+ case "30415-03.htm":
{
- htmltext = "30421-06.htm";
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(LUCKY_KEY, 1);
+ break;
}
- else if (st.hasQuestItems(LUCKY_KEY))
+ case "30418-02.htm":
{
- htmltext = "30421-08.htm";
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CANDLE, 1);
+ break;
}
- else if (st.getQuestItemsCount(FAMILY_REMAINS) == 3)
- {
- htmltext = "30421-18.htm";
- }
- }
- else if (event.equals("30421-10.htm"))
- {
- if (st.hasQuestItems(SEED_OF_HORROR))
- {
- htmltext = "30421-09.htm";
- }
- else if (st.getQuestItemsCount(KNEE_BONE) == 2)
- {
- htmltext = "30421-19.htm";
- }
- }
- else if (event.equals("30421-13.htm"))
- {
- if (st.hasQuestItems(SEED_OF_LUNACY))
- {
- htmltext = "30421-12.htm";
- }
- }
- else if (event.equals("30415-03.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(LUCKY_KEY, 1);
- }
- else if (event.equals("30418-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CANDLE, 1);
}
return htmltext;
@@ -150,13 +153,16 @@ public class Q412_PathToADarkWizard extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30421-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case VARIKA:
+ {
if (st.hasQuestItems(SEED_OF_ANGER, SEED_OF_HORROR, SEED_OF_LUNACY))
{
htmltext = "30421-16.htm";
@@ -175,8 +181,9 @@ public class Q412_PathToADarkWizard extends Quest
htmltext = "30421-17.htm";
}
break;
-
+ }
case CHARKEREN:
+ {
if (st.hasQuestItems(SEED_OF_ANGER))
{
htmltext = "30415-06.htm";
@@ -198,8 +205,9 @@ public class Q412_PathToADarkWizard extends Quest
htmltext = "30415-04.htm";
}
break;
-
+ }
case ANNIKA:
+ {
if (st.hasQuestItems(SEED_OF_HORROR))
{
htmltext = "30418-04.htm";
@@ -221,8 +229,9 @@ public class Q412_PathToADarkWizard extends Quest
htmltext = "30418-03.htm";
}
break;
-
+ }
case ARKENIA:
+ {
if (st.hasQuestItems(SEED_OF_LUNACY))
{
htmltext = "30419-03.htm";
@@ -246,8 +255,10 @@ public class Q412_PathToADarkWizard extends Quest
htmltext = "30419-02.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -265,27 +276,31 @@ public class Q412_PathToADarkWizard extends Quest
switch (npc.getNpcId())
{
case 20015:
+ {
if (st.hasQuestItems(LUCKY_KEY))
{
st.dropItems(FAMILY_REMAINS, 1, 3, 500000);
}
break;
-
+ }
case 20022:
case 20517:
case 20518:
+ {
if (st.hasQuestItems(CANDLE))
{
st.dropItems(KNEE_BONE, 1, 2, 500000);
}
break;
-
+ }
case 20045:
+ {
if (st.hasQuestItems(HUB_SCENT))
{
st.dropItems(HEART_OF_LUNACY, 1, 3, 500000);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q413_PathToAShillienOracle/Q413_PathToAShillienOracle.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q413_PathToAShillienOracle/Q413_PathToAShillienOracle.java
index 6154f63548..5394c66ba3 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q413_PathToAShillienOracle/Q413_PathToAShillienOracle.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q413_PathToAShillienOracle/Q413_PathToAShillienOracle.java
@@ -26,6 +26,10 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q413_PathToAShillienOracle extends Quest
{
+ // NPCs
+ private static final int SIDRA = 30330;
+ private static final int ADONIUS = 30375;
+ private static final int TALBOT = 30377;
// Items
private static final int SIDRA_LETTER = 1262;
private static final int BLANK_SHEET = 1263;
@@ -37,20 +41,12 @@ public class Q413_PathToAShillienOracle extends Quest
private static final int ANDARIEL_BOOK = 1269;
private static final int ORB_OF_ABYSS = 1270;
- // NPCs
- private static final int SIDRA = 30330;
- private static final int ADONIUS = 30375;
- private static final int TALBOT = 30377;
-
public Q413_PathToAShillienOracle()
{
super(413, "Path to a Shillien Oracle");
-
registerQuestItems(SIDRA_LETTER, BLANK_SHEET, BLOODY_RUNE, GARMIEL_BOOK, PRAYER_OF_ADONIUS, PENITENT_MARK, ASHEN_BONES, ANDARIEL_BOOK);
-
addStartNpc(SIDRA);
addTalkId(SIDRA, ADONIUS, TALBOT);
-
addKillId(20776, 20457, 20458, 20514, 20515);
}
@@ -64,41 +60,46 @@ public class Q413_PathToAShillienOracle extends Quest
return htmltext;
}
- if (event.equals("30330-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DARK_MAGE)
+ case "30330-05.htm":
{
- htmltext = (player.getClassId() == ClassId.SHILLIEN_ORACLE) ? "30330-02a.htm" : "30330-03.htm";
+ if (player.getClassId() != ClassId.DARK_MAGE)
+ {
+ htmltext = (player.getClassId() == ClassId.SHILLIEN_ORACLE) ? "30330-02a.htm" : "30330-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30330-02.htm";
+ }
+ else if (st.hasQuestItems(ORB_OF_ABYSS))
+ {
+ htmltext = "30330-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30330-06.htm":
{
- htmltext = "30330-02.htm";
+ st.startQuest();
+ st.giveItems(SIDRA_LETTER, 1);
+ break;
}
- else if (st.hasQuestItems(ORB_OF_ABYSS))
+ case "30377-02.htm":
{
- htmltext = "30330-04.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SIDRA_LETTER, 1);
+ st.giveItems(BLANK_SHEET, 5);
+ break;
+ }
+ case "30375-04.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PRAYER_OF_ADONIUS, 1);
+ st.giveItems(PENITENT_MARK, 1);
+ break;
}
- }
- else if (event.equals("30330-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(SIDRA_LETTER, 1);
- }
- else if (event.equals("30377-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SIDRA_LETTER, 1);
- st.giveItems(BLANK_SHEET, 5);
- }
- else if (event.equals("30375-04.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PRAYER_OF_ADONIUS, 1);
- st.giveItems(PENITENT_MARK, 1);
}
return htmltext;
@@ -117,14 +118,17 @@ public class Q413_PathToAShillienOracle extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30330-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SIDRA:
+ {
if (cond == 1)
{
htmltext = "30330-07.htm";
@@ -149,8 +153,9 @@ public class Q413_PathToAShillienOracle extends Quest
st.exitQuest(true);
}
break;
-
+ }
case TALBOT:
+ {
if (cond == 1)
{
htmltext = "30377-01.htm";
@@ -162,7 +167,7 @@ public class Q413_PathToAShillienOracle extends Quest
else if (cond == 3)
{
htmltext = "30377-05.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BLOODY_RUNE, -1);
st.giveItems(GARMIEL_BOOK, 1);
@@ -177,8 +182,9 @@ public class Q413_PathToAShillienOracle extends Quest
htmltext = "30377-07.htm";
}
break;
-
+ }
case ADONIUS:
+ {
if (cond == 4)
{
htmltext = "30375-01.htm";
@@ -190,7 +196,7 @@ public class Q413_PathToAShillienOracle extends Quest
else if (cond == 6)
{
htmltext = "30375-07.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ASHEN_BONES, -1);
st.takeItems(PENITENT_MARK, -1);
@@ -201,8 +207,10 @@ public class Q413_PathToAShillienOracle extends Quest
htmltext = "30375-08.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -219,18 +227,18 @@ public class Q413_PathToAShillienOracle extends Quest
if (npc.getNpcId() == 20776)
{
- if (st.getInt("cond") == 2)
+ if (st.isCond(2))
{
st.takeItems(BLANK_SHEET, 1);
if (st.dropItemsAlways(BLOODY_RUNE, 1, 5))
{
- st.set("cond", "3");
+ st.setCond(3);
}
}
}
- else if ((st.getInt("cond") == 5) && st.dropItemsAlways(ASHEN_BONES, 1, 10))
+ else if (st.isCond(5) && st.dropItemsAlways(ASHEN_BONES, 1, 10))
{
- st.set("cond", "6");
+ st.setCond(6);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q414_PathToAnOrcRaider/Q414_PathToAnOrcRaider.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q414_PathToAnOrcRaider/Q414_PathToAnOrcRaider.java
index 616468c5c3..4b39140ba1 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q414_PathToAnOrcRaider/Q414_PathToAnOrcRaider.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q414_PathToAnOrcRaider/Q414_PathToAnOrcRaider.java
@@ -27,6 +27,15 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q414_PathToAnOrcRaider extends Quest
{
+ // NPCs
+ private static final int KARUKIA = 30570;
+ private static final int KASMAN = 30501;
+ private static final int TAZEER = 31978;
+ // Monsters
+ private static final int GOBLIN_TOMB_RAIDER_LEADER = 20320;
+ private static final int KURUKA_RATMAN_LEADER = 27045;
+ private static final int UMBAR_ORC = 27054;
+ private static final int TIMORA_ORC = 27320;
// Items
private static final int GREEN_BLOOD = 1578;
private static final int GOBLIN_DWELLING_MAP = 1579;
@@ -37,26 +46,12 @@ public class Q414_PathToAnOrcRaider extends Quest
private static final int MARK_OF_RAIDER = 1592;
private static final int TIMORA_ORC_HEAD = 8544;
- // NPCs
- private static final int KARUKIA = 30570;
- private static final int KASMAN = 30501;
- private static final int TAZEER = 31978;
-
- // Monsters
- private static final int GOBLIN_TOMB_RAIDER_LEADER = 20320;
- private static final int KURUKA_RATMAN_LEADER = 27045;
- private static final int UMBAR_ORC = 27054;
- private static final int TIMORA_ORC = 27320;
-
public Q414_PathToAnOrcRaider()
{
super(414, "Path to an Orc Raider");
-
registerQuestItems(GREEN_BLOOD, GOBLIN_DWELLING_MAP, KURUKA_RATMAN_TOOTH, BETRAYER_REPORT_1, BETRAYER_REPORT_2, HEAD_OF_BETRAYER, TIMORA_ORC_HEAD);
-
addStartNpc(KARUKIA);
addTalkId(KARUKIA, KASMAN, TAZEER);
-
addKillId(GOBLIN_TOMB_RAIDER_LEADER, KURUKA_RATMAN_LEADER, UMBAR_ORC, TIMORA_ORC);
}
@@ -70,51 +65,54 @@ public class Q414_PathToAnOrcRaider extends Quest
return htmltext;
}
- // KARUKIA
- if (event.equals("30570-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.ORC_FIGHTER)
+ case "30570-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ORC_RAIDER) ? "30570-02a.htm" : "30570-03.htm";
+ if (player.getClassId() != ClassId.ORC_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ORC_RAIDER) ? "30570-02a.htm" : "30570-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30570-02.htm";
+ }
+ else if (st.hasQuestItems(MARK_OF_RAIDER))
+ {
+ htmltext = "30570-04.htm";
+ }
+ else
+ {
+ st.startQuest();
+ st.giveItems(GOBLIN_DWELLING_MAP, 1);
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30570-07a.htm":
{
- htmltext = "30570-02.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GOBLIN_DWELLING_MAP, 1);
+ st.takeItems(KURUKA_RATMAN_TOOTH, -1);
+ st.giveItems(BETRAYER_REPORT_1, 1);
+ st.giveItems(BETRAYER_REPORT_2, 1);
+ break;
}
- else if (st.hasQuestItems(MARK_OF_RAIDER))
+ case "30570-07b.htm":
{
- htmltext = "30570-04.htm";
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GOBLIN_DWELLING_MAP, 1);
+ st.takeItems(KURUKA_RATMAN_TOOTH, -1);
+ break;
}
- else
+ case "31978-03.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(GOBLIN_DWELLING_MAP, 1);
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
}
- else if (event.equals("30570-07a.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GOBLIN_DWELLING_MAP, 1);
- st.takeItems(KURUKA_RATMAN_TOOTH, -1);
- st.giveItems(BETRAYER_REPORT_1, 1);
- st.giveItems(BETRAYER_REPORT_2, 1);
- }
- else if (event.equals("30570-07b.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GOBLIN_DWELLING_MAP, 1);
- st.takeItems(KURUKA_RATMAN_TOOTH, -1);
- }
- // TAZEER
- else if (event.equals("31978-03.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
return htmltext;
}
@@ -132,14 +130,17 @@ public class Q414_PathToAnOrcRaider extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30570-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case KARUKIA:
+ {
if (cond == 1)
{
htmltext = "30570-06.htm";
@@ -157,8 +158,9 @@ public class Q414_PathToAnOrcRaider extends Quest
htmltext = "30570-07b.htm";
}
break;
-
+ }
case KASMAN:
+ {
if (cond == 3)
{
htmltext = "30501-01.htm";
@@ -183,8 +185,9 @@ public class Q414_PathToAnOrcRaider extends Quest
}
}
break;
-
+ }
case TAZEER:
+ {
if (cond == 5)
{
htmltext = "31978-01.htm";
@@ -204,8 +207,10 @@ public class Q414_PathToAnOrcRaider extends Quest
st.exitQuest(true);
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -220,12 +225,11 @@ public class Q414_PathToAnOrcRaider extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case GOBLIN_TOMB_RAIDER_LEADER:
- if (cond == 1)
+ {
+ if (st.isCond(1))
{
if (st.getQuestItemsCount(GREEN_BLOOD) <= Rnd.get(20))
{
@@ -239,33 +243,37 @@ public class Q414_PathToAnOrcRaider extends Quest
}
}
break;
-
+ }
case KURUKA_RATMAN_LEADER:
- if ((cond == 1) && st.dropItemsAlways(KURUKA_RATMAN_TOOTH, 1, 10))
+ {
+ if (st.isCond(1) && st.dropItemsAlways(KURUKA_RATMAN_TOOTH, 1, 10))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case UMBAR_ORC:
- if (((cond == 3) || (cond == 4)) && (st.getQuestItemsCount(HEAD_OF_BETRAYER) < 2) && (Rnd.get(10) < 2))
+ {
+ if ((st.isCond(3) || st.isCond(4)) && (st.getQuestItemsCount(HEAD_OF_BETRAYER) < 2) && (Rnd.get(10) < 2))
{
- if (cond == 3)
+ if (st.isCond(3))
{
- st.set("cond", "4");
+ st.setCond(4);
}
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HEAD_OF_BETRAYER, 1);
}
break;
-
+ }
case TIMORA_ORC:
- if ((cond == 6) && st.dropItems(TIMORA_ORC_HEAD, 1, 1, 600000))
+ {
+ if (st.isCond(6) && st.dropItems(TIMORA_ORC_HEAD, 1, 1, 600000))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q415_PathToAMonk/Q415_PathToAMonk.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q415_PathToAMonk/Q415_PathToAMonk.java
index dcb3e133e3..ab541a74ca 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q415_PathToAMonk/Q415_PathToAMonk.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q415_PathToAMonk/Q415_PathToAMonk.java
@@ -28,6 +28,13 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q415_PathToAMonk extends Quest
{
+ // NPCs
+ private static final int GANTAKI = 30587;
+ private static final int ROSHEEK = 30590;
+ private static final int KASMAN = 30501;
+ private static final int TORUKU = 30591;
+ private static final int AREN = 32056;
+ private static final int MOIRA = 31979;
// Items
private static final int POMEGRANATE = 1593;
private static final int LEATHER_POUCH_1 = 1594;
@@ -55,23 +62,12 @@ public class Q415_PathToAMonk extends Quest
private static final int KASHA_SPIDER_TOOTH = 8545;
private static final int HORN_OF_BAAR_DRE_VANUL = 8546;
- // NPCs
- private static final int GANTAKI = 30587;
- private static final int ROSHEEK = 30590;
- private static final int KASMAN = 30501;
- private static final int TORUKU = 30591;
- private static final int AREN = 32056;
- private static final int MOIRA = 31979;
-
public Q415_PathToAMonk()
{
super(415, "Path to a Monk");
-
registerQuestItems(POMEGRANATE, LEATHER_POUCH_1, LEATHER_POUCH_2, LEATHER_POUCH_3, LEATHER_POUCH_FULL_1, LEATHER_POUCH_FULL_2, LEATHER_POUCH_FULL_3, KASHA_BEAR_CLAW, KASHA_BLADE_SPIDER_TALON, SCARLET_SALAMANDER_SCALE, FIERY_SPIRIT_SCROLL, ROSHEEK_LETTER, GANTAKI_LETTER_OF_RECOMMENDATION, FIG, LEATHER_POUCH_4, LEATHER_POUCH_FULL_4, VUKU_ORC_TUSK, RATMAN_FANG, LANG_KLIZARDMAN_TOOTH, FELIM_LIZARDMAN_TOOTH, IRON_WILL_SCROLL, TORUKU_LETTER, KASHA_SPIDER_TOOTH, HORN_OF_BAAR_DRE_VANUL);
-
addStartNpc(GANTAKI);
addTalkId(GANTAKI, ROSHEEK, KASMAN, TORUKU, AREN, MOIRA);
-
addKillId(20014, 20017, 20024, 20359, 20415, 20476, 20478, 20479, 21118);
}
@@ -85,54 +81,61 @@ public class Q415_PathToAMonk extends Quest
return htmltext;
}
- if (event.equals("30587-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.ORC_FIGHTER)
+ case "30587-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ORC_MONK) ? "30587-02a.htm" : "30587-02.htm";
+ if (player.getClassId() != ClassId.ORC_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ORC_MONK) ? "30587-02a.htm" : "30587-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30587-03.htm";
+ }
+ else if (st.hasQuestItems(KHAVATARI_TOTEM))
+ {
+ htmltext = "30587-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30587-06.htm":
{
- htmltext = "30587-03.htm";
+ st.startQuest();
+ st.giveItems(POMEGRANATE, 1);
+ break;
}
- else if (st.hasQuestItems(KHAVATARI_TOTEM))
+ case "30587-09a.htm":
{
- htmltext = "30587-04.htm";
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ROSHEEK_LETTER, 1);
+ st.giveItems(GANTAKI_LETTER_OF_RECOMMENDATION, 1);
+ break;
+ }
+ case "30587-09b.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ROSHEEK_LETTER, 1);
+ break;
+ }
+ case "32056-03.htm":
+ {
+ st.setCond(15);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32056-08.htm":
+ {
+ st.takeItems(FIERY_SPIRIT_SCROLL, 1);
+ st.giveItems(KHAVATARI_TOTEM, 1);
+ st.rewardExpAndSp(3200, 4230);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30587-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(POMEGRANATE, 1);
- }
- else if (event.equals("30587-09a.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROSHEEK_LETTER, 1);
- st.giveItems(GANTAKI_LETTER_OF_RECOMMENDATION, 1);
- }
- else if (event.equals("30587-09b.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROSHEEK_LETTER, 1);
- }
- else if (event.equals("32056-03.htm"))
- {
- st.set("cond", "15");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32056-08.htm"))
- {
- st.takeItems(FIERY_SPIRIT_SCROLL, 1);
- st.giveItems(KHAVATARI_TOTEM, 1);
- st.rewardExpAndSp(3200, 4230);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -151,14 +154,17 @@ public class Q415_PathToAMonk extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30587-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GANTAKI:
+ {
if (cond == 1)
{
htmltext = "30587-07.htm";
@@ -180,12 +186,13 @@ public class Q415_PathToAMonk extends Quest
htmltext = "30587-11.htm";
}
break;
-
+ }
case ROSHEEK:
+ {
if (cond == 1)
{
htmltext = "30590-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(POMEGRANATE, 1);
st.giveItems(LEATHER_POUCH_1, 1);
@@ -197,7 +204,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 3)
{
htmltext = "30590-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LEATHER_POUCH_FULL_1, 1);
st.giveItems(LEATHER_POUCH_2, 1);
@@ -209,7 +216,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 5)
{
htmltext = "30590-05.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LEATHER_POUCH_FULL_2, 1);
st.giveItems(LEATHER_POUCH_3, 1);
@@ -221,7 +228,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 7)
{
htmltext = "30590-07.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LEATHER_POUCH_FULL_3, 1);
st.giveItems(FIERY_SPIRIT_SCROLL, 1);
@@ -236,12 +243,13 @@ public class Q415_PathToAMonk extends Quest
htmltext = "30590-09.htm";
}
break;
-
+ }
case KASMAN:
+ {
if (cond == 9)
{
htmltext = "30501-01.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GANTAKI_LETTER_OF_RECOMMENDATION, 1);
st.giveItems(FIG, 1);
@@ -267,12 +275,13 @@ public class Q415_PathToAMonk extends Quest
st.exitQuest(true);
}
break;
-
+ }
case TORUKU:
+ {
if (cond == 10)
{
htmltext = "30591-01.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FIG, 1);
st.giveItems(LEATHER_POUCH_4, 1);
@@ -284,7 +293,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 12)
{
htmltext = "30591-03.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LEATHER_POUCH_FULL_4, 1);
st.giveItems(IRON_WILL_SCROLL, 1);
@@ -295,8 +304,9 @@ public class Q415_PathToAMonk extends Quest
htmltext = "30591-04.htm";
}
break;
-
+ }
case AREN:
+ {
if (cond == 14)
{
htmltext = "32056-01.htm";
@@ -308,7 +318,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 16)
{
htmltext = "32056-05.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KASHA_SPIDER_TOOTH, -1);
}
@@ -319,7 +329,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 18)
{
htmltext = "32056-07.htm";
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HORN_OF_BAAR_DRE_VANUL, -1);
}
@@ -328,16 +338,19 @@ public class Q415_PathToAMonk extends Quest
htmltext = "32056-09.htm";
}
break;
-
+ }
case MOIRA:
+ {
if (cond == 20)
{
htmltext = "31979-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -363,50 +376,55 @@ public class Q415_PathToAMonk extends Quest
switch (npc.getNpcId())
{
case 20479:
- if ((st.getInt("cond") == 2) && st.dropItemsAlways(KASHA_BEAR_CLAW, 1, 5))
+ {
+ if (st.isCond(2) && st.dropItemsAlways(KASHA_BEAR_CLAW, 1, 5))
{
- st.set("cond", "3");
+ st.setCond(3);
st.takeItems(KASHA_BEAR_CLAW, -1);
st.takeItems(LEATHER_POUCH_1, 1);
st.giveItems(LEATHER_POUCH_FULL_1, 1);
}
break;
-
+ }
case 20478:
- if ((st.getInt("cond") == 4) && st.dropItemsAlways(KASHA_BLADE_SPIDER_TALON, 1, 5))
+ {
+ if (st.isCond(4) && st.dropItemsAlways(KASHA_BLADE_SPIDER_TALON, 1, 5))
{
- st.set("cond", "5");
+ st.setCond(5);
st.takeItems(KASHA_BLADE_SPIDER_TALON, -1);
st.takeItems(LEATHER_POUCH_2, 1);
st.giveItems(LEATHER_POUCH_FULL_2, 1);
}
- else if ((st.getInt("cond") == 15) && st.dropItems(KASHA_SPIDER_TOOTH, 1, 6, 500000))
+ else if (st.isCond(15) && st.dropItems(KASHA_SPIDER_TOOTH, 1, 6, 500000))
{
- st.set("cond", "16");
+ st.setCond(16);
}
break;
-
+ }
case 20476:
- if ((st.getInt("cond") == 15) && st.dropItems(KASHA_SPIDER_TOOTH, 1, 6, 500000))
+ {
+ if (st.isCond(15) && st.dropItems(KASHA_SPIDER_TOOTH, 1, 6, 500000))
{
- st.set("cond", "16");
+ st.setCond(16);
}
break;
-
+ }
case 20415:
- if ((st.getInt("cond") == 6) && st.dropItemsAlways(SCARLET_SALAMANDER_SCALE, 1, 5))
+ {
+ if (st.isCond(6) && st.dropItemsAlways(SCARLET_SALAMANDER_SCALE, 1, 5))
{
- st.set("cond", "7");
+ st.setCond(7);
st.takeItems(SCARLET_SALAMANDER_SCALE, -1);
st.takeItems(LEATHER_POUCH_3, 1);
st.giveItems(LEATHER_POUCH_FULL_3, 1);
}
break;
-
+ }
case 20014:
- if ((st.getInt("cond") == 11) && st.dropItemsAlways(FELIM_LIZARDMAN_TOOTH, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
+ {
+ if (st.isCond(11) && st.dropItemsAlways(FELIM_LIZARDMAN_TOOTH, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
{
- st.set("cond", "12");
+ st.setCond(12);
st.takeItems(VUKU_ORC_TUSK, -1);
st.takeItems(RATMAN_FANG, -1);
st.takeItems(LANG_KLIZARDMAN_TOOTH, -1);
@@ -415,11 +433,12 @@ public class Q415_PathToAMonk extends Quest
st.giveItems(LEATHER_POUCH_FULL_4, 1);
}
break;
-
+ }
case 20017:
- if ((st.getInt("cond") == 11) && st.dropItemsAlways(VUKU_ORC_TUSK, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3))
+ {
+ if (st.isCond(11) && st.dropItemsAlways(VUKU_ORC_TUSK, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3))
{
- st.set("cond", "12");
+ st.setCond(12);
st.takeItems(VUKU_ORC_TUSK, -1);
st.takeItems(RATMAN_FANG, -1);
st.takeItems(LANG_KLIZARDMAN_TOOTH, -1);
@@ -428,11 +447,12 @@ public class Q415_PathToAMonk extends Quest
st.giveItems(LEATHER_POUCH_FULL_4, 1);
}
break;
-
+ }
case 20024:
- if ((st.getInt("cond") == 11) && st.dropItemsAlways(LANG_KLIZARDMAN_TOOTH, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
+ {
+ if (st.isCond(11) && st.dropItemsAlways(LANG_KLIZARDMAN_TOOTH, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
{
- st.set("cond", "12");
+ st.setCond(12);
st.takeItems(VUKU_ORC_TUSK, -1);
st.takeItems(RATMAN_FANG, -1);
st.takeItems(LANG_KLIZARDMAN_TOOTH, -1);
@@ -441,11 +461,12 @@ public class Q415_PathToAMonk extends Quest
st.giveItems(LEATHER_POUCH_FULL_4, 1);
}
break;
-
+ }
case 20359:
- if ((st.getInt("cond") == 11) && st.dropItemsAlways(RATMAN_FANG, 1, 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
+ {
+ if (st.isCond(11) && st.dropItemsAlways(RATMAN_FANG, 1, 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
{
- st.set("cond", "12");
+ st.setCond(12);
st.takeItems(VUKU_ORC_TUSK, -1);
st.takeItems(RATMAN_FANG, -1);
st.takeItems(LANG_KLIZARDMAN_TOOTH, -1);
@@ -454,15 +475,17 @@ public class Q415_PathToAMonk extends Quest
st.giveItems(LEATHER_POUCH_FULL_4, 1);
}
break;
-
+ }
case 21118:
- if (st.getInt("cond") == 17)
+ {
+ if (st.isCond(17))
{
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HORN_OF_BAAR_DRE_VANUL, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q416_PathToAnOrcShaman/Q416_PathToAnOrcShaman.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q416_PathToAnOrcShaman/Q416_PathToAnOrcShaman.java
index 0a92ff835b..c37bb47c3f 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q416_PathToAnOrcShaman/Q416_PathToAnOrcShaman.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q416_PathToAnOrcShaman/Q416_PathToAnOrcShaman.java
@@ -27,6 +27,23 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q416_PathToAnOrcShaman extends Quest
{
+ // NPCs
+ private static final int TATARU_ZU_HESTUI = 30585;
+ private static final int UMOS = 30502;
+ private static final int HESTUI_TOTEM_SPIRIT = 30592;
+ private static final int DUDA_MARA_TOTEM_SPIRIT = 30593;
+ private static final int MOIRA = 31979;
+ private static final int TOTEM_SPIRIT_OF_GANDI = 32057;
+ private static final int DEAD_LEOPARD_CARCASS = 32090;
+ // Monsters
+ private static final int VENOMOUS_SPIDER = 20038;
+ private static final int ARACHNID_TRACKER = 20043;
+ private static final int GRIZZLY_BEAR = 20335;
+ private static final int SCARLET_SALAMANDER = 20415;
+ private static final int KASHA_BLADE_SPIDER = 20478;
+ private static final int KASHA_BEAR = 20479;
+ private static final int DURKA_SPIRIT = 27056;
+ private static final int BLACK_LEOPARD = 27319;
// Items
private static final int FIRE_CHARM = 1616;
private static final int KASHA_BEAR_PELT = 1617;
@@ -45,34 +62,12 @@ public class Q416_PathToAnOrcShaman extends Quest
private static final int TOTEM_SPIRIT_BLOOD = 1630;
private static final int MASK_OF_MEDIUM = 1631;
- // NPCs
- private static final int TATARU_ZU_HESTUI = 30585;
- private static final int UMOS = 30502;
- private static final int HESTUI_TOTEM_SPIRIT = 30592;
- private static final int DUDA_MARA_TOTEM_SPIRIT = 30593;
- private static final int MOIRA = 31979;
- private static final int TOTEM_SPIRIT_OF_GANDI = 32057;
- private static final int DEAD_LEOPARD_CARCASS = 32090;
-
- // Monsters
- private static final int VENOMOUS_SPIDER = 20038;
- private static final int ARACHNID_TRACKER = 20043;
- private static final int GRIZZLY_BEAR = 20335;
- private static final int SCARLET_SALAMANDER = 20415;
- private static final int KASHA_BLADE_SPIDER = 20478;
- private static final int KASHA_BEAR = 20479;
- private static final int DURKA_SPIRIT = 27056;
- private static final int BLACK_LEOPARD = 27319;
-
public Q416_PathToAnOrcShaman()
{
super(416, "Path to an Orc Shaman");
-
registerQuestItems(FIRE_CHARM, KASHA_BEAR_PELT, KASHA_BLADE_SPIDER_HUSK, FIERY_EGG_1, HESTUI_MASK, FIERY_EGG_2, TOTEM_SPIRIT_CLAW, TATARU_LETTER, FLAME_CHARM, GRIZZLY_BLOOD, BLOOD_CAULDRON, SPIRIT_NET, BOUND_DURKA_SPIRIT, DURKA_PARASITE, TOTEM_SPIRIT_BLOOD);
-
addStartNpc(TATARU_ZU_HESTUI);
addTalkId(TATARU_ZU_HESTUI, UMOS, HESTUI_TOTEM_SPIRIT, DUDA_MARA_TOTEM_SPIRIT, MOIRA, TOTEM_SPIRIT_OF_GANDI, DEAD_LEOPARD_CARCASS);
-
addKillId(VENOMOUS_SPIDER, ARACHNID_TRACKER, GRIZZLY_BEAR, SCARLET_SALAMANDER, KASHA_BLADE_SPIDER, KASHA_BEAR, DURKA_SPIRIT, BLACK_LEOPARD);
}
@@ -86,85 +81,90 @@ public class Q416_PathToAnOrcShaman extends Quest
return htmltext;
}
- // TATARU ZU HESTUI
- if (event.equals("30585-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.ORC_MAGE)
+ case "30585-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ORC_SHAMAN) ? "30585-02a.htm" : "30585-02.htm";
+ if (player.getClassId() != ClassId.ORC_MAGE)
+ {
+ htmltext = (player.getClassId() == ClassId.ORC_SHAMAN) ? "30585-02a.htm" : "30585-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30585-03.htm";
+ }
+ else if (st.hasQuestItems(MASK_OF_MEDIUM))
+ {
+ htmltext = "30585-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30585-06.htm":
{
- htmltext = "30585-03.htm";
+ st.startQuest();
+ st.giveItems(FIRE_CHARM, 1);
+ break;
}
- else if (st.hasQuestItems(MASK_OF_MEDIUM))
+ case "30585-11b.htm":
{
- htmltext = "30585-04.htm";
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TOTEM_SPIRIT_CLAW, 1);
+ st.giveItems(TATARU_LETTER, 1);
+ break;
+ }
+ case "30585-11c.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TOTEM_SPIRIT_CLAW, 1);
+ break;
+ }
+ case "30592-03.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HESTUI_MASK, 1);
+ st.takeItems(FIERY_EGG_2, 1);
+ st.giveItems(TOTEM_SPIRIT_CLAW, 1);
+ break;
+ }
+ case "30593-03.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_CAULDRON, 1);
+ st.giveItems(SPIRIT_NET, 1);
+ break;
+ }
+ case "32057-02.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32057-05.htm":
+ {
+ st.setCond(21);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32090-04.htm":
+ {
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30502-07.htm":
+ {
+ st.takeItems(TOTEM_SPIRIT_BLOOD, -1);
+ st.giveItems(MASK_OF_MEDIUM, 1);
+ st.rewardExpAndSp(3200, 2600);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30585-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(FIRE_CHARM, 1);
- }
- else if (event.equals("30585-11b.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TOTEM_SPIRIT_CLAW, 1);
- st.giveItems(TATARU_LETTER, 1);
- }
- else if (event.equals("30585-11c.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TOTEM_SPIRIT_CLAW, 1);
- }
- // HESTUI TOTEM SPIRIT
- else if (event.equals("30592-03.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HESTUI_MASK, 1);
- st.takeItems(FIERY_EGG_2, 1);
- st.giveItems(TOTEM_SPIRIT_CLAW, 1);
- }
- // DUDA MARA TOTEM SPIRIT
- else if (event.equals("30593-03.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_CAULDRON, 1);
- st.giveItems(SPIRIT_NET, 1);
- }
- // TOTEM SPIRIT OF GANDI
- else if (event.equals("32057-02.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32057-05.htm"))
- {
- st.set("cond", "21");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // DEAD LEOPARD CARCASS
- else if (event.equals("32090-04.htm"))
- {
- st.set("cond", "18");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // UMOS
- else if (event.equals("30502-07.htm"))
- {
- st.takeItems(TOTEM_SPIRIT_BLOOD, -1);
- st.giveItems(MASK_OF_MEDIUM, 1);
- st.rewardExpAndSp(3200, 2600);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -183,14 +183,17 @@ public class Q416_PathToAnOrcShaman extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30585-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case TATARU_ZU_HESTUI:
+ {
if (cond == 1)
{
htmltext = "30585-07.htm";
@@ -198,7 +201,7 @@ public class Q416_PathToAnOrcShaman extends Quest
else if (cond == 2)
{
htmltext = "30585-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FIERY_EGG_1, 1);
st.takeItems(FIRE_CHARM, 1);
@@ -228,8 +231,9 @@ public class Q416_PathToAnOrcShaman extends Quest
htmltext = "30585-11c.htm";
}
break;
-
+ }
case HESTUI_TOTEM_SPIRIT:
+ {
if (cond == 3)
{
htmltext = "30592-01.htm";
@@ -243,12 +247,13 @@ public class Q416_PathToAnOrcShaman extends Quest
htmltext = "30592-05.htm";
}
break;
-
+ }
case UMOS:
+ {
if (cond == 5)
{
htmltext = "30502-01.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TATARU_LETTER, 1);
st.giveItems(FLAME_CHARM, 1);
@@ -260,7 +265,7 @@ public class Q416_PathToAnOrcShaman extends Quest
else if (cond == 7)
{
htmltext = "30502-03.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FLAME_CHARM, 1);
st.takeItems(GRIZZLY_BLOOD, 3);
@@ -279,12 +284,13 @@ public class Q416_PathToAnOrcShaman extends Quest
htmltext = "30502-06.htm";
}
break;
-
+ }
case MOIRA:
+ {
if (cond == 12)
{
htmltext = "31979-01.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if ((cond > 12) && (cond < 21))
@@ -301,8 +307,9 @@ public class Q416_PathToAnOrcShaman extends Quest
st.exitQuest(true);
}
break;
-
+ }
case TOTEM_SPIRIT_OF_GANDI:
+ {
if (cond == 13)
{
htmltext = "32057-01.htm";
@@ -316,8 +323,9 @@ public class Q416_PathToAnOrcShaman extends Quest
htmltext = "32057-04.htm";
}
break;
-
+ }
case DUDA_MARA_TOTEM_SPIRIT:
+ {
if (cond == 8)
{
htmltext = "30593-01.htm";
@@ -329,7 +337,7 @@ public class Q416_PathToAnOrcShaman extends Quest
else if (cond == 10)
{
htmltext = "30593-05.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BOUND_DURKA_SPIRIT, 1);
st.giveItems(TOTEM_SPIRIT_BLOOD, 1);
@@ -339,8 +347,9 @@ public class Q416_PathToAnOrcShaman extends Quest
htmltext = "30593-06.htm";
}
break;
-
+ }
case DEAD_LEOPARD_CARCASS:
+ {
if (cond == 14)
{
htmltext = "32090-01a.htm";
@@ -348,7 +357,7 @@ public class Q416_PathToAnOrcShaman extends Quest
else if (cond == 15)
{
htmltext = "32090-01.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 16)
@@ -366,12 +375,14 @@ public class Q416_PathToAnOrcShaman extends Quest
else if (cond == 19)
{
htmltext = "32090-06.htm";
- st.set("cond", "20");
+ st.setCond(20);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -386,17 +397,16 @@ public class Q416_PathToAnOrcShaman extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case KASHA_BEAR:
- if ((cond == 1) && !st.hasQuestItems(KASHA_BEAR_PELT))
+ {
+ if (st.isCond(1) && !st.hasQuestItems(KASHA_BEAR_PELT))
{
st.giveItems(KASHA_BEAR_PELT, 1);
if (st.hasQuestItems(FIERY_EGG_1, KASHA_BLADE_SPIDER_HUSK))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -405,14 +415,15 @@ public class Q416_PathToAnOrcShaman extends Quest
}
}
break;
-
+ }
case KASHA_BLADE_SPIDER:
- if ((cond == 1) && !st.hasQuestItems(KASHA_BLADE_SPIDER_HUSK))
+ {
+ if (st.isCond(1) && !st.hasQuestItems(KASHA_BLADE_SPIDER_HUSK))
{
st.giveItems(KASHA_BLADE_SPIDER_HUSK, 1);
if (st.hasQuestItems(KASHA_BEAR_PELT, FIERY_EGG_1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -421,14 +432,15 @@ public class Q416_PathToAnOrcShaman extends Quest
}
}
break;
-
+ }
case SCARLET_SALAMANDER:
- if ((cond == 1) && !st.hasQuestItems(FIERY_EGG_1))
+ {
+ if (st.isCond(1) && !st.hasQuestItems(FIERY_EGG_1))
{
st.giveItems(FIERY_EGG_1, 1);
if (st.hasQuestItems(KASHA_BEAR_PELT, KASHA_BLADE_SPIDER_HUSK))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -437,17 +449,19 @@ public class Q416_PathToAnOrcShaman extends Quest
}
}
break;
-
+ }
case GRIZZLY_BEAR:
- if ((cond == 6) && st.dropItemsAlways(GRIZZLY_BLOOD, 1, 3))
+ {
+ if (st.isCond(6) && st.dropItemsAlways(GRIZZLY_BLOOD, 1, 3))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case VENOMOUS_SPIDER:
case ARACHNID_TRACKER:
- if (cond == 9)
+ {
+ if (st.isCond(9))
{
final int count = st.getQuestItemsCount(DURKA_PARASITE);
final int rnd = Rnd.get(10);
@@ -463,24 +477,26 @@ public class Q416_PathToAnOrcShaman extends Quest
}
}
break;
-
+ }
case DURKA_SPIRIT:
- if (cond == 9)
+ {
+ if (st.isCond(9))
{
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DURKA_PARASITE, -1);
st.takeItems(SPIRIT_NET, 1);
st.giveItems(BOUND_DURKA_SPIRIT, 1);
}
break;
-
+ }
case BLACK_LEOPARD:
- if (cond == 14)
+ {
+ if (st.isCond(14))
{
if (st.getInt("leopard") > 0)
{
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
if (Rnd.get(3) < 2)
@@ -493,9 +509,9 @@ public class Q416_PathToAnOrcShaman extends Quest
st.set("leopard", "1");
}
}
- else if (cond == 16)
+ else if (st.isCond(16))
{
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
if (Rnd.get(3) < 2)
@@ -503,12 +519,13 @@ public class Q416_PathToAnOrcShaman extends Quest
npc.broadcastNpcSay("Listen to Tejakar Gandi, young Oroka! The spirit of the slain leopard is calling you, " + player.getName() + "!");
}
}
- else if (cond == 18)
+ else if (st.isCond(18))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q417_PathToBecomeAScavenger/Q417_PathToBecomeAScavenger.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q417_PathToBecomeAScavenger/Q417_PathToBecomeAScavenger.java
index 67586113e6..2bc5d4ffea 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q417_PathToBecomeAScavenger/Q417_PathToBecomeAScavenger.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q417_PathToBecomeAScavenger/Q417_PathToBecomeAScavenger.java
@@ -27,6 +27,21 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q417_PathToBecomeAScavenger extends Quest
{
+ // NPCs
+ private static final int RAUT = 30316;
+ private static final int SHARI = 30517;
+ private static final int MION = 30519;
+ private static final int PIPPI = 30524;
+ private static final int BRONK = 30525;
+ private static final int ZIMENF = 30538;
+ private static final int TOMA = 30556;
+ private static final int TORAI = 30557;
+ private static final int YASHENI = 31958;
+ // Monsters
+ private static final int HUNTER_TARANTULA = 20403;
+ private static final int PLUNDER_TARANTULA = 20508;
+ private static final int HUNTER_BEAR = 20777;
+ private static final int HONEY_BEAR = 27058;
// Items
private static final int RING_OF_RAVEN = 1642;
private static final int PIPPI_LETTER = 1643;
@@ -46,32 +61,12 @@ public class Q417_PathToBecomeAScavenger extends Quest
private static final int BEAD_PARCEL_1 = 1657;
private static final int BEAD_PARCEL_2 = 8543;
- // NPCs
- private static final int RAUT = 30316;
- private static final int SHARI = 30517;
- private static final int MION = 30519;
- private static final int PIPPI = 30524;
- private static final int BRONK = 30525;
- private static final int ZIMENF = 30538;
- private static final int TOMA = 30556;
- private static final int TORAI = 30557;
- private static final int YASHENI = 31958;
-
- // Monsters
- private static final int HUNTER_TARANTULA = 20403;
- private static final int PLUNDER_TARANTULA = 20508;
- private static final int HUNTER_BEAR = 20777;
- private static final int HONEY_BEAR = 27058;
-
public Q417_PathToBecomeAScavenger()
{
super(417, "Path to become a Scavenger");
-
registerQuestItems(PIPPI_LETTER, RAUT_TELEPORT_SCROLL, SUCCUBUS_UNDIES, MION_LETTER, BRONK_INGOT, SHARI_AXE, ZIMENF_POTION, BRONK_PAY, SHARI_PAY, ZIMENF_PAY, BEAR_PICTURE, TARANTULA_PICTURE, HONEY_JAR, BEAD, BEAD_PARCEL_1, BEAD_PARCEL_2);
-
addStartNpc(PIPPI);
addTalkId(RAUT, SHARI, MION, PIPPI, BRONK, ZIMENF, TOMA, TORAI, YASHENI);
-
addKillId(HUNTER_TARANTULA, PLUNDER_TARANTULA, HUNTER_BEAR, HONEY_BEAR);
}
@@ -85,122 +80,131 @@ public class Q417_PathToBecomeAScavenger extends Quest
return htmltext;
}
- // PIPPI
- if (event.equals("30524-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DWARVEN_FIGHTER)
+ case "30524-05.htm":
{
- htmltext = (player.getClassId() == ClassId.SCAVENGER) ? "30524-02a.htm" : "30524-08.htm";
+ if (player.getClassId() != ClassId.DWARVEN_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.SCAVENGER) ? "30524-02a.htm" : "30524-08.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30524-02.htm";
+ }
+ else if (st.hasQuestItems(RING_OF_RAVEN))
+ {
+ htmltext = "30524-04.htm";
+ }
+ else
+ {
+ st.startQuest();
+ st.giveItems(PIPPI_LETTER, 1);
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30519_1":
{
- htmltext = "30524-02.htm";
- }
- else if (st.hasQuestItems(RING_OF_RAVEN))
- {
- htmltext = "30524-04.htm";
- }
- else
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(PIPPI_LETTER, 1);
- }
- }
- // MION
- else if (event.equals("30519_1"))
- {
- final int random = Rnd.get(3);
-
- htmltext = "30519-0" + (random + 2) + ".htm";
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PIPPI_LETTER, -1);
- st.giveItems(ZIMENF_POTION - random, 1);
- }
- else if (event.equals("30519_2"))
- {
- final int random = Rnd.get(3);
-
- htmltext = "30519-0" + (random + 2) + ".htm";
- st.takeItems(BRONK_PAY, -1);
- st.takeItems(SHARI_PAY, -1);
- st.takeItems(ZIMENF_PAY, -1);
- st.giveItems(ZIMENF_POTION - random, 1);
- }
- else if (event.equals("30519-07.htm"))
- {
- st.set("id", String.valueOf(st.getInt("id") + 1));
- }
- else if (event.equals("30519-09.htm"))
- {
- final int id = st.getInt("id");
- if ((id / 10) < 2)
- {
- htmltext = "30519-07.htm";
- st.set("id", String.valueOf(id + 1));
- }
- else if ((id / 10) == 2)
- {
- st.set("id", String.valueOf(id + 1));
- }
- else if ((id / 10) >= 3)
- {
- htmltext = "30519-10.htm";
- st.set("cond", "4");
+ final int random = Rnd.get(3);
+ htmltext = "30519-0" + (random + 2) + ".htm";
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SHARI_AXE, -1);
- st.takeItems(ZIMENF_POTION, -1);
- st.takeItems(BRONK_INGOT, -1);
- st.giveItems(MION_LETTER, 1);
+ st.takeItems(PIPPI_LETTER, -1);
+ st.giveItems(ZIMENF_POTION - random, 1);
+ break;
+ }
+ case "30519_2":
+ {
+ final int random = Rnd.get(3);
+ htmltext = "30519-0" + (random + 2) + ".htm";
+ st.takeItems(BRONK_PAY, -1);
+ st.takeItems(SHARI_PAY, -1);
+ st.takeItems(ZIMENF_PAY, -1);
+ st.giveItems(ZIMENF_POTION - random, 1);
+ break;
+ }
+ case "30519-07.htm":
+ {
+ st.set("id", String.valueOf(st.getInt("id") + 1));
+ break;
+ }
+ case "30519-09.htm":
+ {
+ final int id = st.getInt("id");
+ if ((id / 10) < 2)
+ {
+ htmltext = "30519-07.htm";
+ st.set("id", String.valueOf(id + 1));
+ }
+ else if ((id / 10) == 2)
+ {
+ st.set("id", String.valueOf(id + 1));
+ }
+ else if ((id / 10) >= 3)
+ {
+ htmltext = "30519-10.htm";
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SHARI_AXE, -1);
+ st.takeItems(ZIMENF_POTION, -1);
+ st.takeItems(BRONK_INGOT, -1);
+ st.giveItems(MION_LETTER, 1);
+ }
+ break;
+ }
+ case "30519-11.htm":
+ {
+ if (Rnd.nextBoolean())
+ {
+ htmltext = "30519-06.htm";
+ }
+ break;
+ }
+ case "30556-05b.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BEAD, -1);
+ st.takeItems(TARANTULA_PICTURE, 1);
+ st.giveItems(BEAD_PARCEL_1, 1);
+ break;
+ }
+ case "30556-06b.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BEAD, -1);
+ st.takeItems(TARANTULA_PICTURE, 1);
+ st.giveItems(BEAD_PARCEL_2, 1);
+ break;
+ }
+ case "30316-02.htm":
+ case "30316-03.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BEAD_PARCEL_1, 1);
+ st.giveItems(RAUT_TELEPORT_SCROLL, 1);
+ break;
+ }
+ case "30557-03.htm":
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RAUT_TELEPORT_SCROLL, 1);
+ st.giveItems(SUCCUBUS_UNDIES, 1);
+ break;
+ }
+ case "31958-02.htm":
+ {
+ st.takeItems(BEAD_PARCEL_2, 1);
+ st.giveItems(RING_OF_RAVEN, 1);
+ st.rewardExpAndSp(3200, 7080);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30519-11.htm") && Rnd.nextBoolean())
- {
- htmltext = "30519-06.htm";
- }
- else if (event.equals("30556-05b.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BEAD, -1);
- st.takeItems(TARANTULA_PICTURE, 1);
- st.giveItems(BEAD_PARCEL_1, 1);
- }
- else if (event.equals("30556-06b.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BEAD, -1);
- st.takeItems(TARANTULA_PICTURE, 1);
- st.giveItems(BEAD_PARCEL_2, 1);
- }
- // RAUT
- else if (event.equals("30316-02.htm") || event.equals("30316-03.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BEAD_PARCEL_1, 1);
- st.giveItems(RAUT_TELEPORT_SCROLL, 1);
- }
- // TORAI
- else if (event.equals("30557-03.htm"))
- {
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RAUT_TELEPORT_SCROLL, 1);
- st.giveItems(SUCCUBUS_UNDIES, 1);
- }
- // YASHENI
- else if (event.equals("31958-02.htm"))
- {
- st.takeItems(BEAD_PARCEL_2, 1);
- st.giveItems(RING_OF_RAVEN, 1);
- st.rewardExpAndSp(3200, 7080);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -219,14 +223,17 @@ public class Q417_PathToBecomeAScavenger extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30524-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case PIPPI:
+ {
if (cond == 1)
{
htmltext = "30524-06.htm";
@@ -236,8 +243,9 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30524-07.htm";
}
break;
-
+ }
case MION:
+ {
if (st.hasQuestItems(PIPPI_LETTER))
{
htmltext = "30519-01.htm";
@@ -264,7 +272,7 @@ public class Q417_PathToBecomeAScavenger extends Quest
else
{
htmltext = "30519-15.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BRONK_PAY, -1);
st.takeItems(SHARI_PAY, -1);
@@ -281,8 +289,9 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30519-14.htm";
}
break;
-
+ }
case SHARI:
+ {
if (st.hasQuestItems(SHARI_AXE))
{
final int id = st.getInt("id");
@@ -293,7 +302,7 @@ public class Q417_PathToBecomeAScavenger extends Quest
else
{
htmltext = "30517-02.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
st.set("id", String.valueOf(id + 10));
@@ -305,8 +314,9 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30517-03.htm";
}
break;
-
+ }
case BRONK:
+ {
if (st.hasQuestItems(BRONK_INGOT))
{
final int id = st.getInt("id");
@@ -317,7 +327,7 @@ public class Q417_PathToBecomeAScavenger extends Quest
else
{
htmltext = "30525-02.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
st.set("id", String.valueOf(id + 10));
@@ -329,8 +339,9 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30525-03.htm";
}
break;
-
+ }
case ZIMENF:
+ {
if (st.hasQuestItems(ZIMENF_POTION))
{
final int id = st.getInt("id");
@@ -341,7 +352,7 @@ public class Q417_PathToBecomeAScavenger extends Quest
else
{
htmltext = "30538-02.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
st.set("id", String.valueOf(id + 10));
@@ -353,12 +364,13 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30538-03.htm";
}
break;
-
+ }
case TOMA:
+ {
if (cond == 4)
{
htmltext = "30556-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MION_LETTER, 1);
st.giveItems(BEAR_PICTURE, 1);
@@ -370,7 +382,7 @@ public class Q417_PathToBecomeAScavenger extends Quest
else if (cond == 6)
{
htmltext = "30556-03.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HONEY_JAR, -1);
st.takeItems(BEAR_PICTURE, 1);
@@ -397,8 +409,9 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30556-06c.htm";
}
break;
-
+ }
case RAUT:
+ {
if (cond == 9)
{
htmltext = "30316-01.htm";
@@ -418,22 +431,26 @@ public class Q417_PathToBecomeAScavenger extends Quest
st.exitQuest(true);
}
break;
-
+ }
case TORAI:
+ {
if (cond == 10)
{
htmltext = "30557-01.htm";
}
break;
-
+ }
case YASHENI:
+ {
if (cond == 12)
{
htmltext = "31958-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -451,7 +468,8 @@ public class Q417_PathToBecomeAScavenger extends Quest
switch (npc.getNpcId())
{
case HUNTER_BEAR:
- if (st.getInt("cond") == 5)
+ {
+ if (st.isCond(5))
{
final int step = st.getInt("step");
if (step > 20)
@@ -472,21 +490,24 @@ public class Q417_PathToBecomeAScavenger extends Quest
}
}
break;
-
+ }
case HONEY_BEAR:
- if ((st.getInt("cond") == 5) && (npc.getSpoiledBy() == player.getObjectId()) && st.dropItemsAlways(HONEY_JAR, 1, 5))
+ {
+ if (st.isCond(5) && (npc.getSpoiledBy() == player.getObjectId()) && st.dropItemsAlways(HONEY_JAR, 1, 5))
{
- st.set("cond", "6");
+ st.setCond(6);
}
break;
-
+ }
case HUNTER_TARANTULA:
case PLUNDER_TARANTULA:
- if ((st.getInt("cond") == 7) && (npc.getSpoiledBy() == player.getObjectId()) && st.dropItems(BEAD, 1, 20, (npc.getNpcId() == HUNTER_TARANTULA) ? 333333 : 600000))
+ {
+ if (st.isCond(7) && (npc.getSpoiledBy() == player.getObjectId()) && st.dropItems(BEAD, 1, 20, (npc.getNpcId() == HUNTER_TARANTULA) ? 333333 : 600000))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q418_PathToAnArtisan/Q418_PathToAnArtisan.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q418_PathToAnArtisan/Q418_PathToAnArtisan.java
index 374b05205c..48482efc4b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q418_PathToAnArtisan/Q418_PathToAnArtisan.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q418_PathToAnArtisan/Q418_PathToAnArtisan.java
@@ -26,6 +26,14 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q418_PathToAnArtisan extends Quest
{
+ // NPCs
+ private static final int SILVERA = 30527;
+ private static final int KLUTO = 30317;
+ private static final int PINTER = 30298;
+ private static final int OBI = 32052;
+ private static final int HITCHI = 31963;
+ private static final int LOCKIRIN = 30531;
+ private static final int RYDEL = 31956;
// Items
private static final int SILVERA_RING = 1632;
private static final int FIRST_PASS_CERTIFICATE = 1633;
@@ -38,24 +46,12 @@ public class Q418_PathToAnArtisan extends Quest
private static final int STOLEN_SECRET_BOX = 1640;
private static final int SECRET_BOX = 1641;
- // NPCs
- private static final int SILVERA = 30527;
- private static final int KLUTO = 30317;
- private static final int PINTER = 30298;
- private static final int OBI = 32052;
- private static final int HITCHI = 31963;
- private static final int LOCKIRIN = 30531;
- private static final int RYDEL = 31956;
-
public Q418_PathToAnArtisan()
{
super(418, "Path to an Artisan");
-
registerQuestItems(SILVERA_RING, FIRST_PASS_CERTIFICATE, SECOND_PASS_CERTIFICATE, BOOGLE_RATMAN_TOOTH, BOOGLE_RATMAN_LEADER_TOOTH, KLUTO_LETTER, FOOTPRINT_OF_THIEF, STOLEN_SECRET_BOX, SECRET_BOX);
-
addStartNpc(SILVERA);
addTalkId(SILVERA, KLUTO, PINTER, OBI, HITCHI, LOCKIRIN, RYDEL);
-
addKillId(20389, 20390, 20017);
}
@@ -69,108 +65,127 @@ public class Q418_PathToAnArtisan extends Quest
return htmltext;
}
- if (event.equals("30527-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DWARVEN_FIGHTER)
+ case "30527-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ARTISAN) ? "30527-02a.htm" : "30527-02.htm";
+ if (player.getClassId() != ClassId.DWARVEN_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ARTISAN) ? "30527-02a.htm" : "30527-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30527-03.htm";
+ }
+ else if (st.hasQuestItems(FINAL_PASS_CERTIFICATE))
+ {
+ htmltext = "30527-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30527-06.htm":
{
- htmltext = "30527-03.htm";
+ st.startQuest();
+ st.giveItems(SILVERA_RING, 1);
+ break;
}
- else if (st.hasQuestItems(FINAL_PASS_CERTIFICATE))
+ case "30527-08a.htm":
{
- htmltext = "30527-04.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BOOGLE_RATMAN_LEADER_TOOTH, -1);
+ st.takeItems(BOOGLE_RATMAN_TOOTH, -1);
+ st.takeItems(SILVERA_RING, 1);
+ st.giveItems(FIRST_PASS_CERTIFICATE, 1);
+ break;
+ }
+ case "30527-08b.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BOOGLE_RATMAN_LEADER_TOOTH, -1);
+ st.takeItems(BOOGLE_RATMAN_TOOTH, -1);
+ st.takeItems(SILVERA_RING, 1);
+ break;
+ }
+ case "30317-04.htm":
+ case "30317-07.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(KLUTO_LETTER, 1);
+ break;
+ }
+ case "30317-10.htm":
+ {
+ st.takeItems(FIRST_PASS_CERTIFICATE, 1);
+ st.takeItems(SECOND_PASS_CERTIFICATE, 1);
+ st.takeItems(SECRET_BOX, 1);
+ st.giveItems(FINAL_PASS_CERTIFICATE, 1);
+ st.rewardExpAndSp(3200, 6980);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30317-12.htm":
+ case "30531-05.htm":
+ case "32052-11.htm":
+ case "31963-10.htm":
+ case "31956-04.htm":
+ {
+ st.takeItems(FIRST_PASS_CERTIFICATE, 1);
+ st.takeItems(SECOND_PASS_CERTIFICATE, 1);
+ st.takeItems(SECRET_BOX, 1);
+ st.giveItems(FINAL_PASS_CERTIFICATE, 1);
+ st.rewardExpAndSp(3200, 3490);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30298-03.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KLUTO_LETTER, -1);
+ st.giveItems(FOOTPRINT_OF_THIEF, 1);
+ break;
+ }
+ case "30298-06.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(FOOTPRINT_OF_THIEF, -1);
+ st.takeItems(STOLEN_SECRET_BOX, -1);
+ st.giveItems(SECOND_PASS_CERTIFICATE, 1);
+ st.giveItems(SECRET_BOX, 1);
+ break;
+ }
+ case "32052-06.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31963-04.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31963-05.htm":
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31963-07.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("30527-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(SILVERA_RING, 1);
- }
- else if (event.equals("30527-08a.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BOOGLE_RATMAN_LEADER_TOOTH, -1);
- st.takeItems(BOOGLE_RATMAN_TOOTH, -1);
- st.takeItems(SILVERA_RING, 1);
- st.giveItems(FIRST_PASS_CERTIFICATE, 1);
- }
- else if (event.equals("30527-08b.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BOOGLE_RATMAN_LEADER_TOOTH, -1);
- st.takeItems(BOOGLE_RATMAN_TOOTH, -1);
- st.takeItems(SILVERA_RING, 1);
- }
- else if (event.equals("30317-04.htm") || event.equals("30317-07.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(KLUTO_LETTER, 1);
- }
- else if (event.equals("30317-10.htm"))
- {
- st.takeItems(FIRST_PASS_CERTIFICATE, 1);
- st.takeItems(SECOND_PASS_CERTIFICATE, 1);
- st.takeItems(SECRET_BOX, 1);
- st.giveItems(FINAL_PASS_CERTIFICATE, 1);
- st.rewardExpAndSp(3200, 6980);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30317-12.htm") || event.equals("30531-05.htm") || event.equals("32052-11.htm") || event.equals("31963-10.htm") || event.equals("31956-04.htm"))
- {
- st.takeItems(FIRST_PASS_CERTIFICATE, 1);
- st.takeItems(SECOND_PASS_CERTIFICATE, 1);
- st.takeItems(SECRET_BOX, 1);
- st.giveItems(FINAL_PASS_CERTIFICATE, 1);
- st.rewardExpAndSp(3200, 3490);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30298-03.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KLUTO_LETTER, -1);
- st.giveItems(FOOTPRINT_OF_THIEF, 1);
- }
- else if (event.equals("30298-06.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(FOOTPRINT_OF_THIEF, -1);
- st.takeItems(STOLEN_SECRET_BOX, -1);
- st.giveItems(SECOND_PASS_CERTIFICATE, 1);
- st.giveItems(SECRET_BOX, 1);
- }
- else if (event.equals("32052-06.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31963-04.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31963-05.htm"))
- {
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31963-07.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
}
return htmltext;
@@ -189,14 +204,17 @@ public class Q418_PathToAnArtisan extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30527-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SILVERA:
+ {
if (cond == 1)
{
htmltext = "30527-07.htm";
@@ -214,8 +232,9 @@ public class Q418_PathToAnArtisan extends Quest
htmltext = "30527-09a.htm";
}
break;
-
+ }
case KLUTO:
+ {
if (cond == 3)
{
htmltext = "30317-01.htm";
@@ -229,8 +248,9 @@ public class Q418_PathToAnArtisan extends Quest
htmltext = "30317-09.htm";
}
break;
-
+ }
case PINTER:
+ {
if (cond == 4)
{
htmltext = "30298-01.htm";
@@ -248,8 +268,9 @@ public class Q418_PathToAnArtisan extends Quest
htmltext = "30298-07.htm";
}
break;
-
+ }
case OBI:
+ {
if (cond == 8)
{
htmltext = "32052-01.htm";
@@ -263,8 +284,9 @@ public class Q418_PathToAnArtisan extends Quest
htmltext = "32052-07.htm";
}
break;
-
+ }
case HITCHI:
+ {
if (cond == 9)
{
htmltext = "31963-01.htm";
@@ -282,22 +304,26 @@ public class Q418_PathToAnArtisan extends Quest
htmltext = "31963-08.htm";
}
break;
-
+ }
case LOCKIRIN:
+ {
if (cond == 10)
{
htmltext = "30531-01.htm";
}
break;
-
+ }
case RYDEL:
+ {
if (cond == 12)
{
htmltext = "31956-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -315,25 +341,29 @@ public class Q418_PathToAnArtisan extends Quest
switch (npc.getNpcId())
{
case 20389:
- if ((st.getInt("cond") == 1) && st.dropItems(BOOGLE_RATMAN_TOOTH, 1, 10, 700000) && (st.getQuestItemsCount(BOOGLE_RATMAN_LEADER_TOOTH) == 2))
+ {
+ if (st.isCond(1) && st.dropItems(BOOGLE_RATMAN_TOOTH, 1, 10, 700000) && (st.getQuestItemsCount(BOOGLE_RATMAN_LEADER_TOOTH) == 2))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20390:
- if ((st.getInt("cond") == 1) && st.dropItems(BOOGLE_RATMAN_LEADER_TOOTH, 1, 2, 500000) && (st.getQuestItemsCount(BOOGLE_RATMAN_TOOTH) == 10))
+ {
+ if (st.isCond(1) && st.dropItems(BOOGLE_RATMAN_LEADER_TOOTH, 1, 2, 500000) && (st.getQuestItemsCount(BOOGLE_RATMAN_TOOTH) == 10))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20017:
- if ((st.getInt("cond") == 5) && st.dropItems(STOLEN_SECRET_BOX, 1, 1, 200000))
+ {
+ if (st.isCond(5) && st.dropItems(STOLEN_SECRET_BOX, 1, 1, 200000))
{
- st.set("cond", "6");
+ st.setCond(6);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q419_GetAPet/Q419_GetAPet.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q419_GetAPet/Q419_GetAPet.java
index 6c2a16e63b..ec48358aa9 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q419_GetAPet/Q419_GetAPet.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q419_GetAPet/Q419_GetAPet.java
@@ -29,6 +29,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q419_GetAPet extends Quest
{
+ // NPCs
+ private static final int MARTIN = 30731;
+ private static final int BELLA = 30256;
+ private static final int METTY = 30072;
+ private static final int ELLIE = 30091;
// Items
private static final int ANIMAL_LOVER_LIST = 3417;
private static final int ANIMAL_SLAYER_LIST_1 = 3418;
@@ -41,105 +46,37 @@ public class Q419_GetAPet extends Quest
private static final int BLOODY_NAIL = 3425;
private static final int BLOODY_KASHA_FANG = 3426;
private static final int BLOODY_TARANTULA_NAIL = 3427;
-
// Reward
private static final int WOLF_COLLAR = 2375;
-
- // NPCs
- private static final int MARTIN = 30731;
- private static final int BELLA = 30256;
- private static final int METTY = 30072;
- private static final int ELLIE = 30091;
-
// Droplist
private static final Map DROPLIST = new HashMap<>();
static
{
- DROPLIST.put(20103, new int[]
- {
- BLOODY_FANG,
- 600000
- });
- DROPLIST.put(20106, new int[]
- {
- BLOODY_FANG,
- 750000
- });
- DROPLIST.put(20108, new int[]
- {
- BLOODY_FANG,
- 1000000
- });
- DROPLIST.put(20460, new int[]
- {
- BLOODY_CLAW,
- 600000
- });
- DROPLIST.put(20308, new int[]
- {
- BLOODY_CLAW,
- 750000
- });
- DROPLIST.put(20466, new int[]
- {
- BLOODY_CLAW,
- 1000000
- });
- DROPLIST.put(20025, new int[]
- {
- BLOODY_NAIL,
- 600000
- });
- DROPLIST.put(20105, new int[]
- {
- BLOODY_NAIL,
- 750000
- });
- DROPLIST.put(20034, new int[]
- {
- BLOODY_NAIL,
- 1000000
- });
- DROPLIST.put(20474, new int[]
- {
- BLOODY_KASHA_FANG,
- 600000
- });
- DROPLIST.put(20476, new int[]
- {
- BLOODY_KASHA_FANG,
- 750000
- });
- DROPLIST.put(20478, new int[]
- {
- BLOODY_KASHA_FANG,
- 1000000
- });
- DROPLIST.put(20403, new int[]
- {
- BLOODY_TARANTULA_NAIL,
- 750000
- });
- DROPLIST.put(20508, new int[]
- {
- BLOODY_TARANTULA_NAIL,
- 1000000
- });
+ // @formatter:off
+ DROPLIST.put(20103, new int[]{BLOODY_FANG, 600000});
+ DROPLIST.put(20106, new int[]{BLOODY_FANG, 750000});
+ DROPLIST.put(20108, new int[]{BLOODY_FANG, 1000000});
+ DROPLIST.put(20460, new int[]{BLOODY_CLAW, 600000});
+ DROPLIST.put(20308, new int[]{BLOODY_CLAW, 750000});
+ DROPLIST.put(20466, new int[]{BLOODY_CLAW, 1000000});
+ DROPLIST.put(20025, new int[]{BLOODY_NAIL, 600000});
+ DROPLIST.put(20105, new int[]{BLOODY_NAIL, 750000});
+ DROPLIST.put(20034, new int[]{BLOODY_NAIL, 1000000});
+ DROPLIST.put(20474, new int[]{BLOODY_KASHA_FANG, 600000});
+ DROPLIST.put(20476, new int[]{BLOODY_KASHA_FANG, 750000});
+ DROPLIST.put(20478, new int[]{BLOODY_KASHA_FANG, 1000000});
+ DROPLIST.put(20403, new int[]{BLOODY_TARANTULA_NAIL, 750000});
+ DROPLIST.put(20508, new int[]{BLOODY_TARANTULA_NAIL, 1000000});
+ // @formatter:on
}
public Q419_GetAPet()
{
super(419, "Get a Pet");
-
registerQuestItems(ANIMAL_LOVER_LIST, ANIMAL_SLAYER_LIST_1, ANIMAL_SLAYER_LIST_2, ANIMAL_SLAYER_LIST_3, ANIMAL_SLAYER_LIST_4, ANIMAL_SLAYER_LIST_5, BLOODY_FANG, BLOODY_CLAW, BLOODY_NAIL, BLOODY_KASHA_FANG, BLOODY_TARANTULA_NAIL);
-
addStartNpc(MARTIN);
addTalkId(MARTIN, BELLA, ELLIE, METTY);
-
- for (int npcId : DROPLIST.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(DROPLIST.keySet());
}
@Override
@@ -152,69 +89,75 @@ public class Q419_GetAPet extends Quest
return htmltext;
}
- if (event.equals("task"))
+ switch (event)
{
- final int race = player.getRace().ordinal();
- htmltext = "30731-0" + (race + 4) + ".htm";
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ANIMAL_SLAYER_LIST_1 + race, 1);
- }
- else if (event.equals("30731-12.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ANIMAL_SLAYER_LIST_1, 1);
- st.takeItems(ANIMAL_SLAYER_LIST_2, 1);
- st.takeItems(ANIMAL_SLAYER_LIST_3, 1);
- st.takeItems(ANIMAL_SLAYER_LIST_4, 1);
- st.takeItems(ANIMAL_SLAYER_LIST_5, 1);
- st.takeItems(BLOODY_FANG, -1);
- st.takeItems(BLOODY_CLAW, -1);
- st.takeItems(BLOODY_NAIL, -1);
- st.takeItems(BLOODY_KASHA_FANG, -1);
- st.takeItems(BLOODY_TARANTULA_NAIL, -1);
- st.giveItems(ANIMAL_LOVER_LIST, 1);
- }
- else if (event.equals("30256-03.htm"))
- {
- st.set("progress", String.valueOf(st.getInt("progress") | 1));
- if (st.getInt("progress") == 7)
+ case "task":
+ {
+ final int race = player.getRace().ordinal();
+ htmltext = "30731-0" + (race + 4) + ".htm";
+ st.startQuest();
+ st.giveItems(ANIMAL_SLAYER_LIST_1 + race, 1);
+ break;
+ }
+ case "30731-12.htm":
{
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ANIMAL_SLAYER_LIST_1, 1);
+ st.takeItems(ANIMAL_SLAYER_LIST_2, 1);
+ st.takeItems(ANIMAL_SLAYER_LIST_3, 1);
+ st.takeItems(ANIMAL_SLAYER_LIST_4, 1);
+ st.takeItems(ANIMAL_SLAYER_LIST_5, 1);
+ st.takeItems(BLOODY_FANG, -1);
+ st.takeItems(BLOODY_CLAW, -1);
+ st.takeItems(BLOODY_NAIL, -1);
+ st.takeItems(BLOODY_KASHA_FANG, -1);
+ st.takeItems(BLOODY_TARANTULA_NAIL, -1);
+ st.giveItems(ANIMAL_LOVER_LIST, 1);
+ break;
}
- }
- else if (event.equals("30072-02.htm"))
- {
- st.set("progress", String.valueOf(st.getInt("progress") | 2));
- if (st.getInt("progress") == 7)
+ case "30256-03.htm":
{
- st.playSound(QuestState.SOUND_MIDDLE);
+ st.set("progress", String.valueOf(st.getInt("progress") | 1));
+ if (st.getInt("progress") == 7)
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
}
- }
- else if (event.equals("30091-02.htm"))
- {
- st.set("progress", String.valueOf(st.getInt("progress") | 4));
- if (st.getInt("progress") == 7)
+ case "30072-02.htm":
{
- st.playSound(QuestState.SOUND_MIDDLE);
+ st.set("progress", String.valueOf(st.getInt("progress") | 2));
+ if (st.getInt("progress") == 7)
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
+ }
+ case "30091-02.htm":
+ {
+ st.set("progress", String.valueOf(st.getInt("progress") | 4));
+ if (st.getInt("progress") == 7)
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
+ }
+ case "test":
+ {
+ st.set("answers", "0");
+ st.set("quiz", "20 21 22 23 24 25 26 27 28 29 30 31 32 33");
+ return checkQuestions(st);
+ }
+ case "wrong":
+ {
+ st.set("wrong", String.valueOf(st.getInt("wrong") + 1));
+ return checkQuestions(st);
+ }
+ case "right":
+ {
+ st.set("correct", String.valueOf(st.getInt("correct") + 1));
+ return checkQuestions(st);
}
- }
- else if (event.equals("test"))
- {
- st.set("answers", "0");
- st.set("quiz", "20 21 22 23 24 25 26 27 28 29 30 31 32 33");
- return checkQuestions(st);
- }
- else if (event.equals("wrong"))
- {
- st.set("wrong", String.valueOf(st.getInt("wrong") + 1));
- return checkQuestions(st);
- }
- else if (event.equals("right"))
- {
- st.set("correct", String.valueOf(st.getInt("correct") + 1));
- return checkQuestions(st);
}
return htmltext;
@@ -233,13 +176,16 @@ public class Q419_GetAPet extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30731-01.htm" : "30731-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case MARTIN:
+ {
if (st.hasAtLeastOneQuestItem(ANIMAL_SLAYER_LIST_1, ANIMAL_SLAYER_LIST_2, ANIMAL_SLAYER_LIST_3, ANIMAL_SLAYER_LIST_4, ANIMAL_SLAYER_LIST_5))
{
final int proofs = st.getQuestItemsCount(BLOODY_FANG) + st.getQuestItemsCount(BLOODY_CLAW) + st.getQuestItemsCount(BLOODY_NAIL) + st.getQuestItemsCount(BLOODY_KASHA_FANG) + st.getQuestItemsCount(BLOODY_TARANTULA_NAIL);
@@ -265,20 +211,25 @@ public class Q419_GetAPet extends Quest
htmltext = "30731-16.htm";
}
break;
-
+ }
case BELLA:
+ {
htmltext = "30256-01.htm";
break;
-
+ }
case METTY:
+ {
htmltext = "30072-01.htm";
break;
-
+ }
case ELLIE:
+ {
htmltext = "30091-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q420_LittleWing/Q420_LittleWing.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q420_LittleWing/Q420_LittleWing.java
index f39bccf881..c5c7eee175 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q420_LittleWing/Q420_LittleWing.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q420_LittleWing/Q420_LittleWing.java
@@ -26,17 +26,19 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q420_LittleWing extends Quest
{
- // Needed items
- private static final int COAL = 1870;
- private static final int CHARCOAL = 1871;
- private static final int SILVER_NUGGET = 1873;
- private static final int STONE_OF_PURITY = 1875;
- private static final int GEMSTONE_D = 2130;
- private static final int GEMSTONE_C = 2131;
-
+ // NPCs
+ private static final int MARIA = 30608;
+ private static final int CRONOS = 30610;
+ private static final int BYRON = 30711;
+ private static final int MIMYU = 30747;
+ private static final int EXARION = 30748;
+ private static final int ZWOV = 30749;
+ private static final int KALIBRAN = 30750;
+ private static final int SUZET = 30751;
+ private static final int SHAMHAI = 30752;
+ private static final int COOPER = 30829;
// Items
private static final int FAIRY_DUST = 3499;
-
private static final int FAIRY_STONE = 3816;
private static final int DELUXE_FAIRY_STONE = 3817;
private static final int FAIRY_STONE_LIST = 3818;
@@ -53,26 +55,19 @@ public class Q420_LittleWing extends Quest
private static final int EGG_OF_WYVERN_SUZET = 3829;
private static final int SCALE_OF_WYVERN_SHAMHAI = 3830;
private static final int EGG_OF_WYVERN_SHAMHAI = 3831;
-
+ // Needed items
+ private static final int COAL = 1870;
+ private static final int CHARCOAL = 1871;
+ private static final int SILVER_NUGGET = 1873;
+ private static final int STONE_OF_PURITY = 1875;
+ private static final int GEMSTONE_D = 2130;
+ private static final int GEMSTONE_C = 2131;
// Rewards
private static final int DRAGONFLUTE_OF_WIND = 3500;
private static final int DRAGONFLUTE_OF_STAR = 3501;
private static final int DRAGONFLUTE_OF_TWILIGHT = 3502;
private static final int HATCHLING_SOFT_LEATHER = 3912;
private static final int FOOD_FOR_HATCHLING = 4038;
-
- // NPCs
- private static final int MARIA = 30608;
- private static final int CRONOS = 30610;
- private static final int BYRON = 30711;
- private static final int MIMYU = 30747;
- private static final int EXARION = 30748;
- private static final int ZWOV = 30749;
- private static final int KALIBRAN = 30750;
- private static final int SUZET = 30751;
- private static final int SHAMHAI = 30752;
- private static final int COOPER = 30829;
-
// Spawn Points
private static final Location[] LOCATIONS =
{
@@ -80,18 +75,15 @@ public class Q420_LittleWing extends Quest
new Location(108940, 41615, -4643, 0),
new Location(110395, 41625, -4642, 0)
};
-
+ // Misc
private static int _counter = 0;
public Q420_LittleWing()
{
super(420, "Little Wing");
-
registerQuestItems(FAIRY_STONE, DELUXE_FAIRY_STONE, FAIRY_STONE_LIST, DELUXE_FAIRY_STONE_LIST, TOAD_LORD_BACK_SKIN, JUICE_OF_MONKSHOOD, SCALE_OF_DRAKE_EXARION, EGG_OF_DRAKE_EXARION, SCALE_OF_DRAKE_ZWOV, EGG_OF_DRAKE_ZWOV, SCALE_OF_DRAKE_KALIBRAN, EGG_OF_DRAKE_KALIBRAN, SCALE_OF_WYVERN_SUZET, EGG_OF_WYVERN_SUZET, SCALE_OF_WYVERN_SHAMHAI, EGG_OF_WYVERN_SHAMHAI);
-
addStartNpc(COOPER, MIMYU);
addTalkId(MARIA, CRONOS, BYRON, MIMYU, EXARION, ZWOV, KALIBRAN, SUZET, SHAMHAI, COOPER);
-
addKillId(20202, 20231, 20233, 20270, 20551, 20580, 20589, 20590, 20591, 20592, 20593, 20594, 20595, 20596, 20597, 20598, 20599);
}
@@ -105,186 +97,200 @@ public class Q420_LittleWing extends Quest
return htmltext;
}
- // COOPER
- if (event.equals("30829-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- // CRONOS
- else if (event.equals("30610-05.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(FAIRY_STONE_LIST, 1);
- }
- else if (event.equals("30610-06.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(DELUXE_FAIRY_STONE_LIST, 1);
- }
- else if (event.equals("30610-12.htm"))
- {
- st.set("cond", "2");
- st.set("deluxestone", "1");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(FAIRY_STONE_LIST, 1);
- }
- else if (event.equals("30610-13.htm"))
- {
- st.set("cond", "2");
- st.set("deluxestone", "1");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(DELUXE_FAIRY_STONE_LIST, 1);
- }
- // MARIA
- else if (event.equals("30608-03.htm"))
- {
- if (!checkItems(st, false))
+ case "30829-02.htm":
{
- htmltext = "30608-01.htm"; // Avoid to continue while trade or drop mats before clicking bypass
+ st.startQuest();
+ break;
}
- else
+ case "30610-05.htm":
{
- st.takeItems(COAL, 10);
- st.takeItems(CHARCOAL, 10);
- st.takeItems(GEMSTONE_D, 1);
- st.takeItems(SILVER_NUGGET, 3);
- st.takeItems(TOAD_LORD_BACK_SKIN, -1);
- st.takeItems(FAIRY_STONE_LIST, 1);
- st.giveItems(FAIRY_STONE, 1);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(FAIRY_STONE_LIST, 1);
+ break;
}
- }
- else if (event.equals("30608-05.htm"))
- {
- if (!checkItems(st, true))
+ case "30610-06.htm":
{
- htmltext = "30608-01.htm"; // Avoid to continue while trade or drop mats before clicking bypass
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(DELUXE_FAIRY_STONE_LIST, 1);
+ break;
}
- else
+ case "30610-12.htm":
{
- st.takeItems(COAL, 10);
- st.takeItems(CHARCOAL, 10);
- st.takeItems(GEMSTONE_C, 1);
- st.takeItems(STONE_OF_PURITY, 1);
- st.takeItems(SILVER_NUGGET, 5);
- st.takeItems(TOAD_LORD_BACK_SKIN, -1);
- st.takeItems(DELUXE_FAIRY_STONE_LIST, 1);
- st.giveItems(DELUXE_FAIRY_STONE, 1);
+ st.setCond(2);
+ st.set("deluxestone", "1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(FAIRY_STONE_LIST, 1);
+ break;
}
- }
- // BYRON
- else if (event.equals("30711-03.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- if (st.hasQuestItems(DELUXE_FAIRY_STONE))
+ case "30610-13.htm":
{
- htmltext = "30711-04.htm";
+ st.setCond(2);
+ st.set("deluxestone", "1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(DELUXE_FAIRY_STONE_LIST, 1);
+ break;
}
- }
- // MIMYU
- else if (event.equals("30747-02.htm"))
- {
- st.set("mimyu", "1");
- st.takeItems(FAIRY_STONE, 1);
- }
- else if (event.equals("30747-04.htm"))
- {
- st.set("mimyu", "1");
- st.takeItems(DELUXE_FAIRY_STONE, 1);
- st.giveItems(FAIRY_DUST, 1);
- }
- else if (event.equals("30747-07.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(JUICE_OF_MONKSHOOD, 1);
- }
- else if (event.equals("30747-12.htm") && !st.hasQuestItems(FAIRY_DUST))
- {
- htmltext = "30747-15.htm";
- giveRandomPet(st, false);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30747-13.htm"))
- {
- giveRandomPet(st, st.hasQuestItems(FAIRY_DUST));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30747-14.htm"))
- {
- if (st.hasQuestItems(FAIRY_DUST))
+ case "30608-03.htm":
{
- st.takeItems(FAIRY_DUST, 1);
- giveRandomPet(st, true);
- if (Rnd.get(20) == 1)
+ if (!checkItems(st, false))
{
- st.giveItems(HATCHLING_SOFT_LEATHER, 1);
+ htmltext = "30608-01.htm"; // Avoid to continue while trade or drop mats before clicking bypass
}
else
{
- htmltext = "30747-14t.htm";
- st.giveItems(FOOD_FOR_HATCHLING, 20);
+ st.takeItems(COAL, 10);
+ st.takeItems(CHARCOAL, 10);
+ st.takeItems(GEMSTONE_D, 1);
+ st.takeItems(SILVER_NUGGET, 3);
+ st.takeItems(TOAD_LORD_BACK_SKIN, -1);
+ st.takeItems(FAIRY_STONE_LIST, 1);
+ st.giveItems(FAIRY_STONE, 1);
}
+ break;
+ }
+ case "30608-05.htm":
+ {
+ if (!checkItems(st, true))
+ {
+ htmltext = "30608-01.htm"; // Avoid to continue while trade or drop mats before clicking bypass
+ }
+ else
+ {
+ st.takeItems(COAL, 10);
+ st.takeItems(CHARCOAL, 10);
+ st.takeItems(GEMSTONE_C, 1);
+ st.takeItems(STONE_OF_PURITY, 1);
+ st.takeItems(SILVER_NUGGET, 5);
+ st.takeItems(TOAD_LORD_BACK_SKIN, -1);
+ st.takeItems(DELUXE_FAIRY_STONE_LIST, 1);
+ st.giveItems(DELUXE_FAIRY_STONE, 1);
+ }
+ break;
+ }
+ case "30711-03.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ if (st.hasQuestItems(DELUXE_FAIRY_STONE))
+ {
+ htmltext = "30711-04.htm";
+ }
+ break;
+ }
+ case "30747-02.htm":
+ {
+ st.set("mimyu", "1");
+ st.takeItems(FAIRY_STONE, 1);
+ break;
+ }
+ case "30747-04.htm":
+ {
+ st.set("mimyu", "1");
+ st.takeItems(DELUXE_FAIRY_STONE, 1);
+ st.giveItems(FAIRY_DUST, 1);
+ break;
+ }
+ case "30747-07.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(JUICE_OF_MONKSHOOD, 1);
+ break;
+ }
+ case "30747-12.htm":
+ {
+ if (!st.hasQuestItems(FAIRY_DUST))
+ {
+ htmltext = "30747-15.htm";
+ giveRandomPet(st, false);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ break;
+ }
+ case "30747-13.htm":
+ {
+ giveRandomPet(st, st.hasQuestItems(FAIRY_DUST));
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
+ break;
}
- else
+ case "30747-14.htm":
{
- htmltext = "30747-13.htm";
+ if (st.hasQuestItems(FAIRY_DUST))
+ {
+ st.takeItems(FAIRY_DUST, 1);
+ giveRandomPet(st, true);
+ if (Rnd.get(20) == 1)
+ {
+ st.giveItems(HATCHLING_SOFT_LEATHER, 1);
+ }
+ else
+ {
+ htmltext = "30747-14t.htm";
+ st.giveItems(FOOD_FOR_HATCHLING, 20);
+ }
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "30747-13.htm";
+ }
+ break;
+ }
+ case "30748-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JUICE_OF_MONKSHOOD, 1);
+ st.giveItems(SCALE_OF_DRAKE_EXARION, 1);
+ break;
+ }
+ case "30749-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JUICE_OF_MONKSHOOD, 1);
+ st.giveItems(SCALE_OF_DRAKE_ZWOV, 1);
+ break;
+ }
+ case "30750-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JUICE_OF_MONKSHOOD, 1);
+ st.giveItems(SCALE_OF_DRAKE_KALIBRAN, 1);
+ break;
+ }
+ case "30750-05.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(EGG_OF_DRAKE_KALIBRAN, 19);
+ st.takeItems(SCALE_OF_DRAKE_KALIBRAN, 1);
+ break;
+ }
+ case "30751-03.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JUICE_OF_MONKSHOOD, 1);
+ st.giveItems(SCALE_OF_WYVERN_SUZET, 1);
+ break;
+ }
+ case "30752-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JUICE_OF_MONKSHOOD, 1);
+ st.giveItems(SCALE_OF_WYVERN_SHAMHAI, 1);
+ break;
}
- }
- // EXARION
- else if (event.equals("30748-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JUICE_OF_MONKSHOOD, 1);
- st.giveItems(SCALE_OF_DRAKE_EXARION, 1);
- }
- // ZWOV
- else if (event.equals("30749-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JUICE_OF_MONKSHOOD, 1);
- st.giveItems(SCALE_OF_DRAKE_ZWOV, 1);
- }
- // KALIBRAN
- else if (event.equals("30750-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JUICE_OF_MONKSHOOD, 1);
- st.giveItems(SCALE_OF_DRAKE_KALIBRAN, 1);
- }
- else if (event.equals("30750-05.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(EGG_OF_DRAKE_KALIBRAN, 19);
- st.takeItems(SCALE_OF_DRAKE_KALIBRAN, 1);
- }
- // SUZET
- else if (event.equals("30751-03.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JUICE_OF_MONKSHOOD, 1);
- st.giveItems(SCALE_OF_WYVERN_SUZET, 1);
- }
- // SHAMHAI
- else if (event.equals("30752-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JUICE_OF_MONKSHOOD, 1);
- st.giveItems(SCALE_OF_WYVERN_SHAMHAI, 1);
}
return htmltext;
@@ -303,29 +309,36 @@ public class Q420_LittleWing extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
switch (npc.getNpcId())
{
case COOPER:
+ {
htmltext = (player.getLevel() >= 35) ? "30829-01.htm" : "30829-03.htm";
break;
-
+ }
case MIMYU:
+ {
_counter += 1;
final Location loc = LOCATIONS[_counter % 3];
npc.teleToLocation(loc.getX(), loc.getY(), loc.getZ());
return null;
+ }
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case COOPER:
+ {
htmltext = "30829-04.htm";
break;
-
+ }
case CRONOS:
+ {
if (cond == 1)
{
htmltext = "30610-01.htm";
@@ -345,7 +358,7 @@ public class Q420_LittleWing extends Quest
else
{
htmltext = "30610-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -363,8 +376,9 @@ public class Q420_LittleWing extends Quest
htmltext = "30610-11.htm";
}
break;
-
+ }
case MARIA:
+ {
if (st.hasAtLeastOneQuestItem(FAIRY_STONE, DELUXE_FAIRY_STONE))
{
htmltext = "30608-06.htm";
@@ -381,22 +395,23 @@ public class Q420_LittleWing extends Quest
}
}
break;
-
+ }
case BYRON:
+ {
final int deluxestone = st.getInt("deluxestone");
if (deluxestone == 1)
{
if (st.hasQuestItems(FAIRY_STONE))
{
htmltext = "30711-05.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.unset("deluxestone");
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (st.hasQuestItems(DELUXE_FAIRY_STONE))
{
htmltext = "30711-06.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.unset("deluxestone");
st.playSound(QuestState.SOUND_MIDDLE);
}
@@ -425,8 +440,9 @@ public class Q420_LittleWing extends Quest
}
}
break;
-
+ }
case MIMYU:
+ {
if (cond == 4)
{
if (st.getInt("mimyu") == 1)
@@ -470,8 +486,9 @@ public class Q420_LittleWing extends Quest
return null;
}
break;
-
+ }
case EXARION:
+ {
if (cond == 5)
{
htmltext = "30748-01.htm";
@@ -485,7 +502,7 @@ public class Q420_LittleWing extends Quest
else
{
htmltext = "30748-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(EGG_OF_DRAKE_EXARION, 19);
st.takeItems(SCALE_OF_DRAKE_EXARION, 1);
@@ -496,8 +513,9 @@ public class Q420_LittleWing extends Quest
htmltext = "30748-05.htm";
}
break;
-
+ }
case ZWOV:
+ {
if (cond == 5)
{
htmltext = "30749-01.htm";
@@ -511,7 +529,7 @@ public class Q420_LittleWing extends Quest
else
{
htmltext = "30749-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(EGG_OF_DRAKE_ZWOV, 19);
st.takeItems(SCALE_OF_DRAKE_ZWOV, 1);
@@ -522,8 +540,9 @@ public class Q420_LittleWing extends Quest
htmltext = "30749-05.htm";
}
break;
-
+ }
case KALIBRAN:
+ {
if (cond == 5)
{
htmltext = "30750-01.htm";
@@ -537,8 +556,9 @@ public class Q420_LittleWing extends Quest
htmltext = "30750-06.htm";
}
break;
-
+ }
case SUZET:
+ {
if (cond == 5)
{
htmltext = "30751-01.htm";
@@ -552,7 +572,7 @@ public class Q420_LittleWing extends Quest
else
{
htmltext = "30751-05.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(EGG_OF_WYVERN_SUZET, 19);
st.takeItems(SCALE_OF_WYVERN_SUZET, 1);
@@ -563,8 +583,9 @@ public class Q420_LittleWing extends Quest
htmltext = "30751-06.htm";
}
break;
-
+ }
case SHAMHAI:
+ {
if (cond == 5)
{
htmltext = "30752-01.htm";
@@ -578,7 +599,7 @@ public class Q420_LittleWing extends Quest
else
{
htmltext = "30752-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(EGG_OF_WYVERN_SHAMHAI, 19);
st.takeItems(SCALE_OF_WYVERN_SHAMHAI, 1);
@@ -589,8 +610,10 @@ public class Q420_LittleWing extends Quest
htmltext = "30752-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -608,6 +631,7 @@ public class Q420_LittleWing extends Quest
switch (npc.getNpcId())
{
case 20231:
+ {
if (st.hasQuestItems(FAIRY_STONE_LIST))
{
st.dropItems(TOAD_LORD_BACK_SKIN, 1, 10, 300000);
@@ -617,42 +641,47 @@ public class Q420_LittleWing extends Quest
st.dropItems(TOAD_LORD_BACK_SKIN, 1, 20, 300000);
}
break;
-
+ }
case 20580:
+ {
if (st.hasQuestItems(SCALE_OF_DRAKE_EXARION) && !st.dropItems(EGG_OF_DRAKE_EXARION, 1, 20, 500000))
{
npc.broadcastNpcSay("If the eggs get taken, we're dead!");
}
break;
-
+ }
case 20233:
+ {
if (st.hasQuestItems(SCALE_OF_DRAKE_ZWOV))
{
st.dropItems(EGG_OF_DRAKE_ZWOV, 1, 20, 500000);
}
break;
-
+ }
case 20551:
+ {
if (st.hasQuestItems(SCALE_OF_DRAKE_KALIBRAN) && !st.dropItems(EGG_OF_DRAKE_KALIBRAN, 1, 20, 500000))
{
npc.broadcastNpcSay("Hey! Everybody watch the eggs!");
}
break;
-
+ }
case 20270:
+ {
if (st.hasQuestItems(SCALE_OF_WYVERN_SUZET) && !st.dropItems(EGG_OF_WYVERN_SUZET, 1, 20, 500000))
{
npc.broadcastNpcSay("I thought I'd caught one share... Whew!");
}
break;
-
+ }
case 20202:
+ {
if (st.hasQuestItems(SCALE_OF_WYVERN_SHAMHAI))
{
st.dropItems(EGG_OF_WYVERN_SHAMHAI, 1, 20, 500000);
}
break;
-
+ }
case 20589:
case 20590:
case 20591:
@@ -664,6 +693,7 @@ public class Q420_LittleWing extends Quest
case 20597:
case 20598:
case 20599:
+ {
if (st.hasQuestItems(DELUXE_FAIRY_STONE) && (Rnd.get(100) < 30))
{
st.set("deluxestone", "2");
@@ -672,6 +702,7 @@ public class Q420_LittleWing extends Quest
npc.broadcastNpcSay("The stone... the Elven stone... broke...");
}
break;
+ }
}
return null;
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q421_LittleWingsBigAdventure/Q421_LittleWingsBigAdventure.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q421_LittleWingsBigAdventure/Q421_LittleWingsBigAdventure.java
index 592312bf2e..f7e3e47830 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q421_LittleWingsBigAdventure/Q421_LittleWingsBigAdventure.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q421_LittleWingsBigAdventure/Q421_LittleWingsBigAdventure.java
@@ -45,19 +45,15 @@ public class Q421_LittleWingsBigAdventure extends Quest
// NPCs
private static final int CRONOS = 30610;
private static final int MIMYU = 30747;
-
// Item
private static final int FAIRY_LEAF = 4325;
public Q421_LittleWingsBigAdventure()
{
super(421, "Little Wing's Big Adventure");
-
registerQuestItems(FAIRY_LEAF);
-
addStartNpc(CRONOS);
addTalkId(CRONOS, MIMYU);
-
addAttackId(27185, 27186, 27187, 27188);
addKillId(27185, 27186, 27187, 27188);
}
@@ -72,50 +68,53 @@ public class Q421_LittleWingsBigAdventure extends Quest
return htmltext;
}
- if (event.equals("30610-06.htm"))
+ switch (event)
{
- if ((st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) == 1)
+ case "30610-06.htm":
{
- // Find the level of the flute.
- for (int i = 3500; i < 3503; i++)
+ if ((st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) == 1)
{
- final ItemInstance item = player.getInventory().getItemByItemId(i);
- if ((item != null) && (item.getEnchantLevel() >= 55))
+ // Find the level of the flute.
+ for (int i = 3500; i < 3503; i++)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("iCond", "1");
- st.set("summonOid", String.valueOf(item.getObjectId()));
- st.playSound(QuestState.SOUND_ACCEPT);
- return "30610-05.htm";
+ final ItemInstance item = player.getInventory().getItemByItemId(i);
+ if ((item != null) && (item.getEnchantLevel() >= 55))
+ {
+ st.startQuest();
+ st.set("iCond", "1");
+ st.set("summonOid", String.valueOf(item.getObjectId()));
+ return "30610-05.htm";
+ }
}
}
+ // Exit quest if you got more than one flute, or the flute level doesn't meat requirements.
+ st.exitQuest(true);
+ break;
}
-
- // Exit quest if you got more than one flute, or the flute level doesn't meat requirements.
- st.exitQuest(true);
- }
- else if (event.equals("30747-02.htm"))
- {
- final Summon summon = player.getPet();
- if (summon != null)
+ case "30747-02.htm":
{
- htmltext = (summon.getControlItemId() == st.getInt("summonOid")) ? "30747-04.htm" : "30747-03.htm";
+ final Summon summon = player.getPet();
+ if (summon != null)
+ {
+ htmltext = (summon.getControlItemId() == st.getInt("summonOid")) ? "30747-04.htm" : "30747-03.htm";
+ }
+ break;
}
- }
- else if (event.equals("30747-05.htm"))
- {
- final Summon summon = player.getPet();
- if ((summon == null) || (summon.getControlItemId() != st.getInt("summonOid")))
+ case "30747-05.htm":
{
- htmltext = "30747-06.htm";
- }
- else
- {
- st.set("cond", "2");
- st.set("iCond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(FAIRY_LEAF, 4);
+ final Summon summon = player.getPet();
+ if ((summon == null) || (summon.getControlItemId() != st.getInt("summonOid")))
+ {
+ htmltext = "30747-06.htm";
+ }
+ else
+ {
+ st.setCond(2);
+ st.set("iCond", "3");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(FAIRY_LEAF, 4);
+ }
+ break;
}
}
@@ -135,6 +134,7 @@ public class Q421_LittleWingsBigAdventure extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
// Wrong level.
if (player.getLevel() < 45)
{
@@ -160,15 +160,18 @@ public class Q421_LittleWingsBigAdventure extends Quest
htmltext = "30610-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case CRONOS:
+ {
htmltext = "30610-07.htm";
break;
-
+ }
case MIMYU:
+ {
final int id = st.getInt("iCond");
if (id == 1)
{
@@ -223,7 +226,7 @@ public class Q421_LittleWingsBigAdventure extends Quest
if ((item != null) && (item.getObjectId() == st.getInt("summonOid")))
{
st.takeItems(i, 1);
- st.giveItems(i + 922, 1, item.getEnchantLevel()); // TODO rebuild entirely pet system in order enchant is given a fuck. Supposed to give an item level XX for a flute level XX.
+ st.giveItems(i + 922, 1, item.getEnchantLevel()); // TODO: rebuild entirely pet system in order enchant is given a fuck. Supposed to give an item level XX for a flute level XX.
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
return "30747-16.htm";
@@ -240,8 +243,10 @@ public class Q421_LittleWingsBigAdventure extends Quest
}
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -263,7 +268,7 @@ public class Q421_LittleWingsBigAdventure extends Quest
}
// Condition required : 2.
- final QuestState st = checkPlayerCondition(attacker, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(attacker, npc, 2);
if (st == null)
{
return null;
@@ -287,7 +292,7 @@ public class Q421_LittleWingsBigAdventure extends Quest
// Four leafs have been used ; update quest state.
if (st.getInt("iCond") == 63)
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q422_RepentYourSins/Q422_RepentYourSins.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q422_RepentYourSins/Q422_RepentYourSins.java
index 316850fc0c..381a1c53e1 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q422_RepentYourSins/Q422_RepentYourSins.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q422_RepentYourSins/Q422_RepentYourSins.java
@@ -27,23 +27,6 @@ import org.l2jmobius.gameserver.network.serverpackets.UserInfo;
public class Q422_RepentYourSins extends Quest
{
- // Items
- private static final int RATMAN_SCAVENGER_SKULL = 4326;
- private static final int TUREK_WAR_HOUND_TAIL = 4327;
- private static final int TYRANT_KINGPIN_HEART = 4328;
- private static final int TRISALIM_TARANTULA_VENOM_SAC = 4329;
-
- private static final int QITEM_PENITENT_MANACLES = 4330;
- private static final int MANUAL_OF_MANACLES = 4331;
- private static final int PENITENT_MANACLES = 4425;
- private static final int LEFT_PENITENT_MANACLES = 4426;
-
- private static final int SILVER_NUGGET = 1873;
- private static final int ADAMANTINE_NUGGET = 1877;
- private static final int BLACKSMITH_FRAME = 1892;
- private static final int COKES = 1879;
- private static final int STEEL = 1880;
-
// NPCs
private static final int BLACK_JUDGE = 30981;
private static final int KATARI = 30668;
@@ -51,16 +34,27 @@ public class Q422_RepentYourSins extends Quest
private static final int CASIAN = 30612;
private static final int JOAN = 30718;
private static final int PUSHKIN = 30300;
+ // Items
+ private static final int RATMAN_SCAVENGER_SKULL = 4326;
+ private static final int TUREK_WAR_HOUND_TAIL = 4327;
+ private static final int TYRANT_KINGPIN_HEART = 4328;
+ private static final int TRISALIM_TARANTULA_VENOM_SAC = 4329;
+ private static final int QITEM_PENITENT_MANACLES = 4330;
+ private static final int MANUAL_OF_MANACLES = 4331;
+ private static final int PENITENT_MANACLES = 4425;
+ private static final int LEFT_PENITENT_MANACLES = 4426;
+ private static final int SILVER_NUGGET = 1873;
+ private static final int ADAMANTINE_NUGGET = 1877;
+ private static final int BLACKSMITH_FRAME = 1892;
+ private static final int COKES = 1879;
+ private static final int STEEL = 1880;
public Q422_RepentYourSins()
{
super(422, "Repent Your Sins");
-
registerQuestItems(RATMAN_SCAVENGER_SKULL, TUREK_WAR_HOUND_TAIL, TYRANT_KINGPIN_HEART, TRISALIM_TARANTULA_VENOM_SAC, MANUAL_OF_MANACLES, PENITENT_MANACLES, QITEM_PENITENT_MANACLES);
-
addStartNpc(BLACK_JUDGE);
addTalkId(BLACK_JUDGE, KATARI, PIOTUR, CASIAN, JOAN, PUSHKIN);
-
addKillId(20039, 20494, 20193, 20561);
}
@@ -74,119 +68,121 @@ public class Q422_RepentYourSins extends Quest
return htmltext;
}
- if (event.equals("Start"))
+ switch (event)
{
- st.set("cond", "1");
- if (player.getLevel() <= 20)
+ case "Start":
{
- htmltext = "30981-03.htm";
- st.set("cond", "2");
- }
- else if ((player.getLevel() >= 20) && (player.getLevel() <= 30))
- {
- htmltext = "30981-04.htm";
- st.set("cond", "3");
- }
- else if ((player.getLevel() >= 30) && (player.getLevel() <= 40))
- {
- htmltext = "30981-05.htm";
- st.set("cond", "4");
- }
- else
- {
- htmltext = "30981-06.htm";
- st.set("cond", "5");
- }
- st.setState(State.STARTED);
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30981-11.htm"))
- {
- if (!st.hasQuestItems(PENITENT_MANACLES))
- {
- final int cond = st.getInt("cond");
-
- // Case you return back the qitem to Black Judge. She rewards you with the pet item.
- if (cond == 15)
+ st.startQuest();
+ if (player.getLevel() <= 20)
{
- st.set("cond", "16");
- st.set("level", String.valueOf(player.getLevel()));
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(QITEM_PENITENT_MANACLES, -1);
- st.giveItems(PENITENT_MANACLES, 1);
+ htmltext = "30981-03.htm";
+ st.setCond(2);
}
- // Case you return back to Black Judge with leftover of previous quest.
- else if (cond == 16)
+ else if ((player.getLevel() >= 20) && (player.getLevel() <= 30))
{
- st.set("level", String.valueOf(player.getLevel()));
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(LEFT_PENITENT_MANACLES, -1);
- st.giveItems(PENITENT_MANACLES, 1);
+ htmltext = "30981-04.htm";
+ st.setCond(3);
}
- }
- }
- else if (event.equals("30981-19.htm"))
- {
- if (st.hasQuestItems(LEFT_PENITENT_MANACLES))
- {
- st.setState(State.STARTED);
- st.set("cond", "16");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- }
- else if (event.equals("Pk"))
- {
- final Summon pet = player.getPet();
-
- // If Sin Eater is currently summoned, show a warning.
- if ((pet != null) && (pet.getNpcId() == 12564))
- {
- htmltext = "30981-16.htm";
- }
- else if (findSinEaterLvl(player) > st.getInt("level"))
- {
- st.takeItems(PENITENT_MANACLES, 1);
- st.giveItems(LEFT_PENITENT_MANACLES, 1);
-
- final int removePkAmount = Rnd.get(10) + 1;
-
- // Player's PKs are lower than random amount ; finish the quest.
- if (player.getPkKills() <= removePkAmount)
+ else if ((player.getLevel() >= 30) && (player.getLevel() <= 40))
{
- htmltext = "30981-15.htm";
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
-
- player.setPkKills(0);
- player.sendPacket(new UserInfo(player));
+ htmltext = "30981-05.htm";
+ st.setCond(4);
}
- // Player's PK are bigger than random amount ; continue the quest.
else
{
- htmltext = "30981-14.htm";
- st.set("level", String.valueOf(player.getLevel()));
- st.playSound(QuestState.SOUND_MIDDLE);
-
- player.setPkKills(player.getPkKills() - removePkAmount);
- player.sendPacket(new UserInfo(player));
+ htmltext = "30981-06.htm";
+ st.setCond(5);
}
+ break;
+ }
+ case "30981-11.htm":
+ {
+ if (!st.hasQuestItems(PENITENT_MANACLES))
+ {
+ final int cond = st.getCond();
+
+ // Case you return back the qitem to Black Judge. She rewards you with the pet item.
+ if (cond == 15)
+ {
+ st.setCond(16);
+ st.set("level", String.valueOf(player.getLevel()));
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(QITEM_PENITENT_MANACLES, -1);
+ st.giveItems(PENITENT_MANACLES, 1);
+ }
+ // Case you return back to Black Judge with leftover of previous quest.
+ else if (cond == 16)
+ {
+ st.set("level", String.valueOf(player.getLevel()));
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(LEFT_PENITENT_MANACLES, -1);
+ st.giveItems(PENITENT_MANACLES, 1);
+ }
+ }
+ break;
+ }
+ case "30981-19.htm":
+ {
+ if (st.hasQuestItems(LEFT_PENITENT_MANACLES))
+ {
+ st.setState(State.STARTED);
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_ACCEPT);
+ }
+ break;
+ }
+ case "Pk":
+ {
+ final Summon pet = player.getPet();
+ // If Sin Eater is currently summoned, show a warning.
+ if ((pet != null) && (pet.getNpcId() == 12564))
+ {
+ htmltext = "30981-16.htm";
+ }
+ else if (findSinEaterLvl(player) > st.getInt("level"))
+ {
+ st.takeItems(PENITENT_MANACLES, 1);
+ st.giveItems(LEFT_PENITENT_MANACLES, 1);
+
+ final int removePkAmount = Rnd.get(10) + 1;
+
+ // Player's PKs are lower than random amount ; finish the quest.
+ if (player.getPkKills() <= removePkAmount)
+ {
+ htmltext = "30981-15.htm";
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+
+ player.setPkKills(0);
+ player.sendPacket(new UserInfo(player));
+ }
+ // Player's PK are bigger than random amount ; continue the quest.
+ else
+ {
+ htmltext = "30981-14.htm";
+ st.set("level", String.valueOf(player.getLevel()));
+ st.playSound(QuestState.SOUND_MIDDLE);
+
+ player.setPkKills(player.getPkKills() - removePkAmount);
+ player.sendPacket(new UserInfo(player));
+ }
+ }
+ break;
+ }
+ case "Quit":
+ {
+ htmltext = "30981-20.htm";
+ st.takeItems(RATMAN_SCAVENGER_SKULL, -1);
+ st.takeItems(TUREK_WAR_HOUND_TAIL, -1);
+ st.takeItems(TYRANT_KINGPIN_HEART, -1);
+ st.takeItems(TRISALIM_TARANTULA_VENOM_SAC, -1);
+ st.takeItems(MANUAL_OF_MANACLES, -1);
+ st.takeItems(PENITENT_MANACLES, -1);
+ st.takeItems(QITEM_PENITENT_MANACLES, -1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("Quit"))
- {
- htmltext = "30981-20.htm";
-
- st.takeItems(RATMAN_SCAVENGER_SKULL, -1);
- st.takeItems(TUREK_WAR_HOUND_TAIL, -1);
- st.takeItems(TYRANT_KINGPIN_HEART, -1);
- st.takeItems(TRISALIM_TARANTULA_VENOM_SAC, -1);
-
- st.takeItems(MANUAL_OF_MANACLES, -1);
- st.takeItems(PENITENT_MANACLES, -1);
- st.takeItems(QITEM_PENITENT_MANACLES, -1);
-
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -205,6 +201,7 @@ public class Q422_RepentYourSins extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getPkKills() >= 1)
{
htmltext = (st.hasQuestItems(LEFT_PENITENT_MANACLES)) ? "30981-18.htm" : "30981-02.htm";
@@ -214,12 +211,14 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30981-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BLACK_JUDGE:
+ {
if (cond <= 9)
{
htmltext = "30981-07.htm";
@@ -227,7 +226,7 @@ public class Q422_RepentYourSins extends Quest
else if ((cond > 9) && (cond < 14))
{
htmltext = "30981-08.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(MANUAL_OF_MANACLES, 1);
}
@@ -251,12 +250,13 @@ public class Q422_RepentYourSins extends Quest
}
}
break;
-
+ }
case KATARI:
+ {
if (cond == 2)
{
htmltext = "30668-01.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 6)
@@ -268,7 +268,7 @@ public class Q422_RepentYourSins extends Quest
else
{
htmltext = "30668-03.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RATMAN_SCAVENGER_SKULL, -1);
}
@@ -278,12 +278,13 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30668-04.htm";
}
break;
-
+ }
case PIOTUR:
+ {
if (cond == 3)
{
htmltext = "30597-01.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 7)
@@ -295,7 +296,7 @@ public class Q422_RepentYourSins extends Quest
else
{
htmltext = "30597-03.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TUREK_WAR_HOUND_TAIL, -1);
}
@@ -305,12 +306,13 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30597-04.htm";
}
break;
-
+ }
case CASIAN:
+ {
if (cond == 4)
{
htmltext = "30612-01.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 8)
@@ -322,7 +324,7 @@ public class Q422_RepentYourSins extends Quest
else
{
htmltext = "30612-03.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TYRANT_KINGPIN_HEART, -1);
}
@@ -332,12 +334,13 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30612-04.htm";
}
break;
-
+ }
case JOAN:
+ {
if (cond == 5)
{
htmltext = "30718-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 9)
@@ -349,7 +352,7 @@ public class Q422_RepentYourSins extends Quest
else
{
htmltext = "30718-03.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TRISALIM_TARANTULA_VENOM_SAC, -1);
}
@@ -359,8 +362,9 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30718-04.htm";
}
break;
-
+ }
case PUSHKIN:
+ {
if ((cond == 14) && (st.getQuestItemsCount(MANUAL_OF_MANACLES) == 1))
{
if ((st.getQuestItemsCount(SILVER_NUGGET) < 10) || (st.getQuestItemsCount(STEEL) < 5) || (st.getQuestItemsCount(ADAMANTINE_NUGGET) < 2) || (st.getQuestItemsCount(COKES) < 10) || (st.getQuestItemsCount(BLACKSMITH_FRAME) < 1))
@@ -370,7 +374,7 @@ public class Q422_RepentYourSins extends Quest
else
{
htmltext = "30300-01.htm";
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MANUAL_OF_MANACLES, 1);
@@ -388,8 +392,10 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30300-03.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -407,32 +413,37 @@ public class Q422_RepentYourSins extends Quest
switch (npc.getNpcId())
{
case 20039:
- if (st.getInt("cond") == 6)
+ {
+ if (st.isCond(6))
{
st.dropItemsAlways(RATMAN_SCAVENGER_SKULL, 1, 10);
}
break;
-
+ }
case 20494:
- if (st.getInt("cond") == 7)
+ {
+ if (st.isCond(7))
{
st.dropItemsAlways(TUREK_WAR_HOUND_TAIL, 1, 10);
}
break;
-
+ }
case 20193:
- if (st.getInt("cond") == 8)
+ {
+ if (st.isCond(8))
{
st.dropItemsAlways(TYRANT_KINGPIN_HEART, 1, 1);
}
break;
-
+ }
case 20561:
- if (st.getInt("cond") == 9)
+ {
+ if (st.isCond(9))
{
st.dropItemsAlways(TRISALIM_TARANTULA_VENOM_SAC, 1, 3);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q426_QuestForFishingShot/Q426_QuestForFishingShot.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q426_QuestForFishingShot/Q426_QuestForFishingShot.java
index 17706b6319..a850f201b7 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q426_QuestForFishingShot/Q426_QuestForFishingShot.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q426_QuestForFishingShot/Q426_QuestForFishingShot.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q426_QuestForFishingShot extends Quest
{
private static final int SWEET_FLUID = 7586;
-
private static final Map MOBS1 = new HashMap<>();
static
{
@@ -204,7 +203,6 @@ public class Q426_QuestForFishingShot extends Quest
MOBS1.put(21641, 195);
MOBS1.put(21644, 170);
}
-
private static final Map MOBS2 = new HashMap<>();
static
{
@@ -235,7 +233,6 @@ public class Q426_QuestForFishingShot extends Quest
MOBS2.put(21518, 255);
MOBS2.put(21636, 950);
}
-
private static final Map MOBS3 = new HashMap<>();
static
{
@@ -256,7 +253,6 @@ public class Q426_QuestForFishingShot extends Quest
MOBS3.put(21081, 955);
MOBS3.put(21264, 920);
}
-
private static final Map MOBS4 = new HashMap<>();
static
{
@@ -280,7 +276,6 @@ public class Q426_QuestForFishingShot extends Quest
MOBS4.put(21655, 640);
MOBS4.put(21657, 935);
}
-
private static final Map MOBS5 = new HashMap<>();
static
{
@@ -293,70 +288,30 @@ public class Q426_QuestForFishingShot extends Quest
MOBS5.put(21654, 400);
MOBS5.put(21656, 750);
}
-
- private static final Map MOBSspecial = new HashMap<>();
+ private static final Map MOB_SPECIAL = new HashMap<>();
static
{
- MOBSspecial.put(20829, new int[]
- {
- 115,
- 6
- });
- MOBSspecial.put(20859, new int[]
- {
- 890,
- 8
- });
- MOBSspecial.put(21066, new int[]
- {
- 5,
- 5
- });
- MOBSspecial.put(21068, new int[]
- {
- 565,
- 11
- });
- MOBSspecial.put(21071, new int[]
- {
- 400,
- 12
- });
+ // @formatter:off
+ MOB_SPECIAL.put(20829, new int[]{115, 6});
+ MOB_SPECIAL.put(20859, new int[]{890, 8});
+ MOB_SPECIAL.put(21066, new int[]{5, 5});
+ MOB_SPECIAL.put(21068, new int[]{565, 11});
+ MOB_SPECIAL.put(21071, new int[]{400, 12});
+ // @formatter:on
}
public Q426_QuestForFishingShot()
{
super(426, "Quest for Fishing Shot");
-
registerQuestItems(SWEET_FLUID);
-
addStartNpc(31562, 31563, 31564, 31565, 31566, 31567, 31568, 31569, 31570, 31571, 31572, 31573, 31574, 31575, 31576, 31577, 31578, 31579, 31696, 31697, 31989, 32007);
addTalkId(31562, 31563, 31564, 31565, 31566, 31567, 31568, 31569, 31570, 31571, 31572, 31573, 31574, 31575, 31576, 31577, 31578, 31579, 31696, 31697, 31989, 32007);
-
- for (int mob : MOBS1.keySet())
- {
- addKillId(mob);
- }
- for (int mob : MOBS2.keySet())
- {
- addKillId(mob);
- }
- for (int mob : MOBS3.keySet())
- {
- addKillId(mob);
- }
- for (int mob : MOBS4.keySet())
- {
- addKillId(mob);
- }
- for (int mob : MOBS5.keySet())
- {
- addKillId(mob);
- }
- for (int mob : MOBSspecial.keySet())
- {
- addKillId(mob);
- }
+ addKillId(MOBS1.keySet());
+ addKillId(MOBS2.keySet());
+ addKillId(MOBS3.keySet());
+ addKillId(MOBS4.keySet());
+ addKillId(MOBS5.keySet());
+ addKillId(MOB_SPECIAL.keySet());
}
@Override
@@ -371,9 +326,7 @@ public class Q426_QuestForFishingShot extends Quest
if (event.equals("03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("08.htm"))
{
@@ -397,12 +350,15 @@ public class Q426_QuestForFishingShot extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(SWEET_FLUID)) ? "05.htm" : "04.htm";
break;
+ }
}
return htmltext;
@@ -423,10 +379,9 @@ public class Q426_QuestForFishingShot extends Quest
return null;
}
- final int npcId = npc.getNpcId();
int drop = 0;
int chance = 0;
-
+ final int npcId = npc.getNpcId();
if (MOBS1.containsKey(npcId))
{
chance = MOBS1.get(npcId);
@@ -451,10 +406,10 @@ public class Q426_QuestForFishingShot extends Quest
chance = MOBS5.get(npcId);
drop = 4;
}
- else if (MOBSspecial.containsKey(npcId))
+ else if (MOB_SPECIAL.containsKey(npcId))
{
- chance = MOBSspecial.get(npcId)[0];
- drop = MOBSspecial.get(npcId)[1];
+ chance = MOB_SPECIAL.get(npcId)[0];
+ drop = MOB_SPECIAL.get(npcId)[1];
}
if (Rnd.get(1000) <= chance)
@@ -467,6 +422,7 @@ public class Q426_QuestForFishingShot extends Quest
st.playSound(QuestState.SOUND_ITEMGET);
st.rewardItems(SWEET_FLUID, drop);
}
+
return null;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q431_WeddingMarch/Q431_WeddingMarch.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q431_WeddingMarch/Q431_WeddingMarch.java
index 4060b1f71c..f9de10e6d0 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q431_WeddingMarch/Q431_WeddingMarch.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q431_WeddingMarch/Q431_WeddingMarch.java
@@ -26,22 +26,17 @@ public class Q431_WeddingMarch extends Quest
{
// NPC
private static final int KANTABILON = 31042;
-
// Item
private static final int SILVER_CRYSTAL = 7540;
-
// Reward
private static final int WEDDING_ECHO_CRYSTAL = 7062;
public Q431_WeddingMarch()
{
super(431, "Wedding March");
-
registerQuestItems(SILVER_CRYSTAL);
-
addStartNpc(KANTABILON);
addTalkId(KANTABILON);
-
addKillId(20786, 20787);
}
@@ -57,9 +52,7 @@ public class Q431_WeddingMarch extends Quest
if (event.equals("31042-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31042-05.htm"))
{
@@ -92,11 +85,13 @@ public class Q431_WeddingMarch extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 38) ? "31042-00.htm" : "31042-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31042-02.htm";
@@ -106,6 +101,7 @@ public class Q431_WeddingMarch extends Quest
htmltext = (st.getQuestItemsCount(SILVER_CRYSTAL) < 50) ? "31042-03.htm" : "31042-04.htm";
}
break;
+ }
}
return htmltext;
@@ -114,7 +110,7 @@ public class Q431_WeddingMarch extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -128,7 +124,7 @@ public class Q431_WeddingMarch extends Quest
if (st.dropItems(SILVER_CRYSTAL, 1, 50, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q432_BirthdayPartySong/Q432_BirthdayPartySong.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q432_BirthdayPartySong/Q432_BirthdayPartySong.java
index fc49584466..50f909ce0c 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q432_BirthdayPartySong/Q432_BirthdayPartySong.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q432_BirthdayPartySong/Q432_BirthdayPartySong.java
@@ -26,19 +26,15 @@ public class Q432_BirthdayPartySong extends Quest
{
// NPC
private static final int OCTAVIA = 31043;
-
// Item
private static final int RED_CRYSTAL = 7541;
public Q432_BirthdayPartySong()
{
super(432, "Birthday Party Song");
-
registerQuestItems(RED_CRYSTAL);
-
addStartNpc(OCTAVIA);
addTalkId(OCTAVIA);
-
addKillId(21103);
}
@@ -54,20 +50,15 @@ public class Q432_BirthdayPartySong extends Quest
if (event.equals("31043-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
- else if (event.equals("31043-06.htm"))
+ else if (event.equals("31043-06.htm") && (st.getQuestItemsCount(RED_CRYSTAL) == 50))
{
- if (st.getQuestItemsCount(RED_CRYSTAL) == 50)
- {
- htmltext = "31043-05.htm";
- st.takeItems(RED_CRYSTAL, -1);
- st.rewardItems(7061, 25);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
+ htmltext = "31043-05.htm";
+ st.takeItems(RED_CRYSTAL, -1);
+ st.rewardItems(7061, 25);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
}
return htmltext;
@@ -86,12 +77,15 @@ public class Q432_BirthdayPartySong extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 31) ? "31043-00.htm" : "31043-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(RED_CRYSTAL) < 50) ? "31043-03.htm" : "31043-04.htm";
break;
+ }
}
return htmltext;
@@ -100,7 +94,7 @@ public class Q432_BirthdayPartySong extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -114,7 +108,7 @@ public class Q432_BirthdayPartySong extends Quest
if (st.dropItems(RED_CRYSTAL, 1, 50, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q501_ProofOfClanAlliance/Q501_ProofOfClanAlliance.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q501_ProofOfClanAlliance/Q501_ProofOfClanAlliance.java
index 52298d16ad..e2cbf26c8b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q501_ProofOfClanAlliance/Q501_ProofOfClanAlliance.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q501_ProofOfClanAlliance/Q501_ProofOfClanAlliance.java
@@ -36,10 +36,24 @@ import org.l2jmobius.gameserver.model.quest.State;
*/
public class Q501_ProofOfClanAlliance extends Quest
{
+ // NPC
+ private static final int SIR_KRISTOF_RODEMAI = 30756;
+ private static final int STATUE_OF_OFFERING = 30757;
+ private static final int ATHREA = 30758;
+ private static final int KALIS = 30759;
+ // Monsters
+ private static final int VANOR_SILENOS_SHAMAN = 20685;
+ private static final int HARIT_LIZARDMAN_SHAMAN = 20644;
+ private static final int OEL_MAHUM_WITCH_DOCTOR = 20576;
+ // Chests
+ private static final int BOX_OF_ATHREA_1 = 27173;
+ private static final int BOX_OF_ATHREA_2 = 27174;
+ private static final int BOX_OF_ATHREA_3 = 27175;
+ private static final int BOX_OF_ATHREA_4 = 27176;
+ private static final int BOX_OF_ATHREA_5 = 27177;
// Items
private static final int ADENA = 57;
private static final int POTION_OF_RECOVERY = 3889;
-
// Quest Items
private static final int HERB_OF_HARIT = 3832;
private static final int HERB_OF_VANOR = 3833;
@@ -49,31 +63,8 @@ public class Q501_ProofOfClanAlliance extends Quest
private static final int SYMBOL_OF_LOYALTY = 3837;
private static final int VOUCHER_OF_FAITH = 3873;
private static final int ANTIDOTE_RECIPE_LIST = 3872;
-
// Reward
private static final int PROOF_OF_ALLIANCE = 3874;
-
- // NPC
- private static final int SIR_KRISTOF_RODEMAI = 30756;
- private static final int STATUE_OF_OFFERING = 30757;
- private static final int ATHREA = 30758;
- private static final int KALIS = 30759;
-
- // Mobs
- private static final int VANOR_SILENOS_SHAMAN = 20685;
- private static final int HARIT_LIZARDMAN_SHAMAN = 20644;
- private static final int OEL_MAHUM_WITCH_DOCTOR = 20576;
-
- // Chests
- private static final int BOX_OF_ATHREA_1 = 27173;
- private static final int BOX_OF_ATHREA_2 = 27174;
- private static final int BOX_OF_ATHREA_3 = 27175;
- private static final int BOX_OF_ATHREA_4 = 27176;
- private static final int BOX_OF_ATHREA_5 = 27177;
-
- // Trigger
- private static boolean _isSpawned = false;
-
// Drops
private static final Map DROP = new HashMap<>();
static
@@ -82,7 +73,6 @@ public class Q501_ProofOfClanAlliance extends Quest
DROP.put(HARIT_LIZARDMAN_SHAMAN, HERB_OF_HARIT);
DROP.put(OEL_MAHUM_WITCH_DOCTOR, HERB_OF_OEL_MAHUM);
}
-
// Chests spawns
// @formatter:off
private static final int[][] CHESTS_SPAWN =
@@ -105,36 +95,27 @@ public class Q501_ProofOfClanAlliance extends Quest
{102186, 103022, -3541}
};
// @formatter:on
-
// Chests
- private static final List CHESTS_ID = new ArrayList<>();
+ private static final List CHEST_IDS = new ArrayList<>();
static
{
- CHESTS_ID.add(BOX_OF_ATHREA_1);
- CHESTS_ID.add(BOX_OF_ATHREA_2);
- CHESTS_ID.add(BOX_OF_ATHREA_3);
- CHESTS_ID.add(BOX_OF_ATHREA_4);
- CHESTS_ID.add(BOX_OF_ATHREA_5);
+ CHEST_IDS.add(BOX_OF_ATHREA_1);
+ CHEST_IDS.add(BOX_OF_ATHREA_2);
+ CHEST_IDS.add(BOX_OF_ATHREA_3);
+ CHEST_IDS.add(BOX_OF_ATHREA_4);
+ CHEST_IDS.add(BOX_OF_ATHREA_5);
}
+ // Trigger
+ private static boolean _isSpawned = false;
public Q501_ProofOfClanAlliance()
{
super(501, "Proof of Clan Alliance");
-
registerQuestItems(HERB_OF_HARIT, HERB_OF_VANOR, HERB_OF_OEL_MAHUM, BLOOD_OF_EVA, ATHREAS_COIN, SYMBOL_OF_LOYALTY, VOUCHER_OF_FAITH, ANTIDOTE_RECIPE_LIST);
-
addStartNpc(SIR_KRISTOF_RODEMAI, STATUE_OF_OFFERING);
addTalkId(SIR_KRISTOF_RODEMAI, KALIS, STATUE_OF_OFFERING, ATHREA);
-
- for (int mob : DROP.keySet())
- {
- addKillId(mob);
- }
-
- for (int chest : CHESTS_ID)
- {
- addKillId(chest);
- }
+ addKillId(DROP.keySet());
+ addKillId(CHEST_IDS);
}
@Override
@@ -142,114 +123,121 @@ public class Q501_ProofOfClanAlliance extends Quest
{
String htmltext = event;
final QuestState st = player.getQuestState(getName());
- final QuestState st2 = getClanLeaderQuestState(player, npc);
if (st == null)
{
return htmltext;
}
- if (event.equals("30756-07.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("state", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30759-03.htm"))
- {
- st.set("cond", "2");
- st.set("state", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30759-07.htm"))
- {
- st.set("cond", "3");
- st.set("state", "3");
- st.takeItems(SYMBOL_OF_LOYALTY, 1);
- st.takeItems(SYMBOL_OF_LOYALTY, 1);
- st.takeItems(SYMBOL_OF_LOYALTY, 1);
- st.giveItems(ANTIDOTE_RECIPE_LIST, 1);
- SkillTable.getInstance().getSkill(4082, 1).applyEffects(npc, player);
- startQuestTimer("poison", 60000, npc, player, true);
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30757-03.htm"))
- {
- if (Rnd.get(10) > 5)
+ case "30756-07.htm":
{
+ st.startQuest();
+ st.set("state", "1");
+ break;
+ }
+ case "30759-03.htm":
+ {
+ st.setCond(2);
+ st.set("state", "2");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30759-07.htm":
+ {
+ st.setCond(3);
+ st.set("state", "3");
+ st.takeItems(SYMBOL_OF_LOYALTY, 1);
+ st.takeItems(SYMBOL_OF_LOYALTY, 1);
+ st.takeItems(SYMBOL_OF_LOYALTY, 1);
+ st.giveItems(ANTIDOTE_RECIPE_LIST, 1);
+ SkillTable.getInstance().getSkill(4082, 1).applyEffects(npc, player);
+ startQuestTimer("poison", 60000, npc, player, true);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30757-03.htm":
+ {
+ if (Rnd.get(10) > 5)
+ {
+ final QuestState st2 = getClanLeaderQuestState(player, npc);
+ st.setState(State.STARTED);
+ st.set("symbol", "1");
+ st2.set("symbols", String.valueOf(st2.getInt("symbols") + 1));
+ st.giveItems(SYMBOL_OF_LOYALTY, 1);
+ st.playSound(QuestState.SOUND_ACCEPT);
+ htmltext = "30757-04.htm";
+ }
+ else
+ {
+ castSkill(npc, player, 4083);
+ startQuestTimer("die", 4000, npc, player, false);
+ }
+ break;
+ }
+ case "30758-03.htm":
+ {
+ if (!_isSpawned && (player.getAdena() >= 10000))
+ {
+ final QuestState st2 = getClanLeaderQuestState(player, npc);
+ st2.set("state", "4");
+ st2.set("bingo", "0");
+ st2.set("chests", "0");
+ st.takeItems(ADENA, 10000);
+ for (int[] coords : CHESTS_SPAWN)
+ {
+ st.addSpawn(CHEST_IDS.get(Rnd.get(CHEST_IDS.size())), coords[0], coords[1], coords[2], 0, false, 0);
+ }
+
+ _isSpawned = true;
+ startQuestTimer("despawn", 300000, null, player, false);
+ }
+ else
+ {
+ htmltext = "30758-03a.htm";
+ }
+ break;
+ }
+ case "30758-07.htm":
+ {
+ if (player.getAdena() >= 10000)
+ {
+ if (!_isSpawned)
+ {
+ st.takeItems(ADENA, 10000);
+ }
+ }
+ else
+ {
+ htmltext = "30758-06.htm";
+ }
+ break;
+ }
+ case "die":
+ {
+ final QuestState st2 = getClanLeaderQuestState(player, npc);
st.setState(State.STARTED);
st.set("symbol", "1");
st2.set("symbols", String.valueOf(st2.getInt("symbols") + 1));
st.giveItems(SYMBOL_OF_LOYALTY, 1);
st.playSound(QuestState.SOUND_ACCEPT);
- htmltext = "30757-04.htm";
+ return null;
}
- else
+ case "poison":
{
- castSkill(npc, player, 4083);
- startQuestTimer("die", 4000, npc, player, false);
- }
- }
- else if (event.equals("30758-03.htm"))
- {
- if (!_isSpawned && (player.getAdena() >= 10000))
- {
- st2.set("state", "4");
- st2.set("bingo", "0");
- st2.set("chests", "0");
- st.takeItems(ADENA, 10000);
- for (int[] coords : CHESTS_SPAWN)
+ if (player.getAbnormalEffect() != 514)
{
- st.addSpawn(CHESTS_ID.get(Rnd.get(CHESTS_ID.size())), coords[0], coords[1], coords[2], 0, false, 0);
+ player.sendMessage("Are you noob?");
+ cancelQuestTimer("poison", npc, player); // Cancel check timer
}
-
- _isSpawned = true;
- startQuestTimer("despawn", 300000, null, player, false);
+ return null;
}
- else
+ case "despawn":
{
- htmltext = "30758-03a.htm";
+ _isSpawned = false;
+ return null;
}
}
- else if (event.equals("30758-07.htm"))
- {
- if (player.getAdena() >= 10000)
- {
- if (!_isSpawned)
- {
- st.takeItems(ADENA, 10000);
- }
- }
- else
- {
- htmltext = "30758-06.htm";
- }
- }
- // Timers
- else if (event.equals("die"))
- {
- st.setState(State.STARTED);
- st.set("symbol", "1");
- st2.set("symbols", String.valueOf(st2.getInt("symbols") + 1));
- st.giveItems(SYMBOL_OF_LOYALTY, 1);
- st.playSound(QuestState.SOUND_ACCEPT);
- return null;
- }
- else if (event.equals("poison"))
- {
- if (player.getAbnormalEffect() != 514)
- {
- player.sendMessage("Are you noob?");
- cancelQuestTimer("poison", npc, player); // Cancel check timer
- }
-
- return null;
- }
- else if (event.equals("despawn"))
- {
- _isSpawned = false;
- return null;
- }
return htmltext;
}
@@ -259,7 +247,6 @@ public class Q501_ProofOfClanAlliance extends Quest
{
String htmltext = getNoQuestMsg();
final QuestState st = player.getQuestState(getName());
- final QuestState cl = getClanLeaderQuestState(player, npc);
if (st == null)
{
return htmltext;
@@ -268,9 +255,11 @@ public class Q501_ProofOfClanAlliance extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
switch (npc.getNpcId())
{
case SIR_KRISTOF_RODEMAI:
+ {
if (player.isClanLeader())
{
if (player.getClan().getLevel() == 3)
@@ -298,8 +287,10 @@ public class Q501_ProofOfClanAlliance extends Quest
htmltext = "30756-05.htm";
}
break;
-
+ }
case STATUE_OF_OFFERING:
+ {
+ final QuestState cl = getClanLeaderQuestState(player, npc);
if ((cl != null) && (cl.getInt("state") == 2) && (cl.getInt("symbols") < 3))
{
if (!player.isClanLeader())
@@ -323,14 +314,17 @@ public class Q501_ProofOfClanAlliance extends Quest
htmltext = "30757-06.htm";
}
break;
+ }
}
break;
-
+ }
case State.STARTED:
+ {
final int state = st.getInt("state");
switch (npc.getNpcId())
{
case SIR_KRISTOF_RODEMAI:
+ {
if ((state == 6) && st.hasQuestItems(VOUCHER_OF_FAITH))
{
htmltext = "30756-09.htm";
@@ -346,15 +340,18 @@ public class Q501_ProofOfClanAlliance extends Quest
htmltext = "30756-10.htm";
}
break;
-
+ }
case STATUE_OF_OFFERING:
+ {
+ final QuestState cl = getClanLeaderQuestState(player, npc);
if ((cl != null) && (cl.getInt("state") == 2) && (st.getInt("symbol") == 1))
{
htmltext = "30757-01b.htm";
}
break;
-
+ }
case KALIS:
+ {
if (player.isClanLeader())
{
if ((state == 1) && !st.hasQuestItems(SYMBOL_OF_LOYALTY))
@@ -374,7 +371,7 @@ public class Q501_ProofOfClanAlliance extends Quest
}
else if ((state > 2) && (state < 6) && (player.getAbnormalEffect() != 514))
{
- st.set("cond", "1");
+ st.setCond(1);
st.set("state", "1");
st.takeItems(ANTIDOTE_RECIPE_LIST, -1);
htmltext = "30759-09.htm";
@@ -385,7 +382,7 @@ public class Q501_ProofOfClanAlliance extends Quest
}
else if ((state == 5) && (player.getAbnormalEffect() == 514) && st.hasAtLeastOneQuestItem(HERB_OF_HARIT, HERB_OF_VANOR, HERB_OF_OEL_MAHUM, BLOOD_OF_EVA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.set("state", "6");
st.takeItems(ANTIDOTE_RECIPE_LIST, -1);
st.takeItems(HERB_OF_HARIT, -1);
@@ -408,8 +405,10 @@ public class Q501_ProofOfClanAlliance extends Quest
htmltext = "30759-12.htm";
}
break;
-
+ }
case ATHREA:
+ {
+ final QuestState cl = getClanLeaderQuestState(player, npc);
if ((cl != null) && (cl.getInt("state") == 3) && cl.hasQuestItems(ANTIDOTE_RECIPE_LIST) && !cl.hasQuestItems(BLOOD_OF_EVA) && hasFirstHerb(st, cl.getString("herbs")) && (getHerbs(cl.getString("herbs")).size() == 3))
{
htmltext = "30758-01.htm";
@@ -434,8 +433,10 @@ public class Q501_ProofOfClanAlliance extends Quest
htmltext = "30758-09.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -470,7 +471,7 @@ public class Q501_ProofOfClanAlliance extends Quest
st.dropItemsAlways(itemId, 1, 1);
}
}
- else if (CHESTS_ID.contains(npcId) && (cl.getInt("state") == 4))
+ else if (CHEST_IDS.contains(npcId) && (cl.getInt("state") == 4))
{
final int chests = cl.getInt("chests");
final int bingo = cl.getInt("bingo");
@@ -495,25 +496,29 @@ public class Q501_ProofOfClanAlliance extends Quest
switch (itemId)
{
case HERB_OF_VANOR:
+ {
if (st.hasQuestItems(HERB_OF_HARIT) || st.hasQuestItems(HERB_OF_OEL_MAHUM))
{
return true;
}
break;
-
+ }
case HERB_OF_HARIT:
+ {
if (st.hasQuestItems(HERB_OF_VANOR) || st.hasQuestItems(HERB_OF_OEL_MAHUM))
{
return true;
}
break;
-
+ }
case HERB_OF_OEL_MAHUM:
+ {
if (st.hasQuestItems(HERB_OF_HARIT) || st.hasQuestItems(HERB_OF_VANOR))
{
return true;
}
break;
+ }
}
return false;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q503_PursuitOfClanAmbition/Q503_PursuitOfClanAmbition.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q503_PursuitOfClanAmbition/Q503_PursuitOfClanAmbition.java
index 11a4e78ecb..995bf78300 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q503_PursuitOfClanAmbition/Q503_PursuitOfClanAmbition.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q503_PursuitOfClanAmbition/Q503_PursuitOfClanAmbition.java
@@ -28,32 +28,7 @@ import org.l2jmobius.gameserver.model.quest.State;
*/
public class Q503_PursuitOfClanAmbition extends Quest
{
- // Items
- // First
- private static final int G_LET_MARTIEN = 3866;
- private static final int TH_WYRM_EGGS = 3842;
- private static final int DRAKE_EGGS = 3841;
- private static final int BL_WYRM_EGGS = 3840;
- private static final int MI_DRAKE_EGGS = 3839;
- private static final int BROOCH = 3843;
- private static final int BL_ANVIL_COIN = 3871;
-
- // Second part
- private static final int G_LET_BALTHAZAR = 3867;
- private static final int RECIPE_POWER_STONE = 3838;
- private static final int POWER_STONE = 3846;
- private static final int NEBULITE_CRYSTALS = 3844;
- private static final int BROKE_POWER_STONE = 3845;
-
- // Third part
- private static final int G_LET_RODEMAI = 3868;
- private static final int IMP_KEYS = 3847;
- private static final int SCEPTER_JUDGEMENT = 3869;
-
- // Final item
- private static final int PROOF_ASPIRATION = 3870;
-
- // NPCS
+ // NPCs
private static final int MARTIEN = 30645;
private static final int ATHREA = 30758;
private static final int KALIS = 30759;
@@ -66,8 +41,7 @@ public class Q503_PursuitOfClanAmbition extends Quest
private static final int RODEMAI = 30868;
private static final int COFFER = 30765;
private static final int CLEO = 30766;
-
- // Mobs
+ // Monsters
private static final int THUNDER_WYRM = 20282;
private static final int THUNDER_WYRM_TWO = 20243;
private static final int DRAKE = 20137;
@@ -78,11 +52,29 @@ public class Q503_PursuitOfClanAmbition extends Quest
private static final int GRAVE_GUARD = 20668;
private static final int GRAVE_KEYMASTER = 27179;
private static final int IMPERIAL_SLAVE = 27180;
-
// Attack mob
private static final int IMPERIAL_GRAVEKEEPER = 27181;
-
- // DROPLIST
+ // First part items
+ private static final int G_LET_MARTIEN = 3866;
+ private static final int TH_WYRM_EGGS = 3842;
+ private static final int DRAKE_EGGS = 3841;
+ private static final int BL_WYRM_EGGS = 3840;
+ private static final int MI_DRAKE_EGGS = 3839;
+ private static final int BROOCH = 3843;
+ private static final int BL_ANVIL_COIN = 3871;
+ // Second part items
+ private static final int G_LET_BALTHAZAR = 3867;
+ private static final int RECIPE_POWER_STONE = 3838;
+ private static final int POWER_STONE = 3846;
+ private static final int NEBULITE_CRYSTALS = 3844;
+ private static final int BROKE_POWER_STONE = 3845;
+ // Third part items
+ private static final int G_LET_RODEMAI = 3868;
+ private static final int IMP_KEYS = 3847;
+ private static final int SCEPTER_JUDGEMENT = 3869;
+ // Final item
+ private static final int PROOF_ASPIRATION = 3870;
+ // Droplist
private static final int[][] DROPLIST =
{
// npcId, cond, MaxCount, chance, item1, item2 (giants), item3 (giants)
@@ -103,12 +95,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
public Q503_PursuitOfClanAmbition()
{
super(503, "Pursuit of Clan Ambition!");
-
registerQuestItems(MI_DRAKE_EGGS, BL_WYRM_EGGS, DRAKE_EGGS, TH_WYRM_EGGS, BROOCH, NEBULITE_CRYSTALS, BROKE_POWER_STONE, POWER_STONE, IMP_KEYS, G_LET_MARTIEN, G_LET_BALTHAZAR, G_LET_RODEMAI, SCEPTER_JUDGEMENT);
-
addStartNpc(GUSTAF);
addTalkId(MARTIEN, ATHREA, KALIS, GUSTAF, FRITZ, LUTZ, KURTZ, KUSTO, BALTHAZAR, RODEMAI, COFFER, CLEO);
-
addKillId(THUNDER_WYRM_TWO, THUNDER_WYRM, DRAKE, DRAKE_TWO, BLITZ_WYRM, GIANT_SOLDIER, GIANT_SCOUT, GRAVE_GUARD, GRAVE_KEYMASTER, IMPERIAL_GRAVEKEEPER);
addAttackId(IMPERIAL_GRAVEKEEPER);
}
@@ -123,135 +112,146 @@ public class Q503_PursuitOfClanAmbition extends Quest
return htmltext;
}
- // Gustaf
- if (event.equalsIgnoreCase("30760-08.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.giveItems(G_LET_MARTIEN, 1);
- st.set("cond", "1");
- }
- else if (event.equalsIgnoreCase("30760-12.htm"))
- {
- st.giveItems(G_LET_BALTHAZAR, 1);
- st.set("cond", "4");
- }
- else if (event.equalsIgnoreCase("30760-16.htm"))
- {
- st.giveItems(G_LET_RODEMAI, 1);
- st.set("cond", "7");
- }
- else if (event.equalsIgnoreCase("30760-20.htm"))
- {
- st.takeItems(SCEPTER_JUDGEMENT, -1);
- st.giveItems(PROOF_ASPIRATION, 1);
- st.rewardExpAndSp(0, 250000);
- st.exitQuest(false);
- finishQuestToClan(player);
- }
- else if (event.equalsIgnoreCase("30760-22.htm"))
- {
- st.set("cond", "1");
- }
- else if (event.equalsIgnoreCase("30760-23.htm"))
- {
- st.takeItems(SCEPTER_JUDGEMENT, -1);
- st.giveItems(PROOF_ASPIRATION, 1);
- st.rewardExpAndSp(0, 250000);
- st.exitQuest(false);
- finishQuestToClan(player);
- }
- // Martien
- else if (event.equalsIgnoreCase("30645-03.htm"))
- {
- setQuestToClanMembers(player);
- st.takeItems(G_LET_MARTIEN, -1);
- st.set("cond", "2");
- st.set("kurt", "0");
- }
- // Kurtz
- else if (event.equalsIgnoreCase("30763-02.htm"))
- {
- st.giveItems(MI_DRAKE_EGGS, 6);
- st.giveItems(BROOCH, 1);
- st.set("kurt", "1");
- }
- // Lutz
- else if (event.equalsIgnoreCase("30762-02.htm"))
- {
- st.giveItems(MI_DRAKE_EGGS, 4);
- st.giveItems(BL_WYRM_EGGS, 3);
- st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
- st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
- st.set("lutz", "1");
- }
- // Fritz
- else if (event.equalsIgnoreCase("30761-02.htm"))
- {
- st.giveItems(BL_WYRM_EGGS, 3);
- st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
- st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
- st.set("fritz", "1");
- }
- // Kusto
- else if (event.equalsIgnoreCase("30512-03.htm"))
- {
- st.takeItems(BROOCH, 1);
- st.giveItems(BL_ANVIL_COIN, 1);
- st.set("kurt", "2");
- }
- // Balthazar
- else if (event.equalsIgnoreCase("30764-03.htm"))
- {
- st.takeItems(G_LET_BALTHAZAR, -1);
- st.set("cond", "5");
- }
- else if (event.equalsIgnoreCase("30764-05.htm"))
- {
- st.takeItems(G_LET_BALTHAZAR, -1);
- st.set("cond", "5");
- }
- else if (event.equalsIgnoreCase("30764-06.htm"))
- {
- st.takeItems(BL_ANVIL_COIN, -1);
- st.giveItems(RECIPE_POWER_STONE, 1);
- }
- // Rodemai
- else if (event.equalsIgnoreCase("30868-04.htm"))
- {
- st.takeItems(G_LET_RODEMAI, -1);
- st.set("cond", "8");
- }
- else if (event.equalsIgnoreCase("30868-06a.htm"))
- {
- st.set("cond", "10");
- }
- else if (event.equalsIgnoreCase("30868-10.htm"))
- {
- st.set("cond", "12");
- }
- // Cleo
- else if (event.equalsIgnoreCase("30766-04.htm"))
- {
- st.set("cond", "9");
- npc.broadcastNpcSay("Blood and Honor");
- final NpcInstance sister1 = addSpawn(KALIS, 160665, 21209, -3710, npc.getHeading(), false, 180000);
- sister1.broadcastNpcSay("Ambition and Power");
- final NpcInstance sister2 = addSpawn(ATHREA, 160665, 21291, -3710, npc.getHeading(), false, 180000);
- sister2.broadcastNpcSay("War and Death");
- }
- // Coffer
- else if (event.equalsIgnoreCase("Open"))
- {
- if (st.getQuestItemsCount(IMP_KEYS) < 6)
+ case "30760-08.htm":
{
- htmltext = "30765-03a.htm";
+ st.startQuest();
+ st.giveItems(G_LET_MARTIEN, 1);
+ break;
}
- else
+ case "30760-12.htm":
{
- htmltext = "30765-03.htm";
- st.set("cond", "11");
- st.takeItems(IMP_KEYS, 6);
- st.giveItems(SCEPTER_JUDGEMENT, 1);
+ st.giveItems(G_LET_BALTHAZAR, 1);
+ st.setCond(4);
+ break;
+ }
+ case "30760-16.htm":
+ {
+ st.giveItems(G_LET_RODEMAI, 1);
+ st.setCond(7);
+ break;
+ }
+ case "30760-20.htm":
+ {
+ st.takeItems(SCEPTER_JUDGEMENT, -1);
+ st.giveItems(PROOF_ASPIRATION, 1);
+ st.rewardExpAndSp(0, 250000);
+ st.exitQuest(false);
+ finishQuestToClan(player);
+ break;
+ }
+ case "30760-22.htm":
+ {
+ st.setCond(1);
+ break;
+ }
+ case "30760-23.htm":
+ {
+ st.takeItems(SCEPTER_JUDGEMENT, -1);
+ st.giveItems(PROOF_ASPIRATION, 1);
+ st.rewardExpAndSp(0, 250000);
+ st.exitQuest(false);
+ finishQuestToClan(player);
+ break;
+ }
+ case "30645-03.htm":
+ {
+ setQuestToClanMembers(player);
+ st.takeItems(G_LET_MARTIEN, -1);
+ st.setCond(2);
+ st.set("kurt", "0");
+ break;
+ }
+ case "30763-02.htm":
+ {
+ st.giveItems(MI_DRAKE_EGGS, 6);
+ st.giveItems(BROOCH, 1);
+ st.set("kurt", "1");
+ break;
+ }
+ case "30762-02.htm":
+ {
+ st.giveItems(MI_DRAKE_EGGS, 4);
+ st.giveItems(BL_WYRM_EGGS, 3);
+ st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
+ st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
+ st.set("lutz", "1");
+ break;
+ }
+ case "30761-02.htm":
+ {
+ st.giveItems(BL_WYRM_EGGS, 3);
+ st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
+ st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
+ st.set("fritz", "1");
+ break;
+ }
+ case "30512-03.htm":
+ {
+ st.takeItems(BROOCH, 1);
+ st.giveItems(BL_ANVIL_COIN, 1);
+ st.set("kurt", "2");
+ break;
+ }
+ case "30764-03.htm":
+ {
+ st.takeItems(G_LET_BALTHAZAR, -1);
+ st.setCond(5);
+ break;
+ }
+ case "30764-05.htm":
+ {
+ st.takeItems(G_LET_BALTHAZAR, -1);
+ st.setCond(5);
+ break;
+ }
+ case "30764-06.htm":
+ {
+ st.takeItems(BL_ANVIL_COIN, -1);
+ st.giveItems(RECIPE_POWER_STONE, 1);
+ break;
+ }
+ case "30868-04.htm":
+ {
+ st.takeItems(G_LET_RODEMAI, -1);
+ st.setCond(8);
+ break;
+ }
+ case "30868-06a.htm":
+ {
+ st.setCond(10);
+ break;
+ }
+ case "30868-10.htm":
+ {
+ st.setCond(12);
+ break;
+ }
+ case "30766-04.htm":
+ {
+ st.setCond(9);
+ npc.broadcastNpcSay("Blood and Honor");
+ final NpcInstance sister1 = addSpawn(KALIS, 160665, 21209, -3710, npc.getHeading(), false, 180000);
+ sister1.broadcastNpcSay("Ambition and Power");
+ final NpcInstance sister2 = addSpawn(ATHREA, 160665, 21291, -3710, npc.getHeading(), false, 180000);
+ sister2.broadcastNpcSay("War and Death");
+ break;
+ }
+ case "Open":
+ {
+ if (st.getQuestItemsCount(IMP_KEYS) < 6)
+ {
+ htmltext = "30765-03a.htm";
+ }
+ else
+ {
+ htmltext = "30765-03.htm";
+ st.setCond(11);
+ st.takeItems(IMP_KEYS, 6);
+ st.giveItems(SCEPTER_JUDGEMENT, 1);
+ }
+ break;
}
}
@@ -271,6 +271,7 @@ public class Q503_PursuitOfClanAmbition extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClan() == null)
{
htmltext = "30760-01.htm";
@@ -299,18 +300,20 @@ public class Q503_PursuitOfClanAmbition extends Quest
st.exitQuest(true);
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
int memberCond = 0;
if (getClanLeaderQuestState(player, npc) != null)
{
- memberCond = getClanLeaderQuestState(player, npc).getInt("cond");
+ memberCond = getClanLeaderQuestState(player, npc).getCond();
}
switch (npc.getNpcId())
{
case GUSTAF:
+ {
if (player.isClanLeader())
{
if (cond == 1)
@@ -374,8 +377,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case MARTIEN:
+ {
if (player.isClanLeader())
{
if (cond == 1)
@@ -387,7 +391,7 @@ public class Q503_PursuitOfClanAmbition extends Quest
if ((st.getQuestItemsCount(MI_DRAKE_EGGS) > 9) && (st.getQuestItemsCount(BL_WYRM_EGGS) > 9) && (st.getQuestItemsCount(DRAKE_EGGS) > 9) && (st.getQuestItemsCount(TH_WYRM_EGGS) > 9))
{
htmltext = "30645-05.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.takeItems(MI_DRAKE_EGGS, -1);
st.takeItems(BL_WYRM_EGGS, -1);
st.takeItems(DRAKE_EGGS, -1);
@@ -415,8 +419,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case LUTZ:
+ {
if (player.isClanLeader() && (cond == 2))
{
if (st.getInt("lutz") == 1)
@@ -429,8 +434,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case KURTZ:
+ {
if (player.isClanLeader() && (cond == 2))
{
if (st.getInt("kurt") == 1)
@@ -443,8 +449,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case FRITZ:
+ {
if (player.isClanLeader() && (cond == 2))
{
if (st.getInt("fritz") == 1)
@@ -457,8 +464,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case KUSTO:
+ {
if (player.isClanLeader())
{
if (st.getQuestItemsCount(BROOCH) == 1)
@@ -485,8 +493,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case BALTHAZAR:
+ {
if (player.isClanLeader())
{
if (cond == 4)
@@ -508,7 +517,7 @@ public class Q503_PursuitOfClanAmbition extends Quest
st.takeItems(POWER_STONE, -1);
st.takeItems(NEBULITE_CRYSTALS, -1);
st.takeItems(BROOCH, -1);
- st.set("cond", "6");
+ st.setCond(6);
}
else
{
@@ -528,8 +537,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case RODEMAI:
+ {
if (player.isClanLeader())
{
if (cond == 7)
@@ -569,8 +579,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case CLEO:
+ {
if (player.isClanLeader())
{
if (cond == 8)
@@ -598,8 +609,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case COFFER:
+ {
if (player.isClanLeader())
{
if (cond == 10)
@@ -615,22 +627,26 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case KALIS:
+ {
if (player.isClanLeader())
{
htmltext = "30759-01.htm";
}
break;
-
+ }
case ATHREA:
+ {
if (player.isClanLeader())
{
htmltext = "30758-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -651,14 +667,13 @@ public class Q503_PursuitOfClanAmbition extends Quest
if (element[0] == npc.getNpcId())
{
final int cond = element[1];
- final int maxCount = element[2];
- final int chance = element[3];
- final int item1 = element[4];
- final int item2 = element[5];
- final int item3 = element[6];
-
- if (st.getInt("cond") == cond)
+ if (st.getCond() == cond)
{
+ final int maxCount = element[2];
+ final int chance = element[3];
+ final int item1 = element[4];
+ final int item2 = element[5];
+ final int item3 = element[6];
if (item1 != 0)
{
st.dropItems(item1, 1, maxCount, chance);
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q504_CompetitionForTheBanditStronghold/Q504_CompetitionForTheBanditStronghold.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q504_CompetitionForTheBanditStronghold/Q504_CompetitionForTheBanditStronghold.java
index 88c35f9d2b..9974e6c9bc 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q504_CompetitionForTheBanditStronghold/Q504_CompetitionForTheBanditStronghold.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q504_CompetitionForTheBanditStronghold/Q504_CompetitionForTheBanditStronghold.java
@@ -44,7 +44,6 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
public Q504_CompetitionForTheBanditStronghold()
{
super(504, "Competition for the Bandit Stronghold");
-
addStartNpc(MESSENGER);
addTalkId(MESSENGER);
addKillId(TARLK_BUGBEAR, TARLK_BUGBEAR_WARRIOR, TARLK_BUGBEAR_HIGH_WARRIOR, TARLK_BASILISK, ELDER_TARLK_BASILISK);
@@ -62,9 +61,7 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
if (event.equals("a2.htm"))
{
- qs.set("cond", "1");
- qs.setState(State.STARTED);
- qs.playSound("ItemSound.quest_accept");
+ qs.startQuest();
}
if (event.equals("a4.htm"))
{
@@ -72,7 +69,7 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
{
qs.takeItems(TARLK_AMULET, -30);
qs.giveItems(ALLIANCE_TROPHEY, 1);
- qs.playSound("ItemSound.quest_finish");
+ qs.playSound(QuestState.SOUND_FINISH);
qs.exitQuest(true);
}
else
@@ -94,8 +91,6 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
return htmltext;
}
- final int npcId = npc.getNpcId();
- final int cond = qs.getInt("cond");
final Clan clan = player.getClan();
if (clan == null)
{
@@ -111,8 +106,9 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
}
if (BanditStrongholdSiege.getInstance().isRegistrationPeriod())
{
- if (npcId == MESSENGER)
+ if (npc.getNpcId() == MESSENGER)
{
+ final int cond = qs.getCond();
if (cond == 0)
{
htmltext = "a1.htm";
@@ -141,13 +137,13 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
return null;
}
- if ((qs.getInt("cond") < 2) && (qs.getQuestItemsCount(TARLK_AMULET) < 30))
+ if ((qs.getCond() < 2) && (qs.getQuestItemsCount(TARLK_AMULET) < 30))
{
qs.giveItems(TARLK_AMULET, 1);
- qs.playSound("ItemSound.quest_itemget");
+ qs.playSound(QuestState.SOUND_ITEMGET);
if (qs.getQuestItemsCount(TARLK_AMULET) == 30)
{
- qs.set("cond", "2");
+ qs.setCond(2);
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q505_BloodOffering/Q505_BloodOffering.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q505_BloodOffering/Q505_BloodOffering.java
index 1f3485d0af..8add2b2172 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q505_BloodOffering/Q505_BloodOffering.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q505_BloodOffering/Q505_BloodOffering.java
@@ -46,7 +46,6 @@ public class Q505_BloodOffering extends Quest
public Q505_BloodOffering()
{
super(505, "Blood Offering");
-
addStartNpc(TOWN_DAWN);
addTalkId(TOWN_DAWN);
addStartNpc(TOWN_DUSK);
@@ -81,9 +80,9 @@ public class Q505_BloodOffering extends Quest
if (qs2 != null)
{
qs2.setState(State.STARTED);
- qs2.set("cond", "1");
+ qs2.setCond(1);
}
- qs.playSound("ItemSound.quest_accept");
+ qs.playSound(QuestState.SOUND_ACCEPT);
qs.exitQuest(true);
return "guide.htm";
}
@@ -145,7 +144,7 @@ public class Q505_BloodOffering extends Quest
if (cabal.equals("dawn"))
{
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
qs.getPlayer().teleToLocation(-80157, 111344, -4901);
if (qs2 != null)
{
@@ -156,7 +155,7 @@ public class Q505_BloodOffering extends Quest
if (cabal.equals("dusk"))
{
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
if (qs2 != null)
{
qs2.unset("cond");
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q601_WatchingEyes/Q601_WatchingEyes.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q601_WatchingEyes/Q601_WatchingEyes.java
index 33943364f9..18c5fa1b73 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q601_WatchingEyes/Q601_WatchingEyes.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q601_WatchingEyes/Q601_WatchingEyes.java
@@ -27,41 +27,23 @@ public class Q601_WatchingEyes extends Quest
{
// Items
private static final int PROOF_OF_AVENGER = 7188;
-
// Rewards
private static final int[][] REWARDS =
{
- {
- 6699,
- 90000,
- 20
- },
- {
- 6698,
- 80000,
- 40
- },
- {
- 6700,
- 40000,
- 50
- },
- {
- 0,
- 230000,
- 100
- }
+ // @formatter:off
+ {6699, 90000, 20},
+ {6698, 80000, 40},
+ {6700, 40000, 50},
+ {0, 230000, 100}
+ // @formatter:on
};
public Q601_WatchingEyes()
{
super(601, "Watching Eyes");
-
registerQuestItems(PROOF_OF_AVENGER);
-
addStartNpc(31683); // Eye of Argos
addTalkId(31683);
-
addKillId(21306, 21308, 21309, 21310, 21311);
}
@@ -83,9 +65,7 @@ public class Q601_WatchingEyes extends Quest
}
else
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
}
else if (event.equals("31683-07.htm"))
@@ -126,11 +106,13 @@ public class Q601_WatchingEyes extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "31683-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = (st.hasQuestItems(PROOF_OF_AVENGER)) ? "31683-05.htm" : "31683-04.htm";
@@ -140,6 +122,7 @@ public class Q601_WatchingEyes extends Quest
htmltext = "31683-06.htm";
}
break;
+ }
}
return htmltext;
@@ -148,7 +131,7 @@ public class Q601_WatchingEyes extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "cond", "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -162,7 +145,7 @@ public class Q601_WatchingEyes extends Quest
if (st.dropItems(PROOF_OF_AVENGER, 1, 100, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q602_ShadowOfLight/Q602_ShadowOfLight.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q602_ShadowOfLight/Q602_ShadowOfLight.java
index cc72f07152..e00e8fe844 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q602_ShadowOfLight/Q602_ShadowOfLight.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q602_ShadowOfLight/Q602_ShadowOfLight.java
@@ -26,48 +26,22 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q602_ShadowOfLight extends Quest
{
private static final int EYE_OF_DARKNESS = 7189;
-
private static final int[][] REWARDS =
{
- {
- 6699,
- 40000,
- 120000,
- 20000,
- 20
- },
- {
- 6698,
- 60000,
- 110000,
- 15000,
- 40
- },
- {
- 6700,
- 40000,
- 150000,
- 10000,
- 50
- },
- {
- 0,
- 100000,
- 140000,
- 11250,
- 100
- }
+ // @formatter:off
+ {6699, 40000, 120000, 20000, 20},
+ {6698, 60000, 110000, 15000, 40},
+ {6700, 40000, 150000, 10000, 50},
+ {0, 100000, 140000, 11250, 100}
+ // @formatter:on
};
public Q602_ShadowOfLight()
{
super(602, "Shadow of Light");
-
registerQuestItems(EYE_OF_DARKNESS);
-
addStartNpc(31683); // Eye of Argos
addTalkId(31683);
-
addKillId(21299, 21304);
}
@@ -89,9 +63,7 @@ public class Q602_ShadowOfLight extends Quest
}
else
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
}
else if (event.equals("31683-05.htm"))
@@ -134,11 +106,13 @@ public class Q602_ShadowOfLight extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "31683-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31683-03.htm";
@@ -148,6 +122,7 @@ public class Q602_ShadowOfLight extends Quest
htmltext = "31683-04.htm";
}
break;
+ }
}
return htmltext;
@@ -156,7 +131,7 @@ public class Q602_ShadowOfLight extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "cond", "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -170,7 +145,7 @@ public class Q602_ShadowOfLight extends Quest
if (st.dropItems(EYE_OF_DARKNESS, 1, 100, (npc.getNpcId() == 21299) ? 450000 : 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q603_DaimonTheWhiteEyed_Part1/Q603_DaimonTheWhiteEyed_Part1.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q603_DaimonTheWhiteEyed_Part1/Q603_DaimonTheWhiteEyed_Part1.java
index b65794591d..6a159d5e9d 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q603_DaimonTheWhiteEyed_Part1/Q603_DaimonTheWhiteEyed_Part1.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q603_DaimonTheWhiteEyed_Part1/Q603_DaimonTheWhiteEyed_Part1.java
@@ -27,11 +27,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
{
- // Items
- private static final int EVIL_SPIRIT_BEADS = 7190;
- private static final int BROKEN_CRYSTAL = 7191;
- private static final int UNFINISHED_SUMMON_CRYSTAL = 7192;
-
// NPCs
private static final int EYE_OF_ARGOS = 31683;
private static final int MYSTERIOUS_TABLET_1 = 31548;
@@ -39,12 +34,14 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
private static final int MYSTERIOUS_TABLET_3 = 31550;
private static final int MYSTERIOUS_TABLET_4 = 31551;
private static final int MYSTERIOUS_TABLET_5 = 31552;
-
// Monsters
private static final int CANYON_BANDERSNATCH_SLAVE = 21297;
private static final int BUFFALO_SLAVE = 21299;
private static final int GRENDEL_SLAVE = 21304;
-
+ // Items
+ private static final int EVIL_SPIRIT_BEADS = 7190;
+ private static final int BROKEN_CRYSTAL = 7191;
+ private static final int UNFINISHED_SUMMON_CRYSTAL = 7192;
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -57,12 +54,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
public Q603_DaimonTheWhiteEyed_Part1()
{
super(603, "Daimon the White-Eyed - Part 1");
-
registerQuestItems(EVIL_SPIRIT_BEADS, BROKEN_CRYSTAL);
-
addStartNpc(EYE_OF_ARGOS);
addTalkId(EYE_OF_ARGOS, MYSTERIOUS_TABLET_1, MYSTERIOUS_TABLET_2, MYSTERIOUS_TABLET_3, MYSTERIOUS_TABLET_4, MYSTERIOUS_TABLET_5);
-
addKillId(BUFFALO_SLAVE, GRENDEL_SLAVE, CANYON_BANDERSNATCH_SLAVE);
}
@@ -76,71 +70,78 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
return htmltext;
}
- // Eye of Argos
- if (event.equals("31683-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31683-06.htm"))
- {
- if (st.getQuestItemsCount(BROKEN_CRYSTAL) > 4)
+ case "31683-03.htm":
{
- st.set("cond", "7");
+ st.startQuest();
+ break;
+ }
+ case "31683-06.htm":
+ {
+ if (st.getQuestItemsCount(BROKEN_CRYSTAL) > 4)
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BROKEN_CRYSTAL, -1);
+ }
+ else
+ {
+ htmltext = "31683-07.htm";
+ }
+ break;
+ }
+ case "31683-10.htm":
+ {
+ if (st.getQuestItemsCount(EVIL_SPIRIT_BEADS) > 199)
+ {
+ st.takeItems(EVIL_SPIRIT_BEADS, -1);
+ st.giveItems(UNFINISHED_SUMMON_CRYSTAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ st.setCond(7);
+ htmltext = "31683-11.htm";
+ }
+ break;
+ }
+ case "31548-02.htm":
+ {
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BROKEN_CRYSTAL, -1);
+ st.giveItems(BROKEN_CRYSTAL, 1);
+ break;
}
- else
+ case "31549-02.htm":
{
- htmltext = "31683-07.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BROKEN_CRYSTAL, 1);
+ break;
}
- }
- else if (event.equals("31683-10.htm"))
- {
- if (st.getQuestItemsCount(EVIL_SPIRIT_BEADS) > 199)
+ case "31550-02.htm":
{
- st.takeItems(EVIL_SPIRIT_BEADS, -1);
- st.giveItems(UNFINISHED_SUMMON_CRYSTAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BROKEN_CRYSTAL, 1);
+ break;
}
- else
+ case "31551-02.htm":
{
- st.set("cond", "7");
- htmltext = "31683-11.htm";
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BROKEN_CRYSTAL, 1);
+ break;
+ }
+ case "31552-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BROKEN_CRYSTAL, 1);
+ break;
}
- }
- // Mysterious tablets
- else if (event.equals("31548-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BROKEN_CRYSTAL, 1);
- }
- else if (event.equals("31549-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BROKEN_CRYSTAL, 1);
- }
- else if (event.equals("31550-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BROKEN_CRYSTAL, 1);
- }
- else if (event.equals("31551-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BROKEN_CRYSTAL, 1);
- }
- else if (event.equals("31552-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BROKEN_CRYSTAL, 1);
}
return htmltext;
@@ -159,14 +160,17 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 73) ? "31683-02.htm" : "31683-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case EYE_OF_ARGOS:
+ {
if (cond < 6)
{
htmltext = "31683-04.htm";
@@ -184,8 +188,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31683-09.htm";
}
break;
-
+ }
case MYSTERIOUS_TABLET_1:
+ {
if (cond == 1)
{
htmltext = "31548-01.htm";
@@ -195,8 +200,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31548-03.htm";
}
break;
-
+ }
case MYSTERIOUS_TABLET_2:
+ {
if (cond == 2)
{
htmltext = "31549-01.htm";
@@ -206,8 +212,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31549-03.htm";
}
break;
-
+ }
case MYSTERIOUS_TABLET_3:
+ {
if (cond == 3)
{
htmltext = "31550-01.htm";
@@ -217,8 +224,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31550-03.htm";
}
break;
-
+ }
case MYSTERIOUS_TABLET_4:
+ {
if (cond == 4)
{
htmltext = "31551-01.htm";
@@ -228,8 +236,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31551-03.htm";
}
break;
-
+ }
case MYSTERIOUS_TABLET_5:
+ {
if (cond == 5)
{
htmltext = "31552-01.htm";
@@ -239,8 +248,10 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31552-03.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -249,7 +260,7 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "7");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 7);
if (partyMember == null)
{
return null;
@@ -263,7 +274,7 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
if (st.dropItems(EVIL_SPIRIT_BEADS, 1, 200, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "8");
+ st.setCond(8);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q604_DaimonTheWhiteEyed_Part2/Q604_DaimonTheWhiteEyed_Part2.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q604_DaimonTheWhiteEyed_Part2/Q604_DaimonTheWhiteEyed_Part2.java
index 3f07a43ca9..f99acdb138 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q604_DaimonTheWhiteEyed_Part2/Q604_DaimonTheWhiteEyed_Part2.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q604_DaimonTheWhiteEyed_Part2/Q604_DaimonTheWhiteEyed_Part2.java
@@ -30,13 +30,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
{
- // Monster
- private static final int DAIMON_THE_WHITE_EYED = 25290;
-
// NPCs
private static final int EYE_OF_ARGOS = 31683;
private static final int DAIMON_ALTAR = 31541;
-
+ // Monster
+ private static final int DAIMON_THE_WHITE_EYED = 25290;
// Items
private static final int UNFINISHED_SUMMON_CRYSTAL = 7192;
private static final int SUMMON_CRYSTAL = 7193;
@@ -50,39 +48,37 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
4599,
4600
};
-
// Other
private static final int CHECK_INTERVAL = 600000; // 10 minutes
private static final int IDLE_INTERVAL = 3; // (X * CHECK_INTERVAL) = 30 minutes
-
private NpcInstance _npc = null;
private int _status = -1;
public Q604_DaimonTheWhiteEyed_Part2()
{
super(604, "Daimon the White-Eyed - Part 2");
-
registerQuestItems(SUMMON_CRYSTAL, ESSENCE_OF_DAIMON);
-
addStartNpc(EYE_OF_ARGOS);
addTalkId(EYE_OF_ARGOS, DAIMON_ALTAR);
-
addAttackId(DAIMON_THE_WHITE_EYED);
addKillId(DAIMON_THE_WHITE_EYED);
-
switch (RaidBossSpawnManager.getInstance().getRaidBossStatusId(DAIMON_THE_WHITE_EYED))
{
case UNDEFINED:
+ {
LOGGER.log(Level.WARNING, getName() + ": can not find spawned RaidBoss id=" + DAIMON_THE_WHITE_EYED);
break;
-
+ }
case ALIVE:
+ {
spawnNpc();
// fallthrough
-
+ }
case DEAD:
+ {
startQuestTimer("check", CHECK_INTERVAL, null, null, true);
break;
+ }
}
}
@@ -113,58 +109,60 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
return htmltext;
}
- // Eye of Argos
- if (event.equals("31683-03.htm"))
+ switch (event)
{
- if (st.hasQuestItems(UNFINISHED_SUMMON_CRYSTAL))
+ case "31683-03.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.takeItems(UNFINISHED_SUMMON_CRYSTAL, 1);
- st.giveItems(SUMMON_CRYSTAL, 1);
- }
- else
- {
- htmltext = "31683-04.htm";
- }
- }
- else if (event.equals("31683-08.htm"))
- {
- if (st.hasQuestItems(ESSENCE_OF_DAIMON))
- {
- st.takeItems(ESSENCE_OF_DAIMON, 1);
- st.rewardItems(REWARD_DYE[Rnd.get(REWARD_DYE.length)], 5);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else
- {
- htmltext = "31683-09.htm";
- }
- }
- // Diamon's Altar
- else if (event.equals("31541-02.htm"))
- {
- if (st.hasQuestItems(SUMMON_CRYSTAL))
- {
- if (_status < 0)
+ if (st.hasQuestItems(UNFINISHED_SUMMON_CRYSTAL))
{
- if (spawnRaid())
+ st.startQuest();
+ st.takeItems(UNFINISHED_SUMMON_CRYSTAL, 1);
+ st.giveItems(SUMMON_CRYSTAL, 1);
+ }
+ else
+ {
+ htmltext = "31683-04.htm";
+ }
+ break;
+ }
+ case "31683-08.htm":
+ {
+ if (st.hasQuestItems(ESSENCE_OF_DAIMON))
+ {
+ st.takeItems(ESSENCE_OF_DAIMON, 1);
+ st.rewardItems(REWARD_DYE[Rnd.get(REWARD_DYE.length)], 5);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "31683-09.htm";
+ }
+ break;
+ }
+ case "31541-02.htm":
+ {
+ if (st.hasQuestItems(SUMMON_CRYSTAL))
+ {
+ if (_status < 0)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SUMMON_CRYSTAL, 1);
+ if (spawnRaid())
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SUMMON_CRYSTAL, 1);
+ }
+ }
+ else
+ {
+ htmltext = "31541-04.htm";
}
}
else
{
- htmltext = "31541-04.htm";
+ htmltext = "31541-03.htm";
}
- }
- else
- {
- htmltext = "31541-03.htm";
+ break;
}
}
@@ -184,6 +182,7 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 73)
{
htmltext = "31683-02.htm";
@@ -194,12 +193,14 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
htmltext = "31683-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case EYE_OF_ARGOS:
+ {
if (cond == 1)
{
htmltext = "31683-05.htm";
@@ -213,8 +214,9 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
htmltext = "31683-07.htm";
}
break;
-
+ }
case DAIMON_ALTAR:
+ {
if (cond == 1)
{
htmltext = "31541-01.htm";
@@ -224,8 +226,10 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
htmltext = "31541-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -241,7 +245,7 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "2"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 2))
{
final QuestState st = partyMember.getQuestState(getName());
if (st == null)
@@ -249,7 +253,7 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
continue;
}
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(ESSENCE_OF_DAIMON, 1);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q605_AllianceWithKetraOrcs/Q605_AllianceWithKetraOrcs.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q605_AllianceWithKetraOrcs/Q605_AllianceWithKetraOrcs.java
index e7c7e92d6a..70eccbe6f4 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q605_AllianceWithKetraOrcs/Q605_AllianceWithKetraOrcs.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q605_AllianceWithKetraOrcs/Q605_AllianceWithKetraOrcs.java
@@ -58,7 +58,6 @@ public class Q605_AllianceWithKetraOrcs extends Quest
CHANCES.put(21374, 626000);
CHANCES.put(21375, 626000);
}
-
private static final Map CHANCES_MANE = new HashMap<>();
static
{
@@ -78,36 +77,26 @@ public class Q605_AllianceWithKetraOrcs extends Quest
CHANCES_MANE.put(21371, 713000);
CHANCES_MANE.put(21373, 738000);
}
-
// Quest Items
private static final int VARKA_BADGE_SOLDIER = 7216;
private static final int VARKA_BADGE_OFFICER = 7217;
private static final int VARKA_BADGE_CAPTAIN = 7218;
-
private static final int KETRA_ALLIANCE_1 = 7211;
private static final int KETRA_ALLIANCE_2 = 7212;
private static final int KETRA_ALLIANCE_3 = 7213;
private static final int KETRA_ALLIANCE_4 = 7214;
private static final int KETRA_ALLIANCE_5 = 7215;
-
private static final int TOTEM_OF_VALOR = 7219;
private static final int TOTEM_OF_WISDOM = 7220;
-
private static final int VARKA_MANE = 7233;
public Q605_AllianceWithKetraOrcs()
{
super(605, "Alliance with Ketra Orcs");
-
registerQuestItems(VARKA_BADGE_SOLDIER, VARKA_BADGE_OFFICER, VARKA_BADGE_CAPTAIN);
-
addStartNpc(31371); // Wahkan
addTalkId(31371);
-
- for (int mobs : CHANCES.keySet())
- {
- addKillId(mobs);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -120,113 +109,115 @@ public class Q605_AllianceWithKetraOrcs extends Quest
return htmltext;
}
- if (event.equals("31371-03a.htm"))
+ switch (event)
{
- if (player.isAlliedWithVarka())
+ case "31371-03a.htm":
{
- htmltext = "31371-02a.htm";
- }
- else
- {
- st.setState(State.STARTED);
- st.playSound(QuestState.SOUND_ACCEPT);
- for (int i = KETRA_ALLIANCE_1; i <= KETRA_ALLIANCE_5; i++)
+ if (player.isAlliedWithVarka())
{
- if (st.hasQuestItems(i))
+ htmltext = "31371-02a.htm";
+ }
+ else
+ {
+ st.startQuest();
+ for (int i = KETRA_ALLIANCE_1; i <= KETRA_ALLIANCE_5; i++)
{
- st.set("cond", String.valueOf(i - 7209));
- player.setAllianceWithVarkaKetra(i - 7210);
- return "31371-0" + (i - 7207) + ".htm";
+ if (st.hasQuestItems(i))
+ {
+ st.setCond(i - 7209);
+ player.setAllianceWithVarkaKetra(i - 7210);
+ return "31371-0" + (i - 7207) + ".htm";
+ }
}
}
- st.set("cond", "1");
+ break;
}
- }
- // Stage 1
- else if (event.equals("31371-10-1.htm"))
- {
- if (st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 100)
+ case "31371-10-1.htm":
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VARKA_BADGE_SOLDIER, -1);
- st.giveItems(KETRA_ALLIANCE_1, 1);
- player.setAllianceWithVarkaKetra(1);
+ if (st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 100)
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VARKA_BADGE_SOLDIER, -1);
+ st.giveItems(KETRA_ALLIANCE_1, 1);
+ player.setAllianceWithVarkaKetra(1);
+ }
+ else
+ {
+ htmltext = "31371-03b.htm";
+ }
+ break;
}
- else
+ case "31371-10-2.htm":
{
- htmltext = "31371-03b.htm";
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 200) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 100))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VARKA_BADGE_SOLDIER, -1);
+ st.takeItems(VARKA_BADGE_OFFICER, -1);
+ st.takeItems(KETRA_ALLIANCE_1, -1);
+ st.giveItems(KETRA_ALLIANCE_2, 1);
+ player.setAllianceWithVarkaKetra(2);
+ }
+ else
+ {
+ htmltext = "31371-12.htm";
+ }
+ break;
}
- }
- // Stage 2
- else if (event.equals("31371-10-2.htm"))
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 200) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 100))
+ case "31371-10-3.htm":
+ {
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 200) && (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) >= 100))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VARKA_BADGE_SOLDIER, -1);
+ st.takeItems(VARKA_BADGE_OFFICER, -1);
+ st.takeItems(VARKA_BADGE_CAPTAIN, -1);
+ st.takeItems(KETRA_ALLIANCE_2, -1);
+ st.giveItems(KETRA_ALLIANCE_3, 1);
+ player.setAllianceWithVarkaKetra(3);
+ }
+ else
+ {
+ htmltext = "31371-15.htm";
+ }
+ break;
+ }
+ case "31371-10-4.htm":
+ {
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) >= 200) && (st.getQuestItemsCount(TOTEM_OF_VALOR) >= 1))
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VARKA_BADGE_SOLDIER, -1);
+ st.takeItems(VARKA_BADGE_OFFICER, -1);
+ st.takeItems(VARKA_BADGE_CAPTAIN, -1);
+ st.takeItems(TOTEM_OF_VALOR, -1);
+ st.takeItems(KETRA_ALLIANCE_3, -1);
+ st.giveItems(KETRA_ALLIANCE_4, 1);
+ player.setAllianceWithVarkaKetra(4);
+ }
+ else
+ {
+ htmltext = "31371-21.htm";
+ }
+ break;
+ }
+ case "31371-20.htm":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VARKA_BADGE_SOLDIER, -1);
- st.takeItems(VARKA_BADGE_OFFICER, -1);
st.takeItems(KETRA_ALLIANCE_1, -1);
- st.giveItems(KETRA_ALLIANCE_2, 1);
- player.setAllianceWithVarkaKetra(2);
- }
- else
- {
- htmltext = "31371-12.htm";
- }
- }
- // Stage 3
- else if (event.equals("31371-10-3.htm"))
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 200) && (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) >= 100))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VARKA_BADGE_SOLDIER, -1);
- st.takeItems(VARKA_BADGE_OFFICER, -1);
- st.takeItems(VARKA_BADGE_CAPTAIN, -1);
st.takeItems(KETRA_ALLIANCE_2, -1);
- st.giveItems(KETRA_ALLIANCE_3, 1);
- player.setAllianceWithVarkaKetra(3);
- }
- else
- {
- htmltext = "31371-15.htm";
- }
- }
- // Stage 4
- else if (event.equals("31371-10-4.htm"))
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) >= 200) && (st.getQuestItemsCount(TOTEM_OF_VALOR) >= 1))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VARKA_BADGE_SOLDIER, -1);
- st.takeItems(VARKA_BADGE_OFFICER, -1);
- st.takeItems(VARKA_BADGE_CAPTAIN, -1);
- st.takeItems(TOTEM_OF_VALOR, -1);
st.takeItems(KETRA_ALLIANCE_3, -1);
- st.giveItems(KETRA_ALLIANCE_4, 1);
- player.setAllianceWithVarkaKetra(4);
+ st.takeItems(KETRA_ALLIANCE_4, -1);
+ st.takeItems(KETRA_ALLIANCE_5, -1);
+ st.takeItems(TOTEM_OF_VALOR, -1);
+ st.takeItems(TOTEM_OF_WISDOM, -1);
+ player.setAllianceWithVarkaKetra(0);
+ st.exitQuest(true);
+ break;
}
- else
- {
- htmltext = "31371-21.htm";
- }
- }
- // Leave quest
- else if (event.equals("31371-20.htm"))
- {
- st.takeItems(KETRA_ALLIANCE_1, -1);
- st.takeItems(KETRA_ALLIANCE_2, -1);
- st.takeItems(KETRA_ALLIANCE_3, -1);
- st.takeItems(KETRA_ALLIANCE_4, -1);
- st.takeItems(KETRA_ALLIANCE_5, -1);
- st.takeItems(TOTEM_OF_VALOR, -1);
- st.takeItems(TOTEM_OF_WISDOM, -1);
- player.setAllianceWithVarkaKetra(0);
- st.exitQuest(true);
}
return htmltext;
@@ -245,6 +236,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 74)
{
htmltext = "31371-01.htm";
@@ -256,78 +248,88 @@ public class Q605_AllianceWithKetraOrcs extends Quest
player.setAllianceWithVarkaKetra(0);
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
- if (cond == 1)
+ {
+ switch (st.getCond())
{
- if (st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 100)
+ case 1:
{
- htmltext = "31371-03b.htm";
+ if (st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 100)
+ {
+ htmltext = "31371-03b.htm";
+ }
+ else
+ {
+ htmltext = "31371-09.htm";
+ }
+ break;
}
- else
+ case 2:
{
- htmltext = "31371-09.htm";
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 200) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 100))
+ {
+ htmltext = "31371-12.htm";
+ }
+ else
+ {
+ htmltext = "31371-13.htm";
+ }
+ break;
}
- }
- else if (cond == 2)
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 200) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 100))
+ case 3:
{
- htmltext = "31371-12.htm";
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 200) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 100))
+ {
+ htmltext = "31371-15.htm";
+ }
+ else
+ {
+ htmltext = "31371-16.htm";
+ }
+ break;
}
- else
+ case 4:
{
- htmltext = "31371-13.htm";
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(TOTEM_OF_VALOR))
+ {
+ htmltext = "31371-21.htm";
+ }
+ else
+ {
+ htmltext = "31371-22.htm";
+ }
+ break;
}
- }
- else if (cond == 3)
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 200) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 100))
+ case 5:
{
- htmltext = "31371-15.htm";
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 400) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 400) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(TOTEM_OF_WISDOM))
+ {
+ htmltext = "31371-17.htm";
+ }
+ else
+ {
+ htmltext = "31371-10-5.htm";
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VARKA_BADGE_SOLDIER, 400);
+ st.takeItems(VARKA_BADGE_OFFICER, 400);
+ st.takeItems(VARKA_BADGE_CAPTAIN, 200);
+ st.takeItems(TOTEM_OF_WISDOM, -1);
+ st.takeItems(KETRA_ALLIANCE_4, -1);
+ st.giveItems(KETRA_ALLIANCE_5, 1);
+ player.setAllianceWithVarkaKetra(5);
+ }
+ break;
}
- else
+ case 6:
{
- htmltext = "31371-16.htm";
+ htmltext = "31371-08.htm";
+ break;
}
}
- else if (cond == 4)
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(TOTEM_OF_VALOR))
- {
- htmltext = "31371-21.htm";
- }
- else
- {
- htmltext = "31371-22.htm";
- }
- }
- else if (cond == 5)
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 400) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 400) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(TOTEM_OF_WISDOM))
- {
- htmltext = "31371-17.htm";
- }
- else
- {
- htmltext = "31371-10-5.htm";
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VARKA_BADGE_SOLDIER, 400);
- st.takeItems(VARKA_BADGE_OFFICER, 400);
- st.takeItems(VARKA_BADGE_CAPTAIN, 200);
- st.takeItems(TOTEM_OF_WISDOM, -1);
- st.takeItems(KETRA_ALLIANCE_4, -1);
- st.giveItems(KETRA_ALLIANCE_5, 1);
- player.setAllianceWithVarkaKetra(5);
- }
- }
- else if (cond == 6)
- {
- htmltext = "31371-08.htm";
- }
break;
+ }
}
return htmltext;
@@ -358,7 +360,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond == 6)
{
return null;
@@ -371,6 +373,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
case 21353:
case 21354:
case 21355:
+ {
if (cond == 1)
{
st.dropItems(VARKA_BADGE_SOLDIER, 1, 100, CHANCES.get(npcId));
@@ -388,7 +391,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
st.dropItems(VARKA_BADGE_SOLDIER, 1, 400, CHANCES.get(npcId));
}
break;
-
+ }
case 21357:
case 21358:
case 21360:
@@ -397,6 +400,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
case 21364:
case 21369:
case 21370:
+ {
if (cond == 2)
{
st.dropItems(VARKA_BADGE_OFFICER, 1, 100, CHANCES.get(npcId));
@@ -414,7 +418,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
st.dropItems(VARKA_BADGE_OFFICER, 1, 400, CHANCES.get(npcId));
}
break;
-
+ }
case 21365:
case 21366:
case 21368:
@@ -423,6 +427,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
case 21373:
case 21374:
case 21375:
+ {
if (cond == 3)
{
st.dropItems(VARKA_BADGE_CAPTAIN, 1, 100, CHANCES.get(npcId));
@@ -432,6 +437,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
st.dropItems(VARKA_BADGE_CAPTAIN, 1, 200, CHANCES.get(npcId));
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q606_WarWithVarkaSilenos/Q606_WarWithVarkaSilenos.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q606_WarWithVarkaSilenos/Q606_WarWithVarkaSilenos.java
index 36acb6eb6d..c4b03466c0 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q606_WarWithVarkaSilenos/Q606_WarWithVarkaSilenos.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q606_WarWithVarkaSilenos/Q606_WarWithVarkaSilenos.java
@@ -34,9 +34,7 @@ public class Q606_WarWithVarkaSilenos extends Quest
public Q606_WarWithVarkaSilenos()
{
super(606, "War with Varka Silenos");
-
registerQuestItems(VARKA_MANE);
-
addStartNpc(31370); // Kadun Zu Ketra
addTalkId(31370);
}
@@ -51,29 +49,33 @@ public class Q606_WarWithVarkaSilenos extends Quest
return htmltext;
}
- if (event.equals("31370-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31370-07.htm"))
- {
- if (st.getQuestItemsCount(VARKA_MANE) >= 100)
+ case "31370-03.htm":
{
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(VARKA_MANE, 100);
- st.giveItems(HORN_OF_BUFFALO, 20);
+ st.startQuest();
+ break;
}
- else
+ case "31370-07.htm":
{
- htmltext = "31370-08.htm";
+ if (st.getQuestItemsCount(VARKA_MANE) >= 100)
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(VARKA_MANE, 100);
+ st.giveItems(HORN_OF_BUFFALO, 20);
+ }
+ else
+ {
+ htmltext = "31370-08.htm";
+ }
+ break;
+ }
+ case "31370-09.htm":
+ {
+ st.takeItems(VARKA_MANE, -1);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("31370-09.htm"))
- {
- st.takeItems(VARKA_MANE, -1);
- st.exitQuest(true);
}
return htmltext;
@@ -92,12 +94,15 @@ public class Q606_WarWithVarkaSilenos extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() >= 74) && player.isAlliedWithKetra()) ? "31370-01.htm" : "31370-02.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(VARKA_MANE)) ? "31370-04.htm" : "31370-05.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q607_ProveYourCourage/Q607_ProveYourCourage.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q607_ProveYourCourage/Q607_ProveYourCourage.java
index 8182dc2b21..c3c986b4b0 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q607_ProveYourCourage/Q607_ProveYourCourage.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q607_ProveYourCourage/Q607_ProveYourCourage.java
@@ -32,12 +32,9 @@ public class Q607_ProveYourCourage extends Quest
public Q607_ProveYourCourage()
{
super(607, "Prove your courage!");
-
registerQuestItems(HEAD_OF_SHADITH);
-
addStartNpc(31370); // Kadun Zu Ketra
addTalkId(31370);
-
addKillId(25309); // Shadith
}
@@ -53,9 +50,7 @@ public class Q607_ProveYourCourage extends Quest
if (event.equals("31370-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31370-07.htm"))
{
@@ -70,7 +65,7 @@ public class Q607_ProveYourCourage extends Quest
else
{
htmltext = "31370-06.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.playSound(QuestState.SOUND_ACCEPT);
}
}
@@ -91,6 +86,7 @@ public class Q607_ProveYourCourage extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 75)
{
htmltext = "31370-03.htm";
@@ -104,10 +100,12 @@ public class Q607_ProveYourCourage extends Quest
htmltext = "31370-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(HEAD_OF_SHADITH)) ? "31370-05.htm" : "31370-06.htm";
break;
+ }
}
return htmltext;
@@ -116,7 +114,7 @@ public class Q607_ProveYourCourage extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "1"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 1))
{
if (partyMember.getAllianceWithVarkaKetra() >= 3)
{
@@ -128,7 +126,7 @@ public class Q607_ProveYourCourage extends Quest
if (st.hasQuestItems(KETRA_ALLIANCE_3))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HEAD_OF_SHADITH, 1);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q608_SlayTheEnemyCommander/Q608_SlayTheEnemyCommander.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q608_SlayTheEnemyCommander/Q608_SlayTheEnemyCommander.java
index 86848b844f..4bc961ec38 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q608_SlayTheEnemyCommander/Q608_SlayTheEnemyCommander.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q608_SlayTheEnemyCommander/Q608_SlayTheEnemyCommander.java
@@ -32,12 +32,9 @@ public class Q608_SlayTheEnemyCommander extends Quest
public Q608_SlayTheEnemyCommander()
{
super(608, "Slay the enemy commander!");
-
registerQuestItems(HEAD_OF_MOS);
-
addStartNpc(31370); // Kadun Zu Ketra
addTalkId(31370);
-
addKillId(25312); // Mos
}
@@ -53,9 +50,7 @@ public class Q608_SlayTheEnemyCommander extends Quest
if (event.equals("31370-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31370-07.htm"))
{
@@ -70,7 +65,7 @@ public class Q608_SlayTheEnemyCommander extends Quest
else
{
htmltext = "31370-06.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.playSound(QuestState.SOUND_ACCEPT);
}
}
@@ -91,6 +86,7 @@ public class Q608_SlayTheEnemyCommander extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 75)
{
if ((player.getAllianceWithVarkaKetra() >= 4) && st.hasQuestItems(KETRA_ALLIANCE_4) && !st.hasQuestItems(TOTEM_OF_WISDOM))
@@ -107,10 +103,12 @@ public class Q608_SlayTheEnemyCommander extends Quest
htmltext = "31370-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(HEAD_OF_MOS)) ? "31370-05.htm" : "31370-06.htm";
break;
+ }
}
return htmltext;
@@ -119,7 +117,7 @@ public class Q608_SlayTheEnemyCommander extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "1"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 1))
{
if (partyMember.getAllianceWithVarkaKetra() >= 4)
{
@@ -131,7 +129,7 @@ public class Q608_SlayTheEnemyCommander extends Quest
if (st.hasQuestItems(KETRA_ALLIANCE_4))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HEAD_OF_MOS, 1);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q609_MagicalPowerOfWater_Part1/Q609_MagicalPowerOfWater_Part1.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q609_MagicalPowerOfWater_Part1/Q609_MagicalPowerOfWater_Part1.java
index 8455f1fe1a..847369bcbf 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q609_MagicalPowerOfWater_Part1/Q609_MagicalPowerOfWater_Part1.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q609_MagicalPowerOfWater_Part1/Q609_MagicalPowerOfWater_Part1.java
@@ -29,7 +29,6 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
private static final int ASEFA = 31372;
private static final int UDAN_BOX = 31561;
private static final int EYE = 31685;
-
// Items
private static final int THIEF_KEY = 1661;
private static final int STOLEN_GREEN_TOTEM = 7237;
@@ -39,12 +38,9 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
public Q609_MagicalPowerOfWater_Part1()
{
super(609, "Magical Power of Water - Part 1");
-
registerQuestItems(STOLEN_GREEN_TOTEM);
-
addStartNpc(WAHKAN);
addTalkId(WAHKAN, ASEFA, UDAN_BOX);
-
// IDs aggro ranges to avoid, else quest is automatically failed.
addAggroRangeEnterId(21350, 21351, 21353, 21354, 21355, 21357, 21358, 21360, 21361, 21362, 21369, 21370, 21364, 21365, 21366, 21368, 21371, 21372, 21373, 21374, 21375);
}
@@ -59,37 +55,40 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
return htmltext;
}
- if (event.equals("31371-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("spawned", "0");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31561-03.htm"))
- {
- // You have been discovered ; quest is failed.
- if (st.getInt("spawned") == 1)
+ case "31371-03.htm":
{
- htmltext = "31561-04.htm";
+ st.startQuest();
+ st.set("spawned", "0");
+ break;
}
- else if (!st.hasQuestItems(THIEF_KEY))
+ case "31561-03.htm":
{
- htmltext = "31561-02.htm";
+ // You have been discovered ; quest is failed.
+ if (st.getInt("spawned") == 1)
+ {
+ htmltext = "31561-04.htm";
+ }
+ else if (!st.hasQuestItems(THIEF_KEY))
+ {
+ htmltext = "31561-02.htm";
+ }
+ else
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(THIEF_KEY, 1);
+ st.giveItems(STOLEN_GREEN_TOTEM, 1);
+ }
+ break;
}
- else
+ case "AsefaEyeDespawn":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(THIEF_KEY, 1);
- st.giveItems(STOLEN_GREEN_TOTEM, 1);
+ npc.broadcastNpcSay("I'll be waiting for your return.");
+ return null;
}
}
- else if (event.equals("AsefaEyeDespawn"))
- {
- npc.broadcastNpcSay("I'll be waiting for your return.");
- return null;
- }
return htmltext;
}
@@ -107,22 +106,26 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() >= 74) && (player.getAllianceWithVarkaKetra() >= 2)) ? "31371-01.htm" : "31371-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case WAHKAN:
+ {
htmltext = "31371-04.htm";
break;
-
+ }
case ASEFA:
+ {
if (cond == 1)
{
htmltext = "31372-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 2)
@@ -151,8 +154,9 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
st.exitQuest(true);
}
break;
-
+ }
case UDAN_BOX:
+ {
if (cond == 2)
{
htmltext = "31561-01.htm";
@@ -162,8 +166,10 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
htmltext = "31561-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -178,7 +184,7 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
return null;
}
- if ((st.getInt("spawned") == 0) && (st.getInt("cond") == 2))
+ if (st.isCond(2) && (st.getInt("spawned") == 0))
{
// Put "spawned" flag to 1 to avoid to spawn another.
st.set("spawned", "1");
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q610_MagicalPowerOfWater_Part2/Q610_MagicalPowerOfWater_Part2.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q610_MagicalPowerOfWater_Part2/Q610_MagicalPowerOfWater_Part2.java
index 575bcdc70a..7e89872364 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q610_MagicalPowerOfWater_Part2/Q610_MagicalPowerOfWater_Part2.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q610_MagicalPowerOfWater_Part2/Q610_MagicalPowerOfWater_Part2.java
@@ -29,49 +29,46 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q610_MagicalPowerOfWater_Part2 extends Quest
{
- // Monster
- private static final int SOUL_OF_WATER_ASHUTAR = 25316;
-
// NPCs
private static final int ASEFA = 31372;
private static final int VARKAS_HOLY_ALTAR = 31560;
-
+ // Monster
+ private static final int SOUL_OF_WATER_ASHUTAR = 25316;
// Items
private static final int GREEN_TOTEM = 7238;
private static final int ICE_HEART_OF_ASHUTAR = 7239;
-
// Other
private static final int CHECK_INTERVAL = 600000; // 10 minutes
private static final int IDLE_INTERVAL = 2; // (X * CHECK_INTERVAL) = 20 minutes
-
private NpcInstance _npc = null;
private int _status = -1;
public Q610_MagicalPowerOfWater_Part2()
{
super(610, "Magical Power of Water - Part 2");
-
registerQuestItems(ICE_HEART_OF_ASHUTAR);
-
addStartNpc(ASEFA);
addTalkId(ASEFA, VARKAS_HOLY_ALTAR);
-
addAttackId(SOUL_OF_WATER_ASHUTAR);
addKillId(SOUL_OF_WATER_ASHUTAR);
switch (RaidBossSpawnManager.getInstance().getRaidBossStatusId(SOUL_OF_WATER_ASHUTAR))
{
case UNDEFINED:
+ {
LOGGER.log(Level.WARNING, getName() + ": can not find spawned RaidBoss id=" + SOUL_OF_WATER_ASHUTAR);
break;
-
+ }
case ALIVE:
+ {
spawnNpc();
// fallthrough
-
+ }
case DEAD:
+ {
startQuestTimer("check", CHECK_INTERVAL, null, null, true);
break;
+ }
}
}
@@ -102,56 +99,58 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
return htmltext;
}
- // Asefa
- if (event.equals("31372-04.htm"))
+ switch (event)
{
- if (st.hasQuestItems(GREEN_TOTEM))
+ case "31372-04.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else
- {
- htmltext = "31372-02.htm";
- }
- }
- else if (event.equals("31372-07.htm"))
- {
- if (st.hasQuestItems(ICE_HEART_OF_ASHUTAR))
- {
- st.takeItems(ICE_HEART_OF_ASHUTAR, 1);
- st.rewardExpAndSp(10000, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else
- {
- htmltext = "31372-08.htm";
- }
- }
- // Varka's Holy Altar
- else if (event.equals("31560-02.htm"))
- {
- if (st.hasQuestItems(GREEN_TOTEM))
- {
- if (_status < 0)
+ if (st.hasQuestItems(GREEN_TOTEM))
{
- if (spawnRaid())
+ st.startQuest();
+ }
+ else
+ {
+ htmltext = "31372-02.htm";
+ }
+ break;
+ }
+ case "31372-07.htm":
+ {
+ if (st.hasQuestItems(ICE_HEART_OF_ASHUTAR))
+ {
+ st.takeItems(ICE_HEART_OF_ASHUTAR, 1);
+ st.rewardExpAndSp(10000, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "31372-08.htm";
+ }
+ break;
+ }
+ case "31560-02.htm":
+ {
+ if (st.hasQuestItems(GREEN_TOTEM))
+ {
+ if (_status < 0)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GREEN_TOTEM, 1);
+ if (spawnRaid())
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GREEN_TOTEM, 1);
+ }
+ }
+ else
+ {
+ htmltext = "31560-04.htm";
}
}
else
{
- htmltext = "31560-04.htm";
+ htmltext = "31560-03.htm";
}
- }
- else
- {
- htmltext = "31560-03.htm";
+ break;
}
}
@@ -171,6 +170,7 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (!st.hasQuestItems(GREEN_TOTEM))
{
htmltext = "31372-02.htm";
@@ -184,16 +184,19 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
htmltext = "31372-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ASEFA:
+ {
htmltext = (cond < 3) ? "31372-05.htm" : "31372-06.htm";
break;
-
+ }
case VARKAS_HOLY_ALTAR:
+ {
if (cond == 1)
{
htmltext = "31560-01.htm";
@@ -203,8 +206,10 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
htmltext = "31560-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -220,7 +225,7 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "2"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 2))
{
final QuestState st = partyMember.getQuestState(getName());
if (st == null)
@@ -228,7 +233,7 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
continue;
}
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(ICE_HEART_OF_ASHUTAR, 1);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q611_AllianceWithVarkaSilenos/Q611_AllianceWithVarkaSilenos.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q611_AllianceWithVarkaSilenos/Q611_AllianceWithVarkaSilenos.java
index 41597572c9..66be081496 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q611_AllianceWithVarkaSilenos/Q611_AllianceWithVarkaSilenos.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q611_AllianceWithVarkaSilenos/Q611_AllianceWithVarkaSilenos.java
@@ -58,7 +58,6 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
CHANCES.put(21348, 626000);
CHANCES.put(21349, 626000);
}
-
private static final Map CHANCES_MOLAR = new HashMap<>();
static
{
@@ -78,36 +77,26 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
CHANCES_MOLAR.put(21345, 713000);
CHANCES_MOLAR.put(21347, 738000);
}
-
// Quest Items
private static final int KETRA_BADGE_SOLDIER = 7226;
private static final int KETRA_BADGE_OFFICER = 7227;
private static final int KETRA_BADGE_CAPTAIN = 7228;
-
private static final int VARKA_ALLIANCE_1 = 7221;
private static final int VARKA_ALLIANCE_2 = 7222;
private static final int VARKA_ALLIANCE_3 = 7223;
private static final int VARKA_ALLIANCE_4 = 7224;
private static final int VARKA_ALLIANCE_5 = 7225;
-
private static final int VALOR_FEATHER = 7229;
private static final int WISDOM_FEATHER = 7230;
-
private static final int MOLAR_OF_KETRA_ORC = 7234;
public Q611_AllianceWithVarkaSilenos()
{
super(611, "Alliance with Varka Silenos");
-
registerQuestItems(KETRA_BADGE_SOLDIER, KETRA_BADGE_OFFICER, KETRA_BADGE_CAPTAIN);
-
addStartNpc(31378); // Naran Ashanuk
addTalkId(31378);
-
- for (int mobs : CHANCES.keySet())
- {
- addKillId(mobs);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -120,113 +109,115 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
return htmltext;
}
- if (event.equals("31378-03a.htm"))
+ switch (event)
{
- if (player.isAlliedWithKetra())
+ case "31378-03a.htm":
{
- htmltext = "31378-02a.htm";
- }
- else
- {
- st.setState(State.STARTED);
- st.playSound(QuestState.SOUND_ACCEPT);
- for (int i = VARKA_ALLIANCE_1; i <= VARKA_ALLIANCE_5; i++)
+ if (player.isAlliedWithKetra())
{
- if (st.hasQuestItems(i))
+ htmltext = "31378-02a.htm";
+ }
+ else
+ {
+ st.startQuest();
+ for (int i = VARKA_ALLIANCE_1; i <= VARKA_ALLIANCE_5; i++)
{
- st.set("cond", String.valueOf(i - 7219));
- player.setAllianceWithVarkaKetra(7220 - i);
- return "31378-0" + (i - 7217) + ".htm";
+ if (st.hasQuestItems(i))
+ {
+ st.setCond(i - 7219);
+ player.setAllianceWithVarkaKetra(7220 - i);
+ return "31378-0" + (i - 7217) + ".htm";
+ }
}
}
- st.set("cond", "1");
+ break;
}
- }
- // Stage 1
- else if (event.equals("31378-10-1.htm"))
- {
- if (st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 100)
+ case "31378-10-1.htm":
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KETRA_BADGE_SOLDIER, -1);
- st.giveItems(VARKA_ALLIANCE_1, 1);
- player.setAllianceWithVarkaKetra(-1);
+ if (st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 100)
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KETRA_BADGE_SOLDIER, -1);
+ st.giveItems(VARKA_ALLIANCE_1, 1);
+ player.setAllianceWithVarkaKetra(-1);
+ }
+ else
+ {
+ htmltext = "31378-03b.htm";
+ }
+ break;
}
- else
+ case "31378-10-2.htm":
{
- htmltext = "31378-03b.htm";
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 200) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 100))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KETRA_BADGE_SOLDIER, -1);
+ st.takeItems(KETRA_BADGE_OFFICER, -1);
+ st.takeItems(VARKA_ALLIANCE_1, -1);
+ st.giveItems(VARKA_ALLIANCE_2, 1);
+ player.setAllianceWithVarkaKetra(-2);
+ }
+ else
+ {
+ htmltext = "31378-12.htm";
+ }
+ break;
}
- }
- // Stage 2
- else if (event.equals("31378-10-2.htm"))
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 200) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 100))
+ case "31378-10-3.htm":
+ {
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 200) && (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) >= 100))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KETRA_BADGE_SOLDIER, -1);
+ st.takeItems(KETRA_BADGE_OFFICER, -1);
+ st.takeItems(KETRA_BADGE_CAPTAIN, -1);
+ st.takeItems(VARKA_ALLIANCE_2, -1);
+ st.giveItems(VARKA_ALLIANCE_3, 1);
+ player.setAllianceWithVarkaKetra(-3);
+ }
+ else
+ {
+ htmltext = "31378-15.htm";
+ }
+ break;
+ }
+ case "31378-10-4.htm":
+ {
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) >= 200) && (st.getQuestItemsCount(VALOR_FEATHER) >= 1))
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KETRA_BADGE_SOLDIER, -1);
+ st.takeItems(KETRA_BADGE_OFFICER, -1);
+ st.takeItems(KETRA_BADGE_CAPTAIN, -1);
+ st.takeItems(VALOR_FEATHER, -1);
+ st.takeItems(VARKA_ALLIANCE_3, -1);
+ st.giveItems(VARKA_ALLIANCE_4, 1);
+ player.setAllianceWithVarkaKetra(-4);
+ }
+ else
+ {
+ htmltext = "31378-21.htm";
+ }
+ break;
+ }
+ case "31378-20.htm":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KETRA_BADGE_SOLDIER, -1);
- st.takeItems(KETRA_BADGE_OFFICER, -1);
st.takeItems(VARKA_ALLIANCE_1, -1);
- st.giveItems(VARKA_ALLIANCE_2, 1);
- player.setAllianceWithVarkaKetra(-2);
- }
- else
- {
- htmltext = "31378-12.htm";
- }
- }
- // Stage 3
- else if (event.equals("31378-10-3.htm"))
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 200) && (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) >= 100))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KETRA_BADGE_SOLDIER, -1);
- st.takeItems(KETRA_BADGE_OFFICER, -1);
- st.takeItems(KETRA_BADGE_CAPTAIN, -1);
st.takeItems(VARKA_ALLIANCE_2, -1);
- st.giveItems(VARKA_ALLIANCE_3, 1);
- player.setAllianceWithVarkaKetra(-3);
- }
- else
- {
- htmltext = "31378-15.htm";
- }
- }
- // Stage 4
- else if (event.equals("31378-10-4.htm"))
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) >= 200) && (st.getQuestItemsCount(VALOR_FEATHER) >= 1))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KETRA_BADGE_SOLDIER, -1);
- st.takeItems(KETRA_BADGE_OFFICER, -1);
- st.takeItems(KETRA_BADGE_CAPTAIN, -1);
- st.takeItems(VALOR_FEATHER, -1);
st.takeItems(VARKA_ALLIANCE_3, -1);
- st.giveItems(VARKA_ALLIANCE_4, 1);
- player.setAllianceWithVarkaKetra(-4);
+ st.takeItems(VARKA_ALLIANCE_4, -1);
+ st.takeItems(VARKA_ALLIANCE_5, -1);
+ st.takeItems(VALOR_FEATHER, -1);
+ st.takeItems(WISDOM_FEATHER, -1);
+ player.setAllianceWithVarkaKetra(0);
+ st.exitQuest(true);
+ break;
}
- else
- {
- htmltext = "31378-21.htm";
- }
- }
- // Leave quest
- else if (event.equals("31378-20.htm"))
- {
- st.takeItems(VARKA_ALLIANCE_1, -1);
- st.takeItems(VARKA_ALLIANCE_2, -1);
- st.takeItems(VARKA_ALLIANCE_3, -1);
- st.takeItems(VARKA_ALLIANCE_4, -1);
- st.takeItems(VARKA_ALLIANCE_5, -1);
- st.takeItems(VALOR_FEATHER, -1);
- st.takeItems(WISDOM_FEATHER, -1);
- player.setAllianceWithVarkaKetra(0);
- st.exitQuest(true);
}
return htmltext;
@@ -245,6 +236,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 74)
{
htmltext = "31378-01.htm";
@@ -256,78 +248,88 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
player.setAllianceWithVarkaKetra(0);
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
- if (cond == 1)
+ {
+ switch (st.getCond())
{
- if (st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 100)
+ case 1:
{
- htmltext = "31378-03b.htm";
+ if (st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 100)
+ {
+ htmltext = "31378-03b.htm";
+ }
+ else
+ {
+ htmltext = "31378-09.htm";
+ }
+ break;
}
- else
+ case 2:
{
- htmltext = "31378-09.htm";
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 200) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 100))
+ {
+ htmltext = "31378-12.htm";
+ }
+ else
+ {
+ htmltext = "31378-13.htm";
+ }
+ break;
}
- }
- else if (cond == 2)
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 200) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 100))
+ case 3:
{
- htmltext = "31378-12.htm";
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 200) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 100))
+ {
+ htmltext = "31378-15.htm";
+ }
+ else
+ {
+ htmltext = "31378-16.htm";
+ }
+ break;
}
- else
+ case 4:
{
- htmltext = "31378-13.htm";
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(VALOR_FEATHER))
+ {
+ htmltext = "31378-21.htm";
+ }
+ else
+ {
+ htmltext = "31378-22.htm";
+ }
+ break;
}
- }
- else if (cond == 3)
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 200) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 100))
+ case 5:
{
- htmltext = "31378-15.htm";
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 400) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 400) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(WISDOM_FEATHER))
+ {
+ htmltext = "31378-17.htm";
+ }
+ else
+ {
+ htmltext = "31378-10-5.htm";
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KETRA_BADGE_SOLDIER, 400);
+ st.takeItems(KETRA_BADGE_OFFICER, 400);
+ st.takeItems(KETRA_BADGE_CAPTAIN, 200);
+ st.takeItems(WISDOM_FEATHER, -1);
+ st.takeItems(VARKA_ALLIANCE_4, -1);
+ st.giveItems(VARKA_ALLIANCE_5, 1);
+ player.setAllianceWithVarkaKetra(-5);
+ }
+ break;
}
- else
+ case 6:
{
- htmltext = "31378-16.htm";
+ htmltext = "31378-08.htm";
+ break;
}
}
- else if (cond == 4)
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(VALOR_FEATHER))
- {
- htmltext = "31378-21.htm";
- }
- else
- {
- htmltext = "31378-22.htm";
- }
- }
- else if (cond == 5)
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 400) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 400) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(WISDOM_FEATHER))
- {
- htmltext = "31378-17.htm";
- }
- else
- {
- htmltext = "31378-10-5.htm";
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KETRA_BADGE_SOLDIER, 400);
- st.takeItems(KETRA_BADGE_OFFICER, 400);
- st.takeItems(KETRA_BADGE_CAPTAIN, 200);
- st.takeItems(WISDOM_FEATHER, -1);
- st.takeItems(VARKA_ALLIANCE_4, -1);
- st.giveItems(VARKA_ALLIANCE_5, 1);
- player.setAllianceWithVarkaKetra(-5);
- }
- }
- else if (cond == 6)
- {
- htmltext = "31378-08.htm";
- }
break;
+ }
}
return htmltext;
@@ -358,7 +360,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond == 6)
{
return null;
@@ -371,6 +373,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
case 21327:
case 21328:
case 21329:
+ {
if (cond == 1)
{
st.dropItems(KETRA_BADGE_SOLDIER, 1, 100, CHANCES.get(npcId));
@@ -388,7 +391,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
st.dropItems(KETRA_BADGE_SOLDIER, 1, 400, CHANCES.get(npcId));
}
break;
-
+ }
case 21331:
case 21332:
case 21334:
@@ -397,6 +400,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
case 21338:
case 21343:
case 21344:
+ {
if (cond == 2)
{
st.dropItems(KETRA_BADGE_OFFICER, 1, 100, CHANCES.get(npcId));
@@ -414,7 +418,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
st.dropItems(KETRA_BADGE_OFFICER, 1, 400, CHANCES.get(npcId));
}
break;
-
+ }
case 21339:
case 21340:
case 21342:
@@ -423,6 +427,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
case 21347:
case 21348:
case 21349:
+ {
if (cond == 3)
{
st.dropItems(KETRA_BADGE_CAPTAIN, 1, 100, CHANCES.get(npcId));
@@ -432,6 +437,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
st.dropItems(KETRA_BADGE_CAPTAIN, 1, 200, CHANCES.get(npcId));
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q612_WarWithKetraOrcs/Q612_WarWithKetraOrcs.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q612_WarWithKetraOrcs/Q612_WarWithKetraOrcs.java
index fa84ce30d0..fbe5464951 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q612_WarWithKetraOrcs/Q612_WarWithKetraOrcs.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q612_WarWithKetraOrcs/Q612_WarWithKetraOrcs.java
@@ -34,9 +34,7 @@ public class Q612_WarWithKetraOrcs extends Quest
public Q612_WarWithKetraOrcs()
{
super(612, "War with Ketra Orcs");
-
registerQuestItems(MOLAR_OF_KETRA_ORC);
-
addStartNpc(31377); // Ashas Varka Durai
addTalkId(31377);
}
@@ -51,29 +49,33 @@ public class Q612_WarWithKetraOrcs extends Quest
return htmltext;
}
- if (event.equals("31377-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31377-07.htm"))
- {
- if (st.getQuestItemsCount(MOLAR_OF_KETRA_ORC) >= 100)
+ case "31377-03.htm":
{
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(MOLAR_OF_KETRA_ORC, 100);
- st.giveItems(NEPENTHES_SEED, 20);
+ st.startQuest();
+ break;
}
- else
+ case "31377-07.htm":
{
- htmltext = "31377-08.htm";
+ if (st.getQuestItemsCount(MOLAR_OF_KETRA_ORC) >= 100)
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(MOLAR_OF_KETRA_ORC, 100);
+ st.giveItems(NEPENTHES_SEED, 20);
+ }
+ else
+ {
+ htmltext = "31377-08.htm";
+ }
+ break;
+ }
+ case "31377-09.htm":
+ {
+ st.takeItems(MOLAR_OF_KETRA_ORC, -1);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("31377-09.htm"))
- {
- st.takeItems(MOLAR_OF_KETRA_ORC, -1);
- st.exitQuest(true);
}
return htmltext;
@@ -92,12 +94,15 @@ public class Q612_WarWithKetraOrcs extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() >= 74) && player.isAlliedWithVarka()) ? "31377-01.htm" : "31377-02.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(MOLAR_OF_KETRA_ORC)) ? "31377-04.htm" : "31377-05.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q613_ProveYourCourage/Q613_ProveYourCourage.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q613_ProveYourCourage/Q613_ProveYourCourage.java
index 779a01e73f..d1bfc222ef 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q613_ProveYourCourage/Q613_ProveYourCourage.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q613_ProveYourCourage/Q613_ProveYourCourage.java
@@ -32,12 +32,9 @@ public class Q613_ProveYourCourage extends Quest
public Q613_ProveYourCourage()
{
super(613, "Prove your courage!");
-
registerQuestItems(HEAD_OF_HEKATON);
-
addStartNpc(31377); // Ashas Varka Durai
addTalkId(31377);
-
addKillId(25299); // Hekaton
}
@@ -53,9 +50,7 @@ public class Q613_ProveYourCourage extends Quest
if (event.equals("31377-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31377-07.htm"))
{
@@ -70,7 +65,7 @@ public class Q613_ProveYourCourage extends Quest
else
{
htmltext = "31377-06.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.playSound(QuestState.SOUND_ACCEPT);
}
}
@@ -91,6 +86,7 @@ public class Q613_ProveYourCourage extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 75)
{
htmltext = "31377-03.htm";
@@ -104,10 +100,12 @@ public class Q613_ProveYourCourage extends Quest
htmltext = "31377-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(HEAD_OF_HEKATON)) ? "31377-05.htm" : "31377-06.htm";
break;
+ }
}
return htmltext;
@@ -116,7 +114,7 @@ public class Q613_ProveYourCourage extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "1"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 1))
{
if (partyMember.getAllianceWithVarkaKetra() <= -3)
{
@@ -128,7 +126,7 @@ public class Q613_ProveYourCourage extends Quest
if (st.hasQuestItems(VARKA_ALLIANCE_3))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HEAD_OF_HEKATON, 1);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q614_SlayTheEnemyCommander/Q614_SlayTheEnemyCommander.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q614_SlayTheEnemyCommander/Q614_SlayTheEnemyCommander.java
index 055125f7ab..f8ef413079 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q614_SlayTheEnemyCommander/Q614_SlayTheEnemyCommander.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q614_SlayTheEnemyCommander/Q614_SlayTheEnemyCommander.java
@@ -32,12 +32,9 @@ public class Q614_SlayTheEnemyCommander extends Quest
public Q614_SlayTheEnemyCommander()
{
super(614, "Slay the enemy commander!");
-
registerQuestItems(HEAD_OF_TAYR);
-
addStartNpc(31377); // Ashas Varka Durai
addTalkId(31377);
-
addKillId(25302); // Tayr
}
@@ -53,9 +50,7 @@ public class Q614_SlayTheEnemyCommander extends Quest
if (event.equals("31377-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31377-07.htm"))
{
@@ -70,7 +65,7 @@ public class Q614_SlayTheEnemyCommander extends Quest
else
{
htmltext = "31377-06.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.playSound(QuestState.SOUND_ACCEPT);
}
}
@@ -91,6 +86,7 @@ public class Q614_SlayTheEnemyCommander extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 75)
{
if ((player.getAllianceWithVarkaKetra() <= -4) && st.hasQuestItems(VARKA_ALLIANCE_4) && !st.hasQuestItems(FEATHER_OF_WISDOM))
@@ -107,10 +103,12 @@ public class Q614_SlayTheEnemyCommander extends Quest
htmltext = "31377-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(HEAD_OF_TAYR)) ? "31377-05.htm" : "31377-06.htm";
break;
+ }
}
return htmltext;
@@ -119,7 +117,7 @@ public class Q614_SlayTheEnemyCommander extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "1"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 1))
{
if (partyMember.getAllianceWithVarkaKetra() <= -4)
{
@@ -131,7 +129,7 @@ public class Q614_SlayTheEnemyCommander extends Quest
if (st.hasQuestItems(VARKA_ALLIANCE_4))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HEAD_OF_TAYR, 1);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q615_MagicalPowerOfFire_Part1/Q615_MagicalPowerOfFire_Part1.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q615_MagicalPowerOfFire_Part1/Q615_MagicalPowerOfFire_Part1.java
index 3ec0616622..d16ca95c34 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q615_MagicalPowerOfFire_Part1/Q615_MagicalPowerOfFire_Part1.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q615_MagicalPowerOfFire_Part1/Q615_MagicalPowerOfFire_Part1.java
@@ -29,7 +29,6 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
private static final int UDAN = 31379;
private static final int ASEFA_BOX = 31559;
private static final int EYE = 31684;
-
// Items
private static final int THIEF_KEY = 1661;
private static final int STOLEN_RED_TOTEM = 7242;
@@ -39,12 +38,9 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
public Q615_MagicalPowerOfFire_Part1()
{
super(615, "Magical Power of Fire - Part 1");
-
registerQuestItems(STOLEN_RED_TOTEM);
-
addStartNpc(NARAN);
addTalkId(NARAN, UDAN, ASEFA_BOX);
-
// IDs aggro ranges to avoid, else quest is automatically failed.
addAggroRangeEnterId(21350, 21351, 21353, 21354, 21355, 21357, 21358, 21360, 21361, 21362, 21369, 21370, 21364, 21365, 21366, 21368, 21371, 21372, 21373, 21374, 21375);
}
@@ -59,37 +55,40 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
return htmltext;
}
- if (event.equals("31378-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("spawned", "0");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31559-03.htm"))
- {
- // You have been discovered ; quest is failed.
- if (st.getInt("spawned") == 1)
+ case "31378-03.htm":
{
- htmltext = "31559-04.htm";
+ st.startQuest();
+ st.set("spawned", "0");
+ break;
}
- else if (!st.hasQuestItems(THIEF_KEY))
+ case "31559-03.htm":
{
- htmltext = "31559-02.htm";
+ // You have been discovered ; quest is failed.
+ if (st.getInt("spawned") == 1)
+ {
+ htmltext = "31559-04.htm";
+ }
+ else if (!st.hasQuestItems(THIEF_KEY))
+ {
+ htmltext = "31559-02.htm";
+ }
+ else
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(THIEF_KEY, 1);
+ st.giveItems(STOLEN_RED_TOTEM, 1);
+ }
+ break;
}
- else
+ case "UdanEyeDespawn":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(THIEF_KEY, 1);
- st.giveItems(STOLEN_RED_TOTEM, 1);
+ npc.broadcastNpcSay("I'll be waiting for your return.");
+ return null;
}
}
- else if (event.equals("UdanEyeDespawn"))
- {
- npc.broadcastNpcSay("I'll be waiting for your return.");
- return null;
- }
return htmltext;
}
@@ -107,22 +106,26 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() >= 74) && (player.getAllianceWithVarkaKetra() <= -2)) ? "31378-01.htm" : "31378-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NARAN:
+ {
htmltext = "31378-04.htm";
break;
-
+ }
case UDAN:
+ {
if (cond == 1)
{
htmltext = "31379-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 2)
@@ -151,8 +154,9 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
st.exitQuest(true);
}
break;
-
+ }
case ASEFA_BOX:
+ {
if (cond == 2)
{
htmltext = "31559-01.htm";
@@ -162,8 +166,10 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
htmltext = "31559-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -178,7 +184,7 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
return null;
}
- if ((st.getInt("spawned") == 0) && (st.getInt("cond") == 2))
+ if ((st.getInt("spawned") == 0) && st.isCond(2))
{
// Put "spawned" flag to 1 to avoid to spawn another.
st.set("spawned", "1");
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q616_MagicalPowerOfFire_Part2/Q616_MagicalPowerOfFire_Part2.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q616_MagicalPowerOfFire_Part2/Q616_MagicalPowerOfFire_Part2.java
index 65c4ea0ad4..6e7ec3e08a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q616_MagicalPowerOfFire_Part2/Q616_MagicalPowerOfFire_Part2.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q616_MagicalPowerOfFire_Part2/Q616_MagicalPowerOfFire_Part2.java
@@ -29,49 +29,45 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q616_MagicalPowerOfFire_Part2 extends Quest
{
- // Monster
- private static final int SOUL_OF_FIRE_NASTRON = 25306;
-
// NPCs
private static final int UDAN_MARDUI = 31379;
private static final int KETRAS_HOLY_ALTAR = 31558;
-
+ // Monster
+ private static final int SOUL_OF_FIRE_NASTRON = 25306;
// Items
private static final int RED_TOTEM = 7243;
private static final int FIRE_HEART_OF_NASTRON = 7244;
-
// Other
private static final int CHECK_INTERVAL = 600000; // 10 minutes
private static final int IDLE_INTERVAL = 2; // (X * CHECK_INTERVAL) = 20 minutes
-
private NpcInstance _npc = null;
private int _status = -1;
public Q616_MagicalPowerOfFire_Part2()
{
super(616, "Magical Power of Fire - Part 2");
-
registerQuestItems(FIRE_HEART_OF_NASTRON);
-
addStartNpc(UDAN_MARDUI);
addTalkId(UDAN_MARDUI, KETRAS_HOLY_ALTAR);
-
addAttackId(SOUL_OF_FIRE_NASTRON);
addKillId(SOUL_OF_FIRE_NASTRON);
-
switch (RaidBossSpawnManager.getInstance().getRaidBossStatusId(SOUL_OF_FIRE_NASTRON))
{
case UNDEFINED:
+ {
LOGGER.log(Level.WARNING, getName() + ": can not find spawned RaidBoss id=" + SOUL_OF_FIRE_NASTRON);
break;
-
+ }
case ALIVE:
+ {
spawnNpc();
// fallthrough
-
+ }
case DEAD:
+ {
startQuestTimer("check", CHECK_INTERVAL, null, null, true);
break;
+ }
}
}
@@ -102,56 +98,58 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
return htmltext;
}
- // Udan Mardui
- if (event.equals("31379-04.htm"))
+ switch (event)
{
- if (st.hasQuestItems(RED_TOTEM))
+ case "31379-04.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else
- {
- htmltext = "31379-02.htm";
- }
- }
- else if (event.equals("31379-08.htm"))
- {
- if (st.hasQuestItems(FIRE_HEART_OF_NASTRON))
- {
- st.takeItems(FIRE_HEART_OF_NASTRON, 1);
- st.rewardExpAndSp(10000, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else
- {
- htmltext = "31379-09.htm";
- }
- }
- // Ketra's Holy Altar
- else if (event.equals("31558-02.htm"))
- {
- if (st.hasQuestItems(RED_TOTEM))
- {
- if (_status < 0)
+ if (st.hasQuestItems(RED_TOTEM))
{
- if (spawnRaid())
+ st.startQuest();
+ }
+ else
+ {
+ htmltext = "31379-02.htm";
+ }
+ break;
+ }
+ case "31379-08.htm":
+ {
+ if (st.hasQuestItems(FIRE_HEART_OF_NASTRON))
+ {
+ st.takeItems(FIRE_HEART_OF_NASTRON, 1);
+ st.rewardExpAndSp(10000, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "31379-09.htm";
+ }
+ break;
+ }
+ case "31558-02.htm":
+ {
+ if (st.hasQuestItems(RED_TOTEM))
+ {
+ if (_status < 0)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RED_TOTEM, 1);
+ if (spawnRaid())
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RED_TOTEM, 1);
+ }
+ }
+ else
+ {
+ htmltext = "31558-04.htm";
}
}
else
{
- htmltext = "31558-04.htm";
+ htmltext = "31558-03.htm";
}
- }
- else
- {
- htmltext = "31558-03.htm";
+ break;
}
}
@@ -171,6 +169,7 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (!st.hasQuestItems(RED_TOTEM))
{
htmltext = "31379-02.htm";
@@ -184,12 +183,14 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
htmltext = "31379-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case UDAN_MARDUI:
+ {
if (cond == 1)
{
htmltext = "31379-05.htm";
@@ -203,8 +204,9 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
htmltext = "31379-07.htm";
}
break;
-
+ }
case KETRAS_HOLY_ALTAR:
+ {
if (cond == 1)
{
htmltext = "31558-01.htm";
@@ -214,8 +216,10 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
htmltext = "31558-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -231,7 +235,7 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "2"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 2))
{
final QuestState st = partyMember.getQuestState(getName());
if (st == null)
@@ -239,7 +243,7 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
continue;
}
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(FIRE_HEART_OF_NASTRON, 1);
}
@@ -282,6 +286,7 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
return true;
}
+
return false;
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q617_GatherTheFlames/Q617_GatherTheFlames.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q617_GatherTheFlames/Q617_GatherTheFlames.java
index ce27154d74..a34c82cc38 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q617_GatherTheFlames/Q617_GatherTheFlames.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q617_GatherTheFlames/Q617_GatherTheFlames.java
@@ -33,10 +33,8 @@ public class Q617_GatherTheFlames extends Quest
private static final int HILDA = 31271;
private static final int VULCAN = 31539;
private static final int ROONEY = 32049;
-
// Items
private static final int TORCH = 7264;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -68,7 +66,6 @@ public class Q617_GatherTheFlames extends Quest
CHANCES.put(21379, 590000);
CHANCES.put(21380, 490000);
}
-
// Rewards
private static final int[] REWARD =
{
@@ -87,16 +84,10 @@ public class Q617_GatherTheFlames extends Quest
public Q617_GatherTheFlames()
{
super(617, "Gather the Flames");
-
registerQuestItems(TORCH);
-
addStartNpc(VULCAN, HILDA);
addTalkId(VULCAN, HILDA, ROONEY);
-
- for (int mobs : CHANCES.keySet())
- {
- addKillId(mobs);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -111,9 +102,7 @@ public class Q617_GatherTheFlames extends Quest
if (event.equals("31539-03.htm") || event.equals("31271-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31539-05.htm"))
{
@@ -159,25 +148,32 @@ public class Q617_GatherTheFlames extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = npc.getNpcId() + ((player.getLevel() >= 74) ? "-01.htm" : "-02.htm");
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case VULCAN:
+ {
htmltext = (st.getQuestItemsCount(TORCH) >= 1000) ? "31539-04.htm" : "31539-05.htm";
break;
-
+ }
case HILDA:
+ {
htmltext = "31271-04.htm";
break;
-
+ }
case ROONEY:
+ {
htmltext = (st.getQuestItemsCount(TORCH) >= 1200) ? "32049-01.htm" : "32049-02.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q618_IntoTheFlame/Q618_IntoTheFlame.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q618_IntoTheFlame/Q618_IntoTheFlame.java
index 4439573cb4..d17b38caf9 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q618_IntoTheFlame/Q618_IntoTheFlame.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q618_IntoTheFlame/Q618_IntoTheFlame.java
@@ -27,23 +27,18 @@ public class Q618_IntoTheFlame extends Quest
// NPCs
private static final int KLEIN = 31540;
private static final int HILDA = 31271;
-
// Items
private static final int VACUALITE_ORE = 7265;
private static final int VACUALITE = 7266;
-
// Reward
private static final int FLOATING_STONE = 7267;
public Q618_IntoTheFlame()
{
super(618, "Into the Flame");
-
registerQuestItems(VACUALITE_ORE, VACUALITE);
-
addStartNpc(KLEIN);
addTalkId(KLEIN, HILDA);
-
// Kookaburras, Bandersnatches, Grendels
addKillId(21274, 21275, 21276, 21277, 21282, 21283, 21284, 21285, 21290, 21291, 21292, 21293);
}
@@ -58,30 +53,35 @@ public class Q618_IntoTheFlame extends Quest
return htmltext;
}
- if (event.equals("31540-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31540-05.htm"))
- {
- st.takeItems(VACUALITE, 1);
- st.giveItems(FLOATING_STONE, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("31271-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31271-05.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VACUALITE_ORE, -1);
- st.giveItems(VACUALITE, 1);
+ case "31540-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31540-05.htm":
+ {
+ st.takeItems(VACUALITE, 1);
+ st.giveItems(FLOATING_STONE, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "31271-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31271-05.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VACUALITE_ORE, -1);
+ st.giveItems(VACUALITE, 1);
+ break;
+ }
}
return htmltext;
@@ -100,18 +100,22 @@ public class Q618_IntoTheFlame extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "31540-01.htm" : "31540-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case KLEIN:
+ {
htmltext = (cond == 4) ? "31540-04.htm" : "31540-03.htm";
break;
-
+ }
case HILDA:
+ {
if (cond == 1)
{
htmltext = "31271-01.htm";
@@ -129,8 +133,10 @@ public class Q618_IntoTheFlame extends Quest
htmltext = "31271-06.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -139,7 +145,7 @@ public class Q618_IntoTheFlame extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "2");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 2);
if (partyMember == null)
{
return null;
@@ -153,7 +159,7 @@ public class Q618_IntoTheFlame extends Quest
if (st.dropItems(VACUALITE_ORE, 1, 50, 500000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q619_RelicsOfTheOldEmpire/Q619_RelicsOfTheOldEmpire.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q619_RelicsOfTheOldEmpire/Q619_RelicsOfTheOldEmpire.java
index c5f9c67bef..4f26652a3b 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q619_RelicsOfTheOldEmpire/Q619_RelicsOfTheOldEmpire.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q619_RelicsOfTheOldEmpire/Q619_RelicsOfTheOldEmpire.java
@@ -27,11 +27,9 @@ public class Q619_RelicsOfTheOldEmpire extends Quest
{
// NPC
private static int GHOST_OF_ADVENTURER = 31538;
-
// Items
private static int RELICS = 7254;
private static int ENTRANCE = 7075;
-
// Rewards ; all S grade weapons recipe (60%)
private static int[] RCP_REWARDS = new int[]
{
@@ -50,21 +48,16 @@ public class Q619_RelicsOfTheOldEmpire extends Quest
public Q619_RelicsOfTheOldEmpire()
{
super(619, "Relics of the Old Empire");
-
registerQuestItems(RELICS);
-
addStartNpc(GHOST_OF_ADVENTURER);
addTalkId(GHOST_OF_ADVENTURER);
-
for (int id = 21396; id <= 21434; id++)
{
// IT monsters
addKillId(id);
}
-
// monsters at IT entrance
addKillId(21798, 21799, 21800);
-
for (int id = 18120; id <= 18256; id++)
{
// Sepulchers monsters
@@ -82,29 +75,33 @@ public class Q619_RelicsOfTheOldEmpire extends Quest
return htmltext;
}
- if (event.equals("31538-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31538-09.htm"))
- {
- if (st.getQuestItemsCount(RELICS) >= 1000)
+ case "31538-03.htm":
{
- htmltext = "31538-09.htm";
- st.takeItems(RELICS, 1000);
- st.giveItems(RCP_REWARDS[Rnd.get(RCP_REWARDS.length)], 1);
+ st.startQuest();
+ break;
}
- else
+ case "31538-09.htm":
{
- htmltext = "31538-06.htm";
+ if (st.getQuestItemsCount(RELICS) >= 1000)
+ {
+ htmltext = "31538-09.htm";
+ st.takeItems(RELICS, 1000);
+ st.giveItems(RCP_REWARDS[Rnd.get(RCP_REWARDS.length)], 1);
+ }
+ else
+ {
+ htmltext = "31538-06.htm";
+ }
+ break;
+ }
+ case "31538-10.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("31538-10.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
}
@@ -122,10 +119,12 @@ public class Q619_RelicsOfTheOldEmpire extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 74) ? "31538-02.htm" : "31538-01.htm";
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(RELICS) >= 1000)
{
htmltext = "31538-04.htm";
@@ -139,6 +138,7 @@ public class Q619_RelicsOfTheOldEmpire extends Quest
htmltext = "31538-07.htm";
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q620_FourGoblets/Q620_FourGoblets.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q620_FourGoblets/Q620_FourGoblets.java
index 79eb3bb0e1..4ddcba2a54 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q620_FourGoblets/Q620_FourGoblets.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q620_FourGoblets/Q620_FourGoblets.java
@@ -31,26 +31,20 @@ public class Q620_FourGoblets extends Quest
private static final int GHOST_OF_WIGOTH_1 = 31452;
private static final int NAMELESS_SPIRIT = 31453;
private static final int GHOST_OF_WIGOTH_2 = 31454;
-
private static final int GHOST_CHAMBERLAIN_1 = 31919;
private static final int GHOST_CHAMBERLAIN_2 = 31920;
-
private static final int CONQUERORS_SEPULCHER_MANAGER = 31921;
private static final int EMPERORS_SEPULCHER_MANAGER = 31922;
private static final int GREAT_SAGES_SEPULCHER_MANAGER = 31923;
private static final int JUDGES_SEPULCHER_MANAGER = 31924;
-
// Items
private static final int RELIC = 7254;
private static final int SEALED_BOX = 7255;
-
private static final int GOBLET_OF_ALECTIA = 7256;
private static final int GOBLET_OF_TISHAS = 7257;
private static final int GOBLET_OF_MEKARA = 7258;
private static final int GOBLET_OF_MORIGUL = 7259;
-
private static final int USED_GRAVE_PASS = 7261;
-
// Rewards
private static final int ANTIQUE_BROOCH = 7262;
private static final int[] RCP_REWARDS = new int[]
@@ -70,12 +64,9 @@ public class Q620_FourGoblets extends Quest
public Q620_FourGoblets()
{
super(620, "Four Goblets");
-
registerQuestItems(SEALED_BOX, USED_GRAVE_PASS, GOBLET_OF_ALECTIA, GOBLET_OF_TISHAS, GOBLET_OF_MEKARA, GOBLET_OF_MORIGUL);
-
addStartNpc(NAMELESS_SPIRIT, CONQUERORS_SEPULCHER_MANAGER, EMPERORS_SEPULCHER_MANAGER, GREAT_SAGES_SEPULCHER_MANAGER, JUDGES_SEPULCHER_MANAGER, GHOST_CHAMBERLAIN_1, GHOST_CHAMBERLAIN_2);
addTalkId(NAMELESS_SPIRIT, CONQUERORS_SEPULCHER_MANAGER, EMPERORS_SEPULCHER_MANAGER, GREAT_SAGES_SEPULCHER_MANAGER, JUDGES_SEPULCHER_MANAGER, GHOST_CHAMBERLAIN_1, GHOST_CHAMBERLAIN_2, GHOST_OF_WIGOTH_1, GHOST_OF_WIGOTH_2);
-
for (int id = 18120; id <= 18256; id++)
{
addKillId(id);
@@ -105,15 +96,13 @@ public class Q620_FourGoblets extends Quest
}
else if (event.equals("31453-13.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31453-16.htm"))
{
if (st.hasQuestItems(GOBLET_OF_ALECTIA, GOBLET_OF_TISHAS, GOBLET_OF_MEKARA, GOBLET_OF_MORIGUL))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GOBLET_OF_ALECTIA, -1);
st.takeItems(GOBLET_OF_TISHAS, -1);
@@ -128,7 +117,7 @@ public class Q620_FourGoblets extends Quest
}
// else if (event.equals("31453-13.htm"))
// {
- // if (st.getInt("cond") == 2)
+ // if (st.getCond()s == 2)
// {
// htmltext = "31453-19.htm";
// }
@@ -232,13 +221,7 @@ public class Q620_FourGoblets extends Quest
}
final int npcId = npc.getNpcId();
- final int id = st.getState();
- final int cond = st.getInt("cond");
- if (id == State.CREATED)
- {
- st.set("cond", "0");
- }
-
+ final int cond = st.getCond();
if (npcId == GHOST_OF_WIGOTH_1)
{
if (cond == 1)
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q621_EggDelivery/Q621_EggDelivery.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q621_EggDelivery/Q621_EggDelivery.java
index 772afda2e3..427f85fadf 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q621_EggDelivery/Q621_EggDelivery.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q621_EggDelivery/Q621_EggDelivery.java
@@ -25,10 +25,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q621_EggDelivery extends Quest
{
- // Items
- private static final int BOILED_EGGS = 7195;
- private static final int FEE_OF_BOILED_EGG = 7196;
-
// NPCs
private static final int JEREMY = 31521;
private static final int PULIN = 31543;
@@ -37,7 +33,9 @@ public class Q621_EggDelivery extends Quest
private static final int KUBER = 31546;
private static final int BEOLIN = 31547;
private static final int VALENTINE = 31584;
-
+ // Items
+ private static final int BOILED_EGGS = 7195;
+ private static final int FEE_OF_BOILED_EGG = 7196;
// Rewards
private static final int HASTE_POTION = 1062;
private static final int[] RECIPES =
@@ -50,9 +48,7 @@ public class Q621_EggDelivery extends Quest
public Q621_EggDelivery()
{
super(621, "Egg Delivery");
-
registerQuestItems(BOILED_EGGS, FEE_OF_BOILED_EGG);
-
addStartNpc(JEREMY);
addTalkId(JEREMY, PULIN, NAFF, CROCUS, KUBER, BEOLIN, VALENTINE);
}
@@ -67,77 +63,86 @@ public class Q621_EggDelivery extends Quest
return htmltext;
}
- if (event.equals("31521-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(BOILED_EGGS, 5);
- }
- else if (event.equals("31543-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BOILED_EGGS, 1);
- st.giveItems(FEE_OF_BOILED_EGG, 1);
- }
- else if (event.equals("31544-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BOILED_EGGS, 1);
- st.giveItems(FEE_OF_BOILED_EGG, 1);
- }
- else if (event.equals("31545-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BOILED_EGGS, 1);
- st.giveItems(FEE_OF_BOILED_EGG, 1);
- }
- else if (event.equals("31546-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BOILED_EGGS, 1);
- st.giveItems(FEE_OF_BOILED_EGG, 1);
- }
- else if (event.equals("31547-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BOILED_EGGS, 1);
- st.giveItems(FEE_OF_BOILED_EGG, 1);
- }
- else if (event.equals("31521-06.htm"))
- {
- if (st.getQuestItemsCount(FEE_OF_BOILED_EGG) < 5)
+ case "31521-02.htm":
{
- htmltext = "31521-08.htm";
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
+ st.startQuest();
+ st.giveItems(BOILED_EGGS, 5);
+ break;
}
- else
+ case "31543-02.htm":
{
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(FEE_OF_BOILED_EGG, 5);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BOILED_EGGS, 1);
+ st.giveItems(FEE_OF_BOILED_EGG, 1);
+ break;
}
- }
- else if (event.equals("31584-02.htm"))
- {
- if (Rnd.get(5) < 1)
+ case "31544-02.htm":
{
- st.rewardItems(RECIPES[Rnd.get(3)], 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BOILED_EGGS, 1);
+ st.giveItems(FEE_OF_BOILED_EGG, 1);
+ break;
}
- else
+ case "31545-02.htm":
{
- st.rewardItems(57, 18800);
- st.rewardItems(HASTE_POTION, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BOILED_EGGS, 1);
+ st.giveItems(FEE_OF_BOILED_EGG, 1);
+ break;
+ }
+ case "31546-02.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BOILED_EGGS, 1);
+ st.giveItems(FEE_OF_BOILED_EGG, 1);
+ break;
+ }
+ case "31547-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BOILED_EGGS, 1);
+ st.giveItems(FEE_OF_BOILED_EGG, 1);
+ break;
+ }
+ case "31521-06.htm":
+ {
+ if (st.getQuestItemsCount(FEE_OF_BOILED_EGG) < 5)
+ {
+ htmltext = "31521-08.htm";
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ }
+ else
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(FEE_OF_BOILED_EGG, 5);
+ }
+ break;
+ }
+ case "31584-02.htm":
+ {
+ if (Rnd.get(5) < 1)
+ {
+ st.rewardItems(RECIPES[Rnd.get(3)], 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ st.rewardItems(57, 18800);
+ st.rewardItems(HASTE_POTION, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ break;
}
}
return htmltext;
@@ -156,14 +161,17 @@ public class Q621_EggDelivery extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 68) ? "31521-03.htm" : "31521-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case JEREMY:
+ {
if (cond == 1)
{
htmltext = "31521-04.htm";
@@ -177,8 +185,9 @@ public class Q621_EggDelivery extends Quest
htmltext = "31521-07.htm";
}
break;
-
+ }
case PULIN:
+ {
if ((cond == 1) && (st.getQuestItemsCount(BOILED_EGGS) == 5))
{
htmltext = "31543-01.htm";
@@ -188,8 +197,9 @@ public class Q621_EggDelivery extends Quest
htmltext = "31543-03.htm";
}
break;
-
+ }
case NAFF:
+ {
if ((cond == 2) && (st.getQuestItemsCount(BOILED_EGGS) == 4))
{
htmltext = "31544-01.htm";
@@ -199,8 +209,9 @@ public class Q621_EggDelivery extends Quest
htmltext = "31544-03.htm";
}
break;
-
+ }
case CROCUS:
+ {
if ((cond == 3) && (st.getQuestItemsCount(BOILED_EGGS) == 3))
{
htmltext = "31545-01.htm";
@@ -210,8 +221,9 @@ public class Q621_EggDelivery extends Quest
htmltext = "31545-03.htm";
}
break;
-
+ }
case KUBER:
+ {
if ((cond == 4) && (st.getQuestItemsCount(BOILED_EGGS) == 2))
{
htmltext = "31546-01.htm";
@@ -221,8 +233,9 @@ public class Q621_EggDelivery extends Quest
htmltext = "31546-03.htm";
}
break;
-
+ }
case BEOLIN:
+ {
if ((cond == 5) && (st.getQuestItemsCount(BOILED_EGGS) == 1))
{
htmltext = "31547-01.htm";
@@ -232,15 +245,18 @@ public class Q621_EggDelivery extends Quest
htmltext = "31547-03.htm";
}
break;
-
+ }
case VALENTINE:
+ {
if (cond == 7)
{
htmltext = "31584-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q622_SpecialtyLiquorDelivery/Q622_SpecialtyLiquorDelivery.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q622_SpecialtyLiquorDelivery/Q622_SpecialtyLiquorDelivery.java
index f53743f761..77bec61cc5 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q622_SpecialtyLiquorDelivery/Q622_SpecialtyLiquorDelivery.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q622_SpecialtyLiquorDelivery/Q622_SpecialtyLiquorDelivery.java
@@ -25,10 +25,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q622_SpecialtyLiquorDelivery extends Quest
{
- // Items
- private static final int SPECIAL_DRINK = 7197;
- private static final int FEE_OF_SPECIAL_DRINK = 7198;
-
// NPCs
private static final int JEREMY = 31521;
private static final int PULIN = 31543;
@@ -37,7 +33,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
private static final int KUBER = 31546;
private static final int BEOLIN = 31547;
private static final int LIETTA = 31267;
-
+ // Items
+ private static final int SPECIAL_DRINK = 7197;
+ private static final int FEE_OF_SPECIAL_DRINK = 7198;
// Rewards
private static final int ADENA = 57;
private static final int HASTE_POTION = 1062;
@@ -51,9 +49,7 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
public Q622_SpecialtyLiquorDelivery()
{
super(622, "Specialty Liquor Delivery");
-
registerQuestItems(SPECIAL_DRINK, FEE_OF_SPECIAL_DRINK);
-
addStartNpc(JEREMY);
addTalkId(JEREMY, PULIN, NAFF, CROCUS, KUBER, BEOLIN, LIETTA);
}
@@ -68,67 +64,76 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
return htmltext;
}
- if (event.equals("31521-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(SPECIAL_DRINK, 5);
- }
- else if (event.equals("31547-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPECIAL_DRINK, 1);
- st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
- }
- else if (event.equals("31546-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPECIAL_DRINK, 1);
- st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
- }
- else if (event.equals("31545-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPECIAL_DRINK, 1);
- st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
- }
- else if (event.equals("31544-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPECIAL_DRINK, 1);
- st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
- }
- else if (event.equals("31543-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPECIAL_DRINK, 1);
- st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
- }
- else if (event.equals("31521-06.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(FEE_OF_SPECIAL_DRINK, 5);
- }
- else if (event.equals("31267-02.htm"))
- {
- if (Rnd.get(5) < 1)
+ case "31521-02.htm":
{
- st.giveItems(RECIPES[Rnd.get(RECIPES.length)], 1);
+ st.startQuest();
+ st.giveItems(SPECIAL_DRINK, 5);
+ break;
}
- else
+ case "31547-02.htm":
{
- st.rewardItems(ADENA, 18800);
- st.rewardItems(HASTE_POTION, 1);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPECIAL_DRINK, 1);
+ st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
+ break;
+ }
+ case "31546-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPECIAL_DRINK, 1);
+ st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
+ break;
+ }
+ case "31545-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPECIAL_DRINK, 1);
+ st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
+ break;
+ }
+ case "31544-02.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPECIAL_DRINK, 1);
+ st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
+ break;
+ }
+ case "31543-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPECIAL_DRINK, 1);
+ st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
+ break;
+ }
+ case "31521-06.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(FEE_OF_SPECIAL_DRINK, 5);
+ break;
+ }
+ case "31267-02.htm":
+ {
+ if (Rnd.get(5) < 1)
+ {
+ st.giveItems(RECIPES[Rnd.get(RECIPES.length)], 1);
+ }
+ else
+ {
+ st.rewardItems(ADENA, 18800);
+ st.rewardItems(HASTE_POTION, 1);
+ }
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -147,14 +152,17 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 68) ? "31521-03.htm" : "31521-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case JEREMY:
+ {
if (cond < 6)
{
htmltext = "31521-04.htm";
@@ -168,8 +176,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31521-06.htm";
}
break;
-
+ }
case BEOLIN:
+ {
if ((cond == 1) && (st.getQuestItemsCount(SPECIAL_DRINK) == 5))
{
htmltext = "31547-01.htm";
@@ -179,8 +188,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31547-03.htm";
}
break;
-
+ }
case KUBER:
+ {
if ((cond == 2) && (st.getQuestItemsCount(SPECIAL_DRINK) == 4))
{
htmltext = "31546-01.htm";
@@ -190,8 +200,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31546-03.htm";
}
break;
-
+ }
case CROCUS:
+ {
if ((cond == 3) && (st.getQuestItemsCount(SPECIAL_DRINK) == 3))
{
htmltext = "31545-01.htm";
@@ -201,8 +212,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31545-03.htm";
}
break;
-
+ }
case NAFF:
+ {
if ((cond == 4) && (st.getQuestItemsCount(SPECIAL_DRINK) == 2))
{
htmltext = "31544-01.htm";
@@ -212,8 +224,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31544-03.htm";
}
break;
-
+ }
case PULIN:
+ {
if ((cond == 5) && (st.getQuestItemsCount(SPECIAL_DRINK) == 1))
{
htmltext = "31543-01.htm";
@@ -223,14 +236,17 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31543-03.htm";
}
break;
-
+ }
case LIETTA:
+ {
if (cond == 7)
{
htmltext = "31267-01.htm";
}
break;
+ }
}
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q623_TheFinestFood/Q623_TheFinestFood.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q623_TheFinestFood/Q623_TheFinestFood.java
index 2a5df6eaca..320fe6e228 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q623_TheFinestFood/Q623_TheFinestFood.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q623_TheFinestFood/Q623_TheFinestFood.java
@@ -25,28 +25,23 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q623_TheFinestFood extends Quest
{
+ // NPC
+ private static final int JEREMY = 31521;
+ // Monsters
+ private static final int FLAVA = 21316;
+ private static final int BUFFALO = 21315;
+ private static final int ANTELOPE = 21318;
// Items
private static final int LEAF_OF_FLAVA = 7199;
private static final int BUFFALO_MEAT = 7200;
private static final int ANTELOPE_HORN = 7201;
- // NPC
- private static final int JEREMY = 31521;
-
- // Monsters
- private static final int FLAVA = 21316;
- private static final int BUFFALO = 21315;
- private static final int ANTELOPE = 21318;
-
public Q623_TheFinestFood()
{
super(623, "The Finest Food");
-
registerQuestItems(LEAF_OF_FLAVA, BUFFALO_MEAT, ANTELOPE_HORN);
-
addStartNpc(JEREMY);
addTalkId(JEREMY);
-
addKillId(FLAVA, BUFFALO, ANTELOPE);
}
@@ -64,9 +59,7 @@ public class Q623_TheFinestFood extends Quest
{
if (player.getLevel() >= 71)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else
{
@@ -121,11 +114,13 @@ public class Q623_TheFinestFood extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "31521-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31521-06.htm";
@@ -142,6 +137,7 @@ public class Q623_TheFinestFood extends Quest
}
}
break;
+ }
}
return htmltext;
@@ -150,7 +146,7 @@ public class Q623_TheFinestFood extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -165,25 +161,29 @@ public class Q623_TheFinestFood extends Quest
switch (npc.getNpcId())
{
case FLAVA:
+ {
if (st.dropItemsAlways(LEAF_OF_FLAVA, 1, 100) && (st.getQuestItemsCount(BUFFALO_MEAT) >= 100) && (st.getQuestItemsCount(ANTELOPE_HORN) >= 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case BUFFALO:
+ {
if (st.dropItemsAlways(BUFFALO_MEAT, 1, 100) && (st.getQuestItemsCount(LEAF_OF_FLAVA) >= 100) && (st.getQuestItemsCount(ANTELOPE_HORN) >= 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case ANTELOPE:
+ {
if (st.dropItemsAlways(ANTELOPE_HORN, 1, 100) && (st.getQuestItemsCount(LEAF_OF_FLAVA) >= 100) && (st.getQuestItemsCount(BUFFALO_MEAT) >= 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q624_TheFinestIngredients_Part1/Q624_TheFinestIngredients_Part1.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q624_TheFinestIngredients_Part1/Q624_TheFinestIngredients_Part1.java
index e7a01b8119..4196a9c5ef 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q624_TheFinestIngredients_Part1/Q624_TheFinestIngredients_Part1.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q624_TheFinestIngredients_Part1/Q624_TheFinestIngredients_Part1.java
@@ -24,17 +24,15 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q624_TheFinestIngredients_Part1 extends Quest
{
- // Mobs
+ // Monsters
private static final int NEPENTHES = 21319;
private static final int ATROX = 21321;
private static final int ATROXSPAWN = 21317;
private static final int BANDERSNATCH = 21314;
-
// Items
private static final int TRUNK_OF_NEPENTHES = 7202;
private static final int FOOT_OF_BANDERSNATCHLING = 7203;
private static final int SECRET_SPICE = 7204;
-
// Rewards
private static final int ICE_CRYSTAL = 7080;
private static final int SOY_SAUCE_JAR = 7205;
@@ -42,12 +40,9 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
public Q624_TheFinestIngredients_Part1()
{
super(624, "The Finest Ingredients - Part 1");
-
registerQuestItems(TRUNK_OF_NEPENTHES, FOOT_OF_BANDERSNATCHLING, SECRET_SPICE);
-
addStartNpc(31521); // Jeremy
addTalkId(31521);
-
addKillId(NEPENTHES, ATROX, ATROXSPAWN, BANDERSNATCH);
}
@@ -63,9 +58,7 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
if (event.equals("31521-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31521-05.htm"))
{
@@ -81,7 +74,7 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
}
else
{
- st.set("cond", "1");
+ st.setCond(1);
htmltext = "31521-07.htm";
}
}
@@ -102,11 +95,13 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 73) ? "31521-03.htm" : "31521-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31521-06.htm";
@@ -123,6 +118,7 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
}
}
break;
+ }
}
return htmltext;
@@ -131,7 +127,7 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -146,26 +142,30 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
switch (npc.getNpcId())
{
case NEPENTHES:
+ {
if (st.dropItemsAlways(TRUNK_OF_NEPENTHES, 1, 50) && (st.getQuestItemsCount(FOOT_OF_BANDERSNATCHLING) >= 50) && (st.getQuestItemsCount(SECRET_SPICE) >= 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case ATROX:
case ATROXSPAWN:
+ {
if (st.dropItemsAlways(SECRET_SPICE, 1, 50) && (st.getQuestItemsCount(TRUNK_OF_NEPENTHES) >= 50) && (st.getQuestItemsCount(FOOT_OF_BANDERSNATCHLING) >= 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case BANDERSNATCH:
+ {
if (st.dropItemsAlways(FOOT_OF_BANDERSNATCHLING, 1, 50) && (st.getQuestItemsCount(TRUNK_OF_NEPENTHES) >= 50) && (st.getQuestItemsCount(SECRET_SPICE) >= 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q625_TheFinestIngredients_Part2/Q625_TheFinestIngredients_Part2.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q625_TheFinestIngredients_Part2/Q625_TheFinestIngredients_Part2.java
index 0d330d5999..674e0689f2 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q625_TheFinestIngredients_Part2/Q625_TheFinestIngredients_Part2.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q625_TheFinestIngredients_Part2/Q625_TheFinestIngredients_Part2.java
@@ -30,13 +30,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q625_TheFinestIngredients_Part2 extends Quest
{
- // Monster
- private static final int ICICLE_EMPEROR_BUMBALUMP = 25296;
-
// NPCs
private static final int JEREMY = 31521;
private static final int YETI_TABLE = 31542;
-
+ // Monster
+ private static final int ICICLE_EMPEROR_BUMBALUMP = 25296;
// Items
private static final int SOY_SAUCE_JAR = 7205;
private static final int FOOD_FOR_BUMBALUMP = 7209;
@@ -50,39 +48,38 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
4593,
4594
};
-
// Other
private static final int CHECK_INTERVAL = 600000; // 10 minutes
private static final int IDLE_INTERVAL = 3; // (X * CHECK_INTERVAL) = 30 minutes
-
private NpcInstance _npc = null;
private int _status = -1;
public Q625_TheFinestIngredients_Part2()
{
super(625, "The Finest Ingredients - Part 2");
-
registerQuestItems(FOOD_FOR_BUMBALUMP, SPECIAL_YETI_MEAT);
-
addStartNpc(JEREMY);
addTalkId(JEREMY, YETI_TABLE);
-
addAttackId(ICICLE_EMPEROR_BUMBALUMP);
addKillId(ICICLE_EMPEROR_BUMBALUMP);
switch (RaidBossSpawnManager.getInstance().getRaidBossStatusId(ICICLE_EMPEROR_BUMBALUMP))
{
case UNDEFINED:
+ {
LOGGER.log(Level.WARNING, getName() + ": can not find spawned RaidBoss id=" + ICICLE_EMPEROR_BUMBALUMP);
break;
-
+ }
case ALIVE:
+ {
spawnNpc();
// fallthrough
-
+ }
case DEAD:
+ {
startQuestTimer("check", CHECK_INTERVAL, null, null, true);
break;
+ }
}
}
@@ -113,58 +110,60 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
return htmltext;
}
- // Jeremy
- if (event.equals("31521-03.htm"))
+ switch (event)
{
- if (st.hasQuestItems(SOY_SAUCE_JAR))
+ case "31521-03.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.takeItems(SOY_SAUCE_JAR, 1);
- st.giveItems(FOOD_FOR_BUMBALUMP, 1);
- }
- else
- {
- htmltext = "31521-04.htm";
- }
- }
- else if (event.equals("31521-08.htm"))
- {
- if (st.hasQuestItems(SPECIAL_YETI_MEAT))
- {
- st.takeItems(SPECIAL_YETI_MEAT, 1);
- st.rewardItems(REWARD_DYE[Rnd.get(REWARD_DYE.length)], 5);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else
- {
- htmltext = "31521-09.htm";
- }
- }
- // Yeti's Table
- else if (event.equals("31542-02.htm"))
- {
- if (st.hasQuestItems(FOOD_FOR_BUMBALUMP))
- {
- if (_status < 0)
+ if (st.hasQuestItems(SOY_SAUCE_JAR))
{
- if (spawnRaid())
+ st.startQuest();
+ st.takeItems(SOY_SAUCE_JAR, 1);
+ st.giveItems(FOOD_FOR_BUMBALUMP, 1);
+ }
+ else
+ {
+ htmltext = "31521-04.htm";
+ }
+ break;
+ }
+ case "31521-08.htm":
+ {
+ if (st.hasQuestItems(SPECIAL_YETI_MEAT))
+ {
+ st.takeItems(SPECIAL_YETI_MEAT, 1);
+ st.rewardItems(REWARD_DYE[Rnd.get(REWARD_DYE.length)], 5);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "31521-09.htm";
+ }
+ break;
+ }
+ case "31542-02.htm":
+ {
+ if (st.hasQuestItems(FOOD_FOR_BUMBALUMP))
+ {
+ if (_status < 0)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(FOOD_FOR_BUMBALUMP, 1);
+ if (spawnRaid())
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(FOOD_FOR_BUMBALUMP, 1);
+ }
+ }
+ else
+ {
+ htmltext = "31542-04.htm";
}
}
else
{
- htmltext = "31542-04.htm";
+ htmltext = "31542-03.htm";
}
- }
- else
- {
- htmltext = "31542-03.htm";
+ break;
}
}
@@ -184,14 +183,17 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 73) ? "31521-02.htm" : "31521-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case JEREMY:
+ {
if (cond == 1)
{
htmltext = "31521-05.htm";
@@ -205,8 +207,9 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
htmltext = "31521-07.htm";
}
break;
-
+ }
case YETI_TABLE:
+ {
if (cond == 1)
{
htmltext = "31542-01.htm";
@@ -216,8 +219,10 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
htmltext = "31542-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -233,7 +238,7 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "2"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 2))
{
final QuestState st = partyMember.getQuestState(getName());
if (st == null)
@@ -241,7 +246,7 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
continue;
}
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SPECIAL_YETI_MEAT, 1);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q626_ADarkTwilight/Q626_ADarkTwilight.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q626_ADarkTwilight/Q626_ADarkTwilight.java
index 4c52f725d3..22631a5b77 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q626_ADarkTwilight/Q626_ADarkTwilight.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q626_ADarkTwilight/Q626_ADarkTwilight.java
@@ -27,12 +27,10 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q626_ADarkTwilight extends Quest
{
- // Items
- private static final int BLOOD_OF_SAINT = 7169;
-
// NPC
private static final int HIERARCH = 31517;
-
+ // Items
+ private static final int BLOOD_OF_SAINT = 7169;
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -56,16 +54,10 @@ public class Q626_ADarkTwilight extends Quest
public Q626_ADarkTwilight()
{
super(626, "A Dark Twilight");
-
registerQuestItems(BLOOD_OF_SAINT);
-
addStartNpc(HIERARCH);
addTalkId(HIERARCH);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -78,40 +70,44 @@ public class Q626_ADarkTwilight extends Quest
return htmltext;
}
- if (event.equals("31517-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("reward1"))
- {
- if (st.getQuestItemsCount(BLOOD_OF_SAINT) == 300)
+ case "31517-03.htm":
{
- htmltext = "31517-07.htm";
- st.takeItems(BLOOD_OF_SAINT, 300);
- st.rewardExpAndSp(162773, 12500);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.startQuest();
+ break;
}
- else
+ case "reward1":
{
- htmltext = "31517-08.htm";
+ if (st.getQuestItemsCount(BLOOD_OF_SAINT) == 300)
+ {
+ htmltext = "31517-07.htm";
+ st.takeItems(BLOOD_OF_SAINT, 300);
+ st.rewardExpAndSp(162773, 12500);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "31517-08.htm";
+ }
+ break;
}
- }
- else if (event.equals("reward2"))
- {
- if (st.getQuestItemsCount(BLOOD_OF_SAINT) == 300)
+ case "reward2":
{
- htmltext = "31517-07.htm";
- st.takeItems(BLOOD_OF_SAINT, 300);
- st.rewardItems(57, 100000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = "31517-08.htm";
+ if (st.getQuestItemsCount(BLOOD_OF_SAINT) == 300)
+ {
+ htmltext = "31517-07.htm";
+ st.takeItems(BLOOD_OF_SAINT, 300);
+ st.rewardItems(57, 100000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "31517-08.htm";
+ }
+ break;
}
}
return htmltext;
@@ -130,11 +126,13 @@ public class Q626_ADarkTwilight extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "31517-02.htm" : "31517-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31517-05.htm";
@@ -144,10 +142,12 @@ public class Q626_ADarkTwilight extends Quest
htmltext = "31517-04.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -156,7 +156,7 @@ public class Q626_ADarkTwilight extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -164,7 +164,7 @@ public class Q626_ADarkTwilight extends Quest
if (st.dropItems(BLOOD_OF_SAINT, 1, 300, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q627_HeartInSearchOfPower/Q627_HeartInSearchOfPower.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q627_HeartInSearchOfPower/Q627_HeartInSearchOfPower.java
index 19f990d02a..4575014a8d 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q627_HeartInSearchOfPower/Q627_HeartInSearchOfPower.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q627_HeartInSearchOfPower/Q627_HeartInSearchOfPower.java
@@ -30,12 +30,10 @@ public class Q627_HeartInSearchOfPower extends Quest
// NPCs
private static final int NECROMANCER = 31518;
private static final int ENFEUX = 31519;
-
// Items
private static final int SEAL_OF_LIGHT = 7170;
private static final int BEAD_OF_OBEDIENCE = 7171;
private static final int GEM_OF_SAINTS = 7172;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -55,56 +53,26 @@ public class Q627_HeartInSearchOfPower extends Quest
CHANCES.put(21540, 762000);
CHANCES.put(21658, 690000);
}
-
// Rewards
private static final Map REWARDS = new HashMap<>();
static
{
- REWARDS.put("adena", new int[]
- {
- 0,
- 0,
- 100000
- });
- REWARDS.put("asofe", new int[]
- {
- 4043,
- 13,
- 6400
- });
- REWARDS.put("thon", new int[]
- {
- 4044,
- 13,
- 6400
- });
- REWARDS.put("enria", new int[]
- {
- 4042,
- 6,
- 13600
- });
- REWARDS.put("mold", new int[]
- {
- 4041,
- 3,
- 17200
- });
+ // @formatter:off
+ REWARDS.put("adena", new int[]{0, 0, 100000});
+ REWARDS.put("asofe", new int[]{4043, 13, 6400});
+ REWARDS.put("thon", new int[]{4044, 13, 6400});
+ REWARDS.put("enria", new int[]{4042, 6, 13600});
+ REWARDS.put("mold", new int[]{4041, 3, 17200});
+ // @formatter:on
}
public Q627_HeartInSearchOfPower()
{
super(627, "Heart in Search of Power");
-
registerQuestItems(BEAD_OF_OBEDIENCE);
-
addStartNpc(NECROMANCER);
addTalkId(NECROMANCER, ENFEUX);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -119,31 +87,29 @@ public class Q627_HeartInSearchOfPower extends Quest
if (event.equals("31518-01.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31518-03.htm"))
{
if (st.getQuestItemsCount(BEAD_OF_OBEDIENCE) == 300)
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BEAD_OF_OBEDIENCE, -1);
st.giveItems(SEAL_OF_LIGHT, 1);
}
else
{
- htmltext = "31518-03a.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.takeItems(BEAD_OF_OBEDIENCE, -1);
+ htmltext = "31518-03a.htm";
}
}
else if (event.equals("31519-01.htm"))
{
if (st.getQuestItemsCount(SEAL_OF_LIGHT) == 1)
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SEAL_OF_LIGHT, 1);
st.giveItems(GEM_OF_SAINTS, 1);
@@ -187,14 +153,17 @@ public class Q627_HeartInSearchOfPower extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "31518-00a.htm" : "31518-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NECROMANCER:
+ {
if (cond == 1)
{
htmltext = "31518-01a.htm";
@@ -212,8 +181,9 @@ public class Q627_HeartInSearchOfPower extends Quest
htmltext = "31518-05.htm";
}
break;
-
+ }
case ENFEUX:
+ {
if (cond == 3)
{
htmltext = "31519-00.htm";
@@ -223,8 +193,10 @@ public class Q627_HeartInSearchOfPower extends Quest
htmltext = "31519-02.htm";
}
break;
+ }
}
break;
+ }
}
@@ -234,7 +206,7 @@ public class Q627_HeartInSearchOfPower extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -242,7 +214,7 @@ public class Q627_HeartInSearchOfPower extends Quest
if (st.dropItems(BEAD_OF_OBEDIENCE, 1, 300, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q628_HuntOfTheGoldenRamMercenaryForce/Q628_HuntOfTheGoldenRamMercenaryForce.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q628_HuntOfTheGoldenRamMercenaryForce/Q628_HuntOfTheGoldenRamMercenaryForce.java
index 2c796486bf..995ae34432 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q628_HuntOfTheGoldenRamMercenaryForce/Q628_HuntOfTheGoldenRamMercenaryForce.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q628_HuntOfTheGoldenRamMercenaryForce/Q628_HuntOfTheGoldenRamMercenaryForce.java
@@ -29,13 +29,11 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
{
// NPCs
private static final int KAHMAN = 31554;
-
// Items
private static final int SPLINTER_STAKATO_CHITIN = 7248;
private static final int NEEDLE_STAKATO_CHITIN = 7249;
private static final int GOLDEN_RAM_BADGE_RECRUIT = 7246;
private static final int GOLDEN_RAM_BADGE_SOLDIER = 7247;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -55,16 +53,10 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
public Q628_HuntOfTheGoldenRamMercenaryForce()
{
super(628, "Hunt of the Golden Ram Mercenary Force");
-
registerQuestItems(SPLINTER_STAKATO_CHITIN, NEEDLE_STAKATO_CHITIN, GOLDEN_RAM_BADGE_RECRUIT, GOLDEN_RAM_BADGE_SOLDIER);
-
addStartNpc(KAHMAN);
addTalkId(KAHMAN);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -77,27 +69,31 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
return htmltext;
}
- if (event.equals("31554-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31554-03a.htm"))
- {
- if ((st.getQuestItemsCount(SPLINTER_STAKATO_CHITIN) >= 100) && (st.getInt("cond") == 1)) // Giving GOLDEN_RAM_BADGE_RECRUIT Medals
+ case "31554-02.htm":
{
- htmltext = "31554-04.htm";
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPLINTER_STAKATO_CHITIN, -1);
- st.giveItems(GOLDEN_RAM_BADGE_RECRUIT, 1);
+ st.startQuest();
+ break;
+ }
+ case "31554-03a.htm":
+ {
+ if ((st.getQuestItemsCount(SPLINTER_STAKATO_CHITIN) >= 100) && st.isCond(1)) // Giving GOLDEN_RAM_BADGE_RECRUIT Medals
+ {
+ htmltext = "31554-04.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPLINTER_STAKATO_CHITIN, -1);
+ st.giveItems(GOLDEN_RAM_BADGE_RECRUIT, 1);
+ }
+ break;
+ }
+ case "31554-07.htm":
+ {
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("31554-07.htm")) // Cancel Quest
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
}
return htmltext;
@@ -116,11 +112,13 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 66) ? "31554-01a.htm" : "31554-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
if (st.getQuestItemsCount(SPLINTER_STAKATO_CHITIN) >= 100)
@@ -137,7 +135,7 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
if ((st.getQuestItemsCount(SPLINTER_STAKATO_CHITIN) >= 100) && (st.getQuestItemsCount(NEEDLE_STAKATO_CHITIN) >= 100))
{
htmltext = "31554-05.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_FINISH);
st.takeItems(SPLINTER_STAKATO_CHITIN, -1);
st.takeItems(NEEDLE_STAKATO_CHITIN, -1);
@@ -158,6 +156,7 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
htmltext = "31554-05a.htm";
}
break;
+ }
}
return htmltext;
@@ -178,9 +177,8 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case 21508:
@@ -188,22 +186,25 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
case 21510:
case 21511:
case 21512:
+ {
if ((cond == 1) || (cond == 2))
{
st.dropItems(SPLINTER_STAKATO_CHITIN, 1, 100, CHANCES.get(npcId));
}
break;
-
+ }
case 21513:
case 21514:
case 21515:
case 21516:
case 21517:
+ {
if (cond == 2)
{
st.dropItems(NEEDLE_STAKATO_CHITIN, 1, 100, CHANCES.get(npcId));
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q629_CleanUpTheSwampOfScreams/Q629_CleanUpTheSwampOfScreams.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q629_CleanUpTheSwampOfScreams/Q629_CleanUpTheSwampOfScreams.java
index 33d81ae5f7..40e95329d7 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q629_CleanUpTheSwampOfScreams/Q629_CleanUpTheSwampOfScreams.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q629_CleanUpTheSwampOfScreams/Q629_CleanUpTheSwampOfScreams.java
@@ -29,11 +29,9 @@ public class Q629_CleanUpTheSwampOfScreams extends Quest
{
// NPC
private static final int PIERCE = 31553;
-
- // ITEMS
+ // Items
private static final int TALON_OF_STAKATO = 7250;
private static final int GOLDEN_RAM_COIN = 7251;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -53,16 +51,10 @@ public class Q629_CleanUpTheSwampOfScreams extends Quest
public Q629_CleanUpTheSwampOfScreams()
{
super(629, "Clean up the Swamp of Screams");
-
registerQuestItems(TALON_OF_STAKATO, GOLDEN_RAM_COIN);
-
addStartNpc(PIERCE);
addTalkId(PIERCE);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -75,37 +67,41 @@ public class Q629_CleanUpTheSwampOfScreams extends Quest
return htmltext;
}
- if (event.equals("31553-1.htm"))
+ switch (event)
{
- if (player.getLevel() >= 66)
+ case "31553-1.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ if (player.getLevel() >= 66)
+ {
+ st.startQuest();
+ }
+ else
+ {
+ htmltext = "31553-0a.htm";
+ st.exitQuest(true);
+ }
+ break;
}
- else
+ case "31553-3.htm":
{
- htmltext = "31553-0a.htm";
+ if (st.getQuestItemsCount(TALON_OF_STAKATO) >= 100)
+ {
+ st.takeItems(TALON_OF_STAKATO, 100);
+ st.giveItems(GOLDEN_RAM_COIN, 20);
+ }
+ else
+ {
+ htmltext = "31553-3a.htm";
+ }
+ break;
+ }
+ case "31553-5.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
+ break;
}
}
- else if (event.equals("31553-3.htm"))
- {
- if (st.getQuestItemsCount(TALON_OF_STAKATO) >= 100)
- {
- st.takeItems(TALON_OF_STAKATO, 100);
- st.giveItems(GOLDEN_RAM_COIN, 20);
- }
- else
- {
- htmltext = "31553-3a.htm";
- }
- }
- else if (event.equals("31553-5.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
return htmltext;
}
@@ -128,12 +124,15 @@ public class Q629_CleanUpTheSwampOfScreams extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 66) ? "31553-0a.htm" : "31553-0.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(TALON_OF_STAKATO) >= 100) ? "31553-2.htm" : "31553-1a.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q631_DeliciousTopChoiceMeat/Q631_DeliciousTopChoiceMeat.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q631_DeliciousTopChoiceMeat/Q631_DeliciousTopChoiceMeat.java
index 3a938bc5a6..a2ae60a276 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q631_DeliciousTopChoiceMeat/Q631_DeliciousTopChoiceMeat.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q631_DeliciousTopChoiceMeat/Q631_DeliciousTopChoiceMeat.java
@@ -30,10 +30,8 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
{
// NPC
private static final int TUNATUN = 31537;
-
// Item
private static final int TOP_QUALITY_MEAT = 7546;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -63,49 +61,26 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
CHANCES.put(21504, 509000);
CHANCES.put(21505, 920000);
}
-
// Rewards
private static final int[][] REWARDS =
{
- {
- 4039,
- 15
- },
- {
- 4043,
- 15
- },
- {
- 4044,
- 15
- },
- {
- 4040,
- 10
- },
- {
- 4042,
- 10
- },
- {
- 4041,
- 5
- }
+ // @formatter:off
+ {4039, 15},
+ {4043, 15},
+ {4044, 15},
+ {4040, 10},
+ {4042, 10},
+ {4041, 5}
+ // @formatter:on
};
public Q631_DeliciousTopChoiceMeat()
{
super(631, "Delicious Top Choice Meat");
-
registerQuestItems(TOP_QUALITY_MEAT);
-
addStartNpc(TUNATUN);
addTalkId(TUNATUN);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -122,9 +97,7 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
{
if (player.getLevel() >= 65)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else
{
@@ -147,7 +120,7 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
}
else
{
- st.set("cond", "1");
+ st.setCond(1);
htmltext = "31537-07.htm";
}
}
@@ -168,11 +141,13 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "31537-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31537-03a.htm";
@@ -185,11 +160,12 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
}
else
{
- st.set("cond", "1");
+ st.setCond(1);
htmltext = "31537-03a.htm";
}
}
break;
+ }
}
return htmltext;
@@ -198,7 +174,7 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -212,7 +188,7 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
if (st.dropItems(TOP_QUALITY_MEAT, 1, 120, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q632_NecromancersRequest/Q632_NecromancersRequest.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q632_NecromancersRequest/Q632_NecromancersRequest.java
index c41d58bc17..d00e1b7b50 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q632_NecromancersRequest/Q632_NecromancersRequest.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q632_NecromancersRequest/Q632_NecromancersRequest.java
@@ -42,7 +42,6 @@ public class Q632_NecromancersRequest extends Quest
21594,
21595
};
-
private static final int[] UNDEADS =
{
21547,
@@ -58,7 +57,6 @@ public class Q632_NecromancersRequest extends Quest
21577,
21579
};
-
// Items
private static final int VAMPIRE_HEART = 7542;
private static final int ZOMBIE_BRAIN = 7543;
@@ -66,12 +64,9 @@ public class Q632_NecromancersRequest extends Quest
public Q632_NecromancersRequest()
{
super(632, "Necromancer's Request");
-
registerQuestItems(VAMPIRE_HEART, ZOMBIE_BRAIN);
-
addStartNpc(31522); // Mysterious Wizard
addTalkId(31522);
-
addKillId(VAMPIRES);
addKillId(UNDEADS);
}
@@ -88,15 +83,13 @@ public class Q632_NecromancersRequest extends Quest
if (event.equals("31522-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31522-06.htm"))
{
if (st.getQuestItemsCount(VAMPIRE_HEART) >= 200)
{
- st.set("cond", "1");
+ st.setCond(1);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(VAMPIRE_HEART, -1);
st.rewardItems(57, 120000);
@@ -128,12 +121,15 @@ public class Q632_NecromancersRequest extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 63) ? "31522-01.htm" : "31522-02.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(VAMPIRE_HEART) >= 200) ? "31522-05.htm" : "31522-04.htm";
break;
+ }
}
return htmltext;
@@ -163,9 +159,9 @@ public class Q632_NecromancersRequest extends Quest
}
}
- if ((st.getInt("cond") == 1) && st.dropItems(VAMPIRE_HEART, 1, 200, 500000))
+ if (st.isCond(1) && st.dropItems(VAMPIRE_HEART, 1, 200, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q633_InTheForgottenVillage/Q633_InTheForgottenVillage.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q633_InTheForgottenVillage/Q633_InTheForgottenVillage.java
index c2911f9f2f..f33b62bc85 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q633_InTheForgottenVillage/Q633_InTheForgottenVillage.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q633_InTheForgottenVillage/Q633_InTheForgottenVillage.java
@@ -27,14 +27,12 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q633_InTheForgottenVillage extends Quest
{
- // NPCS
+ // NPCs
private static final int MINA = 31388;
-
- // ITEMS
+ // Items
private static final int RIB_BONE = 7544;
private static final int ZOMBIE_LIVER = 7545;
-
- // MOBS / DROP chances
+ // Monsters / Drop chances
private static final Map MOBS = new HashMap<>();
static
{
@@ -55,7 +53,6 @@ public class Q633_InTheForgottenVillage extends Quest
MOBS.put(21583, 397000); // Bone Scavenger
MOBS.put(21584, 401000); // Bone Scavenger
}
-
private static final Map UNDEADS = new HashMap<>();
static
{
@@ -74,21 +71,11 @@ public class Q633_InTheForgottenVillage extends Quest
public Q633_InTheForgottenVillage()
{
super(633, "In the Forgotten Village");
-
registerQuestItems(RIB_BONE, ZOMBIE_LIVER);
-
addStartNpc(MINA);
addTalkId(MINA);
-
- for (int i : MOBS.keySet())
- {
- addKillId(i);
- }
-
- for (int i : UNDEADS.keySet())
- {
- addKillId(i);
- }
+ addKillId(MOBS.keySet());
+ addKillId(UNDEADS.keySet());
}
@Override
@@ -101,29 +88,33 @@ public class Q633_InTheForgottenVillage extends Quest
return htmltext;
}
- if (event.equals("31388-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31388-10.htm"))
- {
- st.takeItems(RIB_BONE, -1);
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
- }
- else if (event.equals("31388-09.htm"))
- {
- if (st.getQuestItemsCount(RIB_BONE) >= 200)
+ case "31388-04.htm":
{
- htmltext = "31388-08.htm";
- st.takeItems(RIB_BONE, 200);
- st.rewardItems(57, 25000);
- st.rewardExpAndSp(305235, 0);
- st.playSound(QuestState.SOUND_FINISH);
+ st.startQuest();
+ break;
+ }
+ case "31388-10.htm":
+ {
+ st.takeItems(RIB_BONE, -1);
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
+ }
+ case "31388-09.htm":
+ {
+ if (st.getQuestItemsCount(RIB_BONE) >= 200)
+ {
+ htmltext = "31388-08.htm";
+ st.takeItems(RIB_BONE, 200);
+ st.rewardItems(57, 25000);
+ st.rewardExpAndSp(305235, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ }
+ st.setCond(1);
+ break;
}
- st.set("cond", "1");
}
return htmltext;
@@ -142,11 +133,13 @@ public class Q633_InTheForgottenVillage extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 65) ? "31388-03.htm" : "31388-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31388-06.htm";
@@ -156,6 +149,7 @@ public class Q633_InTheForgottenVillage extends Quest
htmltext = "31388-05.htm";
}
break;
+ }
}
return htmltext;
@@ -177,7 +171,7 @@ public class Q633_InTheForgottenVillage extends Quest
}
else if (MOBS.containsKey(npcId))
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -191,7 +185,7 @@ public class Q633_InTheForgottenVillage extends Quest
if (st.dropItems(RIB_BONE, 1, 200, MOBS.get(npcId)))
{
- st.set("cond", "2");
+ st.setCond(2);
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q634_InSearchOfFragmentsOfDimension/Q634_InSearchOfFragmentsOfDimension.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q634_InSearchOfFragmentsOfDimension/Q634_InSearchOfFragmentsOfDimension.java
index e150f42186..909f6ce4d3 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q634_InSearchOfFragmentsOfDimension/Q634_InSearchOfFragmentsOfDimension.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q634_InSearchOfFragmentsOfDimension/Q634_InSearchOfFragmentsOfDimension.java
@@ -57,9 +57,7 @@ public class Q634_InSearchOfFragmentsOfDimension extends Quest
if (event.equals("02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("05.htm"))
{
@@ -83,12 +81,15 @@ public class Q634_InSearchOfFragmentsOfDimension extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "01a.htm" : "01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = "03.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q635_InTheDimensionalRift/Q635_InTheDimensionalRift.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q635_InTheDimensionalRift/Q635_InTheDimensionalRift.java
index ac29c8d6a2..07fc09d150 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q635_InTheDimensionalRift/Q635_InTheDimensionalRift.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/Q635_InTheDimensionalRift/Q635_InTheDimensionalRift.java
@@ -55,7 +55,6 @@ public class Q635_InTheDimensionalRift extends Quest
public Q635_InTheDimensionalRift()
{
super(635, "In the Dimensional Rift");
-
for (int i = 31494; i <= 31508; i++)
{
addTalkId(i);
@@ -89,7 +88,7 @@ public class Q635_InTheDimensionalRift extends Quest
}
qs.set("count", "" + (count + 1));
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
qs.getPlayer().teleToLocation(-114790, -180576, -6781);
}
else
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/SagasSuperClass.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/SagasSuperClass.java
index 828cb2db32..b7e32f3069 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/SagasSuperClass.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/quests/SagasSuperClass.java
@@ -238,9 +238,7 @@ public class SagasSuperClass extends Quest
}
else if (event.equals("accept"))
{
- st.set("cond", "1");
- st.setState(State.STARTED);
- st.playSound("ItemSound.quest_accept");
+ st.startQuest();
st.giveItems(_items[10], 1);
htmltext = "0-03.htm";
}
@@ -263,8 +261,8 @@ public class SagasSuperClass extends Quest
{
if (player.getLevel() >= 76)
{
+ st.setCond(0);
st.exitQuest(false);
- st.set("cond", "0");
htmltext = "0-07.htm";
st.takeItems(_items[10], -1);
st.rewardExpAndSp(2299404, 0);
@@ -290,19 +288,19 @@ public class SagasSuperClass extends Quest
else
{
st.takeItems(_items[10], -1);
- st.playSound("ItemSound.quest_middle");
- st.set("cond", "20");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.setCond(20);
htmltext = "0-08.htm";
}
}
else if (event.equals("1-3"))
{
- st.set("cond", "3");
+ st.setCond(3);
htmltext = "1-05.htm";
}
else if (event.equals("1-4"))
{
- st.set("cond", "4");
+ st.setCond(4);
st.takeItems(_items[0], 1);
if (_items[11] != 0)
{
@@ -313,12 +311,12 @@ public class SagasSuperClass extends Quest
}
else if (event.equals("2-1"))
{
- st.set("cond", "2");
+ st.setCond(2);
htmltext = "2-05.htm";
}
else if (event.equals("2-2"))
{
- st.set("cond", "5");
+ st.setCond(5);
st.takeItems(_items[1], 1);
st.giveItems(_items[4], 1);
htmltext = "2-06.htm";
@@ -329,17 +327,17 @@ public class SagasSuperClass extends Quest
}
else if (event.equals("3-6"))
{
- st.set("cond", "11");
+ st.setCond(11);
htmltext = "3-02.htm";
}
else if (event.equals("3-7"))
{
- st.set("cond", "12");
+ st.setCond(12);
htmltext = "3-03.htm";
}
else if (event.equals("3-8"))
{
- st.set("cond", "13");
+ st.setCond(13);
st.takeItems(_items[2], 1);
st.giveItems(_items[7], 1);
htmltext = "3-08.htm";
@@ -351,35 +349,35 @@ public class SagasSuperClass extends Quest
else if (event.equals("4-2"))
{
st.giveItems(_items[9], 1);
- st.set("cond", "18");
- st.playSound("ItemSound.quest_middle");
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "4-011.htm";
}
else if (event.equals("4-3"))
{
st.giveItems(_items[9], 1);
- st.set("cond", "18");
+ st.setCond(18);
npc.broadcastNpcSay(_text[13].replace("PLAYERNAME", player.getName()));
st.set("Quest0", "0");
cancelQuestTimer("Mob_2 has despawned", npc, player);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
deleteSpawn(npc);
return null;
}
else if (event.equals("5-1"))
{
- st.set("cond", "6");
+ st.setCond(6);
st.takeItems(_items[4], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "5-02.htm";
}
else if (event.equals("6-1"))
{
- st.set("cond", "8");
+ st.setCond(8);
st.takeItems(_items[5], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "6-03.htm";
}
else if (event.equals("7-1"))
@@ -404,26 +402,26 @@ public class SagasSuperClass extends Quest
}
else if (event.equals("7-2"))
{
- st.set("cond", "10");
+ st.setCond(10);
st.takeItems(_items[6], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "7-06.htm";
}
else if (event.equals("8-1"))
{
- st.set("cond", "14");
+ st.setCond(14);
st.takeItems(_items[7], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "8-02.htm";
}
else if (event.equals("9-1"))
{
- st.set("cond", "17");
+ st.setCond(17);
st.takeItems(_items[8], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "9-03.htm";
}
else if (event.equals("10-1"))
@@ -454,15 +452,15 @@ public class SagasSuperClass extends Quest
}
else if (event.equals("10-2"))
{
- st.set("cond", "19");
+ st.setCond(19);
st.takeItems(_items[9], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "10-06.htm";
}
else if (event.equals("11-9"))
{
- st.set("cond", "15");
+ st.setCond(15);
htmltext = "11-03.htm";
}
else if (event.equals("Mob_1 Timer 1"))
@@ -580,7 +578,7 @@ public class SagasSuperClass extends Quest
}
else if (st.getPlayer().getClassId().getId() == getPrevClass(st.getPlayer()))
{
- switch (st.getInt("cond"))
+ switch (st.getCond())
{
case 0:
{
@@ -803,8 +801,8 @@ public class SagasSuperClass extends Quest
htmltext = "0-09.htm";
if ((getClassId(st.getPlayer()) < 131) || (getClassId(st.getPlayer()) > 135)) // in Kamael quests, npc wants to chat for a bit before changing class
{
+ st.setCond(0);
st.exitQuest(false);
- st.set("cond", "0");
st.rewardExpAndSp(2299404, 0);
st.giveItems(57, 5000000);
st.giveItems(6622, 1);
@@ -847,7 +845,7 @@ public class SagasSuperClass extends Quest
final int npcId = npc.getNpcId();
if (st != null)
{
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (npcId == _npc[4])
{
if (cond == 17)
@@ -925,7 +923,8 @@ public class SagasSuperClass extends Quest
{
return super.onAttack(npc, player, damage, isPet);
}
- final int cond = st2.getInt("cond");
+
+ final int cond = st2.getCond();
final QuestState st = player.getQuestState(getName());
final int npcId = npc.getNpcId();
if ((npcId == _mob[2]) && (st == st2) && (cond == 17))
@@ -987,10 +986,9 @@ public class SagasSuperClass extends Quest
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
final int npcId = npc.getNpcId();
- QuestState st = player.getQuestState(getName());
- for (int Archon_Minion = 21646; Archon_Minion < 21652; Archon_Minion++)
+ for (int archonMinion = 21646; archonMinion < 21652; archonMinion++)
{
- if (npcId == Archon_Minion)
+ if (npcId == archonMinion)
{
final Party party = player.getParty();
if (party != null)
@@ -999,7 +997,7 @@ public class SagasSuperClass extends Quest
for (PlayerInstance player1 : party.getPartyMembers())
{
final QuestState st1 = findQuest(player1);
- if ((st1 != null) && (st1.getInt("cond") == 15))
+ if ((st1 != null) && st1.isCond(15))
{
partyQuestMembers.add(st1);
}
@@ -1013,7 +1011,7 @@ public class SagasSuperClass extends Quest
else
{
final QuestState st1 = findQuest(player);
- if ((st1 != null) && (st1.getInt("cond") == 15))
+ if ((st1 != null) && st1.isCond(15))
{
giveHallishaMark(st1);
}
@@ -1027,14 +1025,14 @@ public class SagasSuperClass extends Quest
if (npcId == element)
{
final QuestState st1 = findQuest(player);
- if ((st1 != null) && (st1.getInt("cond") == 15))
+ if ((st1 != null) && st1.isCond(15))
{
// This is just a guess....not really sure what it actually says, if anything
npc.broadcastNpcSay(_text[4].replace("PLAYERNAME", st1.getPlayer().getName()));
st1.giveItems(_items[8], 1);
st1.takeItems(_items[3], -1);
- st1.set("cond", "16");
- st1.playSound("ItemSound.quest_middle");
+ st1.setCond(16);
+ st1.playSound(QuestState.SOUND_MIDDLE);
}
return super.onKill(npc, player, isPet);
}
@@ -1045,7 +1043,7 @@ public class SagasSuperClass extends Quest
if (npcId == guardianAngel)
{
final QuestState st1 = findQuest(player);
- if ((st1 != null) && (st1.getInt("cond") == 6))
+ if ((st1 != null) && st1.isCond(6))
{
if (st1.getInt("kills") < 9)
{
@@ -1053,14 +1051,16 @@ public class SagasSuperClass extends Quest
}
else
{
- st1.playSound("ItemSound.quest_middle");
+ st1.playSound(QuestState.SOUND_MIDDLE);
st1.giveItems(_items[5], 1);
- st1.set("cond", "7");
+ st1.setCond(7);
}
}
return super.onKill(npc, player, isPet);
}
}
+
+ QuestState st = player.getQuestState(getName());
if ((st != null) && (npcId != _mob[2]))
{
final QuestState st2 = findRightState(npc);
@@ -1068,21 +1068,20 @@ public class SagasSuperClass extends Quest
{
return super.onKill(npc, player, isPet);
}
- final int cond = st.getInt("cond");
- if ((npcId == _mob[0]) && (cond == 8))
+ if ((npcId == _mob[0]) && st.isCond(8))
{
if (!player.isInParty() && (st == st2))
{
npc.broadcastNpcSay(_text[12].replace("PLAYERNAME", player.getName()));
st.giveItems(_items[6], 1);
- st.set("cond", "9");
- st.playSound("ItemSound.quest_middle");
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
}
cancelQuestTimer("Mob_1 has despawned", npc, st2.getPlayer());
st2.set("spawned", "0");
deleteSpawn(npc);
}
- else if ((npcId == _mob[1]) && (cond == 15))
+ else if ((npcId == _mob[1]) && st.isCond(15))
{
if (!player.isInParty())
{
@@ -1091,8 +1090,8 @@ public class SagasSuperClass extends Quest
npc.broadcastNpcSay(_text[4].replace("PLAYERNAME", player.getName()));
st.giveItems(_items[8], 1);
st.takeItems(_items[3], -1);
- st.set("cond", "16");
- st.playSound("ItemSound.quest_middle");
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
}
else
{
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/IdManager.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
index a81f44e60d..4cc2541beb 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
@@ -39,7 +39,7 @@ public class IdManager
{
private static final Logger LOGGER = Logger.getLogger(IdManager.class.getName());
- //@formatter:off
+ // @formatter:off
private static final String[][] ID_EXTRACTS =
{
{"characters","charId"},
@@ -47,7 +47,7 @@ public class IdManager
{"clan_data","clan_id"},
{"itemsonground","object_id"}
};
- //@formatter:on
+ // @formatter:on
private static final String[] TIMESTAMPS_CLEAN =
{
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java
index 1f8a2a58ca..223d9fcaa8 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java
@@ -1409,7 +1409,7 @@ public class NpcInstance extends Creature
final QuestState qs = player.getQuestState(q.getName());
if (qs != null)
{
- if (qs.isStarted() && (qs.getInt("cond") > 0))
+ if (qs.getCond() > 0)
{
state = " (In Progress)";
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/Quest.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/Quest.java
index aae93fcea3..f40ea0e7bd 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/Quest.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/Quest.java
@@ -1242,11 +1242,10 @@ public class Quest extends ManagedScript
* Auxiliary function for party quests. Checks the player's condition. Player member must be within Config.PARTY_RANGE distance from the npc. If npc is null, distance condition is ignored.
* @param player : the instance of a player whose party is to be searched
* @param npc : the instance of a Npc to compare distance
- * @param var : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
- * @param value : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
+ * @param cond : an integer specifying a quest condition that must be satisfied for a party member to be considered.
* @return QuestState : The QuestState of that player.
*/
- public QuestState checkPlayerCondition(PlayerInstance player, NpcInstance npc, String var, String value)
+ public QuestState checkPlayerCondition(PlayerInstance player, NpcInstance npc, int cond)
{
// No valid player or npc instance is passed, there is nothing to check.
if ((player == null) || (npc == null))
@@ -1261,8 +1260,8 @@ public class Quest extends ManagedScript
return null;
}
- // Condition exists? Condition has correct value?
- if ((qs.get(var) == null) || !value.equalsIgnoreCase(qs.get(var).toString()))
+ // Condition has correct value?
+ if (!qs.isCond(cond))
{
return null;
}
@@ -1347,12 +1346,11 @@ public class Quest extends ManagedScript
* Auxiliary function for party quests. Note: This function is only here because of how commonly it may be used by quest developers. For any variations on this function, the quest script can always handle things on its own
* @param player : the instance of a player whose party is to be searched
* @param npc : the instance of a Npc to compare distance
- * @param var : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
- * @param value : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
+ * @param cond : an integer specifying a quest condition that must be satisfied for a party member to be considered.
* @return List : List of party members that matches the specified condition, empty list if none matches. If the var is null, empty list is returned (i.e. no condition is applied). The party member must be within Config.PARTY_RANGE distance from the npc. If npc is null, distance
* condition is ignored.
*/
- public List getPartyMembers(PlayerInstance player, NpcInstance npc, String var, String value)
+ public List getPartyMembers(PlayerInstance player, NpcInstance npc, int cond)
{
if (player == null)
{
@@ -1362,13 +1360,13 @@ public class Quest extends ManagedScript
final Party party = player.getParty();
if (party == null)
{
- return (checkPlayerCondition(player, npc, var, value) != null) ? Arrays.asList(player) : Collections.emptyList();
+ return (checkPlayerCondition(player, npc, cond) != null) ? Arrays.asList(player) : Collections.emptyList();
}
final List result = new ArrayList<>();
for (PlayerInstance member : party.getPartyMembers())
{
- if (checkPlayerCondition(member, npc, var, value) != null)
+ if (checkPlayerCondition(member, npc, cond) != null)
{
result.add(member);
}
@@ -1381,11 +1379,10 @@ public class Quest extends ManagedScript
* Auxiliary function for party quests. Note: This function is only here because of how commonly it may be used by quest developers. For any variations on this function, the quest script can always handle things on its own
* @param player : the instance of a player whose party is to be searched
* @param npc : the instance of a Npc to compare distance
- * @param var : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
- * @param value : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
- * @return Player : Player for a random party member that matches the specified condition, or null if no match. If the var is null, null is returned (i.e. no condition is applied). The party member must be within 1500 distance from the npc. If npc is null, distance condition is ignored.
+ * @param cond : an integer specifying a quest condition that must be satisfied for a party member to be considered.
+ * @return Player : Player for a random party member that matches the specified condition, or null if no match. If the cond is null, null is returned (i.e. no condition is applied). The party member must be within 1500 distance from the npc. If npc is null, distance condition is ignored.
*/
- public PlayerInstance getRandomPartyMember(PlayerInstance player, NpcInstance npc, String var, String value)
+ public PlayerInstance getRandomPartyMember(PlayerInstance player, NpcInstance npc, int cond)
{
// No valid player instance is passed, there is nothing to check.
if (player == null)
@@ -1394,44 +1391,28 @@ public class Quest extends ManagedScript
}
// Return random candidate.
- final List members = getPartyMembers(player, npc, var, value);
+ final List members = getPartyMembers(player, npc, cond);
if (members.isEmpty())
{
final QuestState qs = player.getQuestState(getName());
- if (qs != null)
+ if ((qs != null) && qs.isCond(cond))
{
- final Object sVar = qs.get(var);
- if ((sVar != null) && ((String) sVar).equalsIgnoreCase(value))
- {
- return player; // match
- }
+ return player; // match
}
return null; // no match
}
return members.get(Rnd.get(members.size()));
}
- /**
- * Auxiliary function for party quests. Note: This function is only here because of how commonly it may be used by quest developers. For any variations on this function, the quest script can always handle things on its own.
- * @param player : the instance of a player whose party is to be searched
- * @param npc : the instance of a Npc to compare distance
- * @param value : the value of the "cond" variable that must be matched
- * @return Player : Player for a random party member that matches the specified condition, or null if no match.
- */
- public PlayerInstance getRandomPartyMember(PlayerInstance player, NpcInstance npc, String value)
- {
- return getRandomPartyMember(player, npc, "cond", value);
- }
-
/**
* Auxiliary function for party quests. Note: This function is only here because of how commonly it may be used by quest developers. For any variations on this function, the quest script can always handle things on its own
* @param player the instance of a player whose party is to be searched
- * @param var a tuple specifying a quest condition that must be satisfied for a party member to be considered.
+ * @param variable a tuple specifying a quest condition that must be satisfied for a party member to be considered.
* @param value
* @return PlayerInstance: PlayerInstance for a random party member that matches the specified condition, or null if no match. If the var is null, any random party member is returned (i.e. no condition is applied). The party member must be within 1500 distance from the target of the reference
* player, or if no target exists, 1500 distance from the player itself.
*/
- public PlayerInstance getRandomPartyMember(PlayerInstance player, String var, String value)
+ public PlayerInstance getRandomPartyMember(PlayerInstance player, String variable, String value)
{
// if no valid player instance is passed, there is nothing to check...
if (player == null)
@@ -1440,7 +1421,7 @@ public class Quest extends ManagedScript
}
// for null var condition, return any random party member.
- if (var == null)
+ if (variable == null)
{
return getRandomPartyMember(player);
}
@@ -1454,7 +1435,7 @@ public class Quest extends ManagedScript
final QuestState qs = player.getQuestState(getName());
if (qs != null)
{
- final Object sVar = qs.get(var);
+ final Object sVar = qs.get(variable);
if ((sVar != null) && ((String) sVar).equalsIgnoreCase(value))
{
return player; // match
@@ -1478,7 +1459,7 @@ public class Quest extends ManagedScript
final QuestState qs = partyMember.getQuestState(getName());
if (qs != null)
{
- final Object sVar = qs.get(var);
+ final Object sVar = qs.get(variable);
if ((sVar != null) && ((String) sVar).equalsIgnoreCase(value) && partyMember.isInsideRadius3D(target, Config.ALT_PARTY_RANGE))
{
candidates.add(partyMember);
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index a5dd291caa..fa4a80bb70 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.quest;
import java.util.HashMap;
import java.util.Map;
+import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
@@ -49,6 +50,9 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+
public static final String SOUND_ACCEPT = "ItemSound.quest_accept";
public static final String SOUND_ITEMGET = "ItemSound.quest_itemget";
public static final String SOUND_MIDDLE = "ItemSound.quest_middle";
@@ -72,16 +76,14 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** A map of key->value pairs containing the quest state variables and their values */
private Map _vars;
/**
- * Constructor of the QuestState : save the quest in the list of quests of the player.
- *
- * Actions :
- * - Save informations in the object QuestState created (Quest, Player, Completion, State)
- * - Add the QuestState in the player's list of quests by using setQuestState()
- * - Add drops gotten by the quest
+ * Constructor of the QuestState. Creates the QuestState object and sets the player's progress of the quest to this QuestState.
* @param quest the {@link Quest} object associated with the QuestState
* @param player the owner of this {@link QuestState} object
* @param state the initial state of the quest
@@ -210,9 +212,9 @@ public class QuestState
// Otherwise, delete variables for quest and update database (quest CANNOT be created again => not repeatable)
if (_vars != null)
{
- for (String var : _vars.keySet())
+ for (String variable : _vars.keySet())
{
- Quest.deleteQuestVarInDb(this, var);
+ Quest.deleteQuestVarInDb(this, variable);
}
_vars.clear();
}
@@ -222,60 +224,74 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
- * @param val String pointing out the value of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
+ * @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String val)
+ public void setInternal(String variable, String value)
{
if (_vars == null)
{
_vars = new HashMap<>();
}
- String value = val;
if (value == null)
{
- value = "";
+ _vars.put(variable, "");
+ return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
/**
* Return value of parameter "value" after adding the couple (var,value) in class variable "vars".
- * Actions :
- * - Initialize class variable "vars" if is null
+ * Actions:
+ *
+ * - Initialize class variable "vars" if is null.
* - Initialize parameter "value" if is null
* - Add/Update couple (var,value) in class variable Map "vars"
- * - If the key represented by "var" exists in Map "vars", the couple (var,value) is updated in the database. The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
- * If the key doesn't exist, the couple is added/created in the database
- * @param var : String indicating the name of the variable for quest
- * @param val : String indicating the value of the variable for quest
+ * - If the key represented by "var" exists in Map "vars", the couple (var,value) is updated in the database.
+ * The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
+ * If the key doesn't exist, the couple is added/created in the database
+ *
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_vars == null)
{
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if (var.equals("cond"))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -284,29 +300,40 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
}
catch (Exception e)
{
- LOGGER.finer(_player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
/**
- * Internally handles the progression of the quest so that it is ready for sending appropriate packets to the client
+ * Internally handles the progression of the quest so that it is ready for sending appropriate packets to the client.
* Actions :
- * - Check if the new progress number resets the quest to a previous (smaller) step
- * - If not, check if quest progress steps have been skipped
- * - If skipped, prepare the variable completedStateFlags appropriately to be ready for sending to clients
+ *
+ * - Check if the new progress number resets the quest to a previous (smaller) step.
+ * - If not, check if quest progress steps have been skipped.
+ * - If skipped, prepare the variable completedStateFlags appropriately to be ready for sending to clients.
* - If no steps were skipped, flags do not need to be prepared...
- * - If the passed step resets the quest to a previous step, reset such that steps after the parameter are not considered, while skipped steps before the parameter, if any, maintain their info
- * @param cond : int indicating the step number for the current quest progress (as will be shown to the client)
- * @param old : int indicating the previously noted step For more info on the variable communicating the progress steps to the client, please see
+ * - If the passed step resets the quest to a previous step, reset such that steps after the parameter are not considered, while skipped steps before the parameter, if any, maintain their info.
+ *
+ * @param cond the current quest progress condition (0 - 31 including)
+ * @param old the previous quest progress condition to check against
*/
private void setCond(int cond, int old)
{
@@ -386,75 +413,120 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_vars == null)
{
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * Return the value of the variable of quest represented by "var"
- * @param var : name of the variable of quest
- * @return Object
+ * @param variable the name of the variable to get
+ * @return the value of the variable from the list of quest variables
*/
- public Object get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
+ }
+
+ /**
+ * @param variable the name of the variable to get
+ * @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
+ */
+ public int getInt(String variable)
+ {
+ int varInt = 0;
+ if (_vars != null)
+ {
+ final String value = _vars.get(variable);
+ if (value != null)
+ {
+ try
+ {
+ varInt = Integer.parseInt(value);
+ }
+ catch (Exception e)
+ {
+ LOGGER.info(_player.getName() + ": variable " + variable + " isn't an integer: returned value will be " + varInt + e);
+ if (Config.AUTODELETE_INVALID_QUEST_DATA)
+ {
+ exitQuest(true);
+ }
+ }
+ }
+ }
+ return varInt;
}
/**
* Return the value of the variable of quest represented by "var"
- * @param var : name of the variable of quest
+ * @param variable : name of the variable of quest
* @return String
*/
- public String getString(String var)
+ public String getString(String variable)
{
if (_vars == null)
{
return "";
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * Return the value of the variable of quest represented by "var"
- * @param var : String designating the variable for the quest
- * @return int
+ * Checks if the quest state progress ({@code cond}) is at the specified step.
+ * @param condition the condition to check against
+ * @return {@code true} if the quest condition is equal to {@code condition}, {@code false} otherwise
+ * @see #getInt(String var)
*/
- public int getInt(String var)
+ public boolean isCond(int condition)
{
- int varint = 0;
- String value = "";
- if ((_vars != null) && ((value = _vars.get(var)) != null))
+ return _cond == condition;
+ }
+
+ /**
+ * Sets the quest state progress ({@code cond}) to the specified step.
+ * @param value the new value of the quest state progress
+ * @see #set(String var, String value)
+ */
+ public void setCond(int value)
+ {
+ if (isStarted())
{
- try
- {
- varint = Integer.parseInt(value);
- }
- catch (Exception e)
- {
- LOGGER.info(_player.getName() + ": variable " + var + " isn't an integer: returned value will be " + varint + e);
- if (Config.AUTODELETE_INVALID_QUEST_DATA)
- {
- exitQuest(true);
- }
- }
+ set(COND_VAR, Integer.toString(value));
}
- return varint;
+ }
+
+ /**
+ * @return the current quest progress ({@code cond})
+ */
+ public int getCond()
+ {
+ if (isStarted())
+ {
+ return _cond;
+ }
+
+ return 0;
}
/**
@@ -879,14 +951,14 @@ public class QuestState
*/
public void rewardItems(int itemId, int itemCount)
{
- if (itemId == 57)
- {
- giveItems(itemId, (int) (itemCount * Config.RATE_QUESTS_REWARD), 0); // TODO: RATE_QUEST_REWARD_ADENA
- }
- else
- {
- giveItems(itemId, (int) (itemCount * Config.RATE_QUESTS_REWARD), 0);
- }
+ // if (itemId == 57)
+ // {
+ // giveItems(itemId, (int) (itemCount * Config.RATE_QUEST_REWARD_ADENA), 0); // TODO: RATE_QUEST_REWARD_ADENA
+ // }
+ // else
+ // {
+ giveItems(itemId, (int) (itemCount * Config.RATE_QUESTS_REWARD), 0);
+ // }
}
/**
@@ -1068,6 +1140,20 @@ public class QuestState
return getQuest().addSpawn(npcId, x, y, z, heading, randomOffset, despawnDelay);
}
+ /**
+ * Set condition to 1, state to STARTED and play the "ItemSound.quest_accept".
+ * Works only if state is CREATED and the quest is not a custom quest.
+ */
+ public void startQuest()
+ {
+ if (isCreated())
+ {
+ set(COND_VAR, "1");
+ setState(State.STARTED);
+ _player.sendPacket(new PlaySound(QuestState.SOUND_ACCEPT));
+ }
+ }
+
public void showQuestionMark(int number)
{
_player.sendPacket(new TutorialShowQuestionMark(number));
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/ExCaptureOrc.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/ExCaptureOrc.java
index a052512523..e2b2d7e57a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/ExCaptureOrc.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/ExCaptureOrc.java
@@ -28,7 +28,7 @@ public class ExCaptureOrc implements IClientOutgoingPacket
static
{
// TODO: Verify the data
- //@formatter:off
+ // @formatter:off
_test = new byte[]
{
(byte) 0xE4 ,(byte) 0xAB ,(byte) 0x8E ,(byte) 0xC5 ,(byte) 0xE9 ,(byte) 0xF9 ,(byte) 0x86 ,(byte) 0x7B,
@@ -40,7 +40,7 @@ public class ExCaptureOrc implements IClientOutgoingPacket
(byte) 0x5E ,(byte) 0x1C ,(byte) 0x59 ,(byte) 0x8E ,(byte) 0x74 ,(byte) 0x01 ,(byte) 0x9E ,(byte) 0xC2,
(byte) 0x00 ,(byte) 0x95 ,(byte) 0xB0 ,(byte) 0x1D ,(byte) 0x87 ,(byte) 0xED ,(byte) 0x9C ,(byte) 0x8A
};
- //@formatter:on
+ // @formatter:on
}
@Override
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/GMViewQuestList.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/GMViewQuestList.java
index c90c3135d6..6de298cefe 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/GMViewQuestList.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/GMViewQuestList.java
@@ -55,7 +55,7 @@ public class GMViewQuestList implements IClientOutgoingPacket
continue;
}
- packet.writeD(qs.getInt("cond")); // stage of quest progress
+ packet.writeD(qs.getCond()); // stage of quest progress
}
return true;
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 1c662efed9..ee3a3f27e9 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -48,7 +48,7 @@ public class QuestList implements IClientOutgoingPacket
}
else
{
- packet.writeD(qs.getInt("cond"));
+ packet.writeD(qs.getCond());
}
}
return true;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/FeedableBeasts.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/FeedableBeasts.java
index 5c468ae007..74356b6334 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/FeedableBeasts.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/FeedableBeasts.java
@@ -174,7 +174,7 @@ public class FeedableBeasts extends Quest
// TODO: no grendels?
GrowthCapableMob temp;
- //@formatter:off
+ // @formatter:off
final int[][] Kookabura_0_Gold = {{ 21452, 21453, 21454, 21455 }};
final int[][] Kookabura_0_Crystal = {{ 21456, 21457, 21458, 21459 }};
final int[][] Kookabura_1_Gold_1= {{ 21460, 21462 }};
@@ -199,7 +199,7 @@ public class FeedableBeasts extends Quest
final int[][] Cougar_1_Crystal_2 = {{ 21503,21505 }};
final int[][] Cougar_2_1 = {{ 21506, 21828 }, { 16015,16016 }};
final int[][] Cougar_2_2 = {{ 21507, 21829 }, { 16015,16016 }};
- //@formatter:on
+ // @formatter:on
// Alpen Kookabura
temp = new GrowthCapableMob(0, 100);
@@ -412,7 +412,7 @@ public class FeedableBeasts extends Quest
if ((st != null) && (Rnd.get(100) < 5) && !st.hasQuestItems(7185))
{
st.giveItems(7185, 1);
- st.set("cond", "2");
+ st.setCond(2);
}
// Also, perform a rare random chat
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/NewbieHelper.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/NewbieHelper.java
index 991ae68b88..c23e5d1c42 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/NewbieHelper.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/NewbieHelper.java
@@ -44,14 +44,12 @@ public class NewbieHelper extends Quest
private static final int LICENSE_OF_MINER = 1498;
// Orc
private static final int VOUCHER_OF_FLAME = 1496;
-
// Items Reward
private static final int SOULSHOT_NOVICE = 5789;
private static final int SPIRITSHOT_NOVICE = 5790;
private static final int BLUE_GEM = 6353;
private static final int TOKEN = 8542;
private static final int SCROLL = 8594;
-
private static final Map _events = new HashMap<>();
static
{
@@ -62,7 +60,6 @@ public class NewbieHelper extends Quest
_events.put("30528_02", new Event("30528-03.htm", 115642, -178046, -941, LICENSE_OF_MINER, 0x35, SOULSHOT_NOVICE, 200, 0x00, 0, 0));
_events.put("30573_02", new Event("30573-03.htm", -45067, -113549, -235, VOUCHER_OF_FLAME, 0x31, SOULSHOT_NOVICE, 200, 0x2c, SOULSHOT_NOVICE, 200));
}
-
// @formatter:off
private static final Map _talks = new HashMap<>();
static
@@ -91,11 +88,8 @@ public class NewbieHelper extends Quest
public NewbieHelper()
{
super(-1, "ai/others");
-
addStartNpc(30009, 30019, 30131, 30400, 30530, 30575);
-
addTalkId(30009, 30019, 30131, 30400, 30530, 30575, 30008, 30017, 30129, 30370, 30528, 30573);
-
addFirstTalkId(new int[]
{
30009, // Newbie Helper - Human
@@ -118,7 +112,6 @@ public class NewbieHelper extends Quest
30528, // Foreman - Dwarf
30573 // Flame Guardian - Orc
});
-
addKillId(18342);
}
@@ -250,12 +243,12 @@ public class NewbieHelper extends Quest
{
String htmltext = "";
QuestState qs1 = player.getQuestState(getName());
- final QuestState qs2 = player.getQuestState(Tutorial.class.getSimpleName());
if (qs1 == null)
{
qs1 = newQuestState(player);
}
+ final QuestState qs2 = player.getQuestState(Tutorial.class.getSimpleName());
if ((qs2 == null) || Config.DISABLE_TUTORIAL)
{
npc.showChatWindow(player);
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/custom/KetraOrcSupport/KetraOrcSupport.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/custom/KetraOrcSupport/KetraOrcSupport.java
index 823ead33ae..f1d13cc8c3 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/custom/KetraOrcSupport/KetraOrcSupport.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/custom/KetraOrcSupport/KetraOrcSupport.java
@@ -50,9 +50,7 @@ public class KetraOrcSupport extends Quest
private static final int JAFF = 31374; // Warehouse Keeper
private static final int JUMARA = 31375; // Trader
private static final int KURFA = 31376; // Gate Keeper
-
private static final int HORN = 7186;
-
private static final int[] KETRAS =
{
21324,
@@ -77,44 +75,19 @@ public class KetraOrcSupport extends Quest
21348,
21349
};
-
private static final int[][] BUFF =
{
- {
- 4359,
- 2
- }, // Focus: Requires 2 Buffalo Horns
- {
- 4360,
- 2
- }, // Death Whisper: Requires 2 Buffalo Horns
- {
- 4345,
- 3
- }, // Might: Requires 3 Buffalo Horns
- {
- 4355,
- 3
- }, // Acumen: Requires 3 Buffalo Horns
- {
- 4352,
- 3
- }, // Berserker: Requires 3 Buffalo Horns
- {
- 4354,
- 3
- }, // Vampiric Rage: Requires 3 Buffalo Horns
- {
- 4356,
- 6
- }, // Empower: Requires 6 Buffalo Horns
- {
- 4357,
- 6
- }
- // Haste: Requires 6 Buffalo Horns
+ // @formatter:off
+ {4359, 2}, // Focus: Requires 2 Buffalo Horns
+ {4360, 2}, // Death Whisper: Requires 2 Buffalo Horns
+ {4345, 3}, // Might: Requires 3 Buffalo Horns
+ {4355, 3}, // Acumen: Requires 3 Buffalo Horns
+ {4352, 3}, // Berserker: Requires 3 Buffalo Horns
+ {4354, 3}, // Vampiric Rage: Requires 3 Buffalo Horns
+ {4356, 6}, // Empower: Requires 6 Buffalo Horns
+ {4357, 6}, // Haste: Requires 6 Buffalo Horns
+ // @formatter:on
};
-
private static final Skill VARKA_KETRA_PETRIFICATION = SkillTable.getInstance().getSkill(4578, 1);
/**
@@ -185,11 +158,15 @@ public class KetraOrcSupport extends Quest
switch (player.getAllianceWithVarkaKetra())
{
case 4:
+ {
htmltext = "31376-4.htm";
break;
+ }
case 5:
+ {
htmltext = "31376-5.htm";
break;
+ }
}
}
@@ -211,6 +188,7 @@ public class KetraOrcSupport extends Quest
switch (npc.getNpcId())
{
case KADUN:
+ {
if (allianceLevel > 0)
{
htmltext = "31370-friend.htm";
@@ -220,8 +198,9 @@ public class KetraOrcSupport extends Quest
htmltext = "31370-no.htm";
}
break;
-
+ }
case WAHKAN:
+ {
if (allianceLevel > 0)
{
htmltext = "31371-friend.htm";
@@ -231,8 +210,9 @@ public class KetraOrcSupport extends Quest
htmltext = "31371-no.htm";
}
break;
-
+ }
case ASEFA:
+ {
st.setState(State.STARTED);
if (allianceLevel < 1)
{
@@ -254,8 +234,9 @@ public class KetraOrcSupport extends Quest
}
}
break;
-
+ }
case ATAN:
+ {
if (player.getKarma() >= 1)
{
htmltext = "31373-pk.htm";
@@ -273,18 +254,24 @@ public class KetraOrcSupport extends Quest
htmltext = "31373-2.htm";
}
break;
-
+ }
case JAFF:
+ {
switch (allianceLevel)
{
case 1:
+ {
htmltext = "31374-1.htm";
break;
+ }
case 2:
case 3:
+ {
htmltext = "31374-2.htm";
break;
+ }
default:
+ {
if (allianceLevel <= 0)
{
htmltext = "31374-no.htm";
@@ -298,29 +285,40 @@ public class KetraOrcSupport extends Quest
htmltext = "31374-4.htm";
}
break;
+ }
}
break;
-
+ }
case JUMARA:
+ {
switch (allianceLevel)
{
case 2:
+ {
htmltext = "31375-1.htm";
break;
+ }
case 3:
case 4:
+ {
htmltext = "31375-2.htm";
break;
+ }
case 5:
+ {
htmltext = "31375-3.htm";
break;
+ }
default:
+ {
htmltext = "31375-no.htm";
break;
+ }
}
break;
-
+ }
case KURFA:
+ {
if (allianceLevel <= 0)
{
htmltext = "31376-no.htm";
@@ -338,6 +336,7 @@ public class KetraOrcSupport extends Quest
htmltext = "31376-3.htm";
}
break;
+ }
}
return htmltext;
@@ -376,6 +375,7 @@ public class KetraOrcSupport extends Quest
case HEAL_STATIC:
case BALANCE_LIFE:
case HOT:
+ {
for (WorldObject target : skill.getTargetList(caster))
{
// Character isn't existing, or is current caster, we drop check.
@@ -419,6 +419,7 @@ public class KetraOrcSupport extends Quest
}
}
break;
+ }
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/custom/VarkaSilenosSupport/VarkaSilenosSupport.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/custom/VarkaSilenosSupport/VarkaSilenosSupport.java
index f5ddaf1c48..e3c989f304 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/custom/VarkaSilenosSupport/VarkaSilenosSupport.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/custom/VarkaSilenosSupport/VarkaSilenosSupport.java
@@ -49,9 +49,7 @@ public class VarkaSilenosSupport extends Quest
private static final int HAGOS = 31381; // Warehouse Keeper
private static final int SHIKON = 31382; // Trader
private static final int TERANU = 31383; // Teleporter
-
private static final int SEED = 7187;
-
private static final int[] VARKAS =
{
21350,
@@ -76,44 +74,19 @@ public class VarkaSilenosSupport extends Quest
21374,
21375
};
-
private static final int[][] BUFF =
{
- {
- 4359,
- 2
- }, // Focus: Requires 2 Nepenthese Seeds
- {
- 4360,
- 2
- }, // Death Whisper: Requires 2 Nepenthese Seeds
- {
- 4345,
- 3
- }, // Might: Requires 3 Nepenthese Seeds
- {
- 4355,
- 3
- }, // Acumen: Requires 3 Nepenthese Seeds
- {
- 4352,
- 3
- }, // Berserker: Requires 3 Nepenthese Seeds
- {
- 4354,
- 3
- }, // Vampiric Rage: Requires 3 Nepenthese Seeds
- {
- 4356,
- 6
- }, // Empower: Requires 6 Nepenthese Seeds
- {
- 4357,
- 6
- }
- // Haste: Requires 6 Nepenthese Seeds
+ // @formatter:off
+ {4359, 2}, // Focus: Requires 2 Nepenthese Seeds
+ {4360, 2}, // Death Whisper: Requires 2 Nepenthese Seeds
+ {4345, 3}, // Might: Requires 3 Nepenthese Seeds
+ {4355, 3}, // Acumen: Requires 3 Nepenthese Seeds
+ {4352, 3}, // Berserker: Requires 3 Nepenthese Seeds
+ {4354, 3}, // Vampiric Rage: Requires 3 Nepenthese Seeds
+ {4356, 6}, // Empower: Requires 6 Nepenthese Seeds
+ {4357, 6}, // Haste: Requires 6 Nepenthese Seeds
+ // @formatter:on
};
-
private static final Skill VARKA_KETRA_PETRIFICATION = SkillTable.getInstance().getSkill(4578, 1);
/**
@@ -184,11 +157,15 @@ public class VarkaSilenosSupport extends Quest
switch (player.getAllianceWithVarkaKetra())
{
case -4:
+ {
htmltext = "31383-4.htm";
break;
+ }
case -5:
+ {
htmltext = "31383-5.htm";
break;
+ }
}
}
@@ -210,6 +187,7 @@ public class VarkaSilenosSupport extends Quest
switch (npc.getNpcId())
{
case ASHAS:
+ {
if (allianceLevel < 0)
{
htmltext = "31377-friend.htm";
@@ -219,8 +197,9 @@ public class VarkaSilenosSupport extends Quest
htmltext = "31377-no.htm";
}
break;
-
+ }
case NARAN:
+ {
if (allianceLevel < 0)
{
htmltext = "31378-friend.htm";
@@ -230,8 +209,9 @@ public class VarkaSilenosSupport extends Quest
htmltext = "31378-no.htm";
}
break;
-
+ }
case UDAN:
+ {
st.setState(State.STARTED);
if (allianceLevel > -1)
{
@@ -253,8 +233,9 @@ public class VarkaSilenosSupport extends Quest
}
}
break;
-
+ }
case DIYABU:
+ {
if (player.getKarma() >= 1)
{
htmltext = "31380-pk.htm";
@@ -272,18 +253,24 @@ public class VarkaSilenosSupport extends Quest
htmltext = "31380-2.htm";
}
break;
-
+ }
case HAGOS:
+ {
switch (allianceLevel)
{
case -1:
+ {
htmltext = "31381-1.htm";
break;
+ }
case -2:
case -3:
+ {
htmltext = "31381-2.htm";
break;
+ }
default:
+ {
if (allianceLevel >= 0)
{
htmltext = "31381-no.htm";
@@ -297,29 +284,40 @@ public class VarkaSilenosSupport extends Quest
htmltext = "31381-4.htm";
}
break;
+ }
}
break;
-
+ }
case SHIKON:
+ {
switch (allianceLevel)
{
case -2:
+ {
htmltext = "31382-1.htm";
break;
+ }
case -3:
case -4:
+ {
htmltext = "31382-2.htm";
break;
+ }
case -5:
+ {
htmltext = "31382-3.htm";
break;
+ }
default:
+ {
htmltext = "31382-no.htm";
break;
+ }
}
break;
-
+ }
case TERANU:
+ {
if (allianceLevel >= 0)
{
htmltext = "31383-no.htm";
@@ -337,6 +335,7 @@ public class VarkaSilenosSupport extends Quest
htmltext = "31383-3.htm";
}
break;
+ }
}
return htmltext;
@@ -375,6 +374,7 @@ public class VarkaSilenosSupport extends Quest
case HEAL_STATIC:
case BALANCE_LIFE:
case HOT:
+ {
for (WorldObject target : skill.getTargetList(caster))
{
// Character isn't existing, or is current caster, we drop check.
@@ -418,6 +418,7 @@ public class VarkaSilenosSupport extends Quest
}
}
break;
+ }
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q001_LettersOfLove/Q001_LettersOfLove.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q001_LettersOfLove/Q001_LettersOfLove.java
index 491afa51e5..2735d1c380 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q001_LettersOfLove/Q001_LettersOfLove.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q001_LettersOfLove/Q001_LettersOfLove.java
@@ -24,26 +24,22 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q001_LettersOfLove extends Quest
{
- // Npcs
+ // NPCs
private static final int DARIN = 30048;
private static final int ROXXY = 30006;
private static final int BAULRO = 30033;
-
// Items
private static final int DARIN_LETTER = 687;
private static final int ROXXY_KERCHIEF = 688;
private static final int DARIN_RECEIPT = 1079;
private static final int BAULRO_POTION = 1080;
-
// Reward
private static final int NECKLACE = 906;
public Q001_LettersOfLove()
{
super(1, "Letters of Love");
-
registerQuestItems(DARIN_LETTER, ROXXY_KERCHIEF, DARIN_RECEIPT, BAULRO_POTION);
-
addStartNpc(DARIN);
addTalkId(DARIN, ROXXY, BAULRO);
}
@@ -60,9 +56,7 @@ public class Q001_LettersOfLove extends Quest
if (event.equals("30048-06.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(DARIN_LETTER, 1);
}
@@ -82,14 +76,17 @@ public class Q001_LettersOfLove extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 2) ? "30048-01.htm" : "30048-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case DARIN:
+ {
if (cond == 1)
{
htmltext = "30048-07.htm";
@@ -97,7 +94,7 @@ public class Q001_LettersOfLove extends Quest
else if (cond == 2)
{
htmltext = "30048-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ROXXY_KERCHIEF, 1);
st.giveItems(DARIN_RECEIPT, 1);
@@ -115,12 +112,13 @@ public class Q001_LettersOfLove extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ROXXY:
+ {
if (cond == 1)
{
htmltext = "30006-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DARIN_LETTER, 1);
st.giveItems(ROXXY_KERCHIEF, 1);
@@ -134,12 +132,13 @@ public class Q001_LettersOfLove extends Quest
htmltext = "30006-03.htm";
}
break;
-
+ }
case BAULRO:
+ {
if (cond == 3)
{
htmltext = "30033-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DARIN_RECEIPT, 1);
st.giveItems(BAULRO_POTION, 1);
@@ -149,12 +148,15 @@ public class Q001_LettersOfLove extends Quest
htmltext = "30033-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q002_WhatWomenWant/Q002_WhatWomenWant.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q002_WhatWomenWant/Q002_WhatWomenWant.java
index 90d28bec04..3f7fb2faff 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q002_WhatWomenWant/Q002_WhatWomenWant.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q002_WhatWomenWant/Q002_WhatWomenWant.java
@@ -30,23 +30,19 @@ public class Q002_WhatWomenWant extends Quest
private static final int MIRABEL = 30146;
private static final int HERBIEL = 30150;
private static final int GREENIS = 30157;
-
// Items
private static final int ARUJIEN_LETTER_1 = 1092;
private static final int ARUJIEN_LETTER_2 = 1093;
private static final int ARUJIEN_LETTER_3 = 1094;
private static final int POETRY_BOOK = 689;
private static final int GREENIS_LETTER = 693;
-
// Rewards
private static final int MYSTICS_EARRING = 113;
public Q002_WhatWomenWant()
{
super(2, "What Women Want");
-
registerQuestItems(ARUJIEN_LETTER_1, ARUJIEN_LETTER_2, ARUJIEN_LETTER_3, POETRY_BOOK, GREENIS_LETTER);
-
addStartNpc(ARUJIEN);
addTalkId(ARUJIEN, MIRABEL, HERBIEL, GREENIS);
}
@@ -61,26 +57,30 @@ public class Q002_WhatWomenWant extends Quest
return htmltext;
}
- if (event.equals("30223-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ARUJIEN_LETTER_1, 1);
- }
- else if (event.equals("30223-08.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARUJIEN_LETTER_3, 1);
- st.giveItems(POETRY_BOOK, 1);
- }
- else if (event.equals("30223-09.htm"))
- {
- st.takeItems(ARUJIEN_LETTER_3, 1);
- st.rewardItems(57, 450);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30223-04.htm":
+ {
+ st.startQuest();
+ st.giveItems(ARUJIEN_LETTER_1, 1);
+ break;
+ }
+ case "30223-08.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARUJIEN_LETTER_3, 1);
+ st.giveItems(POETRY_BOOK, 1);
+ break;
+ }
+ case "30223-09.htm":
+ {
+ st.takeItems(ARUJIEN_LETTER_3, 1);
+ st.rewardItems(57, 450);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -99,6 +99,7 @@ public class Q002_WhatWomenWant extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() != Race.ELF) && (player.getRace() != Race.HUMAN))
{
htmltext = "30223-00.htm";
@@ -112,12 +113,14 @@ public class Q002_WhatWomenWant extends Quest
htmltext = "30223-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ARUJIEN:
+ {
if (st.hasQuestItems(ARUJIEN_LETTER_1))
{
htmltext = "30223-05.htm";
@@ -143,12 +146,13 @@ public class Q002_WhatWomenWant extends Quest
st.exitQuest(false);
}
break;
-
+ }
case MIRABEL:
+ {
if (cond == 1)
{
htmltext = "30146-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ARUJIEN_LETTER_1, 1);
st.giveItems(ARUJIEN_LETTER_2, 1);
@@ -158,12 +162,13 @@ public class Q002_WhatWomenWant extends Quest
htmltext = "30146-02.htm";
}
break;
-
+ }
case HERBIEL:
+ {
if (cond == 2)
{
htmltext = "30150-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ARUJIEN_LETTER_2, 1);
st.giveItems(ARUJIEN_LETTER_3, 1);
@@ -173,8 +178,9 @@ public class Q002_WhatWomenWant extends Quest
htmltext = "30150-02.htm";
}
break;
-
+ }
case GREENIS:
+ {
if (cond < 4)
{
htmltext = "30157-01.htm";
@@ -182,7 +188,7 @@ public class Q002_WhatWomenWant extends Quest
else if (cond == 4)
{
htmltext = "30157-02.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(POETRY_BOOK, 1);
st.giveItems(GREENIS_LETTER, 1);
@@ -192,12 +198,15 @@ public class Q002_WhatWomenWant extends Quest
htmltext = "30157-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q003_WillTheSealBeBroken/Q003_WillTheSealBeBroken.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q003_WillTheSealBeBroken/Q003_WillTheSealBeBroken.java
index fb65f9b929..06229bdcc8 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q003_WillTheSealBeBroken/Q003_WillTheSealBeBroken.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q003_WillTheSealBeBroken/Q003_WillTheSealBeBroken.java
@@ -29,19 +29,15 @@ public class Q003_WillTheSealBeBroken extends Quest
private static final int ONYX_BEAST_EYE = 1081;
private static final int TAINT_STONE = 1082;
private static final int SUCCUBUS_BLOOD = 1083;
-
// Reward
private static final int SCROLL_ENCHANT_ARMOR_D = 956;
public Q003_WillTheSealBeBroken()
{
super(3, "Will the Seal be Broken?");
-
registerQuestItems(ONYX_BEAST_EYE, TAINT_STONE, SUCCUBUS_BLOOD);
-
addStartNpc(30141); // Talloth
addTalkId(30141);
-
addKillId(20031, 20041, 20046, 20048, 20052, 20057);
}
@@ -57,9 +53,7 @@ public class Q003_WillTheSealBeBroken extends Quest
if (event.equals("30141-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -78,6 +72,7 @@ public class Q003_WillTheSealBeBroken extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30141-00.htm";
@@ -91,9 +86,10 @@ public class Q003_WillTheSealBeBroken extends Quest
htmltext = "30141-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30141-04.htm";
@@ -109,10 +105,12 @@ public class Q003_WillTheSealBeBroken extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -121,7 +119,7 @@ public class Q003_WillTheSealBeBroken extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -130,28 +128,32 @@ public class Q003_WillTheSealBeBroken extends Quest
switch (npc.getNpcId())
{
case 20031:
+ {
if (st.dropItemsAlways(ONYX_BEAST_EYE, 1, 1) && st.hasQuestItems(TAINT_STONE, SUCCUBUS_BLOOD))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20041:
case 20046:
+ {
if (st.dropItemsAlways(TAINT_STONE, 1, 1) && st.hasQuestItems(ONYX_BEAST_EYE, SUCCUBUS_BLOOD))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20048:
case 20052:
case 20057:
+ {
if (st.dropItemsAlways(SUCCUBUS_BLOOD, 1, 1) && st.hasQuestItems(ONYX_BEAST_EYE, TAINT_STONE))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q004_LongliveThePaagrioLord/Q004_LongliveThePaagrioLord.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q004_LongliveThePaagrioLord/Q004_LongliveThePaagrioLord.java
index ab622fdc27..34459fa8cc 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q004_LongliveThePaagrioLord/Q004_LongliveThePaagrioLord.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q004_LongliveThePaagrioLord/Q004_LongliveThePaagrioLord.java
@@ -43,9 +43,7 @@ public class Q004_LongliveThePaagrioLord extends Quest
public Q004_LongliveThePaagrioLord()
{
super(4, "Long live the Pa'agrio Lord!");
-
registerQuestItems(1541, 1542, 1543, 1544, 1545, 1546);
-
addStartNpc(30578); // Nakusin
addTalkId(30578, 30585, 30566, 30562, 30560, 30559, 30587);
}
@@ -62,9 +60,7 @@ public class Q004_LongliveThePaagrioLord extends Quest
if (event.equals("30578-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -83,6 +79,7 @@ public class Q004_LongliveThePaagrioLord extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30578-00.htm";
@@ -96,11 +93,11 @@ public class Q004_LongliveThePaagrioLord extends Quest
htmltext = "30578-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
-
if (npcId == NAKUSIN)
{
if (cond == 1)
@@ -140,7 +137,7 @@ public class Q004_LongliveThePaagrioLord extends Quest
if (count == 6)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -150,10 +147,12 @@ public class Q004_LongliveThePaagrioLord extends Quest
}
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q005_MinersFavor/Q005_MinersFavor.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q005_MinersFavor/Q005_MinersFavor.java
index 1470ace119..24e07aaf48 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q005_MinersFavor/Q005_MinersFavor.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q005_MinersFavor/Q005_MinersFavor.java
@@ -30,7 +30,6 @@ public class Q005_MinersFavor extends Quest
private static final int GARITA = 30518;
private static final int REED = 30520;
private static final int BRUNON = 30526;
-
// Items
private static final int BOLTERS_LIST = 1547;
private static final int MINING_BOOTS = 1548;
@@ -38,16 +37,13 @@ public class Q005_MinersFavor extends Quest
private static final int BOOMBOOM_POWDER = 1550;
private static final int REDSTONE_BEER = 1551;
private static final int BOLTERS_SMELLY_SOCKS = 1552;
-
// Reward
private static final int NECKLACE = 906;
public Q005_MinersFavor()
{
super(5, "Miner's Favor");
-
registerQuestItems(BOLTERS_LIST, MINING_BOOTS, MINERS_PICK, BOOMBOOM_POWDER, REDSTONE_BEER, BOLTERS_SMELLY_SOCKS);
-
addStartNpc(BOLTER);
addTalkId(BOLTER, SHARI, GARITA, REED, BRUNON);
}
@@ -64,9 +60,7 @@ public class Q005_MinersFavor extends Quest
if (event.equals("30554-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(BOLTERS_LIST, 1);
st.giveItems(BOLTERS_SMELLY_SOCKS, 1);
}
@@ -76,7 +70,7 @@ public class Q005_MinersFavor extends Quest
st.giveItems(MINERS_PICK, 1);
if (st.hasQuestItems(MINING_BOOTS, BOOMBOOM_POWDER, REDSTONE_BEER))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -101,14 +95,17 @@ public class Q005_MinersFavor extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 2) ? "30554-01.htm" : "30554-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BOLTER:
+ {
if (cond == 1)
{
htmltext = "30554-04.htm";
@@ -126,15 +123,16 @@ public class Q005_MinersFavor extends Quest
st.exitQuest(false);
}
break;
-
+ }
case SHARI:
+ {
if ((cond == 1) && !st.hasQuestItems(BOOMBOOM_POWDER))
{
htmltext = "30517-01.htm";
st.giveItems(BOOMBOOM_POWDER, 1);
if (st.hasQuestItems(MINING_BOOTS, MINERS_PICK, REDSTONE_BEER))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -147,15 +145,16 @@ public class Q005_MinersFavor extends Quest
htmltext = "30517-02.htm";
}
break;
-
+ }
case GARITA:
+ {
if ((cond == 1) && !st.hasQuestItems(MINING_BOOTS))
{
htmltext = "30518-01.htm";
st.giveItems(MINING_BOOTS, 1);
if (st.hasQuestItems(MINERS_PICK, BOOMBOOM_POWDER, REDSTONE_BEER))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -168,15 +167,16 @@ public class Q005_MinersFavor extends Quest
htmltext = "30518-02.htm";
}
break;
-
+ }
case REED:
+ {
if ((cond == 1) && !st.hasQuestItems(REDSTONE_BEER))
{
htmltext = "30520-01.htm";
st.giveItems(REDSTONE_BEER, 1);
if (st.hasQuestItems(MINING_BOOTS, MINERS_PICK, BOOMBOOM_POWDER))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -189,8 +189,9 @@ public class Q005_MinersFavor extends Quest
htmltext = "30520-02.htm";
}
break;
-
+ }
case BRUNON:
+ {
if ((cond == 1) && !st.hasQuestItems(MINERS_PICK))
{
htmltext = "30526-01.htm";
@@ -200,12 +201,15 @@ public class Q005_MinersFavor extends Quest
htmltext = "30526-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q006_StepIntoTheFuture/Q006_StepIntoTheFuture.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q006_StepIntoTheFuture/Q006_StepIntoTheFuture.java
index a9a4ac453e..3490e4b40a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q006_StepIntoTheFuture/Q006_StepIntoTheFuture.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q006_StepIntoTheFuture/Q006_StepIntoTheFuture.java
@@ -29,10 +29,8 @@ public class Q006_StepIntoTheFuture extends Quest
private static final int ROXXY = 30006;
private static final int BAULRO = 30033;
private static final int SIR_COLLIN = 30311;
-
// Items
private static final int BAULRO_LETTER = 7571;
-
// Rewards
private static final int MARK_TRAVELER = 7570;
private static final int SOE_GIRAN = 7559;
@@ -40,9 +38,7 @@ public class Q006_StepIntoTheFuture extends Quest
public Q006_StepIntoTheFuture()
{
super(6, "Step into the Future");
-
registerQuestItems(BAULRO_LETTER);
-
addStartNpc(ROXXY);
addTalkId(ROXXY, BAULRO, SIR_COLLIN);
}
@@ -57,37 +53,42 @@ public class Q006_StepIntoTheFuture extends Quest
return htmltext;
}
- if (event.equals("30006-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30033-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BAULRO_LETTER, 1);
- }
- else if (event.equals("30311-02.htm"))
- {
- if (st.hasQuestItems(BAULRO_LETTER))
+ case "30006-03.htm":
{
- st.set("cond", "3");
+ st.startQuest();
+ break;
+ }
+ case "30033-02.htm":
+ {
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BAULRO_LETTER, 1);
+ st.giveItems(BAULRO_LETTER, 1);
+ break;
}
- else
+ case "30311-02.htm":
{
- htmltext = "30311-03.htm";
+ if (st.hasQuestItems(BAULRO_LETTER))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BAULRO_LETTER, 1);
+ }
+ else
+ {
+ htmltext = "30311-03.htm";
+ }
+ break;
+ }
+ case "30006-06.htm":
+ {
+ st.giveItems(MARK_TRAVELER, 1);
+ st.rewardItems(SOE_GIRAN, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
}
- }
- else if (event.equals("30006-06.htm"))
- {
- st.giveItems(MARK_TRAVELER, 1);
- st.rewardItems(SOE_GIRAN, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
}
return htmltext;
@@ -106,6 +107,7 @@ public class Q006_StepIntoTheFuture extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() != Race.HUMAN) || (player.getLevel() < 3))
{
htmltext = "30006-01.htm";
@@ -115,12 +117,14 @@ public class Q006_StepIntoTheFuture extends Quest
htmltext = "30006-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ROXXY:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30006-04.htm";
@@ -130,8 +134,9 @@ public class Q006_StepIntoTheFuture extends Quest
htmltext = "30006-05.htm";
}
break;
-
+ }
case BAULRO:
+ {
if (cond == 1)
{
htmltext = "30033-01.htm";
@@ -145,8 +150,9 @@ public class Q006_StepIntoTheFuture extends Quest
htmltext = "30033-04.htm";
}
break;
-
+ }
case SIR_COLLIN:
+ {
if (cond == 2)
{
htmltext = "30311-01.htm";
@@ -156,12 +162,15 @@ public class Q006_StepIntoTheFuture extends Quest
htmltext = "30311-03a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q007_ATripBegins/Q007_ATripBegins.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q007_ATripBegins/Q007_ATripBegins.java
index e04b8d2a29..0583b4cf78 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q007_ATripBegins/Q007_ATripBegins.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q007_ATripBegins/Q007_ATripBegins.java
@@ -29,10 +29,8 @@ public class Q007_ATripBegins extends Quest
private static final int MIRABEL = 30146;
private static final int ARIEL = 30148;
private static final int ASTERIOS = 30154;
-
// Items
private static final int ARIEL_RECO = 7572;
-
// Rewards
private static final int MARK_TRAVELER = 7570;
private static final int SOE_GIRAN = 7559;
@@ -40,9 +38,7 @@ public class Q007_ATripBegins extends Quest
public Q007_ATripBegins()
{
super(7, "A Trip Begins");
-
registerQuestItems(ARIEL_RECO);
-
addStartNpc(MIRABEL);
addTalkId(MIRABEL, ARIEL, ASTERIOS);
}
@@ -57,30 +53,35 @@ public class Q007_ATripBegins extends Quest
return htmltext;
}
- if (event.equals("30146-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30148-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(ARIEL_RECO, 1);
- }
- else if (event.equals("30154-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARIEL_RECO, 1);
- }
- else if (event.equals("30146-06.htm"))
- {
- st.giveItems(MARK_TRAVELER, 1);
- st.rewardItems(SOE_GIRAN, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30146-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30148-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(ARIEL_RECO, 1);
+ break;
+ }
+ case "30154-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARIEL_RECO, 1);
+ break;
+ }
+ case "30146-06.htm":
+ {
+ st.giveItems(MARK_TRAVELER, 1);
+ st.rewardItems(SOE_GIRAN, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -99,6 +100,7 @@ public class Q007_ATripBegins extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30146-01.htm";
@@ -112,12 +114,14 @@ public class Q007_ATripBegins extends Quest
htmltext = "30146-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MIRABEL:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30146-04.htm";
@@ -127,8 +131,9 @@ public class Q007_ATripBegins extends Quest
htmltext = "30146-05.htm";
}
break;
-
+ }
case ARIEL:
+ {
if (cond == 1)
{
htmltext = "30148-01.htm";
@@ -138,8 +143,9 @@ public class Q007_ATripBegins extends Quest
htmltext = "30148-03.htm";
}
break;
-
+ }
case ASTERIOS:
+ {
if (cond == 2)
{
htmltext = "30154-01.htm";
@@ -149,12 +155,15 @@ public class Q007_ATripBegins extends Quest
htmltext = "30154-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q008_AnAdventureBegins/Q008_AnAdventureBegins.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q008_AnAdventureBegins/Q008_AnAdventureBegins.java
index 1b45d9b9d0..0ce7b35ef6 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q008_AnAdventureBegins/Q008_AnAdventureBegins.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q008_AnAdventureBegins/Q008_AnAdventureBegins.java
@@ -29,10 +29,8 @@ public class Q008_AnAdventureBegins extends Quest
private static final int JASMINE = 30134;
private static final int ROSELYN = 30355;
private static final int HARNE = 30144;
-
// Items
private static final int ROSELYN_NOTE = 7573;
-
// Rewards
private static final int SOE_GIRAN = 7559;
private static final int MARK_TRAVELER = 7570;
@@ -40,9 +38,7 @@ public class Q008_AnAdventureBegins extends Quest
public Q008_AnAdventureBegins()
{
super(8, "An Adventure Begins");
-
registerQuestItems(ROSELYN_NOTE);
-
addStartNpc(JASMINE);
addTalkId(JASMINE, ROSELYN, HARNE);
}
@@ -57,30 +53,35 @@ public class Q008_AnAdventureBegins extends Quest
return htmltext;
}
- if (event.equals("30134-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30355-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(ROSELYN_NOTE, 1);
- }
- else if (event.equals("30144-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROSELYN_NOTE, 1);
- }
- else if (event.equals("30134-06.htm"))
- {
- st.giveItems(MARK_TRAVELER, 1);
- st.rewardItems(SOE_GIRAN, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30134-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30355-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(ROSELYN_NOTE, 1);
+ break;
+ }
+ case "30144-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ROSELYN_NOTE, 1);
+ break;
+ }
+ case "30134-06.htm":
+ {
+ st.giveItems(MARK_TRAVELER, 1);
+ st.rewardItems(SOE_GIRAN, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -99,6 +100,7 @@ public class Q008_AnAdventureBegins extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getLevel() >= 3) && (player.getRace() == Race.DARK_ELF))
{
htmltext = "30134-02.htm";
@@ -108,12 +110,14 @@ public class Q008_AnAdventureBegins extends Quest
htmltext = "30134-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case JASMINE:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30134-04.htm";
@@ -123,8 +127,9 @@ public class Q008_AnAdventureBegins extends Quest
htmltext = "30134-05.htm";
}
break;
-
+ }
case ROSELYN:
+ {
if (cond == 1)
{
htmltext = "30355-01.htm";
@@ -134,8 +139,9 @@ public class Q008_AnAdventureBegins extends Quest
htmltext = "30355-03.htm";
}
break;
-
+ }
case HARNE:
+ {
if (cond == 2)
{
htmltext = "30144-01.htm";
@@ -145,12 +151,15 @@ public class Q008_AnAdventureBegins extends Quest
htmltext = "30144-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q009_IntoTheCityOfHumans/Q009_IntoTheCityOfHumans.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q009_IntoTheCityOfHumans/Q009_IntoTheCityOfHumans.java
index 9b89bea4ff..6d7cd45e0b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q009_IntoTheCityOfHumans/Q009_IntoTheCityOfHumans.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q009_IntoTheCityOfHumans/Q009_IntoTheCityOfHumans.java
@@ -29,7 +29,6 @@ public class Q009_IntoTheCityOfHumans extends Quest
private static final int PETUKAI = 30583;
private static final int TANAPI = 30571;
private static final int TAMIL = 30576;
-
// Rewards
private static final int MARK_OF_TRAVELER = 7570;
private static final int SOE_GIRAN = 7126;
@@ -37,7 +36,6 @@ public class Q009_IntoTheCityOfHumans extends Quest
public Q009_IntoTheCityOfHumans()
{
super(9, "Into the City of Humans");
-
addStartNpc(PETUKAI);
addTalkId(PETUKAI, TANAPI, TAMIL);
}
@@ -52,23 +50,27 @@ public class Q009_IntoTheCityOfHumans extends Quest
return htmltext;
}
- if (event.equals("30583-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30571-01.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30576-01.htm"))
- {
- st.giveItems(MARK_OF_TRAVELER, 1);
- st.rewardItems(SOE_GIRAN, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30583-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30571-01.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30576-01.htm":
+ {
+ st.giveItems(MARK_OF_TRAVELER, 1);
+ st.rewardItems(SOE_GIRAN, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -87,6 +89,7 @@ public class Q009_IntoTheCityOfHumans extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getLevel() >= 3) && (player.getRace() == Race.ORC))
{
htmltext = "30583-00.htm";
@@ -96,19 +99,22 @@ public class Q009_IntoTheCityOfHumans extends Quest
htmltext = "30583-00a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case PETUKAI:
+ {
if (cond == 1)
{
htmltext = "30583-01a.htm";
}
break;
-
+ }
case TANAPI:
+ {
if (cond == 1)
{
htmltext = "30571-00.htm";
@@ -118,19 +124,23 @@ public class Q009_IntoTheCityOfHumans extends Quest
htmltext = "30571-01a.htm";
}
break;
-
+ }
case TAMIL:
+ {
if (cond == 2)
{
htmltext = "30576-00.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q010_IntoTheWorld/Q010_IntoTheWorld.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q010_IntoTheWorld/Q010_IntoTheWorld.java
index 225da14143..5e4a5b16ac 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q010_IntoTheWorld/Q010_IntoTheWorld.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q010_IntoTheWorld/Q010_IntoTheWorld.java
@@ -27,11 +27,9 @@ public class Q010_IntoTheWorld extends Quest
{
// Items
private static final int VERY_EXPENSIVE_NECKLACE = 7574;
-
// Rewards
private static final int SOE_GIRAN = 7559;
private static final int MARK_OF_TRAVELER = 7570;
-
// NPCs
private static final int REED = 30520;
private static final int BALANKI = 30533;
@@ -40,9 +38,7 @@ public class Q010_IntoTheWorld extends Quest
public Q010_IntoTheWorld()
{
super(10, "Into the World");
-
registerQuestItems(VERY_EXPENSIVE_NECKLACE);
-
addStartNpc(BALANKI);
addTalkId(BALANKI, REED, GERALD);
}
@@ -57,35 +53,41 @@ public class Q010_IntoTheWorld extends Quest
return htmltext;
}
- if (event.equals("30533-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30520-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(VERY_EXPENSIVE_NECKLACE, 1);
- }
- else if (event.equals("30650-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VERY_EXPENSIVE_NECKLACE, 1);
- }
- else if (event.equals("30520-04.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30533-05.htm"))
- {
- st.giveItems(SOE_GIRAN, 1);
- st.rewardItems(MARK_OF_TRAVELER, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30533-02.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30520-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(VERY_EXPENSIVE_NECKLACE, 1);
+ break;
+ }
+ case "30650-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VERY_EXPENSIVE_NECKLACE, 1);
+ break;
+ }
+ case "30520-04.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30533-05.htm":
+ {
+ st.giveItems(SOE_GIRAN, 1);
+ st.rewardItems(MARK_OF_TRAVELER, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -104,6 +106,7 @@ public class Q010_IntoTheWorld extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getLevel() >= 3) && (player.getRace() == Race.DWARF))
{
htmltext = "30533-01.htm";
@@ -113,12 +116,14 @@ public class Q010_IntoTheWorld extends Quest
htmltext = "30533-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BALANKI:
+ {
if (cond < 4)
{
htmltext = "30533-03.htm";
@@ -128,8 +133,9 @@ public class Q010_IntoTheWorld extends Quest
htmltext = "30533-04.htm";
}
break;
-
+ }
case REED:
+ {
if (cond == 1)
{
htmltext = "30520-01.htm";
@@ -147,8 +153,9 @@ public class Q010_IntoTheWorld extends Quest
htmltext = "30520-04a.htm";
}
break;
-
+ }
case GERALD:
+ {
if (cond == 2)
{
htmltext = "30650-01.htm";
@@ -158,12 +165,15 @@ public class Q010_IntoTheWorld extends Quest
htmltext = "30650-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q011_SecretMeetingWithKetraOrcs/Q011_SecretMeetingWithKetraOrcs.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q011_SecretMeetingWithKetraOrcs/Q011_SecretMeetingWithKetraOrcs.java
index 4af39d9042..ef865f8576 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q011_SecretMeetingWithKetraOrcs/Q011_SecretMeetingWithKetraOrcs.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q011_SecretMeetingWithKetraOrcs/Q011_SecretMeetingWithKetraOrcs.java
@@ -24,20 +24,17 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q011_SecretMeetingWithKetraOrcs extends Quest
{
- // Npcs
+ // NPCs
private static final int CADMON = 31296;
private static final int LEON = 31256;
private static final int WAHKAN = 31371;
-
// Items
private static final int MUNITIONS_BOX = 7231;
public Q011_SecretMeetingWithKetraOrcs()
{
super(11, "Secret Meeting With Ketra Orcs");
-
registerQuestItems(MUNITIONS_BOX);
-
addStartNpc(CADMON);
addTalkId(CADMON, LEON, WAHKAN);
}
@@ -52,24 +49,28 @@ public class Q011_SecretMeetingWithKetraOrcs extends Quest
return htmltext;
}
- if (event.equals("31296-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31256-02.htm"))
- {
- st.giveItems(MUNITIONS_BOX, 1);
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31371-02.htm"))
- {
- st.takeItems(MUNITIONS_BOX, 1);
- st.rewardExpAndSp(79787, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31296-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31256-02.htm":
+ {
+ st.giveItems(MUNITIONS_BOX, 1);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31371-02.htm":
+ {
+ st.takeItems(MUNITIONS_BOX, 1);
+ st.rewardExpAndSp(79787, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -88,21 +89,25 @@ public class Q011_SecretMeetingWithKetraOrcs extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 74) ? "31296-02.htm" : "31296-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case CADMON:
+ {
if (cond == 1)
{
htmltext = "31296-04.htm";
}
break;
-
+ }
case LEON:
+ {
if (cond == 1)
{
htmltext = "31256-01.htm";
@@ -112,19 +117,23 @@ public class Q011_SecretMeetingWithKetraOrcs extends Quest
htmltext = "31256-03.htm";
}
break;
-
+ }
case WAHKAN:
+ {
if (cond == 2)
{
htmltext = "31371-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q012_SecretMeetingWithVarkaSilenos/Q012_SecretMeetingWithVarkaSilenos.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q012_SecretMeetingWithVarkaSilenos/Q012_SecretMeetingWithVarkaSilenos.java
index 41c2b05a45..6d846b576c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q012_SecretMeetingWithVarkaSilenos/Q012_SecretMeetingWithVarkaSilenos.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q012_SecretMeetingWithVarkaSilenos/Q012_SecretMeetingWithVarkaSilenos.java
@@ -28,16 +28,13 @@ public class Q012_SecretMeetingWithVarkaSilenos extends Quest
private static final int CADMON = 31296;
private static final int HELMUT = 31258;
private static final int NARAN_ASHANUK = 31378;
-
// Items
private static final int MUNITIONS_BOX = 7232;
public Q012_SecretMeetingWithVarkaSilenos()
{
super(12, "Secret Meeting With Varka Silenos");
-
registerQuestItems(MUNITIONS_BOX);
-
addStartNpc(CADMON);
addTalkId(CADMON, HELMUT, NARAN_ASHANUK);
}
@@ -52,24 +49,28 @@ public class Q012_SecretMeetingWithVarkaSilenos extends Quest
return htmltext;
}
- if (event.equals("31296-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31258-02.htm"))
- {
- st.giveItems(MUNITIONS_BOX, 1);
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31378-02.htm"))
- {
- st.takeItems(MUNITIONS_BOX, 1);
- st.rewardExpAndSp(79761, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31296-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31258-02.htm":
+ {
+ st.giveItems(MUNITIONS_BOX, 1);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31378-02.htm":
+ {
+ st.takeItems(MUNITIONS_BOX, 1);
+ st.rewardExpAndSp(79761, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -88,21 +89,25 @@ public class Q012_SecretMeetingWithVarkaSilenos extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 74) ? "31296-02.htm" : "31296-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case CADMON:
+ {
if (cond == 1)
{
htmltext = "31296-04.htm";
}
break;
-
+ }
case HELMUT:
+ {
if (cond == 1)
{
htmltext = "31258-01.htm";
@@ -112,19 +117,23 @@ public class Q012_SecretMeetingWithVarkaSilenos extends Quest
htmltext = "31258-03.htm";
}
break;
-
+ }
case NARAN_ASHANUK:
+ {
if (cond == 2)
{
htmltext = "31378-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q013_ParcelDelivery/Q013_ParcelDelivery.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q013_ParcelDelivery/Q013_ParcelDelivery.java
index 9475cbca48..01100aaff7 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q013_ParcelDelivery/Q013_ParcelDelivery.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q013_ParcelDelivery/Q013_ParcelDelivery.java
@@ -27,16 +27,13 @@ public class Q013_ParcelDelivery extends Quest
// NPCs
private static final int FUNDIN = 31274;
private static final int VULCAN = 31539;
-
// Item
private static final int PACKAGE = 7263;
public Q013_ParcelDelivery()
{
super(13, "Parcel Delivery");
-
registerQuestItems(PACKAGE);
-
addStartNpc(FUNDIN);
addTalkId(FUNDIN, VULCAN);
}
@@ -53,9 +50,7 @@ public class Q013_ParcelDelivery extends Quest
if (event.equals("31274-2.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(PACKAGE, 1);
}
else if (event.equals("31539-1.htm"))
@@ -82,25 +77,32 @@ public class Q013_ParcelDelivery extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 74) ? "31274-1.htm" : "31274-0.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case FUNDIN:
+ {
htmltext = "31274-2.htm";
break;
-
+ }
case VULCAN:
+ {
htmltext = "31539-0.htm";
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q014_WhereaboutsOfTheArchaeologist/Q014_WhereaboutsOfTheArchaeologist.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q014_WhereaboutsOfTheArchaeologist/Q014_WhereaboutsOfTheArchaeologist.java
index 60db27e7ba..a6b3f3c4be 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q014_WhereaboutsOfTheArchaeologist/Q014_WhereaboutsOfTheArchaeologist.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q014_WhereaboutsOfTheArchaeologist/Q014_WhereaboutsOfTheArchaeologist.java
@@ -27,16 +27,13 @@ public class Q014_WhereaboutsOfTheArchaeologist extends Quest
// NPCs
private static final int LIESEL = 31263;
private static final int GHOST_OF_ADVENTURER = 31538;
-
// Items
private static final int LETTER = 7253;
public Q014_WhereaboutsOfTheArchaeologist()
{
super(14, "Whereabouts of the Archaeologist");
-
registerQuestItems(LETTER);
-
addStartNpc(LIESEL);
addTalkId(LIESEL, GHOST_OF_ADVENTURER);
}
@@ -53,9 +50,7 @@ public class Q014_WhereaboutsOfTheArchaeologist extends Quest
if (event.equals("31263-2.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(LETTER, 1);
}
else if (event.equals("31538-1.htm"))
@@ -82,25 +77,32 @@ public class Q014_WhereaboutsOfTheArchaeologist extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 74) ? "31263-1.htm" : "31263-0.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case LIESEL:
+ {
htmltext = "31263-2.htm";
break;
-
+ }
case GHOST_OF_ADVENTURER:
+ {
htmltext = "31538-0.htm";
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q015_SweetWhispers/Q015_SweetWhispers.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q015_SweetWhispers/Q015_SweetWhispers.java
index 1d4e74e636..2513cabcd8 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q015_SweetWhispers/Q015_SweetWhispers.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q015_SweetWhispers/Q015_SweetWhispers.java
@@ -32,7 +32,6 @@ public class Q015_SweetWhispers extends Quest
public Q015_SweetWhispers()
{
super(15, "Sweet Whispers");
-
addStartNpc(VLADIMIR);
addTalkId(VLADIMIR, HIERARCH, MYSTERIOUS_NECRO);
}
@@ -47,22 +46,26 @@ public class Q015_SweetWhispers extends Quest
return htmltext;
}
- if (event.equals("31302-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31518-01.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31517-01.htm"))
- {
- st.rewardExpAndSp(60217, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31302-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31518-01.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31517-01.htm":
+ {
+ st.rewardExpAndSp(60217, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -81,18 +84,22 @@ public class Q015_SweetWhispers extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "31302-00a.htm" : "31302-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VLADIMIR:
+ {
htmltext = "31302-01a.htm";
break;
-
+ }
case MYSTERIOUS_NECRO:
+ {
if (cond == 1)
{
htmltext = "31518-00.htm";
@@ -102,19 +109,23 @@ public class Q015_SweetWhispers extends Quest
htmltext = "31518-01a.htm";
}
break;
-
+ }
case HIERARCH:
+ {
if (cond == 2)
{
htmltext = "31517-00.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q016_TheComingDarkness/Q016_TheComingDarkness.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q016_TheComingDarkness/Q016_TheComingDarkness.java
index c071211438..84e9786e5e 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q016_TheComingDarkness/Q016_TheComingDarkness.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q016_TheComingDarkness/Q016_TheComingDarkness.java
@@ -38,9 +38,7 @@ public class Q016_TheComingDarkness extends Quest
public Q016_TheComingDarkness()
{
super(16, "The Coming Darkness");
-
registerQuestItems(CRYSTAL_OF_SEAL);
-
addStartNpc(HIERARCH);
addTalkId(HIERARCH, EVIL_ALTAR_1, EVIL_ALTAR_2, EVIL_ALTAR_3, EVIL_ALTAR_4, EVIL_ALTAR_5);
}
@@ -55,42 +53,49 @@ public class Q016_TheComingDarkness extends Quest
return htmltext;
}
- if (event.equals("31517-2.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(CRYSTAL_OF_SEAL, 5);
- }
- else if (event.equals("31512-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRYSTAL_OF_SEAL, 1);
- }
- else if (event.equals("31513-1.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRYSTAL_OF_SEAL, 1);
- }
- else if (event.equals("31514-1.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRYSTAL_OF_SEAL, 1);
- }
- else if (event.equals("31515-1.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRYSTAL_OF_SEAL, 1);
- }
- else if (event.equals("31516-1.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRYSTAL_OF_SEAL, 1);
+ case "31517-2.htm":
+ {
+ st.startQuest();
+ st.giveItems(CRYSTAL_OF_SEAL, 5);
+ break;
+ }
+ case "31512-1.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRYSTAL_OF_SEAL, 1);
+ break;
+ }
+ case "31513-1.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRYSTAL_OF_SEAL, 1);
+ break;
+ }
+ case "31514-1.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRYSTAL_OF_SEAL, 1);
+ break;
+ }
+ case "31515-1.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRYSTAL_OF_SEAL, 1);
+ break;
+ }
+ case "31516-1.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRYSTAL_OF_SEAL, 1);
+ break;
+ }
}
return htmltext;
@@ -109,16 +114,19 @@ public class Q016_TheComingDarkness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 62) ? "31517-0a.htm" : "31517-0.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
switch (npcId)
{
case HIERARCH:
+ {
if (cond == 6)
{
htmltext = "31517-4.htm";
@@ -139,12 +147,13 @@ public class Q016_TheComingDarkness extends Quest
}
}
break;
-
+ }
case EVIL_ALTAR_1:
case EVIL_ALTAR_2:
case EVIL_ALTAR_3:
case EVIL_ALTAR_4:
case EVIL_ALTAR_5:
+ {
final int condAltar = npcId - 31511;
if (cond == condAltar)
{
@@ -162,12 +171,15 @@ public class Q016_TheComingDarkness extends Quest
htmltext = npcId + "-2.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q017_LightAndDarkness/Q017_LightAndDarkness.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q017_LightAndDarkness/Q017_LightAndDarkness.java
index a9c951d31d..2d1c289c07 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q017_LightAndDarkness/Q017_LightAndDarkness.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q017_LightAndDarkness/Q017_LightAndDarkness.java
@@ -24,22 +24,19 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q017_LightAndDarkness extends Quest
{
- // Items
- private static final int BLOOD_OF_SAINT = 7168;
-
// NPCs
private static final int HIERARCH = 31517;
private static final int SAINT_ALTAR_1 = 31508;
private static final int SAINT_ALTAR_2 = 31509;
private static final int SAINT_ALTAR_3 = 31510;
private static final int SAINT_ALTAR_4 = 31511;
+ // Items
+ private static final int BLOOD_OF_SAINT = 7168;
public Q017_LightAndDarkness()
{
super(17, "Light and Darkness");
-
registerQuestItems(BLOOD_OF_SAINT);
-
addStartNpc(HIERARCH);
addTalkId(HIERARCH, SAINT_ALTAR_1, SAINT_ALTAR_2, SAINT_ALTAR_3, SAINT_ALTAR_4);
}
@@ -54,63 +51,69 @@ public class Q017_LightAndDarkness extends Quest
return htmltext;
}
- if (event.equals("31517-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(BLOOD_OF_SAINT, 4);
- }
- else if (event.equals("31508-02.htm"))
- {
- if (st.hasQuestItems(BLOOD_OF_SAINT))
+ case "31517-04.htm":
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_OF_SAINT, 1);
+ st.startQuest();
+ st.giveItems(BLOOD_OF_SAINT, 4);
+ break;
}
- else
+ case "31508-02.htm":
{
- htmltext = "31508-03.htm";
+ if (st.hasQuestItems(BLOOD_OF_SAINT))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_OF_SAINT, 1);
+ }
+ else
+ {
+ htmltext = "31508-03.htm";
+ }
+ break;
}
- }
- else if (event.equals("31509-02.htm"))
- {
- if (st.hasQuestItems(BLOOD_OF_SAINT))
+ case "31509-02.htm":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_OF_SAINT, 1);
+ if (st.hasQuestItems(BLOOD_OF_SAINT))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_OF_SAINT, 1);
+ }
+ else
+ {
+ htmltext = "31509-03.htm";
+ }
+ break;
}
- else
+ case "31510-02.htm":
{
- htmltext = "31509-03.htm";
+ if (st.hasQuestItems(BLOOD_OF_SAINT))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_OF_SAINT, 1);
+ }
+ else
+ {
+ htmltext = "31510-03.htm";
+ }
+ break;
}
- }
- else if (event.equals("31510-02.htm"))
- {
- if (st.hasQuestItems(BLOOD_OF_SAINT))
+ case "31511-02.htm":
{
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_OF_SAINT, 1);
- }
- else
- {
- htmltext = "31510-03.htm";
- }
- }
- else if (event.equals("31511-02.htm"))
- {
- if (st.hasQuestItems(BLOOD_OF_SAINT))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_OF_SAINT, 1);
- }
- else
- {
- htmltext = "31511-03.htm";
+ if (st.hasQuestItems(BLOOD_OF_SAINT))
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_OF_SAINT, 1);
+ }
+ else
+ {
+ htmltext = "31511-03.htm";
+ }
+ break;
}
}
@@ -130,14 +133,17 @@ public class Q017_LightAndDarkness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 61) ? "31517-03.htm" : "31517-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HIERARCH:
+ {
if (cond == 5)
{
htmltext = "31517-07.htm";
@@ -158,8 +164,9 @@ public class Q017_LightAndDarkness extends Quest
}
}
break;
-
+ }
case SAINT_ALTAR_1:
+ {
if (cond == 1)
{
htmltext = "31508-01.htm";
@@ -169,8 +176,9 @@ public class Q017_LightAndDarkness extends Quest
htmltext = "31508-04.htm";
}
break;
-
+ }
case SAINT_ALTAR_2:
+ {
if (cond == 2)
{
htmltext = "31509-01.htm";
@@ -180,8 +188,9 @@ public class Q017_LightAndDarkness extends Quest
htmltext = "31509-04.htm";
}
break;
-
+ }
case SAINT_ALTAR_3:
+ {
if (cond == 3)
{
htmltext = "31510-01.htm";
@@ -191,8 +200,9 @@ public class Q017_LightAndDarkness extends Quest
htmltext = "31510-04.htm";
}
break;
-
+ }
case SAINT_ALTAR_4:
+ {
if (cond == 4)
{
htmltext = "31511-01.htm";
@@ -202,12 +212,15 @@ public class Q017_LightAndDarkness extends Quest
htmltext = "31511-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q018_MeetingWithTheGoldenRam/Q018_MeetingWithTheGoldenRam.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q018_MeetingWithTheGoldenRam/Q018_MeetingWithTheGoldenRam.java
index 9f714ad046..301a62b3ee 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q018_MeetingWithTheGoldenRam/Q018_MeetingWithTheGoldenRam.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q018_MeetingWithTheGoldenRam/Q018_MeetingWithTheGoldenRam.java
@@ -24,20 +24,18 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q018_MeetingWithTheGoldenRam extends Quest
{
- // Items
- private static final int SUPPLY_BOX = 7245;
-
// NPCs
private static final int DONAL = 31314;
private static final int DAISY = 31315;
private static final int ABERCROMBIE = 31555;
+ // Items
+ private static final int SUPPLY_BOX = 7245;
public Q018_MeetingWithTheGoldenRam()
{
super(18, "Meeting with the Golden Ram");
registerQuestItems(SUPPLY_BOX);
-
addStartNpc(DONAL);
addTalkId(DONAL, DAISY, ABERCROMBIE);
}
@@ -52,25 +50,29 @@ public class Q018_MeetingWithTheGoldenRam extends Quest
return htmltext;
}
- if (event.equals("31314-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31315-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(SUPPLY_BOX, 1);
- }
- else if (event.equals("31555-02.htm"))
- {
- st.takeItems(SUPPLY_BOX, 1);
- st.rewardItems(57, 15000);
- st.rewardExpAndSp(50000, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31314-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31315-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(SUPPLY_BOX, 1);
+ break;
+ }
+ case "31555-02.htm":
+ {
+ st.takeItems(SUPPLY_BOX, 1);
+ st.rewardItems(57, 15000);
+ st.rewardExpAndSp(50000, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -89,18 +91,22 @@ public class Q018_MeetingWithTheGoldenRam extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 66) ? "31314-02.htm" : "31314-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case DONAL:
+ {
htmltext = "31314-04.htm";
break;
-
+ }
case DAISY:
+ {
if (cond == 1)
{
htmltext = "31315-01.htm";
@@ -110,19 +116,23 @@ public class Q018_MeetingWithTheGoldenRam extends Quest
htmltext = "31315-03.htm";
}
break;
-
+ }
case ABERCROMBIE:
+ {
if (cond == 2)
{
htmltext = "31555-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q019_GoToThePastureland/Q019_GoToThePastureland.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q019_GoToThePastureland/Q019_GoToThePastureland.java
index 210cb3659c..650a217e45 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q019_GoToThePastureland/Q019_GoToThePastureland.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q019_GoToThePastureland/Q019_GoToThePastureland.java
@@ -24,19 +24,16 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q019_GoToThePastureland extends Quest
{
- // Items
- private static final int YOUNG_WILD_BEAST_MEAT = 7547;
-
// NPCs
private static final int VLADIMIR = 31302;
private static final int TUNATUN = 31537;
+ // Items
+ private static final int YOUNG_WILD_BEAST_MEAT = 7547;
public Q019_GoToThePastureland()
{
super(19, "Go to the Pastureland!");
-
registerQuestItems(YOUNG_WILD_BEAST_MEAT);
-
addStartNpc(VLADIMIR);
addTalkId(VLADIMIR, TUNATUN);
}
@@ -53,9 +50,7 @@ public class Q019_GoToThePastureland extends Quest
if (event.equals("31302-01.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(YOUNG_WILD_BEAST_MEAT, 1);
}
else if (event.equals("019_finish"))
@@ -89,10 +84,12 @@ public class Q019_GoToThePastureland extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 63) ? "31302-03.htm" : "31302-00.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case VLADIMIR:
@@ -104,10 +101,12 @@ public class Q019_GoToThePastureland extends Quest
break;
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q020_BringUpWithLove/Q020_BringUpWithLove.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q020_BringUpWithLove/Q020_BringUpWithLove.java
index c8d72609b3..d2a3647259 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q020_BringUpWithLove/Q020_BringUpWithLove.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q020_BringUpWithLove/Q020_BringUpWithLove.java
@@ -30,9 +30,7 @@ public class Q020_BringUpWithLove extends Quest
public Q020_BringUpWithLove()
{
super(20, "Bring Up With Love");
-
registerQuestItems(JEWEL_OF_INNOCENCE);
-
addStartNpc(31537); // Tunatun
addTalkId(31537);
}
@@ -49,9 +47,7 @@ public class Q020_BringUpWithLove extends Quest
if (event.equals("31537-09.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31537-12.htm"))
{
@@ -77,11 +73,13 @@ public class Q020_BringUpWithLove extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 65) ? "31537-02.htm" : "31537-01.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 2)
+ {
+ if (st.isCond(2))
{
htmltext = "31537-11.htm";
}
@@ -90,10 +88,12 @@ public class Q020_BringUpWithLove extends Quest
htmltext = "31537-10.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q021_HiddenTruth/Q021_HiddenTruth.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q021_HiddenTruth/Q021_HiddenTruth.java
index c978a00c47..5750423758 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q021_HiddenTruth/Q021_HiddenTruth.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q021_HiddenTruth/Q021_HiddenTruth.java
@@ -36,7 +36,6 @@ public class Q021_HiddenTruth extends Quest
private static final int DOMINIC = 31350;
private static final int BENEDICT = 31349;
private static final int INNOCENTIN = 31328;
-
// Items
private static final int CROSS_OF_EINHASAD = 7140;
private static final int CROSS_OF_EINHASAD_NEXT_QUEST = 7141;
@@ -54,9 +53,7 @@ public class Q021_HiddenTruth extends Quest
public Q021_HiddenTruth()
{
super(21, "Hidden Truth");
-
registerQuestItems(CROSS_OF_EINHASAD);
-
addStartNpc(MYSTERIOUS_WIZARD);
addTalkId(MYSTERIOUS_WIZARD, TOMBSTONE, VON_HELLMAN_DUKE, VON_HELLMAN_PAGE, BROKEN_BOOKSHELF, AGRIPEL, DOMINIC, BENEDICT, INNOCENTIN);
}
@@ -71,87 +68,94 @@ public class Q021_HiddenTruth extends Quest
return htmltext;
}
- if (event.equals("31522-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31523-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- spawnTheDuke(player);
- }
- else if (event.equals("31524-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- spawnThePage(player);
- }
- else if (event.equals("31526-08.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31526-14.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CROSS_OF_EINHASAD, 1);
- }
- else if (event.equals("1"))
- {
- _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[0]);
- _page.broadcastNpcSay("Follow me...");
- startQuestTimer("2", 5000, _page, player, false);
- return null;
- }
- else if (event.equals("2"))
- {
- _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[1]);
- startQuestTimer("3", 12000, _page, player, false);
- return null;
- }
- else if (event.equals("3"))
- {
- _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[2]);
- startQuestTimer("4", 18000, _page, player, false);
- return null;
- }
- else if (event.equals("4"))
- {
- st.set("end_walk", "1");
- _page.broadcastNpcSay("Please check this bookcase, " + player.getName() + ".");
- startQuestTimer("5", 47000, _page, player, false);
- return null;
- }
- else if (event.equals("5"))
- {
- _page.broadcastNpcSay("I'm confused! Maybe it's time to go back.");
- return null;
- }
- else if (event.equals("31328-05.htm"))
- {
- if (st.hasQuestItems(CROSS_OF_EINHASAD))
+ case "31522-02.htm":
{
- st.takeItems(CROSS_OF_EINHASAD, 1);
- st.giveItems(CROSS_OF_EINHASAD_NEXT_QUEST, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.startQuest();
+ break;
+ }
+ case "31523-03.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ spawnTheDuke(player);
+ break;
+ }
+ case "31524-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ spawnThePage(player);
+ break;
+ }
+ case "31526-08.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31526-14.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CROSS_OF_EINHASAD, 1);
+ break;
+ }
+ case "1":
+ {
+ _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[0]);
+ _page.broadcastNpcSay("Follow me...");
+ startQuestTimer("2", 5000, _page, player, false);
+ return null;
+ }
+ case "2":
+ {
+ _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[1]);
+ startQuestTimer("3", 12000, _page, player, false);
+ return null;
+ }
+ case "3":
+ {
+ _page.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, PAGE_LOCS[2]);
+ startQuestTimer("4", 18000, _page, player, false);
+ return null;
+ }
+ case "4":
+ {
+ st.set("end_walk", "1");
+ _page.broadcastNpcSay("Please check this bookcase, " + player.getName() + ".");
+ startQuestTimer("5", 47000, _page, player, false);
+ return null;
+ }
+ case "5":
+ {
+ _page.broadcastNpcSay("I'm confused! Maybe it's time to go back.");
+ return null;
+ }
+ case "31328-05.htm":
+ {
+ if (st.hasQuestItems(CROSS_OF_EINHASAD))
+ {
+ st.takeItems(CROSS_OF_EINHASAD, 1);
+ st.giveItems(CROSS_OF_EINHASAD_NEXT_QUEST, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
+ }
+ case "dukeDespawn":
+ {
+ _duke.deleteMe();
+ _duke = null;
+ return null;
+ }
+ case "pageDespawn":
+ {
+ _page.deleteMe();
+ _page = null;
+ return null;
}
- }
- else if (event.equals("dukeDespawn"))
- {
- _duke.deleteMe();
- _duke = null;
- return null;
- }
- else if (event.equals("pageDespawn"))
- {
- _page.deleteMe();
- _page = null;
- return null;
}
return htmltext;
@@ -170,18 +174,22 @@ public class Q021_HiddenTruth extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 63) ? "31522-03.htm" : "31522-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MYSTERIOUS_WIZARD:
+ {
htmltext = "31522-05.htm";
break;
-
+ }
case TOMBSTONE:
+ {
if (cond == 1)
{
htmltext = "31523-01.htm";
@@ -196,8 +204,9 @@ public class Q021_HiddenTruth extends Quest
htmltext = "31523-04.htm";
}
break;
-
+ }
case VON_HELLMAN_DUKE:
+ {
if (cond == 2)
{
htmltext = "31524-01.htm";
@@ -212,14 +221,15 @@ public class Q021_HiddenTruth extends Quest
htmltext = "31524-07a.htm";
}
break;
-
+ }
case VON_HELLMAN_PAGE:
+ {
if (cond == 3)
{
if (st.getInt("end_walk") == 1)
{
htmltext = "31525-02.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -232,12 +242,13 @@ public class Q021_HiddenTruth extends Quest
htmltext = "31525-02.htm";
}
break;
-
+ }
case BROKEN_BOOKSHELF:
+ {
if (((cond == 3) && (st.getInt("end_walk") == 1)) || (cond == 4))
{
htmltext = "31526-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
if (_page != null)
@@ -264,10 +275,11 @@ public class Q021_HiddenTruth extends Quest
htmltext = "31526-15.htm";
}
break;
-
+ }
case AGRIPEL:
case BENEDICT:
case DOMINIC:
+ {
if (((cond == 6) || (cond == 7)) && st.hasQuestItems(CROSS_OF_EINHASAD))
{
final int npcId = npc.getNpcId();
@@ -295,7 +307,7 @@ public class Q021_HiddenTruth extends Quest
if ((st.getInt(String.valueOf(npcId1)) == 1) && (st.getInt(String.valueOf(npcId2)) == 1))
{
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -307,17 +319,20 @@ public class Q021_HiddenTruth extends Quest
htmltext = npcId + "-01.htm";
}
break;
-
+ }
case INNOCENTIN:
+ {
if ((cond == 7) && st.hasQuestItems(CROSS_OF_EINHASAD))
{
htmltext = "31328-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
if (npc.getNpcId() == INNOCENTIN)
{
htmltext = "31328-06.htm";
@@ -327,6 +342,7 @@ public class Q021_HiddenTruth extends Quest
htmltext = getAlreadyCompletedMsg();
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q022_TragedyInVonHellmannForest/Q022_TragedyInVonHellmannForest.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q022_TragedyInVonHellmannForest/Q022_TragedyInVonHellmannForest.java
index 2f31ba52e2..2f3ab6066e 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q022_TragedyInVonHellmannForest/Q022_TragedyInVonHellmannForest.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q022_TragedyInVonHellmannForest/Q022_TragedyInVonHellmannForest.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.QuestTimer;
-import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.util.Util;
import quests.Q021_HiddenTruth.Q021_HiddenTruth;
@@ -38,7 +37,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
private static final int WELL = 31527;
private static final int GHOST_OF_PRIEST = 31528;
private static final int GHOST_OF_ADVENTURER = 31529;
- // Mobs
+ // Monsters
private static final int[] MOBS =
{
21553, // Trampled Man
@@ -66,7 +65,6 @@ public class Q022_TragedyInVonHellmannForest extends Quest
public Q022_TragedyInVonHellmannForest()
{
super(22, "Tragedy in von Hellmann Forest");
-
addKillId(MOBS);
addKillId(SOUL_OF_WELL);
addAttackId(SOUL_OF_WELL);
@@ -135,9 +133,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
{
if (qs.isCreated())
{
- qs.setState(State.STARTED);
- qs.set("cond", "1");
- qs.playSound(QuestState.SOUND_ACCEPT);
+ qs.startQuest();
htmltext = event;
}
break;
@@ -146,21 +142,21 @@ public class Q022_TragedyInVonHellmannForest extends Quest
{
if (!qs.hasQuestItems(CROSS_OF_EINHASAD))
{
- qs.set("cond", "2");
+ qs.setCond(2);
htmltext = event;
}
else
{
htmltext = "31334-06.htm";
- qs.set("cond", "3");
+ qs.setCond(3);
}
break;
}
case "31334-08.htm":
{
- if (qs.getInt("cond") == 3)
+ if (qs.isCond(3))
{
- qs.set("cond", "4");
+ qs.setCond(4);
qs.playSound(QuestState.SOUND_MIDDLE);
htmltext = event;
}
@@ -168,7 +164,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31334-13.htm":
{
- final int cond = qs.getInt("cond");
+ final int cond = qs.getCond();
if (((5 <= cond) && (cond <= 7)) && qs.hasQuestItems(CROSS_OF_EINHASAD))
{
if (_tifarenOwner == 0)
@@ -181,14 +177,14 @@ public class Q022_TragedyInVonHellmannForest extends Quest
if (((cond == 5) || (cond == 6)) && qs.hasQuestItems(LOST_SKULL_OF_ELF))
{
qs.takeItems(LOST_SKULL_OF_ELF, -1);
- qs.set("cond", "7");
+ qs.setCond(7);
qs.playSound(QuestState.SOUND_MIDDLE);
}
htmltext = event;
}
else
{
- qs.set("cond", "6");
+ qs.setCond(6);
htmltext = "31334-14.htm";
}
}
@@ -211,7 +207,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
qt.cancel();
npc.setScriptValue(0);
startQuestTimer("DESPAWN_GHOST2", 1000 * 3, npc, player);
- qs.set("cond", "8");
+ qs.setCond(8);
qs.playSound(QuestState.SOUND_MIDDLE);
htmltext = event;
}
@@ -229,7 +225,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31328-03.htm":
{
- if (qs.getInt("cond") == 8)
+ if (qs.isCond(8))
{
qs.takeItems(CROSS_OF_EINHASAD, -1);
@@ -239,10 +235,10 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31328-09.htm":
{
- if (qs.getInt("cond") == 8)
+ if (qs.isCond(8))
{
qs.giveItems(LETTER_OF_INNOCENTIN, 1);
- qs.set("cond", "9");
+ qs.setCond(9);
qs.playSound(QuestState.SOUND_MIDDLE);
htmltext = event;
}
@@ -250,10 +246,10 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31328-11.htm":
{
- if ((qs.getInt("cond") == 14) && qs.hasQuestItems(REPORT_BOX))
+ if (qs.isCond(14) && qs.hasQuestItems(REPORT_BOX))
{
qs.takeItems(REPORT_BOX, -1);
- qs.set("cond", "15");
+ qs.setCond(15);
qs.playSound(QuestState.SOUND_MIDDLE);
htmltext = event;
}
@@ -261,9 +257,9 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31328-19.htm":
{
- if (qs.getInt("cond") == 15)
+ if (qs.isCond(15))
{
- qs.set("cond", "16");
+ qs.setCond(16);
qs.playSound(QuestState.SOUND_MIDDLE);
htmltext = event;
}
@@ -271,7 +267,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31527-02.htm":
{
- if ((qs.getInt("cond") == 10) && (_soulWellNpc == null))
+ if (qs.isCond(10) && (_soulWellNpc == null))
{
_soulWellNpc = addSpawn(SOUL_OF_WELL, SOUL_WELL_LOC, true, 0);
startQuestTimer("activateSoulOfWell", 90000, _soulWellNpc, player);
@@ -304,7 +300,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case "31529-03.htm":
{
- if ((qs.getInt("cond") == 9) && qs.hasQuestItems(LETTER_OF_INNOCENTIN))
+ if (qs.isCond(9) && qs.hasQuestItems(LETTER_OF_INNOCENTIN))
{
qs.set("memoState", "8");
htmltext = event;
@@ -325,7 +321,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
if (qs.getInt("memoState") == 9)
{
qs.giveItems(JEWEL_OF_ADVENTURER_1, 1);
- qs.set("cond", "10");
+ qs.setCond(10);
qs.playSound(QuestState.SOUND_MIDDLE);
qs.set("memoState", "10");
htmltext = event;
@@ -345,7 +341,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
{
case TIFAREN:
{
- switch (qs.getInt("cond"))
+ switch (qs.getCond())
{
case 0:
{
@@ -401,7 +397,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
else
{
htmltext = "31334-16.htm";
- qs.set("cond", "6");
+ qs.setCond(6);
}
}
break;
@@ -431,14 +427,14 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case INNOCENTIN:
{
- switch (qs.getInt("cond"))
+ switch (qs.getCond())
{
case 2:
{
if (!qs.hasQuestItems(CROSS_OF_EINHASAD))
{
qs.giveItems(CROSS_OF_EINHASAD, 1);
- qs.set("cond", "3");
+ qs.setCond(3);
htmltext = "31328-01.htm";
}
break;
@@ -500,7 +496,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case WELL:
{
- switch (qs.getInt("cond"))
+ switch (qs.getCond())
{
case 10:
{
@@ -516,7 +512,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
if (qs.hasQuestItems(JEWEL_OF_ADVENTURER_2) && !qs.hasQuestItems(SEALED_REPORT_BOX))
{
qs.giveItems(SEALED_REPORT_BOX, 1);
- qs.set("cond", "13");
+ qs.setCond(13);
htmltext = "31527-04.htm";
}
break;
@@ -534,7 +530,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
}
case GHOST_OF_ADVENTURER:
{
- switch (qs.getInt("cond"))
+ switch (qs.getCond())
{
case 9:
{
@@ -586,7 +582,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
if (qs.hasQuestItems(JEWEL_OF_ADVENTURER_2) && !qs.hasQuestItems(SEALED_REPORT_BOX))
{
htmltext = "31529-15.htm";
- qs.set("cond", "12");
+ qs.setCond(12);
}
break;
}
@@ -597,7 +593,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
qs.giveItems(REPORT_BOX, 1);
qs.takeItems(SEALED_REPORT_BOX, -1);
qs.takeItems(JEWEL_OF_ADVENTURER_2, -1);
- qs.set("cond", "14");
+ qs.setCond(14);
htmltext = "31529-16.htm";
}
break;
@@ -621,7 +617,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isSummon)
{
final QuestState qs = attacker.getQuestState(getName());
- if ((qs != null) && (qs.getInt("cond") == 10) && qs.hasQuestItems(JEWEL_OF_ADVENTURER_1))
+ if ((qs != null) && qs.isCond(10) && qs.hasQuestItems(JEWEL_OF_ADVENTURER_1))
{
if (qs.getInt("memoState") == 10)
{
@@ -631,7 +627,7 @@ public class Q022_TragedyInVonHellmannForest extends Quest
{
qs.takeItems(JEWEL_OF_ADVENTURER_1, -1);
qs.giveItems(JEWEL_OF_ADVENTURER_2, 1);
- qs.set("cond", "11");
+ qs.setCond(11);
}
}
return super.onAttack(npc, attacker, damage, isSummon);
@@ -649,10 +645,10 @@ public class Q022_TragedyInVonHellmannForest extends Quest
else
{
final QuestState qs = killer.getQuestState(getName());
- if ((qs != null) && (qs.getInt("cond") == 4) && qs.hasQuestItems(CROSS_OF_EINHASAD) && !qs.hasQuestItems(LOST_SKULL_OF_ELF) && (Rnd.get(100) < 10))
+ if ((qs != null) && qs.isCond(4) && qs.hasQuestItems(CROSS_OF_EINHASAD) && !qs.hasQuestItems(LOST_SKULL_OF_ELF) && (Rnd.get(100) < 10))
{
qs.giveItems(LOST_SKULL_OF_ELF, 1);
- qs.set("cond", "5");
+ qs.setCond(5);
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q023_LidiasHeart/Q023_LidiasHeart.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q023_LidiasHeart/Q023_LidiasHeart.java
index 245e00afeb..7a328fc142 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q023_LidiasHeart/Q023_LidiasHeart.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q023_LidiasHeart/Q023_LidiasHeart.java
@@ -64,105 +64,117 @@ public class Q023_LidiasHeart extends Quest
return htmltext;
}
- if (event.equals("31328-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(FOREST_OF_DEADMAN_MAP, 1);
- st.giveItems(SILVER_KEY, 1);
- }
- else if (event.equals("31328-06.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31526-05.htm"))
- {
- if (!st.hasQuestItems(LIDIA_HAIRPIN))
+ case "31328-02.htm":
{
- st.giveItems(LIDIA_HAIRPIN, 1);
- if (st.hasQuestItems(LIDIA_DIARY))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- }
+ st.startQuest();
+ st.giveItems(FOREST_OF_DEADMAN_MAP, 1);
+ st.giveItems(SILVER_KEY, 1);
+ break;
}
- }
- else if (event.equals("31526-11.htm"))
- {
- if (!st.hasQuestItems(LIDIA_DIARY))
+ case "31328-06.htm":
{
- st.giveItems(LIDIA_DIARY, 1);
- if (st.hasQuestItems(LIDIA_HAIRPIN))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- }
- }
- else if (event.equals("31328-11.htm"))
- {
- if (st.getInt("cond") < 5)
- {
- st.set("cond", "5");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("31328-19.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31524-04.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LIDIA_DIARY, 1);
- }
- else if (event.equals("31523-02.htm"))
- {
- if (_ghost == null)
+ case "31526-05.htm":
{
- _ghost = addSpawn(31524, 51432, -54570, -3136, 0, false, 60000);
- _ghost.broadcastNpcSay("Who awoke me?");
- startQuestTimer("ghost_cleanup", 58000, null, player, false);
+ if (!st.hasQuestItems(LIDIA_HAIRPIN))
+ {
+ st.giveItems(LIDIA_HAIRPIN, 1);
+ if (st.hasQuestItems(LIDIA_DIARY))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ }
+ break;
}
- }
- else if (event.equals("31523-05.htm"))
- {
- // Don't launch twice the same task...
- if (getQuestTimer("tomb_digger", null, player) == null)
+ case "31526-11.htm":
{
- startQuestTimer("tomb_digger", 10000, null, player, false);
+ if (!st.hasQuestItems(LIDIA_DIARY))
+ {
+ st.giveItems(LIDIA_DIARY, 1);
+ if (st.hasQuestItems(LIDIA_HAIRPIN))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ }
+ break;
+ }
+ case "31328-11.htm":
+ {
+ if (st.getCond() < 5)
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
+ }
+ case "31328-19.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31524-04.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LIDIA_DIARY, 1);
+ break;
+ }
+ case "31523-02.htm":
+ {
+ if (_ghost == null)
+ {
+ _ghost = addSpawn(31524, 51432, -54570, -3136, 0, false, 60000);
+ _ghost.broadcastNpcSay("Who awoke me?");
+ startQuestTimer("ghost_cleanup", 58000, null, player, false);
+ }
+ break;
+ }
+ case "31523-05.htm":
+ {
+ // Don't launch twice the same task...
+ if (getQuestTimer("tomb_digger", null, player) == null)
+ {
+ startQuestTimer("tomb_digger", 10000, null, player, false);
+ }
+ break;
+ }
+ case "tomb_digger":
+ {
+ htmltext = "31523-06.htm";
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(SILVER_KEY, 1);
+ break;
+ }
+ case "31530-02.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SILVER_KEY, 1);
+ st.giveItems(SILVER_SPEAR, 1);
+ break;
+ }
+ case "ghost_cleanup":
+ {
+ _ghost = null;
+ return null;
}
- }
- else if (event.equals("tomb_digger"))
- {
- htmltext = "31523-06.htm";
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(SILVER_KEY, 1);
- }
- else if (event.equals("31530-02.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SILVER_KEY, 1);
- st.giveItems(SILVER_SPEAR, 1);
- }
- else if (event.equals("ghost_cleanup"))
- {
- _ghost = null;
- return null;
}
return htmltext;
}
@@ -180,6 +192,7 @@ public class Q023_LidiasHeart extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
final QuestState st2 = player.getQuestState(Q022_TragedyInVonHellmannForest.class.getSimpleName());
if ((st2 != null) && st2.isCompleted())
{
@@ -197,12 +210,14 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31328-00.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case INNOCENTIN:
+ {
if (cond == 1)
{
htmltext = "31328-03.htm";
@@ -224,12 +239,13 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31328-21.htm";
}
break;
-
+ }
case BROKEN_BOOKSHELF:
+ {
if (cond == 2)
{
htmltext = "31526-00.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 3)
@@ -248,8 +264,9 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31526-13.htm";
}
break;
-
+ }
case GHOST_OF_VON_HELLMANN:
+ {
if (cond == 6)
{
htmltext = "31524-01.htm";
@@ -259,8 +276,9 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31524-05.htm";
}
break;
-
+ }
case TOMBSTONE:
+ {
if (cond == 6)
{
htmltext = (_ghost == null) ? "31523-01.htm" : "31523-03.htm";
@@ -274,12 +292,13 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31523-06.htm";
}
break;
-
+ }
case VIOLET:
+ {
if (cond == 8)
{
htmltext = "31386-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 9)
@@ -299,12 +318,13 @@ public class Q023_LidiasHeart extends Quest
else
{
htmltext = "31386-02.htm";
- st.set("cond", "9");
+ st.setCond(9);
}
}
break;
-
+ }
case BOX:
+ {
if (cond == 9)
{
htmltext = "31530-01.htm";
@@ -314,10 +334,12 @@ public class Q023_LidiasHeart extends Quest
htmltext = "31530-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
if (npc.getNpcId() == VIOLET)
{
htmltext = "31386-04.htm";
@@ -327,6 +349,7 @@ public class Q023_LidiasHeart extends Quest
htmltext = getAlreadyCompletedMsg();
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForestOfTheDead/Q024_InhabitantsOfTheForestOfTheDead.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForestOfTheDead/Q024_InhabitantsOfTheForestOfTheDead.java
index f7fcdeeab0..d6ed585570 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForestOfTheDead/Q024_InhabitantsOfTheForestOfTheDead.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForestOfTheDead/Q024_InhabitantsOfTheForestOfTheDead.java
@@ -67,105 +67,122 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
@Override
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{
- String htmltext = event;
QuestState st = player.getQuestState(getName());
if (st == null)
{
return event;
}
- if (event.equals("31389-03.htm"))
+
+ String htmltext = event;
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("state", "1");
- st.playSound("ItemSound.quest_accept");
- st.giveItems(FLOWER, 1);
- }
- else if (event.equals("31389-08.htm"))
- {
- st.set("state", "3");
- }
- else if (event.equals("31389-13.htm"))
- {
- st.set("cond", "3");
- st.set("state", "4");
- st.playSound("ItemSound.quest_middle");
- st.giveItems(SILVER_CROSS, 1);
- }
- else if (event.equals("31389-18.htm"))
- {
- st.playSound("InterfaceSound.charstat_open_01");
- }
- else if (event.equals("31389-19.htm"))
- {
- st.set("cond", "5");
- st.set("state", "5");
- st.takeItems(BROKEN_SILVER_CROSS, -1);
- st.playSound("ItemSound.quest_middle");
- }
- else if (event.equals("31522-03.htm"))
- {
- st.set("state", "12");
- st.takeItems(TOTEM, -1);
- }
- else if (event.equals("31522-08.htm"))
- {
- st.set("cond", "11");
- st.set("state", "13");
- st.playSound("ItemSound.quest_middle");
- }
- else if (event.equals("31522-17.htm"))
- {
- st.set("state", "14");
- }
- else if (event.equals("31522-21.htm"))
- {
- st.giveItems(SUSPICIOUS_TOTEM, 1);
- st.playSound("ItemSound.quest_finish");
- st.exitQuest(false);
- }
- else if (event.equals("31532-04.htm"))
- {
- st.set("cond", "6");
- st.set("state", "6");
- st.giveItems(LETTER, 1);
- st.playSound("ItemSound.quest_middle");
- }
- else if (event.equals("31532-06.htm"))
- {
- if (st.hasQuestItems(HAIRPIN))
+ case "31389-03.htm":
{
- st.set("state", "8");
- st.takeItems(LETTER, -1);
- st.takeItems(HAIRPIN, -1);
+ st.startQuest();
+ st.set("state", "1");
+ st.giveItems(FLOWER, 1);
+ break;
}
- else
+ case "31389-08.htm":
{
- st.set("cond", "7");
- st.set("state", "7");
- htmltext = "31532-07.htm";
+ st.set("state", "3");
+ break;
+ }
+ case "31389-13.htm":
+ {
+ st.setCond(3);
+ st.set("state", "4");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(SILVER_CROSS, 1);
+ break;
+ }
+ case "31389-18.htm":
+ {
+ st.playSound("InterfaceSound.charstat_open_01");
+ break;
+ }
+ case "31389-19.htm":
+ {
+ st.setCond(5);
+ st.set("state", "5");
+ st.takeItems(BROKEN_SILVER_CROSS, -1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31522-03.htm":
+ {
+ st.set("state", "12");
+ st.takeItems(TOTEM, -1);
+ break;
+ }
+ case "31522-08.htm":
+ {
+ st.setCond(11);
+ st.set("state", "13");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31522-17.htm":
+ {
+ st.set("state", "14");
+ break;
+ }
+ case "31522-21.htm":
+ {
+ st.giveItems(SUSPICIOUS_TOTEM, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "31532-04.htm":
+ {
+ st.setCond(6);
+ st.set("state", "6");
+ st.giveItems(LETTER, 1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31532-06.htm":
+ {
+ if (st.hasQuestItems(HAIRPIN))
+ {
+ st.set("state", "8");
+ st.takeItems(LETTER, -1);
+ st.takeItems(HAIRPIN, -1);
+ }
+ else
+ {
+ st.setCond(7);
+ st.set("state", "7");
+ htmltext = "31532-07.htm";
+ }
+ break;
+ }
+ case "31532-10.htm":
+ {
+ st.set("state", "9");
+ break;
+ }
+ case "31532-14.htm":
+ {
+ st.set("state", "10");
+ break;
+ }
+ case "31532-19.htm":
+ {
+ st.setCond(9);
+ st.set("state", "11");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31531-02.htm":
+ {
+ st.setCond(2);
+ st.set("state", "2");
+ st.takeItems(FLOWER, -1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("31532-10.htm"))
- {
- st.set("state", "9");
- }
- else if (event.equals("31532-14.htm"))
- {
- st.set("state", "10");
- }
- else if (event.equals("31532-19.htm"))
- {
- st.set("cond", "9");
- st.set("state", "11");
- st.playSound("ItemSound.quest_middle");
- }
- else if (event.equals("31531-02.htm"))
- {
- st.set("cond", "2");
- st.set("state", "2");
- st.takeItems(FLOWER, -1);
- st.playSound("ItemSound.quest_middle");
}
return htmltext;
@@ -175,15 +192,17 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
public String onTalk(NpcInstance npc, PlayerInstance player)
{
String htmltext = getNoQuestMsg();
- QuestState st = player.getQuestState(getName());
+ final QuestState st = player.getQuestState(getName());
if (st == null)
{
return htmltext;
}
+
switch (st.getState())
{
case State.CREATED:
- QuestState st2 = player.getQuestState(Q023_LidiasHeart.class.getSimpleName());
+ {
+ final QuestState st2 = player.getQuestState(Q023_LidiasHeart.class.getSimpleName());
if ((st2 != null) && st2.isCompleted() && (player.getLevel() >= 65))
{
htmltext = "31389-01.htm";
@@ -193,11 +212,14 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
htmltext = "31389-02.htm";
}
break;
+ }
case State.STARTED:
+ {
int state = st.getInt("state");
switch (npc.getNpcId())
{
case 31389:
+ {
if (state == 1)
{
htmltext = "31389-04.htm";
@@ -237,9 +259,9 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
if ((state == 7) && !st.hasQuestItems(HAIRPIN))
{
htmltext = "31389-21.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.giveItems(HAIRPIN, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
}
else if (((state == 7) && st.hasQuestItems(HAIRPIN)) || (state == 6))
{
@@ -249,7 +271,9 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
return htmltext;
}
+ }
case 31522:
+ {
if ((state == 11) && st.hasQuestItems(TOTEM))
{
htmltext = "31522-01.htm";
@@ -274,7 +298,9 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
return htmltext;
}
+ }
case 31531:
+ {
if ((state == 1) && st.hasQuestItems(FLOWER))
{
htmltext = "31531-01.htm";
@@ -287,7 +313,9 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
}
return htmltext;
+ }
case 31532:
+ {
if (state == 5)
{
htmltext = "31532-01.htm";
@@ -327,10 +355,15 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
return htmltext;
}
+ }
default:
+ {
return htmltext;
+ }
}
+ }
case State.COMPLETED:
+ {
if (npc.getNpcId() == 31522)
{
htmltext = "31522-22.htm";
@@ -339,6 +372,7 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
{
htmltext = getAlreadyCompletedMsg();
}
+ }
}
return htmltext;
@@ -359,7 +393,7 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
{
qs.takeItems(SILVER_CROSS, -1);
qs.giveItems(BROKEN_SILVER_CROSS, 1);
- qs.set("cond", "4");
+ qs.setCond(4);
for (PlayerInstance nearby : npc.getKnownList().getKnownPlayers().values())
{
nearby.sendPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "That sign!"));
@@ -372,7 +406,7 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isSummon)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "9");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 9);
if (partyMember == null)
{
return null;
@@ -385,7 +419,7 @@ public class Q024_InhabitantsOfTheForestOfTheDead extends Quest
}
if (st.dropItems(TOTEM, 1, 1, 100000))
{
- st.set("cond", "10");
+ st.setCond(10);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java
index 74c41c00e5..652dfd0e6d 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java
@@ -55,7 +55,6 @@ public class Q025_HidingBehindTheTruth extends Quest
public Q025_HidingBehindTheTruth()
{
super(25, "Hiding Behind the Truth");
-
addStartNpc(BENEDICT);
addTalkId(AGRIPEL, BENEDICT, BOOKSHELF, BOOKSHELF2, BOOKSHELF3, WIZARD, LIDIA, TOMBSTONE, COFFIN);
addKillId(TRIOL);
@@ -76,9 +75,7 @@ public class Q025_HidingBehindTheTruth extends Quest
{
case "31349-02.htm":
{
- qs.playSound("ItemSound.quest_accept");
- qs.set("cond", "1");
- qs.setState(State.STARTED);
+ qs.startQuest();
break;
}
case "31349-03.htm":
@@ -89,15 +86,15 @@ public class Q025_HidingBehindTheTruth extends Quest
}
else
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "2");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(2);
}
break;
}
case "31349-10.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "4");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(4);
break;
}
case "31348-02.htm":
@@ -107,15 +104,15 @@ public class Q025_HidingBehindTheTruth extends Quest
}
case "31348-07.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "5");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(5);
qs.giveItems(GEMSTONE_KEY, 1);
break;
}
case "31522-04.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "6");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(6);
break;
}
case "31535-03.htm":
@@ -128,8 +125,8 @@ public class Q025_HidingBehindTheTruth extends Quest
triol.setRunning();
((Attackable) triol).addDamageHate(player, 0, 999);
triol.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "7");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(7);
}
else if (qs.getInt("step") == 2)
{
@@ -141,8 +138,8 @@ public class Q025_HidingBehindTheTruth extends Quest
{
qs.giveItems(CONTRACT, 1);
qs.takeItems(GEMSTONE_KEY, -1);
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "9");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(9);
break;
}
case "31532-02.htm":
@@ -152,27 +149,27 @@ public class Q025_HidingBehindTheTruth extends Quest
}
case "31532-06.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "11");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(11);
break;
}
case "31531-02.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "12");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(12);
qs.addSpawn(COFFIN, 60104, -35820, -664, 20000);
break;
}
case "31532-18.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "15");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(15);
break;
}
case "31522-12.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "16");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(16);
}
break;
case "31348-10.htm":
@@ -182,14 +179,14 @@ public class Q025_HidingBehindTheTruth extends Quest
}
case "31348-15.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "17");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(17);
break;
}
case "31348-16.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "18");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(18);
break;
}
case "31532-20.htm":
@@ -200,7 +197,7 @@ public class Q025_HidingBehindTheTruth extends Quest
qs.rewardExpAndSp(572277, 53750);
qs.unset("cond");
qs.exitQuest(true);
- qs.playSound("ItemSound.quest_finish");
+ qs.playSound(QuestState.SOUND_FINISH);
break;
}
case "31522-15.htm":
@@ -211,7 +208,7 @@ public class Q025_HidingBehindTheTruth extends Quest
qs.rewardExpAndSp(572277, 53750);
qs.unset("cond");
qs.exitQuest(true);
- qs.playSound("ItemSound.quest_finish");
+ qs.playSound(QuestState.SOUND_FINISH);
break;
}
}
@@ -231,7 +228,7 @@ public class Q025_HidingBehindTheTruth extends Quest
final int npcId = npc.getNpcId();
final int id = qs.getState();
- final int cond = qs.getInt("cond");
+ final int cond = qs.getCond();
if (id == State.COMPLETED)
{
htmltext = getAlreadyCompletedMsg();
@@ -276,8 +273,8 @@ public class Q025_HidingBehindTheTruth extends Quest
if (cond == 2)
{
htmltext = "31522-01.htm";
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "3");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(3);
qs.giveItems(SUSPICIOUS_TOTEM, 1);
}
else if (cond == 3)
@@ -295,8 +292,8 @@ public class Q025_HidingBehindTheTruth extends Quest
else if (cond == 9)
{
htmltext = "31522-05.htm";
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "10");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(10);
}
else if (cond == 10)
{
@@ -380,7 +377,7 @@ public class Q025_HidingBehindTheTruth extends Quest
else if (cond == 13)
{
htmltext = "31532-07.htm";
- qs.set("cond", "14");
+ qs.setCond(14);
qs.takeItems(DRESS, -1);
}
else if (cond == 14)
@@ -417,8 +414,8 @@ public class Q025_HidingBehindTheTruth extends Quest
{
htmltext = "31536-01.htm";
qs.giveItems(DRESS, 1);
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "13");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(13);
npc.deleteMe();
}
}
@@ -435,10 +432,10 @@ public class Q025_HidingBehindTheTruth extends Quest
return null;
}
- if ((qs.getState() == State.STARTED) && (qs.getInt("cond") == 7))
+ if ((qs.getState() == State.STARTED) && qs.isCond(7))
{
- qs.playSound("ItemSound.quest_itemget");
- qs.set("cond", "8");
+ qs.playSound(QuestState.SOUND_ITEMGET);
+ qs.setCond(8);
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "You've ended my immortal life! You've protected by the feudal lord, aren't you?"));
qs.giveItems(TOTEM_DOLL, 1);
qs.set("step", "2");
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q027_ChestCaughtWithABaitOfWind/Q027_ChestCaughtWithABaitOfWind.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q027_ChestCaughtWithABaitOfWind/Q027_ChestCaughtWithABaitOfWind.java
index e05247f7d4..c722f9963c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q027_ChestCaughtWithABaitOfWind/Q027_ChestCaughtWithABaitOfWind.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q027_ChestCaughtWithABaitOfWind/Q027_ChestCaughtWithABaitOfWind.java
@@ -55,38 +55,42 @@ public class Q027_ChestCaughtWithABaitOfWind extends Quest
return htmltext;
}
- if (event.equals("31570-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31570-07.htm"))
- {
- if (st.hasQuestItems(LARGE_BLUE_TREASURE_CHEST))
+ case "31570-04.htm":
{
- st.set("cond", "2");
- st.takeItems(LARGE_BLUE_TREASURE_CHEST, 1);
- st.giveItems(STRANGE_BLUEPRINT, 1);
+ st.startQuest();
+ break;
}
- else
+ case "31570-07.htm":
{
- htmltext = "31570-08.htm";
+ if (st.hasQuestItems(LARGE_BLUE_TREASURE_CHEST))
+ {
+ st.setCond(2);
+ st.takeItems(LARGE_BLUE_TREASURE_CHEST, 1);
+ st.giveItems(STRANGE_BLUEPRINT, 1);
+ }
+ else
+ {
+ htmltext = "31570-08.htm";
+ }
+ break;
}
- }
- else if (event.equals("31434-02.htm"))
- {
- if (st.hasQuestItems(STRANGE_BLUEPRINT))
+ case "31434-02.htm":
{
- htmltext = "31434-02.htm";
- st.takeItems(STRANGE_BLUEPRINT, 1);
- st.giveItems(BLACK_PEARL_RING, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = "31434-03.htm";
+ if (st.hasQuestItems(STRANGE_BLUEPRINT))
+ {
+ htmltext = "31434-02.htm";
+ st.takeItems(STRANGE_BLUEPRINT, 1);
+ st.giveItems(BLACK_PEARL_RING, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "31434-03.htm";
+ }
+ break;
}
}
@@ -106,6 +110,7 @@ public class Q027_ChestCaughtWithABaitOfWind extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 27)
{
htmltext = "31570-02.htm";
@@ -123,12 +128,14 @@ public class Q027_ChestCaughtWithABaitOfWind extends Quest
}
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LANOSCO:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(LARGE_BLUE_TREASURE_CHEST)) ? "31570-06.htm" : "31570-05.htm";
@@ -138,19 +145,23 @@ public class Q027_ChestCaughtWithABaitOfWind extends Quest
htmltext = "31570-09.htm";
}
break;
-
+ }
case SHALING:
+ {
if (cond == 2)
{
htmltext = "31434-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q028_ChestCaughtWithABaitOfIcyAir/Q028_ChestCaughtWithABaitOfIcyAir.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q028_ChestCaughtWithABaitOfIcyAir/Q028_ChestCaughtWithABaitOfIcyAir.java
index b8d395c70f..e17e87aa31 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q028_ChestCaughtWithABaitOfIcyAir/Q028_ChestCaughtWithABaitOfIcyAir.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q028_ChestCaughtWithABaitOfIcyAir/Q028_ChestCaughtWithABaitOfIcyAir.java
@@ -29,7 +29,6 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
// NPCs
private static final int OFULLE = 31572;
private static final int KIKI = 31442;
-
// Items
private static final int BIG_YELLOW_TREASURE_CHEST = 6503;
private static final int KIKI_LETTER = 7626;
@@ -38,9 +37,7 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
public Q028_ChestCaughtWithABaitOfIcyAir()
{
super(28, "Chest caught with a bait of icy air");
-
registerQuestItems(KIKI_LETTER);
-
addStartNpc(OFULLE);
addTalkId(OFULLE, KIKI);
}
@@ -55,38 +52,42 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
return htmltext;
}
- if (event.equals("31572-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31572-07.htm"))
- {
- if (st.hasQuestItems(BIG_YELLOW_TREASURE_CHEST))
+ case "31572-04.htm":
{
- st.set("cond", "2");
- st.takeItems(BIG_YELLOW_TREASURE_CHEST, 1);
- st.giveItems(KIKI_LETTER, 1);
+ st.startQuest();
+ break;
}
- else
+ case "31572-07.htm":
{
- htmltext = "31572-08.htm";
+ if (st.hasQuestItems(BIG_YELLOW_TREASURE_CHEST))
+ {
+ st.setCond(2);
+ st.takeItems(BIG_YELLOW_TREASURE_CHEST, 1);
+ st.giveItems(KIKI_LETTER, 1);
+ }
+ else
+ {
+ htmltext = "31572-08.htm";
+ }
+ break;
}
- }
- else if (event.equals("31442-02.htm"))
- {
- if (st.hasQuestItems(KIKI_LETTER))
+ case "31442-02.htm":
{
- htmltext = "31442-02.htm";
- st.takeItems(KIKI_LETTER, 1);
- st.giveItems(ELVEN_RING, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = "31442-03.htm";
+ if (st.hasQuestItems(KIKI_LETTER))
+ {
+ htmltext = "31442-02.htm";
+ st.takeItems(KIKI_LETTER, 1);
+ st.giveItems(ELVEN_RING, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "31442-03.htm";
+ }
+ break;
}
}
@@ -106,6 +107,7 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 36)
{
htmltext = "31572-02.htm";
@@ -123,12 +125,14 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
}
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case OFULLE:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(BIG_YELLOW_TREASURE_CHEST)) ? "31572-06.htm" : "31572-05.htm";
@@ -138,19 +142,23 @@ public class Q028_ChestCaughtWithABaitOfIcyAir extends Quest
htmltext = "31572-09.htm";
}
break;
-
+ }
case KIKI:
+ {
if (cond == 2)
{
htmltext = "31442-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q029_ChestCaughtWithABaitOfEarth/Q029_ChestCaughtWithABaitOfEarth.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q029_ChestCaughtWithABaitOfEarth/Q029_ChestCaughtWithABaitOfEarth.java
index 96ad700155..d39f993acf 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q029_ChestCaughtWithABaitOfEarth/Q029_ChestCaughtWithABaitOfEarth.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q029_ChestCaughtWithABaitOfEarth/Q029_ChestCaughtWithABaitOfEarth.java
@@ -29,7 +29,6 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
// NPCs
private static final int WILLIE = 31574;
private static final int ANABEL = 30909;
-
// Items
private static final int SMALL_PURPLE_TREASURE_CHEST = 6507;
private static final int SMALL_GLASS_BOX = 7627;
@@ -38,9 +37,7 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
public Q029_ChestCaughtWithABaitOfEarth()
{
super(29, "Chest caught with a bait of earth");
-
registerQuestItems(SMALL_GLASS_BOX);
-
addStartNpc(WILLIE);
addTalkId(WILLIE, ANABEL);
}
@@ -55,38 +52,42 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
return htmltext;
}
- if (event.equals("31574-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31574-07.htm"))
- {
- if (st.hasQuestItems(SMALL_PURPLE_TREASURE_CHEST))
+ case "31574-04.htm":
{
- st.set("cond", "2");
- st.takeItems(SMALL_PURPLE_TREASURE_CHEST, 1);
- st.giveItems(SMALL_GLASS_BOX, 1);
+ st.startQuest();
+ break;
}
- else
+ case "31574-07.htm":
{
- htmltext = "31574-08.htm";
+ if (st.hasQuestItems(SMALL_PURPLE_TREASURE_CHEST))
+ {
+ st.setCond(2);
+ st.takeItems(SMALL_PURPLE_TREASURE_CHEST, 1);
+ st.giveItems(SMALL_GLASS_BOX, 1);
+ }
+ else
+ {
+ htmltext = "31574-08.htm";
+ }
+ break;
}
- }
- else if (event.equals("30909-02.htm"))
- {
- if (st.hasQuestItems(SMALL_GLASS_BOX))
+ case "30909-02.htm":
{
- htmltext = "30909-02.htm";
- st.takeItems(SMALL_GLASS_BOX, 1);
- st.giveItems(PLATED_LEATHER_GLOVES, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = "30909-03.htm";
+ if (st.hasQuestItems(SMALL_GLASS_BOX))
+ {
+ htmltext = "30909-02.htm";
+ st.takeItems(SMALL_GLASS_BOX, 1);
+ st.giveItems(PLATED_LEATHER_GLOVES, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "30909-03.htm";
+ }
+ break;
}
}
@@ -106,6 +107,7 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 48)
{
htmltext = "31574-02.htm";
@@ -123,12 +125,14 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
}
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case WILLIE:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(SMALL_PURPLE_TREASURE_CHEST)) ? "31574-06.htm" : "31574-05.htm";
@@ -138,19 +142,23 @@ public class Q029_ChestCaughtWithABaitOfEarth extends Quest
htmltext = "31574-09.htm";
}
break;
-
+ }
case ANABEL:
+ {
if (cond == 2)
{
htmltext = "30909-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q030_ChestCaughtWithABaitOfFire/Q030_ChestCaughtWithABaitOfFire.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q030_ChestCaughtWithABaitOfFire/Q030_ChestCaughtWithABaitOfFire.java
index e13f7c8362..8b3c3b03ca 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q030_ChestCaughtWithABaitOfFire/Q030_ChestCaughtWithABaitOfFire.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q030_ChestCaughtWithABaitOfFire/Q030_ChestCaughtWithABaitOfFire.java
@@ -29,7 +29,6 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
// NPCs
private static final int LINNAEUS = 31577;
private static final int RUKAL = 30629;
-
// Items
private static final int RED_TREASURE_BOX = 6511;
private static final int MUSICAL_SCORE = 7628;
@@ -38,9 +37,7 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
public Q030_ChestCaughtWithABaitOfFire()
{
super(30, "Chest caught with a bait of fire");
-
registerQuestItems(MUSICAL_SCORE);
-
addStartNpc(LINNAEUS);
addTalkId(LINNAEUS, RUKAL);
}
@@ -55,38 +52,42 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
return htmltext;
}
- if (event.equals("31577-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31577-07.htm"))
- {
- if (st.hasQuestItems(RED_TREASURE_BOX))
+ case "31577-04.htm":
{
- st.set("cond", "2");
- st.takeItems(RED_TREASURE_BOX, 1);
- st.giveItems(MUSICAL_SCORE, 1);
+ st.startQuest();
+ break;
}
- else
+ case "31577-07.htm":
{
- htmltext = "31577-08.htm";
+ if (st.hasQuestItems(RED_TREASURE_BOX))
+ {
+ st.setCond(2);
+ st.takeItems(RED_TREASURE_BOX, 1);
+ st.giveItems(MUSICAL_SCORE, 1);
+ }
+ else
+ {
+ htmltext = "31577-08.htm";
+ }
+ break;
}
- }
- else if (event.equals("30629-02.htm"))
- {
- if (st.hasQuestItems(MUSICAL_SCORE))
+ case "30629-02.htm":
{
- htmltext = "30629-02.htm";
- st.takeItems(MUSICAL_SCORE, 1);
- st.giveItems(NECKLACE_OF_PROTECTION, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = "30629-03.htm";
+ if (st.hasQuestItems(MUSICAL_SCORE))
+ {
+ htmltext = "30629-02.htm";
+ st.takeItems(MUSICAL_SCORE, 1);
+ st.giveItems(NECKLACE_OF_PROTECTION, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "30629-03.htm";
+ }
+ break;
}
}
@@ -106,6 +107,7 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 60)
{
htmltext = "31577-02.htm";
@@ -123,12 +125,14 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
}
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LINNAEUS:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(RED_TREASURE_BOX)) ? "31577-06.htm" : "31577-05.htm";
@@ -138,19 +142,23 @@ public class Q030_ChestCaughtWithABaitOfFire extends Quest
htmltext = "31577-09.htm";
}
break;
-
+ }
case RUKAL:
+ {
if (cond == 2)
{
htmltext = "30629-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q031_SecretBuriedInTheSwamp/Q031_SecretBuriedInTheSwamp.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q031_SecretBuriedInTheSwamp/Q031_SecretBuriedInTheSwamp.java
index c9b59f944d..e29e5dd22c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q031_SecretBuriedInTheSwamp/Q031_SecretBuriedInTheSwamp.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q031_SecretBuriedInTheSwamp/Q031_SecretBuriedInTheSwamp.java
@@ -24,9 +24,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q031_SecretBuriedInTheSwamp extends Quest
{
- // Item
- private static final int KRORIN_JOURNAL = 7252;
-
// NPCs
private static final int ABERCROMBIE = 31555;
private static final int FORGOTTEN_MONUMENT_1 = 31661;
@@ -34,13 +31,13 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
private static final int FORGOTTEN_MONUMENT_3 = 31663;
private static final int FORGOTTEN_MONUMENT_4 = 31664;
private static final int CORPSE_OF_DWARF = 31665;
+ // Item
+ private static final int KRORIN_JOURNAL = 7252;
public Q031_SecretBuriedInTheSwamp()
{
super(31, "Secret Buried in the Swamp");
-
registerQuestItems(KRORIN_JOURNAL);
-
addStartNpc(ABERCROMBIE);
addTalkId(ABERCROMBIE, CORPSE_OF_DWARF, FORGOTTEN_MONUMENT_1, FORGOTTEN_MONUMENT_2, FORGOTTEN_MONUMENT_3, FORGOTTEN_MONUMENT_4);
}
@@ -55,50 +52,59 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
return htmltext;
}
- if (event.equals("31555-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31665-01.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(KRORIN_JOURNAL, 1);
- }
- else if (event.equals("31555-04.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31661-01.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31662-01.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31663-01.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31664-01.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31555-07.htm"))
- {
- st.takeItems(KRORIN_JOURNAL, 1);
- st.rewardItems(57, 40000);
- st.rewardExpAndSp(130000, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31555-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31665-01.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(KRORIN_JOURNAL, 1);
+ break;
+ }
+ case "31555-04.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31661-01.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31662-01.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31663-01.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31664-01.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31555-07.htm":
+ {
+ st.takeItems(KRORIN_JOURNAL, 1);
+ st.rewardItems(57, 40000);
+ st.rewardExpAndSp(130000, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -117,14 +123,17 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 66) ? "31555-00a.htm" : "31555-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ABERCROMBIE:
+ {
if (cond == 1)
{
htmltext = "31555-02.htm";
@@ -142,8 +151,9 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31555-06.htm";
}
break;
-
+ }
case CORPSE_OF_DWARF:
+ {
if (cond == 1)
{
htmltext = "31665-00.htm";
@@ -153,8 +163,9 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31665-02.htm";
}
break;
-
+ }
case FORGOTTEN_MONUMENT_1:
+ {
if (cond == 3)
{
htmltext = "31661-00.htm";
@@ -164,8 +175,9 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31661-02.htm";
}
break;
-
+ }
case FORGOTTEN_MONUMENT_2:
+ {
if (cond == 4)
{
htmltext = "31662-00.htm";
@@ -175,8 +187,9 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31662-02.htm";
}
break;
-
+ }
case FORGOTTEN_MONUMENT_3:
+ {
if (cond == 5)
{
htmltext = "31663-00.htm";
@@ -186,8 +199,9 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31663-02.htm";
}
break;
-
+ }
case FORGOTTEN_MONUMENT_4:
+ {
if (cond == 6)
{
htmltext = "31664-00.htm";
@@ -197,12 +211,15 @@ public class Q031_SecretBuriedInTheSwamp extends Quest
htmltext = "31664-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q032_AnObviousLie/Q032_AnObviousLie.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q032_AnObviousLie/Q032_AnObviousLie.java
index 56958ee723..e67434b635 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q032_AnObviousLie/Q032_AnObviousLie.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q032_AnObviousLie/Q032_AnObviousLie.java
@@ -24,32 +24,27 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q032_AnObviousLie extends Quest
{
+ // NPCs
+ private static final int GENTLER = 30094;
+ private static final int MAXIMILIAN = 30120;
+ private static final int MIKI_THE_CAT = 31706;
// Items
private static final int SUEDE = 1866;
private static final int THREAD = 1868;
private static final int SPIRIT_ORE = 3031;
private static final int MAP = 7165;
private static final int MEDICINAL_HERB = 7166;
-
// Rewards
private static final int CAT_EARS = 6843;
private static final int RACOON_EARS = 7680;
private static final int RABBIT_EARS = 7683;
- // NPCs
- private static final int GENTLER = 30094;
- private static final int MAXIMILIAN = 30120;
- private static final int MIKI_THE_CAT = 31706;
-
public Q032_AnObviousLie()
{
super(32, "An Obvious Lie");
-
registerQuestItems(MAP, MEDICINAL_HERB);
-
addStartNpc(MAXIMILIAN);
addTalkId(MAXIMILIAN, GENTLER, MIKI_THE_CAT);
-
addKillId(20135); // Alligator
}
@@ -63,103 +58,115 @@ public class Q032_AnObviousLie extends Quest
return htmltext;
}
- if (event.equals("30120-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30094-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(MAP, 1);
- }
- else if (event.equals("31706-1.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAP, 1);
- }
- else if (event.equals("30094-4.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MEDICINAL_HERB, 20);
- }
- else if (event.equals("30094-7.htm"))
- {
- if (st.getQuestItemsCount(SPIRIT_ORE) < 500)
+ case "30120-1.htm":
{
- htmltext = "30094-5.htm";
+ st.startQuest();
+ break;
}
- else
+ case "30094-1.htm":
{
- st.set("cond", "6");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPIRIT_ORE, 500);
+ st.giveItems(MAP, 1);
+ break;
}
- }
- else if (event.equals("31706-4.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30094-10.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30094-13.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("cat"))
- {
- if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ case "31706-1.htm":
{
- htmltext = "30094-11.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAP, 1);
+ break;
}
- else
+ case "30094-4.htm":
{
- htmltext = "30094-14.htm";
- st.takeItems(SUEDE, 500);
- st.takeItems(THREAD, 1000);
- st.giveItems(CAT_EARS, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MEDICINAL_HERB, 20);
+ break;
}
- }
- else if (event.equals("racoon"))
- {
- if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ case "30094-7.htm":
{
- htmltext = "30094-11.htm";
+ if (st.getQuestItemsCount(SPIRIT_ORE) < 500)
+ {
+ htmltext = "30094-5.htm";
+ }
+ else
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPIRIT_ORE, 500);
+ }
+ break;
}
- else
+ case "31706-4.htm":
{
- htmltext = "30094-14.htm";
- st.takeItems(SUEDE, 500);
- st.takeItems(THREAD, 1000);
- st.giveItems(RACOON_EARS, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("rabbit"))
- {
- if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ case "30094-10.htm":
{
- htmltext = "30094-11.htm";
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- else
+ case "30094-13.htm":
{
- htmltext = "30094-14.htm";
- st.takeItems(SUEDE, 500);
- st.takeItems(THREAD, 1000);
- st.giveItems(RABBIT_EARS, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "cat":
+ {
+ if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ {
+ htmltext = "30094-11.htm";
+ }
+ else
+ {
+ htmltext = "30094-14.htm";
+ st.takeItems(SUEDE, 500);
+ st.takeItems(THREAD, 1000);
+ st.giveItems(CAT_EARS, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
+ }
+ case "racoon":
+ {
+ if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ {
+ htmltext = "30094-11.htm";
+ }
+ else
+ {
+ htmltext = "30094-14.htm";
+ st.takeItems(SUEDE, 500);
+ st.takeItems(THREAD, 1000);
+ st.giveItems(RACOON_EARS, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
+ }
+ case "rabbit":
+ {
+ if ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500))
+ {
+ htmltext = "30094-11.htm";
+ }
+ else
+ {
+ htmltext = "30094-14.htm";
+ st.takeItems(SUEDE, 500);
+ st.takeItems(THREAD, 1000);
+ st.giveItems(RABBIT_EARS, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
}
}
@@ -179,18 +186,22 @@ public class Q032_AnObviousLie extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 45) ? "30120-0a.htm" : "30120-0.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MAXIMILIAN:
+ {
htmltext = "30120-2.htm";
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-0.htm";
@@ -220,8 +231,9 @@ public class Q032_AnObviousLie extends Quest
htmltext = ((st.getQuestItemsCount(THREAD) < 1000) || (st.getQuestItemsCount(SUEDE) < 500)) ? "30094-11.htm" : "30094-12.htm";
}
break;
-
+ }
case MIKI_THE_CAT:
+ {
if (cond == 2)
{
htmltext = "31706-0.htm";
@@ -239,12 +251,15 @@ public class Q032_AnObviousLie extends Quest
htmltext = "31706-5.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -253,7 +268,7 @@ public class Q032_AnObviousLie extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "3");
+ final QuestState st = checkPlayerCondition(player, npc, 3);
if (st == null)
{
return null;
@@ -261,7 +276,7 @@ public class Q032_AnObviousLie extends Quest
if (st.dropItemsAlways(MEDICINAL_HERB, 1, 20))
{
- st.set("cond", "4");
+ st.setCond(4);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q033_MakeAPairOfDressShoes/Q033_MakeAPairOfDressShoes.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q033_MakeAPairOfDressShoes/Q033_MakeAPairOfDressShoes.java
index 93f230e0e6..8301acece6 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q033_MakeAPairOfDressShoes/Q033_MakeAPairOfDressShoes.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q033_MakeAPairOfDressShoes/Q033_MakeAPairOfDressShoes.java
@@ -30,19 +30,16 @@ public class Q033_MakeAPairOfDressShoes extends Quest
private static final int WOODLEY = 30838;
private static final int IAN = 30164;
private static final int LEIKAR = 31520;
-
// Items
private static final int LEATHER = 1882;
private static final int THREAD = 1868;
private static final int ADENA = 57;
-
// Rewards
public static final int DRESS_SHOES_BOX = 7113;
public Q033_MakeAPairOfDressShoes()
{
super(33, "Make a Pair of Dress Shoes");
-
addStartNpc(WOODLEY);
addTalkId(WOODLEY, IAN, LEIKAR);
}
@@ -57,55 +54,62 @@ public class Q033_MakeAPairOfDressShoes extends Quest
return htmltext;
}
- if (event.equals("30838-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31520-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30838-3.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30838-5.htm"))
- {
- if ((st.getQuestItemsCount(LEATHER) >= 200) && (st.getQuestItemsCount(THREAD) >= 600) && (st.getQuestItemsCount(ADENA) >= 200000))
+ case "30838-1.htm":
{
- st.set("cond", "4");
+ st.startQuest();
+ break;
+ }
+ case "31520-1.htm":
+ {
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ADENA, 200000);
- st.takeItems(LEATHER, 200);
- st.takeItems(THREAD, 600);
+ break;
}
- else
+ case "30838-3.htm":
{
- htmltext = "30838-4a.htm";
- }
- }
- else if (event.equals("30164-1.htm"))
- {
- if (st.getQuestItemsCount(ADENA) >= 300000)
- {
- st.set("cond", "5");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ADENA, 300000);
+ break;
}
- else
+ case "30838-5.htm":
{
- htmltext = "30164-1a.htm";
+ if ((st.getQuestItemsCount(LEATHER) >= 200) && (st.getQuestItemsCount(THREAD) >= 600) && (st.getQuestItemsCount(ADENA) >= 200000))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ADENA, 200000);
+ st.takeItems(LEATHER, 200);
+ st.takeItems(THREAD, 600);
+ }
+ else
+ {
+ htmltext = "30838-4a.htm";
+ }
+ break;
+ }
+ case "30164-1.htm":
+ {
+ if (st.getQuestItemsCount(ADENA) >= 300000)
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ADENA, 300000);
+ }
+ else
+ {
+ htmltext = "30164-1a.htm";
+ }
+ break;
+ }
+ case "30838-7.htm":
+ {
+ st.giveItems(DRESS_SHOES_BOX, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
}
- }
- else if (event.equals("30838-7.htm"))
- {
- st.giveItems(DRESS_SHOES_BOX, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
}
return htmltext;
@@ -124,10 +128,11 @@ public class Q033_MakeAPairOfDressShoes extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 60)
{
final QuestState fwear = player.getQuestState(Q037_MakeFormalWear.class.getSimpleName());
- if ((fwear != null) && (fwear.getInt("cond") == 7))
+ if ((fwear != null) && fwear.isCond(7))
{
htmltext = "30838-0.htm";
}
@@ -141,12 +146,14 @@ public class Q033_MakeAPairOfDressShoes extends Quest
htmltext = "30838-0b.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case WOODLEY:
+ {
if (cond == 1)
{
htmltext = "30838-1.htm";
@@ -175,8 +182,9 @@ public class Q033_MakeAPairOfDressShoes extends Quest
htmltext = "30838-6.htm";
}
break;
-
+ }
case LEIKAR:
+ {
if (cond == 1)
{
htmltext = "31520-0.htm";
@@ -186,8 +194,9 @@ public class Q033_MakeAPairOfDressShoes extends Quest
htmltext = "31520-1a.htm";
}
break;
-
+ }
case IAN:
+ {
if (cond == 4)
{
htmltext = "30164-0.htm";
@@ -197,12 +206,15 @@ public class Q033_MakeAPairOfDressShoes extends Quest
htmltext = "30164-2.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q034_InSearchOfCloth/Q034_InSearchOfCloth.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q034_InSearchOfCloth/Q034_InSearchOfCloth.java
index 828dbb5dd6..e3d530a59b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q034_InSearchOfCloth/Q034_InSearchOfCloth.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q034_InSearchOfCloth/Q034_InSearchOfCloth.java
@@ -30,29 +30,23 @@ public class Q034_InSearchOfCloth extends Quest
private static final int RADIA = 30088;
private static final int RALFORD = 30165;
private static final int VARAN = 30294;
-
// Monsters
private static final int TRISALIM_SPIDER = 20560;
private static final int TRISALIM_TARANTULA = 20561;
-
// Items
private static final int SPINNERET = 7528;
private static final int SUEDE = 1866;
private static final int THREAD = 1868;
private static final int SPIDERSILK = 7161;
-
// Rewards
private static final int MYSTERIOUS_CLOTH = 7076;
public Q034_InSearchOfCloth()
{
super(34, "In Search of Cloth");
-
registerQuestItems(SPINNERET, SPIDERSILK);
-
addStartNpc(RADIA);
addTalkId(RADIA, RALFORD, VARAN);
-
addKillId(TRISALIM_SPIDER, TRISALIM_TARANTULA);
}
@@ -66,48 +60,55 @@ public class Q034_InSearchOfCloth extends Quest
return htmltext;
}
- if (event.equals("30088-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30294-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30088-3.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30165-1.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30165-3.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPINNERET, 10);
- st.giveItems(SPIDERSILK, 1);
- }
- else if (event.equals("30088-5.htm"))
- {
- if ((st.getQuestItemsCount(SUEDE) >= 3000) && (st.getQuestItemsCount(THREAD) >= 5000) && st.hasQuestItems(SPIDERSILK))
+ case "30088-1.htm":
{
- st.takeItems(SPIDERSILK, 1);
- st.takeItems(SUEDE, 3000);
- st.takeItems(THREAD, 5000);
- st.giveItems(MYSTERIOUS_CLOTH, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.startQuest();
+ break;
}
- else
+ case "30294-1.htm":
{
- htmltext = "30088-4a.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30088-3.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30165-1.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30165-3.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPINNERET, 10);
+ st.giveItems(SPIDERSILK, 1);
+ break;
+ }
+ case "30088-5.htm":
+ {
+ if ((st.getQuestItemsCount(SUEDE) >= 3000) && (st.getQuestItemsCount(THREAD) >= 5000) && st.hasQuestItems(SPIDERSILK))
+ {
+ st.takeItems(SPIDERSILK, 1);
+ st.takeItems(SUEDE, 3000);
+ st.takeItems(THREAD, 5000);
+ st.giveItems(MYSTERIOUS_CLOTH, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "30088-4a.htm";
+ }
+ break;
}
}
@@ -127,10 +128,11 @@ public class Q034_InSearchOfCloth extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 60)
{
final QuestState fwear = player.getQuestState(Q037_MakeFormalWear.class.getSimpleName());
- if ((fwear != null) && (fwear.getInt("cond") == 6))
+ if ((fwear != null) && fwear.isCond(6))
{
htmltext = "30088-0.htm";
}
@@ -144,12 +146,14 @@ public class Q034_InSearchOfCloth extends Quest
htmltext = "30088-0b.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case RADIA:
+ {
if (cond == 1)
{
htmltext = "30088-1a.htm";
@@ -174,8 +178,9 @@ public class Q034_InSearchOfCloth extends Quest
}
}
break;
-
+ }
case VARAN:
+ {
if (cond == 1)
{
htmltext = "30294-0.htm";
@@ -185,8 +190,9 @@ public class Q034_InSearchOfCloth extends Quest
htmltext = "30294-1a.htm";
}
break;
-
+ }
case RALFORD:
+ {
if (cond == 3)
{
htmltext = "30165-0.htm";
@@ -204,12 +210,15 @@ public class Q034_InSearchOfCloth extends Quest
htmltext = "30165-3a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -218,7 +227,7 @@ public class Q034_InSearchOfCloth extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "4");
+ final QuestState st = checkPlayerCondition(player, npc, 4);
if (st == null)
{
return null;
@@ -226,7 +235,7 @@ public class Q034_InSearchOfCloth extends Quest
if (st.dropItems(SPINNERET, 1, 10, 500000))
{
- st.set("cond", "5");
+ st.setCond(5);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q035_FindGlitteringJewelry/Q035_FindGlitteringJewelry.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q035_FindGlitteringJewelry/Q035_FindGlitteringJewelry.java
index b65447a9b4..21d45d1925 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q035_FindGlitteringJewelry/Q035_FindGlitteringJewelry.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q035_FindGlitteringJewelry/Q035_FindGlitteringJewelry.java
@@ -29,25 +29,20 @@ public class Q035_FindGlitteringJewelry extends Quest
// NPCs
private static final int ELLIE = 30091;
private static final int FELTON = 30879;
-
// Items
private static final int ROUGH_JEWEL = 7162;
private static final int ORIHARUKON = 1893;
private static final int SILVER_NUGGET = 1873;
private static final int THONS = 4044;
-
// Reward
private static final int JEWEL_BOX = 7077;
public Q035_FindGlitteringJewelry()
{
super(35, "Find Glittering Jewelry");
-
registerQuestItems(ROUGH_JEWEL);
-
addStartNpc(ELLIE);
addTalkId(ELLIE, FELTON);
-
addKillId(20135); // Alligator
}
@@ -61,37 +56,42 @@ public class Q035_FindGlitteringJewelry extends Quest
return htmltext;
}
- if (event.equals("30091-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30879-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30091-3.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROUGH_JEWEL, 10);
- }
- else if (event.equals("30091-5.htm"))
- {
- if ((st.getQuestItemsCount(ORIHARUKON) >= 5) && (st.getQuestItemsCount(SILVER_NUGGET) >= 500) && (st.getQuestItemsCount(THONS) >= 150))
+ case "30091-1.htm":
{
- st.takeItems(ORIHARUKON, 5);
- st.takeItems(SILVER_NUGGET, 500);
- st.takeItems(THONS, 150);
- st.giveItems(JEWEL_BOX, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.startQuest();
+ break;
}
- else
+ case "30879-1.htm":
{
- htmltext = "30091-4a.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30091-3.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ROUGH_JEWEL, 10);
+ break;
+ }
+ case "30091-5.htm":
+ {
+ if ((st.getQuestItemsCount(ORIHARUKON) >= 5) && (st.getQuestItemsCount(SILVER_NUGGET) >= 500) && (st.getQuestItemsCount(THONS) >= 150))
+ {
+ st.takeItems(ORIHARUKON, 5);
+ st.takeItems(SILVER_NUGGET, 500);
+ st.takeItems(THONS, 150);
+ st.giveItems(JEWEL_BOX, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "30091-4a.htm";
+ }
+ break;
}
}
@@ -111,10 +111,11 @@ public class Q035_FindGlitteringJewelry extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 60)
{
final QuestState fwear = player.getQuestState(Q037_MakeFormalWear.class.getSimpleName());
- if ((fwear != null) && (fwear.getInt("cond") == 6))
+ if ((fwear != null) && fwear.isCond(6))
{
htmltext = "30091-0.htm";
}
@@ -128,12 +129,14 @@ public class Q035_FindGlitteringJewelry extends Quest
htmltext = "30091-0b.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ELLIE:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30091-1a.htm";
@@ -147,8 +150,9 @@ public class Q035_FindGlitteringJewelry extends Quest
htmltext = ((st.getQuestItemsCount(ORIHARUKON) >= 5) && (st.getQuestItemsCount(SILVER_NUGGET) >= 500) && (st.getQuestItemsCount(THONS) >= 150)) ? "30091-4.htm" : "30091-4a.htm";
}
break;
-
+ }
case FELTON:
+ {
if (cond == 1)
{
htmltext = "30879-0.htm";
@@ -158,12 +162,15 @@ public class Q035_FindGlitteringJewelry extends Quest
htmltext = "30879-1a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -172,7 +179,7 @@ public class Q035_FindGlitteringJewelry extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -180,7 +187,7 @@ public class Q035_FindGlitteringJewelry extends Quest
if (st.dropItems(ROUGH_JEWEL, 1, 10, 500000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q036_MakeASewingKit/Q036_MakeASewingKit.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q036_MakeASewingKit/Q036_MakeASewingKit.java
index a9d67c413d..a335bfd69c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q036_MakeASewingKit/Q036_MakeASewingKit.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q036_MakeASewingKit/Q036_MakeASewingKit.java
@@ -30,19 +30,15 @@ public class Q036_MakeASewingKit extends Quest
private static final int REINFORCED_STEEL = 7163;
private static final int ARTISANS_FRAME = 1891;
private static final int ORIHARUKON = 1893;
-
// Reward
private static final int SEWING_KIT = 7078;
public Q036_MakeASewingKit()
{
super(36, "Make a Sewing Kit");
-
registerQuestItems(REINFORCED_STEEL);
-
addStartNpc(30847); // Ferris
addTalkId(30847);
-
addKillId(20566); // Iron Golem
}
@@ -56,31 +52,35 @@ public class Q036_MakeASewingKit extends Quest
return htmltext;
}
- if (event.equals("30847-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30847-3.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(REINFORCED_STEEL, 5);
- }
- else if (event.equals("30847-5.htm"))
- {
- if ((st.getQuestItemsCount(ORIHARUKON) >= 10) && (st.getQuestItemsCount(ARTISANS_FRAME) >= 10))
+ case "30847-1.htm":
{
- st.takeItems(ARTISANS_FRAME, 10);
- st.takeItems(ORIHARUKON, 10);
- st.giveItems(SEWING_KIT, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.startQuest();
+ break;
}
- else
+ case "30847-3.htm":
{
- htmltext = "30847-4a.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(REINFORCED_STEEL, 5);
+ break;
+ }
+ case "30847-5.htm":
+ {
+ if ((st.getQuestItemsCount(ORIHARUKON) >= 10) && (st.getQuestItemsCount(ARTISANS_FRAME) >= 10))
+ {
+ st.takeItems(ARTISANS_FRAME, 10);
+ st.takeItems(ORIHARUKON, 10);
+ st.giveItems(SEWING_KIT, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "30847-4a.htm";
+ }
+ break;
}
}
@@ -100,10 +100,11 @@ public class Q036_MakeASewingKit extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 60)
{
final QuestState fwear = player.getQuestState(Q037_MakeFormalWear.class.getSimpleName());
- if ((fwear != null) && (fwear.getInt("cond") == 6))
+ if ((fwear != null) && fwear.isCond(6))
{
htmltext = "30847-0.htm";
}
@@ -117,9 +118,10 @@ public class Q036_MakeASewingKit extends Quest
htmltext = "30847-0b.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30847-1a.htm";
@@ -133,10 +135,12 @@ public class Q036_MakeASewingKit extends Quest
htmltext = ((st.getQuestItemsCount(ORIHARUKON) < 10) || (st.getQuestItemsCount(ARTISANS_FRAME) < 10)) ? "30847-4a.htm" : "30847-4.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -145,7 +149,7 @@ public class Q036_MakeASewingKit extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -153,7 +157,7 @@ public class Q036_MakeASewingKit extends Quest
if (st.dropItems(REINFORCED_STEEL, 1, 5, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q037_MakeFormalWear/Q037_MakeFormalWear.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q037_MakeFormalWear/Q037_MakeFormalWear.java
index fece33173f..2b55637689 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q037_MakeFormalWear/Q037_MakeFormalWear.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q037_MakeFormalWear/Q037_MakeFormalWear.java
@@ -29,7 +29,6 @@ public class Q037_MakeFormalWear extends Quest
private static final int LEIKAR = 31520;
private static final int JEREMY = 31521;
private static final int MIST = 31627;
-
// Items
private static final int MYSTERIOUS_CLOTH = 7076;
private static final int JEWEL_BOX = 7077;
@@ -38,16 +37,13 @@ public class Q037_MakeFormalWear extends Quest
private static final int SIGNET_RING = 7164;
private static final int ICE_WINE = 7160;
private static final int BOX_OF_COOKIES = 7159;
-
// Reward
private static final int FORMAL_WEAR = 6408;
public Q037_MakeFormalWear()
{
super(37, "Make Formal Wear");
-
registerQuestItems(SIGNET_RING, ICE_WINE, BOX_OF_COOKIES);
-
addStartNpc(ALEXIS);
addTalkId(ALEXIS, LEIKAR, JEREMY, MIST);
}
@@ -62,57 +58,66 @@ public class Q037_MakeFormalWear extends Quest
return htmltext;
}
- if (event.equals("30842-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31520-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(SIGNET_RING, 1);
- }
- else if (event.equals("31521-1.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SIGNET_RING, 1);
- st.giveItems(ICE_WINE, 1);
- }
- else if (event.equals("31627-1.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ICE_WINE, 1);
- }
- else if (event.equals("31521-3.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BOX_OF_COOKIES, 1);
- }
- else if (event.equals("31520-3.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BOX_OF_COOKIES, 1);
- }
- else if (event.equals("31520-5.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JEWEL_BOX, 1);
- st.takeItems(MYSTERIOUS_CLOTH, 1);
- st.takeItems(SEWING_KIT, 1);
- }
- else if (event.equals("31520-7.htm"))
- {
- st.takeItems(DRESS_SHOES_BOX, 1);
- st.giveItems(FORMAL_WEAR, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30842-1.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31520-1.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(SIGNET_RING, 1);
+ break;
+ }
+ case "31521-1.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SIGNET_RING, 1);
+ st.giveItems(ICE_WINE, 1);
+ break;
+ }
+ case "31627-1.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ICE_WINE, 1);
+ break;
+ }
+ case "31521-3.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BOX_OF_COOKIES, 1);
+ break;
+ }
+ case "31520-3.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BOX_OF_COOKIES, 1);
+ break;
+ }
+ case "31520-5.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JEWEL_BOX, 1);
+ st.takeItems(MYSTERIOUS_CLOTH, 1);
+ st.takeItems(SEWING_KIT, 1);
+ break;
+ }
+ case "31520-7.htm":
+ {
+ st.takeItems(DRESS_SHOES_BOX, 1);
+ st.giveItems(FORMAL_WEAR, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -131,21 +136,25 @@ public class Q037_MakeFormalWear extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "30842-0a.htm" : "30842-0.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ALEXIS:
+ {
if (cond == 1)
{
htmltext = "30842-2.htm";
}
break;
-
+ }
case LEIKAR:
+ {
if (cond == 1)
{
htmltext = "31520-0.htm";
@@ -174,8 +183,9 @@ public class Q037_MakeFormalWear extends Quest
htmltext = (st.hasQuestItems(DRESS_SHOES_BOX)) ? "31520-6.htm" : "31520-5a.htm";
}
break;
-
+ }
case JEREMY:
+ {
if (st.hasQuestItems(SIGNET_RING))
{
htmltext = "31521-0.htm";
@@ -193,8 +203,9 @@ public class Q037_MakeFormalWear extends Quest
htmltext = "31521-3a.htm";
}
break;
-
+ }
case MIST:
+ {
if (cond == 3)
{
htmltext = "31627-0.htm";
@@ -204,12 +215,15 @@ public class Q037_MakeFormalWear extends Quest
htmltext = "31627-2.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q038_DragonFangs/Q038_DragonFangs.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q038_DragonFangs/Q038_DragonFangs.java
index d94f4b1355..3ec9979244 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q038_DragonFangs/Q038_DragonFangs.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q038_DragonFangs/Q038_DragonFangs.java
@@ -28,86 +28,45 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q038_DragonFangs extends Quest
{
+ // NPCs
+ private static final int LUIS = 30386;
+ private static final int IRIS = 30034;
+ private static final int ROHMER = 30344;
// Items
private static final int FEATHER_ORNAMENT = 7173;
private static final int TOOTH_OF_TOTEM = 7174;
private static final int TOOTH_OF_DRAGON = 7175;
private static final int LETTER_OF_IRIS = 7176;
private static final int LETTER_OF_ROHMER = 7177;
-
- // NPCs
- private static final int LUIS = 30386;
- private static final int IRIS = 30034;
- private static final int ROHMER = 30344;
-
// Reward { item, adena }
private static final int[][] REWARD =
{
- {
- 45,
- 5200
- },
- {
- 627,
- 1500
- },
- {
- 1123,
- 3200
- },
- {
- 605,
- 3200
- }
+ // @formatter:off
+ {45, 5200},
+ {627, 1500},
+ {1123, 3200},
+ {605, 3200}
+ // @formatter:on
};
-
// Droplist
private static final Map DROPLIST = new HashMap<>();
static
{
- DROPLIST.put(21100, new int[]
- {
- 1,
- FEATHER_ORNAMENT,
- 100,
- 1000000
- });
- DROPLIST.put(20357, new int[]
- {
- 1,
- FEATHER_ORNAMENT,
- 100,
- 1000000
- });
- DROPLIST.put(21101, new int[]
- {
- 6,
- TOOTH_OF_DRAGON,
- 50,
- 500000
- });
- DROPLIST.put(20356, new int[]
- {
- 6,
- TOOTH_OF_DRAGON,
- 50,
- 500000
- });
+ // @formatter:off
+ DROPLIST.put(21100, new int[]{1, FEATHER_ORNAMENT, 100, 1000000});
+ DROPLIST.put(20357, new int[]{1, FEATHER_ORNAMENT, 100, 1000000});
+ DROPLIST.put(21101, new int[]{6, TOOTH_OF_DRAGON, 50, 500000});
+ DROPLIST.put(20356, new int[]{6, TOOTH_OF_DRAGON, 50, 500000});
+ // @formatter:on
}
public Q038_DragonFangs()
{
super(38, "Dragon Fangs");
-
registerQuestItems(FEATHER_ORNAMENT, TOOTH_OF_TOTEM, TOOTH_OF_DRAGON, LETTER_OF_IRIS, LETTER_OF_ROHMER);
-
addStartNpc(LUIS);
addTalkId(LUIS, IRIS, ROHMER);
-
- for (int mob : DROPLIST.keySet())
- {
- addKillId(mob);
- }
+ addKillId(DROPLIST.keySet());
}
@Override
@@ -120,62 +79,69 @@ public class Q038_DragonFangs extends Quest
return htmltext;
}
- if (event.equals("30386-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30386-04.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(FEATHER_ORNAMENT, 100);
- st.giveItems(TOOTH_OF_TOTEM, 1);
- }
- else if (event.equals("30034-02a.htm"))
- {
- if (st.hasQuestItems(TOOTH_OF_TOTEM))
+ case "30386-02.htm":
{
- htmltext = "30034-02.htm";
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TOOTH_OF_TOTEM, 1);
- st.giveItems(LETTER_OF_IRIS, 1);
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30344-02a.htm"))
- {
- if (st.hasQuestItems(LETTER_OF_IRIS))
+ case "30386-04.htm":
{
- htmltext = "30344-02.htm";
- st.set("cond", "5");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_OF_IRIS, 1);
- st.giveItems(LETTER_OF_ROHMER, 1);
+ st.takeItems(FEATHER_ORNAMENT, 100);
+ st.giveItems(TOOTH_OF_TOTEM, 1);
+ break;
}
- }
- else if (event.equals("30034-04a.htm"))
- {
- if (st.hasQuestItems(LETTER_OF_ROHMER))
+ case "30034-02a.htm":
{
- htmltext = "30034-04.htm";
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_OF_ROHMER, 1);
+ if (st.hasQuestItems(TOOTH_OF_TOTEM))
+ {
+ htmltext = "30034-02.htm";
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TOOTH_OF_TOTEM, 1);
+ st.giveItems(LETTER_OF_IRIS, 1);
+ }
+ break;
}
- }
- else if (event.equals("30034-06a.htm"))
- {
- if (st.getQuestItemsCount(TOOTH_OF_DRAGON) >= 50)
+ case "30344-02a.htm":
{
- final int position = Rnd.get(REWARD.length);
- htmltext = "30034-06.htm";
- st.takeItems(TOOTH_OF_DRAGON, 50);
- st.giveItems(REWARD[position][0], 1);
- st.rewardItems(57, REWARD[position][1]);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ if (st.hasQuestItems(LETTER_OF_IRIS))
+ {
+ htmltext = "30344-02.htm";
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_OF_IRIS, 1);
+ st.giveItems(LETTER_OF_ROHMER, 1);
+ }
+ break;
+ }
+ case "30034-04a.htm":
+ {
+ if (st.hasQuestItems(LETTER_OF_ROHMER))
+ {
+ htmltext = "30034-04.htm";
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_OF_ROHMER, 1);
+ }
+ break;
+ }
+ case "30034-06a.htm":
+ {
+ if (st.getQuestItemsCount(TOOTH_OF_DRAGON) >= 50)
+ {
+ final int position = Rnd.get(REWARD.length);
+ htmltext = "30034-06.htm";
+ st.takeItems(TOOTH_OF_DRAGON, 50);
+ st.giveItems(REWARD[position][0], 1);
+ st.rewardItems(57, REWARD[position][1]);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
}
}
@@ -199,7 +165,7 @@ public class Q038_DragonFangs extends Quest
break;
case State.STARTED:
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LUIS:
@@ -271,9 +237,9 @@ public class Q038_DragonFangs extends Quest
}
final int[] droplist = DROPLIST.get(npc.getNpcId());
- if ((st.getInt("cond") == droplist[0]) && st.dropItems(droplist[1], 1, droplist[2], droplist[3]))
+ if (st.isCond(droplist[0]) && st.dropItems(droplist[1], 1, droplist[2], droplist[3]))
{
- st.set("cond", String.valueOf(droplist[0] + 1));
+ st.setCond(droplist[0] + 1);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q039_RedEyedInvaders/Q039_RedEyedInvaders.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q039_RedEyedInvaders/Q039_RedEyedInvaders.java
index e0cc882419..09221f8861 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q039_RedEyedInvaders/Q039_RedEyedInvaders.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q039_RedEyedInvaders/Q039_RedEyedInvaders.java
@@ -30,64 +30,34 @@ public class Q039_RedEyedInvaders extends Quest
// NPCs
private static final int BABENCO = 30334;
private static final int BATHIS = 30332;
-
- // Mobs
+ // Monsters
private static final int MAILLE_LIZARDMAN = 20919;
private static final int MAILLE_LIZARDMAN_SCOUT = 20920;
private static final int MAILLE_LIZARDMAN_GUARD = 20921;
private static final int ARANEID = 20925;
-
// Items
private static final int BLACK_BONE_NECKLACE = 7178;
private static final int RED_BONE_NECKLACE = 7179;
private static final int INCENSE_POUCH = 7180;
private static final int GEM_OF_MAILLE = 7181;
-
+ // @formatter:off
// First droplist
private static final Map FIRST_DP = new HashMap<>();
static
{
- FIRST_DP.put(MAILLE_LIZARDMAN_GUARD, new int[]
- {
- RED_BONE_NECKLACE,
- BLACK_BONE_NECKLACE
- });
- FIRST_DP.put(MAILLE_LIZARDMAN, new int[]
- {
- BLACK_BONE_NECKLACE,
- RED_BONE_NECKLACE
- });
- FIRST_DP.put(MAILLE_LIZARDMAN_SCOUT, new int[]
- {
- BLACK_BONE_NECKLACE,
- RED_BONE_NECKLACE
- });
+ FIRST_DP.put(MAILLE_LIZARDMAN_GUARD, new int[]{RED_BONE_NECKLACE, BLACK_BONE_NECKLACE});
+ FIRST_DP.put(MAILLE_LIZARDMAN, new int[]{BLACK_BONE_NECKLACE, RED_BONE_NECKLACE});
+ FIRST_DP.put(MAILLE_LIZARDMAN_SCOUT, new int[]{BLACK_BONE_NECKLACE, RED_BONE_NECKLACE});
}
-
// Second droplist
private static final Map SECOND_DP = new HashMap<>();
static
{
- SECOND_DP.put(ARANEID, new int[]
- {
- GEM_OF_MAILLE,
- INCENSE_POUCH,
- 500000
- });
- SECOND_DP.put(MAILLE_LIZARDMAN_GUARD, new int[]
- {
- INCENSE_POUCH,
- GEM_OF_MAILLE,
- 300000
- });
- SECOND_DP.put(MAILLE_LIZARDMAN_SCOUT, new int[]
- {
- INCENSE_POUCH,
- GEM_OF_MAILLE,
- 250000
- });
+ SECOND_DP.put(ARANEID, new int[]{GEM_OF_MAILLE, INCENSE_POUCH, 500000});
+ SECOND_DP.put(MAILLE_LIZARDMAN_GUARD, new int[]{INCENSE_POUCH, GEM_OF_MAILLE, 300000});
+ SECOND_DP.put(MAILLE_LIZARDMAN_SCOUT, new int[]{INCENSE_POUCH, GEM_OF_MAILLE, 250000});
}
-
+ // @formatter:on
// Rewards
private static final int GREEN_COLORED_LURE_HG = 6521;
private static final int BABY_DUCK_RODE = 6529;
@@ -96,12 +66,9 @@ public class Q039_RedEyedInvaders extends Quest
public Q039_RedEyedInvaders()
{
super(39, "Red-Eyed Invaders");
-
registerQuestItems(BLACK_BONE_NECKLACE, RED_BONE_NECKLACE, INCENSE_POUCH, GEM_OF_MAILLE);
-
addStartNpc(BABENCO);
addTalkId(BABENCO, BATHIS);
-
addKillId(MAILLE_LIZARDMAN, MAILLE_LIZARDMAN_SCOUT, MAILLE_LIZARDMAN_GUARD, ARANEID);
}
@@ -115,33 +82,38 @@ public class Q039_RedEyedInvaders extends Quest
return htmltext;
}
- if (event.equals("30334-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30332-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30332-3.htm"))
- {
- st.set("cond", "4");
- st.takeItems(BLACK_BONE_NECKLACE, -1);
- st.takeItems(RED_BONE_NECKLACE, -1);
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30332-5.htm"))
- {
- st.takeItems(INCENSE_POUCH, -1);
- st.takeItems(GEM_OF_MAILLE, -1);
- st.giveItems(GREEN_COLORED_LURE_HG, 60);
- st.giveItems(BABY_DUCK_RODE, 1);
- st.giveItems(FISHING_SHOT_NG, 500);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30334-1.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30332-1.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30332-3.htm":
+ {
+ st.setCond(4);
+ st.takeItems(BLACK_BONE_NECKLACE, -1);
+ st.takeItems(RED_BONE_NECKLACE, -1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30332-5.htm":
+ {
+ st.takeItems(INCENSE_POUCH, -1);
+ st.takeItems(GEM_OF_MAILLE, -1);
+ st.giveItems(GREEN_COLORED_LURE_HG, 60);
+ st.giveItems(BABY_DUCK_RODE, 1);
+ st.giveItems(FISHING_SHOT_NG, 500);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -160,18 +132,22 @@ public class Q039_RedEyedInvaders extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "30334-2.htm" : "30334-0.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BABENCO:
+ {
htmltext = "30334-3.htm";
break;
-
+ }
case BATHIS:
+ {
if (cond == 1)
{
htmltext = "30332-0.htm";
@@ -193,12 +169,15 @@ public class Q039_RedEyedInvaders extends Quest
htmltext = "30332-4.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -208,7 +187,7 @@ public class Q039_RedEyedInvaders extends Quest
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
final int npcId = npc.getNpcId();
- PlayerInstance partyMember = getRandomPartyMember(player, npc, "2");
+ PlayerInstance partyMember = getRandomPartyMember(player, npc, 2);
if ((partyMember != null) && (npcId != ARANEID))
{
final QuestState st = partyMember.getQuestState(getName());
@@ -220,12 +199,12 @@ public class Q039_RedEyedInvaders extends Quest
final int[] list = FIRST_DP.get(npcId);
if (st.dropItems(list[0], 1, 100, 500000) && (st.getQuestItemsCount(list[1]) == 100))
{
- st.set("cond", "3");
+ st.setCond(3);
}
}
else
{
- partyMember = getRandomPartyMember(player, npc, "4");
+ partyMember = getRandomPartyMember(player, npc, 4);
if ((partyMember != null) && (npcId != MAILLE_LIZARDMAN))
{
final QuestState st = partyMember.getQuestState(getName());
@@ -237,7 +216,7 @@ public class Q039_RedEyedInvaders extends Quest
final int[] list = SECOND_DP.get(npcId);
if (st.dropItems(list[0], 1, 30, list[2]) && (st.getQuestItemsCount(list[1]) == 30))
{
- st.set("cond", "5");
+ st.setCond(5);
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q042_HelpTheUncle/Q042_HelpTheUncle.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q042_HelpTheUncle/Q042_HelpTheUncle.java
index 4dc07a0770..6ab65bbd8a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q042_HelpTheUncle/Q042_HelpTheUncle.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q042_HelpTheUncle/Q042_HelpTheUncle.java
@@ -27,26 +27,21 @@ public class Q042_HelpTheUncle extends Quest
// NPCs
private static final int WATERS = 30828;
private static final int SOPHYA = 30735;
-
+ // Monsters
+ private static final int MONSTER_EYE_DESTROYER = 20068;
+ private static final int MONSTER_EYE_GAZER = 20266;
// Items
private static final int TRIDENT = 291;
private static final int MAP_PIECE = 7548;
private static final int MAP = 7549;
private static final int PET_TICKET = 7583;
- // Monsters
- private static final int MONSTER_EYE_DESTROYER = 20068;
- private static final int MONSTER_EYE_GAZER = 20266;
-
public Q042_HelpTheUncle()
{
super(42, "Help the Uncle!");
-
registerQuestItems(MAP_PIECE, MAP);
-
addStartNpc(WATERS);
addTalkId(WATERS, SOPHYA);
-
addKillId(MONSTER_EYE_DESTROYER, MONSTER_EYE_GAZER);
}
@@ -60,36 +55,45 @@ public class Q042_HelpTheUncle extends Quest
return htmltext;
}
- if (event.equals("30828-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30828-03.htm") && st.hasQuestItems(TRIDENT))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TRIDENT, 1);
- }
- else if (event.equals("30828-05.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAP_PIECE, 30);
- st.giveItems(MAP, 1);
- }
- else if (event.equals("30735-06.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAP, 1);
- }
- else if (event.equals("30828-07.htm"))
- {
- st.giveItems(PET_TICKET, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30828-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30828-03.htm":
+ {
+ if (st.hasQuestItems(TRIDENT))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TRIDENT, 1);
+ }
+ break;
+ }
+ case "30828-05.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAP_PIECE, 30);
+ st.giveItems(MAP, 1);
+ break;
+ }
+ case "30735-06.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAP, 1);
+ break;
+ }
+ case "30828-07.htm":
+ {
+ st.giveItems(PET_TICKET, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -108,14 +112,17 @@ public class Q042_HelpTheUncle extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 25) ? "30828-00a.htm" : "30828-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case WATERS:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(TRIDENT)) ? "30828-01a.htm" : "30828-02.htm";
@@ -137,8 +144,9 @@ public class Q042_HelpTheUncle extends Quest
htmltext = "30828-06.htm";
}
break;
-
+ }
case SOPHYA:
+ {
if (cond == 4)
{
htmltext = "30735-05.htm";
@@ -148,12 +156,15 @@ public class Q042_HelpTheUncle extends Quest
htmltext = "30735-06a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -162,7 +173,7 @@ public class Q042_HelpTheUncle extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -170,7 +181,7 @@ public class Q042_HelpTheUncle extends Quest
if (st.dropItemsAlways(MAP_PIECE, 1, 30))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q043_HelpTheSister/Q043_HelpTheSister.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q043_HelpTheSister/Q043_HelpTheSister.java
index 78b9b411d7..5217997f98 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q043_HelpTheSister/Q043_HelpTheSister.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q043_HelpTheSister/Q043_HelpTheSister.java
@@ -27,26 +27,21 @@ public class Q043_HelpTheSister extends Quest
// NPCs
private static final int COOPER = 30829;
private static final int GALLADUCCI = 30097;
-
+ // Monsters
+ private static final int SPECTER = 20171;
+ private static final int SORROW_MAIDEN = 20197;
// Items
private static final int CRAFTED_DAGGER = 220;
private static final int MAP_PIECE = 7550;
private static final int MAP = 7551;
private static final int PET_TICKET = 7584;
- // Monsters
- private static final int SPECTER = 20171;
- private static final int SORROW_MAIDEN = 20197;
-
public Q043_HelpTheSister()
{
super(43, "Help the Sister!");
-
registerQuestItems(MAP_PIECE, MAP);
-
addStartNpc(COOPER);
addTalkId(COOPER, GALLADUCCI);
-
addKillId(SPECTER, SORROW_MAIDEN);
}
@@ -60,36 +55,45 @@ public class Q043_HelpTheSister extends Quest
return htmltext;
}
- if (event.equals("30829-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30829-03.htm") && st.hasQuestItems(CRAFTED_DAGGER))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRAFTED_DAGGER, 1);
- }
- else if (event.equals("30829-05.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAP_PIECE, 30);
- st.giveItems(MAP, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAP, 1);
- }
- else if (event.equals("30829-07.htm"))
- {
- st.giveItems(PET_TICKET, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30829-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30829-03.htm":
+ {
+ if (st.hasQuestItems(CRAFTED_DAGGER))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRAFTED_DAGGER, 1);
+ }
+ break;
+ }
+ case "30829-05.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAP_PIECE, 30);
+ st.giveItems(MAP, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAP, 1);
+ break;
+ }
+ case "30829-07.htm":
+ {
+ st.giveItems(PET_TICKET, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -108,14 +112,17 @@ public class Q043_HelpTheSister extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 26) ? "30829-00a.htm" : "30829-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case COOPER:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(CRAFTED_DAGGER)) ? "30829-01a.htm" : "30829-02.htm";
@@ -137,8 +144,9 @@ public class Q043_HelpTheSister extends Quest
htmltext = "30829-06.htm";
}
break;
-
+ }
case GALLADUCCI:
+ {
if (cond == 4)
{
htmltext = "30097-05.htm";
@@ -148,12 +156,15 @@ public class Q043_HelpTheSister extends Quest
htmltext = "30097-06a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -162,7 +173,7 @@ public class Q043_HelpTheSister extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -170,7 +181,7 @@ public class Q043_HelpTheSister extends Quest
if (st.dropItemsAlways(MAP_PIECE, 1, 30))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q044_HelpTheSon/Q044_HelpTheSon.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q044_HelpTheSon/Q044_HelpTheSon.java
index 3f83b360bb..8ef336f2d7 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q044_HelpTheSon/Q044_HelpTheSon.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q044_HelpTheSon/Q044_HelpTheSon.java
@@ -24,30 +24,25 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q044_HelpTheSon extends Quest
{
- // Npcs
+ // NPCs
private static final int LUNDY = 30827;
private static final int DRIKUS = 30505;
-
+ // Monsters
+ private static final int MAILLE = 20919;
+ private static final int MAILLE_SCOUT = 20920;
+ private static final int MAILLE_GUARD = 20921;
// Items
private static final int WORK_HAMMER = 168;
private static final int GEMSTONE_FRAGMENT = 7552;
private static final int GEMSTONE = 7553;
private static final int PET_TICKET = 7585;
- // Monsters
- private static final int MAILLE = 20919;
- private static final int MAILLE_SCOUT = 20920;
- private static final int MAILLE_GUARD = 20921;
-
public Q044_HelpTheSon()
{
super(44, "Help the Son!");
-
registerQuestItems(GEMSTONE_FRAGMENT, GEMSTONE);
-
addStartNpc(LUNDY);
addTalkId(LUNDY, DRIKUS);
-
addKillId(MAILLE, MAILLE_SCOUT, MAILLE_GUARD);
}
@@ -61,36 +56,45 @@ public class Q044_HelpTheSon extends Quest
return htmltext;
}
- if (event.equals("30827-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30827-03.htm") && st.hasQuestItems(WORK_HAMMER))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WORK_HAMMER, 1);
- }
- else if (event.equals("30827-05.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_FRAGMENT, 30);
- st.giveItems(GEMSTONE, 1);
- }
- else if (event.equals("30505-06.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE, 1);
- }
- else if (event.equals("30827-07.htm"))
- {
- st.giveItems(PET_TICKET, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30827-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30827-03.htm":
+ {
+ if (st.hasQuestItems(WORK_HAMMER))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WORK_HAMMER, 1);
+ }
+ break;
+ }
+ case "30827-05.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_FRAGMENT, 30);
+ st.giveItems(GEMSTONE, 1);
+ break;
+ }
+ case "30505-06.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE, 1);
+ break;
+ }
+ case "30827-07.htm":
+ {
+ st.giveItems(PET_TICKET, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -109,14 +113,17 @@ public class Q044_HelpTheSon extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 24) ? "30827-00a.htm" : "30827-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LUNDY:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(WORK_HAMMER)) ? "30827-01a.htm" : "30827-02.htm";
@@ -138,8 +145,9 @@ public class Q044_HelpTheSon extends Quest
htmltext = "30827-06.htm";
}
break;
-
+ }
case DRIKUS:
+ {
if (cond == 4)
{
htmltext = "30505-05.htm";
@@ -149,12 +157,15 @@ public class Q044_HelpTheSon extends Quest
htmltext = "30505-06a.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -163,7 +174,7 @@ public class Q044_HelpTheSon extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -171,7 +182,7 @@ public class Q044_HelpTheSon extends Quest
if (st.dropItemsAlways(GEMSTONE_FRAGMENT, 1, 30))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q045_ToTalkingIsland/Q045_ToTalkingIsland.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q045_ToTalkingIsland/Q045_ToTalkingIsland.java
index 2f93f4d3f5..c681299bf0 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q045_ToTalkingIsland/Q045_ToTalkingIsland.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q045_ToTalkingIsland/Q045_ToTalkingIsland.java
@@ -21,12 +21,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q045_ToTalkingIsland extends Quest
{
- // Npcs
+ // NPCs
private static final int GALLADUCCI = 30097;
private static final int GENTLER = 30094;
private static final int SANDRA = 30090;
private static final int DUSTIN = 30116;
-
// Items
private static final int ORDER_DOCUMENT_1 = 7563;
private static final int ORDER_DOCUMENT_2 = 7564;
@@ -40,9 +39,7 @@ public class Q045_ToTalkingIsland extends Quest
public Q045_ToTalkingIsland()
{
super(45, "To Talking Island");
-
registerQuestItems(ORDER_DOCUMENT_1, ORDER_DOCUMENT_2, ORDER_DOCUMENT_3, MAGIC_SWORD_HILT, GEMSTONE_POWDER, PURIFIED_MAGIC_NECKLACE);
-
addStartNpc(GALLADUCCI);
addTalkId(GALLADUCCI, GENTLER, SANDRA, DUSTIN);
}
@@ -57,55 +54,63 @@ public class Q045_ToTalkingIsland extends Quest
return htmltext;
}
- if (event.equals("30097-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_DOCUMENT_1, 1);
- }
- else if (event.equals("30094-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_1, 1);
- st.giveItems(MAGIC_SWORD_HILT, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAGIC_SWORD_HILT, 1);
- st.giveItems(ORDER_DOCUMENT_2, 1);
- }
- else if (event.equals("30090-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_2, 1);
- st.giveItems(GEMSTONE_POWDER, 1);
- }
- else if (event.equals("30097-09.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_POWDER, 1);
- st.giveItems(ORDER_DOCUMENT_3, 1);
- }
- else if (event.equals("30116-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_3, 1);
- st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
- }
- else if (event.equals("30097-12.htm"))
- {
- st.takeItems(MARK_OF_TRAVELER, -1);
- st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
- st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30097-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(ORDER_DOCUMENT_1, 1);
+ break;
+ }
+ case "30094-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_1, 1);
+ st.giveItems(MAGIC_SWORD_HILT, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAGIC_SWORD_HILT, 1);
+ st.giveItems(ORDER_DOCUMENT_2, 1);
+ break;
+ }
+ case "30090-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_2, 1);
+ st.giveItems(GEMSTONE_POWDER, 1);
+ break;
+ }
+ case "30097-09.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_POWDER, 1);
+ st.giveItems(ORDER_DOCUMENT_3, 1);
+ break;
+ }
+ case "30116-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_3, 1);
+ st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
+ break;
+ }
+ case "30097-12.htm":
+ {
+ st.takeItems(MARK_OF_TRAVELER, -1);
+ st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
+ st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -124,6 +129,7 @@ public class Q045_ToTalkingIsland extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() == Race.HUMAN) && (player.getLevel() >= 3))
{
if (st.hasQuestItems(MARK_OF_TRAVELER))
@@ -140,12 +146,14 @@ public class Q045_ToTalkingIsland extends Quest
htmltext = "30097-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLADUCCI:
+ {
if (cond == 1)
{
htmltext = "30097-04.htm";
@@ -171,8 +179,9 @@ public class Q045_ToTalkingIsland extends Quest
htmltext = "30097-11.htm";
}
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-01.htm";
@@ -182,8 +191,9 @@ public class Q045_ToTalkingIsland extends Quest
htmltext = "30094-03.htm";
}
break;
-
+ }
case SANDRA:
+ {
if (cond == 3)
{
htmltext = "30090-01.htm";
@@ -193,8 +203,9 @@ public class Q045_ToTalkingIsland extends Quest
htmltext = "30090-03.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 5)
{
htmltext = "30116-01.htm";
@@ -204,12 +215,15 @@ public class Q045_ToTalkingIsland extends Quest
htmltext = "30116-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q046_OnceMoreInTheArmsOfTheMotherTree/Q046_OnceMoreInTheArmsOfTheMotherTree.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q046_OnceMoreInTheArmsOfTheMotherTree/Q046_OnceMoreInTheArmsOfTheMotherTree.java
index b5a3db7797..5952a8521f 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q046_OnceMoreInTheArmsOfTheMotherTree/Q046_OnceMoreInTheArmsOfTheMotherTree.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q046_OnceMoreInTheArmsOfTheMotherTree/Q046_OnceMoreInTheArmsOfTheMotherTree.java
@@ -30,7 +30,6 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
private static final int GENTLER = 30094;
private static final int SANDRA = 30090;
private static final int DUSTIN = 30116;
-
// Items
private static final int ORDER_DOCUMENT_1 = 7563;
private static final int ORDER_DOCUMENT_2 = 7564;
@@ -44,9 +43,7 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
public Q046_OnceMoreInTheArmsOfTheMotherTree()
{
super(46, "Once More In the Arms of the Mother Tree");
-
registerQuestItems(ORDER_DOCUMENT_1, ORDER_DOCUMENT_2, ORDER_DOCUMENT_3, MAGIC_SWORD_HILT, GEMSTONE_POWDER, PURIFIED_MAGIC_NECKLACE);
-
addStartNpc(GALLADUCCI);
addTalkId(GALLADUCCI, GENTLER, SANDRA, DUSTIN);
}
@@ -61,55 +58,63 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
return htmltext;
}
- if (event.equals("30097-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_DOCUMENT_1, 1);
- }
- else if (event.equals("30094-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_1, 1);
- st.giveItems(MAGIC_SWORD_HILT, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAGIC_SWORD_HILT, 1);
- st.giveItems(ORDER_DOCUMENT_2, 1);
- }
- else if (event.equals("30090-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_2, 1);
- st.giveItems(GEMSTONE_POWDER, 1);
- }
- else if (event.equals("30097-09.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_POWDER, 1);
- st.giveItems(ORDER_DOCUMENT_3, 1);
- }
- else if (event.equals("30116-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_3, 1);
- st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
- }
- else if (event.equals("30097-12.htm"))
- {
- st.takeItems(MARK_OF_TRAVELER, -1);
- st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
- st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30097-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(ORDER_DOCUMENT_1, 1);
+ break;
+ }
+ case "30094-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_1, 1);
+ st.giveItems(MAGIC_SWORD_HILT, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAGIC_SWORD_HILT, 1);
+ st.giveItems(ORDER_DOCUMENT_2, 1);
+ break;
+ }
+ case "30090-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_2, 1);
+ st.giveItems(GEMSTONE_POWDER, 1);
+ break;
+ }
+ case "30097-09.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_POWDER, 1);
+ st.giveItems(ORDER_DOCUMENT_3, 1);
+ break;
+ }
+ case "30116-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_3, 1);
+ st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
+ break;
+ }
+ case "30097-12.htm":
+ {
+ st.takeItems(MARK_OF_TRAVELER, -1);
+ st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
+ st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -128,6 +133,7 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() == Race.ELF) && (player.getLevel() >= 3))
{
if (st.hasQuestItems(MARK_OF_TRAVELER))
@@ -144,12 +150,14 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
htmltext = "30097-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLADUCCI:
+ {
if (cond == 1)
{
htmltext = "30097-04.htm";
@@ -175,8 +183,9 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
htmltext = "30097-11.htm";
}
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-01.htm";
@@ -186,8 +195,9 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
htmltext = "30094-03.htm";
}
break;
-
+ }
case SANDRA:
+ {
if (cond == 3)
{
htmltext = "30090-01.htm";
@@ -197,8 +207,9 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
htmltext = "30090-03.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 5)
{
htmltext = "30116-01.htm";
@@ -208,12 +219,15 @@ public class Q046_OnceMoreInTheArmsOfTheMotherTree extends Quest
htmltext = "30116-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q047_IntoTheDarkForest/Q047_IntoTheDarkForest.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q047_IntoTheDarkForest/Q047_IntoTheDarkForest.java
index 1ba040fd6f..a02ce8334d 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q047_IntoTheDarkForest/Q047_IntoTheDarkForest.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q047_IntoTheDarkForest/Q047_IntoTheDarkForest.java
@@ -30,7 +30,6 @@ public class Q047_IntoTheDarkForest extends Quest
private static final int GENTLER = 30094;
private static final int SANDRA = 30090;
private static final int DUSTIN = 30116;
-
// Items
private static final int ORDER_DOCUMENT_1 = 7563;
private static final int ORDER_DOCUMENT_2 = 7564;
@@ -44,9 +43,7 @@ public class Q047_IntoTheDarkForest extends Quest
public Q047_IntoTheDarkForest()
{
super(47, "Into the Dark Forest");
-
registerQuestItems(ORDER_DOCUMENT_1, ORDER_DOCUMENT_2, ORDER_DOCUMENT_3, MAGIC_SWORD_HILT, GEMSTONE_POWDER, PURIFIED_MAGIC_NECKLACE);
-
addStartNpc(GALLADUCCI);
addTalkId(GALLADUCCI, SANDRA, DUSTIN, GENTLER);
}
@@ -61,55 +58,63 @@ public class Q047_IntoTheDarkForest extends Quest
return htmltext;
}
- if (event.equals("30097-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_DOCUMENT_1, 1);
- }
- else if (event.equals("30094-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_1, 1);
- st.giveItems(MAGIC_SWORD_HILT, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAGIC_SWORD_HILT, 1);
- st.giveItems(ORDER_DOCUMENT_2, 1);
- }
- else if (event.equals("30090-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_2, 1);
- st.giveItems(GEMSTONE_POWDER, 1);
- }
- else if (event.equals("30097-09.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_POWDER, 1);
- st.giveItems(ORDER_DOCUMENT_3, 1);
- }
- else if (event.equals("30116-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_3, 1);
- st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
- }
- else if (event.equals("30097-12.htm"))
- {
- st.takeItems(MARK_OF_TRAVELER, -1);
- st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
- st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30097-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(ORDER_DOCUMENT_1, 1);
+ break;
+ }
+ case "30094-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_1, 1);
+ st.giveItems(MAGIC_SWORD_HILT, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAGIC_SWORD_HILT, 1);
+ st.giveItems(ORDER_DOCUMENT_2, 1);
+ break;
+ }
+ case "30090-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_2, 1);
+ st.giveItems(GEMSTONE_POWDER, 1);
+ break;
+ }
+ case "30097-09.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_POWDER, 1);
+ st.giveItems(ORDER_DOCUMENT_3, 1);
+ break;
+ }
+ case "30116-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_3, 1);
+ st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
+ break;
+ }
+ case "30097-12.htm":
+ {
+ st.takeItems(MARK_OF_TRAVELER, -1);
+ st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
+ st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -128,6 +133,7 @@ public class Q047_IntoTheDarkForest extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() == Race.DARK_ELF) && (player.getLevel() >= 3))
{
if (st.hasQuestItems(MARK_OF_TRAVELER))
@@ -144,12 +150,14 @@ public class Q047_IntoTheDarkForest extends Quest
htmltext = "30097-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLADUCCI:
+ {
if (cond == 1)
{
htmltext = "30097-04.htm";
@@ -175,8 +183,9 @@ public class Q047_IntoTheDarkForest extends Quest
htmltext = "30097-11.htm";
}
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-01.htm";
@@ -186,8 +195,9 @@ public class Q047_IntoTheDarkForest extends Quest
htmltext = "30094-03.htm";
}
break;
-
+ }
case SANDRA:
+ {
if (cond == 3)
{
htmltext = "30090-01.htm";
@@ -197,8 +207,9 @@ public class Q047_IntoTheDarkForest extends Quest
htmltext = "30090-03.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 5)
{
htmltext = "30116-01.htm";
@@ -208,12 +219,15 @@ public class Q047_IntoTheDarkForest extends Quest
htmltext = "30116-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q048_ToTheImmortalPlateau/Q048_ToTheImmortalPlateau.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q048_ToTheImmortalPlateau/Q048_ToTheImmortalPlateau.java
index 1772cbb811..d92c97f567 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q048_ToTheImmortalPlateau/Q048_ToTheImmortalPlateau.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q048_ToTheImmortalPlateau/Q048_ToTheImmortalPlateau.java
@@ -30,7 +30,6 @@ public class Q048_ToTheImmortalPlateau extends Quest
private static final int GENTLER = 30094;
private static final int SANDRA = 30090;
private static final int DUSTIN = 30116;
-
// Items
private static final int ORDER_DOCUMENT_1 = 7563;
private static final int ORDER_DOCUMENT_2 = 7564;
@@ -44,9 +43,7 @@ public class Q048_ToTheImmortalPlateau extends Quest
public Q048_ToTheImmortalPlateau()
{
super(48, "To the Immortal Plateau");
-
registerQuestItems(ORDER_DOCUMENT_1, ORDER_DOCUMENT_2, ORDER_DOCUMENT_3, MAGIC_SWORD_HILT, GEMSTONE_POWDER, PURIFIED_MAGIC_NECKLACE);
-
addStartNpc(GALLADUCCI);
addTalkId(GALLADUCCI, SANDRA, DUSTIN, GENTLER);
}
@@ -61,55 +58,63 @@ public class Q048_ToTheImmortalPlateau extends Quest
return htmltext;
}
- if (event.equals("30097-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_DOCUMENT_1, 1);
- }
- else if (event.equals("30094-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_1, 1);
- st.giveItems(MAGIC_SWORD_HILT, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAGIC_SWORD_HILT, 1);
- st.giveItems(ORDER_DOCUMENT_2, 1);
- }
- else if (event.equals("30090-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_2, 1);
- st.giveItems(GEMSTONE_POWDER, 1);
- }
- else if (event.equals("30097-09.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_POWDER, 1);
- st.giveItems(ORDER_DOCUMENT_3, 1);
- }
- else if (event.equals("30116-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_3, 1);
- st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
- }
- else if (event.equals("30097-12.htm"))
- {
- st.takeItems(MARK_OF_TRAVELER, -1);
- st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
- st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30097-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(ORDER_DOCUMENT_1, 1);
+ break;
+ }
+ case "30094-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_1, 1);
+ st.giveItems(MAGIC_SWORD_HILT, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAGIC_SWORD_HILT, 1);
+ st.giveItems(ORDER_DOCUMENT_2, 1);
+ break;
+ }
+ case "30090-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_2, 1);
+ st.giveItems(GEMSTONE_POWDER, 1);
+ break;
+ }
+ case "30097-09.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_POWDER, 1);
+ st.giveItems(ORDER_DOCUMENT_3, 1);
+ break;
+ }
+ case "30116-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_3, 1);
+ st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
+ break;
+ }
+ case "30097-12.htm":
+ {
+ st.takeItems(MARK_OF_TRAVELER, -1);
+ st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
+ st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -128,6 +133,7 @@ public class Q048_ToTheImmortalPlateau extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() == Race.ORC) && (player.getLevel() >= 3))
{
if (st.hasQuestItems(MARK_OF_TRAVELER))
@@ -144,12 +150,14 @@ public class Q048_ToTheImmortalPlateau extends Quest
htmltext = "30097-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLADUCCI:
+ {
if (cond == 1)
{
htmltext = "30097-04.htm";
@@ -175,8 +183,9 @@ public class Q048_ToTheImmortalPlateau extends Quest
htmltext = "30097-11.htm";
}
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-01.htm";
@@ -186,8 +195,9 @@ public class Q048_ToTheImmortalPlateau extends Quest
htmltext = "30094-03.htm";
}
break;
-
+ }
case SANDRA:
+ {
if (cond == 3)
{
htmltext = "30090-01.htm";
@@ -197,8 +207,9 @@ public class Q048_ToTheImmortalPlateau extends Quest
htmltext = "30090-03.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 5)
{
htmltext = "30116-01.htm";
@@ -208,12 +219,15 @@ public class Q048_ToTheImmortalPlateau extends Quest
htmltext = "30116-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q049_TheRoadHome/Q049_TheRoadHome.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q049_TheRoadHome/Q049_TheRoadHome.java
index 0d15347c76..328b4903fc 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q049_TheRoadHome/Q049_TheRoadHome.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q049_TheRoadHome/Q049_TheRoadHome.java
@@ -30,7 +30,6 @@ public class Q049_TheRoadHome extends Quest
private static final int GENTLER = 30094;
private static final int SANDRA = 30090;
private static final int DUSTIN = 30116;
-
// Items
private static final int ORDER_DOCUMENT_1 = 7563;
private static final int ORDER_DOCUMENT_2 = 7564;
@@ -44,9 +43,7 @@ public class Q049_TheRoadHome extends Quest
public Q049_TheRoadHome()
{
super(49, "The Road Home");
-
registerQuestItems(ORDER_DOCUMENT_1, ORDER_DOCUMENT_2, ORDER_DOCUMENT_3, MAGIC_SWORD_HILT, GEMSTONE_POWDER, PURIFIED_MAGIC_NECKLACE);
-
addStartNpc(GALLADUCCI);
addTalkId(GALLADUCCI, GENTLER, SANDRA, DUSTIN);
}
@@ -61,55 +58,63 @@ public class Q049_TheRoadHome extends Quest
return htmltext;
}
- if (event.equals("30097-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_DOCUMENT_1, 1);
- }
- else if (event.equals("30094-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_1, 1);
- st.giveItems(MAGIC_SWORD_HILT, 1);
- }
- else if (event.equals("30097-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MAGIC_SWORD_HILT, 1);
- st.giveItems(ORDER_DOCUMENT_2, 1);
- }
- else if (event.equals("30090-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_2, 1);
- st.giveItems(GEMSTONE_POWDER, 1);
- }
- else if (event.equals("30097-09.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GEMSTONE_POWDER, 1);
- st.giveItems(ORDER_DOCUMENT_3, 1);
- }
- else if (event.equals("30116-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORDER_DOCUMENT_3, 1);
- st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
- }
- else if (event.equals("30097-12.htm"))
- {
- st.takeItems(MARK_OF_TRAVELER, -1);
- st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
- st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30097-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(ORDER_DOCUMENT_1, 1);
+ break;
+ }
+ case "30094-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_1, 1);
+ st.giveItems(MAGIC_SWORD_HILT, 1);
+ break;
+ }
+ case "30097-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MAGIC_SWORD_HILT, 1);
+ st.giveItems(ORDER_DOCUMENT_2, 1);
+ break;
+ }
+ case "30090-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_2, 1);
+ st.giveItems(GEMSTONE_POWDER, 1);
+ break;
+ }
+ case "30097-09.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GEMSTONE_POWDER, 1);
+ st.giveItems(ORDER_DOCUMENT_3, 1);
+ break;
+ }
+ case "30116-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORDER_DOCUMENT_3, 1);
+ st.giveItems(PURIFIED_MAGIC_NECKLACE, 1);
+ break;
+ }
+ case "30097-12.htm":
+ {
+ st.takeItems(MARK_OF_TRAVELER, -1);
+ st.takeItems(PURIFIED_MAGIC_NECKLACE, 1);
+ st.rewardItems(SCROLL_OF_ESCAPE_SPECIAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -128,6 +133,7 @@ public class Q049_TheRoadHome extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getRace() == Race.DWARF) && (player.getLevel() >= 3))
{
if (st.hasQuestItems(MARK_OF_TRAVELER))
@@ -144,12 +150,14 @@ public class Q049_TheRoadHome extends Quest
htmltext = "30097-01a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLADUCCI:
+ {
if (cond == 1)
{
htmltext = "30097-04.htm";
@@ -175,8 +183,9 @@ public class Q049_TheRoadHome extends Quest
htmltext = "30097-11.htm";
}
break;
-
+ }
case GENTLER:
+ {
if (cond == 1)
{
htmltext = "30094-01.htm";
@@ -186,8 +195,9 @@ public class Q049_TheRoadHome extends Quest
htmltext = "30094-03.htm";
}
break;
-
+ }
case SANDRA:
+ {
if (cond == 3)
{
htmltext = "30090-01.htm";
@@ -197,8 +207,9 @@ public class Q049_TheRoadHome extends Quest
htmltext = "30090-03.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 5)
{
htmltext = "30116-01.htm";
@@ -208,12 +219,15 @@ public class Q049_TheRoadHome extends Quest
htmltext = "30116-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q050_LanoscosSpecialBait/Q050_LanoscosSpecialBait.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q050_LanoscosSpecialBait/Q050_LanoscosSpecialBait.java
index f40debe490..19e414fd6b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q050_LanoscosSpecialBait/Q050_LanoscosSpecialBait.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q050_LanoscosSpecialBait/Q050_LanoscosSpecialBait.java
@@ -26,19 +26,15 @@ public class Q050_LanoscosSpecialBait extends Quest
{
// Item
private static final int ESSENCE_OF_WIND = 7621;
-
// Reward
private static final int WIND_FISHING_LURE = 7610;
public Q050_LanoscosSpecialBait()
{
super(50, "Lanosco's Special Bait");
-
registerQuestItems(ESSENCE_OF_WIND);
-
addStartNpc(31570); // Lanosco
addTalkId(31570);
-
addKillId(21026); // Singing wind
}
@@ -54,9 +50,7 @@ public class Q050_LanoscosSpecialBait extends Quest
if (event.equals("31570-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31570-07.htm"))
{
@@ -83,16 +77,20 @@ public class Q050_LanoscosSpecialBait extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 27) ? "31570-02.htm" : "31570-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(ESSENCE_OF_WIND) == 100) ? "31570-04.htm" : "31570-05.htm";
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -101,7 +99,7 @@ public class Q050_LanoscosSpecialBait extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -109,7 +107,7 @@ public class Q050_LanoscosSpecialBait extends Quest
if (st.dropItems(ESSENCE_OF_WIND, 1, 100, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q051_OFullesSpecialBait/Q051_OFullesSpecialBait.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q051_OFullesSpecialBait/Q051_OFullesSpecialBait.java
index ab837bbb39..e374ee7874 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q051_OFullesSpecialBait/Q051_OFullesSpecialBait.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q051_OFullesSpecialBait/Q051_OFullesSpecialBait.java
@@ -26,19 +26,15 @@ public class Q051_OFullesSpecialBait extends Quest
{
// Item
private static final int LOST_BAIT = 7622;
-
// Reward
private static final int ICY_AIR_LURE = 7611;
public Q051_OFullesSpecialBait()
{
super(51, "O'Fulle's Special Bait");
-
registerQuestItems(LOST_BAIT);
-
addStartNpc(31572); // O'Fulle
addTalkId(31572);
-
addKillId(20552); // Fettered Soul
}
@@ -54,9 +50,7 @@ public class Q051_OFullesSpecialBait extends Quest
if (event.equals("31572-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31572-07.htm"))
{
@@ -83,16 +77,20 @@ public class Q051_OFullesSpecialBait extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 36) ? "31572-02.htm" : "31572-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(LOST_BAIT) == 100) ? "31572-04.htm" : "31572-05.htm";
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -101,7 +99,7 @@ public class Q051_OFullesSpecialBait extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -109,7 +107,7 @@ public class Q051_OFullesSpecialBait extends Quest
if (st.dropItemsAlways(LOST_BAIT, 1, 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q052_WilliesSpecialBait/Q052_WilliesSpecialBait.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q052_WilliesSpecialBait/Q052_WilliesSpecialBait.java
index 91cccf8b3e..c6d4bb43c3 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q052_WilliesSpecialBait/Q052_WilliesSpecialBait.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q052_WilliesSpecialBait/Q052_WilliesSpecialBait.java
@@ -26,19 +26,15 @@ public class Q052_WilliesSpecialBait extends Quest
{
// Item
private static final int TARLK_EYE = 7623;
-
// Reward
private static final int EARTH_FISHING_LURE = 7612;
public Q052_WilliesSpecialBait()
{
super(52, "Willie's Special Bait");
-
registerQuestItems(TARLK_EYE);
-
addStartNpc(31574); // Willie
addTalkId(31574);
-
addKillId(20573); // Tarlk Basilik
}
@@ -54,9 +50,7 @@ public class Q052_WilliesSpecialBait extends Quest
if (event.equals("31574-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31574-07.htm"))
{
@@ -83,16 +77,20 @@ public class Q052_WilliesSpecialBait extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 48) ? "31574-02.htm" : "31574-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(TARLK_EYE) == 100) ? "31574-04.htm" : "31574-05.htm";
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -101,7 +99,7 @@ public class Q052_WilliesSpecialBait extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -109,7 +107,7 @@ public class Q052_WilliesSpecialBait extends Quest
if (st.dropItems(TARLK_EYE, 1, 100, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q053_LinnaeusSpecialBait/Q053_LinnaeusSpecialBait.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q053_LinnaeusSpecialBait/Q053_LinnaeusSpecialBait.java
index 1e91c88ab3..e2ee0695f2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q053_LinnaeusSpecialBait/Q053_LinnaeusSpecialBait.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q053_LinnaeusSpecialBait/Q053_LinnaeusSpecialBait.java
@@ -26,19 +26,15 @@ public class Q053_LinnaeusSpecialBait extends Quest
{
// Item
private static final int CRIMSON_DRAKE_HEART = 7624;
-
// Reward
private static final int FLAMING_FISHING_LURE = 7613;
public Q053_LinnaeusSpecialBait()
{
super(53, "Linnaeus' Special Bait");
-
registerQuestItems(CRIMSON_DRAKE_HEART);
-
addStartNpc(31577); // Linnaeus
addTalkId(31577);
-
addKillId(20670); // Crimson Drake
}
@@ -54,9 +50,7 @@ public class Q053_LinnaeusSpecialBait extends Quest
if (event.equals("31577-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31577-07.htm"))
{
@@ -83,16 +77,20 @@ public class Q053_LinnaeusSpecialBait extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "31577-02.htm" : "31577-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(CRIMSON_DRAKE_HEART) == 100) ? "31577-04.htm" : "31577-05.htm";
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -101,7 +99,7 @@ public class Q053_LinnaeusSpecialBait extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -109,7 +107,7 @@ public class Q053_LinnaeusSpecialBait extends Quest
if (st.dropItems(CRIMSON_DRAKE_HEART, 1, 100, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q101_SwordOfSolidarity/Q101_SwordOfSolidarity.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q101_SwordOfSolidarity/Q101_SwordOfSolidarity.java
index 862243f692..ef381812b4 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q101_SwordOfSolidarity/Q101_SwordOfSolidarity.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q101_SwordOfSolidarity/Q101_SwordOfSolidarity.java
@@ -29,7 +29,6 @@ public class Q101_SwordOfSolidarity extends Quest
// NPCs
private static final int ROIEN = 30008;
private static final int ALTRAN = 30283;
-
// Items
private static final int BROKEN_SWORD_HANDLE = 739;
private static final int BROKEN_BLADE_BOTTOM = 740;
@@ -37,7 +36,6 @@ public class Q101_SwordOfSolidarity extends Quest
private static final int ROIENS_LETTER = 796;
private static final int DIR_TO_RUINS = 937;
private static final int ALTRANS_NOTE = 742;
-
private static final int SWORD_OF_SOLIDARITY = 738;
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
@@ -51,12 +49,9 @@ public class Q101_SwordOfSolidarity extends Quest
public Q101_SwordOfSolidarity()
{
super(101, "Sword of Solidarity");
-
registerQuestItems(BROKEN_SWORD_HANDLE, BROKEN_BLADE_BOTTOM, BROKEN_BLADE_TOP);
-
addStartNpc(ROIEN);
addTalkId(ROIEN, ALTRAN);
-
addKillId(20361, 20362);
}
@@ -70,49 +65,51 @@ public class Q101_SwordOfSolidarity extends Quest
return htmltext;
}
- if (event.equals("30008-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ROIENS_LETTER, 1);
- }
- else if (event.equals("30283-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROIENS_LETTER, 1);
- st.giveItems(DIR_TO_RUINS, 1);
- }
- else if (event.equals("30283-06.htm"))
- {
- st.takeItems(BROKEN_SWORD_HANDLE, 1);
- st.giveItems(SWORD_OF_SOLIDARITY, 1);
- st.giveItems(LESSER_HEALING_POT, 100);
-
- if (player.isNewbie())
+ case "30008-03.htm":
{
- st.showQuestionMark(26);
- if (player.isMageClass())
- {
- st.playTutorialVoice("tutorial_voice_027");
- st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
- }
- else
- {
- st.playTutorialVoice("tutorial_voice_026");
- st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
- }
+ st.startQuest();
+ st.giveItems(ROIENS_LETTER, 1);
+ break;
+ }
+ case "30283-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ROIENS_LETTER, 1);
+ st.giveItems(DIR_TO_RUINS, 1);
+ break;
+ }
+ case "30283-06.htm":
+ {
+ st.takeItems(BROKEN_SWORD_HANDLE, 1);
+ st.giveItems(SWORD_OF_SOLIDARITY, 1);
+ st.giveItems(LESSER_HEALING_POT, 100);
+ if (player.isNewbie())
+ {
+ st.showQuestionMark(26);
+ if (player.isMageClass())
+ {
+ st.playTutorialVoice("tutorial_voice_027");
+ st.giveItems(SPIRITSHOT_FOR_BEGINNERS, 3000);
+ }
+ else
+ {
+ st.playTutorialVoice("tutorial_voice_026");
+ st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000);
+ }
+ }
+ st.giveItems(ECHO_BATTLE, 10);
+ st.giveItems(ECHO_LOVE, 10);
+ st.giveItems(ECHO_SOLITUDE, 10);
+ st.giveItems(ECHO_FEAST, 10);
+ st.giveItems(ECHO_CELEBRATION, 10);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
}
-
- st.giveItems(ECHO_BATTLE, 10);
- st.giveItems(ECHO_LOVE, 10);
- st.giveItems(ECHO_SOLITUDE, 10);
- st.giveItems(ECHO_FEAST, 10);
- st.giveItems(ECHO_CELEBRATION, 10);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
}
return htmltext;
@@ -131,6 +128,7 @@ public class Q101_SwordOfSolidarity extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.HUMAN)
{
htmltext = "30008-01a.htm";
@@ -144,12 +142,14 @@ public class Q101_SwordOfSolidarity extends Quest
htmltext = "30008-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = (st.getInt("cond"));
+ {
+ final int cond = (st.getCond());
switch (npc.getNpcId())
{
case ROIEN:
+ {
if (cond == 1)
{
htmltext = "30008-04.htm";
@@ -165,7 +165,7 @@ public class Q101_SwordOfSolidarity extends Quest
else if (cond == 4)
{
htmltext = "30008-05.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALTRANS_NOTE, 1);
st.giveItems(BROKEN_SWORD_HANDLE, 1);
@@ -175,8 +175,9 @@ public class Q101_SwordOfSolidarity extends Quest
htmltext = "30008-05a.htm";
}
break;
-
+ }
case ALTRAN:
+ {
if (cond == 1)
{
htmltext = "30283-01.htm";
@@ -188,7 +189,7 @@ public class Q101_SwordOfSolidarity extends Quest
else if (cond == 3)
{
htmltext = "30283-04.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DIR_TO_RUINS, 1);
st.takeItems(BROKEN_BLADE_TOP, 1);
@@ -204,12 +205,15 @@ public class Q101_SwordOfSolidarity extends Quest
htmltext = "30283-05.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -218,7 +222,7 @@ public class Q101_SwordOfSolidarity extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -230,7 +234,7 @@ public class Q101_SwordOfSolidarity extends Quest
}
else if (st.dropItems(BROKEN_BLADE_BOTTOM, 1, 1, 200000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q102_SeaOfSporesFever/Q102_SeaOfSporesFever.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q102_SeaOfSporesFever/Q102_SeaOfSporesFever.java
index 4e29b6d68a..af1373979a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q102_SeaOfSporesFever/Q102_SeaOfSporesFever.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q102_SeaOfSporesFever/Q102_SeaOfSporesFever.java
@@ -26,6 +26,13 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q102_SeaOfSporesFever extends Quest
{
+ // NPCs
+ private static final int ALBERIUS = 30284;
+ private static final int COBENDELL = 30156;
+ private static final int BERROS = 30217;
+ private static final int VELTRESS = 30219;
+ private static final int RAYEN = 30221;
+ private static final int GARTRANDELL = 30285;
// Items
private static final int ALBERIUS_LETTER = 964;
private static final int EVERGREEN_AMULET = 965;
@@ -36,7 +43,6 @@ public class Q102_SeaOfSporesFever extends Quest
private static final int COBENDELL_MEDICINE_3 = 1132;
private static final int COBENDELL_MEDICINE_4 = 1133;
private static final int COBENDELL_MEDICINE_5 = 1134;
-
// Rewards
private static final int SPIRITSHOT_NO_GRADE = 2509;
private static final int SOULSHOT_NO_GRADE = 1835;
@@ -49,23 +55,12 @@ public class Q102_SeaOfSporesFever extends Quest
private static final int ECHO_FEAST = 4415;
private static final int ECHO_CELEBRATION = 4416;
- // NPCs
- private static final int ALBERIUS = 30284;
- private static final int COBENDELL = 30156;
- private static final int BERROS = 30217;
- private static final int VELTRESS = 30219;
- private static final int RAYEN = 30221;
- private static final int GARTRANDELL = 30285;
-
public Q102_SeaOfSporesFever()
{
super(102, "Sea of Spores Fever");
-
registerQuestItems(ALBERIUS_LETTER, EVERGREEN_AMULET, DRYAD_TEARS, COBENDELL_MEDICINE_1, COBENDELL_MEDICINE_2, COBENDELL_MEDICINE_3, COBENDELL_MEDICINE_4, COBENDELL_MEDICINE_5, ALBERIUS_LIST);
-
addStartNpc(ALBERIUS);
addTalkId(ALBERIUS, COBENDELL, BERROS, RAYEN, GARTRANDELL, VELTRESS);
-
addKillId(20013, 20019);
}
@@ -81,9 +76,7 @@ public class Q102_SeaOfSporesFever extends Quest
if (event.equals("30284-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(ALBERIUS_LETTER, 1);
}
@@ -103,6 +96,7 @@ public class Q102_SeaOfSporesFever extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30284-00.htm";
@@ -116,12 +110,14 @@ public class Q102_SeaOfSporesFever extends Quest
htmltext = "30284-07.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ALBERIUS:
+ {
if (cond == 1)
{
htmltext = "30284-03.htm";
@@ -133,7 +129,7 @@ public class Q102_SeaOfSporesFever extends Quest
else if (cond == 4)
{
htmltext = "30284-04.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.set("medicines", "4");
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(COBENDELL_MEDICINE_1, 1);
@@ -170,12 +166,13 @@ public class Q102_SeaOfSporesFever extends Quest
st.exitQuest(false);
}
break;
-
+ }
case COBENDELL:
+ {
if (cond == 1)
{
htmltext = "30156-03.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALBERIUS_LETTER, 1);
st.giveItems(EVERGREEN_AMULET, 1);
@@ -191,7 +188,7 @@ public class Q102_SeaOfSporesFever extends Quest
else if (cond == 3)
{
htmltext = "30156-05.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DRYAD_TEARS, -1);
st.takeItems(EVERGREEN_AMULET, 1);
@@ -206,44 +203,51 @@ public class Q102_SeaOfSporesFever extends Quest
htmltext = "30156-06.htm";
}
break;
-
+ }
case BERROS:
+ {
if (cond == 5)
{
htmltext = "30217-01.htm";
checkItem(st, COBENDELL_MEDICINE_2);
}
break;
-
+ }
case VELTRESS:
+ {
if (cond == 5)
{
htmltext = "30219-01.htm";
checkItem(st, COBENDELL_MEDICINE_3);
}
break;
-
+ }
case RAYEN:
+ {
if (cond == 5)
{
htmltext = "30221-01.htm";
checkItem(st, COBENDELL_MEDICINE_4);
}
break;
-
+ }
case GARTRANDELL:
+ {
if (cond == 5)
{
htmltext = "30285-01.htm";
checkItem(st, COBENDELL_MEDICINE_5);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -252,7 +256,7 @@ public class Q102_SeaOfSporesFever extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -260,7 +264,7 @@ public class Q102_SeaOfSporesFever extends Quest
if (st.dropItems(DRYAD_TEARS, 1, 10, 300000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
@@ -275,7 +279,7 @@ public class Q102_SeaOfSporesFever extends Quest
final int medicinesLeft = st.getInt("medicines") - 1;
if (medicinesLeft == 0)
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q103_SpiritOfCraftsman/Q103_SpiritOfCraftsman.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q103_SpiritOfCraftsman/Q103_SpiritOfCraftsman.java
index ffc93e27da..eb44fbd6ba 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q103_SpiritOfCraftsman/Q103_SpiritOfCraftsman.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q103_SpiritOfCraftsman/Q103_SpiritOfCraftsman.java
@@ -26,6 +26,10 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q103_SpiritOfCraftsman extends Quest
{
+ // NPCs
+ private static final int KARROD = 30307;
+ private static final int CECKTINON = 30132;
+ private static final int HARNE = 30144;
// Items
private static final int KARROD_LETTER = 968;
private static final int CECKTINON_VOUCHER_1 = 969;
@@ -35,7 +39,6 @@ public class Q103_SpiritOfCraftsman extends Quest
private static final int ZOMBIE_HEAD = 973;
private static final int STEELBENDER_HEAD = 974;
private static final int BONE_FRAGMENT = 1107;
-
// Rewards
private static final int SPIRITSHOT_NO_GRADE = 2509;
private static final int SOULSHOT_NO_GRADE = 1835;
@@ -49,20 +52,12 @@ public class Q103_SpiritOfCraftsman extends Quest
private static final int ECHO_FEAST = 4415;
private static final int ECHO_CELEBRATION = 4416;
- // NPCs
- private static final int KARROD = 30307;
- private static final int CECKTINON = 30132;
- private static final int HARNE = 30144;
-
public Q103_SpiritOfCraftsman()
{
super(103, "Spirit of Craftsman");
-
registerQuestItems(KARROD_LETTER, CECKTINON_VOUCHER_1, CECKTINON_VOUCHER_2, BONE_FRAGMENT, SOUL_CATCHER, PRESERVING_OIL, ZOMBIE_HEAD, STEELBENDER_HEAD);
-
addStartNpc(KARROD);
addTalkId(KARROD, CECKTINON, HARNE);
-
addKillId(20015, 20020, 20455, 20517, 20518);
}
@@ -78,9 +73,7 @@ public class Q103_SpiritOfCraftsman extends Quest
if (event.equals("30307-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(KARROD_LETTER, 1);
}
@@ -100,6 +93,7 @@ public class Q103_SpiritOfCraftsman extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30307-00.htm";
@@ -113,12 +107,14 @@ public class Q103_SpiritOfCraftsman extends Quest
htmltext = "30307-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case KARROD:
+ {
if (cond < 8)
{
htmltext = "30307-06.htm";
@@ -164,12 +160,13 @@ public class Q103_SpiritOfCraftsman extends Quest
st.exitQuest(false);
}
break;
-
+ }
case CECKTINON:
+ {
if (cond == 1)
{
htmltext = "30132-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KARROD_LETTER, 1);
st.giveItems(CECKTINON_VOUCHER_1, 1);
@@ -181,7 +178,7 @@ public class Q103_SpiritOfCraftsman extends Quest
else if (cond == 5)
{
htmltext = "30132-03.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SOUL_CATCHER, 1);
st.giveItems(PRESERVING_OIL, 1);
@@ -193,7 +190,7 @@ public class Q103_SpiritOfCraftsman extends Quest
else if (cond == 7)
{
htmltext = "30132-05.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ZOMBIE_HEAD, 1);
st.giveItems(STEELBENDER_HEAD, 1);
@@ -203,12 +200,13 @@ public class Q103_SpiritOfCraftsman extends Quest
htmltext = "30132-06.htm";
}
break;
-
+ }
case HARNE:
+ {
if (cond == 2)
{
htmltext = "30144-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CECKTINON_VOUCHER_1, 1);
st.giveItems(CECKTINON_VOUCHER_2, 1);
@@ -220,7 +218,7 @@ public class Q103_SpiritOfCraftsman extends Quest
else if (cond == 4)
{
htmltext = "30144-03.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CECKTINON_VOUCHER_2, 1);
st.takeItems(BONE_FRAGMENT, 10);
@@ -231,12 +229,15 @@ public class Q103_SpiritOfCraftsman extends Quest
htmltext = "30144-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -256,20 +257,23 @@ public class Q103_SpiritOfCraftsman extends Quest
case 20517:
case 20518:
case 20455:
- if ((st.getInt("cond") == 3) && st.dropItems(BONE_FRAGMENT, 1, 10, 300000))
+ {
+ if (st.isCond(3) && st.dropItems(BONE_FRAGMENT, 1, 10, 300000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case 20015:
case 20020:
- if ((st.getInt("cond") == 6) && st.dropItems(ZOMBIE_HEAD, 1, 1, 300000))
+ {
+ if (st.isCond(6) && st.dropItems(ZOMBIE_HEAD, 1, 1, 300000))
{
- st.set("cond", "7");
+ st.setCond(7);
st.takeItems(PRESERVING_OIL, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q104_SpiritOfMirrors/Q104_SpiritOfMirrors.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q104_SpiritOfMirrors/Q104_SpiritOfMirrors.java
index 8033a1841b..58ce71667b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q104_SpiritOfMirrors/Q104_SpiritOfMirrors.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q104_SpiritOfMirrors/Q104_SpiritOfMirrors.java
@@ -27,12 +27,16 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q104_SpiritOfMirrors extends Quest
{
+ // NPCs
+ private static final int GALLINT = 30017;
+ private static final int ARNOLD = 30041;
+ private static final int JOHNSTONE = 30043;
+ private static final int KENYOS = 30045;
// Items
private static final int GALLINS_OAK_WAND = 748;
private static final int WAND_SPIRITBOUND_1 = 1135;
private static final int WAND_SPIRITBOUND_2 = 1136;
private static final int WAND_SPIRITBOUND_3 = 1137;
-
// Rewards
private static final int SPIRITSHOT_NO_GRADE = 2509;
private static final int SOULSHOT_NO_GRADE = 1835;
@@ -46,18 +50,10 @@ public class Q104_SpiritOfMirrors extends Quest
private static final int ECHO_FEAST = 4415;
private static final int ECHO_CELEBRATION = 4416;
- // NPCs
- private static final int GALLINT = 30017;
- private static final int ARNOLD = 30041;
- private static final int JOHNSTONE = 30043;
- private static final int KENYOS = 30045;
-
public Q104_SpiritOfMirrors()
{
super(104, "Spirit of Mirrors");
-
registerQuestItems(GALLINS_OAK_WAND, WAND_SPIRITBOUND_1, WAND_SPIRITBOUND_2, WAND_SPIRITBOUND_3);
-
addStartNpc(GALLINT);
addTalkId(GALLINT, ARNOLD, JOHNSTONE, KENYOS);
@@ -76,9 +72,7 @@ public class Q104_SpiritOfMirrors extends Quest
if (event.equals("30017-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(GALLINS_OAK_WAND, 1);
st.giveItems(GALLINS_OAK_WAND, 1);
st.giveItems(GALLINS_OAK_WAND, 1);
@@ -100,6 +94,7 @@ public class Q104_SpiritOfMirrors extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.HUMAN)
{
htmltext = "30017-00.htm";
@@ -113,12 +108,14 @@ public class Q104_SpiritOfMirrors extends Quest
htmltext = "30017-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GALLINT:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30017-04.htm";
@@ -168,23 +165,27 @@ public class Q104_SpiritOfMirrors extends Quest
st.exitQuest(false);
}
break;
-
+ }
case KENYOS:
case JOHNSTONE:
case ARNOLD:
+ {
htmltext = npc.getNpcId() + "-01.htm";
if (cond == 1)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -210,7 +211,7 @@ public class Q104_SpiritOfMirrors extends Quest
st.giveItems(WAND_SPIRITBOUND_1, 1);
if (st.hasQuestItems(WAND_SPIRITBOUND_2, WAND_SPIRITBOUND_3))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -227,7 +228,7 @@ public class Q104_SpiritOfMirrors extends Quest
st.giveItems(WAND_SPIRITBOUND_2, 1);
if (st.hasQuestItems(WAND_SPIRITBOUND_1, WAND_SPIRITBOUND_3))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -244,7 +245,7 @@ public class Q104_SpiritOfMirrors extends Quest
st.giveItems(WAND_SPIRITBOUND_3, 1);
if (st.hasQuestItems(WAND_SPIRITBOUND_1, WAND_SPIRITBOUND_2))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q105_SkirmishWithTheOrcs/Q105_SkirmishWithTheOrcs.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q105_SkirmishWithTheOrcs/Q105_SkirmishWithTheOrcs.java
index e1673650d9..cc1c06d4c3 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q105_SkirmishWithTheOrcs/Q105_SkirmishWithTheOrcs.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q105_SkirmishWithTheOrcs/Q105_SkirmishWithTheOrcs.java
@@ -27,6 +27,15 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q105_SkirmishWithTheOrcs extends Quest
{
+ // Monster
+ private static final int KABOO_CHIEF_UOPH = 27059;
+ private static final int KABOO_CHIEF_KRACHA = 27060;
+ private static final int KABOO_CHIEF_BATOH = 27061;
+ private static final int KABOO_CHIEF_TANUKIA = 27062;
+ private static final int KABOO_CHIEF_TUREL = 27064;
+ private static final int KABOO_CHIEF_ROKO = 27065;
+ private static final int KABOO_CHIEF_KAMUT = 27067;
+ private static final int KABOO_CHIEF_MURTIKA = 27068;
// Item
private static final int KENDELL_ORDER_1 = 1836;
private static final int KENDELL_ORDER_2 = 1837;
@@ -38,17 +47,6 @@ public class Q105_SkirmishWithTheOrcs extends Quest
private static final int KENDELL_ORDER_8 = 1843;
private static final int KABOO_CHIEF_TORC_1 = 1844;
private static final int KABOO_CHIEF_TORC_2 = 1845;
-
- // Monster
- private static final int KABOO_CHIEF_UOPH = 27059;
- private static final int KABOO_CHIEF_KRACHA = 27060;
- private static final int KABOO_CHIEF_BATOH = 27061;
- private static final int KABOO_CHIEF_TANUKIA = 27062;
- private static final int KABOO_CHIEF_TUREL = 27064;
- private static final int KABOO_CHIEF_ROKO = 27065;
- private static final int KABOO_CHIEF_KAMUT = 27067;
- private static final int KABOO_CHIEF_MURTIKA = 27068;
-
// Rewards
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
@@ -63,12 +61,9 @@ public class Q105_SkirmishWithTheOrcs extends Quest
public Q105_SkirmishWithTheOrcs()
{
super(105, "Skirmish with the Orcs");
-
registerQuestItems(KENDELL_ORDER_1, KENDELL_ORDER_2, KENDELL_ORDER_3, KENDELL_ORDER_4, KENDELL_ORDER_5, KENDELL_ORDER_6, KENDELL_ORDER_7, KENDELL_ORDER_8, KABOO_CHIEF_TORC_1, KABOO_CHIEF_TORC_2);
-
addStartNpc(30218); // Kendell
addTalkId(30218);
-
addKillId(KABOO_CHIEF_UOPH, KABOO_CHIEF_KRACHA, KABOO_CHIEF_BATOH, KABOO_CHIEF_TANUKIA, KABOO_CHIEF_TUREL, KABOO_CHIEF_ROKO, KABOO_CHIEF_KAMUT, KABOO_CHIEF_MURTIKA);
}
@@ -84,11 +79,10 @@ public class Q105_SkirmishWithTheOrcs extends Quest
if (event.equals("30218-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(Rnd.get(1836, 1839), 1); // Kendell's orders 1 to 4.
}
+
return htmltext;
}
@@ -105,6 +99,7 @@ public class Q105_SkirmishWithTheOrcs extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30218-00.htm";
@@ -118,9 +113,10 @@ public class Q105_SkirmishWithTheOrcs extends Quest
htmltext = "30218-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30218-05.htm";
@@ -128,7 +124,7 @@ public class Q105_SkirmishWithTheOrcs extends Quest
else if (cond == 2)
{
htmltext = "30218-06.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KABOO_CHIEF_TORC_1, 1);
st.takeItems(KENDELL_ORDER_1, 1);
@@ -184,10 +180,12 @@ public class Q105_SkirmishWithTheOrcs extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -207,33 +205,37 @@ public class Q105_SkirmishWithTheOrcs extends Quest
case KABOO_CHIEF_KRACHA:
case KABOO_CHIEF_BATOH:
case KABOO_CHIEF_TANUKIA:
- if ((st.getInt("cond") == 1) && st.hasQuestItems(npc.getNpcId() - 25223)) // npcId - 25223 = itemId to verify.
+ {
+ if (st.isCond(1) && st.hasQuestItems(npc.getNpcId() - 25223)) // npcId - 25223 = itemId to verify.
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KABOO_CHIEF_TORC_1, 1);
}
break;
-
+ }
case KABOO_CHIEF_TUREL:
case KABOO_CHIEF_ROKO:
- if ((st.getInt("cond") == 3) && st.hasQuestItems(npc.getNpcId() - 25224)) // npcId - 25224 = itemId to verify.
+ {
+ if (st.isCond(3) && st.hasQuestItems(npc.getNpcId() - 25224)) // npcId - 25224 = itemId to verify.
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KABOO_CHIEF_TORC_2, 1);
}
break;
-
+ }
case KABOO_CHIEF_KAMUT:
case KABOO_CHIEF_MURTIKA:
- if ((st.getInt("cond") == 3) && st.hasQuestItems(npc.getNpcId() - 25225)) // npcId - 25225 = itemId to verify.
+ {
+ if (st.isCond(3) && st.hasQuestItems(npc.getNpcId() - 25225)) // npcId - 25225 = itemId to verify.
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KABOO_CHIEF_TORC_2, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q106_ForgottenTruth/Q106_ForgottenTruth.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q106_ForgottenTruth/Q106_ForgottenTruth.java
index 50522b42c5..b3763c633f 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q106_ForgottenTruth/Q106_ForgottenTruth.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q106_ForgottenTruth/Q106_ForgottenTruth.java
@@ -29,14 +29,12 @@ public class Q106_ForgottenTruth extends Quest
// NPCs
private static final int THIFIELL = 30358;
private static final int KARTIA = 30133;
-
// Items
private static final int ONYX_TALISMAN_1 = 984;
private static final int ONYX_TALISMAN_2 = 985;
private static final int ANCIENT_SCROLL = 986;
private static final int ANCIENT_CLAY_TABLET = 987;
private static final int KARTIA_TRANSLATION = 988;
-
// Rewards
private static final int SPIRITSHOT_NO_GRADE = 2509;
private static final int SOULSHOT_NO_GRADE = 1835;
@@ -53,12 +51,9 @@ public class Q106_ForgottenTruth extends Quest
public Q106_ForgottenTruth()
{
super(106, "Forgotten Truth");
-
registerQuestItems(ONYX_TALISMAN_1, ONYX_TALISMAN_2, ANCIENT_SCROLL, ANCIENT_CLAY_TABLET, KARTIA_TRANSLATION);
-
addStartNpc(THIFIELL);
addTalkId(THIFIELL, KARTIA);
-
addKillId(27070); // Tumran Orc Brigand
}
@@ -74,11 +69,10 @@ public class Q106_ForgottenTruth extends Quest
if (event.equals("30358-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(ONYX_TALISMAN_1, 1);
}
+
return htmltext;
}
@@ -95,6 +89,7 @@ public class Q106_ForgottenTruth extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30358-00.htm";
@@ -108,12 +103,14 @@ public class Q106_ForgottenTruth extends Quest
htmltext = "30358-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case THIFIELL:
+ {
if (cond == 1)
{
htmltext = "30358-06.htm";
@@ -167,12 +164,13 @@ public class Q106_ForgottenTruth extends Quest
st.exitQuest(false);
}
break;
-
+ }
case KARTIA:
+ {
if (cond == 1)
{
htmltext = "30133-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ONYX_TALISMAN_1, 1);
st.giveItems(ONYX_TALISMAN_2, 1);
@@ -184,7 +182,7 @@ public class Q106_ForgottenTruth extends Quest
else if (cond == 3)
{
htmltext = "30133-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ONYX_TALISMAN_2, 1);
st.takeItems(ANCIENT_SCROLL, 1);
@@ -196,12 +194,15 @@ public class Q106_ForgottenTruth extends Quest
htmltext = "30133-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -209,7 +210,7 @@ public class Q106_ForgottenTruth extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -221,7 +222,7 @@ public class Q106_ForgottenTruth extends Quest
}
else if (st.dropItems(ANCIENT_CLAY_TABLET, 1, 1, 200000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q107_MercilessPunishment/Q107_MercilessPunishment.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q107_MercilessPunishment/Q107_MercilessPunishment.java
index 169b9b8b65..a83db4bdbe 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q107_MercilessPunishment/Q107_MercilessPunishment.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q107_MercilessPunishment/Q107_MercilessPunishment.java
@@ -29,7 +29,6 @@ public class Q107_MercilessPunishment extends Quest
// NPCs
private static final int HATOS = 30568;
private static final int PARUGON = 30580;
-
// Items
private static final int HATOS_ORDER_1 = 1553;
private static final int HATOS_ORDER_2 = 1554;
@@ -37,7 +36,6 @@ public class Q107_MercilessPunishment extends Quest
private static final int LETTER_TO_HUMAN = 1557;
private static final int LETTER_TO_DARKELF = 1556;
private static final int LETTER_TO_ELF = 1558;
-
// Rewards
private static final int BUTCHER_SWORD = 1510;
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
@@ -52,12 +50,9 @@ public class Q107_MercilessPunishment extends Quest
public Q107_MercilessPunishment()
{
super(107, "Merciless Punishment");
-
registerQuestItems(HATOS_ORDER_1, HATOS_ORDER_2, HATOS_ORDER_3, LETTER_TO_HUMAN, LETTER_TO_DARKELF, LETTER_TO_ELF);
-
addStartNpc(HATOS);
addTalkId(HATOS, PARUGON);
-
addKillId(27041); // Baranka's Messenger
}
@@ -71,31 +66,36 @@ public class Q107_MercilessPunishment extends Quest
return htmltext;
}
- if (event.equals("30568-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(HATOS_ORDER_1, 1);
- }
- else if (event.equals("30568-06.htm"))
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
- }
- else if (event.equals("30568-07.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HATOS_ORDER_1, 1);
- st.giveItems(HATOS_ORDER_2, 1);
- }
- else if (event.equals("30568-09.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HATOS_ORDER_2, 1);
- st.giveItems(HATOS_ORDER_3, 1);
+ case "30568-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(HATOS_ORDER_1, 1);
+ break;
+ }
+ case "30568-06.htm":
+ {
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
+ }
+ case "30568-07.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HATOS_ORDER_1, 1);
+ st.giveItems(HATOS_ORDER_2, 1);
+ break;
+ }
+ case "30568-09.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HATOS_ORDER_2, 1);
+ st.giveItems(HATOS_ORDER_3, 1);
+ break;
+ }
}
return htmltext;
@@ -114,6 +114,7 @@ public class Q107_MercilessPunishment extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30568-00.htm";
@@ -127,12 +128,14 @@ public class Q107_MercilessPunishment extends Quest
htmltext = "30568-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HATOS:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30568-04.htm";
@@ -185,21 +188,25 @@ public class Q107_MercilessPunishment extends Quest
st.exitQuest(false);
}
break;
-
+ }
case PARUGON:
+ {
htmltext = "30580-01.htm";
if (cond == 1)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -214,22 +221,22 @@ public class Q107_MercilessPunishment extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond == 2)
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LETTER_TO_HUMAN, 1);
}
else if (cond == 4)
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LETTER_TO_DARKELF, 1);
}
else if (cond == 6)
{
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LETTER_TO_ELF, 1);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q108_JumbleTumbleDiamondFuss/Q108_JumbleTumbleDiamondFuss.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q108_JumbleTumbleDiamondFuss/Q108_JumbleTumbleDiamondFuss.java
index 718f397fc0..f3b391184d 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q108_JumbleTumbleDiamondFuss/Q108_JumbleTumbleDiamondFuss.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q108_JumbleTumbleDiamondFuss/Q108_JumbleTumbleDiamondFuss.java
@@ -35,7 +35,10 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
private static final int BRUNON = 30526;
private static final int MARON = 30529;
private static final int TOROCCO = 30555;
-
+ // Monsters
+ private static final int GOBLIN_BRIGAND_LEADER = 20323;
+ private static final int GOBLIN_BRIGAND_LIEUTENANT = 20324;
+ private static final int BLADE_BAT = 20480;
// Items
private static final int GOUPH_CONTRACT = 1559;
private static final int REEP_CONTRACT = 1560;
@@ -50,12 +53,6 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
private static final int BERRY_TART = 1569;
private static final int BAT_DIAGRAM = 1570;
private static final int STAR_DIAMOND = 1571;
-
- // Monsters
- private static final int GOBLIN_BRIGAND_LEADER = 20323;
- private static final int GOBLIN_BRIGAND_LIEUTENANT = 20324;
- private static final int BLADE_BAT = 20480;
-
// Rewards
private static final int SILVERSMITH_HAMMER = 1511;
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
@@ -66,48 +63,25 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
private static final int ECHO_FEAST = 4415;
private static final int ECHO_CELEBRATION = 4416;
private static final int LESSER_HEALING_POTION = 1060;
-
+ // @formatter:off
private static final int[][] LEADER_DROPLIST =
{
- {
- AQUAMARINE,
- 1,
- 10,
- 800000
- },
- {
- CHRYSOBERYL,
- 1,
- 10,
- 800000
- }
+ {AQUAMARINE, 1, 10, 800000},
+ {CHRYSOBERYL, 1, 10, 800000}
};
-
private static final int[][] LIEUTENANT_DROPLIST =
{
- {
- AQUAMARINE,
- 1,
- 10,
- 600000
- },
- {
- CHRYSOBERYL,
- 1,
- 10,
- 600000
- }
+ {AQUAMARINE, 1, 10, 600000},
+ {CHRYSOBERYL, 1, 10, 600000}
};
+ // @formatter:on
public Q108_JumbleTumbleDiamondFuss()
{
super(108, "Jumble, Tumble, Diamond Fuss");
-
registerQuestItems(GOUPH_CONTRACT, REEP_CONTRACT, ELVEN_WINE, BRUNON_DICE, BRUNON_CONTRACT, AQUAMARINE, CHRYSOBERYL, GEM_BOX, COAL_PIECE, BRUNON_LETTER, BERRY_TART, BAT_DIAGRAM, STAR_DIAMOND);
-
addStartNpc(GOUPH);
addTalkId(GOUPH, REEP, MURDOC, AIRY, BRUNON, MARON, TOROCCO);
-
addKillId(GOBLIN_BRIGAND_LEADER, GOBLIN_BRIGAND_LIEUTENANT, BLADE_BAT);
}
@@ -121,26 +95,30 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
return htmltext;
}
- if (event.equals("30523-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(GOUPH_CONTRACT, 1);
- }
- else if (event.equals("30555-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(REEP_CONTRACT, 1);
- st.giveItems(ELVEN_WINE, 1);
- }
- else if (event.equals("30526-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BRUNON_DICE, 1);
- st.giveItems(BRUNON_CONTRACT, 1);
+ case "30523-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(GOUPH_CONTRACT, 1);
+ break;
+ }
+ case "30555-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(REEP_CONTRACT, 1);
+ st.giveItems(ELVEN_WINE, 1);
+ break;
+ }
+ case "30526-02.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BRUNON_DICE, 1);
+ st.giveItems(BRUNON_CONTRACT, 1);
+ break;
+ }
}
return htmltext;
@@ -159,6 +137,7 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DWARF)
{
htmltext = "30523-00.htm";
@@ -172,12 +151,14 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30523-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GOUPH:
+ {
if (cond == 1)
{
htmltext = "30523-04.htm";
@@ -189,7 +170,7 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
else if (cond == 7)
{
htmltext = "30523-06.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GEM_BOX, 1);
st.giveItems(COAL_PIECE, 1);
@@ -230,12 +211,13 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
st.exitQuest(false);
}
break;
-
+ }
case REEP:
+ {
if (cond == 1)
{
htmltext = "30516-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GOUPH_CONTRACT, 1);
st.giveItems(REEP_CONTRACT, 1);
@@ -245,8 +227,9 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30516-02.htm";
}
break;
-
+ }
case TOROCCO:
+ {
if (cond == 2)
{
htmltext = "30555-01.htm";
@@ -264,12 +247,13 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30555-05.htm";
}
break;
-
+ }
case MARON:
+ {
if (cond == 3)
{
htmltext = "30529-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ELVEN_WINE, 1);
st.giveItems(BRUNON_DICE, 1);
@@ -283,8 +267,9 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30529-03.htm";
}
break;
-
+ }
case BRUNON:
+ {
if (cond == 4)
{
htmltext = "30526-01.htm";
@@ -296,7 +281,7 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
else if (cond == 6)
{
htmltext = "30526-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BRUNON_CONTRACT, 1);
st.takeItems(AQUAMARINE, -1);
@@ -310,7 +295,7 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
else if (cond == 8)
{
htmltext = "30526-06.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(COAL_PIECE, 1);
st.giveItems(BRUNON_LETTER, 1);
@@ -324,12 +309,13 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30526-08.htm";
}
break;
-
+ }
case MURDOC:
+ {
if (cond == 9)
{
htmltext = "30521-01.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BRUNON_LETTER, 1);
st.giveItems(BERRY_TART, 1);
@@ -343,12 +329,13 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30521-03.htm";
}
break;
-
+ }
case AIRY:
+ {
if (cond == 10)
{
htmltext = "30522-01.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BERRY_TART, 1);
st.giveItems(BAT_DIAGRAM, 1);
@@ -362,12 +349,15 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
htmltext = "30522-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -384,26 +374,30 @@ public class Q108_JumbleTumbleDiamondFuss extends Quest
switch (npc.getNpcId())
{
case GOBLIN_BRIGAND_LEADER:
- if ((st.getInt("cond") == 5) && st.dropMultipleItems(LEADER_DROPLIST))
+ {
+ if (st.isCond(5) && st.dropMultipleItems(LEADER_DROPLIST))
{
- st.set("cond", "6");
+ st.setCond(6);
}
break;
-
+ }
case GOBLIN_BRIGAND_LIEUTENANT:
- if ((st.getInt("cond") == 5) && st.dropMultipleItems(LIEUTENANT_DROPLIST))
+ {
+ if (st.isCond(5) && st.dropMultipleItems(LIEUTENANT_DROPLIST))
{
- st.set("cond", "6");
+ st.setCond(6);
}
break;
-
+ }
case BLADE_BAT:
- if ((st.getInt("cond") == 11) && st.dropItems(STAR_DIAMOND, 1, 1, 200000))
+ {
+ if (st.isCond(11) && st.dropItems(STAR_DIAMOND, 1, 1, 200000))
{
st.takeItems(BAT_DIAGRAM, 1);
- st.set("cond", "12");
+ st.setCond(12);
}
break;
+ }
}
return null;
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q109_InSearchOfTheNest/Q109_InSearchOfTheNest.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q109_InSearchOfTheNest/Q109_InSearchOfTheNest.java
index ab0c8cfcba..b8db9bdeca 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q109_InSearchOfTheNest/Q109_InSearchOfTheNest.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q109_InSearchOfTheNest/Q109_InSearchOfTheNest.java
@@ -28,7 +28,6 @@ public class Q109_InSearchOfTheNest extends Quest
private static final int PIERCE = 31553;
private static final int KAHMAN = 31554;
private static final int SCOUT_CORPSE = 32015;
-
// Items
private static final int SCOUT_MEMO = 8083;
private static final int RECRUIT_BADGE = 7246;
@@ -37,9 +36,7 @@ public class Q109_InSearchOfTheNest extends Quest
public Q109_InSearchOfTheNest()
{
super(109, "In Search of the Nest");
-
registerQuestItems(SCOUT_MEMO);
-
addStartNpc(PIERCE);
addTalkId(PIERCE, SCOUT_CORPSE, KAHMAN);
}
@@ -54,29 +51,34 @@ public class Q109_InSearchOfTheNest extends Quest
return htmltext;
}
- if (event.equals("31553-01.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("32015-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(SCOUT_MEMO, 1);
- }
- else if (event.equals("31553-03.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SCOUT_MEMO, 1);
- }
- else if (event.equals("31554-02.htm"))
- {
- st.rewardItems(57, 5168);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31553-01.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "32015-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(SCOUT_MEMO, 1);
+ break;
+ }
+ case "31553-03.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SCOUT_MEMO, 1);
+ break;
+ }
+ case "31554-02.htm":
+ {
+ st.rewardItems(57, 5168);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -95,6 +97,7 @@ public class Q109_InSearchOfTheNest extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
// Must worn one or other Golden Ram Badge in order to be accepted.
if ((player.getLevel() >= 66) && st.hasAtLeastOneQuestItem(RECRUIT_BADGE, SOLDIER_BADGE))
{
@@ -105,12 +108,14 @@ public class Q109_InSearchOfTheNest extends Quest
htmltext = "31553-00a.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case PIERCE:
+ {
if (cond == 1)
{
htmltext = "31553-01a.htm";
@@ -124,8 +129,9 @@ public class Q109_InSearchOfTheNest extends Quest
htmltext = "31553-03.htm";
}
break;
-
+ }
case SCOUT_CORPSE:
+ {
if (cond == 1)
{
htmltext = "32015-01.htm";
@@ -135,19 +141,23 @@ public class Q109_InSearchOfTheNest extends Quest
htmltext = "32015-02.htm";
}
break;
-
+ }
case KAHMAN:
+ {
if (cond == 3)
{
htmltext = "31554-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q110_ToThePrimevalIsle/Q110_ToThePrimevalIsle.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q110_ToThePrimevalIsle/Q110_ToThePrimevalIsle.java
index 3afa1a18ce..ed4574be43 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q110_ToThePrimevalIsle/Q110_ToThePrimevalIsle.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q110_ToThePrimevalIsle/Q110_ToThePrimevalIsle.java
@@ -27,16 +27,13 @@ public class Q110_ToThePrimevalIsle extends Quest
// NPCs
private static final int ANTON = 31338;
private static final int MARQUEZ = 32113;
-
// Item
private static final int ANCIENT_BOOK = 8777;
public Q110_ToThePrimevalIsle()
{
super(110, "To the Primeval Isle");
-
registerQuestItems(ANCIENT_BOOK);
-
addStartNpc(ANTON);
addTalkId(ANTON, MARQUEZ);
}
@@ -53,9 +50,7 @@ public class Q110_ToThePrimevalIsle extends Quest
if (event.equals("31338-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(ANCIENT_BOOK, 1);
}
else if (event.equals("32113-03.htm") && st.hasQuestItems(ANCIENT_BOOK))
@@ -82,25 +77,32 @@ public class Q110_ToThePrimevalIsle extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 75) ? "31338-00.htm" : "31338-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case ANTON:
+ {
htmltext = "31338-01c.htm";
break;
-
+ }
case MARQUEZ:
+ {
htmltext = "32113-01.htm";
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q111_ElrokianHuntersProof/Q111_ElrokianHuntersProof.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q111_ElrokianHuntersProof/Q111_ElrokianHuntersProof.java
index 8c64cd9a5b..2272ef9ab2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q111_ElrokianHuntersProof/Q111_ElrokianHuntersProof.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q111_ElrokianHuntersProof/Q111_ElrokianHuntersProof.java
@@ -29,7 +29,6 @@ public class Q111_ElrokianHuntersProof extends Quest
private static final int MUSHIKA = 32114;
private static final int ASAMAH = 32115;
private static final int KIRIKASHIN = 32116;
-
// Items
private static final int FRAGMENT = 8768;
private static final int EXPEDITION_LETTER = 8769;
@@ -41,12 +40,9 @@ public class Q111_ElrokianHuntersProof extends Quest
public Q111_ElrokianHuntersProof()
{
super(111, "Elrokian Hunter's Proof");
-
registerQuestItems(FRAGMENT, EXPEDITION_LETTER, CLAW, BONE, SKIN, PRACTICE_TRAP);
-
addStartNpc(MARQUEZ);
addTalkId(MARQUEZ, MUSHIKA, ASAMAH, KIRIKASHIN);
-
addKillId(22196, 22197, 22198, 22218, 22200, 22201, 22202, 22219, 22208, 22209, 22210, 22221, 22203, 22204, 22205, 22220);
}
@@ -60,57 +56,67 @@ public class Q111_ElrokianHuntersProof extends Quest
return htmltext;
}
- if (event.equals("32113-002.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("32115-002.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32113-009.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32113-018.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(FRAGMENT, -1);
- st.giveItems(EXPEDITION_LETTER, 1);
- }
- else if (event.equals("32116-003.htm"))
- {
- st.set("cond", "7");
- st.playSound("EtcSound.elcroki_song_full");
- }
- else if (event.equals("32116-005.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32115-004.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32115-006.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32116-007.htm"))
- {
- st.takeItems(PRACTICE_TRAP, 1);
- st.giveItems(8763, 1);
- st.giveItems(8764, 100);
- st.rewardItems(57, 1022636);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "32113-002.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "32115-002.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32113-009.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32113-018.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(FRAGMENT, -1);
+ st.giveItems(EXPEDITION_LETTER, 1);
+ break;
+ }
+ case "32116-003.htm":
+ {
+ st.setCond(7);
+ st.playSound("EtcSound.elcroki_song_full");
+ break;
+ }
+ case "32116-005.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32115-004.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32115-006.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32116-007.htm":
+ {
+ st.takeItems(PRACTICE_TRAP, 1);
+ st.giveItems(8763, 1);
+ st.giveItems(8764, 100);
+ st.rewardItems(57, 1022636);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -129,14 +135,17 @@ public class Q111_ElrokianHuntersProof extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 75) ? "32113-000.htm" : "32113-001.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MARQUEZ:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "32113-002.htm";
@@ -154,17 +163,19 @@ public class Q111_ElrokianHuntersProof extends Quest
htmltext = "32113-010.htm";
}
break;
-
+ }
case MUSHIKA:
+ {
if (cond == 1)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
htmltext = "32114-001.htm";
break;
-
+ }
case ASAMAH:
+ {
if (cond == 2)
{
htmltext = "32115-001.htm";
@@ -188,7 +199,7 @@ public class Q111_ElrokianHuntersProof extends Quest
else if (cond == 11)
{
htmltext = "32115-007.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BONE, -1);
st.takeItems(CLAW, -1);
@@ -196,8 +207,9 @@ public class Q111_ElrokianHuntersProof extends Quest
st.giveItems(PRACTICE_TRAP, 1);
}
break;
-
+ }
case KIRIKASHIN:
+ {
if (cond < 6)
{
htmltext = "32116-008.htm";
@@ -216,12 +228,15 @@ public class Q111_ElrokianHuntersProof extends Quest
htmltext = "32116-006.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -248,41 +263,46 @@ public class Q111_ElrokianHuntersProof extends Quest
case 22197:
case 22198:
case 22218:
- if ((st.getInt("cond") == 4) && st.dropItems(FRAGMENT, 1, 50, 250000))
+ {
+ if (st.isCond(4) && st.dropItems(FRAGMENT, 1, 50, 250000))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case 22200:
case 22201:
case 22202:
case 22219:
- if ((st.getInt("cond") == 10) && st.dropItems(CLAW, 1, 10, 650000) && (st.getQuestItemsCount(BONE) >= 10) && (st.getQuestItemsCount(SKIN) >= 10))
+ {
+ if (st.isCond(10) && st.dropItems(CLAW, 1, 10, 650000) && (st.getQuestItemsCount(BONE) >= 10) && (st.getQuestItemsCount(SKIN) >= 10))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case 22208:
case 22209:
case 22210:
case 22221:
- if ((st.getInt("cond") == 10) && st.dropItems(SKIN, 1, 10, 650000) && (st.getQuestItemsCount(CLAW) >= 10) && (st.getQuestItemsCount(BONE) >= 10))
+ {
+ if (st.isCond(10) && st.dropItems(SKIN, 1, 10, 650000) && (st.getQuestItemsCount(CLAW) >= 10) && (st.getQuestItemsCount(BONE) >= 10))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case 22203:
case 22204:
case 22205:
case 22220:
- if ((st.getInt("cond") == 10) && st.dropItems(BONE, 1, 10, 650000) && (st.getQuestItemsCount(CLAW) >= 10) && (st.getQuestItemsCount(SKIN) >= 10))
+ {
+ if (st.isCond(10) && st.dropItems(BONE, 1, 10, 650000) && (st.getQuestItemsCount(CLAW) >= 10) && (st.getQuestItemsCount(SKIN) >= 10))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q112_WalkOfFate/Q112_WalkOfFate.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q112_WalkOfFate/Q112_WalkOfFate.java
index bb99b9617e..98e73d3db0 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q112_WalkOfFate/Q112_WalkOfFate.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q112_WalkOfFate/Q112_WalkOfFate.java
@@ -27,14 +27,12 @@ public class Q112_WalkOfFate extends Quest
// NPCs
private static final int LIVINA = 30572;
private static final int KARUDA = 32017;
-
// Rewards
private static final int ENCHANT_D = 956;
public Q112_WalkOfFate()
{
super(112, "Walk of Fate");
-
addStartNpc(LIVINA);
addTalkId(LIVINA, KARUDA);
}
@@ -51,9 +49,7 @@ public class Q112_WalkOfFate extends Quest
if (event.equals("30572-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("32017-02.htm"))
{
@@ -79,25 +75,32 @@ public class Q112_WalkOfFate extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "30572-00.htm" : "30572-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case LIVINA:
+ {
htmltext = "30572-03.htm";
break;
-
+ }
case KARUDA:
+ {
htmltext = "32017-01.htm";
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q113_StatusOfTheBeaconTower/Q113_StatusOfTheBeaconTower.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q113_StatusOfTheBeaconTower/Q113_StatusOfTheBeaconTower.java
index 1017b6f44f..5d0117413e 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q113_StatusOfTheBeaconTower/Q113_StatusOfTheBeaconTower.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q113_StatusOfTheBeaconTower/Q113_StatusOfTheBeaconTower.java
@@ -27,16 +27,13 @@ public class Q113_StatusOfTheBeaconTower extends Quest
// NPCs
private static final int MOIRA = 31979;
private static final int TORRANT = 32016;
-
// Item
private static final int BOX = 8086;
public Q113_StatusOfTheBeaconTower()
{
super(113, "Status of the Beacon Tower");
-
registerQuestItems(BOX);
-
addStartNpc(MOIRA);
addTalkId(MOIRA, TORRANT);
}
@@ -53,9 +50,7 @@ public class Q113_StatusOfTheBeaconTower extends Quest
if (event.equals("31979-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(BOX, 1);
}
else if (event.equals("32016-02.htm"))
@@ -82,25 +77,32 @@ public class Q113_StatusOfTheBeaconTower extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 40) ? "31979-00.htm" : "31979-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case MOIRA:
+ {
htmltext = "31979-03.htm";
break;
-
+ }
case TORRANT:
+ {
htmltext = "32016-01.htm";
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q114_ResurrectionOfAnOldManager/Q114_ResurrectionOfAnOldManager.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q114_ResurrectionOfAnOldManager/Q114_ResurrectionOfAnOldManager.java
index ede4177a8c..4392a5c18b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q114_ResurrectionOfAnOldManager/Q114_ResurrectionOfAnOldManager.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q114_ResurrectionOfAnOldManager/Q114_ResurrectionOfAnOldManager.java
@@ -35,7 +35,8 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
private static final int STONE = 32046;
private static final int WENDY = 32047;
private static final int BOX = 32050;
-
+ // Monsters
+ private static final int GOLEM = 27318;
// Items
private static final int LETTER = 8288;
private static final int DETECTOR = 8090;
@@ -43,18 +44,12 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
private static final int STARSTONE = 8287;
private static final int STARSTONE_2 = 8289;
- // Mobs
- private static final int GOLEM = 27318;
-
public Q114_ResurrectionOfAnOldManager()
{
super(114, "Resurrection of an Old Manager");
-
registerQuestItems(LETTER, DETECTOR, DETECTOR_2, STARSTONE, STARSTONE_2);
-
addStartNpc(YUMI);
addTalkId(YUMI, WENDY, BOX, STONE, NEWYEAR);
-
addKillId(GOLEM);
}
@@ -68,261 +63,296 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
return htmltext;
}
- if (event.equals("32041-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("talk", "0");
- st.set("golemSpawned", "0");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("32041-06.htm"))
- {
- st.set("talk", "1");
- }
- else if (event.equals("32041-07.htm"))
- {
- st.set("cond", "2");
- st.set("talk", "0");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32041-10.htm"))
- {
- final int choice = st.getInt("choice");
- if (choice == 1)
+ case "32041-02.htm":
{
- htmltext = "32041-10.htm";
+ st.startQuest();
+ st.set("golemSpawned", "0");
+ break;
}
- else if (choice == 2)
- {
- htmltext = "32041-10a.htm";
- }
- else if (choice == 3)
- {
- htmltext = "32041-10b.htm";
- }
- }
- else if (event.equals("32041-11.htm"))
- {
- st.set("talk", "1");
- }
- else if (event.equals("32041-18.htm"))
- {
- st.set("talk", "2");
- }
- else if (event.equals("32041-20.htm"))
- {
- st.set("cond", "6");
- st.set("talk", "0");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32041-25.htm"))
- {
- st.set("cond", "17");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(DETECTOR, 1);
- }
- else if (event.equals("32041-28.htm"))
- {
- st.set("talk", "1");
- st.takeItems(DETECTOR_2, 1);
- }
- else if (event.equals("32041-31.htm"))
- {
- if (st.getInt("choice") > 1)
- {
- htmltext = "32041-37.htm";
- }
- }
- else if (event.equals("32041-32.htm"))
- {
- st.set("cond", "21");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(LETTER, 1);
- }
- else if (event.equals("32041-36.htm"))
- {
- st.set("cond", "20");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32046-02.htm"))
- {
- st.set("cond", "19");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32046-06.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else if (event.equals("32047-01.htm"))
- {
- final int talk = st.getInt("talk");
- final int talk1 = st.getInt("talk1");
- if ((talk == 1) && (talk1 == 1))
- {
- htmltext = "32047-04.htm";
- }
- else if ((talk == 2) && (talk1 == 2) && (st.getInt("talk2") == 2))
- {
- htmltext = "32047-08.htm";
- }
- }
- else if (event.equals("32047-02.htm"))
- {
- if (st.getInt("talk") == 0)
+ case "32041-06.htm":
{
st.set("talk", "1");
+ break;
}
- }
- else if (event.equals("32047-03.htm"))
- {
- if (st.getInt("talk1") == 0)
+ case "32041-07.htm":
{
- st.set("talk1", "1");
- }
- }
- else if (event.equals("32047-05.htm"))
- {
- st.set("cond", "3");
- st.set("talk", "0");
- st.set("choice", "1");
- st.unset("talk1");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32047-06.htm"))
- {
- st.set("cond", "4");
- st.set("talk", "0");
- st.set("choice", "2");
- st.unset("talk1");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32047-07.htm"))
- {
- st.set("cond", "5");
- st.set("talk", "0");
- st.set("choice", "3");
- st.unset("talk1");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32047-13.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32047-13a.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32047-15.htm"))
- {
- if (st.getInt("talk") == 0)
- {
- st.set("talk", "1");
- }
- }
- else if (event.equals("32047-15a.htm"))
- {
- if (st.getInt("golemSpawned") == 0)
- {
- final NpcInstance golem = addSpawn(GOLEM, 96977, -110625, -3322, 0, true, 0);
- golem.broadcastNpcSay("You, " + player.getName() + ", you attacked Wendy. Prepare to die!");
- ((Attackable) golem).addDamageHate(player, 0, 999);
- golem.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
- st.set("golemSpawned", "1");
- startQuestTimer("golemDespawn", 900000, golem, player, false);
- }
- else
- {
- htmltext = "32047-19a.htm";
- }
- }
- else if (event.equals("32047-17a.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32047-20.htm"))
- {
- st.set("talk", "2");
- }
- else if (event.equals("32047-23.htm"))
- {
- st.set("cond", "13");
- st.set("talk", "0");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32047-25.htm"))
- {
- st.set("cond", "15");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(STARSTONE, 1);
- }
- else if (event.equals("32047-30.htm"))
- {
- st.set("talk", "2");
- }
- else if (event.equals("32047-33.htm"))
- {
- final int cond = st.getInt("cond");
- if (cond == 7)
- {
- st.set("cond", "8");
+ st.setCond(2);
st.set("talk", "0");
st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- else if (cond == 8)
+ case "32041-10.htm":
{
- st.set("cond", "9");
- htmltext = "32047-34.htm";
- st.playSound(QuestState.SOUND_MIDDLE);
+ final int choice = st.getInt("choice");
+ if (choice == 1)
+ {
+ htmltext = "32041-10.htm";
+ }
+ else if (choice == 2)
+ {
+ htmltext = "32041-10a.htm";
+ }
+ else if (choice == 3)
+ {
+ htmltext = "32041-10b.htm";
+ }
+ break;
}
- }
- else if (event.equals("32047-34.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32047-38.htm"))
- {
- if (st.getQuestItemsCount(57) >= 3000)
+ case "32041-11.htm":
{
- st.set("cond", "26");
+ st.set("talk", "1");
+ break;
+ }
+ case "32041-18.htm":
+ {
+ st.set("talk", "2");
+ break;
+ }
+ case "32041-20.htm":
+ {
+ st.setCond(6);
+ st.set("talk", "0");
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(57, 3000);
+ break;
+ }
+ case "32041-25.htm":
+ {
+ st.setCond(17);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(DETECTOR, 1);
+ break;
+ }
+ case "32041-28.htm":
+ {
+ st.set("talk", "1");
+ st.takeItems(DETECTOR_2, 1);
+ break;
+ }
+ case "32041-31.htm":
+ {
+ if (st.getInt("choice") > 1)
+ {
+ htmltext = "32041-37.htm";
+ }
+ break;
+ }
+ case "32041-32.htm":
+ {
+ st.setCond(21);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(LETTER, 1);
+ break;
+ }
+ case "32041-36.htm":
+ {
+ st.setCond(20);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32046-02.htm":
+ {
+ st.setCond(19);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32046-06.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "32047-01.htm":
+ {
+ final int talk = st.getInt("talk");
+ final int talk1 = st.getInt("talk1");
+ if ((talk == 1) && (talk1 == 1))
+ {
+ htmltext = "32047-04.htm";
+ }
+ else if ((talk == 2) && (talk1 == 2) && (st.getInt("talk2") == 2))
+ {
+ htmltext = "32047-08.htm";
+ }
+ break;
+ }
+ case "32047-02.htm":
+ {
+ if (st.getInt("talk") == 0)
+ {
+ st.set("talk", "1");
+ }
+ break;
+ }
+ case "32047-03.htm":
+ {
+ if (st.getInt("talk1") == 0)
+ {
+ st.set("talk1", "1");
+ }
+ break;
+ }
+ case "32047-05.htm":
+ {
+ st.setCond(3);
+ st.set("talk", "0");
+ st.set("choice", "1");
+ st.unset("talk1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32047-06.htm":
+ {
+ st.setCond(4);
+ st.set("talk", "0");
+ st.set("choice", "2");
+ st.unset("talk1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32047-07.htm":
+ {
+ st.setCond(5);
+ st.set("talk", "0");
+ st.set("choice", "3");
+ st.unset("talk1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32047-13.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32047-13a.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32047-15.htm":
+ {
+ if (st.getInt("talk") == 0)
+ {
+ st.set("talk", "1");
+ }
+ break;
+ }
+ case "32047-15a.htm":
+ {
+ if (st.getInt("golemSpawned") == 0)
+ {
+ final NpcInstance golem = addSpawn(GOLEM, 96977, -110625, -3322, 0, true, 0);
+ golem.broadcastNpcSay("You, " + player.getName() + ", you attacked Wendy. Prepare to die!");
+ ((Attackable) golem).addDamageHate(player, 0, 999);
+ golem.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
+ st.set("golemSpawned", "1");
+ startQuestTimer("golemDespawn", 900000, golem, player, false);
+ }
+ else
+ {
+ htmltext = "32047-19a.htm";
+ }
+ break;
+ }
+ case "32047-17a.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32047-20.htm":
+ {
+ st.set("talk", "2");
+ break;
+ }
+ case "32047-23.htm":
+ {
+ st.setCond(13);
+ st.set("talk", "0");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32047-25.htm":
+ {
+ st.setCond(15);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(STARSTONE, 1);
+ break;
+ }
+ case "32047-30.htm":
+ {
+ st.set("talk", "2");
+ break;
+ }
+ case "32047-33.htm":
+ {
+ final int cond = st.getCond();
+ if (cond == 7)
+ {
+ st.setCond(8);
+ st.set("talk", "0");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else if (cond == 8)
+ {
+ st.setCond(9);
+ htmltext = "32047-34.htm";
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
+ }
+ case "32047-34.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32047-38.htm":
+ {
+ if (st.getQuestItemsCount(57) >= 3000)
+ {
+ st.setCond(26);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(57, 3000);
+ st.giveItems(STARSTONE_2, 1);
+ }
+ else
+ {
+ htmltext = "32047-39.htm";
+ }
+ break;
+ }
+ case "32050-02.htm":
+ {
+ st.set("talk", "1");
+ st.playSound("ItemSound.armor_wood_3");
+ break;
+ }
+ case "32050-04.htm":
+ {
+ st.setCond(14);
+ st.set("talk", "0");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(STARSTONE, 1);
+ break;
+ }
+ case "31961-02.htm":
+ {
+ st.setCond(22);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER, 1);
st.giveItems(STARSTONE_2, 1);
+ break;
}
- else
+ case "golemDespawn":
{
- htmltext = "32047-39.htm";
+ st.unset("golemSpawned");
+ return null;
}
}
- else if (event.equals("32050-02.htm"))
- {
- st.set("talk", "1");
- st.playSound("ItemSound.armor_wood_3");
- }
- else if (event.equals("32050-04.htm"))
- {
- st.set("cond", "14");
- st.set("talk", "0");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(STARSTONE, 1);
- }
- else if (event.equals("31961-02.htm"))
- {
- st.set("cond", "22");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER, 1);
- st.giveItems(STARSTONE_2, 1);
- }
- else if (event.equals("golemDespawn"))
- {
- st.unset("golemSpawned");
- return null;
- }
return htmltext;
}
@@ -340,17 +370,20 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
final QuestState pavelReq = player.getQuestState(Q121_PavelTheGiant.class.getSimpleName());
htmltext = ((pavelReq == null) || !pavelReq.isCompleted() || (player.getLevel() < 49)) ? "32041-00.htm" : "32041-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
final int talk = st.getInt("talk");
switch (npc.getNpcId())
{
case YUMI:
+ {
if (cond == 1)
{
if (talk == 0)
@@ -415,7 +448,7 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
else if ((cond == 22) || (cond == 26))
{
htmltext = "32041-34.htm";
- st.set("cond", "27");
+ st.setCond(27);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 27)
@@ -423,8 +456,9 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
htmltext = "32041-35.htm";
}
break;
-
+ }
case WENDY:
+ {
if (cond == 2)
{
if ((talk == 0) && (st.getInt("talk1") == 0))
@@ -524,7 +558,7 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
else if (cond == 15)
{
htmltext = "32047-26.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 16)
@@ -540,8 +574,9 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
htmltext = "32047-40.htm";
}
break;
-
+ }
case BOX:
+ {
if (cond == 13)
{
if (talk == 0)
@@ -558,11 +593,12 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
htmltext = "32050-05.htm";
}
break;
-
+ }
case STONE:
- if (st.getInt("cond") == 17)
+ {
+ if (cond == 17)
{
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DETECTOR, 1);
st.giveItems(DETECTOR_2, 1);
@@ -582,8 +618,9 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
htmltext = "32046-03.htm";
}
break;
-
+ }
case NEWYEAR:
+ {
if (cond == 21)
{
htmltext = "31961-01.htm";
@@ -593,12 +630,15 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
htmltext = "31961-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -606,14 +646,14 @@ public class Q114_ResurrectionOfAnOldManager extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "10");
+ final QuestState st = checkPlayerCondition(player, npc, 10);
if (st == null)
{
return null;
}
npc.broadcastNpcSay("This enemy is far too powerful for me to fight. I must withdraw!");
- st.set("cond", "11");
+ st.setCond(11);
st.unset("golemSpawned");
st.playSound(QuestState.SOUND_MIDDLE);
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q115_TheOtherSideOfTruth/Q115_TheOtherSideOfTruth.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q115_TheOtherSideOfTruth/Q115_TheOtherSideOfTruth.java
index cdbe2f23fc..e62057c200 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q115_TheOtherSideOfTruth/Q115_TheOtherSideOfTruth.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q115_TheOtherSideOfTruth/Q115_TheOtherSideOfTruth.java
@@ -48,7 +48,6 @@ public class Q115_TheOtherSideOfTruth extends Quest
public Q115_TheOtherSideOfTruth()
{
super(115, "The Other Side of Truth");
-
addStartNpc(RAFFORTY);
addTalkId(RAFFORTY, MISA, SCULPTURE1, SCULPTURE2, SCULPTURE3, SCULPTURE4, KIERRE);
registerQuestItems(LETTER, LETTER2, TABLET, REPORT);
@@ -68,22 +67,20 @@ public class Q115_TheOtherSideOfTruth extends Quest
{
case "32018-04.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "7");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(7);
qs.takeItems(LETTER2, 1);
break;
}
case "32020-02.htm":
{
- qs.setState(State.STARTED);
- qs.playSound("ItemSound.quest_accept");
- qs.set("cond", "1");
+ qs.startQuest();
break;
}
case "32020-05.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "3");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(3);
qs.takeItems(LETTER, 1);
break;
}
@@ -91,26 +88,26 @@ public class Q115_TheOtherSideOfTruth extends Quest
case "32020-08a.htm":
{
qs.exitQuest(true);
- qs.playSound("ItemSound.quest_finish");
+ qs.playSound(QuestState.SOUND_FINISH);
break;
}
case "32020-08.htm":
case "32020-07a.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "4");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(4);
break;
}
case "32020-12.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "5");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(5);
break;
}
case "32020-16.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "10");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(10);
qs.takeItems(REPORT, 1);
break;
}
@@ -118,14 +115,14 @@ public class Q115_TheOtherSideOfTruth extends Quest
{
if (qs.getQuestItemsCount(TABLET) == 0)
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "11");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(11);
htmltext = "32020-19.htm";
}
else
{
qs.exitQuest(false);
- qs.playSound("ItemSound.quest_finish");
+ qs.playSound(QuestState.SOUND_FINISH);
qs.giveItems(57, 115673);
qs.rewardExpAndSp(493595, 40442);
}
@@ -133,14 +130,14 @@ public class Q115_TheOtherSideOfTruth extends Quest
}
case "32020-19.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "11");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(11);
break;
}
case "32022-02.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "9");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(9);
final NpcInstance man = qs.addSpawn(SUSPICIOUS, 104562, -107598, -3688, 0, false, 4000);
man.broadcastPacket(new CreatureSay(man.getObjectId(), ChatType.GENERAL, man.getName(), "We meet again."));
startQuestTimer("2", 3700, man, player);
@@ -156,8 +153,8 @@ public class Q115_TheOtherSideOfTruth extends Quest
}
case "Sculpture-04a.htm":
{
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "8");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(8);
final NpcInstance man = qs.addSpawn(SUSPICIOUS, 117890, -126478, -2584, 0, false, 4000);
man.broadcastPacket(new CreatureSay(man.getObjectId(), ChatType.GENERAL, man.getName(), "This looks like the right place..."));
startQuestTimer("1", 3700, man, player);
@@ -200,7 +197,7 @@ public class Q115_TheOtherSideOfTruth extends Quest
final int state = qs.getState();
final int npcId = npc.getNpcId();
- final int cond = qs.getInt("cond");
+ final int cond = qs.getCond();
if (state == State.COMPLETED)
{
htmltext = getAlreadyCompletedMsg();
@@ -238,9 +235,9 @@ public class Q115_TheOtherSideOfTruth extends Quest
else if (cond == 5)
{
htmltext = "32020-13.htm";
- qs.playSound("ItemSound.quest_middle");
+ qs.playSound(QuestState.SOUND_MIDDLE);
qs.giveItems(LETTER2, 1);
- qs.set("cond", "6");
+ qs.setCond(6);
}
else if (cond == 6)
{
@@ -262,7 +259,7 @@ public class Q115_TheOtherSideOfTruth extends Quest
{
htmltext = "32020-18.htm";
qs.exitQuest(false);
- qs.playSound("ItemSound.quest_finish");
+ qs.playSound(QuestState.SOUND_FINISH);
qs.giveItems(57, 60044);
}
}
@@ -272,8 +269,8 @@ public class Q115_TheOtherSideOfTruth extends Quest
{
htmltext = "32018-01.htm";
qs.giveItems(LETTER, 1);
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "2");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(2);
}
else if (cond == 2)
{
@@ -312,8 +309,8 @@ public class Q115_TheOtherSideOfTruth extends Quest
else if (cond == 11)
{
qs.giveItems(TABLET, 1);
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "12");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(12);
htmltext = "Sculpture-07.htm";
}
else if (cond == 12)
@@ -345,8 +342,8 @@ public class Q115_TheOtherSideOfTruth extends Quest
else if (cond == 11)
{
qs.giveItems(TABLET, 1);
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "12");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(12);
htmltext = "Sculpture-07.htm";
}
else if (cond == 12)
@@ -375,8 +372,8 @@ public class Q115_TheOtherSideOfTruth extends Quest
else if (cond == 11)
{
qs.giveItems(TABLET, 1);
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "12");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(12);
htmltext = "Sculpture-07.htm";
}
else if (cond == 12)
@@ -405,8 +402,8 @@ public class Q115_TheOtherSideOfTruth extends Quest
else if (cond == 11)
{
qs.giveItems(TABLET, 1);
- qs.playSound("ItemSound.quest_middle");
- qs.set("cond", "12");
+ qs.playSound(QuestState.SOUND_MIDDLE);
+ qs.setCond(12);
htmltext = "Sculpture-07.htm";
}
else if (cond == 12)
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q116_BeyondTheHillsOfWinter/Q116_BeyondTheHillsOfWinter.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q116_BeyondTheHillsOfWinter/Q116_BeyondTheHillsOfWinter.java
index fb00a77bd2..936017f557 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q116_BeyondTheHillsOfWinter/Q116_BeyondTheHillsOfWinter.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q116_BeyondTheHillsOfWinter/Q116_BeyondTheHillsOfWinter.java
@@ -28,22 +28,18 @@ public class Q116_BeyondTheHillsOfWinter extends Quest
// NPCs
private static final int FILAUR = 30535;
private static final int OBI = 32052;
-
// Items
private static final int BANDAGE = 1833;
private static final int ENERGY_STONE = 5589;
private static final int THIEF_KEY = 1661;
private static final int GOODS = 8098;
-
// Reward
private static final int SSD = 1463;
public Q116_BeyondTheHillsOfWinter()
{
super(116, "Beyond the Hills of Winter");
-
registerQuestItems(GOODS);
-
addStartNpc(FILAUR);
addTalkId(FILAUR, OBI);
}
@@ -58,33 +54,38 @@ public class Q116_BeyondTheHillsOfWinter extends Quest
return htmltext;
}
- if (event.equals("30535-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30535-05.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(GOODS, 1);
- }
- else if (event.equals("materials"))
- {
- htmltext = "32052-02.htm";
- st.takeItems(GOODS, -1);
- st.rewardItems(SSD, 1650);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else if (event.equals("adena"))
- {
- htmltext = "32052-02.htm";
- st.takeItems(GOODS, -1);
- st.giveItems(57, 16500);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30535-02.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30535-05.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(GOODS, 1);
+ break;
+ }
+ case "materials":
+ {
+ htmltext = "32052-02.htm";
+ st.takeItems(GOODS, -1);
+ st.rewardItems(SSD, 1650);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "adena":
+ {
+ htmltext = "32052-02.htm";
+ st.takeItems(GOODS, -1);
+ st.giveItems(57, 16500);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -103,14 +104,17 @@ public class Q116_BeyondTheHillsOfWinter extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() < 30) || (player.getRace() != Race.DWARF)) ? "30535-00.htm" : "30535-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case FILAUR:
+ {
if (cond == 1)
{
if ((st.getQuestItemsCount(BANDAGE) >= 20) && (st.getQuestItemsCount(ENERGY_STONE) >= 5) && (st.getQuestItemsCount(THIEF_KEY) >= 10))
@@ -130,19 +134,23 @@ public class Q116_BeyondTheHillsOfWinter extends Quest
htmltext = "30535-05.htm";
}
break;
-
+ }
case OBI:
+ {
if (cond == 2)
{
htmltext = "32052-00.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q117_TheOceanOfDistantStars/Q117_TheOceanOfDistantStars.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q117_TheOceanOfDistantStars/Q117_TheOceanOfDistantStars.java
index ad965eeab5..565a94f2d1 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q117_TheOceanOfDistantStars/Q117_TheOceanOfDistantStars.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q117_TheOceanOfDistantStars/Q117_TheOceanOfDistantStars.java
@@ -30,21 +30,17 @@ public class Q117_TheOceanOfDistantStars extends Quest
private static final int ANCIENT_GHOST = 32055;
private static final int OBI = 32052;
private static final int BOX = 32076;
-
+ // Monsters
+ private static final int BANDIT_WARRIOR = 22023;
+ private static final int BANDIT_INSPECTOR = 22024;
// Items
private static final int GREY_STAR = 8495;
private static final int ENGRAVED_HAMMER = 8488;
- // Monsters
- private static final int BANDIT_WARRIOR = 22023;
- private static final int BANDIT_INSPECTOR = 22024;
-
public Q117_TheOceanOfDistantStars()
{
super(117, "The Ocean of Distant Stars");
-
registerQuestItems(GREY_STAR, ENGRAVED_HAMMER);
-
addStartNpc(ABEY);
addTalkId(ABEY, ANCIENT_GHOST, GHOST, OBI, BOX);
addKillId(BANDIT_WARRIOR, BANDIT_INSPECTOR);
@@ -60,60 +56,71 @@ public class Q117_TheOceanOfDistantStars extends Quest
return htmltext;
}
- if (event.equals("32053-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("32055-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32052-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32053-04.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32076-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(ENGRAVED_HAMMER, 1);
- }
- else if (event.equals("32053-06.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32052-04.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32052-06.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GREY_STAR, 1);
- }
- else if (event.equals("32055-04.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ENGRAVED_HAMMER, 1);
- }
- else if (event.equals("32054-03.htm"))
- {
- st.rewardExpAndSp(63591, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "32053-02.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "32055-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32052-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32053-04.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32076-02.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(ENGRAVED_HAMMER, 1);
+ break;
+ }
+ case "32053-06.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32052-04.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32052-06.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GREY_STAR, 1);
+ break;
+ }
+ case "32055-04.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ENGRAVED_HAMMER, 1);
+ break;
+ }
+ case "32054-03.htm":
+ {
+ st.rewardExpAndSp(63591, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -132,14 +139,17 @@ public class Q117_TheOceanOfDistantStars extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 39) ? "32053-00.htm" : "32053-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ANCIENT_GHOST:
+ {
if (cond == 1)
{
htmltext = "32055-01.htm";
@@ -157,8 +167,9 @@ public class Q117_TheOceanOfDistantStars extends Quest
htmltext = "32055-05.htm";
}
break;
-
+ }
case OBI:
+ {
if (cond == 2)
{
htmltext = "32052-01.htm";
@@ -184,8 +195,9 @@ public class Q117_TheOceanOfDistantStars extends Quest
htmltext = "32052-06.htm";
}
break;
-
+ }
case ABEY:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "32053-02.htm";
@@ -207,8 +219,9 @@ public class Q117_TheOceanOfDistantStars extends Quest
htmltext = "32053-06.htm";
}
break;
-
+ }
case BOX:
+ {
if (cond == 4)
{
htmltext = "32076-01.htm";
@@ -218,19 +231,23 @@ public class Q117_TheOceanOfDistantStars extends Quest
htmltext = "32076-03.htm";
}
break;
-
+ }
case GHOST:
+ {
if (cond == 10)
{
htmltext = "32054-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -239,7 +256,7 @@ public class Q117_TheOceanOfDistantStars extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "7");
+ final QuestState st = checkPlayerCondition(player, npc, 7);
if (st == null)
{
return null;
@@ -247,7 +264,7 @@ public class Q117_TheOceanOfDistantStars extends Quest
if (st.dropItems(GREY_STAR, 1, 1, 200000))
{
- st.set("cond", "8");
+ st.setCond(8);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q118_ToLeadAndBeLed/Q118_ToLeadAndBeLed.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q118_ToLeadAndBeLed/Q118_ToLeadAndBeLed.java
index db1c722bad..a4db45d793 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q118_ToLeadAndBeLed/Q118_ToLeadAndBeLed.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q118_ToLeadAndBeLed/Q118_ToLeadAndBeLed.java
@@ -26,20 +26,17 @@ import quests.Q123_TheLeaderAndTheFollower.Q123_TheLeaderAndTheFollower;
public class Q118_ToLeadAndBeLed extends Quest
{
- // Npc
+ // NPC
private static final int PINTER = 30298;
-
- // Mobs
+ // Monsters
private static final int MAILLE_LIZARDMAN = 20919;
private static final int MAILLE_LIZARDMAN_SCOUT = 20920;
private static final int MAILLE_LIZARDMAN_GUARD = 20921;
private static final int KING_OF_THE_ARANEID = 20927;
-
// Items
private static final int BLOOD_OF_MAILLE_LIZARDMAN = 8062;
private static final int LEG_OF_KING_ARANEID = 8063;
private static final int CRYSTAL_D = 1458;
-
// Rewards
private static final int CLAN_OATH_HELM = 7850;
private static final int CLAN_OATH_ARMOR = 7851;
@@ -55,12 +52,9 @@ public class Q118_ToLeadAndBeLed extends Quest
public Q118_ToLeadAndBeLed()
{
super(118, "To Lead and Be Led");
-
registerQuestItems(BLOOD_OF_MAILLE_LIZARDMAN, LEG_OF_KING_ARANEID);
-
addStartNpc(PINTER);
addTalkId(PINTER);
-
addKillId(MAILLE_LIZARDMAN, MAILLE_LIZARDMAN_SCOUT, MAILLE_LIZARDMAN_GUARD, KING_OF_THE_ARANEID);
}
@@ -74,84 +68,90 @@ public class Q118_ToLeadAndBeLed extends Quest
return htmltext;
}
- if (event.equals("30298-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("state", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30298-05d.htm"))
- {
- if (st.getQuestItemsCount(BLOOD_OF_MAILLE_LIZARDMAN) > 9)
+ case "30298-03.htm":
{
- st.set("cond", "3");
- st.set("state", "2");
- st.set("stateEx", "1");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_OF_MAILLE_LIZARDMAN, -1);
+ st.startQuest();
+ st.set("state", "1");
+ break;
}
- }
- else if (event.equals("30298-05e.htm"))
- {
- if (st.getQuestItemsCount(BLOOD_OF_MAILLE_LIZARDMAN) > 9)
+ case "30298-05d.htm":
{
- st.set("cond", "4");
- st.set("state", "2");
- st.set("stateEx", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_OF_MAILLE_LIZARDMAN, -1);
- }
- }
- else if (event.equals("30298-05f.htm"))
- {
- if (st.getQuestItemsCount(BLOOD_OF_MAILLE_LIZARDMAN) > 9)
- {
- st.set("cond", "5");
- st.set("state", "2");
- st.set("stateEx", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_OF_MAILLE_LIZARDMAN, -1);
- }
- }
- else if (event.equals("30298-10.htm"))
- {
- final PlayerInstance academic = getApprentice(player);
- if (academic != null)
- {
- final QuestState st2 = academic.getQuestState(Q123_TheLeaderAndTheFollower.class.getSimpleName());
- if ((st2 != null) && (st2.getInt("state") == 2))
+ if (st.getQuestItemsCount(BLOOD_OF_MAILLE_LIZARDMAN) > 9)
{
- final int stateEx = st2.getInt("stateEx");
- if (stateEx == 1)
+ st.setCond(3);
+ st.set("state", "2");
+ st.set("stateEx", "1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_OF_MAILLE_LIZARDMAN, -1);
+ }
+ break;
+ }
+ case "30298-05e.htm":
+ {
+ if (st.getQuestItemsCount(BLOOD_OF_MAILLE_LIZARDMAN) > 9)
+ {
+ st.setCond(4);
+ st.set("state", "2");
+ st.set("stateEx", "2");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_OF_MAILLE_LIZARDMAN, -1);
+ }
+ break;
+ }
+ case "30298-05f.htm":
+ {
+ if (st.getQuestItemsCount(BLOOD_OF_MAILLE_LIZARDMAN) > 9)
+ {
+ st.setCond(5);
+ st.set("state", "2");
+ st.set("stateEx", "3");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_OF_MAILLE_LIZARDMAN, -1);
+ }
+ break;
+ }
+ case "30298-10.htm":
+ {
+ final PlayerInstance academic = getApprentice(player);
+ if (academic != null)
+ {
+ final QuestState st2 = academic.getQuestState(Q123_TheLeaderAndTheFollower.class.getSimpleName());
+ if ((st2 != null) && (st2.getInt("state") == 2))
{
- if (st.getQuestItemsCount(CRYSTAL_D) > 921)
+ final int stateEx = st2.getInt("stateEx");
+ if (stateEx == 1)
{
- st.takeItems(CRYSTAL_D, 922);
- st2.set("cond", "6");
- st2.set("state", "3");
- st2.playSound(QuestState.SOUND_MIDDLE);
+ if (st.getQuestItemsCount(CRYSTAL_D) > 921)
+ {
+ st.takeItems(CRYSTAL_D, 922);
+ st2.setCond(6);
+ st2.set("state", "3");
+ st2.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ htmltext = "30298-11.htm";
+ }
}
else
{
- htmltext = "30298-11.htm";
- }
- }
- else
- {
- if (st.getQuestItemsCount(CRYSTAL_D) > 770)
- {
- st.takeItems(CRYSTAL_D, 771);
- st2.set("cond", "6");
- st2.set("state", "3");
- st2.playSound(QuestState.SOUND_MIDDLE);
- }
- else
- {
- htmltext = "30298-11a.htm";
+ if (st.getQuestItemsCount(CRYSTAL_D) > 770)
+ {
+ st.takeItems(CRYSTAL_D, 771);
+ st2.setCond(6);
+ st2.set("state", "3");
+ st2.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ htmltext = "30298-11a.htm";
+ }
}
}
}
+ break;
}
}
@@ -171,6 +171,7 @@ public class Q118_ToLeadAndBeLed extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getSponsor() > 0)
{
final QuestState st2 = player.getQuestState(Q123_TheLeaderAndTheFollower.class.getSimpleName());
@@ -212,8 +213,9 @@ public class Q118_ToLeadAndBeLed extends Quest
}
}
break;
-
+ }
case State.STARTED:
+ {
final int state = st.getInt("state");
if (state == 1)
{
@@ -262,7 +264,7 @@ public class Q118_ToLeadAndBeLed extends Quest
}
else if (state == 3)
{
- st.set("cond", "7");
+ st.setCond(7);
st.set("state", "4");
st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "30298-15.htm";
@@ -306,10 +308,12 @@ public class Q118_ToLeadAndBeLed extends Quest
}
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -330,24 +334,26 @@ public class Q118_ToLeadAndBeLed extends Quest
return null;
}
- final int cond = st.getInt("cond");
switch (npc.getNpcId())
{
case MAILLE_LIZARDMAN:
case MAILLE_LIZARDMAN_SCOUT:
case MAILLE_LIZARDMAN_GUARD:
- if ((cond == 1) && st.dropItems(BLOOD_OF_MAILLE_LIZARDMAN, 1, 10, 700000))
+ {
+ if (st.isCond(1) && st.dropItems(BLOOD_OF_MAILLE_LIZARDMAN, 1, 10, 700000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case KING_OF_THE_ARANEID:
- if ((cond == 7) && getSponsor(player) && st.dropItems(LEG_OF_KING_ARANEID, 1, 8, 700000))
+ {
+ if (st.isCond(7) && getSponsor(player) && st.dropItems(LEG_OF_KING_ARANEID, 1, 8, 700000))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q119_LastImperialPrince/Q119_LastImperialPrince.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q119_LastImperialPrince/Q119_LastImperialPrince.java
index e772e9549a..b164f54629 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q119_LastImperialPrince/Q119_LastImperialPrince.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q119_LastImperialPrince/Q119_LastImperialPrince.java
@@ -27,16 +27,13 @@ public class Q119_LastImperialPrince extends Quest
// NPCs
private static final int NAMELESS_SPIRIT = 31453;
private static final int DEVORIN = 32009;
-
// Item
private static final int ANTIQUE_BROOCH = 7262;
public Q119_LastImperialPrince()
{
super(119, "Last Imperial Prince");
-
registerQuestItems(ANTIQUE_BROOCH);
-
addStartNpc(NAMELESS_SPIRIT);
addTalkId(NAMELESS_SPIRIT, DEVORIN);
}
@@ -51,38 +48,43 @@ public class Q119_LastImperialPrince extends Quest
return htmltext;
}
- if (event.equals("31453-04.htm"))
+ switch (event)
{
- if (st.hasQuestItems(ANTIQUE_BROOCH))
+ case "31453-04.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ if (st.hasQuestItems(ANTIQUE_BROOCH))
+ {
+ st.startQuest();
+ }
+ else
+ {
+ htmltext = "31453-04b.htm";
+ st.exitQuest(true);
+ }
+ break;
}
- else
+ case "32009-02.htm":
{
- htmltext = "31453-04b.htm";
- st.exitQuest(true);
+ if (!st.hasQuestItems(ANTIQUE_BROOCH))
+ {
+ htmltext = "31453-02a.htm";
+ st.exitQuest(true);
+ }
+ break;
}
- }
- else if (event.equals("32009-02.htm"))
- {
- if (!st.hasQuestItems(ANTIQUE_BROOCH))
+ case "32009-03.htm":
{
- htmltext = "31453-02a.htm";
- st.exitQuest(true);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31453-07.htm":
+ {
+ st.rewardItems(57, 68787);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
}
- }
- else if (event.equals("32009-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31453-07.htm"))
- {
- st.rewardItems(57, 68787);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
}
return htmltext;
}
@@ -100,14 +102,17 @@ public class Q119_LastImperialPrince extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (!st.hasQuestItems(ANTIQUE_BROOCH) || (player.getLevel() < 74)) ? "31453-00a.htm" : "31453-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NAMELESS_SPIRIT:
+ {
if (cond == 1)
{
htmltext = "31453-04a.htm";
@@ -117,8 +122,9 @@ public class Q119_LastImperialPrince extends Quest
htmltext = "31453-05.htm";
}
break;
-
+ }
case DEVORIN:
+ {
if (cond == 1)
{
htmltext = "32009-01.htm";
@@ -128,12 +134,15 @@ public class Q119_LastImperialPrince extends Quest
htmltext = "32009-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = "31453-00b.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q120_PavelsResearch/Q120_PavelsResearch.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q120_PavelsResearch/Q120_PavelsResearch.java
index db728e5b75..7058203dd1 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q120_PavelsResearch/Q120_PavelsResearch.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q120_PavelsResearch/Q120_PavelsResearch.java
@@ -51,7 +51,6 @@ public class Q120_PavelsResearch extends Quest
public Q120_PavelsResearch()
{
super(120, "Pavel's Research");
-
addStartNpc(STONES);
addTalkId(BOOKSHELF, STONES, WEATHER1, WEATHER2, WEATHER3, WENDY, YUMI);
registerQuestItems(FLOWER, REPORT, REPORT2, ENIGMA, HEART, NECKLACE);
@@ -71,34 +70,34 @@ public class Q120_PavelsResearch extends Quest
{
case "32041-03.htm":
{
- qs.set("cond", "3");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(3);
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32041-04.htm":
{
- qs.set("cond", "4");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(4);
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32041-12.htm":
{
- qs.set("cond", "8");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(8);
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32041-16.htm":
{
- qs.set("cond", "16");
+ qs.setCond(16);
qs.giveItems(ENIGMA, 1);
- qs.playSound("ItemSound.quest_middle");
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32041-22.htm":
{
- qs.set("cond", "17");
+ qs.setCond(17);
qs.takeItems(ENIGMA, 1);
- qs.playSound("ItemSound.quest_middle");
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32041-32.htm":
@@ -106,19 +105,19 @@ public class Q120_PavelsResearch extends Quest
qs.takeItems(NECKLACE, 1);
qs.giveItems(EAR_BINDING, 1);
qs.exitQuest(true);
- qs.playSound("ItemSound.quest_finish");
+ qs.playSound(QuestState.SOUND_FINISH);
break;
}
case "32042-06.htm":
{
- if (qs.getInt("cond") == 10)
+ if (qs.isCond(10))
{
if ((qs.getInt("talk") + qs.getInt("talk1")) == 2)
{
- qs.set("cond", "11");
+ qs.setCond(11);
qs.set("talk", "0");
qs.set("talk1", "0");
- qs.playSound("ItemSound.quest_middle");
+ qs.playSound(QuestState.SOUND_MIDDLE);
}
else
{
@@ -161,23 +160,23 @@ public class Q120_PavelsResearch extends Quest
}
case "32042-15.htm":
{
- qs.set("cond", "12");
+ qs.setCond(12);
qs.set("talk", "0");
qs.set("talk1", "0");
qs.set("talk2", "0");
- qs.playSound("ItemSound.quest_middle");
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32043-06.htm":
{
- if (qs.getInt("cond") == 17)
+ if (qs.isCond(17))
{
if ((qs.getInt("talk") + qs.getInt("talk1")) == 2)
{
- qs.set("cond", "18");
+ qs.setCond(18);
qs.set("talk", "0");
qs.set("talk1", "0");
- qs.playSound("ItemSound.quest_middle");
+ qs.playSound(QuestState.SOUND_MIDDLE);
}
else
{
@@ -215,21 +214,21 @@ public class Q120_PavelsResearch extends Quest
}
case "32043-30.htm":
{
- qs.set("cond", "19");
+ qs.setCond(19);
qs.set("talk", "0");
qs.set("talk1", "0");
break;
}
case "32044-06.htm":
{
- if (qs.getInt("cond") == 20)
+ if (qs.isCond(20))
{
if ((qs.getInt("talk") + qs.getInt("talk1")) == 2)
{
- qs.set("cond", "21");
+ qs.setCond(21);
qs.set("talk", "0");
qs.set("talk1", "0");
- qs.playSound("ItemSound.quest_middle");
+ qs.playSound(QuestState.SOUND_MIDDLE);
}
else
{
@@ -264,16 +263,16 @@ public class Q120_PavelsResearch extends Quest
}
case "32044-17.htm":
{
- qs.set("cond", "22");
+ qs.setCond(22);
qs.set("talk", "0");
qs.set("talk1", "0");
- qs.playSound("ItemSound.quest_middle");
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32045-02.htm":
{
- qs.set("cond", "15");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(15);
+ qs.playSound(QuestState.SOUND_MIDDLE);
qs.giveItems(REPORT2, 1);
npc.broadcastPacket(new MagicSkillUse(npc, qs.getPlayer(), 5073, 5, 1500, 0));
break;
@@ -288,9 +287,7 @@ public class Q120_PavelsResearch extends Quest
{
if (qs.getPlayer().getLevel() >= 50)
{
- qs.setState(State.STARTED);
- qs.playSound("ItemSound.quest_accept");
- qs.set("cond", "1");
+ qs.startQuest();
}
else
{
@@ -301,78 +298,78 @@ public class Q120_PavelsResearch extends Quest
}
case "32046-08.htm":
{
- qs.set("cond", "2");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(2);
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32046-12.htm":
{
- qs.set("cond", "6");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(6);
+ qs.playSound(QuestState.SOUND_MIDDLE);
qs.giveItems(FLOWER, 1);
break;
}
case "32046-22.htm":
{
- qs.set("cond", "10");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(10);
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32046-29.htm":
{
- qs.set("cond", "13");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(13);
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32046-35.htm":
{
- qs.set("cond", "20");
+ qs.setCond(20);
qs.playSound("ItemSou;nd.quest_middle");
break;
}
case "32046-38.htm":
{
- qs.set("cond", "23");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(23);
+ qs.playSound(QuestState.SOUND_MIDDLE);
qs.giveItems(HEART, 1);
break;
}
case "32047-06.htm":
{
- qs.set("cond", "5");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(5);
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32047-10.htm":
{
- qs.set("cond", "7");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(7);
+ qs.playSound(QuestState.SOUND_MIDDLE);
qs.takeItems(FLOWER, 1);
break;
}
case "32047-15.htm":
{
- qs.set("cond", "9");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(9);
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32047-18.htm":
{
- qs.set("cond", "14");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(14);
+ qs.playSound(QuestState.SOUND_MIDDLE);
break;
}
case "32047-26.htm":
{
- qs.set("cond", "24");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(24);
+ qs.playSound(QuestState.SOUND_MIDDLE);
qs.takeItems(HEART, 1);
break;
}
case "32047-32.htm":
{
- qs.set("cond", "25");
- qs.playSound("ItemSound.quest_middle");
+ qs.setCond(25);
+ qs.playSound(QuestState.SOUND_MIDDLE);
qs.giveItems(NECKLACE, 1);
break;
}
@@ -429,7 +426,7 @@ public class Q120_PavelsResearch extends Quest
final int state = qs.getState();
final int npcId = npc.getNpcId();
- final int cond = qs.getInt("cond");
+ final int cond = qs.getCond();
if (state == State.COMPLETED)
{
htmltext = getAlreadyCompletedMsg();
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q121_PavelTheGiant/Q121_PavelTheGiant.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q121_PavelTheGiant/Q121_PavelTheGiant.java
index ffbecd10c5..380e9b2e23 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q121_PavelTheGiant/Q121_PavelTheGiant.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q121_PavelTheGiant/Q121_PavelTheGiant.java
@@ -31,7 +31,6 @@ public class Q121_PavelTheGiant extends Quest
public Q121_PavelTheGiant()
{
super(121, "Pavel the Giant");
-
addStartNpc(NEWYEAR);
addTalkId(NEWYEAR, YUMI);
}
@@ -48,9 +47,7 @@ public class Q121_PavelTheGiant extends Quest
if (event.equals("31961-2.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("32041-2.htm"))
{
@@ -75,25 +72,32 @@ public class Q121_PavelTheGiant extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 46) ? "31961-1a.htm" : "31961-1.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case NEWYEAR:
+ {
htmltext = "31961-2a.htm";
break;
-
+ }
case YUMI:
+ {
htmltext = "32041-1.htm";
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q122_OminousNews/Q122_OminousNews.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q122_OminousNews/Q122_OminousNews.java
index 24f3a38bc0..d2f4d6a63f 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q122_OminousNews/Q122_OminousNews.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q122_OminousNews/Q122_OminousNews.java
@@ -31,7 +31,6 @@ public class Q122_OminousNews extends Quest
public Q122_OminousNews()
{
super(122, "Ominous News");
-
addStartNpc(MOIRA);
addTalkId(MOIRA, KARUDA);
}
@@ -48,9 +47,7 @@ public class Q122_OminousNews extends Quest
if (event.equals("31979-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("32017-02.htm"))
{
@@ -75,25 +72,32 @@ public class Q122_OminousNews extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "31979-01.htm" : "31979-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case MOIRA:
+ {
htmltext = "31979-03.htm";
break;
-
+ }
case KARUDA:
+ {
htmltext = "32017-01.htm";
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q123_TheLeaderAndTheFollower/Q123_TheLeaderAndTheFollower.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q123_TheLeaderAndTheFollower/Q123_TheLeaderAndTheFollower.java
index 8c79a1bed7..20564fd7c2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q123_TheLeaderAndTheFollower/Q123_TheLeaderAndTheFollower.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q123_TheLeaderAndTheFollower/Q123_TheLeaderAndTheFollower.java
@@ -28,16 +28,13 @@ public class Q123_TheLeaderAndTheFollower extends Quest
{
// NPC
private static final int NEWYEAR = 31961;
-
- // Mobs
+ // Monsters
private static final int BRUIN_LIZARDMAN = 27321;
private static final int PICOT_ARENEID = 27322;
-
// Items
private static final int BRUIN_LIZARDMAN_BLOOD = 8549;
private static final int PICOT_ARANEID_LEG = 8550;
private static final int CRYSTAL_D = 1458;
-
// Rewards
private static final int CLAN_OATH_HELM = 7850;
private static final int CLAN_OATH_ARMOR = 7851;
@@ -53,12 +50,9 @@ public class Q123_TheLeaderAndTheFollower extends Quest
public Q123_TheLeaderAndTheFollower()
{
super(123, "The Leader and the Follower");
-
registerQuestItems(BRUIN_LIZARDMAN_BLOOD, PICOT_ARANEID_LEG);
-
addStartNpc(NEWYEAR);
addTalkId(NEWYEAR);
-
addKillId(BRUIN_LIZARDMAN, PICOT_ARENEID);
}
@@ -72,84 +66,90 @@ public class Q123_TheLeaderAndTheFollower extends Quest
return htmltext;
}
- if (event.equals("31961-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("state", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31961-05d.htm"))
- {
- if (st.getQuestItemsCount(BRUIN_LIZARDMAN_BLOOD) > 9)
+ case "31961-03.htm":
{
- st.set("cond", "3");
- st.set("state", "2");
- st.set("stateEx", "1");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BRUIN_LIZARDMAN_BLOOD, -1);
+ st.startQuest();
+ st.set("st}ate", "1");
+ break;
}
- }
- else if (event.equals("31961-05e.htm"))
- {
- if (st.getQuestItemsCount(BRUIN_LIZARDMAN_BLOOD) > 9)
+ case "31961-05d.htm":
{
- st.set("cond", "4");
- st.set("state", "2");
- st.set("stateEx", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BRUIN_LIZARDMAN_BLOOD, -1);
- }
- }
- else if (event.equals("31961-05f.htm"))
- {
- if (st.getQuestItemsCount(BRUIN_LIZARDMAN_BLOOD) > 9)
- {
- st.set("cond", "5");
- st.set("state", "2");
- st.set("stateEx", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BRUIN_LIZARDMAN_BLOOD, -1);
- }
- }
- else if (event.equals("31961-10.htm"))
- {
- final PlayerInstance academic = getApprentice(player);
- if (academic != null)
- {
- final QuestState st2 = academic.getQuestState(getName());
- if ((st2 != null) && (st2.getInt("state") == 2))
+ if (st.getQuestItemsCount(BRUIN_LIZARDMAN_BLOOD) > 9)
{
- final int stateEx = st2.getInt("stateEx");
- if (stateEx == 1)
+ st.setCond(3);
+ st.set("state", "2");
+ st.set("stateEx", "1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BRUIN_LIZARDMAN_BLOOD, -1);
+ }
+ break;
+ }
+ case "31961-05e.htm":
+ {
+ if (st.getQuestItemsCount(BRUIN_LIZARDMAN_BLOOD) > 9)
+ {
+ st.setCond(4);
+ st.set("state", "2");
+ st.set("stateEx", "2");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BRUIN_LIZARDMAN_BLOOD, -1);
+ }
+ break;
+ }
+ case "31961-05f.htm":
+ {
+ if (st.getQuestItemsCount(BRUIN_LIZARDMAN_BLOOD) > 9)
+ {
+ st.setCond(5);
+ st.set("state", "2");
+ st.set("stateEx", "3");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BRUIN_LIZARDMAN_BLOOD, -1);
+ }
+ break;
+ }
+ case "31961-10.htm":
+ {
+ final PlayerInstance academic = getApprentice(player);
+ if (academic != null)
+ {
+ final QuestState st2 = academic.getQuestState(getName());
+ if ((st2 != null) && (st2.getInt("state") == 2))
{
- if (st.getQuestItemsCount(CRYSTAL_D) > 921)
+ final int stateEx = st2.getInt("stateEx");
+ if (stateEx == 1)
{
- st.takeItems(CRYSTAL_D, 922);
- st2.set("cond", "6");
- st2.set("state", "3");
- st2.playSound(QuestState.SOUND_MIDDLE);
+ if (st.getQuestItemsCount(CRYSTAL_D) > 921)
+ {
+ st.takeItems(CRYSTAL_D, 922);
+ st2.setCond(6);
+ st2.set("state", "3");
+ st2.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ htmltext = "31961-11.htm";
+ }
}
else
{
- htmltext = "31961-11.htm";
- }
- }
- else
- {
- if (st.getQuestItemsCount(CRYSTAL_D) > 770)
- {
- st.takeItems(CRYSTAL_D, 771);
- st2.set("cond", "6");
- st2.set("state", "3");
- st2.playSound(QuestState.SOUND_MIDDLE);
- }
- else
- {
- htmltext = "31961-11a.htm";
+ if (st.getQuestItemsCount(CRYSTAL_D) > 770)
+ {
+ st.takeItems(CRYSTAL_D, 771);
+ st2.setCond(6);
+ st2.set("state", "3");
+ st2.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ htmltext = "31961-11a.htm";
+ }
}
}
}
+ break;
}
}
@@ -169,6 +169,7 @@ public class Q123_TheLeaderAndTheFollower extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getSponsor() > 0)
{
final QuestState st2 = player.getQuestState(Q118_ToLeadAndBeLed.class.getSimpleName());
@@ -210,8 +211,9 @@ public class Q123_TheLeaderAndTheFollower extends Quest
}
}
break;
-
+ }
case State.STARTED:
+ {
final int state = st.getInt("state");
if (state == 1)
{
@@ -260,7 +262,7 @@ public class Q123_TheLeaderAndTheFollower extends Quest
}
else if (state == 3)
{
- st.set("cond", "7");
+ st.setCond(7);
st.set("state", "4");
st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "31961-15.htm";
@@ -304,10 +306,12 @@ public class Q123_TheLeaderAndTheFollower extends Quest
}
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -328,22 +332,24 @@ public class Q123_TheLeaderAndTheFollower extends Quest
return null;
}
- final int cond = st.getInt("cond");
switch (npc.getNpcId())
{
case BRUIN_LIZARDMAN:
- if ((cond == 1) && st.dropItems(BRUIN_LIZARDMAN_BLOOD, 1, 10, 700000))
+ {
+ if (st.isCond(1) && st.dropItems(BRUIN_LIZARDMAN_BLOOD, 1, 10, 700000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case PICOT_ARENEID:
- if ((cond == 7) && getSponsor(player) && st.dropItems(PICOT_ARANEID_LEG, 1, 8, 700000))
+ {
+ if (st.isCond(7) && getSponsor(player) && st.dropItems(PICOT_ARANEID_LEG, 1, 8, 700000))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q124_MeetingTheElroki/Q124_MeetingTheElroki.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q124_MeetingTheElroki/Q124_MeetingTheElroki.java
index 1887cf0d50..8dfb5518b5 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q124_MeetingTheElroki/Q124_MeetingTheElroki.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q124_MeetingTheElroki/Q124_MeetingTheElroki.java
@@ -34,7 +34,6 @@ public class Q124_MeetingTheElroki extends Quest
public Q124_MeetingTheElroki()
{
super(124, "Meeting the Elroki");
-
addStartNpc(MARQUEZ);
addTalkId(MARQUEZ, MUSHIKA, ASAMAH, KARAKAWEI, MANTARASA);
}
@@ -49,44 +48,52 @@ public class Q124_MeetingTheElroki extends Quest
return htmltext;
}
- if (event.equals("32113-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("32113-04.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32114-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32115-04.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32117-02.htm"))
- {
- if (st.getInt("cond") == 4)
+ case "32113-03.htm":
{
- st.set("progress", "1");
+ st.startQuest();
+ break;
+ }
+ case "32113-04.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32114-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32115-04.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32117-02.htm":
+ {
+ if (st.isCond(4))
+ {
+ st.set("progress", "1");
+ }
+ break;
+ }
+ case "32117-03.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32118-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(8778, 1); // Egg
+ break;
}
- }
- else if (event.equals("32117-03.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32118-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(8778, 1); // Egg
}
return htmltext;
@@ -105,14 +112,17 @@ public class Q124_MeetingTheElroki extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 75) ? "32113-01a.htm" : "32113-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MARQUEZ:
+ {
if (cond == 1)
{
htmltext = "32113-03.htm";
@@ -122,8 +132,9 @@ public class Q124_MeetingTheElroki extends Quest
htmltext = "32113-04a.htm";
}
break;
-
+ }
case MUSHIKA:
+ {
if (cond == 2)
{
htmltext = "32114-01.htm";
@@ -133,8 +144,9 @@ public class Q124_MeetingTheElroki extends Quest
htmltext = "32114-03.htm";
}
break;
-
+ }
case ASAMAH:
+ {
if (cond == 3)
{
htmltext = "32115-01.htm";
@@ -148,8 +160,9 @@ public class Q124_MeetingTheElroki extends Quest
st.exitQuest(false);
}
break;
-
+ }
case KARAKAWEI:
+ {
if (cond == 4)
{
htmltext = "32117-01.htm";
@@ -163,8 +176,9 @@ public class Q124_MeetingTheElroki extends Quest
htmltext = "32117-04.htm";
}
break;
-
+ }
case MANTARASA:
+ {
if (cond == 5)
{
htmltext = "32118-01.htm";
@@ -174,10 +188,12 @@ public class Q124_MeetingTheElroki extends Quest
htmltext = "32118-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
if (npc.getNpcId() == ASAMAH)
{
htmltext = "32115-06.htm";
@@ -187,6 +203,7 @@ public class Q124_MeetingTheElroki extends Quest
htmltext = getAlreadyCompletedMsg();
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q125_TheNameOfEvil_1/Q125_TheNameOfEvil_1.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q125_TheNameOfEvil_1/Q125_TheNameOfEvil_1.java
index 7470a4b3ab..ca38dbf649 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q125_TheNameOfEvil_1/Q125_TheNameOfEvil_1.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q125_TheNameOfEvil_1/Q125_TheNameOfEvil_1.java
@@ -33,12 +33,10 @@ public class Q125_TheNameOfEvil_1 extends Quest
private static final int ULU_KAIMU = 32119;
private static final int BALU_KAIMU = 32120;
private static final int CHUTA_KAIMU = 32121;
-
private static final int ORNITHOMIMUS_CLAW = 8779;
private static final int DEINONYCHUS_BONE = 8780;
private static final int EPITAPH_OF_WISDOM = 8781;
private static final int GAZKH_FRAGMENT = 8782;
-
private static final int[] ORNITHOMIMUS =
{
22200,
@@ -49,7 +47,6 @@ public class Q125_TheNameOfEvil_1 extends Quest
22742,
22744
};
-
private static final int[] DEINONYCHUS =
{
16067,
@@ -65,21 +62,11 @@ public class Q125_TheNameOfEvil_1 extends Quest
public Q125_TheNameOfEvil_1()
{
super(125, "The Name of Evil - 1");
-
registerQuestItems(ORNITHOMIMUS_CLAW, DEINONYCHUS_BONE, EPITAPH_OF_WISDOM, GAZKH_FRAGMENT);
-
addStartNpc(MUSHIKA);
addTalkId(MUSHIKA, KARAKAWEI, ULU_KAIMU, BALU_KAIMU, CHUTA_KAIMU);
-
- for (int i : ORNITHOMIMUS)
- {
- addKillId(i);
- }
-
- for (int i : DEINONYCHUS)
- {
- addKillId(i);
- }
+ addKillId(ORNITHOMIMUS);
+ addKillId(DEINONYCHUS);
}
@Override
@@ -92,44 +79,52 @@ public class Q125_TheNameOfEvil_1 extends Quest
return htmltext;
}
- if (event.equals("32114-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("32114-09.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(GAZKH_FRAGMENT, 1);
- }
- else if (event.equals("32117-08.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32117-14.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32119-14.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32120-15.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32121-16.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GAZKH_FRAGMENT, -1);
- st.giveItems(EPITAPH_OF_WISDOM, 1);
+ case "32114-05.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "32114-09.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(GAZKH_FRAGMENT, 1);
+ break;
+ }
+ case "32117-08.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32117-14.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32119-14.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32120-15.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32121-16.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GAZKH_FRAGMENT, -1);
+ st.giveItems(EPITAPH_OF_WISDOM, 1);
+ break;
+ }
}
return htmltext;
@@ -148,6 +143,7 @@ public class Q125_TheNameOfEvil_1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
final QuestState first = player.getQuestState(Q124_MeetingTheElroki.class.getSimpleName());
if ((first != null) && first.isCompleted() && (player.getLevel() >= 76))
{
@@ -158,12 +154,14 @@ public class Q125_TheNameOfEvil_1 extends Quest
htmltext = "32114-00.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MUSHIKA:
+ {
if (cond == 1)
{
htmltext = "32114-07.htm";
@@ -184,8 +182,9 @@ public class Q125_TheNameOfEvil_1 extends Quest
st.exitQuest(false);
}
break;
-
+ }
case KARAKAWEI:
+ {
if (cond == 2)
{
htmltext = "32117-01.htm";
@@ -206,7 +205,7 @@ public class Q125_TheNameOfEvil_1 extends Quest
else
{
htmltext = "32117-09.htm";
- st.set("cond", "3");
+ st.setCond(3);
}
}
else if (cond == 5)
@@ -222,8 +221,9 @@ public class Q125_TheNameOfEvil_1 extends Quest
htmltext = "32117-17.htm";
}
break;
-
+ }
case ULU_KAIMU:
+ {
if (cond == 5)
{
npc.doCast(SkillTable.getInstance().getSkill(5089, 1));
@@ -234,8 +234,9 @@ public class Q125_TheNameOfEvil_1 extends Quest
htmltext = "32119-14.htm";
}
break;
-
+ }
case BALU_KAIMU:
+ {
if (cond == 6)
{
npc.doCast(SkillTable.getInstance().getSkill(5089, 1));
@@ -246,8 +247,9 @@ public class Q125_TheNameOfEvil_1 extends Quest
htmltext = "32120-16.htm";
}
break;
-
+ }
case CHUTA_KAIMU:
+ {
if (cond == 7)
{
npc.doCast(SkillTable.getInstance().getSkill(5089, 1));
@@ -258,12 +260,15 @@ public class Q125_TheNameOfEvil_1 extends Quest
htmltext = "32121-17.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -272,7 +277,7 @@ public class Q125_TheNameOfEvil_1 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "3");
+ final QuestState st = checkPlayerCondition(player, npc, 3);
if (st == null)
{
return null;
@@ -283,16 +288,17 @@ public class Q125_TheNameOfEvil_1 extends Quest
{
if (st.dropItems(ORNITHOMIMUS_CLAW, 1, 2, 50000) && (st.getQuestItemsCount(DEINONYCHUS_BONE) == 2))
{
- st.set("cond", "4");
+ st.setCond(4);
}
}
else if (Util.contains(DEINONYCHUS, npcId))
{
if (st.dropItems(DEINONYCHUS_BONE, 1, 2, 50000) && (st.getQuestItemsCount(ORNITHOMIMUS_CLAW) == 2))
{
- st.set("cond", "4");
+ st.setCond(4);
}
}
+
return null;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q126_TheNameOfEvil_2/Q126_TheNameOfEvil_2.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q126_TheNameOfEvil_2/Q126_TheNameOfEvil_2.java
index fa7d546a89..3bd55d6596 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q126_TheNameOfEvil_2/Q126_TheNameOfEvil_2.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q126_TheNameOfEvil_2/Q126_TheNameOfEvil_2.java
@@ -33,14 +33,12 @@ public class Q126_TheNameOfEvil_2 extends Quest
private static final int CHUTA_KAIMU = 32121;
private static final int WARRIOR_GRAVE = 32122;
private static final int SHILEN_STONE_STATUE = 32109;
-
private static final int BONEPOWDER = 8783;
private static final int EWA = 729;
public Q126_TheNameOfEvil_2()
{
super(126, "The Name of Evil - 2");
-
addStartNpc(ASAMANAH);
addTalkId(ASAMANAH, MUSHIKA, ULU_KAIMU, BALU_KAIMU, CHUTA_KAIMU, WARRIOR_GRAVE, SHILEN_STONE_STATUE);
}
@@ -55,237 +53,275 @@ public class Q126_TheNameOfEvil_2 extends Quest
return htmltext;
}
- if (event.equals("32115-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("32115-10.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32119-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32119-09.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32119-11.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32120-07.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32120-09.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32120-11.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32121-07.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32121-10.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32121-15.htm"))
- {
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32122-03.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32122-15.htm"))
- {
- st.set("cond", "13");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32122-18.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32122-87.htm"))
- {
- st.giveItems(BONEPOWDER, 1);
- }
- else if (event.equals("32122-90.htm"))
- {
- st.set("cond", "18");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32109-02.htm"))
- {
- st.set("cond", "19");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32109-19.htm"))
- {
- st.set("cond", "20");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BONEPOWDER, 1);
- }
- else if (event.equals("32115-21.htm"))
- {
- st.set("cond", "21");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32115-28.htm"))
- {
- st.set("cond", "22");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32114-08.htm"))
- {
- st.set("cond", "23");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32114-09.htm"))
- {
- st.giveItems(EWA, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else if (event.equals("DOOne"))
- {
- htmltext = "32122-26.htm";
- if (st.getInt("DO") < 1)
+ case "32115-05.htm":
{
- st.set("DO", "1");
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("MIOne"))
- {
- htmltext = "32122-30.htm";
- if (st.getInt("MI") < 1)
+ case "32115-10.htm":
{
- st.set("MI", "1");
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("FAOne"))
- {
- htmltext = "32122-34.htm";
- if (st.getInt("FA") < 1)
+ case "32119-02.htm":
{
- st.set("FA", "1");
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("SOLOne"))
- {
- htmltext = "32122-38.htm";
- if (st.getInt("SOL") < 1)
+ case "32119-09.htm":
{
- st.set("SOL", "1");
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("FA_2One"))
- {
- if (st.getInt("FA_2") < 1)
+ case "32119-11.htm":
{
- st.set("FA_2", "1");
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- htmltext = getSongOne(st);
- }
- else if (event.equals("FATwo"))
- {
- htmltext = "32122-47.htm";
- if (st.getInt("FA") < 1)
+ case "32120-07.htm":
{
- st.set("FA", "1");
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("SOLTwo"))
- {
- htmltext = "32122-51.htm";
- if (st.getInt("SOL") < 1)
+ case "32120-09.htm":
{
- st.set("SOL", "1");
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("TITwo"))
- {
- htmltext = "32122-55.htm";
- if (st.getInt("TI") < 1)
+ case "32120-11.htm":
{
- st.set("TI", "1");
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("SOL_2Two"))
- {
- htmltext = "32122-59.htm";
- if (st.getInt("SOL_2") < 1)
+ case "32121-07.htm":
{
- st.set("SOL_2", "1");
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("FA_2Two"))
- {
- if (st.getInt("FA_2") < 1)
+ case "32121-10.htm":
{
- st.set("FA_2", "1");
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- htmltext = getSongTwo(st);
- }
- else if (event.equals("SOLTri"))
- {
- htmltext = "32122-68.htm";
- if (st.getInt("SOL") < 1)
+ case "32121-15.htm":
{
- st.set("SOL", "1");
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("FATri"))
- {
- htmltext = "32122-72.htm";
- if (st.getInt("FA") < 1)
+ case "32122-03.htm":
{
- st.set("FA", "1");
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("MITri"))
- {
- htmltext = "32122-76.htm";
- if (st.getInt("MI") < 1)
+ case "32122-15.htm":
{
- st.set("MI", "1");
+ st.setCond(13);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("FA_2Tri"))
- {
- htmltext = "32122-80.htm";
- if (st.getInt("FA_2") < 1)
+ case "32122-18.htm":
{
- st.set("FA_2", "1");
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("MI_2Tri"))
- {
- if (st.getInt("MI_2") < 1)
+ case "32122-87.htm":
{
- st.set("MI_2", "1");
+ st.giveItems(BONEPOWDER, 1);
+ break;
+ }
+ case "32122-90.htm":
+ {
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32109-02.htm":
+ {
+ st.setCond(19);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32109-19.htm":
+ {
+ st.setCond(20);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BONEPOWDER, 1);
+ break;
+ }
+ case "32115-21.htm":
+ {
+ st.setCond(21);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32115-28.htm":
+ {
+ st.setCond(22);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32114-08.htm":
+ {
+ st.setCond(23);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32114-09.htm":
+ {
+ st.giveItems(EWA, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "DOOne":
+ {
+ htmltext = "32122-26.htm";
+ if (st.getInt("DO") < 1)
+ {
+ st.set("DO", "1");
+ }
+ break;
+ }
+ case "MIOne":
+ {
+ htmltext = "32122-30.htm";
+ if (st.getInt("MI") < 1)
+ {
+ st.set("MI", "1");
+ }
+ break;
+ }
+ case "FAOne":
+ {
+ htmltext = "32122-34.htm";
+ if (st.getInt("FA") < 1)
+ {
+ st.set("FA", "1");
+ }
+ break;
+ }
+ case "SOLOne":
+ {
+ htmltext = "32122-38.htm";
+ if (st.getInt("SOL") < 1)
+ {
+ st.set("SOL", "1");
+ }
+ break;
+ }
+ case "FA_2One":
+ {
+ if (st.getInt("FA_2") < 1)
+ {
+ st.set("FA_2", "1");
+ }
+ htmltext = getSongOne(st);
+ break;
+ }
+ case "FATwo":
+ {
+ htmltext = "32122-47.htm";
+ if (st.getInt("FA") < 1)
+ {
+ st.set("FA", "1");
+ }
+ break;
+ }
+ case "SOLTwo":
+ {
+ htmltext = "32122-51.htm";
+ if (st.getInt("SOL") < 1)
+ {
+ st.set("SOL", "1");
+ }
+ break;
+ }
+ case "TITwo":
+ {
+ htmltext = "32122-55.htm";
+ if (st.getInt("TI") < 1)
+ {
+ st.set("TI", "1");
+ }
+ break;
+ }
+ case "SOL_2Two":
+ {
+ htmltext = "32122-59.htm";
+ if (st.getInt("SOL_2") < 1)
+ {
+ st.set("SOL_2", "1");
+ }
+ break;
+ }
+ case "FA_2Two":
+ {
+ if (st.getInt("FA_2") < 1)
+ {
+ st.set("FA_2", "1");
+ }
+ htmltext = getSongTwo(st);
+ break;
+ }
+ case "SOLTri":
+ {
+ htmltext = "32122-68.htm";
+ if (st.getInt("SOL") < 1)
+ {
+ st.set("SOL", "1");
+ }
+ break;
+ }
+ case "FATri":
+ {
+ htmltext = "32122-72.htm";
+ if (st.getInt("FA") < 1)
+ {
+ st.set("FA", "1");
+ }
+ break;
+ }
+ case "MITri":
+ {
+ htmltext = "32122-76.htm";
+ if (st.getInt("MI") < 1)
+ {
+ st.set("MI", "1");
+ }
+ break;
+ }
+ case "FA_2Tri":
+ {
+ htmltext = "32122-80.htm";
+ if (st.getInt("FA_2") < 1)
+ {
+ st.set("FA_2", "1");
+ }
+ break;
+ }
+ case "MI_2Tri":
+ {
+ if (st.getInt("MI_2") < 1)
+ {
+ st.set("MI_2", "1");
+ }
+ htmltext = getSongTri(st);
+ break;
}
- htmltext = getSongTri(st);
}
return htmltext;
@@ -304,6 +340,7 @@ public class Q126_TheNameOfEvil_2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 77)
{
htmltext = "32115-02.htm";
@@ -321,16 +358,18 @@ public class Q126_TheNameOfEvil_2 extends Quest
}
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ASAMANAH:
+ {
if (cond == 1)
{
htmltext = "32115-11.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if ((cond > 1) && (cond < 20))
@@ -350,8 +389,9 @@ public class Q126_TheNameOfEvil_2 extends Quest
htmltext = "32115-29.htm";
}
break;
-
+ }
case ULU_KAIMU:
+ {
if (cond == 1)
{
htmltext = "32119-01a.htm";
@@ -373,8 +413,9 @@ public class Q126_TheNameOfEvil_2 extends Quest
htmltext = "32119-12.htm";
}
break;
-
+ }
case BALU_KAIMU:
+ {
if (cond < 5)
{
htmltext = "32120-02.htm";
@@ -396,8 +437,9 @@ public class Q126_TheNameOfEvil_2 extends Quest
htmltext = "32120-12.htm";
}
break;
-
+ }
case CHUTA_KAIMU:
+ {
if (cond < 8)
{
htmltext = "32121-02.htm";
@@ -419,8 +461,9 @@ public class Q126_TheNameOfEvil_2 extends Quest
htmltext = "32121-16.htm";
}
break;
-
+ }
case WARRIOR_GRAVE:
+ {
if (cond < 11)
{
htmltext = "32122-02.htm";
@@ -458,8 +501,9 @@ public class Q126_TheNameOfEvil_2 extends Quest
htmltext = "32122-91.htm";
}
break;
-
+ }
case SHILEN_STONE_STATUE:
+ {
if (cond < 18)
{
htmltext = "32109-03.htm";
@@ -477,8 +521,9 @@ public class Q126_TheNameOfEvil_2 extends Quest
htmltext = "32109-04.htm";
}
break;
-
+ }
case MUSHIKA:
+ {
if (cond < 22)
{
htmltext = "32114-02.htm";
@@ -492,12 +537,15 @@ public class Q126_TheNameOfEvil_2 extends Quest
htmltext = "32114-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -506,10 +554,10 @@ public class Q126_TheNameOfEvil_2 extends Quest
private static String getSongOne(QuestState st)
{
String htmltext = "32122-24.htm";
- if ((st.getInt("cond") == 14) && (st.getInt("DO") > 0) && (st.getInt("MI") > 0) && (st.getInt("FA") > 0) && (st.getInt("SOL") > 0) && (st.getInt("FA_2") > 0))
+ if (st.isCond(14) && (st.getInt("DO") > 0) && (st.getInt("MI") > 0) && (st.getInt("FA") > 0) && (st.getInt("SOL") > 0) && (st.getInt("FA_2") > 0))
{
htmltext = "32122-42.htm";
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.unset("DO");
st.unset("MI");
@@ -523,10 +571,10 @@ public class Q126_TheNameOfEvil_2 extends Quest
private static String getSongTwo(QuestState st)
{
String htmltext = "32122-45.htm";
- if ((st.getInt("cond") == 15) && (st.getInt("FA") > 0) && (st.getInt("SOL") > 0) && (st.getInt("TI") > 0) && (st.getInt("SOL_2") > 0) && (st.getInt("FA_2") > 0))
+ if (st.isCond(15) && (st.getInt("FA") > 0) && (st.getInt("SOL") > 0) && (st.getInt("TI") > 0) && (st.getInt("SOL_2") > 0) && (st.getInt("FA_2") > 0))
{
htmltext = "32122-63.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
st.unset("FA");
st.unset("SOL");
@@ -540,10 +588,10 @@ public class Q126_TheNameOfEvil_2 extends Quest
private static String getSongTri(QuestState st)
{
String htmltext = "32122-66.htm";
- if ((st.getInt("cond") == 16) && (st.getInt("SOL") > 0) && (st.getInt("FA") > 0) && (st.getInt("MI") > 0) && (st.getInt("FA_2") > 0) && (st.getInt("MI_2") > 0))
+ if (st.isCond(16) && (st.getInt("SOL") > 0) && (st.getInt("FA") > 0) && (st.getInt("MI") > 0) && (st.getInt("FA_2") > 0) && (st.getInt("MI_2") > 0))
{
htmltext = "32122-84.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.unset("SOL");
st.unset("FA");
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q127_KamaelAWindowToTheFuture/Q127_KamaelAWindowToTheFuture.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q127_KamaelAWindowToTheFuture/Q127_KamaelAWindowToTheFuture.java
index d8241994b3..0415ccad03 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q127_KamaelAWindowToTheFuture/Q127_KamaelAWindowToTheFuture.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q127_KamaelAWindowToTheFuture/Q127_KamaelAWindowToTheFuture.java
@@ -33,7 +33,6 @@ public class Q127_KamaelAWindowToTheFuture extends Quest
private static final int OLTLIN = 30862;
private static final int JURIS = 30113;
private static final int RODEMAI = 30756;
-
// Items
private static final int MARK_DOMINIC = 8939;
private static final int MARK_HUMAN = 8940;
@@ -45,9 +44,7 @@ public class Q127_KamaelAWindowToTheFuture extends Quest
public Q127_KamaelAWindowToTheFuture()
{
super(127, "Kamael: A Window to the Future");
-
registerQuestItems(MARK_DOMINIC, MARK_HUMAN, MARK_DWARF, MARK_ORC, MARK_DELF, MARK_ELF);
-
addStartNpc(DOMINIC);
addTalkId(DOMINIC, KLAUS, ALDER, AKLAN, OLTLIN, JURIS, RODEMAI);
}
@@ -62,70 +59,80 @@ public class Q127_KamaelAWindowToTheFuture extends Quest
return htmltext;
}
- if (event.equals("31350-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(MARK_DOMINIC, 1);
- }
- else if (event.equals("31350-06.htm"))
- {
- st.takeItems(MARK_HUMAN, -1);
- st.takeItems(MARK_DWARF, -1);
- st.takeItems(MARK_ELF, -1);
- st.takeItems(MARK_DELF, -1);
- st.takeItems(MARK_ORC, -1);
- st.takeItems(MARK_DOMINIC, -1);
- st.rewardItems(57, 159100);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else if (event.equals("30187-06.htm"))
- {
- st.set("cond", "2");
- }
- else if (event.equals("30187-08.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(MARK_HUMAN, 1);
- }
- else if (event.equals("32092-05.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(MARK_DWARF, 1);
- }
- else if (event.equals("31288-04.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(MARK_ORC, 1);
- }
- else if (event.equals("30862-04.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(MARK_DELF, 1);
- }
- else if (event.equals("30113-04.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(MARK_ELF, 1);
- }
- else if (event.equals("kamaelstory"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- player.sendPacket(ExShowSlideshowKamael.STATIC_PACKET);
- return null;
- }
- else if (event.equals("30756-05.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
+ case "31350-04.htm":
+ {
+ st.startQuest();
+ st.giveItems(MARK_DOMINIC, 1);
+ break;
+ }
+ case "31350-06.htm":
+ {
+ st.takeItems(MARK_HUMAN, -1);
+ st.takeItems(MARK_DWARF, -1);
+ st.takeItems(MARK_ELF, -1);
+ st.takeItems(MARK_DELF, -1);
+ st.takeItems(MARK_ORC, -1);
+ st.takeItems(MARK_DOMINIC, -1);
+ st.rewardItems(57, 159100);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "30187-06.htm":
+ {
+ st.setCond(2);
+ break;
+ }
+ case "30187-08.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(MARK_HUMAN, 1);
+ break;
+ }
+ case "32092-05.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(MARK_DWARF, 1);
+ break;
+ }
+ case "31288-04.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(MARK_ORC, 1);
+ break;
+ }
+ case "30862-04.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(MARK_DELF, 1);
+ break;
+ }
+ case "30113-04.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(MARK_ELF, 1);
+ break;
+ }
+ case "kamaelstory":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ player.sendPacket(ExShowSlideshowKamael.STATIC_PACKET);
+ return null;
+ }
+ case "30756-05.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
}
return htmltext;
@@ -141,80 +148,89 @@ public class Q127_KamaelAWindowToTheFuture extends Quest
return htmltext;
}
- npc.getNpcId();
- final int cond = st.getInt("cond");
-
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "31350-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case KLAUS:
- if (cond == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30187-01.htm";
}
- else if (cond == 2)
+ else if (st.isCond(2))
{
htmltext = "30187-06.htm";
}
break;
-
+ }
case ALDER:
- if (cond == 3)
+ {
+ if (st.isCond(3))
{
htmltext = "32092-01.htm";
}
break;
-
+ }
case AKLAN:
- if (cond == 4)
+ {
+ if (st.isCond(4))
{
htmltext = "31288-01.htm";
}
break;
-
+ }
case OLTLIN:
- if (cond == 5)
+ {
+ if (st.isCond(5))
{
htmltext = "30862-01.htm";
}
break;
-
+ }
case JURIS:
- if (cond == 6)
+ {
+ if (st.isCond(6))
{
htmltext = "30113-01.htm";
}
break;
-
+ }
case RODEMAI:
- if (cond == 7)
+ {
+ if (st.isCond(7))
{
htmltext = "30756-01.htm";
}
- else if (cond == 8)
+ else if (st.isCond(8))
{
htmltext = "30756-04.htm";
}
break;
-
+ }
case DOMINIC:
- if (cond == 9)
+ {
+ if (st.isCond(9))
{
htmltext = "31350-05.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
return htmltext;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q151_CureForFeverDisease/Q151_CureForFeverDisease.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q151_CureForFeverDisease/Q151_CureForFeverDisease.java
index bda0ac7012..7216a30fbd 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q151_CureForFeverDisease/Q151_CureForFeverDisease.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q151_CureForFeverDisease/Q151_CureForFeverDisease.java
@@ -24,23 +24,19 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q151_CureForFeverDisease extends Quest
{
+ // NPCs
+ private static final int ELIAS = 30050;
+ private static final int YOHANES = 30032;
// Items
private static final int POISON_SAC = 703;
private static final int FEVER_MEDICINE = 704;
- // NPCs
- private static final int ELIAS = 30050;
- private static final int YOHANES = 30032;
-
public Q151_CureForFeverDisease()
{
super(151, "Cure for Fever Disease");
-
registerQuestItems(FEVER_MEDICINE, POISON_SAC);
-
addStartNpc(ELIAS);
addTalkId(ELIAS, YOHANES);
-
addKillId(20103, 20106, 20108);
}
@@ -56,9 +52,7 @@ public class Q151_CureForFeverDisease extends Quest
if (event.equals("30050-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -77,14 +71,17 @@ public class Q151_CureForFeverDisease extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30050-01.htm" : "30050-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ELIAS:
+ {
if (cond == 1)
{
htmltext = "30050-04.htm";
@@ -102,12 +99,13 @@ public class Q151_CureForFeverDisease extends Quest
st.exitQuest(false);
}
break;
-
+ }
case YOHANES:
+ {
if (cond == 2)
{
htmltext = "30032-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(POISON_SAC, 1);
st.giveItems(FEVER_MEDICINE, 1);
@@ -117,12 +115,15 @@ public class Q151_CureForFeverDisease extends Quest
htmltext = "30032-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -131,7 +132,7 @@ public class Q151_CureForFeverDisease extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -139,7 +140,7 @@ public class Q151_CureForFeverDisease extends Quest
if (st.dropItems(POISON_SAC, 1, 1, 200000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q152_ShardsOfGolem/Q152_ShardsOfGolem.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q152_ShardsOfGolem/Q152_ShardsOfGolem.java
index 1b6d31a4dc..73f781a463 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q152_ShardsOfGolem/Q152_ShardsOfGolem.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q152_ShardsOfGolem/Q152_ShardsOfGolem.java
@@ -24,31 +24,25 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q152_ShardsOfGolem extends Quest
{
+ // NPCs
+ private static final int HARRIS = 30035;
+ private static final int ALTRAN = 30283;
+ // Monster
+ private static final int STONE_GOLEM = 20016;
// Items
private static final int HARRIS_RECEIPT_1 = 1008;
private static final int HARRIS_RECEIPT_2 = 1009;
private static final int GOLEM_SHARD = 1010;
private static final int TOOL_BOX = 1011;
-
// Reward
private static final int WOODEN_BREASTPLATE = 23;
- // NPCs
- private static final int HARRIS = 30035;
- private static final int ALTRAN = 30283;
-
- // Mob
- private static final int STONE_GOLEM = 20016;
-
public Q152_ShardsOfGolem()
{
super(152, "Shards of Golem");
-
registerQuestItems(HARRIS_RECEIPT_1, HARRIS_RECEIPT_2, GOLEM_SHARD, TOOL_BOX);
-
addStartNpc(HARRIS);
addTalkId(HARRIS, ALTRAN);
-
addKillId(STONE_GOLEM);
}
@@ -64,14 +58,12 @@ public class Q152_ShardsOfGolem extends Quest
if (event.equals("30035-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(HARRIS_RECEIPT_1, 1);
}
else if (event.equals("30283-02.htm"))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HARRIS_RECEIPT_1, 1);
st.giveItems(HARRIS_RECEIPT_2, 1);
@@ -93,14 +85,17 @@ public class Q152_ShardsOfGolem extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 10) ? "30035-01a.htm" : "30035-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HARRIS:
+ {
if (cond < 4)
{
htmltext = "30035-03.htm";
@@ -116,8 +111,9 @@ public class Q152_ShardsOfGolem extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ALTRAN:
+ {
if (cond == 1)
{
htmltext = "30283-01.htm";
@@ -129,7 +125,7 @@ public class Q152_ShardsOfGolem extends Quest
else if (cond == 3)
{
htmltext = "30283-04.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GOLEM_SHARD, -1);
st.giveItems(TOOL_BOX, 1);
@@ -139,12 +135,15 @@ public class Q152_ShardsOfGolem extends Quest
htmltext = "30283-05.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -153,7 +152,7 @@ public class Q152_ShardsOfGolem extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -161,7 +160,7 @@ public class Q152_ShardsOfGolem extends Quest
if (st.dropItems(GOLEM_SHARD, 1, 5, 300000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q153_DeliverGoods/Q153_DeliverGoods.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q153_DeliverGoods/Q153_DeliverGoods.java
index c5c33a23f0..9f74808f5d 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q153_DeliverGoods/Q153_DeliverGoods.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q153_DeliverGoods/Q153_DeliverGoods.java
@@ -29,7 +29,6 @@ public class Q153_DeliverGoods extends Quest
private static final int SILVIA = 30003;
private static final int ARNOLD = 30041;
private static final int RANT = 30054;
-
// Items
private static final int DELIVERY_LIST = 1012;
private static final int HEAVY_WOOD_BOX = 1013;
@@ -38,7 +37,6 @@ public class Q153_DeliverGoods extends Quest
private static final int JACKSON_RECEIPT = 1016;
private static final int SILVIA_RECEIPT = 1017;
private static final int RANT_RECEIPT = 1018;
-
// Rewards
private static final int SOULSHOT_NO_GRADE = 1835;
private static final int RING_OF_KNOWLEDGE = 875;
@@ -46,9 +44,7 @@ public class Q153_DeliverGoods extends Quest
public Q153_DeliverGoods()
{
super(153, "Deliver Goods");
-
registerQuestItems(DELIVERY_LIST, HEAVY_WOOD_BOX, CLOTH_BUNDLE, CLAY_POT, JACKSON_RECEIPT, SILVIA_RECEIPT, RANT_RECEIPT);
-
addStartNpc(ARNOLD);
addTalkId(JACKSON, SILVIA, ARNOLD, RANT);
}
@@ -65,9 +61,7 @@ public class Q153_DeliverGoods extends Quest
if (event.equals("30041-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(DELIVERY_LIST, 1);
st.giveItems(CLAY_POT, 1);
st.giveItems(CLOTH_BUNDLE, 1);
@@ -90,18 +84,21 @@ public class Q153_DeliverGoods extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 2) ? "30041-00.htm" : "30041-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case ARNOLD:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30041-03.htm";
}
- else if (st.getInt("cond") == 2)
+ else if (st.isCond(2))
{
htmltext = "30041-04.htm";
st.takeItems(DELIVERY_LIST, 1);
@@ -115,8 +112,9 @@ public class Q153_DeliverGoods extends Quest
st.exitQuest(false);
}
break;
-
+ }
case JACKSON:
+ {
if (st.hasQuestItems(HEAVY_WOOD_BOX))
{
htmltext = "30002-01.htm";
@@ -124,7 +122,7 @@ public class Q153_DeliverGoods extends Quest
st.giveItems(JACKSON_RECEIPT, 1);
if (st.hasQuestItems(SILVIA_RECEIPT, RANT_RECEIPT))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -137,8 +135,9 @@ public class Q153_DeliverGoods extends Quest
htmltext = "30002-02.htm";
}
break;
-
+ }
case SILVIA:
+ {
if (st.hasQuestItems(CLOTH_BUNDLE))
{
htmltext = "30003-01.htm";
@@ -147,7 +146,7 @@ public class Q153_DeliverGoods extends Quest
st.giveItems(SOULSHOT_NO_GRADE, 3);
if (st.hasQuestItems(JACKSON_RECEIPT, RANT_RECEIPT))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -160,8 +159,9 @@ public class Q153_DeliverGoods extends Quest
htmltext = "30003-02.htm";
}
break;
-
+ }
case RANT:
+ {
if (st.hasQuestItems(CLAY_POT))
{
htmltext = "30054-01.htm";
@@ -169,7 +169,7 @@ public class Q153_DeliverGoods extends Quest
st.giveItems(RANT_RECEIPT, 1);
if (st.hasQuestItems(JACKSON_RECEIPT, SILVIA_RECEIPT))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -182,12 +182,15 @@ public class Q153_DeliverGoods extends Quest
htmltext = "30054-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q154_SacrificeToTheSea/Q154_SacrificeToTheSea.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q154_SacrificeToTheSea/Q154_SacrificeToTheSea.java
index be3a429db3..0842c1bf7c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q154_SacrificeToTheSea/Q154_SacrificeToTheSea.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q154_SacrificeToTheSea/Q154_SacrificeToTheSea.java
@@ -28,24 +28,19 @@ public class Q154_SacrificeToTheSea extends Quest
private static final int ROCKSWELL = 30312;
private static final int CRISTEL = 30051;
private static final int ROLFE = 30055;
-
// Items
private static final int FOX_FUR = 1032;
private static final int FOX_FUR_YARN = 1033;
private static final int MAIDEN_DOLL = 1034;
-
// Reward
private static final int EARING = 113;
public Q154_SacrificeToTheSea()
{
super(154, "Sacrifice to the Sea");
-
registerQuestItems(FOX_FUR, FOX_FUR_YARN, MAIDEN_DOLL);
-
addStartNpc(ROCKSWELL);
addTalkId(ROCKSWELL, CRISTEL, ROLFE);
-
addKillId(20481, 20544, 20545); // Following Keltirs can be found near Talking Island.
}
@@ -61,9 +56,7 @@ public class Q154_SacrificeToTheSea extends Quest
if (event.equals("30312-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -82,14 +75,17 @@ public class Q154_SacrificeToTheSea extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 2) ? "30312-02.htm" : "30312-03.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ROCKSWELL:
+ {
if (cond == 1)
{
htmltext = "30312-05.htm";
@@ -112,8 +108,9 @@ public class Q154_SacrificeToTheSea extends Quest
st.exitQuest(false);
}
break;
-
+ }
case CRISTEL:
+ {
if (cond == 1)
{
htmltext = (st.hasQuestItems(FOX_FUR)) ? "30051-01.htm" : "30051-01a.htm";
@@ -121,7 +118,7 @@ public class Q154_SacrificeToTheSea extends Quest
else if (cond == 2)
{
htmltext = "30051-02.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FOX_FUR, -1);
st.giveItems(FOX_FUR_YARN, 1);
@@ -135,8 +132,9 @@ public class Q154_SacrificeToTheSea extends Quest
htmltext = "30051-04.htm";
}
break;
-
+ }
case ROLFE:
+ {
if (cond < 3)
{
htmltext = "30055-03.htm";
@@ -144,7 +142,7 @@ public class Q154_SacrificeToTheSea extends Quest
else if (cond == 3)
{
htmltext = "30055-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FOX_FUR_YARN, 1);
st.giveItems(MAIDEN_DOLL, 1);
@@ -154,12 +152,15 @@ public class Q154_SacrificeToTheSea extends Quest
htmltext = "30055-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -168,7 +169,7 @@ public class Q154_SacrificeToTheSea extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -176,7 +177,7 @@ public class Q154_SacrificeToTheSea extends Quest
if (st.dropItems(FOX_FUR, 1, 10, 400000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q155_FindSirWindawood/Q155_FindSirWindawood.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q155_FindSirWindawood/Q155_FindSirWindawood.java
index c7d1d293a0..15577464b1 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q155_FindSirWindawood/Q155_FindSirWindawood.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q155_FindSirWindawood/Q155_FindSirWindawood.java
@@ -24,20 +24,17 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q155_FindSirWindawood extends Quest
{
+ // NPCs
+ private static final int ABELLOS = 30042;
+ private static final int WINDAWOOD = 30311;
// Items
private static final int OFFICIAL_LETTER = 1019;
private static final int HASTE_POTION = 734;
- // NPCs
- private static final int ABELLOS = 30042;
- private static final int WINDAWOOD = 30311;
-
public Q155_FindSirWindawood()
{
super(155, "Find Sir Windawood");
-
registerQuestItems(OFFICIAL_LETTER);
-
addStartNpc(ABELLOS);
addTalkId(WINDAWOOD, ABELLOS);
}
@@ -54,9 +51,7 @@ public class Q155_FindSirWindawood extends Quest
if (event.equals("30042-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(OFFICIAL_LETTER, 1);
}
@@ -76,17 +71,21 @@ public class Q155_FindSirWindawood extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 3) ? "30042-01a.htm" : "30042-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case ABELLOS:
+ {
htmltext = "30042-03.htm";
break;
-
+ }
case WINDAWOOD:
+ {
if (st.hasQuestItems(OFFICIAL_LETTER))
{
htmltext = "30311-01.htm";
@@ -96,12 +95,15 @@ public class Q155_FindSirWindawood extends Quest
st.exitQuest(false);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q156_MillenniumLove/Q156_MillenniumLove.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q156_MillenniumLove/Q156_MillenniumLove.java
index 562d2196e6..2aae7b0bfd 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q156_MillenniumLove/Q156_MillenniumLove.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q156_MillenniumLove/Q156_MillenniumLove.java
@@ -24,20 +24,17 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q156_MillenniumLove extends Quest
{
+ // NPCs
+ private static final int LILITH = 30368;
+ private static final int BAENEDES = 30369;
// Items
private static final int LILITH_LETTER = 1022;
private static final int THEON_DIARY = 1023;
- // NPCs
- private static final int LILITH = 30368;
- private static final int BAENEDES = 30369;
-
public Q156_MillenniumLove()
{
super(156, "Millennium Love");
-
registerQuestItems(LILITH_LETTER, THEON_DIARY);
-
addStartNpc(LILITH);
addTalkId(LILITH, BAENEDES);
}
@@ -52,26 +49,30 @@ public class Q156_MillenniumLove extends Quest
return htmltext;
}
- if (event.equals("30368-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LILITH_LETTER, 1);
- }
- else if (event.equals("30369-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LILITH_LETTER, 1);
- st.giveItems(THEON_DIARY, 1);
- }
- else if (event.equals("30369-03.htm"))
- {
- st.takeItems(LILITH_LETTER, 1);
- st.rewardExpAndSp(3000, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30368-04.htm":
+ {
+ st.startQuest();
+ st.giveItems(LILITH_LETTER, 1);
+ break;
+ }
+ case "30369-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LILITH_LETTER, 1);
+ st.giveItems(THEON_DIARY, 1);
+ break;
+ }
+ case "30369-03.htm":
+ {
+ st.takeItems(LILITH_LETTER, 1);
+ st.rewardExpAndSp(3000, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -90,13 +91,16 @@ public class Q156_MillenniumLove extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30368-00.htm" : "30368-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case LILITH:
+ {
if (st.hasQuestItems(LILITH_LETTER))
{
htmltext = "30368-05.htm";
@@ -111,8 +115,9 @@ public class Q156_MillenniumLove extends Quest
st.exitQuest(false);
}
break;
-
+ }
case BAENEDES:
+ {
if (st.hasQuestItems(LILITH_LETTER))
{
htmltext = "30369-01.htm";
@@ -122,12 +127,15 @@ public class Q156_MillenniumLove extends Quest
htmltext = "30369-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q157_RecoverSmuggledGoods/Q157_RecoverSmuggledGoods.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q157_RecoverSmuggledGoods/Q157_RecoverSmuggledGoods.java
index 1ce5911bb4..19d0ad82e1 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q157_RecoverSmuggledGoods/Q157_RecoverSmuggledGoods.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q157_RecoverSmuggledGoods/Q157_RecoverSmuggledGoods.java
@@ -26,19 +26,15 @@ public class Q157_RecoverSmuggledGoods extends Quest
{
// Item
private static final int ADAMANTITE_ORE = 1024;
-
// Reward
private static final int BUCKLER = 20;
public Q157_RecoverSmuggledGoods()
{
super(157, "Recover Smuggled Goods");
-
registerQuestItems(ADAMANTITE_ORE);
-
addStartNpc(30005); // Wilford
addTalkId(30005);
-
addKillId(20121); // Toad
}
@@ -54,9 +50,7 @@ public class Q157_RecoverSmuggledGoods extends Quest
if (event.equals("30005-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -75,11 +69,13 @@ public class Q157_RecoverSmuggledGoods extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 5) ? "30005-02.htm" : "30005-03.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30005-06.htm";
@@ -93,10 +89,12 @@ public class Q157_RecoverSmuggledGoods extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -104,7 +102,7 @@ public class Q157_RecoverSmuggledGoods extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -112,7 +110,7 @@ public class Q157_RecoverSmuggledGoods extends Quest
if (st.dropItems(ADAMANTITE_ORE, 1, 20, 400000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q158_SeedOfEvil/Q158_SeedOfEvil.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q158_SeedOfEvil/Q158_SeedOfEvil.java
index 9854896c87..e8e4864534 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q158_SeedOfEvil/Q158_SeedOfEvil.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q158_SeedOfEvil/Q158_SeedOfEvil.java
@@ -26,19 +26,15 @@ public class Q158_SeedOfEvil extends Quest
{
// Item
private static final int CLAY_TABLET = 1025;
-
// Reward
private static final int ENCHANT_ARMOR_D = 956;
public Q158_SeedOfEvil()
{
super(158, "Seed of Evil");
-
registerQuestItems(CLAY_TABLET);
-
addStartNpc(30031); // Biotin
addTalkId(30031);
-
addKillId(27016); // Nerkas
}
@@ -54,9 +50,7 @@ public class Q158_SeedOfEvil extends Quest
if (event.equals("30031-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -75,10 +69,12 @@ public class Q158_SeedOfEvil extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 21) ? "30031-02.htm" : "30031-03.htm";
break;
-
+ }
case State.STARTED:
+ {
if (!st.hasQuestItems(CLAY_TABLET))
{
htmltext = "30031-05.htm";
@@ -92,10 +88,12 @@ public class Q158_SeedOfEvil extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -104,13 +102,13 @@ public class Q158_SeedOfEvil extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
}
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(CLAY_TABLET, 1);
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q159_ProtectTheWaterSource/Q159_ProtectTheWaterSource.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q159_ProtectTheWaterSource/Q159_ProtectTheWaterSource.java
index 7a6ffaa31d..2fb36e875a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q159_ProtectTheWaterSource/Q159_ProtectTheWaterSource.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q159_ProtectTheWaterSource/Q159_ProtectTheWaterSource.java
@@ -33,12 +33,9 @@ public class Q159_ProtectTheWaterSource extends Quest
public Q159_ProtectTheWaterSource()
{
super(159, "Protect the Water Source");
-
registerQuestItems(PLAGUE_DUST, HYACINTH_CHARM_1, HYACINTH_CHARM_2);
-
addStartNpc(30154); // Asterios
addTalkId(30154);
-
addKillId(27017); // Plague Zombie
}
@@ -54,9 +51,7 @@ public class Q159_ProtectTheWaterSource extends Quest
if (event.equals("30154-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(HYACINTH_CHARM_1, 1);
}
@@ -76,6 +71,7 @@ public class Q159_ProtectTheWaterSource extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30154-00.htm";
@@ -89,9 +85,10 @@ public class Q159_ProtectTheWaterSource extends Quest
htmltext = "30154-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30154-05.htm";
@@ -99,7 +96,7 @@ public class Q159_ProtectTheWaterSource extends Quest
else if (cond == 2)
{
htmltext = "30154-06.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PLAGUE_DUST, -1);
st.takeItems(HYACINTH_CHARM_1, 1);
@@ -119,10 +116,12 @@ public class Q159_ProtectTheWaterSource extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -137,13 +136,13 @@ public class Q159_ProtectTheWaterSource extends Quest
return null;
}
- if ((st.getInt("cond") == 1) && st.dropItems(PLAGUE_DUST, 1, 1, 400000))
+ if (st.isCond(1) && st.dropItems(PLAGUE_DUST, 1, 1, 400000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
- else if ((st.getInt("cond") == 3) && st.dropItems(PLAGUE_DUST, 1, 5, 400000))
+ else if (st.isCond(2) && st.dropItems(PLAGUE_DUST, 1, 5, 400000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q160_NerupasRequest/Q160_NerupasRequest.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q160_NerupasRequest/Q160_NerupasRequest.java
index 1f7a97aeb2..dc66232ac7 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q160_NerupasRequest/Q160_NerupasRequest.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q160_NerupasRequest/Q160_NerupasRequest.java
@@ -25,27 +25,23 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q160_NerupasRequest extends Quest
{
- // Items
- private static final int SILVERY_SPIDERSILK = 1026;
- private static final int UNOREN_RECEIPT = 1027;
- private static final int CREAMEES_TICKET = 1028;
- private static final int NIGHTSHADE_LEAF = 1029;
-
- // Reward
- private static final int LESSER_HEALING_POTION = 1060;
-
// NPCs
private static final int NERUPA = 30370;
private static final int UNOREN = 30147;
private static final int CREAMEES = 30149;
private static final int JULIA = 30152;
+ // Items
+ private static final int SILVERY_SPIDERSILK = 1026;
+ private static final int UNOREN_RECEIPT = 1027;
+ private static final int CREAMEES_TICKET = 1028;
+ private static final int NIGHTSHADE_LEAF = 1029;
+ // Reward
+ private static final int LESSER_HEALING_POTION = 1060;
public Q160_NerupasRequest()
{
super(160, "Nerupa's Request");
-
registerQuestItems(SILVERY_SPIDERSILK, UNOREN_RECEIPT, CREAMEES_TICKET, NIGHTSHADE_LEAF);
-
addStartNpc(NERUPA);
addTalkId(NERUPA, UNOREN, CREAMEES, JULIA);
}
@@ -62,9 +58,7 @@ public class Q160_NerupasRequest extends Quest
if (event.equals("30370-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(SILVERY_SPIDERSILK, 1);
}
@@ -84,6 +78,7 @@ public class Q160_NerupasRequest extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30370-00.htm";
@@ -97,12 +92,14 @@ public class Q160_NerupasRequest extends Quest
htmltext = "30370-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NERUPA:
+ {
if (cond < 4)
{
htmltext = "30370-05.htm";
@@ -117,12 +114,13 @@ public class Q160_NerupasRequest extends Quest
st.exitQuest(false);
}
break;
-
+ }
case UNOREN:
+ {
if (cond == 1)
{
htmltext = "30147-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SILVERY_SPIDERSILK, 1);
st.giveItems(UNOREN_RECEIPT, 1);
@@ -136,12 +134,13 @@ public class Q160_NerupasRequest extends Quest
htmltext = "30147-03.htm";
}
break;
-
+ }
case CREAMEES:
+ {
if (cond == 2)
{
htmltext = "30149-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(UNOREN_RECEIPT, 1);
st.giveItems(CREAMEES_TICKET, 1);
@@ -155,12 +154,13 @@ public class Q160_NerupasRequest extends Quest
htmltext = "30149-03.htm";
}
break;
-
+ }
case JULIA:
+ {
if (cond == 3)
{
htmltext = "30152-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CREAMEES_TICKET, 1);
st.giveItems(NIGHTSHADE_LEAF, 1);
@@ -170,12 +170,15 @@ public class Q160_NerupasRequest extends Quest
htmltext = "30152-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q161_FruitOfTheMotherTree/Q161_FruitOfTheMotherTree.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q161_FruitOfTheMotherTree/Q161_FruitOfTheMotherTree.java
index 342366e225..b267153ac9 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q161_FruitOfTheMotherTree/Q161_FruitOfTheMotherTree.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q161_FruitOfTheMotherTree/Q161_FruitOfTheMotherTree.java
@@ -28,7 +28,6 @@ public class Q161_FruitOfTheMotherTree extends Quest
// NPCs
private static final int ANDELLIA = 30362;
private static final int THALIA = 30371;
-
// Items
private static final int ANDELLIA_LETTER = 1036;
private static final int MOTHERTREE_FRUIT = 1037;
@@ -36,9 +35,7 @@ public class Q161_FruitOfTheMotherTree extends Quest
public Q161_FruitOfTheMotherTree()
{
super(161, "Fruit of the Mothertree");
-
registerQuestItems(ANDELLIA_LETTER, MOTHERTREE_FRUIT);
-
addStartNpc(ANDELLIA);
addTalkId(ANDELLIA, THALIA);
}
@@ -55,9 +52,7 @@ public class Q161_FruitOfTheMotherTree extends Quest
if (event.equals("30362-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(ANDELLIA_LETTER, 1);
}
@@ -77,6 +72,7 @@ public class Q161_FruitOfTheMotherTree extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30362-00.htm";
@@ -90,12 +86,14 @@ public class Q161_FruitOfTheMotherTree extends Quest
htmltext = "30362-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ANDELLIA:
+ {
if (cond == 1)
{
htmltext = "30362-05.htm";
@@ -110,12 +108,13 @@ public class Q161_FruitOfTheMotherTree extends Quest
st.exitQuest(false);
}
break;
-
+ }
case THALIA:
+ {
if (cond == 1)
{
htmltext = "30371-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ANDELLIA_LETTER, 1);
st.giveItems(MOTHERTREE_FRUIT, 1);
@@ -125,12 +124,15 @@ public class Q161_FruitOfTheMotherTree extends Quest
htmltext = "30371-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q162_CurseOfTheUndergroundFortress/Q162_CurseOfTheUndergroundFortress.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q162_CurseOfTheUndergroundFortress/Q162_CurseOfTheUndergroundFortress.java
index 363474b94e..fc771663fc 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q162_CurseOfTheUndergroundFortress/Q162_CurseOfTheUndergroundFortress.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q162_CurseOfTheUndergroundFortress/Q162_CurseOfTheUndergroundFortress.java
@@ -35,14 +35,11 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
private static final int DUNGEON_SKELETON_ARCHER = 20463;
private static final int DUNGEON_SKELETON = 20464;
private static final int DREAD_SOLDIER = 20504;
-
// Items
private static final int BONE_FRAGMENT = 1158;
private static final int ELF_SKULL = 1159;
-
// Rewards
private static final int BONE_SHIELD = 625;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -58,12 +55,9 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
public Q162_CurseOfTheUndergroundFortress()
{
super(162, "Curse of the Underground Fortress");
-
registerQuestItems(BONE_FRAGMENT, ELF_SKULL);
-
addStartNpc(30147); // Unoren
addTalkId(30147);
-
addKillId(SHADE_HORROR, DARK_TERROR, MIST_TERROR, DUNGEON_SKELETON_ARCHER, DUNGEON_SKELETON, DREAD_SOLDIER);
}
@@ -79,9 +73,7 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
if (event.equals("30147-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -100,6 +92,7 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() == Race.DARK_ELF)
{
htmltext = "30147-00.htm";
@@ -113,9 +106,10 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
htmltext = "30147-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30147-05.htm";
@@ -131,10 +125,12 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -143,33 +139,35 @@ public class Q162_CurseOfTheUndergroundFortress extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
}
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case DUNGEON_SKELETON:
case DUNGEON_SKELETON_ARCHER:
case DREAD_SOLDIER:
+ {
if (st.dropItems(BONE_FRAGMENT, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(ELF_SKULL) >= 3))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case SHADE_HORROR:
case DARK_TERROR:
case MIST_TERROR:
+ {
if (st.dropItems(ELF_SKULL, 1, 3, CHANCES.get(npcId)) && (st.getQuestItemsCount(BONE_FRAGMENT) >= 10))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q163_LegacyOfThePoet/Q163_LegacyOfThePoet.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q163_LegacyOfThePoet/Q163_LegacyOfThePoet.java
index ff7dcc1683..ec7888a762 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q163_LegacyOfThePoet/Q163_LegacyOfThePoet.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q163_LegacyOfThePoet/Q163_LegacyOfThePoet.java
@@ -27,7 +27,6 @@ public class Q163_LegacyOfThePoet extends Quest
{
// NPC
private static final int STARDEN = 30220;
-
// Items
private static final int[] RUMIELS_POEMS =
{
@@ -36,45 +35,23 @@ public class Q163_LegacyOfThePoet extends Quest
1040,
1041
};
-
// Droplist
private static final int[][] DROPLIST =
{
- {
- RUMIELS_POEMS[0],
- 1,
- 1,
- 100000
- },
- {
- RUMIELS_POEMS[1],
- 1,
- 1,
- 200000
- },
- {
- RUMIELS_POEMS[2],
- 1,
- 1,
- 200000
- },
- {
- RUMIELS_POEMS[3],
- 1,
- 1,
- 400000
- }
+ // @formatter:off
+ {RUMIELS_POEMS[0], 1, 1, 100000},
+ {RUMIELS_POEMS[1], 1, 1, 200000},
+ {RUMIELS_POEMS[2], 1, 1, 200000},
+ {RUMIELS_POEMS[3], 1, 1, 400000}
+ // @formatter:on
};
public Q163_LegacyOfThePoet()
{
super(163, "Legacy of the Poet");
-
registerQuestItems(RUMIELS_POEMS);
-
addStartNpc(STARDEN);
addTalkId(STARDEN);
-
addKillId(20372, 20373);
}
@@ -90,9 +67,7 @@ public class Q163_LegacyOfThePoet extends Quest
if (event.equals("30220-07.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -111,6 +86,7 @@ public class Q163_LegacyOfThePoet extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() == Race.DARK_ELF)
{
htmltext = "30220-00.htm";
@@ -124,17 +100,16 @@ public class Q163_LegacyOfThePoet extends Quest
htmltext = "30220-03.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 2)
+ {
+ if (st.isCond(2))
{
htmltext = "30220-09.htm";
-
for (int poem : RUMIELS_POEMS)
{
st.takeItems(poem, -1);
}
-
st.rewardItems(57, 13890);
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(false);
@@ -144,10 +119,12 @@ public class Q163_LegacyOfThePoet extends Quest
htmltext = "30220-08.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -156,7 +133,7 @@ public class Q163_LegacyOfThePoet extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -164,7 +141,7 @@ public class Q163_LegacyOfThePoet extends Quest
if (st.dropMultipleItems(DROPLIST))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q164_BloodFiend/Q164_BloodFiend.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q164_BloodFiend/Q164_BloodFiend.java
index 25b024b909..cbe83a4750 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q164_BloodFiend/Q164_BloodFiend.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q164_BloodFiend/Q164_BloodFiend.java
@@ -31,12 +31,9 @@ public class Q164_BloodFiend extends Quest
public Q164_BloodFiend()
{
super(164, "Blood Fiend");
-
registerQuestItems(KIRUNAK_SKULL);
-
addStartNpc(30149);
addTalkId(30149);
-
addKillId(27021);
}
@@ -52,9 +49,7 @@ public class Q164_BloodFiend extends Quest
if (event.equals("30149-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -73,6 +68,7 @@ public class Q164_BloodFiend extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() == Race.DARK_ELF)
{
htmltext = "30149-00.htm";
@@ -86,8 +82,9 @@ public class Q164_BloodFiend extends Quest
htmltext = "30149-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (st.hasQuestItems(KIRUNAK_SKULL))
{
htmltext = "30149-06.htm";
@@ -101,10 +98,12 @@ public class Q164_BloodFiend extends Quest
htmltext = "30149-05.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -113,13 +112,13 @@ public class Q164_BloodFiend extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
}
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KIRUNAK_SKULL, 1);
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q165_ShilensHunt/Q165_ShilensHunt.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q165_ShilensHunt/Q165_ShilensHunt.java
index 19960206ce..ebd8e6d8fb 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q165_ShilensHunt/Q165_ShilensHunt.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q165_ShilensHunt/Q165_ShilensHunt.java
@@ -33,11 +33,9 @@ public class Q165_ShilensHunt extends Quest
private static final int YOUNG_BROWN_KELTIR = 20529;
private static final int BROWN_KELTIR = 20532;
private static final int ELDER_BROWN_KELTIR = 20536;
-
// Items
private static final int DARK_BEZOAR = 1160;
private static final int LESSER_HEALING_POTION = 1060;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -51,12 +49,9 @@ public class Q165_ShilensHunt extends Quest
public Q165_ShilensHunt()
{
super(165, "Shilen's Hunt");
-
registerQuestItems(DARK_BEZOAR);
-
addStartNpc(30348); // Nelsya
addTalkId(30348);
-
addKillId(ASHEN_WOLF, YOUNG_BROWN_KELTIR, BROWN_KELTIR, ELDER_BROWN_KELTIR);
}
@@ -72,9 +67,7 @@ public class Q165_ShilensHunt extends Quest
if (event.equals("30348-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -93,6 +86,7 @@ public class Q165_ShilensHunt extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30348-00.htm";
@@ -106,8 +100,9 @@ public class Q165_ShilensHunt extends Quest
htmltext = "30348-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(DARK_BEZOAR) >= 13)
{
htmltext = "30348-05.htm";
@@ -122,10 +117,12 @@ public class Q165_ShilensHunt extends Quest
htmltext = "30348-04.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -134,7 +131,7 @@ public class Q165_ShilensHunt extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -142,7 +139,7 @@ public class Q165_ShilensHunt extends Quest
if (st.dropItems(DARK_BEZOAR, 1, 13, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q166_MassOfDarkness/Q166_MassOfDarkness.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q166_MassOfDarkness/Q166_MassOfDarkness.java
index af246dd166..ba4c593f86 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q166_MassOfDarkness/Q166_MassOfDarkness.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q166_MassOfDarkness/Q166_MassOfDarkness.java
@@ -30,7 +30,6 @@ public class Q166_MassOfDarkness extends Quest
private static final int IRIA = 30135;
private static final int DORANKUS = 30139;
private static final int TRUDY = 30143;
-
// Items
private static final int UNDRIAS_LETTER = 1088;
private static final int CEREMONIAL_DAGGER = 1089;
@@ -40,9 +39,7 @@ public class Q166_MassOfDarkness extends Quest
public Q166_MassOfDarkness()
{
super(166, "Mass of Darkness");
-
registerQuestItems(UNDRIAS_LETTER, CEREMONIAL_DAGGER, DREVIANT_WINE, GARMIEL_SCRIPTURE);
-
addStartNpc(UNDRIAS);
addTalkId(UNDRIAS, IRIA, DORANKUS, TRUDY);
}
@@ -59,9 +56,7 @@ public class Q166_MassOfDarkness extends Quest
if (event.equals("30130-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(UNDRIAS_LETTER, 1);
}
@@ -81,6 +76,7 @@ public class Q166_MassOfDarkness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30130-00.htm";
@@ -94,12 +90,14 @@ public class Q166_MassOfDarkness extends Quest
htmltext = "30130-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case UNDRIAS:
+ {
if (cond == 1)
{
htmltext = "30130-05.htm";
@@ -117,15 +115,16 @@ public class Q166_MassOfDarkness extends Quest
st.exitQuest(false);
}
break;
-
+ }
case IRIA:
+ {
if ((cond == 1) && !st.hasQuestItems(CEREMONIAL_DAGGER))
{
htmltext = "30135-01.htm";
st.giveItems(CEREMONIAL_DAGGER, 1);
if (st.hasQuestItems(DREVIANT_WINE, GARMIEL_SCRIPTURE))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -138,15 +137,16 @@ public class Q166_MassOfDarkness extends Quest
htmltext = "30135-02.htm";
}
break;
-
+ }
case DORANKUS:
+ {
if ((cond == 1) && !st.hasQuestItems(DREVIANT_WINE))
{
htmltext = "30139-01.htm";
st.giveItems(DREVIANT_WINE, 1);
if (st.hasQuestItems(CEREMONIAL_DAGGER, GARMIEL_SCRIPTURE))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -159,15 +159,16 @@ public class Q166_MassOfDarkness extends Quest
htmltext = "30139-02.htm";
}
break;
-
+ }
case TRUDY:
+ {
if ((cond == 1) && !st.hasQuestItems(GARMIEL_SCRIPTURE))
{
htmltext = "30143-01.htm";
st.giveItems(GARMIEL_SCRIPTURE, 1);
if (st.hasQuestItems(CEREMONIAL_DAGGER, DREVIANT_WINE))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -180,12 +181,15 @@ public class Q166_MassOfDarkness extends Quest
htmltext = "30143-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q167_DwarvenKinship/Q167_DwarvenKinship.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q167_DwarvenKinship/Q167_DwarvenKinship.java
index 7fedfd46d6..846e76fb98 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q167_DwarvenKinship/Q167_DwarvenKinship.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q167_DwarvenKinship/Q167_DwarvenKinship.java
@@ -24,21 +24,18 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q167_DwarvenKinship extends Quest
{
- // Items
- private static final int CARLON_LETTER = 1076;
- private static final int NORMAN_LETTER = 1106;
-
// NPCs
private static final int CARLON = 30350;
private static final int NORMAN = 30210;
private static final int HAPROCK = 30255;
+ // Items
+ private static final int CARLON_LETTER = 1076;
+ private static final int NORMAN_LETTER = 1106;
public Q167_DwarvenKinship()
{
super(167, "Dwarven Kinship");
-
registerQuestItems(CARLON_LETTER, NORMAN_LETTER);
-
addStartNpc(CARLON);
addTalkId(CARLON, HAPROCK, NORMAN);
}
@@ -53,33 +50,38 @@ public class Q167_DwarvenKinship extends Quest
return htmltext;
}
- if (event.equals("30350-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(CARLON_LETTER, 1);
- }
- else if (event.equals("30255-03.htm"))
- {
- st.set("cond", "2");
- st.takeItems(CARLON_LETTER, 1);
- st.giveItems(NORMAN_LETTER, 1);
- st.rewardItems(57, 2000);
- }
- else if (event.equals("30255-04.htm"))
- {
- st.takeItems(CARLON_LETTER, 1);
- st.rewardItems(57, 3000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else if (event.equals("30210-02.htm"))
- {
- st.takeItems(NORMAN_LETTER, 1);
- st.rewardItems(57, 20000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "30350-04.htm":
+ {
+ st.startQuest();
+ st.giveItems(CARLON_LETTER, 1);
+ break;
+ }
+ case "30255-03.htm":
+ {
+ st.setCond(2);
+ st.takeItems(CARLON_LETTER, 1);
+ st.giveItems(NORMAN_LETTER, 1);
+ st.rewardItems(57, 2000);
+ break;
+ }
+ case "30255-04.htm":
+ {
+ st.takeItems(CARLON_LETTER, 1);
+ st.rewardItems(57, 3000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "30210-02.htm":
+ {
+ st.takeItems(NORMAN_LETTER, 1);
+ st.rewardItems(57, 20000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -98,21 +100,25 @@ public class Q167_DwarvenKinship extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30350-02.htm" : "30350-03.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case CARLON:
+ {
if (cond == 1)
{
htmltext = "30350-05.htm";
}
break;
-
+ }
case HAPROCK:
+ {
if (cond == 1)
{
htmltext = "30255-01.htm";
@@ -122,19 +128,23 @@ public class Q167_DwarvenKinship extends Quest
htmltext = "30255-05.htm";
}
break;
-
+ }
case NORMAN:
+ {
if (cond == 2)
{
htmltext = "30210-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q168_DeliverSupplies/Q168_DeliverSupplies.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q168_DeliverSupplies/Q168_DeliverSupplies.java
index b17bac0bed..7a44b024eb 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q168_DeliverSupplies/Q168_DeliverSupplies.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q168_DeliverSupplies/Q168_DeliverSupplies.java
@@ -25,6 +25,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q168_DeliverSupplies extends Quest
{
+ // NPCs
+ private static final int JENNA = 30349;
+ private static final int ROSELYN = 30355;
+ private static final int KRISTIN = 30357;
+ private static final int HARANT = 30360;
// Items
private static final int JENNA_LETTER = 1153;
private static final int SENTRY_BLADE_1 = 1154;
@@ -32,18 +37,10 @@ public class Q168_DeliverSupplies extends Quest
private static final int SENTRY_BLADE_3 = 1156;
private static final int OLD_BRONZE_SWORD = 1157;
- // NPCs
- private static final int JENNA = 30349;
- private static final int ROSELYN = 30355;
- private static final int KRISTIN = 30357;
- private static final int HARANT = 30360;
-
public Q168_DeliverSupplies()
{
super(168, "Deliver Supplies");
-
registerQuestItems(JENNA_LETTER, SENTRY_BLADE_1, SENTRY_BLADE_2, SENTRY_BLADE_3, OLD_BRONZE_SWORD);
-
addStartNpc(JENNA);
addTalkId(JENNA, ROSELYN, KRISTIN, HARANT);
}
@@ -60,9 +57,7 @@ public class Q168_DeliverSupplies extends Quest
if (event.equals("30349-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(JENNA_LETTER, 1);
}
@@ -82,6 +77,7 @@ public class Q168_DeliverSupplies extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30349-00.htm";
@@ -95,12 +91,14 @@ public class Q168_DeliverSupplies extends Quest
htmltext = "30349-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case JENNA:
+ {
if (cond == 1)
{
htmltext = "30349-04.htm";
@@ -108,7 +106,7 @@ public class Q168_DeliverSupplies extends Quest
else if (cond == 2)
{
htmltext = "30349-05.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SENTRY_BLADE_1, 1);
}
@@ -125,12 +123,13 @@ public class Q168_DeliverSupplies extends Quest
st.exitQuest(false);
}
break;
-
+ }
case HARANT:
+ {
if (cond == 1)
{
htmltext = "30360-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(JENNA_LETTER, 1);
st.giveItems(SENTRY_BLADE_1, 1);
@@ -142,8 +141,9 @@ public class Q168_DeliverSupplies extends Quest
htmltext = "30360-02.htm";
}
break;
-
+ }
case ROSELYN:
+ {
if (cond == 3)
{
if (st.hasQuestItems(SENTRY_BLADE_2))
@@ -153,7 +153,7 @@ public class Q168_DeliverSupplies extends Quest
st.giveItems(OLD_BRONZE_SWORD, 1);
if (st.getQuestItemsCount(OLD_BRONZE_SWORD) == 2)
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -167,8 +167,9 @@ public class Q168_DeliverSupplies extends Quest
htmltext = "30355-02.htm";
}
break;
-
+ }
case KRISTIN:
+ {
if (cond == 3)
{
if (st.hasQuestItems(SENTRY_BLADE_3))
@@ -178,7 +179,7 @@ public class Q168_DeliverSupplies extends Quest
st.giveItems(OLD_BRONZE_SWORD, 1);
if (st.getQuestItemsCount(OLD_BRONZE_SWORD) == 2)
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -192,12 +193,15 @@ public class Q168_DeliverSupplies extends Quest
htmltext = "30357-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q169_OffspringOfNightmares/Q169_OffspringOfNightmares.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q169_OffspringOfNightmares/Q169_OffspringOfNightmares.java
index 4cd5825fd5..afecc85d74 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q169_OffspringOfNightmares/Q169_OffspringOfNightmares.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q169_OffspringOfNightmares/Q169_OffspringOfNightmares.java
@@ -33,12 +33,9 @@ public class Q169_OffspringOfNightmares extends Quest
public Q169_OffspringOfNightmares()
{
super(169, "Offspring of Nightmares");
-
registerQuestItems(CRACKED_SKULL, PERFECT_SKULL);
-
addStartNpc(30145); // Vlasty
addTalkId(30145);
-
addKillId(20105, 20025);
}
@@ -54,9 +51,7 @@ public class Q169_OffspringOfNightmares extends Quest
if (event.equals("30145-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30145-08.htm"))
{
@@ -85,6 +80,7 @@ public class Q169_OffspringOfNightmares extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30145-00.htm";
@@ -98,9 +94,10 @@ public class Q169_OffspringOfNightmares extends Quest
htmltext = "30145-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
if (st.hasQuestItems(CRACKED_SKULL))
@@ -117,10 +114,12 @@ public class Q169_OffspringOfNightmares extends Quest
htmltext = "30145-07.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -135,9 +134,9 @@ public class Q169_OffspringOfNightmares extends Quest
return null;
}
- if ((st.getInt("cond") == 1) && st.dropItems(PERFECT_SKULL, 1, 1, 200000))
+ if (st.isCond(1) && st.dropItems(PERFECT_SKULL, 1, 1, 200000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
else
{
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q170_DangerousSeduction/Q170_DangerousSeduction.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q170_DangerousSeduction/Q170_DangerousSeduction.java
index a6a03d1cc5..69ff6d1356 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q170_DangerousSeduction/Q170_DangerousSeduction.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q170_DangerousSeduction/Q170_DangerousSeduction.java
@@ -31,12 +31,9 @@ public class Q170_DangerousSeduction extends Quest
public Q170_DangerousSeduction()
{
super(170, "Dangerous Seduction");
-
registerQuestItems(NIGHTMARE_CRYSTAL);
-
addStartNpc(30305); // Vellior
addTalkId(30305);
-
addKillId(27022); // Merkenis
}
@@ -52,9 +49,7 @@ public class Q170_DangerousSeduction extends Quest
if (event.equals("30305-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -73,6 +68,7 @@ public class Q170_DangerousSeduction extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30305-00.htm";
@@ -86,8 +82,9 @@ public class Q170_DangerousSeduction extends Quest
htmltext = "30305-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (st.hasQuestItems(NIGHTMARE_CRYSTAL))
{
htmltext = "30305-06.htm";
@@ -101,10 +98,12 @@ public class Q170_DangerousSeduction extends Quest
htmltext = "30305-05.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -113,13 +112,13 @@ public class Q170_DangerousSeduction extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
}
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(NIGHTMARE_CRYSTAL, 1);
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q171_ActsOfEvil/Q171_ActsOfEvil.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q171_ActsOfEvil/Q171_ActsOfEvil.java
index ac681b5c39..4016860bb8 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q171_ActsOfEvil/Q171_ActsOfEvil.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q171_ActsOfEvil/Q171_ActsOfEvil.java
@@ -28,6 +28,13 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q171_ActsOfEvil extends Quest
{
+ // NPCs
+ private static final int ALVAH = 30381;
+ private static final int ARODIN = 30207;
+ private static final int TYRA = 30420;
+ private static final int ROLENTO = 30437;
+ private static final int NETI = 30425;
+ private static final int BURAI = 30617;
// Items
private static final int BLADE_MOLD = 4239;
private static final int TYRA_BILL = 4240;
@@ -40,15 +47,6 @@ public class Q171_ActsOfEvil extends Quest
private static final int CERTIFICATE = 4247;
private static final int CARGO_BOX = 4248;
private static final int OL_MAHUM_HEAD = 4249;
-
- // NPCs
- private static final int ALVAH = 30381;
- private static final int ARODIN = 30207;
- private static final int TYRA = 30420;
- private static final int ROLENTO = 30437;
- private static final int NETI = 30425;
- private static final int BURAI = 30617;
-
// Turek Orcs drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -62,12 +60,9 @@ public class Q171_ActsOfEvil extends Quest
public Q171_ActsOfEvil()
{
super(171, "Acts of Evil");
-
registerQuestItems(BLADE_MOLD, TYRA_BILL, RANGER_REPORT_1, RANGER_REPORT_2, RANGER_REPORT_3, RANGER_REPORT_4, WEAPON_TRADE_CONTRACT, ATTACK_DIRECTIVES, CERTIFICATE, CARGO_BOX, OL_MAHUM_HEAD);
-
addStartNpc(ALVAH);
addTalkId(ALVAH, ARODIN, TYRA, ROLENTO, NETI, BURAI);
-
addKillId(20496, 20497, 20498, 20499, 20062, 20064, 20066, 20438);
}
@@ -81,42 +76,49 @@ public class Q171_ActsOfEvil extends Quest
return htmltext;
}
- if (event.equals("30381-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30207-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30381-04.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30381-07.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WEAPON_TRADE_CONTRACT, 1);
- }
- else if (event.equals("30437-03.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CARGO_BOX, 1);
- st.giveItems(CERTIFICATE, 1);
- }
- else if (event.equals("30617-04.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ATTACK_DIRECTIVES, 1);
- st.takeItems(CARGO_BOX, 1);
- st.takeItems(CERTIFICATE, 1);
+ case "30381-02.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30207-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30381-04.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30381-07.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WEAPON_TRADE_CONTRACT, 1);
+ break;
+ }
+ case "30437-03.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CARGO_BOX, 1);
+ st.giveItems(CERTIFICATE, 1);
+ break;
+ }
+ case "30617-04.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ATTACK_DIRECTIVES, 1);
+ st.takeItems(CARGO_BOX, 1);
+ st.takeItems(CERTIFICATE, 1);
+ break;
+ }
}
return htmltext;
@@ -135,14 +137,17 @@ public class Q171_ActsOfEvil extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 27) ? "30381-01a.htm" : "30381-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ALVAH:
+ {
if (cond < 4)
{
htmltext = "30381-02a.htm";
@@ -156,7 +161,7 @@ public class Q171_ActsOfEvil extends Quest
if (st.hasQuestItems(RANGER_REPORT_1, RANGER_REPORT_2, RANGER_REPORT_3, RANGER_REPORT_4))
{
htmltext = "30381-05.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RANGER_REPORT_1, 1);
st.takeItems(RANGER_REPORT_2, 1);
@@ -191,8 +196,9 @@ public class Q171_ActsOfEvil extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ARODIN:
+ {
if (cond == 1)
{
htmltext = "30207-01.htm";
@@ -206,7 +212,7 @@ public class Q171_ActsOfEvil extends Quest
if (st.hasQuestItems(TYRA_BILL))
{
htmltext = "30207-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TYRA_BILL, 1);
}
@@ -220,14 +226,15 @@ public class Q171_ActsOfEvil extends Quest
htmltext = "30207-03a.htm";
}
break;
-
+ }
case TYRA:
+ {
if (cond == 2)
{
if (st.getQuestItemsCount(BLADE_MOLD) >= 20)
{
htmltext = "30420-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BLADE_MOLD, -1);
st.giveItems(TYRA_BILL, 1);
@@ -246,12 +253,13 @@ public class Q171_ActsOfEvil extends Quest
htmltext = "30420-02.htm";
}
break;
-
+ }
case NETI:
+ {
if (cond == 7)
{
htmltext = "30425-01.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond > 7)
@@ -259,8 +267,9 @@ public class Q171_ActsOfEvil extends Quest
htmltext = "30425-02.htm";
}
break;
-
+ }
case ROLENTO:
+ {
if (cond == 8)
{
htmltext = "30437-01.htm";
@@ -270,8 +279,9 @@ public class Q171_ActsOfEvil extends Quest
htmltext = "30437-03a.htm";
}
break;
-
+ }
case BURAI:
+ {
if ((cond == 9) && st.hasQuestItems(CERTIFICATE, CARGO_BOX, ATTACK_DIRECTIVES))
{
htmltext = "30617-01.htm";
@@ -281,7 +291,7 @@ public class Q171_ActsOfEvil extends Quest
if (st.getQuestItemsCount(OL_MAHUM_HEAD) >= 30)
{
htmltext = "30617-05.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(OL_MAHUM_HEAD, -1);
st.rewardItems(57, 8000);
@@ -292,12 +302,15 @@ public class Q171_ActsOfEvil extends Quest
}
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -313,14 +326,14 @@ public class Q171_ActsOfEvil extends Quest
}
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case 20496:
case 20497:
case 20498:
case 20499:
- if ((st.getInt("cond") == 2) && !st.dropItems(BLADE_MOLD, 1, 20, CHANCES.get(npcId)))
+ {
+ if (st.isCond(2) && !st.dropItems(BLADE_MOLD, 1, 20, CHANCES.get(npcId)))
{
final int count = st.getQuestItemsCount(BLADE_MOLD);
if ((count == 5) || ((count >= 10) && (Rnd.get(100) < 25)))
@@ -329,10 +342,11 @@ public class Q171_ActsOfEvil extends Quest
}
}
break;
-
+ }
case 20062:
case 20064:
- if (st.getInt("cond") == 5)
+ {
+ if (st.isCond(5))
{
if (!st.hasQuestItems(RANGER_REPORT_1))
{
@@ -359,22 +373,25 @@ public class Q171_ActsOfEvil extends Quest
}
}
break;
-
+ }
case 20438:
- if ((st.getInt("cond") == 6) && (Rnd.get(100) < 10) && !st.hasQuestItems(WEAPON_TRADE_CONTRACT, ATTACK_DIRECTIVES))
+ {
+ if (st.isCond(6) && (Rnd.get(100) < 10) && !st.hasQuestItems(WEAPON_TRADE_CONTRACT, ATTACK_DIRECTIVES))
{
st.playSound(QuestState.SOUND_ITEMGET);
st.giveItems(WEAPON_TRADE_CONTRACT, 1);
st.giveItems(ATTACK_DIRECTIVES, 1);
}
break;
-
+ }
case 20066:
- if (st.getInt("cond") == 10)
+ {
+ if (st.isCond(10))
{
st.dropItems(OL_MAHUM_HEAD, 1, 30, 500000);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q211_TrialOfTheChallenger/Q211_TrialOfTheChallenger.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q211_TrialOfTheChallenger/Q211_TrialOfTheChallenger.java
index 690e85dfa3..6544e2b474 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q211_TrialOfTheChallenger/Q211_TrialOfTheChallenger.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q211_TrialOfTheChallenger/Q211_TrialOfTheChallenger.java
@@ -27,13 +27,23 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q211_TrialOfTheChallenger extends Quest
{
+ // NPCs
+ private static final int FILAUR = 30535;
+ private static final int KASH = 30644;
+ private static final int MARTIEN = 30645;
+ private static final int RALDO = 30646;
+ private static final int CHEST_OF_SHYSLASSYS = 30647;
+ // Monsters
+ private static final int SHYSLASSYS = 27110;
+ private static final int GORR = 27112;
+ private static final int BARAHAM = 27113;
+ private static final int SUCCUBUS_QUEEN = 27114;
// Items
private static final int LETTER_OF_KASH = 2628;
private static final int WATCHER_EYE_1 = 2629;
private static final int WATCHER_EYE_2 = 2630;
private static final int SCROLL_OF_SHYSLASSYS = 2631;
private static final int BROKEN_KEY = 2632;
-
// Rewards
private static final int ADENA = 57;
private static final int ELVEN_NECKLACE_BEADS = 1904;
@@ -47,28 +57,12 @@ public class Q211_TrialOfTheChallenger extends Quest
private static final int MARK_OF_CHALLENGER = 2627;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int FILAUR = 30535;
- private static final int KASH = 30644;
- private static final int MARTIEN = 30645;
- private static final int RALDO = 30646;
- private static final int CHEST_OF_SHYSLASSYS = 30647;
-
- // Monsters
- private static final int SHYSLASSYS = 27110;
- private static final int GORR = 27112;
- private static final int BARAHAM = 27113;
- private static final int SUCCUBUS_QUEEN = 27114;
-
public Q211_TrialOfTheChallenger()
{
super(211, "Trial of the Challenger");
-
registerQuestItems(LETTER_OF_KASH, WATCHER_EYE_1, WATCHER_EYE_2, SCROLL_OF_SHYSLASSYS, BROKEN_KEY);
-
addStartNpc(KASH);
addTalkId(FILAUR, KASH, MARTIEN, RALDO, CHEST_OF_SHYSLASSYS);
-
addKillId(SHYSLASSYS, GORR, BARAHAM, SUCCUBUS_QUEEN);
}
@@ -82,73 +76,74 @@ public class Q211_TrialOfTheChallenger extends Quest
return htmltext;
}
- // KASH
- if (event.equals("30644-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
- if (!player.getVariables().getBoolean("secondClassChange35", false))
+ case "30644-05.htm":
{
- htmltext = "30644-05a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange35", true);
- }
- }
- // MARTIEN
- else if (event.equals("30645-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_OF_KASH, 1);
- }
- // RALDO
- else if (event.equals("30646-04.htm") || event.equals("30646-06.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WATCHER_EYE_2, 1);
- }
- // CHEST_OF_SHYSLASSYS
- else if (event.equals("30647-04.htm"))
- {
- if (st.hasQuestItems(BROKEN_KEY))
- {
- if (Rnd.get(10) < 2)
+ st.startQuest();
+ if (!player.getVariables().getBoolean("secondClassChange35", false))
{
- htmltext = "30647-03.htm";
- st.playSound(QuestState.SOUND_JACKPOT);
- st.takeItems(BROKEN_KEY, 1);
- final int chance = Rnd.get(100);
- if (chance > 90)
+ htmltext = "30644-05a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange35", true);
+ }
+ break;
+ }
+ case "30645-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_OF_KASH, 1);
+ break;
+ }
+ case "30646-04.htm":
+ case "30646-06.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WATCHER_EYE_2, 1);
+ break;
+ }
+ case "30647-04.htm":
+ {
+ if (st.hasQuestItems(BROKEN_KEY))
+ {
+ if (Rnd.get(10) < 2)
{
- st.rewardItems(BRIGANDINE_GAUNTLETS_PATTERN, 1);
- st.rewardItems(IRON_BOOTS_DESIGN, 1);
- st.rewardItems(MANTICOR_SKIN_GAITERS_PATTERN, 1);
- st.rewardItems(MITHRIL_SCALE_GAITERS_MATERIAL, 1);
- st.rewardItems(RIP_GAUNTLETS_PATTERN, 1);
- }
- else if (chance > 70)
- {
- st.rewardItems(ELVEN_NECKLACE_BEADS, 1);
- st.rewardItems(TOME_OF_BLOOD_PAGE, 1);
- }
- else if (chance > 40)
- {
- st.rewardItems(WHITE_TUNIC_PATTERN, 1);
+ htmltext = "30647-03.htm";
+ st.playSound(QuestState.SOUND_JACKPOT);
+ st.takeItems(BROKEN_KEY, 1);
+ final int chance = Rnd.get(100);
+ if (chance > 90)
+ {
+ st.rewardItems(BRIGANDINE_GAUNTLETS_PATTERN, 1);
+ st.rewardItems(IRON_BOOTS_DESIGN, 1);
+ st.rewardItems(MANTICOR_SKIN_GAITERS_PATTERN, 1);
+ st.rewardItems(MITHRIL_SCALE_GAITERS_MATERIAL, 1);
+ st.rewardItems(RIP_GAUNTLETS_PATTERN, 1);
+ }
+ else if (chance > 70)
+ {
+ st.rewardItems(ELVEN_NECKLACE_BEADS, 1);
+ st.rewardItems(TOME_OF_BLOOD_PAGE, 1);
+ }
+ else if (chance > 40)
+ {
+ st.rewardItems(WHITE_TUNIC_PATTERN, 1);
+ }
+ else
+ {
+ st.rewardItems(IRON_BOOTS_DESIGN, 1);
+ }
}
else
{
- st.rewardItems(IRON_BOOTS_DESIGN, 1);
+ htmltext = "30647-02.htm";
+ st.takeItems(BROKEN_KEY, 1);
+ st.rewardItems(ADENA, Rnd.get(1, 1000));
}
}
- else
- {
- htmltext = "30647-02.htm";
- st.takeItems(BROKEN_KEY, 1);
- st.rewardItems(ADENA, Rnd.get(1, 1000));
- }
+ break;
}
}
@@ -168,6 +163,7 @@ public class Q211_TrialOfTheChallenger extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.WARRIOR) && (player.getClassId() != ClassId.ELVEN_KNIGHT) && (player.getClassId() != ClassId.PALUS_KNIGHT) && (player.getClassId() != ClassId.ORC_RAIDER) && (player.getClassId() != ClassId.ORC_MONK))
{
htmltext = "30644-02.htm";
@@ -181,12 +177,14 @@ public class Q211_TrialOfTheChallenger extends Quest
htmltext = "30644-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case KASH:
+ {
if (cond == 1)
{
htmltext = "30644-06.htm";
@@ -194,7 +192,7 @@ public class Q211_TrialOfTheChallenger extends Quest
else if (cond == 2)
{
htmltext = "30644-07.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SCROLL_OF_SHYSLASSYS, 1);
st.giveItems(LETTER_OF_KASH, 1);
@@ -208,12 +206,14 @@ public class Q211_TrialOfTheChallenger extends Quest
htmltext = "30644-09.htm";
}
break;
-
+ }
case CHEST_OF_SHYSLASSYS:
+ {
htmltext = "30647-01.htm";
break;
-
+ }
case MARTIEN:
+ {
if (cond == 3)
{
htmltext = "30645-01.htm";
@@ -225,7 +225,7 @@ public class Q211_TrialOfTheChallenger extends Quest
else if (cond == 5)
{
htmltext = "30645-04.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(WATCHER_EYE_1, 1);
}
@@ -242,8 +242,9 @@ public class Q211_TrialOfTheChallenger extends Quest
htmltext = "30645-06.htm";
}
break;
-
+ }
case RALDO:
+ {
if (cond == 7)
{
htmltext = "30646-01.htm";
@@ -263,14 +264,15 @@ public class Q211_TrialOfTheChallenger extends Quest
st.exitQuest(false);
}
break;
-
+ }
case FILAUR:
+ {
if (cond == 8)
{
if (player.getLevel() >= 36)
{
htmltext = "30535-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -288,12 +290,15 @@ public class Q211_TrialOfTheChallenger extends Quest
htmltext = "30535-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -311,39 +316,44 @@ public class Q211_TrialOfTheChallenger extends Quest
switch (npc.getNpcId())
{
case SHYSLASSYS:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(BROKEN_KEY, 1);
st.giveItems(SCROLL_OF_SHYSLASSYS, 1);
addSpawn(CHEST_OF_SHYSLASSYS, npc, false, 200000);
}
break;
-
+ }
case GORR:
- if ((st.getInt("cond") == 4) && st.dropItemsAlways(WATCHER_EYE_1, 1, 1))
+ {
+ if (st.isCond(4) && st.dropItemsAlways(WATCHER_EYE_1, 1, 1))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case BARAHAM:
- if ((st.getInt("cond") == 6) && st.dropItemsAlways(WATCHER_EYE_2, 1, 1))
+ {
+ if (st.isCond(6) && st.dropItemsAlways(WATCHER_EYE_2, 1, 1))
{
- st.set("cond", "7");
+ st.setCond(7);
}
addSpawn(RALDO, npc, false, 100000);
break;
-
+ }
case SUCCUBUS_QUEEN:
- if (st.getInt("cond") == 9)
+ {
+ if (st.isCond(9))
{
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
}
addSpawn(RALDO, npc, false, 100000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q212_TrialOfDuty/Q212_TrialOfDuty.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q212_TrialOfDuty/Q212_TrialOfDuty.java
index 562744385e..b3362c5b6c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q212_TrialOfDuty/Q212_TrialOfDuty.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q212_TrialOfDuty/Q212_TrialOfDuty.java
@@ -28,6 +28,14 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q212_TrialOfDuty extends Quest
{
+ // NPCs
+ private static final int HANNAVALT = 30109;
+ private static final int DUSTIN = 30116;
+ private static final int SIR_COLLIN = 30311;
+ private static final int SIR_ARON = 30653;
+ private static final int SIR_KIEL = 30654;
+ private static final int SILVERSHADOW = 30655;
+ private static final int SPIRIT_TALIANUS = 30656;
// Items
private static final int LETTER_OF_DUSTIN = 2634;
private static final int KNIGHTS_TEAR = 2635;
@@ -43,29 +51,16 @@ public class Q212_TrialOfDuty extends Quest
private static final int ATHEBALDT_SHIN = 2645;
private static final int LETTER_OF_WINDAWOOD = 2646;
private static final int OLD_KNIGHT_SWORD = 3027;
-
// Rewards
private static final int MARK_OF_DUTY = 2633;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int HANNAVALT = 30109;
- private static final int DUSTIN = 30116;
- private static final int SIR_COLLIN = 30311;
- private static final int SIR_ARON = 30653;
- private static final int SIR_KIEL = 30654;
- private static final int SILVERSHADOW = 30655;
- private static final int SPIRIT_TALIANUS = 30656;
-
public Q212_TrialOfDuty()
{
super(212, "Trial of Duty");
-
registerQuestItems(LETTER_OF_DUSTIN, KNIGHTS_TEAR, MIRROR_OF_ORPIC, TEAR_OF_CONFESSION, REPORT_PIECE_1, REPORT_PIECE_2, TEAR_OF_LOYALTY, MILITAS_ARTICLE, SAINTS_ASHES_URN, ATHEBALDT_SKULL, ATHEBALDT_RIBS, ATHEBALDT_SHIN, LETTER_OF_WINDAWOOD, OLD_KNIGHT_SWORD);
-
addStartNpc(HANNAVALT);
addTalkId(HANNAVALT, DUSTIN, SIR_COLLIN, SIR_ARON, SIR_KIEL, SILVERSHADOW, SPIRIT_TALIANUS);
-
addKillId(20144, 20190, 20191, 20200, 20201, 20270, 27119, 20577, 20578, 20579, 20580, 20581, 20582);
}
@@ -81,10 +76,7 @@ public class Q212_TrialOfDuty extends Quest
if (event.equals("30109-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
+ st.startQuest();
if (!player.getVariables().getBoolean("secondClassChange35", false))
{
htmltext = "30109-04a.htm";
@@ -94,7 +86,7 @@ public class Q212_TrialOfDuty extends Quest
}
else if (event.equals("30116-05.htm"))
{
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TEAR_OF_LOYALTY, 1);
}
@@ -115,6 +107,7 @@ public class Q212_TrialOfDuty extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.KNIGHT) && (player.getClassId() != ClassId.ELVEN_KNIGHT) && (player.getClassId() != ClassId.PALUS_KNIGHT))
{
htmltext = "30109-02.htm";
@@ -128,12 +121,14 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30109-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HANNAVALT:
+ {
if (cond == 18)
{
htmltext = "30109-05.htm";
@@ -149,12 +144,13 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30109-04a.htm";
}
break;
-
+ }
case SIR_ARON:
+ {
if (cond == 1)
{
htmltext = "30653-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(OLD_KNIGHT_SWORD, 1);
}
@@ -165,7 +161,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 3)
{
htmltext = "30653-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KNIGHTS_TEAR, 1);
st.takeItems(OLD_KNIGHT_SWORD, 1);
@@ -175,12 +171,13 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30653-04.htm";
}
break;
-
+ }
case SIR_KIEL:
+ {
if (cond == 4)
{
htmltext = "30654-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
@@ -190,7 +187,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 6)
{
htmltext = "30654-03.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(MIRROR_OF_ORPIC, 1);
}
@@ -201,7 +198,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 9)
{
htmltext = "30654-05.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TEAR_OF_CONFESSION, 1);
}
@@ -210,12 +207,13 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30654-06.htm";
}
break;
-
+ }
case SPIRIT_TALIANUS:
+ {
if (cond == 8)
{
htmltext = "30656-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MIRROR_OF_ORPIC, 1);
st.takeItems(REPORT_PIECE_2, 1);
@@ -225,8 +223,9 @@ public class Q212_TrialOfDuty extends Quest
npc.deleteMe();
}
break;
-
+ }
case SILVERSHADOW:
+ {
if (cond == 10)
{
if (player.getLevel() < 35)
@@ -236,7 +235,7 @@ public class Q212_TrialOfDuty extends Quest
else
{
htmltext = "30655-02.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -247,7 +246,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 12)
{
htmltext = "30655-04.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MILITAS_ARTICLE, -1);
st.giveItems(TEAR_OF_LOYALTY, 1);
@@ -257,8 +256,9 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30655-05.htm";
}
break;
-
+ }
case DUSTIN:
+ {
if (cond == 13)
{
htmltext = "30116-01.htm";
@@ -270,7 +270,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 15)
{
htmltext = "30116-07.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ATHEBALDT_SKULL, 1);
st.takeItems(ATHEBALDT_RIBS, 1);
@@ -284,7 +284,7 @@ public class Q212_TrialOfDuty extends Quest
else if (cond == 17)
{
htmltext = "30116-08.htm";
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LETTER_OF_WINDAWOOD, 1);
st.giveItems(LETTER_OF_DUSTIN, 1);
@@ -294,12 +294,13 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30116-10.htm";
}
break;
-
+ }
case SIR_COLLIN:
+ {
if (cond == 16)
{
htmltext = "30311-01.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SAINTS_ASHES_URN, 1);
st.giveItems(LETTER_OF_WINDAWOOD, 1);
@@ -309,12 +310,15 @@ public class Q212_TrialOfDuty extends Quest
htmltext = "30311-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -329,63 +333,68 @@ public class Q212_TrialOfDuty extends Quest
return null;
}
- final int cond = st.getInt("cond");
switch (npc.getNpcId())
{
case 20190:
case 20191:
- if ((cond == 2) && (Rnd.get(10) < 1))
+ {
+ if (st.isCond(2) && (Rnd.get(10) < 1))
{
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
addSpawn(27119, npc, false, 120000);
}
break;
-
+ }
case 27119:
- if ((cond == 2) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == OLD_KNIGHT_SWORD))
+ {
+ if (st.isCond(2) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == OLD_KNIGHT_SWORD))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KNIGHTS_TEAR, 1);
}
break;
-
+ }
case 20201:
case 20200:
- if ((cond == 5) && st.dropItemsAlways(REPORT_PIECE_1, 1, 10))
+ {
+ if (st.isCond(5) && st.dropItemsAlways(REPORT_PIECE_1, 1, 10))
{
- st.set("cond", "6");
+ st.setCond(6);
st.takeItems(REPORT_PIECE_1, -1);
st.giveItems(REPORT_PIECE_2, 1);
}
break;
-
+ }
case 20144:
- if (((cond == 7) || (cond == 8)) && (Rnd.get(100) < 33))
+ {
+ if ((st.isCond(7) || st.isCond(8)) && (Rnd.get(100) < 33))
{
- if (cond == 7)
+ if (st.isCond(7))
{
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
}
addSpawn(30656, npc, false, 300000);
}
break;
-
+ }
case 20577:
case 20578:
case 20579:
case 20580:
case 20581:
case 20582:
- if ((cond == 11) && st.dropItemsAlways(MILITAS_ARTICLE, 1, 20))
+ {
+ if (st.isCond(11) && st.dropItemsAlways(MILITAS_ARTICLE, 1, 20))
{
- st.set("cond", "12");
+ st.setCond(12);
}
break;
-
+ }
case 20270:
- if ((cond == 14) && Rnd.nextBoolean())
+ {
+ if (st.isCond(14) && Rnd.nextBoolean())
{
if (!st.hasQuestItems(ATHEBALDT_SKULL))
{
@@ -399,12 +408,13 @@ public class Q212_TrialOfDuty extends Quest
}
else if (!st.hasQuestItems(ATHEBALDT_SHIN))
{
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(ATHEBALDT_SHIN, 1);
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q213_TrialOfTheSeeker/Q213_TrialOfTheSeeker.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q213_TrialOfTheSeeker/Q213_TrialOfTheSeeker.java
index 0564dc02b0..06c7e9cee4 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q213_TrialOfTheSeeker/Q213_TrialOfTheSeeker.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q213_TrialOfTheSeeker/Q213_TrialOfTheSeeker.java
@@ -26,6 +26,23 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q213_TrialOfTheSeeker extends Quest
{
+ // NPCs
+ private static final int TERRY = 30064;
+ private static final int DUFNER = 30106;
+ private static final int BRUNON = 30526;
+ private static final int VIKTOR = 30684;
+ private static final int MARINA = 30715;
+ // Monsters
+ private static final int NEER_GHOUL_BERSERKER = 20198;
+ private static final int ANT_CAPTAIN = 20080;
+ private static final int OL_MAHUM_CAPTAIN = 20211;
+ private static final int TURAK_BUGBEAR_WARRIOR = 20249;
+ private static final int TUREK_ORC_WARLORD = 20495;
+ private static final int MEDUSA = 20158;
+ private static final int ANT_WARRIOR_CAPTAIN = 20088;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int BREKA_ORC_OVERLORD = 20270;
+ private static final int LETO_LIZARDMAN_WARRIOR = 20580;
// Items
private static final int DUFNER_LETTER = 2647;
private static final int TERRY_ORDER_1 = 2648;
@@ -53,39 +70,16 @@ public class Q213_TrialOfTheSeeker extends Quest
private static final int ABYSS_RUNESTONE_3 = 2670;
private static final int ABYSS_RUNESTONE_4 = 2671;
private static final int TERRY_REPORT = 2672;
-
// Rewards
private static final int MARK_OF_SEEKER = 2673;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int TERRY = 30064;
- private static final int DUFNER = 30106;
- private static final int BRUNON = 30526;
- private static final int VIKTOR = 30684;
- private static final int MARINA = 30715;
-
- // Monsters
- private static final int NEER_GHOUL_BERSERKER = 20198;
- private static final int ANT_CAPTAIN = 20080;
- private static final int OL_MAHUM_CAPTAIN = 20211;
- private static final int TURAK_BUGBEAR_WARRIOR = 20249;
- private static final int TUREK_ORC_WARLORD = 20495;
- private static final int MEDUSA = 20158;
- private static final int ANT_WARRIOR_CAPTAIN = 20088;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int BREKA_ORC_OVERLORD = 20270;
- private static final int LETO_LIZARDMAN_WARRIOR = 20580;
-
public Q213_TrialOfTheSeeker()
{
super(213, "Trial of the Seeker");
-
registerQuestItems(DUFNER_LETTER, TERRY_ORDER_1, TERRY_ORDER_2, TERRY_LETTER, VIKTOR_LETTER, HAWKEYE_LETTER, MYSTERIOUS_RUNESTONE, OL_MAHUM_RUNESTONE, TUREK_RUNESTONE, ANT_RUNESTONE, TURAK_BUGBEAR_RUNESTONE, TERRY_BOX, VIKTOR_REQUEST, MEDUSA_SCALES, SHILEN_RUNESTONE, ANALYSIS_REQUEST, MARINA_LETTER, EXPERIMENT_TOOLS, ANALYSIS_RESULT, TERRY_ORDER_3, LIST_OF_HOST, ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_3, ABYSS_RUNESTONE_4, TERRY_REPORT);
-
addStartNpc(DUFNER);
addTalkId(TERRY, DUFNER, BRUNON, VIKTOR, MARINA);
-
addKillId(NEER_GHOUL_BERSERKER, ANT_CAPTAIN, OL_MAHUM_CAPTAIN, TURAK_BUGBEAR_WARRIOR, TUREK_ORC_WARLORD, ANT_WARRIOR_CAPTAIN, MARSH_STAKATO_DRONE, BREKA_ORC_OVERLORD, LETO_LIZARDMAN_WARRIOR, MEDUSA);
}
@@ -99,108 +93,114 @@ public class Q213_TrialOfTheSeeker extends Quest
return htmltext;
}
- // DUFNER
- if (event.equals("30106-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(DUFNER_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange35", false))
+ case "30106-05.htm":
{
- htmltext = "30106-05a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange35", true);
+ st.startQuest();
+ st.giveItems(DUFNER_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange35", false))
+ {
+ htmltext = "30106-05a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange35", true);
+ }
+ break;
}
- }
- // TERRY
- else if (event.equals("30064-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(DUFNER_LETTER, 1);
- st.giveItems(TERRY_ORDER_1, 1);
- }
- else if (event.equals("30064-06.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MYSTERIOUS_RUNESTONE, 1);
- st.takeItems(TERRY_ORDER_1, 1);
- st.giveItems(TERRY_ORDER_2, 1);
- }
- else if (event.equals("30064-10.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ANT_RUNESTONE, 1);
- st.takeItems(OL_MAHUM_RUNESTONE, 1);
- st.takeItems(TURAK_BUGBEAR_RUNESTONE, 1);
- st.takeItems(TUREK_RUNESTONE, 1);
- st.takeItems(TERRY_ORDER_2, 1);
- st.giveItems(TERRY_BOX, 1);
- st.giveItems(TERRY_LETTER, 1);
- }
- else if (event.equals("30064-18.htm"))
- {
- if (player.getLevel() < 36)
+ case "30064-03.htm":
{
- htmltext = "30064-17.htm";
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(ANALYSIS_RESULT, 1);
- st.giveItems(TERRY_ORDER_3, 1);
- }
- else
- {
- st.set("cond", "16");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ANALYSIS_RESULT, 1);
- st.giveItems(LIST_OF_HOST, 1);
+ st.takeItems(DUFNER_LETTER, 1);
+ st.giveItems(TERRY_ORDER_1, 1);
+ break;
+ }
+ case "30064-06.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MYSTERIOUS_RUNESTONE, 1);
+ st.takeItems(TERRY_ORDER_1, 1);
+ st.giveItems(TERRY_ORDER_2, 1);
+ break;
+ }
+ case "30064-10.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ANT_RUNESTONE, 1);
+ st.takeItems(OL_MAHUM_RUNESTONE, 1);
+ st.takeItems(TURAK_BUGBEAR_RUNESTONE, 1);
+ st.takeItems(TUREK_RUNESTONE, 1);
+ st.takeItems(TERRY_ORDER_2, 1);
+ st.giveItems(TERRY_BOX, 1);
+ st.giveItems(TERRY_LETTER, 1);
+ break;
+ }
+ case "30064-18.htm":
+ {
+ if (player.getLevel() < 36)
+ {
+ htmltext = "30064-17.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(ANALYSIS_RESULT, 1);
+ st.giveItems(TERRY_ORDER_3, 1);
+ }
+ else
+ {
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ANALYSIS_RESULT, 1);
+ st.giveItems(LIST_OF_HOST, 1);
+ }
+ break;
+ }
+ case "30684-05.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TERRY_LETTER, 1);
+ st.giveItems(VIKTOR_LETTER, 1);
+ break;
+ }
+ case "30684-11.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TERRY_LETTER, 1);
+ st.takeItems(TERRY_BOX, 1);
+ st.takeItems(HAWKEYE_LETTER, 1);
+ st.takeItems(VIKTOR_LETTER, 1);
+ st.giveItems(VIKTOR_REQUEST, 1);
+ break;
+ }
+ case "30684-15.htm":
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VIKTOR_REQUEST, 1);
+ st.takeItems(MEDUSA_SCALES, 10);
+ st.giveItems(ANALYSIS_REQUEST, 1);
+ st.giveItems(SHILEN_RUNESTONE, 1);
+ break;
+ }
+ case "30715-02.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SHILEN_RUNESTONE, 1);
+ st.takeItems(ANALYSIS_REQUEST, 1);
+ st.giveItems(MARINA_LETTER, 1);
+ break;
+ }
+ case "30715-05.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(EXPERIMENT_TOOLS, 1);
+ st.giveItems(ANALYSIS_RESULT, 1);
+ break;
}
- }
- // VIKTOR
- else if (event.equals("30684-05.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TERRY_LETTER, 1);
- st.giveItems(VIKTOR_LETTER, 1);
- }
- else if (event.equals("30684-11.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TERRY_LETTER, 1);
- st.takeItems(TERRY_BOX, 1);
- st.takeItems(HAWKEYE_LETTER, 1);
- st.takeItems(VIKTOR_LETTER, 1);
- st.giveItems(VIKTOR_REQUEST, 1);
- }
- else if (event.equals("30684-15.htm"))
- {
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VIKTOR_REQUEST, 1);
- st.takeItems(MEDUSA_SCALES, 10);
- st.giveItems(ANALYSIS_REQUEST, 1);
- st.giveItems(SHILEN_RUNESTONE, 1);
- }
- // MARINA
- else if (event.equals("30715-02.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SHILEN_RUNESTONE, 1);
- st.takeItems(ANALYSIS_REQUEST, 1);
- st.giveItems(MARINA_LETTER, 1);
- }
- else if (event.equals("30715-05.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(EXPERIMENT_TOOLS, 1);
- st.giveItems(ANALYSIS_RESULT, 1);
}
return htmltext;
@@ -219,6 +219,7 @@ public class Q213_TrialOfTheSeeker extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() == ClassId.ROGUE) || (player.getClassId() == ClassId.ELVEN_SCOUT) || (player.getClassId() == ClassId.ASSASSIN))
{
htmltext = (player.getLevel() < 35) ? "30106-02.htm" : "30106-03.htm";
@@ -228,12 +229,14 @@ public class Q213_TrialOfTheSeeker extends Quest
htmltext = "30106-00.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case DUFNER:
+ {
if (cond == 1)
{
htmltext = "30106-06.htm";
@@ -256,8 +259,9 @@ public class Q213_TrialOfTheSeeker extends Quest
}
}
break;
-
+ }
case TERRY:
+ {
if (cond == 1)
{
htmltext = "30064-01.htm";
@@ -285,7 +289,7 @@ public class Q213_TrialOfTheSeeker extends Quest
else if (cond == 7)
{
htmltext = "30064-12.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(VIKTOR_LETTER, 1);
st.giveItems(HAWKEYE_LETTER, 1);
@@ -311,7 +315,7 @@ public class Q213_TrialOfTheSeeker extends Quest
else
{
htmltext = "30064-21.htm";
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TERRY_ORDER_3, 1);
st.giveItems(LIST_OF_HOST, 1);
@@ -340,8 +344,9 @@ public class Q213_TrialOfTheSeeker extends Quest
}
}
break;
-
+ }
case VIKTOR:
+ {
if (cond == 6)
{
htmltext = "30684-01.htm";
@@ -371,8 +376,9 @@ public class Q213_TrialOfTheSeeker extends Quest
htmltext = "30684-17.htm";
}
break;
-
+ }
case MARINA:
+ {
if (cond == 11)
{
htmltext = "30715-01.htm";
@@ -390,12 +396,13 @@ public class Q213_TrialOfTheSeeker extends Quest
htmltext = "30715-06.htm";
}
break;
-
+ }
case BRUNON:
+ {
if (cond == 12)
{
htmltext = "30526-01.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MARINA_LETTER, 1);
st.giveItems(EXPERIMENT_TOOLS, 1);
@@ -405,12 +412,15 @@ public class Q213_TrialOfTheSeeker extends Quest
htmltext = "30526-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -425,79 +435,88 @@ public class Q213_TrialOfTheSeeker extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case NEER_GHOUL_BERSERKER:
- if ((cond == 2) && st.dropItems(MYSTERIOUS_RUNESTONE, 1, 1, 100000))
+ {
+ if (st.isCond(2) && st.dropItems(MYSTERIOUS_RUNESTONE, 1, 1, 100000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case ANT_CAPTAIN:
- if ((cond == 4) && st.dropItems(ANT_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(OL_MAHUM_RUNESTONE, TURAK_BUGBEAR_RUNESTONE, TUREK_RUNESTONE))
+ {
+ if (st.isCond(4) && st.dropItems(ANT_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(OL_MAHUM_RUNESTONE, TURAK_BUGBEAR_RUNESTONE, TUREK_RUNESTONE))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case OL_MAHUM_CAPTAIN:
- if ((cond == 4) && st.dropItems(OL_MAHUM_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, TURAK_BUGBEAR_RUNESTONE, TUREK_RUNESTONE))
+ {
+ if (st.isCond(4) && st.dropItems(OL_MAHUM_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, TURAK_BUGBEAR_RUNESTONE, TUREK_RUNESTONE))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case TURAK_BUGBEAR_WARRIOR:
- if ((cond == 4) && st.dropItems(TURAK_BUGBEAR_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, OL_MAHUM_RUNESTONE, TUREK_RUNESTONE))
+ {
+ if (st.isCond(4) && st.dropItems(TURAK_BUGBEAR_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, OL_MAHUM_RUNESTONE, TUREK_RUNESTONE))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case TUREK_ORC_WARLORD:
- if ((cond == 4) && st.dropItems(TUREK_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, OL_MAHUM_RUNESTONE, TURAK_BUGBEAR_RUNESTONE))
+ {
+ if (st.isCond(4) && st.dropItems(TUREK_RUNESTONE, 1, 1, 250000) && st.hasQuestItems(ANT_RUNESTONE, OL_MAHUM_RUNESTONE, TURAK_BUGBEAR_RUNESTONE))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case MEDUSA:
- if ((cond == 9) && st.dropItems(MEDUSA_SCALES, 1, 10, 300000))
+ {
+ if (st.isCond(9) && st.dropItems(MEDUSA_SCALES, 1, 10, 300000))
{
- st.set("cond", "10");
+ st.setCond(10);
}
break;
-
+ }
case MARSH_STAKATO_DRONE:
- if (((cond == 15) || (cond == 16)) && st.dropItems(ABYSS_RUNESTONE_1, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_3, ABYSS_RUNESTONE_4))
+ {
+ if ((st.isCond(15) || st.isCond(16)) && st.dropItems(ABYSS_RUNESTONE_1, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_3, ABYSS_RUNESTONE_4))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case BREKA_ORC_OVERLORD:
- if (((cond == 15) || (cond == 16)) && st.dropItems(ABYSS_RUNESTONE_2, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_3, ABYSS_RUNESTONE_4))
+ {
+ if ((st.isCond(15) || st.isCond(16)) && st.dropItems(ABYSS_RUNESTONE_2, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_3, ABYSS_RUNESTONE_4))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case ANT_WARRIOR_CAPTAIN:
- if (((cond == 15) || (cond == 16)) && st.dropItems(ABYSS_RUNESTONE_3, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_4))
+ {
+ if ((st.isCond(15) || st.isCond(16)) && st.dropItems(ABYSS_RUNESTONE_3, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_4))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case LETO_LIZARDMAN_WARRIOR:
- if (((cond == 15) || (cond == 16)) && st.dropItems(ABYSS_RUNESTONE_4, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_3))
+ {
+ if ((st.isCond(15) || st.isCond(16)) && st.dropItems(ABYSS_RUNESTONE_4, 1, 1, 250000) && st.hasQuestItems(ABYSS_RUNESTONE_1, ABYSS_RUNESTONE_2, ABYSS_RUNESTONE_3))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q214_TrialOfTheScholar/Q214_TrialOfTheScholar.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q214_TrialOfTheScholar/Q214_TrialOfTheScholar.java
index 9d8210b1cf..2e2593a422 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q214_TrialOfTheScholar/Q214_TrialOfTheScholar.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q214_TrialOfTheScholar/Q214_TrialOfTheScholar.java
@@ -26,6 +26,32 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q214_TrialOfTheScholar extends Quest
{
+ // NPCs
+ private static final int SYLVAIN = 30070;
+ private static final int LUCAS = 30071;
+ private static final int VALKON = 30103;
+ private static final int DIETER = 30111;
+ private static final int JUREK = 30115;
+ private static final int EDROC = 30230;
+ private static final int RAUT = 30316;
+ private static final int POITAN = 30458;
+ private static final int MIRIEN = 30461;
+ private static final int MARIA = 30608;
+ private static final int CRETA = 30609;
+ private static final int CRONOS = 30610;
+ private static final int TRIFF = 30611;
+ private static final int CASIAN = 30612;
+ // Monsters
+ private static final int MONSTER_EYE_DESTROYER = 20068;
+ private static final int MEDUSA = 20158;
+ private static final int GHOUL = 20201;
+ private static final int SHACKLE_1 = 20235;
+ private static final int SHACKLE_2 = 20279;
+ private static final int BREKA_ORC_SHAMAN = 20269;
+ private static final int FETTERED_SOUL = 20552;
+ private static final int GRANDIS = 20554;
+ private static final int ENCHANTED_GARGOYLE = 20567;
+ private static final int LETO_LIZARDMAN_WARRIOR = 20580;
// Items
private static final int MIRIEN_SIGIL_1 = 2675;
private static final int MIRIEN_SIGIL_2 = 2676;
@@ -72,48 +98,16 @@ public class Q214_TrialOfTheScholar extends Quest
private static final int FETTERED_SOUL_ICHOR = 2718;
private static final int ENCHANTED_GARGOYLE_NAIL = 2719;
private static final int SYMBOL_OF_CRONOS = 2720;
-
// Rewards
private static final int MARK_OF_SCHOLAR = 2674;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int SYLVAIN = 30070;
- private static final int LUCAS = 30071;
- private static final int VALKON = 30103;
- private static final int DIETER = 30111;
- private static final int JUREK = 30115;
- private static final int EDROC = 30230;
- private static final int RAUT = 30316;
- private static final int POITAN = 30458;
- private static final int MIRIEN = 30461;
- private static final int MARIA = 30608;
- private static final int CRETA = 30609;
- private static final int CRONOS = 30610;
- private static final int TRIFF = 30611;
- private static final int CASIAN = 30612;
-
- // Monsters
- private static final int MONSTER_EYE_DESTROYER = 20068;
- private static final int MEDUSA = 20158;
- private static final int GHOUL = 20201;
- private static final int SHACKLE_1 = 20235;
- private static final int SHACKLE_2 = 20279;
- private static final int BREKA_ORC_SHAMAN = 20269;
- private static final int FETTERED_SOUL = 20552;
- private static final int GRANDIS = 20554;
- private static final int ENCHANTED_GARGOYLE = 20567;
- private static final int LETO_LIZARDMAN_WARRIOR = 20580;
-
public Q214_TrialOfTheScholar()
{
super(214, "Trial of the Scholar");
-
registerQuestItems(MIRIEN_SIGIL_1, MIRIEN_SIGIL_2, MIRIEN_SIGIL_3, MIRIEN_INSTRUCTION, MARIA_LETTER_1, MARIA_LETTER_2, LUCAS_LETTER, LUCILLA_HANDBAG, CRETA_LETTER_1, CRETA_PAINTING_1, CRETA_PAINTING_2, CRETA_PAINTING_3, BROWN_SCROLL_SCRAP, CRYSTAL_OF_PURITY_1, HIGH_PRIEST_SIGIL, GRAND_MAGISTER_SIGIL, CRONOS_SIGIL, SYLVAIN_LETTER, SYMBOL_OF_SYLVAIN, JUREK_LIST, MONSTER_EYE_DESTROYER_SKIN, SHAMAN_NECKLACE, SHACKLE_SCALP, SYMBOL_OF_JUREK, CRONOS_LETTER, DIETER_KEY, CRETA_LETTER_2, DIETER_LETTER, DIETER_DIARY, RAUT_LETTER_ENVELOPE, TRIFF_RING, SCRIPTURE_CHAPTER_1, SCRIPTURE_CHAPTER_2, SCRIPTURE_CHAPTER_3, SCRIPTURE_CHAPTER_4, VALKON_REQUEST, POITAN_NOTES, STRONG_LIQUOR, CRYSTAL_OF_PURITY_2, CASIAN_LIST, GHOUL_SKIN, MEDUSA_BLOOD, FETTERED_SOUL_ICHOR, ENCHANTED_GARGOYLE_NAIL, SYMBOL_OF_CRONOS);
-
addStartNpc(MIRIEN);
addTalkId(MIRIEN, SYLVAIN, LUCAS, VALKON, DIETER, JUREK, EDROC, RAUT, POITAN, MARIA, CRETA, CRONOS, TRIFF, CASIAN);
-
addKillId(MONSTER_EYE_DESTROYER, MEDUSA, GHOUL, SHACKLE_1, SHACKLE_2, BREKA_ORC_SHAMAN, FETTERED_SOUL, GRANDIS, ENCHANTED_GARGOYLE, LETO_LIZARDMAN_WARRIOR);
}
@@ -127,193 +121,201 @@ public class Q214_TrialOfTheScholar extends Quest
return htmltext;
}
- // MIRIEN
- if (event.equals("30461-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(MIRIEN_SIGIL_1, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange35", false))
+ case "30461-04.htm":
{
- htmltext = "30461-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange35", true);
+ st.startQuest();
+ st.giveItems(MIRIEN_SIGIL_1, 1);
+ if (!player.getVariables().getBoolean("secondClassChange35", false))
+ {
+ htmltext = "30461-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange35", true);
+ }
+ break;
}
- }
- else if (event.equals("30461-09.htm"))
- {
- if (player.getLevel() < 36)
+ case "30461-09.htm":
+ {
+ if (player.getLevel() < 36)
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(MIRIEN_INSTRUCTION, 1);
+ }
+ else
+ {
+ htmltext = "30461-10.htm";
+ st.setCond(19);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MIRIEN_SIGIL_2, 1);
+ st.takeItems(SYMBOL_OF_JUREK, 1);
+ st.giveItems(MIRIEN_SIGIL_3, 1);
+ }
+ break;
+ }
+ case "30070-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(HIGH_PRIEST_SIGIL, 1);
+ st.giveItems(SYLVAIN_LETTER, 1);
+ break;
+ }
+ case "30608-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SYLVAIN_LETTER, 1);
+ st.giveItems(MARIA_LETTER_1, 1);
+ break;
+ }
+ case "30608-08.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRETA_LETTER_1, 1);
+ st.giveItems(LUCILLA_HANDBAG, 1);
+ break;
+ }
+ case "30608-14.htm":
+ {
+ st.setCond(13);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BROWN_SCROLL_SCRAP, -1);
+ st.takeItems(CRETA_PAINTING_3, 1);
+ st.giveItems(CRYSTAL_OF_PURITY_1, 1);
+ break;
+ }
+ case "30115-03.htm":
+ {
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(GRAND_MAGISTER_SIGIL, 1);
+ st.giveItems(JUREK_LIST, 1);
+ break;
+ }
+ case "30071-04.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRETA_PAINTING_2, 1);
+ st.giveItems(CRETA_PAINTING_3, 1);
+ break;
+ }
+ case "30609-05.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MARIA_LETTER_2, 1);
+ st.giveItems(CRETA_LETTER_1, 1);
+ break;
+ }
+ case "30609-09.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LUCILLA_HANDBAG, 1);
+ st.giveItems(CRETA_PAINTING_1, 1);
+ break;
+ }
+ case "30609-14.htm":
+ {
+ st.setCond(22);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(DIETER_KEY, 1);
+ st.giveItems(CRETA_LETTER_2, 1);
+ break;
+ }
+ case "30610-10.htm":
+ {
+ st.setCond(20);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CRONOS_LETTER, 1);
+ st.giveItems(CRONOS_SIGIL, 1);
+ break;
+ }
+ case "30610-14.htm":
+ {
+ st.setCond(31);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRONOS_SIGIL, 1);
+ st.takeItems(DIETER_DIARY, 1);
+ st.takeItems(SCRIPTURE_CHAPTER_1, 1);
+ st.takeItems(SCRIPTURE_CHAPTER_2, 1);
+ st.takeItems(SCRIPTURE_CHAPTER_3, 1);
+ st.takeItems(SCRIPTURE_CHAPTER_4, 1);
+ st.takeItems(TRIFF_RING, 1);
+ st.giveItems(SYMBOL_OF_CRONOS, 1);
+ break;
+ }
+ case "30111-05.htm":
+ {
+ st.setCond(21);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRONOS_LETTER, 1);
+ st.giveItems(DIETER_KEY, 1);
+ break;
+ }
+ case "30111-09.htm":
+ {
+ st.setCond(23);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRETA_LETTER_2, 1);
+ st.giveItems(DIETER_DIARY, 1);
+ st.giveItems(DIETER_LETTER, 1);
+ break;
+ }
+ case "30230-02.htm":
+ {
+ st.setCond(24);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(DIETER_LETTER, 1);
+ st.giveItems(RAUT_LETTER_ENVELOPE, 1);
+ break;
+ }
+ case "30316-02.htm":
+ {
+ st.setCond(25);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RAUT_LETTER_ENVELOPE, 1);
+ st.giveItems(SCRIPTURE_CHAPTER_1, 1);
+ st.giveItems(STRONG_LIQUOR, 1);
+ break;
+ }
+ case "30611-04.htm":
+ {
+ st.setCond(26);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(STRONG_LIQUOR, 1);
+ st.giveItems(TRIFF_RING, 1);
+ break;
+ }
+ case "30103-04.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(MIRIEN_INSTRUCTION, 1);
+ st.giveItems(VALKON_REQUEST, 1);
+ break;
}
- else
+ case "30612-04.htm":
{
- htmltext = "30461-10.htm";
- st.set("cond", "19");
+ st.setCond(28);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MIRIEN_SIGIL_2, 1);
- st.takeItems(SYMBOL_OF_JUREK, 1);
- st.giveItems(MIRIEN_SIGIL_3, 1);
+ st.giveItems(CASIAN_LIST, 1);
+ break;
+ }
+ case "30612-07.htm":
+ {
+ st.setCond(30);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CASIAN_LIST, 1);
+ st.takeItems(ENCHANTED_GARGOYLE_NAIL, -1);
+ st.takeItems(FETTERED_SOUL_ICHOR, -1);
+ st.takeItems(GHOUL_SKIN, -1);
+ st.takeItems(MEDUSA_BLOOD, -1);
+ st.takeItems(POITAN_NOTES, 1);
+ st.giveItems(SCRIPTURE_CHAPTER_4, 1);
+ break;
}
- }
- // SYLVAIN
- else if (event.equals("30070-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(HIGH_PRIEST_SIGIL, 1);
- st.giveItems(SYLVAIN_LETTER, 1);
- }
- // MARIA
- else if (event.equals("30608-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SYLVAIN_LETTER, 1);
- st.giveItems(MARIA_LETTER_1, 1);
- }
- else if (event.equals("30608-08.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRETA_LETTER_1, 1);
- st.giveItems(LUCILLA_HANDBAG, 1);
- }
- else if (event.equals("30608-14.htm"))
- {
- st.set("cond", "13");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BROWN_SCROLL_SCRAP, -1);
- st.takeItems(CRETA_PAINTING_3, 1);
- st.giveItems(CRYSTAL_OF_PURITY_1, 1);
- }
- // JUREK
- else if (event.equals("30115-03.htm"))
- {
- st.set("cond", "16");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(GRAND_MAGISTER_SIGIL, 1);
- st.giveItems(JUREK_LIST, 1);
- }
- // LUCAS
- else if (event.equals("30071-04.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRETA_PAINTING_2, 1);
- st.giveItems(CRETA_PAINTING_3, 1);
- }
- // CRETA
- else if (event.equals("30609-05.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MARIA_LETTER_2, 1);
- st.giveItems(CRETA_LETTER_1, 1);
- }
- else if (event.equals("30609-09.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LUCILLA_HANDBAG, 1);
- st.giveItems(CRETA_PAINTING_1, 1);
- }
- else if (event.equals("30609-14.htm"))
- {
- st.set("cond", "22");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(DIETER_KEY, 1);
- st.giveItems(CRETA_LETTER_2, 1);
- }
- // CRONOS
- else if (event.equals("30610-10.htm"))
- {
- st.set("cond", "20");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CRONOS_LETTER, 1);
- st.giveItems(CRONOS_SIGIL, 1);
- }
- else if (event.equals("30610-14.htm"))
- {
- st.set("cond", "31");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRONOS_SIGIL, 1);
- st.takeItems(DIETER_DIARY, 1);
- st.takeItems(SCRIPTURE_CHAPTER_1, 1);
- st.takeItems(SCRIPTURE_CHAPTER_2, 1);
- st.takeItems(SCRIPTURE_CHAPTER_3, 1);
- st.takeItems(SCRIPTURE_CHAPTER_4, 1);
- st.takeItems(TRIFF_RING, 1);
- st.giveItems(SYMBOL_OF_CRONOS, 1);
- }
- // DIETER
- else if (event.equals("30111-05.htm"))
- {
- st.set("cond", "21");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRONOS_LETTER, 1);
- st.giveItems(DIETER_KEY, 1);
- }
- else if (event.equals("30111-09.htm"))
- {
- st.set("cond", "23");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRETA_LETTER_2, 1);
- st.giveItems(DIETER_DIARY, 1);
- st.giveItems(DIETER_LETTER, 1);
- }
- // EDROC
- else if (event.equals("30230-02.htm"))
- {
- st.set("cond", "24");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(DIETER_LETTER, 1);
- st.giveItems(RAUT_LETTER_ENVELOPE, 1);
- }
- // RAUT
- else if (event.equals("30316-02.htm"))
- {
- st.set("cond", "25");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RAUT_LETTER_ENVELOPE, 1);
- st.giveItems(SCRIPTURE_CHAPTER_1, 1);
- st.giveItems(STRONG_LIQUOR, 1);
- }
- // TRIFF
- else if (event.equals("30611-04.htm"))
- {
- st.set("cond", "26");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(STRONG_LIQUOR, 1);
- st.giveItems(TRIFF_RING, 1);
- }
- // VALKON
- else if (event.equals("30103-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(VALKON_REQUEST, 1);
- }
- // CASIAN
- else if (event.equals("30612-04.htm"))
- {
- st.set("cond", "28");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CASIAN_LIST, 1);
- }
- else if (event.equals("30612-07.htm"))
- {
- st.set("cond", "30");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CASIAN_LIST, 1);
- st.takeItems(ENCHANTED_GARGOYLE_NAIL, -1);
- st.takeItems(FETTERED_SOUL_ICHOR, -1);
- st.takeItems(GHOUL_SKIN, -1);
- st.takeItems(MEDUSA_BLOOD, -1);
- st.takeItems(POITAN_NOTES, 1);
- st.giveItems(SCRIPTURE_CHAPTER_4, 1);
}
return htmltext;
@@ -332,6 +334,7 @@ public class Q214_TrialOfTheScholar extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.WIZARD) && (player.getClassId() != ClassId.ELVEN_WIZARD) && (player.getClassId() != ClassId.DARK_WIZARD))
{
htmltext = "30461-01.htm";
@@ -345,12 +348,14 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30461-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MIRIEN:
+ {
if (cond < 14)
{
htmltext = "30461-05.htm";
@@ -358,7 +363,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 14)
{
htmltext = "30461-06.htm";
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MIRIEN_SIGIL_1, 1);
st.takeItems(SYMBOL_OF_SYLVAIN, 1);
@@ -383,7 +388,7 @@ public class Q214_TrialOfTheScholar extends Quest
else
{
htmltext = "30461-12.htm";
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MIRIEN_INSTRUCTION, 1);
st.takeItems(MIRIEN_SIGIL_2, 1);
@@ -408,8 +413,9 @@ public class Q214_TrialOfTheScholar extends Quest
st.exitQuest(false);
}
break;
-
+ }
case SYLVAIN:
+ {
if (cond == 1)
{
htmltext = "30070-01.htm";
@@ -421,7 +427,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 13)
{
htmltext = "30070-04.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CRYSTAL_OF_PURITY_1, 1);
st.takeItems(HIGH_PRIEST_SIGIL, 1);
@@ -436,8 +442,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30070-06.htm";
}
break;
-
+ }
case MARIA:
+ {
if (cond == 2)
{
htmltext = "30608-01.htm";
@@ -449,7 +456,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 4)
{
htmltext = "30608-04.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LUCAS_LETTER, 1);
st.giveItems(MARIA_LETTER_2, 1);
@@ -469,7 +476,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 8)
{
htmltext = "30608-10.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CRETA_PAINTING_1, 1);
st.giveItems(CRETA_PAINTING_2, 1);
@@ -481,7 +488,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 10)
{
htmltext = "30608-12.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 11)
@@ -515,8 +522,9 @@ public class Q214_TrialOfTheScholar extends Quest
}
}
break;
-
+ }
case JUREK:
+ {
if (cond == 15)
{
htmltext = "30115-01.htm";
@@ -528,7 +536,7 @@ public class Q214_TrialOfTheScholar extends Quest
else if (cond == 17)
{
htmltext = "30115-05.htm";
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GRAND_MAGISTER_SIGIL, 1);
st.takeItems(JUREK_LIST, 1);
@@ -546,12 +554,13 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30115-07.htm";
}
break;
-
+ }
case LUCAS:
+ {
if (cond == 3)
{
htmltext = "30071-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MARIA_LETTER_1, 1);
st.giveItems(LUCAS_LETTER, 1);
@@ -577,8 +586,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30071-07.htm";
}
break;
-
+ }
case CRETA:
+ {
if (cond == 5)
{
htmltext = "30609-01.htm";
@@ -608,8 +618,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30609-15.htm";
}
break;
-
+ }
case CRONOS:
+ {
if (cond == 19)
{
htmltext = "30610-01.htm";
@@ -627,8 +638,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30610-15.htm";
}
break;
-
+ }
case DIETER:
+ {
if (cond == 20)
{
htmltext = "30111-01.htm";
@@ -658,8 +670,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30111-15.htm";
}
break;
-
+ }
case EDROC:
+ {
if (cond == 23)
{
htmltext = "30230-01.htm";
@@ -673,8 +686,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30230-04.htm";
}
break;
-
+ }
case RAUT:
+ {
if (cond == 24)
{
htmltext = "30316-01.htm";
@@ -688,8 +702,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30316-05.htm";
}
break;
-
+ }
case TRIFF:
+ {
if (cond == 25)
{
htmltext = "30611-01.htm";
@@ -699,8 +714,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30611-05.htm";
}
break;
-
+ }
case VALKON:
+ {
if (st.hasQuestItems(TRIFF_RING))
{
if (!st.hasQuestItems(SCRIPTURE_CHAPTER_2))
@@ -730,8 +746,9 @@ public class Q214_TrialOfTheScholar extends Quest
}
}
break;
-
+ }
case POITAN:
+ {
if ((cond == 26) || (cond == 27))
{
if (!st.hasQuestItems(POITAN_NOTES))
@@ -754,8 +771,9 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30458-04.htm";
}
break;
-
+ }
case CASIAN:
+ {
if (((cond == 26) || (cond == 27)) && st.hasQuestItems(POITAN_NOTES))
{
if (st.hasQuestItems(SCRIPTURE_CHAPTER_1, SCRIPTURE_CHAPTER_2, SCRIPTURE_CHAPTER_3))
@@ -767,7 +785,7 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30612-01.htm";
if (cond == 26)
{
- st.set("cond", "27");
+ st.setCond(27);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -785,12 +803,15 @@ public class Q214_TrialOfTheScholar extends Quest
htmltext = "30612-08.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -808,68 +829,78 @@ public class Q214_TrialOfTheScholar extends Quest
switch (npc.getNpcId())
{
case LETO_LIZARDMAN_WARRIOR:
- if ((st.getInt("cond") == 11) && st.dropItems(BROWN_SCROLL_SCRAP, 1, 5, 500000))
+ {
+ if (st.isCond(11) && st.dropItems(BROWN_SCROLL_SCRAP, 1, 5, 500000))
{
- st.set("cond", "12");
+ st.setCond(12);
}
break;
-
+ }
case SHACKLE_1:
case SHACKLE_2:
- if ((st.getInt("cond") == 16) && st.dropItems(SHACKLE_SCALP, 1, 2, 500000) && (st.getQuestItemsCount(MONSTER_EYE_DESTROYER_SKIN) == 5) && (st.getQuestItemsCount(SHAMAN_NECKLACE) == 5))
+ {
+ if (st.isCond(16) && st.dropItems(SHACKLE_SCALP, 1, 2, 500000) && (st.getQuestItemsCount(MONSTER_EYE_DESTROYER_SKIN) == 5) && (st.getQuestItemsCount(SHAMAN_NECKLACE) == 5))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case MONSTER_EYE_DESTROYER:
- if ((st.getInt("cond") == 16) && st.dropItems(MONSTER_EYE_DESTROYER_SKIN, 1, 5, 500000) && (st.getQuestItemsCount(SHACKLE_SCALP) == 2) && (st.getQuestItemsCount(SHAMAN_NECKLACE) == 5))
+ {
+ if (st.isCond(16) && st.dropItems(MONSTER_EYE_DESTROYER_SKIN, 1, 5, 500000) && (st.getQuestItemsCount(SHACKLE_SCALP) == 2) && (st.getQuestItemsCount(SHAMAN_NECKLACE) == 5))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case BREKA_ORC_SHAMAN:
- if ((st.getInt("cond") == 16) && st.dropItems(SHAMAN_NECKLACE, 1, 5, 500000) && (st.getQuestItemsCount(SHACKLE_SCALP) == 2) && (st.getQuestItemsCount(MONSTER_EYE_DESTROYER_SKIN) == 5))
+ {
+ if (st.isCond(16) && st.dropItems(SHAMAN_NECKLACE, 1, 5, 500000) && (st.getQuestItemsCount(SHACKLE_SCALP) == 2) && (st.getQuestItemsCount(MONSTER_EYE_DESTROYER_SKIN) == 5))
{
- st.set("cond", "17");
+ st.setCond(17);
}
break;
-
+ }
case GRANDIS:
+ {
if (st.hasQuestItems(TRIFF_RING))
{
st.dropItems(SCRIPTURE_CHAPTER_3, 1, 1, 300000);
}
break;
-
+ }
case MEDUSA:
- if ((st.getInt("cond") == 28) && st.dropItemsAlways(MEDUSA_BLOOD, 1, 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
+ {
+ if (st.isCond(28) && st.dropItemsAlways(MEDUSA_BLOOD, 1, 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
{
- st.set("cond", "29");
+ st.setCond(29);
}
break;
-
+ }
case GHOUL:
- if ((st.getInt("cond") == 28) && st.dropItemsAlways(GHOUL_SKIN, 1, 10) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
+ {
+ if (st.isCond(28) && st.dropItemsAlways(GHOUL_SKIN, 1, 10) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
{
- st.set("cond", "29");
+ st.setCond(29);
}
break;
-
+ }
case FETTERED_SOUL:
- if ((st.getInt("cond") == 28) && st.dropItemsAlways(FETTERED_SOUL_ICHOR, 1, 5) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
+ {
+ if (st.isCond(28) && st.dropItemsAlways(FETTERED_SOUL_ICHOR, 1, 5) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(ENCHANTED_GARGOYLE_NAIL) == 5))
{
- st.set("cond", "29");
+ st.setCond(29);
}
break;
-
+ }
case ENCHANTED_GARGOYLE:
- if ((st.getInt("cond") == 28) && st.dropItemsAlways(ENCHANTED_GARGOYLE_NAIL, 1, 5) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5))
+ {
+ if (st.isCond(28) && st.dropItemsAlways(ENCHANTED_GARGOYLE_NAIL, 1, 5) && (st.getQuestItemsCount(MEDUSA_BLOOD) == 12) && (st.getQuestItemsCount(GHOUL_SKIN) == 10) && (st.getQuestItemsCount(FETTERED_SOUL_ICHOR) == 5))
{
- st.set("cond", "29");
+ st.setCond(29);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q215_TrialOfThePilgrim/Q215_TrialOfThePilgrim.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q215_TrialOfThePilgrim/Q215_TrialOfThePilgrim.java
index 7137211f43..74e97410ec 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q215_TrialOfThePilgrim/Q215_TrialOfThePilgrim.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q215_TrialOfThePilgrim/Q215_TrialOfThePilgrim.java
@@ -27,6 +27,22 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q215_TrialOfThePilgrim extends Quest
{
+ // NPCs
+ private static final int SANTIAGO = 30648;
+ private static final int TANAPI = 30571;
+ private static final int ANCESTOR_MARTANKUS = 30649;
+ private static final int GAURI_TWINKLEROCK = 30550;
+ private static final int DORF = 30651;
+ private static final int GERALD = 30650;
+ private static final int PRIMOS = 30117;
+ private static final int PETRON = 30036;
+ private static final int ANDELLIA = 30362;
+ private static final int URUHA = 30652;
+ private static final int CASIAN = 30612;
+ // Monsters
+ private static final int LAVA_SALAMANDER = 27116;
+ private static final int NAHIR = 27117;
+ private static final int BLACK_WILLOW = 27118;
// Items
private static final int BOOK_OF_SAGE = 2722;
private static final int VOUCHER_OF_TRIAL = 2723;
@@ -40,38 +56,16 @@ public class Q215_TrialOfThePilgrim extends Quest
private static final int BOOK_OF_DARKNESS = 2731;
private static final int DEBRIS_OF_WILLOW = 2732;
private static final int TAG_OF_RUMOR = 2733;
-
// Rewards
private static final int MARK_OF_PILGRIM = 2721;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int SANTIAGO = 30648;
- private static final int TANAPI = 30571;
- private static final int ANCESTOR_MARTANKUS = 30649;
- private static final int GAURI_TWINKLEROCK = 30550;
- private static final int DORF = 30651;
- private static final int GERALD = 30650;
- private static final int PRIMOS = 30117;
- private static final int PETRON = 30036;
- private static final int ANDELLIA = 30362;
- private static final int URUHA = 30652;
- private static final int CASIAN = 30612;
-
- // Monsters
- private static final int LAVA_SALAMANDER = 27116;
- private static final int NAHIR = 27117;
- private static final int BLACK_WILLOW = 27118;
-
public Q215_TrialOfThePilgrim()
{
super(215, "Trial of the Pilgrim");
-
registerQuestItems(BOOK_OF_SAGE, VOUCHER_OF_TRIAL, SPIRIT_OF_FLAME, ESSENCE_OF_FLAME, BOOK_OF_GERALD, GRAY_BADGE, PICTURE_OF_NAHIR, HAIR_OF_NAHIR, STATUE_OF_EINHASAD, BOOK_OF_DARKNESS, DEBRIS_OF_WILLOW, TAG_OF_RUMOR);
-
addStartNpc(SANTIAGO);
addTalkId(SANTIAGO, TANAPI, ANCESTOR_MARTANKUS, GAURI_TWINKLEROCK, DORF, GERALD, PRIMOS, PETRON, ANDELLIA, URUHA, CASIAN);
-
addKillId(LAVA_SALAMANDER, NAHIR, BLACK_WILLOW);
}
@@ -79,64 +73,69 @@ public class Q215_TrialOfThePilgrim extends Quest
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{
String htmltext = event;
-
final QuestState st = player.getQuestState(getName());
if (st == null)
{
return htmltext;
}
- if (event.equals("30648-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(VOUCHER_OF_TRIAL, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange35", false))
+ case "30648-04.htm":
{
- htmltext = "30648-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange35", true);
+ st.startQuest();
+ st.giveItems(VOUCHER_OF_TRIAL, 1);
+ if (!player.getVariables().getBoolean("secondClassChange35", false))
+ {
+ htmltext = "30648-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange35", true);
+ }
+ break;
}
- }
- else if (event.equals("30649-04.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ESSENCE_OF_FLAME, 1);
- st.giveItems(SPIRIT_OF_FLAME, 1);
- }
- else if (event.equals("30650-02.htm"))
- {
- if (st.getQuestItemsCount(57) >= 100000)
+ case "30649-04.htm":
{
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(57, 100000);
- st.giveItems(BOOK_OF_GERALD, 1);
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ESSENCE_OF_FLAME, 1);
+ st.giveItems(SPIRIT_OF_FLAME, 1);
+ break;
}
- else
+ case "30650-02.htm":
{
- htmltext = "30650-03.htm";
+ if (st.getQuestItemsCount(57) >= 100000)
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(57, 100000);
+ st.giveItems(BOOK_OF_GERALD, 1);
+ }
+ else
+ {
+ htmltext = "30650-03.htm";
+ }
+ break;
+ }
+ case "30652-02.htm":
+ {
+ st.setCond(15);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(DEBRIS_OF_WILLOW, 1);
+ st.giveItems(BOOK_OF_DARKNESS, 1);
+ break;
+ }
+ case "30362-04.htm":
+ {
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30362-05.htm":
+ {
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BOOK_OF_DARKNESS, 1);
+ break;
}
- }
- else if (event.equals("30652-02.htm"))
- {
- st.set("cond", "15");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(DEBRIS_OF_WILLOW, 1);
- st.giveItems(BOOK_OF_DARKNESS, 1);
- }
- else if (event.equals("30362-04.htm"))
- {
- st.set("cond", "16");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30362-05.htm"))
- {
- st.set("cond", "16");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BOOK_OF_DARKNESS, 1);
}
return htmltext;
@@ -155,6 +154,7 @@ public class Q215_TrialOfThePilgrim extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.CLERIC) && (player.getClassId() != ClassId.ORACLE) && (player.getClassId() != ClassId.SHILLIEN_ORACLE) && (player.getClassId() != ClassId.ORC_SHAMAN))
{
htmltext = "30648-02.htm";
@@ -168,12 +168,14 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30648-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SANTIAGO:
+ {
if (cond < 17)
{
htmltext = "30648-09.htm";
@@ -189,12 +191,13 @@ public class Q215_TrialOfThePilgrim extends Quest
st.exitQuest(false);
}
break;
-
+ }
case TANAPI:
+ {
if (cond == 1)
{
htmltext = "30571-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(VOUCHER_OF_TRIAL, 1);
}
@@ -208,17 +211,18 @@ public class Q215_TrialOfThePilgrim extends Quest
if (cond == 5)
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
break;
-
+ }
case ANCESTOR_MARTANKUS:
+ {
if (cond == 2)
{
htmltext = "30649-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 3)
@@ -230,12 +234,13 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30649-03.htm";
}
break;
-
+ }
case GAURI_TWINKLEROCK:
+ {
if (cond == 6)
{
htmltext = "30550-01.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(TAG_OF_RUMOR, 1);
}
@@ -244,12 +249,13 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30550-02.htm";
}
break;
-
+ }
case DORF:
+ {
if (cond == 7)
{
htmltext = (!st.hasQuestItems(BOOK_OF_GERALD)) ? "30651-01.htm" : "30651-02.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TAG_OF_RUMOR, 1);
st.giveItems(GRAY_BADGE, 1);
@@ -259,8 +265,9 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30651-03.htm";
}
break;
-
+ }
case GERALD:
+ {
if ((cond == 7) && !st.hasQuestItems(BOOK_OF_GERALD))
{
htmltext = "30650-01.htm";
@@ -273,12 +280,13 @@ public class Q215_TrialOfThePilgrim extends Quest
st.giveItems(57, 100000);
}
break;
-
+ }
case PRIMOS:
+ {
if (cond == 8)
{
htmltext = "30117-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond > 8)
@@ -286,12 +294,13 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30117-02.htm";
}
break;
-
+ }
case PETRON:
+ {
if (cond == 9)
{
htmltext = "30036-01.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(PICTURE_OF_NAHIR, 1);
}
@@ -302,7 +311,7 @@ public class Q215_TrialOfThePilgrim extends Quest
else if (cond == 11)
{
htmltext = "30036-03.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HAIR_OF_NAHIR, 1);
st.takeItems(PICTURE_OF_NAHIR, 1);
@@ -313,8 +322,9 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30036-04.htm";
}
break;
-
+ }
case ANDELLIA:
+ {
if (cond == 12)
{
if (player.getLevel() < 36)
@@ -324,7 +334,7 @@ public class Q215_TrialOfThePilgrim extends Quest
else
{
htmltext = "30362-01.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -345,8 +355,9 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30362-06.htm";
}
break;
-
+ }
case URUHA:
+ {
if (cond == 14)
{
htmltext = "30652-01.htm";
@@ -356,12 +367,13 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30652-03.htm";
}
break;
-
+ }
case CASIAN:
+ {
if (cond == 16)
{
htmltext = "30612-01.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BOOK_OF_DARKNESS, 1);
st.takeItems(GRAY_BADGE, 1);
@@ -374,12 +386,15 @@ public class Q215_TrialOfThePilgrim extends Quest
htmltext = "30612-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -397,25 +412,29 @@ public class Q215_TrialOfThePilgrim extends Quest
switch (npc.getNpcId())
{
case LAVA_SALAMANDER:
- if ((st.getInt("cond") == 3) && st.dropItems(ESSENCE_OF_FLAME, 1, 1, 200000))
+ {
+ if (st.isCond(3) && st.dropItems(ESSENCE_OF_FLAME, 1, 1, 200000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case NAHIR:
- if ((st.getInt("cond") == 10) && st.dropItems(HAIR_OF_NAHIR, 1, 1, 200000))
+ {
+ if (st.isCond(10) && st.dropItems(HAIR_OF_NAHIR, 1, 1, 200000))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case BLACK_WILLOW:
- if ((st.getInt("cond") == 13) && st.dropItems(DEBRIS_OF_WILLOW, 1, 1, 200000))
+ {
+ if (st.isCond(13) && st.dropItems(DEBRIS_OF_WILLOW, 1, 1, 200000))
{
- st.set("cond", "14");
+ st.setCond(14);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q216_TrialOfTheGuildsman/Q216_TrialOfTheGuildsman.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q216_TrialOfTheGuildsman/Q216_TrialOfTheGuildsman.java
index 3077419680..d9c8b131ad 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q216_TrialOfTheGuildsman/Q216_TrialOfTheGuildsman.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q216_TrialOfTheGuildsman/Q216_TrialOfTheGuildsman.java
@@ -27,6 +27,26 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q216_TrialOfTheGuildsman extends Quest
{
+ // NPCs
+ private static final int VALKON = 30103;
+ private static final int NORMAN = 30210;
+ private static final int ALTRAN = 30283;
+ private static final int PINTER = 30298;
+ private static final int DUNING = 30688;
+ // Monsters
+ private static final int ANT = 20079;
+ private static final int ANT_CAPTAIN = 20080;
+ private static final int GRANITE_GOLEM = 20083;
+ private static final int MANDRAGORA_SPROUT = 20154;
+ private static final int MANDRAGORA_SAPLING = 20155;
+ private static final int MANDRAGORA_BLOSSOM = 20156;
+ private static final int SILENOS = 20168;
+ private static final int STRAIN = 20200;
+ private static final int GHOUL = 20201;
+ private static final int DEAD_SEEKER = 20202;
+ private static final int BREKA_ORC_SHAMAN = 20269;
+ private static final int BREKA_ORC_OVERLORD = 20270;
+ private static final int BREKA_ORC_WARRIOR = 20271;
// Items
private static final int RECIPE_JOURNEYMAN_RING = 3024;
private static final int RECIPE_AMBER_BEAD = 3025;
@@ -50,42 +70,16 @@ public class Q216_TrialOfTheGuildsman extends Quest
private static final int AMBER_LUMP = 3137;
private static final int JOURNEYMAN_DECO_BEADS = 3138;
private static final int JOURNEYMAN_RING = 3139;
-
// Rewards
private static final int MARK_OF_GUILDSMAN = 3119;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int VALKON = 30103;
- private static final int NORMAN = 30210;
- private static final int ALTRAN = 30283;
- private static final int PINTER = 30298;
- private static final int DUNING = 30688;
-
- // Monsters
- private static final int ANT = 20079;
- private static final int ANT_CAPTAIN = 20080;
- private static final int GRANITE_GOLEM = 20083;
- private static final int MANDRAGORA_SPROUT = 20154;
- private static final int MANDRAGORA_SAPLING = 20155;
- private static final int MANDRAGORA_BLOSSOM = 20156;
- private static final int SILENOS = 20168;
- private static final int STRAIN = 20200;
- private static final int GHOUL = 20201;
- private static final int DEAD_SEEKER = 20202;
- private static final int BREKA_ORC_SHAMAN = 20269;
- private static final int BREKA_ORC_OVERLORD = 20270;
- private static final int BREKA_ORC_WARRIOR = 20271;
-
public Q216_TrialOfTheGuildsman()
{
super(216, "Trial of the Guildsman");
-
registerQuestItems(RECIPE_JOURNEYMAN_RING, RECIPE_AMBER_BEAD, VALKON_RECOMMENDATION, MANDRAGORA_BERRY, ALTRAN_INSTRUCTIONS, ALTRAN_RECOMMENDATION_1, ALTRAN_RECOMMENDATION_2, NORMAN_INSTRUCTIONS, NORMAN_RECEIPT, DUNING_INSTRUCTIONS, DUNING_KEY, NORMAN_LIST, GRAY_BONE_POWDER, GRANITE_WHETSTONE, RED_PIGMENT, BRAIDED_YARN, JOURNEYMAN_GEM, PINTER_INSTRUCTIONS, AMBER_BEAD, AMBER_LUMP, JOURNEYMAN_DECO_BEADS, JOURNEYMAN_RING);
-
addStartNpc(VALKON);
addTalkId(VALKON, NORMAN, ALTRAN, PINTER, DUNING);
-
addKillId(ANT, ANT_CAPTAIN, GRANITE_GOLEM, MANDRAGORA_SPROUT, MANDRAGORA_SAPLING, MANDRAGORA_BLOSSOM, SILENOS, STRAIN, GHOUL, DEAD_SEEKER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, BREKA_ORC_WARRIOR);
}
@@ -93,94 +87,103 @@ public class Q216_TrialOfTheGuildsman extends Quest
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{
String htmltext = event;
-
final QuestState st = player.getQuestState(getName());
if (st == null)
{
return htmltext;
}
- if (event.equals("30103-06.htm"))
+ switch (event)
{
- if (st.getQuestItemsCount(57) >= 2000)
+ case "30103-06.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.takeItems(57, 2000);
- st.giveItems(VALKON_RECOMMENDATION, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange35", false))
+ if (st.getQuestItemsCount(57) >= 2000)
{
- htmltext = "30103-06d.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange35", true);
+ st.startQuest();
+ st.takeItems(57, 2000);
+ st.giveItems(VALKON_RECOMMENDATION, 1);
+
+ if (!player.getVariables().getBoolean("secondClassChange35", false))
+ {
+ htmltext = "30103-06d.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_35.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange35", true);
+ }
}
+ else
+ {
+ htmltext = "30103-05a.htm";
+ }
+ break;
}
- else
+ case "30103-06c.htm":
+ case "30103-07c.htm":
{
- htmltext = "30103-05a.htm";
+ if (st.getCond() < 3)
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
}
- }
- else if (event.equals("30103-06c.htm") || event.equals("30103-07c.htm"))
- {
- if (st.getInt("cond") < 3)
+ case "30103-09a.htm":
+ case "30103-09b.htm":
{
- st.set("cond", "3");
+ st.takeItems(ALTRAN_INSTRUCTIONS, 1);
+ st.takeItems(JOURNEYMAN_RING, -1);
+ st.giveItems(MARK_OF_GUILDSMAN, 1);
+ st.rewardExpAndSp(80993, 12250);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "30210-04.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(ALTRAN_RECOMMENDATION_1, 1);
+ st.giveItems(NORMAN_INSTRUCTIONS, 1);
+ st.giveItems(NORMAN_RECEIPT, 1);
+ break;
+ }
+ case "30210-10.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(NORMAN_LIST, 1);
+ break;
+ }
+ case "30283-03.htm":
+ {
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MANDRAGORA_BERRY, 1);
+ st.takeItems(VALKON_RECOMMENDATION, 1);
+ st.giveItems(ALTRAN_INSTRUCTIONS, 1);
+ st.giveItems(ALTRAN_RECOMMENDATION_1, 1);
+ st.giveItems(ALTRAN_RECOMMENDATION_2, 1);
+ st.giveItems(RECIPE_JOURNEYMAN_RING, 1);
+ break;
}
- }
- else if (event.equals("30103-09a.htm") || event.equals("30103-09b.htm"))
- {
- st.takeItems(ALTRAN_INSTRUCTIONS, 1);
- st.takeItems(JOURNEYMAN_RING, -1);
- st.giveItems(MARK_OF_GUILDSMAN, 1);
- st.rewardExpAndSp(80993, 12250);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else if (event.equals("30210-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(ALTRAN_RECOMMENDATION_1, 1);
- st.giveItems(NORMAN_INSTRUCTIONS, 1);
- st.giveItems(NORMAN_RECEIPT, 1);
- }
- else if (event.equals("30210-10.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(NORMAN_LIST, 1);
- }
- else if (event.equals("30283-03.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MANDRAGORA_BERRY, 1);
- st.takeItems(VALKON_RECOMMENDATION, 1);
- st.giveItems(ALTRAN_INSTRUCTIONS, 1);
- st.giveItems(ALTRAN_RECOMMENDATION_1, 1);
- st.giveItems(ALTRAN_RECOMMENDATION_2, 1);
- st.giveItems(RECIPE_JOURNEYMAN_RING, 1);
- }
- else if (event.equals("30298-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(ALTRAN_RECOMMENDATION_2, 1);
- st.giveItems(PINTER_INSTRUCTIONS, 1);
-
- // Artisan receives a recipe to craft Amber Beads, while spoiler case is handled in onKill section.
- if (player.getClassId() == ClassId.ARTISAN)
+ case "30298-04.htm":
{
- htmltext = "30298-05.htm";
- st.giveItems(RECIPE_AMBER_BEAD, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(ALTRAN_RECOMMENDATION_2, 1);
+ st.giveItems(PINTER_INSTRUCTIONS, 1);
+ // Artisan receives a recipe to craft Amber Beads, while spoiler case is handled in onKill section.
+ if (player.getClassId() == ClassId.ARTISAN)
+ {
+ htmltext = "30298-05.htm";
+ st.giveItems(RECIPE_AMBER_BEAD, 1);
+ }
+ break;
+ }
+ case "30688-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(NORMAN_RECEIPT, 1);
+ st.giveItems(DUNING_INSTRUCTIONS, 1);
+ break;
}
- }
- else if (event.equals("30688-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(NORMAN_RECEIPT, 1);
- st.giveItems(DUNING_INSTRUCTIONS, 1);
}
return htmltext;
@@ -199,6 +202,7 @@ public class Q216_TrialOfTheGuildsman extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.SCAVENGER) && (player.getClassId() != ClassId.ARTISAN))
{
htmltext = "30103-01.htm";
@@ -212,12 +216,14 @@ public class Q216_TrialOfTheGuildsman extends Quest
htmltext = "30103-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VALKON:
+ {
if (cond == 1)
{
htmltext = "30103-06c.htm";
@@ -235,14 +241,15 @@ public class Q216_TrialOfTheGuildsman extends Quest
htmltext = (st.getQuestItemsCount(JOURNEYMAN_RING) == 7) ? "30103-09.htm" : "30103-08.htm";
}
break;
-
+ }
case ALTRAN:
+ {
if (cond < 4)
{
htmltext = "30283-01.htm";
if (cond == 1)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -255,8 +262,9 @@ public class Q216_TrialOfTheGuildsman extends Quest
htmltext = "30283-04.htm";
}
break;
-
+ }
case NORMAN:
+ {
if (cond == 5)
{
if (st.hasQuestItems(ALTRAN_RECOMMENDATION_1))
@@ -292,7 +300,7 @@ public class Q216_TrialOfTheGuildsman extends Quest
if (st.getQuestItemsCount(JOURNEYMAN_DECO_BEADS) == 7)
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -307,8 +315,9 @@ public class Q216_TrialOfTheGuildsman extends Quest
}
}
break;
-
+ }
case DUNING:
+ {
if (cond == 5)
{
if (st.hasQuestItems(NORMAN_RECEIPT))
@@ -334,8 +343,9 @@ public class Q216_TrialOfTheGuildsman extends Quest
}
}
break;
-
+ }
case PINTER:
+ {
if (cond == 5)
{
if (st.hasQuestItems(ALTRAN_RECOMMENDATION_2))
@@ -357,7 +367,7 @@ public class Q216_TrialOfTheGuildsman extends Quest
if (st.getQuestItemsCount(JOURNEYMAN_GEM) == 7)
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -372,12 +382,15 @@ public class Q216_TrialOfTheGuildsman extends Quest
htmltext = "30298-08.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -397,61 +410,66 @@ public class Q216_TrialOfTheGuildsman extends Quest
case MANDRAGORA_SPROUT:
case MANDRAGORA_SAPLING:
case MANDRAGORA_BLOSSOM:
- if ((st.getInt("cond") == 3) && st.dropItemsAlways(MANDRAGORA_BERRY, 1, 1))
+ {
+ if (st.isCond(3) && st.dropItemsAlways(MANDRAGORA_BERRY, 1, 1))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case BREKA_ORC_WARRIOR:
case BREKA_ORC_OVERLORD:
case BREKA_ORC_SHAMAN:
+ {
if (st.hasQuestItems(DUNING_INSTRUCTIONS))
{
st.dropItemsAlways(DUNING_KEY, 1, 30);
}
break;
-
+ }
case GHOUL:
case STRAIN:
+ {
if (st.hasQuestItems(NORMAN_LIST))
{
st.dropItemsAlways(GRAY_BONE_POWDER, 5, 70);
}
break;
-
+ }
case GRANITE_GOLEM:
+ {
if (st.hasQuestItems(NORMAN_LIST))
{
st.dropItemsAlways(GRANITE_WHETSTONE, 7, 70);
}
break;
-
+ }
case DEAD_SEEKER:
+ {
if (st.hasQuestItems(NORMAN_LIST))
{
st.dropItemsAlways(RED_PIGMENT, 7, 70);
}
break;
-
+ }
case SILENOS:
+ {
if (st.hasQuestItems(NORMAN_LIST))
{
st.dropItemsAlways(BRAIDED_YARN, 10, 70);
}
break;
-
+ }
case ANT:
case ANT_CAPTAIN:
- if (st.hasQuestItems(PINTER_INSTRUCTIONS))
+ {
+ // Different cases if player is a wannabe BH or WS.
+ if (st.hasQuestItems(PINTER_INSTRUCTIONS) && st.dropItemsAlways(AMBER_BEAD, ((player.getClassId() == ClassId.SCAVENGER) && (npc.getSpoiledBy() == player.getObjectId())) ? 10 : 5, 70) && (player.getClassId() == ClassId.ARTISAN) && Rnd.nextBoolean())
{
- // Different cases if player is a wannabe BH or WS.
- if (st.dropItemsAlways(AMBER_BEAD, ((player.getClassId() == ClassId.SCAVENGER) && (npc.getSpoiledBy() == player.getObjectId())) ? 10 : 5, 70) && (player.getClassId() == ClassId.ARTISAN) && Rnd.nextBoolean())
- {
- st.giveItems(AMBER_LUMP, 1);
- }
+ st.giveItems(AMBER_LUMP, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q217_TestimonyOfTrust/Q217_TestimonyOfTrust.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q217_TestimonyOfTrust/Q217_TestimonyOfTrust.java
index 7e9557da9c..e274023430 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q217_TestimonyOfTrust/Q217_TestimonyOfTrust.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q217_TestimonyOfTrust/Q217_TestimonyOfTrust.java
@@ -27,6 +27,36 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q217_TestimonyOfTrust extends Quest
{
+ // NPCs
+ private static final int HOLLINT = 30191;
+ private static final int ASTERIOS = 30154;
+ private static final int THIFIELL = 30358;
+ private static final int CLAYTON = 30464;
+ private static final int SERESIN = 30657;
+ private static final int KAKAI = 30565;
+ private static final int MANAKIA = 30515;
+ private static final int LOCKIRIN = 30531;
+ private static final int NIKOLA = 30621;
+ private static final int BIOTIN = 30031;
+ // Monsters
+ private static final int DRYAD = 20013;
+ private static final int DRYAD_ELDER = 20019;
+ private static final int LIREIN = 20036;
+ private static final int LIREIN_ELDER = 20044;
+ private static final int ACTEA_OF_VERDANT_WILDS = 27121;
+ private static final int LUELL_OF_ZEPHYR_WINDS = 27120;
+ private static final int GUARDIAN_BASILIK = 20550;
+ private static final int ANT_RECRUIT = 20082;
+ private static final int ANT_PATROL = 20084;
+ private static final int ANT_GUARD = 20086;
+ private static final int ANT_SOLDIER = 20087;
+ private static final int ANT_WARRIOR_CAPTAIN = 20088;
+ private static final int MARSH_STAKATO = 20157;
+ private static final int MARSH_STAKATO_WORKER = 20230;
+ private static final int MARSH_STAKATO_SOLDIER = 20232;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int WINDSUS = 20553;
+ private static final int PORTA = 20213;
// Items
private static final int LETTER_TO_ELF = 2735;
private static final int LETTER_TO_DARK_ELF = 2736;
@@ -55,52 +85,16 @@ public class Q217_TestimonyOfTrust extends Quest
private static final int LETTER_TO_NIKOLA = 2759;
private static final int ORDER_OF_NIKOLA = 2760;
private static final int HEARTSTONE_OF_PORTA = 2761;
-
// Rewards
private static final int MARK_OF_TRUST = 2734;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int HOLLINT = 30191;
- private static final int ASTERIOS = 30154;
- private static final int THIFIELL = 30358;
- private static final int CLAYTON = 30464;
- private static final int SERESIN = 30657;
- private static final int KAKAI = 30565;
- private static final int MANAKIA = 30515;
- private static final int LOCKIRIN = 30531;
- private static final int NIKOLA = 30621;
- private static final int BIOTIN = 30031;
-
- // Monsters
- private static final int DRYAD = 20013;
- private static final int DRYAD_ELDER = 20019;
- private static final int LIREIN = 20036;
- private static final int LIREIN_ELDER = 20044;
- private static final int ACTEA_OF_VERDANT_WILDS = 27121;
- private static final int LUELL_OF_ZEPHYR_WINDS = 27120;
- private static final int GUARDIAN_BASILIK = 20550;
- private static final int ANT_RECRUIT = 20082;
- private static final int ANT_PATROL = 20084;
- private static final int ANT_GUARD = 20086;
- private static final int ANT_SOLDIER = 20087;
- private static final int ANT_WARRIOR_CAPTAIN = 20088;
- private static final int MARSH_STAKATO = 20157;
- private static final int MARSH_STAKATO_WORKER = 20230;
- private static final int MARSH_STAKATO_SOLDIER = 20232;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int WINDSUS = 20553;
- private static final int PORTA = 20213;
-
public Q217_TestimonyOfTrust()
{
super(217, "Testimony of Trust");
-
registerQuestItems(LETTER_TO_ELF, LETTER_TO_DARK_ELF, LETTER_TO_DWARF, LETTER_TO_ORC, LETTER_TO_SERESIN, SCROLL_OF_DARK_ELF_TRUST, SCROLL_OF_ELF_TRUST, SCROLL_OF_DWARF_TRUST, SCROLL_OF_ORC_TRUST, RECOMMENDATION_OF_HOLLINT, ORDER_OF_ASTERIOS, BREATH_OF_WINDS, SEED_OF_VERDURE, LETTER_FROM_THIFIELL, BLOOD_GUARDIAN_BASILIK, GIANT_APHID, STAKATO_FLUIDS, BASILIK_PLASMA, HONEY_DEW, STAKATO_ICHOR, ORDER_OF_CLAYTON, PARASITE_OF_LOTA, LETTER_TO_MANAKIA, LETTER_OF_MANAKIA, LETTER_TO_NIKOLA, ORDER_OF_NIKOLA, HEARTSTONE_OF_PORTA);
-
addStartNpc(HOLLINT);
addTalkId(HOLLINT, ASTERIOS, THIFIELL, CLAYTON, SERESIN, KAKAI, MANAKIA, LOCKIRIN, NIKOLA, BIOTIN);
-
addKillId(DRYAD, DRYAD_ELDER, LIREIN, LIREIN_ELDER, ACTEA_OF_VERDANT_WILDS, LUELL_OF_ZEPHYR_WINDS, GUARDIAN_BASILIK, ANT_RECRUIT, ANT_PATROL, ANT_GUARD, ANT_SOLDIER, ANT_WARRIOR_CAPTAIN, MARSH_STAKATO, MARSH_STAKATO_WORKER, MARSH_STAKATO_SOLDIER, MARSH_STAKATO_DRONE, WINDSUS, PORTA);
}
@@ -108,87 +102,94 @@ public class Q217_TestimonyOfTrust extends Quest
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{
String htmltext = event;
-
final QuestState st = player.getQuestState(getName());
if (st == null)
{
return htmltext;
}
- if (event.equals("30191-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LETTER_TO_ELF, 1);
- st.giveItems(LETTER_TO_DARK_ELF, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange37", false))
+ case "30191-04.htm":
{
- htmltext = "30191-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
- player.getVariables().set("secondClassChange37", true);
- }
- }
- else if (event.equals("30154-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_ELF, 1);
- st.giveItems(ORDER_OF_ASTERIOS, 1);
- }
- else if (event.equals("30358-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_DARK_ELF, 1);
- st.giveItems(LETTER_FROM_THIFIELL, 1);
- }
- else if (event.equals("30515-02.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_MANAKIA, 1);
- }
- else if (event.equals("30531-02.htm"))
- {
- st.set("cond", "18");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_DWARF, 1);
- st.giveItems(LETTER_TO_NIKOLA, 1);
- }
- else if (event.equals("30565-02.htm"))
- {
- st.set("cond", "13");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_ORC, 1);
- st.giveItems(LETTER_TO_MANAKIA, 1);
- }
- else if (event.equals("30621-02.htm"))
- {
- st.set("cond", "19");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_NIKOLA, 1);
- st.giveItems(ORDER_OF_NIKOLA, 1);
- }
- else if (event.equals("30657-03.htm"))
- {
- if (player.getLevel() < 38)
- {
- htmltext = "30657-02.htm";
- if (st.getInt("cond") == 10)
+ st.startQuest();
+ st.giveItems(LETTER_TO_ELF, 1);
+ st.giveItems(LETTER_TO_DARK_ELF, 1);
+ if (!player.getVariables().getBoolean("secondClassChange37", false))
{
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_MIDDLE);
+ htmltext = "30191-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
+ player.getVariables().set("secondClassChange37", true);
}
+ break;
}
- else
+ case "30154-03.htm":
{
- st.set("cond", "12");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_TO_SERESIN, 1);
- st.giveItems(LETTER_TO_DWARF, 1);
- st.giveItems(LETTER_TO_ORC, 1);
+ st.takeItems(LETTER_TO_ELF, 1);
+ st.giveItems(ORDER_OF_ASTERIOS, 1);
+ break;
+ }
+ case "30358-02.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_DARK_ELF, 1);
+ st.giveItems(LETTER_FROM_THIFIELL, 1);
+ break;
+ }
+ case "30515-02.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_MANAKIA, 1);
+ break;
+ }
+ case "30531-02.htm":
+ {
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_DWARF, 1);
+ st.giveItems(LETTER_TO_NIKOLA, 1);
+ break;
+ }
+ case "30565-02.htm":
+ {
+ st.setCond(13);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_ORC, 1);
+ st.giveItems(LETTER_TO_MANAKIA, 1);
+ break;
+ }
+ case "30621-02.htm":
+ {
+ st.setCond(19);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_NIKOLA, 1);
+ st.giveItems(ORDER_OF_NIKOLA, 1);
+ break;
+ }
+ case "30657-03.htm":
+ {
+ if (player.getLevel() < 38)
+ {
+ htmltext = "30657-02.htm";
+ if (st.isCond(10))
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ }
+ else
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_TO_SERESIN, 1);
+ st.giveItems(LETTER_TO_DWARF, 1);
+ st.giveItems(LETTER_TO_ORC, 1);
+ }
+ break;
}
}
@@ -208,6 +209,7 @@ public class Q217_TestimonyOfTrust extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId().level() != 1)
{
htmltext = "30191-01a.htm";
@@ -225,12 +227,14 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30191-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HOLLINT:
+ {
if (cond < 9)
{
htmltext = "30191-08.htm";
@@ -238,7 +242,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 9)
{
htmltext = "30191-05.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SCROLL_OF_DARK_ELF_TRUST, 1);
st.takeItems(SCROLL_OF_ELF_TRUST, 1);
@@ -251,7 +255,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 22)
{
htmltext = "30191-06.htm";
- st.set("cond", "23");
+ st.setCond(23);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SCROLL_OF_DWARF_TRUST, 1);
st.takeItems(SCROLL_OF_ORC_TRUST, 1);
@@ -262,8 +266,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30191-07.htm";
}
break;
-
+ }
case ASTERIOS:
+ {
if (cond == 1)
{
htmltext = "30154-01.htm";
@@ -275,7 +280,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 3)
{
htmltext = "30154-05.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BREATH_OF_WINDS, 1);
st.takeItems(SEED_OF_VERDURE, 1);
@@ -287,8 +292,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30154-06.htm";
}
break;
-
+ }
case THIFIELL:
+ {
if (cond == 4)
{
htmltext = "30358-01.htm";
@@ -300,7 +306,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 8)
{
htmltext = "30358-03.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BASILIK_PLASMA, 1);
st.takeItems(HONEY_DEW, 1);
@@ -312,12 +318,13 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30358-04.htm";
}
break;
-
+ }
case CLAYTON:
+ {
if (cond == 5)
{
htmltext = "30464-01.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LETTER_FROM_THIFIELL, 1);
st.giveItems(ORDER_OF_CLAYTON, 1);
@@ -331,14 +338,15 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30464-03.htm";
if (cond == 7)
{
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ORDER_OF_CLAYTON, 1);
}
}
break;
-
+ }
case SERESIN:
+ {
if ((cond == 10) || (cond == 11))
{
htmltext = "30657-01.htm";
@@ -352,8 +360,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30657-05.htm";
}
break;
-
+ }
case KAKAI:
+ {
if (cond == 12)
{
htmltext = "30565-01.htm";
@@ -365,7 +374,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 16)
{
htmltext = "30565-04.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LETTER_OF_MANAKIA, 1);
st.giveItems(SCROLL_OF_ORC_TRUST, 1);
@@ -375,8 +384,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30565-05.htm";
}
break;
-
+ }
case MANAKIA:
+ {
if (cond == 13)
{
htmltext = "30515-01.htm";
@@ -388,7 +398,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 15)
{
htmltext = "30515-04.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PARASITE_OF_LOTA, -1);
st.giveItems(LETTER_OF_MANAKIA, 1);
@@ -398,8 +408,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30515-05.htm";
}
break;
-
+ }
case LOCKIRIN:
+ {
if (cond == 17)
{
htmltext = "30531-01.htm";
@@ -411,7 +422,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 21)
{
htmltext = "30531-04.htm";
- st.set("cond", "22");
+ st.setCond(22);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SCROLL_OF_DWARF_TRUST, 1);
}
@@ -420,8 +431,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30531-05.htm";
}
break;
-
+ }
case NIKOLA:
+ {
if (cond == 18)
{
htmltext = "30621-01.htm";
@@ -433,7 +445,7 @@ public class Q217_TestimonyOfTrust extends Quest
else if (cond == 20)
{
htmltext = "30621-04.htm";
- st.set("cond", "21");
+ st.setCond(21);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HEARTSTONE_OF_PORTA, -1);
st.takeItems(ORDER_OF_NIKOLA, 1);
@@ -443,8 +455,9 @@ public class Q217_TestimonyOfTrust extends Quest
htmltext = "30621-05.htm";
}
break;
-
+ }
case BIOTIN:
+ {
if (cond == 23)
{
htmltext = "30031-01.htm";
@@ -456,12 +469,15 @@ public class Q217_TestimonyOfTrust extends Quest
st.exitQuest(false);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -476,34 +492,36 @@ public class Q217_TestimonyOfTrust extends Quest
return null;
}
- final int npcId = npc.getNpcId();
- switch (npcId)
+ switch (npc.getNpcId())
{
case DRYAD:
case DRYAD_ELDER:
- if ((st.getInt("cond") == 2) && !st.hasQuestItems(SEED_OF_VERDURE) && (Rnd.get(100) < 33))
+ {
+ if (st.isCond(2) && !st.hasQuestItems(SEED_OF_VERDURE) && (Rnd.get(100) < 33))
{
addSpawn(ACTEA_OF_VERDANT_WILDS, npc, true, 200000);
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
}
break;
-
+ }
case LIREIN:
case LIREIN_ELDER:
- if ((st.getInt("cond") == 2) && !st.hasQuestItems(BREATH_OF_WINDS) && (Rnd.get(100) < 33))
+ {
+ if (st.isCond(2) && !st.hasQuestItems(BREATH_OF_WINDS) && (Rnd.get(100) < 33))
{
addSpawn(LUELL_OF_ZEPHYR_WINDS, npc, true, 200000);
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
}
break;
-
+ }
case ACTEA_OF_VERDANT_WILDS:
- if ((st.getInt("cond") == 2) && !st.hasQuestItems(SEED_OF_VERDURE))
+ {
+ if (st.isCond(2) && !st.hasQuestItems(SEED_OF_VERDURE))
{
st.giveItems(SEED_OF_VERDURE, 1);
if (st.hasQuestItems(BREATH_OF_WINDS))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -512,14 +530,15 @@ public class Q217_TestimonyOfTrust extends Quest
}
}
break;
-
+ }
case LUELL_OF_ZEPHYR_WINDS:
- if ((st.getInt("cond") == 2) && !st.hasQuestItems(BREATH_OF_WINDS))
+ {
+ if (st.isCond(2) && !st.hasQuestItems(BREATH_OF_WINDS))
{
st.giveItems(BREATH_OF_WINDS, 1);
if (st.hasQuestItems(SEED_OF_VERDURE))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -528,66 +547,72 @@ public class Q217_TestimonyOfTrust extends Quest
}
}
break;
-
+ }
case MARSH_STAKATO:
case MARSH_STAKATO_WORKER:
case MARSH_STAKATO_SOLDIER:
case MARSH_STAKATO_DRONE:
- if ((st.getInt("cond") == 6) && !st.hasQuestItems(STAKATO_ICHOR) && st.dropItemsAlways(STAKATO_FLUIDS, 1, 10))
+ {
+ if (st.isCond(6) && !st.hasQuestItems(STAKATO_ICHOR) && st.dropItemsAlways(STAKATO_FLUIDS, 1, 10))
{
st.takeItems(STAKATO_FLUIDS, -1);
st.giveItems(STAKATO_ICHOR, 1);
if (st.hasQuestItems(BASILIK_PLASMA, HONEY_DEW))
{
- st.set("cond", "7");
+ st.setCond(7);
}
}
break;
-
+ }
case ANT_RECRUIT:
case ANT_PATROL:
case ANT_GUARD:
case ANT_SOLDIER:
case ANT_WARRIOR_CAPTAIN:
- if ((st.getInt("cond") == 6) && !st.hasQuestItems(HONEY_DEW) && st.dropItemsAlways(GIANT_APHID, 1, 10))
+ {
+ if (st.isCond(6) && !st.hasQuestItems(HONEY_DEW) && st.dropItemsAlways(GIANT_APHID, 1, 10))
{
st.takeItems(GIANT_APHID, -1);
st.giveItems(HONEY_DEW, 1);
if (st.hasQuestItems(BASILIK_PLASMA, STAKATO_ICHOR))
{
- st.set("cond", "7");
+ st.setCond(7);
}
}
break;
-
+ }
case GUARDIAN_BASILIK:
- if ((st.getInt("cond") == 6) && !st.hasQuestItems(BASILIK_PLASMA) && st.dropItemsAlways(BLOOD_GUARDIAN_BASILIK, 1, 10))
+ {
+ if (st.isCond(6) && !st.hasQuestItems(BASILIK_PLASMA) && st.dropItemsAlways(BLOOD_GUARDIAN_BASILIK, 1, 10))
{
st.takeItems(BLOOD_GUARDIAN_BASILIK, -1);
st.giveItems(BASILIK_PLASMA, 1);
if (st.hasQuestItems(HONEY_DEW, STAKATO_ICHOR))
{
- st.set("cond", "7");
+ st.setCond(7);
}
}
break;
-
+ }
case WINDSUS:
- if ((st.getInt("cond") == 14) && st.dropItems(PARASITE_OF_LOTA, 1, 10, 500000))
+ {
+ if (st.isCond(14) && st.dropItems(PARASITE_OF_LOTA, 1, 10, 500000))
{
- st.set("cond", "15");
+ st.setCond(15);
}
break;
-
+ }
case PORTA:
- if ((st.getInt("cond") == 19) && st.dropItemsAlways(HEARTSTONE_OF_PORTA, 1, 10))
+ {
+ if (st.isCond(19) && st.dropItemsAlways(HEARTSTONE_OF_PORTA, 1, 10))
{
- st.set("cond", "20");
+ st.setCond(20);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q218_TestimonyOfLife/Q218_TestimonyOfLife.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q218_TestimonyOfLife/Q218_TestimonyOfLife.java
index 8ccb482186..899ac5dc89 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q218_TestimonyOfLife/Q218_TestimonyOfLife.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q218_TestimonyOfLife/Q218_TestimonyOfLife.java
@@ -36,7 +36,6 @@ public class Q218_TestimonyOfLife extends Quest
private static final int ARKENIA = 30419;
private static final int CARDIEN = 30460;
private static final int ISAEL = 30655;
-
// Items
private static final int TALINS_SPEAR = 3026;
private static final int CARDIEN_LETTER = 3141;
@@ -64,7 +63,6 @@ public class Q218_TestimonyOfLife extends Quest
private static final int WYRM_TALON = 3163;
private static final int SPIDER_ICHOR = 3164;
private static final int HARPY_DOWN = 3165;
-
private static final int[] TALINS_PIECES =
{
3166,
@@ -74,7 +72,6 @@ public class Q218_TestimonyOfLife extends Quest
3170,
3171
};
-
// Rewards
private static final int MARK_OF_LIFE = 3140;
private static final int DIMENSIONAL_DIAMOND = 7562;
@@ -82,12 +79,9 @@ public class Q218_TestimonyOfLife extends Quest
public Q218_TestimonyOfLife()
{
super(218, "Testimony of Life");
-
registerQuestItems(TALINS_SPEAR, CARDIEN_LETTER, CAMOMILE_CHARM, HIERARCH_LETTER, MOONFLOWER_CHARM, GRAIL_DIAGRAM, THALIA_LETTER_1, THALIA_LETTER_2, THALIA_INSTRUCTIONS, PUSHKIN_LIST, PURE_MITHRIL_CUP, ARKENIA_CONTRACT, ARKENIA_INSTRUCTIONS, ADONIUS_LIST, ANDARIEL_SCRIPTURE_COPY, STARDUST, ISAEL_INSTRUCTIONS, ISAEL_LETTER, GRAIL_OF_PURITY, TEARS_OF_UNICORN, WATER_OF_LIFE, PURE_MITHRIL_ORE, ANT_SOLDIER_ACID, WYRM_TALON, SPIDER_ICHOR, HARPY_DOWN, 3166, 3167, 3168, 3169, 3170, 3171);
-
addStartNpc(CARDIEN);
addTalkId(ASTERIOS, PUSHKIN, THALIA, ADONIUS, ARKENIA, CARDIEN, ISAEL);
-
addKillId(20145, 20176, 20233, 27077, 20550, 20581, 20582, 20082, 20084, 20086, 20087, 20088);
}
@@ -101,90 +95,98 @@ public class Q218_TestimonyOfLife extends Quest
return htmltext;
}
- if (event.equals("30460-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(CARDIEN_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange37", false))
+ case "30460-04.htm":
{
- htmltext = "30460-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
- player.getVariables().set("secondClassChange37", true);
+ st.startQuest();
+ st.giveItems(CARDIEN_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange37", false))
+ {
+ htmltext = "30460-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
+ player.getVariables().set("secondClassChange37", true);
+ }
+ break;
}
- }
- else if (event.equals("30154-07.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CARDIEN_LETTER, 1);
- st.giveItems(HIERARCH_LETTER, 1);
- st.giveItems(MOONFLOWER_CHARM, 1);
- }
- else if (event.equals("30371-03.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HIERARCH_LETTER, 1);
- st.giveItems(GRAIL_DIAGRAM, 1);
- }
- else if (event.equals("30371-11.htm"))
- {
- st.takeItems(STARDUST, 1);
- st.playSound(QuestState.SOUND_MIDDLE);
-
- if (player.getLevel() < 38)
+ case "30154-07.htm":
{
- htmltext = "30371-10.htm";
- st.set("cond", "13");
- st.giveItems(THALIA_INSTRUCTIONS, 1);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CARDIEN_LETTER, 1);
+ st.giveItems(HIERARCH_LETTER, 1);
+ st.giveItems(MOONFLOWER_CHARM, 1);
+ break;
}
- else
+ case "30371-03.htm":
{
- st.set("cond", "14");
- st.giveItems(THALIA_LETTER_2, 1);
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HIERARCH_LETTER, 1);
+ st.giveItems(GRAIL_DIAGRAM, 1);
+ break;
+ }
+ case "30371-11.htm":
+ {
+ st.takeItems(STARDUST, 1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ if (player.getLevel() < 38)
+ {
+ htmltext = "30371-10.htm";
+ st.setCond(13);
+ st.giveItems(THALIA_INSTRUCTIONS, 1);
+ }
+ else
+ {
+ st.setCond(14);
+ st.giveItems(THALIA_LETTER_2, 1);
+ }
+ break;
+ }
+ case "30300-06.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GRAIL_DIAGRAM, 1);
+ st.giveItems(PUSHKIN_LIST, 1);
+ break;
+ }
+ case "30300-10.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PUSHKIN_LIST, 1);
+ st.takeItems(ANT_SOLDIER_ACID, -1);
+ st.takeItems(PURE_MITHRIL_ORE, -1);
+ st.takeItems(WYRM_TALON, -1);
+ st.giveItems(PURE_MITHRIL_CUP, 1);
+ break;
+ }
+ case "30419-04.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(THALIA_LETTER_1, 1);
+ st.giveItems(ARKENIA_CONTRACT, 1);
+ st.giveItems(ARKENIA_INSTRUCTIONS, 1);
+ break;
+ }
+ case "30375-02.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARKENIA_INSTRUCTIONS, 1);
+ st.giveItems(ADONIUS_LIST, 1);
+ break;
+ }
+ case "30655-02.htm":
+ {
+ st.setCond(15);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(THALIA_LETTER_2, 1);
+ st.giveItems(ISAEL_INSTRUCTIONS, 1);
+ break;
}
- }
- else if (event.equals("30300-06.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GRAIL_DIAGRAM, 1);
- st.giveItems(PUSHKIN_LIST, 1);
- }
- else if (event.equals("30300-10.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PUSHKIN_LIST, 1);
- st.takeItems(ANT_SOLDIER_ACID, -1);
- st.takeItems(PURE_MITHRIL_ORE, -1);
- st.takeItems(WYRM_TALON, -1);
- st.giveItems(PURE_MITHRIL_CUP, 1);
- }
- else if (event.equals("30419-04.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(THALIA_LETTER_1, 1);
- st.giveItems(ARKENIA_CONTRACT, 1);
- st.giveItems(ARKENIA_INSTRUCTIONS, 1);
- }
- else if (event.equals("30375-02.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARKENIA_INSTRUCTIONS, 1);
- st.giveItems(ADONIUS_LIST, 1);
- }
- else if (event.equals("30655-02.htm"))
- {
- st.set("cond", "15");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(THALIA_LETTER_2, 1);
- st.giveItems(ISAEL_INSTRUCTIONS, 1);
}
return htmltext;
@@ -203,6 +205,7 @@ public class Q218_TestimonyOfLife extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30460-01.htm";
@@ -216,12 +219,14 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30460-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ASTERIOS:
+ {
if (cond == 1)
{
htmltext = "30154-01.htm";
@@ -233,7 +238,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 20)
{
htmltext = "30154-09.htm";
- st.set("cond", "21");
+ st.setCond(21);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MOONFLOWER_CHARM, 1);
st.takeItems(WATER_OF_LIFE, 1);
@@ -244,8 +249,9 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30154-10.htm";
}
break;
-
+ }
case PUSHKIN:
+ {
if (cond == 3)
{
htmltext = "30300-01.htm";
@@ -267,8 +273,9 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30300-12.htm";
}
break;
-
+ }
case THALIA:
+ {
if (cond == 2)
{
htmltext = "30371-01.htm";
@@ -284,7 +291,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 6)
{
htmltext = "30371-06.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PURE_MITHRIL_CUP, 1);
st.giveItems(THALIA_LETTER_1, 1);
@@ -310,7 +317,7 @@ public class Q218_TestimonyOfLife extends Quest
else
{
htmltext = "30371-13.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(THALIA_INSTRUCTIONS, 1);
st.giveItems(THALIA_LETTER_2, 1);
@@ -327,7 +334,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 17)
{
htmltext = "30371-16.htm";
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ISAEL_LETTER, 1);
st.giveItems(GRAIL_OF_PURITY, 1);
@@ -339,7 +346,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 19)
{
htmltext = "30371-18.htm";
- st.set("cond", "20");
+ st.setCond(20);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TEARS_OF_UNICORN, 1);
st.giveItems(WATER_OF_LIFE, 1);
@@ -349,8 +356,9 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30371-19.htm";
}
break;
-
+ }
case ADONIUS:
+ {
if (cond == 8)
{
htmltext = "30375-01.htm";
@@ -362,7 +370,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 10)
{
htmltext = "30375-04.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ADONIUS_LIST, 1);
st.takeItems(HARPY_DOWN, -1);
@@ -378,8 +386,9 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30375-06.htm";
}
break;
-
+ }
case ARKENIA:
+ {
if (cond == 7)
{
htmltext = "30419-01.htm";
@@ -391,7 +400,7 @@ public class Q218_TestimonyOfLife extends Quest
else if (cond == 11)
{
htmltext = "30419-06.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ANDARIEL_SCRIPTURE_COPY, 1);
st.takeItems(ARKENIA_CONTRACT, 1);
@@ -406,8 +415,9 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30419-08.htm";
}
break;
-
+ }
case CARDIEN:
+ {
if (cond == 1)
{
htmltext = "30460-05.htm";
@@ -427,8 +437,9 @@ public class Q218_TestimonyOfLife extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ISAEL:
+ {
if (cond == 14)
{
htmltext = "30655-01.htm";
@@ -442,7 +453,7 @@ public class Q218_TestimonyOfLife extends Quest
if (st.hasQuestItems(TALINS_PIECES))
{
htmltext = "30655-04.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
for (int itemId : TALINS_PIECES)
@@ -468,13 +479,16 @@ public class Q218_TestimonyOfLife extends Quest
htmltext = "30655-06.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -492,58 +506,65 @@ public class Q218_TestimonyOfLife extends Quest
switch (npc.getNpcId())
{
case 20550:
- if ((st.getInt("cond") == 4) && st.dropItems(PURE_MITHRIL_ORE, 1, 10, 500000) && (st.getQuestItemsCount(WYRM_TALON) >= 20) && (st.getQuestItemsCount(ANT_SOLDIER_ACID) >= 20))
+ {
+ if (st.isCond(4) && st.dropItems(PURE_MITHRIL_ORE, 1, 10, 500000) && (st.getQuestItemsCount(WYRM_TALON) >= 20) && (st.getQuestItemsCount(ANT_SOLDIER_ACID) >= 20))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case 20176:
- if ((st.getInt("cond") == 4) && st.dropItems(WYRM_TALON, 1, 20, 500000) && (st.getQuestItemsCount(PURE_MITHRIL_ORE) >= 10) && (st.getQuestItemsCount(ANT_SOLDIER_ACID) >= 20))
+ {
+ if (st.isCond(4) && st.dropItems(WYRM_TALON, 1, 20, 500000) && (st.getQuestItemsCount(PURE_MITHRIL_ORE) >= 10) && (st.getQuestItemsCount(ANT_SOLDIER_ACID) >= 20))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case 20082:
case 20084:
case 20086:
case 20087:
case 20088:
- if ((st.getInt("cond") == 4) && st.dropItems(ANT_SOLDIER_ACID, 1, 20, 800000) && (st.getQuestItemsCount(PURE_MITHRIL_ORE) >= 10) && (st.getQuestItemsCount(WYRM_TALON) >= 20))
+ {
+ if (st.isCond(4) && st.dropItems(ANT_SOLDIER_ACID, 1, 20, 800000) && (st.getQuestItemsCount(PURE_MITHRIL_ORE) >= 10) && (st.getQuestItemsCount(WYRM_TALON) >= 20))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case 20233:
- if ((st.getInt("cond") == 9) && st.dropItems(SPIDER_ICHOR, 1, 20, 500000) && (st.getQuestItemsCount(HARPY_DOWN) >= 20))
+ {
+ if (st.isCond(9) && st.dropItems(SPIDER_ICHOR, 1, 20, 500000) && (st.getQuestItemsCount(HARPY_DOWN) >= 20))
{
- st.set("cond", "10");
+ st.setCond(10);
}
break;
-
+ }
case 20145:
- if ((st.getInt("cond") == 9) && st.dropItems(HARPY_DOWN, 1, 20, 500000) && (st.getQuestItemsCount(SPIDER_ICHOR) >= 20))
+ {
+ if (st.isCond(9) && st.dropItems(HARPY_DOWN, 1, 20, 500000) && (st.getQuestItemsCount(SPIDER_ICHOR) >= 20))
{
- st.set("cond", "10");
+ st.setCond(10);
}
break;
-
+ }
case 27077:
- if ((st.getInt("cond") == 18) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == TALINS_SPEAR))
+ {
+ if (st.isCond(18) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == TALINS_SPEAR))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GRAIL_OF_PURITY, 1);
st.takeItems(TALINS_SPEAR, 1);
st.giveItems(TEARS_OF_UNICORN, 1);
}
break;
-
+ }
case 20581:
case 20582:
- if ((st.getInt("cond") == 15) && Rnd.nextBoolean())
+ {
+ if (st.isCond(15) && Rnd.nextBoolean())
{
for (int itemId : TALINS_PIECES)
{
@@ -554,10 +575,11 @@ public class Q218_TestimonyOfLife extends Quest
return null;
}
}
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q219_TestimonyOfFate/Q219_TestimonyOfFate.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q219_TestimonyOfFate/Q219_TestimonyOfFate.java
index 271bbf6c26..816e52f4ec 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q219_TestimonyOfFate/Q219_TestimonyOfFate.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q219_TestimonyOfFate/Q219_TestimonyOfFate.java
@@ -40,7 +40,22 @@ public class Q219_TestimonyOfFate extends Quest
private static final int ARKENIA = 30419;
private static final int BLOODY_PIXY = 31845;
private static final int BLIGHT_TREANT = 31850;
-
+ // Monsters
+ private static final int HANGMAN_TREE = 20144;
+ private static final int MARSH_STAKATO = 20157;
+ private static final int MEDUSA = 20158;
+ private static final int TYRANT = 20192;
+ private static final int TYRANT_KINGPIN = 20193;
+ private static final int DEAD_SEEKER = 20202;
+ private static final int MARSH_STAKATO_WORKER = 20230;
+ private static final int MARSH_STAKATO_SOLDIER = 20232;
+ private static final int MARSH_SPIDER = 20233;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int BREKA_ORC_OVERLORD = 20270;
+ private static final int GRANDIS = 20554;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int KARUL_BUGBEAR = 20600;
+ private static final int BLACK_WILLOW_LURKER = 27079;
// Items
private static final int KAIRA_LETTER = 3173;
private static final int METHEUS_FUNERAL_JAR = 3174;
@@ -72,28 +87,9 @@ public class Q219_TestimonyOfFate extends Quest
private static final int BLACK_WILLOW_LEAF = 3200;
private static final int BLIGHT_TREANT_SAP = 3201;
private static final int ARKENIA_LETTER = 3202;
-
// Rewards
private static final int MARK_OF_FATE = 3172;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // Monsters
- private static final int HANGMAN_TREE = 20144;
- private static final int MARSH_STAKATO = 20157;
- private static final int MEDUSA = 20158;
- private static final int TYRANT = 20192;
- private static final int TYRANT_KINGPIN = 20193;
- private static final int DEAD_SEEKER = 20202;
- private static final int MARSH_STAKATO_WORKER = 20230;
- private static final int MARSH_STAKATO_SOLDIER = 20232;
- private static final int MARSH_SPIDER = 20233;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int BREKA_ORC_OVERLORD = 20270;
- private static final int GRANDIS = 20554;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int KARUL_BUGBEAR = 20600;
- private static final int BLACK_WILLOW_LURKER = 27079;
-
// Cond 6 drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -112,12 +108,9 @@ public class Q219_TestimonyOfFate extends Quest
public Q219_TestimonyOfFate()
{
super(219, "Testimony of Fate");
-
registerQuestItems(KAIRA_LETTER, METHEUS_FUNERAL_JAR, KASANDRA_REMAINS, HERBALISM_TEXTBOOK, IXIA_LIST, MEDUSA_ICHOR, MARSH_SPIDER_FLUIDS, DEAD_SEEKER_DUNG, TYRANT_BLOOD, NIGHTSHADE_ROOT, BELLADONNA, ALDER_SKULL_1, ALDER_SKULL_2, ALDER_RECEIPT, REVELATIONS_MANUSCRIPT, KAIRA_RECOMMENDATION, KAIRA_INSTRUCTIONS, PALUS_CHARM, THIFIELL_LETTER, ARKENIA_NOTE, PIXY_GARNET, GRANDIS_SKULL, KARUL_BUGBEAR_SKULL, BREKA_OVERLORD_SKULL, LETO_OVERLORD_SKULL, RED_FAIRY_DUST, BLIGHT_TREANT_SEED, BLACK_WILLOW_LEAF, BLIGHT_TREANT_SAP, ARKENIA_LETTER);
-
addStartNpc(KAIRA);
addTalkId(KAIRA, METHEUS, IXIA, ALDER_SPIRIT, ROA, NORMAN, THIFIELL, ARKENIA, BLOODY_PIXY, BLIGHT_TREANT);
-
addKillId(HANGMAN_TREE, MARSH_STAKATO, MEDUSA, TYRANT, TYRANT_KINGPIN, DEAD_SEEKER, MARSH_STAKATO_WORKER, MARSH_STAKATO_SOLDIER, MARSH_SPIDER, MARSH_STAKATO_DRONE, BREKA_ORC_OVERLORD, GRANDIS, LETO_LIZARDMAN_OVERLORD, KARUL_BUGBEAR, BLACK_WILLOW_LURKER);
}
@@ -131,69 +124,75 @@ public class Q219_TestimonyOfFate extends Quest
return htmltext;
}
- if (event.equals("30476-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(KAIRA_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange37", false))
+ case "30476-05.htm":
{
- htmltext = "30476-05a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
- player.getVariables().set("secondClassChange37", true);
+ st.startQuest();
+ st.giveItems(KAIRA_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange37", false))
+ {
+ htmltext = "30476-05a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
+ player.getVariables().set("secondClassChange37", true);
+ }
+ break;
}
- }
- else if (event.equals("30114-04.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ALDER_SKULL_2, 1);
- st.giveItems(ALDER_RECEIPT, 1);
- }
- else if (event.equals("30476-12.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
-
- if (player.getLevel() < 38)
+ case "30114-04.htm":
{
- htmltext = "30476-13.htm";
- st.set("cond", "14");
- st.giveItems(KAIRA_INSTRUCTIONS, 1);
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ALDER_SKULL_2, 1);
+ st.giveItems(ALDER_RECEIPT, 1);
+ break;
}
- else
+ case "30476-12.htm":
{
- st.set("cond", "15");
- st.takeItems(REVELATIONS_MANUSCRIPT, 1);
- st.giveItems(KAIRA_RECOMMENDATION, 1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ if (player.getLevel() < 38)
+ {
+ htmltext = "30476-13.htm";
+ st.setCond(14);
+ st.giveItems(KAIRA_INSTRUCTIONS, 1);
+ }
+ else
+ {
+ st.setCond(15);
+ st.takeItems(REVELATIONS_MANUSCRIPT, 1);
+ st.giveItems(KAIRA_RECOMMENDATION, 1);
+ }
+ break;
+ }
+ case "30419-02.htm":
+ {
+ st.setCond(17);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(THIFIELL_LETTER, 1);
+ st.giveItems(ARKENIA_NOTE, 1);
+ break;
+ }
+ case "31845-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(PIXY_GARNET, 1);
+ break;
+ }
+ case "31850-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(BLIGHT_TREANT_SEED, 1);
+ break;
+ }
+ case "30419-05.htm":
+ {
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARKENIA_NOTE, 1);
+ st.takeItems(BLIGHT_TREANT_SAP, 1);
+ st.takeItems(RED_FAIRY_DUST, 1);
+ st.giveItems(ARKENIA_LETTER, 1);
+ break;
}
- }
- else if (event.equals("30419-02.htm"))
- {
- st.set("cond", "17");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(THIFIELL_LETTER, 1);
- st.giveItems(ARKENIA_NOTE, 1);
- }
- else if (event.equals("31845-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(PIXY_GARNET, 1);
- }
- else if (event.equals("31850-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(BLIGHT_TREANT_SEED, 1);
- }
- else if (event.equals("30419-05.htm"))
- {
- st.set("cond", "18");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARKENIA_NOTE, 1);
- st.takeItems(BLIGHT_TREANT_SAP, 1);
- st.takeItems(RED_FAIRY_DUST, 1);
- st.giveItems(ARKENIA_LETTER, 1);
}
return htmltext;
@@ -212,6 +211,7 @@ public class Q219_TestimonyOfFate extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30476-02.htm";
@@ -225,12 +225,14 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30476-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case KAIRA:
+ {
if (cond == 1)
{
htmltext = "30476-06.htm";
@@ -246,7 +248,7 @@ public class Q219_TestimonyOfFate extends Quest
else if (cond == 9)
{
htmltext = "30476-09.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALDER_SKULL_1, 1);
addSpawn(ALDER_SPIRIT, player, false, 0);
@@ -268,7 +270,7 @@ public class Q219_TestimonyOfFate extends Quest
else
{
htmltext = "30476-12.htm";
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KAIRA_INSTRUCTIONS, 1);
st.takeItems(REVELATIONS_MANUSCRIPT, 1);
@@ -284,12 +286,13 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30476-17.htm";
}
break;
-
+ }
case METHEUS:
+ {
if (cond == 1)
{
htmltext = "30614-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KAIRA_LETTER, 1);
st.giveItems(METHEUS_FUNERAL_JAR, 1);
@@ -301,8 +304,8 @@ public class Q219_TestimonyOfFate extends Quest
else if (cond == 3)
{
htmltext = "30614-03.htm";
- st.set("cond", "4");
- st.set("cond", "5");
+ st.setCond(4);
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KASANDRA_REMAINS, 1);
st.giveItems(HERBALISM_TEXTBOOK, 1);
@@ -314,7 +317,7 @@ public class Q219_TestimonyOfFate extends Quest
else if (cond == 8)
{
htmltext = "30614-05.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BELLADONNA, 1);
st.giveItems(ALDER_SKULL_1, 1);
@@ -324,12 +327,13 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30614-06.htm";
}
break;
-
+ }
case IXIA:
+ {
if (cond == 5)
{
htmltext = "30463-01.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HERBALISM_TEXTBOOK, 1);
st.giveItems(IXIA_LIST, 1);
@@ -341,7 +345,7 @@ public class Q219_TestimonyOfFate extends Quest
else if (cond == 7)
{
htmltext = "30463-03.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(IXIA_LIST, 1);
st.takeItems(DEAD_SEEKER_DUNG, -1);
@@ -360,19 +364,21 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30463-05.htm";
}
break;
-
+ }
case ALDER_SPIRIT:
+ {
if (cond == 10)
{
htmltext = "30613-01.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(ALDER_SKULL_2, 1);
npc.deleteMe();
}
break;
-
+ }
case ROA:
+ {
if (cond == 11)
{
htmltext = "30114-01.htm";
@@ -386,12 +392,13 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30114-06.htm";
}
break;
-
+ }
case NORMAN:
+ {
if (cond == 12)
{
htmltext = "30210-01.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALDER_RECEIPT, 1);
st.giveItems(REVELATIONS_MANUSCRIPT, 1);
@@ -401,12 +408,13 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30210-02.htm";
}
break;
-
+ }
case THIFIELL:
+ {
if (cond == 15)
{
htmltext = "30358-01.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KAIRA_RECOMMENDATION, 1);
st.giveItems(PALUS_CHARM, 1);
@@ -432,8 +440,9 @@ public class Q219_TestimonyOfFate extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ARKENIA:
+ {
if (cond == 16)
{
htmltext = "30419-01.htm";
@@ -447,8 +456,9 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "30419-06.htm";
}
break;
-
+ }
case BLOODY_PIXY:
+ {
if (cond == 17)
{
if (st.hasQuestItems(PIXY_GARNET))
@@ -483,8 +493,9 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "31845-05.htm";
}
break;
-
+ }
case BLIGHT_TREANT:
+ {
if (cond == 17)
{
if (st.hasQuestItems(BLIGHT_TREANT_SEED))
@@ -516,12 +527,15 @@ public class Q219_TestimonyOfFate extends Quest
htmltext = "31850-05.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -541,88 +555,100 @@ public class Q219_TestimonyOfFate extends Quest
switch (npcId)
{
case HANGMAN_TREE:
- if (st.getInt("cond") == 2)
+ {
+ if (st.isCond(2))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(METHEUS_FUNERAL_JAR, 1);
st.giveItems(KASANDRA_REMAINS, 1);
}
break;
-
+ }
case DEAD_SEEKER:
- if ((st.getInt("cond") == 6) && st.dropItems(DEAD_SEEKER_DUNG, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
+ {
+ if (st.isCond(6) && st.dropItems(DEAD_SEEKER_DUNG, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case TYRANT:
case TYRANT_KINGPIN:
- if ((st.getInt("cond") == 6) && st.dropItems(TYRANT_BLOOD, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
+ {
+ if (st.isCond(6) && st.dropItems(TYRANT_BLOOD, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case MEDUSA:
- if ((st.getInt("cond") == 6) && st.dropItems(MEDUSA_ICHOR, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
+ {
+ if (st.isCond(6) && st.dropItems(MEDUSA_ICHOR, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case MARSH_STAKATO:
case MARSH_STAKATO_WORKER:
case MARSH_STAKATO_SOLDIER:
case MARSH_STAKATO_DRONE:
- if ((st.getInt("cond") == 6) && st.dropItems(NIGHTSHADE_ROOT, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
+ {
+ if (st.isCond(6) && st.dropItems(NIGHTSHADE_ROOT, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(MARSH_SPIDER_FLUIDS) >= 10))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case MARSH_SPIDER:
- if ((st.getInt("cond") == 6) && st.dropItems(MARSH_SPIDER_FLUIDS, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10))
+ {
+ if (st.isCond(6) && st.dropItems(MARSH_SPIDER_FLUIDS, 1, 10, CHANCES.get(npcId)) && (st.getQuestItemsCount(DEAD_SEEKER_DUNG) >= 10) && (st.getQuestItemsCount(TYRANT_BLOOD) >= 10) && (st.getQuestItemsCount(MEDUSA_ICHOR) >= 10) && (st.getQuestItemsCount(NIGHTSHADE_ROOT) >= 10))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case GRANDIS:
+ {
if (st.hasQuestItems(PIXY_GARNET))
{
st.dropItemsAlways(GRANDIS_SKULL, 1, 10);
}
break;
-
+ }
case LETO_LIZARDMAN_OVERLORD:
+ {
if (st.hasQuestItems(PIXY_GARNET))
{
st.dropItemsAlways(LETO_OVERLORD_SKULL, 1, 10);
}
break;
-
+ }
case BREKA_ORC_OVERLORD:
+ {
if (st.hasQuestItems(PIXY_GARNET))
{
st.dropItemsAlways(BREKA_OVERLORD_SKULL, 1, 10);
}
break;
-
+ }
case KARUL_BUGBEAR:
+ {
if (st.hasQuestItems(PIXY_GARNET))
{
st.dropItemsAlways(KARUL_BUGBEAR_SKULL, 1, 10);
}
break;
-
+ }
case BLACK_WILLOW_LURKER:
+ {
if (st.hasQuestItems(BLIGHT_TREANT_SEED))
{
st.dropItemsAlways(BLACK_WILLOW_LEAF, 1, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q220_TestimonyOfGlory/Q220_TestimonyOfGlory.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q220_TestimonyOfGlory/Q220_TestimonyOfGlory.java
index 7e88416047..d2cf4be3d6 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q220_TestimonyOfGlory/Q220_TestimonyOfGlory.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q220_TestimonyOfGlory/Q220_TestimonyOfGlory.java
@@ -26,6 +26,38 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q220_TestimonyOfGlory extends Quest
{
+ // NPCs
+ private static final int KASMAN = 30501;
+ private static final int VOKIAN = 30514;
+ private static final int MANAKIA = 30515;
+ private static final int KAKAI = 30565;
+ private static final int TANAPI = 30571;
+ private static final int VOLTAR = 30615;
+ private static final int KEPRA = 30616;
+ private static final int BURAI = 30617;
+ private static final int HARAK = 30618;
+ private static final int DRIKO = 30619;
+ private static final int CHIANTA = 30642;
+ // Monsters
+ private static final int TYRANT = 20192;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int GUARDIAN_BASILISK = 20550;
+ private static final int MANASHEN_GARGOYLE = 20563;
+ private static final int TIMAK_ORC = 20583;
+ private static final int TIMAK_ORC_ARCHER = 20584;
+ private static final int TIMAK_ORC_SOLDIER = 20585;
+ private static final int TIMAK_ORC_WARRIOR = 20586;
+ private static final int TIMAK_ORC_SHAMAN = 20587;
+ private static final int TIMAK_ORC_OVERLORD = 20588;
+ private static final int TAMLIN_ORC = 20601;
+ private static final int TAMLIN_ORC_ARCHER = 20602;
+ private static final int RAGNA_ORC_OVERLORD = 20778;
+ private static final int RAGNA_ORC_SEER = 20779;
+ private static final int PASHIKA_SON_OF_VOLTAR = 27080;
+ private static final int VULTUS_SON_OF_VOLTAR = 27081;
+ private static final int ENKU_ORC_OVERLORD = 27082;
+ private static final int MAKUM_BUGBEAR_THUG = 27083;
+ private static final int REVENANT_OF_TANTOS_CHIEF = 27086;
// Items
private static final int VOKIAN_ORDER_1 = 3204;
private static final int MANASHEN_SHARD = 3205;
@@ -61,45 +93,9 @@ public class Q220_TestimonyOfGlory extends Quest
private static final int TANAPI_ORDER = 3235;
private static final int SCEPTER_OF_TANTOS = 3236;
private static final int RITUAL_BOX = 3237;
-
// Rewards
private static final int MARK_OF_GLORY = 3203;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // NPCs
- private static final int KASMAN = 30501;
- private static final int VOKIAN = 30514;
- private static final int MANAKIA = 30515;
- private static final int KAKAI = 30565;
- private static final int TANAPI = 30571;
- private static final int VOLTAR = 30615;
- private static final int KEPRA = 30616;
- private static final int BURAI = 30617;
- private static final int HARAK = 30618;
- private static final int DRIKO = 30619;
- private static final int CHIANTA = 30642;
-
- // Monsters
- private static final int TYRANT = 20192;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int GUARDIAN_BASILISK = 20550;
- private static final int MANASHEN_GARGOYLE = 20563;
- private static final int TIMAK_ORC = 20583;
- private static final int TIMAK_ORC_ARCHER = 20584;
- private static final int TIMAK_ORC_SOLDIER = 20585;
- private static final int TIMAK_ORC_WARRIOR = 20586;
- private static final int TIMAK_ORC_SHAMAN = 20587;
- private static final int TIMAK_ORC_OVERLORD = 20588;
- private static final int TAMLIN_ORC = 20601;
- private static final int TAMLIN_ORC_ARCHER = 20602;
- private static final int RAGNA_ORC_OVERLORD = 20778;
- private static final int RAGNA_ORC_SEER = 20779;
- private static final int PASHIKA_SON_OF_VOLTAR = 27080;
- private static final int VULTUS_SON_OF_VOLTAR = 27081;
- private static final int ENKU_ORC_OVERLORD = 27082;
- private static final int MAKUM_BUGBEAR_THUG = 27083;
- private static final int REVENANT_OF_TANTOS_CHIEF = 27086;
-
// Checks & Instances
private static boolean _sonsOfVoltar = false;
private static boolean _enkuOrcOverlords = false;
@@ -108,12 +104,9 @@ public class Q220_TestimonyOfGlory extends Quest
public Q220_TestimonyOfGlory()
{
super(220, "Testimony of Glory");
-
registerQuestItems(VOKIAN_ORDER_1, MANASHEN_SHARD, TYRANT_TALON, GUARDIAN_BASILISK_FANG, VOKIAN_ORDER_2, NECKLACE_OF_AUTHORITY, CHIANTA_ORDER_1, SCEPTER_OF_BREKA, SCEPTER_OF_ENKU, SCEPTER_OF_VUKU, SCEPTER_OF_TUREK, SCEPTER_OF_TUNATH, CHIANTA_ORDER_2, CHIANTA_ORDER_3, TAMLIN_ORC_SKULL, TIMAK_ORC_HEAD, SCEPTER_BOX, PASHIKA_HEAD, VULTUS_HEAD, GLOVE_OF_VOLTAR, ENKU_OVERLORD_HEAD, GLOVE_OF_KEPRA, MAKUM_BUGBEAR_HEAD, GLOVE_OF_BURAI, MANAKIA_LETTER_1, MANAKIA_LETTER_2, KASMAN_LETTER_1, KASMAN_LETTER_2, KASMAN_LETTER_3, DRIKO_CONTRACT, STAKATO_DRONE_HUSK, TANAPI_ORDER, SCEPTER_OF_TANTOS, RITUAL_BOX);
-
addStartNpc(VOKIAN);
addTalkId(KASMAN, VOKIAN, MANAKIA, KAKAI, TANAPI, VOLTAR, KEPRA, BURAI, HARAK, DRIKO, CHIANTA);
-
addAttackId(RAGNA_ORC_OVERLORD, RAGNA_ORC_SEER, REVENANT_OF_TANTOS_CHIEF);
addKillId(TYRANT, MARSH_STAKATO_DRONE, GUARDIAN_BASILISK, MANASHEN_GARGOYLE, TIMAK_ORC, TIMAK_ORC_ARCHER, TIMAK_ORC_SOLDIER, TIMAK_ORC_WARRIOR, TIMAK_ORC_SHAMAN, TIMAK_ORC_OVERLORD, TAMLIN_ORC, TAMLIN_ORC_ARCHER, RAGNA_ORC_OVERLORD, RAGNA_ORC_SEER, PASHIKA_SON_OF_VOLTAR, VULTUS_SON_OF_VOLTAR, ENKU_ORC_OVERLORD, MAKUM_BUGBEAR_THUG, REVENANT_OF_TANTOS_CHIEF);
}
@@ -128,225 +121,238 @@ public class Q220_TestimonyOfGlory extends Quest
return htmltext;
}
- // VOKIAN
- if (event.equals("30514-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(VOKIAN_ORDER_1, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange37", false))
+ case "30514-05.htm":
{
- htmltext = "30514-05a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
- player.getVariables().set("secondClassChange37", true);
+ st.startQuest();
+ st.giveItems(VOKIAN_ORDER_1, 1);
+ if (!player.getVariables().getBoolean("secondClassChange37", false))
+ {
+ htmltext = "30514-05a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
+ player.getVariables().set("secondClassChange37", true);
+ }
+ break;
}
- }
- // CHIANTA
- else if (event.equals("30642-03.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VOKIAN_ORDER_2, 1);
- st.giveItems(CHIANTA_ORDER_1, 1);
- }
- else if (event.equals("30642-07.htm"))
- {
- st.takeItems(CHIANTA_ORDER_1, 1);
- st.takeItems(KASMAN_LETTER_1, 1);
- st.takeItems(MANAKIA_LETTER_1, 1);
- st.takeItems(MANAKIA_LETTER_2, 1);
- st.takeItems(SCEPTER_OF_BREKA, 1);
- st.takeItems(SCEPTER_OF_ENKU, 1);
- st.takeItems(SCEPTER_OF_TUNATH, 1);
- st.takeItems(SCEPTER_OF_TUREK, 1);
- st.takeItems(SCEPTER_OF_VUKU, 1);
-
- if (player.getLevel() >= 37)
+ case "30642-03.htm":
{
- st.set("cond", "6");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CHIANTA_ORDER_3, 1);
+ st.takeItems(VOKIAN_ORDER_2, 1);
+ st.giveItems(CHIANTA_ORDER_1, 1);
+ break;
}
- else
+ case "30642-07.htm":
+ {
+ st.takeItems(CHIANTA_ORDER_1, 1);
+ st.takeItems(KASMAN_LETTER_1, 1);
+ st.takeItems(MANAKIA_LETTER_1, 1);
+ st.takeItems(MANAKIA_LETTER_2, 1);
+ st.takeItems(SCEPTER_OF_BREKA, 1);
+ st.takeItems(SCEPTER_OF_ENKU, 1);
+ st.takeItems(SCEPTER_OF_TUNATH, 1);
+ st.takeItems(SCEPTER_OF_TUREK, 1);
+ st.takeItems(SCEPTER_OF_VUKU, 1);
+ if (player.getLevel() >= 37)
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CHIANTA_ORDER_3, 1);
+ }
+ else
+ {
+ htmltext = "30642-06.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(CHIANTA_ORDER_2, 1);
+ }
+ break;
+ }
+ case "30501-02.htm":
+ {
+ if (!st.hasQuestItems(SCEPTER_OF_VUKU))
+ {
+ if (st.hasQuestItems(KASMAN_LETTER_1))
+ {
+ htmltext = "30501-04.htm";
+ }
+ else
+ {
+ htmltext = "30501-03.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(KASMAN_LETTER_1, 1);
+ }
+ st.addRadar(-2150, 124443, -3724);
+ }
+ break;
+ }
+ case "30501-05.htm":
+ {
+ if (!st.hasQuestItems(SCEPTER_OF_TUREK))
+ {
+ if (st.hasQuestItems(KASMAN_LETTER_2))
+ {
+ htmltext = "30501-07.htm";
+ }
+ else
+ {
+ htmltext = "30501-06.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(KASMAN_LETTER_2, 1);
+ }
+ st.addRadar(-94294, 110818, -3563);
+ }
+ break;
+ }
+ case "30501-08.htm":
+ {
+ if (!st.hasQuestItems(SCEPTER_OF_TUNATH))
+ {
+ if (st.hasQuestItems(KASMAN_LETTER_3))
+ {
+ htmltext = "30501-10.htm";
+ }
+ else
+ {
+ htmltext = "30501-09.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(KASMAN_LETTER_3, 1);
+ }
+ st.addRadar(-55217, 200628, -3724);
+ }
+ break;
+ }
+ case "30515-02.htm":
+ {
+ if (!st.hasQuestItems(SCEPTER_OF_BREKA))
+ {
+ if (st.hasQuestItems(MANAKIA_LETTER_1))
+ {
+ htmltext = "30515-04.htm";
+ }
+ else
+ {
+ htmltext = "30515-03.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(MANAKIA_LETTER_1, 1);
+ }
+ st.addRadar(80100, 119991, -2264);
+ }
+ break;
+ }
+ case "30515-05.htm":
+ {
+ if (!st.hasQuestItems(SCEPTER_OF_ENKU))
+ {
+ if (st.hasQuestItems(MANAKIA_LETTER_2))
+ {
+ htmltext = "30515-07.htm";
+ }
+ else
+ {
+ htmltext = "30515-06.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(MANAKIA_LETTER_2, 1);
+ }
+ st.addRadar(19815, 189703, -3032);
+ }
+ break;
+ }
+ case "30615-04.htm":
{
- htmltext = "30642-06.htm";
st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(CHIANTA_ORDER_2, 1);
+ st.takeItems(MANAKIA_LETTER_1, 1);
+ st.giveItems(GLOVE_OF_VOLTAR, 1);
+ if (!_sonsOfVoltar)
+ {
+ addSpawn(PASHIKA_SON_OF_VOLTAR, 80117, 120039, -2259, 0, false, 200000);
+ addSpawn(VULTUS_SON_OF_VOLTAR, 80058, 120038, -2259, 0, false, 200000);
+ _sonsOfVoltar = true;
+
+ // Resets Sons Of Voltar
+ startQuestTimer("voltar_sons_cleanup", 201000, null, player, false);
+ }
+ break;
}
- }
- // KASMAN
- else if (event.equals("30501-02.htm") && !st.hasQuestItems(SCEPTER_OF_VUKU))
- {
- if (st.hasQuestItems(KASMAN_LETTER_1))
+ case "30616-05.htm":
{
- htmltext = "30501-04.htm";
- }
- else
- {
- htmltext = "30501-03.htm";
st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(KASMAN_LETTER_1, 1);
+ st.takeItems(MANAKIA_LETTER_2, 1);
+ st.giveItems(GLOVE_OF_KEPRA, 1);
+ if (!_enkuOrcOverlords)
+ {
+ addSpawn(ENKU_ORC_OVERLORD, 19894, 189743, -3074, 0, false, 200000);
+ addSpawn(ENKU_ORC_OVERLORD, 19869, 189800, -3059, 0, false, 200000);
+ addSpawn(ENKU_ORC_OVERLORD, 19818, 189818, -3047, 0, false, 200000);
+ addSpawn(ENKU_ORC_OVERLORD, 19753, 189837, -3027, 0, false, 200000);
+ _enkuOrcOverlords = true;
+
+ // Resets Enku Orc Overlords
+ startQuestTimer("enku_orcs_cleanup", 201000, null, player, false);
+ }
+ break;
}
- st.addRadar(-2150, 124443, -3724);
- }
- else if (event.equals("30501-05.htm") && !st.hasQuestItems(SCEPTER_OF_TUREK))
- {
- if (st.hasQuestItems(KASMAN_LETTER_2))
+ case "30617-04.htm":
{
- htmltext = "30501-07.htm";
- }
- else
- {
- htmltext = "30501-06.htm";
st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(KASMAN_LETTER_2, 1);
+ st.takeItems(KASMAN_LETTER_2, 1);
+ st.giveItems(GLOVE_OF_BURAI, 1);
+ if (!_makumBugbearThugs)
+ {
+ addSpawn(MAKUM_BUGBEAR_THUG, -94292, 110781, -3701, 0, false, 200000);
+ addSpawn(MAKUM_BUGBEAR_THUG, -94293, 110861, -3701, 0, false, 200000);
+ _makumBugbearThugs = true;
+
+ // Resets Makum Bugbear Thugs
+ startQuestTimer("makum_bugbears_cleanup", 201000, null, player, false);
+ }
+ break;
}
- st.addRadar(-94294, 110818, -3563);
- }
- else if (event.equals("30501-08.htm") && !st.hasQuestItems(SCEPTER_OF_TUNATH))
- {
- if (st.hasQuestItems(KASMAN_LETTER_3))
+ case "30618-03.htm":
{
- htmltext = "30501-10.htm";
+ st.takeItems(KASMAN_LETTER_3, 1);
+ st.giveItems(SCEPTER_OF_TUNATH, 1);
+ if (st.hasQuestItems(SCEPTER_OF_BREKA, SCEPTER_OF_ENKU, SCEPTER_OF_VUKU, SCEPTER_OF_TUREK))
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
}
- else
+ case "30619-03.htm":
{
- htmltext = "30501-09.htm";
st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(KASMAN_LETTER_3, 1);
+ st.takeItems(KASMAN_LETTER_1, 1);
+ st.giveItems(DRIKO_CONTRACT, 1);
+ break;
}
- st.addRadar(-55217, 200628, -3724);
- }
- // MANAKIA
- else if (event.equals("30515-02.htm") && !st.hasQuestItems(SCEPTER_OF_BREKA))
- {
- if (st.hasQuestItems(MANAKIA_LETTER_1))
+ case "30571-03.htm":
{
- htmltext = "30515-04.htm";
- }
- else
- {
- htmltext = "30515-03.htm";
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(MANAKIA_LETTER_1, 1);
- }
- st.addRadar(80100, 119991, -2264);
- }
- else if (event.equals("30515-05.htm") && !st.hasQuestItems(SCEPTER_OF_ENKU))
- {
- if (st.hasQuestItems(MANAKIA_LETTER_2))
- {
- htmltext = "30515-07.htm";
- }
- else
- {
- htmltext = "30515-06.htm";
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(MANAKIA_LETTER_2, 1);
- }
- st.addRadar(19815, 189703, -3032);
- }
- // VOLTAR
- else if (event.equals("30615-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(MANAKIA_LETTER_1, 1);
- st.giveItems(GLOVE_OF_VOLTAR, 1);
-
- if (!_sonsOfVoltar)
- {
- addSpawn(PASHIKA_SON_OF_VOLTAR, 80117, 120039, -2259, 0, false, 200000);
- addSpawn(VULTUS_SON_OF_VOLTAR, 80058, 120038, -2259, 0, false, 200000);
- _sonsOfVoltar = true;
-
- // Resets Sons Of Voltar
- startQuestTimer("voltar_sons_cleanup", 201000, null, player, false);
- }
- }
- // KEPRA
- else if (event.equals("30616-05.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(MANAKIA_LETTER_2, 1);
- st.giveItems(GLOVE_OF_KEPRA, 1);
-
- if (!_enkuOrcOverlords)
- {
- addSpawn(ENKU_ORC_OVERLORD, 19894, 189743, -3074, 0, false, 200000);
- addSpawn(ENKU_ORC_OVERLORD, 19869, 189800, -3059, 0, false, 200000);
- addSpawn(ENKU_ORC_OVERLORD, 19818, 189818, -3047, 0, false, 200000);
- addSpawn(ENKU_ORC_OVERLORD, 19753, 189837, -3027, 0, false, 200000);
- _enkuOrcOverlords = true;
-
- // Resets Enku Orc Overlords
- startQuestTimer("enku_orcs_cleanup", 201000, null, player, false);
- }
- }
- // BURAI
- else if (event.equals("30617-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(KASMAN_LETTER_2, 1);
- st.giveItems(GLOVE_OF_BURAI, 1);
-
- if (!_makumBugbearThugs)
- {
- addSpawn(MAKUM_BUGBEAR_THUG, -94292, 110781, -3701, 0, false, 200000);
- addSpawn(MAKUM_BUGBEAR_THUG, -94293, 110861, -3701, 0, false, 200000);
- _makumBugbearThugs = true;
-
- // Resets Makum Bugbear Thugs
- startQuestTimer("makum_bugbears_cleanup", 201000, null, player, false);
- }
- }
- // HARAK
- else if (event.equals("30618-03.htm"))
- {
- st.takeItems(KASMAN_LETTER_3, 1);
- st.giveItems(SCEPTER_OF_TUNATH, 1);
-
- if (st.hasQuestItems(SCEPTER_OF_BREKA, SCEPTER_OF_ENKU, SCEPTER_OF_VUKU, SCEPTER_OF_TUREK))
- {
- st.set("cond", "5");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SCEPTER_BOX, 1);
+ st.giveItems(TANAPI_ORDER, 1);
+ break;
}
- else
+ case "voltar_sons_cleanup":
{
- st.playSound(QuestState.SOUND_ITEMGET);
+ _sonsOfVoltar = false;
+ return null;
+ }
+ case "enku_orcs_cleanup":
+ {
+ _enkuOrcOverlords = false;
+ return null;
+ }
+ case "makum_bugbears_cleanup":
+ {
+ _makumBugbearThugs = false;
+ return null;
}
- }
- // DRIKO
- else if (event.equals("30619-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(KASMAN_LETTER_1, 1);
- st.giveItems(DRIKO_CONTRACT, 1);
- }
- // TANAPI
- else if (event.equals("30571-03.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SCEPTER_BOX, 1);
- st.giveItems(TANAPI_ORDER, 1);
- }
- // Clean ups
- else if (event.equals("voltar_sons_cleanup"))
- {
- _sonsOfVoltar = false;
- return null;
- }
- else if (event.equals("enku_orcs_cleanup"))
- {
- _enkuOrcOverlords = false;
- return null;
- }
- else if (event.equals("makum_bugbears_cleanup"))
- {
- _makumBugbearThugs = false;
- return null;
}
return htmltext;
@@ -365,6 +371,7 @@ public class Q220_TestimonyOfGlory extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30514-01.htm";
@@ -382,12 +389,14 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30514-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VOKIAN:
+ {
if (cond == 1)
{
htmltext = "30514-06.htm";
@@ -395,7 +404,7 @@ public class Q220_TestimonyOfGlory extends Quest
else if (cond == 2)
{
htmltext = "30514-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GUARDIAN_BASILISK_FANG, 10);
st.takeItems(MANASHEN_SHARD, 10);
@@ -413,8 +422,9 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30514-10.htm";
}
break;
-
+ }
case CHIANTA:
+ {
if (cond == 3)
{
htmltext = "30642-01.htm";
@@ -430,7 +440,7 @@ public class Q220_TestimonyOfGlory extends Quest
if (player.getLevel() >= 37)
{
htmltext = "30642-09.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CHIANTA_ORDER_2, 1);
st.giveItems(CHIANTA_ORDER_3, 1);
@@ -452,7 +462,7 @@ public class Q220_TestimonyOfGlory extends Quest
else if (cond == 7)
{
htmltext = "30642-11.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CHIANTA_ORDER_3, 1);
st.takeItems(NECKLACE_OF_AUTHORITY, 1);
@@ -469,8 +479,9 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30642-13.htm";
}
break;
-
+ }
case KASMAN:
+ {
if (st.hasQuestItems(CHIANTA_ORDER_1))
{
htmltext = "30501-01.htm";
@@ -480,8 +491,9 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30501-11.htm";
}
break;
-
+ }
case MANAKIA:
+ {
if (st.hasQuestItems(CHIANTA_ORDER_1))
{
htmltext = "30515-01.htm";
@@ -491,8 +503,9 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30515-08.htm";
}
break;
-
+ }
case VOLTAR:
+ {
if (cond > 3)
{
if (st.hasQuestItems(MANAKIA_LETTER_1))
@@ -522,7 +535,7 @@ public class Q220_TestimonyOfGlory extends Quest
if (st.hasQuestItems(SCEPTER_OF_ENKU, SCEPTER_OF_VUKU, SCEPTER_OF_TUREK, SCEPTER_OF_TUNATH))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -544,8 +557,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case KEPRA:
+ {
if (cond > 3)
{
if (st.hasQuestItems(MANAKIA_LETTER_2))
@@ -577,7 +591,7 @@ public class Q220_TestimonyOfGlory extends Quest
if (st.hasQuestItems(SCEPTER_OF_BREKA, SCEPTER_OF_VUKU, SCEPTER_OF_TUREK, SCEPTER_OF_TUNATH))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -599,8 +613,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case BURAI:
+ {
if (cond > 3)
{
if (st.hasQuestItems(KASMAN_LETTER_2))
@@ -630,7 +645,7 @@ public class Q220_TestimonyOfGlory extends Quest
if (st.hasQuestItems(SCEPTER_OF_BREKA, SCEPTER_OF_VUKU, SCEPTER_OF_ENKU, SCEPTER_OF_TUNATH))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -652,8 +667,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case HARAK:
+ {
if (cond > 3)
{
if (st.hasQuestItems(KASMAN_LETTER_3))
@@ -675,8 +691,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case DRIKO:
+ {
if (cond > 3)
{
if (st.hasQuestItems(KASMAN_LETTER_1))
@@ -695,7 +712,7 @@ public class Q220_TestimonyOfGlory extends Quest
if (st.hasQuestItems(SCEPTER_OF_BREKA, SCEPTER_OF_TUREK, SCEPTER_OF_ENKU, SCEPTER_OF_TUNATH))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -722,8 +739,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case TANAPI:
+ {
if (cond == 8)
{
htmltext = "30571-01.htm";
@@ -735,7 +753,7 @@ public class Q220_TestimonyOfGlory extends Quest
else if (cond == 10)
{
htmltext = "30571-05.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SCEPTER_OF_TANTOS, 1);
st.takeItems(TANAPI_ORDER, 1);
@@ -746,8 +764,9 @@ public class Q220_TestimonyOfGlory extends Quest
htmltext = "30571-06.htm";
}
break;
-
+ }
case KAKAI:
+ {
if ((cond > 7) && (cond < 11))
{
htmltext = "30565-01.htm";
@@ -763,12 +782,15 @@ public class Q220_TestimonyOfGlory extends Quest
st.exitQuest(false);
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -783,21 +805,21 @@ public class Q220_TestimonyOfGlory extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case RAGNA_ORC_OVERLORD:
case RAGNA_ORC_SEER:
- if ((cond == 9) && npc.isScriptValue(0))
+ {
+ if (st.isCond(9) && npc.isScriptValue(0))
{
npc.broadcastNpcSay("Is it a lackey of Kakai?!");
npc.setScriptValue(1);
}
break;
-
+ }
case REVENANT_OF_TANTOS_CHIEF:
- if (cond == 9)
+ {
+ if (st.isCond(9))
{
if (npc.isScriptValue(0))
{
@@ -811,6 +833,7 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
+ }
}
return null;
@@ -825,39 +848,42 @@ public class Q220_TestimonyOfGlory extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case TYRANT:
- if ((cond == 1) && st.dropItems(TYRANT_TALON, 1, 10, 500000) && ((st.getQuestItemsCount(GUARDIAN_BASILISK_FANG) + st.getQuestItemsCount(MANASHEN_SHARD)) == 20))
+ {
+ if (st.isCond(1) && st.dropItems(TYRANT_TALON, 1, 10, 500000) && ((st.getQuestItemsCount(GUARDIAN_BASILISK_FANG) + st.getQuestItemsCount(MANASHEN_SHARD)) == 20))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case GUARDIAN_BASILISK:
- if ((cond == 1) && st.dropItems(GUARDIAN_BASILISK_FANG, 1, 10, 500000) && ((st.getQuestItemsCount(TYRANT_TALON) + st.getQuestItemsCount(MANASHEN_SHARD)) == 20))
+ {
+ if (st.isCond(1) && st.dropItems(GUARDIAN_BASILISK_FANG, 1, 10, 500000) && ((st.getQuestItemsCount(TYRANT_TALON) + st.getQuestItemsCount(MANASHEN_SHARD)) == 20))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case MANASHEN_GARGOYLE:
- if ((cond == 1) && st.dropItems(MANASHEN_SHARD, 1, 10, 750000) && ((st.getQuestItemsCount(TYRANT_TALON) + st.getQuestItemsCount(GUARDIAN_BASILISK_FANG)) == 20))
+ {
+ if (st.isCond(1) && st.dropItems(MANASHEN_SHARD, 1, 10, 750000) && ((st.getQuestItemsCount(TYRANT_TALON) + st.getQuestItemsCount(GUARDIAN_BASILISK_FANG)) == 20))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case MARSH_STAKATO_DRONE:
+ {
if (st.hasQuestItems(DRIKO_CONTRACT))
{
st.dropItems(STAKATO_DRONE_HUSK, 1, 30, 750000);
}
break;
-
+ }
case PASHIKA_SON_OF_VOLTAR:
+ {
if (st.hasQuestItems(GLOVE_OF_VOLTAR) && !st.hasQuestItems(PASHIKA_HEAD))
{
st.giveItems(PASHIKA_HEAD, 1);
@@ -872,8 +898,9 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case VULTUS_SON_OF_VOLTAR:
+ {
if (st.hasQuestItems(GLOVE_OF_VOLTAR) && !st.hasQuestItems(VULTUS_HEAD))
{
st.giveItems(VULTUS_HEAD, 1);
@@ -888,63 +915,71 @@ public class Q220_TestimonyOfGlory extends Quest
}
}
break;
-
+ }
case ENKU_ORC_OVERLORD:
+ {
if (st.hasQuestItems(GLOVE_OF_KEPRA) && st.dropItemsAlways(ENKU_OVERLORD_HEAD, 1, 4))
{
st.takeItems(GLOVE_OF_KEPRA, 1);
}
break;
-
+ }
case MAKUM_BUGBEAR_THUG:
+ {
if (st.hasQuestItems(GLOVE_OF_BURAI) && st.dropItemsAlways(MAKUM_BUGBEAR_HEAD, 1, 2))
{
st.takeItems(GLOVE_OF_BURAI, 1);
}
break;
-
+ }
case TIMAK_ORC:
case TIMAK_ORC_ARCHER:
case TIMAK_ORC_SOLDIER:
case TIMAK_ORC_WARRIOR:
case TIMAK_ORC_SHAMAN:
case TIMAK_ORC_OVERLORD:
- if ((cond == 6) && st.dropItems(TIMAK_ORC_HEAD, 1, 20, 500000 + ((npc.getNpcId() - 20583) * 100000)) && (st.getQuestItemsCount(TAMLIN_ORC_SKULL) == 20))
+ {
+ if (st.isCond(6) && st.dropItems(TIMAK_ORC_HEAD, 1, 20, 500000 + ((npc.getNpcId() - 20583) * 100000)) && (st.getQuestItemsCount(TAMLIN_ORC_SKULL) == 20))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case TAMLIN_ORC:
- if ((cond == 6) && st.dropItems(TAMLIN_ORC_SKULL, 1, 20, 500000) && (st.getQuestItemsCount(TIMAK_ORC_HEAD) == 20))
+ {
+ if (st.isCond(6) && st.dropItems(TAMLIN_ORC_SKULL, 1, 20, 500000) && (st.getQuestItemsCount(TIMAK_ORC_HEAD) == 20))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case TAMLIN_ORC_ARCHER:
- if ((cond == 6) && st.dropItems(TAMLIN_ORC_SKULL, 1, 20, 600000) && (st.getQuestItemsCount(TIMAK_ORC_HEAD) == 20))
+ {
+ if (st.isCond(6) && st.dropItems(TAMLIN_ORC_SKULL, 1, 20, 600000) && (st.getQuestItemsCount(TIMAK_ORC_HEAD) == 20))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case RAGNA_ORC_OVERLORD:
case RAGNA_ORC_SEER:
- if (cond == 9)
+ {
+ if (st.isCond(9))
{
npc.broadcastNpcSay("Too late!");
addSpawn(REVENANT_OF_TANTOS_CHIEF, npc, true, 200000);
}
break;
-
+ }
case REVENANT_OF_TANTOS_CHIEF:
- if ((cond == 9) && st.dropItemsAlways(SCEPTER_OF_TANTOS, 1, 1))
+ {
+ if (st.isCond(9) && st.dropItemsAlways(SCEPTER_OF_TANTOS, 1, 1))
{
- st.set("cond", "10");
+ st.setCond(10);
npc.broadcastNpcSay("I'll get revenge someday!!");
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q221_TestimonyOfProsperity/Q221_TestimonyOfProsperity.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q221_TestimonyOfProsperity/Q221_TestimonyOfProsperity.java
index f43e7f395b..898f58f02b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q221_TestimonyOfProsperity/Q221_TestimonyOfProsperity.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q221_TestimonyOfProsperity/Q221_TestimonyOfProsperity.java
@@ -26,12 +26,44 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q221_TestimonyOfProsperity extends Quest
{
+ // NPCs
+ private static final int WILFORD = 30005;
+ private static final int PARMAN = 30104;
+ private static final int LILITH = 30368;
+ private static final int BRIGHT = 30466;
+ private static final int SHARI = 30517;
+ private static final int MION = 30519;
+ private static final int LOCKIRIN = 30531;
+ private static final int SPIRON = 30532;
+ private static final int BALANKI = 30533;
+ private static final int KEEF = 30534;
+ private static final int FILAUR = 30535;
+ private static final int ARIN = 30536;
+ private static final int MARYSE_REDBONNET = 30553;
+ private static final int BOLTER = 30554;
+ private static final int TOROCCO = 30555;
+ private static final int TOMA = 30556;
+ private static final int PIOTUR = 30597;
+ private static final int EMILY = 30620;
+ private static final int NIKOLA = 30621;
+ private static final int BOX_OF_TITAN = 30622;
+ // Monsters
+ private static final int MANDRAGORA_SPROUT_1 = 20223;
+ private static final int MANDRAGORA_SPROUT_2 = 20154;
+ private static final int MANDRAGORA_SAPLING = 20155;
+ private static final int MANDRAGORA_BLOSSOM = 20156;
+ private static final int MARSH_STAKATO = 20157;
+ private static final int GIANT_CRIMSON_ANT = 20228;
+ private static final int MARSH_STAKATO_WORKER = 20230;
+ private static final int TOAD_LORD = 20231;
+ private static final int MARSH_STAKATO_SOLDIER = 20232;
+ private static final int MARSH_SPIDER = 20233;
+ private static final int MARSH_STAKATO_DRONE = 20234;
// Items
private static final int ADENA = 57;
private static final int ANIMAL_SKIN = 1867;
private static final int RECIPE_TITAN_KEY = 3023;
private static final int KEY_OF_TITAN = 3030;
-
private static final int RING_OF_TESTIMONY_1 = 3239;
private static final int RING_OF_TESTIMONY_2 = 3240;
private static final int OLD_ACCOUNT_BOOK = 3241;
@@ -70,55 +102,16 @@ public class Q221_TestimonyOfProsperity extends Quest
private static final int TOAD_LORD_SAC = 3274;
private static final int SPIDER_THORN = 3275;
private static final int CRYSTAL_BROOCH = 3428;
-
// Rewards
private static final int MARK_OF_PROSPERITY = 3238;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int WILFORD = 30005;
- private static final int PARMAN = 30104;
- private static final int LILITH = 30368;
- private static final int BRIGHT = 30466;
- private static final int SHARI = 30517;
- private static final int MION = 30519;
- private static final int LOCKIRIN = 30531;
- private static final int SPIRON = 30532;
- private static final int BALANKI = 30533;
- private static final int KEEF = 30534;
- private static final int FILAUR = 30535;
- private static final int ARIN = 30536;
- private static final int MARYSE_REDBONNET = 30553;
- private static final int BOLTER = 30554;
- private static final int TOROCCO = 30555;
- private static final int TOMA = 30556;
- private static final int PIOTUR = 30597;
- private static final int EMILY = 30620;
- private static final int NIKOLA = 30621;
- private static final int BOX_OF_TITAN = 30622;
-
- // Monsters
- private static final int MANDRAGORA_SPROUT_1 = 20223;
- private static final int MANDRAGORA_SPROUT_2 = 20154;
- private static final int MANDRAGORA_SAPLING = 20155;
- private static final int MANDRAGORA_BLOSSOM = 20156;
- private static final int MARSH_STAKATO = 20157;
- private static final int GIANT_CRIMSON_ANT = 20228;
- private static final int MARSH_STAKATO_WORKER = 20230;
- private static final int TOAD_LORD = 20231;
- private static final int MARSH_STAKATO_SOLDIER = 20232;
- private static final int MARSH_SPIDER = 20233;
- private static final int MARSH_STAKATO_DRONE = 20234;
-
public Q221_TestimonyOfProsperity()
{
super(221, "Testimony of Prosperity");
-
registerQuestItems(RING_OF_TESTIMONY_1, RING_OF_TESTIMONY_2, OLD_ACCOUNT_BOOK, BLESSED_SEED, EMILY_RECIPE, LILITH_ELVEN_WAFER, MAPHR_TABLET_FRAGMENT, COLLECTION_LICENSE, LOCKIRIN_NOTICE_1, LOCKIRIN_NOTICE_2, LOCKIRIN_NOTICE_3, LOCKIRIN_NOTICE_4, LOCKIRIN_NOTICE_5, CONTRIBUTION_OF_SHARI, CONTRIBUTION_OF_MION, CONTRIBUTION_OF_MARYSE, MARYSE_REQUEST, CONTRIBUTION_OF_TOMA, RECEIPT_OF_BOLTER, RECEIPT_OF_CONTRIBUTION_1, RECEIPT_OF_CONTRIBUTION_2, RECEIPT_OF_CONTRIBUTION_3, RECEIPT_OF_CONTRIBUTION_4, RECEIPT_OF_CONTRIBUTION_5, PROCURATION_OF_TOROCCO, BRIGHT_LIST, MANDRAGORA_PETAL, CRIMSON_MOSS, MANDRAGORA_BOUQUET, PARMAN_INSTRUCTIONS, PARMAN_LETTER, CLAY_DOUGH, PATTERN_OF_KEYHOLE, NIKOLAS_LIST, STAKATO_SHELL, TOAD_LORD_SAC, SPIDER_THORN, CRYSTAL_BROOCH);
-
addStartNpc(PARMAN);
addTalkId(WILFORD, PARMAN, LILITH, BRIGHT, SHARI, MION, LOCKIRIN, SPIRON, BALANKI, KEEF, FILAUR, ARIN, MARYSE_REDBONNET, BOLTER, TOROCCO, TOMA, PIOTUR, EMILY, NIKOLA, BOX_OF_TITAN);
-
addKillId(MANDRAGORA_SPROUT_1, MANDRAGORA_SAPLING, MANDRAGORA_BLOSSOM, MARSH_STAKATO, MANDRAGORA_SPROUT_2, GIANT_CRIMSON_ANT, MARSH_STAKATO_WORKER, TOAD_LORD, MARSH_STAKATO_SOLDIER, MARSH_SPIDER, MARSH_STAKATO_DRONE);
}
@@ -132,158 +125,163 @@ public class Q221_TestimonyOfProsperity extends Quest
return htmltext;
}
- // PARMAN
- if (event.equals("30104-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(RING_OF_TESTIMONY_1, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange37", false))
+ case "30104-04.htm":
{
- htmltext = "30104-04e.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
- player.getVariables().set("secondClassChange37", true);
+ st.startQuest();
+ st.giveItems(RING_OF_TESTIMONY_1, 1);
+ if (!player.getVariables().getBoolean("secondClassChange37", false))
+ {
+ htmltext = "30104-04e.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_37.get(player.getRace().ordinal()));
+ player.getVariables().set("secondClassChange37", true);
+ }
+ break;
}
- }
- else if (event.equals("30104-07.htm"))
- {
- st.takeItems(BLESSED_SEED, 1);
- st.takeItems(EMILY_RECIPE, 1);
- st.takeItems(LILITH_ELVEN_WAFER, 1);
- st.takeItems(OLD_ACCOUNT_BOOK, 1);
- st.takeItems(RING_OF_TESTIMONY_1, 1);
- st.playSound(QuestState.SOUND_MIDDLE);
-
- if (player.getLevel() < 38)
+ case "30104-07.htm":
{
- st.set("cond", "3");
- st.giveItems(PARMAN_INSTRUCTIONS, 1);
- }
- else
- {
- htmltext = "30104-08.htm";
- st.set("cond", "4");
- st.giveItems(PARMAN_LETTER, 1);
- st.giveItems(RING_OF_TESTIMONY_2, 1);
- }
- }
- // LOCKIRIN
- else if (event.equals("30531-02.htm") && st.hasQuestItems(COLLECTION_LICENSE))
- {
- htmltext = "30531-04.htm";
- }
- else if (event.equals("30531-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(COLLECTION_LICENSE, 1);
- st.giveItems(LOCKIRIN_NOTICE_1, 1);
- st.giveItems(LOCKIRIN_NOTICE_2, 1);
- st.giveItems(LOCKIRIN_NOTICE_3, 1);
- st.giveItems(LOCKIRIN_NOTICE_4, 1);
- st.giveItems(LOCKIRIN_NOTICE_5, 1);
- }
- // KEEF
- else if (event.equals("30534-03a.htm") && (st.getQuestItemsCount(ADENA) >= 5000))
- {
- htmltext = "30534-03b.htm";
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(ADENA, 5000);
- st.takeItems(PROCURATION_OF_TOROCCO, 1);
- st.giveItems(RECEIPT_OF_CONTRIBUTION_3, 1);
- }
- // WILFORD
- else if (event.equals("30005-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(CRYSTAL_BROOCH, 1);
- }
- // BRIGHT
- else if (event.equals("30466-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(BRIGHT_LIST, 1);
- }
- // TOROCCO
- else if (event.equals("30555-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(PROCURATION_OF_TOROCCO, 1);
- }
- // LILITH
- else if (event.equals("30368-03.htm"))
- {
- st.takeItems(CRYSTAL_BROOCH, 1);
- st.giveItems(LILITH_ELVEN_WAFER, 1);
-
- if (st.hasQuestItems(BLESSED_SEED, OLD_ACCOUNT_BOOK, EMILY_RECIPE))
- {
- st.set("cond", "2");
+ st.takeItems(BLESSED_SEED, 1);
+ st.takeItems(EMILY_RECIPE, 1);
+ st.takeItems(LILITH_ELVEN_WAFER, 1);
+ st.takeItems(OLD_ACCOUNT_BOOK, 1);
+ st.takeItems(RING_OF_TESTIMONY_1, 1);
st.playSound(QuestState.SOUND_MIDDLE);
+ if (player.getLevel() < 38)
+ {
+ st.setCond(3);
+ st.giveItems(PARMAN_INSTRUCTIONS, 1);
+ }
+ else
+ {
+ htmltext = "30104-08.htm";
+ st.setCond(4);
+ st.giveItems(PARMAN_LETTER, 1);
+ st.giveItems(RING_OF_TESTIMONY_2, 1);
+ }
+ break;
}
- else
+ case "30531-02.htm":
+ {
+ if (st.hasQuestItems(COLLECTION_LICENSE))
+ {
+ htmltext = "30531-04.htm";
+ }
+ break;
+ }
+ case "30531-03.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(COLLECTION_LICENSE, 1);
+ st.giveItems(LOCKIRIN_NOTICE_1, 1);
+ st.giveItems(LOCKIRIN_NOTICE_2, 1);
+ st.giveItems(LOCKIRIN_NOTICE_3, 1);
+ st.giveItems(LOCKIRIN_NOTICE_4, 1);
+ st.giveItems(LOCKIRIN_NOTICE_5, 1);
+ break;
}
- }
- // PIOTUR
- else if (event.equals("30597-02.htm"))
- {
- st.giveItems(BLESSED_SEED, 1);
-
- if (st.hasQuestItems(OLD_ACCOUNT_BOOK, EMILY_RECIPE, LILITH_ELVEN_WAFER))
+ case "30534-03a.htm":
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
+ if (st.getQuestItemsCount(ADENA) >= 5000)
+ {
+ htmltext = "30534-03b.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(ADENA, 5000);
+ st.takeItems(PROCURATION_OF_TOROCCO, 1);
+ st.giveItems(RECEIPT_OF_CONTRIBUTION_3, 1);
+ }
+ break;
}
- else
+ case "30005-04.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(CRYSTAL_BROOCH, 1);
+ break;
}
- }
- // EMILY
- else if (event.equals("30620-03.htm"))
- {
- st.takeItems(MANDRAGORA_BOUQUET, 1);
- st.giveItems(EMILY_RECIPE, 1);
-
- if (st.hasQuestItems(BLESSED_SEED, OLD_ACCOUNT_BOOK, LILITH_ELVEN_WAFER))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else
+ case "30466-03.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(BRIGHT_LIST, 1);
+ break;
+ }
+ case "30555-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(PROCURATION_OF_TOROCCO, 1);
+ break;
+ }
+ case "30368-03.htm":
+ {
+ st.takeItems(CRYSTAL_BROOCH, 1);
+ st.giveItems(LILITH_ELVEN_WAFER, 1);
+ if (st.hasQuestItems(BLESSED_SEED, OLD_ACCOUNT_BOOK, EMILY_RECIPE))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
+ }
+ case "30597-02.htm":
+ {
+ st.giveItems(BLESSED_SEED, 1);
+ if (st.hasQuestItems(OLD_ACCOUNT_BOOK, EMILY_RECIPE, LILITH_ELVEN_WAFER))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
+ }
+ case "30620-03.htm":
+ {
+ st.takeItems(MANDRAGORA_BOUQUET, 1);
+ st.giveItems(EMILY_RECIPE, 1);
+ if (st.hasQuestItems(BLESSED_SEED, OLD_ACCOUNT_BOOK, LILITH_ELVEN_WAFER))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
+ }
+ case "30621-04.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CLAY_DOUGH, 1);
+ break;
+ }
+ case "30622-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CLAY_DOUGH, 1);
+ st.giveItems(PATTERN_OF_KEYHOLE, 1);
+ break;
+ }
+ case "30622-04.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KEY_OF_TITAN, 1);
+ st.takeItems(NIKOLAS_LIST, 1);
+ st.takeItems(RECIPE_TITAN_KEY, 1);
+ st.takeItems(STAKATO_SHELL, 20);
+ st.takeItems(SPIDER_THORN, 10);
+ st.takeItems(TOAD_LORD_SAC, 10);
+ st.giveItems(MAPHR_TABLET_FRAGMENT, 1);
+ break;
}
- }
- // NIKOLA
- else if (event.equals("30621-04.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CLAY_DOUGH, 1);
- }
- // BOX OF TITAN
- else if (event.equals("30622-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CLAY_DOUGH, 1);
- st.giveItems(PATTERN_OF_KEYHOLE, 1);
- }
- else if (event.equals("30622-04.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KEY_OF_TITAN, 1);
- st.takeItems(NIKOLAS_LIST, 1);
- st.takeItems(RECIPE_TITAN_KEY, 1);
- st.takeItems(STAKATO_SHELL, 20);
- st.takeItems(SPIDER_THORN, 10);
- st.takeItems(TOAD_LORD_SAC, 10);
- st.giveItems(MAPHR_TABLET_FRAGMENT, 1);
}
return htmltext;
@@ -302,6 +300,7 @@ public class Q221_TestimonyOfProsperity extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DWARF)
{
htmltext = "30104-01.htm";
@@ -319,12 +318,14 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30104-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case PARMAN:
+ {
if (cond == 1)
{
htmltext = "30104-05.htm";
@@ -342,7 +343,7 @@ public class Q221_TestimonyOfProsperity extends Quest
else
{
htmltext = "30104-10.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PARMAN_INSTRUCTIONS, 1);
st.giveItems(PARMAN_LETTER, 1);
@@ -369,8 +370,9 @@ public class Q221_TestimonyOfProsperity extends Quest
st.exitQuest(false);
}
break;
-
+ }
case LOCKIRIN:
+ {
if ((cond == 1) || (cond == 2))
{
if (st.hasQuestItems(COLLECTION_LICENSE))
@@ -388,7 +390,7 @@ public class Q221_TestimonyOfProsperity extends Quest
if (st.hasQuestItems(BLESSED_SEED, EMILY_RECIPE, LILITH_ELVEN_WAFER))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -411,8 +413,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30531-07.htm";
}
break;
-
+ }
case SPIRON:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(LOCKIRIN_NOTICE_1))
@@ -434,8 +437,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case BALANKI:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(LOCKIRIN_NOTICE_2))
@@ -458,8 +462,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case KEEF:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(LOCKIRIN_NOTICE_3))
@@ -478,8 +483,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case FILAUR:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(LOCKIRIN_NOTICE_4))
@@ -501,8 +507,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case ARIN:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(LOCKIRIN_NOTICE_5))
@@ -524,8 +531,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case SHARI:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(CONTRIBUTION_OF_SHARI))
@@ -540,8 +548,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case MION:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(CONTRIBUTION_OF_MION))
@@ -556,8 +565,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case MARYSE_REDBONNET:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(MARYSE_REQUEST))
@@ -587,8 +597,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case TOROCCO:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(PROCURATION_OF_TOROCCO))
@@ -601,8 +612,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case BOLTER:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(RECEIPT_OF_BOLTER))
@@ -617,8 +629,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case TOMA:
+ {
if ((cond == 1) && st.hasQuestItems(COLLECTION_LICENSE))
{
if (st.hasQuestItems(CONTRIBUTION_OF_TOMA))
@@ -633,8 +646,9 @@ public class Q221_TestimonyOfProsperity extends Quest
}
}
break;
-
+ }
case PIOTUR:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = (st.hasQuestItems(BLESSED_SEED)) ? "30597-03.htm" : "30597-01.htm";
@@ -644,8 +658,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30597-04.htm";
}
break;
-
+ }
case WILFORD:
+ {
if ((cond == 1) || (cond == 2))
{
if (st.hasQuestItems(LILITH_ELVEN_WAFER))
@@ -662,8 +677,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30005-07.htm";
}
break;
-
+ }
case LILITH:
+ {
if ((cond == 1) || (cond == 2))
{
if (st.hasQuestItems(CRYSTAL_BROOCH))
@@ -680,8 +696,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30368-05.htm";
}
break;
-
+ }
case BRIGHT:
+ {
if ((cond == 1) || (cond == 2))
{
if (st.hasQuestItems(EMILY_RECIPE))
@@ -718,8 +735,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30466-08.htm";
}
break;
-
+ }
case EMILY:
+ {
if ((cond == 1) || (cond == 2))
{
if (st.hasQuestItems(EMILY_RECIPE))
@@ -736,8 +754,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30620-05.htm";
}
break;
-
+ }
case NIKOLA:
+ {
if (cond == 4)
{
htmltext = "30621-01.htm";
@@ -751,7 +770,7 @@ public class Q221_TestimonyOfProsperity extends Quest
else if (cond == 6)
{
htmltext = "30621-06.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PATTERN_OF_KEYHOLE, 1);
st.giveItems(NIKOLAS_LIST, 1);
@@ -766,8 +785,9 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30621-09.htm";
}
break;
-
+ }
case BOX_OF_TITAN:
+ {
if (cond == 5)
{
htmltext = "30622-01.htm";
@@ -781,12 +801,15 @@ public class Q221_TestimonyOfProsperity extends Quest
htmltext = "30622-05.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -801,86 +824,96 @@ public class Q221_TestimonyOfProsperity extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case MANDRAGORA_SPROUT_1:
+ {
if (st.hasQuestItems(BRIGHT_LIST))
{
st.dropItems(MANDRAGORA_PETAL, 1, 20, 300000);
}
break;
-
+ }
case MANDRAGORA_SPROUT_2:
+ {
if (st.hasQuestItems(BRIGHT_LIST))
{
st.dropItems(MANDRAGORA_PETAL, 1, 20, 600000);
}
break;
-
+ }
case MANDRAGORA_SAPLING:
+ {
if (st.hasQuestItems(BRIGHT_LIST))
{
st.dropItems(MANDRAGORA_PETAL, 1, 20, 800000);
}
break;
-
+ }
case MANDRAGORA_BLOSSOM:
+ {
if (st.hasQuestItems(BRIGHT_LIST))
{
st.dropItemsAlways(MANDRAGORA_PETAL, 1, 20);
}
break;
-
+ }
case GIANT_CRIMSON_ANT:
+ {
if (st.hasQuestItems(BRIGHT_LIST))
{
st.dropItemsAlways(CRIMSON_MOSS, 1, 10);
}
break;
-
+ }
case MARSH_STAKATO:
- if ((cond == 7) && st.dropItems(STAKATO_SHELL, 1, 20, 200000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
+ {
+ if (st.isCond(7) && st.dropItems(STAKATO_SHELL, 1, 20, 200000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
-
+ }
case MARSH_STAKATO_WORKER:
- if ((cond == 7) && st.dropItems(STAKATO_SHELL, 1, 20, 300000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
+ {
+ if (st.isCond(7) && st.dropItems(STAKATO_SHELL, 1, 20, 300000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
-
+ }
case MARSH_STAKATO_SOLDIER:
- if ((cond == 7) && st.dropItems(STAKATO_SHELL, 1, 20, 500000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
+ {
+ if (st.isCond(7) && st.dropItems(STAKATO_SHELL, 1, 20, 500000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
-
+ }
case MARSH_STAKATO_DRONE:
- if ((cond == 7) && st.dropItems(STAKATO_SHELL, 1, 20, 600000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
+ {
+ if (st.isCond(7) && st.dropItems(STAKATO_SHELL, 1, 20, 600000) && ((st.getQuestItemsCount(TOAD_LORD_SAC) + st.getQuestItemsCount(SPIDER_THORN)) == 20))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
-
+ }
case TOAD_LORD:
- if ((cond == 7) && st.dropItems(TOAD_LORD_SAC, 1, 10, 200000) && ((st.getQuestItemsCount(STAKATO_SHELL) + st.getQuestItemsCount(SPIDER_THORN)) == 30))
+ {
+ if (st.isCond(7) && st.dropItems(TOAD_LORD_SAC, 1, 10, 200000) && ((st.getQuestItemsCount(STAKATO_SHELL) + st.getQuestItemsCount(SPIDER_THORN)) == 30))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
-
+ }
case MARSH_SPIDER:
- if ((cond == 7) && st.dropItems(SPIDER_THORN, 1, 10, 200000) && ((st.getQuestItemsCount(STAKATO_SHELL) + st.getQuestItemsCount(TOAD_LORD_SAC)) == 30))
+ {
+ if (st.isCond(7) && st.dropItems(SPIDER_THORN, 1, 10, 200000) && ((st.getQuestItemsCount(STAKATO_SHELL) + st.getQuestItemsCount(TOAD_LORD_SAC)) == 30))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q222_TestOfTheDuelist/Q222_TestOfTheDuelist.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q222_TestOfTheDuelist/Q222_TestOfTheDuelist.java
index 89e9543960..6c8a2f4772 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q222_TestOfTheDuelist/Q222_TestOfTheDuelist.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q222_TestOfTheDuelist/Q222_TestOfTheDuelist.java
@@ -28,7 +28,22 @@ public class Q222_TestOfTheDuelist extends Quest
{
// NPC
private static final int KAIEN = 30623;
-
+ // Monsters
+ private static final int PUNCHER = 20085;
+ private static final int NOBLE_ANT_LEADER = 20090;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int DEAD_SEEKER = 20202;
+ private static final int BREKA_ORC_OVERLORD = 20270;
+ private static final int FETTERED_SOUL = 20552;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int ENCHANTED_MONSTEREYE = 20564;
+ private static final int TAMLIN_ORC = 20601;
+ private static final int TAMLIN_ORC_ARCHER = 20602;
+ private static final int EXCURO = 20214;
+ private static final int KRATOR = 20217;
+ private static final int GRANDIS = 20554;
+ private static final int TIMAK_ORC_OVERLORD = 20588;
+ private static final int LAKIN = 20604;
// Items
private static final int ORDER_GLUDIO = 2763;
private static final int ORDER_DION = 2764;
@@ -51,37 +66,16 @@ public class Q222_TestOfTheDuelist extends Quest
private static final int GRANDIS_SKIN = 2781;
private static final int TIMAK_ORC_BELT = 2782;
private static final int LAKIN_MACE = 2783;
-
// Rewards
private static final int MARK_OF_DUELIST = 2762;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // Monsters
- private static final int PUNCHER = 20085;
- private static final int NOBLE_ANT_LEADER = 20090;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int DEAD_SEEKER = 20202;
- private static final int BREKA_ORC_OVERLORD = 20270;
- private static final int FETTERED_SOUL = 20552;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int ENCHANTED_MONSTEREYE = 20564;
- private static final int TAMLIN_ORC = 20601;
- private static final int TAMLIN_ORC_ARCHER = 20602;
- private static final int EXCURO = 20214;
- private static final int KRATOR = 20217;
- private static final int GRANDIS = 20554;
- private static final int TIMAK_ORC_OVERLORD = 20588;
- private static final int LAKIN = 20604;
-
public Q222_TestOfTheDuelist()
{
super(222, "Test of the Duelist");
-
registerQuestItems(ORDER_GLUDIO, ORDER_DION, ORDER_GIRAN, ORDER_OREN, ORDER_ADEN, FINAL_ORDER, PUNCHER_SHARD, NOBLE_ANT_FEELER, DRONE_CHITIN, DEAD_SEEKER_FANG, OVERLORD_NECKLACE, FETTERED_SOUL_CHAIN, CHIEF_AMULET, ENCHANTED_EYE_MEAT, TAMRIN_ORC_RING, TAMRIN_ORC_ARROW, EXCURO_SKIN, KRATOR_SHARD, GRANDIS_SKIN, TIMAK_ORC_BELT, LAKIN_MACE);
-
addStartNpc(KAIEN);
addTalkId(KAIEN);
-
addKillId(PUNCHER, NOBLE_ANT_LEADER, MARSH_STAKATO_DRONE, DEAD_SEEKER, BREKA_ORC_OVERLORD, FETTERED_SOUL, LETO_LIZARDMAN_OVERLORD, ENCHANTED_MONSTEREYE, TAMLIN_ORC, TAMLIN_ORC_ARCHER, EXCURO, KRATOR, GRANDIS, TIMAK_ORC_OVERLORD, LAKIN);
}
@@ -95,57 +89,60 @@ public class Q222_TestOfTheDuelist extends Quest
return htmltext;
}
- if (event.equals("30623-04.htm"))
+ switch (event)
{
- if (player.getRace() == Race.ORC)
+ case "30623-04.htm":
{
- htmltext = "30623-05.htm";
+ if (player.getRace() == Race.ORC)
+ {
+ htmltext = "30623-05.htm";
+ }
+ break;
}
- }
- else if (event.equals("30623-07.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_GLUDIO, 1);
- st.giveItems(ORDER_DION, 1);
- st.giveItems(ORDER_GIRAN, 1);
- st.giveItems(ORDER_OREN, 1);
- st.giveItems(ORDER_ADEN, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30623-07.htm":
{
- htmltext = "30623-07a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.setCond(2);
+ st.giveItems(ORDER_GLUDIO, 1);
+ st.giveItems(ORDER_DION, 1);
+ st.giveItems(ORDER_GIRAN, 1);
+ st.giveItems(ORDER_OREN, 1);
+ st.giveItems(ORDER_ADEN, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30623-07a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- else if (event.equals("30623-16.htm"))
- {
- if (st.getInt("cond") == 3)
+ case "30623-16.htm":
{
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
-
- st.takeItems(ORDER_GLUDIO, 1);
- st.takeItems(ORDER_DION, 1);
- st.takeItems(ORDER_GIRAN, 1);
- st.takeItems(ORDER_OREN, 1);
- st.takeItems(ORDER_ADEN, 1);
-
- st.takeItems(PUNCHER_SHARD, -1);
- st.takeItems(NOBLE_ANT_FEELER, -1);
- st.takeItems(DRONE_CHITIN, -1);
- st.takeItems(DEAD_SEEKER_FANG, -1);
- st.takeItems(OVERLORD_NECKLACE, -1);
- st.takeItems(FETTERED_SOUL_CHAIN, -1);
- st.takeItems(CHIEF_AMULET, -1);
- st.takeItems(ENCHANTED_EYE_MEAT, -1);
- st.takeItems(TAMRIN_ORC_RING, -1);
- st.takeItems(TAMRIN_ORC_ARROW, -1);
-
- st.giveItems(FINAL_ORDER, 1);
+ if (st.isCond(3))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+
+ st.takeItems(ORDER_GLUDIO, 1);
+ st.takeItems(ORDER_DION, 1);
+ st.takeItems(ORDER_GIRAN, 1);
+ st.takeItems(ORDER_OREN, 1);
+ st.takeItems(ORDER_ADEN, 1);
+
+ st.takeItems(PUNCHER_SHARD, -1);
+ st.takeItems(NOBLE_ANT_FEELER, -1);
+ st.takeItems(DRONE_CHITIN, -1);
+ st.takeItems(DEAD_SEEKER_FANG, -1);
+ st.takeItems(OVERLORD_NECKLACE, -1);
+ st.takeItems(FETTERED_SOUL_CHAIN, -1);
+ st.takeItems(CHIEF_AMULET, -1);
+ st.takeItems(ENCHANTED_EYE_MEAT, -1);
+ st.takeItems(TAMRIN_ORC_RING, -1);
+ st.takeItems(TAMRIN_ORC_ARROW, -1);
+
+ st.giveItems(FINAL_ORDER, 1);
+ }
+ break;
}
}
@@ -165,6 +162,7 @@ public class Q222_TestOfTheDuelist extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
final int classId = player.getClassId().getId();
if ((classId != 0x01) && (classId != 0x2f) && (classId != 0x13) && (classId != 0x20))
{
@@ -179,9 +177,10 @@ public class Q222_TestOfTheDuelist extends Quest
htmltext = "30623-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 2)
{
htmltext = "30623-07a.htm";
@@ -210,10 +209,12 @@ public class Q222_TestOfTheDuelist extends Quest
st.exitQuest(false);
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -228,119 +229,136 @@ public class Q222_TestOfTheDuelist extends Quest
return null;
}
- if (st.getInt("cond") == 2)
+ if (st.isCond(2))
{
switch (npc.getNpcId())
{
case PUNCHER:
+ {
if (st.dropItemsAlways(PUNCHER_SHARD, 1, 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case NOBLE_ANT_LEADER:
+ {
if (st.dropItemsAlways(NOBLE_ANT_FEELER, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case MARSH_STAKATO_DRONE:
+ {
if (st.dropItemsAlways(DRONE_CHITIN, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case DEAD_SEEKER:
+ {
if (st.dropItemsAlways(DEAD_SEEKER_FANG, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case BREKA_ORC_OVERLORD:
+ {
if (st.dropItemsAlways(OVERLORD_NECKLACE, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case FETTERED_SOUL:
+ {
if (st.dropItemsAlways(FETTERED_SOUL_CHAIN, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case LETO_LIZARDMAN_OVERLORD:
+ {
if (st.dropItemsAlways(CHIEF_AMULET, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case ENCHANTED_MONSTEREYE:
+ {
if (st.dropItemsAlways(ENCHANTED_EYE_MEAT, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case TAMLIN_ORC:
+ {
if (st.dropItemsAlways(TAMRIN_ORC_RING, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_ARROW) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case TAMLIN_ORC_ARCHER:
+ {
if (st.dropItemsAlways(TAMRIN_ORC_ARROW, 1, 10) && (st.getQuestItemsCount(PUNCHER_SHARD) >= 10) && (st.getQuestItemsCount(NOBLE_ANT_FEELER) >= 10) && (st.getQuestItemsCount(DRONE_CHITIN) >= 10) && (st.getQuestItemsCount(DEAD_SEEKER_FANG) >= 10) && (st.getQuestItemsCount(OVERLORD_NECKLACE) >= 10) && (st.getQuestItemsCount(FETTERED_SOUL_CHAIN) >= 10) && (st.getQuestItemsCount(CHIEF_AMULET) >= 10) && (st.getQuestItemsCount(ENCHANTED_EYE_MEAT) >= 10) && (st.getQuestItemsCount(TAMRIN_ORC_RING) >= 10))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
+ }
}
}
- else if (st.getInt("cond") == 4)
+ else if (st.isCond(4))
{
switch (npc.getNpcId())
{
case EXCURO:
+ {
if (st.dropItemsAlways(EXCURO_SKIN, 1, 3) && (st.getQuestItemsCount(KRATOR_SHARD) >= 3) && (st.getQuestItemsCount(LAKIN_MACE) >= 3) && (st.getQuestItemsCount(GRANDIS_SKIN) >= 3) && (st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case KRATOR:
+ {
if (st.dropItemsAlways(KRATOR_SHARD, 1, 3) && (st.getQuestItemsCount(EXCURO_SKIN) >= 3) && (st.getQuestItemsCount(LAKIN_MACE) >= 3) && (st.getQuestItemsCount(GRANDIS_SKIN) >= 3) && (st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case LAKIN:
+ {
if (st.dropItemsAlways(LAKIN_MACE, 1, 3) && (st.getQuestItemsCount(EXCURO_SKIN) >= 3) && (st.getQuestItemsCount(KRATOR_SHARD) >= 3) && (st.getQuestItemsCount(GRANDIS_SKIN) >= 3) && (st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case GRANDIS:
+ {
if (st.dropItemsAlways(GRANDIS_SKIN, 1, 3) && (st.getQuestItemsCount(EXCURO_SKIN) >= 3) && (st.getQuestItemsCount(KRATOR_SHARD) >= 3) && (st.getQuestItemsCount(LAKIN_MACE) >= 3) && (st.getQuestItemsCount(TIMAK_ORC_BELT) >= 3))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case TIMAK_ORC_OVERLORD:
+ {
if (st.dropItemsAlways(TIMAK_ORC_BELT, 1, 3) && (st.getQuestItemsCount(EXCURO_SKIN) >= 3) && (st.getQuestItemsCount(KRATOR_SHARD) >= 3) && (st.getQuestItemsCount(LAKIN_MACE) >= 3) && (st.getQuestItemsCount(GRANDIS_SKIN) >= 3))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
+ }
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q223_TestOfTheChampion/Q223_TestOfTheChampion.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q223_TestOfTheChampion/Q223_TestOfTheChampion.java
index c30dbb79cb..2fb4ff1562 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q223_TestOfTheChampion/Q223_TestOfTheChampion.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q223_TestOfTheChampion/Q223_TestOfTheChampion.java
@@ -30,6 +30,25 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q223_TestOfTheChampion extends Quest
{
+ // NPCs
+ private static final int ASCALON = 30624;
+ private static final int GROOT = 30093;
+ private static final int MOUEN = 30196;
+ private static final int MASON = 30625;
+ // Monsters
+ private static final int HARPY = 20145;
+ private static final int HARPY_MATRIARCH = 27088;
+ private static final int MEDUSA = 20158;
+ private static final int WINDSUS = 20553;
+ private static final int ROAD_COLLECTOR = 27089;
+ private static final int ROAD_SCAVENGER = 20551;
+ private static final int LETO_LIZARDMAN = 20577;
+ private static final int LETO_LIZARDMAN_ARCHER = 20578;
+ private static final int LETO_LIZARDMAN_SOLDIER = 20579;
+ private static final int LETO_LIZARDMAN_WARRIOR = 20580;
+ private static final int LETO_LIZARDMAN_SHAMAN = 20581;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int BLOODY_AXE_ELITE = 20780;
// Items
private static final int ASCALON_LETTER_1 = 3277;
private static final int MASON_LETTER = 3278;
@@ -47,41 +66,16 @@ public class Q223_TestOfTheChampion extends Quest
private static final int BLOODY_AXE_HEAD = 3290;
private static final int ROAD_RATMAN_HEAD = 3291;
private static final int LETO_LIZARDMAN_FANG = 3292;
-
// Rewards
private static final int MARK_OF_CHAMPION = 3276;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int ASCALON = 30624;
- private static final int GROOT = 30093;
- private static final int MOUEN = 30196;
- private static final int MASON = 30625;
-
- // Monsters
- private static final int HARPY = 20145;
- private static final int HARPY_MATRIARCH = 27088;
- private static final int MEDUSA = 20158;
- private static final int WINDSUS = 20553;
- private static final int ROAD_COLLECTOR = 27089;
- private static final int ROAD_SCAVENGER = 20551;
- private static final int LETO_LIZARDMAN = 20577;
- private static final int LETO_LIZARDMAN_ARCHER = 20578;
- private static final int LETO_LIZARDMAN_SOLDIER = 20579;
- private static final int LETO_LIZARDMAN_WARRIOR = 20580;
- private static final int LETO_LIZARDMAN_SHAMAN = 20581;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int BLOODY_AXE_ELITE = 20780;
-
public Q223_TestOfTheChampion()
{
super(223, "Test of the Champion");
-
registerQuestItems(MASON_LETTER, MEDUSA_VENOM, WINDSUS_BILE, WHITE_ROSE_INSIGNIA, HARPY_EGG, GROOT_LETTER, MOUEN_LETTER, ASCALON_LETTER_1, IRON_ROSE_RING, BLOODY_AXE_HEAD, ASCALON_LETTER_2, ASCALON_LETTER_3, MOUEN_ORDER_1, ROAD_RATMAN_HEAD, MOUEN_ORDER_2, LETO_LIZARDMAN_FANG);
-
addStartNpc(ASCALON);
addTalkId(ASCALON, GROOT, MOUEN, MASON);
-
addAttackId(HARPY, ROAD_SCAVENGER);
addKillId(HARPY, MEDUSA, HARPY_MATRIARCH, ROAD_COLLECTOR, ROAD_SCAVENGER, WINDSUS, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, BLOODY_AXE_ELITE);
}
@@ -96,62 +90,69 @@ public class Q223_TestOfTheChampion extends Quest
return htmltext;
}
- if (event.equals("30624-06.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ASCALON_LETTER_1, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30624-06.htm":
{
- htmltext = "30624-06a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(ASCALON_LETTER_1, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30624-06a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
+ }
+ case "30624-10.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MASON_LETTER, 1);
+ st.giveItems(ASCALON_LETTER_2, 1);
+ break;
+ }
+ case "30624-14.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GROOT_LETTER, 1);
+ st.giveItems(ASCALON_LETTER_3, 1);
+ break;
+ }
+ case "30625-03.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ASCALON_LETTER_1, 1);
+ st.giveItems(IRON_ROSE_RING, 1);
+ break;
+ }
+ case "30093-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ASCALON_LETTER_2, 1);
+ st.giveItems(WHITE_ROSE_INSIGNIA, 1);
+ break;
+ }
+ case "30196-03.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ASCALON_LETTER_3, 1);
+ st.giveItems(MOUEN_ORDER_1, 1);
+ break;
+ }
+ case "30196-06.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MOUEN_ORDER_1, 1);
+ st.takeItems(ROAD_RATMAN_HEAD, 1);
+ st.giveItems(MOUEN_ORDER_2, 1);
+ break;
}
- }
- else if (event.equals("30624-10.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MASON_LETTER, 1);
- st.giveItems(ASCALON_LETTER_2, 1);
- }
- else if (event.equals("30624-14.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GROOT_LETTER, 1);
- st.giveItems(ASCALON_LETTER_3, 1);
- }
- else if (event.equals("30625-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ASCALON_LETTER_1, 1);
- st.giveItems(IRON_ROSE_RING, 1);
- }
- else if (event.equals("30093-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ASCALON_LETTER_2, 1);
- st.giveItems(WHITE_ROSE_INSIGNIA, 1);
- }
- else if (event.equals("30196-03.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ASCALON_LETTER_3, 1);
- st.giveItems(MOUEN_ORDER_1, 1);
- }
- else if (event.equals("30196-06.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MOUEN_ORDER_1, 1);
- st.takeItems(ROAD_RATMAN_HEAD, 1);
- st.giveItems(MOUEN_ORDER_2, 1);
}
return htmltext;
@@ -170,6 +171,7 @@ public class Q223_TestOfTheChampion extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
final ClassId classId = player.getClassId();
if ((classId != ClassId.WARRIOR) && (classId != ClassId.ORC_RAIDER))
{
@@ -184,12 +186,14 @@ public class Q223_TestOfTheChampion extends Quest
htmltext = (classId == ClassId.WARRIOR) ? "30624-03.htm" : "30624-04.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ASCALON:
+ {
if (cond == 1)
{
htmltext = "30624-07.htm";
@@ -233,8 +237,9 @@ public class Q223_TestOfTheChampion extends Quest
st.exitQuest(false);
}
break;
-
+ }
case MASON:
+ {
if (cond == 1)
{
htmltext = "30625-01.htm";
@@ -246,7 +251,7 @@ public class Q223_TestOfTheChampion extends Quest
else if (cond == 3)
{
htmltext = "30625-05.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BLOODY_AXE_HEAD, -1);
st.takeItems(IRON_ROSE_RING, 1);
@@ -261,8 +266,9 @@ public class Q223_TestOfTheChampion extends Quest
htmltext = "30625-07.htm";
}
break;
-
+ }
case GROOT:
+ {
if (cond == 5)
{
htmltext = "30093-01.htm";
@@ -274,7 +280,7 @@ public class Q223_TestOfTheChampion extends Quest
else if (cond == 7)
{
htmltext = "30093-04.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(WHITE_ROSE_INSIGNIA, 1);
st.takeItems(HARPY_EGG, -1);
@@ -291,8 +297,9 @@ public class Q223_TestOfTheChampion extends Quest
htmltext = "30093-06.htm";
}
break;
-
+ }
case MOUEN:
+ {
if (cond == 9)
{
htmltext = "30196-01.htm";
@@ -312,7 +319,7 @@ public class Q223_TestOfTheChampion extends Quest
else if (cond == 13)
{
htmltext = "30196-08.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LETO_LIZARDMAN_FANG, -1);
st.takeItems(MOUEN_ORDER_2, 1);
@@ -323,12 +330,15 @@ public class Q223_TestOfTheChampion extends Quest
htmltext = "30196-09.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -346,7 +356,8 @@ public class Q223_TestOfTheChampion extends Quest
switch (npc.getNpcId())
{
case HARPY: // Possibility to spawn an HARPY _MATRIARCH.
- if ((st.getInt("cond") == 6) && Rnd.nextBoolean() && !npc.isScriptValue(1))
+ {
+ if (st.isCond(6) && Rnd.nextBoolean() && !npc.isScriptValue(1))
{
final Creature originalKiller = isPet ? attacker.getPet() : attacker;
@@ -362,9 +373,10 @@ public class Q223_TestOfTheChampion extends Quest
npc.setScriptValue(1);
}
break;
-
+ }
case ROAD_SCAVENGER: // Possibility to spawn a Road Collector.
- if ((st.getInt("cond") == 10) && Rnd.nextBoolean() && !npc.isScriptValue(1))
+ {
+ if (st.isCond(10) && Rnd.nextBoolean() && !npc.isScriptValue(1))
{
final Creature originalKiller = isPet ? attacker.getPet() : attacker;
@@ -380,6 +392,7 @@ public class Q223_TestOfTheChampion extends Quest
npc.setScriptValue(1);
}
break;
+ }
}
return null;
@@ -395,57 +408,63 @@ public class Q223_TestOfTheChampion extends Quest
}
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case BLOODY_AXE_ELITE:
- if ((st.getInt("cond") == 2) && st.dropItemsAlways(BLOODY_AXE_HEAD, 1, 100))
+ {
+ if (st.isCond(2) && st.dropItemsAlways(BLOODY_AXE_HEAD, 1, 100))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case HARPY:
case HARPY_MATRIARCH:
- if ((st.getInt("cond") == 6) && st.dropItems(HARPY_EGG, 1, 30, 500000) && (st.getQuestItemsCount(MEDUSA_VENOM) == 30) && (st.getQuestItemsCount(WINDSUS_BILE) == 30))
+ {
+ if (st.isCond(6) && st.dropItems(HARPY_EGG, 1, 30, 500000) && (st.getQuestItemsCount(MEDUSA_VENOM) == 30) && (st.getQuestItemsCount(WINDSUS_BILE) == 30))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case MEDUSA:
- if ((st.getInt("cond") == 6) && st.dropItems(MEDUSA_VENOM, 1, 30, 500000) && (st.getQuestItemsCount(HARPY_EGG) == 30) && (st.getQuestItemsCount(WINDSUS_BILE) == 30))
+ {
+ if (st.isCond(6) && st.dropItems(MEDUSA_VENOM, 1, 30, 500000) && (st.getQuestItemsCount(HARPY_EGG) == 30) && (st.getQuestItemsCount(WINDSUS_BILE) == 30))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case WINDSUS:
- if ((st.getInt("cond") == 6) && st.dropItems(WINDSUS_BILE, 1, 30, 500000) && (st.getQuestItemsCount(HARPY_EGG) == 30) && (st.getQuestItemsCount(MEDUSA_VENOM) == 30))
+ {
+ if (st.isCond(6) && st.dropItems(WINDSUS_BILE, 1, 30, 500000) && (st.getQuestItemsCount(HARPY_EGG) == 30) && (st.getQuestItemsCount(MEDUSA_VENOM) == 30))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case ROAD_COLLECTOR:
case ROAD_SCAVENGER:
- if ((st.getInt("cond") == 10) && st.dropItemsAlways(ROAD_RATMAN_HEAD, 1, 100))
+ {
+ if (st.isCond(10) && st.dropItemsAlways(ROAD_RATMAN_HEAD, 1, 100))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case LETO_LIZARDMAN:
case LETO_LIZARDMAN_ARCHER:
case LETO_LIZARDMAN_SOLDIER:
case LETO_LIZARDMAN_WARRIOR:
case LETO_LIZARDMAN_SHAMAN:
case LETO_LIZARDMAN_OVERLORD:
- if ((st.getInt("cond") == 12) && st.dropItems(LETO_LIZARDMAN_FANG, 1, 100, 500000 + (100000 * (npcId - 20577))))
+ {
+ if (st.isCond(12) && st.dropItems(LETO_LIZARDMAN_FANG, 1, 100, 500000 + (100000 * (npcId - 20577))))
{
- st.set("cond", "13");
+ st.setCond(13);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q224_TestOfSagittarius/Q224_TestOfSagittarius.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q224_TestOfSagittarius/Q224_TestOfSagittarius.java
index 380c530f96..c4efa3a651 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q224_TestOfSagittarius/Q224_TestOfSagittarius.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q224_TestOfSagittarius/Q224_TestOfSagittarius.java
@@ -28,35 +28,12 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q224_TestOfSagittarius extends Quest
{
- // Items
- private static final int BERNARD_INTRODUCTION = 3294;
- private static final int HAMIL_LETTER_1 = 3295;
- private static final int HAMIL_LETTER_2 = 3296;
- private static final int HAMIL_LETTER_3 = 3297;
- private static final int HUNTER_RUNE_1 = 3298;
- private static final int HUNTER_RUNE_2 = 3299;
- private static final int TALISMAN_OF_KADESH = 3300;
- private static final int TALISMAN_OF_SNAKE = 3301;
- private static final int MITHRIL_CLIP = 3302;
- private static final int STAKATO_CHITIN = 3303;
- private static final int REINFORCED_BOWSTRING = 3304;
- private static final int MANASHEN_HORN = 3305;
- private static final int BLOOD_OF_LIZARDMAN = 3306;
-
- private static final int CRESCENT_MOON_BOW = 3028;
- private static final int WOODEN_ARROW = 17;
-
- // Rewards
- private static final int MARK_OF_SAGITTARIUS = 3293;
- private static final int DIMENSIONAL_DIAMOND = 7562;
-
// NPCs
private static final int BERNARD = 30702;
private static final int HAMIL = 30626;
private static final int SIR_ARON_TANFORD = 30653;
private static final int VOKIAN = 30514;
private static final int GAUEN = 30717;
-
// Monsters
private static final int ANT = 20079;
private static final int ANT_CAPTAIN = 20080;
@@ -81,16 +58,32 @@ public class Q224_TestOfSagittarius extends Quest
private static final int LETO_LIZARDMAN_SHAMAN = 20581;
private static final int LETO_LIZARDMAN_OVERLORD = 20582;
private static final int SERPENT_DEMON_KADESH = 27090;
+ // Items
+ private static final int BERNARD_INTRODUCTION = 3294;
+ private static final int HAMIL_LETTER_1 = 3295;
+ private static final int HAMIL_LETTER_2 = 3296;
+ private static final int HAMIL_LETTER_3 = 3297;
+ private static final int HUNTER_RUNE_1 = 3298;
+ private static final int HUNTER_RUNE_2 = 3299;
+ private static final int TALISMAN_OF_KADESH = 3300;
+ private static final int TALISMAN_OF_SNAKE = 3301;
+ private static final int MITHRIL_CLIP = 3302;
+ private static final int STAKATO_CHITIN = 3303;
+ private static final int REINFORCED_BOWSTRING = 3304;
+ private static final int MANASHEN_HORN = 3305;
+ private static final int BLOOD_OF_LIZARDMAN = 3306;
+ private static final int CRESCENT_MOON_BOW = 3028;
+ private static final int WOODEN_ARROW = 17;
+ // Rewards
+ private static final int MARK_OF_SAGITTARIUS = 3293;
+ private static final int DIMENSIONAL_DIAMOND = 7562;
public Q224_TestOfSagittarius()
{
super(224, "Test of Sagittarius");
-
registerQuestItems(BERNARD_INTRODUCTION, HAMIL_LETTER_1, HAMIL_LETTER_2, HAMIL_LETTER_3, HUNTER_RUNE_1, HUNTER_RUNE_2, TALISMAN_OF_KADESH, TALISMAN_OF_SNAKE, MITHRIL_CLIP, STAKATO_CHITIN, REINFORCED_BOWSTRING, MANASHEN_HORN, BLOOD_OF_LIZARDMAN, CRESCENT_MOON_BOW);
-
addStartNpc(BERNARD);
addTalkId(BERNARD, HAMIL, SIR_ARON_TANFORD, VOKIAN, GAUEN);
-
addKillId(ANT, ANT_CAPTAIN, ANT_OVERSEER, ANT_RECRUIT, ANT_PATROL, ANT_GUARD, NOBLE_ANT, NOBLE_ANT_LEADER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, MARSH_STAKATO_WORKER, MARSH_STAKATO_SOLDIER, MARSH_STAKATO_DRONE, MARSH_SPIDER, ROAD_SCAVENGER, MANASHEN_GARGOYLE, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, SERPENT_DEMON_KADESH);
}
@@ -104,49 +97,50 @@ public class Q224_TestOfSagittarius extends Quest
return htmltext;
}
- // BERNARD
- if (event.equals("30702-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(BERNARD_INTRODUCTION, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30702-04.htm":
{
- htmltext = "30702-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(BERNARD_INTRODUCTION, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30702-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
+ }
+ case "30626-03.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BERNARD_INTRODUCTION, 1);
+ st.giveItems(HAMIL_LETTER_1, 1);
+ break;
+ }
+ case "30626-07.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HUNTER_RUNE_1, 10);
+ st.giveItems(HAMIL_LETTER_2, 1);
+ break;
+ }
+ case "30653-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HAMIL_LETTER_1, 1);
+ break;
+ }
+ case "30514-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HAMIL_LETTER_2, 1);
+ break;
}
- }
- // HAMIL
- else if (event.equals("30626-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BERNARD_INTRODUCTION, 1);
- st.giveItems(HAMIL_LETTER_1, 1);
- }
- else if (event.equals("30626-07.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HUNTER_RUNE_1, 10);
- st.giveItems(HAMIL_LETTER_2, 1);
- }
- // SIR_ARON_TANFORD
- else if (event.equals("30653-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HAMIL_LETTER_1, 1);
- }
- // VOKIAN
- else if (event.equals("30514-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HAMIL_LETTER_2, 1);
}
return htmltext;
@@ -165,6 +159,7 @@ public class Q224_TestOfSagittarius extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.ROGUE) && (player.getClassId() != ClassId.ELVEN_SCOUT) && (player.getClassId() != ClassId.ASSASSIN))
{
htmltext = "30702-02.htm";
@@ -178,16 +173,19 @@ public class Q224_TestOfSagittarius extends Quest
htmltext = "30702-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BERNARD:
+ {
htmltext = "30702-05.htm";
break;
-
+ }
case HAMIL:
+ {
if (cond == 1)
{
htmltext = "30626-01.htm";
@@ -207,7 +205,7 @@ public class Q224_TestOfSagittarius extends Quest
else if (cond == 8)
{
htmltext = "30626-09.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HUNTER_RUNE_2, 10);
st.giveItems(HAMIL_LETTER_3, 1);
@@ -219,7 +217,7 @@ public class Q224_TestOfSagittarius extends Quest
else if (cond == 12)
{
htmltext = "30626-11.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 13)
@@ -239,8 +237,9 @@ public class Q224_TestOfSagittarius extends Quest
st.exitQuest(false);
}
break;
-
+ }
case SIR_ARON_TANFORD:
+ {
if (cond == 2)
{
htmltext = "30653-01.htm";
@@ -250,8 +249,9 @@ public class Q224_TestOfSagittarius extends Quest
htmltext = "30653-03.htm";
}
break;
-
+ }
case VOKIAN:
+ {
if (cond == 5)
{
htmltext = "30514-01.htm";
@@ -263,7 +263,7 @@ public class Q224_TestOfSagittarius extends Quest
else if (cond == 7)
{
htmltext = "30514-04.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TALISMAN_OF_SNAKE, 1);
}
@@ -272,12 +272,13 @@ public class Q224_TestOfSagittarius extends Quest
htmltext = "30514-05.htm";
}
break;
-
+ }
case GAUEN:
+ {
if (cond == 9)
{
htmltext = "30717-01.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HAMIL_LETTER_3, 1);
}
@@ -288,7 +289,7 @@ public class Q224_TestOfSagittarius extends Quest
else if (cond == 11)
{
htmltext = "30717-02.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MANASHEN_HORN, 1);
st.takeItems(MITHRIL_CLIP, 1);
@@ -302,12 +303,15 @@ public class Q224_TestOfSagittarius extends Quest
htmltext = "30717-04.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -332,58 +336,65 @@ public class Q224_TestOfSagittarius extends Quest
case ANT_GUARD:
case NOBLE_ANT:
case NOBLE_ANT_LEADER:
- if ((st.getInt("cond") == 3) && st.dropItems(HUNTER_RUNE_1, 1, 10, 500000))
+ {
+ if (st.isCond(3) && st.dropItems(HUNTER_RUNE_1, 1, 10, 500000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case BREKA_ORC_SHAMAN:
case BREKA_ORC_OVERLORD:
- if ((st.getInt("cond") == 6) && st.dropItems(HUNTER_RUNE_2, 1, 10, 500000))
+ {
+ if (st.isCond(6) && st.dropItems(HUNTER_RUNE_2, 1, 10, 500000))
{
- st.set("cond", "7");
+ st.setCond(7);
st.giveItems(TALISMAN_OF_SNAKE, 1);
}
break;
-
+ }
case MARSH_STAKATO_WORKER:
case MARSH_STAKATO_SOLDIER:
case MARSH_STAKATO_DRONE:
- if ((st.getInt("cond") == 10) && st.dropItems(STAKATO_CHITIN, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, MITHRIL_CLIP, REINFORCED_BOWSTRING))
+ {
+ if (st.isCond(10) && st.dropItems(STAKATO_CHITIN, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, MITHRIL_CLIP, REINFORCED_BOWSTRING))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case MARSH_SPIDER:
- if ((st.getInt("cond") == 10) && st.dropItems(REINFORCED_BOWSTRING, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, MITHRIL_CLIP, STAKATO_CHITIN))
+ {
+ if (st.isCond(10) && st.dropItems(REINFORCED_BOWSTRING, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, MITHRIL_CLIP, STAKATO_CHITIN))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case ROAD_SCAVENGER:
- if ((st.getInt("cond") == 10) && st.dropItems(MITHRIL_CLIP, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, REINFORCED_BOWSTRING, STAKATO_CHITIN))
+ {
+ if (st.isCond(10) && st.dropItems(MITHRIL_CLIP, 1, 1, 100000) && st.hasQuestItems(MANASHEN_HORN, REINFORCED_BOWSTRING, STAKATO_CHITIN))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case MANASHEN_GARGOYLE:
- if ((st.getInt("cond") == 10) && st.dropItems(MANASHEN_HORN, 1, 1, 100000) && st.hasQuestItems(REINFORCED_BOWSTRING, MITHRIL_CLIP, STAKATO_CHITIN))
+ {
+ if (st.isCond(10) && st.dropItems(MANASHEN_HORN, 1, 1, 100000) && st.hasQuestItems(REINFORCED_BOWSTRING, MITHRIL_CLIP, STAKATO_CHITIN))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case LETO_LIZARDMAN:
case LETO_LIZARDMAN_ARCHER:
case LETO_LIZARDMAN_SOLDIER:
case LETO_LIZARDMAN_WARRIOR:
case LETO_LIZARDMAN_SHAMAN:
case LETO_LIZARDMAN_OVERLORD:
- if (st.getInt("cond") == 13)
+ {
+ if (st.isCond(13))
{
if (((st.getQuestItemsCount(BLOOD_OF_LIZARDMAN) - 120) * 5) > Rnd.get(100))
{
@@ -397,13 +408,14 @@ public class Q224_TestOfSagittarius extends Quest
}
}
break;
-
+ }
case SERPENT_DEMON_KADESH:
- if (st.getInt("cond") == 13)
+ {
+ if (st.isCond(13))
{
if (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == CRESCENT_MOON_BOW)
{
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(TALISMAN_OF_KADESH, 1);
}
@@ -413,6 +425,7 @@ public class Q224_TestOfSagittarius extends Quest
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q225_TestOfTheSearcher/Q225_TestOfTheSearcher.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q225_TestOfTheSearcher/Q225_TestOfTheSearcher.java
index db96684e37..ebb71f3033 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q225_TestOfTheSearcher/Q225_TestOfTheSearcher.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q225_TestOfTheSearcher/Q225_TestOfTheSearcher.java
@@ -26,6 +26,22 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q225_TestOfTheSearcher extends Quest
{
+ // NPCs
+ private static final int ALEX = 30291;
+ private static final int TYRA = 30420;
+ private static final int TREE = 30627;
+ private static final int STRONG_WOODEN_CHEST = 30628;
+ private static final int LUTHER = 30690;
+ private static final int LEIRYNN = 30728;
+ private static final int BORYS = 30729;
+ private static final int JAX = 30730;
+ // Monsters
+ private static final int HANGMAN_TREE = 20144;
+ private static final int ROAD_SCAVENGER = 20551;
+ private static final int GIANT_FUNGUS = 20555;
+ private static final int DELU_LIZARDMAN_SHAMAN = 20781;
+ private static final int DELU_CHIEF_KALKIS = 27093;
+ private static final int NEER_BODYGUARD = 27092;
// Items
private static final int LUTHER_LETTER = 2784;
private static final int ALEX_WARRANT = 2785;
@@ -52,40 +68,18 @@ public class Q225_TestOfTheSearcher extends Quest
private static final int RUSTED_KEY = 2806;
private static final int GOLD_BAR = 2807;
private static final int ALEX_RECOMMEND = 2808;
-
// Rewards
private static final int MARK_OF_SEARCHER = 2809;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // NPCs
- private static final int ALEX = 30291;
- private static final int TYRA = 30420;
- private static final int TREE = 30627;
- private static final int STRONG_WOODEN_CHEST = 30628;
- private static final int LUTHER = 30690;
- private static final int LEIRYNN = 30728;
- private static final int BORYS = 30729;
- private static final int JAX = 30730;
-
- // Monsters
- private static final int HANGMAN_TREE = 20144;
- private static final int ROAD_SCAVENGER = 20551;
- private static final int GIANT_FUNGUS = 20555;
- private static final int DELU_LIZARDMAN_SHAMAN = 20781;
- private static final int DELU_CHIEF_KALKIS = 27093;
- private static final int NEER_BODYGUARD = 27092;
-
+ // Misc
private static NpcInstance _strongWoodenChest; // Used to avoid to spawn multiple instances.
public Q225_TestOfTheSearcher()
{
super(225, "Test of the Searcher");
-
registerQuestItems(LUTHER_LETTER, ALEX_WARRANT, LEIRYNN_ORDER_1, DELU_TOTEM, LEIRYNN_ORDER_2, CHIEF_KALKI_FANG, LEIRYNN_REPORT, STRANGE_MAP, LAMBERT_MAP, ALEX_LETTER, ALEX_ORDER, WINE_CATALOG, TYRA_CONTRACT, RED_SPORE_DUST, MALRUKIAN_WINE, OLD_ORDER, JAX_DIARY, TORN_MAP_PIECE_1, TORN_MAP_PIECE_2, SOLT_MAP, MAKEL_MAP, COMBINED_MAP, RUSTED_KEY, GOLD_BAR, ALEX_RECOMMEND);
-
addStartNpc(LUTHER);
addTalkId(ALEX, TYRA, TREE, STRONG_WOODEN_CHEST, LUTHER, LEIRYNN, BORYS, JAX);
-
addAttackId(DELU_LIZARDMAN_SHAMAN);
addKillId(HANGMAN_TREE, ROAD_SCAVENGER, GIANT_FUNGUS, DELU_LIZARDMAN_SHAMAN, DELU_CHIEF_KALKIS, NEER_BODYGUARD);
}
@@ -100,90 +94,89 @@ public class Q225_TestOfTheSearcher extends Quest
return htmltext;
}
- // LUTHER
- if (event.equals("30690-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LUTHER_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30690-05.htm":
{
- htmltext = "30690-05a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
- }
- }
- // ALEX
- else if (event.equals("30291-07.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LEIRYNN_REPORT, 1);
- st.takeItems(STRANGE_MAP, 1);
- st.giveItems(ALEX_LETTER, 1);
- st.giveItems(ALEX_ORDER, 1);
- st.giveItems(LAMBERT_MAP, 1);
- }
- // TYRA
- else if (event.equals("30420-01a.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WINE_CATALOG, 1);
- st.giveItems(TYRA_CONTRACT, 1);
- }
- // JAX
- else if (event.equals("30730-01d.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(OLD_ORDER, 1);
- st.giveItems(JAX_DIARY, 1);
- }
- // TREE
- else if (event.equals("30627-01a.htm"))
- {
- if (_strongWoodenChest == null)
- {
- if (st.getInt("cond") == 16)
+ st.startQuest();
+ st.giveItems(LUTHER_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
{
- st.set("cond", "17");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(RUSTED_KEY, 1);
+ htmltext = "30690-05a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
}
-
- _strongWoodenChest = addSpawn(STRONG_WOODEN_CHEST, 10098, 157287, -2406, 0, false, 0);
- startQuestTimer("chest_despawn", 300000, null, player, false);
+ break;
}
- }
- // STRONG WOODEN CHEST
- else if (event.equals("30628-01a.htm"))
- {
- if (!st.hasQuestItems(RUSTED_KEY))
+ case "30291-07.htm":
{
- htmltext = "30628-02.htm";
- }
- else
- {
- st.set("cond", "18");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RUSTED_KEY, -1);
- st.giveItems(GOLD_BAR, 20);
-
+ st.takeItems(LEIRYNN_REPORT, 1);
+ st.takeItems(STRANGE_MAP, 1);
+ st.giveItems(ALEX_LETTER, 1);
+ st.giveItems(ALEX_ORDER, 1);
+ st.giveItems(LAMBERT_MAP, 1);
+ break;
+ }
+ case "30420-01a.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WINE_CATALOG, 1);
+ st.giveItems(TYRA_CONTRACT, 1);
+ break;
+ }
+ case "30730-01d.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(OLD_ORDER, 1);
+ st.giveItems(JAX_DIARY, 1);
+ break;
+ }
+ case "30627-01a.htm":
+ {
+ if (_strongWoodenChest == null)
+ {
+ if (st.isCond(16))
+ {
+ st.setCond(17);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(RUSTED_KEY, 1);
+ }
+
+ _strongWoodenChest = addSpawn(STRONG_WOODEN_CHEST, 10098, 157287, -2406, 0, false, 0);
+ startQuestTimer("chest_despawn", 300000, null, player, false);
+ }
+ break;
+ }
+ case "30628-01a.htm":
+ {
+ if (!st.hasQuestItems(RUSTED_KEY))
+ {
+ htmltext = "30628-02.htm";
+ }
+ else
+ {
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RUSTED_KEY, -1);
+ st.giveItems(GOLD_BAR, 20);
+
+ _strongWoodenChest.deleteMe();
+ _strongWoodenChest = null;
+ cancelQuestTimer("chest_despawn", null, player);
+ }
+ break;
+ }
+ case "chest_despawn":
+ {
_strongWoodenChest.deleteMe();
_strongWoodenChest = null;
- cancelQuestTimer("chest_despawn", null, player);
+ return null;
}
}
- // STRONG WOODEN CHEST DESPAWN
- else if (event.equals("chest_despawn"))
- {
- _strongWoodenChest.deleteMe();
- _strongWoodenChest = null;
- return null;
- }
return htmltext;
}
@@ -201,6 +194,7 @@ public class Q225_TestOfTheSearcher extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.ROGUE) && (player.getClassId() != ClassId.ELVEN_SCOUT) && (player.getClassId() != ClassId.ASSASSIN) && (player.getClassId() != ClassId.SCAVENGER))
{
htmltext = "30690-01.htm";
@@ -214,12 +208,14 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = (player.getClassId() == ClassId.SCAVENGER) ? "30690-04.htm" : "30690-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LUTHER:
+ {
if (cond == 1)
{
htmltext = "30690-06.htm";
@@ -239,12 +235,13 @@ public class Q225_TestOfTheSearcher extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ALEX:
+ {
if (cond == 1)
{
htmltext = "30291-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LUTHER_LETTER, 1);
st.giveItems(ALEX_WARRANT, 1);
@@ -276,7 +273,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 18)
{
htmltext = "30291-11.htm";
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALEX_ORDER, 1);
st.takeItems(COMBINED_MAP, 1);
@@ -288,12 +285,13 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = "30291-12.htm";
}
break;
-
+ }
case LEIRYNN:
+ {
if (cond == 2)
{
htmltext = "30728-01.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALEX_WARRANT, 1);
st.giveItems(LEIRYNN_ORDER_1, 1);
@@ -305,7 +303,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 4)
{
htmltext = "30728-03.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DELU_TOTEM, -1);
st.takeItems(LEIRYNN_ORDER_1, 1);
@@ -318,7 +316,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 6)
{
htmltext = "30728-05.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CHIEF_KALKI_FANG, 1);
st.takeItems(LEIRYNN_ORDER_2, 1);
@@ -333,12 +331,13 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = "30728-07.htm";
}
break;
-
+ }
case BORYS:
+ {
if (cond == 8)
{
htmltext = "30729-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ALEX_LETTER, 1);
st.giveItems(WINE_CATALOG, 1);
@@ -350,7 +349,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 12)
{
htmltext = "30729-03.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MALRUKIAN_WINE, 1);
st.takeItems(WINE_CATALOG, 1);
@@ -365,8 +364,9 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = "30729-05.htm";
}
break;
-
+ }
case TYRA:
+ {
if (cond == 9)
{
htmltext = "30420-01.htm";
@@ -378,7 +378,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 11)
{
htmltext = "30420-03.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RED_SPORE_DUST, -1);
st.takeItems(TYRA_CONTRACT, 1);
@@ -389,8 +389,9 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = "30420-04.htm";
}
break;
-
+ }
case JAX:
+ {
if (cond == 13)
{
htmltext = "30730-01.htm";
@@ -402,7 +403,7 @@ public class Q225_TestOfTheSearcher extends Quest
else if (cond == 15)
{
htmltext = "30730-03.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LAMBERT_MAP, 1);
st.takeItems(MAKEL_MAP, 1);
@@ -415,26 +416,31 @@ public class Q225_TestOfTheSearcher extends Quest
htmltext = "30730-04.htm";
}
break;
-
+ }
case TREE:
+ {
if ((cond == 16) || (cond == 17))
{
htmltext = "30627-01.htm";
}
break;
-
+ }
case STRONG_WOODEN_CHEST:
+ {
if (cond == 17)
{
htmltext = "30628-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -462,11 +468,11 @@ public class Q225_TestOfTheSearcher extends Quest
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
QuestState st;
-
switch (npc.getNpcId())
{
case DELU_LIZARDMAN_SHAMAN:
- st = checkPlayerCondition(player, npc, "cond", "3");
+ {
+ st = checkPlayerCondition(player, npc, 3);
if (st == null)
{
return null;
@@ -474,25 +480,27 @@ public class Q225_TestOfTheSearcher extends Quest
if (st.dropItemsAlways(DELU_TOTEM, 1, 10))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case DELU_CHIEF_KALKIS:
- st = checkPlayerCondition(player, npc, "cond", "5");
+ {
+ st = checkPlayerCondition(player, npc, 5);
if (st == null)
{
return null;
}
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(CHIEF_KALKI_FANG, 1);
st.giveItems(STRANGE_MAP, 1);
break;
-
+ }
case GIANT_FUNGUS:
- st = checkPlayerCondition(player, npc, "cond", "10");
+ {
+ st = checkPlayerCondition(player, npc, 10);
if (st == null)
{
return null;
@@ -500,12 +508,13 @@ public class Q225_TestOfTheSearcher extends Quest
if (st.dropItemsAlways(RED_SPORE_DUST, 1, 10))
{
- st.set("cond", "11");
+ st.setCond(11);
}
break;
-
+ }
case ROAD_SCAVENGER:
- st = checkPlayerCondition(player, npc, "cond", "14");
+ {
+ st = checkPlayerCondition(player, npc, 14);
if (st == null)
{
return null;
@@ -518,13 +527,14 @@ public class Q225_TestOfTheSearcher extends Quest
if (st.hasQuestItems(MAKEL_MAP))
{
- st.set("cond", "15");
+ st.setCond(15);
}
}
break;
-
+ }
case HANGMAN_TREE:
- st = checkPlayerCondition(player, npc, "cond", "14");
+ {
+ st = checkPlayerCondition(player, npc, 14);
if (st == null)
{
return null;
@@ -537,10 +547,11 @@ public class Q225_TestOfTheSearcher extends Quest
if (st.hasQuestItems(SOLT_MAP))
{
- st.set("cond", "15");
+ st.setCond(15);
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q226_TestOfTheHealer/Q226_TestOfTheHealer.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q226_TestOfTheHealer/Q226_TestOfTheHealer.java
index b34624f2f8..43ea779f86 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q226_TestOfTheHealer/Q226_TestOfTheHealer.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q226_TestOfTheHealer/Q226_TestOfTheHealer.java
@@ -27,22 +27,6 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q226_TestOfTheHealer extends Quest
{
- // Items
- private static final int REPORT_OF_PERRIN = 2810;
- private static final int KRISTINA_LETTER = 2811;
- private static final int PICTURE_OF_WINDY = 2812;
- private static final int GOLDEN_STATUE = 2813;
- private static final int WINDY_PEBBLES = 2814;
- private static final int ORDER_OF_SORIUS = 2815;
- private static final int SECRET_LETTER_1 = 2816;
- private static final int SECRET_LETTER_2 = 2817;
- private static final int SECRET_LETTER_3 = 2818;
- private static final int SECRET_LETTER_4 = 2819;
-
- // Rewards
- private static final int MARK_OF_HEALER = 2820;
- private static final int DIMENSIONAL_DIAMOND = 7562;
-
// NPCs
private static final int BANDELLOS = 30473;
private static final int SORIUS = 30327;
@@ -57,7 +41,6 @@ public class Q226_TestOfTheHealer extends Quest
private static final int KAIN_FLYING_KNIFE = 30664;
private static final int KRISTINA = 30665;
private static final int DAURIN_HAMMERCRUSH = 30674;
-
// Monsters
private static final int LETO_LIZARDMAN_LEADER = 27123;
private static final int LETO_LIZARDMAN_ASSASSIN = 27124;
@@ -65,19 +48,30 @@ public class Q226_TestOfTheHealer extends Quest
private static final int LETO_LIZARDMAN_WIZARD = 27126;
private static final int LETO_LIZARDMAN_LORD = 27127;
private static final int TATOMA = 27134;
-
+ // Items
+ private static final int REPORT_OF_PERRIN = 2810;
+ private static final int KRISTINA_LETTER = 2811;
+ private static final int PICTURE_OF_WINDY = 2812;
+ private static final int GOLDEN_STATUE = 2813;
+ private static final int WINDY_PEBBLES = 2814;
+ private static final int ORDER_OF_SORIUS = 2815;
+ private static final int SECRET_LETTER_1 = 2816;
+ private static final int SECRET_LETTER_2 = 2817;
+ private static final int SECRET_LETTER_3 = 2818;
+ private static final int SECRET_LETTER_4 = 2819;
+ // Rewards
+ private static final int MARK_OF_HEALER = 2820;
+ private static final int DIMENSIONAL_DIAMOND = 7562;
+ // Misc
private NpcInstance _tatoma;
private NpcInstance _letoLeader;
public Q226_TestOfTheHealer()
{
super(226, "Test of the Healer");
-
registerQuestItems(REPORT_OF_PERRIN, KRISTINA_LETTER, PICTURE_OF_WINDY, GOLDEN_STATUE, WINDY_PEBBLES, ORDER_OF_SORIUS, SECRET_LETTER_1, SECRET_LETTER_2, SECRET_LETTER_3, SECRET_LETTER_4);
-
addStartNpc(BANDELLOS);
addTalkId(BANDELLOS, SORIUS, ALLANA, PERRIN, GUPU, ORPHAN_GIRL, WINDY_SHAORING, MYSTERIOUS_DARKELF, PIPER_LONGBOW, SLEIN_SHINING_BLADE, KAIN_FLYING_KNIFE, KRISTINA, DAURIN_HAMMERCRUSH);
-
addKillId(LETO_LIZARDMAN_LEADER, LETO_LIZARDMAN_ASSASSIN, LETO_LIZARDMAN_SNIPER, LETO_LIZARDMAN_WIZARD, LETO_LIZARDMAN_LORD, TATOMA);
}
@@ -91,110 +85,110 @@ public class Q226_TestOfTheHealer extends Quest
return htmltext;
}
- // BANDELLOS
- if (event.equals("30473-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(REPORT_OF_PERRIN, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30473-04.htm":
{
- htmltext = "30473-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(REPORT_OF_PERRIN, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30473-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- else if (event.equals("30473-09.htm"))
- {
- st.takeItems(GOLDEN_STATUE, 1);
- st.giveItems(MARK_OF_HEALER, 1);
- st.rewardExpAndSp(134839, 50000);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- // PERRIN
- else if (event.equals("30428-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
-
- if (_tatoma == null)
+ case "30473-09.htm":
{
- _tatoma = addSpawn(TATOMA, -93254, 147559, -2679, 0, false, 0);
- startQuestTimer("tatoma_despawn", 200000, null, player, false);
+ st.takeItems(GOLDEN_STATUE, 1);
+ st.giveItems(MARK_OF_HEALER, 1);
+ st.rewardExpAndSp(134839, 50000);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
}
- }
- // GUPU
- else if (event.equals("30658-02.htm"))
- {
- if (st.getQuestItemsCount(57) >= 100000)
+ case "30428-02.htm":
{
- st.set("cond", "7");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(57, 100000);
- st.giveItems(PICTURE_OF_WINDY, 1);
+ if (_tatoma == null)
+ {
+ _tatoma = addSpawn(TATOMA, -93254, 147559, -2679, 0, false, 0);
+ startQuestTimer("tatoma_despawn", 200000, null, player, false);
+ }
+ break;
}
- else
+ case "30658-02.htm":
{
- htmltext = "30658-05.htm";
+ if (st.getQuestItemsCount(57) >= 100000)
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(57, 100000);
+ st.giveItems(PICTURE_OF_WINDY, 1);
+ }
+ else
+ {
+ htmltext = "30658-05.htm";
+ }
+ break;
}
- }
- else if (event.equals("30658-03.htm"))
- {
- st.set("gupu", "1");
- }
- else if (event.equals("30658-07.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // WINDY SHAORING
- else if (event.equals("30660-03.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PICTURE_OF_WINDY, 1);
- st.giveItems(WINDY_PEBBLES, 1);
- }
- // DAURIN HAMMERCRUSH
- else if (event.equals("30674-02.htm"))
- {
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_BEFORE_BATTLE);
- st.takeItems(ORDER_OF_SORIUS, 1);
-
- if (_letoLeader == null)
+ case "30658-03.htm":
{
- _letoLeader = addSpawn(LETO_LIZARDMAN_LEADER, -97441, 106585, -3405, 0, false, 0);
- startQuestTimer("leto_leader_despawn", 200000, null, player, false);
+ st.set("gupu", "1");
+ break;
+ }
+ case "30658-07.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30660-03.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PICTURE_OF_WINDY, 1);
+ st.giveItems(WINDY_PEBBLES, 1);
+ break;
+ }
+ case "30674-02.htm":
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_BEFORE_BATTLE);
+ st.takeItems(ORDER_OF_SORIUS, 1);
+ if (_letoLeader == null)
+ {
+ _letoLeader = addSpawn(LETO_LIZARDMAN_LEADER, -97441, 106585, -3405, 0, false, 0);
+ startQuestTimer("leto_leader_despawn", 200000, null, player, false);
+ }
+ break;
+ }
+ case "30665-02.htm":
+ {
+ st.setCond(22);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SECRET_LETTER_1, 1);
+ st.takeItems(SECRET_LETTER_2, 1);
+ st.takeItems(SECRET_LETTER_3, 1);
+ st.takeItems(SECRET_LETTER_4, 1);
+ st.giveItems(KRISTINA_LETTER, 1);
+ break;
+ }
+ case "tatoma_despawn":
+ {
+ _tatoma.deleteMe();
+ _tatoma = null;
+ return null;
+ }
+ case "leto_leader_despawn":
+ {
+ _letoLeader.deleteMe();
+ _letoLeader = null;
+ return null;
}
- }
- // KRISTINA
- else if (event.equals("30665-02.htm"))
- {
- st.set("cond", "22");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SECRET_LETTER_1, 1);
- st.takeItems(SECRET_LETTER_2, 1);
- st.takeItems(SECRET_LETTER_3, 1);
- st.takeItems(SECRET_LETTER_4, 1);
- st.giveItems(KRISTINA_LETTER, 1);
- }
- // DESPAWNS
- else if (event.equals("tatoma_despawn"))
- {
- _tatoma.deleteMe();
- _tatoma = null;
- return null;
- }
- else if (event.equals("leto_leader_despawn"))
- {
- _letoLeader.deleteMe();
- _letoLeader = null;
- return null;
}
return htmltext;
@@ -213,6 +207,7 @@ public class Q226_TestOfTheHealer extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.KNIGHT) && (player.getClassId() != ClassId.ELVEN_KNIGHT) && (player.getClassId() != ClassId.CLERIC) && (player.getClassId() != ClassId.ORACLE))
{
htmltext = "30473-01.htm";
@@ -226,12 +221,14 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30473-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BANDELLOS:
+ {
if (cond < 23)
{
htmltext = "30473-05.htm";
@@ -253,8 +250,9 @@ public class Q226_TestOfTheHealer extends Quest
}
}
break;
-
+ }
case PERRIN:
+ {
if (cond < 3)
{
htmltext = "30428-01.htm";
@@ -262,7 +260,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 3)
{
htmltext = "30428-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REPORT_OF_PERRIN, 1);
}
@@ -271,16 +269,18 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30428-04.htm";
}
break;
-
+ }
case ORPHAN_GIRL:
+ {
htmltext = "30659-0" + Rnd.get(1, 5) + ".htm";
break;
-
+ }
case ALLANA:
+ {
if (cond == 4)
{
htmltext = "30424-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond > 4)
@@ -288,18 +288,19 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30424-02.htm";
}
break;
-
+ }
case GUPU:
+ {
if ((st.getInt("gupu") == 1) && (cond != 9))
{
htmltext = "30658-07.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
{
htmltext = "30658-01.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 6)
@@ -322,8 +323,9 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30658-07.htm";
}
break;
-
+ }
case WINDY_SHAORING:
+ {
if (cond == 7)
{
htmltext = "30660-01.htm";
@@ -333,12 +335,13 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30660-04.htm";
}
break;
-
+ }
case SORIUS:
+ {
if (cond == 9)
{
htmltext = "30327-01.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(ORDER_OF_SORIUS, 1);
}
@@ -349,7 +352,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 22)
{
htmltext = "30327-03.htm";
- st.set("cond", "23");
+ st.setCond(23);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KRISTINA_LETTER, 1);
}
@@ -358,8 +361,9 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30327-04.htm";
}
break;
-
+ }
case DAURIN_HAMMERCRUSH:
+ {
if (cond == 10)
{
htmltext = "30674-01.htm";
@@ -376,7 +380,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 12)
{
htmltext = "30674-03.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond > 12)
@@ -384,10 +388,11 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30674-04.htm";
}
break;
-
+ }
case PIPER_LONGBOW:
case SLEIN_SHINING_BLADE:
case KAIN_FLYING_KNIFE:
+ {
if ((cond == 13) || (cond == 14))
{
htmltext = npc.getNpcId() + "-01.htm";
@@ -399,16 +404,17 @@ public class Q226_TestOfTheHealer extends Quest
else if ((cond > 18) && (cond < 22))
{
htmltext = npc.getNpcId() + "-03.htm";
- st.set("cond", "21");
+ st.setCond(21);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
-
+ }
case MYSTERIOUS_DARKELF:
+ {
if (cond == 13)
{
htmltext = "30661-01.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
addSpawn(LETO_LIZARDMAN_ASSASSIN, player, true, 0);
addSpawn(LETO_LIZARDMAN_ASSASSIN, player, true, 0);
@@ -421,7 +427,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 15)
{
htmltext = "30661-02.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
addSpawn(LETO_LIZARDMAN_SNIPER, player, true, 0);
addSpawn(LETO_LIZARDMAN_SNIPER, player, true, 0);
@@ -434,7 +440,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 17)
{
htmltext = "30661-03.htm";
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_BEFORE_BATTLE);
addSpawn(LETO_LIZARDMAN_WIZARD, player, true, 0);
addSpawn(LETO_LIZARDMAN_WIZARD, player, true, 0);
@@ -447,7 +453,7 @@ public class Q226_TestOfTheHealer extends Quest
else if (cond == 19)
{
htmltext = "30661-04.htm";
- st.set("cond", "20");
+ st.setCond(20);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if ((cond == 20) || (cond == 21))
@@ -455,8 +461,9 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30661-04.htm";
}
break;
-
+ }
case KRISTINA:
+ {
if ((cond > 18) && (cond < 22))
{
htmltext = "30665-01.htm";
@@ -470,12 +477,15 @@ public class Q226_TestOfTheHealer extends Quest
htmltext = "30665-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -490,56 +500,62 @@ public class Q226_TestOfTheHealer extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case TATOMA:
+ {
if ((cond == 1) || (cond == 2))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
_tatoma = null;
cancelQuestTimer("tatoma_despawn", null, player);
break;
-
+ }
case LETO_LIZARDMAN_LEADER:
+ {
if ((cond == 10) || (cond == 11))
{
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SECRET_LETTER_1, 1);
}
_letoLeader = null;
cancelQuestTimer("leto_leader_despawn", null, player);
break;
-
+ }
case LETO_LIZARDMAN_ASSASSIN:
+ {
if ((cond == 13) || (cond == 14))
{
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SECRET_LETTER_2, 1);
}
break;
-
+ }
case LETO_LIZARDMAN_SNIPER:
+ {
if ((cond == 15) || (cond == 16))
{
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SECRET_LETTER_3, 1);
}
break;
-
+ }
case LETO_LIZARDMAN_LORD:
+ {
if ((cond == 17) || (cond == 18))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SECRET_LETTER_4, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q227_TestOfTheReformer/Q227_TestOfTheReformer.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q227_TestOfTheReformer/Q227_TestOfTheReformer.java
index 1af359dc11..35a9ee11b4 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q227_TestOfTheReformer/Q227_TestOfTheReformer.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q227_TestOfTheReformer/Q227_TestOfTheReformer.java
@@ -29,6 +29,26 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q227_TestOfTheReformer extends Quest
{
+ // NPCs
+ private static final int PUPINA = 30118;
+ private static final int SLA = 30666;
+ private static final int RAMUS = 30667;
+ private static final int KATARI = 30668;
+ private static final int KAKAN = 30669;
+ private static final int NYAKURI = 30670;
+ private static final int OL_MAHUM_PILGRIM = 30732;
+ // Monsters
+ private static final int MISERY_SKELETON = 20022;
+ private static final int SKELETON_ARCHER = 20100;
+ private static final int SKELETON_MARKSMAN = 20102;
+ private static final int SKELETON_LORD = 20104;
+ private static final int SILENT_HORROR = 20404;
+ private static final int NAMELESS_REVENANT = 27099;
+ private static final int ARURAUNE = 27128;
+ private static final int OL_MAHUM_INSPECTOR = 27129;
+ private static final int OL_MAHUM_BETRAYER = 27130;
+ private static final int CRIMSON_WEREWOLF = 27131;
+ private static final int KRUDEL_LIZARDMAN = 27132;
// Items
private static final int BOOK_OF_REFORM = 2822;
private static final int LETTER_OF_INTRODUCTION = 2823;
@@ -49,57 +69,27 @@ public class Q227_TestOfTheReformer extends Quest
private static final int BONE_FRAGMENT_8 = 2838;
private static final int BONE_FRAGMENT_9 = 2839;
private static final int KAKAN_LETTER = 3037;
-
// Rewards
private static final int MARK_OF_REFORMER = 2821;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // NPCs
- private static final int PUPINA = 30118;
- private static final int SLA = 30666;
- private static final int RAMUS = 30667;
- private static final int KATARI = 30668;
- private static final int KAKAN = 30669;
- private static final int NYAKURI = 30670;
- private static final int OL_MAHUM_PILGRIM = 30732;
-
- // Monsters
- private static final int MISERY_SKELETON = 20022;
- private static final int SKELETON_ARCHER = 20100;
- private static final int SKELETON_MARKSMAN = 20102;
- private static final int SKELETON_LORD = 20104;
- private static final int SILENT_HORROR = 20404;
- private static final int NAMELESS_REVENANT = 27099;
- private static final int ARURAUNE = 27128;
- private static final int OL_MAHUM_INSPECTOR = 27129;
- private static final int OL_MAHUM_BETRAYER = 27130;
- private static final int CRIMSON_WEREWOLF = 27131;
- private static final int KRUDEL_LIZARDMAN = 27132;
-
// Checks & Instances
private static long _timer;
-
+ // Misc
private static NpcInstance _olMahumInspector;
private static NpcInstance _olMahumPilgrim;
private static NpcInstance _olMahumBetrayer;
-
private static boolean _crimsonWerewolf = false;
private static boolean _krudelLizardman = false;
// Allowed skills when attacking Crimson Werewolf
- /*
- * private static final int[] ALLOWED_SKILLS = { 1031, 1069, 1164, 1168, 1147, 1177, 1184, 1201, 1206 };
- */
+ // private static final int[] ALLOWED_SKILLS = { 1031, 1069, 1164, 1168, 1147, 1177, 1184, 1201, 1206 };
public Q227_TestOfTheReformer()
{
super(227, "Test of the Reformer");
-
registerQuestItems(BOOK_OF_REFORM, LETTER_OF_INTRODUCTION, SLA_LETTER, GREETINGS, OL_MAHUM_MONEY, KATARI_LETTER, NYAKURI_LETTER, UNDEAD_LIST, RAMUS_LETTER, RIPPED_DIARY, HUGE_NAIL, LETTER_OF_BETRAYER, BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_7, BONE_FRAGMENT_8, BONE_FRAGMENT_9, KAKAN_LETTER);
-
addStartNpc(PUPINA);
addTalkId(PUPINA, SLA, RAMUS, KATARI, KAKAN, NYAKURI, OL_MAHUM_PILGRIM);
-
addAttackId(NAMELESS_REVENANT, CRIMSON_WEREWOLF);
addKillId(MISERY_SKELETON, SKELETON_ARCHER, SKELETON_MARKSMAN, SKELETON_LORD, SILENT_HORROR, NAMELESS_REVENANT, ARURAUNE, OL_MAHUM_INSPECTOR, OL_MAHUM_BETRAYER, CRIMSON_WEREWOLF, KRUDEL_LIZARDMAN);
}
@@ -114,123 +104,117 @@ public class Q227_TestOfTheReformer extends Quest
return htmltext;
}
- // PUPINA
- if (event.equals("30118-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(BOOK_OF_REFORM, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30118-04.htm":
{
- htmltext = "30118-04b.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(BOOK_OF_REFORM, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30118-04b.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- else if (event.equals("30118-06.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BOOK_OF_REFORM, 1);
- st.takeItems(HUGE_NAIL, 1);
- st.giveItems(LETTER_OF_INTRODUCTION, 1);
- }
- // SLA
- else if (event.equals("30666-04.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LETTER_OF_INTRODUCTION, 1);
- st.giveItems(SLA_LETTER, 1);
- }
- // KAKAN
- else if (event.equals("30669-03.htm"))
- {
- if (st.getInt("cond") != 12)
+ case "30118-06.htm":
{
- st.set("cond", "12");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BOOK_OF_REFORM, 1);
+ st.takeItems(HUGE_NAIL, 1);
+ st.giveItems(LETTER_OF_INTRODUCTION, 1);
+ break;
}
-
- if (!_crimsonWerewolf)
+ case "30666-04.htm":
{
- addSpawn(CRIMSON_WEREWOLF, -9382, -89852, -2333, 0, false, 299000);
- _crimsonWerewolf = true;
-
- // Resets Crimson Werewolf
- startQuestTimer("werewolf_cleanup", 300000, null, player, false);
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LETTER_OF_INTRODUCTION, 1);
+ st.giveItems(SLA_LETTER, 1);
+ break;
}
- }
- // NYAKURI
- else if (event.equals("30670-03.htm"))
- {
- st.set("cond", "15");
- st.playSound(QuestState.SOUND_MIDDLE);
- if (!_krudelLizardman)
+ case "30669-03.htm":
{
- addSpawn(KRUDEL_LIZARDMAN, 126019, -179983, -1781, 0, false, 299000);
- _krudelLizardman = true;
-
- // Resets Krudel Lizardman
- startQuestTimer("lizardman_cleanup", 300000, null, player, false);
- }
- }
- // Despawns Crimson Werewolf
- else if (event.equals("werewolf_despawn"))
- {
- npc.abortAttack();
- npc.broadcastNpcSay("Cowardly guy!");
- npc.decayMe();
- _crimsonWerewolf = false;
- cancelQuestTimer("werewolf_cleanup", null, player);
- return null;
- }
- // Despawns
- else if (event.equals("ol_mahums_despawn"))
- {
- _timer++;
-
- if ((st.getInt("cond") == 8) || (_timer >= 60))
- {
- if (_olMahumPilgrim != null)
+ if (!st.isCond(12))
{
- _olMahumPilgrim.deleteMe();
- _olMahumPilgrim = null;
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
}
-
- if (_olMahumInspector != null)
+ if (!_crimsonWerewolf)
{
- _olMahumInspector.deleteMe();
- _olMahumInspector = null;
+ addSpawn(CRIMSON_WEREWOLF, -9382, -89852, -2333, 0, false, 299000);
+ _crimsonWerewolf = true;
+
+ // Resets Crimson Werewolf
+ startQuestTimer("werewolf_cleanup", 300000, null, player, false);
}
- cancelQuestTimer("ol_mahums_despawn", null, player);
- _timer = 0;
+ break;
}
-
- return null;
- }
- else if (event.equals("betrayer_despawn"))
- {
- if (_olMahumBetrayer != null)
+ case "30670-03.htm":
{
- _olMahumBetrayer.deleteMe();
- _olMahumBetrayer = null;
+ st.setCond(15);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ if (!_krudelLizardman)
+ {
+ addSpawn(KRUDEL_LIZARDMAN, 126019, -179983, -1781, 0, false, 299000);
+ _krudelLizardman = true;
+
+ // Resets Krudel Lizardman
+ startQuestTimer("lizardman_cleanup", 300000, null, player, false);
+ }
+ break;
+ }
+ case "werewolf_despawn":
+ {
+ npc.abortAttack();
+ npc.broadcastNpcSay("Cowardly guy!");
+ npc.decayMe();
+ _crimsonWerewolf = false;
+ cancelQuestTimer("werewolf_cleanup", null, player);
+ return null;
+ }
+ case "ol_mahums_despawn":
+ {
+ _timer++;
+ if (st.isCond(8) || (_timer >= 60))
+ {
+ if (_olMahumPilgrim != null)
+ {
+ _olMahumPilgrim.deleteMe();
+ _olMahumPilgrim = null;
+ }
+
+ if (_olMahumInspector != null)
+ {
+ _olMahumInspector.deleteMe();
+ _olMahumInspector = null;
+ }
+ cancelQuestTimer("ol_mahums_despawn", null, player);
+ _timer = 0;
+ }
+ return null;
+ }
+ case "betrayer_despawn":
+ {
+ if (_olMahumBetrayer != null)
+ {
+ _olMahumBetrayer.deleteMe();
+ _olMahumBetrayer = null;
+ }
+ return null;
+ }
+ case "werewolf_cleanup":
+ {
+ _crimsonWerewolf = false;
+ return null;
+ }
+ case "lizardman_cleanup":
+ {
+ _krudelLizardman = false;
+ return null;
}
-
- return null;
- }
- // Clean ups
- else if (event.equals("werewolf_cleanup"))
- {
- _crimsonWerewolf = false;
- return null;
- }
- else if (event.equals("lizardman_cleanup"))
- {
- _krudelLizardman = false;
- return null;
}
return htmltext;
@@ -249,6 +233,7 @@ public class Q227_TestOfTheReformer extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() == ClassId.CLERIC) || (player.getClassId() == ClassId.SHILLIEN_ORACLE))
{
htmltext = (player.getLevel() < 39) ? "30118-01.htm" : "30118-03.htm";
@@ -258,12 +243,14 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30118-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case PUPINA:
+ {
if (cond < 3)
{
htmltext = "30118-04a.htm";
@@ -277,8 +264,9 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30118-07.htm";
}
break;
-
+ }
case SLA:
+ {
if (cond == 4)
{
htmltext = "30666-01.htm";
@@ -290,7 +278,7 @@ public class Q227_TestOfTheReformer extends Quest
else if (cond == 10)
{
htmltext = "30666-06.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(OL_MAHUM_MONEY, 1);
st.giveItems(GREETINGS, 3);
@@ -313,15 +301,16 @@ public class Q227_TestOfTheReformer extends Quest
st.exitQuest(false);
}
break;
-
+ }
case KATARI:
+ {
if ((cond == 5) || (cond == 6))
{
htmltext = "30668-01.htm";
if (cond == 5)
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SLA_LETTER, 1);
}
@@ -371,7 +360,7 @@ public class Q227_TestOfTheReformer extends Quest
else if (cond == 9)
{
htmltext = "30668-03.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LETTER_OF_BETRAYER, 1);
st.giveItems(KATARI_LETTER, 1);
@@ -381,18 +370,20 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30668-04.htm";
}
break;
-
+ }
case OL_MAHUM_PILGRIM:
+ {
if (cond == 7)
{
htmltext = "30732-01.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(OL_MAHUM_MONEY, 1);
}
break;
-
+ }
case KAKAN:
+ {
if ((cond == 11) || (cond == 12))
{
htmltext = "30669-01.htm";
@@ -400,7 +391,7 @@ public class Q227_TestOfTheReformer extends Quest
else if (cond == 13)
{
htmltext = "30669-04.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GREETINGS, 1);
st.giveItems(KAKAN_LETTER, 1);
@@ -410,8 +401,9 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30669-04.htm";
}
break;
-
+ }
case NYAKURI:
+ {
if ((cond == 14) || (cond == 15))
{
htmltext = "30670-01.htm";
@@ -419,7 +411,7 @@ public class Q227_TestOfTheReformer extends Quest
else if (cond == 16)
{
htmltext = "30670-04.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GREETINGS, 1);
st.giveItems(NYAKURI_LETTER, 1);
@@ -429,12 +421,13 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30670-04.htm";
}
break;
-
+ }
case RAMUS:
+ {
if (cond == 17)
{
htmltext = "30667-01.htm";
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GREETINGS, 1);
st.giveItems(UNDEAD_LIST, 1);
@@ -446,7 +439,7 @@ public class Q227_TestOfTheReformer extends Quest
else if (cond == 19)
{
htmltext = "30667-03.htm";
- st.set("cond", "20");
+ st.setCond(20);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BONE_FRAGMENT_4, 1);
st.takeItems(BONE_FRAGMENT_5, 1);
@@ -461,12 +454,15 @@ public class Q227_TestOfTheReformer extends Quest
htmltext = "30667-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -481,18 +477,20 @@ public class Q227_TestOfTheReformer extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NAMELESS_REVENANT:
+ {
// TODO: if (((cond == 1) || (cond == 2)) && (skill != null) && (skill.getId() == 1031))
if ((cond == 1) || (cond == 2))
{
npc.setScriptValue(1);
}
break;
-
+ }
case CRIMSON_WEREWOLF:
+ {
// TODO: if ((cond == 12) && !npc.isScriptValue(1) && ((skill == null) || !ArraysUtil.contains(ALLOWED_SKILLS, skill.getId())))
if ((cond == 12) && !npc.isScriptValue(1))
{
@@ -500,6 +498,7 @@ public class Q227_TestOfTheReformer extends Quest
startQuestTimer("werewolf_despawn", 1000, npc, attacker, false);
}
break;
+ }
}
return null;
@@ -514,74 +513,81 @@ public class Q227_TestOfTheReformer extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NAMELESS_REVENANT:
+ {
if (((cond == 1) || (cond == 2)) && npc.isScriptValue(1) && st.dropItemsAlways(RIPPED_DIARY, 1, 7))
{
- st.set("cond", "2");
+ st.setCond(2);
st.takeItems(RIPPED_DIARY, -1);
addSpawn(ARURAUNE, npc, false, 300000);
}
break;
-
+ }
case ARURAUNE:
+ {
if (cond == 2)
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HUGE_NAIL, 1);
npc.broadcastNpcSay("The concealed truth will always be revealed...!");
}
break;
-
+ }
case OL_MAHUM_INSPECTOR:
+ {
if (cond == 6)
{
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
-
+ }
case OL_MAHUM_BETRAYER:
+ {
if (cond == 8)
{
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LETTER_OF_BETRAYER, 1);
cancelQuestTimer("betrayer_despawn", null, player);
_olMahumBetrayer = null;
}
break;
-
+ }
case CRIMSON_WEREWOLF:
+ {
if (cond == 12)
{
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
cancelQuestTimer("werewolf_cleanup", null, player);
_crimsonWerewolf = false;
}
break;
-
+ }
case KRUDEL_LIZARDMAN:
+ {
if (cond == 15)
{
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
cancelQuestTimer("lizardman_cleanup", null, player);
_krudelLizardman = false;
}
break;
-
+ }
case SILENT_HORROR:
+ {
if ((cond == 18) && !st.hasQuestItems(BONE_FRAGMENT_4))
{
st.giveItems(BONE_FRAGMENT_4, 1);
if (st.hasQuestItems(BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_7, BONE_FRAGMENT_8))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -590,14 +596,15 @@ public class Q227_TestOfTheReformer extends Quest
}
}
break;
-
+ }
case SKELETON_LORD:
+ {
if ((cond == 18) && !st.hasQuestItems(BONE_FRAGMENT_5))
{
st.giveItems(BONE_FRAGMENT_5, 1);
if (st.hasQuestItems(BONE_FRAGMENT_4, BONE_FRAGMENT_6, BONE_FRAGMENT_7, BONE_FRAGMENT_8))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -606,14 +613,15 @@ public class Q227_TestOfTheReformer extends Quest
}
}
break;
-
+ }
case SKELETON_MARKSMAN:
+ {
if ((cond == 18) && !st.hasQuestItems(BONE_FRAGMENT_6))
{
st.giveItems(BONE_FRAGMENT_6, 1);
if (st.hasQuestItems(BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_7, BONE_FRAGMENT_8))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -622,14 +630,15 @@ public class Q227_TestOfTheReformer extends Quest
}
}
break;
-
+ }
case MISERY_SKELETON:
+ {
if ((cond == 18) && !st.hasQuestItems(BONE_FRAGMENT_7))
{
st.giveItems(BONE_FRAGMENT_7, 1);
if (st.hasQuestItems(BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_8))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -638,14 +647,15 @@ public class Q227_TestOfTheReformer extends Quest
}
}
break;
-
+ }
case SKELETON_ARCHER:
+ {
if ((cond == 18) && !st.hasQuestItems(BONE_FRAGMENT_8))
{
st.giveItems(BONE_FRAGMENT_8, 1);
if (st.hasQuestItems(BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_7))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -654,6 +664,7 @@ public class Q227_TestOfTheReformer extends Quest
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q228_TestOfMagus/Q228_TestOfMagus.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q228_TestOfMagus/Q228_TestOfMagus.java
index 58c47ac955..e25c3a8f17 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q228_TestOfMagus/Q228_TestOfMagus.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q228_TestOfMagus/Q228_TestOfMagus.java
@@ -26,6 +26,30 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q228_TestOfMagus extends Quest
{
+ // NPCs
+ private static final int PARINA = 30391;
+ private static final int EARTH_SNAKE = 30409;
+ private static final int FLAME_SALAMANDER = 30411;
+ private static final int WIND_SYLPH = 30412;
+ private static final int WATER_UNDINE = 30413;
+ private static final int CASIAN = 30612;
+ private static final int RUKAL = 30629;
+ // Monsters
+ private static final int HARPY = 20145;
+ private static final int MARSH_STAKATO = 20157;
+ private static final int WYRM = 20176;
+ private static final int MARSH_STAKATO_WORKER = 20230;
+ private static final int TOAD_LORD = 20231;
+ private static final int MARSH_STAKATO_SOLDIER = 20232;
+ private static final int MARSH_STAKATO_DRONE = 20234;
+ private static final int WINDSUS = 20553;
+ private static final int ENCHANTED_MONSTEREYE = 20564;
+ private static final int ENCHANTED_STONE_GOLEM = 20565;
+ private static final int ENCHANTED_IRON_GOLEM = 20566;
+ private static final int SINGING_FLOWER_PHANTASM = 27095;
+ private static final int SINGING_FLOWER_NIGHTMARE = 27096;
+ private static final int SINGING_FLOWER_DARKLING = 27097;
+ private static final int GHOST_FIRE = 27098;
// Items
private static final int RUKAL_LETTER = 2841;
private static final int PARINA_LETTER = 2842;
@@ -50,46 +74,16 @@ public class Q228_TestOfMagus extends Quest
private static final int SYLPH_CHARM = 2861;
private static final int UNDINE_CHARM = 2862;
private static final int SERPENT_CHARM = 2863;
-
// Rewards
private static final int MARK_OF_MAGUS = 2840;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int PARINA = 30391;
- private static final int EARTH_SNAKE = 30409;
- private static final int FLAME_SALAMANDER = 30411;
- private static final int WIND_SYLPH = 30412;
- private static final int WATER_UNDINE = 30413;
- private static final int CASIAN = 30612;
- private static final int RUKAL = 30629;
-
- // Monsters
- private static final int HARPY = 20145;
- private static final int MARSH_STAKATO = 20157;
- private static final int WYRM = 20176;
- private static final int MARSH_STAKATO_WORKER = 20230;
- private static final int TOAD_LORD = 20231;
- private static final int MARSH_STAKATO_SOLDIER = 20232;
- private static final int MARSH_STAKATO_DRONE = 20234;
- private static final int WINDSUS = 20553;
- private static final int ENCHANTED_MONSTEREYE = 20564;
- private static final int ENCHANTED_STONE_GOLEM = 20565;
- private static final int ENCHANTED_IRON_GOLEM = 20566;
- private static final int SINGING_FLOWER_PHANTASM = 27095;
- private static final int SINGING_FLOWER_NIGHTMARE = 27096;
- private static final int SINGING_FLOWER_DARKLING = 27097;
- private static final int GHOST_FIRE = 27098;
-
public Q228_TestOfMagus()
{
super(228, "Test of Magus");
-
registerQuestItems(RUKAL_LETTER, PARINA_LETTER, LILAC_CHARM, GOLDEN_SEED_1, GOLDEN_SEED_2, GOLDEN_SEED_3, SCORE_OF_ELEMENTS, DAZZLING_DROP, FLAME_CRYSTAL, HARPY_FEATHER, WYRM_WINGBONE, WINDSUS_MANE, EN_MONSTEREYE_SHELL, EN_STONEGOLEM_POWDER, EN_IRONGOLEM_SCRAP, TONE_OF_WATER, TONE_OF_FIRE, TONE_OF_WIND, TONE_OF_EARTH, SALAMANDER_CHARM, SYLPH_CHARM, UNDINE_CHARM, SERPENT_CHARM);
-
addStartNpc(RUKAL);
addTalkId(PARINA, EARTH_SNAKE, FLAME_SALAMANDER, WIND_SYLPH, WATER_UNDINE, CASIAN, RUKAL);
-
addKillId(HARPY, MARSH_STAKATO, WYRM, MARSH_STAKATO_WORKER, TOAD_LORD, MARSH_STAKATO_SOLDIER, MARSH_STAKATO_DRONE, WINDSUS, ENCHANTED_MONSTEREYE, ENCHANTED_STONE_GOLEM, ENCHANTED_IRON_GOLEM, SINGING_FLOWER_PHANTASM, SINGING_FLOWER_NIGHTMARE, SINGING_FLOWER_DARKLING, GHOST_FIRE);
}
@@ -103,58 +97,59 @@ public class Q228_TestOfMagus extends Quest
return htmltext;
}
- // RUKAL
- if (event.equals("30629-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(RUKAL_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30629-04.htm":
{
- htmltext = "30629-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(RUKAL_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30629-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
+ }
+ case "30629-10.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GOLDEN_SEED_1, 1);
+ st.takeItems(GOLDEN_SEED_2, 1);
+ st.takeItems(GOLDEN_SEED_3, 1);
+ st.takeItems(LILAC_CHARM, 1);
+ st.giveItems(SCORE_OF_ELEMENTS, 1);
+ break;
+ }
+ case "30391-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RUKAL_LETTER, 1);
+ st.giveItems(PARINA_LETTER, 1);
+ break;
+ }
+ case "30612-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PARINA_LETTER, 1);
+ st.giveItems(LILAC_CHARM, 1);
+ break;
+ }
+ case "30412-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(SYLPH_CHARM, 1);
+ break;
+ }
+ case "30409-03.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(SERPENT_CHARM, 1);
+ break;
}
- }
- else if (event.equals("30629-10.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GOLDEN_SEED_1, 1);
- st.takeItems(GOLDEN_SEED_2, 1);
- st.takeItems(GOLDEN_SEED_3, 1);
- st.takeItems(LILAC_CHARM, 1);
- st.giveItems(SCORE_OF_ELEMENTS, 1);
- }
- // PARINA
- else if (event.equals("30391-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RUKAL_LETTER, 1);
- st.giveItems(PARINA_LETTER, 1);
- }
- // CASIAN
- else if (event.equals("30612-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PARINA_LETTER, 1);
- st.giveItems(LILAC_CHARM, 1);
- }
- // WIND SYLPH
- else if (event.equals("30412-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(SYLPH_CHARM, 1);
- }
- // EARTH SNAKE
- else if (event.equals("30409-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(SERPENT_CHARM, 1);
}
return htmltext;
@@ -173,6 +168,7 @@ public class Q228_TestOfMagus extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.WIZARD) && (player.getClassId() != ClassId.ELVEN_WIZARD) && (player.getClassId() != ClassId.DARK_WIZARD))
{
htmltext = "30629-01.htm";
@@ -186,12 +182,14 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30629-03.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case RUKAL:
+ {
if (cond == 1)
{
htmltext = "30629-05.htm";
@@ -227,8 +225,9 @@ public class Q228_TestOfMagus extends Quest
st.exitQuest(false);
}
break;
-
+ }
case PARINA:
+ {
if (cond == 1)
{
htmltext = "30391-01.htm";
@@ -246,8 +245,9 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30391-05.htm";
}
break;
-
+ }
case CASIAN:
+ {
if (cond == 2)
{
htmltext = "30612-01.htm";
@@ -265,8 +265,9 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30612-05.htm";
}
break;
-
+ }
case WATER_UNDINE:
+ {
if (cond == 5)
{
if (st.hasQuestItems(UNDINE_CHARM))
@@ -284,7 +285,7 @@ public class Q228_TestOfMagus extends Quest
if (st.hasQuestItems(TONE_OF_FIRE, TONE_OF_WIND, TONE_OF_EARTH))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -309,8 +310,9 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30413-04.htm";
}
break;
-
+ }
case FLAME_SALAMANDER:
+ {
if (cond == 5)
{
if (st.hasQuestItems(SALAMANDER_CHARM))
@@ -328,7 +330,7 @@ public class Q228_TestOfMagus extends Quest
if (st.hasQuestItems(TONE_OF_WATER, TONE_OF_WIND, TONE_OF_EARTH))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -352,8 +354,9 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30411-04.htm";
}
break;
-
+ }
case WIND_SYLPH:
+ {
if (cond == 5)
{
if (st.hasQuestItems(SYLPH_CHARM))
@@ -373,7 +376,7 @@ public class Q228_TestOfMagus extends Quest
if (st.hasQuestItems(TONE_OF_WATER, TONE_OF_FIRE, TONE_OF_EARTH))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -396,8 +399,9 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30412-05.htm";
}
break;
-
+ }
case EARTH_SNAKE:
+ {
if (cond == 5)
{
if (st.hasQuestItems(SERPENT_CHARM))
@@ -417,7 +421,7 @@ public class Q228_TestOfMagus extends Quest
if (st.hasQuestItems(TONE_OF_WATER, TONE_OF_FIRE, TONE_OF_WIND))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -440,12 +444,15 @@ public class Q228_TestOfMagus extends Quest
htmltext = "30409-06.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -460,47 +467,50 @@ public class Q228_TestOfMagus extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
+ final int cond = st.getCond();
if (cond == 3)
{
switch (npc.getNpcId())
{
case SINGING_FLOWER_PHANTASM:
+ {
if (!st.hasQuestItems(GOLDEN_SEED_1))
{
npc.broadcastNpcSay("I am a tree of nothing... a tree... that knows where to return...");
st.dropItemsAlways(GOLDEN_SEED_1, 1, 1);
if (st.hasQuestItems(GOLDEN_SEED_2, GOLDEN_SEED_3))
{
- st.set("cond", "4");
+ st.setCond(4);
}
}
break;
-
+ }
case SINGING_FLOWER_NIGHTMARE:
+ {
if (!st.hasQuestItems(GOLDEN_SEED_2))
{
npc.broadcastNpcSay("I am a creature that shows the truth of the place deep in my heart...");
st.dropItemsAlways(GOLDEN_SEED_2, 1, 1);
if (st.hasQuestItems(GOLDEN_SEED_1, GOLDEN_SEED_3))
{
- st.set("cond", "4");
+ st.setCond(4);
}
}
break;
-
+ }
case SINGING_FLOWER_DARKLING:
+ {
if (!st.hasQuestItems(GOLDEN_SEED_3))
{
npc.broadcastNpcSay("I am a mirror of darkness... a virtual image of darkness...");
st.dropItemsAlways(GOLDEN_SEED_3, 1, 1);
if (st.hasQuestItems(GOLDEN_SEED_1, GOLDEN_SEED_2))
{
- st.set("cond", "4");
+ st.setCond(4);
}
}
break;
+ }
}
}
else if (cond == 5)
@@ -508,76 +518,87 @@ public class Q228_TestOfMagus extends Quest
switch (npc.getNpcId())
{
case GHOST_FIRE:
+ {
if (st.hasQuestItems(SALAMANDER_CHARM))
{
st.dropItems(FLAME_CRYSTAL, 1, 5, 500000);
}
break;
-
+ }
case TOAD_LORD:
case MARSH_STAKATO:
case MARSH_STAKATO_WORKER:
+ {
if (st.hasQuestItems(UNDINE_CHARM))
{
st.dropItems(DAZZLING_DROP, 1, 20, 300000);
}
break;
-
+ }
case MARSH_STAKATO_SOLDIER:
+ {
if (st.hasQuestItems(UNDINE_CHARM))
{
st.dropItems(DAZZLING_DROP, 1, 20, 400000);
}
break;
-
+ }
case MARSH_STAKATO_DRONE:
+ {
if (st.hasQuestItems(UNDINE_CHARM))
{
st.dropItems(DAZZLING_DROP, 1, 20, 500000);
}
break;
-
+ }
case HARPY:
+ {
if (st.hasQuestItems(SYLPH_CHARM))
{
st.dropItemsAlways(HARPY_FEATHER, 1, 20);
}
break;
-
+ }
case WYRM:
+ {
if (st.hasQuestItems(SYLPH_CHARM))
{
st.dropItems(WYRM_WINGBONE, 1, 10, 500000);
}
break;
-
+ }
case WINDSUS:
+ {
if (st.hasQuestItems(SYLPH_CHARM))
{
st.dropItems(WINDSUS_MANE, 1, 10, 500000);
}
break;
-
+ }
case ENCHANTED_MONSTEREYE:
+ {
if (st.hasQuestItems(SERPENT_CHARM))
{
st.dropItemsAlways(EN_MONSTEREYE_SHELL, 1, 10);
}
break;
-
+ }
case ENCHANTED_STONE_GOLEM:
+ {
if (st.hasQuestItems(SERPENT_CHARM))
{
st.dropItemsAlways(EN_STONEGOLEM_POWDER, 1, 10);
}
break;
-
+ }
case ENCHANTED_IRON_GOLEM:
+ {
if (st.hasQuestItems(SERPENT_CHARM))
{
st.dropItemsAlways(EN_IRONGOLEM_SCRAP, 1, 10);
}
break;
+ }
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q229_TestOfWitchcraft/Q229_TestOfWitchcraft.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q229_TestOfWitchcraft/Q229_TestOfWitchcraft.java
index 354b564b17..e90f4b5592 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q229_TestOfWitchcraft/Q229_TestOfWitchcraft.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q229_TestOfWitchcraft/Q229_TestOfWitchcraft.java
@@ -26,6 +26,33 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q229_TestOfWitchcraft extends Quest
{
+ // NPCs
+ private static final int LARA = 30063;
+ private static final int ALEXANDRIA = 30098;
+ private static final int IKER = 30110;
+ private static final int VADIN = 30188;
+ private static final int NESTLE = 30314;
+ private static final int SIR_KLAUS_VASPER = 30417;
+ private static final int LEOPOLD = 30435;
+ private static final int KAIRA = 30476;
+ private static final int ORIM = 30630;
+ private static final int RODERIK = 30631;
+ private static final int ENDRIGO = 30632;
+ private static final int EVERT = 30633;
+ // Monsters
+ private static final int DIRE_WYRM = 20557;
+ private static final int ENCHANTED_STONE_GOLEM = 20565;
+ private static final int LETO_LIZARDMAN = 20577;
+ private static final int LETO_LIZARDMAN_ARCHER = 20578;
+ private static final int LETO_LIZARDMAN_SOLDIER = 20579;
+ private static final int LETO_LIZARDMAN_WARRIOR = 20580;
+ private static final int LETO_LIZARDMAN_SHAMAN = 20581;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int TAMLIN_ORC = 20601;
+ private static final int TAMLIN_ORC_ARCHER = 20602;
+ private static final int NAMELESS_REVENANT = 27099;
+ private static final int SKELETAL_MERCENARY = 27100;
+ private static final int DREVANUL_PRINCE_ZERUEL = 27101;
// Items
private static final int ORIM_DIAGRAM = 3308;
private static final int ALEXANDRIA_BOOK = 3309;
@@ -56,53 +83,19 @@ public class Q229_TestOfWitchcraft extends Quest
private static final int ZERUEL_BIND_CRYSTAL = 3334;
private static final int BRIMSTONE_2 = 3335;
private static final int SWORD_OF_BINDING = 3029;
-
// Rewards
private static final int MARK_OF_WITCHCRAFT = 3307;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // NPCs
- private static final int LARA = 30063;
- private static final int ALEXANDRIA = 30098;
- private static final int IKER = 30110;
- private static final int VADIN = 30188;
- private static final int NESTLE = 30314;
- private static final int SIR_KLAUS_VASPER = 30417;
- private static final int LEOPOLD = 30435;
- private static final int KAIRA = 30476;
- private static final int ORIM = 30630;
- private static final int RODERIK = 30631;
- private static final int ENDRIGO = 30632;
- private static final int EVERT = 30633;
-
- // Monsters
- private static final int DIRE_WYRM = 20557;
- private static final int ENCHANTED_STONE_GOLEM = 20565;
- private static final int LETO_LIZARDMAN = 20577;
- private static final int LETO_LIZARDMAN_ARCHER = 20578;
- private static final int LETO_LIZARDMAN_SOLDIER = 20579;
- private static final int LETO_LIZARDMAN_WARRIOR = 20580;
- private static final int LETO_LIZARDMAN_SHAMAN = 20581;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int TAMLIN_ORC = 20601;
- private static final int TAMLIN_ORC_ARCHER = 20602;
- private static final int NAMELESS_REVENANT = 27099;
- private static final int SKELETAL_MERCENARY = 27100;
- private static final int DREVANUL_PRINCE_ZERUEL = 27101;
-
- // Checks
+ // Misc
private static boolean _drevanulPrinceZeruel = false;
private static boolean _swordOfBinding = false;
public Q229_TestOfWitchcraft()
{
super(229, "Test of Witchcraft");
-
registerQuestItems(ORIM_DIAGRAM, ALEXANDRIA_BOOK, IKER_LIST, DIRE_WYRM_FANG, LETO_LIZARDMAN_CHARM, EN_GOLEM_HEARTSTONE, LARA_MEMO, NESTLE_MEMO, LEOPOLD_JOURNAL, AKLANTOTH_GEM_1, AKLANTOTH_GEM_2, AKLANTOTH_GEM_3, AKLANTOTH_GEM_4, AKLANTOTH_GEM_5, AKLANTOTH_GEM_6, BRIMSTONE_1, ORIM_INSTRUCTIONS, ORIM_LETTER_1, ORIM_LETTER_2, SIR_VASPER_LETTER, VADIN_CRUCIFIX, TAMLIN_ORC_AMULET, VADIN_SANCTIONS, IKER_AMULET, SOULTRAP_CRYSTAL, PURGATORY_KEY, ZERUEL_BIND_CRYSTAL, BRIMSTONE_2, SWORD_OF_BINDING);
-
addStartNpc(ORIM);
addTalkId(LARA, ALEXANDRIA, IKER, VADIN, NESTLE, SIR_KLAUS_VASPER, LEOPOLD, KAIRA, ORIM, RODERIK, ENDRIGO, EVERT);
-
addAttackId(NAMELESS_REVENANT, SKELETAL_MERCENARY, DREVANUL_PRINCE_ZERUEL);
addKillId(DIRE_WYRM, ENCHANTED_STONE_GOLEM, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, TAMLIN_ORC, TAMLIN_ORC_ARCHER, NAMELESS_REVENANT, SKELETAL_MERCENARY, DREVANUL_PRINCE_ZERUEL);
}
@@ -117,160 +110,159 @@ public class Q229_TestOfWitchcraft extends Quest
return htmltext;
}
- // ORIM
- if (event.equals("30630-08.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORIM_DIAGRAM, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30630-08.htm":
{
- htmltext = "30630-08a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(ORIM_DIAGRAM, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30630-08a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- else if (event.equals("30630-14.htm"))
- {
- st.set("cond", "4");
- st.unset("gem456");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(AKLANTOTH_GEM_1, 1);
- st.takeItems(AKLANTOTH_GEM_2, 1);
- st.takeItems(AKLANTOTH_GEM_3, 1);
- st.takeItems(AKLANTOTH_GEM_4, 1);
- st.takeItems(AKLANTOTH_GEM_5, 1);
- st.takeItems(AKLANTOTH_GEM_6, 1);
- st.takeItems(ALEXANDRIA_BOOK, 1);
- st.giveItems(BRIMSTONE_1, 1);
- addSpawn(DREVANUL_PRINCE_ZERUEL, 70381, 109638, -3726, 0, false, 120000);
- }
- else if (event.equals("30630-16.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BRIMSTONE_1, 1);
- st.giveItems(ORIM_INSTRUCTIONS, 1);
- st.giveItems(ORIM_LETTER_1, 1);
- st.giveItems(ORIM_LETTER_2, 1);
- }
- else if (event.equals("30630-22.htm"))
- {
- st.takeItems(IKER_AMULET, 1);
- st.takeItems(ORIM_INSTRUCTIONS, 1);
- st.takeItems(PURGATORY_KEY, 1);
- st.takeItems(SWORD_OF_BINDING, 1);
- st.takeItems(ZERUEL_BIND_CRYSTAL, 1);
- st.giveItems(MARK_OF_WITCHCRAFT, 1);
- st.rewardExpAndSp(139796, 40000);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- // ALEXANDRIA
- else if (event.equals("30098-03.htm"))
- {
- st.set("cond", "2");
- st.set("gem456", "1");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ORIM_DIAGRAM, 1);
- st.giveItems(ALEXANDRIA_BOOK, 1);
- }
- // IKER
- else if (event.equals("30110-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(IKER_LIST, 1);
- }
- else if (event.equals("30110-08.htm"))
- {
- st.takeItems(ORIM_LETTER_2, 1);
- st.giveItems(IKER_AMULET, 1);
- st.giveItems(SOULTRAP_CRYSTAL, 1);
-
- if (st.hasQuestItems(SWORD_OF_BINDING))
+ case "30630-14.htm":
{
- st.set("cond", "7");
+ st.setCond(4);
+ st.unset("gem456");
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(AKLANTOTH_GEM_1, 1);
+ st.takeItems(AKLANTOTH_GEM_2, 1);
+ st.takeItems(AKLANTOTH_GEM_3, 1);
+ st.takeItems(AKLANTOTH_GEM_4, 1);
+ st.takeItems(AKLANTOTH_GEM_5, 1);
+ st.takeItems(AKLANTOTH_GEM_6, 1);
+ st.takeItems(ALEXANDRIA_BOOK, 1);
+ st.giveItems(BRIMSTONE_1, 1);
+ addSpawn(DREVANUL_PRINCE_ZERUEL, 70381, 109638, -3726, 0, false, 120000);
+ break;
}
- else
+ case "30630-16.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BRIMSTONE_1, 1);
+ st.giveItems(ORIM_INSTRUCTIONS, 1);
+ st.giveItems(ORIM_LETTER_1, 1);
+ st.giveItems(ORIM_LETTER_2, 1);
+ break;
+ }
+ case "30630-22.htm":
+ {
+ st.takeItems(IKER_AMULET, 1);
+ st.takeItems(ORIM_INSTRUCTIONS, 1);
+ st.takeItems(PURGATORY_KEY, 1);
+ st.takeItems(SWORD_OF_BINDING, 1);
+ st.takeItems(ZERUEL_BIND_CRYSTAL, 1);
+ st.giveItems(MARK_OF_WITCHCRAFT, 1);
+ st.rewardExpAndSp(139796, 40000);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "30098-03.htm":
+ {
+ st.setCond(2);
+ st.set("gem456", "1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORIM_DIAGRAM, 1);
+ st.giveItems(ALEXANDRIA_BOOK, 1);
+ break;
+ }
+ case "30110-03.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(IKER_LIST, 1);
+ break;
}
- }
- // KAIRA
- else if (event.equals("30476-02.htm"))
- {
- st.giveItems(AKLANTOTH_GEM_2, 1);
-
- if (st.hasQuestItems(AKLANTOTH_GEM_1, AKLANTOTH_GEM_3) && (st.getInt("gem456") == 6))
+ case "30110-08.htm":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ORIM_LETTER_2, 1);
+ st.giveItems(IKER_AMULET, 1);
+ st.giveItems(SOULTRAP_CRYSTAL, 1);
+ if (st.hasQuestItems(SWORD_OF_BINDING))
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
}
- else
+ case "30476-02.htm":
+ {
+ st.giveItems(AKLANTOTH_GEM_2, 1);
+ if (st.hasQuestItems(AKLANTOTH_GEM_1, AKLANTOTH_GEM_3) && (st.getInt("gem456") == 6))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
+ }
+ case "30063-02.htm":
{
st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(LARA_MEMO, 1);
+ break;
}
- }
- // LARA
- else if (event.equals("30063-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(LARA_MEMO, 1);
- }
- // NESTLE
- else if (event.equals("30314-02.htm"))
- {
- st.set("gem456", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(NESTLE_MEMO, 1);
- }
- // LEOPOLD
- else if (event.equals("30435-02.htm"))
- {
- st.set("gem456", "3");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(NESTLE_MEMO, 1);
- st.giveItems(LEOPOLD_JOURNAL, 1);
- }
- // SIR KLAUS VASPER
- else if (event.equals("30417-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(ORIM_LETTER_1, 1);
- st.giveItems(SIR_VASPER_LETTER, 1);
- }
- // EVERT
- else if (event.equals("30633-02.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BRIMSTONE_2, 1);
-
- if (!_drevanulPrinceZeruel)
+ case "30314-02.htm":
{
- addSpawn(DREVANUL_PRINCE_ZERUEL, 13395, 169807, -3708, 0, false, 299000);
- _drevanulPrinceZeruel = true;
-
- // Resets Drevanul Prince Zeruel
- startQuestTimer("zeruel_cleanup", 300000, null, player, false);
+ st.set("gem456", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(NESTLE_MEMO, 1);
+ break;
+ }
+ case "30435-02.htm":
+ {
+ st.set("gem456", "3");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(NESTLE_MEMO, 1);
+ st.giveItems(LEOPOLD_JOURNAL, 1);
+ break;
+ }
+ case "30417-03.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(ORIM_LETTER_1, 1);
+ st.giveItems(SIR_VASPER_LETTER, 1);
+ break;
+ }
+ case "30633-02.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BRIMSTONE_2, 1);
+ if (!_drevanulPrinceZeruel)
+ {
+ addSpawn(DREVANUL_PRINCE_ZERUEL, 13395, 169807, -3708, 0, false, 299000);
+ _drevanulPrinceZeruel = true;
+
+ // Resets Drevanul Prince Zeruel
+ startQuestTimer("zeruel_cleanup", 300000, null, player, false);
+ }
+ break;
+ }
+ case "zeruel_despawn":
+ {
+ npc.abortAttack();
+ npc.decayMe();
+ return null;
+ }
+ case "zeruel_cleanup":
+ {
+ _drevanulPrinceZeruel = false;
+ return null;
}
- }
- // Despawns Drevanul Prince Zeruel
- else if (event.equals("zeruel_despawn"))
- {
- npc.abortAttack();
- npc.decayMe();
- return null;
- }
- // Drevanul Prince Zeruel's reset
- else if (event.equals("zeruel_cleanup"))
- {
- _drevanulPrinceZeruel = false;
- return null;
}
return htmltext;
@@ -289,6 +281,7 @@ public class Q229_TestOfWitchcraft extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.KNIGHT) && (player.getClassId() != ClassId.WIZARD) && (player.getClassId() != ClassId.PALUS_KNIGHT))
{
htmltext = "30630-01.htm";
@@ -302,14 +295,15 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = (player.getClassId() == ClassId.WIZARD) ? "30630-03.htm" : "30630-05.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
final int gem456 = st.getInt("gem456");
-
switch (npc.getNpcId())
{
case ORIM:
+ {
if (cond == 1)
{
htmltext = "30630-09.htm";
@@ -337,7 +331,7 @@ public class Q229_TestOfWitchcraft extends Quest
else if (cond == 7)
{
htmltext = "30630-18.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if ((cond == 8) || (cond == 9))
@@ -349,8 +343,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30630-19.htm";
}
break;
-
+ }
case ALEXANDRIA:
+ {
if (cond == 1)
{
htmltext = "30098-01.htm";
@@ -364,8 +359,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30098-05.htm";
}
break;
-
+ }
case KAIRA:
+ {
if (st.hasQuestItems(AKLANTOTH_GEM_2))
{
htmltext = "30476-03.htm";
@@ -379,8 +375,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30476-04.htm";
}
break;
-
+ }
case IKER:
+ {
if (st.hasQuestItems(AKLANTOTH_GEM_1))
{
htmltext = "30110-06.htm";
@@ -402,7 +399,7 @@ public class Q229_TestOfWitchcraft extends Quest
if (st.hasQuestItems(AKLANTOTH_GEM_2, AKLANTOTH_GEM_3) && (gem456 == 6))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -428,8 +425,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30110-10.htm";
}
break;
-
+ }
case LARA:
+ {
if (st.hasQuestItems(AKLANTOTH_GEM_3))
{
htmltext = "30063-04.htm";
@@ -447,16 +445,18 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30063-05.htm";
}
break;
-
+ }
case RODERIK:
case ENDRIGO:
+ {
if (st.hasAtLeastOneQuestItem(LARA_MEMO, AKLANTOTH_GEM_3))
{
htmltext = npc.getNpcId() + "-01.htm";
}
break;
-
+ }
case NESTLE:
+ {
if (gem456 == 1)
{
htmltext = "30314-01.htm";
@@ -470,8 +470,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30314-04.htm";
}
break;
-
+ }
case LEOPOLD:
+ {
if (gem456 == 2)
{
htmltext = "30435-01.htm";
@@ -489,8 +490,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30435-05.htm";
}
break;
-
+ }
case SIR_KLAUS_VASPER:
+ {
if (st.hasAtLeastOneQuestItem(SIR_VASPER_LETTER, VADIN_CRUCIFIX))
{
htmltext = "30417-04.htm";
@@ -503,7 +505,7 @@ public class Q229_TestOfWitchcraft extends Quest
if (st.hasQuestItems(SOULTRAP_CRYSTAL))
{
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -520,8 +522,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30417-06.htm";
}
break;
-
+ }
case VADIN:
+ {
if (st.hasQuestItems(SIR_VASPER_LETTER))
{
htmltext = "30188-01.htm";
@@ -553,8 +556,9 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30188-05.htm";
}
break;
-
+ }
case EVERT:
+ {
if ((cond == 7) || (cond == 8))
{
htmltext = "30633-01.htm";
@@ -577,12 +581,15 @@ public class Q229_TestOfWitchcraft extends Quest
htmltext = "30633-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -597,30 +604,31 @@ public class Q229_TestOfWitchcraft extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case NAMELESS_REVENANT:
+ {
if (st.hasQuestItems(LARA_MEMO) && !npc.isScriptValue(1))
{
npc.setScriptValue(1);
npc.broadcastNpcSay("I absolutely cannot give it to you! It is my precious jewel!");
}
break;
-
+ }
case SKELETAL_MERCENARY:
+ {
if ((st.getInt("gem456") > 2) && (st.getInt("gem456") < 6) && !npc.isScriptValue(1))
{
npc.setScriptValue(1);
npc.broadcastNpcSay("I absolutely cannot give it to you! It is my precious jewel!");
}
break;
-
+ }
case DREVANUL_PRINCE_ZERUEL:
- if ((cond == 4) && !npc.isScriptValue(1))
+ {
+ if (st.isCond(4) && !npc.isScriptValue(1))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
npc.setScriptValue(1);
@@ -628,7 +636,7 @@ public class Q229_TestOfWitchcraft extends Quest
startQuestTimer("zeruel_despawn", 1000, npc, attacker, false);
}
- else if ((cond == 9) && _drevanulPrinceZeruel)
+ else if (st.isCond(9) && _drevanulPrinceZeruel)
{
if (attacker.getInventory().getPaperdollItemId(7) == SWORD_OF_BINDING)
{
@@ -646,6 +654,7 @@ public class Q229_TestOfWitchcraft extends Quest
}
}
break;
+ }
}
return null;
@@ -660,47 +669,53 @@ public class Q229_TestOfWitchcraft extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case DIRE_WYRM:
+ {
if (st.hasQuestItems(IKER_LIST))
{
st.dropItemsAlways(DIRE_WYRM_FANG, 1, 20);
}
break;
-
+ }
case ENCHANTED_STONE_GOLEM:
+ {
if (st.hasQuestItems(IKER_LIST))
{
st.dropItemsAlways(EN_GOLEM_HEARTSTONE, 1, 20);
}
break;
-
+ }
case LETO_LIZARDMAN:
case LETO_LIZARDMAN_ARCHER:
+ {
if (st.hasQuestItems(IKER_LIST))
{
st.dropItems(LETO_LIZARDMAN_CHARM, 1, 20, 500000);
}
break;
+ }
case LETO_LIZARDMAN_SOLDIER:
case LETO_LIZARDMAN_WARRIOR:
+ {
if (st.hasQuestItems(IKER_LIST))
{
st.dropItems(LETO_LIZARDMAN_CHARM, 1, 20, 600000);
}
break;
+ }
case LETO_LIZARDMAN_SHAMAN:
case LETO_LIZARDMAN_OVERLORD:
+ {
if (st.hasQuestItems(IKER_LIST))
{
st.dropItems(LETO_LIZARDMAN_CHARM, 1, 20, 700000);
}
break;
-
+ }
case NAMELESS_REVENANT:
+ {
if (st.hasQuestItems(LARA_MEMO))
{
st.takeItems(LARA_MEMO, 1);
@@ -708,7 +723,7 @@ public class Q229_TestOfWitchcraft extends Quest
if (st.hasQuestItems(AKLANTOTH_GEM_1, AKLANTOTH_GEM_2) && (st.getInt("gem456") == 6))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -717,8 +732,9 @@ public class Q229_TestOfWitchcraft extends Quest
}
}
break;
-
+ }
case SKELETAL_MERCENARY:
+ {
final int gem456 = st.getInt("gem456");
if (gem456 == 3)
{
@@ -740,7 +756,7 @@ public class Q229_TestOfWitchcraft extends Quest
if (st.hasQuestItems(AKLANTOTH_GEM_1, AKLANTOTH_GEM_2, AKLANTOTH_GEM_3))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -749,21 +765,23 @@ public class Q229_TestOfWitchcraft extends Quest
}
}
break;
-
+ }
case TAMLIN_ORC:
case TAMLIN_ORC_ARCHER:
+ {
if (st.hasQuestItems(VADIN_CRUCIFIX))
{
st.dropItems(TAMLIN_ORC_AMULET, 1, 20, 500000);
}
break;
-
+ }
case DREVANUL_PRINCE_ZERUEL:
- if ((cond == 9) && _drevanulPrinceZeruel)
+ {
+ if (st.isCond(9) && _drevanulPrinceZeruel)
{
if (_swordOfBinding)
{
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_ITEMGET);
st.takeItems(BRIMSTONE_2, 1);
st.takeItems(SOULTRAP_CRYSTAL, 1);
@@ -775,6 +793,7 @@ public class Q229_TestOfWitchcraft extends Quest
_drevanulPrinceZeruel = false;
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q230_TestOfTheSummoner/Q230_TestOfTheSummoner.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q230_TestOfTheSummoner/Q230_TestOfTheSummoner.java
index 277010ab82..a08ee472d8 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q230_TestOfTheSummoner/Q230_TestOfTheSummoner.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q230_TestOfTheSummoner/Q230_TestOfTheSummoner.java
@@ -34,6 +34,44 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q230_TestOfTheSummoner extends Quest
{
+ // NPCs
+ private static final int LARA = 30063;
+ private static final int GALATEA = 30634;
+ private static final int ALMORS = 30635;
+ private static final int CAMONIELL = 30636;
+ private static final int BELTHUS = 30637;
+ private static final int BASILLA = 30638;
+ private static final int CELESTIEL = 30639;
+ private static final int BRYNTHEA = 30640;
+ // Monsters
+ private static final int NOBLE_ANT = 20089;
+ private static final int NOBLE_ANT_LEADER = 20090;
+ private static final int WYRM = 20176;
+ private static final int TYRANT = 20192;
+ private static final int TYRANT_KINGPIN = 20193;
+ private static final int BREKA_ORC = 20267;
+ private static final int BREKA_ORC_ARCHER = 20268;
+ private static final int BREKA_ORC_SHAMAN = 20269;
+ private static final int BREKA_ORC_OVERLORD = 20270;
+ private static final int BREKA_ORC_WARRIOR = 20271;
+ private static final int FETTERED_SOUL = 20552;
+ private static final int WINDSUS = 20553;
+ private static final int GIANT_FUNGUS = 20555;
+ private static final int MANASHEN_GARGOYLE = 20563;
+ private static final int LETO_LIZARDMAN = 20577;
+ private static final int LETO_LIZARDMAN_ARCHER = 20578;
+ private static final int LETO_LIZARDMAN_SOLDIER = 20579;
+ private static final int LETO_LIZARDMAN_WARRIOR = 20580;
+ private static final int LETO_LIZARDMAN_SHAMAN = 20581;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int KARUL_BUGBEAR = 20600;
+ // Quest Monsters
+ private static final int PAKO_THE_CAT = 27102;
+ private static final int UNICORN_RACER = 27103;
+ private static final int SHADOW_TUREN = 27104;
+ private static final int MIMI_THE_CAT = 27105;
+ private static final int UNICORN_PHANTASM = 27106;
+ private static final int SILHOUETTE_TILFO = 27107;
// Items
private static final int LETO_LIZARDMAN_AMULET = 3337;
private static final int SAC_OF_REDSPORES = 3338;
@@ -88,79 +126,19 @@ public class Q230_TestOfTheSummoner extends Quest
private static final int CRYSTAL_OF_FOUL_6 = 3387;
private static final int CRYSTAL_OF_DEFEAT_6 = 3388;
private static final int CRYSTAL_OF_VICTORY_6 = 3389;
-
// Rewards
private static final int MARK_OF_SUMMONER = 3336;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
- // Npcs
- private static final int LARA = 30063;
- private static final int GALATEA = 30634;
- private static final int ALMORS = 30635;
- private static final int CAMONIELL = 30636;
- private static final int BELTHUS = 30637;
- private static final int BASILLA = 30638;
- private static final int CELESTIEL = 30639;
- private static final int BRYNTHEA = 30640;
-
- // Monsters
- private static final int NOBLE_ANT = 20089;
- private static final int NOBLE_ANT_LEADER = 20090;
- private static final int WYRM = 20176;
- private static final int TYRANT = 20192;
- private static final int TYRANT_KINGPIN = 20193;
- private static final int BREKA_ORC = 20267;
- private static final int BREKA_ORC_ARCHER = 20268;
- private static final int BREKA_ORC_SHAMAN = 20269;
- private static final int BREKA_ORC_OVERLORD = 20270;
- private static final int BREKA_ORC_WARRIOR = 20271;
- private static final int FETTERED_SOUL = 20552;
- private static final int WINDSUS = 20553;
- private static final int GIANT_FUNGUS = 20555;
- private static final int MANASHEN_GARGOYLE = 20563;
- private static final int LETO_LIZARDMAN = 20577;
- private static final int LETO_LIZARDMAN_ARCHER = 20578;
- private static final int LETO_LIZARDMAN_SOLDIER = 20579;
- private static final int LETO_LIZARDMAN_WARRIOR = 20580;
- private static final int LETO_LIZARDMAN_SHAMAN = 20581;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int KARUL_BUGBEAR = 20600;
-
- // Quest Monsters
- private static final int PAKO_THE_CAT = 27102;
- private static final int UNICORN_RACER = 27103;
- private static final int SHADOW_TUREN = 27104;
- private static final int MIMI_THE_CAT = 27105;
- private static final int UNICORN_PHANTASM = 27106;
- private static final int SILHOUETTE_TILFO = 27107;
-
+ // Other
private static final int[][] LARA_LISTS = new int[][]
{
- {
- LARA_LIST_1,
- SAC_OF_REDSPORES,
- LETO_LIZARDMAN_AMULET
- },
- {
- LARA_LIST_2,
- KARUL_BUGBEAR_TOTEM,
- SHARDS_OF_MANASHEN
- },
- {
- LARA_LIST_3,
- CRIMSON_BLOODSTONE,
- BREKA_ORC_TOTEM
- },
- {
- LARA_LIST_4,
- TUSK_OF_WINDSUS,
- TALONS_OF_TYRANT
- },
- {
- LARA_LIST_5,
- WINGS_OF_DRONEANT,
- FANGS_OF_WYRM
- }
+ // @formatter:off
+ {LARA_LIST_1, SAC_OF_REDSPORES, LETO_LIZARDMAN_AMULET},
+ {LARA_LIST_2, KARUL_BUGBEAR_TOTEM, SHARDS_OF_MANASHEN},
+ {LARA_LIST_3, CRIMSON_BLOODSTONE, BREKA_ORC_TOTEM},
+ {LARA_LIST_4, TUSK_OF_WINDSUS, TALONS_OF_TYRANT},
+ {LARA_LIST_5, WINGS_OF_DRONEANT, FANGS_OF_WYRM}
+ // @formatter:on
};
private static final Map _duelsInProgress = new ConcurrentHashMap<>();
@@ -168,12 +146,9 @@ public class Q230_TestOfTheSummoner extends Quest
public Q230_TestOfTheSummoner()
{
super(230, "Test of the Summoner");
-
registerQuestItems(LETO_LIZARDMAN_AMULET, SAC_OF_REDSPORES, KARUL_BUGBEAR_TOTEM, SHARDS_OF_MANASHEN, BREKA_ORC_TOTEM, CRIMSON_BLOODSTONE, TALONS_OF_TYRANT, WINGS_OF_DRONEANT, TUSK_OF_WINDSUS, FANGS_OF_WYRM, LARA_LIST_1, LARA_LIST_2, LARA_LIST_3, LARA_LIST_4, LARA_LIST_5, GALATEA_LETTER, BEGINNER_ARCANA, ALMORS_ARCANA, CAMONIELL_ARCANA, BELTHUS_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA, CRYSTAL_OF_PROGRESS_1, CRYSTAL_OF_INPROGRESS_1, CRYSTAL_OF_FOUL_1, CRYSTAL_OF_DEFEAT_1, CRYSTAL_OF_VICTORY_1, CRYSTAL_OF_PROGRESS_2, CRYSTAL_OF_INPROGRESS_2, CRYSTAL_OF_FOUL_2, CRYSTAL_OF_DEFEAT_2, CRYSTAL_OF_VICTORY_2, CRYSTAL_OF_PROGRESS_3, CRYSTAL_OF_INPROGRESS_3, CRYSTAL_OF_FOUL_3, CRYSTAL_OF_DEFEAT_3, CRYSTAL_OF_VICTORY_3, CRYSTAL_OF_PROGRESS_4, CRYSTAL_OF_INPROGRESS_4, CRYSTAL_OF_FOUL_4, CRYSTAL_OF_DEFEAT_4, CRYSTAL_OF_VICTORY_4, CRYSTAL_OF_PROGRESS_5, CRYSTAL_OF_INPROGRESS_5, CRYSTAL_OF_FOUL_5, CRYSTAL_OF_DEFEAT_5, CRYSTAL_OF_VICTORY_5, CRYSTAL_OF_PROGRESS_6, CRYSTAL_OF_INPROGRESS_6, CRYSTAL_OF_FOUL_6, CRYSTAL_OF_DEFEAT_6, CRYSTAL_OF_VICTORY_6);
-
addStartNpc(GALATEA);
addTalkId(GALATEA, ALMORS, CAMONIELL, BELTHUS, BASILLA, CELESTIEL, BRYNTHEA, LARA);
-
addKillId(NOBLE_ANT, NOBLE_ANT_LEADER, WYRM, TYRANT, TYRANT_KINGPIN, BREKA_ORC, BREKA_ORC_ARCHER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, BREKA_ORC_WARRIOR, FETTERED_SOUL, WINDSUS, GIANT_FUNGUS, MANASHEN_GARGOYLE, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, KARUL_BUGBEAR, PAKO_THE_CAT, UNICORN_RACER, SHADOW_TUREN, MIMI_THE_CAT, UNICORN_PHANTASM, SILHOUETTE_TILFO);
addAttackId(PAKO_THE_CAT, UNICORN_RACER, SHADOW_TUREN, MIMI_THE_CAT, UNICORN_PHANTASM, SILHOUETTE_TILFO);
}
@@ -181,173 +156,171 @@ public class Q230_TestOfTheSummoner extends Quest
@Override
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{
- String htmltext = event;
final QuestState st = player.getQuestState(getName());
if (st == null)
{
return null;
}
+ String htmltext = event;
- // GALATEA
- if (event.equals("30634-08.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("Belthus", "1");
- st.set("Brynthea", "1");
- st.set("Celestiel", "1");
- st.set("Camoniell", "1");
- st.set("Basilla", "1");
- st.set("Almors", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(GALATEA_LETTER, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30634-08.htm":
{
- htmltext = "30634-08a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.set("Belthus", "1");
+ st.set("Brynthea", "1");
+ st.set("Celestiel", "1");
+ st.set("Camoniell", "1");
+ st.set("Basilla", "1");
+ st.set("Almors", "1");
+ st.giveItems(GALATEA_LETTER, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30634-08a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- // LARA
- else if (event.equals("30063-02.htm")) // Lara first time to give a list out
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GALATEA_LETTER, 1);
-
- final int random = Rnd.get(5);
-
- st.giveItems(LARA_LISTS[random][0], 1);
- st.set("Lara", String.valueOf(random + 1)); // avoid 0
- }
- else if (event.equals("30063-04.htm")) // Lara later to give a list out
- {
- final int random = Rnd.get(5);
-
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(LARA_LISTS[random][0], 1);
- st.set("Lara", String.valueOf(random + 1));
- }
- // ALMORS
- else if (event.equals("30635-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30063-02.htm":
{
- htmltext = "30635-03.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GALATEA_LETTER, 1);
+ final int random = Rnd.get(5);
+ st.giveItems(LARA_LISTS[random][0], 1);
+ st.set("Lara", String.valueOf(random + 1)); // avoid 0
+ break;
}
- }
- else if (event.equals("30635-04.htm"))
- {
- st.set("Almors", "2"); // set state ready to fight
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_1, -1); // just in case he cheated or lost
- st.takeItems(CRYSTAL_OF_DEFEAT_1, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_1, 1); // give Starting Crystal
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
- }
- // CAMONIELL
- else if (event.equals("30636-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30063-04.htm":
{
- htmltext = "30636-03.htm";
+ final int random = Rnd.get(5);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(LARA_LISTS[random][0], 1);
+ st.set("Lara", String.valueOf(random + 1));
+ break;
}
- }
- else if (event.equals("30636-04.htm"))
- {
- st.set("Camoniell", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_2, -1);
- st.takeItems(CRYSTAL_OF_DEFEAT_2, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_2, 1);
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
- }
- // BELTHUS
- else if (event.equals("30637-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30635-02.htm":
{
- htmltext = "30637-03.htm";
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30635-03.htm";
+ }
+ break;
}
- }
- else if (event.equals("30637-04.htm"))
- {
- st.set("Belthus", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_3, -1);
- st.takeItems(CRYSTAL_OF_DEFEAT_3, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_3, 1);
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
- }
- // BASILLA
- else if (event.equals("30638-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30635-04.htm":
{
- htmltext = "30638-03.htm";
+ st.set("Almors", "2"); // set state ready to fight
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_1, -1); // just in case he cheated or lost
+ st.takeItems(CRYSTAL_OF_DEFEAT_1, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_1, 1); // give Starting Crystal
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
}
- }
- else if (event.equals("30638-04.htm"))
- {
- st.set("Basilla", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_4, -1);
- st.takeItems(CRYSTAL_OF_DEFEAT_4, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_4, 1);
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
- }
- // CELESTIEL
- else if (event.equals("30639-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30636-02.htm":
{
- htmltext = "30639-03.htm";
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30636-03.htm";
+ }
+ break;
}
- }
- else if (event.equals("30639-04.htm"))
- {
- st.set("Celestiel", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_5, -1);
- st.takeItems(CRYSTAL_OF_DEFEAT_5, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_5, 1);
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
- }
- // BRYNTHEA
- else if (event.equals("30640-02.htm"))
- {
- if (st.hasQuestItems(BEGINNER_ARCANA))
+ case "30636-04.htm":
{
- htmltext = "30640-03.htm";
+ st.set("Camoniell", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_2, -1);
+ st.takeItems(CRYSTAL_OF_DEFEAT_2, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_2, 1);
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
+ }
+ case "30637-02.htm":
+ {
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30637-03.htm";
+ }
+ break;
+ }
+ case "30637-04.htm":
+ {
+ st.set("Belthus", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_3, -1);
+ st.takeItems(CRYSTAL_OF_DEFEAT_3, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_3, 1);
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
+ }
+ case "30638-02.htm":
+ {
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30638-03.htm";
+ }
+ break;
+ }
+ case "30638-04.htm":
+ {
+ st.set("Basilla", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_4, -1);
+ st.takeItems(CRYSTAL_OF_DEFEAT_4, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_4, 1);
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
+ }
+ case "30639-02.htm":
+ {
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30639-03.htm";
+ }
+ break;
+ }
+ case "30639-04.htm":
+ {
+ st.set("Celestiel", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_5, -1);
+ st.takeItems(CRYSTAL_OF_DEFEAT_5, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_5, 1);
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
+ }
+ case "30640-02.htm":
+ {
+ if (st.hasQuestItems(BEGINNER_ARCANA))
+ {
+ htmltext = "30640-03.htm";
+ }
+ break;
+ }
+ case "30640-04.htm":
+ {
+ st.set("Brynthea", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CRYSTAL_OF_FOUL_6, -1);
+ st.takeItems(CRYSTAL_OF_DEFEAT_6, -1);
+ st.takeItems(BEGINNER_ARCANA, 1);
+ st.giveItems(CRYSTAL_OF_PROGRESS_6, 1);
+ npc.setTarget(player);
+ npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
+ break;
}
- }
- else if (event.equals("30640-04.htm"))
- {
- st.set("Brynthea", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CRYSTAL_OF_FOUL_6, -1);
- st.takeItems(CRYSTAL_OF_DEFEAT_6, -1);
- st.takeItems(BEGINNER_ARCANA, 1);
- st.giveItems(CRYSTAL_OF_PROGRESS_6, 1);
-
- npc.setTarget(player);
- npc.doCast(SkillTable.getInstance().getSkill(4126, 1));
}
return htmltext;
@@ -363,12 +336,12 @@ public class Q230_TestOfTheSummoner extends Quest
return htmltext;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
-
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getClassId() != ClassId.WIZARD) && (player.getClassId() != ClassId.ELVEN_WIZARD) && (player.getClassId() != ClassId.DARK_WIZARD))
{
htmltext = "30634-01.htm";
@@ -382,11 +355,13 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30634-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npcId)
{
case LARA:
+ {
if (cond == 1)
{
htmltext = "30063-01.htm";
@@ -407,7 +382,7 @@ public class Q230_TestOfTheSummoner extends Quest
else
{
htmltext = "30063-06.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.unset("Lara");
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(laraPart[0], 1);
@@ -418,8 +393,9 @@ public class Q230_TestOfTheSummoner extends Quest
}
}
break;
-
+ }
case GALATEA:
+ {
if (cond == 1)
{
htmltext = "30634-09.htm";
@@ -450,8 +426,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ALMORS:
+ {
final int almorsStat = st.getInt("Almors");
if (almorsStat == 1)
{
@@ -482,7 +459,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(CAMONIELL_ARCANA, BELTHUS_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -495,8 +472,9 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30635-10.htm";
}
break;
-
+ }
case CAMONIELL:
+ {
final int camoniellStat = st.getInt("Camoniell");
if (camoniellStat == 1)
{
@@ -527,7 +505,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(ALMORS_ARCANA, BELTHUS_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -540,8 +518,9 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30636-10.htm";
}
break;
-
+ }
case BELTHUS:
+ {
final int belthusStat = st.getInt("Belthus");
if (belthusStat == 1)
{
@@ -572,7 +551,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(ALMORS_ARCANA, CAMONIELL_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -585,8 +564,9 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30637-10.htm";
}
break;
-
+ }
case BASILLA:
+ {
final int basillaStat = st.getInt("Basilla");
if (basillaStat == 1)
{
@@ -617,7 +597,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(ALMORS_ARCANA, CAMONIELL_ARCANA, BELTHUS_ARCANA, CELESTIEL_ARCANA, BRYNTHEA_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -630,8 +610,9 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30638-10.htm";
}
break;
-
+ }
case CELESTIEL:
+ {
final int celestielStat = st.getInt("Celestiel");
if (celestielStat == 1)
{
@@ -662,7 +643,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(ALMORS_ARCANA, CAMONIELL_ARCANA, BELTHUS_ARCANA, BASILLIA_ARCANA, BRYNTHEA_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -675,8 +656,9 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30639-10.htm";
}
break;
-
+ }
case BRYNTHEA:
+ {
final int bryntheaStat = st.getInt("Brynthea");
if (bryntheaStat == 1)
{
@@ -707,7 +689,7 @@ public class Q230_TestOfTheSummoner extends Quest
if (st.hasQuestItems(ALMORS_ARCANA, CAMONIELL_ARCANA, BELTHUS_ARCANA, BASILLIA_ARCANA, CELESTIEL_ARCANA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -720,12 +702,15 @@ public class Q230_TestOfTheSummoner extends Quest
htmltext = "30640-10.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -747,6 +732,7 @@ public class Q230_TestOfTheSummoner extends Quest
switch (((NpcInstance) killer).getNpcId())
{
case PAKO_THE_CAT:
+ {
if (st.getInt("Almors") == 3)
{
st.set("Almors", "4");
@@ -754,8 +740,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_1, 1);
}
break;
-
+ }
case UNICORN_RACER:
+ {
if (st.getInt("Camoniell") == 3)
{
st.set("Camoniell", "4");
@@ -763,8 +750,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_2, 1);
}
break;
-
+ }
case SHADOW_TUREN:
+ {
if (st.getInt("Belthus") == 3)
{
st.set("Belthus", "4");
@@ -772,8 +760,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_3, 1);
}
break;
-
+ }
case MIMI_THE_CAT:
+ {
if (st.getInt("Basilla") == 3)
{
st.set("Basilla", "4");
@@ -781,8 +770,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_4, 1);
}
break;
-
+ }
case UNICORN_PHANTASM:
+ {
if (st.getInt("Celestiel") == 3)
{
st.set("Celestiel", "4");
@@ -790,8 +780,9 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_5, 1);
}
break;
-
+ }
case SILHOUETTE_TILFO:
+ {
if (st.getInt("Brynthea") == 3)
{
st.set("Brynthea", "4");
@@ -799,6 +790,7 @@ public class Q230_TestOfTheSummoner extends Quest
st.giveItems(CRYSTAL_OF_DEFEAT_6, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q231_TestOfTheMaestro/Q231_TestOfTheMaestro.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q231_TestOfTheMaestro/Q231_TestOfTheMaestro.java
index ed41e38f3a..fc4f258011 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q231_TestOfTheMaestro/Q231_TestOfTheMaestro.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q231_TestOfTheMaestro/Q231_TestOfTheMaestro.java
@@ -28,6 +28,24 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q231_TestOfTheMaestro extends Quest
{
+ // NPCs
+ private static final int LOCKIRIN = 30531;
+ private static final int SPIRON = 30532;
+ private static final int BALANKI = 30533;
+ private static final int KEEF = 30534;
+ private static final int FILAUR = 30535;
+ private static final int ARIN = 30536;
+ private static final int TOMA = 30556;
+ private static final int CROTO = 30671;
+ private static final int DUBABAH = 30672;
+ private static final int LORAIN = 30673;
+ // Monsters
+ private static final int KING_BUGBEAR = 20150;
+ private static final int GIANT_MIST_LEECH = 20225;
+ private static final int STINGER_WASP = 20229;
+ private static final int MARSH_SPIDER = 20233;
+ private static final int EVIL_EYE_LORD = 27133;
+ // Items
private static final int RECOMMENDATION_OF_BALANKI = 2864;
private static final int RECOMMENDATION_OF_FILAUR = 2865;
private static final int RECOMMENDATION_OF_ARIN = 2866;
@@ -43,39 +61,16 @@ public class Q231_TestOfTheMaestro extends Quest
private static final int MARSH_SPIDER_WEB = 2877;
private static final int BLOOD_OF_LEECH = 2878;
private static final int BROKEN_TELEPORT_DEVICE = 2916;
-
// Rewards
private static final int MARK_OF_MAESTRO = 2867;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int LOCKIRIN = 30531;
- private static final int SPIRON = 30532;
- private static final int BALANKI = 30533;
- private static final int KEEF = 30534;
- private static final int FILAUR = 30535;
- private static final int ARIN = 30536;
- private static final int TOMA = 30556;
- private static final int CROTO = 30671;
- private static final int DUBABAH = 30672;
- private static final int LORAIN = 30673;
-
- // Monsters
- private static final int KING_BUGBEAR = 20150;
- private static final int GIANT_MIST_LEECH = 20225;
- private static final int STINGER_WASP = 20229;
- private static final int MARSH_SPIDER = 20233;
- private static final int EVIL_EYE_LORD = 27133;
-
public Q231_TestOfTheMaestro()
{
super(231, "Test of the Maestro");
-
registerQuestItems(RECOMMENDATION_OF_BALANKI, RECOMMENDATION_OF_FILAUR, RECOMMENDATION_OF_ARIN, LETTER_OF_SOLDER_DETACHMENT, PAINT_OF_KAMURU, NECKLACE_OF_KAMURU, PAINT_OF_TELEPORT_DEVICE, TELEPORT_DEVICE, ARCHITECTURE_OF_KRUMA, REPORT_OF_KRUMA, INGREDIENTS_OF_ANTIDOTE, STINGER_WASP_NEEDLE, MARSH_SPIDER_WEB, BLOOD_OF_LEECH, BROKEN_TELEPORT_DEVICE);
-
addStartNpc(LOCKIRIN);
addTalkId(LOCKIRIN, SPIRON, BALANKI, KEEF, FILAUR, ARIN, TOMA, CROTO, DUBABAH, LORAIN);
-
addKillId(GIANT_MIST_LEECH, STINGER_WASP, MARSH_SPIDER, EVIL_EYE_LORD);
}
@@ -89,66 +84,63 @@ public class Q231_TestOfTheMaestro extends Quest
return htmltext;
}
- // LOCKIRIN
- if (event.equals("30531-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30531-04.htm":
{
- htmltext = "30531-04a.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30531-04a.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
+ }
+ case "30533-02.htm":
+ {
+ st.set("bCond", "1");
+ break;
+ }
+ case "30671-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(PAINT_OF_KAMURU, 1);
+ break;
+ }
+ case "30556-05.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(PAINT_OF_TELEPORT_DEVICE, 1);
+ st.giveItems(BROKEN_TELEPORT_DEVICE, 1);
+ player.teleToLocation(140352, -194133, -3146);
+ startQuestTimer("spawn_bugbears", 5000, null, player, false);
+ break;
+ }
+ case "30673-04.htm":
+ {
+ st.set("fCond", "2");
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BLOOD_OF_LEECH, -1);
+ st.takeItems(INGREDIENTS_OF_ANTIDOTE, 1);
+ st.takeItems(MARSH_SPIDER_WEB, -1);
+ st.takeItems(STINGER_WASP_NEEDLE, -1);
+ st.giveItems(REPORT_OF_KRUMA, 1);
+ break;
+ }
+ case "spawn_bugbears":
+ {
+ final Attackable bugbear1 = (Attackable) addSpawn(KING_BUGBEAR, 140333, -194153, -3138, 0, false, 200000);
+ bugbear1.addDamageHate(player, 0, 999);
+ bugbear1.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
+ final Attackable bugbear2 = (Attackable) addSpawn(KING_BUGBEAR, 140395, -194147, -3146, 0, false, 200000);
+ bugbear2.addDamageHate(player, 0, 999);
+ bugbear2.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
+ final Attackable bugbear3 = (Attackable) addSpawn(KING_BUGBEAR, 140304, -194082, -3157, 0, false, 200000);
+ bugbear3.addDamageHate(player, 0, 999);
+ bugbear3.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
+ return null;
}
- }
- // BALANKI
- else if (event.equals("30533-02.htm"))
- {
- st.set("bCond", "1");
- }
- else if (event.equals("30671-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(PAINT_OF_KAMURU, 1);
- }
- // TOMA
- else if (event.equals("30556-05.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(PAINT_OF_TELEPORT_DEVICE, 1);
- st.giveItems(BROKEN_TELEPORT_DEVICE, 1);
- player.teleToLocation(140352, -194133, -3146);
- startQuestTimer("spawn_bugbears", 5000, null, player, false);
- }
- // LORAIN
- else if (event.equals("30673-04.htm"))
- {
- st.set("fCond", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BLOOD_OF_LEECH, -1);
- st.takeItems(INGREDIENTS_OF_ANTIDOTE, 1);
- st.takeItems(MARSH_SPIDER_WEB, -1);
- st.takeItems(STINGER_WASP_NEEDLE, -1);
- st.giveItems(REPORT_OF_KRUMA, 1);
- }
- // Spawns 3 King Bugbears
- else if (event.equals("spawn_bugbears"))
- {
- final Attackable bugbear1 = (Attackable) addSpawn(KING_BUGBEAR, 140333, -194153, -3138, 0, false, 200000);
- bugbear1.addDamageHate(player, 0, 999);
- bugbear1.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
-
- final Attackable bugbear2 = (Attackable) addSpawn(KING_BUGBEAR, 140395, -194147, -3146, 0, false, 200000);
- bugbear2.addDamageHate(player, 0, 999);
- bugbear2.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
-
- final Attackable bugbear3 = (Attackable) addSpawn(KING_BUGBEAR, 140304, -194082, -3157, 0, false, 200000);
- bugbear3.addDamageHate(player, 0, 999);
- bugbear3.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
-
- return null;
}
return htmltext;
@@ -167,6 +159,7 @@ public class Q231_TestOfTheMaestro extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId() != ClassId.ARTISAN)
{
htmltext = "30531-01.htm";
@@ -180,12 +173,14 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30531-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case LOCKIRIN:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30531-05.htm";
@@ -203,18 +198,20 @@ public class Q231_TestOfTheMaestro extends Quest
st.exitQuest(false);
}
break;
-
+ }
case SPIRON:
+ {
htmltext = "30532-01.htm";
break;
-
+ }
case KEEF:
+ {
htmltext = "30534-01.htm";
break;
-
- // Part 1
+ }
case BALANKI:
- int bCond = st.getInt("bCond");
+ {
+ final int bCond = st.getInt("bCond");
if (bCond == 0)
{
htmltext = "30533-01.htm";
@@ -232,7 +229,7 @@ public class Q231_TestOfTheMaestro extends Quest
if (st.hasQuestItems(RECOMMENDATION_OF_ARIN, RECOMMENDATION_OF_FILAUR))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -245,9 +242,10 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30533-05.htm";
}
break;
-
+ }
case CROTO:
- bCond = st.getInt("bCond");
+ {
+ final int bCond = st.getInt("bCond");
if (bCond == 1)
{
if (!st.hasQuestItems(PAINT_OF_KAMURU))
@@ -273,14 +271,15 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30671-05.htm";
}
break;
-
+ }
case DUBABAH:
+ {
htmltext = "30672-01.htm";
break;
-
- // Part 2
+ }
case ARIN:
- int aCond = st.getInt("aCond");
+ {
+ final int aCond = st.getInt("aCond");
if (aCond == 0)
{
htmltext = "30536-01.htm";
@@ -300,7 +299,7 @@ public class Q231_TestOfTheMaestro extends Quest
if (st.hasQuestItems(RECOMMENDATION_OF_BALANKI, RECOMMENDATION_OF_FILAUR))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -313,9 +312,10 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30536-04.htm";
}
break;
-
+ }
case TOMA:
- aCond = st.getInt("aCond");
+ {
+ final int aCond = st.getInt("aCond");
if (aCond == 1)
{
if (!st.hasQuestItems(BROKEN_TELEPORT_DEVICE))
@@ -336,10 +336,10 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30556-07.htm";
}
break;
-
- // Part 3
+ }
case FILAUR:
- int fCond = st.getInt("fCond");
+ {
+ final int fCond = st.getInt("fCond");
if (fCond == 0)
{
htmltext = "30535-01.htm";
@@ -360,7 +360,7 @@ public class Q231_TestOfTheMaestro extends Quest
if (st.hasQuestItems(RECOMMENDATION_OF_BALANKI, RECOMMENDATION_OF_ARIN))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -373,9 +373,10 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30535-04.htm";
}
break;
-
+ }
case LORAIN:
- fCond = st.getInt("fCond");
+ {
+ final int fCond = st.getInt("fCond");
if (fCond == 1)
{
if (!st.hasQuestItems(REPORT_OF_KRUMA))
@@ -402,12 +403,15 @@ public class Q231_TestOfTheMaestro extends Quest
htmltext = "30673-05.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -416,7 +420,7 @@ public class Q231_TestOfTheMaestro extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -425,32 +429,37 @@ public class Q231_TestOfTheMaestro extends Quest
switch (npc.getNpcId())
{
case GIANT_MIST_LEECH:
+ {
if (st.hasQuestItems(INGREDIENTS_OF_ANTIDOTE))
{
st.dropItemsAlways(BLOOD_OF_LEECH, 1, 10);
}
break;
-
+ }
case STINGER_WASP:
+ {
if (st.hasQuestItems(INGREDIENTS_OF_ANTIDOTE))
{
st.dropItemsAlways(STINGER_WASP_NEEDLE, 1, 10);
}
break;
-
+ }
case MARSH_SPIDER:
+ {
if (st.hasQuestItems(INGREDIENTS_OF_ANTIDOTE))
{
st.dropItemsAlways(MARSH_SPIDER_WEB, 1, 10);
}
break;
-
+ }
case EVIL_EYE_LORD:
+ {
if (st.hasQuestItems(PAINT_OF_KAMURU))
{
st.dropItemsAlways(NECKLACE_OF_KAMURU, 1, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q232_TestOfTheLord/Q232_TestOfTheLord.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q232_TestOfTheLord/Q232_TestOfTheLord.java
index e0825c47e7..2a66b64d96 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q232_TestOfTheLord/Q232_TestOfTheLord.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q232_TestOfTheLord/Q232_TestOfTheLord.java
@@ -40,7 +40,6 @@ public class Q232_TestOfTheLord extends Quest
private static final int CHIANTA = 30642;
private static final int FIRST_ORC = 30643;
private static final int ANCESTOR_MARTANKUS = 30649;
-
// Items
private static final int ORDEAL_NECKLACE = 3391;
private static final int VARKEES_CHARM = 3392;
@@ -69,22 +68,18 @@ public class Q232_TestOfTheLord extends Quest
private static final int RAGNA_CHIEF_NOTICE = 3415;
private static final int BONE_ARROW = 1341;
private static final int IMMORTAL_FLAME = 3416;
-
// Rewards
private static final int MARK_LORD = 3390;
private static final int DIMENSIONAL_DIAMOND = 7562;
-
+ // Misc
private static NpcInstance _firstOrc; // Used to avoid to spawn multiple instances.
public Q232_TestOfTheLord()
{
super(232, "Test of the Lord");
-
registerQuestItems(VARKEES_CHARM, TANTUS_CHARM, HATOS_CHARM, TAKUNA_CHARM, CHIANTA_CHARM, MANAKIAS_ORDERS, BREKA_ORC_FANG, MANAKIAS_AMULET, HUGE_ORC_FANG, SUMARIS_LETTER, URUTU_BLADE, TIMAK_ORC_SKULL, SWORD_INTO_SKULL, NERUGA_AXE_BLADE, AXE_OF_CEREMONY, MARSH_SPIDER_FEELER, MARSH_SPIDER_FEET, HANDIWORK_SPIDER_BROOCH, MONSTEREYE_CORNEA, MONSTEREYE_WOODCARVING, BEAR_FANG_NECKLACE, MARTANKUS_CHARM, RAGNA_ORC_HEAD, RAGNA_ORC_HEAD, IMMORTAL_FLAME);
-
addStartNpc(KAKAI);
addTalkId(KAKAI, CHIANTA, HATOS, SOMAK, SUMARI, TAKUNA, TANTUS, JAKAL, VARKEES, MANAKIA, ANCESTOR_MARTANKUS, FIRST_ORC);
-
addKillId(20233, 20269, 20270, 20564, 20583, 20584, 20585, 20586, 20587, 20588, 20778, 20779);
}
@@ -98,89 +93,101 @@ public class Q232_TestOfTheLord extends Quest
return htmltext;
}
- if (event.equals("30565-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDEAL_NECKLACE, 1);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30565-05.htm":
{
- htmltext = "30565-05b.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ st.giveItems(ORDEAL_NECKLACE, 1);
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30565-05b.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
}
- }
- else if (event.equals("30565-08.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SWORD_INTO_SKULL, 1);
- st.takeItems(AXE_OF_CEREMONY, 1);
- st.takeItems(MONSTEREYE_WOODCARVING, 1);
- st.takeItems(HANDIWORK_SPIDER_BROOCH, 1);
- st.takeItems(ORDEAL_NECKLACE, 1);
- st.takeItems(HUGE_ORC_FANG, 1);
- st.giveItems(BEAR_FANG_NECKLACE, 1);
- }
- else if (event.equals("30566-02.htm"))
- {
- st.giveItems(VARKEES_CHARM, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30567-02.htm"))
- {
- st.giveItems(TANTUS_CHARM, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30558-02.htm"))
- {
- st.takeItems(57, 1000);
- st.giveItems(NERUGA_AXE_BLADE, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30568-02.htm"))
- {
- st.giveItems(HATOS_CHARM, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30641-02.htm"))
- {
- st.giveItems(TAKUNA_CHARM, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30642-02.htm"))
- {
- st.giveItems(CHIANTA_CHARM, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30643-02.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- startQuestTimer("f_orc_despawn", 10000, null, player, false);
- }
- else if (event.equals("30649-04.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BEAR_FANG_NECKLACE, 1);
- st.giveItems(MARTANKUS_CHARM, 1);
- }
- else if (event.equals("30649-07.htm"))
- {
- if (_firstOrc == null)
+ case "30565-08.htm":
{
- _firstOrc = addSpawn(FIRST_ORC, 21036, -107690, -3038, 200000, false, 0);
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SWORD_INTO_SKULL, 1);
+ st.takeItems(AXE_OF_CEREMONY, 1);
+ st.takeItems(MONSTEREYE_WOODCARVING, 1);
+ st.takeItems(HANDIWORK_SPIDER_BROOCH, 1);
+ st.takeItems(ORDEAL_NECKLACE, 1);
+ st.takeItems(HUGE_ORC_FANG, 1);
+ st.giveItems(BEAR_FANG_NECKLACE, 1);
+ break;
}
- }
- else if (event.equals("f_orc_despawn"))
- {
- if (_firstOrc != null)
+ case "30566-02.htm":
{
- _firstOrc.deleteMe();
- _firstOrc = null;
+ st.giveItems(VARKEES_CHARM, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30567-02.htm":
+ {
+ st.giveItems(TANTUS_CHARM, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30558-02.htm":
+ {
+ st.takeItems(57, 1000);
+ st.giveItems(NERUGA_AXE_BLADE, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30568-02.htm":
+ {
+ st.giveItems(HATOS_CHARM, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30641-02.htm":
+ {
+ st.giveItems(TAKUNA_CHARM, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30642-02.htm":
+ {
+ st.giveItems(CHIANTA_CHARM, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30643-02.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ startQuestTimer("f_orc_despawn", 10000, null, player, false);
+ break;
+ }
+ case "30649-04.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BEAR_FANG_NECKLACE, 1);
+ st.giveItems(MARTANKUS_CHARM, 1);
+ break;
+ }
+ case "30649-07.htm":
+ {
+ if (_firstOrc == null)
+ {
+ _firstOrc = addSpawn(FIRST_ORC, 21036, -107690, -3038, 200000, false, 0);
+ }
+ break;
+ }
+ case "f_orc_despawn":
+ {
+ if (_firstOrc != null)
+ {
+ _firstOrc.deleteMe();
+ _firstOrc = null;
+ }
+ break;
}
}
@@ -200,6 +207,7 @@ public class Q232_TestOfTheLord extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30565-01.htm";
@@ -217,12 +225,14 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30565-04.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VARKEES:
+ {
if (st.hasQuestItems(HUGE_ORC_FANG))
{
htmltext = "30566-05.htm";
@@ -238,7 +248,7 @@ public class Q232_TestOfTheLord extends Quest
if (st.hasQuestItems(SWORD_INTO_SKULL, AXE_OF_CEREMONY, MONSTEREYE_WOODCARVING, HANDIWORK_SPIDER_BROOCH, ORDEAL_NECKLACE))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -256,8 +266,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30566-01.htm";
}
break;
-
+ }
case MANAKIA:
+ {
if (st.hasQuestItems(HUGE_ORC_FANG))
{
htmltext = "30515-05.htm";
@@ -288,8 +299,9 @@ public class Q232_TestOfTheLord extends Quest
st.playSound(QuestState.SOUND_ITEMGET);
}
break;
-
+ }
case TANTUS:
+ {
if (st.hasQuestItems(AXE_OF_CEREMONY))
{
htmltext = "30567-05.htm";
@@ -306,7 +318,7 @@ public class Q232_TestOfTheLord extends Quest
if (st.hasQuestItems(SWORD_INTO_SKULL, MONSTEREYE_WOODCARVING, HANDIWORK_SPIDER_BROOCH, ORDEAL_NECKLACE, HUGE_ORC_FANG))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -324,8 +336,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30567-01.htm";
}
break;
-
+ }
case JAKAL:
+ {
if (st.hasQuestItems(AXE_OF_CEREMONY))
{
htmltext = "30558-05.htm";
@@ -346,8 +359,9 @@ public class Q232_TestOfTheLord extends Quest
}
}
break;
-
+ }
case HATOS:
+ {
if (st.hasQuestItems(SWORD_INTO_SKULL))
{
htmltext = "30568-05.htm";
@@ -364,7 +378,7 @@ public class Q232_TestOfTheLord extends Quest
if (st.hasQuestItems(AXE_OF_CEREMONY, MONSTEREYE_WOODCARVING, HANDIWORK_SPIDER_BROOCH, ORDEAL_NECKLACE, HUGE_ORC_FANG))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -382,8 +396,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30568-01.htm";
}
break;
-
+ }
case SUMARI:
+ {
if (st.hasQuestItems(URUTU_BLADE))
{
htmltext = "30564-03.htm";
@@ -399,8 +414,9 @@ public class Q232_TestOfTheLord extends Quest
st.playSound(QuestState.SOUND_ITEMGET);
}
break;
-
+ }
case SOMAK:
+ {
if (st.hasQuestItems(SWORD_INTO_SKULL))
{
htmltext = "30510-03.htm";
@@ -417,8 +433,9 @@ public class Q232_TestOfTheLord extends Quest
st.playSound(QuestState.SOUND_ITEMGET);
}
break;
-
+ }
case TAKUNA:
+ {
if (st.hasQuestItems(HANDIWORK_SPIDER_BROOCH))
{
htmltext = "30641-05.htm";
@@ -435,7 +452,7 @@ public class Q232_TestOfTheLord extends Quest
if (st.hasQuestItems(SWORD_INTO_SKULL, AXE_OF_CEREMONY, MONSTEREYE_WOODCARVING, ORDEAL_NECKLACE, HUGE_ORC_FANG))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -453,8 +470,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30641-01.htm";
}
break;
-
+ }
case CHIANTA:
+ {
if (st.hasQuestItems(MONSTEREYE_WOODCARVING))
{
htmltext = "30642-05.htm";
@@ -470,7 +488,7 @@ public class Q232_TestOfTheLord extends Quest
if (st.hasQuestItems(SWORD_INTO_SKULL, AXE_OF_CEREMONY, HANDIWORK_SPIDER_BROOCH, ORDEAL_NECKLACE, HUGE_ORC_FANG))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -488,8 +506,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30642-01.htm";
}
break;
-
+ }
case KAKAI:
+ {
if (cond == 1)
{
htmltext = "30565-06.htm";
@@ -518,8 +537,9 @@ public class Q232_TestOfTheLord extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ANCESTOR_MARTANKUS:
+ {
if (cond == 3)
{
htmltext = "30649-01.htm";
@@ -531,7 +551,7 @@ public class Q232_TestOfTheLord extends Quest
else if (cond == 5)
{
htmltext = "30649-06.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MARTANKUS_CHARM, 1);
@@ -548,8 +568,9 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30649-08.htm";
}
break;
-
+ }
case FIRST_ORC:
+ {
if (cond == 6)
{
htmltext = "30643-01.htm";
@@ -559,12 +580,15 @@ public class Q232_TestOfTheLord extends Quest
htmltext = "30643-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -582,59 +606,67 @@ public class Q232_TestOfTheLord extends Quest
switch (npc.getNpcId())
{
case 20564:
+ {
if (st.hasQuestItems(CHIANTA_CHARM))
{
st.dropItemsAlways(MONSTEREYE_CORNEA, 1, 20);
}
break;
-
+ }
case 20583:
case 20584:
case 20585:
+ {
if (st.hasQuestItems(HATOS_CHARM))
{
st.dropItems(TIMAK_ORC_SKULL, 1, 10, 710000);
}
break;
-
+ }
case 20586:
+ {
if (st.hasQuestItems(HATOS_CHARM))
{
st.dropItems(TIMAK_ORC_SKULL, 1, 10, 810000);
}
break;
-
+ }
case 20587:
case 20588:
+ {
if (st.hasQuestItems(HATOS_CHARM))
{
st.dropItemsAlways(TIMAK_ORC_SKULL, 1, 10);
}
break;
-
+ }
case 20233:
+ {
if (st.hasQuestItems(TAKUNA_CHARM))
{
st.dropItemsAlways((st.getQuestItemsCount(MARSH_SPIDER_FEELER) >= 10) ? MARSH_SPIDER_FEET : MARSH_SPIDER_FEELER, 1, 10);
}
break;
-
+ }
case 20269:
+ {
if (st.hasQuestItems(MANAKIAS_ORDERS))
{
st.dropItems(BREKA_ORC_FANG, 1, 20, 410000);
}
break;
-
+ }
case 20270:
+ {
if (st.hasQuestItems(MANAKIAS_ORDERS))
{
st.dropItems(BREKA_ORC_FANG, 1, 20, 510000);
}
break;
-
+ }
case 20778:
case 20779:
+ {
if (st.hasQuestItems(MARTANKUS_CHARM))
{
if (!st.hasQuestItems(RAGNA_CHIEF_NOTICE))
@@ -644,12 +676,13 @@ public class Q232_TestOfTheLord extends Quest
}
else if (!st.hasQuestItems(RAGNA_ORC_HEAD))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(RAGNA_ORC_HEAD, 1);
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q233_TestOfTheWarSpirit/Q233_TestOfTheWarSpirit.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q233_TestOfTheWarSpirit/Q233_TestOfTheWarSpirit.java
index 0ba374d1a9..8cdf59b75d 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q233_TestOfTheWarSpirit/Q233_TestOfTheWarSpirit.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q233_TestOfTheWarSpirit/Q233_TestOfTheWarSpirit.java
@@ -28,6 +28,27 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q233_TestOfTheWarSpirit extends Quest
{
+ // NPCs
+ private static final int VIVYAN = 30030;
+ private static final int SARIEN = 30436;
+ private static final int RACOY = 30507;
+ private static final int SOMAK = 30510;
+ private static final int MANAKIA = 30515;
+ private static final int ORIM = 30630;
+ private static final int ANCESTOR_MARTANKUS = 30649;
+ private static final int PEKIRON = 30682;
+ // Monsters
+ private static final int NOBLE_ANT = 20089;
+ private static final int NOBLE_ANT_LEADER = 20090;
+ private static final int MEDUSA = 20158;
+ private static final int PORTA = 20213;
+ private static final int EXCURO = 20214;
+ private static final int MORDEO = 20215;
+ private static final int LETO_LIZARDMAN_SHAMAN = 20581;
+ private static final int LETO_LIZARDMAN_OVERLORD = 20582;
+ private static final int TAMLIN_ORC = 20601;
+ private static final int TAMLIN_ORC_ARCHER = 20602;
+ private static final int STENOA_GORGON_QUEEN = 27108;
// Items
private static final int VENDETTA_TOTEM = 2880;
private static final int TAMLIN_ORC_HEAD = 2881;
@@ -64,40 +85,14 @@ public class Q233_TestOfTheWarSpirit extends Quest
private static final int TONAR_REMAINS_2 = 2912;
private static final int HERMODT_REMAINS_2 = 2913;
private static final int KIRUNA_REMAINS_2 = 2914;
-
// Rewards
private static final int MARK_OF_WARSPIRIT = 2879;
private static final int DIMENSIONAL_DIAMOND = 7562;
- // NPCs
- private static final int VIVYAN = 30030;
- private static final int SARIEN = 30436;
- private static final int RACOY = 30507;
- private static final int SOMAK = 30510;
- private static final int MANAKIA = 30515;
- private static final int ORIM = 30630;
- private static final int ANCESTOR_MARTANKUS = 30649;
- private static final int PEKIRON = 30682;
-
- // Monsters
- private static final int NOBLE_ANT = 20089;
- private static final int NOBLE_ANT_LEADER = 20090;
- private static final int MEDUSA = 20158;
- private static final int PORTA = 20213;
- private static final int EXCURO = 20214;
- private static final int MORDEO = 20215;
- private static final int LETO_LIZARDMAN_SHAMAN = 20581;
- private static final int LETO_LIZARDMAN_OVERLORD = 20582;
- private static final int TAMLIN_ORC = 20601;
- private static final int TAMLIN_ORC_ARCHER = 20602;
- private static final int STENOA_GORGON_QUEEN = 27108;
-
public Q233_TestOfTheWarSpirit()
{
super(233, "Test of the War Spirit");
-
registerQuestItems(VENDETTA_TOTEM, TAMLIN_ORC_HEAD, WARSPIRIT_TOTEM, ORIM_CONTRACT, PORTA_EYE, EXCURO_SCALE, MORDEO_TALON, BRAKI_REMAINS_1, PEKIRON_TOTEM, TONAR_SKULL, TONAR_RIBBONE, TONAR_SPINE, TONAR_ARMBONE, TONAR_THIGHBONE, TONAR_REMAINS_1, MANAKIA_TOTEM, HERMODT_SKULL, HERMODT_RIBBONE, HERMODT_SPINE, HERMODT_ARMBONE, HERMODT_THIGHBONE, HERMODT_REMAINS_1, RACOY_TOTEM, VIVYAN_LETTER, INSECT_DIAGRAM_BOOK, KIRUNA_SKULL, KIRUNA_RIBBONE, KIRUNA_SPINE, KIRUNA_ARMBONE, KIRUNA_THIGHBONE, KIRUNA_REMAINS_1, BRAKI_REMAINS_2, TONAR_REMAINS_2, HERMODT_REMAINS_2, KIRUNA_REMAINS_2);
-
addStartNpc(SOMAK);
addTalkId(SOMAK, VIVYAN, SARIEN, RACOY, MANAKIA, ORIM, ANCESTOR_MARTANKUS, PEKIRON);
addKillId(NOBLE_ANT, NOBLE_ANT_LEADER, MEDUSA, PORTA, EXCURO, MORDEO, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, TAMLIN_ORC, TAMLIN_ORC_ARCHER, STENOA_GORGON_QUEEN);
@@ -113,64 +108,64 @@ public class Q233_TestOfTheWarSpirit extends Quest
return htmltext;
}
- // SOMAK
- if (event.equals("30510-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
- if (!player.getVariables().getBoolean("secondClassChange39", false))
+ case "30510-05.htm":
{
- htmltext = "30510-05e.htm";
- st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
- player.getVariables().set("secondClassChange39", true);
+ st.startQuest();
+ if (!player.getVariables().getBoolean("secondClassChange39", false))
+ {
+ htmltext = "30510-05e.htm";
+ st.giveItems(DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getClassId().getId()));
+ player.getVariables().set("secondClassChange39", true);
+ }
+ break;
+ }
+ case "30630-04.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(ORIM_CONTRACT, 1);
+ break;
+ }
+ case "30507-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(RACOY_TOTEM, 1);
+ break;
+ }
+ case "30030-04.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(VIVYAN_LETTER, 1);
+ break;
+ }
+ case "30682-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(PEKIRON_TOTEM, 1);
+ break;
+ }
+ case "30515-02.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(MANAKIA_TOTEM, 1);
+ break;
+ }
+ case "30649-03.htm":
+ {
+ st.takeItems(TAMLIN_ORC_HEAD, -1);
+ st.takeItems(WARSPIRIT_TOTEM, -1);
+ st.takeItems(BRAKI_REMAINS_2, -1);
+ st.takeItems(HERMODT_REMAINS_2, -1);
+ st.takeItems(KIRUNA_REMAINS_2, -1);
+ st.takeItems(TONAR_REMAINS_2, -1);
+ st.giveItems(MARK_OF_WARSPIRIT, 1);
+ st.rewardExpAndSp(63483, 17500);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
}
- }
- // ORIM
- else if (event.equals("30630-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(ORIM_CONTRACT, 1);
- }
- // RACOY
- else if (event.equals("30507-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(RACOY_TOTEM, 1);
- }
- // VIVYAN
- else if (event.equals("30030-04.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(VIVYAN_LETTER, 1);
- }
- // PEKIRON
- else if (event.equals("30682-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(PEKIRON_TOTEM, 1);
- }
- // MANAKIA
- else if (event.equals("30515-02.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(MANAKIA_TOTEM, 1);
- }
- // ANCESTOR MARTANKUS
- else if (event.equals("30649-03.htm"))
- {
- st.takeItems(TAMLIN_ORC_HEAD, -1);
- st.takeItems(WARSPIRIT_TOTEM, -1);
- st.takeItems(BRAKI_REMAINS_2, -1);
- st.takeItems(HERMODT_REMAINS_2, -1);
- st.takeItems(KIRUNA_REMAINS_2, -1);
- st.takeItems(TONAR_REMAINS_2, -1);
- st.giveItems(MARK_OF_WARSPIRIT, 1);
- st.rewardExpAndSp(63483, 17500);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
}
return htmltext;
@@ -189,6 +184,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId() == ClassId.ORC_SHAMAN)
{
htmltext = (player.getLevel() < 39) ? "30510-03.htm" : "30510-04.htm";
@@ -198,12 +194,14 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = (player.getRace() == Race.ORC) ? "30510-02.htm" : "30510-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SOMAK:
+ {
if (cond == 1)
{
htmltext = "30510-06.htm";
@@ -211,7 +209,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
else if (cond == 2)
{
htmltext = "30510-07.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BRAKI_REMAINS_1, 1);
st.takeItems(HERMODT_REMAINS_1, 1);
@@ -226,7 +224,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
else if (cond == 4)
{
htmltext = "30510-09.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(VENDETTA_TOTEM, 1);
st.giveItems(BRAKI_REMAINS_2, 1);
@@ -240,8 +238,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30510-10.htm";
}
break;
-
+ }
case ORIM:
+ {
if ((cond == 1) && !st.hasQuestItems(BRAKI_REMAINS_1))
{
if (!st.hasQuestItems(ORIM_CONTRACT))
@@ -259,7 +258,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
if (st.hasQuestItems(HERMODT_REMAINS_1, KIRUNA_REMAINS_1, TONAR_REMAINS_1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -277,8 +276,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30630-07.htm";
}
break;
-
+ }
case RACOY:
+ {
if ((cond == 1) && !st.hasQuestItems(KIRUNA_REMAINS_1))
{
if (!st.hasQuestItems(RACOY_TOTEM))
@@ -305,7 +305,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
if (st.hasQuestItems(BRAKI_REMAINS_1, HERMODT_REMAINS_1, TONAR_REMAINS_1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -328,8 +328,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30507-07.htm";
}
break;
-
+ }
case VIVYAN:
+ {
if ((cond == 1) && st.hasQuestItems(RACOY_TOTEM))
{
if (st.hasQuestItems(VIVYAN_LETTER))
@@ -350,8 +351,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30030-07.htm";
}
break;
-
+ }
case SARIEN:
+ {
if ((cond == 1) && st.hasQuestItems(RACOY_TOTEM))
{
if (st.hasQuestItems(VIVYAN_LETTER))
@@ -371,8 +373,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30436-03.htm";
}
break;
-
+ }
case PEKIRON:
+ {
if ((cond == 1) && !st.hasQuestItems(TONAR_REMAINS_1))
{
if (!st.hasQuestItems(PEKIRON_TOTEM))
@@ -392,7 +395,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
if (st.hasQuestItems(BRAKI_REMAINS_1, HERMODT_REMAINS_1, KIRUNA_REMAINS_1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -410,8 +413,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30682-05.htm";
}
break;
-
+ }
case MANAKIA:
+ {
if ((cond == 1) && !st.hasQuestItems(HERMODT_REMAINS_1))
{
if (!st.hasQuestItems(MANAKIA_TOTEM))
@@ -431,7 +435,7 @@ public class Q233_TestOfTheWarSpirit extends Quest
if (st.hasQuestItems(BRAKI_REMAINS_1, KIRUNA_REMAINS_1, TONAR_REMAINS_1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -449,19 +453,23 @@ public class Q233_TestOfTheWarSpirit extends Quest
htmltext = "30515-05.htm";
}
break;
-
+ }
case ANCESTOR_MARTANKUS:
+ {
if (cond == 5)
{
htmltext = "30649-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -479,28 +487,32 @@ public class Q233_TestOfTheWarSpirit extends Quest
switch (npc.getNpcId())
{
case PORTA:
+ {
if (st.hasQuestItems(ORIM_CONTRACT))
{
st.dropItemsAlways(PORTA_EYE, 1, 10);
}
break;
-
+ }
case EXCURO:
+ {
if (st.hasQuestItems(ORIM_CONTRACT))
{
st.dropItemsAlways(EXCURO_SCALE, 1, 10);
}
break;
-
+ }
case MORDEO:
+ {
if (st.hasQuestItems(ORIM_CONTRACT))
{
st.dropItemsAlways(MORDEO_TALON, 1, 10);
}
break;
-
+ }
case NOBLE_ANT:
case NOBLE_ANT_LEADER:
+ {
if (st.hasQuestItems(INSECT_DIAGRAM_BOOK))
{
final int rndAnt = Rnd.get(100);
@@ -532,9 +544,10 @@ public class Q233_TestOfTheWarSpirit extends Quest
}
}
break;
-
+ }
case LETO_LIZARDMAN_SHAMAN:
case LETO_LIZARDMAN_OVERLORD:
+ {
if (st.hasQuestItems(PEKIRON_TOTEM) && Rnd.nextBoolean())
{
if (!st.hasQuestItems(TONAR_SKULL))
@@ -559,8 +572,9 @@ public class Q233_TestOfTheWarSpirit extends Quest
}
}
break;
-
+ }
case MEDUSA:
+ {
if (st.hasQuestItems(MANAKIA_TOTEM) && Rnd.nextBoolean())
{
if (!st.hasQuestItems(HERMODT_RIBBONE))
@@ -581,21 +595,24 @@ public class Q233_TestOfTheWarSpirit extends Quest
}
}
break;
-
+ }
case STENOA_GORGON_QUEEN:
+ {
if (st.hasQuestItems(MANAKIA_TOTEM))
{
st.dropItemsAlways(HERMODT_SKULL, 1, 1);
}
break;
-
+ }
case TAMLIN_ORC:
case TAMLIN_ORC_ARCHER:
+ {
if (st.hasQuestItems(VENDETTA_TOTEM) && st.dropItems(TAMLIN_ORC_HEAD, 1, 13, 500000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q234_FatesWhisper/Q234_FatesWhisper.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q234_FatesWhisper/Q234_FatesWhisper.java
index 7641b90a71..1f2db3c5d5 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q234_FatesWhisper/Q234_FatesWhisper.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q234_FatesWhisper/Q234_FatesWhisper.java
@@ -34,19 +34,14 @@ public class Q234_FatesWhisper extends Quest
private static final int KERMON_INFERNIUM_SCEPTER = 4667;
private static final int GOLKONDA_INFERNIUM_SCEPTER = 4668;
private static final int HALLATE_INFERNIUM_SCEPTER = 4669;
-
private static final int INFERNIUM_VARNISH = 4672;
private static final int REORIN_HAMMER = 4670;
private static final int REORIN_MOLD = 4671;
-
private static final int PIPETTE_KNIFE = 4665;
private static final int RED_PIPETTE_KNIFE = 4673;
-
private static final int CRYSTAL_B = 1460;
-
// Reward
private static final int STAR_OF_DESTINY = 5011;
-
// Chest Spawn
private static final Map CHEST_SPAWN = new HashMap<>();
static
@@ -56,7 +51,6 @@ public class Q234_FatesWhisper extends Quest
CHEST_SPAWN.put(25126, 31029);
CHEST_SPAWN.put(25220, 31030);
}
-
// Weapons
private static final Map WEAPONS = new HashMap<>();
static
@@ -79,15 +73,11 @@ public class Q234_FatesWhisper extends Quest
public Q234_FatesWhisper()
{
super(234, "Fate's Whisper");
-
registerQuestItems(PIPETTE_KNIFE, RED_PIPETTE_KNIFE);
-
addStartNpc(31002);
addTalkId(31002, 30182, 30847, 30178, 30833, 31028, 31029, 31030, 31027);
-
// The 4 bosses which spawn chests
addKillId(25035, 25054, 25126, 25220);
-
// Baium
addAttackId(29020);
}
@@ -104,9 +94,7 @@ public class Q234_FatesWhisper extends Quest
if (event.equals("31002-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30182-01c.htm"))
{
@@ -115,12 +103,12 @@ public class Q234_FatesWhisper extends Quest
}
else if (event.equals("30178-01a.htm"))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (event.equals("30833-01b.htm"))
{
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(PIPETTE_KNIFE, 1);
}
@@ -183,14 +171,17 @@ public class Q234_FatesWhisper extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 75) ? "31002-01.htm" : "31002-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case 31002:
+ {
if (cond == 1)
{
if (!st.hasQuestItems(REIRIA_SOUL_ORB))
@@ -200,7 +191,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "31002-05.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REIRIA_SOUL_ORB, 1);
}
@@ -214,7 +205,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "31002-06.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GOLKONDA_INFERNIUM_SCEPTER, 1);
st.takeItems(HALLATE_INFERNIUM_SCEPTER, 1);
@@ -230,7 +221,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "31002-07.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(INFERNIUM_VARNISH, 1);
}
@@ -244,7 +235,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "31002-08.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REORIN_HAMMER, 1);
}
@@ -256,7 +247,7 @@ public class Q234_FatesWhisper extends Quest
else if (cond == 8)
{
htmltext = "31002-09.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REORIN_MOLD, 1);
}
@@ -269,7 +260,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "31002-BGradeList.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CRYSTAL_B, 984);
}
@@ -290,15 +281,17 @@ public class Q234_FatesWhisper extends Quest
}
}
break;
-
+ }
case 30182:
+ {
if (cond == 3)
{
htmltext = (!st.hasQuestItems(INFERNIUM_VARNISH)) ? "30182-01.htm" : "30182-02.htm";
}
break;
-
+ }
case 30847:
+ {
if ((cond == 4) && !st.hasQuestItems(REORIN_HAMMER))
{
htmltext = "30847-01.htm";
@@ -310,8 +303,9 @@ public class Q234_FatesWhisper extends Quest
htmltext = "30847-02.htm";
}
break;
-
+ }
case 30178:
+ {
if (cond == 5)
{
htmltext = "30178-01.htm";
@@ -321,8 +315,9 @@ public class Q234_FatesWhisper extends Quest
htmltext = "30178-02.htm";
}
break;
-
+ }
case 30833:
+ {
if (cond == 6)
{
htmltext = "30833-01.htm";
@@ -336,7 +331,7 @@ public class Q234_FatesWhisper extends Quest
else
{
htmltext = "30833-03.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RED_PIPETTE_KNIFE, 1);
st.giveItems(REORIN_MOLD, 1);
@@ -347,8 +342,9 @@ public class Q234_FatesWhisper extends Quest
htmltext = "30833-04.htm";
}
break;
-
+ }
case 31027:
+ {
if ((cond == 1) && !st.hasQuestItems(REIRIA_SOUL_ORB))
{
htmltext = "31027-01.htm";
@@ -360,10 +356,11 @@ public class Q234_FatesWhisper extends Quest
htmltext = "31027-02.htm";
}
break;
-
+ }
case 31028:
case 31029:
case 31030:
+ {
final int itemId = npc.getNpcId() - 26361;
if ((cond == 2) && !st.hasQuestItems(itemId))
{
@@ -376,12 +373,15 @@ public class Q234_FatesWhisper extends Quest
htmltext = npc.getNpcId() + "-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -390,7 +390,7 @@ public class Q234_FatesWhisper extends Quest
@Override
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
{
- final QuestState st = checkPlayerCondition(attacker, npc, "cond", "7");
+ final QuestState st = checkPlayerCondition(attacker, npc, 7);
if (st == null)
{
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q235_MimirsElixir/Q235_MimirsElixir.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q235_MimirsElixir/Q235_MimirsElixir.java
index 7c691dfe3a..f16a8d0ea8 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q235_MimirsElixir/Q235_MimirsElixir.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q235_MimirsElixir/Q235_MimirsElixir.java
@@ -26,6 +26,10 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q235_MimirsElixir extends Quest
{
+ // NPCs
+ private static final int JOAN = 30718;
+ private static final int LADD = 30721;
+ private static final int MIXING_URN = 31149;
// Items
private static final int STAR_OF_DESTINY = 5011;
private static final int PURE_SILVER = 6320;
@@ -34,24 +38,15 @@ public class Q235_MimirsElixir extends Quest
private static final int BLOOD_FIRE = 6318;
private static final int MIMIR_ELIXIR = 6319;
private static final int MAGISTER_MIXING_STONE = 5905;
-
// Reward
private static final int SCROLL_ENCHANT_WEAPON_A = 729;
- // NPCs
- private static final int JOAN = 30718;
- private static final int LADD = 30721;
- private static final int MIXING_URN = 31149;
-
public Q235_MimirsElixir()
{
super(235, "Mimir's Elixir");
-
registerQuestItems(PURE_SILVER, TRUE_GOLD, SAGE_STONE, BLOOD_FIRE, MAGISTER_MIXING_STONE, MIMIR_ELIXIR);
-
addStartNpc(LADD);
addTalkId(LADD, JOAN, MIXING_URN);
-
addKillId(20965, 21090);
}
@@ -65,76 +60,92 @@ public class Q235_MimirsElixir extends Quest
return htmltext;
}
- if (event.equals("30721-06.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30721-12.htm") && st.hasQuestItems(TRUE_GOLD))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(MAGISTER_MIXING_STONE, 1);
- }
- else if (event.equals("30721-16.htm") && st.hasQuestItems(MIMIR_ELIXIR))
- {
- player.broadcastPacket(new MagicSkillUse(player, player, 4339, 1, 1, 1));
- st.takeItems(MAGISTER_MIXING_STONE, -1);
- st.takeItems(MIMIR_ELIXIR, -1);
- st.takeItems(STAR_OF_DESTINY, -1);
- st.giveItems(SCROLL_ENCHANT_WEAPON_A, 1);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else if (event.equals("30718-03.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31149-02.htm"))
- {
- if (!st.hasQuestItems(MAGISTER_MIXING_STONE))
+ case "30721-06.htm":
{
- htmltext = "31149-havent.htm";
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("31149-03.htm"))
- {
- if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER))
+ case "30721-12.htm":
{
- htmltext = "31149-havent.htm";
+ if (st.hasQuestItems(TRUE_GOLD))
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(MAGISTER_MIXING_STONE, 1);
+ }
+ break;
}
- }
- else if (event.equals("31149-05.htm"))
- {
- if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD))
+ case "30721-16.htm":
{
- htmltext = "31149-havent.htm";
+ if (st.hasQuestItems(MIMIR_ELIXIR))
+ {
+ player.broadcastPacket(new MagicSkillUse(player, player, 4339, 1, 1, 1));
+ st.takeItems(MAGISTER_MIXING_STONE, -1);
+ st.takeItems(MIMIR_ELIXIR, -1);
+ st.takeItems(STAR_OF_DESTINY, -1);
+ st.giveItems(SCROLL_ENCHANT_WEAPON_A, 1);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ break;
}
- }
- else if (event.equals("31149-07.htm"))
- {
- if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD, BLOOD_FIRE))
+ case "30718-03.htm":
{
- htmltext = "31149-havent.htm";
- }
- }
- else if (event.equals("31149-success.htm"))
- {
- if (st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD, BLOOD_FIRE))
- {
- st.set("cond", "8");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PURE_SILVER, -1);
- st.takeItems(TRUE_GOLD, -1);
- st.takeItems(BLOOD_FIRE, -1);
- st.giveItems(MIMIR_ELIXIR, 1);
+ break;
}
- else
+ case "31149-02.htm":
{
- htmltext = "31149-havent.htm";
+ if (!st.hasQuestItems(MAGISTER_MIXING_STONE))
+ {
+ htmltext = "31149-havent.htm";
+ }
+ break;
+ }
+ case "31149-03.htm":
+ {
+ if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER))
+ {
+ htmltext = "31149-havent.htm";
+ }
+ break;
+ }
+ case "31149-05.htm":
+ {
+ if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD))
+ {
+ htmltext = "31149-havent.htm";
+ }
+ break;
+ }
+ case "31149-07.htm":
+ {
+ if (!st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD, BLOOD_FIRE))
+ {
+ htmltext = "31149-havent.htm";
+ }
+ break;
+ }
+ case "31149-success.htm":
+ {
+ if (st.hasQuestItems(MAGISTER_MIXING_STONE, PURE_SILVER, TRUE_GOLD, BLOOD_FIRE))
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PURE_SILVER, -1);
+ st.takeItems(TRUE_GOLD, -1);
+ st.takeItems(BLOOD_FIRE, -1);
+ st.giveItems(MIMIR_ELIXIR, 1);
+ }
+ else
+ {
+ htmltext = "31149-havent.htm";
+ }
+ break;
}
}
@@ -154,6 +165,7 @@ public class Q235_MimirsElixir extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 75)
{
htmltext = "30721-01b.htm";
@@ -167,18 +179,20 @@ public class Q235_MimirsElixir extends Quest
htmltext = "30721-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LADD:
+ {
if (cond == 1)
{
if (st.hasQuestItems(PURE_SILVER))
{
htmltext = "30721-08.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -203,8 +217,9 @@ public class Q235_MimirsElixir extends Quest
htmltext = "30721-14.htm";
}
break;
-
+ }
case JOAN:
+ {
if (cond == 2)
{
htmltext = "30718-01.htm";
@@ -216,7 +231,7 @@ public class Q235_MimirsElixir extends Quest
else if ((cond == 4) && st.hasQuestItems(SAGE_STONE))
{
htmltext = "30718-05.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SAGE_STONE, -1);
st.giveItems(TRUE_GOLD, 1);
@@ -226,17 +241,21 @@ public class Q235_MimirsElixir extends Quest
htmltext = "30718-06.htm";
}
break;
-
+ }
// The urn gives the same first htm. Bypasses' events will do all the job.
case MIXING_URN:
+ {
htmltext = "31149-01.htm";
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -254,18 +273,21 @@ public class Q235_MimirsElixir extends Quest
switch (npc.getNpcId())
{
case 20965:
- if ((st.getInt("cond") == 3) && st.dropItems(SAGE_STONE, 1, 1, 200000))
+ {
+ if (st.isCond(3) && st.dropItems(SAGE_STONE, 1, 1, 200000))
{
- st.set("cond", "4");
+ st.setCond(4);
}
break;
-
+ }
case 21090:
- if ((st.getInt("cond") == 6) && st.dropItems(BLOOD_FIRE, 1, 1, 200000))
+ {
+ if (st.isCond(6) && st.dropItems(BLOOD_FIRE, 1, 1, 200000))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q241_PossessorOfAPreciousSoul/Q241_PossessorOfAPreciousSoul.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q241_PossessorOfAPreciousSoul/Q241_PossessorOfAPreciousSoul.java
index 3507f5c562..878d2f01d2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q241_PossessorOfAPreciousSoul/Q241_PossessorOfAPreciousSoul.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q241_PossessorOfAPreciousSoul/Q241_PossessorOfAPreciousSoul.java
@@ -37,7 +37,6 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
private static final int KASSANDRA = 31743;
private static final int CARADINE = 31740;
private static final int NOEL = 31272;
-
// Monsters
private static final int BARAHAM = 27113;
private static final int MALRUK_SUCCUBUS_1 = 20244;
@@ -49,7 +48,6 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
private static final int SPLINTER_STAKATO_SOLDIER = 21510;
private static final int SPLINTER_STAKATO_DRONE_1 = 21511;
private static final int SPLINTER_STAKATO_DRONE_2 = 21512;
-
// Items
private static final int LEGEND_OF_SEVENTEEN = 7587;
private static final int MALRUK_SUCCUBUS_CLAW = 7597;
@@ -64,12 +62,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
public Q241_PossessorOfAPreciousSoul()
{
super(241, "Possessor of a Precious Soul - 1");
-
registerQuestItems(LEGEND_OF_SEVENTEEN, MALRUK_SUCCUBUS_CLAW, ECHO_CRYSTAL, POETRY_BOOK, CRIMSON_MOSS, RAHORAKTI_MEDICINE);
-
addStartNpc(TALIEN);
addTalkId(TALIEN, GABRIELLE, GILMORE, KANTABILON, STEDMIEL, VIRGIL, OGMAR, RAHORAKTI, KASSANDRA, CARADINE, NOEL);
-
addKillId(BARAHAM, MALRUK_SUCCUBUS_1, MALRUK_SUCCUBUS_2, MALRUK_SUCCUBUS_TUREN_1, MALRUK_SUCCUBUS_TUREN_2, SPLINTER_STAKATO, SPLINTER_STAKATO_WALKER, SPLINTER_STAKATO_SOLDIER, SPLINTER_STAKATO_DRONE_1, SPLINTER_STAKATO_DRONE_2);
}
@@ -83,132 +78,141 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
return htmltext;
}
- // Talien
- if (event.equals("31739-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31739-07.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LEGEND_OF_SEVENTEEN, 1);
- }
- else if (event.equals("31739-10.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ECHO_CRYSTAL, 1);
- }
- else if (event.equals("31739-13.htm"))
- {
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(POETRY_BOOK, 1);
- }
- // Gabrielle
- else if (event.equals("30753-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Gilmore
- else if (event.equals("30754-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Kantabilon
- else if (event.equals("31042-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31042-05.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MALRUK_SUCCUBUS_CLAW, -1);
- st.giveItems(ECHO_CRYSTAL, 1);
- }
- // Stedmiel
- else if (event.equals("30692-02.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(POETRY_BOOK, 1);
- }
- // Virgil
- else if (event.equals("31742-02.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31742-05.htm"))
- {
- st.set("cond", "18");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Ogmar
- else if (event.equals("31744-02.htm"))
- {
- st.set("cond", "13");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Rahorakti
- else if (event.equals("31336-02.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31336-05.htm"))
- {
- st.set("cond", "16");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CRIMSON_MOSS, -1);
- st.giveItems(RAHORAKTI_MEDICINE, 1);
- }
- // Kassandra
- else if (event.equals("31743-02.htm"))
- {
- st.set("cond", "17");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RAHORAKTI_MEDICINE, 1);
- }
- // Caradine
- else if (event.equals("31740-02.htm"))
- {
- st.set("cond", "19");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31740-05.htm"))
- {
- st.giveItems(VIRGIL_LETTER, 1);
- st.rewardExpAndSp(263043, 0);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- // Noel
- else if (event.equals("31272-02.htm"))
- {
- st.set("cond", "20");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31272-05.htm"))
- {
- if (st.hasQuestItems(HELLFIRE_OIL) && (st.getQuestItemsCount(LUNARGENT) >= 5))
+ case "31739-03.htm":
{
- st.set("cond", "21");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LUNARGENT, 5);
- st.takeItems(HELLFIRE_OIL, 1);
+ st.startQuest();
+ break;
}
- else
+ case "31739-07.htm":
{
- htmltext = "31272-07.htm";
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LEGEND_OF_SEVENTEEN, 1);
+ break;
+ }
+ case "31739-10.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ECHO_CRYSTAL, 1);
+ break;
+ }
+ case "31739-13.htm":
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(POETRY_BOOK, 1);
+ break;
+ }
+ case "30753-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30754-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31042-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31042-05.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MALRUK_SUCCUBUS_CLAW, -1);
+ st.giveItems(ECHO_CRYSTAL, 1);
+ break;
+ }
+ case "30692-02.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(POETRY_BOOK, 1);
+ break;
+ }
+ case "31742-02.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31742-05.htm":
+ {
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31744-02.htm":
+ {
+ st.setCond(13);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31336-02.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31336-05.htm":
+ {
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CRIMSON_MOSS, -1);
+ st.giveItems(RAHORAKTI_MEDICINE, 1);
+ break;
+ }
+ case "31743-02.htm":
+ {
+ st.setCond(17);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RAHORAKTI_MEDICINE, 1);
+ break;
+ }
+ case "31740-02.htm":
+ {
+ st.setCond(19);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31740-05.htm":
+ {
+ st.giveItems(VIRGIL_LETTER, 1);
+ st.rewardExpAndSp(263043, 0);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
+ case "31272-02.htm":
+ {
+ st.setCond(20);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31272-05.htm":
+ {
+ if (st.hasQuestItems(HELLFIRE_OIL) && (st.getQuestItemsCount(LUNARGENT) >= 5))
+ {
+ st.setCond(21);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LUNARGENT, 5);
+ st.takeItems(HELLFIRE_OIL, 1);
+ }
+ else
+ {
+ htmltext = "31272-07.htm";
+ }
+ break;
}
}
return htmltext;
@@ -227,19 +231,22 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (!player.isSubClassActive() || (player.getLevel() < 50)) ? "31739-02.htm" : "31739-01.htm";
break;
-
+ }
case State.STARTED:
+ {
if (!player.isSubClassActive())
{
break;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case TALIEN:
+ {
if (cond == 1)
{
htmltext = "31739-04.htm";
@@ -273,8 +280,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31739-14.htm";
}
break;
-
+ }
case GABRIELLE:
+ {
if (cond == 1)
{
htmltext = "30753-01.htm";
@@ -284,8 +292,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "30753-03.htm";
}
break;
-
+ }
case GILMORE:
+ {
if (cond == 2)
{
htmltext = "30754-01.htm";
@@ -295,8 +304,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "30754-03.htm";
}
break;
-
+ }
case KANTABILON:
+ {
if (cond == 5)
{
htmltext = "31042-01.htm";
@@ -314,8 +324,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31042-06.htm";
}
break;
-
+ }
case STEDMIEL:
+ {
if (cond == 9)
{
htmltext = "30692-01.htm";
@@ -325,8 +336,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "30692-03.htm";
}
break;
-
+ }
case VIRGIL:
+ {
if (cond == 11)
{
htmltext = "31742-01.htm";
@@ -344,8 +356,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31742-06.htm";
}
break;
-
+ }
case OGMAR:
+ {
if (cond == 12)
{
htmltext = "31744-01.htm";
@@ -355,8 +368,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31744-03.htm";
}
break;
-
+ }
case RAHORAKTI:
+ {
if (cond == 13)
{
htmltext = "31336-01.htm";
@@ -374,8 +388,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31336-06.htm";
}
break;
-
+ }
case KASSANDRA:
+ {
if (cond == 16)
{
htmltext = "31743-01.htm";
@@ -385,8 +400,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31743-03.htm";
}
break;
-
+ }
case CARADINE:
+ {
if (cond == 18)
{
htmltext = "31740-01.htm";
@@ -400,8 +416,9 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31740-04.htm";
}
break;
-
+ }
case NOEL:
+ {
if (cond == 19)
{
htmltext = "31272-01.htm";
@@ -422,12 +439,15 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
htmltext = "31272-06.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -444,40 +464,45 @@ public class Q241_PossessorOfAPreciousSoul extends Quest
switch (npc.getNpcId())
{
case BARAHAM:
- if (st.getInt("cond") == 3)
+ {
+ if (st.isCond(3))
{
- st.set("cond", "4");
+ st.setCond(4);
st.giveItems(LEGEND_OF_SEVENTEEN, 1);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
-
+ }
case MALRUK_SUCCUBUS_1:
case MALRUK_SUCCUBUS_2:
- if ((st.getInt("cond") == 6) && st.dropItems(MALRUK_SUCCUBUS_CLAW, 1, 10, 100000))
+ {
+ if (st.isCond(6) && st.dropItems(MALRUK_SUCCUBUS_CLAW, 1, 10, 100000))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case MALRUK_SUCCUBUS_TUREN_1:
case MALRUK_SUCCUBUS_TUREN_2:
- if ((st.getInt("cond") == 6) && st.dropItems(MALRUK_SUCCUBUS_CLAW, 1, 10, 120000))
+ {
+ if (st.isCond(6) && st.dropItems(MALRUK_SUCCUBUS_CLAW, 1, 10, 120000))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case SPLINTER_STAKATO:
case SPLINTER_STAKATO_WALKER:
case SPLINTER_STAKATO_SOLDIER:
case SPLINTER_STAKATO_DRONE_1:
case SPLINTER_STAKATO_DRONE_2:
- if ((st.getInt("cond") == 14) && st.dropItems(CRIMSON_MOSS, 1, 5, 100000))
+ {
+ if (st.isCond(14) && st.dropItems(CRIMSON_MOSS, 1, 5, 100000))
{
- st.set("cond", "15");
+ st.setCond(15);
}
break;
+ }
}
return null;
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q242_PossessorOfAPreciousSoul/Q242_PossessorOfAPreciousSoul.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q242_PossessorOfAPreciousSoul/Q242_PossessorOfAPreciousSoul.java
index fac7457703..6c51e414f7 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q242_PossessorOfAPreciousSoul/Q242_PossessorOfAPreciousSoul.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q242_PossessorOfAPreciousSoul/Q242_PossessorOfAPreciousSoul.java
@@ -36,28 +36,23 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
private static final int CORNERSTONE = 31748;
private static final int FALLEN_UNICORN = 31746;
private static final int PURE_UNICORN = 31747;
-
// Monsters
private static final int RESTRAINER_OF_GLORY = 27317;
-
// Items
private static final int VIRGIL_LETTER = 7677;
private static final int GOLDEN_HAIR = 7590;
private static final int SORCERY_INGREDIENT = 7596;
private static final int ORB_OF_BINDING = 7595;
private static final int CARADINE_LETTER = 7678;
-
+ // Misc
private static boolean _unicorn = false;
public Q242_PossessorOfAPreciousSoul()
{
super(242, "Possessor of a Precious Soul - 2");
-
registerQuestItems(GOLDEN_HAIR, SORCERY_INGREDIENT, ORB_OF_BINDING);
-
addStartNpc(VIRGIL);
addTalkId(VIRGIL, KASSANDRA, OGMAR, MYSTERIOUS_KNIGHT, ANGEL_CORPSE, KALIS, MATILD, CORNERSTONE, FALLEN_UNICORN, PURE_UNICORN);
-
addKillId(RESTRAINER_OF_GLORY);
}
@@ -71,102 +66,103 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
return htmltext;
}
- // Kasandra
- if (event.equals("31743-05.htm"))
+ switch (event)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Ogmar
- else if (event.equals("31744-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Mysterious Knight
- else if (event.equals("31751-02.htm"))
- {
- st.set("cond", "4");
- st.set("angel", "0");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // Kalis
- else if (event.equals("30759-02.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30759-05.htm"))
- {
- if (st.hasQuestItems(SORCERY_INGREDIENT))
+ case "31743-05.htm":
{
- st.set("orb", "0");
- st.set("cornerstone", "0");
- st.set("cond", "9");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GOLDEN_HAIR, 1);
- st.takeItems(SORCERY_INGREDIENT, 1);
+ break;
}
- else
+ case "31744-02.htm":
{
- st.set("cond", "7");
- htmltext = "30759-02.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- // Matild
- else if (event.equals("30738-02.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(SORCERY_INGREDIENT, 1);
- }
- // Cornerstone
- else if (event.equals("31748-03.htm"))
- {
- if (st.hasQuestItems(ORB_OF_BINDING))
+ case "31751-02.htm":
{
- npc.doDie(npc);
- st.takeItems(ORB_OF_BINDING, 1);
-
- int cornerstones = st.getInt("cornerstone");
- cornerstones++;
- if (cornerstones == 4)
+ st.setCond(4);
+ st.set("angel", "0");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30759-02.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30759-05.htm":
+ {
+ if (st.hasQuestItems(SORCERY_INGREDIENT))
{
- st.unset("orb");
- st.unset("cornerstone");
- st.set("cond", "10");
+ st.set("orb", "0");
+ st.set("cornerstone", "0");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GOLDEN_HAIR, 1);
+ st.takeItems(SORCERY_INGREDIENT, 1);
}
else
{
- st.set("cornerstone", Integer.toString(cornerstones));
+ st.setCond(7);
+ htmltext = "30759-02.htm";
}
+ break;
}
- else
+ case "30738-02.htm":
{
- htmltext = null;
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(SORCERY_INGREDIENT, 1);
+ break;
+ }
+ case "31748-03.htm":
+ {
+ if (st.hasQuestItems(ORB_OF_BINDING))
+ {
+ npc.doDie(npc);
+ st.takeItems(ORB_OF_BINDING, 1);
+
+ int cornerstones = st.getInt("cornerstone");
+ cornerstones++;
+ if (cornerstones == 4)
+ {
+ st.unset("orb");
+ st.unset("cornerstone");
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.set("cornerstone", Integer.toString(cornerstones));
+ }
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
+ }
+ case "spu":
+ {
+ addSpawn(PURE_UNICORN, 85884, -76588, -3470, 0, false, 0);
+ return null;
+ }
+ case "dspu":
+ {
+ npc.getSpawn().stopRespawn();
+ npc.deleteMe();
+ startQuestTimer("sfu", 2000, null, player, false);
+ return null;
+ }
+ case "sfu":
+ {
+ final NpcInstance unicorn = addSpawn(FALLEN_UNICORN, 85884, -76588, -3470, 0, false, 0);
+ unicorn.getSpawn().startRespawn();
+ return null;
}
- }
- // Spawn Pure Unicorn
- else if (event.equals("spu"))
- {
- addSpawn(PURE_UNICORN, 85884, -76588, -3470, 0, false, 0);
- return null;
- }
- // Despawn Pure Unicorn
- else if (event.equals("dspu"))
- {
- npc.getSpawn().stopRespawn();
- npc.deleteMe();
- startQuestTimer("sfu", 2000, null, player, false);
- return null;
- }
- // Spawn Fallen Unicorn
- else if (event.equals("sfu"))
- {
- final NpcInstance unicorn = addSpawn(FALLEN_UNICORN, 85884, -76588, -3470, 0, false, 0);
- unicorn.getSpawn().startRespawn();
- return null;
}
return htmltext;
@@ -185,6 +181,7 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (st.hasQuestItems(VIRGIL_LETTER))
{
if (!player.isSubClassActive() || (player.getLevel() < 60))
@@ -193,25 +190,25 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
}
else
{
- htmltext = "31742-03.htm";
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.takeItems(VIRGIL_LETTER, 1);
+ htmltext = "31742-03.htm";
}
}
break;
-
+ }
case State.STARTED:
+ {
if (!player.isSubClassActive())
{
break;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VIRGIL:
+ {
if (cond == 1)
{
htmltext = "31742-04.htm";
@@ -221,8 +218,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31742-05.htm";
}
break;
-
+ }
case KASSANDRA:
+ {
if (cond == 1)
{
htmltext = "31743-01.htm";
@@ -241,8 +239,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
st.exitQuest(false);
}
break;
-
+ }
case OGMAR:
+ {
if (cond == 2)
{
htmltext = "31744-01.htm";
@@ -252,8 +251,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31744-03.htm";
}
break;
-
+ }
case MYSTERIOUS_KNIGHT:
+ {
if (cond == 3)
{
htmltext = "31751-01.htm";
@@ -267,13 +267,13 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
if (st.hasQuestItems(GOLDEN_HAIR))
{
htmltext = "31751-04.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
{
htmltext = "31751-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
}
}
else if (cond == 6)
@@ -281,8 +281,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31751-05.htm";
}
break;
-
+ }
case ANGEL_CORPSE:
+ {
if (cond == 4)
{
npc.doDie(npc);
@@ -293,7 +294,7 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
{
htmltext = "31752-02.htm";
st.unset("angel");
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(GOLDEN_HAIR, 1);
}
@@ -308,8 +309,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31752-01.htm";
}
break;
-
+ }
case KALIS:
+ {
if (cond == 6)
{
htmltext = "30759-01.htm";
@@ -327,7 +329,7 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
else
{
htmltext = "30759-03.htm";
- st.set("cond", "7");
+ st.setCond(7);
}
}
else if (cond == 9)
@@ -335,8 +337,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "30759-06.htm";
}
break;
-
+ }
case MATILD:
+ {
if (cond == 7)
{
htmltext = "30738-01.htm";
@@ -346,8 +349,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "30738-03.htm";
}
break;
-
+ }
case CORNERSTONE:
+ {
if (cond == 9)
{
if (st.hasQuestItems(ORB_OF_BINDING))
@@ -360,8 +364,9 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
}
}
break;
-
+ }
case FALLEN_UNICORN:
+ {
if (cond == 9)
{
htmltext = "31746-01.htm";
@@ -378,11 +383,12 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31746-02.htm";
}
break;
-
+ }
case PURE_UNICORN:
+ {
if (cond == 10)
{
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
if (_unicorn) // Global variable check to prevent multiple spawns
{
@@ -396,12 +402,15 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
htmltext = "31747-02.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -409,7 +418,7 @@ public class Q242_PossessorOfAPreciousSoul extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "9");
+ final QuestState st = checkPlayerCondition(player, npc, 9);
if ((st == null) || !player.isSubClassActive())
{
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q246_PossessorOfAPreciousSoul/Q246_PossessorOfAPreciousSoul.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q246_PossessorOfAPreciousSoul/Q246_PossessorOfAPreciousSoul.java
index e00cf5ee5f..8728cd40d7 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q246_PossessorOfAPreciousSoul/Q246_PossessorOfAPreciousSoul.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q246_PossessorOfAPreciousSoul/Q246_PossessorOfAPreciousSoul.java
@@ -30,7 +30,10 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
private static final int CARADINE = 31740;
private static final int OSSIAN = 31741;
private static final int LADD = 30721;
-
+ // Monsters
+ private static final int PILGRIM_OF_SPLENDOR = 21541;
+ private static final int JUDGE_OF_SPLENDOR = 21544;
+ private static final int BARAKIEL = 25325;
// Items
private static final int WATERBINDER = 7591;
private static final int EVERGREEN = 7592;
@@ -39,20 +42,12 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
private static final int CARADINE_LETTER_1 = 7678;
private static final int CARADINE_LETTER_2 = 7679;
- // Mobs
- private static final int PILGRIM_OF_SPLENDOR = 21541;
- private static final int JUDGE_OF_SPLENDOR = 21544;
- private static final int BARAKIEL = 25325;
-
public Q246_PossessorOfAPreciousSoul()
{
super(246, "Possessor of a Precious Soul - 3");
-
registerQuestItems(WATERBINDER, EVERGREEN, RAIN_SONG, RELIC_BOX);
-
addStartNpc(CARADINE);
addTalkId(CARADINE, OSSIAN, LADD);
-
addKillId(PILGRIM_OF_SPLENDOR, JUDGE_OF_SPLENDOR, BARAKIEL);
}
@@ -66,63 +61,66 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
return htmltext;
}
- // Caradine
- if (event.equals("31740-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.takeItems(CARADINE_LETTER_1, 1);
- }
- // Ossian
- else if (event.equals("31741-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31741-05.htm"))
- {
- if (st.hasQuestItems(WATERBINDER, EVERGREEN))
+ case "31740-04.htm":
{
- st.set("cond", "4");
+ st.startQuest();
+ st.takeItems(CARADINE_LETTER_1, 1);
+ break;
+ }
+ case "31741-02.htm":
+ {
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WATERBINDER, 1);
- st.takeItems(EVERGREEN, 1);
+ break;
}
- else
+ case "31741-05.htm":
{
- htmltext = null;
+ if (st.hasQuestItems(WATERBINDER, EVERGREEN))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WATERBINDER, 1);
+ st.takeItems(EVERGREEN, 1);
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
}
- }
- else if (event.equals("31741-08.htm"))
- {
- if (st.hasQuestItems(RAIN_SONG))
+ case "31741-08.htm":
{
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RAIN_SONG, 1);
- st.giveItems(RELIC_BOX, 1);
+ if (st.hasQuestItems(RAIN_SONG))
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RAIN_SONG, 1);
+ st.giveItems(RELIC_BOX, 1);
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
}
- else
+ case "30721-02.htm":
{
- htmltext = null;
- }
- }
- // Ladd
- else if (event.equals("30721-02.htm"))
- {
- if (st.hasQuestItems(RELIC_BOX))
- {
- st.takeItems(RELIC_BOX, 1);
- st.giveItems(CARADINE_LETTER_2, 1);
- st.rewardExpAndSp(719843, 0);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = null;
+ if (st.hasQuestItems(RELIC_BOX))
+ {
+ st.takeItems(RELIC_BOX, 1);
+ st.giveItems(CARADINE_LETTER_2, 1);
+ st.rewardExpAndSp(719843, 0);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
}
}
@@ -142,29 +140,33 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (st.hasQuestItems(CARADINE_LETTER_1))
{
htmltext = (!player.isSubClassActive() || (player.getLevel() < 65)) ? "31740-02.htm" : "31740-01.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (!player.isSubClassActive())
{
break;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case CARADINE:
+ {
if (cond == 1)
{
htmltext = "31740-05.htm";
}
break;
-
+ }
case OSSIAN:
+ {
if (cond == 1)
{
htmltext = "31741-01.htm";
@@ -196,19 +198,23 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
htmltext = "31741-09.htm";
}
break;
-
+ }
case LADD:
+ {
if ((cond == 6) && st.hasQuestItems(RELIC_BOX))
{
htmltext = "30721-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
}
@@ -219,7 +225,7 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
final int npcId = npc.getNpcId();
if (npcId == BARAKIEL)
{
- for (PlayerInstance plr : getPartyMembers(player, npc, "cond", "4"))
+ for (PlayerInstance plr : getPartyMembers(player, npc, 4))
{
if (!plr.isSubClassActive())
{
@@ -229,7 +235,7 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
final QuestState st = plr.getQuestState(getName());
if (!st.hasQuestItems(RAIN_SONG))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(RAIN_SONG, 1);
}
@@ -242,7 +248,7 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
return null;
}
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -260,7 +266,7 @@ public class Q246_PossessorOfAPreciousSoul extends Quest
}
else
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q247_PossessorOfAPreciousSoul/Q247_PossessorOfAPreciousSoul.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q247_PossessorOfAPreciousSoul/Q247_PossessorOfAPreciousSoul.java
index 9f0a69894f..0a67a1b1e1 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q247_PossessorOfAPreciousSoul/Q247_PossessorOfAPreciousSoul.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q247_PossessorOfAPreciousSoul/Q247_PossessorOfAPreciousSoul.java
@@ -28,7 +28,6 @@ public class Q247_PossessorOfAPreciousSoul extends Quest
// NPCs
private static final int CARADINE = 31740;
private static final int LADY_OF_THE_LAKE = 31745;
-
// Items
private static final int CARADINE_LETTER = 7679;
private static final int NOBLESS_TIARA = 7694;
@@ -36,7 +35,6 @@ public class Q247_PossessorOfAPreciousSoul extends Quest
public Q247_PossessorOfAPreciousSoul()
{
super(247, "Possessor of a Precious Soul - 4");
-
addStartNpc(CARADINE);
addTalkId(CARADINE, LADY_OF_THE_LAKE);
}
@@ -51,28 +49,30 @@ public class Q247_PossessorOfAPreciousSoul extends Quest
return htmltext;
}
- // Caradine
- if (event.equals("31740-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.takeItems(CARADINE_LETTER, 1);
- }
- else if (event.equals("31740-05.htm"))
- {
- st.set("cond", "2");
- player.teleToLocation(143209, 43968, -3038);
- }
- // Lady of the lake
- else if (event.equals("31745-05.htm"))
- {
- player.setNoble(true);
- st.giveItems(NOBLESS_TIARA, 1);
- st.rewardExpAndSp(93836, 0);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ case "31740-03.htm":
+ {
+ st.startQuest();
+ st.takeItems(CARADINE_LETTER, 1);
+ break;
+ }
+ case "31740-05.htm":
+ {
+ st.setCond(2);
+ player.teleToLocation(143209, 43968, -3038);
+ break;
+ }
+ case "31745-05.htm":
+ {
+ player.setNoble(true);
+ st.giveItems(NOBLESS_TIARA, 1);
+ st.rewardExpAndSp(93836, 0);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ break;
+ }
}
return htmltext;
@@ -91,22 +91,25 @@ public class Q247_PossessorOfAPreciousSoul extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (st.hasQuestItems(CARADINE_LETTER))
{
htmltext = (!player.isSubClassActive() || (player.getLevel() < 75)) ? "31740-02.htm" : "31740-01.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (!player.isSubClassActive())
{
break;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case CARADINE:
+ {
if (cond == 1)
{
htmltext = "31740-04.htm";
@@ -116,19 +119,23 @@ public class Q247_PossessorOfAPreciousSoul extends Quest
htmltext = "31740-06.htm";
}
break;
-
+ }
case LADY_OF_THE_LAKE:
+ {
if (cond == 2)
{
htmltext = (player.getLevel() < 75) ? "31745-06.htm" : "31745-01.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q257_TheGuardIsBusy/Q257_TheGuardIsBusy.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q257_TheGuardIsBusy/Q257_TheGuardIsBusy.java
index 07841b7adb..3940a9f94e 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q257_TheGuardIsBusy/Q257_TheGuardIsBusy.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q257_TheGuardIsBusy/Q257_TheGuardIsBusy.java
@@ -29,7 +29,6 @@ public class Q257_TheGuardIsBusy extends Quest
private static final int ORC_AMULET = 752;
private static final int ORC_NECKLACE = 1085;
private static final int WEREWOLF_FANG = 1086;
-
// Newbie Items
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
@@ -37,12 +36,9 @@ public class Q257_TheGuardIsBusy extends Quest
public Q257_TheGuardIsBusy()
{
super(257, "The Guard is Busy");
-
registerQuestItems(ORC_AMULET, ORC_NECKLACE, WEREWOLF_FANG, GLUDIO_LORD_MARK);
-
addStartNpc(30039); // Gilbert
addTalkId(30039);
-
addKillId(20006, 20093, 20096, 20098, 20130, 20131, 20132, 20342, 20343);
}
@@ -58,9 +54,7 @@ public class Q257_TheGuardIsBusy extends Quest
if (event.equals("30039-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(GLUDIO_LORD_MARK, 1);
}
else if (event.equals("30039-05.htm"))
@@ -86,10 +80,12 @@ public class Q257_TheGuardIsBusy extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 6) ? "30039-01.htm" : "30039-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int amulets = st.getQuestItemsCount(ORC_AMULET);
final int necklaces = st.getQuestItemsCount(ORC_NECKLACE);
final int fangs = st.getQuestItemsCount(WEREWOLF_FANG);
@@ -132,6 +128,7 @@ public class Q257_TheGuardIsBusy extends Quest
}
}
break;
+ }
}
return htmltext;
@@ -151,26 +148,32 @@ public class Q257_TheGuardIsBusy extends Quest
case 20006:
case 20130:
case 20131:
+ {
st.dropItems(ORC_AMULET, 1, 0, 500000);
break;
-
+ }
case 20093:
case 20096:
case 20098:
+ {
st.dropItems(ORC_NECKLACE, 1, 0, 500000);
break;
-
+ }
case 20342:
+ {
st.dropItems(WEREWOLF_FANG, 1, 0, 200000);
break;
-
+ }
case 20343:
+ {
st.dropItems(WEREWOLF_FANG, 1, 0, 400000);
break;
-
+ }
case 20132:
+ {
st.dropItems(WEREWOLF_FANG, 1, 0, 500000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q258_BringWolfPelts/Q258_BringWolfPelts.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q258_BringWolfPelts/Q258_BringWolfPelts.java
index 905fe8405f..c7c814d38c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q258_BringWolfPelts/Q258_BringWolfPelts.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q258_BringWolfPelts/Q258_BringWolfPelts.java
@@ -27,7 +27,6 @@ public class Q258_BringWolfPelts extends Quest
{
// Item
private static final int WOLF_PELT = 702;
-
// Rewards
private static final int COTTON_SHIRT = 390;
private static final int LEATHER_PANTS = 29;
@@ -38,12 +37,9 @@ public class Q258_BringWolfPelts extends Quest
public Q258_BringWolfPelts()
{
super(258, "Bring Wolf Pelts");
-
registerQuestItems(WOLF_PELT);
-
addStartNpc(30001); // Lector
addTalkId(30001);
-
addKillId(20120, 20442); // Wolf, Elder Wolf
}
@@ -59,9 +55,7 @@ public class Q258_BringWolfPelts extends Quest
if (event.equals("30001-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -80,10 +74,12 @@ public class Q258_BringWolfPelts extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 3) ? "30001-01.htm" : "30001-02.htm";
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(WOLF_PELT) < 40)
{
htmltext = "30001-05.htm";
@@ -129,6 +125,7 @@ public class Q258_BringWolfPelts extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -137,7 +134,7 @@ public class Q258_BringWolfPelts extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -145,7 +142,7 @@ public class Q258_BringWolfPelts extends Quest
if (st.dropItemsAlways(WOLF_PELT, 1, 40))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q259_RanchersPlea/Q259_RanchersPlea.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q259_RanchersPlea/Q259_RanchersPlea.java
index 3e132e334b..8e02f4e5bd 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q259_RanchersPlea/Q259_RanchersPlea.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q259_RanchersPlea/Q259_RanchersPlea.java
@@ -27,15 +27,12 @@ public class Q259_RanchersPlea extends Quest
// NPCs
private static final int EDMOND = 30497;
private static final int MARIUS = 30405;
-
// Monsters
private static final int GIANT_SPIDER = 20103;
private static final int TALON_SPIDER = 20106;
private static final int BLADE_SPIDER = 20108;
-
// Items
private static final int GIANT_SPIDER_SKIN = 1495;
-
// Rewards
private static final int ADENA = 57;
private static final int HEALING_POTION = 1061;
@@ -44,12 +41,9 @@ public class Q259_RanchersPlea extends Quest
public Q259_RanchersPlea()
{
super(259, "Rancher's Plea");
-
registerQuestItems(GIANT_SPIDER_SKIN);
-
addStartNpc(EDMOND);
addTalkId(EDMOND, MARIUS);
-
addKillId(GIANT_SPIDER, TALON_SPIDER, BLADE_SPIDER);
}
@@ -63,46 +57,52 @@ public class Q259_RanchersPlea extends Quest
return htmltext;
}
- if (event.equals("30497-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30497-06.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30405-04.htm"))
- {
- if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ case "30497-03.htm":
{
- st.takeItems(GIANT_SPIDER_SKIN, 10);
- st.rewardItems(HEALING_POTION, 1);
+ st.startQuest();
+ break;
}
- else
+ case "30497-06.htm":
{
- htmltext = "Incorrect item count";
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30405-05.htm"))
- {
- if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ case "30405-04.htm":
{
- st.takeItems(GIANT_SPIDER_SKIN, 10);
- st.rewardItems(WOODEN_ARROW, 50);
+ if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ {
+ st.takeItems(GIANT_SPIDER_SKIN, 10);
+ st.rewardItems(HEALING_POTION, 1);
+ }
+ else
+ {
+ htmltext = "Incorrect item count";
+ }
+ break;
}
- else
+ case "30405-05.htm":
{
- htmltext = "Incorrect item count";
+ if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ {
+ st.takeItems(GIANT_SPIDER_SKIN, 10);
+ st.rewardItems(WOODEN_ARROW, 50);
+ }
+ else
+ {
+ htmltext = "Incorrect item count";
+ }
+ break;
}
- }
- else if (event.equals("30405-07.htm"))
- {
- if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ case "30405-07.htm":
{
- htmltext = "30405-06.htm";
+ if (st.getQuestItemsCount(GIANT_SPIDER_SKIN) >= 10)
+ {
+ htmltext = "30405-06.htm";
+ }
+ break;
}
}
@@ -122,14 +122,17 @@ public class Q259_RanchersPlea extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30497-01.htm" : "30497-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int count = st.getQuestItemsCount(GIANT_SPIDER_SKIN);
switch (npc.getNpcId())
{
case EDMOND:
+ {
if (count == 0)
{
htmltext = "30497-04.htm";
@@ -141,12 +144,15 @@ public class Q259_RanchersPlea extends Quest
st.rewardItems(ADENA, ((count >= 10) ? 250 : 0) + (count * 25));
}
break;
-
+ }
case MARIUS:
+ {
htmltext = (count < 10) ? "30405-01.htm" : "30405-02.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q260_HuntTheOrcs/Q260_HuntTheOrcs.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q260_HuntTheOrcs/Q260_HuntTheOrcs.java
index 49cb535810..20688c6d5f 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q260_HuntTheOrcs/Q260_HuntTheOrcs.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q260_HuntTheOrcs/Q260_HuntTheOrcs.java
@@ -27,11 +27,6 @@ public class Q260_HuntTheOrcs extends Quest
{
// NPC
private static final int RAYEN = 30221;
-
- // Items
- private static final int ORC_AMULET = 1114;
- private static final int ORC_NECKLACE = 1115;
-
// Monsters
private static final int KABOO_ORC = 20468;
private static final int KABOO_ORC_ARCHER = 20469;
@@ -39,16 +34,16 @@ public class Q260_HuntTheOrcs extends Quest
private static final int KABOO_ORC_FIGHTER = 20471;
private static final int KABOO_ORC_FIGHTER_LEADER = 20472;
private static final int KABOO_ORC_FIGHTER_LIEUTENANT = 20473;
+ // Items
+ private static final int ORC_AMULET = 1114;
+ private static final int ORC_NECKLACE = 1115;
public Q260_HuntTheOrcs()
{
super(260, "Hunt the Orcs");
-
registerQuestItems(ORC_AMULET, ORC_NECKLACE);
-
addStartNpc(RAYEN);
addTalkId(RAYEN);
-
addKillId(KABOO_ORC, KABOO_ORC_ARCHER, KABOO_ORC_GRUNT, KABOO_ORC_FIGHTER, KABOO_ORC_FIGHTER_LEADER, KABOO_ORC_FIGHTER_LIEUTENANT);
}
@@ -64,9 +59,7 @@ public class Q260_HuntTheOrcs extends Quest
if (event.equals("30221-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30221-06.htm"))
{
@@ -90,6 +83,7 @@ public class Q260_HuntTheOrcs extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30221-00.htm";
@@ -103,8 +97,9 @@ public class Q260_HuntTheOrcs extends Quest
htmltext = "30221-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int amulet = st.getQuestItemsCount(ORC_AMULET);
final int necklace = st.getQuestItemsCount(ORC_NECKLACE);
@@ -120,6 +115,7 @@ public class Q260_HuntTheOrcs extends Quest
st.rewardItems(57, (amulet * 5) + (necklace * 15));
}
break;
+ }
}
return htmltext;
@@ -139,14 +135,17 @@ public class Q260_HuntTheOrcs extends Quest
case KABOO_ORC:
case KABOO_ORC_GRUNT:
case KABOO_ORC_ARCHER:
+ {
st.dropItems(ORC_AMULET, 1, 0, 500000);
break;
-
+ }
case KABOO_ORC_FIGHTER:
case KABOO_ORC_FIGHTER_LEADER:
case KABOO_ORC_FIGHTER_LIEUTENANT:
+ {
st.dropItems(ORC_NECKLACE, 1, 0, 500000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q261_CollectorsDream/Q261_CollectorsDream.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q261_CollectorsDream/Q261_CollectorsDream.java
index 26a7557263..0e336e553b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q261_CollectorsDream/Q261_CollectorsDream.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q261_CollectorsDream/Q261_CollectorsDream.java
@@ -30,12 +30,9 @@ public class Q261_CollectorsDream extends Quest
public Q261_CollectorsDream()
{
super(261, "Collector's Dream");
-
registerQuestItems(GIANT_SPIDER_LEG);
-
addStartNpc(30222); // Alshupes
addTalkId(30222);
-
addKillId(20308, 20460, 20466);
}
@@ -51,9 +48,7 @@ public class Q261_CollectorsDream extends Quest
if (event.equals("30222-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -72,11 +67,13 @@ public class Q261_CollectorsDream extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30222-01.htm" : "30222-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 2)
+ {
+ if (st.isCond(2))
{
htmltext = "30222-05.htm";
st.takeItems(GIANT_SPIDER_LEG, -1);
@@ -90,10 +87,12 @@ public class Q261_CollectorsDream extends Quest
htmltext = "30222-04.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -102,7 +101,7 @@ public class Q261_CollectorsDream extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -110,7 +109,7 @@ public class Q261_CollectorsDream extends Quest
if (st.dropItemsAlways(GIANT_SPIDER_LEG, 1, 8))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q262_TradeWithTheIvoryTower/Q262_TradeWithTheIvoryTower.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q262_TradeWithTheIvoryTower/Q262_TradeWithTheIvoryTower.java
index 211b3e1033..da68b6d668 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q262_TradeWithTheIvoryTower/Q262_TradeWithTheIvoryTower.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q262_TradeWithTheIvoryTower/Q262_TradeWithTheIvoryTower.java
@@ -30,12 +30,9 @@ public class Q262_TradeWithTheIvoryTower extends Quest
public Q262_TradeWithTheIvoryTower()
{
super(262, "Trade with the Ivory Tower");
-
registerQuestItems(FUNGUS_SAC);
-
addStartNpc(30137); // Vollodos
addTalkId(30137);
-
addKillId(20400, 20007);
}
@@ -51,9 +48,7 @@ public class Q262_TradeWithTheIvoryTower extends Quest
if (event.equals("30137-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -72,10 +67,12 @@ public class Q262_TradeWithTheIvoryTower extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 8) ? "30137-01.htm" : "30137-02.htm";
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(FUNGUS_SAC) < 10)
{
htmltext = "30137-04.htm";
@@ -89,6 +86,7 @@ public class Q262_TradeWithTheIvoryTower extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -97,7 +95,7 @@ public class Q262_TradeWithTheIvoryTower extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -105,7 +103,7 @@ public class Q262_TradeWithTheIvoryTower extends Quest
if (st.dropItems(FUNGUS_SAC, 1, 10, (npc.getNpcId() == 20400) ? 400000 : 300000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q263_OrcSubjugation/Q263_OrcSubjugation.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q263_OrcSubjugation/Q263_OrcSubjugation.java
index 34294ecd79..5b06a40745 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q263_OrcSubjugation/Q263_OrcSubjugation.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q263_OrcSubjugation/Q263_OrcSubjugation.java
@@ -32,12 +32,9 @@ public class Q263_OrcSubjugation extends Quest
public Q263_OrcSubjugation()
{
super(263, "Orc Subjugation");
-
registerQuestItems(ORC_AMULET, ORC_NECKLACE);
-
addStartNpc(30346); // Kayleen
addTalkId(30346);
-
addKillId(20385, 20386, 20387, 20388);
}
@@ -53,9 +50,7 @@ public class Q263_OrcSubjugation extends Quest
if (event.equals("30346-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30346-06.htm"))
{
@@ -79,6 +74,7 @@ public class Q263_OrcSubjugation extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30346-00.htm";
@@ -92,11 +88,11 @@ public class Q263_OrcSubjugation extends Quest
htmltext = "30346-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int amulet = st.getQuestItemsCount(ORC_AMULET);
final int necklace = st.getQuestItemsCount(ORC_NECKLACE);
-
if ((amulet == 0) && (necklace == 0))
{
htmltext = "30346-04.htm";
@@ -109,6 +105,7 @@ public class Q263_OrcSubjugation extends Quest
st.rewardItems(57, (amulet * 20) + (necklace * 30));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q264_KeenClaws/Q264_KeenClaws.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q264_KeenClaws/Q264_KeenClaws.java
index f545e97a0b..f658492085 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q264_KeenClaws/Q264_KeenClaws.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q264_KeenClaws/Q264_KeenClaws.java
@@ -27,7 +27,6 @@ public class Q264_KeenClaws extends Quest
{
// Item
private static final int WOLF_CLAW = 1367;
-
// Rewards
private static final int LEATHER_SANDALS = 36;
private static final int WOODEN_HELMET = 43;
@@ -39,12 +38,9 @@ public class Q264_KeenClaws extends Quest
public Q264_KeenClaws()
{
super(264, "Keen Claws");
-
registerQuestItems(WOLF_CLAW);
-
addStartNpc(30136); // Payne
addTalkId(30136);
-
addKillId(20003, 20456); // Goblin, Wolf
}
@@ -60,9 +56,7 @@ public class Q264_KeenClaws extends Quest
if (event.equals("30136-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -81,10 +75,12 @@ public class Q264_KeenClaws extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 3) ? "30136-01.htm" : "30136-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int count = st.getQuestItemsCount(WOLF_CLAW);
if (count < 50)
{
@@ -131,6 +127,7 @@ public class Q264_KeenClaws extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -139,7 +136,7 @@ public class Q264_KeenClaws extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -149,12 +146,12 @@ public class Q264_KeenClaws extends Quest
{
if (st.dropItems(WOLF_CLAW, Rnd.nextBoolean() ? 2 : 4, 50, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
}
else if (st.dropItemsAlways(WOLF_CLAW, (Rnd.get(5) < 4) ? 1 : 2, 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q265_ChainsOfSlavery/Q265_ChainsOfSlavery.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q265_ChainsOfSlavery/Q265_ChainsOfSlavery.java
index 005007b773..5a15772c0a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q265_ChainsOfSlavery/Q265_ChainsOfSlavery.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q265_ChainsOfSlavery/Q265_ChainsOfSlavery.java
@@ -27,7 +27,6 @@ public class Q265_ChainsOfSlavery extends Quest
{
// Item
private static final int SHACKLE = 1368;
-
// Newbie Items
private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
@@ -35,12 +34,9 @@ public class Q265_ChainsOfSlavery extends Quest
public Q265_ChainsOfSlavery()
{
super(265, "Chains of Slavery");
-
registerQuestItems(SHACKLE);
-
addStartNpc(30357); // Kristin
addTalkId(30357);
-
addKillId(20004, 20005);
}
@@ -56,9 +52,7 @@ public class Q265_ChainsOfSlavery extends Quest
if (event.equals("30357-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30357-06.htm"))
{
@@ -82,6 +76,7 @@ public class Q265_ChainsOfSlavery extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30357-00.htm";
@@ -95,8 +90,9 @@ public class Q265_ChainsOfSlavery extends Quest
htmltext = "30357-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int shackles = st.getQuestItemsCount(SHACKLE);
if (shackles == 0)
{
@@ -132,6 +128,7 @@ public class Q265_ChainsOfSlavery extends Quest
}
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q266_PleasOfPixies/Q266_PleasOfPixies.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q266_PleasOfPixies/Q266_PleasOfPixies.java
index 6344f42d3d..6b3f77fc13 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q266_PleasOfPixies/Q266_PleasOfPixies.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q266_PleasOfPixies/Q266_PleasOfPixies.java
@@ -28,7 +28,6 @@ public class Q266_PleasOfPixies extends Quest
{
// Items
private static final int PREDATOR_FANG = 1334;
-
// Rewards
private static final int GLASS_SHARD = 1336;
private static final int EMERALD = 1337;
@@ -38,12 +37,9 @@ public class Q266_PleasOfPixies extends Quest
public Q266_PleasOfPixies()
{
super(266, "Pleas of Pixies");
-
registerQuestItems(PREDATOR_FANG);
-
addStartNpc(31852); // Murika
addTalkId(31852);
-
addKillId(20525, 20530, 20534, 20537);
}
@@ -59,9 +55,7 @@ public class Q266_PleasOfPixies extends Quest
if (event.equals("31852-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -80,6 +74,7 @@ public class Q266_PleasOfPixies extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "31852-00.htm";
@@ -93,8 +88,9 @@ public class Q266_PleasOfPixies extends Quest
htmltext = "31852-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(PREDATOR_FANG) < 100)
{
htmltext = "31852-04.htm";
@@ -127,6 +123,7 @@ public class Q266_PleasOfPixies extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -135,7 +132,7 @@ public class Q266_PleasOfPixies extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -144,32 +141,37 @@ public class Q266_PleasOfPixies extends Quest
switch (npc.getNpcId())
{
case 20525:
+ {
if (st.dropItemsAlways(PREDATOR_FANG, Rnd.get(2, 3), 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20530:
+ {
if (st.dropItems(PREDATOR_FANG, 1, 100, 800000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20534:
+ {
if (st.dropItems(PREDATOR_FANG, (Rnd.get(3) == 0) ? 1 : 2, 100, 600000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20537:
+ {
if (st.dropItemsAlways(PREDATOR_FANG, 2, 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q267_WrathOfVerdure/Q267_WrathOfVerdure.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q267_WrathOfVerdure/Q267_WrathOfVerdure.java
index 235691109b..4c2148da19 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q267_WrathOfVerdure/Q267_WrathOfVerdure.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q267_WrathOfVerdure/Q267_WrathOfVerdure.java
@@ -27,19 +27,15 @@ public class Q267_WrathOfVerdure extends Quest
{
// Items
private static final int GOBLIN_CLUB = 1335;
-
// Reward
private static final int SILVERY_LEAF = 1340;
public Q267_WrathOfVerdure()
{
super(267, "Wrath of Verdure");
-
registerQuestItems(GOBLIN_CLUB);
-
addStartNpc(31853); // Bremec
addTalkId(31853);
-
addKillId(20325); // Goblin
}
@@ -55,9 +51,7 @@ public class Q267_WrathOfVerdure extends Quest
if (event.equals("31853-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31853-06.htm"))
{
@@ -81,6 +75,7 @@ public class Q267_WrathOfVerdure extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "31853-00.htm";
@@ -94,8 +89,9 @@ public class Q267_WrathOfVerdure extends Quest
htmltext = "31853-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int count = st.getQuestItemsCount(GOBLIN_CLUB);
if (count > 0)
{
@@ -108,6 +104,7 @@ public class Q267_WrathOfVerdure extends Quest
htmltext = "31853-04.htm";
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q271_ProofOfValor/Q271_ProofOfValor.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q271_ProofOfValor/Q271_ProofOfValor.java
index 27e30c84f7..c25c2cf44f 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q271_ProofOfValor/Q271_ProofOfValor.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q271_ProofOfValor/Q271_ProofOfValor.java
@@ -28,7 +28,6 @@ public class Q271_ProofOfValor extends Quest
{
// Item
private static final int KASHA_WOLF_FANG = 1473;
-
// Rewards
private static final int NECKLACE_OF_VALOR = 1507;
private static final int NECKLACE_OF_COURAGE = 1506;
@@ -36,12 +35,9 @@ public class Q271_ProofOfValor extends Quest
public Q271_ProofOfValor()
{
super(271, "Proof of Valor");
-
registerQuestItems(KASHA_WOLF_FANG);
-
addStartNpc(30577); // Rukain
addTalkId(30577);
-
addKillId(20475); // Kasha Wolf
}
@@ -57,10 +53,7 @@ public class Q271_ProofOfValor extends Quest
if (event.equals("30577-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
+ st.startQuest();
if (st.hasAtLeastOneQuestItem(NECKLACE_OF_COURAGE, NECKLACE_OF_VALOR))
{
htmltext = "30577-07.htm";
@@ -83,6 +76,7 @@ public class Q271_ProofOfValor extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30577-00.htm";
@@ -96,9 +90,10 @@ public class Q271_ProofOfValor extends Quest
htmltext = (st.hasAtLeastOneQuestItem(NECKLACE_OF_COURAGE, NECKLACE_OF_VALOR)) ? "30577-06.htm" : "30577-02.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = (st.hasAtLeastOneQuestItem(NECKLACE_OF_COURAGE, NECKLACE_OF_VALOR)) ? "30577-07.htm" : "30577-04.htm";
}
@@ -111,6 +106,7 @@ public class Q271_ProofOfValor extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -119,7 +115,7 @@ public class Q271_ProofOfValor extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -127,7 +123,7 @@ public class Q271_ProofOfValor extends Quest
if (st.dropItemsAlways(KASHA_WOLF_FANG, (Rnd.get(4) == 0) ? 2 : 1, 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q272_WrathOfAncestors/Q272_WrathOfAncestors.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q272_WrathOfAncestors/Q272_WrathOfAncestors.java
index da4faba0b7..1a87c17b61 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q272_WrathOfAncestors/Q272_WrathOfAncestors.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q272_WrathOfAncestors/Q272_WrathOfAncestors.java
@@ -31,12 +31,9 @@ public class Q272_WrathOfAncestors extends Quest
public Q272_WrathOfAncestors()
{
super(272, "Wrath of Ancestors");
-
registerQuestItems(GRAVE_ROBBERS_HEAD);
-
addStartNpc(30572); // Livina
addTalkId(30572);
-
addKillId(20319, 20320); // Goblin Grave Robber, Goblin Tomb Raider Leader
}
@@ -52,9 +49,7 @@ public class Q272_WrathOfAncestors extends Quest
if (event.equals("30572-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -73,6 +68,7 @@ public class Q272_WrathOfAncestors extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30572-00.htm";
@@ -86,9 +82,10 @@ public class Q272_WrathOfAncestors extends Quest
htmltext = "30572-02.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30572-04.htm";
}
@@ -101,6 +98,7 @@ public class Q272_WrathOfAncestors extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -109,7 +107,7 @@ public class Q272_WrathOfAncestors extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -117,7 +115,7 @@ public class Q272_WrathOfAncestors extends Quest
if (st.dropItemsAlways(GRAVE_ROBBERS_HEAD, 1, 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q273_InvadersOfTheHolyLand/Q273_InvadersOfTheHolyLand.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q273_InvadersOfTheHolyLand/Q273_InvadersOfTheHolyLand.java
index 5de2188aa8..eddb655374 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q273_InvadersOfTheHolyLand/Q273_InvadersOfTheHolyLand.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q273_InvadersOfTheHolyLand/Q273_InvadersOfTheHolyLand.java
@@ -29,19 +29,15 @@ public class Q273_InvadersOfTheHolyLand extends Quest
// Items
private static final int BLACK_SOULSTONE = 1475;
private static final int RED_SOULSTONE = 1476;
-
// Reward
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
public Q273_InvadersOfTheHolyLand()
{
super(273, "Invaders of the Holy Land");
-
registerQuestItems(BLACK_SOULSTONE, RED_SOULSTONE);
-
addStartNpc(30566); // Varkees
addTalkId(30566);
-
addKillId(20311, 20312, 20313);
}
@@ -57,9 +53,7 @@ public class Q273_InvadersOfTheHolyLand extends Quest
if (event.equals("30566-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30566-07.htm"))
{
@@ -83,6 +77,7 @@ public class Q273_InvadersOfTheHolyLand extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30566-00.htm";
@@ -96,8 +91,9 @@ public class Q273_InvadersOfTheHolyLand extends Quest
htmltext = "30566-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int red = st.getQuestItemsCount(RED_SOULSTONE);
final int black = st.getQuestItemsCount(BLACK_SOULSTONE);
if ((red + black) == 0)
@@ -127,6 +123,7 @@ public class Q273_InvadersOfTheHolyLand extends Quest
}
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q274_SkirmishWithTheWerewolves/Q274_SkirmishWithTheWerewolves.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q274_SkirmishWithTheWerewolves/Q274_SkirmishWithTheWerewolves.java
index 09f617a69d..13310add62 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q274_SkirmishWithTheWerewolves/Q274_SkirmishWithTheWerewolves.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q274_SkirmishWithTheWerewolves/Q274_SkirmishWithTheWerewolves.java
@@ -29,7 +29,6 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
// Needed items
private static final int NECKLACE_OF_VALOR = 1507;
private static final int NECKLACE_OF_COURAGE = 1506;
-
// Items
private static final int MARAKU_WEREWOLF_HEAD = 1477;
private static final int MARAKU_WOLFMEN_TOTEM = 1501;
@@ -37,12 +36,9 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
public Q274_SkirmishWithTheWerewolves()
{
super(274, "Skirmish with the Werewolves");
-
registerQuestItems(MARAKU_WEREWOLF_HEAD, MARAKU_WOLFMEN_TOTEM);
-
addStartNpc(30569);
addTalkId(30569);
-
addKillId(20363, 20364);
}
@@ -58,9 +54,7 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
if (event.equals("30569-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -79,6 +73,7 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30569-00.htm";
@@ -96,9 +91,10 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
htmltext = "30569-07.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30569-04.htm";
}
@@ -114,6 +110,7 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -122,7 +119,7 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -130,7 +127,7 @@ public class Q274_SkirmishWithTheWerewolves extends Quest
if (st.dropItemsAlways(MARAKU_WEREWOLF_HEAD, 1, 40))
{
- st.set("cond", "2");
+ st.setCond(2);
}
if (Rnd.get(100) < 6)
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q275_DarkWingedSpies/Q275_DarkWingedSpies.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q275_DarkWingedSpies/Q275_DarkWingedSpies.java
index 8035db79f5..e13520cd6c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q275_DarkWingedSpies/Q275_DarkWingedSpies.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q275_DarkWingedSpies/Q275_DarkWingedSpies.java
@@ -29,7 +29,6 @@ public class Q275_DarkWingedSpies extends Quest
// Monsters
private static final int DARKWING_BAT = 20316;
private static final int VARANGKA_TRACKER = 27043;
-
// Items
private static final int DARKWING_BAT_FANG = 1478;
private static final int VARANGKA_PARASITE = 1479;
@@ -37,12 +36,9 @@ public class Q275_DarkWingedSpies extends Quest
public Q275_DarkWingedSpies()
{
super(275, "Dark Winged Spies");
-
registerQuestItems(DARKWING_BAT_FANG, VARANGKA_PARASITE);
-
addStartNpc(30567); // Tantus
addTalkId(30567);
-
addKillId(DARKWING_BAT, VARANGKA_TRACKER);
}
@@ -58,9 +54,7 @@ public class Q275_DarkWingedSpies extends Quest
if (event.equals("30567-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -79,6 +73,7 @@ public class Q275_DarkWingedSpies extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30567-00.htm";
@@ -92,9 +87,10 @@ public class Q275_DarkWingedSpies extends Quest
htmltext = "30567-02.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30567-04.htm";
}
@@ -108,6 +104,7 @@ public class Q275_DarkWingedSpies extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -116,7 +113,7 @@ public class Q275_DarkWingedSpies extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -125,9 +122,10 @@ public class Q275_DarkWingedSpies extends Quest
switch (npc.getNpcId())
{
case DARKWING_BAT:
+ {
if (st.dropItemsAlways(DARKWING_BAT_FANG, 1, 70))
{
- st.set("cond", "2");
+ st.setCond(2);
}
else if ((Rnd.get(100) < 10) && (st.getQuestItemsCount(DARKWING_BAT_FANG) > 10) && (st.getQuestItemsCount(DARKWING_BAT_FANG) < 66))
{
@@ -136,17 +134,19 @@ public class Q275_DarkWingedSpies extends Quest
st.giveItems(VARANGKA_PARASITE, 1);
}
break;
-
+ }
case VARANGKA_TRACKER:
+ {
if (st.hasQuestItems(VARANGKA_PARASITE))
{
st.takeItems(VARANGKA_PARASITE, -1);
if (st.dropItemsAlways(DARKWING_BAT_FANG, 5, 70))
{
- st.set("cond", "2");
+ st.setCond(2);
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q276_TotemOfTheHestui/Q276_TotemOfTheHestui.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q276_TotemOfTheHestui/Q276_TotemOfTheHestui.java
index 6f2b59b60e..3b9f972e9c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q276_TotemOfTheHestui/Q276_TotemOfTheHestui.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q276_TotemOfTheHestui/Q276_TotemOfTheHestui.java
@@ -29,7 +29,6 @@ public class Q276_TotemOfTheHestui extends Quest
// Items
private static final int KASHA_PARASITE = 1480;
private static final int KASHA_CRYSTAL = 1481;
-
// Rewards
private static final int HESTUI_TOTEM = 1500;
private static final int LEATHER_PANTS = 29;
@@ -37,12 +36,9 @@ public class Q276_TotemOfTheHestui extends Quest
public Q276_TotemOfTheHestui()
{
super(276, "Totem of the Hestui");
-
registerQuestItems(KASHA_PARASITE, KASHA_CRYSTAL);
-
addStartNpc(30571); // Tanapi
addTalkId(30571);
-
addKillId(20479, 27044);
}
@@ -58,9 +54,7 @@ public class Q276_TotemOfTheHestui extends Quest
if (event.equals("30571-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -79,6 +73,7 @@ public class Q276_TotemOfTheHestui extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ORC)
{
htmltext = "30571-00.htm";
@@ -92,9 +87,10 @@ public class Q276_TotemOfTheHestui extends Quest
htmltext = "30571-02.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30571-04.htm";
}
@@ -109,6 +105,7 @@ public class Q276_TotemOfTheHestui extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -117,7 +114,7 @@ public class Q276_TotemOfTheHestui extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -128,6 +125,7 @@ public class Q276_TotemOfTheHestui extends Quest
switch (npc.getNpcId())
{
case 20479:
+ {
final int count = st.getQuestItemsCount(KASHA_PARASITE);
final int random = Rnd.get(100);
if ((count >= 79) || ((count >= 69) && (random <= 20)) || ((count >= 59) && (random <= 15)) || ((count >= 49) && (random <= 10)) || ((count >= 39) && (random < 2)))
@@ -140,12 +138,14 @@ public class Q276_TotemOfTheHestui extends Quest
st.dropItemsAlways(KASHA_PARASITE, 1, 0);
}
break;
-
+ }
case 27044:
- st.set("cond", "2");
+ {
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(KASHA_CRYSTAL, 1);
break;
+ }
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q277_GatekeepersOffering/Q277_GatekeepersOffering.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q277_GatekeepersOffering/Q277_GatekeepersOffering.java
index 41ad19534c..88ba6da0bd 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q277_GatekeepersOffering/Q277_GatekeepersOffering.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q277_GatekeepersOffering/Q277_GatekeepersOffering.java
@@ -26,17 +26,14 @@ public class Q277_GatekeepersOffering extends Quest
{
// Item
private static final int STARSTONE = 1572;
-
// Reward
private static final int GATEKEEPER_CHARM = 1658;
public Q277_GatekeepersOffering()
{
super(277, "Gatekeeper's Offering");
-
addStartNpc(30576); // Tamil
addTalkId(30576);
-
addKillId(20333); // Graystone Golem
}
@@ -52,9 +49,7 @@ public class Q277_GatekeepersOffering extends Quest
if (event.equals("30576-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -73,11 +68,13 @@ public class Q277_GatekeepersOffering extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30576-01.htm" : "30576-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30576-04.htm";
}
@@ -90,6 +87,7 @@ public class Q277_GatekeepersOffering extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -98,7 +96,7 @@ public class Q277_GatekeepersOffering extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -106,7 +104,7 @@ public class Q277_GatekeepersOffering extends Quest
if (st.dropItems(STARSTONE, 1, 20, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q291_RevengeOfTheRedbonnet/Q291_RevengeOfTheRedbonnet.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q291_RevengeOfTheRedbonnet/Q291_RevengeOfTheRedbonnet.java
index 7d6dbe4c61..56678073b2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q291_RevengeOfTheRedbonnet/Q291_RevengeOfTheRedbonnet.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q291_RevengeOfTheRedbonnet/Q291_RevengeOfTheRedbonnet.java
@@ -27,7 +27,6 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
{
// Quest items
private static final int BLACK_WOLF_PELT = 1482;
-
// Rewards
private static final int SCROLL_OF_ESCAPE = 736;
private static final int GRANDMA_PEARL = 1502;
@@ -38,12 +37,9 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
public Q291_RevengeOfTheRedbonnet()
{
super(291, "Revenge of the Redbonnet");
-
registerQuestItems(BLACK_WOLF_PELT);
-
addStartNpc(30553); // Maryse Redbonnet
addTalkId(30553);
-
addKillId(20317);
}
@@ -59,9 +55,7 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
if (event.equals("30553-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -80,11 +74,13 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 4) ? "30553-01.htm" : "30553-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30553-04.htm";
@@ -117,6 +113,7 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -125,7 +122,7 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -133,7 +130,7 @@ public class Q291_RevengeOfTheRedbonnet extends Quest
if (st.dropItemsAlways(BLACK_WOLF_PELT, 1, 40))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q292_BrigandsSweep/Q292_BrigandsSweep.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q292_BrigandsSweep/Q292_BrigandsSweep.java
index 4f1f82c045..bb0af18073 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q292_BrigandsSweep/Q292_BrigandsSweep.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q292_BrigandsSweep/Q292_BrigandsSweep.java
@@ -29,7 +29,12 @@ public class Q292_BrigandsSweep extends Quest
// NPCs
private static final int SPIRON = 30532;
private static final int BALANKI = 30533;
-
+ // Monsters
+ private static final int GOBLIN_BRIGAND = 20322;
+ private static final int GOBLIN_BRIGAND_LEADER = 20323;
+ private static final int GOBLIN_BRIGAND_LIEUTENANT = 20324;
+ private static final int GOBLIN_SNOOPER = 20327;
+ private static final int GOBLIN_LORD = 20528;
// Items
private static final int GOBLIN_NECKLACE = 1483;
private static final int GOBLIN_PENDANT = 1484;
@@ -37,22 +42,12 @@ public class Q292_BrigandsSweep extends Quest
private static final int SUSPICIOUS_MEMO = 1486;
private static final int SUSPICIOUS_CONTRACT = 1487;
- // Monsters
- private static final int GOBLIN_BRIGAND = 20322;
- private static final int GOBLIN_BRIGAND_LEADER = 20323;
- private static final int GOBLIN_BRIGAND_LIEUTENANT = 20324;
- private static final int GOBLIN_SNOOPER = 20327;
- private static final int GOBLIN_LORD = 20528;
-
public Q292_BrigandsSweep()
{
super(292, "Brigands Sweep");
-
registerQuestItems(GOBLIN_NECKLACE, GOBLIN_PENDANT, GOBLIN_LORD_PENDANT, SUSPICIOUS_MEMO, SUSPICIOUS_CONTRACT);
-
addStartNpc(SPIRON);
addTalkId(SPIRON, BALANKI);
-
addKillId(GOBLIN_BRIGAND, GOBLIN_BRIGAND_LEADER, GOBLIN_BRIGAND_LIEUTENANT, GOBLIN_SNOOPER, GOBLIN_LORD);
}
@@ -68,9 +63,7 @@ public class Q292_BrigandsSweep extends Quest
if (event.equals("30532-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30532-06.htm"))
{
@@ -94,6 +87,7 @@ public class Q292_BrigandsSweep extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DWARF)
{
htmltext = "30532-00.htm";
@@ -107,11 +101,13 @@ public class Q292_BrigandsSweep extends Quest
htmltext = "30532-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case SPIRON:
+ {
final int goblinNecklaces = st.getQuestItemsCount(GOBLIN_NECKLACE);
final int goblinPendants = st.getQuestItemsCount(GOBLIN_PENDANT);
final int goblinLordPendants = st.getQuestItemsCount(GOBLIN_LORD_PENDANT);
@@ -149,15 +145,16 @@ public class Q292_BrigandsSweep extends Quest
st.takeItems(GOBLIN_LORD_PENDANT, -1);
if (hasContract)
{
- st.set("cond", "1");
+ st.setCond(1);
st.takeItems(SUSPICIOUS_CONTRACT, -1);
}
st.rewardItems(57, ((12 * goblinNecklaces) + (36 * goblinPendants) + (33 * goblinLordPendants) + (countAll >= 10 ? 1000 : 0) + ((hasContract) ? 1120 : 0)));
}
break;
-
+ }
case BALANKI:
+ {
if (!st.hasQuestItems(SUSPICIOUS_CONTRACT))
{
htmltext = "30533-01.htm";
@@ -165,13 +162,15 @@ public class Q292_BrigandsSweep extends Quest
else
{
htmltext = "30533-02.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.takeItems(SUSPICIOUS_CONTRACT, -1);
st.rewardItems(57, 1500);
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -194,21 +193,25 @@ public class Q292_BrigandsSweep extends Quest
case GOBLIN_BRIGAND:
case GOBLIN_SNOOPER:
case GOBLIN_BRIGAND_LIEUTENANT:
+ {
st.dropItemsAlways(GOBLIN_NECKLACE, 1, 0);
break;
-
+ }
case GOBLIN_BRIGAND_LEADER:
+ {
st.dropItemsAlways(GOBLIN_PENDANT, 1, 0);
break;
-
+ }
case GOBLIN_LORD:
+ {
st.dropItemsAlways(GOBLIN_LORD_PENDANT, 1, 0);
break;
+ }
}
}
- else if ((chance > 4) && (st.getInt("cond") == 1) && st.dropItemsAlways(SUSPICIOUS_MEMO, 1, 3))
+ else if ((chance > 4) && st.isCond(1) && st.dropItemsAlways(SUSPICIOUS_MEMO, 1, 3))
{
- st.set("cond", "2");
+ st.setCond(2);
st.takeItems(SUSPICIOUS_MEMO, -1);
st.giveItems(SUSPICIOUS_CONTRACT, 1);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q293_TheHiddenVeins/Q293_TheHiddenVeins.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q293_TheHiddenVeins/Q293_TheHiddenVeins.java
index b9b5aec1b4..4f22adb6e3 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q293_TheHiddenVeins/Q293_TheHiddenVeins.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q293_TheHiddenVeins/Q293_TheHiddenVeins.java
@@ -26,32 +26,26 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q293_TheHiddenVeins extends Quest
{
+ // NPCs
+ private static final int FILAUR = 30535;
+ private static final int CHINCHIRIN = 30539;
+ // Monsters
+ private static final int UTUKU_ORC = 20446;
+ private static final int UTUKU_ARCHER = 20447;
+ private static final int UTUKU_GRUNT = 20448;
// Items
private static final int CHRYSOLITE_ORE = 1488;
private static final int TORN_MAP_FRAGMENT = 1489;
private static final int HIDDEN_VEIN_MAP = 1490;
-
// Reward
private static final int SOULSHOT_FOR_BEGINNERS = 5789;
- // NPCs
- private static final int FILAUR = 30535;
- private static final int CHINCHIRIN = 30539;
-
- // Mobs
- private static final int UTUKU_ORC = 20446;
- private static final int UTUKU_ARCHER = 20447;
- private static final int UTUKU_GRUNT = 20448;
-
public Q293_TheHiddenVeins()
{
super(293, "The Hidden Veins");
-
registerQuestItems(CHRYSOLITE_ORE, TORN_MAP_FRAGMENT, HIDDEN_VEIN_MAP);
-
addStartNpc(FILAUR);
addTalkId(FILAUR, CHINCHIRIN);
-
addKillId(UTUKU_ORC, UTUKU_ARCHER, UTUKU_GRUNT);
}
@@ -65,25 +59,29 @@ public class Q293_TheHiddenVeins extends Quest
return htmltext;
}
- if (event.equals("30535-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30535-06.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30539-02.htm"))
- {
- if (st.getQuestItemsCount(TORN_MAP_FRAGMENT) >= 4)
+ case "30535-03.htm":
{
- htmltext = "30539-03.htm";
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(TORN_MAP_FRAGMENT, 4);
- st.giveItems(HIDDEN_VEIN_MAP, 1);
+ st.startQuest();
+ break;
+ }
+ case "30535-06.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30539-02.htm":
+ {
+ if (st.getQuestItemsCount(TORN_MAP_FRAGMENT) >= 4)
+ {
+ htmltext = "30539-03.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(TORN_MAP_FRAGMENT, 4);
+ st.giveItems(HIDDEN_VEIN_MAP, 1);
+ }
+ break;
}
}
@@ -103,6 +101,7 @@ public class Q293_TheHiddenVeins extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DWARF)
{
htmltext = "30535-00.htm";
@@ -116,11 +115,13 @@ public class Q293_TheHiddenVeins extends Quest
htmltext = "30535-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case FILAUR:
+ {
final int chrysoliteOres = st.getQuestItemsCount(CHRYSOLITE_ORE);
final int hiddenVeinMaps = st.getQuestItemsCount(HIDDEN_VEIN_MAP);
if ((chrysoliteOres + hiddenVeinMaps) == 0)
@@ -157,12 +158,15 @@ public class Q293_TheHiddenVeins extends Quest
}
}
break;
-
+ }
case CHINCHIRIN:
+ {
htmltext = "30539-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q294_CovertBusiness/Q294_CovertBusiness.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q294_CovertBusiness/Q294_CovertBusiness.java
index 605150c977..1ab6db4cb1 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q294_CovertBusiness/Q294_CovertBusiness.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q294_CovertBusiness/Q294_CovertBusiness.java
@@ -28,19 +28,15 @@ public class Q294_CovertBusiness extends Quest
{
// Item
private static final int BAT_FANG = 1491;
-
// Reward
private static final int RING_OF_RACCOON = 1508;
public Q294_CovertBusiness()
{
super(294, "Covert Business");
-
registerQuestItems(BAT_FANG);
-
addStartNpc(30534); // Keef
addTalkId(30534);
-
addKillId(20370, 20480); // Barded Bat, Blade Bat
}
@@ -56,9 +52,7 @@ public class Q294_CovertBusiness extends Quest
if (event.equals("30534-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -77,6 +71,7 @@ public class Q294_CovertBusiness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DWARF)
{
htmltext = "30534-00.htm";
@@ -90,9 +85,10 @@ public class Q294_CovertBusiness extends Quest
htmltext = "30534-02.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30534-04.htm";
}
@@ -106,6 +102,7 @@ public class Q294_CovertBusiness extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -114,7 +111,7 @@ public class Q294_CovertBusiness extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -139,7 +136,7 @@ public class Q294_CovertBusiness extends Quest
if (st.dropItemsAlways(BAT_FANG, count, 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q295_DreamingOfTheSkies/Q295_DreamingOfTheSkies.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q295_DreamingOfTheSkies/Q295_DreamingOfTheSkies.java
index 43dd39f420..6a64450b7f 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q295_DreamingOfTheSkies/Q295_DreamingOfTheSkies.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q295_DreamingOfTheSkies/Q295_DreamingOfTheSkies.java
@@ -27,19 +27,15 @@ public class Q295_DreamingOfTheSkies extends Quest
{
// Item
private static final int FLOATING_STONE = 1492;
-
// Reward
private static final int RING_OF_FIREFLY = 1509;
public Q295_DreamingOfTheSkies()
{
super(295, "Dreaming of the Skies");
-
registerQuestItems(FLOATING_STONE);
-
addStartNpc(30536); // Arin
addTalkId(30536);
-
addKillId(20153); // Magical Weaver
}
@@ -55,9 +51,7 @@ public class Q295_DreamingOfTheSkies extends Quest
if (event.equals("30536-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -76,11 +70,13 @@ public class Q295_DreamingOfTheSkies extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 11) ? "30536-01.htm" : "30536-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30536-04.htm";
}
@@ -104,6 +100,7 @@ public class Q295_DreamingOfTheSkies extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -112,7 +109,7 @@ public class Q295_DreamingOfTheSkies extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -120,7 +117,7 @@ public class Q295_DreamingOfTheSkies extends Quest
if (st.dropItemsAlways(FLOATING_STONE, (Rnd.get(100) > 25) ? 1 : 2, 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q296_TarantulasSpiderSilk/Q296_TarantulasSpiderSilk.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q296_TarantulasSpiderSilk/Q296_TarantulasSpiderSilk.java
index a9ebae0c5b..9ba767096c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q296_TarantulasSpiderSilk/Q296_TarantulasSpiderSilk.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q296_TarantulasSpiderSilk/Q296_TarantulasSpiderSilk.java
@@ -28,11 +28,9 @@ public class Q296_TarantulasSpiderSilk extends Quest
// NPCs
private static final int MION = 30519;
private static final int DEFENDER_NATHAN = 30548;
-
// Quest Items
private static final int TARANTULA_SPIDER_SILK = 1493;
private static final int TARANTULA_SPINNERETTE = 1494;
-
// Items
private static final int RING_OF_RACCOON = 1508;
private static final int RING_OF_FIREFLY = 1509;
@@ -40,12 +38,9 @@ public class Q296_TarantulasSpiderSilk extends Quest
public Q296_TarantulasSpiderSilk()
{
super(296, "Tarantula's Spider Silk");
-
registerQuestItems(TARANTULA_SPIDER_SILK, TARANTULA_SPINNERETTE);
-
addStartNpc(MION);
addTalkId(MION, DEFENDER_NATHAN);
-
addKillId(20394, 20403, 20508); // Crimson Tarantula, Hunter Tarantula, Plunder arantula
}
@@ -59,34 +54,38 @@ public class Q296_TarantulasSpiderSilk extends Quest
return htmltext;
}
- if (event.equals("30519-03.htm"))
+ switch (event)
{
- if (st.hasAtLeastOneQuestItem(RING_OF_RACCOON, RING_OF_FIREFLY))
+ case "30519-03.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ if (st.hasAtLeastOneQuestItem(RING_OF_RACCOON, RING_OF_FIREFLY))
+ {
+ st.startQuest();
+ }
+ else
+ {
+ htmltext = "30519-03a.htm";
+ }
+ break;
}
- else
+ case "30519-06.htm":
{
- htmltext = "30519-03a.htm";
- }
- }
- else if (event.equals("30519-06.htm"))
- {
- st.takeItems(TARANTULA_SPIDER_SILK, -1);
- st.takeItems(TARANTULA_SPINNERETTE, -1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30548-02.htm"))
- {
- final int count = st.getQuestItemsCount(TARANTULA_SPINNERETTE);
- if (count > 0)
- {
- htmltext = "30548-03.htm";
+ st.takeItems(TARANTULA_SPIDER_SILK, -1);
st.takeItems(TARANTULA_SPINNERETTE, -1);
- st.giveItems(TARANTULA_SPIDER_SILK, count * (15 + Rnd.get(10)));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30548-02.htm":
+ {
+ final int count = st.getQuestItemsCount(TARANTULA_SPINNERETTE);
+ if (count > 0)
+ {
+ htmltext = "30548-03.htm";
+ st.takeItems(TARANTULA_SPINNERETTE, -1);
+ st.giveItems(TARANTULA_SPIDER_SILK, count * (15 + Rnd.get(10)));
+ }
+ break;
}
}
@@ -106,13 +105,16 @@ public class Q296_TarantulasSpiderSilk extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30519-01.htm" : "30519-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case MION:
+ {
final int count = st.getQuestItemsCount(TARANTULA_SPIDER_SILK);
if (count == 0)
{
@@ -125,12 +127,15 @@ public class Q296_TarantulasSpiderSilk extends Quest
st.rewardItems(57, ((count >= 10) ? 2000 : 0) + (count * 30));
}
break;
-
+ }
case DEFENDER_NATHAN:
+ {
htmltext = "30548-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q297_GatekeepersFavor/Q297_GatekeepersFavor.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q297_GatekeepersFavor/Q297_GatekeepersFavor.java
index dd84b1609a..fcec2706cb 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q297_GatekeepersFavor/Q297_GatekeepersFavor.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q297_GatekeepersFavor/Q297_GatekeepersFavor.java
@@ -26,19 +26,15 @@ public class Q297_GatekeepersFavor extends Quest
{
// Item
private static final int STARSTONE = 1573;
-
// Reward
private static final int GATEKEEPER_TOKEN = 1659;
public Q297_GatekeepersFavor()
{
super(297, "Gatekeeper's Favor");
-
registerQuestItems(STARSTONE);
-
addStartNpc(30540); // Wirphy
addTalkId(30540);
-
addKillId(20521); // Whinstone Golem
}
@@ -54,9 +50,7 @@ public class Q297_GatekeepersFavor extends Quest
if (event.equals("30540-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -75,11 +69,13 @@ public class Q297_GatekeepersFavor extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30540-01.htm" : "30540-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30540-04.htm";
}
@@ -92,6 +88,7 @@ public class Q297_GatekeepersFavor extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -100,7 +97,7 @@ public class Q297_GatekeepersFavor extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -108,7 +105,7 @@ public class Q297_GatekeepersFavor extends Quest
if (st.dropItems(STARSTONE, 1, 20, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q298_LizardmensConspiracy/Q298_LizardmensConspiracy.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q298_LizardmensConspiracy/Q298_LizardmensConspiracy.java
index 4aebfcd145..1c6b2b5bf9 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q298_LizardmensConspiracy/Q298_LizardmensConspiracy.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q298_LizardmensConspiracy/Q298_LizardmensConspiracy.java
@@ -27,7 +27,6 @@ public class Q298_LizardmensConspiracy extends Quest
// NPCs
private static final int PRAGA = 30333;
private static final int ROHMER = 30344;
-
// Items
private static final int PATROL_REPORT = 7182;
private static final int WHITE_GEM = 7183;
@@ -36,12 +35,9 @@ public class Q298_LizardmensConspiracy extends Quest
public Q298_LizardmensConspiracy()
{
super(298, "Lizardmen's Conspiracy");
-
registerQuestItems(PATROL_REPORT, WHITE_GEM, RED_GEM);
-
addStartNpc(PRAGA);
addTalkId(PRAGA, ROHMER);
-
addKillId(20926, 20927, 20922, 20923, 20924);
}
@@ -55,29 +51,33 @@ public class Q298_LizardmensConspiracy extends Quest
return htmltext;
}
- if (event.equals("30333-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(PATROL_REPORT, 1);
- }
- else if (event.equals("30344-1.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PATROL_REPORT, 1);
- }
- else if (event.equals("30344-4.htm"))
- {
- if (st.getInt("cond") == 3)
+ case "30333-1.htm":
{
- htmltext = "30344-3.htm";
- st.takeItems(WHITE_GEM, -1);
- st.takeItems(RED_GEM, -1);
- st.rewardExpAndSp(0, 42000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.startQuest();
+ st.giveItems(PATROL_REPORT, 1);
+ break;
+ }
+ case "30344-1.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PATROL_REPORT, 1);
+ break;
+ }
+ case "30344-4.htm":
+ {
+ if (st.isCond(3))
+ {
+ htmltext = "30344-3.htm";
+ st.takeItems(WHITE_GEM, -1);
+ st.takeItems(RED_GEM, -1);
+ st.rewardExpAndSp(0, 42000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ break;
}
}
@@ -97,18 +97,22 @@ public class Q298_LizardmensConspiracy extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 25) ? "30333-0b.htm" : "30333-0a.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case PRAGA:
+ {
htmltext = "30333-2.htm";
break;
-
+ }
case ROHMER:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = (st.hasQuestItems(PATROL_REPORT)) ? "30344-0.htm" : "30344-0a.htm";
}
@@ -117,8 +121,10 @@ public class Q298_LizardmensConspiracy extends Quest
htmltext = "30344-2.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -127,7 +133,7 @@ public class Q298_LizardmensConspiracy extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "2");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 2);
if (partyMember == null)
{
return null;
@@ -142,33 +148,38 @@ public class Q298_LizardmensConspiracy extends Quest
switch (npc.getNpcId())
{
case 20922:
+ {
if (st.dropItems(WHITE_GEM, 1, 50, 400000) && (st.getQuestItemsCount(RED_GEM) >= 50))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20923:
+ {
if (st.dropItems(WHITE_GEM, 1, 50, 450000) && (st.getQuestItemsCount(RED_GEM) >= 50))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20924:
+ {
if (st.dropItems(WHITE_GEM, 1, 50, 350000) && (st.getQuestItemsCount(RED_GEM) >= 50))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20926:
case 20927:
+ {
if (st.dropItems(RED_GEM, 1, 50, 400000) && (st.getQuestItemsCount(WHITE_GEM) >= 50))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q299_GatherIngredientsForPie/Q299_GatherIngredientsForPie.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q299_GatherIngredientsForPie/Q299_GatherIngredientsForPie.java
index 4eb3c5a46e..d1cc4409bc 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q299_GatherIngredientsForPie/Q299_GatherIngredientsForPie.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q299_GatherIngredientsForPie/Q299_GatherIngredientsForPie.java
@@ -28,7 +28,6 @@ public class Q299_GatherIngredientsForPie extends Quest
private static final int LARA = 30063;
private static final int BRIGHT = 30466;
private static final int EMILY = 30620;
-
// Items
private static final int FRUIT_BASKET = 7136;
private static final int AVELLAN_SPICE = 7137;
@@ -37,12 +36,9 @@ public class Q299_GatherIngredientsForPie extends Quest
public Q299_GatherIngredientsForPie()
{
super(299, "Gather Ingredients for Pie");
-
registerQuestItems(FRUIT_BASKET, AVELLAN_SPICE, HONEY_POUCH);
-
addStartNpc(EMILY);
addTalkId(EMILY, LARA, BRIGHT);
-
addKillId(20934, 20935); // Wasp Worker, Wasp Leader
}
@@ -56,49 +52,56 @@ public class Q299_GatherIngredientsForPie extends Quest
return htmltext;
}
- if (event.equals("30620-1.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30620-3.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HONEY_POUCH, -1);
- }
- else if (event.equals("30063-1.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(AVELLAN_SPICE, 1);
- }
- else if (event.equals("30620-5.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(AVELLAN_SPICE, 1);
- }
- else if (event.equals("30466-1.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(FRUIT_BASKET, 1);
- }
- else if (event.equals("30620-7a.htm"))
- {
- if (st.hasQuestItems(FRUIT_BASKET))
+ case "30620-1.htm":
{
- htmltext = "30620-7.htm";
- st.takeItems(FRUIT_BASKET, 1);
- st.rewardItems(57, 25000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.startQuest();
+ break;
}
- else
+ case "30620-3.htm":
{
- st.set("cond", "5");
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HONEY_POUCH, -1);
+ break;
+ }
+ case "30063-1.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(AVELLAN_SPICE, 1);
+ break;
+ }
+ case "30620-5.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(AVELLAN_SPICE, 1);
+ break;
+ }
+ case "30466-1.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(FRUIT_BASKET, 1);
+ break;
+ }
+ case "30620-7a.htm":
+ {
+ if (st.hasQuestItems(FRUIT_BASKET))
+ {
+ htmltext = "30620-7.htm";
+ st.takeItems(FRUIT_BASKET, 1);
+ st.rewardItems(57, 25000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ st.setCond(5);
+ }
+ break;
}
}
@@ -118,14 +121,17 @@ public class Q299_GatherIngredientsForPie extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 34) ? "30620-0a.htm" : "30620-0.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case EMILY:
+ {
if (cond == 1)
{
htmltext = "30620-1a.htm";
@@ -167,8 +173,9 @@ public class Q299_GatherIngredientsForPie extends Quest
htmltext = "30620-6.htm";
}
break;
-
+ }
case LARA:
+ {
if (cond == 3)
{
htmltext = "30063-0.htm";
@@ -178,8 +185,9 @@ public class Q299_GatherIngredientsForPie extends Quest
htmltext = "30063-1a.htm";
}
break;
-
+ }
case BRIGHT:
+ {
if (cond == 5)
{
htmltext = "30466-0.htm";
@@ -189,8 +197,10 @@ public class Q299_GatherIngredientsForPie extends Quest
htmltext = "30466-1a.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -199,7 +209,7 @@ public class Q299_GatherIngredientsForPie extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -213,7 +223,7 @@ public class Q299_GatherIngredientsForPie extends Quest
if (st.dropItems(HONEY_POUCH, 1, 100, (npc.getNpcId() == 20934) ? 571000 : 625000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q300_HuntingLetoLizardman/Q300_HuntingLetoLizardman.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q300_HuntingLetoLizardman/Q300_HuntingLetoLizardman.java
index 9e2458cf7d..316866f05d 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q300_HuntingLetoLizardman/Q300_HuntingLetoLizardman.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q300_HuntingLetoLizardman/Q300_HuntingLetoLizardman.java
@@ -28,16 +28,14 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q300_HuntingLetoLizardman extends Quest
{
- // Item
- private static final int BRACELET = 7139;
-
// Monsters
private static final int LETO_LIZARDMAN = 20577;
private static final int LETO_LIZARDMAN_ARCHER = 20578;
private static final int LETO_LIZARDMAN_SOLDIER = 20579;
private static final int LETO_LIZARDMAN_WARRIOR = 20580;
private static final int LETO_LIZARDMAN_OVERLORD = 20582;
-
+ // Item
+ private static final int BRACELET = 7139;
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -52,12 +50,9 @@ public class Q300_HuntingLetoLizardman extends Quest
public Q300_HuntingLetoLizardman()
{
super(300, "Hunting Leto Lizardman");
-
registerQuestItems(BRACELET);
-
addStartNpc(30126); // Rath
addTalkId(30126);
-
addKillId(LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_OVERLORD);
}
@@ -73,34 +68,29 @@ public class Q300_HuntingLetoLizardman extends Quest
if (event.equals("30126-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
- else if (event.equals("30126-05.htm"))
+ else if (event.equals("30126-05.htm") && (st.getQuestItemsCount(BRACELET) >= 60))
{
- if (st.getQuestItemsCount(BRACELET) >= 60)
+ htmltext = "30126-06.htm";
+ st.takeItems(BRACELET, -1);
+
+ final int luck = Rnd.get(3);
+ if (luck == 0)
{
- htmltext = "30126-06.htm";
- st.takeItems(BRACELET, -1);
-
- final int luck = Rnd.get(3);
- if (luck == 0)
- {
- st.rewardItems(57, 30000);
- }
- else if (luck == 1)
- {
- st.rewardItems(1867, 50);
- }
- else if (luck == 2)
- {
- st.rewardItems(1872, 50);
- }
-
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.rewardItems(57, 30000);
}
+ else if (luck == 1)
+ {
+ st.rewardItems(1867, 50);
+ }
+ else if (luck == 2)
+ {
+ st.rewardItems(1872, 50);
+ }
+
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
}
return htmltext;
@@ -119,12 +109,15 @@ public class Q300_HuntingLetoLizardman extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 34) ? "30126-01.htm" : "30126-02.htm";
break;
-
+ }
case State.STARTED:
- htmltext = (st.getInt("cond") == 1) ? "30126-04a.htm" : "30126-04.htm";
+ {
+ htmltext = st.isCond(1) ? "30126-04a.htm" : "30126-04.htm";
break;
+ }
}
return htmltext;
@@ -133,7 +126,7 @@ public class Q300_HuntingLetoLizardman extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -147,7 +140,7 @@ public class Q300_HuntingLetoLizardman extends Quest
if (st.dropItems(BRACELET, 1, 60, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q303_CollectArrowheads/Q303_CollectArrowheads.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q303_CollectArrowheads/Q303_CollectArrowheads.java
index 69926d1130..b3310701bf 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q303_CollectArrowheads/Q303_CollectArrowheads.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q303_CollectArrowheads/Q303_CollectArrowheads.java
@@ -30,12 +30,9 @@ public class Q303_CollectArrowheads extends Quest
public Q303_CollectArrowheads()
{
super(303, "Collect Arrowheads");
-
registerQuestItems(ORCISH_ARROWHEAD);
-
addStartNpc(30029); // Minia
addTalkId(30029);
-
addKillId(20361);
}
@@ -51,9 +48,7 @@ public class Q303_CollectArrowheads extends Quest
if (event.equals("30029-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -72,11 +67,13 @@ public class Q303_CollectArrowheads extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 10) ? "30029-01.htm" : "30029-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30029-04.htm";
}
@@ -90,6 +87,7 @@ public class Q303_CollectArrowheads extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -98,7 +96,7 @@ public class Q303_CollectArrowheads extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -106,7 +104,7 @@ public class Q303_CollectArrowheads extends Quest
if (st.dropItems(ORCISH_ARROWHEAD, 1, 10, 400000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q306_CrystalsOfFireAndIce/Q306_CrystalsOfFireAndIce.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q306_CrystalsOfFireAndIce/Q306_CrystalsOfFireAndIce.java
index ebf3626493..cdb3c62779 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q306_CrystalsOfFireAndIce/Q306_CrystalsOfFireAndIce.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q306_CrystalsOfFireAndIce/Q306_CrystalsOfFireAndIce.java
@@ -31,47 +31,22 @@ public class Q306_CrystalsOfFireAndIce extends Quest
// Droplist (npcId, itemId, chance)
private static final int[][] DROPLIST =
{
- {
- 20109,
- FLAME_SHARD,
- 300000
- },
- {
- 20110,
- ICE_SHARD,
- 300000
- },
- {
- 20112,
- FLAME_SHARD,
- 400000
- },
- {
- 20113,
- ICE_SHARD,
- 400000
- },
- {
- 20114,
- FLAME_SHARD,
- 500000
- },
- {
- 20115,
- ICE_SHARD,
- 500000
- }
+ // @formatter:off
+ {20109, FLAME_SHARD, 300000},
+ {20110, ICE_SHARD, 300000},
+ {20112, FLAME_SHARD, 400000},
+ {20113, ICE_SHARD, 400000},
+ {20114, FLAME_SHARD, 500000},
+ {20115, ICE_SHARD, 500000}
+ // @formatter:on
};
public Q306_CrystalsOfFireAndIce()
{
super(306, "Crystals of Fire and Ice");
-
registerQuestItems(FLAME_SHARD, ICE_SHARD);
-
addStartNpc(30004); // Katerina
addTalkId(30004);
-
addKillId(20109, 20110, 20112, 20113, 20114, 20115);
}
@@ -87,9 +62,7 @@ public class Q306_CrystalsOfFireAndIce extends Quest
if (event.equals("30004-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30004-06.htm"))
{
@@ -113,10 +86,12 @@ public class Q306_CrystalsOfFireAndIce extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 17) ? "30004-01.htm" : "30004-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int totalItems = st.getQuestItemsCount(FLAME_SHARD) + st.getQuestItemsCount(ICE_SHARD);
if (totalItems == 0)
{
@@ -130,6 +105,7 @@ public class Q306_CrystalsOfFireAndIce extends Quest
st.rewardItems(57, (30 * totalItems) + ((totalItems > 10) ? 5000 : 0));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q313_CollectSpores/Q313_CollectSpores.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q313_CollectSpores/Q313_CollectSpores.java
index c49500ae1a..e79fcffd60 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q313_CollectSpores/Q313_CollectSpores.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q313_CollectSpores/Q313_CollectSpores.java
@@ -30,12 +30,9 @@ public class Q313_CollectSpores extends Quest
public Q313_CollectSpores()
{
super(313, "Collect Spores");
-
registerQuestItems(SPORE_SAC);
-
addStartNpc(30150); // Herbiel
addTalkId(30150);
-
addKillId(20509); // Spore Fungus
}
@@ -51,9 +48,7 @@ public class Q313_CollectSpores extends Quest
if (event.equals("30150-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -72,11 +67,13 @@ public class Q313_CollectSpores extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 8) ? "30150-02.htm" : "30150-03.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30150-06.htm";
}
@@ -89,6 +86,7 @@ public class Q313_CollectSpores extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -97,7 +95,7 @@ public class Q313_CollectSpores extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -105,7 +103,7 @@ public class Q313_CollectSpores extends Quest
if (st.dropItems(SPORE_SAC, 1, 10, 400000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q316_DestroyPlagueCarriers/Q316_DestroyPlagueCarriers.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q316_DestroyPlagueCarriers/Q316_DestroyPlagueCarriers.java
index 8b4f94890d..a4a9de00c4 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q316_DestroyPlagueCarriers/Q316_DestroyPlagueCarriers.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q316_DestroyPlagueCarriers/Q316_DestroyPlagueCarriers.java
@@ -25,24 +25,20 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q316_DestroyPlagueCarriers extends Quest
{
- // Items
- private static final int WERERAT_FANG = 1042;
- private static final int VAROOL_FOULCLAW_FANG = 1043;
-
// Monsters
private static final int SUKAR_WERERAT = 20040;
private static final int SUKAR_WERERAT_LEADER = 20047;
private static final int VAROOL_FOULCLAW = 27020;
+ // Items
+ private static final int WERERAT_FANG = 1042;
+ private static final int VAROOL_FOULCLAW_FANG = 1043;
public Q316_DestroyPlagueCarriers()
{
super(316, "Destroy Plague Carriers");
-
registerQuestItems(WERERAT_FANG, VAROOL_FOULCLAW_FANG);
-
addStartNpc(30155); // Ellenia
addTalkId(30155);
-
addKillId(SUKAR_WERERAT, SUKAR_WERERAT_LEADER, VAROOL_FOULCLAW);
}
@@ -58,9 +54,7 @@ public class Q316_DestroyPlagueCarriers extends Quest
if (event.equals("30155-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30155-08.htm"))
{
@@ -84,6 +78,7 @@ public class Q316_DestroyPlagueCarriers extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.ELF)
{
htmltext = "30155-00.htm";
@@ -97,8 +92,9 @@ public class Q316_DestroyPlagueCarriers extends Quest
htmltext = "30155-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int ratFangs = st.getQuestItemsCount(WERERAT_FANG);
final int varoolFangs = st.getQuestItemsCount(VAROOL_FOULCLAW_FANG);
if ((ratFangs + varoolFangs) == 0)
@@ -113,6 +109,7 @@ public class Q316_DestroyPlagueCarriers extends Quest
st.rewardItems(57, (ratFangs * 30) + (varoolFangs * 10000) + ((ratFangs > 10) ? 5000 : 0));
}
break;
+ }
}
return htmltext;
@@ -131,12 +128,15 @@ public class Q316_DestroyPlagueCarriers extends Quest
{
case SUKAR_WERERAT:
case SUKAR_WERERAT_LEADER:
+ {
st.dropItems(WERERAT_FANG, 1, 0, 400000);
break;
-
+ }
case VAROOL_FOULCLAW:
+ {
st.dropItems(VAROOL_FOULCLAW_FANG, 1, 1, 200000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q317_CatchTheWind/Q317_CatchTheWind.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q317_CatchTheWind/Q317_CatchTheWind.java
index 5481de4f0b..8a29a98c9a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q317_CatchTheWind/Q317_CatchTheWind.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q317_CatchTheWind/Q317_CatchTheWind.java
@@ -30,12 +30,9 @@ public class Q317_CatchTheWind extends Quest
public Q317_CatchTheWind()
{
super(317, "Catch the Wind");
-
registerQuestItems(WIND_SHARD);
-
addStartNpc(30361); // Rizraell
addTalkId(30361);
-
addKillId(20036, 20044);
}
@@ -51,9 +48,7 @@ public class Q317_CatchTheWind extends Quest
if (event.equals("30361-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30361-08.htm"))
{
@@ -77,10 +72,12 @@ public class Q317_CatchTheWind extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 18) ? "30361-02.htm" : "30361-03.htm";
break;
-
+ }
case State.STARTED:
+ {
final int shards = st.getQuestItemsCount(WIND_SHARD);
if (shards == 0)
{
@@ -93,6 +90,7 @@ public class Q317_CatchTheWind extends Quest
st.rewardItems(57, (40 * shards) + (shards >= 10 ? 2988 : 0));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q319_ScentOfDeath/Q319_ScentOfDeath.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q319_ScentOfDeath/Q319_ScentOfDeath.java
index 094be2398b..c25c2bcfee 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q319_ScentOfDeath/Q319_ScentOfDeath.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q319_ScentOfDeath/Q319_ScentOfDeath.java
@@ -30,12 +30,9 @@ public class Q319_ScentOfDeath extends Quest
public Q319_ScentOfDeath()
{
super(319, "Scent of Death");
-
registerQuestItems(ZOMBIE_SKIN);
-
addStartNpc(30138); // Minaless
addTalkId(30138);
-
addKillId(20015, 20020);
}
@@ -51,9 +48,7 @@ public class Q319_ScentOfDeath extends Quest
if (event.equals("30138-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -72,11 +67,13 @@ public class Q319_ScentOfDeath extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 11) ? "30138-02.htm" : "30138-03.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30138-05.htm";
}
@@ -90,6 +87,7 @@ public class Q319_ScentOfDeath extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
}
@@ -97,7 +95,7 @@ public class Q319_ScentOfDeath extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -105,7 +103,7 @@ public class Q319_ScentOfDeath extends Quest
if (st.dropItems(ZOMBIE_SKIN, 1, 5, 200000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q320_BonesTellTheFuture/Q320_BonesTellTheFuture.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q320_BonesTellTheFuture/Q320_BonesTellTheFuture.java
index 73053ab432..7463537a41 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q320_BonesTellTheFuture/Q320_BonesTellTheFuture.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q320_BonesTellTheFuture/Q320_BonesTellTheFuture.java
@@ -31,12 +31,9 @@ public class Q320_BonesTellTheFuture extends Quest
public Q320_BonesTellTheFuture()
{
super(320, "Bones Tell the Future");
-
registerQuestItems(BONE_FRAGMENT);
-
addStartNpc(30359); // Kaitar
addTalkId(30359);
-
addKillId(20517, 20518);
}
@@ -52,9 +49,7 @@ public class Q320_BonesTellTheFuture extends Quest
if (event.equals("30359-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return event;
@@ -73,6 +68,7 @@ public class Q320_BonesTellTheFuture extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getRace() != Race.DARK_ELF)
{
htmltext = "30359-00.htm";
@@ -86,9 +82,10 @@ public class Q320_BonesTellTheFuture extends Quest
htmltext = "30359-03.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30359-05.htm";
}
@@ -101,6 +98,7 @@ public class Q320_BonesTellTheFuture extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -109,7 +107,7 @@ public class Q320_BonesTellTheFuture extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -117,7 +115,7 @@ public class Q320_BonesTellTheFuture extends Quest
if (st.dropItems(BONE_FRAGMENT, 1, 10, (npc.getNpcId() == 20517) ? 180000 : 200000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q324_SweetestVenom/Q324_SweetestVenom.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q324_SweetestVenom/Q324_SweetestVenom.java
index 00200ae22d..bd88c14d01 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q324_SweetestVenom/Q324_SweetestVenom.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q324_SweetestVenom/Q324_SweetestVenom.java
@@ -29,7 +29,6 @@ public class Q324_SweetestVenom extends Quest
{
// Item
private static final int VENOM_SAC = 1077;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -42,12 +41,9 @@ public class Q324_SweetestVenom extends Quest
public Q324_SweetestVenom()
{
super(324, "Sweetest Venom");
-
registerQuestItems(VENOM_SAC);
-
addStartNpc(30351); // Astaron
addTalkId(30351);
-
addKillId(20034, 20038, 20043);
}
@@ -63,9 +59,7 @@ public class Q324_SweetestVenom extends Quest
if (event.equals("30351-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -84,11 +78,13 @@ public class Q324_SweetestVenom extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 18) ? "30351-02.htm" : "30351-03.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30351-05.htm";
}
@@ -101,6 +97,7 @@ public class Q324_SweetestVenom extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -109,7 +106,7 @@ public class Q324_SweetestVenom extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -117,7 +114,7 @@ public class Q324_SweetestVenom extends Quest
if (st.dropItems(VENOM_SAC, 1, 10, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q325_GrimCollector/Q325_GrimCollector.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q325_GrimCollector/Q325_GrimCollector.java
index 3b21cd7ca1..a43422a83e 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q325_GrimCollector/Q325_GrimCollector.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q325_GrimCollector/Q325_GrimCollector.java
@@ -31,6 +31,10 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q325_GrimCollector extends Quest
{
+ // NPCs
+ private static final int CURTIS = 30336;
+ private static final int VARSAK = 30342;
+ private static final int SAMED = 30434;
// Items
private static final int ANATOMY_DIAGRAM = 1349;
private static final int ZOMBIE_HEAD = 1350;
@@ -42,12 +46,7 @@ public class Q325_GrimCollector extends Quest
private static final int ARM_BONE = 1356;
private static final int THIGH_BONE = 1357;
private static final int COMPLETE_SKELETON = 1358;
-
- // NPCs
- private static final int CURTIS = 30336;
- private static final int VARSAK = 30342;
- private static final int SAMED = 30434;
-
+ // Drops
private static final Map> DROPLIST = new HashMap<>();
static
{
@@ -66,16 +65,10 @@ public class Q325_GrimCollector extends Quest
public Q325_GrimCollector()
{
super(325, "Grim Collector");
-
registerQuestItems(ZOMBIE_HEAD, ZOMBIE_HEART, ZOMBIE_LIVER, SKULL, RIB_BONE, SPINE, ARM_BONE, THIGH_BONE, COMPLETE_SKELETON, ANATOMY_DIAGRAM);
-
addStartNpc(CURTIS);
addTalkId(CURTIS, VARSAK, SAMED);
-
- for (int npcId : DROPLIST.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(DROPLIST.keySet());
}
private static int getNumberOfPieces(QuestState st)
@@ -123,60 +116,67 @@ public class Q325_GrimCollector extends Quest
return htmltext;
}
- if (event.equals("30336-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30434-03.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.giveItems(ANATOMY_DIAGRAM, 1);
- }
- else if (event.equals("30434-06.htm"))
- {
- st.takeItems(ANATOMY_DIAGRAM, -1);
- payback(st);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30434-07.htm"))
- {
- payback(st);
- }
- else if (event.equals("30434-09.htm"))
- {
- final int skeletons = st.getQuestItemsCount(COMPLETE_SKELETON);
- if (skeletons > 0)
+ case "30336-03.htm":
{
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(COMPLETE_SKELETON, -1);
- st.rewardItems(57, 543 + (341 * skeletons));
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30342-03.htm"))
- {
- if (!st.hasQuestItems(SPINE, ARM_BONE, SKULL, RIB_BONE, THIGH_BONE))
+ case "30434-03.htm":
{
- htmltext = "30342-02.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.giveItems(ANATOMY_DIAGRAM, 1);
+ break;
}
- else
+ case "30434-06.htm":
{
- st.takeItems(SPINE, 1);
- st.takeItems(SKULL, 1);
- st.takeItems(ARM_BONE, 1);
- st.takeItems(RIB_BONE, 1);
- st.takeItems(THIGH_BONE, 1);
-
- if (Rnd.get(10) < 9)
+ st.takeItems(ANATOMY_DIAGRAM, -1);
+ payback(st);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30434-07.htm":
+ {
+ payback(st);
+ break;
+ }
+ case "30434-09.htm":
+ {
+ final int skeletons = st.getQuestItemsCount(COMPLETE_SKELETON);
+ if (skeletons > 0)
{
- st.giveItems(COMPLETE_SKELETON, 1);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(COMPLETE_SKELETON, -1);
+ st.rewardItems(57, 543 + (341 * skeletons));
+ }
+ break;
+ }
+ case "30342-03.htm":
+ {
+ if (!st.hasQuestItems(SPINE, ARM_BONE, SKULL, RIB_BONE, THIGH_BONE))
+ {
+ htmltext = "30342-02.htm";
}
else
{
- htmltext = "30342-04.htm";
+ st.takeItems(SPINE, 1);
+ st.takeItems(SKULL, 1);
+ st.takeItems(ARM_BONE, 1);
+ st.takeItems(RIB_BONE, 1);
+ st.takeItems(THIGH_BONE, 1);
+
+ if (Rnd.get(10) < 9)
+ {
+ st.giveItems(COMPLETE_SKELETON, 1);
+ }
+ else
+ {
+ htmltext = "30342-04.htm";
+ }
}
+ break;
}
}
@@ -196,17 +196,21 @@ public class Q325_GrimCollector extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30336-01.htm" : "30336-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case CURTIS:
+ {
htmltext = (!st.hasQuestItems(ANATOMY_DIAGRAM)) ? "30336-04.htm" : "30336-05.htm";
break;
-
+ }
case SAMED:
+ {
if (!st.hasQuestItems(ANATOMY_DIAGRAM))
{
htmltext = "30434-01.htm";
@@ -223,12 +227,15 @@ public class Q325_GrimCollector extends Quest
}
}
break;
-
+ }
case VARSAK:
+ {
htmltext = "30342-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q326_VanquishRemnants/Q326_VanquishRemnants.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q326_VanquishRemnants/Q326_VanquishRemnants.java
index 4c2725b06e..8718706951 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q326_VanquishRemnants/Q326_VanquishRemnants.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q326_VanquishRemnants/Q326_VanquishRemnants.java
@@ -28,19 +28,15 @@ public class Q326_VanquishRemnants extends Quest
private static final int RED_CROSS_BADGE = 1359;
private static final int BLUE_CROSS_BADGE = 1360;
private static final int BLACK_CROSS_BADGE = 1361;
-
// Reward
private static final int BLACK_LION_MARK = 1369;
public Q326_VanquishRemnants()
{
super(326, "Vanquish Remnants");
-
registerQuestItems(RED_CROSS_BADGE, BLUE_CROSS_BADGE, BLACK_CROSS_BADGE);
-
addStartNpc(30435); // Leopold
addTalkId(30435);
-
addKillId(20053, 20437, 20058, 20436, 20061, 20439, 20063, 20066, 20438);
}
@@ -56,9 +52,7 @@ public class Q326_VanquishRemnants extends Quest
if (event.equals("30435-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30435-07.htm"))
{
@@ -82,10 +76,12 @@ public class Q326_VanquishRemnants extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 21) ? "30435-01.htm" : "30435-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int redBadges = st.getQuestItemsCount(RED_CROSS_BADGE);
final int blueBadges = st.getQuestItemsCount(BLUE_CROSS_BADGE);
final int blackBadges = st.getQuestItemsCount(BLACK_CROSS_BADGE);
@@ -119,6 +115,7 @@ public class Q326_VanquishRemnants extends Quest
htmltext = "30435-04.htm";
}
break;
+ }
}
return htmltext;
@@ -138,20 +135,24 @@ public class Q326_VanquishRemnants extends Quest
case 20053:
case 20437:
case 20058:
+ {
st.dropItems(RED_CROSS_BADGE, 1, 0, 330000);
break;
-
+ }
case 20436:
case 20061:
case 20439:
case 20063:
+ {
st.dropItems(BLUE_CROSS_BADGE, 1, 0, 160000);
break;
-
+ }
case 20066:
case 20438:
+ {
st.dropItems(BLACK_CROSS_BADGE, 1, 0, 120000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q327_RecoverTheFarmland/Q327_RecoverTheFarmland.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q327_RecoverTheFarmland/Q327_RecoverTheFarmland.java
index 8807f8a48a..db82cc673a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q327_RecoverTheFarmland/Q327_RecoverTheFarmland.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q327_RecoverTheFarmland/Q327_RecoverTheFarmland.java
@@ -28,6 +28,20 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q327_RecoverTheFarmland extends Quest
{
+ // NPCs
+ private static final int LEIKAN = 30382;
+ private static final int PIOTUR = 30597;
+ private static final int IRIS = 30034;
+ private static final int ASHA = 30313;
+ private static final int NESTLE = 30314;
+ // Monsters
+ private static final int TUREK_ORC_WARLORD = 20495;
+ private static final int TUREK_ORC_ARCHER = 20496;
+ private static final int TUREK_ORC_SKIRMISHER = 20497;
+ private static final int TUREK_ORC_SUPPLIER = 20498;
+ private static final int TUREK_ORC_FOOTMAN = 20499;
+ private static final int TUREK_ORC_SENTINEL = 20500;
+ private static final int TUREK_ORC_SHAMAN = 20501;
// Items
private static final int LEIKAN_LETTER = 5012;
private static final int TUREK_DOGTAG = 1846;
@@ -40,7 +54,6 @@ public class Q327_RecoverTheFarmland extends Quest
private static final int ANCIENT_BRASS_TIARA = 1853;
private static final int ANCIENT_BRONZE_MIRROR = 1854;
private static final int ANCIENT_JADE_NECKLACE = 1855;
-
// Rewards
private static final int ADENA = 57;
private static final int SOULSHOT_D = 1463;
@@ -50,63 +63,19 @@ public class Q327_RecoverTheFarmland extends Quest
private static final int POTION_OF_ALACRITY = 735;
private static final int SCROLL_OF_ESCAPE = 736;
private static final int SCROLL_OF_RESURRECTION = 737;
-
- // NPCs
- private static final int LEIKAN = 30382;
- private static final int PIOTUR = 30597;
- private static final int IRIS = 30034;
- private static final int ASHA = 30313;
- private static final int NESTLE = 30314;
-
- // Monsters
- private static final int TUREK_ORC_WARLORD = 20495;
- private static final int TUREK_ORC_ARCHER = 20496;
- private static final int TUREK_ORC_SKIRMISHER = 20497;
- private static final int TUREK_ORC_SUPPLIER = 20498;
- private static final int TUREK_ORC_FOOTMAN = 20499;
- private static final int TUREK_ORC_SENTINEL = 20500;
- private static final int TUREK_ORC_SHAMAN = 20501;
-
// Chances
private static final int[][] DROPLIST =
{
- {
- TUREK_ORC_ARCHER,
- 140000,
- TUREK_DOGTAG
- },
- {
- TUREK_ORC_SKIRMISHER,
- 70000,
- TUREK_DOGTAG
- },
- {
- TUREK_ORC_SUPPLIER,
- 120000,
- TUREK_DOGTAG
- },
- {
- TUREK_ORC_FOOTMAN,
- 100000,
- TUREK_DOGTAG
- },
- {
- TUREK_ORC_SENTINEL,
- 80000,
- TUREK_DOGTAG
- },
- {
- TUREK_ORC_SHAMAN,
- 90000,
- TUREK_MEDALLION
- },
- {
- TUREK_ORC_WARLORD,
- 180000,
- TUREK_MEDALLION
- }
+ // @formatter:off
+ {TUREK_ORC_ARCHER, 140000, TUREK_DOGTAG},
+ {TUREK_ORC_SKIRMISHER, 70000, TUREK_DOGTAG},
+ {TUREK_ORC_SUPPLIER, 120000, TUREK_DOGTAG},
+ {TUREK_ORC_FOOTMAN, 100000, TUREK_DOGTAG},
+ {TUREK_ORC_SENTINEL, 80000, TUREK_DOGTAG},
+ {TUREK_ORC_SHAMAN, 90000, TUREK_MEDALLION},
+ {TUREK_ORC_WARLORD, 180000, TUREK_MEDALLION}
+ // @formatter:on
};
-
// Exp
private static final Map EXP_REWARD = new HashMap<>();
static
@@ -120,12 +89,9 @@ public class Q327_RecoverTheFarmland extends Quest
public Q327_RecoverTheFarmland()
{
super(327, "Recover the Farmland");
-
registerQuestItems(LEIKAN_LETTER);
-
addStartNpc(LEIKAN, PIOTUR);
addTalkId(LEIKAN, PIOTUR, IRIS, ASHA, NESTLE);
-
addKillId(TUREK_ORC_WARLORD, TUREK_ORC_ARCHER, TUREK_ORC_SKIRMISHER, TUREK_ORC_SUPPLIER, TUREK_ORC_FOOTMAN, TUREK_ORC_SENTINEL, TUREK_ORC_SHAMAN);
}
@@ -139,229 +105,243 @@ public class Q327_RecoverTheFarmland extends Quest
return htmltext;
}
- // Piotur
- if (event.equals("30597-03.htm") && (st.getInt("cond") < 1))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30597-06.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- // Leikan
- else if (event.equals("30382-03.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LEIKAN_LETTER, 1);
- }
- // Asha
- else if (event.equals("30313-02.htm"))
- {
- if (st.getQuestItemsCount(CLAY_URN_FRAGMENT) >= 5)
+ case "30597-03.htm":
{
- st.takeItems(CLAY_URN_FRAGMENT, 5);
- if (Rnd.get(6) < 5)
+ if ((st.getCond() < 1))
{
- htmltext = "30313-03.htm";
- st.rewardItems(ANCIENT_CLAY_URN, 1);
+ st.startQuest();
+ }
+ break;
+ }
+ case "30597-06.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30382-03.htm":
+ {
+ st.startQuest();
+ st.setCond(2);
+ st.giveItems(LEIKAN_LETTER, 1);
+ break;
+ }
+ case "30313-02.htm":
+ {
+ if (st.getQuestItemsCount(CLAY_URN_FRAGMENT) >= 5)
+ {
+ st.takeItems(CLAY_URN_FRAGMENT, 5);
+ if (Rnd.get(6) < 5)
+ {
+ htmltext = "30313-03.htm";
+ st.rewardItems(ANCIENT_CLAY_URN, 1);
+ }
+ else
+ {
+ htmltext = "30313-10.htm";
+ }
+ }
+ break;
+ }
+ case "30313-04.htm":
+ {
+ if (st.getQuestItemsCount(BRASS_TRINKET_PIECE) >= 5)
+ {
+ st.takeItems(BRASS_TRINKET_PIECE, 5);
+ if (Rnd.get(7) < 6)
+ {
+ htmltext = "30313-05.htm";
+ st.rewardItems(ANCIENT_BRASS_TIARA, 1);
+ }
+ else
+ {
+ htmltext = "30313-10.htm";
+ }
+ }
+ break;
+ }
+ case "30313-06.htm":
+ {
+ if (st.getQuestItemsCount(BRONZE_MIRROR_PIECE) >= 5)
+ {
+ st.takeItems(BRONZE_MIRROR_PIECE, 5);
+ if (Rnd.get(7) < 6)
+ {
+ htmltext = "30313-07.htm";
+ st.rewardItems(ANCIENT_BRONZE_MIRROR, 1);
+ }
+ else
+ {
+ htmltext = "30313-10.htm";
+ }
+ }
+ break;
+ }
+ case "30313-08.htm":
+ {
+ if (st.getQuestItemsCount(JADE_NECKLACE_BEAD) >= 5)
+ {
+ st.takeItems(JADE_NECKLACE_BEAD, 5);
+ if (Rnd.get(8) < 7)
+ {
+ htmltext = "30313-09.htm";
+ st.rewardItems(ANCIENT_JADE_NECKLACE, 1);
+ }
+ else
+ {
+ htmltext = "30313-10.htm";
+ }
+ }
+ break;
+ }
+ case "30034-03.htm":
+ {
+ final int n = st.getQuestItemsCount(CLAY_URN_FRAGMENT);
+ if (n == 0)
+ {
+ htmltext = "30034-02.htm";
}
else
{
- htmltext = "30313-10.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(CLAY_URN_FRAGMENT, n);
+ st.rewardExpAndSp(n * 307, 0);
}
+ break;
}
- }
- else if (event.equals("30313-04.htm"))
- {
- if (st.getQuestItemsCount(BRASS_TRINKET_PIECE) >= 5)
+ case "30034-04.htm":
{
- st.takeItems(BRASS_TRINKET_PIECE, 5);
- if (Rnd.get(7) < 6)
+ final int n = st.getQuestItemsCount(BRASS_TRINKET_PIECE);
+ if (n == 0)
{
- htmltext = "30313-05.htm";
- st.rewardItems(ANCIENT_BRASS_TIARA, 1);
+ htmltext = "30034-02.htm";
}
else
{
- htmltext = "30313-10.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BRASS_TRINKET_PIECE, n);
+ st.rewardExpAndSp(n * 368, 0);
}
+ break;
}
- }
- else if (event.equals("30313-06.htm"))
- {
- if (st.getQuestItemsCount(BRONZE_MIRROR_PIECE) >= 5)
+ case "30034-05.htm":
{
- st.takeItems(BRONZE_MIRROR_PIECE, 5);
- if (Rnd.get(7) < 6)
+ final int n = st.getQuestItemsCount(BRONZE_MIRROR_PIECE);
+ if (n == 0)
{
- htmltext = "30313-07.htm";
- st.rewardItems(ANCIENT_BRONZE_MIRROR, 1);
+ htmltext = "30034-02.htm";
}
else
{
- htmltext = "30313-10.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BRONZE_MIRROR_PIECE, n);
+ st.rewardExpAndSp(n * 368, 0);
}
+ break;
}
- }
- else if (event.equals("30313-08.htm"))
- {
- if (st.getQuestItemsCount(JADE_NECKLACE_BEAD) >= 5)
+ case "30034-06.htm":
{
- st.takeItems(JADE_NECKLACE_BEAD, 5);
- if (Rnd.get(8) < 7)
+ final int n = st.getQuestItemsCount(JADE_NECKLACE_BEAD);
+ if (n == 0)
{
- htmltext = "30313-09.htm";
- st.rewardItems(ANCIENT_JADE_NECKLACE, 1);
+ htmltext = "30034-02.htm";
}
else
{
- htmltext = "30313-10.htm";
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(JADE_NECKLACE_BEAD, n);
+ st.rewardExpAndSp(n * 430, 0);
}
+ break;
}
- }
- // Iris
- else if (event.equals("30034-03.htm"))
- {
- final int n = st.getQuestItemsCount(CLAY_URN_FRAGMENT);
- if (n == 0)
+ case "30034-07.htm":
{
- htmltext = "30034-02.htm";
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(CLAY_URN_FRAGMENT, n);
- st.rewardExpAndSp(n * 307, 0);
- }
- }
- else if (event.equals("30034-04.htm"))
- {
- final int n = st.getQuestItemsCount(BRASS_TRINKET_PIECE);
- if (n == 0)
- {
- htmltext = "30034-02.htm";
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BRASS_TRINKET_PIECE, n);
- st.rewardExpAndSp(n * 368, 0);
- }
- }
- else if (event.equals("30034-05.htm"))
- {
- final int n = st.getQuestItemsCount(BRONZE_MIRROR_PIECE);
- if (n == 0)
- {
- htmltext = "30034-02.htm";
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BRONZE_MIRROR_PIECE, n);
- st.rewardExpAndSp(n * 368, 0);
- }
- }
- else if (event.equals("30034-06.htm"))
- {
- final int n = st.getQuestItemsCount(JADE_NECKLACE_BEAD);
- if (n == 0)
- {
- htmltext = "30034-02.htm";
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(JADE_NECKLACE_BEAD, n);
- st.rewardExpAndSp(n * 430, 0);
- }
- }
- else if (event.equals("30034-07.htm"))
- {
- boolean isRewarded = false;
- for (int i = 1852; i < 1856; i++)
- {
- final int n = st.getQuestItemsCount(i);
- if (n > 0)
+ boolean isRewarded = false;
+ for (int i = 1852; i < 1856; i++)
{
- st.takeItems(i, n);
- st.rewardExpAndSp(n * EXP_REWARD.get(i), 0);
- isRewarded = true;
+ final int n = st.getQuestItemsCount(i);
+ if (n > 0)
+ {
+ st.takeItems(i, n);
+ st.rewardExpAndSp(n * EXP_REWARD.get(i), 0);
+ isRewarded = true;
+ }
}
- }
- if (!isRewarded)
- {
- htmltext = "30034-02.htm";
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- }
- // Nestle
- else if (event.equals("30314-03.htm"))
- {
- if (!st.hasQuestItems(ANCIENT_CLAY_URN))
- {
- htmltext = "30314-07.htm";
- }
- else
- {
- st.takeItems(ANCIENT_CLAY_URN, 1);
- st.rewardItems(SOULSHOT_D, 70 + Rnd.get(41));
- }
- }
- else if (event.equals("30314-04.htm"))
- {
- if (!st.hasQuestItems(ANCIENT_BRASS_TIARA))
- {
- htmltext = "30314-07.htm";
- }
- else
- {
- st.takeItems(ANCIENT_BRASS_TIARA, 1);
- final int rnd = Rnd.get(100);
- if (rnd < 40)
+ if (!isRewarded)
{
- st.rewardItems(HEALING_POTION, 1);
- }
- else if (rnd < 84)
- {
- st.rewardItems(HASTE_POTION, 1);
+ htmltext = "30034-02.htm";
}
else
{
- st.rewardItems(POTION_OF_ALACRITY, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
}
+ break;
}
- }
- else if (event.equals("30314-05.htm"))
- {
- if (!st.hasQuestItems(ANCIENT_BRONZE_MIRROR))
+ case "30314-03.htm":
{
- htmltext = "30314-07.htm";
+ if (!st.hasQuestItems(ANCIENT_CLAY_URN))
+ {
+ htmltext = "30314-07.htm";
+ }
+ else
+ {
+ st.takeItems(ANCIENT_CLAY_URN, 1);
+ st.rewardItems(SOULSHOT_D, 70 + Rnd.get(41));
+ }
+ break;
}
- else
+ case "30314-04.htm":
{
- st.takeItems(ANCIENT_BRONZE_MIRROR, 1);
- st.rewardItems((Rnd.get(100) < 59) ? SCROLL_OF_ESCAPE : SCROLL_OF_RESURRECTION, 1);
+ if (!st.hasQuestItems(ANCIENT_BRASS_TIARA))
+ {
+ htmltext = "30314-07.htm";
+ }
+ else
+ {
+ st.takeItems(ANCIENT_BRASS_TIARA, 1);
+ final int rnd = Rnd.get(100);
+ if (rnd < 40)
+ {
+ st.rewardItems(HEALING_POTION, 1);
+ }
+ else if (rnd < 84)
+ {
+ st.rewardItems(HASTE_POTION, 1);
+ }
+ else
+ {
+ st.rewardItems(POTION_OF_ALACRITY, 1);
+ }
+ }
+ break;
}
- }
- else if (event.equals("30314-06.htm"))
- {
- if (!st.hasQuestItems(ANCIENT_JADE_NECKLACE))
+ case "30314-05.htm":
{
- htmltext = "30314-07.htm";
+ if (!st.hasQuestItems(ANCIENT_BRONZE_MIRROR))
+ {
+ htmltext = "30314-07.htm";
+ }
+ else
+ {
+ st.takeItems(ANCIENT_BRONZE_MIRROR, 1);
+ st.rewardItems((Rnd.get(100) < 59) ? SCROLL_OF_ESCAPE : SCROLL_OF_RESURRECTION, 1);
+ }
+ break;
}
- else
+ case "30314-06.htm":
{
- st.takeItems(ANCIENT_JADE_NECKLACE, 1);
- st.rewardItems(SPIRITSHOT_D, 50 + Rnd.get(41));
+ if (!st.hasQuestItems(ANCIENT_JADE_NECKLACE))
+ {
+ htmltext = "30314-07.htm";
+ }
+ else
+ {
+ st.takeItems(ANCIENT_JADE_NECKLACE, 1);
+ st.rewardItems(SPIRITSHOT_D, 50 + Rnd.get(41));
+ }
+ break;
}
}
@@ -381,14 +361,17 @@ public class Q327_RecoverTheFarmland extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = npc.getNpcId() + ((player.getLevel() < 25) ? "-01.htm" : "-02.htm");
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case PIOTUR:
+ {
if (!st.hasQuestItems(LEIKAN_LETTER))
{
if (st.hasAtLeastOneQuestItem(TUREK_DOGTAG, TUREK_MEDALLION))
@@ -397,7 +380,7 @@ public class Q327_RecoverTheFarmland extends Quest
if (cond < 4)
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
@@ -415,13 +398,14 @@ public class Q327_RecoverTheFarmland extends Quest
else
{
htmltext = "30597-03a.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LEIKAN_LETTER, 1);
}
break;
-
+ }
case LEIKAN:
+ {
if (cond == 2)
{
htmltext = "30382-04.htm";
@@ -429,7 +413,7 @@ public class Q327_RecoverTheFarmland extends Quest
else if ((cond == 3) || (cond == 4))
{
htmltext = "30382-05.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
@@ -437,12 +421,15 @@ public class Q327_RecoverTheFarmland extends Quest
htmltext = "30382-05.htm";
}
break;
-
+ }
default:
+ {
htmltext = npc.getNpcId() + "-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q328_SenseForBusiness/Q328_SenseForBusiness.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q328_SenseForBusiness/Q328_SenseForBusiness.java
index 20fb529034..6ac792457e 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q328_SenseForBusiness/Q328_SenseForBusiness.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q328_SenseForBusiness/Q328_SenseForBusiness.java
@@ -32,7 +32,6 @@ public class Q328_SenseForBusiness extends Quest
private static final int MONSTER_EYE_LENS = 1366;
private static final int MONSTER_EYE_CARCASS = 1347;
private static final int BASILISK_GIZZARD = 1348;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -48,12 +47,9 @@ public class Q328_SenseForBusiness extends Quest
public Q328_SenseForBusiness()
{
super(328, "Sense for Business");
-
registerQuestItems(MONSTER_EYE_LENS, MONSTER_EYE_CARCASS, BASILISK_GIZZARD);
-
addStartNpc(30436); // Sarien
addTalkId(30436);
-
addKillId(20055, 20059, 20067, 20068, 20070, 20072);
}
@@ -69,9 +65,7 @@ public class Q328_SenseForBusiness extends Quest
if (event.equals("30436-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30436-06.htm"))
{
@@ -95,10 +89,12 @@ public class Q328_SenseForBusiness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 21) ? "30436-01.htm" : "30436-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int carcasses = st.getQuestItemsCount(MONSTER_EYE_CARCASS);
final int lenses = st.getQuestItemsCount(MONSTER_EYE_LENS);
final int gizzards = st.getQuestItemsCount(BASILISK_GIZZARD);
@@ -116,6 +112,7 @@ public class Q328_SenseForBusiness extends Quest
st.rewardItems(57, (25 * carcasses) + (1000 * lenses) + (60 * gizzards) + ((all >= 10) ? 618 : 0));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q329_CuriosityOfADwarf/Q329_CuriosityOfADwarf.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q329_CuriosityOfADwarf/Q329_CuriosityOfADwarf.java
index 48f7234fd0..afdfa134ed 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q329_CuriosityOfADwarf/Q329_CuriosityOfADwarf.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q329_CuriosityOfADwarf/Q329_CuriosityOfADwarf.java
@@ -32,10 +32,8 @@ public class Q329_CuriosityOfADwarf extends Quest
public Q329_CuriosityOfADwarf()
{
super(329, "Curiosity of a Dwarf");
-
addStartNpc(30437); // Rolento
addTalkId(30437);
-
addKillId(20083, 20085); // Granite golem, Puncher
}
@@ -51,9 +49,7 @@ public class Q329_CuriosityOfADwarf extends Quest
if (event.equals("30437-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30437-06.htm"))
{
@@ -77,10 +73,12 @@ public class Q329_CuriosityOfADwarf extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 33) ? "30437-01.htm" : "30437-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int golem = st.getQuestItemsCount(GOLEM_HEARTSTONE);
final int broken = st.getQuestItemsCount(BROKEN_HEARTSTONE);
if ((golem + broken) == 0)
@@ -95,6 +93,7 @@ public class Q329_CuriosityOfADwarf extends Quest
st.rewardItems(57, (broken * 50) + (golem * 1000) + (((golem + broken) > 10) ? 1183 : 0));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q330_AdeptOfTaste/Q330_AdeptOfTaste.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q330_AdeptOfTaste/Q330_AdeptOfTaste.java
index 1a612e8f47..e42430a16b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q330_AdeptOfTaste/Q330_AdeptOfTaste.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q330_AdeptOfTaste/Q330_AdeptOfTaste.java
@@ -36,7 +36,6 @@ public class Q330_AdeptOfTaste extends Quest
private static final int PANO = 30078;
private static final int MIRIEN = 30461;
private static final int JONAS = 30469;
-
// Items
private static final int INGREDIENT_LIST = 1420;
private static final int SONIA_BOTANY_BOOK = 1421;
@@ -70,57 +69,30 @@ public class Q330_AdeptOfTaste extends Quest
private static final int MIRIEN_REVIEW_3 = 1449;
private static final int MIRIEN_REVIEW_4 = 1450;
private static final int MIRIEN_REVIEW_5 = 1451;
-
// Rewards
private static final int JONAS_SALAD_RECIPE = 1455;
private static final int JONAS_SAUCE_RECIPE = 1456;
private static final int JONAS_STEAK_RECIPE = 1457;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
{
- CHANCES.put(20204, new int[]
- {
- 92,
- 100
- });
- CHANCES.put(20229, new int[]
- {
- 80,
- 95
- });
- CHANCES.put(20223, new int[]
- {
- 70,
- 77
- });
- CHANCES.put(20154, new int[]
- {
- 70,
- 77
- });
- CHANCES.put(20155, new int[]
- {
- 87,
- 96
- });
- CHANCES.put(20156, new int[]
- {
- 77,
- 85
- });
+ // @formatter:off
+ CHANCES.put(20204, new int[]{92, 100});
+ CHANCES.put(20229, new int[]{80, 95});
+ CHANCES.put(20223, new int[]{70, 77});
+ CHANCES.put(20154, new int[]{70, 77});
+ CHANCES.put(20155, new int[]{87, 96});
+ CHANCES.put(20156, new int[]{77, 85});
+ // @formatter:on
}
public Q330_AdeptOfTaste()
{
super(330, "Adept of Taste");
-
registerQuestItems(INGREDIENT_LIST, RED_MANDRAGORA_SAP, WHITE_MANDRAGORA_SAP, HONEY, GOLDEN_HONEY, DIONIAN_POTATO, GREEN_MOSS_BUNDLE, BROWN_MOSS_BUNDLE, MONSTER_EYE_MEAT, MIRIEN_REVIEW_1, MIRIEN_REVIEW_2, MIRIEN_REVIEW_3, MIRIEN_REVIEW_4, MIRIEN_REVIEW_5, JONAS_STEAK_DISH_1, JONAS_STEAK_DISH_2, JONAS_STEAK_DISH_3, JONAS_STEAK_DISH_4, JONAS_STEAK_DISH_5, SONIA_BOTANY_BOOK, RED_MANDRAGORA_ROOT, WHITE_MANDRAGORA_ROOT, JACOB_INSECT_BOOK, NECTAR, ROYAL_JELLY, PANO_CONTRACT, HOBGOBLIN_AMULET, GLYVKA_BOTANY_BOOK, GREEN_MARSH_MOSS, BROWN_MARSH_MOSS, ROLANT_CREATURE_BOOK, MONSTER_EYE_BODY);
-
addStartNpc(JONAS); // Jonas
addTalkId(JONAS, SONIA, GLYVKA, ROLLANT, JACOB, PANO, MIRIEN);
-
addKillId(20147, 20154, 20155, 20156, 20204, 20223, 20226, 20228, 20229, 20265, 20266);
}
@@ -134,36 +106,41 @@ public class Q330_AdeptOfTaste extends Quest
return htmltext;
}
- if (event.equals("30469-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(INGREDIENT_LIST, 1);
- }
- else if (event.equals("30062-05.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(SONIA_BOTANY_BOOK, 1);
- st.takeItems(RED_MANDRAGORA_ROOT, -1);
- st.takeItems(WHITE_MANDRAGORA_ROOT, -1);
- st.giveItems(RED_MANDRAGORA_SAP, 1);
- }
- else if (event.equals("30073-05.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(JACOB_INSECT_BOOK, 1);
- st.takeItems(NECTAR, -1);
- st.takeItems(ROYAL_JELLY, -1);
- st.giveItems(HONEY, 1);
- }
- else if (event.equals("30067-05.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(GLYVKA_BOTANY_BOOK, 1);
- st.takeItems(GREEN_MARSH_MOSS, -1);
- st.takeItems(BROWN_MARSH_MOSS, -1);
- st.giveItems(GREEN_MOSS_BUNDLE, 1);
+ case "30469-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(INGREDIENT_LIST, 1);
+ break;
+ }
+ case "30062-05.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(SONIA_BOTANY_BOOK, 1);
+ st.takeItems(RED_MANDRAGORA_ROOT, -1);
+ st.takeItems(WHITE_MANDRAGORA_ROOT, -1);
+ st.giveItems(RED_MANDRAGORA_SAP, 1);
+ break;
+ }
+ case "30073-05.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(JACOB_INSECT_BOOK, 1);
+ st.takeItems(NECTAR, -1);
+ st.takeItems(ROYAL_JELLY, -1);
+ st.giveItems(HONEY, 1);
+ break;
+ }
+ case "30067-05.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(GLYVKA_BOTANY_BOOK, 1);
+ st.takeItems(GREEN_MARSH_MOSS, -1);
+ st.takeItems(BROWN_MARSH_MOSS, -1);
+ st.giveItems(GREEN_MOSS_BUNDLE, 1);
+ break;
+ }
}
return htmltext;
@@ -182,13 +159,16 @@ public class Q330_AdeptOfTaste extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 24) ? "30469-01.htm" : "30469-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case JONAS:
+ {
if (st.hasQuestItems(INGREDIENT_LIST))
{
if (!hasAllIngredients(st))
@@ -273,8 +253,9 @@ public class Q330_AdeptOfTaste extends Quest
st.exitQuest(true);
}
break;
-
+ }
case MIRIEN:
+ {
if (st.hasQuestItems(INGREDIENT_LIST))
{
htmltext = "30461-01.htm";
@@ -318,8 +299,9 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30461-04.htm";
}
break;
-
+ }
case SONIA:
+ {
if (!st.hasQuestItems(RED_MANDRAGORA_SAP) && !st.hasQuestItems(WHITE_MANDRAGORA_SAP))
{
if (!st.hasQuestItems(SONIA_BOTANY_BOOK))
@@ -354,8 +336,9 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30062-07.htm";
}
break;
-
+ }
case JACOB:
+ {
if (!st.hasQuestItems(HONEY) && !st.hasQuestItems(GOLDEN_HONEY))
{
if (!st.hasQuestItems(JACOB_INSECT_BOOK))
@@ -393,8 +376,9 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30073-07.htm";
}
break;
-
+ }
case PANO:
+ {
if (!st.hasQuestItems(DIONIAN_POTATO))
{
if (!st.hasQuestItems(PANO_CONTRACT))
@@ -424,8 +408,9 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30078-04.htm";
}
break;
-
+ }
case GLYVKA:
+ {
if (!st.hasQuestItems(GREEN_MOSS_BUNDLE) && !st.hasQuestItems(BROWN_MOSS_BUNDLE))
{
if (!st.hasQuestItems(GLYVKA_BOTANY_BOOK))
@@ -460,8 +445,9 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30067-07.htm";
}
break;
-
+ }
case ROLLANT:
+ {
if (!st.hasQuestItems(MONSTER_EYE_MEAT))
{
if (!st.hasQuestItems(ROLANT_CREATURE_BOOK))
@@ -491,8 +477,10 @@ public class Q330_AdeptOfTaste extends Quest
htmltext = "30069-04.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -508,46 +496,51 @@ public class Q330_AdeptOfTaste extends Quest
}
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case 20265:
+ {
if (st.hasQuestItems(ROLANT_CREATURE_BOOK))
{
st.dropItems(MONSTER_EYE_BODY, (Rnd.get(97) < 77) ? 2 : 3, 30, 970000);
}
break;
-
+ }
case 20266:
+ {
if (st.hasQuestItems(ROLANT_CREATURE_BOOK))
{
st.dropItemsAlways(MONSTER_EYE_BODY, (Rnd.get(10) < 7) ? 1 : 2, 30);
}
break;
-
+ }
case 20226:
+ {
if (st.hasQuestItems(GLYVKA_BOTANY_BOOK))
{
st.dropItems(((Rnd.get(96) < 87) ? GREEN_MARSH_MOSS : BROWN_MARSH_MOSS), 1, 20, 960000);
}
break;
-
+ }
case 20228:
+ {
if (st.hasQuestItems(GLYVKA_BOTANY_BOOK))
{
st.dropItemsAlways(((Rnd.get(10) < 9) ? GREEN_MARSH_MOSS : BROWN_MARSH_MOSS), 1, 20);
}
break;
-
+ }
case 20147:
+ {
if (st.hasQuestItems(PANO_CONTRACT))
{
st.dropItemsAlways(HOBGOBLIN_AMULET, 1, 30);
}
break;
-
+ }
case 20204:
case 20229:
+ {
if (st.hasQuestItems(JACOB_INSECT_BOOK))
{
final int random = Rnd.get(100);
@@ -562,11 +555,12 @@ public class Q330_AdeptOfTaste extends Quest
}
}
break;
-
+ }
case 20223:
case 20154:
case 20155:
case 20156:
+ {
if (st.hasQuestItems(SONIA_BOTANY_BOOK))
{
final int random = Rnd.get(100);
@@ -577,6 +571,7 @@ public class Q330_AdeptOfTaste extends Quest
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q331_ArrowOfVengeance/Q331_ArrowOfVengeance.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q331_ArrowOfVengeance/Q331_ArrowOfVengeance.java
index db313cf134..75f92a983b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q331_ArrowOfVengeance/Q331_ArrowOfVengeance.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q331_ArrowOfVengeance/Q331_ArrowOfVengeance.java
@@ -32,12 +32,9 @@ public class Q331_ArrowOfVengeance extends Quest
public Q331_ArrowOfVengeance()
{
super(331, "Arrow of Vengeance");
-
registerQuestItems(HARPY_FEATHER, MEDUSA_VENOM, WYRM_TOOTH);
-
addStartNpc(30125); // Belton
addTalkId(30125);
-
addKillId(20145, 20158, 20176);
}
@@ -53,9 +50,7 @@ public class Q331_ArrowOfVengeance extends Quest
if (event.equals("30125-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30125-06.htm"))
{
@@ -79,10 +74,12 @@ public class Q331_ArrowOfVengeance extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 32) ? "30125-01.htm" : "30125-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int harpyFeather = st.getQuestItemsCount(HARPY_FEATHER);
final int medusaVenom = st.getQuestItemsCount(MEDUSA_VENOM);
final int wyrmTooth = st.getQuestItemsCount(WYRM_TOOTH);
@@ -107,6 +104,7 @@ public class Q331_ArrowOfVengeance extends Quest
htmltext = "30125-04.htm";
}
break;
+ }
}
return htmltext;
@@ -124,16 +122,20 @@ public class Q331_ArrowOfVengeance extends Quest
switch (npc.getNpcId())
{
case 20145:
+ {
st.dropItems(HARPY_FEATHER, 1, 0, 500000);
break;
-
+ }
case 20158:
+ {
st.dropItems(MEDUSA_VENOM, 1, 0, 500000);
break;
-
+ }
case 20176:
+ {
st.dropItems(WYRM_TOOTH, 1, 0, 500000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q333_HuntOfTheBlackLion/Q333_HuntOfTheBlackLion.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q333_HuntOfTheBlackLion/Q333_HuntOfTheBlackLion.java
index 40b2af2da9..67112b5dad 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q333_HuntOfTheBlackLion/Q333_HuntOfTheBlackLion.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q333_HuntOfTheBlackLion/Q333_HuntOfTheBlackLion.java
@@ -32,10 +32,8 @@ public class Q333_HuntOfTheBlackLion extends Quest
private static final int UNDRIAS = 30130;
private static final int LOCKIRIN = 30531;
private static final int MORGAN = 30737;
-
// Needs for start
private static final int BLACK_LION_MARK = 1369;
-
// Quest items
private static final int LION_CLAW = 3675;
private static final int LION_EYE = 3676;
@@ -48,7 +46,6 @@ public class Q333_HuntOfTheBlackLion extends Quest
private static final int SOPHYA_LETTER_2 = 3672;
private static final int SOPHYA_LETTER_3 = 3673;
private static final int SOPHYA_LETTER_4 = 3674;
-
private static final int CARGO_BOX_1 = 3440;
private static final int CARGO_BOX_2 = 3441;
private static final int CARGO_BOX_3 = 3442;
@@ -76,7 +73,6 @@ public class Q333_HuntOfTheBlackLion extends Quest
private static final int TABLET_FRAGMENT_3 = 3464;
private static final int TABLET_FRAGMENT_4 = 3465;
private static final int COMPLETE_TABLET = 3466;
-
// Neutral items
private static final int ADENA = 57;
private static final int SWIFT_ATTACK_POTION = 735;
@@ -84,173 +80,41 @@ public class Q333_HuntOfTheBlackLion extends Quest
private static final int HEALING_POTION = 1061;
private static final int SOULSHOT_D = 1463;
private static final int SPIRITSHOT_D = 2510;
-
// Tabs: Part, NpcId, ItemId, Item Chance, Box Id, Box Chance
private static final int[][] DROPLIST =
{
+ // @formatter:off
// Part #1 - Execution Ground
- {
- SOPHYA_LETTER_1,
- 20160,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 90000
- }, // Neer Crawler
- {
- SOPHYA_LETTER_1,
- 20171,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 60000
- }, // Specter
- {
- SOPHYA_LETTER_1,
- 20197,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 70000
- }, // Sorrow Maiden
- {
- SOPHYA_LETTER_1,
- 20198,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 80000
- }, // Neer Ghoul Berserker
- {
- SOPHYA_LETTER_1,
- 20200,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 100000
- }, // Strain
- {
- SOPHYA_LETTER_1,
- 20201,
- UNDEAD_ASH,
- 500000,
- CARGO_BOX_1,
- 110000
- }, // Ghoul
-
+ {SOPHYA_LETTER_1, 20160, UNDEAD_ASH, 500000, CARGO_BOX_1, 90000}, // Neer Crawler
+ {SOPHYA_LETTER_1, 20171, UNDEAD_ASH, 500000, CARGO_BOX_1, 60000}, // Specter
+ {SOPHYA_LETTER_1, 20197, UNDEAD_ASH, 500000, CARGO_BOX_1, 70000}, // Sorrow Maiden
+ {SOPHYA_LETTER_1, 20198, UNDEAD_ASH, 500000, CARGO_BOX_1, 80000}, // Neer Ghoul Berserker
+ {SOPHYA_LETTER_1, 20200, UNDEAD_ASH, 500000, CARGO_BOX_1, 100000}, // Strain
+ {SOPHYA_LETTER_1, 20201, UNDEAD_ASH, 500000, CARGO_BOX_1, 110000}, // Ghoul
// Part #2 - Partisan Hideaway
- {
- SOPHYA_LETTER_2,
- 20207,
- BLOODY_AXE_INSIGNIA,
- 500000,
- CARGO_BOX_2,
- 60000
- }, // Ol Mahum Guerilla
- {
- SOPHYA_LETTER_2,
- 20208,
- BLOODY_AXE_INSIGNIA,
- 500000,
- CARGO_BOX_2,
- 70000
- }, // Ol Mahum Raider
- {
- SOPHYA_LETTER_2,
- 20209,
- BLOODY_AXE_INSIGNIA,
- 500000,
- CARGO_BOX_2,
- 80000
- }, // Ol Mahum Marksman
- {
- SOPHYA_LETTER_2,
- 20210,
- BLOODY_AXE_INSIGNIA,
- 500000,
- CARGO_BOX_2,
- 90000
- }, // Ol Mahum Sergeant
- {
- SOPHYA_LETTER_2,
- 20211,
- BLOODY_AXE_INSIGNIA,
- 500000,
- CARGO_BOX_2,
- 100000
- }, // Ol Mahum Captain
-
+ {SOPHYA_LETTER_2, 20207, BLOODY_AXE_INSIGNIA, 500000, CARGO_BOX_2, 60000}, // Ol Mahum Guerilla
+ {SOPHYA_LETTER_2, 20208, BLOODY_AXE_INSIGNIA, 500000, CARGO_BOX_2, 70000}, // Ol Mahum Raider
+ {SOPHYA_LETTER_2, 20209, BLOODY_AXE_INSIGNIA, 500000, CARGO_BOX_2, 80000}, // Ol Mahum Marksman
+ {SOPHYA_LETTER_2, 20210, BLOODY_AXE_INSIGNIA, 500000, CARGO_BOX_2, 90000}, // Ol Mahum Sergeant
+ {SOPHYA_LETTER_2, 20211, BLOODY_AXE_INSIGNIA, 500000, CARGO_BOX_2, 100000}, // Ol Mahum Captain
// Part #3 - Near Giran Town
- {
- SOPHYA_LETTER_3,
- 20251,
- DELU_FANG,
- 500000,
- CARGO_BOX_3,
- 100000
- }, // Delu Lizardman
- {
- SOPHYA_LETTER_3,
- 20252,
- DELU_FANG,
- 500000,
- CARGO_BOX_3,
- 110000
- }, // Delu Lizardman Scout
- {
- SOPHYA_LETTER_3,
- 20253,
- DELU_FANG,
- 500000,
- CARGO_BOX_3,
- 120000
- }, // Delu Lizardman Warrior
-
+ {SOPHYA_LETTER_3, 20251, DELU_FANG, 500000, CARGO_BOX_3, 100000}, // Delu Lizardman
+ {SOPHYA_LETTER_3, 20252, DELU_FANG, 500000, CARGO_BOX_3, 110000}, // Delu Lizardman Scout
+ {SOPHYA_LETTER_3, 20253, DELU_FANG, 500000, CARGO_BOX_3, 120000}, // Delu Lizardman Warrior
// Part #4 - Cruma Area
- {
- SOPHYA_LETTER_4,
- 20157,
- STAKATO_TALON,
- 500000,
- CARGO_BOX_4,
- 100000
- }, // Marsh Stakato
- {
- SOPHYA_LETTER_4,
- 20230,
- STAKATO_TALON,
- 500000,
- CARGO_BOX_4,
- 110000
- }, // Marsh Stakato Worker
- {
- SOPHYA_LETTER_4,
- 20232,
- STAKATO_TALON,
- 500000,
- CARGO_BOX_4,
- 120000
- }, // Marsh Stakato Soldier
- {
- SOPHYA_LETTER_4,
- 20234,
- STAKATO_TALON,
- 500000,
- CARGO_BOX_4,
- 130000
- }
- // Marsh Stakato Drone
+ {SOPHYA_LETTER_4, 20157, STAKATO_TALON, 500000, CARGO_BOX_4, 100000}, // Marsh Stakato
+ {SOPHYA_LETTER_4, 20230, STAKATO_TALON, 500000, CARGO_BOX_4, 110000}, // Marsh Stakato Worker
+ {SOPHYA_LETTER_4, 20232, STAKATO_TALON, 500000, CARGO_BOX_4, 120000}, // Marsh Stakato Soldier
+ {SOPHYA_LETTER_4, 20234, STAKATO_TALON, 500000, CARGO_BOX_4, 130000}, // Marsh Stakato Drone
+ // @formatter:on
};
public Q333_HuntOfTheBlackLion()
{
super(333, "Hunt of the Black Lion");
-
registerQuestItems(LION_CLAW, LION_EYE, GUILD_COIN, UNDEAD_ASH, BLOODY_AXE_INSIGNIA, DELU_FANG, STAKATO_TALON, SOPHYA_LETTER_1, SOPHYA_LETTER_2, SOPHYA_LETTER_3, SOPHYA_LETTER_4);
-
addStartNpc(SOPHYA);
addTalkId(SOPHYA, REDFOOT, RUPIO, UNDRIAS, LOCKIRIN, MORGAN);
-
for (int[] i : DROPLIST)
{
addKillId(i[1]);
@@ -267,492 +131,514 @@ public class Q333_HuntOfTheBlackLion extends Quest
return htmltext;
}
- if (event.equals("30735-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30735-10.htm"))
- {
- if (!st.hasQuestItems(SOPHYA_LETTER_1))
+ case "30735-04.htm":
{
- st.giveItems(SOPHYA_LETTER_1, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30735-11.htm"))
- {
- if (!st.hasQuestItems(SOPHYA_LETTER_2))
+ case "30735-10.htm":
{
- st.giveItems(SOPHYA_LETTER_2, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ if (!st.hasQuestItems(SOPHYA_LETTER_1))
+ {
+ st.giveItems(SOPHYA_LETTER_1, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
}
- }
- else if (event.equals("30735-12.htm"))
- {
- if (!st.hasQuestItems(SOPHYA_LETTER_3))
+ case "30735-11.htm":
{
- st.giveItems(SOPHYA_LETTER_3, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ if (!st.hasQuestItems(SOPHYA_LETTER_2))
+ {
+ st.giveItems(SOPHYA_LETTER_2, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
}
- }
- else if (event.equals("30735-13.htm"))
- {
- if (!st.hasQuestItems(SOPHYA_LETTER_4))
+ case "30735-12.htm":
{
- st.giveItems(SOPHYA_LETTER_4, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ if (!st.hasQuestItems(SOPHYA_LETTER_3))
+ {
+ st.giveItems(SOPHYA_LETTER_3, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
}
- }
- else if (event.equals("30735-16.htm"))
- {
- if (st.getQuestItemsCount(LION_CLAW) > 9)
+ case "30735-13.htm":
{
- st.takeItems(LION_CLAW, 10);
-
- final int eyes = st.getQuestItemsCount(LION_EYE);
- if (eyes < 5)
+ if (!st.hasQuestItems(SOPHYA_LETTER_4))
{
- htmltext = "30735-17a.htm";
-
- st.giveItems(LION_EYE, 1);
-
- final int random = Rnd.get(100);
- if (random < 25)
- {
- st.giveItems(HEALING_POTION, 20);
- }
- else if (random < 50)
- {
- st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 50 : 100);
- }
- else if (random < 75)
- {
- st.giveItems(SCROLL_OF_ESCAPE, 20);
- }
- else
- {
- st.giveItems(SWIFT_ATTACK_POTION, 3);
- }
- }
- else if (eyes < 9)
- {
- htmltext = "30735-18b.htm";
-
- st.giveItems(LION_EYE, 1);
-
- final int random = Rnd.get(100);
- if (random < 25)
- {
- st.giveItems(HEALING_POTION, 25);
- }
- else if (random < 50)
- {
- st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 100 : 200);
- }
- else if (random < 75)
- {
- st.giveItems(SCROLL_OF_ESCAPE, 20);
- }
- else
- {
- st.giveItems(SWIFT_ATTACK_POTION, 3);
- }
- }
- else
- {
- htmltext = "30735-19b.htm";
-
- final int random = Rnd.get(100);
- if (random < 25)
- {
- st.giveItems(HEALING_POTION, 50);
- }
- else if (random < 50)
- {
- st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 200 : 400);
- }
- else if (random < 75)
- {
- st.giveItems(SCROLL_OF_ESCAPE, 30);
- }
- else
- {
- st.giveItems(SWIFT_ATTACK_POTION, 4);
- }
+ st.giveItems(SOPHYA_LETTER_4, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
}
+ break;
}
- }
- else if (event.equals("30735-20.htm"))
- {
- st.takeItems(SOPHYA_LETTER_1, -1);
- st.takeItems(SOPHYA_LETTER_2, -1);
- st.takeItems(SOPHYA_LETTER_3, -1);
- st.takeItems(SOPHYA_LETTER_4, -1);
- }
- else if (event.equals("30735-26.htm"))
- {
- st.takeItems(LION_CLAW, -1);
- st.takeItems(LION_EYE, -1);
- st.takeItems(GUILD_COIN, -1);
- st.takeItems(BLACK_LION_MARK, -1);
- st.takeItems(SOPHYA_LETTER_1, -1);
- st.takeItems(SOPHYA_LETTER_2, -1);
- st.takeItems(SOPHYA_LETTER_3, -1);
- st.takeItems(SOPHYA_LETTER_4, -1);
- st.giveItems(ADENA, 12400);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30736-03.htm"))
- {
- final boolean cargo1 = st.hasQuestItems(CARGO_BOX_1);
- final boolean cargo2 = st.hasQuestItems(CARGO_BOX_2);
- final boolean cargo3 = st.hasQuestItems(CARGO_BOX_3);
- final boolean cargo4 = st.hasQuestItems(CARGO_BOX_4);
- if ((cargo1 || cargo2 || cargo3 || cargo4) && (player.getAdena() > 649))
+ case "30735-16.htm":
{
- st.takeItems(ADENA, 650);
-
- if (cargo1)
+ if (st.getQuestItemsCount(LION_CLAW) > 9)
{
- st.takeItems(CARGO_BOX_1, 1);
- }
- else if (cargo2)
- {
- st.takeItems(CARGO_BOX_2, 1);
- }
- else if (cargo3)
- {
- st.takeItems(CARGO_BOX_3, 1);
- }
- else
- {
- st.takeItems(CARGO_BOX_4, 1);
- }
-
- final int i0 = Rnd.get(100);
- final int i1 = Rnd.get(100);
- if (i0 < 40)
- {
- if (i1 < 33)
- {
- htmltext = "30736-04a.htm";
- st.giveItems(GLUDIO_APPLE, 1);
- }
- else if (i1 < 66)
- {
- htmltext = "30736-04b.htm";
- st.giveItems(CORN_MEAL, 1);
- }
- else
- {
- htmltext = "30736-04c.htm";
- st.giveItems(WOLF_PELTS, 1);
- }
- }
- else if (i0 < 60)
- {
- if (i1 < 33)
- {
- htmltext = "30736-04d.htm";
- st.giveItems(MOONSTONE, 1);
- }
- else if (i1 < 66)
- {
- htmltext = "30736-04e.htm";
- st.giveItems(GLUDIO_WHEAT_FLOWER, 1);
- }
- else
- {
- htmltext = "30736-04f.htm";
- st.giveItems(SPIDERSILK_ROPE, 1);
- }
- }
- else if (i0 < 70)
- {
- if (i1 < 33)
- {
- htmltext = "30736-04g.htm";
- st.giveItems(ALEXANDRITE, 1);
- }
- else if (i1 < 66)
- {
- htmltext = "30736-04h.htm";
- st.giveItems(SILVER_TEA, 1);
- }
- else
- {
- htmltext = "30736-04i.htm";
- st.giveItems(GOLEM_PART, 1);
- }
- }
- else if (i0 < 75)
- {
- if (i1 < 33)
- {
- htmltext = "30736-04j.htm";
- st.giveItems(FIRE_EMERALD, 1);
- }
- else if (i1 < 66)
- {
- htmltext = "30736-04k.htm";
- st.giveItems(SILK_FROCK, 1);
- }
- else
- {
- htmltext = "30736-04l.htm";
- st.giveItems(PORCELAN_URN, 1);
- }
- }
- else if (i0 < 76)
- {
- htmltext = "30736-04m.htm";
- st.giveItems(IMPERIAL_DIAMOND, 1);
- }
- else if (Rnd.nextBoolean())
- {
- htmltext = "30736-04n.htm";
+ st.takeItems(LION_CLAW, 10);
- if (i1 < 25)
+ final int eyes = st.getQuestItemsCount(LION_EYE);
+ if (eyes < 5)
{
- st.giveItems(STATUE_SHILIEN_HEAD, 1);
+ htmltext = "30735-17a.htm";
+
+ st.giveItems(LION_EYE, 1);
+
+ final int random = Rnd.get(100);
+ if (random < 25)
+ {
+ st.giveItems(HEALING_POTION, 20);
+ }
+ else if (random < 50)
+ {
+ st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 50 : 100);
+ }
+ else if (random < 75)
+ {
+ st.giveItems(SCROLL_OF_ESCAPE, 20);
+ }
+ else
+ {
+ st.giveItems(SWIFT_ATTACK_POTION, 3);
+ }
}
- else if (i1 < 50)
+ else if (eyes < 9)
{
- st.giveItems(STATUE_SHILIEN_TORSO, 1);
- }
- else if (i1 < 75)
- {
- st.giveItems(STATUE_SHILIEN_ARM, 1);
+ htmltext = "30735-18b.htm";
+
+ st.giveItems(LION_EYE, 1);
+
+ final int random = Rnd.get(100);
+ if (random < 25)
+ {
+ st.giveItems(HEALING_POTION, 25);
+ }
+ else if (random < 50)
+ {
+ st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 100 : 200);
+ }
+ else if (random < 75)
+ {
+ st.giveItems(SCROLL_OF_ESCAPE, 20);
+ }
+ else
+ {
+ st.giveItems(SWIFT_ATTACK_POTION, 3);
+ }
}
else
{
- st.giveItems(STATUE_SHILIEN_LEG, 1);
+ htmltext = "30735-19b.htm";
+
+ final int random = Rnd.get(100);
+ if (random < 25)
+ {
+ st.giveItems(HEALING_POTION, 50);
+ }
+ else if (random < 50)
+ {
+ st.giveItems(player.isMageClass() ? SPIRITSHOT_D : SOULSHOT_D, player.isMageClass() ? 200 : 400);
+ }
+ else if (random < 75)
+ {
+ st.giveItems(SCROLL_OF_ESCAPE, 30);
+ }
+ else
+ {
+ st.giveItems(SWIFT_ATTACK_POTION, 4);
+ }
}
}
- else
+ break;
+ }
+ case "30735-20.htm":
+ {
+ st.takeItems(SOPHYA_LETTER_1, -1);
+ st.takeItems(SOPHYA_LETTER_2, -1);
+ st.takeItems(SOPHYA_LETTER_3, -1);
+ st.takeItems(SOPHYA_LETTER_4, -1);
+ break;
+ }
+ case "30735-26.htm":
+ {
+ st.takeItems(LION_CLAW, -1);
+ st.takeItems(LION_EYE, -1);
+ st.takeItems(GUILD_COIN, -1);
+ st.takeItems(BLACK_LION_MARK, -1);
+ st.takeItems(SOPHYA_LETTER_1, -1);
+ st.takeItems(SOPHYA_LETTER_2, -1);
+ st.takeItems(SOPHYA_LETTER_3, -1);
+ st.takeItems(SOPHYA_LETTER_4, -1);
+ st.giveItems(ADENA, 12400);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30736-03.htm":
+ {
+ final boolean cargo1 = st.hasQuestItems(CARGO_BOX_1);
+ final boolean cargo2 = st.hasQuestItems(CARGO_BOX_2);
+ final boolean cargo3 = st.hasQuestItems(CARGO_BOX_3);
+ final boolean cargo4 = st.hasQuestItems(CARGO_BOX_4);
+ if ((cargo1 || cargo2 || cargo3 || cargo4) && (player.getAdena() > 649))
{
- htmltext = "30736-04o.htm";
+ st.takeItems(ADENA, 650);
- if (i1 < 25)
+ if (cargo1)
{
- st.giveItems(TABLET_FRAGMENT_1, 1);
+ st.takeItems(CARGO_BOX_1, 1);
}
- else if (i1 < 50)
+ else if (cargo2)
{
- st.giveItems(TABLET_FRAGMENT_2, 1);
+ st.takeItems(CARGO_BOX_2, 1);
}
- else if (i1 < 75)
+ else if (cargo3)
{
- st.giveItems(TABLET_FRAGMENT_3, 1);
+ st.takeItems(CARGO_BOX_3, 1);
}
else
{
- st.giveItems(TABLET_FRAGMENT_4, 1);
+ st.takeItems(CARGO_BOX_4, 1);
}
- }
- }
- else
- {
- htmltext = "30736-05.htm";
- }
- }
- else if (event.equals("30736-07.htm"))
- {
- final int state = st.getInt("state");
- if (player.getAdena() > (200 + (state * 200)))
- {
- if (state < 3)
- {
+
final int i0 = Rnd.get(100);
- if (i0 < 5)
+ final int i1 = Rnd.get(100);
+ if (i0 < 40)
{
- htmltext = "30736-08a.htm";
- }
- else if (i0 < 10)
- {
- htmltext = "30736-08b.htm";
- }
- else if (i0 < 15)
- {
- htmltext = "30736-08c.htm";
- }
- else if (i0 < 20)
- {
- htmltext = "30736-08d.htm";
- }
- else if (i0 < 25)
- {
- htmltext = "30736-08e.htm";
- }
- else if (i0 < 30)
- {
- htmltext = "30736-08f.htm";
- }
- else if (i0 < 35)
- {
- htmltext = "30736-08g.htm";
- }
- else if (i0 < 40)
- {
- htmltext = "30736-08h.htm";
- }
- else if (i0 < 45)
- {
- htmltext = "30736-08i.htm";
- }
- else if (i0 < 50)
- {
- htmltext = "30736-08j.htm";
- }
- else if (i0 < 55)
- {
- htmltext = "30736-08k.htm";
+ if (i1 < 33)
+ {
+ htmltext = "30736-04a.htm";
+ st.giveItems(GLUDIO_APPLE, 1);
+ }
+ else if (i1 < 66)
+ {
+ htmltext = "30736-04b.htm";
+ st.giveItems(CORN_MEAL, 1);
+ }
+ else
+ {
+ htmltext = "30736-04c.htm";
+ st.giveItems(WOLF_PELTS, 1);
+ }
}
else if (i0 < 60)
{
- htmltext = "30736-08l.htm";
- }
- else if (i0 < 65)
- {
- htmltext = "30736-08m.htm";
+ if (i1 < 33)
+ {
+ htmltext = "30736-04d.htm";
+ st.giveItems(MOONSTONE, 1);
+ }
+ else if (i1 < 66)
+ {
+ htmltext = "30736-04e.htm";
+ st.giveItems(GLUDIO_WHEAT_FLOWER, 1);
+ }
+ else
+ {
+ htmltext = "30736-04f.htm";
+ st.giveItems(SPIDERSILK_ROPE, 1);
+ }
}
else if (i0 < 70)
{
- htmltext = "30736-08n.htm";
+ if (i1 < 33)
+ {
+ htmltext = "30736-04g.htm";
+ st.giveItems(ALEXANDRITE, 1);
+ }
+ else if (i1 < 66)
+ {
+ htmltext = "30736-04h.htm";
+ st.giveItems(SILVER_TEA, 1);
+ }
+ else
+ {
+ htmltext = "30736-04i.htm";
+ st.giveItems(GOLEM_PART, 1);
+ }
}
else if (i0 < 75)
{
- htmltext = "30736-08o.htm";
+ if (i1 < 33)
+ {
+ htmltext = "30736-04j.htm";
+ st.giveItems(FIRE_EMERALD, 1);
+ }
+ else if (i1 < 66)
+ {
+ htmltext = "30736-04k.htm";
+ st.giveItems(SILK_FROCK, 1);
+ }
+ else
+ {
+ htmltext = "30736-04l.htm";
+ st.giveItems(PORCELAN_URN, 1);
+ }
}
- else if (i0 < 80)
+ else if (i0 < 76)
{
- htmltext = "30736-08p.htm";
+ htmltext = "30736-04m.htm";
+ st.giveItems(IMPERIAL_DIAMOND, 1);
}
- else if (i0 < 85)
+ else if (Rnd.nextBoolean())
{
- htmltext = "30736-08q.htm";
- }
- else if (i0 < 90)
- {
- htmltext = "30736-08r.htm";
- }
- else if (i0 < 95)
- {
- htmltext = "30736-08s.htm";
+ htmltext = "30736-04n.htm";
+
+ if (i1 < 25)
+ {
+ st.giveItems(STATUE_SHILIEN_HEAD, 1);
+ }
+ else if (i1 < 50)
+ {
+ st.giveItems(STATUE_SHILIEN_TORSO, 1);
+ }
+ else if (i1 < 75)
+ {
+ st.giveItems(STATUE_SHILIEN_ARM, 1);
+ }
+ else
+ {
+ st.giveItems(STATUE_SHILIEN_LEG, 1);
+ }
}
else
{
- htmltext = "30736-08t.htm";
+ htmltext = "30736-04o.htm";
+
+ if (i1 < 25)
+ {
+ st.giveItems(TABLET_FRAGMENT_1, 1);
+ }
+ else if (i1 < 50)
+ {
+ st.giveItems(TABLET_FRAGMENT_2, 1);
+ }
+ else if (i1 < 75)
+ {
+ st.giveItems(TABLET_FRAGMENT_3, 1);
+ }
+ else
+ {
+ st.giveItems(TABLET_FRAGMENT_4, 1);
+ }
+ }
+ }
+ else
+ {
+ htmltext = "30736-05.htm";
+ }
+ break;
+ }
+ case "30736-07.htm":
+ {
+ final int state = st.getInt("state");
+ if (player.getAdena() > (200 + (state * 200)))
+ {
+ if (state < 3)
+ {
+ final int i0 = Rnd.get(100);
+ if (i0 < 5)
+ {
+ htmltext = "30736-08a.htm";
+ }
+ else if (i0 < 10)
+ {
+ htmltext = "30736-08b.htm";
+ }
+ else if (i0 < 15)
+ {
+ htmltext = "30736-08c.htm";
+ }
+ else if (i0 < 20)
+ {
+ htmltext = "30736-08d.htm";
+ }
+ else if (i0 < 25)
+ {
+ htmltext = "30736-08e.htm";
+ }
+ else if (i0 < 30)
+ {
+ htmltext = "30736-08f.htm";
+ }
+ else if (i0 < 35)
+ {
+ htmltext = "30736-08g.htm";
+ }
+ else if (i0 < 40)
+ {
+ htmltext = "30736-08h.htm";
+ }
+ else if (i0 < 45)
+ {
+ htmltext = "30736-08i.htm";
+ }
+ else if (i0 < 50)
+ {
+ htmltext = "30736-08j.htm";
+ }
+ else if (i0 < 55)
+ {
+ htmltext = "30736-08k.htm";
+ }
+ else if (i0 < 60)
+ {
+ htmltext = "30736-08l.htm";
+ }
+ else if (i0 < 65)
+ {
+ htmltext = "30736-08m.htm";
+ }
+ else if (i0 < 70)
+ {
+ htmltext = "30736-08n.htm";
+ }
+ else if (i0 < 75)
+ {
+ htmltext = "30736-08o.htm";
+ }
+ else if (i0 < 80)
+ {
+ htmltext = "30736-08p.htm";
+ }
+ else if (i0 < 85)
+ {
+ htmltext = "30736-08q.htm";
+ }
+ else if (i0 < 90)
+ {
+ htmltext = "30736-08r.htm";
+ }
+ else if (i0 < 95)
+ {
+ htmltext = "30736-08s.htm";
+ }
+ else
+ {
+ htmltext = "30736-08t.htm";
+ }
+
+ st.takeItems(ADENA, 200 + (state * 200));
+ st.set("state", String.valueOf(state + 1));
+ }
+ else
+ {
+ htmltext = "30736-08.htm";
+ }
+ }
+ break;
+ }
+ case "30471-03.htm":
+ {
+ if (st.hasQuestItems(STATUE_SHILIEN_HEAD, STATUE_SHILIEN_TORSO, STATUE_SHILIEN_ARM, STATUE_SHILIEN_LEG))
+ {
+ st.takeItems(STATUE_SHILIEN_HEAD, 1);
+ st.takeItems(STATUE_SHILIEN_TORSO, 1);
+ st.takeItems(STATUE_SHILIEN_ARM, 1);
+ st.takeItems(STATUE_SHILIEN_LEG, 1);
+
+ if (Rnd.nextBoolean())
+ {
+ htmltext = "30471-04.htm";
+ st.giveItems(COMPLETE_STATUE, 1);
+ }
+ else
+ {
+ htmltext = "30471-05.htm";
+ }
+ }
+ break;
+ }
+ case "30471-06.htm":
+ {
+ if (st.hasQuestItems(TABLET_FRAGMENT_1, TABLET_FRAGMENT_2, TABLET_FRAGMENT_3, TABLET_FRAGMENT_4))
+ {
+ st.takeItems(TABLET_FRAGMENT_1, 1);
+ st.takeItems(TABLET_FRAGMENT_2, 1);
+ st.takeItems(TABLET_FRAGMENT_3, 1);
+ st.takeItems(TABLET_FRAGMENT_4, 1);
+
+ if (Rnd.nextBoolean())
+ {
+ htmltext = "30471-07.htm";
+ st.giveItems(COMPLETE_TABLET, 1);
+ }
+ else
+ {
+ htmltext = "30471-08.htm";
+ }
+ }
+ break;
+ }
+ case "30130-04.htm":
+ {
+ if (st.hasQuestItems(COMPLETE_STATUE))
+ {
+ st.takeItems(COMPLETE_STATUE, 1);
+ st.giveItems(ADENA, 30000);
+ }
+ break;
+ }
+ case "30531-04.htm":
+ {
+ if (st.hasQuestItems(COMPLETE_TABLET))
+ {
+ st.takeItems(COMPLETE_TABLET, 1);
+ st.giveItems(ADENA, 30000);
+ }
+ break;
+ }
+ case "30737-06.htm":
+ {
+ final boolean cargo1 = st.hasQuestItems(CARGO_BOX_1);
+ final boolean cargo2 = st.hasQuestItems(CARGO_BOX_2);
+ final boolean cargo3 = st.hasQuestItems(CARGO_BOX_3);
+ final boolean cargo4 = st.hasQuestItems(CARGO_BOX_4);
+ if (cargo1 || cargo2 || cargo3 || cargo4)
+ {
+ if (cargo1)
+ {
+ st.takeItems(CARGO_BOX_1, 1);
+ }
+ else if (cargo2)
+ {
+ st.takeItems(CARGO_BOX_2, 1);
+ }
+ else if (cargo3)
+ {
+ st.takeItems(CARGO_BOX_3, 1);
+ }
+ else
+ {
+ st.takeItems(CARGO_BOX_4, 1);
}
- st.takeItems(ADENA, 200 + (state * 200));
- st.set("state", String.valueOf(state + 1));
- }
- else
- {
- htmltext = "30736-08.htm";
- }
- }
- }
- else if (event.equals("30471-03.htm"))
- {
- if (st.hasQuestItems(STATUE_SHILIEN_HEAD, STATUE_SHILIEN_TORSO, STATUE_SHILIEN_ARM, STATUE_SHILIEN_LEG))
- {
- st.takeItems(STATUE_SHILIEN_HEAD, 1);
- st.takeItems(STATUE_SHILIEN_TORSO, 1);
- st.takeItems(STATUE_SHILIEN_ARM, 1);
- st.takeItems(STATUE_SHILIEN_LEG, 1);
-
- if (Rnd.nextBoolean())
- {
- htmltext = "30471-04.htm";
- st.giveItems(COMPLETE_STATUE, 1);
- }
- else
- {
- htmltext = "30471-05.htm";
- }
- }
- }
- else if (event.equals("30471-06.htm"))
- {
- if (st.hasQuestItems(TABLET_FRAGMENT_1, TABLET_FRAGMENT_2, TABLET_FRAGMENT_3, TABLET_FRAGMENT_4))
- {
- st.takeItems(TABLET_FRAGMENT_1, 1);
- st.takeItems(TABLET_FRAGMENT_2, 1);
- st.takeItems(TABLET_FRAGMENT_3, 1);
- st.takeItems(TABLET_FRAGMENT_4, 1);
-
- if (Rnd.nextBoolean())
- {
- htmltext = "30471-07.htm";
- st.giveItems(COMPLETE_TABLET, 1);
- }
- else
- {
- htmltext = "30471-08.htm";
- }
- }
- }
- else if (event.equals("30130-04.htm") && st.hasQuestItems(COMPLETE_STATUE))
- {
- st.takeItems(COMPLETE_STATUE, 1);
- st.giveItems(ADENA, 30000);
- }
- else if (event.equals("30531-04.htm") && st.hasQuestItems(COMPLETE_TABLET))
- {
- st.takeItems(COMPLETE_TABLET, 1);
- st.giveItems(ADENA, 30000);
- }
- else if (event.equals("30737-06.htm"))
- {
- final boolean cargo1 = st.hasQuestItems(CARGO_BOX_1);
- final boolean cargo2 = st.hasQuestItems(CARGO_BOX_2);
- final boolean cargo3 = st.hasQuestItems(CARGO_BOX_3);
- final boolean cargo4 = st.hasQuestItems(CARGO_BOX_4);
- if (cargo1 || cargo2 || cargo3 || cargo4)
- {
- if (cargo1)
- {
- st.takeItems(CARGO_BOX_1, 1);
- }
- else if (cargo2)
- {
- st.takeItems(CARGO_BOX_2, 1);
- }
- else if (cargo3)
- {
- st.takeItems(CARGO_BOX_3, 1);
- }
- else
- {
- st.takeItems(CARGO_BOX_4, 1);
- }
-
- final int coins = st.getQuestItemsCount(GUILD_COIN);
- if (coins < 40)
- {
- htmltext = "30737-03.htm";
- st.giveItems(ADENA, 100);
- }
- else if (coins < 80)
- {
- htmltext = "30737-04.htm";
- st.giveItems(ADENA, 200);
- }
- else
- {
- htmltext = "30737-05.htm";
- st.giveItems(ADENA, 300);
- }
-
- if (coins < 80)
- {
- st.giveItems(GUILD_COIN, 1);
+ final int coins = st.getQuestItemsCount(GUILD_COIN);
+ if (coins < 40)
+ {
+ htmltext = "30737-03.htm";
+ st.giveItems(ADENA, 100);
+ }
+ else if (coins < 80)
+ {
+ htmltext = "30737-04.htm";
+ st.giveItems(ADENA, 200);
+ }
+ else
+ {
+ htmltext = "30737-05.htm";
+ st.giveItems(ADENA, 300);
+ }
+
+ if (coins < 80)
+ {
+ st.giveItems(GUILD_COIN, 1);
+ }
}
+ break;
}
}
@@ -772,6 +658,7 @@ public class Q333_HuntOfTheBlackLion extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 25)
{
htmltext = "30735-01.htm";
@@ -785,11 +672,13 @@ public class Q333_HuntOfTheBlackLion extends Quest
htmltext = "30735-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case SOPHYA:
+ {
if (!st.hasAtLeastOneQuestItem(SOPHYA_LETTER_1, SOPHYA_LETTER_2, SOPHYA_LETTER_3, SOPHYA_LETTER_4))
{
htmltext = "30735-14.htm";
@@ -827,12 +716,14 @@ public class Q333_HuntOfTheBlackLion extends Quest
}
}
break;
-
+ }
case REDFOOT:
+ {
htmltext = st.hasAtLeastOneQuestItem(CARGO_BOX_1, CARGO_BOX_2, CARGO_BOX_3, CARGO_BOX_4) ? "30736-02.htm" : "30736-01.htm";
break;
-
+ }
case RUPIO:
+ {
if (st.hasQuestItems(STATUE_SHILIEN_HEAD, STATUE_SHILIEN_TORSO, STATUE_SHILIEN_ARM, STATUE_SHILIEN_LEG) || st.hasQuestItems(TABLET_FRAGMENT_1, TABLET_FRAGMENT_2, TABLET_FRAGMENT_3, TABLET_FRAGMENT_4))
{
htmltext = "30471-02.htm";
@@ -842,8 +733,9 @@ public class Q333_HuntOfTheBlackLion extends Quest
htmltext = "30471-01.htm";
}
break;
-
+ }
case UNDRIAS:
+ {
if (!st.hasQuestItems(COMPLETE_STATUE))
{
htmltext = st.hasQuestItems(STATUE_SHILIEN_HEAD, STATUE_SHILIEN_TORSO, STATUE_SHILIEN_ARM, STATUE_SHILIEN_LEG) ? "30130-02.htm" : "30130-01.htm";
@@ -853,8 +745,9 @@ public class Q333_HuntOfTheBlackLion extends Quest
htmltext = "30130-03.htm";
}
break;
-
+ }
case LOCKIRIN:
+ {
if (!st.hasQuestItems(COMPLETE_TABLET))
{
htmltext = st.hasQuestItems(TABLET_FRAGMENT_1, TABLET_FRAGMENT_2, TABLET_FRAGMENT_3, TABLET_FRAGMENT_4) ? "30531-02.htm" : "30531-01.htm";
@@ -864,12 +757,15 @@ public class Q333_HuntOfTheBlackLion extends Quest
htmltext = "30531-03.htm";
}
break;
-
+ }
case MORGAN:
+ {
htmltext = st.hasAtLeastOneQuestItem(CARGO_BOX_1, CARGO_BOX_2, CARGO_BOX_3, CARGO_BOX_4) ? "30737-02.htm" : "30737-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q334_TheWishingPotion/Q334_TheWishingPotion.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q334_TheWishingPotion/Q334_TheWishingPotion.java
index 5207ae5767..9aa1a05fce 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q334_TheWishingPotion/Q334_TheWishingPotion.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q334_TheWishingPotion/Q334_TheWishingPotion.java
@@ -99,7 +99,6 @@ public class Q334_TheWishingPotion extends Quest
public Q334_TheWishingPotion()
{
super(334, "The Wishing Potion");
-
addStartNpc(ALCHEMIST_MATILD);
addTalkId(ALCHEMIST_MATILD, TORAI, WISDOM_CHEST, RUPINA);
registerQuestItems(ALCHEMY_TEXT_ID, SECRET_BOOK_ID, AMBER_SCALE_ID, WIND_SOULSTONE_ID, GLASS_EYE_ID, HORROR_ECTOPLASM_ID, SILENOS_HORN_ID, ANT_SOLDIER_APHID_ID, TYRANTS_CHITIN_ID, BUGBEAR_BLOOD_ID);
@@ -113,10 +112,10 @@ public class Q334_TheWishingPotion extends Quest
{
if ((st.getQuestItemsCount(AMBER_SCALE_ID) == 1) && (st.getQuestItemsCount(WIND_SOULSTONE_ID) == 1) && (st.getQuestItemsCount(GLASS_EYE_ID) == 1) && (st.getQuestItemsCount(HORROR_ECTOPLASM_ID) == 1) && (st.getQuestItemsCount(SILENOS_HORN_ID) == 1) && (st.getQuestItemsCount(ANT_SOLDIER_APHID_ID) == 1) && (st.getQuestItemsCount(TYRANTS_CHITIN_ID) == 1) && (st.getQuestItemsCount(BUGBEAR_BLOOD_ID) == 1))
{
- st.set("cond", "4");
+ st.setCond(4);
return true;
}
- st.set("cond", "3");
+ st.setCond(3);
return false;
}
@@ -130,176 +129,186 @@ public class Q334_TheWishingPotion extends Quest
return htmltext;
}
- if ("30738-03.htm".equalsIgnoreCase(event))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.giveItems(ALCHEMY_TEXT_ID, 1);
- }
- else if ("30738-06.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) == 0)
+ case "30738-03.htm":
{
- st.takeItems(ALCHEMY_TEXT_ID, -1);
- st.takeItems(SECRET_BOOK_ID, -1);
- if (st.getQuestItemsCount(POTION_RECIPE_1_ID) == 0)
+ st.startQuest();
+ st.giveItems(ALCHEMY_TEXT_ID, 1);
+ break;
+ }
+ case "30738-06.htm":
+ {
+ if (st.getQuestItemsCount(WISH_POTION_ID) == 0)
{
- st.giveItems(POTION_RECIPE_1_ID, 1);
+ st.takeItems(ALCHEMY_TEXT_ID, -1);
+ st.takeItems(SECRET_BOOK_ID, -1);
+ if (st.getQuestItemsCount(POTION_RECIPE_1_ID) == 0)
+ {
+ st.giveItems(POTION_RECIPE_1_ID, 1);
+ }
+ if (st.getQuestItemsCount(POTION_RECIPE_2_ID) == 0)
+ {
+ st.giveItems(POTION_RECIPE_2_ID, 1);
+ }
+ if (st.getQuestItemsCount(MATILDS_ORB_ID) == 0)
+ {
+ htmltext = "30738-06.htm";
+ }
+ else
+ {
+ htmltext = "30738-12.htm";
+ }
+ st.setCond(3);
}
- if (st.getQuestItemsCount(POTION_RECIPE_2_ID) == 0)
+ else if ((st.getQuestItemsCount(MATILDS_ORB_ID) >= 1) && (st.getQuestItemsCount(WISH_POTION_ID) >= 1))
{
- st.giveItems(POTION_RECIPE_2_ID, 1);
+ htmltext = "30738-13.htm";
}
- if (st.getQuestItemsCount(MATILDS_ORB_ID) == 0)
+ break;
+ }
+ case "30738-10.htm":
+ {
+ if (checkIngr(st))
{
- htmltext = "30738-06.htm";
+ st.playSound(QuestState.SOUND_FINISH);
+ st.takeItems(ALCHEMY_TEXT_ID, -1);
+ st.takeItems(SECRET_BOOK_ID, -1);
+ st.takeItems(POTION_RECIPE_1_ID, -1);
+ st.takeItems(POTION_RECIPE_2_ID, -1);
+ st.takeItems(AMBER_SCALE_ID, -1);
+ st.takeItems(WIND_SOULSTONE_ID, -1);
+ st.takeItems(GLASS_EYE_ID, -1);
+ st.takeItems(HORROR_ECTOPLASM_ID, -1);
+ st.takeItems(SILENOS_HORN_ID, -1);
+ st.takeItems(ANT_SOLDIER_APHID_ID, -1);
+ st.takeItems(TYRANTS_CHITIN_ID, -1);
+ st.takeItems(BUGBEAR_BLOOD_ID, -1);
+ if (st.getQuestItemsCount(MATILDS_ORB_ID) == 0)
+ {
+ st.giveItems(MATILDS_ORB_ID, 1);
+ }
+ st.giveItems(WISH_POTION_ID, 1);
+ st.setCond(0);
}
else
{
- htmltext = "30738-12.htm";
+ htmltext = "You don't have required items";
}
- st.set("cond", "3");
+ break;
}
- else if ((st.getQuestItemsCount(MATILDS_ORB_ID) >= 1) && (st.getQuestItemsCount(WISH_POTION_ID) >= 1))
+ case "30738-14.htm":
{
- htmltext = "30738-13.htm";
- }
- }
- else if ("30738-10.htm".equalsIgnoreCase(event))
- {
- if (checkIngr(st))
- {
- st.playSound("ItemSound.quest_finish");
- st.takeItems(ALCHEMY_TEXT_ID, -1);
- st.takeItems(SECRET_BOOK_ID, -1);
- st.takeItems(POTION_RECIPE_1_ID, -1);
- st.takeItems(POTION_RECIPE_2_ID, -1);
- st.takeItems(AMBER_SCALE_ID, -1);
- st.takeItems(WIND_SOULSTONE_ID, -1);
- st.takeItems(GLASS_EYE_ID, -1);
- st.takeItems(HORROR_ECTOPLASM_ID, -1);
- st.takeItems(SILENOS_HORN_ID, -1);
- st.takeItems(ANT_SOLDIER_APHID_ID, -1);
- st.takeItems(TYRANTS_CHITIN_ID, -1);
- st.takeItems(BUGBEAR_BLOOD_ID, -1);
- if (st.getQuestItemsCount(MATILDS_ORB_ID) == 0)
+ if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
{
- st.giveItems(MATILDS_ORB_ID, 1);
+ htmltext = "30738-15.htm";
}
- st.giveItems(WISH_POTION_ID, 1);
- st.set("cond", "0");
+ break;
}
- else
+ case "30738-16.htm":
{
- htmltext = "You don't have required items";
- }
- }
- else if ("30738-14.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
- {
- htmltext = "30738-15.htm";
- }
- }
- else if ("30738-16.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
- {
- st.takeItems(WISH_POTION_ID, 1);
- if (Rnd.get(100) < 50)
+ if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
{
- st.addSpawn(SUCCUBUS_OF_SEDUCTION);
- st.addSpawn(SUCCUBUS_OF_SEDUCTION);
- st.addSpawn(SUCCUBUS_OF_SEDUCTION);
+ st.takeItems(WISH_POTION_ID, 1);
+ if (Rnd.get(100) < 50)
+ {
+ st.addSpawn(SUCCUBUS_OF_SEDUCTION);
+ st.addSpawn(SUCCUBUS_OF_SEDUCTION);
+ st.addSpawn(SUCCUBUS_OF_SEDUCTION);
+ }
+ else
+ {
+ st.addSpawn(RUPINA);
+ }
}
else
{
- st.addSpawn(RUPINA);
+ htmltext = "30738-14.htm";
}
+ break;
}
- else
+ case "30738-17.htm":
{
- htmltext = "30738-14.htm";
- }
- }
- else if ("30738-17.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
- {
- st.takeItems(WISH_POTION_ID, 1);
- final int WISH_CHANCE = Rnd.get(100) + 1;
- if (WISH_CHANCE <= 33)
+ if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
{
- st.addSpawn(GRIMA);
- st.addSpawn(GRIMA);
- st.addSpawn(GRIMA);
- }
- else if (WISH_CHANCE >= 66)
- {
- st.giveItems(57, 10000);
- }
- else if (Rnd.get(100) < 2)
- {
- st.giveItems(57, (Rnd.get(10) + 1) * 1000000);
+ st.takeItems(WISH_POTION_ID, 1);
+ final int WISH_CHANCE = Rnd.get(100) + 1;
+ if (WISH_CHANCE <= 33)
+ {
+ st.addSpawn(GRIMA);
+ st.addSpawn(GRIMA);
+ st.addSpawn(GRIMA);
+ }
+ else if (WISH_CHANCE >= 66)
+ {
+ st.giveItems(57, 10000);
+ }
+ else if (Rnd.get(100) < 2)
+ {
+ st.giveItems(57, (Rnd.get(10) + 1) * 1000000);
+ }
+ else
+ {
+ st.addSpawn(GRIMA);
+ st.addSpawn(GRIMA);
+ st.addSpawn(GRIMA);
+ }
}
else
{
- st.addSpawn(GRIMA);
- st.addSpawn(GRIMA);
- st.addSpawn(GRIMA);
+ htmltext = "30738-14.htm";
}
+ break;
}
- else
+ case "30738-18.htm":
{
- htmltext = "30738-14.htm";
- }
- }
- else if ("30738-18.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
- {
- st.takeItems(WISH_POTION_ID, 1);
- final int WISH_CHANCE = Rnd.get(100) + 1;
- if (WISH_CHANCE <= 33)
+ if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
{
- st.giveItems(CERTIFICATE_OF_ROYALTY_ID, 1);
- }
- else if (WISH_CHANCE >= 66)
- {
- st.giveItems(ANCIENT_CROWN_ID, 1);
+ st.takeItems(WISH_POTION_ID, 1);
+ final int WISH_CHANCE = Rnd.get(100) + 1;
+ if (WISH_CHANCE <= 33)
+ {
+ st.giveItems(CERTIFICATE_OF_ROYALTY_ID, 1);
+ }
+ else if (WISH_CHANCE >= 66)
+ {
+ st.giveItems(ANCIENT_CROWN_ID, 1);
+ }
+ else
+ {
+ st.addSpawn(SANCHES);
+ }
}
else
{
- st.addSpawn(SANCHES);
+ htmltext = "30738-14.htm";
}
+ break;
}
- else
+ case "30738-19.htm":
{
- htmltext = "30738-14.htm";
- }
- }
- else if ("30738-19.htm".equalsIgnoreCase(event))
- {
- if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
- {
- st.takeItems(3467, 1);
- final int WISH_CHANCE = Rnd.get(100) + 1;
- if (WISH_CHANCE <= 33)
+ if (st.getQuestItemsCount(WISH_POTION_ID) >= 1)
{
- st.giveItems(SPELLBOOK_ICEBOLT_ID, 1);
- }
- else if (WISH_CHANCE <= 66)
- {
- st.giveItems(SPELLBOOK_BATTLEHEAL_ID, 1);
+ st.takeItems(3467, 1);
+ final int WISH_CHANCE = Rnd.get(100) + 1;
+ if (WISH_CHANCE <= 33)
+ {
+ st.giveItems(SPELLBOOK_ICEBOLT_ID, 1);
+ }
+ else if (WISH_CHANCE <= 66)
+ {
+ st.giveItems(SPELLBOOK_BATTLEHEAL_ID, 1);
+ }
+ else
+ {
+ st.addSpawn(WISDOM_CHEST);
+ }
}
else
{
- st.addSpawn(WISDOM_CHEST);
+ htmltext = "30738-14.htm";
}
- }
- else
- {
- htmltext = "30738-14.htm";
+ break;
}
}
return htmltext;
@@ -320,7 +329,7 @@ public class Q334_TheWishingPotion extends Quest
int cond = 0;
if (id != 0)
{
- cond = st.getInt("cond");
+ cond = st.getCond();
}
switch (npcId)
{
@@ -339,7 +348,7 @@ public class Q334_TheWishingPotion extends Quest
}
else if (st.getQuestItemsCount(3467) == 0)
{
- st.set("cond", "3");
+ st.setCond(3);
if (st.getQuestItemsCount(POTION_RECIPE_1_ID) == 0)
{
st.giveItems(POTION_RECIPE_1_ID, 1);
@@ -444,7 +453,7 @@ public class Q334_TheWishingPotion extends Quest
}
final int npcId = npc.getNpcId();
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
for (int[] element : DROPLIST_COND)
{
if ((cond == element[0]) && (npcId == element[2]) && ((element[3] == 0) || (st.getQuestItemsCount(element[3]) > 0)))
@@ -465,7 +474,7 @@ public class Q334_TheWishingPotion extends Quest
}
if ((element[1] != cond) && (element[1] != 0))
{
- st.set("cond", "" + element[1]);
+ st.setCond(element[1]);
st.setState(State.STARTED);
}
}
@@ -474,12 +483,12 @@ public class Q334_TheWishingPotion extends Quest
final int dropChance = Rnd.get(100) + 1;
if ((npcId == SUCCUBUS_OF_SEDUCTION) && (dropChance <= DROP_CHANCE_FORBIDDEN_LOVE_SCROLL_ID))
{
- st.playSound("ItemSound.quest_itemget");
+ st.playSound(QuestState.SOUND_ITEMGET);
st.giveItems(FORBIDDEN_LOVE_SCROLL_ID, 1);
}
else if ((npcId == GRIMA) && (dropChance <= DROP_CHANCE_GOLD_BAR_ID))
{
- st.playSound("ItemSound.quest_itemget");
+ st.playSound(QuestState.SOUND_ITEMGET);
st.giveItems(GOLD_BAR_ID, Rnd.get(5) + 1);
}
else if ((npcId == SANCHES) && (Rnd.get(100) < 50))
@@ -512,7 +521,7 @@ public class Q334_TheWishingPotion extends Quest
{
st.giveItems(DEMONS_TUNIC_ID, 1);
}
- st.playSound("ItemSound.quest_itemget");
+ st.playSound(QuestState.SOUND_ITEMGET);
}
return null;
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q335_TheSongOfTheHunter/Q335_TheSongOfTheHunter.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q335_TheSongOfTheHunter/Q335_TheSongOfTheHunter.java
index 68ae78577a..e482970dcf 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q335_TheSongOfTheHunter/Q335_TheSongOfTheHunter.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q335_TheSongOfTheHunter/Q335_TheSongOfTheHunter.java
@@ -153,7 +153,6 @@ public class Q335_TheSongOfTheHunter extends Quest
public Q335_TheSongOfTheHunter()
{
super(335, "Song of the Hunter");
-
addStartNpc(GREY);
addTalkId(GREY, CYBELLIN, TOR);
addKillId(BREKA_OVERLORD_HAKA);
@@ -229,7 +228,7 @@ public class Q335_TheSongOfTheHunter extends Quest
registerQuestItems(questItems.stream().mapToInt(i -> i).toArray());
}
- private static int CalcItemsConds(QuestState st, int[][][] itemConds)
+ private static int calcItemsConds(QuestState st, int[][][] itemConds)
{
int result = 0;
for (int[][] itemCond : itemConds)
@@ -247,7 +246,7 @@ public class Q335_TheSongOfTheHunter extends Quest
return result;
}
- private void DelItemsConds(QuestState st, int[][][] itemConds)
+ private void delItemsConds(QuestState st, int[][][] itemConds)
{
for (int[][] itemCond : itemConds)
{
@@ -258,7 +257,7 @@ public class Q335_TheSongOfTheHunter extends Quest
}
}
- private static int Get_Blood_Crystal_Level(QuestState st)
+ private static int getBloodCrystalLevel(QuestState st)
{
for (int i = Q_BLOOD_CRYSTAL.length - 1; i >= 0; --i)
{
@@ -270,7 +269,7 @@ public class Q335_TheSongOfTheHunter extends Quest
return -1;
}
- private static boolean Blood_Crystal2Adena(QuestState st, int bloodCrystalLevel)
+ private static boolean bloodCrystal2Adena(QuestState st, int bloodCrystalLevel)
{
if (bloodCrystalLevel < 2)
{
@@ -284,7 +283,7 @@ public class Q335_TheSongOfTheHunter extends Quest
return true;
}
- private void GenList(QuestState st)
+ private void genList(QuestState st)
{
// final int grade_c = 12;
// final int grade_b = 6;
@@ -356,7 +355,7 @@ public class Q335_TheSongOfTheHunter extends Quest
}
}
- private static String FormatList(QuestState st, Request[] requests)
+ private static String formatList(QuestState st, Request[] requests)
{
String result = "Guild Member Tor:
%reply%
%reply%
%reply%
%reply%
%reply%
";
final int[] listpacked = unpackInt(st.getInt("list"), 5);
@@ -368,7 +367,7 @@ public class Q335_TheSongOfTheHunter extends Quest
return result;
}
- private static Request GetCurrentRequest(QuestState st, Request[] requests)
+ private static Request getCurrentRequest(QuestState st, Request[] requests)
{
for (Request r : requests)
{
@@ -418,22 +417,20 @@ public class Q335_TheSongOfTheHunter extends Quest
{
st.giveItems(TEST_INSTRUCTIONS1, 1);
}
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound("ItemSound.quest_accept");
+ st.startQuest();
}
}
else if ("30744_09.htm".equals(htmltext))
{
if (state == 2)
{
- if (GetCurrentRequest(st, REQUESTS1) != null)
+ if (getCurrentRequest(st, REQUESTS1) != null)
{
return "30744_09a.htm";
}
if (st.getQuestItemsCount(TEST_INSTRUCTIONS2) == 0)
{
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(TEST_INSTRUCTIONS2, 1);
}
}
@@ -447,7 +444,7 @@ public class Q335_TheSongOfTheHunter extends Quest
st.giveItems(57, 20000);
htmltext = "30744_17.htm";
}
- st.playSound("ItemSound.quest_finish");
+ st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
}
}
@@ -471,18 +468,15 @@ public class Q335_TheSongOfTheHunter extends Quest
{
st.takeItems(i, -1);
}
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(Q_BLOOD_CRYSTAL[1], 1);
}
}
else if ("30746_06.htm".equals(htmltext))
{
- if (state == 2)
+ if ((state == 2) && !bloodCrystal2Adena(st, getBloodCrystalLevel(st)))
{
- if (!Blood_Crystal2Adena(st, Get_Blood_Crystal_Level(st)))
- {
- return null;
- }
+ return null;
}
}
else if ("30746_10.htm".equals(htmltext))
@@ -499,12 +493,9 @@ public class Q335_TheSongOfTheHunter extends Quest
}
else if ("30745_02.htm".equals(htmltext))
{
- if (state == 2)
+ if ((state == 2) && (st.getQuestItemsCount(TEST_INSTRUCTIONS2) > 0))
{
- if (st.getQuestItemsCount(TEST_INSTRUCTIONS2) > 0)
- {
- return "30745_03.htm";
- }
+ return "30745_03.htm";
}
}
else if ("30745_05b.htm".equals(htmltext))
@@ -531,13 +522,13 @@ public class Q335_TheSongOfTheHunter extends Quest
{
if ("30745-list1".equals(htmltext))
{
- GenList(st);
- return FormatList(st, REQUESTS1);
+ genList(st);
+ return formatList(st, REQUESTS1);
}
if ("30745-list2".equals(htmltext))
{
- GenList(st);
- return FormatList(st, REQUESTS2);
+ genList(st);
+ return formatList(st, REQUESTS2);
}
if (htmltext.startsWith("30745-request-"))
{
@@ -581,34 +572,40 @@ public class Q335_TheSongOfTheHunter extends Quest
{
return getNoQuestMsg();
}
+
if (st.getPlayer().getLevel() < 35)
{
st.exitQuest(true);
return "30744_01.htm";
}
- st.set("cond", "0");
+
+ st.setCond(0);
st.unset("list");
return "30744_02.htm";
}
+
if (_state != 2)
{
return getNoQuestMsg();
}
+
if (npcId == GREY)
{
if (st.getQuestItemsCount(TEST_INSTRUCTIONS1) > 0)
{
- if (CalcItemsConds(st, ITEMS_1ST_CIRCLE) < 3)
+ if (calcItemsConds(st, ITEMS_1ST_CIRCLE) < 3)
{
return "30744_05.htm";
}
- DelItemsConds(st, ITEMS_1ST_CIRCLE);
+
+ delItemsConds(st, ITEMS_1ST_CIRCLE);
st.takeItems(TEST_INSTRUCTIONS1, -1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(CIRCLE_HUNTER_LICENSE1, 1);
- st.set("cond", "2");
+ st.setCond(2);
return "30744_06.htm";
}
+
if (st.getQuestItemsCount(CIRCLE_HUNTER_LICENSE1) > 0)
{
if (st.getPlayer().getLevel() < 45)
@@ -620,18 +617,19 @@ public class Q335_TheSongOfTheHunter extends Quest
return "30744_08.htm";
}
}
+
if (st.getQuestItemsCount(TEST_INSTRUCTIONS2) > 0)
{
- if (CalcItemsConds(st, ITEMS_2ND_CIRCLE) < 3)
+ if (calcItemsConds(st, ITEMS_2ND_CIRCLE) < 3)
{
return "30744_11.htm";
}
- DelItemsConds(st, ITEMS_2ND_CIRCLE);
+ delItemsConds(st, ITEMS_2ND_CIRCLE);
st.takeItems(TEST_INSTRUCTIONS2, -1);
st.takeItems(CIRCLE_HUNTER_LICENSE1, -1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(CIRCLE_HUNTER_LICENSE2, 1);
- st.set("cond", "3");
+ st.setCond(3);
return "30744_12.htm";
}
else if (st.getQuestItemsCount(CIRCLE_HUNTER_LICENSE2) > 0)
@@ -649,24 +647,24 @@ public class Q335_TheSongOfTheHunter extends Quest
{
return "30746_02.htm";
}
- final int Blood_Crystal_Level = Get_Blood_Crystal_Level(st);
- if (Blood_Crystal_Level == -1)
+ final int bloodCrystalLevel = getBloodCrystalLevel(st);
+ if (bloodCrystalLevel == -1)
{
return "30746_08.htm";
}
- if (Blood_Crystal_Level == 0)
+ if (bloodCrystalLevel == 0)
{
return "30746_09.htm";
}
- if (Blood_Crystal_Level == 1)
+ if (bloodCrystalLevel == 1)
{
return "30746_04.htm";
}
- if ((Blood_Crystal_Level > 1) && (Blood_Crystal_Level < 10))
+ if ((bloodCrystalLevel > 1) && (bloodCrystalLevel < 10))
{
return "30746_05.htm";
}
- if ((Blood_Crystal_Level == 10) && Blood_Crystal2Adena(st, Blood_Crystal_Level))
+ if ((bloodCrystalLevel == 10) && bloodCrystal2Adena(st, bloodCrystalLevel))
{
return "30746_05a.htm";
}
@@ -679,10 +677,10 @@ public class Q335_TheSongOfTheHunter extends Quest
}
if (st.getQuestItemsCount(CIRCLE_HUNTER_LICENSE1) > 0)
{
- final Request request = GetCurrentRequest(st, REQUESTS1);
+ final Request request = getCurrentRequest(st, REQUESTS1);
if (request != null)
{
- return request.Complete(st) ? "30745_06a.htm" : "30745_05.htm";
+ return request.complete(st) ? "30745_06a.htm" : "30745_05.htm";
}
if (st.getPlayer().getLevel() < 45)
{
@@ -692,12 +690,12 @@ public class Q335_TheSongOfTheHunter extends Quest
}
else if (st.getQuestItemsCount(CIRCLE_HUNTER_LICENSE2) > 0)
{
- final Request request = GetCurrentRequest(st, REQUESTS2);
+ final Request request = getCurrentRequest(st, REQUESTS2);
if (request == null)
{
return "30745_03b.htm";
}
- return request.Complete(st) ? "30745_06b.htm" : "30745_05.htm";
+ return request.complete(st) ? "30745_06b.htm" : "30745_05.htm";
}
}
return getNoQuestMsg();
@@ -716,6 +714,7 @@ public class Q335_TheSongOfTheHunter extends Quest
{
return null;
}
+
final int npcId = npc.getNpcId();
int[][][] itemsCircle = null;
if (st.getQuestItemsCount(TEST_INSTRUCTIONS1) > 0)
@@ -852,8 +851,8 @@ public class Q335_TheSongOfTheHunter extends Quest
{
if ((st.getQuestItemsCount(CYBELLINS_REQUEST) > 0) && (st.getPlayer().getActiveWeaponItem() != null) && (st.getPlayer().getActiveWeaponItem().getItemId() == 3471))
{
- final int Blood_Crystal_Level = Get_Blood_Crystal_Level(st);
- if ((Blood_Crystal_Level > 0) && (Blood_Crystal_Level < 10))
+ final int bloodCrystalLevel = getBloodCrystalLevel(st);
+ if ((bloodCrystalLevel > 0) && (bloodCrystalLevel < 10))
{
for (int lizardmen_id : Q_BLOOD_CRYSTAL_LIZARDMEN)
{
@@ -861,9 +860,9 @@ public class Q335_TheSongOfTheHunter extends Quest
{
if (Rnd.get(100) < 50)
{
- st.takeItems(Q_BLOOD_CRYSTAL[Blood_Crystal_Level], -1);
- st.playSound((Blood_Crystal_Level < 6) ? "ItemSound.quest_middle" : "ItemSound.quest_jackpot");
- st.giveItems(Q_BLOOD_CRYSTAL[Blood_Crystal_Level + 1], 1);
+ st.takeItems(Q_BLOOD_CRYSTAL[bloodCrystalLevel], -1);
+ st.playSound((bloodCrystalLevel < 6) ? QuestState.SOUND_MIDDLE : QuestState.SOUND_JACKPOT);
+ st.giveItems(Q_BLOOD_CRYSTAL[bloodCrystalLevel + 1], 1);
}
else
{
@@ -877,10 +876,10 @@ public class Q335_TheSongOfTheHunter extends Quest
}
}
}
- Request request = GetCurrentRequest(st, REQUESTS1);
+ Request request = getCurrentRequest(st, REQUESTS1);
if (request == null)
{
- request = GetCurrentRequest(st, REQUESTS2);
+ request = getCurrentRequest(st, REQUESTS2);
}
if (request != null)
{
@@ -955,15 +954,16 @@ public class Q335_TheSongOfTheHunter extends Quest
return this;
}
- public boolean Complete(QuestState st)
+ public boolean complete(QuestState st)
{
if (st.getQuestItemsCount(request_item) < request_count)
{
return false;
}
+
st.takeItems(request_id, -1);
st.takeItems(request_item, -1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LAUREL_LEAF_PIN, 1);
st.giveItems(57, reward_adena);
st.unset("list");
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q336_CoinsOfMagic/Q336_CoinsOfMagic.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q336_CoinsOfMagic/Q336_CoinsOfMagic.java
index 60bf92a330..6c70474654 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q336_CoinsOfMagic/Q336_CoinsOfMagic.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q336_CoinsOfMagic/Q336_CoinsOfMagic.java
@@ -154,46 +154,44 @@ public class Q336_CoinsOfMagic extends Quest
return htmltext;
}
- final int cond = st.getInt("cond");
- if ("30702-06.htm".equalsIgnoreCase(event))
+ final int cond = st.getCond();
+ if ("30702-06.htm".equals(event))
{
if (cond < 7)
{
- st.set("cond", "7");
- st.playSound("ItemSound.quest_accept");
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_ACCEPT);
}
}
- else if ("30232-22.htm".equalsIgnoreCase(event))
+ else if ("30232-22.htm".equals(event))
{
if (cond < 6)
{
- st.set("cond", "6");
+ st.setCond(6);
}
}
- else if ("30232-23.htm".equalsIgnoreCase(event))
+ else if ("30232-23.htm".equals(event))
{
if (cond < 5)
{
- st.set("cond", "5");
+ st.setCond(5);
}
}
- else if ("30702-02.htm".equalsIgnoreCase(event))
+ else if ("30702-02.htm".equals(event))
{
- st.set("cond", "2");
+ st.setCond(2);
}
- else if ("30232-05.htm".equalsIgnoreCase(event))
+ else if ("30232-05.htm".equals(event))
{
- st.setState(State.STARTED);
- st.playSound("ItemSound.quest_accept");
+ st.startQuest();
st.giveItems(COIN_DIAGRAM, 1);
- st.set("cond", "1");
}
- else if ("30232-04.htm".equalsIgnoreCase(event) || "30232-18a.htm".equalsIgnoreCase(event))
+ else if ("30232-04.htm".equals(event) || "30232-18a.htm".equals(event))
{
st.exitQuest(true);
- st.playSound("ItemSound.quest_giveup");
+ st.playSound(QuestState.SOUND_GIVEUP);
}
- else if ("raise".equalsIgnoreCase(event))
+ else if ("raise".equals(event))
{
htmltext = promote(st);
}
@@ -230,11 +228,11 @@ public class Q336_CoinsOfMagic extends Quest
st.set("grade", "" + (grade - 1));
if (grade == 3)
{
- st.set("cond", "9");
+ st.setCond(9);
}
else if (grade == 2)
{
- st.set("cond", "11");
+ st.setCond(11);
}
st.playSound("ItemSound.quest_fanfare_middle");
}
@@ -243,11 +241,11 @@ public class Q336_CoinsOfMagic extends Quest
html = "30232-" + (16 - grade) + ".htm";
if (grade == 3)
{
- st.set("cond", "8");
+ st.setCond(8);
}
else if (grade == 2)
{
- st.set("cond", "9");
+ st.setCond(9);
}
}
}
@@ -291,7 +289,7 @@ public class Q336_CoinsOfMagic extends Quest
st.takeItems(COIN_DIAGRAM, -1);
st.giveItems(MEMBERSHIP_3, 1);
st.set("grade", "3");
- st.set("cond", "4");
+ st.setCond(4);
st.playSound("ItemSound.quest_fanfare_middle");
htmltext = "30232-07.htm";
}
@@ -350,19 +348,20 @@ public class Q336_CoinsOfMagic extends Quest
return null;
}
- final int cond = st.getInt("cond");
- final int grade = st.getInt("grade");
- final int chance = (npc.getLevel() + (grade * 3)) - 20;
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
if ((npcId == HARIT_LIZARDMAN_MATRIARCH) || (npcId == HARIT_LIZARDMAN_SHAMAN))
{
if ((cond == 2) && (Rnd.get(1000) < 63))
{
st.giveItems(KALDIS_COIN, 1);
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
}
+
+ final int grade = st.getInt("grade");
+ final int chance = (npc.getLevel() + (grade * 3)) - 20;
for (int[] e : DROPLIST)
{
if (e[0] == npcId)
@@ -374,6 +373,7 @@ public class Q336_CoinsOfMagic extends Quest
return null;
}
}
+
for (int u : MONSTERS)
{
if (u == npcId)
@@ -385,6 +385,7 @@ public class Q336_CoinsOfMagic extends Quest
return null;
}
}
+
return null;
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q337_AudienceWithTheLandDragon/Q337_AudienceWithTheLandDragon.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q337_AudienceWithTheLandDragon/Q337_AudienceWithTheLandDragon.java
index 62c4354b7f..b92b2d2c0e 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q337_AudienceWithTheLandDragon/Q337_AudienceWithTheLandDragon.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q337_AudienceWithTheLandDragon/Q337_AudienceWithTheLandDragon.java
@@ -27,11 +27,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q337_AudienceWithTheLandDragon extends Quest
{
- // Variables
- private static boolean _jewel1 = false;
- private static boolean _jewel2 = false;
- private static boolean _jewel3 = false;
-
// NPCs
private static final int GABRIELLE = 30753;
private static final int ORVEN = 30857; // 1
@@ -42,8 +37,7 @@ public class Q337_AudienceWithTheLandDragon extends Quest
private static final int HELTON = 30678; // 2nd abyssal
private static final int GILMORE = 30754; // 3rd abyssal
private static final int THEODRIC = 30755;
-
- // Mobs
+ // Monsters
private static final int BLOOD_QUEEN = 18001; // 1
private static final int SACRIFICE_OF_THE_SACRIFICED = 27171; // 1
private static final int HARIT_LIZARDMAN_SHAMAN = 20644; // 2
@@ -63,7 +57,6 @@ public class Q337_AudienceWithTheLandDragon extends Quest
private static final int CAVE_KEEPER_2 = 20277;
private static final int ABYSSAL_JEWEL_3 = 27167;
private static final int JEWEL_GUARDIAN_PYTON = 27170;
-
// Items
private static final int FEATHER_OF_GABRIELLE = 3852;
private static final int MARK_OF_WATCHMAN = 3864;
@@ -80,92 +73,31 @@ public class Q337_AudienceWithTheLandDragon extends Quest
private static final int HERALD_OF_SLAYER = 3890;
private static final int THIRD_FRAGMENT_OF_ABYSS_JEWEL = 3861; // 3rd abyssal
private static final int PORTAL_STONE = 3865;
-
- /**
- * 0..npcId, 1..cond, 2..cond2, 3..chance, 4..itemId
- */
+ // Variables
+ private static boolean _jewel1 = false;
+ private static boolean _jewel2 = false;
+ private static boolean _jewel3 = false;
+ // @formatter:off
private static final int[][] DROPS_ON_KILL =
{
- {
- SACRIFICE_OF_THE_SACRIFICED,
- 1,
- 1,
- REMAINS_OF_SACRIFIED
- },
- {
- HARIT_LIZARDMAN_ZEALOT,
- 1,
- 2,
- TOTEM_OF_LAND_DRAGON
- },
- {
- KRANROT,
- 1,
- 3,
- KRANROT_SKIN
- },
- {
- HAMRUT,
- 1,
- 3,
- HAMRUT_LEG
- },
- {
- MARSH_DRAKE,
- 1,
- 4,
- MARSH_DRAKE_TALONS
- },
- {
- MARSH_STALKER,
- 1,
- 4,
- MARSH_STALKER_HORN
- },
- {
- JEWEL_GUARDIAN_MARA,
- 2,
- 5,
- MARA_FANG
- },
- {
- JEWEL_GUARDIAN_MUSFEL,
- 2,
- 6,
- MUSFEL_FANG
- }
+ // 0..npcId, 1..cond, 2..cond2, 3..chance, 4..itemId
+ {SACRIFICE_OF_THE_SACRIFICED, 1, 1, REMAINS_OF_SACRIFIED},
+ {HARIT_LIZARDMAN_ZEALOT, 1, 2, TOTEM_OF_LAND_DRAGON},
+ {KRANROT, 1, 3, KRANROT_SKIN},
+ {HAMRUT, 1, 3, HAMRUT_LEG},
+ {MARSH_DRAKE, 1, 4, MARSH_DRAKE_TALONS},
+ {MARSH_STALKER, 1, 4, MARSH_STALKER_HORN},
+ {JEWEL_GUARDIAN_MARA, 2, 5, MARA_FANG},
+ {JEWEL_GUARDIAN_MUSFEL, 2, 6, MUSFEL_FANG}
};
-
- /**
- * 0..npcId, 1..cond, 2..cond2, 3..itemId, 4..amount of mobs, 5..mob
- */
private static final int[][] DROP_ON_ATTACK =
{
- {
- ABYSSAL_JEWEL_1,
- 2,
- 5,
- FIRST_FRAGMENT_OF_ABYSS_JEWEL,
- 20,
- JEWEL_GUARDIAN_MARA
- },
- {
- ABYSSAL_JEWEL_2,
- 2,
- 6,
- SECOND_FRAGMENT_OF_ABYSS_JEWEL,
- 20,
- JEWEL_GUARDIAN_MUSFEL
- },
- {
- ABYSSAL_JEWEL_3,
- 4,
- 7,
- THIRD_FRAGMENT_OF_ABYSS_JEWEL,
- 3,
- JEWEL_GUARDIAN_PYTON
- },
+ // 0..npcId, 1..cond, 2..cond2, 3..itemId, 4..amount of mobs, 5..mob
+ {ABYSSAL_JEWEL_1, 2, 5, FIRST_FRAGMENT_OF_ABYSS_JEWEL, 20, JEWEL_GUARDIAN_MARA},
+ {ABYSSAL_JEWEL_2, 2, 6, SECOND_FRAGMENT_OF_ABYSS_JEWEL, 20, JEWEL_GUARDIAN_MUSFEL},
+ {ABYSSAL_JEWEL_3, 4, 7, THIRD_FRAGMENT_OF_ABYSS_JEWEL, 3, JEWEL_GUARDIAN_PYTON},
};
+ // @formatter:on
public Q337_AudienceWithTheLandDragon()
{
@@ -190,47 +122,49 @@ public class Q337_AudienceWithTheLandDragon extends Quest
return htmltext;
}
- // Gabrielle
- if (event.equals("30753-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("drop1", "1");
- st.set("drop2", "1");
- st.set("drop3", "1");
- st.set("drop4", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(FEATHER_OF_GABRIELLE, 1);
- }
- else if (event.equals("30753-09.htm"))
- {
- if (st.getQuestItemsCount(MARK_OF_WATCHMAN) >= 4)
+ case "30753-05.htm":
{
- st.set("cond", "2");
- st.set("drop5", "2");
- st.set("drop6", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MARK_OF_WATCHMAN, 4);
+ st.startQuest();
+ st.set("drop1", "1");
+ st.set("drop2", "1");
+ st.set("drop3", "1");
+ st.set("drop4", "1");
+ st.giveItems(FEATHER_OF_GABRIELLE, 1);
+ break;
}
- else
+ case "30753-09.htm":
{
- htmltext = null;
+ if (st.getQuestItemsCount(MARK_OF_WATCHMAN) >= 4)
+ {
+ st.setCond(2);
+ st.set("drop5", "2");
+ st.set("drop6", "2");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MARK_OF_WATCHMAN, 4);
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
}
- }
- // Theodric
- else if (event.equals("30755-05.htm"))
- {
- if (st.hasQuestItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL))
+ case "30755-05.htm":
{
- st.takeItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL, 1);
- st.takeItems(HERALD_OF_SLAYER, 1);
- st.giveItems(PORTAL_STONE, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else
- {
- htmltext = null;
+ if (st.hasQuestItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL))
+ {
+ st.takeItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL, 1);
+ st.takeItems(HERALD_OF_SLAYER, 1);
+ st.giveItems(PORTAL_STONE, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = null;
+ }
+ break;
}
}
@@ -250,14 +184,17 @@ public class Q337_AudienceWithTheLandDragon extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 50) ? "30753-02.htm" : "30753-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GABRIELLE:
+ {
if (cond == 1)
{
htmltext = (st.getQuestItemsCount(MARK_OF_WATCHMAN) < 4) ? "30753-06.htm" : "30753-08.htm";
@@ -271,7 +208,7 @@ public class Q337_AudienceWithTheLandDragon extends Quest
else
{
htmltext = "30753-11.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FEATHER_OF_GABRIELLE, 1);
st.takeItems(MARK_OF_WATCHMAN, 1);
@@ -287,8 +224,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = "30753-13.htm";
}
break;
-
+ }
case ORVEN:
+ {
if (cond == 1)
{
if (st.getInt("drop1") == 1)
@@ -316,8 +254,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case KENDRA:
+ {
if (cond == 1)
{
if (st.getInt("drop2") == 1)
@@ -345,8 +284,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case CHAKIRIS:
+ {
if (cond == 1)
{
if (st.getInt("drop3") == 1)
@@ -375,8 +315,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case KAIENA:
+ {
if (cond == 1)
{
if (st.getInt("drop4") == 1)
@@ -405,18 +346,21 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case MOKE:
+ {
if (cond == 2)
{
switch (st.getInt("drop5"))
{
case 2:
+ {
htmltext = "30498-01.htm";
st.set("drop5", "1");
break;
-
+ }
case 1:
+ {
if (st.hasQuestItems(FIRST_FRAGMENT_OF_ABYSS_JEWEL, MARA_FANG))
{
htmltext = "30498-03.htm";
@@ -431,8 +375,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = "30498-02.htm";
}
break;
-
+ }
case 0:
+ {
if (st.getQuestItemsCount(MARK_OF_WATCHMAN) < 2)
{
htmltext = "30498-04.htm";
@@ -442,21 +387,25 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = "30498-05.htm";
}
break;
+ }
}
}
break;
-
+ }
case HELTON:
+ {
if (cond == 2)
{
switch (st.getInt("drop6"))
{
case 2:
+ {
htmltext = "30678-01.htm";
st.set("drop6", "1");
break;
-
+ }
case 1:
+ {
if (st.hasQuestItems(SECOND_FRAGMENT_OF_ABYSS_JEWEL, MUSFEL_FANG))
{
htmltext = "30678-03.htm";
@@ -471,8 +420,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = "30678-02.htm";
}
break;
-
+ }
case 0:
+ {
if (st.getQuestItemsCount(MARK_OF_WATCHMAN) < 2)
{
htmltext = "30678-04.htm";
@@ -482,11 +432,13 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = "30678-05.htm";
}
break;
+ }
}
}
break;
-
+ }
case GILMORE:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30754-01.htm";
@@ -494,7 +446,7 @@ public class Q337_AudienceWithTheLandDragon extends Quest
else if (cond == 3)
{
htmltext = "30754-02.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.set("drop7", "1");
st.playSound(QuestState.SOUND_MIDDLE);
}
@@ -503,8 +455,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = (!st.hasQuestItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL)) ? "30754-04.htm" : "30754-05.htm";
}
break;
-
+ }
case THEODRIC:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30755-01.htm";
@@ -518,8 +471,10 @@ public class Q337_AudienceWithTheLandDragon extends Quest
htmltext = (!st.hasQuestItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL)) ? "30755-03.htm" : "30755-04.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -542,7 +497,7 @@ public class Q337_AudienceWithTheLandDragon extends Quest
continue;
}
- if (npcInfo[1] != st.getInt("cond"))
+ if (npcInfo[1] != st.getCond())
{
break;
}
@@ -637,9 +592,8 @@ public class Q337_AudienceWithTheLandDragon extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case SACRIFICE_OF_THE_SACRIFICED: // Orven's request
@@ -650,6 +604,7 @@ public class Q337_AudienceWithTheLandDragon extends Quest
case MARSH_STALKER:
case JEWEL_GUARDIAN_MARA:// Moke's request
case JEWEL_GUARDIAN_MUSFEL:// Helton's request
+ {
for (int[] npcInfo : DROPS_ON_KILL)
{
if (npcInfo[0] != npcId)
@@ -669,8 +624,9 @@ public class Q337_AudienceWithTheLandDragon extends Quest
break;
}
break;
-
+ }
case BLOOD_QUEEN:// Orven's request
+ {
if ((cond == 1) && (st.getInt("drop1") == 1) && !st.hasQuestItems(REMAINS_OF_SACRIFIED))
{
for (int i = 0; i < 8; i++)
@@ -679,9 +635,10 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case HARIT_LIZARDMAN_SHAMAN:// Kendra's request
case HARIT_LIZARDMAN_MATRIARCH:
+ {
if ((cond == 1) && (Rnd.get(5) == 0) && (st.getInt("drop2") == 1) && !st.hasQuestItems(TOTEM_OF_LAND_DRAGON))
{
for (int i = 0; i < 3; i++)
@@ -690,16 +647,18 @@ public class Q337_AudienceWithTheLandDragon extends Quest
}
}
break;
-
+ }
case CAVE_MAIDEN_1:// Gilmore's request
case CAVE_MAIDEN_2:
case CAVE_KEEPER_1:
case CAVE_KEEPER_2:
+ {
if ((cond == 4) && (Rnd.get(5) == 0) && !st.hasQuestItems(THIRD_FRAGMENT_OF_ABYSS_JEWEL))
{
addSpawn(ABYSSAL_JEWEL_3, npc.getX() + Rnd.get(-50, 50), npc.getY() + Rnd.get(-50, 50), npc.getZ(), npc.getHeading(), true, 60000);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q338_AlligatorHunter/Q338_AlligatorHunter.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q338_AlligatorHunter/Q338_AlligatorHunter.java
index e9e21fdc53..8328f342b5 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q338_AlligatorHunter/Q338_AlligatorHunter.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q338_AlligatorHunter/Q338_AlligatorHunter.java
@@ -30,12 +30,9 @@ public class Q338_AlligatorHunter extends Quest
public Q338_AlligatorHunter()
{
super(338, "Alligator Hunter");
-
registerQuestItems(ALLIGATOR_PELT);
-
addStartNpc(30892); // Enverun
addTalkId(30892);
-
addKillId(20135); // Alligator
}
@@ -49,28 +46,31 @@ public class Q338_AlligatorHunter extends Quest
return htmltext;
}
- if (event.equals("30892-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30892-05.htm"))
- {
- final int pelts = st.getQuestItemsCount(ALLIGATOR_PELT);
- int reward = pelts * 60;
- if (pelts > 10)
+ case "30892-02.htm":
{
- reward += 3430;
+ st.startQuest();
+ break;
+ }
+ case "30892-05.htm":
+ {
+ final int pelts = st.getQuestItemsCount(ALLIGATOR_PELT);
+ int reward = pelts * 60;
+ if (pelts > 10)
+ {
+ reward += 3430;
+ }
+ st.takeItems(ALLIGATOR_PELT, -1);
+ st.rewardItems(57, reward);
+ break;
+ }
+ case "30892-08.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
-
- st.takeItems(ALLIGATOR_PELT, -1);
- st.rewardItems(57, reward);
- }
- else if (event.equals("30892-08.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -89,12 +89,15 @@ public class Q338_AlligatorHunter extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 40) ? "30892-00.htm" : "30892-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(ALLIGATOR_PELT)) ? "30892-03.htm" : "30892-04.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q340_SubjugationOfLizardmen/Q340_SubjugationOfLizardmen.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q340_SubjugationOfLizardmen/Q340_SubjugationOfLizardmen.java
index 0f2de7e55f..78ba2d02f7 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q340_SubjugationOfLizardmen/Q340_SubjugationOfLizardmen.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q340_SubjugationOfLizardmen/Q340_SubjugationOfLizardmen.java
@@ -29,7 +29,6 @@ public class Q340_SubjugationOfLizardmen extends Quest
private static final int ADONIUS = 30375;
private static final int LEVIAN = 30037;
private static final int CHEST = 30989;
-
// Items
private static final int CARGO = 4255;
private static final int HOLY = 4256;
@@ -39,12 +38,9 @@ public class Q340_SubjugationOfLizardmen extends Quest
public Q340_SubjugationOfLizardmen()
{
super(340, "Subjugation of Lizardmen");
-
registerQuestItems(CARGO, HOLY, ROSARY, TOTEM);
-
addStartNpc(WEISZ);
addTalkId(WEISZ, ADONIUS, LEVIAN, CHEST);
-
addKillId(20008, 20010, 20014, 20024, 20027, 20030, 25146);
}
@@ -58,44 +54,52 @@ public class Q340_SubjugationOfLizardmen extends Quest
return htmltext;
}
- if (event.equals("30385-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30385-07.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(CARGO, -1);
- }
- else if (event.equals("30385-09.htm"))
- {
- st.takeItems(CARGO, -1);
- st.rewardItems(57, 4090);
- }
- else if (event.equals("30385-10.htm"))
- {
- st.takeItems(CARGO, -1);
- st.rewardItems(57, 4090);
- st.exitQuest(true);
- }
- else if (event.equals("30375-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30037-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30989-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(TOTEM, 1);
+ case "30385-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30385-07.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(CARGO, -1);
+ break;
+ }
+ case "30385-09.htm":
+ {
+ st.takeItems(CARGO, -1);
+ st.rewardItems(57, 4090);
+ break;
+ }
+ case "30385-10.htm":
+ {
+ st.takeItems(CARGO, -1);
+ st.rewardItems(57, 4090);
+ st.exitQuest(true);
+ break;
+ }
+ case "30375-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30037-02.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30989-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(TOTEM, 1);
+ break;
+ }
}
return htmltext;
@@ -114,14 +118,17 @@ public class Q340_SubjugationOfLizardmen extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 17) ? "30385-01.htm" : "30385-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case WEISZ:
+ {
if (cond == 1)
{
htmltext = (st.getQuestItemsCount(CARGO) < 30) ? "30385-05.htm" : "30385-06.htm";
@@ -138,8 +145,9 @@ public class Q340_SubjugationOfLizardmen extends Quest
st.exitQuest(false);
}
break;
-
+ }
case ADONIUS:
+ {
if (cond == 2)
{
htmltext = "30375-01.htm";
@@ -149,7 +157,7 @@ public class Q340_SubjugationOfLizardmen extends Quest
if (st.hasQuestItems(ROSARY, HOLY))
{
htmltext = "30375-04.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HOLY, -1);
st.takeItems(ROSARY, -1);
@@ -164,8 +172,9 @@ public class Q340_SubjugationOfLizardmen extends Quest
htmltext = "30375-05.htm";
}
break;
-
+ }
case LEVIAN:
+ {
if (cond == 4)
{
htmltext = "30037-01.htm";
@@ -177,7 +186,7 @@ public class Q340_SubjugationOfLizardmen extends Quest
else if (cond == 6)
{
htmltext = "30037-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TOTEM, -1);
}
@@ -186,8 +195,9 @@ public class Q340_SubjugationOfLizardmen extends Quest
htmltext = "30037-05.htm";
}
break;
-
+ }
case CHEST:
+ {
if (cond == 5)
{
htmltext = "30989-01.htm";
@@ -197,12 +207,15 @@ public class Q340_SubjugationOfLizardmen extends Quest
htmltext = "30989-03.htm";
}
break;
+ }
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -220,38 +233,44 @@ public class Q340_SubjugationOfLizardmen extends Quest
switch (npc.getNpcId())
{
case 20008:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
st.dropItems(CARGO, 1, 30, 500000);
}
break;
-
+ }
case 20010:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
st.dropItems(CARGO, 1, 30, 520000);
}
break;
-
+ }
case 20014:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
st.dropItems(CARGO, 1, 30, 550000);
}
break;
-
+ }
case 20024:
case 20027:
case 20030:
- if ((st.getInt("cond") == 3) && st.dropItems(HOLY, 1, 1, 100000))
+ {
+ if (st.isCond(3) && st.dropItems(HOLY, 1, 1, 100000))
{
st.dropItems(ROSARY, 1, 1, 100000);
}
break;
-
+ }
case 25146:
+ {
addSpawn(CHEST, npc, false, 30000);
break;
+ }
}
return null;
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q341_HuntingForWildBeasts/Q341_HuntingForWildBeasts.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q341_HuntingForWildBeasts/Q341_HuntingForWildBeasts.java
index d5b53ece3c..0ca919731a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q341_HuntingForWildBeasts/Q341_HuntingForWildBeasts.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q341_HuntingForWildBeasts/Q341_HuntingForWildBeasts.java
@@ -29,7 +29,6 @@ public class Q341_HuntingForWildBeasts extends Quest
{
// Item
private static final int BEAR_SKIN = 4259;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -43,12 +42,9 @@ public class Q341_HuntingForWildBeasts extends Quest
public Q341_HuntingForWildBeasts()
{
super(341, "Hunting for Wild Beasts");
-
registerQuestItems(BEAR_SKIN);
-
addStartNpc(30078); // Pano
addTalkId(30078);
-
addKillId(20021, 20203, 20310, 20335);
}
@@ -64,9 +60,7 @@ public class Q341_HuntingForWildBeasts extends Quest
if (event.equals("30078-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -85,10 +79,12 @@ public class Q341_HuntingForWildBeasts extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "30078-00.htm" : "30078-01.htm";
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(BEAR_SKIN) < 20)
{
htmltext = "30078-03.htm";
@@ -102,6 +98,7 @@ public class Q341_HuntingForWildBeasts extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q343_UnderTheShadowOfTheIvoryTower/Q343_UnderTheShadowOfTheIvoryTower.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q343_UnderTheShadowOfTheIvoryTower/Q343_UnderTheShadowOfTheIvoryTower.java
index fd1d6cad82..6087af2fde 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q343_UnderTheShadowOfTheIvoryTower/Q343_UnderTheShadowOfTheIvoryTower.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q343_UnderTheShadowOfTheIvoryTower/Q343_UnderTheShadowOfTheIvoryTower.java
@@ -85,9 +85,7 @@ public class Q343_UnderTheShadowOfTheIvoryTower extends Quest
{
case "30834-03.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound("ItemSound.quest_accept");
+ st.startQuest();
break;
}
case "30834-08.htm":
@@ -105,7 +103,7 @@ public class Q343_UnderTheShadowOfTheIvoryTower extends Quest
}
case "30834-09.htm":
{
- st.playSound("ItemSound.quest_finish");
+ st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
break;
}
@@ -440,7 +438,7 @@ public class Q343_UnderTheShadowOfTheIvoryTower extends Quest
if (Rnd.get(100) < CHANCE)
{
st.giveItems(ORB, 1);
- st.playSound("ItemSound.quest_itemget");
+ st.playSound(QuestState.SOUND_ITEMGET);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q344_1000YearsTheEndOfLamentation/Q344_1000YearsTheEndOfLamentation.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q344_1000YearsTheEndOfLamentation/Q344_1000YearsTheEndOfLamentation.java
index ef1a953952..d4a772e702 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q344_1000YearsTheEndOfLamentation/Q344_1000YearsTheEndOfLamentation.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q344_1000YearsTheEndOfLamentation/Q344_1000YearsTheEndOfLamentation.java
@@ -34,14 +34,12 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
private static final int ORVEN = 30857;
private static final int KAIEN = 30623;
private static final int GARVARENTZ = 30704;
-
// Items
private static final int ARTICLE_DEAD_HERO = 4269;
private static final int OLD_KEY = 4270;
private static final int OLD_HILT = 4271;
private static final int OLD_TOTEM = 4272;
private static final int CRUCIFIX = 4273;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -61,12 +59,9 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
public Q344_1000YearsTheEndOfLamentation()
{
super(344, "1000 years, the End of Lamentation");
-
registerQuestItems(ARTICLE_DEAD_HERO, OLD_KEY, OLD_HILT, OLD_TOTEM, CRUCIFIX);
-
addStartNpc(GILMORE);
addTalkId(GILMORE, RODEMAI, ORVEN, GARVARENTZ, KAIEN);
-
addKillId(20236, 20237, 20238, 20239, 20240, 20272, 20273, 20274, 20275, 20276);
}
@@ -80,71 +75,76 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
return htmltext;
}
- if (event.equals("30754-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30754-07.htm"))
- {
- if (st.get("success") != null)
+ case "30754-04.htm":
{
- st.set("cond", "1");
- st.unset("success");
- st.playSound(QuestState.SOUND_MIDDLE);
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30754-08.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30754-06.htm"))
- {
- if (!st.hasQuestItems(ARTICLE_DEAD_HERO))
+ case "30754-07.htm":
{
- htmltext = "30754-06a.htm";
- }
- else
- {
- final int amount = st.getQuestItemsCount(ARTICLE_DEAD_HERO);
-
- st.takeItems(ARTICLE_DEAD_HERO, -1);
- st.giveItems(57, amount * 60);
-
- // Special item, % based on actual number of qItems.
- if (Rnd.get(1000) < Math.min(10, Math.max(1, amount / 10)))
+ if (st.get("success") != null)
{
- htmltext = "30754-10.htm";
+ st.setCond(1);
+ st.unset("success");
+ st.playSound(QuestState.SOUND_MIDDLE);
}
+ break;
}
- }
- else if (event.equals("30754-11.htm"))
- {
- final int random = Rnd.get(4);
- if (random < 1)
+ case "30754-08.htm":
{
- htmltext = "30754-12.htm";
- st.giveItems(OLD_KEY, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- else if (random < 2)
+ case "30754-06.htm":
{
- htmltext = "30754-13.htm";
- st.giveItems(OLD_HILT, 1);
+ if (!st.hasQuestItems(ARTICLE_DEAD_HERO))
+ {
+ htmltext = "30754-06a.htm";
+ }
+ else
+ {
+ final int amount = st.getQuestItemsCount(ARTICLE_DEAD_HERO);
+
+ st.takeItems(ARTICLE_DEAD_HERO, -1);
+ st.giveItems(57, amount * 60);
+
+ // Special item, % based on actual number of qItems.
+ if (Rnd.get(1000) < Math.min(10, Math.max(1, amount / 10)))
+ {
+ htmltext = "30754-10.htm";
+ }
+ }
+ break;
}
- else if (random < 3)
+ case "30754-11.htm":
{
- htmltext = "30754-14.htm";
- st.giveItems(OLD_TOTEM, 1);
+ final int random = Rnd.get(4);
+ if (random < 1)
+ {
+ htmltext = "30754-12.htm";
+ st.giveItems(OLD_KEY, 1);
+ }
+ else if (random < 2)
+ {
+ htmltext = "30754-13.htm";
+ st.giveItems(OLD_HILT, 1);
+ }
+ else if (random < 3)
+ {
+ htmltext = "30754-14.htm";
+ st.giveItems(OLD_TOTEM, 1);
+ }
+ else
+ {
+ st.giveItems(CRUCIFIX, 1);
+ }
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- else
- {
- st.giveItems(CRUCIFIX, 1);
- }
-
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
}
return htmltext;
@@ -163,14 +163,17 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 48) ? "30754-01.htm" : "30754-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GILMORE:
+ {
if (cond == 1)
{
htmltext = (st.hasQuestItems(ARTICLE_DEAD_HERO)) ? "30754-05.htm" : "30754-09.htm";
@@ -180,8 +183,9 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
htmltext = (st.get("success") != null) ? "30754-16.htm" : "30754-15.htm";
}
break;
-
+ }
default:
+ {
if (cond == 2)
{
if (st.get("success") != null)
@@ -195,8 +199,10 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
}
}
break;
+ }
}
break;
+ }
}
return htmltext;
}
@@ -206,6 +212,7 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
switch (npcId)
{
case ORVEN:
+ {
if (st.hasQuestItems(CRUCIFIX))
{
st.set("success", "1");
@@ -226,8 +233,9 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
}
}
break;
-
+ }
case GARVARENTZ:
+ {
if (st.hasQuestItems(OLD_TOTEM))
{
st.set("success", "1");
@@ -248,8 +256,9 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
}
}
break;
-
+ }
case KAIEN:
+ {
if (st.hasQuestItems(OLD_HILT))
{
st.set("success", "1");
@@ -274,8 +283,9 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
}
}
break;
-
+ }
case RODEMAI:
+ {
if (st.hasQuestItems(OLD_KEY))
{
st.set("success", "1");
@@ -296,13 +306,14 @@ public class Q344_1000YearsTheEndOfLamentation extends Quest
}
}
break;
+ }
}
}
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q345_MethodToRaiseTheDead/Q345_MethodToRaiseTheDead.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q345_MethodToRaiseTheDead/Q345_MethodToRaiseTheDead.java
index a40cc9c8c9..f52f45713b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q345_MethodToRaiseTheDead/Q345_MethodToRaiseTheDead.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q345_MethodToRaiseTheDead/Q345_MethodToRaiseTheDead.java
@@ -25,6 +25,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q345_MethodToRaiseTheDead extends Quest
{
+ // NPCs
+ private static final int XENOVIA = 30912;
+ private static final int DOROTHY = 30970;
+ private static final int ORPHEUS = 30971;
+ private static final int MEDIUM_JAR = 30973;
// Items
private static final int VICTIM_ARM_BONE = 4274;
private static final int VICTIM_THIGH_BONE = 4275;
@@ -33,13 +38,6 @@ public class Q345_MethodToRaiseTheDead extends Quest
private static final int VICTIM_SPINE = 4278;
private static final int USELESS_BONE_PIECES = 4280;
private static final int POWDER_TO_SUMMON_DEAD_SOULS = 4281;
-
- // NPCs
- private static final int XENOVIA = 30912;
- private static final int DOROTHY = 30970;
- private static final int ORPHEUS = 30971;
- private static final int MEDIUM_JAR = 30973;
-
// Rewards
private static final int BILL_OF_IASON_HEINE = 4310;
private static final int IMPERIAL_DIAMOND = 3456;
@@ -47,12 +45,9 @@ public class Q345_MethodToRaiseTheDead extends Quest
public Q345_MethodToRaiseTheDead()
{
super(345, "Method to Raise the Dead");
-
registerQuestItems(VICTIM_ARM_BONE, VICTIM_THIGH_BONE, VICTIM_SKULL, VICTIM_RIB_BONE, VICTIM_SPINE, POWDER_TO_SUMMON_DEAD_SOULS, USELESS_BONE_PIECES);
-
addStartNpc(DOROTHY);
addTalkId(DOROTHY, XENOVIA, MEDIUM_JAR, ORPHEUS);
-
addKillId(20789, 20791);
}
@@ -66,77 +61,84 @@ public class Q345_MethodToRaiseTheDead extends Quest
return htmltext;
}
- if (event.equals("30970-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30970-06.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30912-04.htm"))
- {
- if (player.getAdena() >= 1000)
+ case "30970-03.htm":
{
- htmltext = "30912-03.htm";
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(57, 1000);
- st.giveItems(POWDER_TO_SUMMON_DEAD_SOULS, 1);
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30973-04.htm"))
- {
- if (st.getInt("cond") == 3)
+ case "30970-06.htm":
{
- final int chance = Rnd.get(3);
- if (chance == 0)
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30912-04.htm":
+ {
+ if (player.getAdena() >= 1000)
{
- st.set("cond", "6");
- htmltext = "30973-02a.htm";
+ htmltext = "30912-03.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(57, 1000);
+ st.giveItems(POWDER_TO_SUMMON_DEAD_SOULS, 1);
}
- else if (chance == 1)
+ break;
+ }
+ case "30973-04.htm":
+ {
+ if (st.isCond(3))
{
- st.set("cond", "6");
- htmltext = "30973-02b.htm";
+ final int chance = Rnd.get(3);
+ if (chance == 0)
+ {
+ st.setCond(6);
+ htmltext = "30973-02a.htm";
+ }
+ else if (chance == 1)
+ {
+ st.setCond(6);
+ htmltext = "30973-02b.htm";
+ }
+ else
+ {
+ st.setCond(7);
+ htmltext = "30973-02c.htm";
+ }
+
+ st.takeItems(POWDER_TO_SUMMON_DEAD_SOULS, -1);
+ st.takeItems(VICTIM_ARM_BONE, -1);
+ st.takeItems(VICTIM_THIGH_BONE, -1);
+ st.takeItems(VICTIM_SKULL, -1);
+ st.takeItems(VICTIM_RIB_BONE, -1);
+ st.takeItems(VICTIM_SPINE, -1);
+
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
+ }
+ case "30971-02a.htm":
+ {
+ if (st.hasQuestItems(USELESS_BONE_PIECES))
+ {
+ htmltext = "30971-02.htm";
+ }
+ break;
+ }
+ case "30971-03.htm":
+ {
+ if (st.hasQuestItems(USELESS_BONE_PIECES))
+ {
+ final int amount = st.getQuestItemsCount(USELESS_BONE_PIECES) * 104;
+ st.takeItems(USELESS_BONE_PIECES, -1);
+ st.rewardItems(57, amount);
}
else
{
- st.set("cond", "7");
- htmltext = "30973-02c.htm";
+ htmltext = "30971-02a.htm";
}
-
- st.takeItems(POWDER_TO_SUMMON_DEAD_SOULS, -1);
- st.takeItems(VICTIM_ARM_BONE, -1);
- st.takeItems(VICTIM_THIGH_BONE, -1);
- st.takeItems(VICTIM_SKULL, -1);
- st.takeItems(VICTIM_RIB_BONE, -1);
- st.takeItems(VICTIM_SPINE, -1);
-
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- }
- else if (event.equals("30971-02a.htm"))
- {
- if (st.hasQuestItems(USELESS_BONE_PIECES))
- {
- htmltext = "30971-02.htm";
- }
- }
- else if (event.equals("30971-03.htm"))
- {
- if (st.hasQuestItems(USELESS_BONE_PIECES))
- {
- final int amount = st.getQuestItemsCount(USELESS_BONE_PIECES) * 104;
- st.takeItems(USELESS_BONE_PIECES, -1);
- st.rewardItems(57, amount);
- }
- else
- {
- htmltext = "30971-02a.htm";
+ break;
}
}
@@ -156,14 +158,17 @@ public class Q345_MethodToRaiseTheDead extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 35) ? "30970-00.htm" : "30970-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case DOROTHY:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(VICTIM_ARM_BONE, VICTIM_THIGH_BONE, VICTIM_SKULL, VICTIM_RIB_BONE, VICTIM_SPINE)) ? "30970-04.htm" : "30970-05.htm";
@@ -209,8 +214,9 @@ public class Q345_MethodToRaiseTheDead extends Quest
st.exitQuest(true);
}
break;
-
+ }
case XENOVIA:
+ {
if (cond == 2)
{
htmltext = "30912-01.htm";
@@ -220,16 +226,20 @@ public class Q345_MethodToRaiseTheDead extends Quest
htmltext = "30912-06.htm";
}
break;
-
+ }
case MEDIUM_JAR:
+ {
htmltext = "30973-01.htm";
break;
-
+ }
case ORPHEUS:
+ {
htmltext = "30971-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -238,7 +248,7 @@ public class Q345_MethodToRaiseTheDead extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q347_GoGetTheCalculator/Q347_GoGetTheCalculator.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q347_GoGetTheCalculator/Q347_GoGetTheCalculator.java
index d428335dc0..d97daa55e2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q347_GoGetTheCalculator/Q347_GoGetTheCalculator.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q347_GoGetTheCalculator/Q347_GoGetTheCalculator.java
@@ -29,7 +29,6 @@ public class Q347_GoGetTheCalculator extends Quest
private static final int SILVERA = 30527;
private static final int SPIRON = 30532;
private static final int BALANKI = 30533;
-
// Items
private static final int GEMSTONE_BEAST_CRYSTAL = 4286;
private static final int CALCULATOR_QUEST = 4285;
@@ -38,12 +37,9 @@ public class Q347_GoGetTheCalculator extends Quest
public Q347_GoGetTheCalculator()
{
super(347, "Go Get the Calculator");
-
registerQuestItems(GEMSTONE_BEAST_CRYSTAL, CALCULATOR_QUEST);
-
addStartNpc(BRUNON);
addTalkId(BRUNON, SILVERA, SPIRON, BALANKI);
-
addKillId(20540);
}
@@ -57,57 +53,62 @@ public class Q347_GoGetTheCalculator extends Quest
return htmltext;
}
- if (event.equals("30526-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30533-03.htm"))
- {
- if (st.getQuestItemsCount(57) >= 100)
+ case "30526-05.htm":
{
- htmltext = "30533-02.htm";
- st.takeItems(57, 100);
-
- if (st.getInt("cond") == 3)
+ st.startQuest();
+ break;
+ }
+ case "30533-03.htm":
+ {
+ if (st.getQuestItemsCount(57) >= 100)
{
- st.set("cond", "4");
+ htmltext = "30533-02.htm";
+ st.takeItems(57, 100);
+
+ if (st.isCond(3))
+ {
+ st.setCond(4);
+ }
+ else
+ {
+ st.setCond(2);
+ }
+
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
+ }
+ case "30532-02.htm":
+ {
+ if (st.isCond(2))
+ {
+ st.setCond(4);
}
else
{
- st.set("cond", "2");
+ st.setCond(3);
}
-
st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("30532-02.htm"))
- {
- if (st.getInt("cond") == 2)
+ case "30526-08.htm":
{
- st.set("cond", "4");
+ st.takeItems(CALCULATOR_QUEST, -1);
+ st.giveItems(CALCULATOR_REAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- else
+ case "30526-09.htm":
{
- st.set("cond", "3");
+ st.takeItems(CALCULATOR_QUEST, -1);
+ st.rewardItems(57, 1000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
-
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30526-08.htm"))
- {
- st.takeItems(CALCULATOR_QUEST, -1);
- st.giveItems(CALCULATOR_REAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30526-09.htm"))
- {
- st.takeItems(CALCULATOR_QUEST, -1);
- st.rewardItems(57, 1000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -126,26 +127,32 @@ public class Q347_GoGetTheCalculator extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 12) ? "30526-00.htm" : "30526-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BRUNON:
+ {
htmltext = (!st.hasQuestItems(CALCULATOR_QUEST)) ? "30526-06.htm" : "30526-07.htm";
break;
-
+ }
case SPIRON:
+ {
htmltext = (cond < 4) ? "30532-01.htm" : "30532-05.htm";
break;
-
+ }
case BALANKI:
+ {
htmltext = (cond < 4) ? "30533-01.htm" : "30533-04.htm";
break;
-
+ }
case SILVERA:
+ {
if (cond < 4)
{
htmltext = "30527-00.htm";
@@ -153,7 +160,7 @@ public class Q347_GoGetTheCalculator extends Quest
else if (cond == 4)
{
htmltext = "30527-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
@@ -165,7 +172,7 @@ public class Q347_GoGetTheCalculator extends Quest
else
{
htmltext = "30527-03.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.takeItems(GEMSTONE_BEAST_CRYSTAL, -1);
st.giveItems(CALCULATOR_QUEST, 1);
st.playSound(QuestState.SOUND_MIDDLE);
@@ -176,8 +183,10 @@ public class Q347_GoGetTheCalculator extends Quest
htmltext = "30527-04.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -186,7 +195,7 @@ public class Q347_GoGetTheCalculator extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "5");
+ final QuestState st = checkPlayerCondition(player, npc, 5);
if (st == null)
{
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q348_AnArrogantSearch/Q348_AnArrogantSearch.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q348_AnArrogantSearch/Q348_AnArrogantSearch.java
index 23d08c591a..b9bca8e5c3 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q348_AnArrogantSearch/Q348_AnArrogantSearch.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q348_AnArrogantSearch/Q348_AnArrogantSearch.java
@@ -25,6 +25,29 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q348_AnArrogantSearch extends Quest
{
+ // NPCs
+ private static final int HANELLIN = 30864;
+ private static final int CLAUDIA_ATHEBALDT = 31001;
+ private static final int MARTIEN = 30645;
+ private static final int HARNE = 30144;
+ private static final int ARK_GUARDIAN_CORPSE = 30980;
+ private static final int HOLY_ARK_OF_SECRECY_1 = 30977;
+ private static final int HOLY_ARK_OF_SECRECY_2 = 30978;
+ private static final int HOLY_ARK_OF_SECRECY_3 = 30979;
+ private static final int GUSTAV_ATHEBALDT = 30760;
+ private static final int HARDIN = 30832;
+ private static final int IASON_HEINE = 30969;
+ // Monsters
+ private static final int LESSER_GIANT_MAGE = 20657;
+ private static final int LESSER_GIANT_ELDER = 20658;
+ private static final int PLATINUM_TRIBE_SHAMAN = 20828;
+ private static final int PLATINUM_TRIBE_OVERLORD = 20829;
+ private static final int GUARDIAN_ANGEL = 20859;
+ private static final int SEAL_ANGEL = 20860;
+ // Quest Monsters
+ private static final int ANGEL_KILLER = 27184;
+ private static final int ARK_GUARDIAN_ELBEROTH = 27182;
+ private static final int ARK_GUARDIAN_SHADOW_FANG = 27183;
// Items
private static final int TITAN_POWERSTONE = 4287;
private static final int HANELLIN_FIRST_LETTER = 4288;
@@ -39,36 +62,8 @@ public class Q348_AnArrogantSearch extends Quest
private static final int WHITE_FABRIC_TRIBE = 4294;
private static final int WHITE_FABRIC_ANGELS = 5232;
private static final int BLOODED_FABRIC = 4295;
-
private static final int ANTIDOTE = 1831;
private static final int HEALING_POTION = 1061;
-
- // NPCs
- private static final int HANELLIN = 30864;
- private static final int CLAUDIA_ATHEBALDT = 31001;
- private static final int MARTIEN = 30645;
- private static final int HARNE = 30144;
- private static final int ARK_GUARDIAN_CORPSE = 30980;
- private static final int HOLY_ARK_OF_SECRECY_1 = 30977;
- private static final int HOLY_ARK_OF_SECRECY_2 = 30978;
- private static final int HOLY_ARK_OF_SECRECY_3 = 30979;
- private static final int GUSTAV_ATHEBALDT = 30760;
- private static final int HARDIN = 30832;
- private static final int IASON_HEINE = 30969;
-
- // Monsters
- private static final int LESSER_GIANT_MAGE = 20657;
- private static final int LESSER_GIANT_ELDER = 20658;
- private static final int PLATINUM_TRIBE_SHAMAN = 20828;
- private static final int PLATINUM_TRIBE_OVERLORD = 20829;
- private static final int GUARDIAN_ANGEL = 20859;
- private static final int SEAL_ANGEL = 20860;
-
- // Quest Monsters
- private static final int ANGEL_KILLER = 27184;
- private static final int ARK_GUARDIAN_ELBEROTH = 27182;
- private static final int ARK_GUARDIAN_SHADOW_FANG = 27183;
-
// NPCs instances, in order to avoid infinite instances creation speaking to chests.
private NpcInstance _elberoth;
private NpcInstance _shadowFang;
@@ -77,15 +72,11 @@ public class Q348_AnArrogantSearch extends Quest
public Q348_AnArrogantSearch()
{
super(348, "An Arrogant Search");
-
registerQuestItems(TITAN_POWERSTONE, HANELLIN_FIRST_LETTER, HANELLIN_SECOND_LETTER, HANELLIN_THIRD_LETTER, FIRST_KEY_OF_ARK, SECOND_KEY_OF_ARK, THIRD_KEY_OF_ARK, BOOK_OF_SAINT, BLOOD_OF_SAINT, BOUGH_OF_SAINT, WHITE_FABRIC_TRIBE, WHITE_FABRIC_ANGELS);
-
addStartNpc(HANELLIN);
addTalkId(HANELLIN, CLAUDIA_ATHEBALDT, MARTIEN, HARNE, HOLY_ARK_OF_SECRECY_1, HOLY_ARK_OF_SECRECY_2, HOLY_ARK_OF_SECRECY_3, ARK_GUARDIAN_CORPSE, GUSTAV_ATHEBALDT, HARDIN, IASON_HEINE);
-
addSpawnId(ARK_GUARDIAN_ELBEROTH, ARK_GUARDIAN_SHADOW_FANG, ANGEL_KILLER);
addAttackId(ARK_GUARDIAN_ELBEROTH, ARK_GUARDIAN_SHADOW_FANG, ANGEL_KILLER, PLATINUM_TRIBE_SHAMAN, PLATINUM_TRIBE_OVERLORD);
-
addKillId(LESSER_GIANT_MAGE, LESSER_GIANT_ELDER, ARK_GUARDIAN_ELBEROTH, ARK_GUARDIAN_SHADOW_FANG, ANGEL_KILLER, PLATINUM_TRIBE_SHAMAN, PLATINUM_TRIBE_OVERLORD, GUARDIAN_ANGEL, SEAL_ANGEL);
}
@@ -99,63 +90,73 @@ public class Q348_AnArrogantSearch extends Quest
return htmltext;
}
- if (event.equals("30864-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("cond", "2");
- st.set("points", "0");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30864-09.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TITAN_POWERSTONE, 1);
- }
- else if (event.equals("30864-17.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(HANELLIN_FIRST_LETTER, 1);
- st.giveItems(HANELLIN_SECOND_LETTER, 1);
- st.giveItems(HANELLIN_THIRD_LETTER, 1);
- }
- else if (event.equals("30864-36.htm"))
- {
- st.set("cond", "24");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.rewardItems(57, Rnd.get(1, 2) * 12000);
- }
- else if (event.equals("30864-37.htm"))
- {
- st.set("cond", "25");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30864-51.htm"))
- {
- st.set("cond", "26");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(WHITE_FABRIC_ANGELS, (st.hasQuestItems(BLOODED_FABRIC)) ? 9 : 10);
- }
- else if (event.equals("30864-58.htm"))
- {
- st.set("cond", "27");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30864-57.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30864-56.htm"))
- {
- st.set("cond", "29");
- st.set("gustav", "0"); // st.unset doesn't work.
- st.set("hardin", "0");
- st.set("iason", "0");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(WHITE_FABRIC_ANGELS, 10);
+ case "30864-05.htm":
+ {
+ st.startQuest();
+ st.setCond(2);
+ st.set("points", "0");
+ break;
+ }
+ case "30864-09.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TITAN_POWERSTONE, 1);
+ break;
+ }
+ case "30864-17.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(HANELLIN_FIRST_LETTER, 1);
+ st.giveItems(HANELLIN_SECOND_LETTER, 1);
+ st.giveItems(HANELLIN_THIRD_LETTER, 1);
+ break;
+ }
+ case "30864-36.htm":
+ {
+ st.setCond(24);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.rewardItems(57, Rnd.get(1, 2) * 12000);
+ break;
+ }
+ case "30864-37.htm":
+ {
+ st.setCond(25);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30864-51.htm":
+ {
+ st.setCond(26);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(WHITE_FABRIC_ANGELS, (st.hasQuestItems(BLOODED_FABRIC)) ? 9 : 10);
+ break;
+ }
+ case "30864-58.htm":
+ {
+ st.setCond(27);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30864-57.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30864-56.htm":
+ {
+ st.setCond(29);
+ st.set("gustav", "0"); // st.unset doesn't work.
+ st.set("hardin", "0");
+ st.set("iason", "0");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(WHITE_FABRIC_ANGELS, 10);
+ break;
+ }
}
return htmltext;
@@ -174,6 +175,7 @@ public class Q348_AnArrogantSearch extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (st.hasQuestItems(BLOODED_FABRIC))
{
htmltext = "30864-00.htm";
@@ -187,12 +189,14 @@ public class Q348_AnArrogantSearch extends Quest
htmltext = "30864-02.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case HANELLIN:
+ {
if (cond == 1)
{
htmltext = "30864-02.htm";
@@ -212,7 +216,7 @@ public class Q348_AnArrogantSearch extends Quest
else if (cond == 21)
{
htmltext = "30864-29.htm";
- st.set("cond", "22");
+ st.setCond(22);
st.takeItems(BOOK_OF_SAINT, 1);
st.takeItems(BLOOD_OF_SAINT, 1);
st.takeItems(BOUGH_OF_SAINT, 1);
@@ -282,7 +286,7 @@ public class Q348_AnArrogantSearch extends Quest
if ((st.getInt("gustav") + st.getInt("hardin") + st.getInt("iason")) == 3)
{
htmltext = "30864-60.htm";
- st.set("cond", "28");
+ st.setCond(28);
st.rewardItems(57, 49000);
st.playSound(QuestState.SOUND_MIDDLE);
}
@@ -322,8 +326,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case GUSTAV_ATHEBALDT:
+ {
if (cond == 27)
{
if ((st.getQuestItemsCount(BLOODED_FABRIC) >= 3) && (st.getInt("gustav") == 0))
@@ -343,8 +348,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case HARDIN:
+ {
if (cond == 27)
{
if (st.hasQuestItems(BLOODED_FABRIC) && (st.getInt("hardin") == 0))
@@ -364,8 +370,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case IASON_HEINE:
+ {
if (cond == 27)
{
if ((st.getQuestItemsCount(BLOODED_FABRIC) >= 6) && (st.getInt("iason") == 0))
@@ -385,8 +392,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case HARNE:
+ {
if ((cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BLOOD_OF_SAINT))
@@ -394,7 +402,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(HANELLIN_FIRST_LETTER))
{
htmltext = "30144-01.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HANELLIN_FIRST_LETTER, 1);
st.addRadar(-418, 44174, -3568);
@@ -415,8 +423,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case CLAUDIA_ATHEBALDT:
+ {
if ((cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BOOK_OF_SAINT))
@@ -424,7 +433,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(HANELLIN_SECOND_LETTER))
{
htmltext = "31001-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HANELLIN_SECOND_LETTER, 1);
st.addRadar(181472, 7158, -2725);
@@ -445,8 +454,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case MARTIEN:
+ {
if ((cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BOUGH_OF_SAINT))
@@ -454,7 +464,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(HANELLIN_THIRD_LETTER))
{
htmltext = "30645-01.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HANELLIN_THIRD_LETTER, 1);
st.addRadar(50693, 158674, 376);
@@ -475,8 +485,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case ARK_GUARDIAN_CORPSE:
+ {
if (!st.hasQuestItems(HANELLIN_FIRST_LETTER) && (cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(FIRST_KEY_OF_ARK) && !st.hasQuestItems(BLOOD_OF_SAINT))
@@ -489,9 +500,9 @@ public class Q348_AnArrogantSearch extends Quest
_angelKiller = addSpawn(ANGEL_KILLER, npc, false, 0);
}
- if (st.getInt("cond") != 18)
+ if (!st.isCond(18))
{
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -510,8 +521,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case HOLY_ARK_OF_SECRECY_1:
+ {
if (!st.hasQuestItems(HANELLIN_FIRST_LETTER) && (cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BLOOD_OF_SAINT))
@@ -519,7 +531,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(FIRST_KEY_OF_ARK))
{
htmltext = "30977-02.htm";
- st.set("cond", "20");
+ st.setCond(20);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FIRST_KEY_OF_ARK, 1);
@@ -527,7 +539,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(BOOK_OF_SAINT, BOUGH_OF_SAINT))
{
- st.set("cond", "21");
+ st.setCond(21);
}
}
else
@@ -541,8 +553,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case HOLY_ARK_OF_SECRECY_2:
+ {
if (!st.hasQuestItems(HANELLIN_SECOND_LETTER) && (cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BOOK_OF_SAINT))
@@ -558,7 +571,7 @@ public class Q348_AnArrogantSearch extends Quest
else
{
htmltext = "30978-02.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SECOND_KEY_OF_ARK, 1);
@@ -566,7 +579,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(BLOOD_OF_SAINT, BOUGH_OF_SAINT))
{
- st.set("cond", "21");
+ st.setCond(21);
}
}
}
@@ -576,8 +589,9 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case HOLY_ARK_OF_SECRECY_3:
+ {
if (!st.hasQuestItems(HANELLIN_THIRD_LETTER) && (cond >= 5) && (cond <= 22))
{
if (!st.hasQuestItems(BOUGH_OF_SAINT))
@@ -593,7 +607,7 @@ public class Q348_AnArrogantSearch extends Quest
else
{
htmltext = "30979-02.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(THIRD_KEY_OF_ARK, 1);
@@ -601,7 +615,7 @@ public class Q348_AnArrogantSearch extends Quest
if (st.hasQuestItems(BLOOD_OF_SAINT, BOOK_OF_SAINT))
{
- st.set("cond", "21");
+ st.setCond(21);
}
}
}
@@ -611,8 +625,10 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -624,16 +640,20 @@ public class Q348_AnArrogantSearch extends Quest
switch (npc.getNpcId())
{
case ARK_GUARDIAN_ELBEROTH:
+ {
npc.broadcastNpcSay("This does not belong to you. Take your hands out!");
break;
-
+ }
case ARK_GUARDIAN_SHADOW_FANG:
+ {
npc.broadcastNpcSay("I don't believe it! Grrr!");
break;
-
+ }
case ANGEL_KILLER:
+ {
npc.broadcastNpcSay("I have the key, do you wish to steal it?");
break;
+ }
}
return null;
}
@@ -650,22 +670,25 @@ public class Q348_AnArrogantSearch extends Quest
switch (npc.getNpcId())
{
case ARK_GUARDIAN_ELBEROTH:
+ {
if (npc.isScriptValue(0))
{
npc.broadcastNpcSay("...I feel very sorry, but I have taken your life.");
npc.setScriptValue(1);
}
break;
-
+ }
case ARK_GUARDIAN_SHADOW_FANG:
+ {
if (npc.isScriptValue(0))
{
npc.broadcastNpcSay("I will cover this mountain with your blood!");
npc.setScriptValue(1);
}
break;
-
+ }
case ANGEL_KILLER:
+ {
if (npc.isScriptValue(0))
{
npc.broadcastNpcSay("Haha.. Really amusing! As for the key, search the corpse!");
@@ -678,17 +701,18 @@ public class Q348_AnArrogantSearch extends Quest
npc.broadcastNpcSay("Can't get rid of you... Did you get the key from the corpse?");
npc.decayMe();
- st.set("cond", "19");
+ st.setCond(19);
st.set("angelkiller", "1");
st.playSound(QuestState.SOUND_MIDDLE);
_angelKiller = null;
}
break;
-
+ }
case PLATINUM_TRIBE_OVERLORD:
case PLATINUM_TRIBE_SHAMAN:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (((cond == 24) || (cond == 25)) && st.hasQuestItems(WHITE_FABRIC_TRIBE))
{
final int points = st.getInt("points") + ((npc.getNpcId() == PLATINUM_TRIBE_SHAMAN) ? 60 : 70);
@@ -715,6 +739,7 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
+ }
}
return null;
@@ -729,42 +754,45 @@ public class Q348_AnArrogantSearch extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case LESSER_GIANT_ELDER:
case LESSER_GIANT_MAGE:
+ {
if (cond == 2)
{
st.dropItems(TITAN_POWERSTONE, 1, 1, 100000);
}
break;
-
+ }
case ARK_GUARDIAN_ELBEROTH:
+ {
if ((cond >= 5) && (cond <= 22) && !st.hasQuestItems(SECOND_KEY_OF_ARK))
{
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SECOND_KEY_OF_ARK, 1);
npc.broadcastNpcSay("Oh, dull-witted.. God, they...");
}
_elberoth = null;
break;
-
+ }
case ARK_GUARDIAN_SHADOW_FANG:
+ {
if ((cond >= 5) && (cond <= 22) && !st.hasQuestItems(THIRD_KEY_OF_ARK))
{
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(THIRD_KEY_OF_ARK, 1);
npc.broadcastNpcSay("You do not know.. Seven seals are.. coughs");
}
_shadowFang = null;
break;
-
+ }
case PLATINUM_TRIBE_OVERLORD:
case PLATINUM_TRIBE_SHAMAN:
+ {
if (((cond == 24) || (cond == 25)) && st.hasQuestItems(WHITE_FABRIC_TRIBE))
{
final int points = st.getInt("points") + ((npc.getNpcId() == PLATINUM_TRIBE_SHAMAN) ? 600 : 700);
@@ -791,9 +819,10 @@ public class Q348_AnArrogantSearch extends Quest
}
}
break;
-
+ }
case SEAL_ANGEL:
case GUARDIAN_ANGEL:
+ {
if (((cond == 26) || (cond == 29)) && (Rnd.get(4) < 1) && st.hasQuestItems(WHITE_FABRIC_ANGELS))
{
st.playSound(QuestState.SOUND_ITEMGET);
@@ -801,10 +830,12 @@ public class Q348_AnArrogantSearch extends Quest
st.giveItems(BLOODED_FABRIC, 1);
}
break;
-
+ }
case ANGEL_KILLER:
+ {
_angelKiller = null;
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q350_EnhanceYourWeapon/Q350_EnhanceYourWeapon.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q350_EnhanceYourWeapon/Q350_EnhanceYourWeapon.java
index 6151eceeaf..2538b64c8a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q350_EnhanceYourWeapon/Q350_EnhanceYourWeapon.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q350_EnhanceYourWeapon/Q350_EnhanceYourWeapon.java
@@ -43,7 +43,6 @@ public class Q350_EnhanceYourWeapon extends Quest
public Q350_EnhanceYourWeapon()
{
super(350, "Enhance Your Weapon");
-
addStartNpc(NPCS);
addTalkId(NPCS);
}
@@ -64,9 +63,7 @@ public class Q350_EnhanceYourWeapon extends Quest
case "30856-04.htm":
case "30194-04.htm":
{
- qs.set("cond", "1");
- qs.setState(State.STARTED);
- qs.playSound("ItemSound.quest_accept");
+ qs.startQuest();
break;
}
case "30115-09.htm":
@@ -113,10 +110,6 @@ public class Q350_EnhanceYourWeapon extends Quest
final int npcId = npc.getNpcId();
final int id = qs.getState();
if (id == State.CREATED)
- {
- qs.set("cond", "0");
- }
- if (qs.getInt("cond") == 0)
{
htmltext = npcId + "-01.htm";
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q351_BlackSwan/Q351_BlackSwan.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q351_BlackSwan/Q351_BlackSwan.java
index af7ccc6af8..6a3bd2ab8a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q351_BlackSwan/Q351_BlackSwan.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q351_BlackSwan/Q351_BlackSwan.java
@@ -29,7 +29,6 @@ public class Q351_BlackSwan extends Quest
private static final int GOSTA = 30916;
private static final int IASON_HEINE = 30969;
private static final int ROMAN = 30897;
-
// Items
private static final int ORDER_OF_GOSTA = 4296;
private static final int LIZARD_FANG = 4297;
@@ -39,12 +38,9 @@ public class Q351_BlackSwan extends Quest
public Q351_BlackSwan()
{
super(351, "Black Swan");
-
registerQuestItems(ORDER_OF_GOSTA, BARREL_OF_LEAGUE, LIZARD_FANG);
-
addStartNpc(GOSTA);
addTalkId(GOSTA, IASON_HEINE, ROMAN);
-
addKillId(20784, 20785, 21639, 21640);
}
@@ -58,50 +54,55 @@ public class Q351_BlackSwan extends Quest
return htmltext;
}
- if (event.equals("30916-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ORDER_OF_GOSTA, 1);
- }
- else if (event.equals("30969-02a.htm"))
- {
- final int lizardFangs = st.getQuestItemsCount(LIZARD_FANG);
- if (lizardFangs > 0)
+ case "30916-03.htm":
{
- htmltext = "30969-02.htm";
-
- st.takeItems(LIZARD_FANG, -1);
- st.rewardItems(57, lizardFangs * 20);
+ st.startQuest();
+ st.giveItems(ORDER_OF_GOSTA, 1);
+ break;
}
- }
- else if (event.equals("30969-03a.htm"))
- {
- final int barrels = st.getQuestItemsCount(BARREL_OF_LEAGUE);
- if (barrels > 0)
+ case "30969-02a.htm":
{
- htmltext = "30969-03.htm";
-
- st.takeItems(BARREL_OF_LEAGUE, -1);
- st.rewardItems(BILL_OF_IASON_HEINE, barrels);
-
- // Heine explains than player can speak with Roman in order to exchange bills for rewards.
- if (st.getInt("cond") == 1)
+ final int lizardFangs = st.getQuestItemsCount(LIZARD_FANG);
+ if (lizardFangs > 0)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
+ htmltext = "30969-02.htm";
+
+ st.takeItems(LIZARD_FANG, -1);
+ st.rewardItems(57, lizardFangs * 20);
}
+ break;
}
- }
- else if (event.equals("30969-06.htm"))
- {
- // If no more quest items finish the quest for real, else send a "Return" type HTM.
- if (!st.hasQuestItems(BARREL_OF_LEAGUE, LIZARD_FANG))
+ case "30969-03a.htm":
{
- htmltext = "30969-07.htm";
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ final int barrels = st.getQuestItemsCount(BARREL_OF_LEAGUE);
+ if (barrels > 0)
+ {
+ htmltext = "30969-03.htm";
+
+ st.takeItems(BARREL_OF_LEAGUE, -1);
+ st.rewardItems(BILL_OF_IASON_HEINE, barrels);
+
+ // Heine explains than player can speak with Roman in order to exchange bills for rewards.
+ if (st.isCond(1))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ }
+ break;
+ }
+ case "30969-06.htm":
+ {
+ // If no more quest items finish the quest for real, else send a "Return" type HTM.
+ if (!st.hasQuestItems(BARREL_OF_LEAGUE, LIZARD_FANG))
+ {
+ htmltext = "30969-07.htm";
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ break;
}
}
@@ -121,25 +122,32 @@ public class Q351_BlackSwan extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 32) ? "30916-00.htm" : "30916-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case GOSTA:
+ {
htmltext = "30916-04.htm";
break;
-
+ }
case IASON_HEINE:
+ {
htmltext = "30969-01.htm";
break;
-
+ }
case ROMAN:
+ {
htmltext = (st.hasQuestItems(BILL_OF_IASON_HEINE)) ? "30897-01.htm" : "30897-02.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q352_HelpRoodRaiseANewPet/Q352_HelpRoodRaiseANewPet.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q352_HelpRoodRaiseANewPet/Q352_HelpRoodRaiseANewPet.java
index 93c0e0a330..65dfb0ab02 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q352_HelpRoodRaiseANewPet/Q352_HelpRoodRaiseANewPet.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q352_HelpRoodRaiseANewPet/Q352_HelpRoodRaiseANewPet.java
@@ -32,12 +32,9 @@ public class Q352_HelpRoodRaiseANewPet extends Quest
public Q352_HelpRoodRaiseANewPet()
{
super(352, "Help Rood Raise A New Pet!");
-
registerQuestItems(LIENRIK_EGG_1, LIENRIK_EGG_2);
-
addStartNpc(31067); // Rood
addTalkId(31067);
-
addKillId(20786, 20787, 21644, 21645);
}
@@ -53,9 +50,7 @@ public class Q352_HelpRoodRaiseANewPet extends Quest
if (event.equals("31067-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31067-09.htm"))
{
@@ -79,10 +74,12 @@ public class Q352_HelpRoodRaiseANewPet extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 39) ? "31067-00.htm" : "31067-01.htm";
break;
-
+ }
case State.STARTED:
+ {
final int eggs1 = st.getQuestItemsCount(LIENRIK_EGG_1);
final int eggs2 = st.getQuestItemsCount(LIENRIK_EGG_2);
if ((eggs1 + eggs2) == 0)
@@ -116,6 +113,7 @@ public class Q352_HelpRoodRaiseANewPet extends Quest
}
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q353_PowerOfDarkness/Q353_PowerOfDarkness.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q353_PowerOfDarkness/Q353_PowerOfDarkness.java
index d3795d465b..861b3ea446 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q353_PowerOfDarkness/Q353_PowerOfDarkness.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q353_PowerOfDarkness/Q353_PowerOfDarkness.java
@@ -30,12 +30,9 @@ public class Q353_PowerOfDarkness extends Quest
public Q353_PowerOfDarkness()
{
super(353, "Power of Darkness");
-
registerQuestItems(STONE);
-
addStartNpc(31044); // Galman
addTalkId(31044);
-
addKillId(20244, 20245, 20283, 20284);
}
@@ -51,9 +48,7 @@ public class Q353_PowerOfDarkness extends Quest
if (event.equals("31044-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31044-08.htm"))
{
@@ -77,10 +72,12 @@ public class Q353_PowerOfDarkness extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 55) ? "31044-01.htm" : "31044-02.htm";
break;
-
+ }
case State.STARTED:
+ {
final int stones = st.getQuestItemsCount(STONE);
if (stones == 0)
{
@@ -93,6 +90,7 @@ public class Q353_PowerOfDarkness extends Quest
st.rewardItems(57, 2500 + (230 * stones));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q354_ConquestOfAlligatorIsland/Q354_ConquestOfAlligatorIsland.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q354_ConquestOfAlligatorIsland/Q354_ConquestOfAlligatorIsland.java
index 242323263f..ab4279c2e0 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q354_ConquestOfAlligatorIsland/Q354_ConquestOfAlligatorIsland.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q354_ConquestOfAlligatorIsland/Q354_ConquestOfAlligatorIsland.java
@@ -31,111 +31,26 @@ public class Q354_ConquestOfAlligatorIsland extends Quest
private static final int ALLIGATOR_TOOTH = 5863;
private static final int TORN_MAP_FRAGMENT = 5864;
private static final int PIRATE_TREASURE_MAP = 5915;
-
+ // Drops
private static final Map DROPLIST = new HashMap<>();
static
{
- DROPLIST.put(20804, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 490000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Crokian Lad
- DROPLIST.put(20805, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 560000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Dailaon Lad
- DROPLIST.put(20806, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 500000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Crokian Lad Warrior
- DROPLIST.put(20807, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 600000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Farhite Lad
- DROPLIST.put(20808, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 690000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Nos Lad
- DROPLIST.put(20991, new int[][]
- {
- {
- ALLIGATOR_TOOTH,
- 1,
- 0,
- 600000
- },
- {
- TORN_MAP_FRAGMENT,
- 1,
- 0,
- 100000
- }
- }); // Swamp Tribe
+ // @formatter:off
+ DROPLIST.put(20804, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 490000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Crokian Lad
+ DROPLIST.put(20805, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 560000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Dailaon Lad
+ DROPLIST.put(20806, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 500000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Crokian Lad Warrior
+ DROPLIST.put(20807, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 600000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Farhite Lad
+ DROPLIST.put(20808, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 690000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Nos Lad
+ DROPLIST.put(20991, new int[][]{{ALLIGATOR_TOOTH, 1, 0, 600000},{TORN_MAP_FRAGMENT, 1, 0, 100000}}); // Swamp Tribe
+ // @formatter:on
}
public Q354_ConquestOfAlligatorIsland()
{
super(354, "Conquest of Alligator Island");
-
registerQuestItems(ALLIGATOR_TOOTH, TORN_MAP_FRAGMENT);
-
addStartNpc(30895); // Kluck
addTalkId(30895);
-
addKillId(20804, 20805, 20806, 20807, 20808, 20991);
}
@@ -149,53 +64,59 @@ public class Q354_ConquestOfAlligatorIsland extends Quest
return htmltext;
}
- if (event.equals("30895-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30895-03.htm"))
- {
- if (st.hasQuestItems(TORN_MAP_FRAGMENT))
+ case "30895-02.htm":
{
- htmltext = "30895-03a.htm";
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30895-05.htm"))
- {
- final int amount = st.getQuestItemsCount(ALLIGATOR_TOOTH);
- if (amount > 0)
+ case "30895-03.htm":
{
- int reward = (amount * 220) + 3100;
- if (amount >= 100)
+ if (st.hasQuestItems(TORN_MAP_FRAGMENT))
{
- reward += 7600;
- htmltext = "30895-05b.htm";
+ htmltext = "30895-03a.htm";
}
- else
- {
- htmltext = "30895-05a.htm";
- }
-
- st.takeItems(ALLIGATOR_TOOTH, -1);
- st.rewardItems(57, reward);
+ break;
}
- }
- else if (event.equals("30895-07.htm"))
- {
- if (st.getQuestItemsCount(TORN_MAP_FRAGMENT) >= 10)
+ case "30895-05.htm":
{
- htmltext = "30895-08.htm";
- st.takeItems(TORN_MAP_FRAGMENT, 10);
- st.giveItems(PIRATE_TREASURE_MAP, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ final int amount = st.getQuestItemsCount(ALLIGATOR_TOOTH);
+ if (amount > 0)
+ {
+ int reward = (amount * 220) + 3100;
+ if (amount >= 100)
+ {
+ reward += 7600;
+ htmltext = "30895-05b.htm";
+ }
+ else
+ {
+ htmltext = "30895-05a.htm";
+ }
+
+ st.takeItems(ALLIGATOR_TOOTH, -1);
+ st.rewardItems(57, reward);
+ }
+ break;
+ }
+ case "30895-07.htm":
+ {
+ if (st.getQuestItemsCount(TORN_MAP_FRAGMENT) >= 10)
+ {
+ htmltext = "30895-08.htm";
+ st.takeItems(TORN_MAP_FRAGMENT, 10);
+ st.giveItems(PIRATE_TREASURE_MAP, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ break;
+ }
+ case "30895-09.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30895-09.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -214,12 +135,15 @@ public class Q354_ConquestOfAlligatorIsland extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 38) ? "30895-00.htm" : "30895-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(TORN_MAP_FRAGMENT)) ? "30895-03a.htm" : "30895-03.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q355_FamilyHonor/Q355_FamilyHonor.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q355_FamilyHonor/Q355_FamilyHonor.java
index 1332c97c62..dd4843df06 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q355_FamilyHonor/Q355_FamilyHonor.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q355_FamilyHonor/Q355_FamilyHonor.java
@@ -31,13 +31,11 @@ public class Q355_FamilyHonor extends Quest
// NPCs
private static final int GALIBREDO = 30181;
private static final int PATRIN = 30929;
-
// Monsters
private static final int TIMAK_ORC_TROOP_LEADER = 20767;
private static final int TIMAK_ORC_TROOP_SHAMAN = 20768;
private static final int TIMAK_ORC_TROOP_WARRIOR = 20769;
private static final int TIMAK_ORC_TROOP_ARCHER = 20770;
-
// Items
private static final int GALIBREDO_BUST = 4252;
private static final int WORK_OF_BERONA = 4350;
@@ -45,42 +43,24 @@ public class Q355_FamilyHonor extends Quest
private static final int STATUE_ORIGINAL = 4352;
private static final int STATUE_REPLICA = 4353;
private static final int STATUE_FORGERY = 4354;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
{
- CHANCES.put(TIMAK_ORC_TROOP_LEADER, new int[]
- {
- 44,
- 54
- });
- CHANCES.put(TIMAK_ORC_TROOP_SHAMAN, new int[]
- {
- 36,
- 45
- });
- CHANCES.put(TIMAK_ORC_TROOP_WARRIOR, new int[]
- {
- 35,
- 43
- });
- CHANCES.put(TIMAK_ORC_TROOP_ARCHER, new int[]
- {
- 32,
- 42
- });
+ // @formatter:off
+ CHANCES.put(TIMAK_ORC_TROOP_LEADER, new int[]{44, 54});
+ CHANCES.put(TIMAK_ORC_TROOP_SHAMAN, new int[]{36, 45});
+ CHANCES.put(TIMAK_ORC_TROOP_WARRIOR, new int[]{35, 43});
+ CHANCES.put(TIMAK_ORC_TROOP_ARCHER, new int[]{32, 42});
+ // @formatter:on
}
public Q355_FamilyHonor()
{
super(355, "Family Honor");
-
registerQuestItems(GALIBREDO_BUST);
-
addStartNpc(GALIBREDO);
addTalkId(GALIBREDO, PATRIN);
-
addKillId(TIMAK_ORC_TROOP_LEADER, TIMAK_ORC_TROOP_SHAMAN, TIMAK_ORC_TROOP_WARRIOR, TIMAK_ORC_TROOP_ARCHER);
}
@@ -94,67 +74,72 @@ public class Q355_FamilyHonor extends Quest
return htmltext;
}
- if (event.equals("30181-2.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30181-4b.htm"))
- {
- final int count = st.getQuestItemsCount(GALIBREDO_BUST);
- if (count > 0)
+ case "30181-2.htm":
{
- htmltext = "30181-4.htm";
-
- int reward = 2800 + (count * 120);
- if (count >= 100)
- {
- htmltext = "30181-4a.htm";
- reward += 5000;
- }
-
- st.takeItems(GALIBREDO_BUST, count);
- st.rewardItems(57, reward);
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("30929-7.htm"))
- {
- if (st.hasQuestItems(WORK_OF_BERONA))
+ case "30181-4b.htm":
{
- st.takeItems(WORK_OF_BERONA, 1);
-
- final int appraising = Rnd.get(100);
- if (appraising < 20)
+ final int count = st.getQuestItemsCount(GALIBREDO_BUST);
+ if (count > 0)
{
- htmltext = "30929-2.htm";
- }
- else if (appraising < 40)
- {
- htmltext = "30929-3.htm";
- st.giveItems(STATUE_REPLICA, 1);
- }
- else if (appraising < 60)
- {
- htmltext = "30929-4.htm";
- st.giveItems(STATUE_ORIGINAL, 1);
- }
- else if (appraising < 80)
- {
- htmltext = "30929-5.htm";
- st.giveItems(STATUE_FORGERY, 1);
- }
- else
- {
- htmltext = "30929-6.htm";
- st.giveItems(STATUE_PROTOTYPE, 1);
+ htmltext = "30181-4.htm";
+
+ int reward = 2800 + (count * 120);
+ if (count >= 100)
+ {
+ htmltext = "30181-4a.htm";
+ reward += 5000;
+ }
+
+ st.takeItems(GALIBREDO_BUST, count);
+ st.rewardItems(57, reward);
}
+ break;
+ }
+ case "30929-7.htm":
+ {
+ if (st.hasQuestItems(WORK_OF_BERONA))
+ {
+ st.takeItems(WORK_OF_BERONA, 1);
+
+ final int appraising = Rnd.get(100);
+ if (appraising < 20)
+ {
+ htmltext = "30929-2.htm";
+ }
+ else if (appraising < 40)
+ {
+ htmltext = "30929-3.htm";
+ st.giveItems(STATUE_REPLICA, 1);
+ }
+ else if (appraising < 60)
+ {
+ htmltext = "30929-4.htm";
+ st.giveItems(STATUE_ORIGINAL, 1);
+ }
+ else if (appraising < 80)
+ {
+ htmltext = "30929-5.htm";
+ st.giveItems(STATUE_FORGERY, 1);
+ }
+ else
+ {
+ htmltext = "30929-6.htm";
+ st.giveItems(STATUE_PROTOTYPE, 1);
+ }
+ }
+ break;
+ }
+ case "30181-6.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30181-6.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -173,21 +158,27 @@ public class Q355_FamilyHonor extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 36) ? "30181-0a.htm" : "30181-0.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case GALIBREDO:
+ {
htmltext = (st.hasQuestItems(GALIBREDO_BUST)) ? "30181-3a.htm" : "30181-3.htm";
break;
-
+ }
case PATRIN:
+ {
htmltext = "30929-0.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q356_DigUpTheSeaOfSpores/Q356_DigUpTheSeaOfSpores.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q356_DigUpTheSeaOfSpores/Q356_DigUpTheSeaOfSpores.java
index c661de36fd..5eef2a4ed5 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q356_DigUpTheSeaOfSpores/Q356_DigUpTheSeaOfSpores.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q356_DigUpTheSeaOfSpores/Q356_DigUpTheSeaOfSpores.java
@@ -27,7 +27,6 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
// Items
private static final int HERB_SPORE = 5866;
private static final int CARN_SPORE = 5865;
-
// Monsters
private static final int ROTTING_TREE = 20558;
private static final int SPORE_ZOMBIE = 20562;
@@ -35,12 +34,9 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
public Q356_DigUpTheSeaOfSpores()
{
super(356, "Dig Up the Sea of Spores!");
-
registerQuestItems(HERB_SPORE, CARN_SPORE);
-
addStartNpc(30717); // Gauen
addTalkId(30717);
-
addKillId(ROTTING_TREE, SPORE_ZOMBIE);
}
@@ -54,37 +50,43 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
return htmltext;
}
- if (event.equals("30717-06.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30717-17.htm"))
- {
- st.takeItems(HERB_SPORE, -1);
- st.takeItems(CARN_SPORE, -1);
- st.rewardItems(57, 20950);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30717-14.htm"))
- {
- st.takeItems(HERB_SPORE, -1);
- st.takeItems(CARN_SPORE, -1);
- st.rewardExpAndSp(35000, 2600);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30717-12.htm"))
- {
- st.takeItems(HERB_SPORE, -1);
- st.rewardExpAndSp(24500, 0);
- }
- else if (event.equals("30717-13.htm"))
- {
- st.takeItems(CARN_SPORE, -1);
- st.rewardExpAndSp(0, 1820);
+ case "30717-06.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30717-17.htm":
+ {
+ st.takeItems(HERB_SPORE, -1);
+ st.takeItems(CARN_SPORE, -1);
+ st.rewardItems(57, 20950);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30717-14.htm":
+ {
+ st.takeItems(HERB_SPORE, -1);
+ st.takeItems(CARN_SPORE, -1);
+ st.rewardExpAndSp(35000, 2600);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30717-12.htm":
+ {
+ st.takeItems(HERB_SPORE, -1);
+ st.rewardExpAndSp(24500, 0);
+ break;
+ }
+ case "30717-13.htm":
+ {
+ st.takeItems(CARN_SPORE, -1);
+ st.rewardExpAndSp(0, 1820);
+ break;
+ }
}
return htmltext;
@@ -103,11 +105,13 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 43) ? "30717-01.htm" : "30717-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30717-07.htm";
@@ -132,6 +136,8 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
htmltext = "30717-10.htm";
}
break;
+ }
+
}
return htmltext;
@@ -146,24 +152,27 @@ public class Q356_DigUpTheSeaOfSpores extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond < 3)
{
switch (npc.getNpcId())
{
case ROTTING_TREE:
+ {
if (st.dropItems(HERB_SPORE, 1, 50, 630000))
{
- st.set("cond", (cond == 2) ? "3" : "2");
+ st.setCond((cond == 2) ? 3 : 2);
}
break;
-
+ }
case SPORE_ZOMBIE:
+ {
if (st.dropItems(CARN_SPORE, 1, 50, 760000))
{
- st.set("cond", (cond == 2) ? "3" : "2");
+ st.setCond((cond == 2) ? 3 : 2);
}
break;
+ }
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q357_WarehouseKeepersAmbition/Q357_WarehouseKeepersAmbition.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q357_WarehouseKeepersAmbition/Q357_WarehouseKeepersAmbition.java
index 8465411533..5950adde9e 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q357_WarehouseKeepersAmbition/Q357_WarehouseKeepersAmbition.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q357_WarehouseKeepersAmbition/Q357_WarehouseKeepersAmbition.java
@@ -27,15 +27,13 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q357_WarehouseKeepersAmbition extends Quest
{
- // Item
- private static final int JADE_CRYSTAL = 5867;
-
// Monsters
private static final int FOREST_RUNNER = 20594;
private static final int FLINE_ELDER = 20595;
private static final int LIELE_ELDER = 20596;
private static final int VALLEY_TREANT_ELDER = 20597;
-
+ // Item
+ private static final int JADE_CRYSTAL = 5867;
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -49,12 +47,9 @@ public class Q357_WarehouseKeepersAmbition extends Quest
public Q357_WarehouseKeepersAmbition()
{
super(357, "Warehouse Keeper's Ambition");
-
registerQuestItems(JADE_CRYSTAL);
-
addStartNpc(30686); // Silva
addTalkId(30686);
-
addKillId(FOREST_RUNNER, FLINE_ELDER, LIELE_ELDER, VALLEY_TREANT_ELDER);
}
@@ -68,35 +63,39 @@ public class Q357_WarehouseKeepersAmbition extends Quest
return htmltext;
}
- if (event.equals("30686-2.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30686-7.htm"))
- {
- final int count = st.getQuestItemsCount(JADE_CRYSTAL);
- if (count == 0)
+ case "30686-2.htm":
{
- htmltext = "30686-4.htm";
+ st.startQuest();
+ break;
}
- else
+ case "30686-7.htm":
{
- int reward = (count * 425) + 3500;
- if (count >= 100)
+ final int count = st.getQuestItemsCount(JADE_CRYSTAL);
+ if (count == 0)
{
- reward += 7400;
+ htmltext = "30686-4.htm";
}
-
- st.takeItems(JADE_CRYSTAL, -1);
- st.rewardItems(57, reward);
+ else
+ {
+ int reward = (count * 425) + 3500;
+ if (count >= 100)
+ {
+ reward += 7400;
+ }
+
+ st.takeItems(JADE_CRYSTAL, -1);
+ st.rewardItems(57, reward);
+ }
+ break;
+ }
+ case "30686-8.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30686-8.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -115,12 +114,15 @@ public class Q357_WarehouseKeepersAmbition extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 47) ? "30686-0a.htm" : "30686-0.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (!st.hasQuestItems(JADE_CRYSTAL)) ? "30686-4.htm" : "30686-6.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q358_IllegitimateChildOfAGoddess/Q358_IllegitimateChildOfAGoddess.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q358_IllegitimateChildOfAGoddess/Q358_IllegitimateChildOfAGoddess.java
index abce5ebf37..f3f0582357 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q358_IllegitimateChildOfAGoddess/Q358_IllegitimateChildOfAGoddess.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q358_IllegitimateChildOfAGoddess/Q358_IllegitimateChildOfAGoddess.java
@@ -27,7 +27,6 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
{
// Item
private static final int SCALE = 5868;
-
// Reward
private static final int[] REWARD =
{
@@ -44,12 +43,9 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
public Q358_IllegitimateChildOfAGoddess()
{
super(358, "Illegitimate Child of A Goddess");
-
registerQuestItems(SCALE);
-
addStartNpc(30862); // Oltlin
addTalkId(30862);
-
addKillId(20672, 20673); // Trives, Falibati
}
@@ -65,9 +61,7 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
if (event.equals("30862-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -86,11 +80,13 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 63) ? "30862-01.htm" : "30862-02.htm";
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
htmltext = "30862-06.htm";
}
@@ -103,6 +99,7 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -111,7 +108,7 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -119,7 +116,7 @@ public class Q358_IllegitimateChildOfAGoddess extends Quest
if (st.dropItems(SCALE, 1, 108, (npc.getNpcId() == 20672) ? 680000 : 660000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q359_ForSleeplessDeadmen/Q359_ForSleeplessDeadmen.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q359_ForSleeplessDeadmen/Q359_ForSleeplessDeadmen.java
index 219e534282..780943f7c0 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q359_ForSleeplessDeadmen/Q359_ForSleeplessDeadmen.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q359_ForSleeplessDeadmen/Q359_ForSleeplessDeadmen.java
@@ -28,14 +28,12 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q359_ForSleeplessDeadmen extends Quest
{
- // Item
- private static final int REMAINS = 5869;
-
// Monsters
private static final int DOOM_SERVANT = 21006;
private static final int DOOM_GUARD = 21007;
private static final int DOOM_ARCHER = 21008;
-
+ // Item
+ private static final int REMAINS = 5869;
// Reward
private static final int[] REWARD =
{
@@ -48,7 +46,6 @@ public class Q359_ForSleeplessDeadmen extends Quest
5494,
5495
};
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -61,12 +58,9 @@ public class Q359_ForSleeplessDeadmen extends Quest
public Q359_ForSleeplessDeadmen()
{
super(359, "For Sleepless Deadmen");
-
registerQuestItems(REMAINS);
-
addStartNpc(30857); // Orven
addTalkId(30857);
-
addKillId(DOOM_SERVANT, DOOM_GUARD, DOOM_ARCHER);
}
@@ -82,9 +76,7 @@ public class Q359_ForSleeplessDeadmen extends Quest
if (event.equals("30857-06.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30857-10.htm"))
{
@@ -109,11 +101,13 @@ public class Q359_ForSleeplessDeadmen extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "30857-01.htm" : "30857-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30857-07.htm";
@@ -121,7 +115,7 @@ public class Q359_ForSleeplessDeadmen extends Quest
else if (cond == 2)
{
htmltext = "30857-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REMAINS, -1);
}
@@ -130,6 +124,7 @@ public class Q359_ForSleeplessDeadmen extends Quest
htmltext = "30857-09.htm";
}
break;
+ }
}
return htmltext;
@@ -138,7 +133,7 @@ public class Q359_ForSleeplessDeadmen extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -146,7 +141,7 @@ public class Q359_ForSleeplessDeadmen extends Quest
if (st.dropItems(REMAINS, 1, 60, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q360_PlunderTheirSupplies/Q360_PlunderTheirSupplies.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q360_PlunderTheirSupplies/Q360_PlunderTheirSupplies.java
index e4610f13db..5bc3c16a60 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q360_PlunderTheirSupplies/Q360_PlunderTheirSupplies.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q360_PlunderTheirSupplies/Q360_PlunderTheirSupplies.java
@@ -28,48 +28,21 @@ public class Q360_PlunderTheirSupplies extends Quest
private static final int SUPPLY_ITEM = 5872;
private static final int SUSPICIOUS_DOCUMENT = 5871;
private static final int RECIPE_OF_SUPPLY = 5870;
-
+ // Drops
private static final int[][][] DROPLIST =
{
- {
- {
- SUSPICIOUS_DOCUMENT,
- 1,
- 0,
- 50000
- },
- {
- SUPPLY_ITEM,
- 1,
- 0,
- 500000
- }
- },
- {
- {
- SUSPICIOUS_DOCUMENT,
- 1,
- 0,
- 50000
- },
- {
- SUPPLY_ITEM,
- 1,
- 0,
- 660000
- }
- }
+ // @formatter:off
+ {{SUSPICIOUS_DOCUMENT, 1, 0, 50000},{SUPPLY_ITEM, 1, 0, 500000}},
+ {{SUSPICIOUS_DOCUMENT, 1, 0, 50000},{SUPPLY_ITEM, 1, 0, 660000}}
+ // @formatter:on
};
public Q360_PlunderTheirSupplies()
{
super(360, "Plunder Their Supplies");
-
registerQuestItems(RECIPE_OF_SUPPLY, SUPPLY_ITEM, SUSPICIOUS_DOCUMENT);
-
addStartNpc(30873); // Coleman
addTalkId(30873);
-
addKillId(20666, 20669);
}
@@ -85,9 +58,7 @@ public class Q360_PlunderTheirSupplies extends Quest
if (event.equals("30873-2.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30873-6.htm"))
{
@@ -114,10 +85,12 @@ public class Q360_PlunderTheirSupplies extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 52) ? "30873-0a.htm" : "30873-0.htm";
break;
-
+ }
case State.STARTED:
+ {
final int supplyItems = st.getQuestItemsCount(SUPPLY_ITEM);
if (supplyItems == 0)
{
@@ -132,6 +105,7 @@ public class Q360_PlunderTheirSupplies extends Quest
st.rewardItems(57, reward);
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q362_BardsMandolin/Q362_BardsMandolin.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q362_BardsMandolin/Q362_BardsMandolin.java
index 4144562309..e0c0428a75 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q362_BardsMandolin/Q362_BardsMandolin.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q362_BardsMandolin/Q362_BardsMandolin.java
@@ -24,22 +24,19 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q362_BardsMandolin extends Quest
{
- // Items
- private static final int SWAN_FLUTE = 4316;
- private static final int SWAN_LETTER = 4317;
-
// NPCs
private static final int SWAN = 30957;
private static final int NANARIN = 30956;
private static final int GALION = 30958;
private static final int WOODROW = 30837;
+ // Items
+ private static final int SWAN_FLUTE = 4316;
+ private static final int SWAN_LETTER = 4317;
public Q362_BardsMandolin()
{
super(362, "Bard's Mandolin");
-
registerQuestItems(SWAN_FLUTE, SWAN_LETTER);
-
addStartNpc(SWAN);
addTalkId(SWAN, NANARIN, GALION, WOODROW);
}
@@ -56,9 +53,7 @@ public class Q362_BardsMandolin extends Quest
if (event.equals("30957-3.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30957-7.htm") || event.equals("30957-8.htm"))
{
@@ -84,14 +79,17 @@ public class Q362_BardsMandolin extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30957-2.htm" : "30957-1.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SWAN:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30957-4.htm";
@@ -99,7 +97,7 @@ public class Q362_BardsMandolin extends Quest
else if (cond == 3)
{
htmltext = "30957-5.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SWAN_LETTER, 1);
}
@@ -112,12 +110,13 @@ public class Q362_BardsMandolin extends Quest
htmltext = "30957-6.htm";
}
break;
-
+ }
case WOODROW:
+ {
if (cond == 1)
{
htmltext = "30837-1.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 2)
@@ -129,12 +128,13 @@ public class Q362_BardsMandolin extends Quest
htmltext = "30837-3.htm";
}
break;
-
+ }
case GALION:
+ {
if (cond == 2)
{
htmltext = "30958-1.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_ITEMGET);
st.giveItems(SWAN_FLUTE, 1);
}
@@ -143,12 +143,13 @@ public class Q362_BardsMandolin extends Quest
htmltext = "30958-2.htm";
}
break;
-
+ }
case NANARIN:
+ {
if (cond == 4)
{
htmltext = "30956-1.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SWAN_FLUTE, 1);
st.takeItems(SWAN_LETTER, 1);
@@ -158,8 +159,10 @@ public class Q362_BardsMandolin extends Quest
htmltext = "30956-2.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q363_SorrowfulSoundOfFlute/Q363_SorrowfulSoundOfFlute.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q363_SorrowfulSoundOfFlute/Q363_SorrowfulSoundOfFlute.java
index f9d0bd8dcb..2fbe54d5e9 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q363_SorrowfulSoundOfFlute/Q363_SorrowfulSoundOfFlute.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q363_SorrowfulSoundOfFlute/Q363_SorrowfulSoundOfFlute.java
@@ -32,21 +32,17 @@ public class Q363_SorrowfulSoundOfFlute extends Quest
private static final int HOLVAS = 30058;
private static final int BARBADO = 30959;
private static final int POITAN = 30458;
-
- // Item
+ // Items
private static final int NANARIN_FLUTE = 4319;
private static final int BLACK_BEER = 4320;
private static final int CLOTHES = 4318;
-
// Reward
private static final int THEME_OF_SOLITUDE = 4420;
public Q363_SorrowfulSoundOfFlute()
{
super(363, "Sorrowful Sound of Flute");
-
registerQuestItems(NANARIN_FLUTE, BLACK_BEER, CLOTHES);
-
addStartNpc(NANARIN);
addTalkId(NANARIN, OPIX, ALDO, RANSPO, HOLVAS, BARBADO, POITAN);
}
@@ -61,29 +57,34 @@ public class Q363_SorrowfulSoundOfFlute extends Quest
return htmltext;
}
- if (event.equals("30956-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30956-05.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CLOTHES, 1);
- }
- else if (event.equals("30956-06.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(NANARIN_FLUTE, 1);
- }
- else if (event.equals("30956-07.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BLACK_BEER, 1);
+ case "30956-02.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30956-05.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CLOTHES, 1);
+ break;
+ }
+ case "30956-06.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(NANARIN_FLUTE, 1);
+ break;
+ }
+ case "30956-07.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BLACK_BEER, 1);
+ break;
+ }
}
return htmltext;
@@ -102,14 +103,17 @@ public class Q363_SorrowfulSoundOfFlute extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30956-03.htm" : "30956-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NANARIN:
+ {
if (cond == 1)
{
htmltext = "30956-02.htm";
@@ -138,24 +142,26 @@ public class Q363_SorrowfulSoundOfFlute extends Quest
st.exitQuest(true);
}
break;
-
+ }
case OPIX:
case POITAN:
case ALDO:
case RANSPO:
case HOLVAS:
+ {
htmltext = npc.getNpcId() + "-01.htm";
if (cond == 1)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
-
+ }
case BARBADO:
+ {
if (cond == 3)
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
if (st.hasQuestItems(NANARIN_FLUTE))
@@ -177,7 +183,10 @@ public class Q363_SorrowfulSoundOfFlute extends Quest
htmltext = "30959-03.htm";
}
break;
+ }
}
+ break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q364_JovialAccordion/Q364_JovialAccordion.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q364_JovialAccordion/Q364_JovialAccordion.java
index f560b77242..60e8383217 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q364_JovialAccordion/Q364_JovialAccordion.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q364_JovialAccordion/Q364_JovialAccordion.java
@@ -32,7 +32,6 @@ public class Q364_JovialAccordion extends Quest
private static final int XABER = 30075;
private static final int CLOTH_CHEST = 30961;
private static final int BEER_CHEST = 30960;
-
// Items
private static final int KEY_1 = 4323;
private static final int KEY_2 = 4324;
@@ -43,9 +42,7 @@ public class Q364_JovialAccordion extends Quest
public Q364_JovialAccordion()
{
super(364, "Jovial Accordion");
-
registerQuestItems(KEY_1, KEY_2, STOLEN_BEER, STOLEN_CLOTHES);
-
addStartNpc(BARBADO);
addTalkId(BARBADO, SWAN, SABRIN, XABER, CLOTH_CHEST, BEER_CHEST);
}
@@ -60,44 +57,49 @@ public class Q364_JovialAccordion extends Quest
return htmltext;
}
- if (event.equals("30959-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("items", "0");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30957-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(KEY_1, 1);
- st.giveItems(KEY_2, 1);
- }
- else if (event.equals("30960-04.htm"))
- {
- if (st.hasQuestItems(KEY_2))
+ case "30959-02.htm":
{
- st.takeItems(KEY_2, 1);
- if (Rnd.nextBoolean())
- {
- htmltext = "30960-02.htm";
- st.giveItems(STOLEN_BEER, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
- }
+ st.startQuest();
+ st.set("items", "0");
+ break;
}
- }
- else if (event.equals("30961-04.htm"))
- {
- if (st.hasQuestItems(KEY_1))
+ case "30957-02.htm":
{
- st.takeItems(KEY_1, 1);
- if (Rnd.nextBoolean())
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(KEY_1, 1);
+ st.giveItems(KEY_2, 1);
+ break;
+ }
+ case "30960-04.htm":
+ {
+ if (st.hasQuestItems(KEY_2))
{
- htmltext = "30961-02.htm";
- st.giveItems(STOLEN_CLOTHES, 1);
- st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(KEY_2, 1);
+ if (Rnd.nextBoolean())
+ {
+ htmltext = "30960-02.htm";
+ st.giveItems(STOLEN_BEER, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
}
+ break;
+ }
+ case "30961-04.htm":
+ {
+ if (st.hasQuestItems(KEY_1))
+ {
+ st.takeItems(KEY_1, 1);
+ if (Rnd.nextBoolean())
+ {
+ htmltext = "30961-02.htm";
+ st.giveItems(STOLEN_CLOTHES, 1);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ }
+ }
+ break;
}
}
@@ -117,16 +119,18 @@ public class Q364_JovialAccordion extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30959-00.htm" : "30959-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
final int stolenItems = st.getInt("items");
-
switch (npc.getNpcId())
{
case BARBADO:
+ {
if ((cond == 1) || (cond == 2))
{
htmltext = "30959-03.htm";
@@ -139,8 +143,9 @@ public class Q364_JovialAccordion extends Quest
st.exitQuest(true);
}
break;
-
+ }
case SWAN:
+ {
if (cond == 1)
{
htmltext = "30957-01.htm";
@@ -149,7 +154,7 @@ public class Q364_JovialAccordion extends Quest
{
if (stolenItems > 0)
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
if (stolenItems == 2)
@@ -181,24 +186,27 @@ public class Q364_JovialAccordion extends Quest
htmltext = "30957-07.htm";
}
break;
-
+ }
case BEER_CHEST:
+ {
htmltext = "30960-03.htm";
if ((cond == 2) && st.hasQuestItems(KEY_2))
{
htmltext = "30960-01.htm";
}
break;
-
+ }
case CLOTH_CHEST:
+ {
htmltext = "30961-03.htm";
if ((cond == 2) && st.hasQuestItems(KEY_1))
{
htmltext = "30961-01.htm";
}
break;
-
+ }
case SABRIN:
+ {
if (st.hasQuestItems(STOLEN_BEER))
{
htmltext = "30060-01.htm";
@@ -211,8 +219,9 @@ public class Q364_JovialAccordion extends Quest
htmltext = "30060-02.htm";
}
break;
-
+ }
case XABER:
+ {
if (st.hasQuestItems(STOLEN_CLOTHES))
{
htmltext = "30075-01.htm";
@@ -225,8 +234,10 @@ public class Q364_JovialAccordion extends Quest
htmltext = "30075-02.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q365_DevilsLegacy/Q365_DevilsLegacy.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q365_DevilsLegacy/Q365_DevilsLegacy.java
index a176c5b792..e21bdfc863 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q365_DevilsLegacy/Q365_DevilsLegacy.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q365_DevilsLegacy/Q365_DevilsLegacy.java
@@ -30,19 +30,15 @@ public class Q365_DevilsLegacy extends Quest
// NPCs
private static final int RANDOLF = 30095;
private static final int COLLOB = 30092;
-
// Item
private static final int PIRATE_TREASURE_CHEST = 5873;
public Q365_DevilsLegacy()
{
super(365, "Devil's Legacy");
-
registerQuestItems(PIRATE_TREASURE_CHEST);
-
addStartNpc(RANDOLF);
addTalkId(RANDOLF, COLLOB);
-
addKillId(20836, 20845, 21629, 21630); // Pirate Zombie && Pirate Zombie Captain.
}
@@ -56,104 +52,108 @@ public class Q365_DevilsLegacy extends Quest
return htmltext;
}
- if (event.equals("30095-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30095-06.htm"))
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
- }
- else if (event.equals("30092-05.htm"))
- {
- if (!st.hasQuestItems(PIRATE_TREASURE_CHEST))
+ case "30095-02.htm":
{
- htmltext = "30092-02.htm";
+ st.startQuest();
+ break;
}
- else if (st.getQuestItemsCount(57) < 600)
+ case "30095-06.htm":
{
- htmltext = "30092-03.htm";
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
}
- else
+ case "30092-05.htm":
{
- st.takeItems(PIRATE_TREASURE_CHEST, 1);
- st.takeItems(57, 600);
-
- int i0;
- if (Rnd.get(100) < 80)
+ if (!st.hasQuestItems(PIRATE_TREASURE_CHEST))
{
- i0 = Rnd.get(100);
- if (i0 < 1)
- {
- st.giveItems(955, 1);
- }
- else if (i0 < 4)
- {
- st.giveItems(956, 1);
- }
- else if (i0 < 36)
- {
- st.giveItems(1868, 1);
- }
- else if (i0 < 68)
- {
- st.giveItems(1884, 1);
- }
- else
- {
- st.giveItems(1872, 1);
- }
-
- htmltext = "30092-05.htm";
+ htmltext = "30092-02.htm";
+ }
+ else if (st.getQuestItemsCount(57) < 600)
+ {
+ htmltext = "30092-03.htm";
}
else
{
- i0 = Rnd.get(1000);
- if (i0 < 10)
+ st.takeItems(PIRATE_TREASURE_CHEST, 1);
+ st.takeItems(57, 600);
+
+ int i0;
+ if (Rnd.get(100) < 80)
{
- st.giveItems(951, 1);
- }
- else if (i0 < 40)
- {
- st.giveItems(952, 1);
- }
- else if (i0 < 60)
- {
- st.giveItems(955, 1);
- }
- else if (i0 < 260)
- {
- st.giveItems(956, 1);
- }
- else if (i0 < 445)
- {
- st.giveItems(1879, 1);
- }
- else if (i0 < 630)
- {
- st.giveItems(1880, 1);
- }
- else if (i0 < 815)
- {
- st.giveItems(1882, 1);
+ i0 = Rnd.get(100);
+ if (i0 < 1)
+ {
+ st.giveItems(955, 1);
+ }
+ else if (i0 < 4)
+ {
+ st.giveItems(956, 1);
+ }
+ else if (i0 < 36)
+ {
+ st.giveItems(1868, 1);
+ }
+ else if (i0 < 68)
+ {
+ st.giveItems(1884, 1);
+ }
+ else
+ {
+ st.giveItems(1872, 1);
+ }
+
+ htmltext = "30092-05.htm";
}
else
{
- st.giveItems(1881, 1);
- }
-
- htmltext = "30092-06.htm";
-
- // Curse effect !
- final Skill skill = SkillTable.getInstance().getSkill(4082, 1);
- if ((skill != null) && (player.getFirstEffect(skill) == null))
- {
- skill.applyEffects(npc, player);
+ i0 = Rnd.get(1000);
+ if (i0 < 10)
+ {
+ st.giveItems(951, 1);
+ }
+ else if (i0 < 40)
+ {
+ st.giveItems(952, 1);
+ }
+ else if (i0 < 60)
+ {
+ st.giveItems(955, 1);
+ }
+ else if (i0 < 260)
+ {
+ st.giveItems(956, 1);
+ }
+ else if (i0 < 445)
+ {
+ st.giveItems(1879, 1);
+ }
+ else if (i0 < 630)
+ {
+ st.giveItems(1880, 1);
+ }
+ else if (i0 < 815)
+ {
+ st.giveItems(1882, 1);
+ }
+ else
+ {
+ st.giveItems(1881, 1);
+ }
+
+ htmltext = "30092-06.htm";
+
+ // Curse effect !
+ final Skill skill = SkillTable.getInstance().getSkill(4082, 1);
+ if ((skill != null) && (player.getFirstEffect(skill) == null))
+ {
+ skill.applyEffects(npc, player);
+ }
}
}
+ break;
}
}
@@ -173,13 +173,16 @@ public class Q365_DevilsLegacy extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 39) ? "30095-00.htm" : "30095-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case RANDOLF:
+ {
if (!st.hasQuestItems(PIRATE_TREASURE_CHEST))
{
htmltext = "30095-03.htm";
@@ -194,11 +197,15 @@ public class Q365_DevilsLegacy extends Quest
st.rewardItems(57, reward + 19800);
}
break;
-
+ }
case COLLOB:
+ {
htmltext = "30092-01.htm";
break;
+ }
}
+ break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q366_SilverHairedShaman/Q366_SilverHairedShaman.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q366_SilverHairedShaman/Q366_SilverHairedShaman.java
index 24492569b7..d3dbdd9a86 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q366_SilverHairedShaman/Q366_SilverHairedShaman.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q366_SilverHairedShaman/Q366_SilverHairedShaman.java
@@ -29,10 +29,8 @@ public class Q366_SilverHairedShaman extends Quest
{
// NPC
private static final int DIETER = 30111;
-
// Item
private static final int HAIR = 5874;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -45,12 +43,9 @@ public class Q366_SilverHairedShaman extends Quest
public Q366_SilverHairedShaman()
{
super(366, "Silver Haired Shaman");
-
registerQuestItems(HAIR);
-
addStartNpc(DIETER);
addTalkId(DIETER);
-
addKillId(20986, 20987, 20988);
}
@@ -66,9 +61,7 @@ public class Q366_SilverHairedShaman extends Quest
if (event.equals("30111-2.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30111-6.htm"))
{
@@ -92,10 +85,12 @@ public class Q366_SilverHairedShaman extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 48) ? "30111-0.htm" : "30111-1.htm";
break;
-
+ }
case State.STARTED:
+ {
final int count = st.getQuestItemsCount(HAIR);
if (count == 0)
{
@@ -108,6 +103,7 @@ public class Q366_SilverHairedShaman extends Quest
st.rewardItems(57, 12070 + (500 * count));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q367_ElectrifyingRecharge/Q367_ElectrifyingRecharge.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q367_ElectrifyingRecharge/Q367_ElectrifyingRecharge.java
index 86b51da8d5..fff40ddbb3 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q367_ElectrifyingRecharge/Q367_ElectrifyingRecharge.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q367_ElectrifyingRecharge/Q367_ElectrifyingRecharge.java
@@ -28,7 +28,8 @@ public class Q367_ElectrifyingRecharge extends Quest
{
// NPCs
private static final int LORAIN = 30673;
-
+ // Monsters
+ private static final int CATHEROK = 21035;
// Item
private static final int LORAIN_LAMP = 5875;
private static final int TITAN_LAMP_1 = 5876;
@@ -36,7 +37,6 @@ public class Q367_ElectrifyingRecharge extends Quest
private static final int TITAN_LAMP_3 = 5878;
private static final int TITAN_LAMP_4 = 5879;
private static final int TITAN_LAMP_5 = 5880;
-
// Reward
private static final int[] REWARD =
{
@@ -54,18 +54,12 @@ public class Q367_ElectrifyingRecharge extends Quest
4564
};
- // Mobs
- private static final int CATHEROK = 21035;
-
public Q367_ElectrifyingRecharge()
{
super(367, "Electrifying Recharge!");
-
registerQuestItems(LORAIN_LAMP, TITAN_LAMP_1, TITAN_LAMP_2, TITAN_LAMP_3, TITAN_LAMP_4, TITAN_LAMP_5);
-
addStartNpc(LORAIN);
addTalkId(LORAIN);
-
addSpellFinishedId(CATHEROK);
}
@@ -79,28 +73,33 @@ public class Q367_ElectrifyingRecharge extends Quest
return htmltext;
}
- if (event.equals("30673-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LORAIN_LAMP, 1);
- }
- else if (event.equals("30673-09.htm"))
- {
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LORAIN_LAMP, 1);
- }
- else if (event.equals("30673-08.htm"))
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
- }
- else if (event.equals("30673-07.htm"))
- {
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(LORAIN_LAMP, 1);
+ case "30673-03.htm":
+ {
+ st.startQuest();
+ st.giveItems(LORAIN_LAMP, 1);
+ break;
+ }
+ case "30673-09.htm":
+ {
+ st.playSound(QuestState.SOUND_ACCEPT);
+ st.giveItems(LORAIN_LAMP, 1);
+ break;
+ }
+ case "30673-08.htm":
+ {
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
+ }
+ case "30673-07.htm":
+ {
+ st.setCond(1);
+ st.playSound(QuestState.SOUND_ACCEPT);
+ st.giveItems(LORAIN_LAMP, 1);
+ break;
+ }
}
return htmltext;
}
@@ -118,11 +117,13 @@ public class Q367_ElectrifyingRecharge extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 37) ? "30673-02.htm" : "30673-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
if (st.hasQuestItems(5880))
@@ -160,6 +161,7 @@ public class Q367_ElectrifyingRecharge extends Quest
st.playSound(QuestState.SOUND_FINISH);
}
break;
+ }
}
return htmltext;
}
@@ -167,28 +169,25 @@ public class Q367_ElectrifyingRecharge extends Quest
@Override
public String onSpellFinished(NpcInstance npc, PlayerInstance player, Skill skill)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
}
- if (skill.getId() == 4072)
+ if ((skill.getId() == 4072) && st.hasQuestItems(LORAIN_LAMP))
{
- if (st.hasQuestItems(LORAIN_LAMP))
+ final int randomItem = Rnd.get(5876, 5880);
+ st.takeItems(LORAIN_LAMP, 1);
+ st.giveItems(randomItem, 1);
+ if (randomItem == 5879)
{
- final int randomItem = Rnd.get(5876, 5880);
- st.takeItems(LORAIN_LAMP, 1);
- st.giveItems(randomItem, 1);
- if (randomItem == 5879)
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- }
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ else
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q368_TrespassingIntoTheSacredArea/Q368_TrespassingIntoTheSacredArea.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q368_TrespassingIntoTheSacredArea/Q368_TrespassingIntoTheSacredArea.java
index 4f3809c869..1b346ff172 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q368_TrespassingIntoTheSacredArea/Q368_TrespassingIntoTheSacredArea.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q368_TrespassingIntoTheSacredArea/Q368_TrespassingIntoTheSacredArea.java
@@ -29,10 +29,8 @@ public class Q368_TrespassingIntoTheSacredArea extends Quest
{
// NPC
private static final int RESTINA = 30926;
-
// Item
private static final int FANG = 5881;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -46,12 +44,9 @@ public class Q368_TrespassingIntoTheSacredArea extends Quest
public Q368_TrespassingIntoTheSacredArea()
{
super(368, "Trespassing into the Sacred Area");
-
registerQuestItems(FANG);
-
addStartNpc(RESTINA);
addTalkId(RESTINA);
-
addKillId(20794, 20795, 20796, 20797);
}
@@ -67,9 +62,7 @@ public class Q368_TrespassingIntoTheSacredArea extends Quest
if (event.equals("30926-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30926-05.htm"))
{
@@ -93,10 +86,12 @@ public class Q368_TrespassingIntoTheSacredArea extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 36) ? "30926-01a.htm" : "30926-01.htm";
break;
-
+ }
case State.STARTED:
+ {
final int fangs = st.getQuestItemsCount(FANG);
if (fangs == 0)
{
@@ -110,6 +105,7 @@ public class Q368_TrespassingIntoTheSacredArea extends Quest
st.rewardItems(57, reward);
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q369_CollectorOfJewels/Q369_CollectorOfJewels.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q369_CollectorOfJewels/Q369_CollectorOfJewels.java
index 95e0b0f5ef..b40e25ff8c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q369_CollectorOfJewels/Q369_CollectorOfJewels.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q369_CollectorOfJewels/Q369_CollectorOfJewels.java
@@ -29,63 +29,32 @@ public class Q369_CollectorOfJewels extends Quest
{
// NPC
private static final int NELL = 30376;
-
// Items
private static final int FLARE_SHARD = 5882;
private static final int FREEZING_SHARD = 5883;
-
// Reward
private static final int ADENA = 57;
-
// Droplist
private static final Map DROPLIST = new HashMap<>();
static
{
- DROPLIST.put(20609, new int[]
- {
- FLARE_SHARD,
- 630000
- });
- DROPLIST.put(20612, new int[]
- {
- FLARE_SHARD,
- 770000
- });
- DROPLIST.put(20749, new int[]
- {
- FLARE_SHARD,
- 850000
- });
- DROPLIST.put(20616, new int[]
- {
- FREEZING_SHARD,
- 600000
- });
- DROPLIST.put(20619, new int[]
- {
- FREEZING_SHARD,
- 730000
- });
- DROPLIST.put(20747, new int[]
- {
- FREEZING_SHARD,
- 850000
- });
+ // @formatter:off
+ DROPLIST.put(20609, new int[]{FLARE_SHARD, 630000});
+ DROPLIST.put(20612, new int[]{FLARE_SHARD, 770000});
+ DROPLIST.put(20749, new int[]{FLARE_SHARD, 850000});
+ DROPLIST.put(20616, new int[]{FREEZING_SHARD, 600000});
+ DROPLIST.put(20619, new int[]{FREEZING_SHARD, 730000});
+ DROPLIST.put(20747, new int[]{FREEZING_SHARD, 850000});
+ // @formatter:on
}
public Q369_CollectorOfJewels()
{
super(369, "Collector of Jewels");
-
registerQuestItems(FLARE_SHARD, FREEZING_SHARD);
-
addStartNpc(NELL);
addTalkId(NELL);
-
- for (int mob : DROPLIST.keySet())
- {
- addKillId(mob);
- }
+ addKillId(DROPLIST.keySet());
}
@Override
@@ -98,20 +67,24 @@ public class Q369_CollectorOfJewels extends Quest
return htmltext;
}
- if (event.equals("30376-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30376-07.htm"))
- {
- st.playSound(QuestState.SOUND_ITEMGET);
- }
- else if (event.equals("30376-08.htm"))
- {
- st.exitQuest(true);
- st.playSound(QuestState.SOUND_FINISH);
+ case "30376-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "30376-07.htm":
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ break;
+ }
+ case "30376-08.htm":
+ {
+ st.exitQuest(true);
+ st.playSound(QuestState.SOUND_FINISH);
+ break;
+ }
}
return htmltext;
@@ -130,11 +103,13 @@ public class Q369_CollectorOfJewels extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 25) ? "30376-01.htm" : "30376-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
final int flare = st.getQuestItemsCount(FLARE_SHARD);
final int freezing = st.getQuestItemsCount(FREEZING_SHARD);
if (cond == 1)
@@ -144,7 +119,7 @@ public class Q369_CollectorOfJewels extends Quest
else if ((cond == 2) && (flare >= 50) && (freezing >= 50))
{
htmltext = "30376-05.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FLARE_SHARD, -1);
st.takeItems(FREEZING_SHARD, -1);
@@ -164,6 +139,7 @@ public class Q369_CollectorOfJewels extends Quest
st.exitQuest(true);
}
break;
+ }
}
return htmltext;
@@ -184,18 +160,18 @@ public class Q369_CollectorOfJewels extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
final int[] drop = DROPLIST.get(npc.getNpcId());
if (cond == 1)
{
if (st.dropItems(drop[0], 1, 50, drop[1]) && (st.getQuestItemsCount((drop[0] == FLARE_SHARD) ? FREEZING_SHARD : FLARE_SHARD) >= 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
}
else if ((cond == 3) && st.dropItems(drop[0], 1, 200, drop[1]) && (st.getQuestItemsCount((drop[0] == FLARE_SHARD) ? FREEZING_SHARD : FLARE_SHARD) >= 200))
{
- st.set("cond", "4");
+ st.setCond(4);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q370_AnElderSowsSeeds/Q370_AnElderSowsSeeds.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q370_AnElderSowsSeeds/Q370_AnElderSowsSeeds.java
index ea8902cda8..2960f6b45c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q370_AnElderSowsSeeds/Q370_AnElderSowsSeeds.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q370_AnElderSowsSeeds/Q370_AnElderSowsSeeds.java
@@ -29,14 +29,12 @@ public class Q370_AnElderSowsSeeds extends Quest
{
// NPC
private static final int CASIAN = 30612;
-
// Items
private static final int SPELLBOOK_PAGE = 5916;
private static final int CHAPTER_OF_FIRE = 5917;
private static final int CHAPTER_OF_WATER = 5918;
private static final int CHAPTER_OF_WIND = 5919;
private static final int CHAPTER_OF_EARTH = 5920;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -51,12 +49,9 @@ public class Q370_AnElderSowsSeeds extends Quest
public Q370_AnElderSowsSeeds()
{
super(370, "An Elder Sows Seeds");
-
registerQuestItems(SPELLBOOK_PAGE, CHAPTER_OF_FIRE, CHAPTER_OF_WATER, CHAPTER_OF_WIND, CHAPTER_OF_EARTH);
-
addStartNpc(CASIAN);
addTalkId(CASIAN);
-
addKillId(20082, 20084, 20086, 20089, 20090);
}
@@ -70,28 +65,32 @@ public class Q370_AnElderSowsSeeds extends Quest
return htmltext;
}
- if (event.equals("30612-3.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30612-6.htm"))
- {
- if (st.hasQuestItems(CHAPTER_OF_FIRE, CHAPTER_OF_WATER, CHAPTER_OF_WIND, CHAPTER_OF_EARTH))
+ case "30612-3.htm":
{
- htmltext = "30612-8.htm";
- st.takeItems(CHAPTER_OF_FIRE, 1);
- st.takeItems(CHAPTER_OF_WATER, 1);
- st.takeItems(CHAPTER_OF_WIND, 1);
- st.takeItems(CHAPTER_OF_EARTH, 1);
- st.rewardItems(57, 3600);
+ st.startQuest();
+ break;
+ }
+ case "30612-6.htm":
+ {
+ if (st.hasQuestItems(CHAPTER_OF_FIRE, CHAPTER_OF_WATER, CHAPTER_OF_WIND, CHAPTER_OF_EARTH))
+ {
+ htmltext = "30612-8.htm";
+ st.takeItems(CHAPTER_OF_FIRE, 1);
+ st.takeItems(CHAPTER_OF_WATER, 1);
+ st.takeItems(CHAPTER_OF_WIND, 1);
+ st.takeItems(CHAPTER_OF_EARTH, 1);
+ st.rewardItems(57, 3600);
+ }
+ break;
+ }
+ case "30612-9.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30612-9.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -110,12 +109,15 @@ public class Q370_AnElderSowsSeeds extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 28) ? "30612-0a.htm" : "30612-0.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = "30612-4.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q371_ShriekOfGhosts/Q371_ShriekOfGhosts.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q371_ShriekOfGhosts/Q371_ShriekOfGhosts.java
index 12eddea0eb..b1c354d4d2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q371_ShriekOfGhosts/Q371_ShriekOfGhosts.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q371_ShriekOfGhosts/Q371_ShriekOfGhosts.java
@@ -31,41 +31,26 @@ public class Q371_ShriekOfGhosts extends Quest
// NPCs
private static final int REVA = 30867;
private static final int PATRIN = 30929;
-
// Item
private static final int URN = 5903;
private static final int PORCELAIN = 6002;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
{
- CHANCES.put(20818, new int[]
- {
- 38,
- 43
- });
- CHANCES.put(20820, new int[]
- {
- 48,
- 56
- });
- CHANCES.put(20824, new int[]
- {
- 50,
- 58
- });
+ // @formatter:off
+ CHANCES.put(20818, new int[]{38, 43});
+ CHANCES.put(20820, new int[]{48, 56});
+ CHANCES.put(20824, new int[]{50, 58});
+ // @formatter:on
}
public Q371_ShriekOfGhosts()
{
super(371, "Shriek of Ghosts");
-
registerQuestItems(URN, PORCELAIN);
-
addStartNpc(REVA);
addTalkId(REVA, PATRIN);
-
addKillId(20818, 20820, 20824);
}
@@ -79,69 +64,74 @@ public class Q371_ShriekOfGhosts extends Quest
return htmltext;
}
- if (event.equals("30867-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30867-07.htm"))
- {
- int urns = st.getQuestItemsCount(URN);
- if (urns > 0)
+ case "30867-03.htm":
{
- st.takeItems(URN, urns);
- if (urns >= 100)
+ st.startQuest();
+ break;
+ }
+ case "30867-07.htm":
+ {
+ int urns = st.getQuestItemsCount(URN);
+ if (urns > 0)
{
- urns += 13;
- htmltext = "30867-08.htm";
+ st.takeItems(URN, urns);
+ if (urns >= 100)
+ {
+ urns += 13;
+ htmltext = "30867-08.htm";
+ }
+ else
+ {
+ urns += 7;
+ }
+ st.rewardItems(57, urns * 1000);
+ }
+ break;
+ }
+ case "30867-10.htm":
+ {
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
+ }
+ case "APPR":
+ {
+ if (st.hasQuestItems(PORCELAIN))
+ {
+ final int chance = Rnd.get(100);
+ st.takeItems(PORCELAIN, 1);
+ if (chance < 2)
+ {
+ st.giveItems(6003, 1);
+ htmltext = "30929-03.htm";
+ }
+ else if (chance < 32)
+ {
+ st.giveItems(6004, 1);
+ htmltext = "30929-04.htm";
+ }
+ else if (chance < 62)
+ {
+ st.giveItems(6005, 1);
+ htmltext = "30929-05.htm";
+ }
+ else if (chance < 77)
+ {
+ st.giveItems(6006, 1);
+ htmltext = "30929-06.htm";
+ }
+ else
+ {
+ htmltext = "30929-07.htm";
+ }
}
else
{
- urns += 7;
+ htmltext = "30929-02.htm";
}
- st.rewardItems(57, urns * 1000);
- }
- }
- else if (event.equals("30867-10.htm"))
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
- }
- else if (event.equals("APPR"))
- {
- if (st.hasQuestItems(PORCELAIN))
- {
- final int chance = Rnd.get(100);
- st.takeItems(PORCELAIN, 1);
- if (chance < 2)
- {
- st.giveItems(6003, 1);
- htmltext = "30929-03.htm";
- }
- else if (chance < 32)
- {
- st.giveItems(6004, 1);
- htmltext = "30929-04.htm";
- }
- else if (chance < 62)
- {
- st.giveItems(6005, 1);
- htmltext = "30929-05.htm";
- }
- else if (chance < 77)
- {
- st.giveItems(6006, 1);
- htmltext = "30929-06.htm";
- }
- else
- {
- htmltext = "30929-07.htm";
- }
- }
- else
- {
- htmltext = "30929-02.htm";
+ break;
}
}
@@ -161,13 +151,16 @@ public class Q371_ShriekOfGhosts extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 59) ? "30867-01.htm" : "30867-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case REVA:
+ {
if (st.hasQuestItems(URN))
{
htmltext = (st.hasQuestItems(PORCELAIN)) ? "30867-05.htm" : "30867-04.htm";
@@ -177,12 +170,15 @@ public class Q371_ShriekOfGhosts extends Quest
htmltext = "30867-06.htm";
}
break;
-
+ }
case PATRIN:
+ {
htmltext = "30929-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q372_LegacyOfInsolence/Q372_LegacyOfInsolence.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q372_LegacyOfInsolence/Q372_LegacyOfInsolence.java
index 806663138b..db91834aa2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q372_LegacyOfInsolence/Q372_LegacyOfInsolence.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q372_LegacyOfInsolence/Q372_LegacyOfInsolence.java
@@ -31,262 +31,50 @@ public class Q372_LegacyOfInsolence extends Quest
private static final int HOLLY = 30839;
private static final int CLAUDIA = 31001;
private static final int DESMOND = 30855;
-
// Monsters
private static final int[][] MONSTERS_DROPS =
{
- { // npcId
- 20817,
- 20821,
- 20825,
- 20829,
- 21069,
- 21063
- }, // parchment (red, blue, black, white)
- {
- 5966,
- 5966,
- 5966,
- 5967,
- 5968,
- 5969
- }, // rate
- {
- 300000,
- 400000,
- 460000,
- 400000,
- 250000,
- 250000
- }
+ // @formatter:off
+ {20817, 20821, 20825, 20829, 21069, 21063}, // npcId
+ {5966, 5966, 5966, 5967, 5968, 5969}, // parchment (red, blue, black, white)
+ {300000, 400000, 460000, 400000, 250000, 250000}// rate
};
-
// Items
private static final int[][] SCROLLS =
{
- // Walderal => 13 blueprints => parts, recipes.
- {
- 5989,
- 6001
- },
- // Holly -> 5x Imperial Genealogy -> Dark Crystal parts/Adena
- {
- 5984,
- 5988
- },
- // Patrin -> 5x Ancient Epic -> Tallum parts/Adena
- {
- 5979,
- 5983
- },
- // Claudia -> 7x Revelation of the Seals -> Nightmare parts/Adena
- {
- 5972,
- 5978
- },
- // Desmond -> 7x Revelation of the Seals -> Majestic parts/Adena
- {
- 5972,
- 5978
- }
+ {5989, 6001}, // Walderal => 13 blueprints => parts, recipes.
+ {5984, 5988}, // Holly -> 5x Imperial Genealogy -> Dark Crystal parts/Adena
+ {5979, 5983}, // Patrin -> 5x Ancient Epic -> Tallum parts/Adena
+ {5972, 5978}, // Claudia -> 7x Revelation of the Seals -> Nightmare parts/Adena
+ {5972, 5978}, // Desmond -> 7x Revelation of the Seals -> Majestic parts/Adena
};
-
// Rewards matrice.
private static final int[][][] REWARDS_MATRICE =
{
// Walderal DC choice
- {
- {
- 13,
- 5496
- },
- {
- 26,
- 5508
- },
- {
- 40,
- 5525
- },
- {
- 58,
- 5368
- },
- {
- 76,
- 5392
- },
- {
- 100,
- 5426
- }
- },
+ {{13, 5496},{26, 5508},{40, 5525},{58, 5368},{76, 5392},{100, 5426}},
// Walderal Tallum choice
- {
- {
- 13,
- 5497
- },
- {
- 26,
- 5509
- },
- {
- 40,
- 5526
- },
- {
- 58,
- 5370
- },
- {
- 76,
- 5394
- },
- {
- 100,
- 5428
- }
- },
+ {{13, 5497},{26, 5509},{40, 5526},{58, 5370},{76, 5394},{100, 5428}},
// Walderal NM choice
- {
- {
- 20,
- 5502
- },
- {
- 40,
- 5514
- },
- {
- 58,
- 5527
- },
- {
- 73,
- 5380
- },
- {
- 87,
- 5404
- },
- {
- 100,
- 5430
- }
- },
+ {{20, 5502},{40, 5514},{58, 5527},{73, 5380},{87, 5404},{100, 5430}},
// Walderal Maja choice
- {
- {
- 20,
- 5503
- },
- {
- 40,
- 5515
- },
- {
- 58,
- 5528
- },
- {
- 73,
- 5382
- },
- {
- 87,
- 5406
- },
- {
- 100,
- 5432
- }
- },
+ {{20, 5503},{40, 5515},{58, 5528},{73, 5382},{87, 5406},{100, 5432}},
// Holly DC parts + adenas.
- {
- {
- 33,
- 5496
- },
- {
- 66,
- 5508
- },
- {
- 89,
- 5525
- },
- {
- 100,
- 57
- }
- },
+ {{33, 5496},{66, 5508},{89, 5525},{100, 57}},
// Patrin Tallum parts + adenas.
- {
- {
- 33,
- 5497
- },
- {
- 66,
- 5509
- },
- {
- 89,
- 5526
- },
- {
- 100,
- 57
- }
- },
+ {{33, 5497},{66, 5509},{89, 5526},{100, 57}},
// Claudia NM parts + adenas.
- {
- {
- 35,
- 5502
- },
- {
- 70,
- 5514
- },
- {
- 87,
- 5527
- },
- {
- 100,
- 57
- }
- },
+ {{35, 5502},{70, 5514},{87, 5527},{100, 57}},
// Desmond Maja choice
- {
- {
- 35,
- 5503
- },
- {
- 70,
- 5515
- },
- {
- 87,
- 5528
- },
- {
- 100,
- 57
- }
- }
+ {{35, 5503},{70, 5515},{87, 5528},{100, 57}}
+ // @formatter:on
};
public Q372_LegacyOfInsolence()
{
super(372, "Legacy of Insolence");
-
addStartNpc(WALDERAL);
addTalkId(WALDERAL, PATRIN, HOLLY, CLAUDIA, DESMOND);
-
addKillId(MONSTERS_DROPS[0]);
}
@@ -302,15 +90,13 @@ public class Q372_LegacyOfInsolence extends Quest
if (event.equals("30844-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30844-05b.htm"))
{
- if (st.getInt("cond") == 1)
+ if (st.isCond(1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -351,33 +137,42 @@ public class Q372_LegacyOfInsolence extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 59) ? "30844-01.htm" : "30844-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case WALDERAL:
+ {
htmltext = "30844-05.htm";
break;
-
+ }
case HOLLY:
+ {
htmltext = checkAndRewardItems(st, 1, 4, HOLLY);
break;
-
+ }
case PATRIN:
+ {
htmltext = checkAndRewardItems(st, 2, 5, PATRIN);
break;
-
+ }
case CLAUDIA:
+ {
htmltext = checkAndRewardItems(st, 3, 6, CLAUDIA);
break;
-
+ }
case DESMOND:
+ {
htmltext = checkAndRewardItems(st, 4, 7, DESMOND);
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q373_SupplierOfReagents/Q373_SupplierOfReagents.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q373_SupplierOfReagents/Q373_SupplierOfReagents.java
index dd93eb9f63..3935bf27a8 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q373_SupplierOfReagents/Q373_SupplierOfReagents.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q373_SupplierOfReagents/Q373_SupplierOfReagents.java
@@ -28,14 +28,9 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q373_SupplierOfReagents extends Quest
{
- // Variables
- private static final String INGREDIENT = "ingredient";
- private static final String CATALYST = "catalyst";
-
// NPCs
private static final int WESLEY = 30166;
private static final int URN = 31149;
-
// Monsters
private static final int CRENDION = 20813;
private static final int HALLATE_MAID = 20822;
@@ -44,11 +39,9 @@ public class Q373_SupplierOfReagents extends Quest
private static final int PLATINUM_GUARDIAN_SHAMAN = 21066;
private static final int LAVA_WYRM = 21111;
private static final int HAMES_ORC_SHAMAN = 21115;
-
// Quest items
private static final int MIXING_STONE = 5904;
private static final int MIXING_MANUAL = 6317;
-
// Items - pouches
private static final int REAGENT_POUCH_1 = 6007;
private static final int REAGENT_POUCH_2 = 6008;
@@ -83,6 +76,9 @@ public class Q373_SupplierOfReagents extends Quest
private static final int HELLFIRE_OIL = 6033;
private static final int NIGHTMARE_OIL = 6034;
private static final int PURE_SILVER = 6320;
+ // Variables
+ private static final String INGREDIENT = "ingredient";
+ private static final String CATALYST = "catalyst";
/**
* This droplist defines the npcId, the item dropped and the luck.
@@ -99,177 +95,51 @@ public class Q373_SupplierOfReagents extends Quest
private static final Map DROPLIST = new HashMap<>();
static
{
- DROPLIST.put(PLATINUM_GUARDIAN_SHAMAN, new int[]
- {
- REAGENT_BOX,
- 442000,
- 0
- });
- DROPLIST.put(HAMES_ORC_SHAMAN, new int[]
- {
- REAGENT_POUCH_3,
- 470000,
- 0
- });
- DROPLIST.put(PLATINUM_TRIBE_SHAMAN, new int[]
- {
- REAGENT_POUCH_2,
- QUICKSILVER,
- 680,
- 1000
- });
- DROPLIST.put(HALLATE_MAID, new int[]
- {
- REAGENT_POUCH_1,
- VOLCANIC_ASH,
- 664,
- 844
- });
- DROPLIST.put(HALLATE_GUARDIAN, new int[]
- {
- DEMONS_BLOOD,
- MOONSTONE_SHARD,
- 729,
- 833
- });
- DROPLIST.put(CRENDION, new int[]
- {
- ROTTEN_BONE,
- QUICKSILVER,
- 618,
- 1000
- });
- DROPLIST.put(LAVA_WYRM, new int[]
- {
- WYRMS_BLOOD,
- LAVA_STONE,
- 505,
- 750
- });
+ // @formatter:off
+ DROPLIST.put(PLATINUM_GUARDIAN_SHAMAN, new int[]{REAGENT_BOX, 442000, 0});
+ DROPLIST.put(HAMES_ORC_SHAMAN, new int[]{REAGENT_POUCH_3, 470000, 0});
+ DROPLIST.put(PLATINUM_TRIBE_SHAMAN, new int[]{REAGENT_POUCH_2, QUICKSILVER, 680, 1000});
+ DROPLIST.put(HALLATE_MAID, new int[]{REAGENT_POUCH_1, VOLCANIC_ASH, 664, 844});
+ DROPLIST.put(HALLATE_GUARDIAN, new int[]{DEMONS_BLOOD, MOONSTONE_SHARD, 729, 833});
+ DROPLIST.put(CRENDION, new int[]{ROTTEN_BONE, QUICKSILVER, 618, 1000});
+ DROPLIST.put(LAVA_WYRM, new int[]{WYRMS_BLOOD, LAVA_STONE, 505, 750});
+ // @formatter:n
}
-
private static final int[][] FORMULAS =
{
- {
- 10,
- WYRMS_BLOOD,
- BLOOD_ROOT,
- DRACOPLASM
- },
- {
- 10,
- LAVA_STONE,
- VOLCANIC_ASH,
- MAGMA_DUST
- },
- {
- 10,
- MOONSTONE_SHARD,
- VOLCANIC_ASH,
- MOON_DUST
- },
- {
- 10,
- ROTTEN_BONE,
- BLOOD_ROOT,
- NECROPLASM
- },
- {
- 10,
- DEMONS_BLOOD,
- BLOOD_ROOT,
- DEMONPLASM
- },
- {
- 10,
- INFERNIUM_ORE,
- VOLCANIC_ASH,
- INFERNO_DUST
- },
- {
- 10,
- DRACOPLASM,
- QUICKSILVER,
- DRACONIC_ESSENCE
- },
- {
- 10,
- MAGMA_DUST,
- SULFUR,
- FIRE_ESSENCE
- },
- {
- 10,
- MOON_DUST,
- QUICKSILVER,
- LUNARGENT
- },
- {
- 10,
- NECROPLASM,
- QUICKSILVER,
- MIDNIGHT_OIL
- },
- {
- 10,
- DEMONPLASM,
- SULFUR,
- DEMONIC_ESSENCE
- },
- {
- 10,
- INFERNO_DUST,
- SULFUR,
- ABYSS_OIL
- },
- {
- 1,
- FIRE_ESSENCE,
- DEMONIC_ESSENCE,
- HELLFIRE_OIL
- },
- {
- 1,
- LUNARGENT,
- MIDNIGHT_OIL,
- NIGHTMARE_OIL
- },
- {
- 1,
- LUNARGENT,
- QUICKSILVER,
- PURE_SILVER
- }
+ // @formatter:off
+ {10, WYRMS_BLOOD, BLOOD_ROOT, DRACOPLASM},
+ {10, LAVA_STONE, VOLCANIC_ASH, MAGMA_DUST},
+ {10, MOONSTONE_SHARD, VOLCANIC_ASH, MOON_DUST},
+ {10, ROTTEN_BONE, BLOOD_ROOT, NECROPLASM},
+ {10, DEMONS_BLOOD, BLOOD_ROOT, DEMONPLASM},
+ {10, INFERNIUM_ORE, VOLCANIC_ASH, INFERNO_DUST},
+ {10, DRACOPLASM, QUICKSILVER, DRACONIC_ESSENCE},
+ {10, MAGMA_DUST, SULFUR, FIRE_ESSENCE},
+ {10, MOON_DUST, QUICKSILVER, LUNARGENT},
+ {10, NECROPLASM, QUICKSILVER, MIDNIGHT_OIL},
+ {10, DEMONPLASM, SULFUR, DEMONIC_ESSENCE},
+ {10, INFERNO_DUST, SULFUR, ABYSS_OIL},
+ {1, FIRE_ESSENCE, DEMONIC_ESSENCE, HELLFIRE_OIL},
+ {1, LUNARGENT, MIDNIGHT_OIL, NIGHTMARE_OIL},
+ {1, LUNARGENT, QUICKSILVER, PURE_SILVER}
+ // @formatter:on
};
-
private static final int[][] TEMPERATURES =
{
- {
- 1,
- 100,
- 1
- },
- {
- 2,
- 45,
- 3
- },
- {
- 3,
- 15,
- 5
- }
+ // @formatter:off
+ {1, 100, 1},
+ {2, 45, 3},
+ {3, 15, 5}
+ // @formatter:on
};
public Q373_SupplierOfReagents()
{
super(373, "Supplier of Reagents");
-
registerQuestItems(MIXING_STONE, MIXING_MANUAL);
-
addStartNpc(WESLEY);
addTalkId(WESLEY, URN);
-
addKillId(CRENDION, HALLATE_MAID, HALLATE_GUARDIAN, PLATINUM_TRIBE_SHAMAN, PLATINUM_GUARDIAN_SHAMAN, LAVA_WYRM, HAMES_ORC_SHAMAN);
}
@@ -286,10 +156,7 @@ public class Q373_SupplierOfReagents extends Quest
// Wesley
if (event.equals("30166-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
-
+ st.startQuest();
st.giveItems(MIXING_STONE, 1);
st.giveItems(MIXING_MANUAL, 1);
}
@@ -399,10 +266,12 @@ public class Q373_SupplierOfReagents extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 57) ? "30166-01.htm" : "30166-02.htm";
break;
-
+ }
case State.STARTED:
+ {
if (npc.getNpcId() == WESLEY)
{
htmltext = "30166-05.htm";
@@ -412,6 +281,7 @@ public class Q373_SupplierOfReagents extends Quest
htmltext = "31149-01.htm";
}
break;
+ }
}
return htmltext;
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q374_WhisperOfDreams_Part1/Q374_WhisperOfDreams_Part1.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q374_WhisperOfDreams_Part1/Q374_WhisperOfDreams_Part1.java
index f1287f3afa..b8fec818b2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q374_WhisperOfDreams_Part1/Q374_WhisperOfDreams_Part1.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q374_WhisperOfDreams_Part1/Q374_WhisperOfDreams_Part1.java
@@ -27,57 +27,32 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
// NPCs
private static final int MANAKIA = 30515;
private static final int TORAI = 30557;
-
// Monsters
private static final int CAVE_BEAST = 20620;
private static final int DEATH_WAVE = 20621;
-
// Items
private static final int CAVE_BEAST_TOOTH = 5884;
private static final int DEATH_WAVE_LIGHT = 5885;
private static final int SEALED_MYSTERIOUS_STONE = 5886;
private static final int MYSTERIOUS_STONE = 5887;
-
// Rewards
private static final int[][] REWARDS =
{
- {
- 5486,
- 3,
- 2950
- }, // Dark Crystal, 3x, 2950 adena
- {
- 5487,
- 2,
- 18050
- }, // Nightmare, 2x, 18050 adena
- {
- 5488,
- 2,
- 18050
- }, // Majestic, 2x, 18050 adena
- {
- 5485,
- 4,
- 10450
- }, // Tallum Tunic, 4, 10450 adena
- {
- 5489,
- 6,
- 15550
- }
- // Tallum Stockings, 6, 15550 adena
+ // @formatter:off
+ {5486, 3, 2950}, // Dark Crystal, 3x, 2950 adena
+ {5487, 2, 18050}, // Nightmare, 2x, 18050 adena
+ {5488, 2, 18050}, // Majestic, 2x, 18050 adena
+ {5485, 4, 10450}, // Tallum Tunic, 4, 10450 adena
+ {5489, 6, 15550}, // Tallum Stockings, 6, 15550 adena
+ // @formatter:on
};
public Q374_WhisperOfDreams_Part1()
{
super(374, "Whisper of Dreams, Part 1");
-
registerQuestItems(DEATH_WAVE_LIGHT, CAVE_BEAST_TOOTH, SEALED_MYSTERIOUS_STONE, MYSTERIOUS_STONE);
-
addStartNpc(MANAKIA);
addTalkId(MANAKIA, TORAI);
-
addKillId(CAVE_BEAST, DEATH_WAVE);
}
@@ -94,10 +69,8 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
// Manakia
if (event.equals("30515-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
+ st.startQuest();
st.set("condStone", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
}
else if (event.startsWith("30515-06-"))
{
@@ -127,9 +100,9 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
// Torai
else if (event.equals("30557-02.htm"))
{
- if ((st.getInt("cond") == 2) && st.hasQuestItems(SEALED_MYSTERIOUS_STONE))
+ if (st.isCond(2) && st.hasQuestItems(SEALED_MYSTERIOUS_STONE))
{
- st.set("cond", "3");
+ st.setCond(3);
st.takeItems(SEALED_MYSTERIOUS_STONE, -1);
st.giveItems(MYSTERIOUS_STONE, 1);
st.playSound(QuestState.SOUND_MIDDLE);
@@ -155,14 +128,17 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 56) ? "30515-01.htm" : "30515-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MANAKIA:
+ {
if (!(st.hasQuestItems(SEALED_MYSTERIOUS_STONE)))
{
if ((st.getQuestItemsCount(CAVE_BEAST_TOOTH) >= 65) && (st.getQuestItemsCount(DEATH_WAVE_LIGHT) >= 65))
@@ -179,7 +155,7 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
if (cond == 1)
{
htmltext = "30515-09.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -188,15 +164,18 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
}
}
break;
-
+ }
case TORAI:
+ {
if ((cond == 2) && st.hasQuestItems(SEALED_MYSTERIOUS_STONE))
{
htmltext = "30557-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -221,7 +200,7 @@ public class Q374_WhisperOfDreams_Part1 extends Quest
st.dropItems((npc.getNpcId() == CAVE_BEAST) ? CAVE_BEAST_TOOTH : DEATH_WAVE_LIGHT, 1, 65, 500000);
// Drop sealed mysterious stone to party member who still need it.
- partyMember = getRandomPartyMember(player, npc, "condStone", "1");
+ partyMember = getRandomPartyMember(player, "condStone", "1");
if (partyMember == null)
{
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q375_WhisperOfDreams_Part2/Q375_WhisperOfDreams_Part2.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q375_WhisperOfDreams_Part2/Q375_WhisperOfDreams_Part2.java
index 38ebc1a527..5aaabdafc6 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q375_WhisperOfDreams_Part2/Q375_WhisperOfDreams_Part2.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q375_WhisperOfDreams_Part2/Q375_WhisperOfDreams_Part2.java
@@ -27,16 +27,13 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
{
// NPCs
private static final int MANAKIA = 30515;
-
// Monsters
private static final int KARIK = 20629;
private static final int CAVE_HOWLER = 20624;
-
// Items
private static final int MYSTERIOUS_STONE = 5887;
private static final int KARIK_HORN = 5888;
private static final int CAVE_HOWLER_SKULL = 5889;
-
// Rewards : A grade robe recipes
private static final int[] REWARDS =
{
@@ -48,12 +45,9 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
public Q375_WhisperOfDreams_Part2()
{
super(375, "Whisper of Dreams, Part 2");
-
registerQuestItems(KARIK_HORN, CAVE_HOWLER_SKULL);
-
addStartNpc(MANAKIA);
addTalkId(MANAKIA);
-
addKillId(KARIK, CAVE_HOWLER);
}
@@ -70,9 +64,7 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
// Manakia
if (event.equals("30515-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.takeItems(MYSTERIOUS_STONE, 1);
}
else if (event.equals("30515-07.htm"))
@@ -97,10 +89,12 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (!st.hasQuestItems(MYSTERIOUS_STONE) || (player.getLevel() < 60)) ? "30515-01.htm" : "30515-02.htm";
break;
-
+ }
case State.STARTED:
+ {
if ((st.getQuestItemsCount(KARIK_HORN) >= 100) && (st.getQuestItemsCount(CAVE_HOWLER_SKULL) >= 100))
{
htmltext = "30515-05.htm";
@@ -114,6 +108,7 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
htmltext = "30515-04.htm";
}
break;
+ }
}
return htmltext;
}
@@ -137,12 +132,15 @@ public class Q375_WhisperOfDreams_Part2 extends Quest
switch (npc.getNpcId())
{
case KARIK:
+ {
st.dropItemsAlways(KARIK_HORN, 1, 100);
break;
-
+ }
case CAVE_HOWLER:
+ {
st.dropItems(CAVE_HOWLER_SKULL, 1, 100, 900000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q376_ExplorationOfTheGiantsCave_Part1/Q376_ExplorationOfTheGiantsCave_Part1.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q376_ExplorationOfTheGiantsCave_Part1/Q376_ExplorationOfTheGiantsCave_Part1.java
index 619c8d9810..76007b0853 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q376_ExplorationOfTheGiantsCave_Part1/Q376_ExplorationOfTheGiantsCave_Part1.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q376_ExplorationOfTheGiantsCave_Part1/Q376_ExplorationOfTheGiantsCave_Part1.java
@@ -36,74 +36,38 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
private static final int DICTIONARY_INTERMEDIATE = 5892;
private static final int[][] BOOKS =
{
+ // @formatter:off
// medical theory -> tallum tunic, tallum stockings
- {
- 5937,
- 5938,
- 5939,
- 5940,
- 5941
- },
+ {5937, 5938, 5939, 5940, 5941},
// architecture -> dark crystal leather, tallum leather
- {
- 5932,
- 5933,
- 5934,
- 5935,
- 5936
- },
+ {5932, 5933, 5934, 5935, 5936},
// golem plans -> dark crystal breastplate, tallum plate
- {
- 5922,
- 5923,
- 5924,
- 5925,
- 5926
- },
+ {5922, 5923, 5924, 5925, 5926},
// basics of magic -> dark crystal gaiters, dark crystal leggings
- {
- 5927,
- 5928,
- 5929,
- 5930,
- 5931
- }
+ {5927, 5928, 5929, 5930, 5931}
+ // @formatter:on
};
-
// Rewards
private static final int[][] RECIPES =
{
+ // @formatter:off
// medical theory -> tallum tunic, tallum stockings
- {
- 5346,
- 5354
- },
+ {5346, 5354},
// architecture -> dark crystal leather, tallum leather
- {
- 5332,
- 5334
- },
+ {5332, 5334},
// golem plans -> dark crystal breastplate, tallum plate
- {
- 5416,
- 5418
- },
+ {5416, 5418},
// basics of magic -> dark crystal gaiters, dark crystal leggings
- {
- 5424,
- 5340
- }
+ {5424, 5340}
+ // @formatter:on
};
public Q376_ExplorationOfTheGiantsCave_Part1()
{
super(376, "Exploration of the Giants' Cave, Part 1");
-
registerQuestItems(DICTIONARY_BASIC, MYSTERIOUS_BOOK);
-
addStartNpc(SOBLING);
addTalkId(SOBLING, CLIFF);
-
addKillId(20647, 20648, 20649, 20650);
}
@@ -117,31 +81,34 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
return htmltext;
}
- // Sobling
- if (event.equals("31147-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("condBook", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(DICTIONARY_BASIC, 1);
- }
- else if (event.equals("31147-04.htm"))
- {
- htmltext = checkItems(st);
- }
- else if (event.equals("31147-09.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- // Cliff
- else if (event.equals("30182-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MYSTERIOUS_BOOK, -1);
- st.giveItems(DICTIONARY_INTERMEDIATE, 1);
+ case "31147-03.htm":
+ {
+ st.startQuest();
+ st.set("condBook", "1");
+ st.giveItems(DICTIONARY_BASIC, 1);
+ break;
+ }
+ case "31147-04.htm":
+ {
+ htmltext = checkItems(st);
+ break;
+ }
+ case "31147-09.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30182-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MYSTERIOUS_BOOK, -1);
+ st.giveItems(DICTIONARY_INTERMEDIATE, 1);
+ break;
+ }
}
return htmltext;
@@ -160,18 +127,22 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 51) ? "31147-01.htm" : "31147-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SOBLING:
+ {
htmltext = checkItems(st);
break;
-
+ }
case CLIFF:
+ {
if ((cond == 2) && st.hasQuestItems(MYSTERIOUS_BOOK))
{
htmltext = "30182-01.htm";
@@ -181,8 +152,10 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
htmltext = "30182-03.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -207,7 +180,7 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
st.dropItems(PARCHMENT, 1, 0, 20000);
// Drop mysterious book to person who still need it
- partyMember = getRandomPartyMember(player, npc, "condBook", "1");
+ partyMember = getRandomPartyMember(player, "condBook", "1");
if (partyMember == null)
{
return null;
@@ -231,10 +204,10 @@ public class Q376_ExplorationOfTheGiantsCave_Part1 extends Quest
{
if (st.hasQuestItems(MYSTERIOUS_BOOK))
{
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond == 1)
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
return "31147-07.htm";
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q377_ExplorationOfTheGiantsCave_Part2/Q377_ExplorationOfTheGiantsCave_Part2.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q377_ExplorationOfTheGiantsCave_Part2/Q377_ExplorationOfTheGiantsCave_Part2.java
index f236c0c8a5..19773e8d4a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q377_ExplorationOfTheGiantsCave_Part2/Q377_ExplorationOfTheGiantsCave_Part2.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q377_ExplorationOfTheGiantsCave_Part2/Q377_ExplorationOfTheGiantsCave_Part2.java
@@ -28,49 +28,31 @@ public class Q377_ExplorationOfTheGiantsCave_Part2 extends Quest
// Items
private static final int ANCIENT_BOOK = 5955;
private static final int DICTIONARY_INTERMEDIATE = 5892;
-
private static final int[][] BOOKS =
{
+ // @formatter:off
// science & technology -> majestic leather, leather armor of nightmare
- {
- 5945,
- 5946,
- 5947,
- 5948,
- 5949
- },
+ {5945, 5946, 5947, 5948, 5949},
// culture -> armor of nightmare, majestic plate
- {
- 5950,
- 5951,
- 5952,
- 5953,
- 5954
- }
+ {5950, 5951, 5952, 5953, 5954}
+ // @formatter:on
};
-
// Rewards
private static final int[][] RECIPES =
{
+ // @formatter:off
// science & technology -> majestic leather, leather armor of nightmare
- {
- 5338,
- 5336
- },
+ {5338, 5336},
// culture -> armor of nightmare, majestic plate
- {
- 5420,
- 5422
- }
+ {5420, 5422}
+ // @formatter:on
};
public Q377_ExplorationOfTheGiantsCave_Part2()
{
super(377, "Exploration of Giants Cave, Part 2");
-
addStartNpc(31147); // Sobling
addTalkId(31147);
-
addKillId(20654, 20656, 20657, 20658);
}
@@ -84,20 +66,24 @@ public class Q377_ExplorationOfTheGiantsCave_Part2 extends Quest
return htmltext;
}
- if (event.equals("31147-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31147-04.htm"))
- {
- htmltext = checkItems(st);
- }
- else if (event.equals("31147-07.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ case "31147-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31147-04.htm":
+ {
+ htmltext = checkItems(st);
+ break;
+ }
+ case "31147-07.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
}
return htmltext;
@@ -116,12 +102,15 @@ public class Q377_ExplorationOfTheGiantsCave_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() < 57) || !st.hasQuestItems(DICTIONARY_INTERMEDIATE)) ? "31147-01.htm" : "31147-02.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = checkItems(st);
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q378_MagnificentFeast/Q378_MagnificentFeast.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q378_MagnificentFeast/Q378_MagnificentFeast.java
index 900602a615..ca9a2715b1 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q378_MagnificentFeast/Q378_MagnificentFeast.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q378_MagnificentFeast/Q378_MagnificentFeast.java
@@ -29,7 +29,6 @@ public class Q378_MagnificentFeast extends Quest
{
// NPC
private static final int RANSPO = 30594;
-
// Items
private static final int WINE_15 = 5956;
private static final int WINE_30 = 5957;
@@ -39,71 +38,26 @@ public class Q378_MagnificentFeast extends Quest
private static final int SAUCE_RECIPE = 1456;
private static final int STEAK_RECIPE = 1457;
private static final int RITRON_DESSERT = 5959;
-
// Rewards
private static final Map REWARDS = new HashMap<>();
static
{
- REWARDS.put("9", new int[]
- {
- 847,
- 1,
- 5700
- });
- REWARDS.put("10", new int[]
- {
- 846,
- 2,
- 0
- });
- REWARDS.put("12", new int[]
- {
- 909,
- 1,
- 25400
- });
- REWARDS.put("17", new int[]
- {
- 846,
- 2,
- 1200
- });
- REWARDS.put("18", new int[]
- {
- 879,
- 1,
- 6900
- });
- REWARDS.put("20", new int[]
- {
- 890,
- 2,
- 8500
- });
- REWARDS.put("33", new int[]
- {
- 879,
- 1,
- 8100
- });
- REWARDS.put("34", new int[]
- {
- 910,
- 1,
- 0
- });
- REWARDS.put("36", new int[]
- {
- 848,
- 1,
- 2200
- });
+ // @formatter:off
+ REWARDS.put("9", new int[]{847, 1, 5700});
+ REWARDS.put("10", new int[]{846, 2, 0});
+ REWARDS.put("12", new int[]{909, 1, 25400});
+ REWARDS.put("17", new int[]{846, 2, 1200});
+ REWARDS.put("18", new int[]{879, 1, 6900});
+ REWARDS.put("20", new int[]{890, 2, 8500});
+ REWARDS.put("33", new int[]{879, 1, 8100});
+ REWARDS.put("34", new int[]{910, 1, 0});
+ REWARDS.put("36", new int[]{848, 1, 2200});
+ // @formatter:on
}
public Q378_MagnificentFeast()
{
super(378, "Magnificent Feast");
-
addStartNpc(RANSPO);
addTalkId(RANSPO);
}
@@ -118,75 +72,78 @@ public class Q378_MagnificentFeast extends Quest
return htmltext;
}
- if (event.equals("30594-2.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30594-4a.htm"))
- {
- if (st.hasQuestItems(WINE_15))
+ case "30594-2.htm":
{
- st.set("cond", "2");
- st.set("score", "1");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WINE_15, 1);
+ st.startQuest();
+ break;
}
- else
+ case "30594-4a.htm":
{
- htmltext = "30594-4.htm";
+ if (st.hasQuestItems(WINE_15))
+ {
+ st.setCond(2);
+ st.set("score", "1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WINE_15, 1);
+ }
+ else
+ {
+ htmltext = "30594-4.htm";
+ }
+ break;
}
- }
- else if (event.equals("30594-4b.htm"))
- {
- if (st.hasQuestItems(WINE_30))
+ case "30594-4b.htm":
{
- st.set("cond", "2");
- st.set("score", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WINE_30, 1);
+ if (st.hasQuestItems(WINE_30))
+ {
+ st.setCond(2);
+ st.set("score", "2");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WINE_30, 1);
+ }
+ else
+ {
+ htmltext = "30594-4.htm";
+ }
+ break;
}
- else
+ case "30594-4c.htm":
{
- htmltext = "30594-4.htm";
+ if (st.hasQuestItems(WINE_60))
+ {
+ st.setCond(2);
+ st.set("score", "4");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WINE_60, 1);
+ }
+ else
+ {
+ htmltext = "30594-4.htm";
+ }
+ break;
}
- }
- else if (event.equals("30594-4c.htm"))
- {
- if (st.hasQuestItems(WINE_60))
+ case "30594-6.htm":
{
- st.set("cond", "2");
- st.set("score", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WINE_60, 1);
+ if (st.hasQuestItems(MUSICAL_SCORE))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(MUSICAL_SCORE, 1);
+ }
+ else
+ {
+ htmltext = "30594-5.htm";
+ }
+ break;
}
- else
- {
- htmltext = "30594-4.htm";
- }
- }
- else if (event.equals("30594-6.htm"))
- {
- if (st.hasQuestItems(MUSICAL_SCORE))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(MUSICAL_SCORE, 1);
- }
- else
- {
- htmltext = "30594-5.htm";
- }
- }
- else
- {
- final int score = st.getInt("score");
- if (event.equals("30594-8a.htm"))
+ case "30594-8a.htm":
{
if (st.hasQuestItems(SALAD_RECIPE))
{
- st.set("cond", "4");
+ st.setCond(4);
+ final int score = st.getInt("score");
st.set("score", String.valueOf(score + 8));
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SALAD_RECIPE, 1);
@@ -195,12 +152,14 @@ public class Q378_MagnificentFeast extends Quest
{
htmltext = "30594-8.htm";
}
+ break;
}
- else if (event.equals("30594-8b.htm"))
+ case "30594-8b.htm":
{
if (st.hasQuestItems(SAUCE_RECIPE))
{
- st.set("cond", "4");
+ st.setCond(4);
+ final int score = st.getInt("score");
st.set("score", String.valueOf(score + 16));
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SAUCE_RECIPE, 1);
@@ -209,12 +168,14 @@ public class Q378_MagnificentFeast extends Quest
{
htmltext = "30594-8.htm";
}
+ break;
}
- else if (event.equals("30594-8c.htm"))
+ case "30594-8c.htm":
{
if (st.hasQuestItems(STEAK_RECIPE))
{
- st.set("cond", "4");
+ st.setCond(4);
+ final int score = st.getInt("score");
st.set("score", String.valueOf(score + 32));
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(STEAK_RECIPE, 1);
@@ -223,6 +184,7 @@ public class Q378_MagnificentFeast extends Quest
{
htmltext = "30594-8.htm";
}
+ break;
}
}
@@ -242,11 +204,13 @@ public class Q378_MagnificentFeast extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "30594-0.htm" : "30594-1.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30594-3.htm";
@@ -283,6 +247,8 @@ public class Q378_MagnificentFeast extends Quest
htmltext = "30594-9.htm";
}
}
+ break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q379_FantasyWine/Q379_FantasyWine.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q379_FantasyWine/Q379_FantasyWine.java
index 6d89ca2d77..e52faf5046 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q379_FantasyWine/Q379_FantasyWine.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q379_FantasyWine/Q379_FantasyWine.java
@@ -27,11 +27,9 @@ public class Q379_FantasyWine extends Quest
{
// NPCs
private static final int HARLAN = 30074;
-
// Monsters
private static final int ENKU_CHAMPION = 20291;
private static final int ENKU_SHAMAN = 20292;
-
// Items
private static final int LEAF = 5893;
private static final int STONE = 5894;
@@ -39,12 +37,9 @@ public class Q379_FantasyWine extends Quest
public Q379_FantasyWine()
{
super(379, "Fantasy Wine");
-
registerQuestItems(LEAF, STONE);
-
addStartNpc(HARLAN);
addTalkId(HARLAN);
-
addKillId(ENKU_CHAMPION, ENKU_SHAMAN);
}
@@ -58,40 +53,42 @@ public class Q379_FantasyWine extends Quest
return htmltext;
}
- if (event.equals("30074-3.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30074-6.htm"))
- {
- st.takeItems(LEAF, 80);
- st.takeItems(STONE, 100);
-
- final int rand = Rnd.get(10);
- if (rand < 3)
+ case "30074-3.htm":
{
- htmltext = "30074-6.htm";
- st.giveItems(5956, 1);
+ st.startQuest();
+ break;
}
- else if (rand < 9)
+ case "30074-6.htm":
{
- htmltext = "30074-7.htm";
- st.giveItems(5957, 1);
+ st.takeItems(LEAF, 80);
+ st.takeItems(STONE, 100);
+ final int rand = Rnd.get(10);
+ if (rand < 3)
+ {
+ htmltext = "30074-6.htm";
+ st.giveItems(5956, 1);
+ }
+ else if (rand < 9)
+ {
+ htmltext = "30074-7.htm";
+ st.giveItems(5957, 1);
+ }
+ else
+ {
+ htmltext = "30074-8.htm";
+ st.giveItems(5958, 1);
+ }
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- else
+ case "30074-2a.htm":
{
- htmltext = "30074-8.htm";
- st.giveItems(5958, 1);
+ st.exitQuest(true);
+ break;
}
-
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30074-2a.htm"))
- {
- st.exitQuest(true);
}
return htmltext;
@@ -110,10 +107,12 @@ public class Q379_FantasyWine extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "30074-0a.htm" : "30074-0.htm";
break;
-
+ }
case State.STARTED:
+ {
final int leaf = st.getQuestItemsCount(LEAF);
final int stone = st.getQuestItemsCount(STONE);
if ((leaf == 80) && (stone == 100))
@@ -133,6 +132,7 @@ public class Q379_FantasyWine extends Quest
htmltext = "30074-4.htm";
}
break;
+ }
}
return htmltext;
@@ -151,12 +151,12 @@ public class Q379_FantasyWine extends Quest
{
if (st.dropItemsAlways(LEAF, 1, 80) && (st.getQuestItemsCount(STONE) >= 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
}
else if (st.dropItemsAlways(STONE, 1, 100) && (st.getQuestItemsCount(LEAF) >= 80))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q380_BringOutTheFlavorOfIngredients/Q380_BringOutTheFlavorOfIngredients.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q380_BringOutTheFlavorOfIngredients/Q380_BringOutTheFlavorOfIngredients.java
index 85788c7ac7..9869c9e4a2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q380_BringOutTheFlavorOfIngredients/Q380_BringOutTheFlavorOfIngredients.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q380_BringOutTheFlavorOfIngredients/Q380_BringOutTheFlavorOfIngredients.java
@@ -29,13 +29,11 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
private static final int DIRE_WOLF = 20205;
private static final int KADIF_WEREWOLF = 20206;
private static final int GIANT_MIST_LEECH = 20225;
-
// Items
private static final int RITRON_FRUIT = 5895;
private static final int MOON_FACE_FLOWER = 5896;
private static final int LEECH_FLUIDS = 5897;
private static final int ANTIDOTE = 1831;
-
// Rewards
private static final int RITRON_JELLY = 5960;
private static final int JELLY_RECIPE = 5959;
@@ -43,12 +41,9 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
public Q380_BringOutTheFlavorOfIngredients()
{
super(380, "Bring Out the Flavor of Ingredients!");
-
registerQuestItems(RITRON_FRUIT, MOON_FACE_FLOWER, LEECH_FLUIDS);
-
addStartNpc(30069); // Rollant
addTalkId(30069);
-
addKillId(DIRE_WOLF, KADIF_WEREWOLF, GIANT_MIST_LEECH);
}
@@ -64,9 +59,7 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
if (event.equals("30069-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30069-12.htm"))
{
@@ -91,11 +84,13 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 24) ? "30069-00.htm" : "30069-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30069-06.htm";
@@ -105,7 +100,7 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
if (st.getQuestItemsCount(ANTIDOTE) >= 2)
{
htmltext = "30069-07.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RITRON_FRUIT, -1);
st.takeItems(MOON_FACE_FLOWER, -1);
@@ -120,19 +115,19 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
else if (cond == 3)
{
htmltext = "30069-08.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 4)
{
htmltext = "30069-09.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
{
htmltext = "30069-10.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 6)
@@ -150,6 +145,7 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
}
}
break;
+ }
}
return htmltext;
@@ -158,7 +154,7 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -169,21 +165,21 @@ public class Q380_BringOutTheFlavorOfIngredients extends Quest
case DIRE_WOLF:
if (st.dropItems(RITRON_FRUIT, 1, 4, 100000) && (st.getQuestItemsCount(MOON_FACE_FLOWER) == 20) && (st.getQuestItemsCount(LEECH_FLUIDS) == 10))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
case KADIF_WEREWOLF:
if (st.dropItems(MOON_FACE_FLOWER, 1, 20, 500000) && (st.getQuestItemsCount(RITRON_FRUIT) == 4) && (st.getQuestItemsCount(LEECH_FLUIDS) == 10))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
case GIANT_MIST_LEECH:
if (st.dropItems(LEECH_FLUIDS, 1, 10, 500000) && (st.getQuestItemsCount(RITRON_FRUIT) == 4) && (st.getQuestItemsCount(MOON_FACE_FLOWER) == 20))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q381_LetsBecomeARoyalMember/Q381_LetsBecomeARoyalMember.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q381_LetsBecomeARoyalMember/Q381_LetsBecomeARoyalMember.java
index 301e32e615..afbe457bf1 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q381_LetsBecomeARoyalMember/Q381_LetsBecomeARoyalMember.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q381_LetsBecomeARoyalMember/Q381_LetsBecomeARoyalMember.java
@@ -27,25 +27,20 @@ public class Q381_LetsBecomeARoyalMember extends Quest
// NPCs
private static final int SORINT = 30232;
private static final int SANDRA = 30090;
-
// Items
private static final int KAIL_COIN = 5899;
private static final int COIN_ALBUM = 5900;
private static final int GOLDEN_CLOVER_COIN = 7569;
private static final int COIN_COLLECTOR_MEMBERSHIP = 3813;
-
// Reward
private static final int ROYAL_MEMBERSHIP = 5898;
public Q381_LetsBecomeARoyalMember()
{
super(381, "Let's Become a Royal Member!");
-
registerQuestItems(KAIL_COIN, GOLDEN_CLOVER_COIN);
-
addStartNpc(SORINT);
addTalkId(SORINT, SANDRA);
-
addKillId(21018, 27316);
}
@@ -65,9 +60,7 @@ public class Q381_LetsBecomeARoyalMember extends Quest
}
else if (event.equals("30232-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -86,13 +79,16 @@ public class Q381_LetsBecomeARoyalMember extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() < 55) || !st.hasQuestItems(COIN_COLLECTOR_MEMBERSHIP)) ? "30232-02.htm" : "30232-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case SORINT:
+ {
if (!st.hasQuestItems(KAIL_COIN))
{
htmltext = "30232-04.htm";
@@ -111,8 +107,9 @@ public class Q381_LetsBecomeARoyalMember extends Quest
st.exitQuest(true);
}
break;
-
+ }
case SANDRA:
+ {
if (!st.hasQuestItems(COIN_ALBUM))
{
if (st.getInt("aCond") == 0)
@@ -138,8 +135,10 @@ public class Q381_LetsBecomeARoyalMember extends Quest
htmltext = "30090-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q382_KailsMagicCoin/Q382_KailsMagicCoin.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q382_KailsMagicCoin/Q382_KailsMagicCoin.java
index 8679cb4eb7..1aad918bca 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q382_KailsMagicCoin/Q382_KailsMagicCoin.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q382_KailsMagicCoin/Q382_KailsMagicCoin.java
@@ -30,7 +30,6 @@ public class Q382_KailsMagicCoin extends Quest
private static final int FALLEN_ORC_ARCHER = 21019;
private static final int FALLEN_ORC_SHAMAN = 21020;
private static final int FALLEN_ORC_CAPTAIN = 21022;
-
// Items
private static final int ROYAL_MEMBERSHIP = 5898;
private static final int SILVER_BASILISK = 5961;
@@ -40,12 +39,9 @@ public class Q382_KailsMagicCoin extends Quest
public Q382_KailsMagicCoin()
{
super(382, "Kail's Magic Coin");
-
registerQuestItems(SILVER_BASILISK, GOLD_GOLEM, BLOOD_DRAGON);
-
addStartNpc(30687); // Vergara
addTalkId(30687);
-
addKillId(FALLEN_ORC, FALLEN_ORC_ARCHER, FALLEN_ORC_SHAMAN, FALLEN_ORC_CAPTAIN);
}
@@ -61,9 +57,7 @@ public class Q382_KailsMagicCoin extends Quest
if (event.equals("30687-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
return htmltext;
@@ -82,12 +76,15 @@ public class Q382_KailsMagicCoin extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() < 55) || !st.hasQuestItems(ROYAL_MEMBERSHIP)) ? "30687-01.htm" : "30687-02.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = "30687-04.htm";
break;
+ }
}
return htmltext;
@@ -96,7 +93,7 @@ public class Q382_KailsMagicCoin extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -105,20 +102,25 @@ public class Q382_KailsMagicCoin extends Quest
switch (npc.getNpcId())
{
case FALLEN_ORC:
+ {
st.dropItems(SILVER_BASILISK, 1, 0, 100000);
break;
-
+ }
case FALLEN_ORC_ARCHER:
+ {
st.dropItems(GOLD_GOLEM, 1, 0, 100000);
break;
-
+ }
case FALLEN_ORC_SHAMAN:
+ {
st.dropItems(BLOOD_DRAGON, 1, 0, 100000);
break;
-
+ }
case FALLEN_ORC_CAPTAIN:
+ {
st.dropItems(5961 + Rnd.get(3), 1, 0, 100000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q383_SearchingForTreasure/Q383_SearchingForTreasure.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q383_SearchingForTreasure/Q383_SearchingForTreasure.java
index f7593320bd..2d95800ff4 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q383_SearchingForTreasure/Q383_SearchingForTreasure.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q383_SearchingForTreasure/Q383_SearchingForTreasure.java
@@ -28,7 +28,6 @@ public class Q383_SearchingForTreasure extends Quest
// NPCs
private static final int ESPEN = 30890;
private static final int PIRATE_CHEST = 31148;
-
// Items
private static final int PIRATE_TREASURE_MAP = 5915;
private static final int THIEF_KEY = 1661;
@@ -36,7 +35,6 @@ public class Q383_SearchingForTreasure extends Quest
public Q383_SearchingForTreasure()
{
super(383, "Searching for Treasure");
-
addStartNpc(ESPEN);
addTalkId(ESPEN, PIRATE_CHEST);
}
@@ -51,194 +49,199 @@ public class Q383_SearchingForTreasure extends Quest
return htmltext;
}
- if (event.equals("30890-04.htm"))
+ switch (event)
{
- // Sell the map.
- if (st.hasQuestItems(PIRATE_TREASURE_MAP))
+ case "30890-04.htm":
{
- st.takeItems(PIRATE_TREASURE_MAP, 1);
- st.rewardItems(57, 1000);
- }
- else
- {
- htmltext = "30890-06.htm";
- }
- }
- else if (event.equals("30890-07.htm"))
- {
- // Listen the story.
- if (st.hasQuestItems(PIRATE_TREASURE_MAP))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else
- {
- htmltext = "30890-06.htm";
- }
- }
- else if (event.equals("30890-11.htm"))
- {
- // Decipher the map.
- if (st.hasQuestItems(PIRATE_TREASURE_MAP))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PIRATE_TREASURE_MAP, 1);
- }
- else
- {
- htmltext = "30890-06.htm";
- }
- }
- else if (event.equals("31148-02.htm"))
- {
- if (st.hasQuestItems(THIEF_KEY))
- {
- st.takeItems(THIEF_KEY, 1);
-
- // Adena reward.
- int i1 = 0;
- int i0 = Rnd.get(100);
- if (i0 < 5)
+ // Sell the map.
+ if (st.hasQuestItems(PIRATE_TREASURE_MAP))
{
- st.giveItems(2450, 1);
- }
- else if (i0 < 6)
- {
- st.giveItems(2451, 1);
- }
- else if (i0 < 18)
- {
- st.giveItems(956, 1);
- }
- else if (i0 < 28)
- {
- st.giveItems(952, 1);
+ st.takeItems(PIRATE_TREASURE_MAP, 1);
+ st.rewardItems(57, 1000);
}
else
{
- i1 += 500;
+ htmltext = "30890-06.htm";
}
-
- i0 = Rnd.get(1000);
- if (i0 < 25)
- {
- st.giveItems(4481, 1);
- }
- else if (i0 < 50)
- {
- st.giveItems(4482, 1);
- }
- else if (i0 < 75)
- {
- st.giveItems(4483, 1);
- }
- else if (i0 < 100)
- {
- st.giveItems(4484, 1);
- }
- else if (i0 < 125)
- {
- st.giveItems(4485, 1);
- }
- else if (i0 < 150)
- {
- st.giveItems(4486, 1);
- }
- else if (i0 < 175)
- {
- st.giveItems(4487, 1);
- }
- else if (i0 < 200)
- {
- st.giveItems(4488, 1);
- }
- else if (i0 < 225)
- {
- st.giveItems(4489, 1);
- }
- else if (i0 < 250)
- {
- st.giveItems(4490, 1);
- }
- else if (i0 < 275)
- {
- st.giveItems(4491, 1);
- }
- else if (i0 < 300)
- {
- st.giveItems(4492, 1);
- }
- else
- {
- i1 += 300;
- }
-
- i0 = Rnd.get(100);
- if (i0 < 4)
- {
- st.giveItems(1337, 1);
- }
- else if (i0 < 8)
- {
- st.giveItems(1338, 2);
- }
- else if (i0 < 12)
- {
- st.giveItems(1339, 2);
- }
- else if (i0 < 16)
- {
- st.giveItems(3447, 2);
- }
- else if (i0 < 20)
- {
- st.giveItems(3450, 1);
- }
- else if (i0 < 25)
- {
- st.giveItems(3453, 1);
- }
- else if (i0 < 27)
- {
- st.giveItems(3456, 1);
- }
- else
- {
- i1 += 500;
- }
-
- i0 = Rnd.get(100);
- if (i0 < 20)
- {
- st.giveItems(4408, 1);
- }
- else if (i0 < 40)
- {
- st.giveItems(4409, 1);
- }
- else if (i0 < 60)
- {
- st.giveItems(4418, 1);
- }
- else if (i0 < 80)
- {
- st.giveItems(4419, 1);
- }
- else
- {
- i1 += 500;
- }
-
- st.rewardItems(57, i1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ break;
}
- else
+ case "30890-07.htm":
{
- htmltext = "31148-03.htm";
+ // Listen the story.
+ if (st.hasQuestItems(PIRATE_TREASURE_MAP))
+ {
+ st.startQuest();
+ }
+ else
+ {
+ htmltext = "30890-06.htm";
+ }
+ break;
+ }
+ case "30890-11.htm":
+ {
+ // Decipher the map.
+ if (st.hasQuestItems(PIRATE_TREASURE_MAP))
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PIRATE_TREASURE_MAP, 1);
+ }
+ else
+ {
+ htmltext = "30890-06.htm";
+ }
+ break;
+ }
+ case "31148-02.htm":
+ {
+ if (st.hasQuestItems(THIEF_KEY))
+ {
+ st.takeItems(THIEF_KEY, 1);
+
+ // Adena reward.
+ int i1 = 0;
+ int i0 = Rnd.get(100);
+ if (i0 < 5)
+ {
+ st.giveItems(2450, 1);
+ }
+ else if (i0 < 6)
+ {
+ st.giveItems(2451, 1);
+ }
+ else if (i0 < 18)
+ {
+ st.giveItems(956, 1);
+ }
+ else if (i0 < 28)
+ {
+ st.giveItems(952, 1);
+ }
+ else
+ {
+ i1 += 500;
+ }
+
+ i0 = Rnd.get(1000);
+ if (i0 < 25)
+ {
+ st.giveItems(4481, 1);
+ }
+ else if (i0 < 50)
+ {
+ st.giveItems(4482, 1);
+ }
+ else if (i0 < 75)
+ {
+ st.giveItems(4483, 1);
+ }
+ else if (i0 < 100)
+ {
+ st.giveItems(4484, 1);
+ }
+ else if (i0 < 125)
+ {
+ st.giveItems(4485, 1);
+ }
+ else if (i0 < 150)
+ {
+ st.giveItems(4486, 1);
+ }
+ else if (i0 < 175)
+ {
+ st.giveItems(4487, 1);
+ }
+ else if (i0 < 200)
+ {
+ st.giveItems(4488, 1);
+ }
+ else if (i0 < 225)
+ {
+ st.giveItems(4489, 1);
+ }
+ else if (i0 < 250)
+ {
+ st.giveItems(4490, 1);
+ }
+ else if (i0 < 275)
+ {
+ st.giveItems(4491, 1);
+ }
+ else if (i0 < 300)
+ {
+ st.giveItems(4492, 1);
+ }
+ else
+ {
+ i1 += 300;
+ }
+
+ i0 = Rnd.get(100);
+ if (i0 < 4)
+ {
+ st.giveItems(1337, 1);
+ }
+ else if (i0 < 8)
+ {
+ st.giveItems(1338, 2);
+ }
+ else if (i0 < 12)
+ {
+ st.giveItems(1339, 2);
+ }
+ else if (i0 < 16)
+ {
+ st.giveItems(3447, 2);
+ }
+ else if (i0 < 20)
+ {
+ st.giveItems(3450, 1);
+ }
+ else if (i0 < 25)
+ {
+ st.giveItems(3453, 1);
+ }
+ else if (i0 < 27)
+ {
+ st.giveItems(3456, 1);
+ }
+ else
+ {
+ i1 += 500;
+ }
+
+ i0 = Rnd.get(100);
+ if (i0 < 20)
+ {
+ st.giveItems(4408, 1);
+ }
+ else if (i0 < 40)
+ {
+ st.giveItems(4409, 1);
+ }
+ else if (i0 < 60)
+ {
+ st.giveItems(4418, 1);
+ }
+ else if (i0 < 80)
+ {
+ st.giveItems(4419, 1);
+ }
+ else
+ {
+ i1 += 500;
+ }
+
+ st.rewardItems(57, i1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "31148-03.htm";
+ }
+ break;
}
}
@@ -258,14 +261,17 @@ public class Q383_SearchingForTreasure extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() < 42) || !st.hasQuestItems(PIRATE_TREASURE_MAP)) ? "30890-01.htm" : "30890-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ESPEN:
+ {
if (cond == 1)
{
htmltext = "30890-07a.htm";
@@ -275,15 +281,18 @@ public class Q383_SearchingForTreasure extends Quest
htmltext = "30890-12.htm";
}
break;
-
+ }
case PIRATE_CHEST:
+ {
if (cond == 2)
{
htmltext = "31148-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q384_WarehouseKeepersPastime/Q384_WarehouseKeepersPastime.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q384_WarehouseKeepersPastime/Q384_WarehouseKeepersPastime.java
index 6c89f5d941..e774460fea 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q384_WarehouseKeepersPastime/Q384_WarehouseKeepersPastime.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q384_WarehouseKeepersPastime/Q384_WarehouseKeepersPastime.java
@@ -33,10 +33,8 @@ public class Q384_WarehouseKeepersPastime extends Quest
// NPCs
private static final int CLIFF = 30182;
private static final int BAXT = 30685;
-
// Items
private static final int MEDAL = 5964;
-
private static final Map CHANCES = new HashMap<>();
static
{
@@ -67,160 +65,58 @@ public class Q384_WarehouseKeepersPastime extends Quest
CHANCES.put(20677, 340000); // Tulben
CHANCES.put(20605, 150000); // Weird Drake
}
-
+ // @formatter:off
private static final int[][] MATRICE_3X3_LINES = new int[][]
{
- {
- 1,
- 2,
- 3
- },
- {
- 4,
- 5,
- 6
- },
- {
- 7,
- 8,
- 9
- },
- {
- 1,
- 4,
- 7
- },
- {
- 2,
- 5,
- 8
- },
- {
- 3,
- 6,
- 9
- },
- {
- 1,
- 5,
- 9
- },
- {
- 3,
- 5,
- 7
- }
+ {1, 2, 3},
+ {4, 5, 6},
+ {7, 8, 9},
+ {1, 4, 7},
+ {2, 5, 8},
+ {3, 6, 9},
+ {1, 5, 9},
+ {3, 5, 7}
};
-
private static final int[][] _rewards_10_win =
{
- {
- 16,
- 1888
- }, // Synthetic Cokes
- {
- 32,
- 1887
- }, // Varnish of Purity
- {
- 50,
- 1894
- }, // Crafted Leather
- {
- 80,
- 952
- }, // Scroll: Enchant Armor (C)
- {
- 89,
- 1890
- }, // Mithril Alloy
- {
- 98,
- 1893
- }, // Oriharukon
- {
- 100,
- 951
- }
- // Scroll: Enchant Weapon (C)
+ {16, 1888}, // Synthetic Cokes
+ {32, 1887}, // Varnish of Purity
+ {50, 1894}, // Crafted Leather
+ {80, 952}, // Scroll: Enchant Armor (C)
+ {89, 1890}, // Mithril Alloy
+ {98, 1893}, // Oriharukon
+ {100, 951} // Scroll: Enchant Weapon (C)
};
-
private static final int[][] _rewards_10_lose =
{
- {
- 50,
- 4041
- }, // Mold Hardener
- {
- 80,
- 952
- }, // Scroll: Enchant Armor (C)
- {
- 98,
- 1892
- }, // Blacksmith's Frame
- {
- 100,
- 917
- }
- // Necklace of Mermaid
+ {50, 4041}, // Mold Hardener
+ {80, 952}, // Scroll: Enchant Armor (C)
+ {98, 1892}, // Blacksmith's Frame
+ {100, 917} // Necklace of Mermaid
};
-
private static final int[][] _rewards_100_win =
{
- {
- 50,
- 883
- }, // Aquastone Ring
- {
- 80,
- 951
- }, // Scroll: Enchant Weapon (C)
- {
- 98,
- 852
- }, // Moonstone Earring
- {
- 100,
- 401
- }
- // Drake Leather Armor
+ {50, 883}, // Aquastone Ring
+ {80, 951}, // Scroll: Enchant Weapon (C)
+ {98, 852}, // Moonstone Earring
+ {100, 401} // Drake Leather Armor
};
-
private static final int[][] _rewards_100_lose =
{
- {
- 50,
- 951
- }, // Scroll: Enchant Weapon (C)
- {
- 80,
- 500
- }, // Great Helmet
- {
- 98,
- 2437
- }, // Drake Leather Boots
- {
- 100,
- 135
- }
- // Samurai Longsword
+ {50, 951}, // Scroll: Enchant Weapon (C)
+ {80, 500}, // Great Helmet
+ {98, 2437}, // Drake Leather Boots
+ {100, 135} // Samurai Longsword
};
+ // @formatter:on
public Q384_WarehouseKeepersPastime()
{
super(384, "Warehouse Keeper's Pastime");
-
registerQuestItems(MEDAL);
-
addStartNpc(CLIFF);
addTalkId(CLIFF, BAXT);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -236,9 +132,7 @@ public class Q384_WarehouseKeepersPastime extends Quest
final int npcId = npc.getNpcId();
if (event.equals("30182-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals(npcId + "-08.htm"))
{
@@ -318,7 +212,7 @@ public class Q384_WarehouseKeepersPastime extends Quest
String playerChoice = playerArray.concat(number);
// Transform the generated board (9 string length) into a 2d matrice (3x3 int).
- String[] board = ((String) st.get("board")).split("");
+ String[] board = st.get("board").split("");
// test for all line combination
int winningLines = 0;
@@ -445,8 +339,8 @@ public class Q384_WarehouseKeepersPastime extends Quest
private static final String fillBoard(QuestState st, String htmltext)
{
String result = htmltext;
- String playerArray = (String) st.get("playerArray");
- String[] board = ((String) st.get("board")).split("");
+ String playerArray = st.get("playerArray");
+ String[] board = st.get("board").split("");
for (int i = 1; i < 10; ++i)
{
result = result.replace("", playerArray.contains(board[i - 1]) ? board[i - 1] : "?");
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q385_YokeOfThePast/Q385_YokeOfThePast.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q385_YokeOfThePast/Q385_YokeOfThePast.java
index 970103230f..0e5b10c9e8 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q385_YokeOfThePast/Q385_YokeOfThePast.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q385_YokeOfThePast/Q385_YokeOfThePast.java
@@ -60,13 +60,10 @@ public class Q385_YokeOfThePast extends Quest
31125,
31126
};
-
// Item
private static final int ANCIENT_SCROLL = 5902;
-
// Reward
private static final int BLANK_SCROLL = 5965;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -117,16 +114,10 @@ public class Q385_YokeOfThePast extends Quest
public Q385_YokeOfThePast()
{
super(385, "Yoke of the Past");
-
registerQuestItems(ANCIENT_SCROLL);
-
addStartNpc(GATEKEEPER_ZIGGURAT);
addTalkId(GATEKEEPER_ZIGGURAT);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -141,9 +132,7 @@ public class Q385_YokeOfThePast extends Quest
if (event.equals("05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("10.htm"))
{
@@ -167,10 +156,12 @@ public class Q385_YokeOfThePast extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "02.htm" : "01.htm";
break;
-
+ }
case State.STARTED:
+ {
if (!st.hasQuestItems(ANCIENT_SCROLL))
{
htmltext = "08.htm";
@@ -183,6 +174,7 @@ public class Q385_YokeOfThePast extends Quest
st.rewardItems(BLANK_SCROLL, count);
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q386_StolenDignity/Q386_StolenDignity.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q386_StolenDignity/Q386_StolenDignity.java
index 302bb20a85..5084898b2c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q386_StolenDignity/Q386_StolenDignity.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q386_StolenDignity/Q386_StolenDignity.java
@@ -91,46 +91,16 @@ public class Q386_StolenDignity extends Quest
};
public static final int[][] MATRICE_3X3_LINES = new int[][]
{
- {
- 1,
- 2,
- 3
- },
- {
- 4,
- 5,
- 6
- },
- {
- 7,
- 8,
- 9
- },
- {
- 1,
- 4,
- 7
- },
- {
- 2,
- 5,
- 8
- },
- {
- 3,
- 6,
- 9
- },
- {
- 1,
- 5,
- 9
- },
- {
- 3,
- 5,
- 7
- }
+ // @formatter:off
+ {1, 2, 3},
+ {4, 5, 6},
+ {7, 8, 9},
+ {1, 4, 7},
+ {2, 5, 8},
+ {3, 6, 9},
+ {1, 5, 9},
+ {3, 5, 7}
+ // @formatter:on
};
public Q386_StolenDignity()
@@ -173,19 +143,17 @@ public class Q386_StolenDignity extends Quest
QuestState st = player.getQuestState("Q386_StolenDignity");
if (st == null)
{
- return event;
+ return htmltext;
}
if (event.equals("30843-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
+ st.startQuest();
st.set("state", "1");
- st.playSound("ItemSound.quest_accept");
}
else if (event.equals("30843-08.htm"))
{
- st.playSound("ItemSound.quest_giveup");
+ st.playSound(QuestState.SOUND_GIVEUP);
st.exitQuest(true);
}
else if (event.equals("30843-12.htm"))
@@ -212,7 +180,7 @@ public class Q386_StolenDignity extends Quest
if (event.startsWith("select_2-"))
{
number = event.substring(9);
- playerArray = (String) st.get("playerArray");
+ playerArray = st.get("playerArray");
if (playerArray.contains(number))
{
htmltext = fillBoard(st, getHtmlText("30843-" + (13 + (2 * playerArray.length())) + ".htm"));
@@ -226,7 +194,7 @@ public class Q386_StolenDignity extends Quest
else if (event.startsWith("select_3-"))
{
number = event.substring(9);
- playerArray = (String) st.get("playerArray");
+ playerArray = st.get("playerArray");
if (playerArray.contains(number))
{
htmltext = fillBoard(st, getHtmlText("30843-25.htm"));
@@ -234,7 +202,7 @@ public class Q386_StolenDignity extends Quest
else
{
String playerChoice = playerArray.concat(number);
- String[] board = ((String) st.get("board")).split("");
+ String[] board = st.get("board").split("");
int winningLines = 0;
int[][] var11 = MATRICE_3X3_LINES;
int var12 = var11.length;
@@ -300,8 +268,8 @@ public class Q386_StolenDignity extends Quest
private static final String fillBoard(QuestState st, String htmltext)
{
String result = htmltext;
- String playerArray = (String) st.get("playerArray");
- String[] board = ((String) st.get("board")).split("");
+ String playerArray = st.get("playerArray");
+ String[] board = st.get("board").split("");
for (int i = 1; i < 10; ++i)
{
result = result.replace("", playerArray.contains(board[i - 1]) ? board[i - 1] : "?");
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q401_PathToAWarrior/Q401_PathToAWarrior.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q401_PathToAWarrior/Q401_PathToAWarrior.java
index c483605e44..4f6bc9fb6c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q401_PathToAWarrior/Q401_PathToAWarrior.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q401_PathToAWarrior/Q401_PathToAWarrior.java
@@ -36,7 +36,6 @@ public class Q401_PathToAWarrior extends Quest
private static final int SIMPLON_LETTER = 1143;
private static final int POISON_SPIDER_LEG = 1144;
private static final int MEDALLION_OF_WARRIOR = 1145;
-
// NPCs
private static final int AURON = 30010;
private static final int SIMPLON = 30253;
@@ -44,12 +43,9 @@ public class Q401_PathToAWarrior extends Quest
public Q401_PathToAWarrior()
{
super(401, "Path to a Warrior");
-
registerQuestItems(AURON_LETTER, WARRIOR_GUILD_MARK, RUSTED_BRONZE_SWORD_1, RUSTED_BRONZE_SWORD_2, RUSTED_BRONZE_SWORD_3, SIMPLON_LETTER, POISON_SPIDER_LEG);
-
addStartNpc(AURON);
addTalkId(AURON, SIMPLON);
-
addKillId(20035, 20038, 20042, 20043);
}
@@ -80,21 +76,19 @@ public class Q401_PathToAWarrior extends Quest
}
else if (event.equals("30010-06.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(AURON_LETTER, 1);
}
else if (event.equals("30253-02.htm"))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(AURON_LETTER, 1);
st.giveItems(WARRIOR_GUILD_MARK, 1);
}
else if (event.equals("30010-11.htm"))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RUSTED_BRONZE_SWORD_2, 1);
st.takeItems(SIMPLON_LETTER, 1);
@@ -117,14 +111,17 @@ public class Q401_PathToAWarrior extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30010-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case AURON:
+ {
if (cond == 1)
{
htmltext = "30010-07.htm";
@@ -153,8 +150,9 @@ public class Q401_PathToAWarrior extends Quest
st.exitQuest(true);
}
break;
-
+ }
case SIMPLON:
+ {
if (cond == 1)
{
htmltext = "30253-01.htm";
@@ -173,7 +171,7 @@ public class Q401_PathToAWarrior extends Quest
else if (cond == 3)
{
htmltext = "30253-04.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RUSTED_BRONZE_SWORD_1, 10);
st.takeItems(WARRIOR_GUILD_MARK, 1);
@@ -185,8 +183,10 @@ public class Q401_PathToAWarrior extends Quest
htmltext = "30253-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -205,19 +205,22 @@ public class Q401_PathToAWarrior extends Quest
{
case 20035:
case 20042:
- if ((st.getInt("cond") == 2) && st.dropItems(RUSTED_BRONZE_SWORD_1, 1, 10, 400000))
+ {
+ if (st.isCond(2) && st.dropItems(RUSTED_BRONZE_SWORD_1, 1, 10, 400000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20038:
case 20043:
- if ((st.getInt("cond") == 5) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == RUSTED_BRONZE_SWORD_3) && st.dropItemsAlways(POISON_SPIDER_LEG, 1, 20))
+ {
+ if (st.isCond(5) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == RUSTED_BRONZE_SWORD_3) && st.dropItemsAlways(POISON_SPIDER_LEG, 1, 20))
{
- st.set("cond", "6");
+ st.setCond(6);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q402_PathToAHumanKnight/Q402_PathToAHumanKnight.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q402_PathToAHumanKnight/Q402_PathToAHumanKnight.java
index 4eea580428..a120a9fb3b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q402_PathToAHumanKnight/Q402_PathToAHumanKnight.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q402_PathToAHumanKnight/Q402_PathToAHumanKnight.java
@@ -26,6 +26,16 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q402_PathToAHumanKnight extends Quest
{
+ // NPCs
+ private static final int SIR_KLAUS_VASPER = 30417;
+ private static final int BATHIS = 30332;
+ private static final int RAYMOND = 30289;
+ private static final int BEZIQUE = 30379;
+ private static final int LEVIAN = 30037;
+ private static final int GILBERT = 30039;
+ private static final int BIOTIN = 30031;
+ private static final int SIR_AARON_TANFORD = 30653;
+ private static final int SIR_COLLIN_WINDAWOOD = 30311;
// Items
private static final int SWORD_OF_RITUAL = 1161;
private static final int COIN_OF_LORDS_1 = 1162;
@@ -48,26 +58,12 @@ public class Q402_PathToAHumanKnight extends Quest
private static final int HORRIBLE_SKULL = 1179;
private static final int MARK_OF_ESQUIRE = 1271;
- // NPCs
- private static final int SIR_KLAUS_VASPER = 30417;
- private static final int BATHIS = 30332;
- private static final int RAYMOND = 30289;
- private static final int BEZIQUE = 30379;
- private static final int LEVIAN = 30037;
- private static final int GILBERT = 30039;
- private static final int BIOTIN = 30031;
- private static final int SIR_AARON_TANFORD = 30653;
- private static final int SIR_COLLIN_WINDAWOOD = 30311;
-
public Q402_PathToAHumanKnight()
{
super(402, "Path to a Human Knight");
-
registerQuestItems(MARK_OF_ESQUIRE, COIN_OF_LORDS_1, COIN_OF_LORDS_2, COIN_OF_LORDS_3, COIN_OF_LORDS_4, COIN_OF_LORDS_5, COIN_OF_LORDS_6, GLUDIO_GUARD_MARK_1, BUGBEAR_NECKLACE, EINHASAD_CHURCH_MARK_1, EINHASAD_CRUCIFIX, GLUDIO_GUARD_MARK_2, SPIDER_LEG, EINHASAD_CHURCH_MARK_2, LIZARDMAN_TOTEM, GLUDIO_GUARD_MARK_3, GIANT_SPIDER_HUSK, EINHASAD_CHURCH_MARK_3, LIZARDMAN_TOTEM, GLUDIO_GUARD_MARK_3, GIANT_SPIDER_HUSK, EINHASAD_CHURCH_MARK_3, HORRIBLE_SKULL);
-
addStartNpc(SIR_KLAUS_VASPER);
addTalkId(SIR_KLAUS_VASPER, BATHIS, RAYMOND, BEZIQUE, LEVIAN, GILBERT, BIOTIN, SIR_AARON_TANFORD, SIR_COLLIN_WINDAWOOD);
-
addKillId(20775, 27024, 20038, 20043, 20050, 20030, 20027, 20024, 20103, 20106, 20108, 20404);
}
@@ -81,73 +77,84 @@ public class Q402_PathToAHumanKnight extends Quest
return htmltext;
}
- if (event.equals("30417-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.FIGHTER)
+ case "30417-05.htm":
{
- htmltext = (player.getClassId() == ClassId.KNIGHT) ? "30417-02a.htm" : "30417-03.htm";
+ if (player.getClassId() != ClassId.FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.KNIGHT) ? "30417-02a.htm" : "30417-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30417-02.htm";
+ }
+ else if (st.hasQuestItems(SWORD_OF_RITUAL))
+ {
+ htmltext = "30417-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30417-08.htm":
{
- htmltext = "30417-02.htm";
+ st.startQuest();
+ st.giveItems(MARK_OF_ESQUIRE, 1);
+ break;
}
- else if (st.hasQuestItems(SWORD_OF_RITUAL))
+ case "30332-02.htm":
{
- htmltext = "30417-04.htm";
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(GLUDIO_GUARD_MARK_1, 1);
+ break;
+ }
+ case "30289-03.htm":
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(EINHASAD_CHURCH_MARK_1, 1);
+ break;
+ }
+ case "30379-02.htm":
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(GLUDIO_GUARD_MARK_2, 1);
+ break;
+ }
+ case "30037-02.htm":
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(EINHASAD_CHURCH_MARK_2, 1);
+ break;
+ }
+ case "30039-02.htm":
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(GLUDIO_GUARD_MARK_3, 1);
+ break;
+ }
+ case "30031-02.htm":
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(EINHASAD_CHURCH_MARK_3, 1);
+ break;
+ }
+ case "30417-13.htm":
+ case "30417-14.htm":
+ {
+ final int coinCount = st.getQuestItemsCount(COIN_OF_LORDS_1) + st.getQuestItemsCount(COIN_OF_LORDS_2) + st.getQuestItemsCount(COIN_OF_LORDS_3) + st.getQuestItemsCount(COIN_OF_LORDS_4) + st.getQuestItemsCount(COIN_OF_LORDS_5) + st.getQuestItemsCount(COIN_OF_LORDS_6);
+ st.takeItems(COIN_OF_LORDS_1, -1);
+ st.takeItems(COIN_OF_LORDS_2, -1);
+ st.takeItems(COIN_OF_LORDS_3, -1);
+ st.takeItems(COIN_OF_LORDS_4, -1);
+ st.takeItems(COIN_OF_LORDS_5, -1);
+ st.takeItems(COIN_OF_LORDS_6, -1);
+ st.takeItems(MARK_OF_ESQUIRE, 1);
+ st.giveItems(SWORD_OF_RITUAL, 1);
+ st.rewardExpAndSp(3200, 1500 + (1920 * (coinCount - 3)));
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30417-08.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(MARK_OF_ESQUIRE, 1);
- }
- else if (event.equals("30332-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(GLUDIO_GUARD_MARK_1, 1);
- }
- else if (event.equals("30289-03.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(EINHASAD_CHURCH_MARK_1, 1);
- }
- else if (event.equals("30379-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(GLUDIO_GUARD_MARK_2, 1);
- }
- else if (event.equals("30037-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(EINHASAD_CHURCH_MARK_2, 1);
- }
- else if (event.equals("30039-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(GLUDIO_GUARD_MARK_3, 1);
- }
- else if (event.equals("30031-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(EINHASAD_CHURCH_MARK_3, 1);
- }
- else if (event.equals("30417-13.htm") || event.equals("30417-14.htm"))
- {
- final int coinCount = st.getQuestItemsCount(COIN_OF_LORDS_1) + st.getQuestItemsCount(COIN_OF_LORDS_2) + st.getQuestItemsCount(COIN_OF_LORDS_3) + st.getQuestItemsCount(COIN_OF_LORDS_4) + st.getQuestItemsCount(COIN_OF_LORDS_5) + st.getQuestItemsCount(COIN_OF_LORDS_6);
- st.takeItems(COIN_OF_LORDS_1, -1);
- st.takeItems(COIN_OF_LORDS_2, -1);
- st.takeItems(COIN_OF_LORDS_3, -1);
- st.takeItems(COIN_OF_LORDS_4, -1);
- st.takeItems(COIN_OF_LORDS_5, -1);
- st.takeItems(COIN_OF_LORDS_6, -1);
- st.takeItems(MARK_OF_ESQUIRE, 1);
- st.giveItems(SWORD_OF_RITUAL, 1);
- st.rewardExpAndSp(3200, 1500 + (1920 * (coinCount - 3)));
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -166,13 +173,16 @@ public class Q402_PathToAHumanKnight extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30417-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case SIR_KLAUS_VASPER:
+ {
final int coins = st.getQuestItemsCount(COIN_OF_LORDS_1) + st.getQuestItemsCount(COIN_OF_LORDS_2) + st.getQuestItemsCount(COIN_OF_LORDS_3) + st.getQuestItemsCount(COIN_OF_LORDS_4) + st.getQuestItemsCount(COIN_OF_LORDS_5) + st.getQuestItemsCount(COIN_OF_LORDS_6);
if (coins < 3)
{
@@ -203,8 +213,9 @@ public class Q402_PathToAHumanKnight extends Quest
st.exitQuest(true);
}
break;
-
+ }
case BATHIS:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_1))
{
htmltext = "30332-05.htm";
@@ -229,8 +240,9 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30332-01.htm";
}
break;
-
+ }
case RAYMOND:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_2))
{
htmltext = "30289-06.htm";
@@ -255,8 +267,9 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30289-01.htm";
}
break;
-
+ }
case BEZIQUE:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_3))
{
htmltext = "30379-05.htm";
@@ -281,8 +294,9 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30379-01.htm";
}
break;
-
+ }
case LEVIAN:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_4))
{
htmltext = "30037-05.htm";
@@ -307,8 +321,9 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30037-01.htm";
}
break;
-
+ }
case GILBERT:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_5))
{
htmltext = "30039-05.htm";
@@ -333,8 +348,9 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30039-01.htm";
}
break;
-
+ }
case BIOTIN:
+ {
if (st.hasQuestItems(COIN_OF_LORDS_6))
{
htmltext = "30031-05.htm";
@@ -359,12 +375,15 @@ public class Q402_PathToAHumanKnight extends Quest
htmltext = "30031-01.htm";
}
break;
-
+ }
case SIR_AARON_TANFORD:
+ {
htmltext = "30653-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -382,52 +401,59 @@ public class Q402_PathToAHumanKnight extends Quest
switch (npc.getNpcId())
{
case 20775: // Bugbear Raider
+ {
if (st.hasQuestItems(GLUDIO_GUARD_MARK_1))
{
st.dropItemsAlways(BUGBEAR_NECKLACE, 1, 10);
}
break;
-
+ }
case 27024: // Undead Priest
+ {
if (st.hasQuestItems(EINHASAD_CHURCH_MARK_1))
{
st.dropItems(EINHASAD_CRUCIFIX, 1, 12, 500000);
}
break;
-
+ }
case 20038: // Poison Spider
case 20043: // Arachnid Tracker
case 20050: // Arachnid Predator
+ {
if (st.hasQuestItems(GLUDIO_GUARD_MARK_2))
{
st.dropItemsAlways(SPIDER_LEG, 1, 20);
}
break;
-
+ }
case 20030: // Langk Lizardman
case 20027: // Langk Lizardman Scout
case 20024: // Langk Lizardman Warrior
+ {
if (st.hasQuestItems(EINHASAD_CHURCH_MARK_2))
{
st.dropItems(LIZARDMAN_TOTEM, 1, 20, 500000);
}
break;
-
+ }
case 20103: // Giant Spider
case 20106: // Talon Spider
case 20108: // Blade Spider
+ {
if (st.hasQuestItems(GLUDIO_GUARD_MARK_3))
{
st.dropItems(GIANT_SPIDER_HUSK, 1, 20, 400000);
}
break;
-
+ }
case 20404: // Silent Horror
+ {
if (st.hasQuestItems(EINHASAD_CHURCH_MARK_3))
{
st.dropItems(HORRIBLE_SKULL, 1, 10, 400000);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q403_PathToARogue/Q403_PathToARogue.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q403_PathToARogue/Q403_PathToARogue.java
index 800efdc1b2..ced966044a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q403_PathToARogue/Q403_PathToARogue.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q403_PathToARogue/Q403_PathToARogue.java
@@ -28,6 +28,9 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q403_PathToARogue extends Quest
{
+ // NPCs
+ private static final int BEZIQUE = 30379;
+ private static final int NETI = 30425;
// Items
private static final int BEZIQUE_LETTER = 1180;
private static final int NETI_BOW = 1181;
@@ -41,19 +44,12 @@ public class Q403_PathToARogue extends Quest
private static final int STOLEN_NECKLACE = 1189;
private static final int BEZIQUE_RECOMMENDATION = 1190;
- // NPCs
- private static final int BEZIQUE = 30379;
- private static final int NETI = 30425;
-
public Q403_PathToARogue()
{
super(403, "Path to a Rogue");
-
registerQuestItems(BEZIQUE_LETTER, NETI_BOW, NETI_DAGGER, SPARTOI_BONES, HORSESHOE_OF_LIGHT, MOST_WANTED_LIST, STOLEN_JEWELRY, STOLEN_TOMES, STOLEN_RING, STOLEN_NECKLACE);
-
addStartNpc(BEZIQUE);
addTalkId(BEZIQUE, NETI);
-
addKillId(20035, 20042, 20045, 20051, 20054, 20060, 27038);
}
@@ -67,35 +63,39 @@ public class Q403_PathToARogue extends Quest
return htmltext;
}
- if (event.equals("30379-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.FIGHTER)
+ case "30379-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ROGUE) ? "30379-02a.htm" : "30379-02.htm";
+ if (player.getClassId() != ClassId.FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ROGUE) ? "30379-02a.htm" : "30379-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30379-02.htm";
+ }
+ else if (st.hasQuestItems(BEZIQUE_RECOMMENDATION))
+ {
+ htmltext = "30379-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30379-06.htm":
{
- htmltext = "30379-02.htm";
+ st.startQuest();
+ st.giveItems(BEZIQUE_LETTER, 1);
+ break;
}
- else if (st.hasQuestItems(BEZIQUE_RECOMMENDATION))
+ case "30425-05.htm":
{
- htmltext = "30379-04.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(NETI_BOW, 1);
+ st.giveItems(NETI_DAGGER, 1);
+ break;
}
}
- else if (event.equals("30379-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(BEZIQUE_LETTER, 1);
- }
- else if (event.equals("30425-05.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(NETI_BOW, 1);
- st.giveItems(NETI_DAGGER, 1);
- }
return htmltext;
}
@@ -113,14 +113,17 @@ public class Q403_PathToARogue extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30379-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BEZIQUE:
+ {
if (cond == 1)
{
htmltext = "30379-07.htm";
@@ -132,7 +135,7 @@ public class Q403_PathToARogue extends Quest
else if (cond == 4)
{
htmltext = "30379-08.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HORSESHOE_OF_LIGHT, 1);
st.giveItems(MOST_WANTED_LIST, 1);
@@ -157,8 +160,9 @@ public class Q403_PathToARogue extends Quest
st.exitQuest(true);
}
break;
-
+ }
case NETI:
+ {
if (cond == 1)
{
htmltext = "30425-01.htm";
@@ -170,7 +174,7 @@ public class Q403_PathToARogue extends Quest
else if (cond == 3)
{
htmltext = "30425-07.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SPARTOI_BONES, 10);
st.giveItems(HORSESHOE_OF_LIGHT, 1);
@@ -180,8 +184,10 @@ public class Q403_PathToARogue extends Quest
htmltext = "30425-08.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -207,29 +213,33 @@ public class Q403_PathToARogue extends Quest
case 20035:
case 20045:
case 20051:
- if ((st.getInt("cond") == 2) && st.dropItems(SPARTOI_BONES, 1, 10, 200000))
+ {
+ if (st.isCond(2) && st.dropItems(SPARTOI_BONES, 1, 10, 200000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20042:
- if ((st.getInt("cond") == 2) && st.dropItems(SPARTOI_BONES, 1, 10, 300000))
+ {
+ if (st.isCond(2) && st.dropItems(SPARTOI_BONES, 1, 10, 300000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 20054:
case 20060:
- if ((st.getInt("cond") == 2) && st.dropItems(SPARTOI_BONES, 1, 10, 800000))
+ {
+ if (st.isCond(2) && st.dropItems(SPARTOI_BONES, 1, 10, 800000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 27038:
- if (st.getInt("cond") == 5)
+ {
+ if (st.isCond(5))
{
final int randomItem = Rnd.get(STOLEN_JEWELRY, STOLEN_NECKLACE);
if (!st.hasQuestItems(randomItem))
@@ -237,7 +247,7 @@ public class Q403_PathToARogue extends Quest
st.giveItems(randomItem, 1);
if (st.hasQuestItems(STOLEN_JEWELRY, STOLEN_TOMES, STOLEN_RING, STOLEN_NECKLACE))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -247,6 +257,7 @@ public class Q403_PathToARogue extends Quest
}
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q404_PathToAHumanWizard/Q404_PathToAHumanWizard.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q404_PathToAHumanWizard/Q404_PathToAHumanWizard.java
index 5bdf286cb0..10d140fabd 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q404_PathToAHumanWizard/Q404_PathToAHumanWizard.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q404_PathToAHumanWizard/Q404_PathToAHumanWizard.java
@@ -26,6 +26,13 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q404_PathToAHumanWizard extends Quest
{
+ // NPCs
+ private static final int PARINA = 30391;
+ private static final int EARTH_SNAKE = 30409;
+ private static final int WASTELAND_LIZARDMAN = 30410;
+ private static final int FLAME_SALAMANDER = 30411;
+ private static final int WIND_SYLPH = 30412;
+ private static final int WATER_UNDINE = 30413;
// Items
private static final int MAP_OF_LUSTER = 1280;
private static final int KEY_OF_FLAME = 1281;
@@ -41,23 +48,12 @@ public class Q404_PathToAHumanWizard extends Quest
private static final int EARTH_RING = 1291;
private static final int BEAD_OF_SEASON = 1292;
- // NPCs
- private static final int PARINA = 30391;
- private static final int EARTH_SNAKE = 30409;
- private static final int WASTELAND_LIZARDMAN = 30410;
- private static final int FLAME_SALAMANDER = 30411;
- private static final int WIND_SYLPH = 30412;
- private static final int WATER_UNDINE = 30413;
-
public Q404_PathToAHumanWizard()
{
super(404, "Path to a Human Wizard");
-
registerQuestItems(MAP_OF_LUSTER, KEY_OF_FLAME, FLAME_EARING, BROKEN_BRONZE_MIRROR, WIND_FEATHER, WIND_BANGEL, RAMA_DIARY, SPARKLE_PEBBLE, WATER_NECKLACE, RUST_GOLD_COIN, RED_SOIL, EARTH_RING);
-
addStartNpc(PARINA);
addTalkId(PARINA, EARTH_SNAKE, WASTELAND_LIZARDMAN, FLAME_SALAMANDER, WIND_SYLPH, WATER_UNDINE);
-
addKillId(20021, 20359, 27030);
}
@@ -73,13 +69,11 @@ public class Q404_PathToAHumanWizard extends Quest
if (event.equals("30391-08.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("30410-03.htm"))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BROKEN_BRONZE_MIRROR, 1);
st.giveItems(WIND_FEATHER, 1);
@@ -98,10 +92,11 @@ public class Q404_PathToAHumanWizard extends Quest
return htmltext;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId() != ClassId.MAGE)
{
htmltext = (player.getClassId() == ClassId.WIZARD) ? "30391-02a.htm" : "30391-01.htm";
@@ -119,11 +114,13 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30391-04.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case PARINA:
+ {
if (cond < 13)
{
htmltext = "30391-05.htm";
@@ -142,12 +139,13 @@ public class Q404_PathToAHumanWizard extends Quest
st.exitQuest(true);
}
break;
-
+ }
case FLAME_SALAMANDER:
+ {
if (cond == 1)
{
htmltext = "30411-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(MAP_OF_LUSTER, 1);
}
@@ -158,7 +156,7 @@ public class Q404_PathToAHumanWizard extends Quest
else if (cond == 3)
{
htmltext = "30411-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KEY_OF_FLAME, 1);
st.takeItems(MAP_OF_LUSTER, 1);
@@ -169,12 +167,13 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30411-04.htm";
}
break;
-
+ }
case WIND_SYLPH:
+ {
if (cond == 4)
{
htmltext = "30412-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(BROKEN_BRONZE_MIRROR, 1);
}
@@ -185,7 +184,7 @@ public class Q404_PathToAHumanWizard extends Quest
else if (cond == 6)
{
htmltext = "30412-03.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(WIND_FEATHER, 1);
st.giveItems(WIND_BANGEL, 1);
@@ -195,8 +194,9 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30412-04.htm";
}
break;
-
+ }
case WASTELAND_LIZARDMAN:
+ {
if (cond == 5)
{
htmltext = "30410-01.htm";
@@ -206,12 +206,13 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30410-04.htm";
}
break;
-
+ }
case WATER_UNDINE:
+ {
if (cond == 7)
{
htmltext = "30413-01.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(RAMA_DIARY, 1);
}
@@ -222,7 +223,7 @@ public class Q404_PathToAHumanWizard extends Quest
else if (cond == 9)
{
htmltext = "30413-03.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RAMA_DIARY, 1);
st.takeItems(SPARKLE_PEBBLE, -1);
@@ -233,12 +234,13 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30413-04.htm";
}
break;
-
+ }
case EARTH_SNAKE:
+ {
if (cond == 10)
{
htmltext = "30409-01.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(RUST_GOLD_COIN, 1);
}
@@ -249,7 +251,7 @@ public class Q404_PathToAHumanWizard extends Quest
else if (cond == 12)
{
htmltext = "30409-03.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RED_SOIL, 1);
st.takeItems(RUST_GOLD_COIN, 1);
@@ -260,8 +262,10 @@ public class Q404_PathToAHumanWizard extends Quest
htmltext = "30409-04.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -279,25 +283,29 @@ public class Q404_PathToAHumanWizard extends Quest
switch (npc.getNpcId())
{
case 20359: // Ratman Warrior
- if ((st.getInt("cond") == 2) && st.dropItems(KEY_OF_FLAME, 1, 1, 800000))
+ {
+ if (st.isCond(2) && st.dropItems(KEY_OF_FLAME, 1, 1, 800000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
break;
-
+ }
case 27030: // Water Seer
- if ((st.getInt("cond") == 8) && st.dropItems(SPARKLE_PEBBLE, 1, 2, 800000))
+ {
+ if (st.isCond(8) && st.dropItems(SPARKLE_PEBBLE, 1, 2, 800000))
{
- st.set("cond", "9");
+ st.setCond(9);
}
break;
-
+ }
case 20021: // Red Bear
- if ((st.getInt("cond") == 11) && st.dropItems(RED_SOIL, 1, 1, 200000))
+ {
+ if (st.isCond(11) && st.dropItems(RED_SOIL, 1, 1, 200000))
{
- st.set("cond", "12");
+ st.setCond(12);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q405_PathToACleric/Q405_PathToACleric.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q405_PathToACleric/Q405_PathToACleric.java
index bbf39e4eaf..243e4e3236 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q405_PathToACleric/Q405_PathToACleric.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q405_PathToACleric/Q405_PathToACleric.java
@@ -26,6 +26,13 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q405_PathToACleric extends Quest
{
+ // NPCs
+ private static final int GALLINT = 30017;
+ private static final int ZIGAUNT = 30022;
+ private static final int VIVYAN = 30030;
+ private static final int PRAGA = 30333;
+ private static final int SIMPLON = 30253;
+ private static final int LIONEL = 30408;
// Items
private static final int LETTER_OF_ORDER_1 = 1191;
private static final int LETTER_OF_ORDER_2 = 1192;
@@ -37,27 +44,15 @@ public class Q405_PathToACleric extends Quest
private static final int PENDANT_OF_MOTHER = 1198;
private static final int NECKLACE_OF_MOTHER = 1199;
private static final int LIONEL_COVENANT = 1200;
-
- // NPCs
- private static final int GALLINT = 30017;
- private static final int ZIGAUNT = 30022;
- private static final int VIVYAN = 30030;
- private static final int PRAGA = 30333;
- private static final int SIMPLON = 30253;
- private static final int LIONEL = 30408;
-
// Reward
private static final int MARK_OF_FATE = 1201;
public Q405_PathToACleric()
{
super(405, "Path to a Cleric");
-
registerQuestItems(LETTER_OF_ORDER_1, BOOK_OF_SIMPLON, BOOK_OF_PRAGA, BOOK_OF_VIVYAN, NECKLACE_OF_MOTHER, PENDANT_OF_MOTHER, LETTER_OF_ORDER_2, LIONEL_BOOK, CERTIFICATE_OF_GALLINT, LIONEL_COVENANT);
-
addStartNpc(ZIGAUNT);
addTalkId(ZIGAUNT, SIMPLON, PRAGA, VIVYAN, LIONEL, GALLINT);
-
addKillId(20029, 20026);
}
@@ -73,9 +68,7 @@ public class Q405_PathToACleric extends Quest
if (event.equals("30022-05.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(LETTER_OF_ORDER_1, 1);
}
@@ -95,6 +88,7 @@ public class Q405_PathToACleric extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId() != ClassId.MAGE)
{
htmltext = (player.getClassId() == ClassId.CLERIC) ? "30022-02a.htm" : "30022-02.htm";
@@ -112,12 +106,14 @@ public class Q405_PathToACleric extends Quest
htmltext = "30022-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ZIGAUNT:
+ {
if (cond == 1)
{
htmltext = "30022-06.htm";
@@ -125,7 +121,7 @@ public class Q405_PathToACleric extends Quest
else if (cond == 2)
{
htmltext = "30022-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BOOK_OF_PRAGA, 1);
st.takeItems(BOOK_OF_VIVYAN, 1);
@@ -149,8 +145,9 @@ public class Q405_PathToACleric extends Quest
st.exitQuest(true);
}
break;
-
+ }
case SIMPLON:
+ {
if ((cond == 1) && !st.hasQuestItems(BOOK_OF_SIMPLON))
{
htmltext = "30253-01.htm";
@@ -162,8 +159,9 @@ public class Q405_PathToACleric extends Quest
htmltext = "30253-02.htm";
}
break;
-
+ }
case PRAGA:
+ {
if (cond == 1)
{
if (!st.hasQuestItems(BOOK_OF_PRAGA) && !st.hasQuestItems(NECKLACE_OF_MOTHER) && st.hasQuestItems(BOOK_OF_SIMPLON))
@@ -185,7 +183,7 @@ public class Q405_PathToACleric extends Quest
if (st.hasQuestItems(BOOK_OF_VIVYAN))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -199,8 +197,9 @@ public class Q405_PathToACleric extends Quest
htmltext = "30333-04.htm";
}
break;
-
+ }
case VIVYAN:
+ {
if ((cond == 1) && !st.hasQuestItems(BOOK_OF_VIVYAN) && st.hasQuestItems(BOOK_OF_SIMPLON))
{
htmltext = "30030-01.htm";
@@ -208,7 +207,7 @@ public class Q405_PathToACleric extends Quest
if (st.hasQuestItems(BOOK_OF_PRAGA))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -221,8 +220,9 @@ public class Q405_PathToACleric extends Quest
htmltext = "30030-02.htm";
}
break;
-
+ }
case LIONEL:
+ {
if (cond < 3)
{
htmltext = "30408-02.htm";
@@ -230,7 +230,7 @@ public class Q405_PathToACleric extends Quest
else if (cond == 3)
{
htmltext = "30408-01.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LIONEL_BOOK, 1);
}
@@ -241,7 +241,7 @@ public class Q405_PathToACleric extends Quest
else if (cond == 5)
{
htmltext = "30408-04.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(CERTIFICATE_OF_GALLINT, 1);
st.giveItems(LIONEL_COVENANT, 1);
@@ -251,12 +251,13 @@ public class Q405_PathToACleric extends Quest
htmltext = "30408-05.htm";
}
break;
-
+ }
case GALLINT:
+ {
if (cond == 4)
{
htmltext = "30017-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LIONEL_BOOK, 1);
st.giveItems(CERTIFICATE_OF_GALLINT, 1);
@@ -266,8 +267,10 @@ public class Q405_PathToACleric extends Quest
htmltext = "30017-02.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -276,7 +279,7 @@ public class Q405_PathToACleric extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q406_PathToAnElvenKnight/Q406_PathToAnElvenKnight.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q406_PathToAnElvenKnight/Q406_PathToAnElvenKnight.java
index bab071b340..f7545930f6 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q406_PathToAnElvenKnight/Q406_PathToAnElvenKnight.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q406_PathToAnElvenKnight/Q406_PathToAnElvenKnight.java
@@ -26,6 +26,9 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q406_PathToAnElvenKnight extends Quest
{
+ // NPCs
+ private static final int SORIUS = 30327;
+ private static final int KLUTO = 30317;
// Items
private static final int SORIUS_LETTER = 1202;
private static final int KLUTO_BOX = 1203;
@@ -34,19 +37,12 @@ public class Q406_PathToAnElvenKnight extends Quest
private static final int EMERALD_PIECE = 1206;
private static final int KLUTO_MEMO = 1276;
- // NPCs
- private static final int SORIUS = 30327;
- private static final int KLUTO = 30317;
-
public Q406_PathToAnElvenKnight()
{
super(406, "Path to an Elven Knight");
-
registerQuestItems(SORIUS_LETTER, KLUTO_BOX, TOPAZ_PIECE, EMERALD_PIECE, KLUTO_MEMO);
-
addStartNpc(SORIUS);
addTalkId(SORIUS, KLUTO);
-
addKillId(20035, 20042, 20045, 20051, 20054, 20060, 20782);
}
@@ -60,34 +56,38 @@ public class Q406_PathToAnElvenKnight extends Quest
return htmltext;
}
- if (event.equals("30327-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.ELVEN_FIGHTER)
+ case "30327-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ELVEN_KNIGHT) ? "30327-02a.htm" : "30327-02.htm";
+ if (player.getClassId() != ClassId.ELVEN_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ELVEN_KNIGHT) ? "30327-02a.htm" : "30327-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30327-03.htm";
+ }
+ else if (st.hasQuestItems(ELVEN_KNIGHT_BROOCH))
+ {
+ htmltext = "30327-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30327-06.htm":
{
- htmltext = "30327-03.htm";
+ st.startQuest();
+ break;
}
- else if (st.hasQuestItems(ELVEN_KNIGHT_BROOCH))
+ case "30317-02.htm":
{
- htmltext = "30327-04.htm";
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SORIUS_LETTER, 1);
+ st.giveItems(KLUTO_MEMO, 1);
+ break;
}
}
- else if (event.equals("30327-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30317-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SORIUS_LETTER, 1);
- st.giveItems(KLUTO_MEMO, 1);
- }
return htmltext;
}
@@ -105,14 +105,17 @@ public class Q406_PathToAnElvenKnight extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30327-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SORIUS:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(TOPAZ_PIECE)) ? "30327-07.htm" : "30327-08.htm";
@@ -120,7 +123,7 @@ public class Q406_PathToAnElvenKnight extends Quest
else if (cond == 2)
{
htmltext = "30327-09.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SORIUS_LETTER, 1);
}
@@ -140,8 +143,9 @@ public class Q406_PathToAnElvenKnight extends Quest
st.exitQuest(true);
}
break;
-
+ }
case KLUTO:
+ {
if (cond == 3)
{
htmltext = "30317-01.htm";
@@ -153,7 +157,7 @@ public class Q406_PathToAnElvenKnight extends Quest
else if (cond == 5)
{
htmltext = "30317-05.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(EMERALD_PIECE, -1);
st.takeItems(TOPAZ_PIECE, -1);
@@ -164,8 +168,10 @@ public class Q406_PathToAnElvenKnight extends Quest
htmltext = "30317-06.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -188,18 +194,21 @@ public class Q406_PathToAnElvenKnight extends Quest
case 20051:
case 20054:
case 20060:
- if ((st.getInt("cond") == 1) && st.dropItems(TOPAZ_PIECE, 1, 20, 700000))
+ {
+ if (st.isCond(1) && st.dropItems(TOPAZ_PIECE, 1, 20, 700000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20782:
- if ((st.getInt("cond") == 4) && st.dropItems(EMERALD_PIECE, 1, 20, 500000))
+ {
+ if (st.isCond(4) && st.dropItems(EMERALD_PIECE, 1, 20, 500000))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q407_PathToAnElvenScout/Q407_PathToAnElvenScout.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q407_PathToAnElvenScout/Q407_PathToAnElvenScout.java
index 80533f1c06..9348342b8b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q407_PathToAnElvenScout/Q407_PathToAnElvenScout.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q407_PathToAnElvenScout/Q407_PathToAnElvenScout.java
@@ -26,6 +26,11 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q407_PathToAnElvenScout extends Quest
{
+ // NPCs
+ private static final int REISA = 30328;
+ private static final int BABENCO = 30334;
+ private static final int MORETTI = 30337;
+ private static final int PRIAS = 30426;
// Items
private static final int REISA_LETTER = 1207;
private static final int PRIAS_TORN_LETTER_1 = 1208;
@@ -39,21 +44,12 @@ public class Q407_PathToAnElvenScout extends Quest
private static final int REISA_RECOMMENDATION = 1217;
private static final int RUSTED_KEY = 1293;
- // NPCs
- private static final int REISA = 30328;
- private static final int BABENCO = 30334;
- private static final int MORETTI = 30337;
- private static final int PRIAS = 30426;
-
public Q407_PathToAnElvenScout()
{
super(407, "Path to an Elven Scout");
-
registerQuestItems(REISA_LETTER, PRIAS_TORN_LETTER_1, PRIAS_TORN_LETTER_2, PRIAS_TORN_LETTER_3, PRIAS_TORN_LETTER_4, MORETTI_HERB, MORETTI_LETTER, PRIAS_LETTER, HONORARY_GUARD, RUSTED_KEY);
-
addStartNpc(REISA);
addTalkId(REISA, MORETTI, BABENCO, PRIAS);
-
addKillId(20053, 27031);
}
@@ -83,15 +79,13 @@ public class Q407_PathToAnElvenScout extends Quest
}
else
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.giveItems(REISA_LETTER, 1);
}
}
else if (event.equals("30337-03.htm"))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(REISA_LETTER, -1);
}
@@ -112,14 +106,17 @@ public class Q407_PathToAnElvenScout extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30328-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case REISA:
+ {
if (cond == 1)
{
htmltext = "30328-06.htm";
@@ -139,8 +136,9 @@ public class Q407_PathToAnElvenScout extends Quest
st.exitQuest(true);
}
break;
-
+ }
case MORETTI:
+ {
if (cond == 1)
{
htmltext = "30337-01.htm";
@@ -152,7 +150,7 @@ public class Q407_PathToAnElvenScout extends Quest
else if (cond == 3)
{
htmltext = "30337-06.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PRIAS_TORN_LETTER_1, -1);
st.takeItems(PRIAS_TORN_LETTER_2, -1);
@@ -168,7 +166,7 @@ public class Q407_PathToAnElvenScout extends Quest
else if ((cond == 7) && st.hasQuestItems(PRIAS_LETTER))
{
htmltext = "30337-07.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(PRIAS_LETTER, -1);
st.giveItems(HONORARY_GUARD, 1);
@@ -178,19 +176,21 @@ public class Q407_PathToAnElvenScout extends Quest
htmltext = "30337-08.htm";
}
break;
-
+ }
case BABENCO:
+ {
if (cond == 2)
{
htmltext = "30334-01.htm";
}
break;
-
+ }
case PRIAS:
+ {
if (cond == 4)
{
htmltext = "30426-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 5)
@@ -200,7 +200,7 @@ public class Q407_PathToAnElvenScout extends Quest
else if (cond == 6)
{
htmltext = "30426-02.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RUSTED_KEY, -1);
st.takeItems(MORETTI_HERB, -1);
@@ -212,8 +212,10 @@ public class Q407_PathToAnElvenScout extends Quest
htmltext = "30426-04.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -228,7 +230,7 @@ public class Q407_PathToAnElvenScout extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (npc.getNpcId() == 20053)
{
if (cond == 2)
@@ -250,7 +252,7 @@ public class Q407_PathToAnElvenScout extends Quest
}
else if (!st.hasQuestItems(PRIAS_TORN_LETTER_4))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(PRIAS_TORN_LETTER_4, 1);
}
@@ -258,7 +260,7 @@ public class Q407_PathToAnElvenScout extends Quest
}
else if (((cond == 4) || (cond == 5)) && st.dropItems(RUSTED_KEY, 1, 1, 600000))
{
- st.set("cond", "6");
+ st.setCond(6);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q408_PathToAnElvenWizard/Q408_PathToAnElvenWizard.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q408_PathToAnElvenWizard/Q408_PathToAnElvenWizard.java
index 3f9658f669..f14c552c2d 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q408_PathToAnElvenWizard/Q408_PathToAnElvenWizard.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q408_PathToAnElvenWizard/Q408_PathToAnElvenWizard.java
@@ -26,6 +26,11 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q408_PathToAnElvenWizard extends Quest
{
+ // NPCs
+ private static final int ROSELLA = 30414;
+ private static final int GREENIS = 30157;
+ private static final int THALIA = 30371;
+ private static final int NORTHWIND = 30423;
// Items
private static final int ROSELLA_LETTER = 1218;
private static final int RED_DOWN = 1219;
@@ -42,21 +47,12 @@ public class Q408_PathToAnElvenWizard extends Quest
private static final int SAP_OF_THE_MOTHER_TREE = 1273;
private static final int LUCKY_POTPOURRI = 1274;
- // NPCs
- private static final int ROSELLA = 30414;
- private static final int GREENIS = 30157;
- private static final int THALIA = 30371;
- private static final int NORTHWIND = 30423;
-
public Q408_PathToAnElvenWizard()
{
super(408, "Path to an Elven Wizard");
-
registerQuestItems(ROSELLA_LETTER, RED_DOWN, MAGICAL_POWERS_RUBY, PURE_AQUAMARINE, APPETIZING_APPLE, GOLD_LEAVES, IMMORTAL_LOVE, AMETHYST, NOBILITY_AMETHYST, FERTILITY_PERIDOT, CHARM_OF_GRAIN, SAP_OF_THE_MOTHER_TREE, LUCKY_POTPOURRI);
-
addStartNpc(ROSELLA);
addTalkId(ROSELLA, GREENIS, THALIA, NORTHWIND);
-
addKillId(20047, 20019, 20466);
}
@@ -70,75 +66,82 @@ public class Q408_PathToAnElvenWizard extends Quest
return htmltext;
}
- if (event.equals("30414-06.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.ELVEN_MAGE)
+ case "30414-06.htm":
{
- htmltext = (player.getClassId() == ClassId.ELVEN_WIZARD) ? "30414-02a.htm" : "30414-03.htm";
+ if (player.getClassId() != ClassId.ELVEN_MAGE)
+ {
+ htmltext = (player.getClassId() == ClassId.ELVEN_WIZARD) ? "30414-02a.htm" : "30414-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30414-04.htm";
+ }
+ else if (st.hasQuestItems(ETERNITY_DIAMOND))
+ {
+ htmltext = "30414-05.htm";
+ }
+ else
+ {
+ st.startQuest();
+ st.giveItems(FERTILITY_PERIDOT, 1);
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30414-07.htm":
{
- htmltext = "30414-04.htm";
+ if (!st.hasQuestItems(MAGICAL_POWERS_RUBY))
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(ROSELLA_LETTER, 1);
+ }
+ else
+ {
+ htmltext = "30414-10.htm";
+ }
+ break;
}
- else if (st.hasQuestItems(ETERNITY_DIAMOND))
+ case "30414-14.htm":
{
- htmltext = "30414-05.htm";
+ if (!st.hasQuestItems(PURE_AQUAMARINE))
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(APPETIZING_APPLE, 1);
+ }
+ else
+ {
+ htmltext = "30414-13.htm";
+ }
+ break;
}
- else
+ case "30414-18.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(FERTILITY_PERIDOT, 1);
+ if (!st.hasQuestItems(NOBILITY_AMETHYST))
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(IMMORTAL_LOVE, 1);
+ }
+ else
+ {
+ htmltext = "30414-17.htm";
+ }
+ break;
}
- }
- else if (event.equals("30414-07.htm"))
- {
- if (!st.hasQuestItems(MAGICAL_POWERS_RUBY))
+ case "30157-02.htm":
{
st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(ROSELLA_LETTER, 1);
+ st.takeItems(ROSELLA_LETTER, 1);
+ st.giveItems(CHARM_OF_GRAIN, 1);
+ break;
}
- else
- {
- htmltext = "30414-10.htm";
- }
- }
- else if (event.equals("30414-14.htm"))
- {
- if (!st.hasQuestItems(PURE_AQUAMARINE))
+ case "30371-02.htm":
{
st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(APPETIZING_APPLE, 1);
+ st.takeItems(APPETIZING_APPLE, 1);
+ st.giveItems(SAP_OF_THE_MOTHER_TREE, 1);
+ break;
}
- else
- {
- htmltext = "30414-13.htm";
- }
- }
- else if (event.equals("30414-18.htm"))
- {
- if (!st.hasQuestItems(NOBILITY_AMETHYST))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(IMMORTAL_LOVE, 1);
- }
- else
- {
- htmltext = "30414-17.htm";
- }
- }
- else if (event.equals("30157-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROSELLA_LETTER, 1);
- st.giveItems(CHARM_OF_GRAIN, 1);
- }
- else if (event.equals("30371-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(APPETIZING_APPLE, 1);
- st.giveItems(SAP_OF_THE_MOTHER_TREE, 1);
}
return htmltext;
@@ -157,13 +160,16 @@ public class Q408_PathToAnElvenWizard extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30414-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case ROSELLA:
+ {
if (st.hasQuestItems(MAGICAL_POWERS_RUBY, NOBILITY_AMETHYST, PURE_AQUAMARINE))
{
htmltext = "30414-24.htm";
@@ -227,8 +233,9 @@ public class Q408_PathToAnElvenWizard extends Quest
htmltext = "30414-11.htm";
}
break;
-
+ }
case GREENIS:
+ {
if (st.hasQuestItems(ROSELLA_LETTER))
{
htmltext = "30157-01.htm";
@@ -246,8 +253,9 @@ public class Q408_PathToAnElvenWizard extends Quest
htmltext = "30157-03.htm";
}
break;
-
+ }
case THALIA:
+ {
if (st.hasQuestItems(APPETIZING_APPLE))
{
htmltext = "30371-01.htm";
@@ -265,8 +273,9 @@ public class Q408_PathToAnElvenWizard extends Quest
htmltext = "30371-03.htm";
}
break;
-
+ }
case NORTHWIND:
+ {
if (st.hasQuestItems(IMMORTAL_LOVE))
{
htmltext = "30423-01.htm";
@@ -287,8 +296,10 @@ public class Q408_PathToAnElvenWizard extends Quest
htmltext = "30423-02.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -306,25 +317,29 @@ public class Q408_PathToAnElvenWizard extends Quest
switch (npc.getNpcId())
{
case 20019:
+ {
if (st.hasQuestItems(SAP_OF_THE_MOTHER_TREE))
{
st.dropItems(GOLD_LEAVES, 1, 5, 400000);
}
break;
-
+ }
case 20047:
+ {
if (st.hasQuestItems(LUCKY_POTPOURRI))
{
st.dropItems(AMETHYST, 1, 2, 400000);
}
break;
-
+ }
case 20466:
+ {
if (st.hasQuestItems(CHARM_OF_GRAIN))
{
st.dropItems(RED_DOWN, 1, 5, 700000);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q409_PathToAnElvenOracle/Q409_PathToAnElvenOracle.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q409_PathToAnElvenOracle/Q409_PathToAnElvenOracle.java
index ffad6c7b37..fa3f153d48 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q409_PathToAnElvenOracle/Q409_PathToAnElvenOracle.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q409_PathToAnElvenOracle/Q409_PathToAnElvenOracle.java
@@ -26,6 +26,10 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q409_PathToAnElvenOracle extends Quest
{
+ // NPCs
+ private static final int MANUEL = 30293;
+ private static final int ALLANA = 30424;
+ private static final int PERRIN = 30428;
// Items
private static final int CRYSTAL_MEDALLION = 1231;
private static final int SWINDLER_MONEY = 1232;
@@ -35,20 +39,12 @@ public class Q409_PathToAnElvenOracle extends Quest
private static final int HALF_OF_DIARY = 1236;
private static final int TAMIL_NECKLACE = 1275;
- // NPCs
- private static final int MANUEL = 30293;
- private static final int ALLANA = 30424;
- private static final int PERRIN = 30428;
-
public Q409_PathToAnElvenOracle()
{
super(409, "Path to an Elven Oracle");
-
registerQuestItems(CRYSTAL_MEDALLION, SWINDLER_MONEY, ALLANA_DIARY, LIZARD_CAPTAIN_ORDER, HALF_OF_DIARY, TAMIL_NECKLACE);
-
addStartNpc(MANUEL);
addTalkId(MANUEL, ALLANA, PERRIN);
-
addKillId(27032, 27033, 27034, 27035);
}
@@ -62,25 +58,28 @@ public class Q409_PathToAnElvenOracle extends Quest
return htmltext;
}
- if (event.equals("30293-05.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(CRYSTAL_MEDALLION, 1);
- }
- else if (event.equals("spawn_lizards"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- addSpawn(27032, -92319, 154235, -3284, 2000, false, 0);
- addSpawn(27033, -92361, 154190, -3284, 2000, false, 0);
- addSpawn(27034, -92375, 154278, -3278, 2000, false, 0);
- return null;
- }
- else if (event.equals("30428-06.htm"))
- {
- addSpawn(27035, -93194, 147587, -2672, 2000, false, 0);
+ case "30293-05.htm":
+ {
+ st.startQuest();
+ st.giveItems(CRYSTAL_MEDALLION, 1);
+ break;
+ }
+ case "spawn_lizards":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ addSpawn(27032, -92319, 154235, -3284, 2000, false, 0);
+ addSpawn(27033, -92361, 154190, -3284, 2000, false, 0);
+ addSpawn(27034, -92375, 154278, -3278, 2000, false, 0);
+ return null;
+ }
+ case "30428-06.htm":
+ {
+ addSpawn(27035, -93194, 147587, -2672, 2000, false, 0);
+ break;
+ }
}
return htmltext;
@@ -99,6 +98,7 @@ public class Q409_PathToAnElvenOracle extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClassId() != ClassId.ELVEN_MAGE)
{
htmltext = (player.getClassId() == ClassId.ORACLE) ? "30293-02a.htm" : "30293-02.htm";
@@ -116,12 +116,14 @@ public class Q409_PathToAnElvenOracle extends Quest
htmltext = "30293-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case MANUEL:
+ {
if (cond == 1)
{
htmltext = "30293-06.htm";
@@ -148,8 +150,9 @@ public class Q409_PathToAnElvenOracle extends Quest
st.exitQuest(true);
}
break;
-
+ }
case ALLANA:
+ {
if (cond == 1)
{
htmltext = "30424-01.htm";
@@ -157,7 +160,7 @@ public class Q409_PathToAnElvenOracle extends Quest
else if (cond == 3)
{
htmltext = "30424-02.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HALF_OF_DIARY, 1);
}
@@ -172,7 +175,7 @@ public class Q409_PathToAnElvenOracle extends Quest
else if (cond == 6)
{
htmltext = "30424-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HALF_OF_DIARY, -1);
st.giveItems(ALLANA_DIARY, 1);
@@ -182,8 +185,9 @@ public class Q409_PathToAnElvenOracle extends Quest
htmltext = "30424-05.htm";
}
break;
-
+ }
case PERRIN:
+ {
if (cond == 4)
{
htmltext = "30428-01.htm";
@@ -191,7 +195,7 @@ public class Q409_PathToAnElvenOracle extends Quest
else if (cond == 5)
{
htmltext = "30428-04.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TAMIL_NECKLACE, -1);
st.giveItems(SWINDLER_MONEY, 1);
@@ -201,8 +205,10 @@ public class Q409_PathToAnElvenOracle extends Quest
htmltext = "30428-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -219,16 +225,16 @@ public class Q409_PathToAnElvenOracle extends Quest
if (npc.getNpcId() == 27035)
{
- if (st.getInt("cond") == 4)
+ if (st.isCond(4))
{
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(TAMIL_NECKLACE, 1);
}
}
- else if (st.getInt("cond") == 2)
+ else if (st.isCond(2))
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(LIZARD_CAPTAIN_ORDER, 1);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q410_PathToAPalusKnight/Q410_PathToAPalusKnight.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q410_PathToAPalusKnight/Q410_PathToAPalusKnight.java
index 64e404a463..95f1760940 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q410_PathToAPalusKnight/Q410_PathToAPalusKnight.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q410_PathToAPalusKnight/Q410_PathToAPalusKnight.java
@@ -26,6 +26,13 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q410_PathToAPalusKnight extends Quest
{
+ // NPCs
+ private static final int KALINTA = 30422;
+ private static final int VIRGIL = 30329;
+ // Monsters
+ private static final int POISON_SPIDER = 20038;
+ private static final int ARACHNID_TRACKER = 20043;
+ private static final int LYCANTHROPE = 20049;
// Items
private static final int PALUS_TALISMAN = 1237;
private static final int LYCANTHROPE_SKULL = 1238;
@@ -36,24 +43,12 @@ public class Q410_PathToAPalusKnight extends Quest
private static final int COFFIN_OF_ETERNAL_REST = 1243;
private static final int GAZE_OF_ABYSS = 1244;
- // NPCs
- private static final int KALINTA = 30422;
- private static final int VIRGIL = 30329;
-
- // Monsters
- private static final int POISON_SPIDER = 20038;
- private static final int ARACHNID_TRACKER = 20043;
- private static final int LYCANTHROPE = 20049;
-
public Q410_PathToAPalusKnight()
{
super(410, "Path to a Palus Knight");
-
registerQuestItems(PALUS_TALISMAN, LYCANTHROPE_SKULL, VIRGIL_LETTER, MORTE_TALISMAN, PREDATOR_CARAPACE, ARACHNID_TRACKER_SILK, COFFIN_OF_ETERNAL_REST);
-
addStartNpc(VIRGIL);
addTalkId(VIRGIL, KALINTA);
-
addKillId(POISON_SPIDER, ARACHNID_TRACKER, LYCANTHROPE);
}
@@ -67,51 +62,57 @@ public class Q410_PathToAPalusKnight extends Quest
return htmltext;
}
- if (event.equals("30329-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DARK_FIGHTER)
+ case "30329-05.htm":
{
- htmltext = (player.getClassId() == ClassId.PALUS_KNIGHT) ? "30329-02a.htm" : "30329-03.htm";
+ if (player.getClassId() != ClassId.DARK_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.PALUS_KNIGHT) ? "30329-02a.htm" : "30329-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30329-02.htm";
+ }
+ else if (st.hasQuestItems(GAZE_OF_ABYSS))
+ {
+ htmltext = "30329-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30329-06.htm":
{
- htmltext = "30329-02.htm";
+ st.startQuest();
+ st.giveItems(PALUS_TALISMAN, 1);
+ break;
}
- else if (st.hasQuestItems(GAZE_OF_ABYSS))
+ case "30329-10.htm":
{
- htmltext = "30329-04.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(LYCANTHROPE_SKULL, -1);
+ st.takeItems(PALUS_TALISMAN, 1);
+ st.giveItems(VIRGIL_LETTER, 1);
+ break;
+ }
+ case "30422-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VIRGIL_LETTER, 1);
+ st.giveItems(MORTE_TALISMAN, 1);
+ break;
+ }
+ case "30422-06.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARACHNID_TRACKER_SILK, -1);
+ st.takeItems(MORTE_TALISMAN, 1);
+ st.takeItems(PREDATOR_CARAPACE, -1);
+ st.giveItems(COFFIN_OF_ETERNAL_REST, 1);
+ break;
}
- }
- else if (event.equals("30329-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(PALUS_TALISMAN, 1);
- }
- else if (event.equals("30329-10.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(LYCANTHROPE_SKULL, -1);
- st.takeItems(PALUS_TALISMAN, 1);
- st.giveItems(VIRGIL_LETTER, 1);
- }
- else if (event.equals("30422-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VIRGIL_LETTER, 1);
- st.giveItems(MORTE_TALISMAN, 1);
- }
- else if (event.equals("30422-06.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARACHNID_TRACKER_SILK, -1);
- st.takeItems(MORTE_TALISMAN, 1);
- st.takeItems(PREDATOR_CARAPACE, -1);
- st.giveItems(COFFIN_OF_ETERNAL_REST, 1);
}
return htmltext;
@@ -130,14 +131,17 @@ public class Q410_PathToAPalusKnight extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30329-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case VIRGIL:
+ {
if (cond == 1)
{
htmltext = (!st.hasQuestItems(LYCANTHROPE_SKULL)) ? "30329-07.htm" : "30329-08.htm";
@@ -161,8 +165,9 @@ public class Q410_PathToAPalusKnight extends Quest
st.exitQuest(true);
}
break;
-
+ }
case KALINTA:
+ {
if (cond == 3)
{
htmltext = "30422-01.htm";
@@ -187,8 +192,10 @@ public class Q410_PathToAPalusKnight extends Quest
htmltext = "30422-06.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -206,25 +213,29 @@ public class Q410_PathToAPalusKnight extends Quest
switch (npc.getNpcId())
{
case LYCANTHROPE:
- if ((st.getInt("cond") == 1) && st.dropItemsAlways(LYCANTHROPE_SKULL, 1, 13))
+ {
+ if (st.isCond(1) && st.dropItemsAlways(LYCANTHROPE_SKULL, 1, 13))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case ARACHNID_TRACKER:
- if ((st.getInt("cond") == 4) && st.dropItemsAlways(ARACHNID_TRACKER_SILK, 1, 5) && st.hasQuestItems(PREDATOR_CARAPACE))
+ {
+ if (st.isCond(4) && st.dropItemsAlways(ARACHNID_TRACKER_SILK, 1, 5) && st.hasQuestItems(PREDATOR_CARAPACE))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
-
+ }
case POISON_SPIDER:
- if ((st.getInt("cond") == 4) && st.dropItemsAlways(PREDATOR_CARAPACE, 1, 1) && (st.getQuestItemsCount(ARACHNID_TRACKER_SILK) == 5))
+ {
+ if (st.isCond(4) && st.dropItemsAlways(PREDATOR_CARAPACE, 1, 1) && (st.getQuestItemsCount(ARACHNID_TRACKER_SILK) == 5))
{
- st.set("cond", "5");
+ st.setCond(5);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q411_PathToAnAssassin/Q411_PathToAnAssassin.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q411_PathToAnAssassin/Q411_PathToAnAssassin.java
index ae8e69c1e6..fbcc0fd217 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q411_PathToAnAssassin/Q411_PathToAnAssassin.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q411_PathToAnAssassin/Q411_PathToAnAssassin.java
@@ -26,6 +26,10 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q411_PathToAnAssassin extends Quest
{
+ // NPCs
+ private static final int TRISKEL = 30416;
+ private static final int ARKENIA = 30419;
+ private static final int LEIKAN = 30382;
// Items
private static final int SHILEN_CALL = 1245;
private static final int ARKENIA_LETTER = 1246;
@@ -35,20 +39,12 @@ public class Q411_PathToAnAssassin extends Quest
private static final int ARKENIA_RECOMMENDATION = 1251;
private static final int IRON_HEART = 1252;
- // NPCs
- private static final int TRISKEL = 30416;
- private static final int ARKENIA = 30419;
- private static final int LEIKAN = 30382;
-
public Q411_PathToAnAssassin()
{
super(411, "Path to an Assassin");
-
registerQuestItems(SHILEN_CALL, ARKENIA_LETTER, LEIKAN_NOTE, MOONSTONE_BEAST_MOLAR, SHILEN_TEARS, ARKENIA_RECOMMENDATION);
-
addStartNpc(TRISKEL);
addTalkId(TRISKEL, ARKENIA, LEIKAN);
-
addKillId(27036, 20369);
}
@@ -62,41 +58,45 @@ public class Q411_PathToAnAssassin extends Quest
return htmltext;
}
- if (event.equals("30416-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DARK_FIGHTER)
+ case "30416-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ASSASSIN) ? "30416-02a.htm" : "30416-02.htm";
+ if (player.getClassId() != ClassId.DARK_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ASSASSIN) ? "30416-02a.htm" : "30416-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30416-03.htm";
+ }
+ else if (st.hasQuestItems(IRON_HEART))
+ {
+ htmltext = "30416-04.htm";
+ }
+ else
+ {
+ st.startQuest();
+ st.giveItems(SHILEN_CALL, 1);
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30419-05.htm":
{
- htmltext = "30416-03.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SHILEN_CALL, 1);
+ st.giveItems(ARKENIA_LETTER, 1);
+ break;
}
- else if (st.hasQuestItems(IRON_HEART))
+ case "30382-03.htm":
{
- htmltext = "30416-04.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ARKENIA_LETTER, 1);
+ st.giveItems(LEIKAN_NOTE, 1);
+ break;
}
- else
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(SHILEN_CALL, 1);
- }
- }
- else if (event.equals("30419-05.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SHILEN_CALL, 1);
- st.giveItems(ARKENIA_LETTER, 1);
- }
- else if (event.equals("30382-03.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ARKENIA_LETTER, 1);
- st.giveItems(LEIKAN_NOTE, 1);
}
return htmltext;
@@ -115,14 +115,17 @@ public class Q411_PathToAnAssassin extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30416-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case TRISKEL:
+ {
if (cond == 1)
{
htmltext = "30416-11.htm";
@@ -154,8 +157,9 @@ public class Q411_PathToAnAssassin extends Quest
st.exitQuest(true);
}
break;
-
+ }
case ARKENIA:
+ {
if (cond == 1)
{
htmltext = "30419-01.htm";
@@ -175,7 +179,7 @@ public class Q411_PathToAnAssassin extends Quest
else if (cond == 6)
{
htmltext = "30419-08.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SHILEN_TEARS, -1);
st.giveItems(ARKENIA_RECOMMENDATION, 1);
@@ -185,8 +189,9 @@ public class Q411_PathToAnAssassin extends Quest
htmltext = "30419-09.htm";
}
break;
-
+ }
case LEIKAN:
+ {
if (cond == 2)
{
htmltext = "30382-01.htm";
@@ -198,7 +203,7 @@ public class Q411_PathToAnAssassin extends Quest
else if (cond == 4)
{
htmltext = "30382-07.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MOONSTONE_BEAST_MOLAR, -1);
st.takeItems(LEIKAN_NOTE, -1);
@@ -212,8 +217,10 @@ public class Q411_PathToAnAssassin extends Quest
htmltext = "30382-08.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -230,14 +237,14 @@ public class Q411_PathToAnAssassin extends Quest
if (npc.getNpcId() == 20369)
{
- if ((st.getInt("cond") == 3) && st.dropItemsAlways(MOONSTONE_BEAST_MOLAR, 1, 10))
+ if (st.isCond(3) && st.dropItemsAlways(MOONSTONE_BEAST_MOLAR, 1, 10))
{
- st.set("cond", "4");
+ st.setCond(4);
}
}
- else if (st.getInt("cond") == 5)
+ else if (st.isCond(5))
{
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SHILEN_TEARS, 1);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q412_PathToADarkWizard/Q412_PathToADarkWizard.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q412_PathToADarkWizard/Q412_PathToADarkWizard.java
index dc08c6df65..be048bc93c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q412_PathToADarkWizard/Q412_PathToADarkWizard.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q412_PathToADarkWizard/Q412_PathToADarkWizard.java
@@ -26,6 +26,11 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q412_PathToADarkWizard extends Quest
{
+ // NPCs
+ private static final int VARIKA = 30421;
+ private static final int CHARKEREN = 30415;
+ private static final int ANNIKA = 30418;
+ private static final int ARKENIA = 30419;
// Items
private static final int SEED_OF_ANGER = 1253;
private static final int SEED_OF_DESPAIR = 1254;
@@ -40,21 +45,12 @@ public class Q412_PathToADarkWizard extends Quest
private static final int CANDLE = 1278;
private static final int HUB_SCENT = 1279;
- // NPCs
- private static final int VARIKA = 30421;
- private static final int CHARKEREN = 30415;
- private static final int ANNIKA = 30418;
- private static final int ARKENIA = 30419;
-
public Q412_PathToADarkWizard()
{
super(412, "Path to a Dark Wizard");
-
registerQuestItems(SEED_OF_ANGER, SEED_OF_DESPAIR, SEED_OF_HORROR, SEED_OF_LUNACY, FAMILY_REMAINS, VARIKA_LIQUOR, KNEE_BONE, HEART_OF_LUNACY, LUCKY_KEY, CANDLE, HUB_SCENT);
-
addStartNpc(VARIKA);
addTalkId(VARIKA, CHARKEREN, ANNIKA, ARKENIA);
-
addKillId(20015, 20022, 20045, 20517, 20518);
}
@@ -68,70 +64,77 @@ public class Q412_PathToADarkWizard extends Quest
return htmltext;
}
- if (event.equals("30421-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DARK_MAGE)
+ case "30421-05.htm":
{
- htmltext = (player.getClassId() == ClassId.DARK_WIZARD) ? "30421-02a.htm" : "30421-03.htm";
+ if (player.getClassId() != ClassId.DARK_MAGE)
+ {
+ htmltext = (player.getClassId() == ClassId.DARK_WIZARD) ? "30421-02a.htm" : "30421-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30421-02.htm";
+ }
+ else if (st.hasQuestItems(JEWEL_OF_DARKNESS))
+ {
+ htmltext = "30421-04.htm";
+ }
+ else
+ {
+ st.startQuest();
+ st.giveItems(SEED_OF_DESPAIR, 1);
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30421-07.htm":
{
- htmltext = "30421-02.htm";
+ if (st.hasQuestItems(SEED_OF_ANGER))
+ {
+ htmltext = "30421-06.htm";
+ }
+ else if (st.hasQuestItems(LUCKY_KEY))
+ {
+ htmltext = "30421-08.htm";
+ }
+ else if (st.getQuestItemsCount(FAMILY_REMAINS) == 3)
+ {
+ htmltext = "30421-18.htm";
+ }
+ break;
}
- else if (st.hasQuestItems(JEWEL_OF_DARKNESS))
+ case "30421-10.htm":
{
- htmltext = "30421-04.htm";
+ if (st.hasQuestItems(SEED_OF_HORROR))
+ {
+ htmltext = "30421-09.htm";
+ }
+ else if (st.getQuestItemsCount(KNEE_BONE) == 2)
+ {
+ htmltext = "30421-19.htm";
+ }
+ break;
}
- else
+ case "30421-13.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(SEED_OF_DESPAIR, 1);
+ if (st.hasQuestItems(SEED_OF_LUNACY))
+ {
+ htmltext = "30421-12.htm";
+ }
+ break;
}
- }
- else if (event.equals("30421-07.htm"))
- {
- if (st.hasQuestItems(SEED_OF_ANGER))
+ case "30415-03.htm":
{
- htmltext = "30421-06.htm";
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(LUCKY_KEY, 1);
+ break;
}
- else if (st.hasQuestItems(LUCKY_KEY))
+ case "30418-02.htm":
{
- htmltext = "30421-08.htm";
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(CANDLE, 1);
+ break;
}
- else if (st.getQuestItemsCount(FAMILY_REMAINS) == 3)
- {
- htmltext = "30421-18.htm";
- }
- }
- else if (event.equals("30421-10.htm"))
- {
- if (st.hasQuestItems(SEED_OF_HORROR))
- {
- htmltext = "30421-09.htm";
- }
- else if (st.getQuestItemsCount(KNEE_BONE) == 2)
- {
- htmltext = "30421-19.htm";
- }
- }
- else if (event.equals("30421-13.htm"))
- {
- if (st.hasQuestItems(SEED_OF_LUNACY))
- {
- htmltext = "30421-12.htm";
- }
- }
- else if (event.equals("30415-03.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(LUCKY_KEY, 1);
- }
- else if (event.equals("30418-02.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(CANDLE, 1);
}
return htmltext;
@@ -150,13 +153,16 @@ public class Q412_PathToADarkWizard extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30421-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case VARIKA:
+ {
if (st.hasQuestItems(SEED_OF_ANGER, SEED_OF_HORROR, SEED_OF_LUNACY))
{
htmltext = "30421-16.htm";
@@ -175,8 +181,9 @@ public class Q412_PathToADarkWizard extends Quest
htmltext = "30421-17.htm";
}
break;
-
+ }
case CHARKEREN:
+ {
if (st.hasQuestItems(SEED_OF_ANGER))
{
htmltext = "30415-06.htm";
@@ -198,8 +205,9 @@ public class Q412_PathToADarkWizard extends Quest
htmltext = "30415-04.htm";
}
break;
-
+ }
case ANNIKA:
+ {
if (st.hasQuestItems(SEED_OF_HORROR))
{
htmltext = "30418-04.htm";
@@ -221,8 +229,9 @@ public class Q412_PathToADarkWizard extends Quest
htmltext = "30418-03.htm";
}
break;
-
+ }
case ARKENIA:
+ {
if (st.hasQuestItems(SEED_OF_LUNACY))
{
htmltext = "30419-03.htm";
@@ -246,8 +255,10 @@ public class Q412_PathToADarkWizard extends Quest
htmltext = "30419-02.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -265,27 +276,31 @@ public class Q412_PathToADarkWizard extends Quest
switch (npc.getNpcId())
{
case 20015:
+ {
if (st.hasQuestItems(LUCKY_KEY))
{
st.dropItems(FAMILY_REMAINS, 1, 3, 500000);
}
break;
-
+ }
case 20022:
case 20517:
case 20518:
+ {
if (st.hasQuestItems(CANDLE))
{
st.dropItems(KNEE_BONE, 1, 2, 500000);
}
break;
-
+ }
case 20045:
+ {
if (st.hasQuestItems(HUB_SCENT))
{
st.dropItems(HEART_OF_LUNACY, 1, 3, 500000);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q413_PathToAShillienOracle/Q413_PathToAShillienOracle.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q413_PathToAShillienOracle/Q413_PathToAShillienOracle.java
index 6154f63548..5394c66ba3 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q413_PathToAShillienOracle/Q413_PathToAShillienOracle.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q413_PathToAShillienOracle/Q413_PathToAShillienOracle.java
@@ -26,6 +26,10 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q413_PathToAShillienOracle extends Quest
{
+ // NPCs
+ private static final int SIDRA = 30330;
+ private static final int ADONIUS = 30375;
+ private static final int TALBOT = 30377;
// Items
private static final int SIDRA_LETTER = 1262;
private static final int BLANK_SHEET = 1263;
@@ -37,20 +41,12 @@ public class Q413_PathToAShillienOracle extends Quest
private static final int ANDARIEL_BOOK = 1269;
private static final int ORB_OF_ABYSS = 1270;
- // NPCs
- private static final int SIDRA = 30330;
- private static final int ADONIUS = 30375;
- private static final int TALBOT = 30377;
-
public Q413_PathToAShillienOracle()
{
super(413, "Path to a Shillien Oracle");
-
registerQuestItems(SIDRA_LETTER, BLANK_SHEET, BLOODY_RUNE, GARMIEL_BOOK, PRAYER_OF_ADONIUS, PENITENT_MARK, ASHEN_BONES, ANDARIEL_BOOK);
-
addStartNpc(SIDRA);
addTalkId(SIDRA, ADONIUS, TALBOT);
-
addKillId(20776, 20457, 20458, 20514, 20515);
}
@@ -64,41 +60,46 @@ public class Q413_PathToAShillienOracle extends Quest
return htmltext;
}
- if (event.equals("30330-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DARK_MAGE)
+ case "30330-05.htm":
{
- htmltext = (player.getClassId() == ClassId.SHILLIEN_ORACLE) ? "30330-02a.htm" : "30330-03.htm";
+ if (player.getClassId() != ClassId.DARK_MAGE)
+ {
+ htmltext = (player.getClassId() == ClassId.SHILLIEN_ORACLE) ? "30330-02a.htm" : "30330-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30330-02.htm";
+ }
+ else if (st.hasQuestItems(ORB_OF_ABYSS))
+ {
+ htmltext = "30330-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30330-06.htm":
{
- htmltext = "30330-02.htm";
+ st.startQuest();
+ st.giveItems(SIDRA_LETTER, 1);
+ break;
}
- else if (st.hasQuestItems(ORB_OF_ABYSS))
+ case "30377-02.htm":
{
- htmltext = "30330-04.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SIDRA_LETTER, 1);
+ st.giveItems(BLANK_SHEET, 5);
+ break;
+ }
+ case "30375-04.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(PRAYER_OF_ADONIUS, 1);
+ st.giveItems(PENITENT_MARK, 1);
+ break;
}
- }
- else if (event.equals("30330-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(SIDRA_LETTER, 1);
- }
- else if (event.equals("30377-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SIDRA_LETTER, 1);
- st.giveItems(BLANK_SHEET, 5);
- }
- else if (event.equals("30375-04.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PRAYER_OF_ADONIUS, 1);
- st.giveItems(PENITENT_MARK, 1);
}
return htmltext;
@@ -117,14 +118,17 @@ public class Q413_PathToAShillienOracle extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30330-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SIDRA:
+ {
if (cond == 1)
{
htmltext = "30330-07.htm";
@@ -149,8 +153,9 @@ public class Q413_PathToAShillienOracle extends Quest
st.exitQuest(true);
}
break;
-
+ }
case TALBOT:
+ {
if (cond == 1)
{
htmltext = "30377-01.htm";
@@ -162,7 +167,7 @@ public class Q413_PathToAShillienOracle extends Quest
else if (cond == 3)
{
htmltext = "30377-05.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BLOODY_RUNE, -1);
st.giveItems(GARMIEL_BOOK, 1);
@@ -177,8 +182,9 @@ public class Q413_PathToAShillienOracle extends Quest
htmltext = "30377-07.htm";
}
break;
-
+ }
case ADONIUS:
+ {
if (cond == 4)
{
htmltext = "30375-01.htm";
@@ -190,7 +196,7 @@ public class Q413_PathToAShillienOracle extends Quest
else if (cond == 6)
{
htmltext = "30375-07.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(ASHEN_BONES, -1);
st.takeItems(PENITENT_MARK, -1);
@@ -201,8 +207,10 @@ public class Q413_PathToAShillienOracle extends Quest
htmltext = "30375-08.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -219,18 +227,18 @@ public class Q413_PathToAShillienOracle extends Quest
if (npc.getNpcId() == 20776)
{
- if (st.getInt("cond") == 2)
+ if (st.isCond(2))
{
st.takeItems(BLANK_SHEET, 1);
if (st.dropItemsAlways(BLOODY_RUNE, 1, 5))
{
- st.set("cond", "3");
+ st.setCond(3);
}
}
}
- else if ((st.getInt("cond") == 5) && st.dropItemsAlways(ASHEN_BONES, 1, 10))
+ else if (st.isCond(5) && st.dropItemsAlways(ASHEN_BONES, 1, 10))
{
- st.set("cond", "6");
+ st.setCond(6);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q414_PathToAnOrcRaider/Q414_PathToAnOrcRaider.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q414_PathToAnOrcRaider/Q414_PathToAnOrcRaider.java
index 616468c5c3..4b39140ba1 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q414_PathToAnOrcRaider/Q414_PathToAnOrcRaider.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q414_PathToAnOrcRaider/Q414_PathToAnOrcRaider.java
@@ -27,6 +27,15 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q414_PathToAnOrcRaider extends Quest
{
+ // NPCs
+ private static final int KARUKIA = 30570;
+ private static final int KASMAN = 30501;
+ private static final int TAZEER = 31978;
+ // Monsters
+ private static final int GOBLIN_TOMB_RAIDER_LEADER = 20320;
+ private static final int KURUKA_RATMAN_LEADER = 27045;
+ private static final int UMBAR_ORC = 27054;
+ private static final int TIMORA_ORC = 27320;
// Items
private static final int GREEN_BLOOD = 1578;
private static final int GOBLIN_DWELLING_MAP = 1579;
@@ -37,26 +46,12 @@ public class Q414_PathToAnOrcRaider extends Quest
private static final int MARK_OF_RAIDER = 1592;
private static final int TIMORA_ORC_HEAD = 8544;
- // NPCs
- private static final int KARUKIA = 30570;
- private static final int KASMAN = 30501;
- private static final int TAZEER = 31978;
-
- // Monsters
- private static final int GOBLIN_TOMB_RAIDER_LEADER = 20320;
- private static final int KURUKA_RATMAN_LEADER = 27045;
- private static final int UMBAR_ORC = 27054;
- private static final int TIMORA_ORC = 27320;
-
public Q414_PathToAnOrcRaider()
{
super(414, "Path to an Orc Raider");
-
registerQuestItems(GREEN_BLOOD, GOBLIN_DWELLING_MAP, KURUKA_RATMAN_TOOTH, BETRAYER_REPORT_1, BETRAYER_REPORT_2, HEAD_OF_BETRAYER, TIMORA_ORC_HEAD);
-
addStartNpc(KARUKIA);
addTalkId(KARUKIA, KASMAN, TAZEER);
-
addKillId(GOBLIN_TOMB_RAIDER_LEADER, KURUKA_RATMAN_LEADER, UMBAR_ORC, TIMORA_ORC);
}
@@ -70,51 +65,54 @@ public class Q414_PathToAnOrcRaider extends Quest
return htmltext;
}
- // KARUKIA
- if (event.equals("30570-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.ORC_FIGHTER)
+ case "30570-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ORC_RAIDER) ? "30570-02a.htm" : "30570-03.htm";
+ if (player.getClassId() != ClassId.ORC_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ORC_RAIDER) ? "30570-02a.htm" : "30570-03.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30570-02.htm";
+ }
+ else if (st.hasQuestItems(MARK_OF_RAIDER))
+ {
+ htmltext = "30570-04.htm";
+ }
+ else
+ {
+ st.startQuest();
+ st.giveItems(GOBLIN_DWELLING_MAP, 1);
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30570-07a.htm":
{
- htmltext = "30570-02.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GOBLIN_DWELLING_MAP, 1);
+ st.takeItems(KURUKA_RATMAN_TOOTH, -1);
+ st.giveItems(BETRAYER_REPORT_1, 1);
+ st.giveItems(BETRAYER_REPORT_2, 1);
+ break;
}
- else if (st.hasQuestItems(MARK_OF_RAIDER))
+ case "30570-07b.htm":
{
- htmltext = "30570-04.htm";
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GOBLIN_DWELLING_MAP, 1);
+ st.takeItems(KURUKA_RATMAN_TOOTH, -1);
+ break;
}
- else
+ case "31978-03.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(GOBLIN_DWELLING_MAP, 1);
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
}
- else if (event.equals("30570-07a.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GOBLIN_DWELLING_MAP, 1);
- st.takeItems(KURUKA_RATMAN_TOOTH, -1);
- st.giveItems(BETRAYER_REPORT_1, 1);
- st.giveItems(BETRAYER_REPORT_2, 1);
- }
- else if (event.equals("30570-07b.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GOBLIN_DWELLING_MAP, 1);
- st.takeItems(KURUKA_RATMAN_TOOTH, -1);
- }
- // TAZEER
- else if (event.equals("31978-03.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
return htmltext;
}
@@ -132,14 +130,17 @@ public class Q414_PathToAnOrcRaider extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30570-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case KARUKIA:
+ {
if (cond == 1)
{
htmltext = "30570-06.htm";
@@ -157,8 +158,9 @@ public class Q414_PathToAnOrcRaider extends Quest
htmltext = "30570-07b.htm";
}
break;
-
+ }
case KASMAN:
+ {
if (cond == 3)
{
htmltext = "30501-01.htm";
@@ -183,8 +185,9 @@ public class Q414_PathToAnOrcRaider extends Quest
}
}
break;
-
+ }
case TAZEER:
+ {
if (cond == 5)
{
htmltext = "31978-01.htm";
@@ -204,8 +207,10 @@ public class Q414_PathToAnOrcRaider extends Quest
st.exitQuest(true);
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -220,12 +225,11 @@ public class Q414_PathToAnOrcRaider extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case GOBLIN_TOMB_RAIDER_LEADER:
- if (cond == 1)
+ {
+ if (st.isCond(1))
{
if (st.getQuestItemsCount(GREEN_BLOOD) <= Rnd.get(20))
{
@@ -239,33 +243,37 @@ public class Q414_PathToAnOrcRaider extends Quest
}
}
break;
-
+ }
case KURUKA_RATMAN_LEADER:
- if ((cond == 1) && st.dropItemsAlways(KURUKA_RATMAN_TOOTH, 1, 10))
+ {
+ if (st.isCond(1) && st.dropItemsAlways(KURUKA_RATMAN_TOOTH, 1, 10))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case UMBAR_ORC:
- if (((cond == 3) || (cond == 4)) && (st.getQuestItemsCount(HEAD_OF_BETRAYER) < 2) && (Rnd.get(10) < 2))
+ {
+ if ((st.isCond(3) || st.isCond(4)) && (st.getQuestItemsCount(HEAD_OF_BETRAYER) < 2) && (Rnd.get(10) < 2))
{
- if (cond == 3)
+ if (st.isCond(3))
{
- st.set("cond", "4");
+ st.setCond(4);
}
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HEAD_OF_BETRAYER, 1);
}
break;
-
+ }
case TIMORA_ORC:
- if ((cond == 6) && st.dropItems(TIMORA_ORC_HEAD, 1, 1, 600000))
+ {
+ if (st.isCond(6) && st.dropItems(TIMORA_ORC_HEAD, 1, 1, 600000))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q415_PathToAMonk/Q415_PathToAMonk.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q415_PathToAMonk/Q415_PathToAMonk.java
index 8117a40f54..b9ba039b36 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q415_PathToAMonk/Q415_PathToAMonk.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q415_PathToAMonk/Q415_PathToAMonk.java
@@ -28,6 +28,13 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q415_PathToAMonk extends Quest
{
+ // NPCs
+ private static final int GANTAKI = 30587;
+ private static final int ROSHEEK = 30590;
+ private static final int KASMAN = 30501;
+ private static final int TORUKU = 30591;
+ private static final int AREN = 32056;
+ private static final int MOIRA = 31979;
// Items
private static final int POMEGRANATE = 1593;
private static final int LEATHER_POUCH_1 = 1594;
@@ -55,23 +62,12 @@ public class Q415_PathToAMonk extends Quest
private static final int KASHA_SPIDER_TOOTH = 8545;
private static final int HORN_OF_BAAR_DRE_VANUL = 8546;
- // NPCs
- private static final int GANTAKI = 30587;
- private static final int ROSHEEK = 30590;
- private static final int KASMAN = 30501;
- private static final int TORUKU = 30591;
- private static final int AREN = 32056;
- private static final int MOIRA = 31979;
-
public Q415_PathToAMonk()
{
super(415, "Path to a Monk");
-
registerQuestItems(POMEGRANATE, LEATHER_POUCH_1, LEATHER_POUCH_2, LEATHER_POUCH_3, LEATHER_POUCH_FULL_1, LEATHER_POUCH_FULL_2, LEATHER_POUCH_FULL_3, KASHA_BEAR_CLAW, KASHA_BLADE_SPIDER_TALON, SCARLET_SALAMANDER_SCALE, FIERY_SPIRIT_SCROLL, ROSHEEK_LETTER, GANTAKI_LETTER_OF_RECOMMENDATION, FIG, LEATHER_POUCH_4, LEATHER_POUCH_FULL_4, VUKU_ORC_TUSK, RATMAN_FANG, LANG_KLIZARDMAN_TOOTH, FELIM_LIZARDMAN_TOOTH, IRON_WILL_SCROLL, TORUKU_LETTER, KASHA_SPIDER_TOOTH, HORN_OF_BAAR_DRE_VANUL);
-
addStartNpc(GANTAKI);
addTalkId(GANTAKI, ROSHEEK, KASMAN, TORUKU, AREN, MOIRA);
-
addKillId(20014, 20017, 20024, 20359, 20415, 20476, 20478, 20479, 21118);
}
@@ -85,59 +81,67 @@ public class Q415_PathToAMonk extends Quest
return htmltext;
}
- if (event.equals("30587-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.ORC_FIGHTER)
+ case "30587-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ORC_MONK) ? "30587-02a.htm" : "30587-02.htm";
+ if (player.getClassId() != ClassId.ORC_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ORC_MONK) ? "30587-02a.htm" : "30587-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30587-03.htm";
+ }
+ else if (st.hasQuestItems(KHAVATARI_TOTEM))
+ {
+ htmltext = "30587-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30587-06.htm":
{
- htmltext = "30587-03.htm";
+ st.startQuest();
+ st.giveItems(POMEGRANATE, 1);
+ break;
}
- else if (st.hasQuestItems(KHAVATARI_TOTEM))
+ case "30587-09a.htm":
{
- htmltext = "30587-04.htm";
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ROSHEEK_LETTER, 1);
+ st.giveItems(GANTAKI_LETTER_OF_RECOMMENDATION, 1);
+ break;
+ }
+ case "30587-09b.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ROSHEEK_LETTER, 1);
+ break;
+ }
+ case "32056-03.htm":
+ {
+ st.setCond(15);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32056-08.htm":
+ {
+ st.setCond(20);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31979-03.htm":
+ {
+ st.takeItems(FIERY_SPIRIT_SCROLL, 1);
+ st.giveItems(KHAVATARI_TOTEM, 1);
+ st.rewardExpAndSp(3200, 4230);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30587-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(POMEGRANATE, 1);
- }
- else if (event.equals("30587-09a.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROSHEEK_LETTER, 1);
- st.giveItems(GANTAKI_LETTER_OF_RECOMMENDATION, 1);
- }
- else if (event.equals("30587-09b.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ROSHEEK_LETTER, 1);
- }
- else if (event.equals("32056-03.htm"))
- {
- st.set("cond", "15");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32056-08.htm"))
- {
- st.set("cond", "20");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31979-03.htm"))
- {
- st.takeItems(FIERY_SPIRIT_SCROLL, 1);
- st.giveItems(KHAVATARI_TOTEM, 1);
- st.rewardExpAndSp(3200, 4230);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -156,14 +160,17 @@ public class Q415_PathToAMonk extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30587-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case GANTAKI:
+ {
if (cond == 1)
{
htmltext = "30587-07.htm";
@@ -185,12 +192,13 @@ public class Q415_PathToAMonk extends Quest
htmltext = "30587-11.htm";
}
break;
-
+ }
case ROSHEEK:
+ {
if (cond == 1)
{
htmltext = "30590-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(POMEGRANATE, 1);
st.giveItems(LEATHER_POUCH_1, 1);
@@ -202,7 +210,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 3)
{
htmltext = "30590-03.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LEATHER_POUCH_FULL_1, 1);
st.giveItems(LEATHER_POUCH_2, 1);
@@ -214,7 +222,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 5)
{
htmltext = "30590-05.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LEATHER_POUCH_FULL_2, 1);
st.giveItems(LEATHER_POUCH_3, 1);
@@ -226,7 +234,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 7)
{
htmltext = "30590-07.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LEATHER_POUCH_FULL_3, 1);
st.giveItems(FIERY_SPIRIT_SCROLL, 1);
@@ -241,12 +249,13 @@ public class Q415_PathToAMonk extends Quest
htmltext = "30590-09.htm";
}
break;
-
+ }
case KASMAN:
+ {
if (cond == 9)
{
htmltext = "30501-01.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GANTAKI_LETTER_OF_RECOMMENDATION, 1);
st.giveItems(FIG, 1);
@@ -272,12 +281,13 @@ public class Q415_PathToAMonk extends Quest
st.exitQuest(true);
}
break;
-
+ }
case TORUKU:
+ {
if (cond == 10)
{
htmltext = "30591-01.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FIG, 1);
st.giveItems(LEATHER_POUCH_4, 1);
@@ -289,7 +299,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 12)
{
htmltext = "30591-03.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(LEATHER_POUCH_FULL_4, 1);
st.giveItems(IRON_WILL_SCROLL, 1);
@@ -300,8 +310,9 @@ public class Q415_PathToAMonk extends Quest
htmltext = "30591-04.htm";
}
break;
-
+ }
case AREN:
+ {
if (cond == 14)
{
htmltext = "32056-01.htm";
@@ -313,7 +324,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 16)
{
htmltext = "32056-05.htm";
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(KASHA_SPIDER_TOOTH, -1);
}
@@ -324,7 +335,7 @@ public class Q415_PathToAMonk extends Quest
else if (cond == 18)
{
htmltext = "32056-07.htm";
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HORN_OF_BAAR_DRE_VANUL, -1);
}
@@ -333,16 +344,19 @@ public class Q415_PathToAMonk extends Quest
htmltext = "32056-09.htm";
}
break;
-
+ }
case MOIRA:
+ {
if (cond == 20)
{
htmltext = "31979-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -368,50 +382,55 @@ public class Q415_PathToAMonk extends Quest
switch (npc.getNpcId())
{
case 20479:
- if ((st.getInt("cond") == 2) && st.dropItemsAlways(KASHA_BEAR_CLAW, 1, 5))
+ {
+ if (st.isCond(2) && st.dropItemsAlways(KASHA_BEAR_CLAW, 1, 5))
{
- st.set("cond", "3");
+ st.setCond(3);
st.takeItems(KASHA_BEAR_CLAW, -1);
st.takeItems(LEATHER_POUCH_1, 1);
st.giveItems(LEATHER_POUCH_FULL_1, 1);
}
break;
-
+ }
case 20478:
- if ((st.getInt("cond") == 4) && st.dropItemsAlways(KASHA_BLADE_SPIDER_TALON, 1, 5))
+ {
+ if (st.isCond(4) && st.dropItemsAlways(KASHA_BLADE_SPIDER_TALON, 1, 5))
{
- st.set("cond", "5");
+ st.setCond(5);
st.takeItems(KASHA_BLADE_SPIDER_TALON, -1);
st.takeItems(LEATHER_POUCH_2, 1);
st.giveItems(LEATHER_POUCH_FULL_2, 1);
}
- else if ((st.getInt("cond") == 15) && st.dropItems(KASHA_SPIDER_TOOTH, 1, 6, 500000))
+ else if (st.isCond(15) && st.dropItems(KASHA_SPIDER_TOOTH, 1, 6, 500000))
{
- st.set("cond", "16");
+ st.setCond(16);
}
break;
-
+ }
case 20476:
- if ((st.getInt("cond") == 15) && st.dropItems(KASHA_SPIDER_TOOTH, 1, 6, 500000))
+ {
+ if (st.isCond(15) && st.dropItems(KASHA_SPIDER_TOOTH, 1, 6, 500000))
{
- st.set("cond", "16");
+ st.setCond(16);
}
break;
-
+ }
case 20415:
- if ((st.getInt("cond") == 6) && st.dropItemsAlways(SCARLET_SALAMANDER_SCALE, 1, 5))
+ {
+ if (st.isCond(6) && st.dropItemsAlways(SCARLET_SALAMANDER_SCALE, 1, 5))
{
- st.set("cond", "7");
+ st.setCond(7);
st.takeItems(SCARLET_SALAMANDER_SCALE, -1);
st.takeItems(LEATHER_POUCH_3, 1);
st.giveItems(LEATHER_POUCH_FULL_3, 1);
}
break;
-
+ }
case 20014:
- if ((st.getInt("cond") == 11) && st.dropItemsAlways(FELIM_LIZARDMAN_TOOTH, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
+ {
+ if (st.isCond(11) && st.dropItemsAlways(FELIM_LIZARDMAN_TOOTH, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
{
- st.set("cond", "12");
+ st.setCond(12);
st.takeItems(VUKU_ORC_TUSK, -1);
st.takeItems(RATMAN_FANG, -1);
st.takeItems(LANG_KLIZARDMAN_TOOTH, -1);
@@ -420,11 +439,12 @@ public class Q415_PathToAMonk extends Quest
st.giveItems(LEATHER_POUCH_FULL_4, 1);
}
break;
-
+ }
case 20017:
- if ((st.getInt("cond") == 11) && st.dropItemsAlways(VUKU_ORC_TUSK, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3))
+ {
+ if (st.isCond(11) && st.dropItemsAlways(VUKU_ORC_TUSK, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3))
{
- st.set("cond", "12");
+ st.setCond(12);
st.takeItems(VUKU_ORC_TUSK, -1);
st.takeItems(RATMAN_FANG, -1);
st.takeItems(LANG_KLIZARDMAN_TOOTH, -1);
@@ -433,11 +453,12 @@ public class Q415_PathToAMonk extends Quest
st.giveItems(LEATHER_POUCH_FULL_4, 1);
}
break;
-
+ }
case 20024:
- if ((st.getInt("cond") == 11) && st.dropItemsAlways(LANG_KLIZARDMAN_TOOTH, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
+ {
+ if (st.isCond(11) && st.dropItemsAlways(LANG_KLIZARDMAN_TOOTH, 1, 3) && (st.getQuestItemsCount(RATMAN_FANG) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
{
- st.set("cond", "12");
+ st.setCond(12);
st.takeItems(VUKU_ORC_TUSK, -1);
st.takeItems(RATMAN_FANG, -1);
st.takeItems(LANG_KLIZARDMAN_TOOTH, -1);
@@ -446,11 +467,12 @@ public class Q415_PathToAMonk extends Quest
st.giveItems(LEATHER_POUCH_FULL_4, 1);
}
break;
-
+ }
case 20359:
- if ((st.getInt("cond") == 11) && st.dropItemsAlways(RATMAN_FANG, 1, 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
+ {
+ if (st.isCond(11) && st.dropItemsAlways(RATMAN_FANG, 1, 3) && (st.getQuestItemsCount(LANG_KLIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(FELIM_LIZARDMAN_TOOTH) == 3) && (st.getQuestItemsCount(VUKU_ORC_TUSK) == 3))
{
- st.set("cond", "12");
+ st.setCond(12);
st.takeItems(VUKU_ORC_TUSK, -1);
st.takeItems(RATMAN_FANG, -1);
st.takeItems(LANG_KLIZARDMAN_TOOTH, -1);
@@ -459,15 +481,17 @@ public class Q415_PathToAMonk extends Quest
st.giveItems(LEATHER_POUCH_FULL_4, 1);
}
break;
-
+ }
case 21118:
- if (st.getInt("cond") == 17)
+ {
+ if (st.isCond(17))
{
- st.set("cond", "18");
+ st.setCond(18);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HORN_OF_BAAR_DRE_VANUL, 1);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q416_PathToAnOrcShaman/Q416_PathToAnOrcShaman.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q416_PathToAnOrcShaman/Q416_PathToAnOrcShaman.java
index 0a92ff835b..c37bb47c3f 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q416_PathToAnOrcShaman/Q416_PathToAnOrcShaman.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q416_PathToAnOrcShaman/Q416_PathToAnOrcShaman.java
@@ -27,6 +27,23 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q416_PathToAnOrcShaman extends Quest
{
+ // NPCs
+ private static final int TATARU_ZU_HESTUI = 30585;
+ private static final int UMOS = 30502;
+ private static final int HESTUI_TOTEM_SPIRIT = 30592;
+ private static final int DUDA_MARA_TOTEM_SPIRIT = 30593;
+ private static final int MOIRA = 31979;
+ private static final int TOTEM_SPIRIT_OF_GANDI = 32057;
+ private static final int DEAD_LEOPARD_CARCASS = 32090;
+ // Monsters
+ private static final int VENOMOUS_SPIDER = 20038;
+ private static final int ARACHNID_TRACKER = 20043;
+ private static final int GRIZZLY_BEAR = 20335;
+ private static final int SCARLET_SALAMANDER = 20415;
+ private static final int KASHA_BLADE_SPIDER = 20478;
+ private static final int KASHA_BEAR = 20479;
+ private static final int DURKA_SPIRIT = 27056;
+ private static final int BLACK_LEOPARD = 27319;
// Items
private static final int FIRE_CHARM = 1616;
private static final int KASHA_BEAR_PELT = 1617;
@@ -45,34 +62,12 @@ public class Q416_PathToAnOrcShaman extends Quest
private static final int TOTEM_SPIRIT_BLOOD = 1630;
private static final int MASK_OF_MEDIUM = 1631;
- // NPCs
- private static final int TATARU_ZU_HESTUI = 30585;
- private static final int UMOS = 30502;
- private static final int HESTUI_TOTEM_SPIRIT = 30592;
- private static final int DUDA_MARA_TOTEM_SPIRIT = 30593;
- private static final int MOIRA = 31979;
- private static final int TOTEM_SPIRIT_OF_GANDI = 32057;
- private static final int DEAD_LEOPARD_CARCASS = 32090;
-
- // Monsters
- private static final int VENOMOUS_SPIDER = 20038;
- private static final int ARACHNID_TRACKER = 20043;
- private static final int GRIZZLY_BEAR = 20335;
- private static final int SCARLET_SALAMANDER = 20415;
- private static final int KASHA_BLADE_SPIDER = 20478;
- private static final int KASHA_BEAR = 20479;
- private static final int DURKA_SPIRIT = 27056;
- private static final int BLACK_LEOPARD = 27319;
-
public Q416_PathToAnOrcShaman()
{
super(416, "Path to an Orc Shaman");
-
registerQuestItems(FIRE_CHARM, KASHA_BEAR_PELT, KASHA_BLADE_SPIDER_HUSK, FIERY_EGG_1, HESTUI_MASK, FIERY_EGG_2, TOTEM_SPIRIT_CLAW, TATARU_LETTER, FLAME_CHARM, GRIZZLY_BLOOD, BLOOD_CAULDRON, SPIRIT_NET, BOUND_DURKA_SPIRIT, DURKA_PARASITE, TOTEM_SPIRIT_BLOOD);
-
addStartNpc(TATARU_ZU_HESTUI);
addTalkId(TATARU_ZU_HESTUI, UMOS, HESTUI_TOTEM_SPIRIT, DUDA_MARA_TOTEM_SPIRIT, MOIRA, TOTEM_SPIRIT_OF_GANDI, DEAD_LEOPARD_CARCASS);
-
addKillId(VENOMOUS_SPIDER, ARACHNID_TRACKER, GRIZZLY_BEAR, SCARLET_SALAMANDER, KASHA_BLADE_SPIDER, KASHA_BEAR, DURKA_SPIRIT, BLACK_LEOPARD);
}
@@ -86,85 +81,90 @@ public class Q416_PathToAnOrcShaman extends Quest
return htmltext;
}
- // TATARU ZU HESTUI
- if (event.equals("30585-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.ORC_MAGE)
+ case "30585-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ORC_SHAMAN) ? "30585-02a.htm" : "30585-02.htm";
+ if (player.getClassId() != ClassId.ORC_MAGE)
+ {
+ htmltext = (player.getClassId() == ClassId.ORC_SHAMAN) ? "30585-02a.htm" : "30585-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30585-03.htm";
+ }
+ else if (st.hasQuestItems(MASK_OF_MEDIUM))
+ {
+ htmltext = "30585-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30585-06.htm":
{
- htmltext = "30585-03.htm";
+ st.startQuest();
+ st.giveItems(FIRE_CHARM, 1);
+ break;
}
- else if (st.hasQuestItems(MASK_OF_MEDIUM))
+ case "30585-11b.htm":
{
- htmltext = "30585-04.htm";
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TOTEM_SPIRIT_CLAW, 1);
+ st.giveItems(TATARU_LETTER, 1);
+ break;
+ }
+ case "30585-11c.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(TOTEM_SPIRIT_CLAW, 1);
+ break;
+ }
+ case "30592-03.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HESTUI_MASK, 1);
+ st.takeItems(FIERY_EGG_2, 1);
+ st.giveItems(TOTEM_SPIRIT_CLAW, 1);
+ break;
+ }
+ case "30593-03.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BLOOD_CAULDRON, 1);
+ st.giveItems(SPIRIT_NET, 1);
+ break;
+ }
+ case "32057-02.htm":
+ {
+ st.setCond(14);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32057-05.htm":
+ {
+ st.setCond(21);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "32090-04.htm":
+ {
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30502-07.htm":
+ {
+ st.takeItems(TOTEM_SPIRIT_BLOOD, -1);
+ st.giveItems(MASK_OF_MEDIUM, 1);
+ st.rewardExpAndSp(3200, 2600);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30585-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(FIRE_CHARM, 1);
- }
- else if (event.equals("30585-11b.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TOTEM_SPIRIT_CLAW, 1);
- st.giveItems(TATARU_LETTER, 1);
- }
- else if (event.equals("30585-11c.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(TOTEM_SPIRIT_CLAW, 1);
- }
- // HESTUI TOTEM SPIRIT
- else if (event.equals("30592-03.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HESTUI_MASK, 1);
- st.takeItems(FIERY_EGG_2, 1);
- st.giveItems(TOTEM_SPIRIT_CLAW, 1);
- }
- // DUDA MARA TOTEM SPIRIT
- else if (event.equals("30593-03.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BLOOD_CAULDRON, 1);
- st.giveItems(SPIRIT_NET, 1);
- }
- // TOTEM SPIRIT OF GANDI
- else if (event.equals("32057-02.htm"))
- {
- st.set("cond", "14");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("32057-05.htm"))
- {
- st.set("cond", "21");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // DEAD LEOPARD CARCASS
- else if (event.equals("32090-04.htm"))
- {
- st.set("cond", "18");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- // UMOS
- else if (event.equals("30502-07.htm"))
- {
- st.takeItems(TOTEM_SPIRIT_BLOOD, -1);
- st.giveItems(MASK_OF_MEDIUM, 1);
- st.rewardExpAndSp(3200, 2600);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -183,14 +183,17 @@ public class Q416_PathToAnOrcShaman extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30585-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case TATARU_ZU_HESTUI:
+ {
if (cond == 1)
{
htmltext = "30585-07.htm";
@@ -198,7 +201,7 @@ public class Q416_PathToAnOrcShaman extends Quest
else if (cond == 2)
{
htmltext = "30585-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FIERY_EGG_1, 1);
st.takeItems(FIRE_CHARM, 1);
@@ -228,8 +231,9 @@ public class Q416_PathToAnOrcShaman extends Quest
htmltext = "30585-11c.htm";
}
break;
-
+ }
case HESTUI_TOTEM_SPIRIT:
+ {
if (cond == 3)
{
htmltext = "30592-01.htm";
@@ -243,12 +247,13 @@ public class Q416_PathToAnOrcShaman extends Quest
htmltext = "30592-05.htm";
}
break;
-
+ }
case UMOS:
+ {
if (cond == 5)
{
htmltext = "30502-01.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TATARU_LETTER, 1);
st.giveItems(FLAME_CHARM, 1);
@@ -260,7 +265,7 @@ public class Q416_PathToAnOrcShaman extends Quest
else if (cond == 7)
{
htmltext = "30502-03.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(FLAME_CHARM, 1);
st.takeItems(GRIZZLY_BLOOD, 3);
@@ -279,12 +284,13 @@ public class Q416_PathToAnOrcShaman extends Quest
htmltext = "30502-06.htm";
}
break;
-
+ }
case MOIRA:
+ {
if (cond == 12)
{
htmltext = "31979-01.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if ((cond > 12) && (cond < 21))
@@ -301,8 +307,9 @@ public class Q416_PathToAnOrcShaman extends Quest
st.exitQuest(true);
}
break;
-
+ }
case TOTEM_SPIRIT_OF_GANDI:
+ {
if (cond == 13)
{
htmltext = "32057-01.htm";
@@ -316,8 +323,9 @@ public class Q416_PathToAnOrcShaman extends Quest
htmltext = "32057-04.htm";
}
break;
-
+ }
case DUDA_MARA_TOTEM_SPIRIT:
+ {
if (cond == 8)
{
htmltext = "30593-01.htm";
@@ -329,7 +337,7 @@ public class Q416_PathToAnOrcShaman extends Quest
else if (cond == 10)
{
htmltext = "30593-05.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BOUND_DURKA_SPIRIT, 1);
st.giveItems(TOTEM_SPIRIT_BLOOD, 1);
@@ -339,8 +347,9 @@ public class Q416_PathToAnOrcShaman extends Quest
htmltext = "30593-06.htm";
}
break;
-
+ }
case DEAD_LEOPARD_CARCASS:
+ {
if (cond == 14)
{
htmltext = "32090-01a.htm";
@@ -348,7 +357,7 @@ public class Q416_PathToAnOrcShaman extends Quest
else if (cond == 15)
{
htmltext = "32090-01.htm";
- st.set("cond", "16");
+ st.setCond(16);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 16)
@@ -366,12 +375,14 @@ public class Q416_PathToAnOrcShaman extends Quest
else if (cond == 19)
{
htmltext = "32090-06.htm";
- st.set("cond", "20");
+ st.setCond(20);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -386,17 +397,16 @@ public class Q416_PathToAnOrcShaman extends Quest
return null;
}
- final int cond = st.getInt("cond");
-
switch (npc.getNpcId())
{
case KASHA_BEAR:
- if ((cond == 1) && !st.hasQuestItems(KASHA_BEAR_PELT))
+ {
+ if (st.isCond(1) && !st.hasQuestItems(KASHA_BEAR_PELT))
{
st.giveItems(KASHA_BEAR_PELT, 1);
if (st.hasQuestItems(FIERY_EGG_1, KASHA_BLADE_SPIDER_HUSK))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -405,14 +415,15 @@ public class Q416_PathToAnOrcShaman extends Quest
}
}
break;
-
+ }
case KASHA_BLADE_SPIDER:
- if ((cond == 1) && !st.hasQuestItems(KASHA_BLADE_SPIDER_HUSK))
+ {
+ if (st.isCond(1) && !st.hasQuestItems(KASHA_BLADE_SPIDER_HUSK))
{
st.giveItems(KASHA_BLADE_SPIDER_HUSK, 1);
if (st.hasQuestItems(KASHA_BEAR_PELT, FIERY_EGG_1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -421,14 +432,15 @@ public class Q416_PathToAnOrcShaman extends Quest
}
}
break;
-
+ }
case SCARLET_SALAMANDER:
- if ((cond == 1) && !st.hasQuestItems(FIERY_EGG_1))
+ {
+ if (st.isCond(1) && !st.hasQuestItems(FIERY_EGG_1))
{
st.giveItems(FIERY_EGG_1, 1);
if (st.hasQuestItems(KASHA_BEAR_PELT, KASHA_BLADE_SPIDER_HUSK))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
@@ -437,17 +449,19 @@ public class Q416_PathToAnOrcShaman extends Quest
}
}
break;
-
+ }
case GRIZZLY_BEAR:
- if ((cond == 6) && st.dropItemsAlways(GRIZZLY_BLOOD, 1, 3))
+ {
+ if (st.isCond(6) && st.dropItemsAlways(GRIZZLY_BLOOD, 1, 3))
{
- st.set("cond", "7");
+ st.setCond(7);
}
break;
-
+ }
case VENOMOUS_SPIDER:
case ARACHNID_TRACKER:
- if (cond == 9)
+ {
+ if (st.isCond(9))
{
final int count = st.getQuestItemsCount(DURKA_PARASITE);
final int rnd = Rnd.get(10);
@@ -463,24 +477,26 @@ public class Q416_PathToAnOrcShaman extends Quest
}
}
break;
-
+ }
case DURKA_SPIRIT:
- if (cond == 9)
+ {
+ if (st.isCond(9))
{
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(DURKA_PARASITE, -1);
st.takeItems(SPIRIT_NET, 1);
st.giveItems(BOUND_DURKA_SPIRIT, 1);
}
break;
-
+ }
case BLACK_LEOPARD:
- if (cond == 14)
+ {
+ if (st.isCond(14))
{
if (st.getInt("leopard") > 0)
{
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
if (Rnd.get(3) < 2)
@@ -493,9 +509,9 @@ public class Q416_PathToAnOrcShaman extends Quest
st.set("leopard", "1");
}
}
- else if (cond == 16)
+ else if (st.isCond(16))
{
- st.set("cond", "17");
+ st.setCond(17);
st.playSound(QuestState.SOUND_MIDDLE);
if (Rnd.get(3) < 2)
@@ -503,12 +519,13 @@ public class Q416_PathToAnOrcShaman extends Quest
npc.broadcastNpcSay("Listen to Tejakar Gandi, young Oroka! The spirit of the slain leopard is calling you, " + player.getName() + "!");
}
}
- else if (cond == 18)
+ else if (st.isCond(18))
{
- st.set("cond", "19");
+ st.setCond(19);
st.playSound(QuestState.SOUND_MIDDLE);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q417_PathToBecomeAScavenger/Q417_PathToBecomeAScavenger.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q417_PathToBecomeAScavenger/Q417_PathToBecomeAScavenger.java
index 67586113e6..2bc5d4ffea 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q417_PathToBecomeAScavenger/Q417_PathToBecomeAScavenger.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q417_PathToBecomeAScavenger/Q417_PathToBecomeAScavenger.java
@@ -27,6 +27,21 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q417_PathToBecomeAScavenger extends Quest
{
+ // NPCs
+ private static final int RAUT = 30316;
+ private static final int SHARI = 30517;
+ private static final int MION = 30519;
+ private static final int PIPPI = 30524;
+ private static final int BRONK = 30525;
+ private static final int ZIMENF = 30538;
+ private static final int TOMA = 30556;
+ private static final int TORAI = 30557;
+ private static final int YASHENI = 31958;
+ // Monsters
+ private static final int HUNTER_TARANTULA = 20403;
+ private static final int PLUNDER_TARANTULA = 20508;
+ private static final int HUNTER_BEAR = 20777;
+ private static final int HONEY_BEAR = 27058;
// Items
private static final int RING_OF_RAVEN = 1642;
private static final int PIPPI_LETTER = 1643;
@@ -46,32 +61,12 @@ public class Q417_PathToBecomeAScavenger extends Quest
private static final int BEAD_PARCEL_1 = 1657;
private static final int BEAD_PARCEL_2 = 8543;
- // NPCs
- private static final int RAUT = 30316;
- private static final int SHARI = 30517;
- private static final int MION = 30519;
- private static final int PIPPI = 30524;
- private static final int BRONK = 30525;
- private static final int ZIMENF = 30538;
- private static final int TOMA = 30556;
- private static final int TORAI = 30557;
- private static final int YASHENI = 31958;
-
- // Monsters
- private static final int HUNTER_TARANTULA = 20403;
- private static final int PLUNDER_TARANTULA = 20508;
- private static final int HUNTER_BEAR = 20777;
- private static final int HONEY_BEAR = 27058;
-
public Q417_PathToBecomeAScavenger()
{
super(417, "Path to become a Scavenger");
-
registerQuestItems(PIPPI_LETTER, RAUT_TELEPORT_SCROLL, SUCCUBUS_UNDIES, MION_LETTER, BRONK_INGOT, SHARI_AXE, ZIMENF_POTION, BRONK_PAY, SHARI_PAY, ZIMENF_PAY, BEAR_PICTURE, TARANTULA_PICTURE, HONEY_JAR, BEAD, BEAD_PARCEL_1, BEAD_PARCEL_2);
-
addStartNpc(PIPPI);
addTalkId(RAUT, SHARI, MION, PIPPI, BRONK, ZIMENF, TOMA, TORAI, YASHENI);
-
addKillId(HUNTER_TARANTULA, PLUNDER_TARANTULA, HUNTER_BEAR, HONEY_BEAR);
}
@@ -85,122 +80,131 @@ public class Q417_PathToBecomeAScavenger extends Quest
return htmltext;
}
- // PIPPI
- if (event.equals("30524-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DWARVEN_FIGHTER)
+ case "30524-05.htm":
{
- htmltext = (player.getClassId() == ClassId.SCAVENGER) ? "30524-02a.htm" : "30524-08.htm";
+ if (player.getClassId() != ClassId.DWARVEN_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.SCAVENGER) ? "30524-02a.htm" : "30524-08.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30524-02.htm";
+ }
+ else if (st.hasQuestItems(RING_OF_RAVEN))
+ {
+ htmltext = "30524-04.htm";
+ }
+ else
+ {
+ st.startQuest();
+ st.giveItems(PIPPI_LETTER, 1);
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30519_1":
{
- htmltext = "30524-02.htm";
- }
- else if (st.hasQuestItems(RING_OF_RAVEN))
- {
- htmltext = "30524-04.htm";
- }
- else
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(PIPPI_LETTER, 1);
- }
- }
- // MION
- else if (event.equals("30519_1"))
- {
- final int random = Rnd.get(3);
-
- htmltext = "30519-0" + (random + 2) + ".htm";
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(PIPPI_LETTER, -1);
- st.giveItems(ZIMENF_POTION - random, 1);
- }
- else if (event.equals("30519_2"))
- {
- final int random = Rnd.get(3);
-
- htmltext = "30519-0" + (random + 2) + ".htm";
- st.takeItems(BRONK_PAY, -1);
- st.takeItems(SHARI_PAY, -1);
- st.takeItems(ZIMENF_PAY, -1);
- st.giveItems(ZIMENF_POTION - random, 1);
- }
- else if (event.equals("30519-07.htm"))
- {
- st.set("id", String.valueOf(st.getInt("id") + 1));
- }
- else if (event.equals("30519-09.htm"))
- {
- final int id = st.getInt("id");
- if ((id / 10) < 2)
- {
- htmltext = "30519-07.htm";
- st.set("id", String.valueOf(id + 1));
- }
- else if ((id / 10) == 2)
- {
- st.set("id", String.valueOf(id + 1));
- }
- else if ((id / 10) >= 3)
- {
- htmltext = "30519-10.htm";
- st.set("cond", "4");
+ final int random = Rnd.get(3);
+ htmltext = "30519-0" + (random + 2) + ".htm";
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SHARI_AXE, -1);
- st.takeItems(ZIMENF_POTION, -1);
- st.takeItems(BRONK_INGOT, -1);
- st.giveItems(MION_LETTER, 1);
+ st.takeItems(PIPPI_LETTER, -1);
+ st.giveItems(ZIMENF_POTION - random, 1);
+ break;
+ }
+ case "30519_2":
+ {
+ final int random = Rnd.get(3);
+ htmltext = "30519-0" + (random + 2) + ".htm";
+ st.takeItems(BRONK_PAY, -1);
+ st.takeItems(SHARI_PAY, -1);
+ st.takeItems(ZIMENF_PAY, -1);
+ st.giveItems(ZIMENF_POTION - random, 1);
+ break;
+ }
+ case "30519-07.htm":
+ {
+ st.set("id", String.valueOf(st.getInt("id") + 1));
+ break;
+ }
+ case "30519-09.htm":
+ {
+ final int id = st.getInt("id");
+ if ((id / 10) < 2)
+ {
+ htmltext = "30519-07.htm";
+ st.set("id", String.valueOf(id + 1));
+ }
+ else if ((id / 10) == 2)
+ {
+ st.set("id", String.valueOf(id + 1));
+ }
+ else if ((id / 10) >= 3)
+ {
+ htmltext = "30519-10.htm";
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SHARI_AXE, -1);
+ st.takeItems(ZIMENF_POTION, -1);
+ st.takeItems(BRONK_INGOT, -1);
+ st.giveItems(MION_LETTER, 1);
+ }
+ break;
+ }
+ case "30519-11.htm":
+ {
+ if (Rnd.nextBoolean())
+ {
+ htmltext = "30519-06.htm";
+ }
+ break;
+ }
+ case "30556-05b.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BEAD, -1);
+ st.takeItems(TARANTULA_PICTURE, 1);
+ st.giveItems(BEAD_PARCEL_1, 1);
+ break;
+ }
+ case "30556-06b.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BEAD, -1);
+ st.takeItems(TARANTULA_PICTURE, 1);
+ st.giveItems(BEAD_PARCEL_2, 1);
+ break;
+ }
+ case "30316-02.htm":
+ case "30316-03.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BEAD_PARCEL_1, 1);
+ st.giveItems(RAUT_TELEPORT_SCROLL, 1);
+ break;
+ }
+ case "30557-03.htm":
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RAUT_TELEPORT_SCROLL, 1);
+ st.giveItems(SUCCUBUS_UNDIES, 1);
+ break;
+ }
+ case "31958-02.htm":
+ {
+ st.takeItems(BEAD_PARCEL_2, 1);
+ st.giveItems(RING_OF_RAVEN, 1);
+ st.rewardExpAndSp(3200, 7080);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30519-11.htm") && Rnd.nextBoolean())
- {
- htmltext = "30519-06.htm";
- }
- else if (event.equals("30556-05b.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BEAD, -1);
- st.takeItems(TARANTULA_PICTURE, 1);
- st.giveItems(BEAD_PARCEL_1, 1);
- }
- else if (event.equals("30556-06b.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BEAD, -1);
- st.takeItems(TARANTULA_PICTURE, 1);
- st.giveItems(BEAD_PARCEL_2, 1);
- }
- // RAUT
- else if (event.equals("30316-02.htm") || event.equals("30316-03.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BEAD_PARCEL_1, 1);
- st.giveItems(RAUT_TELEPORT_SCROLL, 1);
- }
- // TORAI
- else if (event.equals("30557-03.htm"))
- {
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RAUT_TELEPORT_SCROLL, 1);
- st.giveItems(SUCCUBUS_UNDIES, 1);
- }
- // YASHENI
- else if (event.equals("31958-02.htm"))
- {
- st.takeItems(BEAD_PARCEL_2, 1);
- st.giveItems(RING_OF_RAVEN, 1);
- st.rewardExpAndSp(3200, 7080);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -219,14 +223,17 @@ public class Q417_PathToBecomeAScavenger extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30524-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case PIPPI:
+ {
if (cond == 1)
{
htmltext = "30524-06.htm";
@@ -236,8 +243,9 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30524-07.htm";
}
break;
-
+ }
case MION:
+ {
if (st.hasQuestItems(PIPPI_LETTER))
{
htmltext = "30519-01.htm";
@@ -264,7 +272,7 @@ public class Q417_PathToBecomeAScavenger extends Quest
else
{
htmltext = "30519-15.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BRONK_PAY, -1);
st.takeItems(SHARI_PAY, -1);
@@ -281,8 +289,9 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30519-14.htm";
}
break;
-
+ }
case SHARI:
+ {
if (st.hasQuestItems(SHARI_AXE))
{
final int id = st.getInt("id");
@@ -293,7 +302,7 @@ public class Q417_PathToBecomeAScavenger extends Quest
else
{
htmltext = "30517-02.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
st.set("id", String.valueOf(id + 10));
@@ -305,8 +314,9 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30517-03.htm";
}
break;
-
+ }
case BRONK:
+ {
if (st.hasQuestItems(BRONK_INGOT))
{
final int id = st.getInt("id");
@@ -317,7 +327,7 @@ public class Q417_PathToBecomeAScavenger extends Quest
else
{
htmltext = "30525-02.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
st.set("id", String.valueOf(id + 10));
@@ -329,8 +339,9 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30525-03.htm";
}
break;
-
+ }
case ZIMENF:
+ {
if (st.hasQuestItems(ZIMENF_POTION))
{
final int id = st.getInt("id");
@@ -341,7 +352,7 @@ public class Q417_PathToBecomeAScavenger extends Quest
else
{
htmltext = "30538-02.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
st.set("id", String.valueOf(id + 10));
@@ -353,12 +364,13 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30538-03.htm";
}
break;
-
+ }
case TOMA:
+ {
if (cond == 4)
{
htmltext = "30556-01.htm";
- st.set("cond", "5");
+ st.setCond(5);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MION_LETTER, 1);
st.giveItems(BEAR_PICTURE, 1);
@@ -370,7 +382,7 @@ public class Q417_PathToBecomeAScavenger extends Quest
else if (cond == 6)
{
htmltext = "30556-03.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(HONEY_JAR, -1);
st.takeItems(BEAR_PICTURE, 1);
@@ -397,8 +409,9 @@ public class Q417_PathToBecomeAScavenger extends Quest
htmltext = "30556-06c.htm";
}
break;
-
+ }
case RAUT:
+ {
if (cond == 9)
{
htmltext = "30316-01.htm";
@@ -418,22 +431,26 @@ public class Q417_PathToBecomeAScavenger extends Quest
st.exitQuest(true);
}
break;
-
+ }
case TORAI:
+ {
if (cond == 10)
{
htmltext = "30557-01.htm";
}
break;
-
+ }
case YASHENI:
+ {
if (cond == 12)
{
htmltext = "31958-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -451,7 +468,8 @@ public class Q417_PathToBecomeAScavenger extends Quest
switch (npc.getNpcId())
{
case HUNTER_BEAR:
- if (st.getInt("cond") == 5)
+ {
+ if (st.isCond(5))
{
final int step = st.getInt("step");
if (step > 20)
@@ -472,21 +490,24 @@ public class Q417_PathToBecomeAScavenger extends Quest
}
}
break;
-
+ }
case HONEY_BEAR:
- if ((st.getInt("cond") == 5) && (npc.getSpoiledBy() == player.getObjectId()) && st.dropItemsAlways(HONEY_JAR, 1, 5))
+ {
+ if (st.isCond(5) && (npc.getSpoiledBy() == player.getObjectId()) && st.dropItemsAlways(HONEY_JAR, 1, 5))
{
- st.set("cond", "6");
+ st.setCond(6);
}
break;
-
+ }
case HUNTER_TARANTULA:
case PLUNDER_TARANTULA:
- if ((st.getInt("cond") == 7) && (npc.getSpoiledBy() == player.getObjectId()) && st.dropItems(BEAD, 1, 20, (npc.getNpcId() == HUNTER_TARANTULA) ? 333333 : 600000))
+ {
+ if (st.isCond(7) && (npc.getSpoiledBy() == player.getObjectId()) && st.dropItems(BEAD, 1, 20, (npc.getNpcId() == HUNTER_TARANTULA) ? 333333 : 600000))
{
- st.set("cond", "8");
+ st.setCond(8);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q418_PathToAnArtisan/Q418_PathToAnArtisan.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q418_PathToAnArtisan/Q418_PathToAnArtisan.java
index 374b05205c..48482efc4b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q418_PathToAnArtisan/Q418_PathToAnArtisan.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q418_PathToAnArtisan/Q418_PathToAnArtisan.java
@@ -26,6 +26,14 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
public class Q418_PathToAnArtisan extends Quest
{
+ // NPCs
+ private static final int SILVERA = 30527;
+ private static final int KLUTO = 30317;
+ private static final int PINTER = 30298;
+ private static final int OBI = 32052;
+ private static final int HITCHI = 31963;
+ private static final int LOCKIRIN = 30531;
+ private static final int RYDEL = 31956;
// Items
private static final int SILVERA_RING = 1632;
private static final int FIRST_PASS_CERTIFICATE = 1633;
@@ -38,24 +46,12 @@ public class Q418_PathToAnArtisan extends Quest
private static final int STOLEN_SECRET_BOX = 1640;
private static final int SECRET_BOX = 1641;
- // NPCs
- private static final int SILVERA = 30527;
- private static final int KLUTO = 30317;
- private static final int PINTER = 30298;
- private static final int OBI = 32052;
- private static final int HITCHI = 31963;
- private static final int LOCKIRIN = 30531;
- private static final int RYDEL = 31956;
-
public Q418_PathToAnArtisan()
{
super(418, "Path to an Artisan");
-
registerQuestItems(SILVERA_RING, FIRST_PASS_CERTIFICATE, SECOND_PASS_CERTIFICATE, BOOGLE_RATMAN_TOOTH, BOOGLE_RATMAN_LEADER_TOOTH, KLUTO_LETTER, FOOTPRINT_OF_THIEF, STOLEN_SECRET_BOX, SECRET_BOX);
-
addStartNpc(SILVERA);
addTalkId(SILVERA, KLUTO, PINTER, OBI, HITCHI, LOCKIRIN, RYDEL);
-
addKillId(20389, 20390, 20017);
}
@@ -69,108 +65,127 @@ public class Q418_PathToAnArtisan extends Quest
return htmltext;
}
- if (event.equals("30527-05.htm"))
+ switch (event)
{
- if (player.getClassId() != ClassId.DWARVEN_FIGHTER)
+ case "30527-05.htm":
{
- htmltext = (player.getClassId() == ClassId.ARTISAN) ? "30527-02a.htm" : "30527-02.htm";
+ if (player.getClassId() != ClassId.DWARVEN_FIGHTER)
+ {
+ htmltext = (player.getClassId() == ClassId.ARTISAN) ? "30527-02a.htm" : "30527-02.htm";
+ }
+ else if (player.getLevel() < 19)
+ {
+ htmltext = "30527-03.htm";
+ }
+ else if (st.hasQuestItems(FINAL_PASS_CERTIFICATE))
+ {
+ htmltext = "30527-04.htm";
+ }
+ break;
}
- else if (player.getLevel() < 19)
+ case "30527-06.htm":
{
- htmltext = "30527-03.htm";
+ st.startQuest();
+ st.giveItems(SILVERA_RING, 1);
+ break;
}
- else if (st.hasQuestItems(FINAL_PASS_CERTIFICATE))
+ case "30527-08a.htm":
{
- htmltext = "30527-04.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BOOGLE_RATMAN_LEADER_TOOTH, -1);
+ st.takeItems(BOOGLE_RATMAN_TOOTH, -1);
+ st.takeItems(SILVERA_RING, 1);
+ st.giveItems(FIRST_PASS_CERTIFICATE, 1);
+ break;
+ }
+ case "30527-08b.htm":
+ {
+ st.setCond(8);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BOOGLE_RATMAN_LEADER_TOOTH, -1);
+ st.takeItems(BOOGLE_RATMAN_TOOTH, -1);
+ st.takeItems(SILVERA_RING, 1);
+ break;
+ }
+ case "30317-04.htm":
+ case "30317-07.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(KLUTO_LETTER, 1);
+ break;
+ }
+ case "30317-10.htm":
+ {
+ st.takeItems(FIRST_PASS_CERTIFICATE, 1);
+ st.takeItems(SECOND_PASS_CERTIFICATE, 1);
+ st.takeItems(SECRET_BOX, 1);
+ st.giveItems(FINAL_PASS_CERTIFICATE, 1);
+ st.rewardExpAndSp(3200, 6980);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30317-12.htm":
+ case "30531-05.htm":
+ case "32052-11.htm":
+ case "31963-10.htm":
+ case "31956-04.htm":
+ {
+ st.takeItems(FIRST_PASS_CERTIFICATE, 1);
+ st.takeItems(SECOND_PASS_CERTIFICATE, 1);
+ st.takeItems(SECRET_BOX, 1);
+ st.giveItems(FINAL_PASS_CERTIFICATE, 1);
+ st.rewardExpAndSp(3200, 3490);
+ player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30298-03.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KLUTO_LETTER, -1);
+ st.giveItems(FOOTPRINT_OF_THIEF, 1);
+ break;
+ }
+ case "30298-06.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(FOOTPRINT_OF_THIEF, -1);
+ st.takeItems(STOLEN_SECRET_BOX, -1);
+ st.giveItems(SECOND_PASS_CERTIFICATE, 1);
+ st.giveItems(SECRET_BOX, 1);
+ break;
+ }
+ case "32052-06.htm":
+ {
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31963-04.htm":
+ {
+ st.setCond(10);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31963-05.htm":
+ {
+ st.setCond(11);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31963-07.htm":
+ {
+ st.setCond(12);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
}
- }
- else if (event.equals("30527-06.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(SILVERA_RING, 1);
- }
- else if (event.equals("30527-08a.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BOOGLE_RATMAN_LEADER_TOOTH, -1);
- st.takeItems(BOOGLE_RATMAN_TOOTH, -1);
- st.takeItems(SILVERA_RING, 1);
- st.giveItems(FIRST_PASS_CERTIFICATE, 1);
- }
- else if (event.equals("30527-08b.htm"))
- {
- st.set("cond", "8");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BOOGLE_RATMAN_LEADER_TOOTH, -1);
- st.takeItems(BOOGLE_RATMAN_TOOTH, -1);
- st.takeItems(SILVERA_RING, 1);
- }
- else if (event.equals("30317-04.htm") || event.equals("30317-07.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(KLUTO_LETTER, 1);
- }
- else if (event.equals("30317-10.htm"))
- {
- st.takeItems(FIRST_PASS_CERTIFICATE, 1);
- st.takeItems(SECOND_PASS_CERTIFICATE, 1);
- st.takeItems(SECRET_BOX, 1);
- st.giveItems(FINAL_PASS_CERTIFICATE, 1);
- st.rewardExpAndSp(3200, 6980);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30317-12.htm") || event.equals("30531-05.htm") || event.equals("32052-11.htm") || event.equals("31963-10.htm") || event.equals("31956-04.htm"))
- {
- st.takeItems(FIRST_PASS_CERTIFICATE, 1);
- st.takeItems(SECOND_PASS_CERTIFICATE, 1);
- st.takeItems(SECRET_BOX, 1);
- st.giveItems(FINAL_PASS_CERTIFICATE, 1);
- st.rewardExpAndSp(3200, 3490);
- player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30298-03.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KLUTO_LETTER, -1);
- st.giveItems(FOOTPRINT_OF_THIEF, 1);
- }
- else if (event.equals("30298-06.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(FOOTPRINT_OF_THIEF, -1);
- st.takeItems(STOLEN_SECRET_BOX, -1);
- st.giveItems(SECOND_PASS_CERTIFICATE, 1);
- st.giveItems(SECRET_BOX, 1);
- }
- else if (event.equals("32052-06.htm"))
- {
- st.set("cond", "9");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31963-04.htm"))
- {
- st.set("cond", "10");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31963-05.htm"))
- {
- st.set("cond", "11");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31963-07.htm"))
- {
- st.set("cond", "12");
- st.playSound(QuestState.SOUND_MIDDLE);
}
return htmltext;
@@ -189,14 +204,17 @@ public class Q418_PathToAnArtisan extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "30527-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case SILVERA:
+ {
if (cond == 1)
{
htmltext = "30527-07.htm";
@@ -214,8 +232,9 @@ public class Q418_PathToAnArtisan extends Quest
htmltext = "30527-09a.htm";
}
break;
-
+ }
case KLUTO:
+ {
if (cond == 3)
{
htmltext = "30317-01.htm";
@@ -229,8 +248,9 @@ public class Q418_PathToAnArtisan extends Quest
htmltext = "30317-09.htm";
}
break;
-
+ }
case PINTER:
+ {
if (cond == 4)
{
htmltext = "30298-01.htm";
@@ -248,8 +268,9 @@ public class Q418_PathToAnArtisan extends Quest
htmltext = "30298-07.htm";
}
break;
-
+ }
case OBI:
+ {
if (cond == 8)
{
htmltext = "32052-01.htm";
@@ -263,8 +284,9 @@ public class Q418_PathToAnArtisan extends Quest
htmltext = "32052-07.htm";
}
break;
-
+ }
case HITCHI:
+ {
if (cond == 9)
{
htmltext = "31963-01.htm";
@@ -282,22 +304,26 @@ public class Q418_PathToAnArtisan extends Quest
htmltext = "31963-08.htm";
}
break;
-
+ }
case LOCKIRIN:
+ {
if (cond == 10)
{
htmltext = "30531-01.htm";
}
break;
-
+ }
case RYDEL:
+ {
if (cond == 12)
{
htmltext = "31956-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -315,25 +341,29 @@ public class Q418_PathToAnArtisan extends Quest
switch (npc.getNpcId())
{
case 20389:
- if ((st.getInt("cond") == 1) && st.dropItems(BOOGLE_RATMAN_TOOTH, 1, 10, 700000) && (st.getQuestItemsCount(BOOGLE_RATMAN_LEADER_TOOTH) == 2))
+ {
+ if (st.isCond(1) && st.dropItems(BOOGLE_RATMAN_TOOTH, 1, 10, 700000) && (st.getQuestItemsCount(BOOGLE_RATMAN_LEADER_TOOTH) == 2))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20390:
- if ((st.getInt("cond") == 1) && st.dropItems(BOOGLE_RATMAN_LEADER_TOOTH, 1, 2, 500000) && (st.getQuestItemsCount(BOOGLE_RATMAN_TOOTH) == 10))
+ {
+ if (st.isCond(1) && st.dropItems(BOOGLE_RATMAN_LEADER_TOOTH, 1, 2, 500000) && (st.getQuestItemsCount(BOOGLE_RATMAN_TOOTH) == 10))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case 20017:
- if ((st.getInt("cond") == 5) && st.dropItems(STOLEN_SECRET_BOX, 1, 1, 200000))
+ {
+ if (st.isCond(5) && st.dropItems(STOLEN_SECRET_BOX, 1, 1, 200000))
{
- st.set("cond", "6");
+ st.setCond(6);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q419_GetAPet/Q419_GetAPet.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q419_GetAPet/Q419_GetAPet.java
index 6c2a16e63b..ec48358aa9 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q419_GetAPet/Q419_GetAPet.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q419_GetAPet/Q419_GetAPet.java
@@ -29,6 +29,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q419_GetAPet extends Quest
{
+ // NPCs
+ private static final int MARTIN = 30731;
+ private static final int BELLA = 30256;
+ private static final int METTY = 30072;
+ private static final int ELLIE = 30091;
// Items
private static final int ANIMAL_LOVER_LIST = 3417;
private static final int ANIMAL_SLAYER_LIST_1 = 3418;
@@ -41,105 +46,37 @@ public class Q419_GetAPet extends Quest
private static final int BLOODY_NAIL = 3425;
private static final int BLOODY_KASHA_FANG = 3426;
private static final int BLOODY_TARANTULA_NAIL = 3427;
-
// Reward
private static final int WOLF_COLLAR = 2375;
-
- // NPCs
- private static final int MARTIN = 30731;
- private static final int BELLA = 30256;
- private static final int METTY = 30072;
- private static final int ELLIE = 30091;
-
// Droplist
private static final Map DROPLIST = new HashMap<>();
static
{
- DROPLIST.put(20103, new int[]
- {
- BLOODY_FANG,
- 600000
- });
- DROPLIST.put(20106, new int[]
- {
- BLOODY_FANG,
- 750000
- });
- DROPLIST.put(20108, new int[]
- {
- BLOODY_FANG,
- 1000000
- });
- DROPLIST.put(20460, new int[]
- {
- BLOODY_CLAW,
- 600000
- });
- DROPLIST.put(20308, new int[]
- {
- BLOODY_CLAW,
- 750000
- });
- DROPLIST.put(20466, new int[]
- {
- BLOODY_CLAW,
- 1000000
- });
- DROPLIST.put(20025, new int[]
- {
- BLOODY_NAIL,
- 600000
- });
- DROPLIST.put(20105, new int[]
- {
- BLOODY_NAIL,
- 750000
- });
- DROPLIST.put(20034, new int[]
- {
- BLOODY_NAIL,
- 1000000
- });
- DROPLIST.put(20474, new int[]
- {
- BLOODY_KASHA_FANG,
- 600000
- });
- DROPLIST.put(20476, new int[]
- {
- BLOODY_KASHA_FANG,
- 750000
- });
- DROPLIST.put(20478, new int[]
- {
- BLOODY_KASHA_FANG,
- 1000000
- });
- DROPLIST.put(20403, new int[]
- {
- BLOODY_TARANTULA_NAIL,
- 750000
- });
- DROPLIST.put(20508, new int[]
- {
- BLOODY_TARANTULA_NAIL,
- 1000000
- });
+ // @formatter:off
+ DROPLIST.put(20103, new int[]{BLOODY_FANG, 600000});
+ DROPLIST.put(20106, new int[]{BLOODY_FANG, 750000});
+ DROPLIST.put(20108, new int[]{BLOODY_FANG, 1000000});
+ DROPLIST.put(20460, new int[]{BLOODY_CLAW, 600000});
+ DROPLIST.put(20308, new int[]{BLOODY_CLAW, 750000});
+ DROPLIST.put(20466, new int[]{BLOODY_CLAW, 1000000});
+ DROPLIST.put(20025, new int[]{BLOODY_NAIL, 600000});
+ DROPLIST.put(20105, new int[]{BLOODY_NAIL, 750000});
+ DROPLIST.put(20034, new int[]{BLOODY_NAIL, 1000000});
+ DROPLIST.put(20474, new int[]{BLOODY_KASHA_FANG, 600000});
+ DROPLIST.put(20476, new int[]{BLOODY_KASHA_FANG, 750000});
+ DROPLIST.put(20478, new int[]{BLOODY_KASHA_FANG, 1000000});
+ DROPLIST.put(20403, new int[]{BLOODY_TARANTULA_NAIL, 750000});
+ DROPLIST.put(20508, new int[]{BLOODY_TARANTULA_NAIL, 1000000});
+ // @formatter:on
}
public Q419_GetAPet()
{
super(419, "Get a Pet");
-
registerQuestItems(ANIMAL_LOVER_LIST, ANIMAL_SLAYER_LIST_1, ANIMAL_SLAYER_LIST_2, ANIMAL_SLAYER_LIST_3, ANIMAL_SLAYER_LIST_4, ANIMAL_SLAYER_LIST_5, BLOODY_FANG, BLOODY_CLAW, BLOODY_NAIL, BLOODY_KASHA_FANG, BLOODY_TARANTULA_NAIL);
-
addStartNpc(MARTIN);
addTalkId(MARTIN, BELLA, ELLIE, METTY);
-
- for (int npcId : DROPLIST.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(DROPLIST.keySet());
}
@Override
@@ -152,69 +89,75 @@ public class Q419_GetAPet extends Quest
return htmltext;
}
- if (event.equals("task"))
+ switch (event)
{
- final int race = player.getRace().ordinal();
- htmltext = "30731-0" + (race + 4) + ".htm";
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(ANIMAL_SLAYER_LIST_1 + race, 1);
- }
- else if (event.equals("30731-12.htm"))
- {
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(ANIMAL_SLAYER_LIST_1, 1);
- st.takeItems(ANIMAL_SLAYER_LIST_2, 1);
- st.takeItems(ANIMAL_SLAYER_LIST_3, 1);
- st.takeItems(ANIMAL_SLAYER_LIST_4, 1);
- st.takeItems(ANIMAL_SLAYER_LIST_5, 1);
- st.takeItems(BLOODY_FANG, -1);
- st.takeItems(BLOODY_CLAW, -1);
- st.takeItems(BLOODY_NAIL, -1);
- st.takeItems(BLOODY_KASHA_FANG, -1);
- st.takeItems(BLOODY_TARANTULA_NAIL, -1);
- st.giveItems(ANIMAL_LOVER_LIST, 1);
- }
- else if (event.equals("30256-03.htm"))
- {
- st.set("progress", String.valueOf(st.getInt("progress") | 1));
- if (st.getInt("progress") == 7)
+ case "task":
+ {
+ final int race = player.getRace().ordinal();
+ htmltext = "30731-0" + (race + 4) + ".htm";
+ st.startQuest();
+ st.giveItems(ANIMAL_SLAYER_LIST_1 + race, 1);
+ break;
+ }
+ case "30731-12.htm":
{
st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(ANIMAL_SLAYER_LIST_1, 1);
+ st.takeItems(ANIMAL_SLAYER_LIST_2, 1);
+ st.takeItems(ANIMAL_SLAYER_LIST_3, 1);
+ st.takeItems(ANIMAL_SLAYER_LIST_4, 1);
+ st.takeItems(ANIMAL_SLAYER_LIST_5, 1);
+ st.takeItems(BLOODY_FANG, -1);
+ st.takeItems(BLOODY_CLAW, -1);
+ st.takeItems(BLOODY_NAIL, -1);
+ st.takeItems(BLOODY_KASHA_FANG, -1);
+ st.takeItems(BLOODY_TARANTULA_NAIL, -1);
+ st.giveItems(ANIMAL_LOVER_LIST, 1);
+ break;
}
- }
- else if (event.equals("30072-02.htm"))
- {
- st.set("progress", String.valueOf(st.getInt("progress") | 2));
- if (st.getInt("progress") == 7)
+ case "30256-03.htm":
{
- st.playSound(QuestState.SOUND_MIDDLE);
+ st.set("progress", String.valueOf(st.getInt("progress") | 1));
+ if (st.getInt("progress") == 7)
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
}
- }
- else if (event.equals("30091-02.htm"))
- {
- st.set("progress", String.valueOf(st.getInt("progress") | 4));
- if (st.getInt("progress") == 7)
+ case "30072-02.htm":
{
- st.playSound(QuestState.SOUND_MIDDLE);
+ st.set("progress", String.valueOf(st.getInt("progress") | 2));
+ if (st.getInt("progress") == 7)
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
+ }
+ case "30091-02.htm":
+ {
+ st.set("progress", String.valueOf(st.getInt("progress") | 4));
+ if (st.getInt("progress") == 7)
+ {
+ st.playSound(QuestState.SOUND_MIDDLE);
+ }
+ break;
+ }
+ case "test":
+ {
+ st.set("answers", "0");
+ st.set("quiz", "20 21 22 23 24 25 26 27 28 29 30 31 32 33");
+ return checkQuestions(st);
+ }
+ case "wrong":
+ {
+ st.set("wrong", String.valueOf(st.getInt("wrong") + 1));
+ return checkQuestions(st);
+ }
+ case "right":
+ {
+ st.set("correct", String.valueOf(st.getInt("correct") + 1));
+ return checkQuestions(st);
}
- }
- else if (event.equals("test"))
- {
- st.set("answers", "0");
- st.set("quiz", "20 21 22 23 24 25 26 27 28 29 30 31 32 33");
- return checkQuestions(st);
- }
- else if (event.equals("wrong"))
- {
- st.set("wrong", String.valueOf(st.getInt("wrong") + 1));
- return checkQuestions(st);
- }
- else if (event.equals("right"))
- {
- st.set("correct", String.valueOf(st.getInt("correct") + 1));
- return checkQuestions(st);
}
return htmltext;
@@ -233,13 +176,16 @@ public class Q419_GetAPet extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 15) ? "30731-01.htm" : "30731-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case MARTIN:
+ {
if (st.hasAtLeastOneQuestItem(ANIMAL_SLAYER_LIST_1, ANIMAL_SLAYER_LIST_2, ANIMAL_SLAYER_LIST_3, ANIMAL_SLAYER_LIST_4, ANIMAL_SLAYER_LIST_5))
{
final int proofs = st.getQuestItemsCount(BLOODY_FANG) + st.getQuestItemsCount(BLOODY_CLAW) + st.getQuestItemsCount(BLOODY_NAIL) + st.getQuestItemsCount(BLOODY_KASHA_FANG) + st.getQuestItemsCount(BLOODY_TARANTULA_NAIL);
@@ -265,20 +211,25 @@ public class Q419_GetAPet extends Quest
htmltext = "30731-16.htm";
}
break;
-
+ }
case BELLA:
+ {
htmltext = "30256-01.htm";
break;
-
+ }
case METTY:
+ {
htmltext = "30072-01.htm";
break;
-
+ }
case ELLIE:
+ {
htmltext = "30091-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q420_LittleWing/Q420_LittleWing.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q420_LittleWing/Q420_LittleWing.java
index f39bccf881..c5c7eee175 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q420_LittleWing/Q420_LittleWing.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q420_LittleWing/Q420_LittleWing.java
@@ -26,17 +26,19 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q420_LittleWing extends Quest
{
- // Needed items
- private static final int COAL = 1870;
- private static final int CHARCOAL = 1871;
- private static final int SILVER_NUGGET = 1873;
- private static final int STONE_OF_PURITY = 1875;
- private static final int GEMSTONE_D = 2130;
- private static final int GEMSTONE_C = 2131;
-
+ // NPCs
+ private static final int MARIA = 30608;
+ private static final int CRONOS = 30610;
+ private static final int BYRON = 30711;
+ private static final int MIMYU = 30747;
+ private static final int EXARION = 30748;
+ private static final int ZWOV = 30749;
+ private static final int KALIBRAN = 30750;
+ private static final int SUZET = 30751;
+ private static final int SHAMHAI = 30752;
+ private static final int COOPER = 30829;
// Items
private static final int FAIRY_DUST = 3499;
-
private static final int FAIRY_STONE = 3816;
private static final int DELUXE_FAIRY_STONE = 3817;
private static final int FAIRY_STONE_LIST = 3818;
@@ -53,26 +55,19 @@ public class Q420_LittleWing extends Quest
private static final int EGG_OF_WYVERN_SUZET = 3829;
private static final int SCALE_OF_WYVERN_SHAMHAI = 3830;
private static final int EGG_OF_WYVERN_SHAMHAI = 3831;
-
+ // Needed items
+ private static final int COAL = 1870;
+ private static final int CHARCOAL = 1871;
+ private static final int SILVER_NUGGET = 1873;
+ private static final int STONE_OF_PURITY = 1875;
+ private static final int GEMSTONE_D = 2130;
+ private static final int GEMSTONE_C = 2131;
// Rewards
private static final int DRAGONFLUTE_OF_WIND = 3500;
private static final int DRAGONFLUTE_OF_STAR = 3501;
private static final int DRAGONFLUTE_OF_TWILIGHT = 3502;
private static final int HATCHLING_SOFT_LEATHER = 3912;
private static final int FOOD_FOR_HATCHLING = 4038;
-
- // NPCs
- private static final int MARIA = 30608;
- private static final int CRONOS = 30610;
- private static final int BYRON = 30711;
- private static final int MIMYU = 30747;
- private static final int EXARION = 30748;
- private static final int ZWOV = 30749;
- private static final int KALIBRAN = 30750;
- private static final int SUZET = 30751;
- private static final int SHAMHAI = 30752;
- private static final int COOPER = 30829;
-
// Spawn Points
private static final Location[] LOCATIONS =
{
@@ -80,18 +75,15 @@ public class Q420_LittleWing extends Quest
new Location(108940, 41615, -4643, 0),
new Location(110395, 41625, -4642, 0)
};
-
+ // Misc
private static int _counter = 0;
public Q420_LittleWing()
{
super(420, "Little Wing");
-
registerQuestItems(FAIRY_STONE, DELUXE_FAIRY_STONE, FAIRY_STONE_LIST, DELUXE_FAIRY_STONE_LIST, TOAD_LORD_BACK_SKIN, JUICE_OF_MONKSHOOD, SCALE_OF_DRAKE_EXARION, EGG_OF_DRAKE_EXARION, SCALE_OF_DRAKE_ZWOV, EGG_OF_DRAKE_ZWOV, SCALE_OF_DRAKE_KALIBRAN, EGG_OF_DRAKE_KALIBRAN, SCALE_OF_WYVERN_SUZET, EGG_OF_WYVERN_SUZET, SCALE_OF_WYVERN_SHAMHAI, EGG_OF_WYVERN_SHAMHAI);
-
addStartNpc(COOPER, MIMYU);
addTalkId(MARIA, CRONOS, BYRON, MIMYU, EXARION, ZWOV, KALIBRAN, SUZET, SHAMHAI, COOPER);
-
addKillId(20202, 20231, 20233, 20270, 20551, 20580, 20589, 20590, 20591, 20592, 20593, 20594, 20595, 20596, 20597, 20598, 20599);
}
@@ -105,186 +97,200 @@ public class Q420_LittleWing extends Quest
return htmltext;
}
- // COOPER
- if (event.equals("30829-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- // CRONOS
- else if (event.equals("30610-05.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(FAIRY_STONE_LIST, 1);
- }
- else if (event.equals("30610-06.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(DELUXE_FAIRY_STONE_LIST, 1);
- }
- else if (event.equals("30610-12.htm"))
- {
- st.set("cond", "2");
- st.set("deluxestone", "1");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(FAIRY_STONE_LIST, 1);
- }
- else if (event.equals("30610-13.htm"))
- {
- st.set("cond", "2");
- st.set("deluxestone", "1");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(DELUXE_FAIRY_STONE_LIST, 1);
- }
- // MARIA
- else if (event.equals("30608-03.htm"))
- {
- if (!checkItems(st, false))
+ case "30829-02.htm":
{
- htmltext = "30608-01.htm"; // Avoid to continue while trade or drop mats before clicking bypass
+ st.startQuest();
+ break;
}
- else
+ case "30610-05.htm":
{
- st.takeItems(COAL, 10);
- st.takeItems(CHARCOAL, 10);
- st.takeItems(GEMSTONE_D, 1);
- st.takeItems(SILVER_NUGGET, 3);
- st.takeItems(TOAD_LORD_BACK_SKIN, -1);
- st.takeItems(FAIRY_STONE_LIST, 1);
- st.giveItems(FAIRY_STONE, 1);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(FAIRY_STONE_LIST, 1);
+ break;
}
- }
- else if (event.equals("30608-05.htm"))
- {
- if (!checkItems(st, true))
+ case "30610-06.htm":
{
- htmltext = "30608-01.htm"; // Avoid to continue while trade or drop mats before clicking bypass
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(DELUXE_FAIRY_STONE_LIST, 1);
+ break;
}
- else
+ case "30610-12.htm":
{
- st.takeItems(COAL, 10);
- st.takeItems(CHARCOAL, 10);
- st.takeItems(GEMSTONE_C, 1);
- st.takeItems(STONE_OF_PURITY, 1);
- st.takeItems(SILVER_NUGGET, 5);
- st.takeItems(TOAD_LORD_BACK_SKIN, -1);
- st.takeItems(DELUXE_FAIRY_STONE_LIST, 1);
- st.giveItems(DELUXE_FAIRY_STONE, 1);
+ st.setCond(2);
+ st.set("deluxestone", "1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(FAIRY_STONE_LIST, 1);
+ break;
}
- }
- // BYRON
- else if (event.equals("30711-03.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- if (st.hasQuestItems(DELUXE_FAIRY_STONE))
+ case "30610-13.htm":
{
- htmltext = "30711-04.htm";
+ st.setCond(2);
+ st.set("deluxestone", "1");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(DELUXE_FAIRY_STONE_LIST, 1);
+ break;
}
- }
- // MIMYU
- else if (event.equals("30747-02.htm"))
- {
- st.set("mimyu", "1");
- st.takeItems(FAIRY_STONE, 1);
- }
- else if (event.equals("30747-04.htm"))
- {
- st.set("mimyu", "1");
- st.takeItems(DELUXE_FAIRY_STONE, 1);
- st.giveItems(FAIRY_DUST, 1);
- }
- else if (event.equals("30747-07.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(JUICE_OF_MONKSHOOD, 1);
- }
- else if (event.equals("30747-12.htm") && !st.hasQuestItems(FAIRY_DUST))
- {
- htmltext = "30747-15.htm";
- giveRandomPet(st, false);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30747-13.htm"))
- {
- giveRandomPet(st, st.hasQuestItems(FAIRY_DUST));
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30747-14.htm"))
- {
- if (st.hasQuestItems(FAIRY_DUST))
+ case "30608-03.htm":
{
- st.takeItems(FAIRY_DUST, 1);
- giveRandomPet(st, true);
- if (Rnd.get(20) == 1)
+ if (!checkItems(st, false))
{
- st.giveItems(HATCHLING_SOFT_LEATHER, 1);
+ htmltext = "30608-01.htm"; // Avoid to continue while trade or drop mats before clicking bypass
}
else
{
- htmltext = "30747-14t.htm";
- st.giveItems(FOOD_FOR_HATCHLING, 20);
+ st.takeItems(COAL, 10);
+ st.takeItems(CHARCOAL, 10);
+ st.takeItems(GEMSTONE_D, 1);
+ st.takeItems(SILVER_NUGGET, 3);
+ st.takeItems(TOAD_LORD_BACK_SKIN, -1);
+ st.takeItems(FAIRY_STONE_LIST, 1);
+ st.giveItems(FAIRY_STONE, 1);
}
+ break;
+ }
+ case "30608-05.htm":
+ {
+ if (!checkItems(st, true))
+ {
+ htmltext = "30608-01.htm"; // Avoid to continue while trade or drop mats before clicking bypass
+ }
+ else
+ {
+ st.takeItems(COAL, 10);
+ st.takeItems(CHARCOAL, 10);
+ st.takeItems(GEMSTONE_C, 1);
+ st.takeItems(STONE_OF_PURITY, 1);
+ st.takeItems(SILVER_NUGGET, 5);
+ st.takeItems(TOAD_LORD_BACK_SKIN, -1);
+ st.takeItems(DELUXE_FAIRY_STONE_LIST, 1);
+ st.giveItems(DELUXE_FAIRY_STONE, 1);
+ }
+ break;
+ }
+ case "30711-03.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ if (st.hasQuestItems(DELUXE_FAIRY_STONE))
+ {
+ htmltext = "30711-04.htm";
+ }
+ break;
+ }
+ case "30747-02.htm":
+ {
+ st.set("mimyu", "1");
+ st.takeItems(FAIRY_STONE, 1);
+ break;
+ }
+ case "30747-04.htm":
+ {
+ st.set("mimyu", "1");
+ st.takeItems(DELUXE_FAIRY_STONE, 1);
+ st.giveItems(FAIRY_DUST, 1);
+ break;
+ }
+ case "30747-07.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(JUICE_OF_MONKSHOOD, 1);
+ break;
+ }
+ case "30747-12.htm":
+ {
+ if (!st.hasQuestItems(FAIRY_DUST))
+ {
+ htmltext = "30747-15.htm";
+ giveRandomPet(st, false);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ break;
+ }
+ case "30747-13.htm":
+ {
+ giveRandomPet(st, st.hasQuestItems(FAIRY_DUST));
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
+ break;
}
- else
+ case "30747-14.htm":
{
- htmltext = "30747-13.htm";
+ if (st.hasQuestItems(FAIRY_DUST))
+ {
+ st.takeItems(FAIRY_DUST, 1);
+ giveRandomPet(st, true);
+ if (Rnd.get(20) == 1)
+ {
+ st.giveItems(HATCHLING_SOFT_LEATHER, 1);
+ }
+ else
+ {
+ htmltext = "30747-14t.htm";
+ st.giveItems(FOOD_FOR_HATCHLING, 20);
+ }
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "30747-13.htm";
+ }
+ break;
+ }
+ case "30748-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JUICE_OF_MONKSHOOD, 1);
+ st.giveItems(SCALE_OF_DRAKE_EXARION, 1);
+ break;
+ }
+ case "30749-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JUICE_OF_MONKSHOOD, 1);
+ st.giveItems(SCALE_OF_DRAKE_ZWOV, 1);
+ break;
+ }
+ case "30750-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JUICE_OF_MONKSHOOD, 1);
+ st.giveItems(SCALE_OF_DRAKE_KALIBRAN, 1);
+ break;
+ }
+ case "30750-05.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(EGG_OF_DRAKE_KALIBRAN, 19);
+ st.takeItems(SCALE_OF_DRAKE_KALIBRAN, 1);
+ break;
+ }
+ case "30751-03.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JUICE_OF_MONKSHOOD, 1);
+ st.giveItems(SCALE_OF_WYVERN_SUZET, 1);
+ break;
+ }
+ case "30752-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(JUICE_OF_MONKSHOOD, 1);
+ st.giveItems(SCALE_OF_WYVERN_SHAMHAI, 1);
+ break;
}
- }
- // EXARION
- else if (event.equals("30748-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JUICE_OF_MONKSHOOD, 1);
- st.giveItems(SCALE_OF_DRAKE_EXARION, 1);
- }
- // ZWOV
- else if (event.equals("30749-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JUICE_OF_MONKSHOOD, 1);
- st.giveItems(SCALE_OF_DRAKE_ZWOV, 1);
- }
- // KALIBRAN
- else if (event.equals("30750-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JUICE_OF_MONKSHOOD, 1);
- st.giveItems(SCALE_OF_DRAKE_KALIBRAN, 1);
- }
- else if (event.equals("30750-05.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(EGG_OF_DRAKE_KALIBRAN, 19);
- st.takeItems(SCALE_OF_DRAKE_KALIBRAN, 1);
- }
- // SUZET
- else if (event.equals("30751-03.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JUICE_OF_MONKSHOOD, 1);
- st.giveItems(SCALE_OF_WYVERN_SUZET, 1);
- }
- // SHAMHAI
- else if (event.equals("30752-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(JUICE_OF_MONKSHOOD, 1);
- st.giveItems(SCALE_OF_WYVERN_SHAMHAI, 1);
}
return htmltext;
@@ -303,29 +309,36 @@ public class Q420_LittleWing extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
switch (npc.getNpcId())
{
case COOPER:
+ {
htmltext = (player.getLevel() >= 35) ? "30829-01.htm" : "30829-03.htm";
break;
-
+ }
case MIMYU:
+ {
_counter += 1;
final Location loc = LOCATIONS[_counter % 3];
npc.teleToLocation(loc.getX(), loc.getY(), loc.getZ());
return null;
+ }
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case COOPER:
+ {
htmltext = "30829-04.htm";
break;
-
+ }
case CRONOS:
+ {
if (cond == 1)
{
htmltext = "30610-01.htm";
@@ -345,7 +358,7 @@ public class Q420_LittleWing extends Quest
else
{
htmltext = "30610-08.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -363,8 +376,9 @@ public class Q420_LittleWing extends Quest
htmltext = "30610-11.htm";
}
break;
-
+ }
case MARIA:
+ {
if (st.hasAtLeastOneQuestItem(FAIRY_STONE, DELUXE_FAIRY_STONE))
{
htmltext = "30608-06.htm";
@@ -381,22 +395,23 @@ public class Q420_LittleWing extends Quest
}
}
break;
-
+ }
case BYRON:
+ {
final int deluxestone = st.getInt("deluxestone");
if (deluxestone == 1)
{
if (st.hasQuestItems(FAIRY_STONE))
{
htmltext = "30711-05.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.unset("deluxestone");
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (st.hasQuestItems(DELUXE_FAIRY_STONE))
{
htmltext = "30711-06.htm";
- st.set("cond", "4");
+ st.setCond(4);
st.unset("deluxestone");
st.playSound(QuestState.SOUND_MIDDLE);
}
@@ -425,8 +440,9 @@ public class Q420_LittleWing extends Quest
}
}
break;
-
+ }
case MIMYU:
+ {
if (cond == 4)
{
if (st.getInt("mimyu") == 1)
@@ -470,8 +486,9 @@ public class Q420_LittleWing extends Quest
return null;
}
break;
-
+ }
case EXARION:
+ {
if (cond == 5)
{
htmltext = "30748-01.htm";
@@ -485,7 +502,7 @@ public class Q420_LittleWing extends Quest
else
{
htmltext = "30748-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(EGG_OF_DRAKE_EXARION, 19);
st.takeItems(SCALE_OF_DRAKE_EXARION, 1);
@@ -496,8 +513,9 @@ public class Q420_LittleWing extends Quest
htmltext = "30748-05.htm";
}
break;
-
+ }
case ZWOV:
+ {
if (cond == 5)
{
htmltext = "30749-01.htm";
@@ -511,7 +529,7 @@ public class Q420_LittleWing extends Quest
else
{
htmltext = "30749-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(EGG_OF_DRAKE_ZWOV, 19);
st.takeItems(SCALE_OF_DRAKE_ZWOV, 1);
@@ -522,8 +540,9 @@ public class Q420_LittleWing extends Quest
htmltext = "30749-05.htm";
}
break;
-
+ }
case KALIBRAN:
+ {
if (cond == 5)
{
htmltext = "30750-01.htm";
@@ -537,8 +556,9 @@ public class Q420_LittleWing extends Quest
htmltext = "30750-06.htm";
}
break;
-
+ }
case SUZET:
+ {
if (cond == 5)
{
htmltext = "30751-01.htm";
@@ -552,7 +572,7 @@ public class Q420_LittleWing extends Quest
else
{
htmltext = "30751-05.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(EGG_OF_WYVERN_SUZET, 19);
st.takeItems(SCALE_OF_WYVERN_SUZET, 1);
@@ -563,8 +583,9 @@ public class Q420_LittleWing extends Quest
htmltext = "30751-06.htm";
}
break;
-
+ }
case SHAMHAI:
+ {
if (cond == 5)
{
htmltext = "30752-01.htm";
@@ -578,7 +599,7 @@ public class Q420_LittleWing extends Quest
else
{
htmltext = "30752-04.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(EGG_OF_WYVERN_SHAMHAI, 19);
st.takeItems(SCALE_OF_WYVERN_SHAMHAI, 1);
@@ -589,8 +610,10 @@ public class Q420_LittleWing extends Quest
htmltext = "30752-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -608,6 +631,7 @@ public class Q420_LittleWing extends Quest
switch (npc.getNpcId())
{
case 20231:
+ {
if (st.hasQuestItems(FAIRY_STONE_LIST))
{
st.dropItems(TOAD_LORD_BACK_SKIN, 1, 10, 300000);
@@ -617,42 +641,47 @@ public class Q420_LittleWing extends Quest
st.dropItems(TOAD_LORD_BACK_SKIN, 1, 20, 300000);
}
break;
-
+ }
case 20580:
+ {
if (st.hasQuestItems(SCALE_OF_DRAKE_EXARION) && !st.dropItems(EGG_OF_DRAKE_EXARION, 1, 20, 500000))
{
npc.broadcastNpcSay("If the eggs get taken, we're dead!");
}
break;
-
+ }
case 20233:
+ {
if (st.hasQuestItems(SCALE_OF_DRAKE_ZWOV))
{
st.dropItems(EGG_OF_DRAKE_ZWOV, 1, 20, 500000);
}
break;
-
+ }
case 20551:
+ {
if (st.hasQuestItems(SCALE_OF_DRAKE_KALIBRAN) && !st.dropItems(EGG_OF_DRAKE_KALIBRAN, 1, 20, 500000))
{
npc.broadcastNpcSay("Hey! Everybody watch the eggs!");
}
break;
-
+ }
case 20270:
+ {
if (st.hasQuestItems(SCALE_OF_WYVERN_SUZET) && !st.dropItems(EGG_OF_WYVERN_SUZET, 1, 20, 500000))
{
npc.broadcastNpcSay("I thought I'd caught one share... Whew!");
}
break;
-
+ }
case 20202:
+ {
if (st.hasQuestItems(SCALE_OF_WYVERN_SHAMHAI))
{
st.dropItems(EGG_OF_WYVERN_SHAMHAI, 1, 20, 500000);
}
break;
-
+ }
case 20589:
case 20590:
case 20591:
@@ -664,6 +693,7 @@ public class Q420_LittleWing extends Quest
case 20597:
case 20598:
case 20599:
+ {
if (st.hasQuestItems(DELUXE_FAIRY_STONE) && (Rnd.get(100) < 30))
{
st.set("deluxestone", "2");
@@ -672,6 +702,7 @@ public class Q420_LittleWing extends Quest
npc.broadcastNpcSay("The stone... the Elven stone... broke...");
}
break;
+ }
}
return null;
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q421_LittleWingsBigAdventure/Q421_LittleWingsBigAdventure.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q421_LittleWingsBigAdventure/Q421_LittleWingsBigAdventure.java
index 592312bf2e..f7e3e47830 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q421_LittleWingsBigAdventure/Q421_LittleWingsBigAdventure.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q421_LittleWingsBigAdventure/Q421_LittleWingsBigAdventure.java
@@ -45,19 +45,15 @@ public class Q421_LittleWingsBigAdventure extends Quest
// NPCs
private static final int CRONOS = 30610;
private static final int MIMYU = 30747;
-
// Item
private static final int FAIRY_LEAF = 4325;
public Q421_LittleWingsBigAdventure()
{
super(421, "Little Wing's Big Adventure");
-
registerQuestItems(FAIRY_LEAF);
-
addStartNpc(CRONOS);
addTalkId(CRONOS, MIMYU);
-
addAttackId(27185, 27186, 27187, 27188);
addKillId(27185, 27186, 27187, 27188);
}
@@ -72,50 +68,53 @@ public class Q421_LittleWingsBigAdventure extends Quest
return htmltext;
}
- if (event.equals("30610-06.htm"))
+ switch (event)
{
- if ((st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) == 1)
+ case "30610-06.htm":
{
- // Find the level of the flute.
- for (int i = 3500; i < 3503; i++)
+ if ((st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) == 1)
{
- final ItemInstance item = player.getInventory().getItemByItemId(i);
- if ((item != null) && (item.getEnchantLevel() >= 55))
+ // Find the level of the flute.
+ for (int i = 3500; i < 3503; i++)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("iCond", "1");
- st.set("summonOid", String.valueOf(item.getObjectId()));
- st.playSound(QuestState.SOUND_ACCEPT);
- return "30610-05.htm";
+ final ItemInstance item = player.getInventory().getItemByItemId(i);
+ if ((item != null) && (item.getEnchantLevel() >= 55))
+ {
+ st.startQuest();
+ st.set("iCond", "1");
+ st.set("summonOid", String.valueOf(item.getObjectId()));
+ return "30610-05.htm";
+ }
}
}
+ // Exit quest if you got more than one flute, or the flute level doesn't meat requirements.
+ st.exitQuest(true);
+ break;
}
-
- // Exit quest if you got more than one flute, or the flute level doesn't meat requirements.
- st.exitQuest(true);
- }
- else if (event.equals("30747-02.htm"))
- {
- final Summon summon = player.getPet();
- if (summon != null)
+ case "30747-02.htm":
{
- htmltext = (summon.getControlItemId() == st.getInt("summonOid")) ? "30747-04.htm" : "30747-03.htm";
+ final Summon summon = player.getPet();
+ if (summon != null)
+ {
+ htmltext = (summon.getControlItemId() == st.getInt("summonOid")) ? "30747-04.htm" : "30747-03.htm";
+ }
+ break;
}
- }
- else if (event.equals("30747-05.htm"))
- {
- final Summon summon = player.getPet();
- if ((summon == null) || (summon.getControlItemId() != st.getInt("summonOid")))
+ case "30747-05.htm":
{
- htmltext = "30747-06.htm";
- }
- else
- {
- st.set("cond", "2");
- st.set("iCond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(FAIRY_LEAF, 4);
+ final Summon summon = player.getPet();
+ if ((summon == null) || (summon.getControlItemId() != st.getInt("summonOid")))
+ {
+ htmltext = "30747-06.htm";
+ }
+ else
+ {
+ st.setCond(2);
+ st.set("iCond", "3");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(FAIRY_LEAF, 4);
+ }
+ break;
}
}
@@ -135,6 +134,7 @@ public class Q421_LittleWingsBigAdventure extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
// Wrong level.
if (player.getLevel() < 45)
{
@@ -160,15 +160,18 @@ public class Q421_LittleWingsBigAdventure extends Quest
htmltext = "30610-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case CRONOS:
+ {
htmltext = "30610-07.htm";
break;
-
+ }
case MIMYU:
+ {
final int id = st.getInt("iCond");
if (id == 1)
{
@@ -223,7 +226,7 @@ public class Q421_LittleWingsBigAdventure extends Quest
if ((item != null) && (item.getObjectId() == st.getInt("summonOid")))
{
st.takeItems(i, 1);
- st.giveItems(i + 922, 1, item.getEnchantLevel()); // TODO rebuild entirely pet system in order enchant is given a fuck. Supposed to give an item level XX for a flute level XX.
+ st.giveItems(i + 922, 1, item.getEnchantLevel()); // TODO: rebuild entirely pet system in order enchant is given a fuck. Supposed to give an item level XX for a flute level XX.
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
return "30747-16.htm";
@@ -240,8 +243,10 @@ public class Q421_LittleWingsBigAdventure extends Quest
}
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -263,7 +268,7 @@ public class Q421_LittleWingsBigAdventure extends Quest
}
// Condition required : 2.
- final QuestState st = checkPlayerCondition(attacker, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(attacker, npc, 2);
if (st == null)
{
return null;
@@ -287,7 +292,7 @@ public class Q421_LittleWingsBigAdventure extends Quest
// Four leafs have been used ; update quest state.
if (st.getInt("iCond") == 63)
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
}
else
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q422_RepentYourSins/Q422_RepentYourSins.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q422_RepentYourSins/Q422_RepentYourSins.java
index 316850fc0c..381a1c53e1 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q422_RepentYourSins/Q422_RepentYourSins.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q422_RepentYourSins/Q422_RepentYourSins.java
@@ -27,23 +27,6 @@ import org.l2jmobius.gameserver.network.serverpackets.UserInfo;
public class Q422_RepentYourSins extends Quest
{
- // Items
- private static final int RATMAN_SCAVENGER_SKULL = 4326;
- private static final int TUREK_WAR_HOUND_TAIL = 4327;
- private static final int TYRANT_KINGPIN_HEART = 4328;
- private static final int TRISALIM_TARANTULA_VENOM_SAC = 4329;
-
- private static final int QITEM_PENITENT_MANACLES = 4330;
- private static final int MANUAL_OF_MANACLES = 4331;
- private static final int PENITENT_MANACLES = 4425;
- private static final int LEFT_PENITENT_MANACLES = 4426;
-
- private static final int SILVER_NUGGET = 1873;
- private static final int ADAMANTINE_NUGGET = 1877;
- private static final int BLACKSMITH_FRAME = 1892;
- private static final int COKES = 1879;
- private static final int STEEL = 1880;
-
// NPCs
private static final int BLACK_JUDGE = 30981;
private static final int KATARI = 30668;
@@ -51,16 +34,27 @@ public class Q422_RepentYourSins extends Quest
private static final int CASIAN = 30612;
private static final int JOAN = 30718;
private static final int PUSHKIN = 30300;
+ // Items
+ private static final int RATMAN_SCAVENGER_SKULL = 4326;
+ private static final int TUREK_WAR_HOUND_TAIL = 4327;
+ private static final int TYRANT_KINGPIN_HEART = 4328;
+ private static final int TRISALIM_TARANTULA_VENOM_SAC = 4329;
+ private static final int QITEM_PENITENT_MANACLES = 4330;
+ private static final int MANUAL_OF_MANACLES = 4331;
+ private static final int PENITENT_MANACLES = 4425;
+ private static final int LEFT_PENITENT_MANACLES = 4426;
+ private static final int SILVER_NUGGET = 1873;
+ private static final int ADAMANTINE_NUGGET = 1877;
+ private static final int BLACKSMITH_FRAME = 1892;
+ private static final int COKES = 1879;
+ private static final int STEEL = 1880;
public Q422_RepentYourSins()
{
super(422, "Repent Your Sins");
-
registerQuestItems(RATMAN_SCAVENGER_SKULL, TUREK_WAR_HOUND_TAIL, TYRANT_KINGPIN_HEART, TRISALIM_TARANTULA_VENOM_SAC, MANUAL_OF_MANACLES, PENITENT_MANACLES, QITEM_PENITENT_MANACLES);
-
addStartNpc(BLACK_JUDGE);
addTalkId(BLACK_JUDGE, KATARI, PIOTUR, CASIAN, JOAN, PUSHKIN);
-
addKillId(20039, 20494, 20193, 20561);
}
@@ -74,119 +68,121 @@ public class Q422_RepentYourSins extends Quest
return htmltext;
}
- if (event.equals("Start"))
+ switch (event)
{
- st.set("cond", "1");
- if (player.getLevel() <= 20)
+ case "Start":
{
- htmltext = "30981-03.htm";
- st.set("cond", "2");
- }
- else if ((player.getLevel() >= 20) && (player.getLevel() <= 30))
- {
- htmltext = "30981-04.htm";
- st.set("cond", "3");
- }
- else if ((player.getLevel() >= 30) && (player.getLevel() <= 40))
- {
- htmltext = "30981-05.htm";
- st.set("cond", "4");
- }
- else
- {
- htmltext = "30981-06.htm";
- st.set("cond", "5");
- }
- st.setState(State.STARTED);
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30981-11.htm"))
- {
- if (!st.hasQuestItems(PENITENT_MANACLES))
- {
- final int cond = st.getInt("cond");
-
- // Case you return back the qitem to Black Judge. She rewards you with the pet item.
- if (cond == 15)
+ st.startQuest();
+ if (player.getLevel() <= 20)
{
- st.set("cond", "16");
- st.set("level", String.valueOf(player.getLevel()));
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(QITEM_PENITENT_MANACLES, -1);
- st.giveItems(PENITENT_MANACLES, 1);
+ htmltext = "30981-03.htm";
+ st.setCond(2);
}
- // Case you return back to Black Judge with leftover of previous quest.
- else if (cond == 16)
+ else if ((player.getLevel() >= 20) && (player.getLevel() <= 30))
{
- st.set("level", String.valueOf(player.getLevel()));
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(LEFT_PENITENT_MANACLES, -1);
- st.giveItems(PENITENT_MANACLES, 1);
+ htmltext = "30981-04.htm";
+ st.setCond(3);
}
- }
- }
- else if (event.equals("30981-19.htm"))
- {
- if (st.hasQuestItems(LEFT_PENITENT_MANACLES))
- {
- st.setState(State.STARTED);
- st.set("cond", "16");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- }
- else if (event.equals("Pk"))
- {
- final Summon pet = player.getPet();
-
- // If Sin Eater is currently summoned, show a warning.
- if ((pet != null) && (pet.getNpcId() == 12564))
- {
- htmltext = "30981-16.htm";
- }
- else if (findSinEaterLvl(player) > st.getInt("level"))
- {
- st.takeItems(PENITENT_MANACLES, 1);
- st.giveItems(LEFT_PENITENT_MANACLES, 1);
-
- final int removePkAmount = Rnd.get(10) + 1;
-
- // Player's PKs are lower than random amount ; finish the quest.
- if (player.getPkKills() <= removePkAmount)
+ else if ((player.getLevel() >= 30) && (player.getLevel() <= 40))
{
- htmltext = "30981-15.htm";
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
-
- player.setPkKills(0);
- player.sendPacket(new UserInfo(player));
+ htmltext = "30981-05.htm";
+ st.setCond(4);
}
- // Player's PK are bigger than random amount ; continue the quest.
else
{
- htmltext = "30981-14.htm";
- st.set("level", String.valueOf(player.getLevel()));
- st.playSound(QuestState.SOUND_MIDDLE);
-
- player.setPkKills(player.getPkKills() - removePkAmount);
- player.sendPacket(new UserInfo(player));
+ htmltext = "30981-06.htm";
+ st.setCond(5);
}
+ break;
+ }
+ case "30981-11.htm":
+ {
+ if (!st.hasQuestItems(PENITENT_MANACLES))
+ {
+ final int cond = st.getCond();
+
+ // Case you return back the qitem to Black Judge. She rewards you with the pet item.
+ if (cond == 15)
+ {
+ st.setCond(16);
+ st.set("level", String.valueOf(player.getLevel()));
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(QITEM_PENITENT_MANACLES, -1);
+ st.giveItems(PENITENT_MANACLES, 1);
+ }
+ // Case you return back to Black Judge with leftover of previous quest.
+ else if (cond == 16)
+ {
+ st.set("level", String.valueOf(player.getLevel()));
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(LEFT_PENITENT_MANACLES, -1);
+ st.giveItems(PENITENT_MANACLES, 1);
+ }
+ }
+ break;
+ }
+ case "30981-19.htm":
+ {
+ if (st.hasQuestItems(LEFT_PENITENT_MANACLES))
+ {
+ st.setState(State.STARTED);
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_ACCEPT);
+ }
+ break;
+ }
+ case "Pk":
+ {
+ final Summon pet = player.getPet();
+ // If Sin Eater is currently summoned, show a warning.
+ if ((pet != null) && (pet.getNpcId() == 12564))
+ {
+ htmltext = "30981-16.htm";
+ }
+ else if (findSinEaterLvl(player) > st.getInt("level"))
+ {
+ st.takeItems(PENITENT_MANACLES, 1);
+ st.giveItems(LEFT_PENITENT_MANACLES, 1);
+
+ final int removePkAmount = Rnd.get(10) + 1;
+
+ // Player's PKs are lower than random amount ; finish the quest.
+ if (player.getPkKills() <= removePkAmount)
+ {
+ htmltext = "30981-15.htm";
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+
+ player.setPkKills(0);
+ player.sendPacket(new UserInfo(player));
+ }
+ // Player's PK are bigger than random amount ; continue the quest.
+ else
+ {
+ htmltext = "30981-14.htm";
+ st.set("level", String.valueOf(player.getLevel()));
+ st.playSound(QuestState.SOUND_MIDDLE);
+
+ player.setPkKills(player.getPkKills() - removePkAmount);
+ player.sendPacket(new UserInfo(player));
+ }
+ }
+ break;
+ }
+ case "Quit":
+ {
+ htmltext = "30981-20.htm";
+ st.takeItems(RATMAN_SCAVENGER_SKULL, -1);
+ st.takeItems(TUREK_WAR_HOUND_TAIL, -1);
+ st.takeItems(TYRANT_KINGPIN_HEART, -1);
+ st.takeItems(TRISALIM_TARANTULA_VENOM_SAC, -1);
+ st.takeItems(MANUAL_OF_MANACLES, -1);
+ st.takeItems(PENITENT_MANACLES, -1);
+ st.takeItems(QITEM_PENITENT_MANACLES, -1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("Quit"))
- {
- htmltext = "30981-20.htm";
-
- st.takeItems(RATMAN_SCAVENGER_SKULL, -1);
- st.takeItems(TUREK_WAR_HOUND_TAIL, -1);
- st.takeItems(TYRANT_KINGPIN_HEART, -1);
- st.takeItems(TRISALIM_TARANTULA_VENOM_SAC, -1);
-
- st.takeItems(MANUAL_OF_MANACLES, -1);
- st.takeItems(PENITENT_MANACLES, -1);
- st.takeItems(QITEM_PENITENT_MANACLES, -1);
-
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -205,6 +201,7 @@ public class Q422_RepentYourSins extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getPkKills() >= 1)
{
htmltext = (st.hasQuestItems(LEFT_PENITENT_MANACLES)) ? "30981-18.htm" : "30981-02.htm";
@@ -214,12 +211,14 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30981-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case BLACK_JUDGE:
+ {
if (cond <= 9)
{
htmltext = "30981-07.htm";
@@ -227,7 +226,7 @@ public class Q422_RepentYourSins extends Quest
else if ((cond > 9) && (cond < 14))
{
htmltext = "30981-08.htm";
- st.set("cond", "14");
+ st.setCond(14);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(MANUAL_OF_MANACLES, 1);
}
@@ -251,12 +250,13 @@ public class Q422_RepentYourSins extends Quest
}
}
break;
-
+ }
case KATARI:
+ {
if (cond == 2)
{
htmltext = "30668-01.htm";
- st.set("cond", "6");
+ st.setCond(6);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 6)
@@ -268,7 +268,7 @@ public class Q422_RepentYourSins extends Quest
else
{
htmltext = "30668-03.htm";
- st.set("cond", "10");
+ st.setCond(10);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(RATMAN_SCAVENGER_SKULL, -1);
}
@@ -278,12 +278,13 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30668-04.htm";
}
break;
-
+ }
case PIOTUR:
+ {
if (cond == 3)
{
htmltext = "30597-01.htm";
- st.set("cond", "7");
+ st.setCond(7);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 7)
@@ -295,7 +296,7 @@ public class Q422_RepentYourSins extends Quest
else
{
htmltext = "30597-03.htm";
- st.set("cond", "11");
+ st.setCond(11);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TUREK_WAR_HOUND_TAIL, -1);
}
@@ -305,12 +306,13 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30597-04.htm";
}
break;
-
+ }
case CASIAN:
+ {
if (cond == 4)
{
htmltext = "30612-01.htm";
- st.set("cond", "8");
+ st.setCond(8);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 8)
@@ -322,7 +324,7 @@ public class Q422_RepentYourSins extends Quest
else
{
htmltext = "30612-03.htm";
- st.set("cond", "12");
+ st.setCond(12);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TYRANT_KINGPIN_HEART, -1);
}
@@ -332,12 +334,13 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30612-04.htm";
}
break;
-
+ }
case JOAN:
+ {
if (cond == 5)
{
htmltext = "30718-01.htm";
- st.set("cond", "9");
+ st.setCond(9);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 9)
@@ -349,7 +352,7 @@ public class Q422_RepentYourSins extends Quest
else
{
htmltext = "30718-03.htm";
- st.set("cond", "13");
+ st.setCond(13);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(TRISALIM_TARANTULA_VENOM_SAC, -1);
}
@@ -359,8 +362,9 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30718-04.htm";
}
break;
-
+ }
case PUSHKIN:
+ {
if ((cond == 14) && (st.getQuestItemsCount(MANUAL_OF_MANACLES) == 1))
{
if ((st.getQuestItemsCount(SILVER_NUGGET) < 10) || (st.getQuestItemsCount(STEEL) < 5) || (st.getQuestItemsCount(ADAMANTINE_NUGGET) < 2) || (st.getQuestItemsCount(COKES) < 10) || (st.getQuestItemsCount(BLACKSMITH_FRAME) < 1))
@@ -370,7 +374,7 @@ public class Q422_RepentYourSins extends Quest
else
{
htmltext = "30300-01.htm";
- st.set("cond", "15");
+ st.setCond(15);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(MANUAL_OF_MANACLES, 1);
@@ -388,8 +392,10 @@ public class Q422_RepentYourSins extends Quest
htmltext = "30300-03.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -407,32 +413,37 @@ public class Q422_RepentYourSins extends Quest
switch (npc.getNpcId())
{
case 20039:
- if (st.getInt("cond") == 6)
+ {
+ if (st.isCond(6))
{
st.dropItemsAlways(RATMAN_SCAVENGER_SKULL, 1, 10);
}
break;
-
+ }
case 20494:
- if (st.getInt("cond") == 7)
+ {
+ if (st.isCond(7))
{
st.dropItemsAlways(TUREK_WAR_HOUND_TAIL, 1, 10);
}
break;
-
+ }
case 20193:
- if (st.getInt("cond") == 8)
+ {
+ if (st.isCond(8))
{
st.dropItemsAlways(TYRANT_KINGPIN_HEART, 1, 1);
}
break;
-
+ }
case 20561:
- if (st.getInt("cond") == 9)
+ {
+ if (st.isCond(9))
{
st.dropItemsAlways(TRISALIM_TARANTULA_VENOM_SAC, 1, 3);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q426_QuestForFishingShot/Q426_QuestForFishingShot.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q426_QuestForFishingShot/Q426_QuestForFishingShot.java
index 17706b6319..a850f201b7 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q426_QuestForFishingShot/Q426_QuestForFishingShot.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q426_QuestForFishingShot/Q426_QuestForFishingShot.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q426_QuestForFishingShot extends Quest
{
private static final int SWEET_FLUID = 7586;
-
private static final Map MOBS1 = new HashMap<>();
static
{
@@ -204,7 +203,6 @@ public class Q426_QuestForFishingShot extends Quest
MOBS1.put(21641, 195);
MOBS1.put(21644, 170);
}
-
private static final Map MOBS2 = new HashMap<>();
static
{
@@ -235,7 +233,6 @@ public class Q426_QuestForFishingShot extends Quest
MOBS2.put(21518, 255);
MOBS2.put(21636, 950);
}
-
private static final Map MOBS3 = new HashMap<>();
static
{
@@ -256,7 +253,6 @@ public class Q426_QuestForFishingShot extends Quest
MOBS3.put(21081, 955);
MOBS3.put(21264, 920);
}
-
private static final Map MOBS4 = new HashMap<>();
static
{
@@ -280,7 +276,6 @@ public class Q426_QuestForFishingShot extends Quest
MOBS4.put(21655, 640);
MOBS4.put(21657, 935);
}
-
private static final Map MOBS5 = new HashMap<>();
static
{
@@ -293,70 +288,30 @@ public class Q426_QuestForFishingShot extends Quest
MOBS5.put(21654, 400);
MOBS5.put(21656, 750);
}
-
- private static final Map MOBSspecial = new HashMap<>();
+ private static final Map MOB_SPECIAL = new HashMap<>();
static
{
- MOBSspecial.put(20829, new int[]
- {
- 115,
- 6
- });
- MOBSspecial.put(20859, new int[]
- {
- 890,
- 8
- });
- MOBSspecial.put(21066, new int[]
- {
- 5,
- 5
- });
- MOBSspecial.put(21068, new int[]
- {
- 565,
- 11
- });
- MOBSspecial.put(21071, new int[]
- {
- 400,
- 12
- });
+ // @formatter:off
+ MOB_SPECIAL.put(20829, new int[]{115, 6});
+ MOB_SPECIAL.put(20859, new int[]{890, 8});
+ MOB_SPECIAL.put(21066, new int[]{5, 5});
+ MOB_SPECIAL.put(21068, new int[]{565, 11});
+ MOB_SPECIAL.put(21071, new int[]{400, 12});
+ // @formatter:on
}
public Q426_QuestForFishingShot()
{
super(426, "Quest for Fishing Shot");
-
registerQuestItems(SWEET_FLUID);
-
addStartNpc(31562, 31563, 31564, 31565, 31566, 31567, 31568, 31569, 31570, 31571, 31572, 31573, 31574, 31575, 31576, 31577, 31578, 31579, 31696, 31697, 31989, 32007);
addTalkId(31562, 31563, 31564, 31565, 31566, 31567, 31568, 31569, 31570, 31571, 31572, 31573, 31574, 31575, 31576, 31577, 31578, 31579, 31696, 31697, 31989, 32007);
-
- for (int mob : MOBS1.keySet())
- {
- addKillId(mob);
- }
- for (int mob : MOBS2.keySet())
- {
- addKillId(mob);
- }
- for (int mob : MOBS3.keySet())
- {
- addKillId(mob);
- }
- for (int mob : MOBS4.keySet())
- {
- addKillId(mob);
- }
- for (int mob : MOBS5.keySet())
- {
- addKillId(mob);
- }
- for (int mob : MOBSspecial.keySet())
- {
- addKillId(mob);
- }
+ addKillId(MOBS1.keySet());
+ addKillId(MOBS2.keySet());
+ addKillId(MOBS3.keySet());
+ addKillId(MOBS4.keySet());
+ addKillId(MOBS5.keySet());
+ addKillId(MOB_SPECIAL.keySet());
}
@Override
@@ -371,9 +326,7 @@ public class Q426_QuestForFishingShot extends Quest
if (event.equals("03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("08.htm"))
{
@@ -397,12 +350,15 @@ public class Q426_QuestForFishingShot extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(SWEET_FLUID)) ? "05.htm" : "04.htm";
break;
+ }
}
return htmltext;
@@ -423,10 +379,9 @@ public class Q426_QuestForFishingShot extends Quest
return null;
}
- final int npcId = npc.getNpcId();
int drop = 0;
int chance = 0;
-
+ final int npcId = npc.getNpcId();
if (MOBS1.containsKey(npcId))
{
chance = MOBS1.get(npcId);
@@ -451,10 +406,10 @@ public class Q426_QuestForFishingShot extends Quest
chance = MOBS5.get(npcId);
drop = 4;
}
- else if (MOBSspecial.containsKey(npcId))
+ else if (MOB_SPECIAL.containsKey(npcId))
{
- chance = MOBSspecial.get(npcId)[0];
- drop = MOBSspecial.get(npcId)[1];
+ chance = MOB_SPECIAL.get(npcId)[0];
+ drop = MOB_SPECIAL.get(npcId)[1];
}
if (Rnd.get(1000) <= chance)
@@ -467,6 +422,7 @@ public class Q426_QuestForFishingShot extends Quest
st.playSound(QuestState.SOUND_ITEMGET);
st.rewardItems(SWEET_FLUID, drop);
}
+
return null;
}
}
\ No newline at end of file
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q431_WeddingMarch/Q431_WeddingMarch.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q431_WeddingMarch/Q431_WeddingMarch.java
index 4060b1f71c..f9de10e6d0 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q431_WeddingMarch/Q431_WeddingMarch.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q431_WeddingMarch/Q431_WeddingMarch.java
@@ -26,22 +26,17 @@ public class Q431_WeddingMarch extends Quest
{
// NPC
private static final int KANTABILON = 31042;
-
// Item
private static final int SILVER_CRYSTAL = 7540;
-
// Reward
private static final int WEDDING_ECHO_CRYSTAL = 7062;
public Q431_WeddingMarch()
{
super(431, "Wedding March");
-
registerQuestItems(SILVER_CRYSTAL);
-
addStartNpc(KANTABILON);
addTalkId(KANTABILON);
-
addKillId(20786, 20787);
}
@@ -57,9 +52,7 @@ public class Q431_WeddingMarch extends Quest
if (event.equals("31042-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31042-05.htm"))
{
@@ -92,11 +85,13 @@ public class Q431_WeddingMarch extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 38) ? "31042-00.htm" : "31042-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31042-02.htm";
@@ -106,6 +101,7 @@ public class Q431_WeddingMarch extends Quest
htmltext = (st.getQuestItemsCount(SILVER_CRYSTAL) < 50) ? "31042-03.htm" : "31042-04.htm";
}
break;
+ }
}
return htmltext;
@@ -114,7 +110,7 @@ public class Q431_WeddingMarch extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -128,7 +124,7 @@ public class Q431_WeddingMarch extends Quest
if (st.dropItems(SILVER_CRYSTAL, 1, 50, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q432_BirthdayPartySong/Q432_BirthdayPartySong.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q432_BirthdayPartySong/Q432_BirthdayPartySong.java
index fc49584466..50f909ce0c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q432_BirthdayPartySong/Q432_BirthdayPartySong.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q432_BirthdayPartySong/Q432_BirthdayPartySong.java
@@ -26,19 +26,15 @@ public class Q432_BirthdayPartySong extends Quest
{
// NPC
private static final int OCTAVIA = 31043;
-
// Item
private static final int RED_CRYSTAL = 7541;
public Q432_BirthdayPartySong()
{
super(432, "Birthday Party Song");
-
registerQuestItems(RED_CRYSTAL);
-
addStartNpc(OCTAVIA);
addTalkId(OCTAVIA);
-
addKillId(21103);
}
@@ -54,20 +50,15 @@ public class Q432_BirthdayPartySong extends Quest
if (event.equals("31043-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
- else if (event.equals("31043-06.htm"))
+ else if (event.equals("31043-06.htm") && (st.getQuestItemsCount(RED_CRYSTAL) == 50))
{
- if (st.getQuestItemsCount(RED_CRYSTAL) == 50)
- {
- htmltext = "31043-05.htm";
- st.takeItems(RED_CRYSTAL, -1);
- st.rewardItems(7061, 25);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
+ htmltext = "31043-05.htm";
+ st.takeItems(RED_CRYSTAL, -1);
+ st.rewardItems(7061, 25);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
}
return htmltext;
@@ -86,12 +77,15 @@ public class Q432_BirthdayPartySong extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 31) ? "31043-00.htm" : "31043-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(RED_CRYSTAL) < 50) ? "31043-03.htm" : "31043-04.htm";
break;
+ }
}
return htmltext;
@@ -100,7 +94,7 @@ public class Q432_BirthdayPartySong extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -114,7 +108,7 @@ public class Q432_BirthdayPartySong extends Quest
if (st.dropItems(RED_CRYSTAL, 1, 50, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q501_ProofOfClanAlliance/Q501_ProofOfClanAlliance.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q501_ProofOfClanAlliance/Q501_ProofOfClanAlliance.java
index 52298d16ad..e2cbf26c8b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q501_ProofOfClanAlliance/Q501_ProofOfClanAlliance.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q501_ProofOfClanAlliance/Q501_ProofOfClanAlliance.java
@@ -36,10 +36,24 @@ import org.l2jmobius.gameserver.model.quest.State;
*/
public class Q501_ProofOfClanAlliance extends Quest
{
+ // NPC
+ private static final int SIR_KRISTOF_RODEMAI = 30756;
+ private static final int STATUE_OF_OFFERING = 30757;
+ private static final int ATHREA = 30758;
+ private static final int KALIS = 30759;
+ // Monsters
+ private static final int VANOR_SILENOS_SHAMAN = 20685;
+ private static final int HARIT_LIZARDMAN_SHAMAN = 20644;
+ private static final int OEL_MAHUM_WITCH_DOCTOR = 20576;
+ // Chests
+ private static final int BOX_OF_ATHREA_1 = 27173;
+ private static final int BOX_OF_ATHREA_2 = 27174;
+ private static final int BOX_OF_ATHREA_3 = 27175;
+ private static final int BOX_OF_ATHREA_4 = 27176;
+ private static final int BOX_OF_ATHREA_5 = 27177;
// Items
private static final int ADENA = 57;
private static final int POTION_OF_RECOVERY = 3889;
-
// Quest Items
private static final int HERB_OF_HARIT = 3832;
private static final int HERB_OF_VANOR = 3833;
@@ -49,31 +63,8 @@ public class Q501_ProofOfClanAlliance extends Quest
private static final int SYMBOL_OF_LOYALTY = 3837;
private static final int VOUCHER_OF_FAITH = 3873;
private static final int ANTIDOTE_RECIPE_LIST = 3872;
-
// Reward
private static final int PROOF_OF_ALLIANCE = 3874;
-
- // NPC
- private static final int SIR_KRISTOF_RODEMAI = 30756;
- private static final int STATUE_OF_OFFERING = 30757;
- private static final int ATHREA = 30758;
- private static final int KALIS = 30759;
-
- // Mobs
- private static final int VANOR_SILENOS_SHAMAN = 20685;
- private static final int HARIT_LIZARDMAN_SHAMAN = 20644;
- private static final int OEL_MAHUM_WITCH_DOCTOR = 20576;
-
- // Chests
- private static final int BOX_OF_ATHREA_1 = 27173;
- private static final int BOX_OF_ATHREA_2 = 27174;
- private static final int BOX_OF_ATHREA_3 = 27175;
- private static final int BOX_OF_ATHREA_4 = 27176;
- private static final int BOX_OF_ATHREA_5 = 27177;
-
- // Trigger
- private static boolean _isSpawned = false;
-
// Drops
private static final Map DROP = new HashMap<>();
static
@@ -82,7 +73,6 @@ public class Q501_ProofOfClanAlliance extends Quest
DROP.put(HARIT_LIZARDMAN_SHAMAN, HERB_OF_HARIT);
DROP.put(OEL_MAHUM_WITCH_DOCTOR, HERB_OF_OEL_MAHUM);
}
-
// Chests spawns
// @formatter:off
private static final int[][] CHESTS_SPAWN =
@@ -105,36 +95,27 @@ public class Q501_ProofOfClanAlliance extends Quest
{102186, 103022, -3541}
};
// @formatter:on
-
// Chests
- private static final List CHESTS_ID = new ArrayList<>();
+ private static final List CHEST_IDS = new ArrayList<>();
static
{
- CHESTS_ID.add(BOX_OF_ATHREA_1);
- CHESTS_ID.add(BOX_OF_ATHREA_2);
- CHESTS_ID.add(BOX_OF_ATHREA_3);
- CHESTS_ID.add(BOX_OF_ATHREA_4);
- CHESTS_ID.add(BOX_OF_ATHREA_5);
+ CHEST_IDS.add(BOX_OF_ATHREA_1);
+ CHEST_IDS.add(BOX_OF_ATHREA_2);
+ CHEST_IDS.add(BOX_OF_ATHREA_3);
+ CHEST_IDS.add(BOX_OF_ATHREA_4);
+ CHEST_IDS.add(BOX_OF_ATHREA_5);
}
+ // Trigger
+ private static boolean _isSpawned = false;
public Q501_ProofOfClanAlliance()
{
super(501, "Proof of Clan Alliance");
-
registerQuestItems(HERB_OF_HARIT, HERB_OF_VANOR, HERB_OF_OEL_MAHUM, BLOOD_OF_EVA, ATHREAS_COIN, SYMBOL_OF_LOYALTY, VOUCHER_OF_FAITH, ANTIDOTE_RECIPE_LIST);
-
addStartNpc(SIR_KRISTOF_RODEMAI, STATUE_OF_OFFERING);
addTalkId(SIR_KRISTOF_RODEMAI, KALIS, STATUE_OF_OFFERING, ATHREA);
-
- for (int mob : DROP.keySet())
- {
- addKillId(mob);
- }
-
- for (int chest : CHESTS_ID)
- {
- addKillId(chest);
- }
+ addKillId(DROP.keySet());
+ addKillId(CHEST_IDS);
}
@Override
@@ -142,114 +123,121 @@ public class Q501_ProofOfClanAlliance extends Quest
{
String htmltext = event;
final QuestState st = player.getQuestState(getName());
- final QuestState st2 = getClanLeaderQuestState(player, npc);
if (st == null)
{
return htmltext;
}
- if (event.equals("30756-07.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("state", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30759-03.htm"))
- {
- st.set("cond", "2");
- st.set("state", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30759-07.htm"))
- {
- st.set("cond", "3");
- st.set("state", "3");
- st.takeItems(SYMBOL_OF_LOYALTY, 1);
- st.takeItems(SYMBOL_OF_LOYALTY, 1);
- st.takeItems(SYMBOL_OF_LOYALTY, 1);
- st.giveItems(ANTIDOTE_RECIPE_LIST, 1);
- SkillTable.getInstance().getSkill(4082, 1).applyEffects(npc, player);
- startQuestTimer("poison", 60000, npc, player, true);
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("30757-03.htm"))
- {
- if (Rnd.get(10) > 5)
+ case "30756-07.htm":
{
+ st.startQuest();
+ st.set("state", "1");
+ break;
+ }
+ case "30759-03.htm":
+ {
+ st.setCond(2);
+ st.set("state", "2");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30759-07.htm":
+ {
+ st.setCond(3);
+ st.set("state", "3");
+ st.takeItems(SYMBOL_OF_LOYALTY, 1);
+ st.takeItems(SYMBOL_OF_LOYALTY, 1);
+ st.takeItems(SYMBOL_OF_LOYALTY, 1);
+ st.giveItems(ANTIDOTE_RECIPE_LIST, 1);
+ SkillTable.getInstance().getSkill(4082, 1).applyEffects(npc, player);
+ startQuestTimer("poison", 60000, npc, player, true);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "30757-03.htm":
+ {
+ if (Rnd.get(10) > 5)
+ {
+ final QuestState st2 = getClanLeaderQuestState(player, npc);
+ st.setState(State.STARTED);
+ st.set("symbol", "1");
+ st2.set("symbols", String.valueOf(st2.getInt("symbols") + 1));
+ st.giveItems(SYMBOL_OF_LOYALTY, 1);
+ st.playSound(QuestState.SOUND_ACCEPT);
+ htmltext = "30757-04.htm";
+ }
+ else
+ {
+ castSkill(npc, player, 4083);
+ startQuestTimer("die", 4000, npc, player, false);
+ }
+ break;
+ }
+ case "30758-03.htm":
+ {
+ if (!_isSpawned && (player.getAdena() >= 10000))
+ {
+ final QuestState st2 = getClanLeaderQuestState(player, npc);
+ st2.set("state", "4");
+ st2.set("bingo", "0");
+ st2.set("chests", "0");
+ st.takeItems(ADENA, 10000);
+ for (int[] coords : CHESTS_SPAWN)
+ {
+ st.addSpawn(CHEST_IDS.get(Rnd.get(CHEST_IDS.size())), coords[0], coords[1], coords[2], 0, false, 0);
+ }
+
+ _isSpawned = true;
+ startQuestTimer("despawn", 300000, null, player, false);
+ }
+ else
+ {
+ htmltext = "30758-03a.htm";
+ }
+ break;
+ }
+ case "30758-07.htm":
+ {
+ if (player.getAdena() >= 10000)
+ {
+ if (!_isSpawned)
+ {
+ st.takeItems(ADENA, 10000);
+ }
+ }
+ else
+ {
+ htmltext = "30758-06.htm";
+ }
+ break;
+ }
+ case "die":
+ {
+ final QuestState st2 = getClanLeaderQuestState(player, npc);
st.setState(State.STARTED);
st.set("symbol", "1");
st2.set("symbols", String.valueOf(st2.getInt("symbols") + 1));
st.giveItems(SYMBOL_OF_LOYALTY, 1);
st.playSound(QuestState.SOUND_ACCEPT);
- htmltext = "30757-04.htm";
+ return null;
}
- else
+ case "poison":
{
- castSkill(npc, player, 4083);
- startQuestTimer("die", 4000, npc, player, false);
- }
- }
- else if (event.equals("30758-03.htm"))
- {
- if (!_isSpawned && (player.getAdena() >= 10000))
- {
- st2.set("state", "4");
- st2.set("bingo", "0");
- st2.set("chests", "0");
- st.takeItems(ADENA, 10000);
- for (int[] coords : CHESTS_SPAWN)
+ if (player.getAbnormalEffect() != 514)
{
- st.addSpawn(CHESTS_ID.get(Rnd.get(CHESTS_ID.size())), coords[0], coords[1], coords[2], 0, false, 0);
+ player.sendMessage("Are you noob?");
+ cancelQuestTimer("poison", npc, player); // Cancel check timer
}
-
- _isSpawned = true;
- startQuestTimer("despawn", 300000, null, player, false);
+ return null;
}
- else
+ case "despawn":
{
- htmltext = "30758-03a.htm";
+ _isSpawned = false;
+ return null;
}
}
- else if (event.equals("30758-07.htm"))
- {
- if (player.getAdena() >= 10000)
- {
- if (!_isSpawned)
- {
- st.takeItems(ADENA, 10000);
- }
- }
- else
- {
- htmltext = "30758-06.htm";
- }
- }
- // Timers
- else if (event.equals("die"))
- {
- st.setState(State.STARTED);
- st.set("symbol", "1");
- st2.set("symbols", String.valueOf(st2.getInt("symbols") + 1));
- st.giveItems(SYMBOL_OF_LOYALTY, 1);
- st.playSound(QuestState.SOUND_ACCEPT);
- return null;
- }
- else if (event.equals("poison"))
- {
- if (player.getAbnormalEffect() != 514)
- {
- player.sendMessage("Are you noob?");
- cancelQuestTimer("poison", npc, player); // Cancel check timer
- }
-
- return null;
- }
- else if (event.equals("despawn"))
- {
- _isSpawned = false;
- return null;
- }
return htmltext;
}
@@ -259,7 +247,6 @@ public class Q501_ProofOfClanAlliance extends Quest
{
String htmltext = getNoQuestMsg();
final QuestState st = player.getQuestState(getName());
- final QuestState cl = getClanLeaderQuestState(player, npc);
if (st == null)
{
return htmltext;
@@ -268,9 +255,11 @@ public class Q501_ProofOfClanAlliance extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
switch (npc.getNpcId())
{
case SIR_KRISTOF_RODEMAI:
+ {
if (player.isClanLeader())
{
if (player.getClan().getLevel() == 3)
@@ -298,8 +287,10 @@ public class Q501_ProofOfClanAlliance extends Quest
htmltext = "30756-05.htm";
}
break;
-
+ }
case STATUE_OF_OFFERING:
+ {
+ final QuestState cl = getClanLeaderQuestState(player, npc);
if ((cl != null) && (cl.getInt("state") == 2) && (cl.getInt("symbols") < 3))
{
if (!player.isClanLeader())
@@ -323,14 +314,17 @@ public class Q501_ProofOfClanAlliance extends Quest
htmltext = "30757-06.htm";
}
break;
+ }
}
break;
-
+ }
case State.STARTED:
+ {
final int state = st.getInt("state");
switch (npc.getNpcId())
{
case SIR_KRISTOF_RODEMAI:
+ {
if ((state == 6) && st.hasQuestItems(VOUCHER_OF_FAITH))
{
htmltext = "30756-09.htm";
@@ -346,15 +340,18 @@ public class Q501_ProofOfClanAlliance extends Quest
htmltext = "30756-10.htm";
}
break;
-
+ }
case STATUE_OF_OFFERING:
+ {
+ final QuestState cl = getClanLeaderQuestState(player, npc);
if ((cl != null) && (cl.getInt("state") == 2) && (st.getInt("symbol") == 1))
{
htmltext = "30757-01b.htm";
}
break;
-
+ }
case KALIS:
+ {
if (player.isClanLeader())
{
if ((state == 1) && !st.hasQuestItems(SYMBOL_OF_LOYALTY))
@@ -374,7 +371,7 @@ public class Q501_ProofOfClanAlliance extends Quest
}
else if ((state > 2) && (state < 6) && (player.getAbnormalEffect() != 514))
{
- st.set("cond", "1");
+ st.setCond(1);
st.set("state", "1");
st.takeItems(ANTIDOTE_RECIPE_LIST, -1);
htmltext = "30759-09.htm";
@@ -385,7 +382,7 @@ public class Q501_ProofOfClanAlliance extends Quest
}
else if ((state == 5) && (player.getAbnormalEffect() == 514) && st.hasAtLeastOneQuestItem(HERB_OF_HARIT, HERB_OF_VANOR, HERB_OF_OEL_MAHUM, BLOOD_OF_EVA))
{
- st.set("cond", "4");
+ st.setCond(4);
st.set("state", "6");
st.takeItems(ANTIDOTE_RECIPE_LIST, -1);
st.takeItems(HERB_OF_HARIT, -1);
@@ -408,8 +405,10 @@ public class Q501_ProofOfClanAlliance extends Quest
htmltext = "30759-12.htm";
}
break;
-
+ }
case ATHREA:
+ {
+ final QuestState cl = getClanLeaderQuestState(player, npc);
if ((cl != null) && (cl.getInt("state") == 3) && cl.hasQuestItems(ANTIDOTE_RECIPE_LIST) && !cl.hasQuestItems(BLOOD_OF_EVA) && hasFirstHerb(st, cl.getString("herbs")) && (getHerbs(cl.getString("herbs")).size() == 3))
{
htmltext = "30758-01.htm";
@@ -434,8 +433,10 @@ public class Q501_ProofOfClanAlliance extends Quest
htmltext = "30758-09.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -470,7 +471,7 @@ public class Q501_ProofOfClanAlliance extends Quest
st.dropItemsAlways(itemId, 1, 1);
}
}
- else if (CHESTS_ID.contains(npcId) && (cl.getInt("state") == 4))
+ else if (CHEST_IDS.contains(npcId) && (cl.getInt("state") == 4))
{
final int chests = cl.getInt("chests");
final int bingo = cl.getInt("bingo");
@@ -495,25 +496,29 @@ public class Q501_ProofOfClanAlliance extends Quest
switch (itemId)
{
case HERB_OF_VANOR:
+ {
if (st.hasQuestItems(HERB_OF_HARIT) || st.hasQuestItems(HERB_OF_OEL_MAHUM))
{
return true;
}
break;
-
+ }
case HERB_OF_HARIT:
+ {
if (st.hasQuestItems(HERB_OF_VANOR) || st.hasQuestItems(HERB_OF_OEL_MAHUM))
{
return true;
}
break;
-
+ }
case HERB_OF_OEL_MAHUM:
+ {
if (st.hasQuestItems(HERB_OF_HARIT) || st.hasQuestItems(HERB_OF_VANOR))
{
return true;
}
break;
+ }
}
return false;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q503_PursuitOfClanAmbition/Q503_PursuitOfClanAmbition.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q503_PursuitOfClanAmbition/Q503_PursuitOfClanAmbition.java
index 11a4e78ecb..995bf78300 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q503_PursuitOfClanAmbition/Q503_PursuitOfClanAmbition.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q503_PursuitOfClanAmbition/Q503_PursuitOfClanAmbition.java
@@ -28,32 +28,7 @@ import org.l2jmobius.gameserver.model.quest.State;
*/
public class Q503_PursuitOfClanAmbition extends Quest
{
- // Items
- // First
- private static final int G_LET_MARTIEN = 3866;
- private static final int TH_WYRM_EGGS = 3842;
- private static final int DRAKE_EGGS = 3841;
- private static final int BL_WYRM_EGGS = 3840;
- private static final int MI_DRAKE_EGGS = 3839;
- private static final int BROOCH = 3843;
- private static final int BL_ANVIL_COIN = 3871;
-
- // Second part
- private static final int G_LET_BALTHAZAR = 3867;
- private static final int RECIPE_POWER_STONE = 3838;
- private static final int POWER_STONE = 3846;
- private static final int NEBULITE_CRYSTALS = 3844;
- private static final int BROKE_POWER_STONE = 3845;
-
- // Third part
- private static final int G_LET_RODEMAI = 3868;
- private static final int IMP_KEYS = 3847;
- private static final int SCEPTER_JUDGEMENT = 3869;
-
- // Final item
- private static final int PROOF_ASPIRATION = 3870;
-
- // NPCS
+ // NPCs
private static final int MARTIEN = 30645;
private static final int ATHREA = 30758;
private static final int KALIS = 30759;
@@ -66,8 +41,7 @@ public class Q503_PursuitOfClanAmbition extends Quest
private static final int RODEMAI = 30868;
private static final int COFFER = 30765;
private static final int CLEO = 30766;
-
- // Mobs
+ // Monsters
private static final int THUNDER_WYRM = 20282;
private static final int THUNDER_WYRM_TWO = 20243;
private static final int DRAKE = 20137;
@@ -78,11 +52,29 @@ public class Q503_PursuitOfClanAmbition extends Quest
private static final int GRAVE_GUARD = 20668;
private static final int GRAVE_KEYMASTER = 27179;
private static final int IMPERIAL_SLAVE = 27180;
-
// Attack mob
private static final int IMPERIAL_GRAVEKEEPER = 27181;
-
- // DROPLIST
+ // First part items
+ private static final int G_LET_MARTIEN = 3866;
+ private static final int TH_WYRM_EGGS = 3842;
+ private static final int DRAKE_EGGS = 3841;
+ private static final int BL_WYRM_EGGS = 3840;
+ private static final int MI_DRAKE_EGGS = 3839;
+ private static final int BROOCH = 3843;
+ private static final int BL_ANVIL_COIN = 3871;
+ // Second part items
+ private static final int G_LET_BALTHAZAR = 3867;
+ private static final int RECIPE_POWER_STONE = 3838;
+ private static final int POWER_STONE = 3846;
+ private static final int NEBULITE_CRYSTALS = 3844;
+ private static final int BROKE_POWER_STONE = 3845;
+ // Third part items
+ private static final int G_LET_RODEMAI = 3868;
+ private static final int IMP_KEYS = 3847;
+ private static final int SCEPTER_JUDGEMENT = 3869;
+ // Final item
+ private static final int PROOF_ASPIRATION = 3870;
+ // Droplist
private static final int[][] DROPLIST =
{
// npcId, cond, MaxCount, chance, item1, item2 (giants), item3 (giants)
@@ -103,12 +95,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
public Q503_PursuitOfClanAmbition()
{
super(503, "Pursuit of Clan Ambition!");
-
registerQuestItems(MI_DRAKE_EGGS, BL_WYRM_EGGS, DRAKE_EGGS, TH_WYRM_EGGS, BROOCH, NEBULITE_CRYSTALS, BROKE_POWER_STONE, POWER_STONE, IMP_KEYS, G_LET_MARTIEN, G_LET_BALTHAZAR, G_LET_RODEMAI, SCEPTER_JUDGEMENT);
-
addStartNpc(GUSTAF);
addTalkId(MARTIEN, ATHREA, KALIS, GUSTAF, FRITZ, LUTZ, KURTZ, KUSTO, BALTHAZAR, RODEMAI, COFFER, CLEO);
-
addKillId(THUNDER_WYRM_TWO, THUNDER_WYRM, DRAKE, DRAKE_TWO, BLITZ_WYRM, GIANT_SOLDIER, GIANT_SCOUT, GRAVE_GUARD, GRAVE_KEYMASTER, IMPERIAL_GRAVEKEEPER);
addAttackId(IMPERIAL_GRAVEKEEPER);
}
@@ -123,135 +112,146 @@ public class Q503_PursuitOfClanAmbition extends Quest
return htmltext;
}
- // Gustaf
- if (event.equalsIgnoreCase("30760-08.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.giveItems(G_LET_MARTIEN, 1);
- st.set("cond", "1");
- }
- else if (event.equalsIgnoreCase("30760-12.htm"))
- {
- st.giveItems(G_LET_BALTHAZAR, 1);
- st.set("cond", "4");
- }
- else if (event.equalsIgnoreCase("30760-16.htm"))
- {
- st.giveItems(G_LET_RODEMAI, 1);
- st.set("cond", "7");
- }
- else if (event.equalsIgnoreCase("30760-20.htm"))
- {
- st.takeItems(SCEPTER_JUDGEMENT, -1);
- st.giveItems(PROOF_ASPIRATION, 1);
- st.rewardExpAndSp(0, 250000);
- st.exitQuest(false);
- finishQuestToClan(player);
- }
- else if (event.equalsIgnoreCase("30760-22.htm"))
- {
- st.set("cond", "1");
- }
- else if (event.equalsIgnoreCase("30760-23.htm"))
- {
- st.takeItems(SCEPTER_JUDGEMENT, -1);
- st.giveItems(PROOF_ASPIRATION, 1);
- st.rewardExpAndSp(0, 250000);
- st.exitQuest(false);
- finishQuestToClan(player);
- }
- // Martien
- else if (event.equalsIgnoreCase("30645-03.htm"))
- {
- setQuestToClanMembers(player);
- st.takeItems(G_LET_MARTIEN, -1);
- st.set("cond", "2");
- st.set("kurt", "0");
- }
- // Kurtz
- else if (event.equalsIgnoreCase("30763-02.htm"))
- {
- st.giveItems(MI_DRAKE_EGGS, 6);
- st.giveItems(BROOCH, 1);
- st.set("kurt", "1");
- }
- // Lutz
- else if (event.equalsIgnoreCase("30762-02.htm"))
- {
- st.giveItems(MI_DRAKE_EGGS, 4);
- st.giveItems(BL_WYRM_EGGS, 3);
- st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
- st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
- st.set("lutz", "1");
- }
- // Fritz
- else if (event.equalsIgnoreCase("30761-02.htm"))
- {
- st.giveItems(BL_WYRM_EGGS, 3);
- st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
- st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
- st.set("fritz", "1");
- }
- // Kusto
- else if (event.equalsIgnoreCase("30512-03.htm"))
- {
- st.takeItems(BROOCH, 1);
- st.giveItems(BL_ANVIL_COIN, 1);
- st.set("kurt", "2");
- }
- // Balthazar
- else if (event.equalsIgnoreCase("30764-03.htm"))
- {
- st.takeItems(G_LET_BALTHAZAR, -1);
- st.set("cond", "5");
- }
- else if (event.equalsIgnoreCase("30764-05.htm"))
- {
- st.takeItems(G_LET_BALTHAZAR, -1);
- st.set("cond", "5");
- }
- else if (event.equalsIgnoreCase("30764-06.htm"))
- {
- st.takeItems(BL_ANVIL_COIN, -1);
- st.giveItems(RECIPE_POWER_STONE, 1);
- }
- // Rodemai
- else if (event.equalsIgnoreCase("30868-04.htm"))
- {
- st.takeItems(G_LET_RODEMAI, -1);
- st.set("cond", "8");
- }
- else if (event.equalsIgnoreCase("30868-06a.htm"))
- {
- st.set("cond", "10");
- }
- else if (event.equalsIgnoreCase("30868-10.htm"))
- {
- st.set("cond", "12");
- }
- // Cleo
- else if (event.equalsIgnoreCase("30766-04.htm"))
- {
- st.set("cond", "9");
- npc.broadcastNpcSay("Blood and Honor");
- final NpcInstance sister1 = addSpawn(KALIS, 160665, 21209, -3710, npc.getHeading(), false, 180000);
- sister1.broadcastNpcSay("Ambition and Power");
- final NpcInstance sister2 = addSpawn(ATHREA, 160665, 21291, -3710, npc.getHeading(), false, 180000);
- sister2.broadcastNpcSay("War and Death");
- }
- // Coffer
- else if (event.equalsIgnoreCase("Open"))
- {
- if (st.getQuestItemsCount(IMP_KEYS) < 6)
+ case "30760-08.htm":
{
- htmltext = "30765-03a.htm";
+ st.startQuest();
+ st.giveItems(G_LET_MARTIEN, 1);
+ break;
}
- else
+ case "30760-12.htm":
{
- htmltext = "30765-03.htm";
- st.set("cond", "11");
- st.takeItems(IMP_KEYS, 6);
- st.giveItems(SCEPTER_JUDGEMENT, 1);
+ st.giveItems(G_LET_BALTHAZAR, 1);
+ st.setCond(4);
+ break;
+ }
+ case "30760-16.htm":
+ {
+ st.giveItems(G_LET_RODEMAI, 1);
+ st.setCond(7);
+ break;
+ }
+ case "30760-20.htm":
+ {
+ st.takeItems(SCEPTER_JUDGEMENT, -1);
+ st.giveItems(PROOF_ASPIRATION, 1);
+ st.rewardExpAndSp(0, 250000);
+ st.exitQuest(false);
+ finishQuestToClan(player);
+ break;
+ }
+ case "30760-22.htm":
+ {
+ st.setCond(1);
+ break;
+ }
+ case "30760-23.htm":
+ {
+ st.takeItems(SCEPTER_JUDGEMENT, -1);
+ st.giveItems(PROOF_ASPIRATION, 1);
+ st.rewardExpAndSp(0, 250000);
+ st.exitQuest(false);
+ finishQuestToClan(player);
+ break;
+ }
+ case "30645-03.htm":
+ {
+ setQuestToClanMembers(player);
+ st.takeItems(G_LET_MARTIEN, -1);
+ st.setCond(2);
+ st.set("kurt", "0");
+ break;
+ }
+ case "30763-02.htm":
+ {
+ st.giveItems(MI_DRAKE_EGGS, 6);
+ st.giveItems(BROOCH, 1);
+ st.set("kurt", "1");
+ break;
+ }
+ case "30762-02.htm":
+ {
+ st.giveItems(MI_DRAKE_EGGS, 4);
+ st.giveItems(BL_WYRM_EGGS, 3);
+ st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
+ st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
+ st.set("lutz", "1");
+ break;
+ }
+ case "30761-02.htm":
+ {
+ st.giveItems(BL_WYRM_EGGS, 3);
+ st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
+ st.addSpawn(BLITZ_WYRM, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
+ st.set("fritz", "1");
+ break;
+ }
+ case "30512-03.htm":
+ {
+ st.takeItems(BROOCH, 1);
+ st.giveItems(BL_ANVIL_COIN, 1);
+ st.set("kurt", "2");
+ break;
+ }
+ case "30764-03.htm":
+ {
+ st.takeItems(G_LET_BALTHAZAR, -1);
+ st.setCond(5);
+ break;
+ }
+ case "30764-05.htm":
+ {
+ st.takeItems(G_LET_BALTHAZAR, -1);
+ st.setCond(5);
+ break;
+ }
+ case "30764-06.htm":
+ {
+ st.takeItems(BL_ANVIL_COIN, -1);
+ st.giveItems(RECIPE_POWER_STONE, 1);
+ break;
+ }
+ case "30868-04.htm":
+ {
+ st.takeItems(G_LET_RODEMAI, -1);
+ st.setCond(8);
+ break;
+ }
+ case "30868-06a.htm":
+ {
+ st.setCond(10);
+ break;
+ }
+ case "30868-10.htm":
+ {
+ st.setCond(12);
+ break;
+ }
+ case "30766-04.htm":
+ {
+ st.setCond(9);
+ npc.broadcastNpcSay("Blood and Honor");
+ final NpcInstance sister1 = addSpawn(KALIS, 160665, 21209, -3710, npc.getHeading(), false, 180000);
+ sister1.broadcastNpcSay("Ambition and Power");
+ final NpcInstance sister2 = addSpawn(ATHREA, 160665, 21291, -3710, npc.getHeading(), false, 180000);
+ sister2.broadcastNpcSay("War and Death");
+ break;
+ }
+ case "Open":
+ {
+ if (st.getQuestItemsCount(IMP_KEYS) < 6)
+ {
+ htmltext = "30765-03a.htm";
+ }
+ else
+ {
+ htmltext = "30765-03.htm";
+ st.setCond(11);
+ st.takeItems(IMP_KEYS, 6);
+ st.giveItems(SCEPTER_JUDGEMENT, 1);
+ }
+ break;
}
}
@@ -271,6 +271,7 @@ public class Q503_PursuitOfClanAmbition extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getClan() == null)
{
htmltext = "30760-01.htm";
@@ -299,18 +300,20 @@ public class Q503_PursuitOfClanAmbition extends Quest
st.exitQuest(true);
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
int memberCond = 0;
if (getClanLeaderQuestState(player, npc) != null)
{
- memberCond = getClanLeaderQuestState(player, npc).getInt("cond");
+ memberCond = getClanLeaderQuestState(player, npc).getCond();
}
switch (npc.getNpcId())
{
case GUSTAF:
+ {
if (player.isClanLeader())
{
if (cond == 1)
@@ -374,8 +377,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case MARTIEN:
+ {
if (player.isClanLeader())
{
if (cond == 1)
@@ -387,7 +391,7 @@ public class Q503_PursuitOfClanAmbition extends Quest
if ((st.getQuestItemsCount(MI_DRAKE_EGGS) > 9) && (st.getQuestItemsCount(BL_WYRM_EGGS) > 9) && (st.getQuestItemsCount(DRAKE_EGGS) > 9) && (st.getQuestItemsCount(TH_WYRM_EGGS) > 9))
{
htmltext = "30645-05.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.takeItems(MI_DRAKE_EGGS, -1);
st.takeItems(BL_WYRM_EGGS, -1);
st.takeItems(DRAKE_EGGS, -1);
@@ -415,8 +419,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case LUTZ:
+ {
if (player.isClanLeader() && (cond == 2))
{
if (st.getInt("lutz") == 1)
@@ -429,8 +434,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case KURTZ:
+ {
if (player.isClanLeader() && (cond == 2))
{
if (st.getInt("kurt") == 1)
@@ -443,8 +449,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case FRITZ:
+ {
if (player.isClanLeader() && (cond == 2))
{
if (st.getInt("fritz") == 1)
@@ -457,8 +464,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case KUSTO:
+ {
if (player.isClanLeader())
{
if (st.getQuestItemsCount(BROOCH) == 1)
@@ -485,8 +493,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case BALTHAZAR:
+ {
if (player.isClanLeader())
{
if (cond == 4)
@@ -508,7 +517,7 @@ public class Q503_PursuitOfClanAmbition extends Quest
st.takeItems(POWER_STONE, -1);
st.takeItems(NEBULITE_CRYSTALS, -1);
st.takeItems(BROOCH, -1);
- st.set("cond", "6");
+ st.setCond(6);
}
else
{
@@ -528,8 +537,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case RODEMAI:
+ {
if (player.isClanLeader())
{
if (cond == 7)
@@ -569,8 +579,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case CLEO:
+ {
if (player.isClanLeader())
{
if (cond == 8)
@@ -598,8 +609,9 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case COFFER:
+ {
if (player.isClanLeader())
{
if (cond == 10)
@@ -615,22 +627,26 @@ public class Q503_PursuitOfClanAmbition extends Quest
}
}
break;
-
+ }
case KALIS:
+ {
if (player.isClanLeader())
{
htmltext = "30759-01.htm";
}
break;
-
+ }
case ATHREA:
+ {
if (player.isClanLeader())
{
htmltext = "30758-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -651,14 +667,13 @@ public class Q503_PursuitOfClanAmbition extends Quest
if (element[0] == npc.getNpcId())
{
final int cond = element[1];
- final int maxCount = element[2];
- final int chance = element[3];
- final int item1 = element[4];
- final int item2 = element[5];
- final int item3 = element[6];
-
- if (st.getInt("cond") == cond)
+ if (st.getCond() == cond)
{
+ final int maxCount = element[2];
+ final int chance = element[3];
+ final int item1 = element[4];
+ final int item2 = element[5];
+ final int item3 = element[6];
if (item1 != 0)
{
st.dropItems(item1, 1, maxCount, chance);
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q504_CompetitionForTheBanditStronghold/Q504_CompetitionForTheBanditStronghold.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q504_CompetitionForTheBanditStronghold/Q504_CompetitionForTheBanditStronghold.java
index 88c35f9d2b..9974e6c9bc 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q504_CompetitionForTheBanditStronghold/Q504_CompetitionForTheBanditStronghold.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q504_CompetitionForTheBanditStronghold/Q504_CompetitionForTheBanditStronghold.java
@@ -44,7 +44,6 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
public Q504_CompetitionForTheBanditStronghold()
{
super(504, "Competition for the Bandit Stronghold");
-
addStartNpc(MESSENGER);
addTalkId(MESSENGER);
addKillId(TARLK_BUGBEAR, TARLK_BUGBEAR_WARRIOR, TARLK_BUGBEAR_HIGH_WARRIOR, TARLK_BASILISK, ELDER_TARLK_BASILISK);
@@ -62,9 +61,7 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
if (event.equals("a2.htm"))
{
- qs.set("cond", "1");
- qs.setState(State.STARTED);
- qs.playSound("ItemSound.quest_accept");
+ qs.startQuest();
}
if (event.equals("a4.htm"))
{
@@ -72,7 +69,7 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
{
qs.takeItems(TARLK_AMULET, -30);
qs.giveItems(ALLIANCE_TROPHEY, 1);
- qs.playSound("ItemSound.quest_finish");
+ qs.playSound(QuestState.SOUND_FINISH);
qs.exitQuest(true);
}
else
@@ -94,8 +91,6 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
return htmltext;
}
- final int npcId = npc.getNpcId();
- final int cond = qs.getInt("cond");
final Clan clan = player.getClan();
if (clan == null)
{
@@ -111,8 +106,9 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
}
if (BanditStrongholdSiege.getInstance().isRegistrationPeriod())
{
- if (npcId == MESSENGER)
+ if (npc.getNpcId() == MESSENGER)
{
+ final int cond = qs.getCond();
if (cond == 0)
{
htmltext = "a1.htm";
@@ -141,13 +137,13 @@ public class Q504_CompetitionForTheBanditStronghold extends Quest
return null;
}
- if ((qs.getInt("cond") < 2) && (qs.getQuestItemsCount(TARLK_AMULET) < 30))
+ if ((qs.getCond() < 2) && (qs.getQuestItemsCount(TARLK_AMULET) < 30))
{
qs.giveItems(TARLK_AMULET, 1);
- qs.playSound("ItemSound.quest_itemget");
+ qs.playSound(QuestState.SOUND_ITEMGET);
if (qs.getQuestItemsCount(TARLK_AMULET) == 30)
{
- qs.set("cond", "2");
+ qs.setCond(2);
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q505_BloodOffering/Q505_BloodOffering.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q505_BloodOffering/Q505_BloodOffering.java
index 1f3485d0af..8add2b2172 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q505_BloodOffering/Q505_BloodOffering.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q505_BloodOffering/Q505_BloodOffering.java
@@ -46,7 +46,6 @@ public class Q505_BloodOffering extends Quest
public Q505_BloodOffering()
{
super(505, "Blood Offering");
-
addStartNpc(TOWN_DAWN);
addTalkId(TOWN_DAWN);
addStartNpc(TOWN_DUSK);
@@ -81,9 +80,9 @@ public class Q505_BloodOffering extends Quest
if (qs2 != null)
{
qs2.setState(State.STARTED);
- qs2.set("cond", "1");
+ qs2.setCond(1);
}
- qs.playSound("ItemSound.quest_accept");
+ qs.playSound(QuestState.SOUND_ACCEPT);
qs.exitQuest(true);
return "guide.htm";
}
@@ -145,7 +144,7 @@ public class Q505_BloodOffering extends Quest
if (cabal.equals("dawn"))
{
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
qs.getPlayer().teleToLocation(-80157, 111344, -4901);
if (qs2 != null)
{
@@ -156,7 +155,7 @@ public class Q505_BloodOffering extends Quest
if (cabal.equals("dusk"))
{
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
if (qs2 != null)
{
qs2.unset("cond");
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q508_AClansReputation/Q508_AClansReputation.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q508_AClansReputation/Q508_AClansReputation.java
index 7fbf1be751..aae4ccfb12 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q508_AClansReputation/Q508_AClansReputation.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q508_AClansReputation/Q508_AClansReputation.java
@@ -32,15 +32,6 @@ public class Q508_AClansReputation extends Quest
{
// NPC
private static final int SIR_ERIC_RODEMAI = 30868;
-
- // Items
- private static final int NUCLEUS_OF_FLAMESTONE_GIANT = 8494;
- private static final int THEMIS_SCALE = 8277;
- private static final int NUCLEUS_OF_HEKATON_PRIME = 8279;
- private static final int TIPHON_SHARD = 8280;
- private static final int GLAKIS_NUCLEUS = 8281;
- private static final int RAHHAS_FANG = 8282;
-
// Raidbosses
private static final int FLAMESTONE_GIANT = 25524;
private static final int PALIBATI_QUEEN_THEMIS = 25252;
@@ -48,92 +39,42 @@ public class Q508_AClansReputation extends Quest
private static final int GARGOYLE_LORD_TIPHON = 25255;
private static final int LAST_LESSER_GIANT_GLAKI = 25245;
private static final int RAHHA = 25051;
-
+ // Items
+ private static final int NUCLEUS_OF_FLAMESTONE_GIANT = 8494;
+ private static final int THEMIS_SCALE = 8277;
+ private static final int NUCLEUS_OF_HEKATON_PRIME = 8279;
+ private static final int TIPHON_SHARD = 8280;
+ private static final int GLAKIS_NUCLEUS = 8281;
+ private static final int RAHHAS_FANG = 8282;
// Reward list (itemId, minClanPoints, maxClanPoints)
private static final int[][] REWARD_LIST =
{
- {
- PALIBATI_QUEEN_THEMIS,
- THEMIS_SCALE,
- 65,
- 100
- },
- {
- HEKATON_PRIME,
- NUCLEUS_OF_HEKATON_PRIME,
- 40,
- 75
- },
- {
- GARGOYLE_LORD_TIPHON,
- TIPHON_SHARD,
- 30,
- 65
- },
- {
- LAST_LESSER_GIANT_GLAKI,
- GLAKIS_NUCLEUS,
- 105,
- 140
- },
- {
- RAHHA,
- RAHHAS_FANG,
- 40,
- 75
- },
- {
- FLAMESTONE_GIANT,
- NUCLEUS_OF_FLAMESTONE_GIANT,
- 60,
- 95
- }
+ // @formatter:off
+ {PALIBATI_QUEEN_THEMIS, THEMIS_SCALE, 65, 100},
+ {HEKATON_PRIME, NUCLEUS_OF_HEKATON_PRIME, 40, 75},
+ {GARGOYLE_LORD_TIPHON, TIPHON_SHARD, 30, 65},
+ {LAST_LESSER_GIANT_GLAKI, GLAKIS_NUCLEUS, 105, 140},
+ {RAHHA, RAHHAS_FANG, 40, 75},
+ {FLAMESTONE_GIANT, NUCLEUS_OF_FLAMESTONE_GIANT, 60, 95}
};
-
// Radar
private static final int[][] radar =
{
- {
- 192346,
- 21528,
- -3648
- },
- {
- 191979,
- 54902,
- -7658
- },
- {
- 170038,
- -26236,
- -3824
- },
- {
- 171762,
- 55028,
- -5992
- },
- {
- 117232,
- -9476,
- -3320
- },
- {
- 144218,
- -5816,
- -4722
- }
+ {192346, 21528, -3648},
+ {191979, 54902, -7658},
+ {170038, -26236, -3824},
+ {171762, 55028, -5992},
+ {117232, -9476, -3320},
+ {144218, -5816, -4722}
+ // @formatter:on
};
public Q508_AClansReputation()
{
super(508, "A Clan's Reputation");
-
registerQuestItems(THEMIS_SCALE, NUCLEUS_OF_HEKATON_PRIME, TIPHON_SHARD, GLAKIS_NUCLEUS, RAHHAS_FANG, NUCLEUS_OF_FLAMESTONE_GIANT);
-
addStartNpc(SIR_ERIC_RODEMAI);
addTalkId(SIR_ERIC_RODEMAI);
-
addKillId(FLAMESTONE_GIANT, PALIBATI_QUEEN_THEMIS, HEKATON_PRIME, GARGOYLE_LORD_TIPHON, LAST_LESSER_GIANT_GLAKI, RAHHA);
}
@@ -161,11 +102,9 @@ public class Q508_AClansReputation extends Quest
st.addRadar(x, y, z);
}
- st.set("cond", "1");
- st.setState(State.STARTED);
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
- else if (event.equalsIgnoreCase("30868-7.htm"))
+ else if (event.equals("30868-7.htm"))
{
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
@@ -185,10 +124,10 @@ public class Q508_AClansReputation extends Quest
}
final Clan clan = player.getClan();
-
switch (st.getState())
{
case State.CREATED:
+ {
if (!player.isClanLeader())
{
st.exitQuest(true);
@@ -204,10 +143,11 @@ public class Q508_AClansReputation extends Quest
htmltext = "30868-0c.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int raid = st.getInt("raid");
- if (st.getInt("cond") == 1)
+ if (st.isCond(1))
{
final int item = REWARD_LIST[raid - 1][1];
final int count = st.getQuestItemsCount(item);
@@ -226,6 +166,7 @@ public class Q508_AClansReputation extends Quest
}
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q509_TheClansPrestige/Q509_TheClansPrestige.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q509_TheClansPrestige/Q509_TheClansPrestige.java
index a6a54dfb14..61d93f9c3b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q509_TheClansPrestige/Q509_TheClansPrestige.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q509_TheClansPrestige/Q509_TheClansPrestige.java
@@ -32,95 +32,45 @@ public class Q509_TheClansPrestige extends Quest
{
// NPCs
private static final int VALDIS = 31331;
-
- // Items
- private static final int DAIMONS_EYES = 8489;
- private static final int HESTIAS_FAIRY_STONE = 8490;
- private static final int NUCLEUS_OF_LESSER_GOLEM = 8491;
- private static final int FALSTON_FANG = 8492;
- private static final int SHAIDS_TALON = 8493;
-
// Raid Bosses
private static final int DAIMON_THE_WHITE_EYED = 25290;
private static final int HESTIA_GUARDIAN_DEITY = 25293;
private static final int PLAGUE_GOLEM = 25523;
private static final int DEMONS_AGENT_FALSTON = 25322;
private static final int QUEEN_SHYEED = 25514;
-
+ // Items
+ private static final int DAIMONS_EYES = 8489;
+ private static final int HESTIAS_FAIRY_STONE = 8490;
+ private static final int NUCLEUS_OF_LESSER_GOLEM = 8491;
+ private static final int FALSTON_FANG = 8492;
+ private static final int SHAIDS_TALON = 8493;
// Reward list (itemId, minClanPoints, maxClanPoints)
private static final int[][] REWARD_LIST =
{
- {
- DAIMON_THE_WHITE_EYED,
- DAIMONS_EYES,
- 180,
- 215
- },
- {
- HESTIA_GUARDIAN_DEITY,
- HESTIAS_FAIRY_STONE,
- 430,
- 465
- },
- {
- PLAGUE_GOLEM,
- NUCLEUS_OF_LESSER_GOLEM,
- 380,
- 415
- },
- {
- DEMONS_AGENT_FALSTON,
- FALSTON_FANG,
- 220,
- 255
- },
- {
- QUEEN_SHYEED,
- SHAIDS_TALON,
- 130,
- 165
- }
+ // @formatter:off
+ {DAIMON_THE_WHITE_EYED, DAIMONS_EYES, 180, 215},
+ {HESTIA_GUARDIAN_DEITY, HESTIAS_FAIRY_STONE, 430, 465},
+ {PLAGUE_GOLEM, NUCLEUS_OF_LESSER_GOLEM, 380, 415},
+ {DEMONS_AGENT_FALSTON, FALSTON_FANG, 220, 255},
+ {QUEEN_SHYEED, SHAIDS_TALON, 130, 165}
};
-
// Radar
private static final int[][] radar =
{
- {
- 186320,
- -43904,
- -3175
- },
- {
- 134672,
- -115600,
- -1216
- },
- {
- 170000,
- -59900,
- -3848
- },
- {
- 93296,
- -75104,
- -1824
- },
- {
- 79635,
- -55612,
- -5980
- }
+ {186320, -43904, -3175},
+ {134672, -115600, -1216},
+ {170000, -59900, -3848},
+ {93296, -75104, -1824},
+ {79635, -55612, -5980}
+ // @formatter:on
};
public Q509_TheClansPrestige()
{
super(509, "The Clan's Prestige");
-
registerQuestItems(DAIMONS_EYES, HESTIAS_FAIRY_STONE, NUCLEUS_OF_LESSER_GOLEM, FALSTON_FANG, SHAIDS_TALON);
-
addStartNpc(VALDIS);
addTalkId(VALDIS);
-
addKillId(DAIMON_THE_WHITE_EYED, HESTIA_GUARDIAN_DEITY, PLAGUE_GOLEM, DEMONS_AGENT_FALSTON, QUEEN_SHYEED);
}
@@ -148,11 +98,9 @@ public class Q509_TheClansPrestige extends Quest
st.addRadar(x, y, z);
}
- st.set("cond", "1");
- st.setState(State.STARTED);
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
- else if (event.equalsIgnoreCase("31331-6.htm"))
+ else if (event.equals("31331-6.htm"))
{
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
@@ -176,6 +124,7 @@ public class Q509_TheClansPrestige extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (!player.isClanLeader())
{
st.exitQuest(true);
@@ -191,10 +140,11 @@ public class Q509_TheClansPrestige extends Quest
htmltext = "31331-0c.htm";
}
break;
-
+ }
case State.STARTED:
+ {
final int raid = st.getInt("raid");
- if (st.getInt("cond") == 1)
+ if (st.isCond(1))
{
final int item = REWARD_LIST[raid - 1][1];
final int count = st.getQuestItemsCount(item);
@@ -213,6 +163,7 @@ public class Q509_TheClansPrestige extends Quest
}
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q510_AClansReputation/Q510_AClansReputation.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q510_AClansReputation/Q510_AClansReputation.java
index 62895fec1d..4d31e60e46 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q510_AClansReputation/Q510_AClansReputation.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q510_AClansReputation/Q510_AClansReputation.java
@@ -30,22 +30,17 @@ public class Q510_AClansReputation extends Quest
{
// NPC
private static final int VALDIS = 31331;
-
// Quest Item
private static final int CLAW = 8767;
-
// Reward
private static final int CLAN_POINTS_REWARD = 50; // Quantity of points
public Q510_AClansReputation()
{
super(510, "A Clan's Reputation");
-
registerQuestItems(CLAW);
-
addStartNpc(VALDIS);
addTalkId(VALDIS);
-
addKillId(22215, 22216, 22217);
}
@@ -59,13 +54,11 @@ public class Q510_AClansReputation extends Quest
return htmltext;
}
- if (event.equalsIgnoreCase("31331-3.htm"))
+ if (event.equals("31331-3.htm"))
{
- st.set("cond", "1");
- st.setState(State.STARTED);
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
- else if (event.equalsIgnoreCase("31331-6.htm"))
+ else if (event.equals("31331-6.htm"))
{
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
@@ -87,6 +80,7 @@ public class Q510_AClansReputation extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (!player.isClanLeader())
{
st.exitQuest(true);
@@ -102,9 +96,10 @@ public class Q510_AClansReputation extends Quest
htmltext = "31331-1.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 1)
+ {
+ if (st.isCond(1))
{
final int count = st.getQuestItemsCount(CLAW);
if (count > 0)
@@ -123,6 +118,7 @@ public class Q510_AClansReputation extends Quest
}
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q601_WatchingEyes/Q601_WatchingEyes.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q601_WatchingEyes/Q601_WatchingEyes.java
index 33943364f9..18c5fa1b73 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q601_WatchingEyes/Q601_WatchingEyes.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q601_WatchingEyes/Q601_WatchingEyes.java
@@ -27,41 +27,23 @@ public class Q601_WatchingEyes extends Quest
{
// Items
private static final int PROOF_OF_AVENGER = 7188;
-
// Rewards
private static final int[][] REWARDS =
{
- {
- 6699,
- 90000,
- 20
- },
- {
- 6698,
- 80000,
- 40
- },
- {
- 6700,
- 40000,
- 50
- },
- {
- 0,
- 230000,
- 100
- }
+ // @formatter:off
+ {6699, 90000, 20},
+ {6698, 80000, 40},
+ {6700, 40000, 50},
+ {0, 230000, 100}
+ // @formatter:on
};
public Q601_WatchingEyes()
{
super(601, "Watching Eyes");
-
registerQuestItems(PROOF_OF_AVENGER);
-
addStartNpc(31683); // Eye of Argos
addTalkId(31683);
-
addKillId(21306, 21308, 21309, 21310, 21311);
}
@@ -83,9 +65,7 @@ public class Q601_WatchingEyes extends Quest
}
else
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
}
else if (event.equals("31683-07.htm"))
@@ -126,11 +106,13 @@ public class Q601_WatchingEyes extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "31683-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = (st.hasQuestItems(PROOF_OF_AVENGER)) ? "31683-05.htm" : "31683-04.htm";
@@ -140,6 +122,7 @@ public class Q601_WatchingEyes extends Quest
htmltext = "31683-06.htm";
}
break;
+ }
}
return htmltext;
@@ -148,7 +131,7 @@ public class Q601_WatchingEyes extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "cond", "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -162,7 +145,7 @@ public class Q601_WatchingEyes extends Quest
if (st.dropItems(PROOF_OF_AVENGER, 1, 100, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q602_ShadowOfLight/Q602_ShadowOfLight.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q602_ShadowOfLight/Q602_ShadowOfLight.java
index cc72f07152..e00e8fe844 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q602_ShadowOfLight/Q602_ShadowOfLight.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q602_ShadowOfLight/Q602_ShadowOfLight.java
@@ -26,48 +26,22 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q602_ShadowOfLight extends Quest
{
private static final int EYE_OF_DARKNESS = 7189;
-
private static final int[][] REWARDS =
{
- {
- 6699,
- 40000,
- 120000,
- 20000,
- 20
- },
- {
- 6698,
- 60000,
- 110000,
- 15000,
- 40
- },
- {
- 6700,
- 40000,
- 150000,
- 10000,
- 50
- },
- {
- 0,
- 100000,
- 140000,
- 11250,
- 100
- }
+ // @formatter:off
+ {6699, 40000, 120000, 20000, 20},
+ {6698, 60000, 110000, 15000, 40},
+ {6700, 40000, 150000, 10000, 50},
+ {0, 100000, 140000, 11250, 100}
+ // @formatter:on
};
public Q602_ShadowOfLight()
{
super(602, "Shadow of Light");
-
registerQuestItems(EYE_OF_DARKNESS);
-
addStartNpc(31683); // Eye of Argos
addTalkId(31683);
-
addKillId(21299, 21304);
}
@@ -89,9 +63,7 @@ public class Q602_ShadowOfLight extends Quest
}
else
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
}
else if (event.equals("31683-05.htm"))
@@ -134,11 +106,13 @@ public class Q602_ShadowOfLight extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "31683-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31683-03.htm";
@@ -148,6 +122,7 @@ public class Q602_ShadowOfLight extends Quest
htmltext = "31683-04.htm";
}
break;
+ }
}
return htmltext;
@@ -156,7 +131,7 @@ public class Q602_ShadowOfLight extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "cond", "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -170,7 +145,7 @@ public class Q602_ShadowOfLight extends Quest
if (st.dropItems(EYE_OF_DARKNESS, 1, 100, (npc.getNpcId() == 21299) ? 450000 : 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q603_DaimonTheWhiteEyed_Part1/Q603_DaimonTheWhiteEyed_Part1.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q603_DaimonTheWhiteEyed_Part1/Q603_DaimonTheWhiteEyed_Part1.java
index b65794591d..6a159d5e9d 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q603_DaimonTheWhiteEyed_Part1/Q603_DaimonTheWhiteEyed_Part1.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q603_DaimonTheWhiteEyed_Part1/Q603_DaimonTheWhiteEyed_Part1.java
@@ -27,11 +27,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
{
- // Items
- private static final int EVIL_SPIRIT_BEADS = 7190;
- private static final int BROKEN_CRYSTAL = 7191;
- private static final int UNFINISHED_SUMMON_CRYSTAL = 7192;
-
// NPCs
private static final int EYE_OF_ARGOS = 31683;
private static final int MYSTERIOUS_TABLET_1 = 31548;
@@ -39,12 +34,14 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
private static final int MYSTERIOUS_TABLET_3 = 31550;
private static final int MYSTERIOUS_TABLET_4 = 31551;
private static final int MYSTERIOUS_TABLET_5 = 31552;
-
// Monsters
private static final int CANYON_BANDERSNATCH_SLAVE = 21297;
private static final int BUFFALO_SLAVE = 21299;
private static final int GRENDEL_SLAVE = 21304;
-
+ // Items
+ private static final int EVIL_SPIRIT_BEADS = 7190;
+ private static final int BROKEN_CRYSTAL = 7191;
+ private static final int UNFINISHED_SUMMON_CRYSTAL = 7192;
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -57,12 +54,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
public Q603_DaimonTheWhiteEyed_Part1()
{
super(603, "Daimon the White-Eyed - Part 1");
-
registerQuestItems(EVIL_SPIRIT_BEADS, BROKEN_CRYSTAL);
-
addStartNpc(EYE_OF_ARGOS);
addTalkId(EYE_OF_ARGOS, MYSTERIOUS_TABLET_1, MYSTERIOUS_TABLET_2, MYSTERIOUS_TABLET_3, MYSTERIOUS_TABLET_4, MYSTERIOUS_TABLET_5);
-
addKillId(BUFFALO_SLAVE, GRENDEL_SLAVE, CANYON_BANDERSNATCH_SLAVE);
}
@@ -76,71 +70,78 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
return htmltext;
}
- // Eye of Argos
- if (event.equals("31683-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31683-06.htm"))
- {
- if (st.getQuestItemsCount(BROKEN_CRYSTAL) > 4)
+ case "31683-03.htm":
{
- st.set("cond", "7");
+ st.startQuest();
+ break;
+ }
+ case "31683-06.htm":
+ {
+ if (st.getQuestItemsCount(BROKEN_CRYSTAL) > 4)
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(BROKEN_CRYSTAL, -1);
+ }
+ else
+ {
+ htmltext = "31683-07.htm";
+ }
+ break;
+ }
+ case "31683-10.htm":
+ {
+ if (st.getQuestItemsCount(EVIL_SPIRIT_BEADS) > 199)
+ {
+ st.takeItems(EVIL_SPIRIT_BEADS, -1);
+ st.giveItems(UNFINISHED_SUMMON_CRYSTAL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ st.setCond(7);
+ htmltext = "31683-11.htm";
+ }
+ break;
+ }
+ case "31548-02.htm":
+ {
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(BROKEN_CRYSTAL, -1);
+ st.giveItems(BROKEN_CRYSTAL, 1);
+ break;
}
- else
+ case "31549-02.htm":
{
- htmltext = "31683-07.htm";
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BROKEN_CRYSTAL, 1);
+ break;
}
- }
- else if (event.equals("31683-10.htm"))
- {
- if (st.getQuestItemsCount(EVIL_SPIRIT_BEADS) > 199)
+ case "31550-02.htm":
{
- st.takeItems(EVIL_SPIRIT_BEADS, -1);
- st.giveItems(UNFINISHED_SUMMON_CRYSTAL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BROKEN_CRYSTAL, 1);
+ break;
}
- else
+ case "31551-02.htm":
{
- st.set("cond", "7");
- htmltext = "31683-11.htm";
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BROKEN_CRYSTAL, 1);
+ break;
+ }
+ case "31552-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(BROKEN_CRYSTAL, 1);
+ break;
}
- }
- // Mysterious tablets
- else if (event.equals("31548-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BROKEN_CRYSTAL, 1);
- }
- else if (event.equals("31549-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BROKEN_CRYSTAL, 1);
- }
- else if (event.equals("31550-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BROKEN_CRYSTAL, 1);
- }
- else if (event.equals("31551-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BROKEN_CRYSTAL, 1);
- }
- else if (event.equals("31552-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(BROKEN_CRYSTAL, 1);
}
return htmltext;
@@ -159,14 +160,17 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 73) ? "31683-02.htm" : "31683-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case EYE_OF_ARGOS:
+ {
if (cond < 6)
{
htmltext = "31683-04.htm";
@@ -184,8 +188,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31683-09.htm";
}
break;
-
+ }
case MYSTERIOUS_TABLET_1:
+ {
if (cond == 1)
{
htmltext = "31548-01.htm";
@@ -195,8 +200,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31548-03.htm";
}
break;
-
+ }
case MYSTERIOUS_TABLET_2:
+ {
if (cond == 2)
{
htmltext = "31549-01.htm";
@@ -206,8 +212,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31549-03.htm";
}
break;
-
+ }
case MYSTERIOUS_TABLET_3:
+ {
if (cond == 3)
{
htmltext = "31550-01.htm";
@@ -217,8 +224,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31550-03.htm";
}
break;
-
+ }
case MYSTERIOUS_TABLET_4:
+ {
if (cond == 4)
{
htmltext = "31551-01.htm";
@@ -228,8 +236,9 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31551-03.htm";
}
break;
-
+ }
case MYSTERIOUS_TABLET_5:
+ {
if (cond == 5)
{
htmltext = "31552-01.htm";
@@ -239,8 +248,10 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
htmltext = "31552-03.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -249,7 +260,7 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "7");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 7);
if (partyMember == null)
{
return null;
@@ -263,7 +274,7 @@ public class Q603_DaimonTheWhiteEyed_Part1 extends Quest
if (st.dropItems(EVIL_SPIRIT_BEADS, 1, 200, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "8");
+ st.setCond(8);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q604_DaimonTheWhiteEyed_Part2/Q604_DaimonTheWhiteEyed_Part2.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q604_DaimonTheWhiteEyed_Part2/Q604_DaimonTheWhiteEyed_Part2.java
index 3f07a43ca9..f99acdb138 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q604_DaimonTheWhiteEyed_Part2/Q604_DaimonTheWhiteEyed_Part2.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q604_DaimonTheWhiteEyed_Part2/Q604_DaimonTheWhiteEyed_Part2.java
@@ -30,13 +30,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
{
- // Monster
- private static final int DAIMON_THE_WHITE_EYED = 25290;
-
// NPCs
private static final int EYE_OF_ARGOS = 31683;
private static final int DAIMON_ALTAR = 31541;
-
+ // Monster
+ private static final int DAIMON_THE_WHITE_EYED = 25290;
// Items
private static final int UNFINISHED_SUMMON_CRYSTAL = 7192;
private static final int SUMMON_CRYSTAL = 7193;
@@ -50,39 +48,37 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
4599,
4600
};
-
// Other
private static final int CHECK_INTERVAL = 600000; // 10 minutes
private static final int IDLE_INTERVAL = 3; // (X * CHECK_INTERVAL) = 30 minutes
-
private NpcInstance _npc = null;
private int _status = -1;
public Q604_DaimonTheWhiteEyed_Part2()
{
super(604, "Daimon the White-Eyed - Part 2");
-
registerQuestItems(SUMMON_CRYSTAL, ESSENCE_OF_DAIMON);
-
addStartNpc(EYE_OF_ARGOS);
addTalkId(EYE_OF_ARGOS, DAIMON_ALTAR);
-
addAttackId(DAIMON_THE_WHITE_EYED);
addKillId(DAIMON_THE_WHITE_EYED);
-
switch (RaidBossSpawnManager.getInstance().getRaidBossStatusId(DAIMON_THE_WHITE_EYED))
{
case UNDEFINED:
+ {
LOGGER.log(Level.WARNING, getName() + ": can not find spawned RaidBoss id=" + DAIMON_THE_WHITE_EYED);
break;
-
+ }
case ALIVE:
+ {
spawnNpc();
// fallthrough
-
+ }
case DEAD:
+ {
startQuestTimer("check", CHECK_INTERVAL, null, null, true);
break;
+ }
}
}
@@ -113,58 +109,60 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
return htmltext;
}
- // Eye of Argos
- if (event.equals("31683-03.htm"))
+ switch (event)
{
- if (st.hasQuestItems(UNFINISHED_SUMMON_CRYSTAL))
+ case "31683-03.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.takeItems(UNFINISHED_SUMMON_CRYSTAL, 1);
- st.giveItems(SUMMON_CRYSTAL, 1);
- }
- else
- {
- htmltext = "31683-04.htm";
- }
- }
- else if (event.equals("31683-08.htm"))
- {
- if (st.hasQuestItems(ESSENCE_OF_DAIMON))
- {
- st.takeItems(ESSENCE_OF_DAIMON, 1);
- st.rewardItems(REWARD_DYE[Rnd.get(REWARD_DYE.length)], 5);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else
- {
- htmltext = "31683-09.htm";
- }
- }
- // Diamon's Altar
- else if (event.equals("31541-02.htm"))
- {
- if (st.hasQuestItems(SUMMON_CRYSTAL))
- {
- if (_status < 0)
+ if (st.hasQuestItems(UNFINISHED_SUMMON_CRYSTAL))
{
- if (spawnRaid())
+ st.startQuest();
+ st.takeItems(UNFINISHED_SUMMON_CRYSTAL, 1);
+ st.giveItems(SUMMON_CRYSTAL, 1);
+ }
+ else
+ {
+ htmltext = "31683-04.htm";
+ }
+ break;
+ }
+ case "31683-08.htm":
+ {
+ if (st.hasQuestItems(ESSENCE_OF_DAIMON))
+ {
+ st.takeItems(ESSENCE_OF_DAIMON, 1);
+ st.rewardItems(REWARD_DYE[Rnd.get(REWARD_DYE.length)], 5);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "31683-09.htm";
+ }
+ break;
+ }
+ case "31541-02.htm":
+ {
+ if (st.hasQuestItems(SUMMON_CRYSTAL))
+ {
+ if (_status < 0)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SUMMON_CRYSTAL, 1);
+ if (spawnRaid())
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SUMMON_CRYSTAL, 1);
+ }
+ }
+ else
+ {
+ htmltext = "31541-04.htm";
}
}
else
{
- htmltext = "31541-04.htm";
+ htmltext = "31541-03.htm";
}
- }
- else
- {
- htmltext = "31541-03.htm";
+ break;
}
}
@@ -184,6 +182,7 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 73)
{
htmltext = "31683-02.htm";
@@ -194,12 +193,14 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
htmltext = "31683-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case EYE_OF_ARGOS:
+ {
if (cond == 1)
{
htmltext = "31683-05.htm";
@@ -213,8 +214,9 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
htmltext = "31683-07.htm";
}
break;
-
+ }
case DAIMON_ALTAR:
+ {
if (cond == 1)
{
htmltext = "31541-01.htm";
@@ -224,8 +226,10 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
htmltext = "31541-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -241,7 +245,7 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "2"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 2))
{
final QuestState st = partyMember.getQuestState(getName());
if (st == null)
@@ -249,7 +253,7 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
continue;
}
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(ESSENCE_OF_DAIMON, 1);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q605_AllianceWithKetraOrcs/Q605_AllianceWithKetraOrcs.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q605_AllianceWithKetraOrcs/Q605_AllianceWithKetraOrcs.java
index e7c7e92d6a..70eccbe6f4 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q605_AllianceWithKetraOrcs/Q605_AllianceWithKetraOrcs.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q605_AllianceWithKetraOrcs/Q605_AllianceWithKetraOrcs.java
@@ -58,7 +58,6 @@ public class Q605_AllianceWithKetraOrcs extends Quest
CHANCES.put(21374, 626000);
CHANCES.put(21375, 626000);
}
-
private static final Map CHANCES_MANE = new HashMap<>();
static
{
@@ -78,36 +77,26 @@ public class Q605_AllianceWithKetraOrcs extends Quest
CHANCES_MANE.put(21371, 713000);
CHANCES_MANE.put(21373, 738000);
}
-
// Quest Items
private static final int VARKA_BADGE_SOLDIER = 7216;
private static final int VARKA_BADGE_OFFICER = 7217;
private static final int VARKA_BADGE_CAPTAIN = 7218;
-
private static final int KETRA_ALLIANCE_1 = 7211;
private static final int KETRA_ALLIANCE_2 = 7212;
private static final int KETRA_ALLIANCE_3 = 7213;
private static final int KETRA_ALLIANCE_4 = 7214;
private static final int KETRA_ALLIANCE_5 = 7215;
-
private static final int TOTEM_OF_VALOR = 7219;
private static final int TOTEM_OF_WISDOM = 7220;
-
private static final int VARKA_MANE = 7233;
public Q605_AllianceWithKetraOrcs()
{
super(605, "Alliance with Ketra Orcs");
-
registerQuestItems(VARKA_BADGE_SOLDIER, VARKA_BADGE_OFFICER, VARKA_BADGE_CAPTAIN);
-
addStartNpc(31371); // Wahkan
addTalkId(31371);
-
- for (int mobs : CHANCES.keySet())
- {
- addKillId(mobs);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -120,113 +109,115 @@ public class Q605_AllianceWithKetraOrcs extends Quest
return htmltext;
}
- if (event.equals("31371-03a.htm"))
+ switch (event)
{
- if (player.isAlliedWithVarka())
+ case "31371-03a.htm":
{
- htmltext = "31371-02a.htm";
- }
- else
- {
- st.setState(State.STARTED);
- st.playSound(QuestState.SOUND_ACCEPT);
- for (int i = KETRA_ALLIANCE_1; i <= KETRA_ALLIANCE_5; i++)
+ if (player.isAlliedWithVarka())
{
- if (st.hasQuestItems(i))
+ htmltext = "31371-02a.htm";
+ }
+ else
+ {
+ st.startQuest();
+ for (int i = KETRA_ALLIANCE_1; i <= KETRA_ALLIANCE_5; i++)
{
- st.set("cond", String.valueOf(i - 7209));
- player.setAllianceWithVarkaKetra(i - 7210);
- return "31371-0" + (i - 7207) + ".htm";
+ if (st.hasQuestItems(i))
+ {
+ st.setCond(i - 7209);
+ player.setAllianceWithVarkaKetra(i - 7210);
+ return "31371-0" + (i - 7207) + ".htm";
+ }
}
}
- st.set("cond", "1");
+ break;
}
- }
- // Stage 1
- else if (event.equals("31371-10-1.htm"))
- {
- if (st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 100)
+ case "31371-10-1.htm":
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VARKA_BADGE_SOLDIER, -1);
- st.giveItems(KETRA_ALLIANCE_1, 1);
- player.setAllianceWithVarkaKetra(1);
+ if (st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 100)
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VARKA_BADGE_SOLDIER, -1);
+ st.giveItems(KETRA_ALLIANCE_1, 1);
+ player.setAllianceWithVarkaKetra(1);
+ }
+ else
+ {
+ htmltext = "31371-03b.htm";
+ }
+ break;
}
- else
+ case "31371-10-2.htm":
{
- htmltext = "31371-03b.htm";
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 200) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 100))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VARKA_BADGE_SOLDIER, -1);
+ st.takeItems(VARKA_BADGE_OFFICER, -1);
+ st.takeItems(KETRA_ALLIANCE_1, -1);
+ st.giveItems(KETRA_ALLIANCE_2, 1);
+ player.setAllianceWithVarkaKetra(2);
+ }
+ else
+ {
+ htmltext = "31371-12.htm";
+ }
+ break;
}
- }
- // Stage 2
- else if (event.equals("31371-10-2.htm"))
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 200) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 100))
+ case "31371-10-3.htm":
+ {
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 200) && (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) >= 100))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VARKA_BADGE_SOLDIER, -1);
+ st.takeItems(VARKA_BADGE_OFFICER, -1);
+ st.takeItems(VARKA_BADGE_CAPTAIN, -1);
+ st.takeItems(KETRA_ALLIANCE_2, -1);
+ st.giveItems(KETRA_ALLIANCE_3, 1);
+ player.setAllianceWithVarkaKetra(3);
+ }
+ else
+ {
+ htmltext = "31371-15.htm";
+ }
+ break;
+ }
+ case "31371-10-4.htm":
+ {
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) >= 200) && (st.getQuestItemsCount(TOTEM_OF_VALOR) >= 1))
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VARKA_BADGE_SOLDIER, -1);
+ st.takeItems(VARKA_BADGE_OFFICER, -1);
+ st.takeItems(VARKA_BADGE_CAPTAIN, -1);
+ st.takeItems(TOTEM_OF_VALOR, -1);
+ st.takeItems(KETRA_ALLIANCE_3, -1);
+ st.giveItems(KETRA_ALLIANCE_4, 1);
+ player.setAllianceWithVarkaKetra(4);
+ }
+ else
+ {
+ htmltext = "31371-21.htm";
+ }
+ break;
+ }
+ case "31371-20.htm":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VARKA_BADGE_SOLDIER, -1);
- st.takeItems(VARKA_BADGE_OFFICER, -1);
st.takeItems(KETRA_ALLIANCE_1, -1);
- st.giveItems(KETRA_ALLIANCE_2, 1);
- player.setAllianceWithVarkaKetra(2);
- }
- else
- {
- htmltext = "31371-12.htm";
- }
- }
- // Stage 3
- else if (event.equals("31371-10-3.htm"))
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 200) && (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) >= 100))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VARKA_BADGE_SOLDIER, -1);
- st.takeItems(VARKA_BADGE_OFFICER, -1);
- st.takeItems(VARKA_BADGE_CAPTAIN, -1);
st.takeItems(KETRA_ALLIANCE_2, -1);
- st.giveItems(KETRA_ALLIANCE_3, 1);
- player.setAllianceWithVarkaKetra(3);
- }
- else
- {
- htmltext = "31371-15.htm";
- }
- }
- // Stage 4
- else if (event.equals("31371-10-4.htm"))
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_OFFICER) >= 300) && (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) >= 200) && (st.getQuestItemsCount(TOTEM_OF_VALOR) >= 1))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VARKA_BADGE_SOLDIER, -1);
- st.takeItems(VARKA_BADGE_OFFICER, -1);
- st.takeItems(VARKA_BADGE_CAPTAIN, -1);
- st.takeItems(TOTEM_OF_VALOR, -1);
st.takeItems(KETRA_ALLIANCE_3, -1);
- st.giveItems(KETRA_ALLIANCE_4, 1);
- player.setAllianceWithVarkaKetra(4);
+ st.takeItems(KETRA_ALLIANCE_4, -1);
+ st.takeItems(KETRA_ALLIANCE_5, -1);
+ st.takeItems(TOTEM_OF_VALOR, -1);
+ st.takeItems(TOTEM_OF_WISDOM, -1);
+ player.setAllianceWithVarkaKetra(0);
+ st.exitQuest(true);
+ break;
}
- else
- {
- htmltext = "31371-21.htm";
- }
- }
- // Leave quest
- else if (event.equals("31371-20.htm"))
- {
- st.takeItems(KETRA_ALLIANCE_1, -1);
- st.takeItems(KETRA_ALLIANCE_2, -1);
- st.takeItems(KETRA_ALLIANCE_3, -1);
- st.takeItems(KETRA_ALLIANCE_4, -1);
- st.takeItems(KETRA_ALLIANCE_5, -1);
- st.takeItems(TOTEM_OF_VALOR, -1);
- st.takeItems(TOTEM_OF_WISDOM, -1);
- player.setAllianceWithVarkaKetra(0);
- st.exitQuest(true);
}
return htmltext;
@@ -245,6 +236,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 74)
{
htmltext = "31371-01.htm";
@@ -256,78 +248,88 @@ public class Q605_AllianceWithKetraOrcs extends Quest
player.setAllianceWithVarkaKetra(0);
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
- if (cond == 1)
+ {
+ switch (st.getCond())
{
- if (st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 100)
+ case 1:
{
- htmltext = "31371-03b.htm";
+ if (st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 100)
+ {
+ htmltext = "31371-03b.htm";
+ }
+ else
+ {
+ htmltext = "31371-09.htm";
+ }
+ break;
}
- else
+ case 2:
{
- htmltext = "31371-09.htm";
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 200) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 100))
+ {
+ htmltext = "31371-12.htm";
+ }
+ else
+ {
+ htmltext = "31371-13.htm";
+ }
+ break;
}
- }
- else if (cond == 2)
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 200) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 100))
+ case 3:
{
- htmltext = "31371-12.htm";
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 200) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 100))
+ {
+ htmltext = "31371-15.htm";
+ }
+ else
+ {
+ htmltext = "31371-16.htm";
+ }
+ break;
}
- else
+ case 4:
{
- htmltext = "31371-13.htm";
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(TOTEM_OF_VALOR))
+ {
+ htmltext = "31371-21.htm";
+ }
+ else
+ {
+ htmltext = "31371-22.htm";
+ }
+ break;
}
- }
- else if (cond == 3)
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 200) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 100))
+ case 5:
{
- htmltext = "31371-15.htm";
+ if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 400) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 400) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(TOTEM_OF_WISDOM))
+ {
+ htmltext = "31371-17.htm";
+ }
+ else
+ {
+ htmltext = "31371-10-5.htm";
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VARKA_BADGE_SOLDIER, 400);
+ st.takeItems(VARKA_BADGE_OFFICER, 400);
+ st.takeItems(VARKA_BADGE_CAPTAIN, 200);
+ st.takeItems(TOTEM_OF_WISDOM, -1);
+ st.takeItems(KETRA_ALLIANCE_4, -1);
+ st.giveItems(KETRA_ALLIANCE_5, 1);
+ player.setAllianceWithVarkaKetra(5);
+ }
+ break;
}
- else
+ case 6:
{
- htmltext = "31371-16.htm";
+ htmltext = "31371-08.htm";
+ break;
}
}
- else if (cond == 4)
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 300) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(TOTEM_OF_VALOR))
- {
- htmltext = "31371-21.htm";
- }
- else
- {
- htmltext = "31371-22.htm";
- }
- }
- else if (cond == 5)
- {
- if ((st.getQuestItemsCount(VARKA_BADGE_SOLDIER) < 400) || (st.getQuestItemsCount(VARKA_BADGE_OFFICER) < 400) || (st.getQuestItemsCount(VARKA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(TOTEM_OF_WISDOM))
- {
- htmltext = "31371-17.htm";
- }
- else
- {
- htmltext = "31371-10-5.htm";
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VARKA_BADGE_SOLDIER, 400);
- st.takeItems(VARKA_BADGE_OFFICER, 400);
- st.takeItems(VARKA_BADGE_CAPTAIN, 200);
- st.takeItems(TOTEM_OF_WISDOM, -1);
- st.takeItems(KETRA_ALLIANCE_4, -1);
- st.giveItems(KETRA_ALLIANCE_5, 1);
- player.setAllianceWithVarkaKetra(5);
- }
- }
- else if (cond == 6)
- {
- htmltext = "31371-08.htm";
- }
break;
+ }
}
return htmltext;
@@ -358,7 +360,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond == 6)
{
return null;
@@ -371,6 +373,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
case 21353:
case 21354:
case 21355:
+ {
if (cond == 1)
{
st.dropItems(VARKA_BADGE_SOLDIER, 1, 100, CHANCES.get(npcId));
@@ -388,7 +391,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
st.dropItems(VARKA_BADGE_SOLDIER, 1, 400, CHANCES.get(npcId));
}
break;
-
+ }
case 21357:
case 21358:
case 21360:
@@ -397,6 +400,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
case 21364:
case 21369:
case 21370:
+ {
if (cond == 2)
{
st.dropItems(VARKA_BADGE_OFFICER, 1, 100, CHANCES.get(npcId));
@@ -414,7 +418,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
st.dropItems(VARKA_BADGE_OFFICER, 1, 400, CHANCES.get(npcId));
}
break;
-
+ }
case 21365:
case 21366:
case 21368:
@@ -423,6 +427,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
case 21373:
case 21374:
case 21375:
+ {
if (cond == 3)
{
st.dropItems(VARKA_BADGE_CAPTAIN, 1, 100, CHANCES.get(npcId));
@@ -432,6 +437,7 @@ public class Q605_AllianceWithKetraOrcs extends Quest
st.dropItems(VARKA_BADGE_CAPTAIN, 1, 200, CHANCES.get(npcId));
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q606_WarWithVarkaSilenos/Q606_WarWithVarkaSilenos.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q606_WarWithVarkaSilenos/Q606_WarWithVarkaSilenos.java
index 36acb6eb6d..c4b03466c0 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q606_WarWithVarkaSilenos/Q606_WarWithVarkaSilenos.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q606_WarWithVarkaSilenos/Q606_WarWithVarkaSilenos.java
@@ -34,9 +34,7 @@ public class Q606_WarWithVarkaSilenos extends Quest
public Q606_WarWithVarkaSilenos()
{
super(606, "War with Varka Silenos");
-
registerQuestItems(VARKA_MANE);
-
addStartNpc(31370); // Kadun Zu Ketra
addTalkId(31370);
}
@@ -51,29 +49,33 @@ public class Q606_WarWithVarkaSilenos extends Quest
return htmltext;
}
- if (event.equals("31370-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31370-07.htm"))
- {
- if (st.getQuestItemsCount(VARKA_MANE) >= 100)
+ case "31370-03.htm":
{
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(VARKA_MANE, 100);
- st.giveItems(HORN_OF_BUFFALO, 20);
+ st.startQuest();
+ break;
}
- else
+ case "31370-07.htm":
{
- htmltext = "31370-08.htm";
+ if (st.getQuestItemsCount(VARKA_MANE) >= 100)
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(VARKA_MANE, 100);
+ st.giveItems(HORN_OF_BUFFALO, 20);
+ }
+ else
+ {
+ htmltext = "31370-08.htm";
+ }
+ break;
+ }
+ case "31370-09.htm":
+ {
+ st.takeItems(VARKA_MANE, -1);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("31370-09.htm"))
- {
- st.takeItems(VARKA_MANE, -1);
- st.exitQuest(true);
}
return htmltext;
@@ -92,12 +94,15 @@ public class Q606_WarWithVarkaSilenos extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() >= 74) && player.isAlliedWithKetra()) ? "31370-01.htm" : "31370-02.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(VARKA_MANE)) ? "31370-04.htm" : "31370-05.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q607_ProveYourCourage/Q607_ProveYourCourage.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q607_ProveYourCourage/Q607_ProveYourCourage.java
index 8182dc2b21..c3c986b4b0 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q607_ProveYourCourage/Q607_ProveYourCourage.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q607_ProveYourCourage/Q607_ProveYourCourage.java
@@ -32,12 +32,9 @@ public class Q607_ProveYourCourage extends Quest
public Q607_ProveYourCourage()
{
super(607, "Prove your courage!");
-
registerQuestItems(HEAD_OF_SHADITH);
-
addStartNpc(31370); // Kadun Zu Ketra
addTalkId(31370);
-
addKillId(25309); // Shadith
}
@@ -53,9 +50,7 @@ public class Q607_ProveYourCourage extends Quest
if (event.equals("31370-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31370-07.htm"))
{
@@ -70,7 +65,7 @@ public class Q607_ProveYourCourage extends Quest
else
{
htmltext = "31370-06.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.playSound(QuestState.SOUND_ACCEPT);
}
}
@@ -91,6 +86,7 @@ public class Q607_ProveYourCourage extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 75)
{
htmltext = "31370-03.htm";
@@ -104,10 +100,12 @@ public class Q607_ProveYourCourage extends Quest
htmltext = "31370-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(HEAD_OF_SHADITH)) ? "31370-05.htm" : "31370-06.htm";
break;
+ }
}
return htmltext;
@@ -116,7 +114,7 @@ public class Q607_ProveYourCourage extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "1"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 1))
{
if (partyMember.getAllianceWithVarkaKetra() >= 3)
{
@@ -128,7 +126,7 @@ public class Q607_ProveYourCourage extends Quest
if (st.hasQuestItems(KETRA_ALLIANCE_3))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HEAD_OF_SHADITH, 1);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q608_SlayTheEnemyCommander/Q608_SlayTheEnemyCommander.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q608_SlayTheEnemyCommander/Q608_SlayTheEnemyCommander.java
index 86848b844f..4bc961ec38 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q608_SlayTheEnemyCommander/Q608_SlayTheEnemyCommander.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q608_SlayTheEnemyCommander/Q608_SlayTheEnemyCommander.java
@@ -32,12 +32,9 @@ public class Q608_SlayTheEnemyCommander extends Quest
public Q608_SlayTheEnemyCommander()
{
super(608, "Slay the enemy commander!");
-
registerQuestItems(HEAD_OF_MOS);
-
addStartNpc(31370); // Kadun Zu Ketra
addTalkId(31370);
-
addKillId(25312); // Mos
}
@@ -53,9 +50,7 @@ public class Q608_SlayTheEnemyCommander extends Quest
if (event.equals("31370-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31370-07.htm"))
{
@@ -70,7 +65,7 @@ public class Q608_SlayTheEnemyCommander extends Quest
else
{
htmltext = "31370-06.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.playSound(QuestState.SOUND_ACCEPT);
}
}
@@ -91,6 +86,7 @@ public class Q608_SlayTheEnemyCommander extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 75)
{
if ((player.getAllianceWithVarkaKetra() >= 4) && st.hasQuestItems(KETRA_ALLIANCE_4) && !st.hasQuestItems(TOTEM_OF_WISDOM))
@@ -107,10 +103,12 @@ public class Q608_SlayTheEnemyCommander extends Quest
htmltext = "31370-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(HEAD_OF_MOS)) ? "31370-05.htm" : "31370-06.htm";
break;
+ }
}
return htmltext;
@@ -119,7 +117,7 @@ public class Q608_SlayTheEnemyCommander extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "1"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 1))
{
if (partyMember.getAllianceWithVarkaKetra() >= 4)
{
@@ -131,7 +129,7 @@ public class Q608_SlayTheEnemyCommander extends Quest
if (st.hasQuestItems(KETRA_ALLIANCE_4))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HEAD_OF_MOS, 1);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q609_MagicalPowerOfWater_Part1/Q609_MagicalPowerOfWater_Part1.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q609_MagicalPowerOfWater_Part1/Q609_MagicalPowerOfWater_Part1.java
index 8455f1fe1a..847369bcbf 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q609_MagicalPowerOfWater_Part1/Q609_MagicalPowerOfWater_Part1.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q609_MagicalPowerOfWater_Part1/Q609_MagicalPowerOfWater_Part1.java
@@ -29,7 +29,6 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
private static final int ASEFA = 31372;
private static final int UDAN_BOX = 31561;
private static final int EYE = 31685;
-
// Items
private static final int THIEF_KEY = 1661;
private static final int STOLEN_GREEN_TOTEM = 7237;
@@ -39,12 +38,9 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
public Q609_MagicalPowerOfWater_Part1()
{
super(609, "Magical Power of Water - Part 1");
-
registerQuestItems(STOLEN_GREEN_TOTEM);
-
addStartNpc(WAHKAN);
addTalkId(WAHKAN, ASEFA, UDAN_BOX);
-
// IDs aggro ranges to avoid, else quest is automatically failed.
addAggroRangeEnterId(21350, 21351, 21353, 21354, 21355, 21357, 21358, 21360, 21361, 21362, 21369, 21370, 21364, 21365, 21366, 21368, 21371, 21372, 21373, 21374, 21375);
}
@@ -59,37 +55,40 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
return htmltext;
}
- if (event.equals("31371-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("spawned", "0");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31561-03.htm"))
- {
- // You have been discovered ; quest is failed.
- if (st.getInt("spawned") == 1)
+ case "31371-03.htm":
{
- htmltext = "31561-04.htm";
+ st.startQuest();
+ st.set("spawned", "0");
+ break;
}
- else if (!st.hasQuestItems(THIEF_KEY))
+ case "31561-03.htm":
{
- htmltext = "31561-02.htm";
+ // You have been discovered ; quest is failed.
+ if (st.getInt("spawned") == 1)
+ {
+ htmltext = "31561-04.htm";
+ }
+ else if (!st.hasQuestItems(THIEF_KEY))
+ {
+ htmltext = "31561-02.htm";
+ }
+ else
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(THIEF_KEY, 1);
+ st.giveItems(STOLEN_GREEN_TOTEM, 1);
+ }
+ break;
}
- else
+ case "AsefaEyeDespawn":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(THIEF_KEY, 1);
- st.giveItems(STOLEN_GREEN_TOTEM, 1);
+ npc.broadcastNpcSay("I'll be waiting for your return.");
+ return null;
}
}
- else if (event.equals("AsefaEyeDespawn"))
- {
- npc.broadcastNpcSay("I'll be waiting for your return.");
- return null;
- }
return htmltext;
}
@@ -107,22 +106,26 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() >= 74) && (player.getAllianceWithVarkaKetra() >= 2)) ? "31371-01.htm" : "31371-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case WAHKAN:
+ {
htmltext = "31371-04.htm";
break;
-
+ }
case ASEFA:
+ {
if (cond == 1)
{
htmltext = "31372-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 2)
@@ -151,8 +154,9 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
st.exitQuest(true);
}
break;
-
+ }
case UDAN_BOX:
+ {
if (cond == 2)
{
htmltext = "31561-01.htm";
@@ -162,8 +166,10 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
htmltext = "31561-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -178,7 +184,7 @@ public class Q609_MagicalPowerOfWater_Part1 extends Quest
return null;
}
- if ((st.getInt("spawned") == 0) && (st.getInt("cond") == 2))
+ if (st.isCond(2) && (st.getInt("spawned") == 0))
{
// Put "spawned" flag to 1 to avoid to spawn another.
st.set("spawned", "1");
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q610_MagicalPowerOfWater_Part2/Q610_MagicalPowerOfWater_Part2.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q610_MagicalPowerOfWater_Part2/Q610_MagicalPowerOfWater_Part2.java
index 575bcdc70a..7e89872364 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q610_MagicalPowerOfWater_Part2/Q610_MagicalPowerOfWater_Part2.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q610_MagicalPowerOfWater_Part2/Q610_MagicalPowerOfWater_Part2.java
@@ -29,49 +29,46 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q610_MagicalPowerOfWater_Part2 extends Quest
{
- // Monster
- private static final int SOUL_OF_WATER_ASHUTAR = 25316;
-
// NPCs
private static final int ASEFA = 31372;
private static final int VARKAS_HOLY_ALTAR = 31560;
-
+ // Monster
+ private static final int SOUL_OF_WATER_ASHUTAR = 25316;
// Items
private static final int GREEN_TOTEM = 7238;
private static final int ICE_HEART_OF_ASHUTAR = 7239;
-
// Other
private static final int CHECK_INTERVAL = 600000; // 10 minutes
private static final int IDLE_INTERVAL = 2; // (X * CHECK_INTERVAL) = 20 minutes
-
private NpcInstance _npc = null;
private int _status = -1;
public Q610_MagicalPowerOfWater_Part2()
{
super(610, "Magical Power of Water - Part 2");
-
registerQuestItems(ICE_HEART_OF_ASHUTAR);
-
addStartNpc(ASEFA);
addTalkId(ASEFA, VARKAS_HOLY_ALTAR);
-
addAttackId(SOUL_OF_WATER_ASHUTAR);
addKillId(SOUL_OF_WATER_ASHUTAR);
switch (RaidBossSpawnManager.getInstance().getRaidBossStatusId(SOUL_OF_WATER_ASHUTAR))
{
case UNDEFINED:
+ {
LOGGER.log(Level.WARNING, getName() + ": can not find spawned RaidBoss id=" + SOUL_OF_WATER_ASHUTAR);
break;
-
+ }
case ALIVE:
+ {
spawnNpc();
// fallthrough
-
+ }
case DEAD:
+ {
startQuestTimer("check", CHECK_INTERVAL, null, null, true);
break;
+ }
}
}
@@ -102,56 +99,58 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
return htmltext;
}
- // Asefa
- if (event.equals("31372-04.htm"))
+ switch (event)
{
- if (st.hasQuestItems(GREEN_TOTEM))
+ case "31372-04.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else
- {
- htmltext = "31372-02.htm";
- }
- }
- else if (event.equals("31372-07.htm"))
- {
- if (st.hasQuestItems(ICE_HEART_OF_ASHUTAR))
- {
- st.takeItems(ICE_HEART_OF_ASHUTAR, 1);
- st.rewardExpAndSp(10000, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else
- {
- htmltext = "31372-08.htm";
- }
- }
- // Varka's Holy Altar
- else if (event.equals("31560-02.htm"))
- {
- if (st.hasQuestItems(GREEN_TOTEM))
- {
- if (_status < 0)
+ if (st.hasQuestItems(GREEN_TOTEM))
{
- if (spawnRaid())
+ st.startQuest();
+ }
+ else
+ {
+ htmltext = "31372-02.htm";
+ }
+ break;
+ }
+ case "31372-07.htm":
+ {
+ if (st.hasQuestItems(ICE_HEART_OF_ASHUTAR))
+ {
+ st.takeItems(ICE_HEART_OF_ASHUTAR, 1);
+ st.rewardExpAndSp(10000, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "31372-08.htm";
+ }
+ break;
+ }
+ case "31560-02.htm":
+ {
+ if (st.hasQuestItems(GREEN_TOTEM))
+ {
+ if (_status < 0)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(GREEN_TOTEM, 1);
+ if (spawnRaid())
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(GREEN_TOTEM, 1);
+ }
+ }
+ else
+ {
+ htmltext = "31560-04.htm";
}
}
else
{
- htmltext = "31560-04.htm";
+ htmltext = "31560-03.htm";
}
- }
- else
- {
- htmltext = "31560-03.htm";
+ break;
}
}
@@ -171,6 +170,7 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (!st.hasQuestItems(GREEN_TOTEM))
{
htmltext = "31372-02.htm";
@@ -184,16 +184,19 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
htmltext = "31372-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case ASEFA:
+ {
htmltext = (cond < 3) ? "31372-05.htm" : "31372-06.htm";
break;
-
+ }
case VARKAS_HOLY_ALTAR:
+ {
if (cond == 1)
{
htmltext = "31560-01.htm";
@@ -203,8 +206,10 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
htmltext = "31560-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -220,7 +225,7 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "2"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 2))
{
final QuestState st = partyMember.getQuestState(getName());
if (st == null)
@@ -228,7 +233,7 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
continue;
}
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(ICE_HEART_OF_ASHUTAR, 1);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q611_AllianceWithVarkaSilenos/Q611_AllianceWithVarkaSilenos.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q611_AllianceWithVarkaSilenos/Q611_AllianceWithVarkaSilenos.java
index 41597572c9..66be081496 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q611_AllianceWithVarkaSilenos/Q611_AllianceWithVarkaSilenos.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q611_AllianceWithVarkaSilenos/Q611_AllianceWithVarkaSilenos.java
@@ -58,7 +58,6 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
CHANCES.put(21348, 626000);
CHANCES.put(21349, 626000);
}
-
private static final Map CHANCES_MOLAR = new HashMap<>();
static
{
@@ -78,36 +77,26 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
CHANCES_MOLAR.put(21345, 713000);
CHANCES_MOLAR.put(21347, 738000);
}
-
// Quest Items
private static final int KETRA_BADGE_SOLDIER = 7226;
private static final int KETRA_BADGE_OFFICER = 7227;
private static final int KETRA_BADGE_CAPTAIN = 7228;
-
private static final int VARKA_ALLIANCE_1 = 7221;
private static final int VARKA_ALLIANCE_2 = 7222;
private static final int VARKA_ALLIANCE_3 = 7223;
private static final int VARKA_ALLIANCE_4 = 7224;
private static final int VARKA_ALLIANCE_5 = 7225;
-
private static final int VALOR_FEATHER = 7229;
private static final int WISDOM_FEATHER = 7230;
-
private static final int MOLAR_OF_KETRA_ORC = 7234;
public Q611_AllianceWithVarkaSilenos()
{
super(611, "Alliance with Varka Silenos");
-
registerQuestItems(KETRA_BADGE_SOLDIER, KETRA_BADGE_OFFICER, KETRA_BADGE_CAPTAIN);
-
addStartNpc(31378); // Naran Ashanuk
addTalkId(31378);
-
- for (int mobs : CHANCES.keySet())
- {
- addKillId(mobs);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -120,113 +109,115 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
return htmltext;
}
- if (event.equals("31378-03a.htm"))
+ switch (event)
{
- if (player.isAlliedWithKetra())
+ case "31378-03a.htm":
{
- htmltext = "31378-02a.htm";
- }
- else
- {
- st.setState(State.STARTED);
- st.playSound(QuestState.SOUND_ACCEPT);
- for (int i = VARKA_ALLIANCE_1; i <= VARKA_ALLIANCE_5; i++)
+ if (player.isAlliedWithKetra())
{
- if (st.hasQuestItems(i))
+ htmltext = "31378-02a.htm";
+ }
+ else
+ {
+ st.startQuest();
+ for (int i = VARKA_ALLIANCE_1; i <= VARKA_ALLIANCE_5; i++)
{
- st.set("cond", String.valueOf(i - 7219));
- player.setAllianceWithVarkaKetra(7220 - i);
- return "31378-0" + (i - 7217) + ".htm";
+ if (st.hasQuestItems(i))
+ {
+ st.setCond(i - 7219);
+ player.setAllianceWithVarkaKetra(7220 - i);
+ return "31378-0" + (i - 7217) + ".htm";
+ }
}
}
- st.set("cond", "1");
+ break;
}
- }
- // Stage 1
- else if (event.equals("31378-10-1.htm"))
- {
- if (st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 100)
+ case "31378-10-1.htm":
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KETRA_BADGE_SOLDIER, -1);
- st.giveItems(VARKA_ALLIANCE_1, 1);
- player.setAllianceWithVarkaKetra(-1);
+ if (st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 100)
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KETRA_BADGE_SOLDIER, -1);
+ st.giveItems(VARKA_ALLIANCE_1, 1);
+ player.setAllianceWithVarkaKetra(-1);
+ }
+ else
+ {
+ htmltext = "31378-03b.htm";
+ }
+ break;
}
- else
+ case "31378-10-2.htm":
{
- htmltext = "31378-03b.htm";
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 200) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 100))
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KETRA_BADGE_SOLDIER, -1);
+ st.takeItems(KETRA_BADGE_OFFICER, -1);
+ st.takeItems(VARKA_ALLIANCE_1, -1);
+ st.giveItems(VARKA_ALLIANCE_2, 1);
+ player.setAllianceWithVarkaKetra(-2);
+ }
+ else
+ {
+ htmltext = "31378-12.htm";
+ }
+ break;
}
- }
- // Stage 2
- else if (event.equals("31378-10-2.htm"))
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 200) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 100))
+ case "31378-10-3.htm":
+ {
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 200) && (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) >= 100))
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KETRA_BADGE_SOLDIER, -1);
+ st.takeItems(KETRA_BADGE_OFFICER, -1);
+ st.takeItems(KETRA_BADGE_CAPTAIN, -1);
+ st.takeItems(VARKA_ALLIANCE_2, -1);
+ st.giveItems(VARKA_ALLIANCE_3, 1);
+ player.setAllianceWithVarkaKetra(-3);
+ }
+ else
+ {
+ htmltext = "31378-15.htm";
+ }
+ break;
+ }
+ case "31378-10-4.htm":
+ {
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) >= 200) && (st.getQuestItemsCount(VALOR_FEATHER) >= 1))
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KETRA_BADGE_SOLDIER, -1);
+ st.takeItems(KETRA_BADGE_OFFICER, -1);
+ st.takeItems(KETRA_BADGE_CAPTAIN, -1);
+ st.takeItems(VALOR_FEATHER, -1);
+ st.takeItems(VARKA_ALLIANCE_3, -1);
+ st.giveItems(VARKA_ALLIANCE_4, 1);
+ player.setAllianceWithVarkaKetra(-4);
+ }
+ else
+ {
+ htmltext = "31378-21.htm";
+ }
+ break;
+ }
+ case "31378-20.htm":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KETRA_BADGE_SOLDIER, -1);
- st.takeItems(KETRA_BADGE_OFFICER, -1);
st.takeItems(VARKA_ALLIANCE_1, -1);
- st.giveItems(VARKA_ALLIANCE_2, 1);
- player.setAllianceWithVarkaKetra(-2);
- }
- else
- {
- htmltext = "31378-12.htm";
- }
- }
- // Stage 3
- else if (event.equals("31378-10-3.htm"))
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 200) && (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) >= 100))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KETRA_BADGE_SOLDIER, -1);
- st.takeItems(KETRA_BADGE_OFFICER, -1);
- st.takeItems(KETRA_BADGE_CAPTAIN, -1);
st.takeItems(VARKA_ALLIANCE_2, -1);
- st.giveItems(VARKA_ALLIANCE_3, 1);
- player.setAllianceWithVarkaKetra(-3);
- }
- else
- {
- htmltext = "31378-15.htm";
- }
- }
- // Stage 4
- else if (event.equals("31378-10-4.htm"))
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_OFFICER) >= 300) && (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) >= 200) && (st.getQuestItemsCount(VALOR_FEATHER) >= 1))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KETRA_BADGE_SOLDIER, -1);
- st.takeItems(KETRA_BADGE_OFFICER, -1);
- st.takeItems(KETRA_BADGE_CAPTAIN, -1);
- st.takeItems(VALOR_FEATHER, -1);
st.takeItems(VARKA_ALLIANCE_3, -1);
- st.giveItems(VARKA_ALLIANCE_4, 1);
- player.setAllianceWithVarkaKetra(-4);
+ st.takeItems(VARKA_ALLIANCE_4, -1);
+ st.takeItems(VARKA_ALLIANCE_5, -1);
+ st.takeItems(VALOR_FEATHER, -1);
+ st.takeItems(WISDOM_FEATHER, -1);
+ player.setAllianceWithVarkaKetra(0);
+ st.exitQuest(true);
+ break;
}
- else
- {
- htmltext = "31378-21.htm";
- }
- }
- // Leave quest
- else if (event.equals("31378-20.htm"))
- {
- st.takeItems(VARKA_ALLIANCE_1, -1);
- st.takeItems(VARKA_ALLIANCE_2, -1);
- st.takeItems(VARKA_ALLIANCE_3, -1);
- st.takeItems(VARKA_ALLIANCE_4, -1);
- st.takeItems(VARKA_ALLIANCE_5, -1);
- st.takeItems(VALOR_FEATHER, -1);
- st.takeItems(WISDOM_FEATHER, -1);
- player.setAllianceWithVarkaKetra(0);
- st.exitQuest(true);
}
return htmltext;
@@ -245,6 +236,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 74)
{
htmltext = "31378-01.htm";
@@ -256,78 +248,88 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
player.setAllianceWithVarkaKetra(0);
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
- if (cond == 1)
+ {
+ switch (st.getCond())
{
- if (st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 100)
+ case 1:
{
- htmltext = "31378-03b.htm";
+ if (st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 100)
+ {
+ htmltext = "31378-03b.htm";
+ }
+ else
+ {
+ htmltext = "31378-09.htm";
+ }
+ break;
}
- else
+ case 2:
{
- htmltext = "31378-09.htm";
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 200) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 100))
+ {
+ htmltext = "31378-12.htm";
+ }
+ else
+ {
+ htmltext = "31378-13.htm";
+ }
+ break;
}
- }
- else if (cond == 2)
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 200) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 100))
+ case 3:
{
- htmltext = "31378-12.htm";
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 200) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 100))
+ {
+ htmltext = "31378-15.htm";
+ }
+ else
+ {
+ htmltext = "31378-16.htm";
+ }
+ break;
}
- else
+ case 4:
{
- htmltext = "31378-13.htm";
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(VALOR_FEATHER))
+ {
+ htmltext = "31378-21.htm";
+ }
+ else
+ {
+ htmltext = "31378-22.htm";
+ }
+ break;
}
- }
- else if (cond == 3)
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 200) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 100))
+ case 5:
{
- htmltext = "31378-15.htm";
+ if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 400) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 400) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(WISDOM_FEATHER))
+ {
+ htmltext = "31378-17.htm";
+ }
+ else
+ {
+ htmltext = "31378-10-5.htm";
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(KETRA_BADGE_SOLDIER, 400);
+ st.takeItems(KETRA_BADGE_OFFICER, 400);
+ st.takeItems(KETRA_BADGE_CAPTAIN, 200);
+ st.takeItems(WISDOM_FEATHER, -1);
+ st.takeItems(VARKA_ALLIANCE_4, -1);
+ st.giveItems(VARKA_ALLIANCE_5, 1);
+ player.setAllianceWithVarkaKetra(-5);
+ }
+ break;
}
- else
+ case 6:
{
- htmltext = "31378-16.htm";
+ htmltext = "31378-08.htm";
+ break;
}
}
- else if (cond == 4)
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 300) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(VALOR_FEATHER))
- {
- htmltext = "31378-21.htm";
- }
- else
- {
- htmltext = "31378-22.htm";
- }
- }
- else if (cond == 5)
- {
- if ((st.getQuestItemsCount(KETRA_BADGE_SOLDIER) < 400) || (st.getQuestItemsCount(KETRA_BADGE_OFFICER) < 400) || (st.getQuestItemsCount(KETRA_BADGE_CAPTAIN) < 200) || !st.hasQuestItems(WISDOM_FEATHER))
- {
- htmltext = "31378-17.htm";
- }
- else
- {
- htmltext = "31378-10-5.htm";
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(KETRA_BADGE_SOLDIER, 400);
- st.takeItems(KETRA_BADGE_OFFICER, 400);
- st.takeItems(KETRA_BADGE_CAPTAIN, 200);
- st.takeItems(WISDOM_FEATHER, -1);
- st.takeItems(VARKA_ALLIANCE_4, -1);
- st.giveItems(VARKA_ALLIANCE_5, 1);
- player.setAllianceWithVarkaKetra(-5);
- }
- }
- else if (cond == 6)
- {
- htmltext = "31378-08.htm";
- }
break;
+ }
}
return htmltext;
@@ -358,7 +360,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond == 6)
{
return null;
@@ -371,6 +373,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
case 21327:
case 21328:
case 21329:
+ {
if (cond == 1)
{
st.dropItems(KETRA_BADGE_SOLDIER, 1, 100, CHANCES.get(npcId));
@@ -388,7 +391,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
st.dropItems(KETRA_BADGE_SOLDIER, 1, 400, CHANCES.get(npcId));
}
break;
-
+ }
case 21331:
case 21332:
case 21334:
@@ -397,6 +400,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
case 21338:
case 21343:
case 21344:
+ {
if (cond == 2)
{
st.dropItems(KETRA_BADGE_OFFICER, 1, 100, CHANCES.get(npcId));
@@ -414,7 +418,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
st.dropItems(KETRA_BADGE_OFFICER, 1, 400, CHANCES.get(npcId));
}
break;
-
+ }
case 21339:
case 21340:
case 21342:
@@ -423,6 +427,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
case 21347:
case 21348:
case 21349:
+ {
if (cond == 3)
{
st.dropItems(KETRA_BADGE_CAPTAIN, 1, 100, CHANCES.get(npcId));
@@ -432,6 +437,7 @@ public class Q611_AllianceWithVarkaSilenos extends Quest
st.dropItems(KETRA_BADGE_CAPTAIN, 1, 200, CHANCES.get(npcId));
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q612_WarWithKetraOrcs/Q612_WarWithKetraOrcs.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q612_WarWithKetraOrcs/Q612_WarWithKetraOrcs.java
index fa84ce30d0..fbe5464951 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q612_WarWithKetraOrcs/Q612_WarWithKetraOrcs.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q612_WarWithKetraOrcs/Q612_WarWithKetraOrcs.java
@@ -34,9 +34,7 @@ public class Q612_WarWithKetraOrcs extends Quest
public Q612_WarWithKetraOrcs()
{
super(612, "War with Ketra Orcs");
-
registerQuestItems(MOLAR_OF_KETRA_ORC);
-
addStartNpc(31377); // Ashas Varka Durai
addTalkId(31377);
}
@@ -51,29 +49,33 @@ public class Q612_WarWithKetraOrcs extends Quest
return htmltext;
}
- if (event.equals("31377-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31377-07.htm"))
- {
- if (st.getQuestItemsCount(MOLAR_OF_KETRA_ORC) >= 100)
+ case "31377-03.htm":
{
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(MOLAR_OF_KETRA_ORC, 100);
- st.giveItems(NEPENTHES_SEED, 20);
+ st.startQuest();
+ break;
}
- else
+ case "31377-07.htm":
{
- htmltext = "31377-08.htm";
+ if (st.getQuestItemsCount(MOLAR_OF_KETRA_ORC) >= 100)
+ {
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(MOLAR_OF_KETRA_ORC, 100);
+ st.giveItems(NEPENTHES_SEED, 20);
+ }
+ else
+ {
+ htmltext = "31377-08.htm";
+ }
+ break;
+ }
+ case "31377-09.htm":
+ {
+ st.takeItems(MOLAR_OF_KETRA_ORC, -1);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("31377-09.htm"))
- {
- st.takeItems(MOLAR_OF_KETRA_ORC, -1);
- st.exitQuest(true);
}
return htmltext;
@@ -92,12 +94,15 @@ public class Q612_WarWithKetraOrcs extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() >= 74) && player.isAlliedWithVarka()) ? "31377-01.htm" : "31377-02.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(MOLAR_OF_KETRA_ORC)) ? "31377-04.htm" : "31377-05.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q613_ProveYourCourage/Q613_ProveYourCourage.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q613_ProveYourCourage/Q613_ProveYourCourage.java
index 779a01e73f..d1bfc222ef 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q613_ProveYourCourage/Q613_ProveYourCourage.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q613_ProveYourCourage/Q613_ProveYourCourage.java
@@ -32,12 +32,9 @@ public class Q613_ProveYourCourage extends Quest
public Q613_ProveYourCourage()
{
super(613, "Prove your courage!");
-
registerQuestItems(HEAD_OF_HEKATON);
-
addStartNpc(31377); // Ashas Varka Durai
addTalkId(31377);
-
addKillId(25299); // Hekaton
}
@@ -53,9 +50,7 @@ public class Q613_ProveYourCourage extends Quest
if (event.equals("31377-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31377-07.htm"))
{
@@ -70,7 +65,7 @@ public class Q613_ProveYourCourage extends Quest
else
{
htmltext = "31377-06.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.playSound(QuestState.SOUND_ACCEPT);
}
}
@@ -91,6 +86,7 @@ public class Q613_ProveYourCourage extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 75)
{
htmltext = "31377-03.htm";
@@ -104,10 +100,12 @@ public class Q613_ProveYourCourage extends Quest
htmltext = "31377-02.htm";
}
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(HEAD_OF_HEKATON)) ? "31377-05.htm" : "31377-06.htm";
break;
+ }
}
return htmltext;
@@ -116,7 +114,7 @@ public class Q613_ProveYourCourage extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "1"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 1))
{
if (partyMember.getAllianceWithVarkaKetra() <= -3)
{
@@ -128,7 +126,7 @@ public class Q613_ProveYourCourage extends Quest
if (st.hasQuestItems(VARKA_ALLIANCE_3))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HEAD_OF_HEKATON, 1);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q614_SlayTheEnemyCommander/Q614_SlayTheEnemyCommander.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q614_SlayTheEnemyCommander/Q614_SlayTheEnemyCommander.java
index 055125f7ab..f8ef413079 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q614_SlayTheEnemyCommander/Q614_SlayTheEnemyCommander.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q614_SlayTheEnemyCommander/Q614_SlayTheEnemyCommander.java
@@ -32,12 +32,9 @@ public class Q614_SlayTheEnemyCommander extends Quest
public Q614_SlayTheEnemyCommander()
{
super(614, "Slay the enemy commander!");
-
registerQuestItems(HEAD_OF_TAYR);
-
addStartNpc(31377); // Ashas Varka Durai
addTalkId(31377);
-
addKillId(25302); // Tayr
}
@@ -53,9 +50,7 @@ public class Q614_SlayTheEnemyCommander extends Quest
if (event.equals("31377-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31377-07.htm"))
{
@@ -70,7 +65,7 @@ public class Q614_SlayTheEnemyCommander extends Quest
else
{
htmltext = "31377-06.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.playSound(QuestState.SOUND_ACCEPT);
}
}
@@ -91,6 +86,7 @@ public class Q614_SlayTheEnemyCommander extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() >= 75)
{
if ((player.getAllianceWithVarkaKetra() <= -4) && st.hasQuestItems(VARKA_ALLIANCE_4) && !st.hasQuestItems(FEATHER_OF_WISDOM))
@@ -107,10 +103,12 @@ public class Q614_SlayTheEnemyCommander extends Quest
htmltext = "31377-03.htm";
}
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(HEAD_OF_TAYR)) ? "31377-05.htm" : "31377-06.htm";
break;
+ }
}
return htmltext;
@@ -119,7 +117,7 @@ public class Q614_SlayTheEnemyCommander extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "1"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 1))
{
if (partyMember.getAllianceWithVarkaKetra() <= -4)
{
@@ -131,7 +129,7 @@ public class Q614_SlayTheEnemyCommander extends Quest
if (st.hasQuestItems(VARKA_ALLIANCE_4))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(HEAD_OF_TAYR, 1);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q615_MagicalPowerOfFire_Part1/Q615_MagicalPowerOfFire_Part1.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q615_MagicalPowerOfFire_Part1/Q615_MagicalPowerOfFire_Part1.java
index 3ec0616622..d16ca95c34 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q615_MagicalPowerOfFire_Part1/Q615_MagicalPowerOfFire_Part1.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q615_MagicalPowerOfFire_Part1/Q615_MagicalPowerOfFire_Part1.java
@@ -29,7 +29,6 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
private static final int UDAN = 31379;
private static final int ASEFA_BOX = 31559;
private static final int EYE = 31684;
-
// Items
private static final int THIEF_KEY = 1661;
private static final int STOLEN_RED_TOTEM = 7242;
@@ -39,12 +38,9 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
public Q615_MagicalPowerOfFire_Part1()
{
super(615, "Magical Power of Fire - Part 1");
-
registerQuestItems(STOLEN_RED_TOTEM);
-
addStartNpc(NARAN);
addTalkId(NARAN, UDAN, ASEFA_BOX);
-
// IDs aggro ranges to avoid, else quest is automatically failed.
addAggroRangeEnterId(21350, 21351, 21353, 21354, 21355, 21357, 21358, 21360, 21361, 21362, 21369, 21370, 21364, 21365, 21366, 21368, 21371, 21372, 21373, 21374, 21375);
}
@@ -59,37 +55,40 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
return htmltext;
}
- if (event.equals("31378-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("spawned", "0");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31559-03.htm"))
- {
- // You have been discovered ; quest is failed.
- if (st.getInt("spawned") == 1)
+ case "31378-03.htm":
{
- htmltext = "31559-04.htm";
+ st.startQuest();
+ st.set("spawned", "0");
+ break;
}
- else if (!st.hasQuestItems(THIEF_KEY))
+ case "31559-03.htm":
{
- htmltext = "31559-02.htm";
+ // You have been discovered ; quest is failed.
+ if (st.getInt("spawned") == 1)
+ {
+ htmltext = "31559-04.htm";
+ }
+ else if (!st.hasQuestItems(THIEF_KEY))
+ {
+ htmltext = "31559-02.htm";
+ }
+ else
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(THIEF_KEY, 1);
+ st.giveItems(STOLEN_RED_TOTEM, 1);
+ }
+ break;
}
- else
+ case "UdanEyeDespawn":
{
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(THIEF_KEY, 1);
- st.giveItems(STOLEN_RED_TOTEM, 1);
+ npc.broadcastNpcSay("I'll be waiting for your return.");
+ return null;
}
}
- else if (event.equals("UdanEyeDespawn"))
- {
- npc.broadcastNpcSay("I'll be waiting for your return.");
- return null;
- }
return htmltext;
}
@@ -107,22 +106,26 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = ((player.getLevel() >= 74) && (player.getAllianceWithVarkaKetra() <= -2)) ? "31378-01.htm" : "31378-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NARAN:
+ {
htmltext = "31378-04.htm";
break;
-
+ }
case UDAN:
+ {
if (cond == 1)
{
htmltext = "31379-01.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 2)
@@ -151,8 +154,9 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
st.exitQuest(true);
}
break;
-
+ }
case ASEFA_BOX:
+ {
if (cond == 2)
{
htmltext = "31559-01.htm";
@@ -162,8 +166,10 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
htmltext = "31559-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -178,7 +184,7 @@ public class Q615_MagicalPowerOfFire_Part1 extends Quest
return null;
}
- if ((st.getInt("spawned") == 0) && (st.getInt("cond") == 2))
+ if ((st.getInt("spawned") == 0) && st.isCond(2))
{
// Put "spawned" flag to 1 to avoid to spawn another.
st.set("spawned", "1");
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q616_MagicalPowerOfFire_Part2/Q616_MagicalPowerOfFire_Part2.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q616_MagicalPowerOfFire_Part2/Q616_MagicalPowerOfFire_Part2.java
index 65c4ea0ad4..6e7ec3e08a 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q616_MagicalPowerOfFire_Part2/Q616_MagicalPowerOfFire_Part2.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q616_MagicalPowerOfFire_Part2/Q616_MagicalPowerOfFire_Part2.java
@@ -29,49 +29,45 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q616_MagicalPowerOfFire_Part2 extends Quest
{
- // Monster
- private static final int SOUL_OF_FIRE_NASTRON = 25306;
-
// NPCs
private static final int UDAN_MARDUI = 31379;
private static final int KETRAS_HOLY_ALTAR = 31558;
-
+ // Monster
+ private static final int SOUL_OF_FIRE_NASTRON = 25306;
// Items
private static final int RED_TOTEM = 7243;
private static final int FIRE_HEART_OF_NASTRON = 7244;
-
// Other
private static final int CHECK_INTERVAL = 600000; // 10 minutes
private static final int IDLE_INTERVAL = 2; // (X * CHECK_INTERVAL) = 20 minutes
-
private NpcInstance _npc = null;
private int _status = -1;
public Q616_MagicalPowerOfFire_Part2()
{
super(616, "Magical Power of Fire - Part 2");
-
registerQuestItems(FIRE_HEART_OF_NASTRON);
-
addStartNpc(UDAN_MARDUI);
addTalkId(UDAN_MARDUI, KETRAS_HOLY_ALTAR);
-
addAttackId(SOUL_OF_FIRE_NASTRON);
addKillId(SOUL_OF_FIRE_NASTRON);
-
switch (RaidBossSpawnManager.getInstance().getRaidBossStatusId(SOUL_OF_FIRE_NASTRON))
{
case UNDEFINED:
+ {
LOGGER.log(Level.WARNING, getName() + ": can not find spawned RaidBoss id=" + SOUL_OF_FIRE_NASTRON);
break;
-
+ }
case ALIVE:
+ {
spawnNpc();
// fallthrough
-
+ }
case DEAD:
+ {
startQuestTimer("check", CHECK_INTERVAL, null, null, true);
break;
+ }
}
}
@@ -102,56 +98,58 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
return htmltext;
}
- // Udan Mardui
- if (event.equals("31379-04.htm"))
+ switch (event)
{
- if (st.hasQuestItems(RED_TOTEM))
+ case "31379-04.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else
- {
- htmltext = "31379-02.htm";
- }
- }
- else if (event.equals("31379-08.htm"))
- {
- if (st.hasQuestItems(FIRE_HEART_OF_NASTRON))
- {
- st.takeItems(FIRE_HEART_OF_NASTRON, 1);
- st.rewardExpAndSp(10000, 0);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else
- {
- htmltext = "31379-09.htm";
- }
- }
- // Ketra's Holy Altar
- else if (event.equals("31558-02.htm"))
- {
- if (st.hasQuestItems(RED_TOTEM))
- {
- if (_status < 0)
+ if (st.hasQuestItems(RED_TOTEM))
{
- if (spawnRaid())
+ st.startQuest();
+ }
+ else
+ {
+ htmltext = "31379-02.htm";
+ }
+ break;
+ }
+ case "31379-08.htm":
+ {
+ if (st.hasQuestItems(FIRE_HEART_OF_NASTRON))
+ {
+ st.takeItems(FIRE_HEART_OF_NASTRON, 1);
+ st.rewardExpAndSp(10000, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "31379-09.htm";
+ }
+ break;
+ }
+ case "31558-02.htm":
+ {
+ if (st.hasQuestItems(RED_TOTEM))
+ {
+ if (_status < 0)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(RED_TOTEM, 1);
+ if (spawnRaid())
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(RED_TOTEM, 1);
+ }
+ }
+ else
+ {
+ htmltext = "31558-04.htm";
}
}
else
{
- htmltext = "31558-04.htm";
+ htmltext = "31558-03.htm";
}
- }
- else
- {
- htmltext = "31558-03.htm";
+ break;
}
}
@@ -171,6 +169,7 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (!st.hasQuestItems(RED_TOTEM))
{
htmltext = "31379-02.htm";
@@ -184,12 +183,14 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
htmltext = "31379-01.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case UDAN_MARDUI:
+ {
if (cond == 1)
{
htmltext = "31379-05.htm";
@@ -203,8 +204,9 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
htmltext = "31379-07.htm";
}
break;
-
+ }
case KETRAS_HOLY_ALTAR:
+ {
if (cond == 1)
{
htmltext = "31558-01.htm";
@@ -214,8 +216,10 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
htmltext = "31558-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -231,7 +235,7 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "2"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 2))
{
final QuestState st = partyMember.getQuestState(getName());
if (st == null)
@@ -239,7 +243,7 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
continue;
}
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(FIRE_HEART_OF_NASTRON, 1);
}
@@ -282,6 +286,7 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
return true;
}
+
return false;
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q617_GatherTheFlames/Q617_GatherTheFlames.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q617_GatherTheFlames/Q617_GatherTheFlames.java
index ce27154d74..a34c82cc38 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q617_GatherTheFlames/Q617_GatherTheFlames.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q617_GatherTheFlames/Q617_GatherTheFlames.java
@@ -33,10 +33,8 @@ public class Q617_GatherTheFlames extends Quest
private static final int HILDA = 31271;
private static final int VULCAN = 31539;
private static final int ROONEY = 32049;
-
// Items
private static final int TORCH = 7264;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -68,7 +66,6 @@ public class Q617_GatherTheFlames extends Quest
CHANCES.put(21379, 590000);
CHANCES.put(21380, 490000);
}
-
// Rewards
private static final int[] REWARD =
{
@@ -87,16 +84,10 @@ public class Q617_GatherTheFlames extends Quest
public Q617_GatherTheFlames()
{
super(617, "Gather the Flames");
-
registerQuestItems(TORCH);
-
addStartNpc(VULCAN, HILDA);
addTalkId(VULCAN, HILDA, ROONEY);
-
- for (int mobs : CHANCES.keySet())
- {
- addKillId(mobs);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -111,9 +102,7 @@ public class Q617_GatherTheFlames extends Quest
if (event.equals("31539-03.htm") || event.equals("31271-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31539-05.htm"))
{
@@ -159,25 +148,32 @@ public class Q617_GatherTheFlames extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = npc.getNpcId() + ((player.getLevel() >= 74) ? "-01.htm" : "-02.htm");
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case VULCAN:
+ {
htmltext = (st.getQuestItemsCount(TORCH) >= 1000) ? "31539-04.htm" : "31539-05.htm";
break;
-
+ }
case HILDA:
+ {
htmltext = "31271-04.htm";
break;
-
+ }
case ROONEY:
+ {
htmltext = (st.getQuestItemsCount(TORCH) >= 1200) ? "32049-01.htm" : "32049-02.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q618_IntoTheFlame/Q618_IntoTheFlame.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q618_IntoTheFlame/Q618_IntoTheFlame.java
index 4439573cb4..d17b38caf9 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q618_IntoTheFlame/Q618_IntoTheFlame.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q618_IntoTheFlame/Q618_IntoTheFlame.java
@@ -27,23 +27,18 @@ public class Q618_IntoTheFlame extends Quest
// NPCs
private static final int KLEIN = 31540;
private static final int HILDA = 31271;
-
// Items
private static final int VACUALITE_ORE = 7265;
private static final int VACUALITE = 7266;
-
// Reward
private static final int FLOATING_STONE = 7267;
public Q618_IntoTheFlame()
{
super(618, "Into the Flame");
-
registerQuestItems(VACUALITE_ORE, VACUALITE);
-
addStartNpc(KLEIN);
addTalkId(KLEIN, HILDA);
-
// Kookaburras, Bandersnatches, Grendels
addKillId(21274, 21275, 21276, 21277, 21282, 21283, 21284, 21285, 21290, 21291, 21292, 21293);
}
@@ -58,30 +53,35 @@ public class Q618_IntoTheFlame extends Quest
return htmltext;
}
- if (event.equals("31540-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31540-05.htm"))
- {
- st.takeItems(VACUALITE, 1);
- st.giveItems(FLOATING_STONE, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("31271-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31271-05.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(VACUALITE_ORE, -1);
- st.giveItems(VACUALITE, 1);
+ case "31540-03.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31540-05.htm":
+ {
+ st.takeItems(VACUALITE, 1);
+ st.giveItems(FLOATING_STONE, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "31271-02.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31271-05.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(VACUALITE_ORE, -1);
+ st.giveItems(VACUALITE, 1);
+ break;
+ }
}
return htmltext;
@@ -100,18 +100,22 @@ public class Q618_IntoTheFlame extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "31540-01.htm" : "31540-02.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case KLEIN:
+ {
htmltext = (cond == 4) ? "31540-04.htm" : "31540-03.htm";
break;
-
+ }
case HILDA:
+ {
if (cond == 1)
{
htmltext = "31271-01.htm";
@@ -129,8 +133,10 @@ public class Q618_IntoTheFlame extends Quest
htmltext = "31271-06.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -139,7 +145,7 @@ public class Q618_IntoTheFlame extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "2");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 2);
if (partyMember == null)
{
return null;
@@ -153,7 +159,7 @@ public class Q618_IntoTheFlame extends Quest
if (st.dropItems(VACUALITE_ORE, 1, 50, 500000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q619_RelicsOfTheOldEmpire/Q619_RelicsOfTheOldEmpire.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q619_RelicsOfTheOldEmpire/Q619_RelicsOfTheOldEmpire.java
index c5f9c67bef..4f26652a3b 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q619_RelicsOfTheOldEmpire/Q619_RelicsOfTheOldEmpire.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q619_RelicsOfTheOldEmpire/Q619_RelicsOfTheOldEmpire.java
@@ -27,11 +27,9 @@ public class Q619_RelicsOfTheOldEmpire extends Quest
{
// NPC
private static int GHOST_OF_ADVENTURER = 31538;
-
// Items
private static int RELICS = 7254;
private static int ENTRANCE = 7075;
-
// Rewards ; all S grade weapons recipe (60%)
private static int[] RCP_REWARDS = new int[]
{
@@ -50,21 +48,16 @@ public class Q619_RelicsOfTheOldEmpire extends Quest
public Q619_RelicsOfTheOldEmpire()
{
super(619, "Relics of the Old Empire");
-
registerQuestItems(RELICS);
-
addStartNpc(GHOST_OF_ADVENTURER);
addTalkId(GHOST_OF_ADVENTURER);
-
for (int id = 21396; id <= 21434; id++)
{
// IT monsters
addKillId(id);
}
-
// monsters at IT entrance
addKillId(21798, 21799, 21800);
-
for (int id = 18120; id <= 18256; id++)
{
// Sepulchers monsters
@@ -82,29 +75,33 @@ public class Q619_RelicsOfTheOldEmpire extends Quest
return htmltext;
}
- if (event.equals("31538-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31538-09.htm"))
- {
- if (st.getQuestItemsCount(RELICS) >= 1000)
+ case "31538-03.htm":
{
- htmltext = "31538-09.htm";
- st.takeItems(RELICS, 1000);
- st.giveItems(RCP_REWARDS[Rnd.get(RCP_REWARDS.length)], 1);
+ st.startQuest();
+ break;
}
- else
+ case "31538-09.htm":
{
- htmltext = "31538-06.htm";
+ if (st.getQuestItemsCount(RELICS) >= 1000)
+ {
+ htmltext = "31538-09.htm";
+ st.takeItems(RELICS, 1000);
+ st.giveItems(RCP_REWARDS[Rnd.get(RCP_REWARDS.length)], 1);
+ }
+ else
+ {
+ htmltext = "31538-06.htm";
+ }
+ break;
+ }
+ case "31538-10.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("31538-10.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
}
@@ -122,10 +119,12 @@ public class Q619_RelicsOfTheOldEmpire extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 74) ? "31538-02.htm" : "31538-01.htm";
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(RELICS) >= 1000)
{
htmltext = "31538-04.htm";
@@ -139,6 +138,7 @@ public class Q619_RelicsOfTheOldEmpire extends Quest
htmltext = "31538-07.htm";
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q620_FourGoblets/Q620_FourGoblets.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q620_FourGoblets/Q620_FourGoblets.java
index 79eb3bb0e1..4ddcba2a54 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q620_FourGoblets/Q620_FourGoblets.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q620_FourGoblets/Q620_FourGoblets.java
@@ -31,26 +31,20 @@ public class Q620_FourGoblets extends Quest
private static final int GHOST_OF_WIGOTH_1 = 31452;
private static final int NAMELESS_SPIRIT = 31453;
private static final int GHOST_OF_WIGOTH_2 = 31454;
-
private static final int GHOST_CHAMBERLAIN_1 = 31919;
private static final int GHOST_CHAMBERLAIN_2 = 31920;
-
private static final int CONQUERORS_SEPULCHER_MANAGER = 31921;
private static final int EMPERORS_SEPULCHER_MANAGER = 31922;
private static final int GREAT_SAGES_SEPULCHER_MANAGER = 31923;
private static final int JUDGES_SEPULCHER_MANAGER = 31924;
-
// Items
private static final int RELIC = 7254;
private static final int SEALED_BOX = 7255;
-
private static final int GOBLET_OF_ALECTIA = 7256;
private static final int GOBLET_OF_TISHAS = 7257;
private static final int GOBLET_OF_MEKARA = 7258;
private static final int GOBLET_OF_MORIGUL = 7259;
-
private static final int USED_GRAVE_PASS = 7261;
-
// Rewards
private static final int ANTIQUE_BROOCH = 7262;
private static final int[] RCP_REWARDS = new int[]
@@ -70,12 +64,9 @@ public class Q620_FourGoblets extends Quest
public Q620_FourGoblets()
{
super(620, "Four Goblets");
-
registerQuestItems(SEALED_BOX, USED_GRAVE_PASS, GOBLET_OF_ALECTIA, GOBLET_OF_TISHAS, GOBLET_OF_MEKARA, GOBLET_OF_MORIGUL);
-
addStartNpc(NAMELESS_SPIRIT, CONQUERORS_SEPULCHER_MANAGER, EMPERORS_SEPULCHER_MANAGER, GREAT_SAGES_SEPULCHER_MANAGER, JUDGES_SEPULCHER_MANAGER, GHOST_CHAMBERLAIN_1, GHOST_CHAMBERLAIN_2);
addTalkId(NAMELESS_SPIRIT, CONQUERORS_SEPULCHER_MANAGER, EMPERORS_SEPULCHER_MANAGER, GREAT_SAGES_SEPULCHER_MANAGER, JUDGES_SEPULCHER_MANAGER, GHOST_CHAMBERLAIN_1, GHOST_CHAMBERLAIN_2, GHOST_OF_WIGOTH_1, GHOST_OF_WIGOTH_2);
-
for (int id = 18120; id <= 18256; id++)
{
addKillId(id);
@@ -105,15 +96,13 @@ public class Q620_FourGoblets extends Quest
}
else if (event.equals("31453-13.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31453-16.htm"))
{
if (st.hasQuestItems(GOBLET_OF_ALECTIA, GOBLET_OF_TISHAS, GOBLET_OF_MEKARA, GOBLET_OF_MORIGUL))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(GOBLET_OF_ALECTIA, -1);
st.takeItems(GOBLET_OF_TISHAS, -1);
@@ -128,7 +117,7 @@ public class Q620_FourGoblets extends Quest
}
// else if (event.equals("31453-13.htm"))
// {
- // if (st.getInt("cond") == 2)
+ // if (st.getCond()s == 2)
// {
// htmltext = "31453-19.htm";
// }
@@ -232,13 +221,7 @@ public class Q620_FourGoblets extends Quest
}
final int npcId = npc.getNpcId();
- final int id = st.getState();
- final int cond = st.getInt("cond");
- if (id == State.CREATED)
- {
- st.set("cond", "0");
- }
-
+ final int cond = st.getCond();
if (npcId == GHOST_OF_WIGOTH_1)
{
if (cond == 1)
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q621_EggDelivery/Q621_EggDelivery.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q621_EggDelivery/Q621_EggDelivery.java
index 772afda2e3..427f85fadf 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q621_EggDelivery/Q621_EggDelivery.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q621_EggDelivery/Q621_EggDelivery.java
@@ -25,10 +25,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q621_EggDelivery extends Quest
{
- // Items
- private static final int BOILED_EGGS = 7195;
- private static final int FEE_OF_BOILED_EGG = 7196;
-
// NPCs
private static final int JEREMY = 31521;
private static final int PULIN = 31543;
@@ -37,7 +33,9 @@ public class Q621_EggDelivery extends Quest
private static final int KUBER = 31546;
private static final int BEOLIN = 31547;
private static final int VALENTINE = 31584;
-
+ // Items
+ private static final int BOILED_EGGS = 7195;
+ private static final int FEE_OF_BOILED_EGG = 7196;
// Rewards
private static final int HASTE_POTION = 1062;
private static final int[] RECIPES =
@@ -50,9 +48,7 @@ public class Q621_EggDelivery extends Quest
public Q621_EggDelivery()
{
super(621, "Egg Delivery");
-
registerQuestItems(BOILED_EGGS, FEE_OF_BOILED_EGG);
-
addStartNpc(JEREMY);
addTalkId(JEREMY, PULIN, NAFF, CROCUS, KUBER, BEOLIN, VALENTINE);
}
@@ -67,77 +63,86 @@ public class Q621_EggDelivery extends Quest
return htmltext;
}
- if (event.equals("31521-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(BOILED_EGGS, 5);
- }
- else if (event.equals("31543-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BOILED_EGGS, 1);
- st.giveItems(FEE_OF_BOILED_EGG, 1);
- }
- else if (event.equals("31544-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BOILED_EGGS, 1);
- st.giveItems(FEE_OF_BOILED_EGG, 1);
- }
- else if (event.equals("31545-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BOILED_EGGS, 1);
- st.giveItems(FEE_OF_BOILED_EGG, 1);
- }
- else if (event.equals("31546-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BOILED_EGGS, 1);
- st.giveItems(FEE_OF_BOILED_EGG, 1);
- }
- else if (event.equals("31547-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_ITEMGET);
- st.takeItems(BOILED_EGGS, 1);
- st.giveItems(FEE_OF_BOILED_EGG, 1);
- }
- else if (event.equals("31521-06.htm"))
- {
- if (st.getQuestItemsCount(FEE_OF_BOILED_EGG) < 5)
+ case "31521-02.htm":
{
- htmltext = "31521-08.htm";
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
+ st.startQuest();
+ st.giveItems(BOILED_EGGS, 5);
+ break;
}
- else
+ case "31543-02.htm":
{
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(FEE_OF_BOILED_EGG, 5);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BOILED_EGGS, 1);
+ st.giveItems(FEE_OF_BOILED_EGG, 1);
+ break;
}
- }
- else if (event.equals("31584-02.htm"))
- {
- if (Rnd.get(5) < 1)
+ case "31544-02.htm":
{
- st.rewardItems(RECIPES[Rnd.get(3)], 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BOILED_EGGS, 1);
+ st.giveItems(FEE_OF_BOILED_EGG, 1);
+ break;
}
- else
+ case "31545-02.htm":
{
- st.rewardItems(57, 18800);
- st.rewardItems(HASTE_POTION, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BOILED_EGGS, 1);
+ st.giveItems(FEE_OF_BOILED_EGG, 1);
+ break;
+ }
+ case "31546-02.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BOILED_EGGS, 1);
+ st.giveItems(FEE_OF_BOILED_EGG, 1);
+ break;
+ }
+ case "31547-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_ITEMGET);
+ st.takeItems(BOILED_EGGS, 1);
+ st.giveItems(FEE_OF_BOILED_EGG, 1);
+ break;
+ }
+ case "31521-06.htm":
+ {
+ if (st.getQuestItemsCount(FEE_OF_BOILED_EGG) < 5)
+ {
+ htmltext = "31521-08.htm";
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ }
+ else
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(FEE_OF_BOILED_EGG, 5);
+ }
+ break;
+ }
+ case "31584-02.htm":
+ {
+ if (Rnd.get(5) < 1)
+ {
+ st.rewardItems(RECIPES[Rnd.get(3)], 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ st.rewardItems(57, 18800);
+ st.rewardItems(HASTE_POTION, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ break;
}
}
return htmltext;
@@ -156,14 +161,17 @@ public class Q621_EggDelivery extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 68) ? "31521-03.htm" : "31521-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case JEREMY:
+ {
if (cond == 1)
{
htmltext = "31521-04.htm";
@@ -177,8 +185,9 @@ public class Q621_EggDelivery extends Quest
htmltext = "31521-07.htm";
}
break;
-
+ }
case PULIN:
+ {
if ((cond == 1) && (st.getQuestItemsCount(BOILED_EGGS) == 5))
{
htmltext = "31543-01.htm";
@@ -188,8 +197,9 @@ public class Q621_EggDelivery extends Quest
htmltext = "31543-03.htm";
}
break;
-
+ }
case NAFF:
+ {
if ((cond == 2) && (st.getQuestItemsCount(BOILED_EGGS) == 4))
{
htmltext = "31544-01.htm";
@@ -199,8 +209,9 @@ public class Q621_EggDelivery extends Quest
htmltext = "31544-03.htm";
}
break;
-
+ }
case CROCUS:
+ {
if ((cond == 3) && (st.getQuestItemsCount(BOILED_EGGS) == 3))
{
htmltext = "31545-01.htm";
@@ -210,8 +221,9 @@ public class Q621_EggDelivery extends Quest
htmltext = "31545-03.htm";
}
break;
-
+ }
case KUBER:
+ {
if ((cond == 4) && (st.getQuestItemsCount(BOILED_EGGS) == 2))
{
htmltext = "31546-01.htm";
@@ -221,8 +233,9 @@ public class Q621_EggDelivery extends Quest
htmltext = "31546-03.htm";
}
break;
-
+ }
case BEOLIN:
+ {
if ((cond == 5) && (st.getQuestItemsCount(BOILED_EGGS) == 1))
{
htmltext = "31547-01.htm";
@@ -232,15 +245,18 @@ public class Q621_EggDelivery extends Quest
htmltext = "31547-03.htm";
}
break;
-
+ }
case VALENTINE:
+ {
if (cond == 7)
{
htmltext = "31584-01.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q622_SpecialtyLiquorDelivery/Q622_SpecialtyLiquorDelivery.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q622_SpecialtyLiquorDelivery/Q622_SpecialtyLiquorDelivery.java
index f53743f761..77bec61cc5 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q622_SpecialtyLiquorDelivery/Q622_SpecialtyLiquorDelivery.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q622_SpecialtyLiquorDelivery/Q622_SpecialtyLiquorDelivery.java
@@ -25,10 +25,6 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q622_SpecialtyLiquorDelivery extends Quest
{
- // Items
- private static final int SPECIAL_DRINK = 7197;
- private static final int FEE_OF_SPECIAL_DRINK = 7198;
-
// NPCs
private static final int JEREMY = 31521;
private static final int PULIN = 31543;
@@ -37,7 +33,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
private static final int KUBER = 31546;
private static final int BEOLIN = 31547;
private static final int LIETTA = 31267;
-
+ // Items
+ private static final int SPECIAL_DRINK = 7197;
+ private static final int FEE_OF_SPECIAL_DRINK = 7198;
// Rewards
private static final int ADENA = 57;
private static final int HASTE_POTION = 1062;
@@ -51,9 +49,7 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
public Q622_SpecialtyLiquorDelivery()
{
super(622, "Specialty Liquor Delivery");
-
registerQuestItems(SPECIAL_DRINK, FEE_OF_SPECIAL_DRINK);
-
addStartNpc(JEREMY);
addTalkId(JEREMY, PULIN, NAFF, CROCUS, KUBER, BEOLIN, LIETTA);
}
@@ -68,67 +64,76 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
return htmltext;
}
- if (event.equals("31521-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.giveItems(SPECIAL_DRINK, 5);
- }
- else if (event.equals("31547-02.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPECIAL_DRINK, 1);
- st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
- }
- else if (event.equals("31546-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPECIAL_DRINK, 1);
- st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
- }
- else if (event.equals("31545-02.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPECIAL_DRINK, 1);
- st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
- }
- else if (event.equals("31544-02.htm"))
- {
- st.set("cond", "5");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPECIAL_DRINK, 1);
- st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
- }
- else if (event.equals("31543-02.htm"))
- {
- st.set("cond", "6");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPECIAL_DRINK, 1);
- st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
- }
- else if (event.equals("31521-06.htm"))
- {
- st.set("cond", "7");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(FEE_OF_SPECIAL_DRINK, 5);
- }
- else if (event.equals("31267-02.htm"))
- {
- if (Rnd.get(5) < 1)
+ case "31521-02.htm":
{
- st.giveItems(RECIPES[Rnd.get(RECIPES.length)], 1);
+ st.startQuest();
+ st.giveItems(SPECIAL_DRINK, 5);
+ break;
}
- else
+ case "31547-02.htm":
{
- st.rewardItems(ADENA, 18800);
- st.rewardItems(HASTE_POTION, 1);
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPECIAL_DRINK, 1);
+ st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
+ break;
+ }
+ case "31546-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPECIAL_DRINK, 1);
+ st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
+ break;
+ }
+ case "31545-02.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPECIAL_DRINK, 1);
+ st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
+ break;
+ }
+ case "31544-02.htm":
+ {
+ st.setCond(5);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPECIAL_DRINK, 1);
+ st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
+ break;
+ }
+ case "31543-02.htm":
+ {
+ st.setCond(6);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPECIAL_DRINK, 1);
+ st.giveItems(FEE_OF_SPECIAL_DRINK, 1);
+ break;
+ }
+ case "31521-06.htm":
+ {
+ st.setCond(7);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(FEE_OF_SPECIAL_DRINK, 5);
+ break;
+ }
+ case "31267-02.htm":
+ {
+ if (Rnd.get(5) < 1)
+ {
+ st.giveItems(RECIPES[Rnd.get(RECIPES.length)], 1);
+ }
+ else
+ {
+ st.rewardItems(ADENA, 18800);
+ st.rewardItems(HASTE_POTION, 1);
+ }
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -147,14 +152,17 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 68) ? "31521-03.htm" : "31521-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case JEREMY:
+ {
if (cond < 6)
{
htmltext = "31521-04.htm";
@@ -168,8 +176,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31521-06.htm";
}
break;
-
+ }
case BEOLIN:
+ {
if ((cond == 1) && (st.getQuestItemsCount(SPECIAL_DRINK) == 5))
{
htmltext = "31547-01.htm";
@@ -179,8 +188,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31547-03.htm";
}
break;
-
+ }
case KUBER:
+ {
if ((cond == 2) && (st.getQuestItemsCount(SPECIAL_DRINK) == 4))
{
htmltext = "31546-01.htm";
@@ -190,8 +200,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31546-03.htm";
}
break;
-
+ }
case CROCUS:
+ {
if ((cond == 3) && (st.getQuestItemsCount(SPECIAL_DRINK) == 3))
{
htmltext = "31545-01.htm";
@@ -201,8 +212,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31545-03.htm";
}
break;
-
+ }
case NAFF:
+ {
if ((cond == 4) && (st.getQuestItemsCount(SPECIAL_DRINK) == 2))
{
htmltext = "31544-01.htm";
@@ -212,8 +224,9 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31544-03.htm";
}
break;
-
+ }
case PULIN:
+ {
if ((cond == 5) && (st.getQuestItemsCount(SPECIAL_DRINK) == 1))
{
htmltext = "31543-01.htm";
@@ -223,14 +236,17 @@ public class Q622_SpecialtyLiquorDelivery extends Quest
htmltext = "31543-03.htm";
}
break;
-
+ }
case LIETTA:
+ {
if (cond == 7)
{
htmltext = "31267-01.htm";
}
break;
+ }
}
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q623_TheFinestFood/Q623_TheFinestFood.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q623_TheFinestFood/Q623_TheFinestFood.java
index 2a5df6eaca..320fe6e228 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q623_TheFinestFood/Q623_TheFinestFood.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q623_TheFinestFood/Q623_TheFinestFood.java
@@ -25,28 +25,23 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q623_TheFinestFood extends Quest
{
+ // NPC
+ private static final int JEREMY = 31521;
+ // Monsters
+ private static final int FLAVA = 21316;
+ private static final int BUFFALO = 21315;
+ private static final int ANTELOPE = 21318;
// Items
private static final int LEAF_OF_FLAVA = 7199;
private static final int BUFFALO_MEAT = 7200;
private static final int ANTELOPE_HORN = 7201;
- // NPC
- private static final int JEREMY = 31521;
-
- // Monsters
- private static final int FLAVA = 21316;
- private static final int BUFFALO = 21315;
- private static final int ANTELOPE = 21318;
-
public Q623_TheFinestFood()
{
super(623, "The Finest Food");
-
registerQuestItems(LEAF_OF_FLAVA, BUFFALO_MEAT, ANTELOPE_HORN);
-
addStartNpc(JEREMY);
addTalkId(JEREMY);
-
addKillId(FLAVA, BUFFALO, ANTELOPE);
}
@@ -64,9 +59,7 @@ public class Q623_TheFinestFood extends Quest
{
if (player.getLevel() >= 71)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else
{
@@ -121,11 +114,13 @@ public class Q623_TheFinestFood extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "31521-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31521-06.htm";
@@ -142,6 +137,7 @@ public class Q623_TheFinestFood extends Quest
}
}
break;
+ }
}
return htmltext;
@@ -150,7 +146,7 @@ public class Q623_TheFinestFood extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -165,25 +161,29 @@ public class Q623_TheFinestFood extends Quest
switch (npc.getNpcId())
{
case FLAVA:
+ {
if (st.dropItemsAlways(LEAF_OF_FLAVA, 1, 100) && (st.getQuestItemsCount(BUFFALO_MEAT) >= 100) && (st.getQuestItemsCount(ANTELOPE_HORN) >= 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case BUFFALO:
+ {
if (st.dropItemsAlways(BUFFALO_MEAT, 1, 100) && (st.getQuestItemsCount(LEAF_OF_FLAVA) >= 100) && (st.getQuestItemsCount(ANTELOPE_HORN) >= 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case ANTELOPE:
+ {
if (st.dropItemsAlways(ANTELOPE_HORN, 1, 100) && (st.getQuestItemsCount(LEAF_OF_FLAVA) >= 100) && (st.getQuestItemsCount(BUFFALO_MEAT) >= 100))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q624_TheFinestIngredients_Part1/Q624_TheFinestIngredients_Part1.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q624_TheFinestIngredients_Part1/Q624_TheFinestIngredients_Part1.java
index e7a01b8119..4196a9c5ef 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q624_TheFinestIngredients_Part1/Q624_TheFinestIngredients_Part1.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q624_TheFinestIngredients_Part1/Q624_TheFinestIngredients_Part1.java
@@ -24,17 +24,15 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q624_TheFinestIngredients_Part1 extends Quest
{
- // Mobs
+ // Monsters
private static final int NEPENTHES = 21319;
private static final int ATROX = 21321;
private static final int ATROXSPAWN = 21317;
private static final int BANDERSNATCH = 21314;
-
// Items
private static final int TRUNK_OF_NEPENTHES = 7202;
private static final int FOOT_OF_BANDERSNATCHLING = 7203;
private static final int SECRET_SPICE = 7204;
-
// Rewards
private static final int ICE_CRYSTAL = 7080;
private static final int SOY_SAUCE_JAR = 7205;
@@ -42,12 +40,9 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
public Q624_TheFinestIngredients_Part1()
{
super(624, "The Finest Ingredients - Part 1");
-
registerQuestItems(TRUNK_OF_NEPENTHES, FOOT_OF_BANDERSNATCHLING, SECRET_SPICE);
-
addStartNpc(31521); // Jeremy
addTalkId(31521);
-
addKillId(NEPENTHES, ATROX, ATROXSPAWN, BANDERSNATCH);
}
@@ -63,9 +58,7 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
if (event.equals("31521-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31521-05.htm"))
{
@@ -81,7 +74,7 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
}
else
{
- st.set("cond", "1");
+ st.setCond(1);
htmltext = "31521-07.htm";
}
}
@@ -102,11 +95,13 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 73) ? "31521-03.htm" : "31521-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31521-06.htm";
@@ -123,6 +118,7 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
}
}
break;
+ }
}
return htmltext;
@@ -131,7 +127,7 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -146,26 +142,30 @@ public class Q624_TheFinestIngredients_Part1 extends Quest
switch (npc.getNpcId())
{
case NEPENTHES:
+ {
if (st.dropItemsAlways(TRUNK_OF_NEPENTHES, 1, 50) && (st.getQuestItemsCount(FOOT_OF_BANDERSNATCHLING) >= 50) && (st.getQuestItemsCount(SECRET_SPICE) >= 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case ATROX:
case ATROXSPAWN:
+ {
if (st.dropItemsAlways(SECRET_SPICE, 1, 50) && (st.getQuestItemsCount(TRUNK_OF_NEPENTHES) >= 50) && (st.getQuestItemsCount(FOOT_OF_BANDERSNATCHLING) >= 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
-
+ }
case BANDERSNATCH:
+ {
if (st.dropItemsAlways(FOOT_OF_BANDERSNATCHLING, 1, 50) && (st.getQuestItemsCount(TRUNK_OF_NEPENTHES) >= 50) && (st.getQuestItemsCount(SECRET_SPICE) >= 50))
{
- st.set("cond", "2");
+ st.setCond(2);
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q625_TheFinestIngredients_Part2/Q625_TheFinestIngredients_Part2.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q625_TheFinestIngredients_Part2/Q625_TheFinestIngredients_Part2.java
index 0d330d5999..674e0689f2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q625_TheFinestIngredients_Part2/Q625_TheFinestIngredients_Part2.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q625_TheFinestIngredients_Part2/Q625_TheFinestIngredients_Part2.java
@@ -30,13 +30,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q625_TheFinestIngredients_Part2 extends Quest
{
- // Monster
- private static final int ICICLE_EMPEROR_BUMBALUMP = 25296;
-
// NPCs
private static final int JEREMY = 31521;
private static final int YETI_TABLE = 31542;
-
+ // Monster
+ private static final int ICICLE_EMPEROR_BUMBALUMP = 25296;
// Items
private static final int SOY_SAUCE_JAR = 7205;
private static final int FOOD_FOR_BUMBALUMP = 7209;
@@ -50,39 +48,38 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
4593,
4594
};
-
// Other
private static final int CHECK_INTERVAL = 600000; // 10 minutes
private static final int IDLE_INTERVAL = 3; // (X * CHECK_INTERVAL) = 30 minutes
-
private NpcInstance _npc = null;
private int _status = -1;
public Q625_TheFinestIngredients_Part2()
{
super(625, "The Finest Ingredients - Part 2");
-
registerQuestItems(FOOD_FOR_BUMBALUMP, SPECIAL_YETI_MEAT);
-
addStartNpc(JEREMY);
addTalkId(JEREMY, YETI_TABLE);
-
addAttackId(ICICLE_EMPEROR_BUMBALUMP);
addKillId(ICICLE_EMPEROR_BUMBALUMP);
switch (RaidBossSpawnManager.getInstance().getRaidBossStatusId(ICICLE_EMPEROR_BUMBALUMP))
{
case UNDEFINED:
+ {
LOGGER.log(Level.WARNING, getName() + ": can not find spawned RaidBoss id=" + ICICLE_EMPEROR_BUMBALUMP);
break;
-
+ }
case ALIVE:
+ {
spawnNpc();
// fallthrough
-
+ }
case DEAD:
+ {
startQuestTimer("check", CHECK_INTERVAL, null, null, true);
break;
+ }
}
}
@@ -113,58 +110,60 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
return htmltext;
}
- // Jeremy
- if (event.equals("31521-03.htm"))
+ switch (event)
{
- if (st.hasQuestItems(SOY_SAUCE_JAR))
+ case "31521-03.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- st.takeItems(SOY_SAUCE_JAR, 1);
- st.giveItems(FOOD_FOR_BUMBALUMP, 1);
- }
- else
- {
- htmltext = "31521-04.htm";
- }
- }
- else if (event.equals("31521-08.htm"))
- {
- if (st.hasQuestItems(SPECIAL_YETI_MEAT))
- {
- st.takeItems(SPECIAL_YETI_MEAT, 1);
- st.rewardItems(REWARD_DYE[Rnd.get(REWARD_DYE.length)], 5);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else
- {
- htmltext = "31521-09.htm";
- }
- }
- // Yeti's Table
- else if (event.equals("31542-02.htm"))
- {
- if (st.hasQuestItems(FOOD_FOR_BUMBALUMP))
- {
- if (_status < 0)
+ if (st.hasQuestItems(SOY_SAUCE_JAR))
{
- if (spawnRaid())
+ st.startQuest();
+ st.takeItems(SOY_SAUCE_JAR, 1);
+ st.giveItems(FOOD_FOR_BUMBALUMP, 1);
+ }
+ else
+ {
+ htmltext = "31521-04.htm";
+ }
+ break;
+ }
+ case "31521-08.htm":
+ {
+ if (st.hasQuestItems(SPECIAL_YETI_MEAT))
+ {
+ st.takeItems(SPECIAL_YETI_MEAT, 1);
+ st.rewardItems(REWARD_DYE[Rnd.get(REWARD_DYE.length)], 5);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ }
+ else
+ {
+ htmltext = "31521-09.htm";
+ }
+ break;
+ }
+ case "31542-02.htm":
+ {
+ if (st.hasQuestItems(FOOD_FOR_BUMBALUMP))
+ {
+ if (_status < 0)
{
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(FOOD_FOR_BUMBALUMP, 1);
+ if (spawnRaid())
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(FOOD_FOR_BUMBALUMP, 1);
+ }
+ }
+ else
+ {
+ htmltext = "31542-04.htm";
}
}
else
{
- htmltext = "31542-04.htm";
+ htmltext = "31542-03.htm";
}
- }
- else
- {
- htmltext = "31542-03.htm";
+ break;
}
}
@@ -184,14 +183,17 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 73) ? "31521-02.htm" : "31521-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case JEREMY:
+ {
if (cond == 1)
{
htmltext = "31521-05.htm";
@@ -205,8 +207,9 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
htmltext = "31521-07.htm";
}
break;
-
+ }
case YETI_TABLE:
+ {
if (cond == 1)
{
htmltext = "31542-01.htm";
@@ -216,8 +219,10 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
htmltext = "31542-05.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -233,7 +238,7 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- for (PlayerInstance partyMember : getPartyMembers(player, npc, "cond", "2"))
+ for (PlayerInstance partyMember : getPartyMembers(player, npc, 2))
{
final QuestState st = partyMember.getQuestState(getName());
if (st == null)
@@ -241,7 +246,7 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
continue;
}
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.giveItems(SPECIAL_YETI_MEAT, 1);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q626_ADarkTwilight/Q626_ADarkTwilight.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q626_ADarkTwilight/Q626_ADarkTwilight.java
index 4c52f725d3..22631a5b77 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q626_ADarkTwilight/Q626_ADarkTwilight.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q626_ADarkTwilight/Q626_ADarkTwilight.java
@@ -27,12 +27,10 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q626_ADarkTwilight extends Quest
{
- // Items
- private static final int BLOOD_OF_SAINT = 7169;
-
// NPC
private static final int HIERARCH = 31517;
-
+ // Items
+ private static final int BLOOD_OF_SAINT = 7169;
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -56,16 +54,10 @@ public class Q626_ADarkTwilight extends Quest
public Q626_ADarkTwilight()
{
super(626, "A Dark Twilight");
-
registerQuestItems(BLOOD_OF_SAINT);
-
addStartNpc(HIERARCH);
addTalkId(HIERARCH);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -78,40 +70,44 @@ public class Q626_ADarkTwilight extends Quest
return htmltext;
}
- if (event.equals("31517-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("reward1"))
- {
- if (st.getQuestItemsCount(BLOOD_OF_SAINT) == 300)
+ case "31517-03.htm":
{
- htmltext = "31517-07.htm";
- st.takeItems(BLOOD_OF_SAINT, 300);
- st.rewardExpAndSp(162773, 12500);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
+ st.startQuest();
+ break;
}
- else
+ case "reward1":
{
- htmltext = "31517-08.htm";
+ if (st.getQuestItemsCount(BLOOD_OF_SAINT) == 300)
+ {
+ htmltext = "31517-07.htm";
+ st.takeItems(BLOOD_OF_SAINT, 300);
+ st.rewardExpAndSp(162773, 12500);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "31517-08.htm";
+ }
+ break;
}
- }
- else if (event.equals("reward2"))
- {
- if (st.getQuestItemsCount(BLOOD_OF_SAINT) == 300)
+ case "reward2":
{
- htmltext = "31517-07.htm";
- st.takeItems(BLOOD_OF_SAINT, 300);
- st.rewardItems(57, 100000);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(false);
- }
- else
- {
- htmltext = "31517-08.htm";
+ if (st.getQuestItemsCount(BLOOD_OF_SAINT) == 300)
+ {
+ htmltext = "31517-07.htm";
+ st.takeItems(BLOOD_OF_SAINT, 300);
+ st.rewardItems(57, 100000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(false);
+ }
+ else
+ {
+ htmltext = "31517-08.htm";
+ }
+ break;
}
}
return htmltext;
@@ -130,11 +126,13 @@ public class Q626_ADarkTwilight extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "31517-02.htm" : "31517-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31517-05.htm";
@@ -144,10 +142,12 @@ public class Q626_ADarkTwilight extends Quest
htmltext = "31517-04.htm";
}
break;
-
+ }
case State.COMPLETED:
+ {
htmltext = getAlreadyCompletedMsg();
break;
+ }
}
return htmltext;
@@ -156,7 +156,7 @@ public class Q626_ADarkTwilight extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -164,7 +164,7 @@ public class Q626_ADarkTwilight extends Quest
if (st.dropItems(BLOOD_OF_SAINT, 1, 300, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q627_HeartInSearchOfPower/Q627_HeartInSearchOfPower.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q627_HeartInSearchOfPower/Q627_HeartInSearchOfPower.java
index 19f990d02a..4575014a8d 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q627_HeartInSearchOfPower/Q627_HeartInSearchOfPower.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q627_HeartInSearchOfPower/Q627_HeartInSearchOfPower.java
@@ -30,12 +30,10 @@ public class Q627_HeartInSearchOfPower extends Quest
// NPCs
private static final int NECROMANCER = 31518;
private static final int ENFEUX = 31519;
-
// Items
private static final int SEAL_OF_LIGHT = 7170;
private static final int BEAD_OF_OBEDIENCE = 7171;
private static final int GEM_OF_SAINTS = 7172;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -55,56 +53,26 @@ public class Q627_HeartInSearchOfPower extends Quest
CHANCES.put(21540, 762000);
CHANCES.put(21658, 690000);
}
-
// Rewards
private static final Map REWARDS = new HashMap<>();
static
{
- REWARDS.put("adena", new int[]
- {
- 0,
- 0,
- 100000
- });
- REWARDS.put("asofe", new int[]
- {
- 4043,
- 13,
- 6400
- });
- REWARDS.put("thon", new int[]
- {
- 4044,
- 13,
- 6400
- });
- REWARDS.put("enria", new int[]
- {
- 4042,
- 6,
- 13600
- });
- REWARDS.put("mold", new int[]
- {
- 4041,
- 3,
- 17200
- });
+ // @formatter:off
+ REWARDS.put("adena", new int[]{0, 0, 100000});
+ REWARDS.put("asofe", new int[]{4043, 13, 6400});
+ REWARDS.put("thon", new int[]{4044, 13, 6400});
+ REWARDS.put("enria", new int[]{4042, 6, 13600});
+ REWARDS.put("mold", new int[]{4041, 3, 17200});
+ // @formatter:on
}
public Q627_HeartInSearchOfPower()
{
super(627, "Heart in Search of Power");
-
registerQuestItems(BEAD_OF_OBEDIENCE);
-
addStartNpc(NECROMANCER);
addTalkId(NECROMANCER, ENFEUX);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -119,31 +87,29 @@ public class Q627_HeartInSearchOfPower extends Quest
if (event.equals("31518-01.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31518-03.htm"))
{
if (st.getQuestItemsCount(BEAD_OF_OBEDIENCE) == 300)
{
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(BEAD_OF_OBEDIENCE, -1);
st.giveItems(SEAL_OF_LIGHT, 1);
}
else
{
- htmltext = "31518-03a.htm";
- st.set("cond", "1");
+ st.setCond(1);
st.takeItems(BEAD_OF_OBEDIENCE, -1);
+ htmltext = "31518-03a.htm";
}
}
else if (event.equals("31519-01.htm"))
{
if (st.getQuestItemsCount(SEAL_OF_LIGHT) == 1)
{
- st.set("cond", "4");
+ st.setCond(4);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(SEAL_OF_LIGHT, 1);
st.giveItems(GEM_OF_SAINTS, 1);
@@ -187,14 +153,17 @@ public class Q627_HeartInSearchOfPower extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 60) ? "31518-00a.htm" : "31518-00.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case NECROMANCER:
+ {
if (cond == 1)
{
htmltext = "31518-01a.htm";
@@ -212,8 +181,9 @@ public class Q627_HeartInSearchOfPower extends Quest
htmltext = "31518-05.htm";
}
break;
-
+ }
case ENFEUX:
+ {
if (cond == 3)
{
htmltext = "31519-00.htm";
@@ -223,8 +193,10 @@ public class Q627_HeartInSearchOfPower extends Quest
htmltext = "31519-02.htm";
}
break;
+ }
}
break;
+ }
}
@@ -234,7 +206,7 @@ public class Q627_HeartInSearchOfPower extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -242,7 +214,7 @@ public class Q627_HeartInSearchOfPower extends Quest
if (st.dropItems(BEAD_OF_OBEDIENCE, 1, 300, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q628_HuntOfTheGoldenRamMercenaryForce/Q628_HuntOfTheGoldenRamMercenaryForce.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q628_HuntOfTheGoldenRamMercenaryForce/Q628_HuntOfTheGoldenRamMercenaryForce.java
index 2c796486bf..995ae34432 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q628_HuntOfTheGoldenRamMercenaryForce/Q628_HuntOfTheGoldenRamMercenaryForce.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q628_HuntOfTheGoldenRamMercenaryForce/Q628_HuntOfTheGoldenRamMercenaryForce.java
@@ -29,13 +29,11 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
{
// NPCs
private static final int KAHMAN = 31554;
-
// Items
private static final int SPLINTER_STAKATO_CHITIN = 7248;
private static final int NEEDLE_STAKATO_CHITIN = 7249;
private static final int GOLDEN_RAM_BADGE_RECRUIT = 7246;
private static final int GOLDEN_RAM_BADGE_SOLDIER = 7247;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -55,16 +53,10 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
public Q628_HuntOfTheGoldenRamMercenaryForce()
{
super(628, "Hunt of the Golden Ram Mercenary Force");
-
registerQuestItems(SPLINTER_STAKATO_CHITIN, NEEDLE_STAKATO_CHITIN, GOLDEN_RAM_BADGE_RECRUIT, GOLDEN_RAM_BADGE_SOLDIER);
-
addStartNpc(KAHMAN);
addTalkId(KAHMAN);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -77,27 +69,31 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
return htmltext;
}
- if (event.equals("31554-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31554-03a.htm"))
- {
- if ((st.getQuestItemsCount(SPLINTER_STAKATO_CHITIN) >= 100) && (st.getInt("cond") == 1)) // Giving GOLDEN_RAM_BADGE_RECRUIT Medals
+ case "31554-02.htm":
{
- htmltext = "31554-04.htm";
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(SPLINTER_STAKATO_CHITIN, -1);
- st.giveItems(GOLDEN_RAM_BADGE_RECRUIT, 1);
+ st.startQuest();
+ break;
+ }
+ case "31554-03a.htm":
+ {
+ if ((st.getQuestItemsCount(SPLINTER_STAKATO_CHITIN) >= 100) && st.isCond(1)) // Giving GOLDEN_RAM_BADGE_RECRUIT Medals
+ {
+ htmltext = "31554-04.htm";
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(SPLINTER_STAKATO_CHITIN, -1);
+ st.giveItems(GOLDEN_RAM_BADGE_RECRUIT, 1);
+ }
+ break;
+ }
+ case "31554-07.htm":
+ {
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("31554-07.htm")) // Cancel Quest
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
}
return htmltext;
@@ -116,11 +112,13 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 66) ? "31554-01a.htm" : "31554-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
if (st.getQuestItemsCount(SPLINTER_STAKATO_CHITIN) >= 100)
@@ -137,7 +135,7 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
if ((st.getQuestItemsCount(SPLINTER_STAKATO_CHITIN) >= 100) && (st.getQuestItemsCount(NEEDLE_STAKATO_CHITIN) >= 100))
{
htmltext = "31554-05.htm";
- st.set("cond", "3");
+ st.setCond(3);
st.playSound(QuestState.SOUND_FINISH);
st.takeItems(SPLINTER_STAKATO_CHITIN, -1);
st.takeItems(NEEDLE_STAKATO_CHITIN, -1);
@@ -158,6 +156,7 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
htmltext = "31554-05a.htm";
}
break;
+ }
}
return htmltext;
@@ -178,9 +177,8 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
return null;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
final int npcId = npc.getNpcId();
-
switch (npcId)
{
case 21508:
@@ -188,22 +186,25 @@ public class Q628_HuntOfTheGoldenRamMercenaryForce extends Quest
case 21510:
case 21511:
case 21512:
+ {
if ((cond == 1) || (cond == 2))
{
st.dropItems(SPLINTER_STAKATO_CHITIN, 1, 100, CHANCES.get(npcId));
}
break;
-
+ }
case 21513:
case 21514:
case 21515:
case 21516:
case 21517:
+ {
if (cond == 2)
{
st.dropItems(NEEDLE_STAKATO_CHITIN, 1, 100, CHANCES.get(npcId));
}
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q629_CleanUpTheSwampOfScreams/Q629_CleanUpTheSwampOfScreams.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q629_CleanUpTheSwampOfScreams/Q629_CleanUpTheSwampOfScreams.java
index 33d81ae5f7..40e95329d7 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q629_CleanUpTheSwampOfScreams/Q629_CleanUpTheSwampOfScreams.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q629_CleanUpTheSwampOfScreams/Q629_CleanUpTheSwampOfScreams.java
@@ -29,11 +29,9 @@ public class Q629_CleanUpTheSwampOfScreams extends Quest
{
// NPC
private static final int PIERCE = 31553;
-
- // ITEMS
+ // Items
private static final int TALON_OF_STAKATO = 7250;
private static final int GOLDEN_RAM_COIN = 7251;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -53,16 +51,10 @@ public class Q629_CleanUpTheSwampOfScreams extends Quest
public Q629_CleanUpTheSwampOfScreams()
{
super(629, "Clean up the Swamp of Screams");
-
registerQuestItems(TALON_OF_STAKATO, GOLDEN_RAM_COIN);
-
addStartNpc(PIERCE);
addTalkId(PIERCE);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -75,37 +67,41 @@ public class Q629_CleanUpTheSwampOfScreams extends Quest
return htmltext;
}
- if (event.equals("31553-1.htm"))
+ switch (event)
{
- if (player.getLevel() >= 66)
+ case "31553-1.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ if (player.getLevel() >= 66)
+ {
+ st.startQuest();
+ }
+ else
+ {
+ htmltext = "31553-0a.htm";
+ st.exitQuest(true);
+ }
+ break;
}
- else
+ case "31553-3.htm":
{
- htmltext = "31553-0a.htm";
+ if (st.getQuestItemsCount(TALON_OF_STAKATO) >= 100)
+ {
+ st.takeItems(TALON_OF_STAKATO, 100);
+ st.giveItems(GOLDEN_RAM_COIN, 20);
+ }
+ else
+ {
+ htmltext = "31553-3a.htm";
+ }
+ break;
+ }
+ case "31553-5.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
+ break;
}
}
- else if (event.equals("31553-3.htm"))
- {
- if (st.getQuestItemsCount(TALON_OF_STAKATO) >= 100)
- {
- st.takeItems(TALON_OF_STAKATO, 100);
- st.giveItems(GOLDEN_RAM_COIN, 20);
- }
- else
- {
- htmltext = "31553-3a.htm";
- }
- }
- else if (event.equals("31553-5.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
return htmltext;
}
@@ -128,12 +124,15 @@ public class Q629_CleanUpTheSwampOfScreams extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 66) ? "31553-0a.htm" : "31553-0.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(TALON_OF_STAKATO) >= 100) ? "31553-2.htm" : "31553-1a.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q631_DeliciousTopChoiceMeat/Q631_DeliciousTopChoiceMeat.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q631_DeliciousTopChoiceMeat/Q631_DeliciousTopChoiceMeat.java
index 3a938bc5a6..a2ae60a276 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q631_DeliciousTopChoiceMeat/Q631_DeliciousTopChoiceMeat.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q631_DeliciousTopChoiceMeat/Q631_DeliciousTopChoiceMeat.java
@@ -30,10 +30,8 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
{
// NPC
private static final int TUNATUN = 31537;
-
// Item
private static final int TOP_QUALITY_MEAT = 7546;
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -63,49 +61,26 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
CHANCES.put(21504, 509000);
CHANCES.put(21505, 920000);
}
-
// Rewards
private static final int[][] REWARDS =
{
- {
- 4039,
- 15
- },
- {
- 4043,
- 15
- },
- {
- 4044,
- 15
- },
- {
- 4040,
- 10
- },
- {
- 4042,
- 10
- },
- {
- 4041,
- 5
- }
+ // @formatter:off
+ {4039, 15},
+ {4043, 15},
+ {4044, 15},
+ {4040, 10},
+ {4042, 10},
+ {4041, 5}
+ // @formatter:on
};
public Q631_DeliciousTopChoiceMeat()
{
super(631, "Delicious Top Choice Meat");
-
registerQuestItems(TOP_QUALITY_MEAT);
-
addStartNpc(TUNATUN);
addTalkId(TUNATUN);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -122,9 +97,7 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
{
if (player.getLevel() >= 65)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else
{
@@ -147,7 +120,7 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
}
else
{
- st.set("cond", "1");
+ st.setCond(1);
htmltext = "31537-07.htm";
}
}
@@ -168,11 +141,13 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = "31537-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31537-03a.htm";
@@ -185,11 +160,12 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
}
else
{
- st.set("cond", "1");
+ st.setCond(1);
htmltext = "31537-03a.htm";
}
}
break;
+ }
}
return htmltext;
@@ -198,7 +174,7 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -212,7 +188,7 @@ public class Q631_DeliciousTopChoiceMeat extends Quest
if (st.dropItems(TOP_QUALITY_MEAT, 1, 120, CHANCES.get(npc.getNpcId())))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q632_NecromancersRequest/Q632_NecromancersRequest.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q632_NecromancersRequest/Q632_NecromancersRequest.java
index c41d58bc17..d00e1b7b50 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q632_NecromancersRequest/Q632_NecromancersRequest.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q632_NecromancersRequest/Q632_NecromancersRequest.java
@@ -42,7 +42,6 @@ public class Q632_NecromancersRequest extends Quest
21594,
21595
};
-
private static final int[] UNDEADS =
{
21547,
@@ -58,7 +57,6 @@ public class Q632_NecromancersRequest extends Quest
21577,
21579
};
-
// Items
private static final int VAMPIRE_HEART = 7542;
private static final int ZOMBIE_BRAIN = 7543;
@@ -66,12 +64,9 @@ public class Q632_NecromancersRequest extends Quest
public Q632_NecromancersRequest()
{
super(632, "Necromancer's Request");
-
registerQuestItems(VAMPIRE_HEART, ZOMBIE_BRAIN);
-
addStartNpc(31522); // Mysterious Wizard
addTalkId(31522);
-
addKillId(VAMPIRES);
addKillId(UNDEADS);
}
@@ -88,15 +83,13 @@ public class Q632_NecromancersRequest extends Quest
if (event.equals("31522-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31522-06.htm"))
{
if (st.getQuestItemsCount(VAMPIRE_HEART) >= 200)
{
- st.set("cond", "1");
+ st.setCond(1);
st.playSound(QuestState.SOUND_MIDDLE);
st.takeItems(VAMPIRE_HEART, -1);
st.rewardItems(57, 120000);
@@ -128,12 +121,15 @@ public class Q632_NecromancersRequest extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 63) ? "31522-01.htm" : "31522-02.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.getQuestItemsCount(VAMPIRE_HEART) >= 200) ? "31522-05.htm" : "31522-04.htm";
break;
+ }
}
return htmltext;
@@ -163,9 +159,9 @@ public class Q632_NecromancersRequest extends Quest
}
}
- if ((st.getInt("cond") == 1) && st.dropItems(VAMPIRE_HEART, 1, 200, 500000))
+ if (st.isCond(1) && st.dropItems(VAMPIRE_HEART, 1, 200, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q633_InTheForgottenVillage/Q633_InTheForgottenVillage.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q633_InTheForgottenVillage/Q633_InTheForgottenVillage.java
index c2911f9f2f..f33b62bc85 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q633_InTheForgottenVillage/Q633_InTheForgottenVillage.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q633_InTheForgottenVillage/Q633_InTheForgottenVillage.java
@@ -27,14 +27,12 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q633_InTheForgottenVillage extends Quest
{
- // NPCS
+ // NPCs
private static final int MINA = 31388;
-
- // ITEMS
+ // Items
private static final int RIB_BONE = 7544;
private static final int ZOMBIE_LIVER = 7545;
-
- // MOBS / DROP chances
+ // Monsters / Drop chances
private static final Map MOBS = new HashMap<>();
static
{
@@ -55,7 +53,6 @@ public class Q633_InTheForgottenVillage extends Quest
MOBS.put(21583, 397000); // Bone Scavenger
MOBS.put(21584, 401000); // Bone Scavenger
}
-
private static final Map UNDEADS = new HashMap<>();
static
{
@@ -74,21 +71,11 @@ public class Q633_InTheForgottenVillage extends Quest
public Q633_InTheForgottenVillage()
{
super(633, "In the Forgotten Village");
-
registerQuestItems(RIB_BONE, ZOMBIE_LIVER);
-
addStartNpc(MINA);
addTalkId(MINA);
-
- for (int i : MOBS.keySet())
- {
- addKillId(i);
- }
-
- for (int i : UNDEADS.keySet())
- {
- addKillId(i);
- }
+ addKillId(MOBS.keySet());
+ addKillId(UNDEADS.keySet());
}
@Override
@@ -101,29 +88,33 @@ public class Q633_InTheForgottenVillage extends Quest
return htmltext;
}
- if (event.equals("31388-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31388-10.htm"))
- {
- st.takeItems(RIB_BONE, -1);
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
- }
- else if (event.equals("31388-09.htm"))
- {
- if (st.getQuestItemsCount(RIB_BONE) >= 200)
+ case "31388-04.htm":
{
- htmltext = "31388-08.htm";
- st.takeItems(RIB_BONE, 200);
- st.rewardItems(57, 25000);
- st.rewardExpAndSp(305235, 0);
- st.playSound(QuestState.SOUND_FINISH);
+ st.startQuest();
+ break;
+ }
+ case "31388-10.htm":
+ {
+ st.takeItems(RIB_BONE, -1);
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
+ }
+ case "31388-09.htm":
+ {
+ if (st.getQuestItemsCount(RIB_BONE) >= 200)
+ {
+ htmltext = "31388-08.htm";
+ st.takeItems(RIB_BONE, 200);
+ st.rewardItems(57, 25000);
+ st.rewardExpAndSp(305235, 0);
+ st.playSound(QuestState.SOUND_FINISH);
+ }
+ st.setCond(1);
+ break;
}
- st.set("cond", "1");
}
return htmltext;
@@ -142,11 +133,13 @@ public class Q633_InTheForgottenVillage extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 65) ? "31388-03.htm" : "31388-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31388-06.htm";
@@ -156,6 +149,7 @@ public class Q633_InTheForgottenVillage extends Quest
htmltext = "31388-05.htm";
}
break;
+ }
}
return htmltext;
@@ -177,7 +171,7 @@ public class Q633_InTheForgottenVillage extends Quest
}
else if (MOBS.containsKey(npcId))
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -191,7 +185,7 @@ public class Q633_InTheForgottenVillage extends Quest
if (st.dropItems(RIB_BONE, 1, 200, MOBS.get(npcId)))
{
- st.set("cond", "2");
+ st.setCond(2);
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q634_InSearchOfFragmentsOfDimension/Q634_InSearchOfFragmentsOfDimension.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q634_InSearchOfFragmentsOfDimension/Q634_InSearchOfFragmentsOfDimension.java
index e150f42186..909f6ce4d3 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q634_InSearchOfFragmentsOfDimension/Q634_InSearchOfFragmentsOfDimension.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q634_InSearchOfFragmentsOfDimension/Q634_InSearchOfFragmentsOfDimension.java
@@ -57,9 +57,7 @@ public class Q634_InSearchOfFragmentsOfDimension extends Quest
if (event.equals("02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("05.htm"))
{
@@ -83,12 +81,15 @@ public class Q634_InSearchOfFragmentsOfDimension extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "01a.htm" : "01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = "03.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q635_InTheDimensionalRift/Q635_InTheDimensionalRift.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q635_InTheDimensionalRift/Q635_InTheDimensionalRift.java
index ac29c8d6a2..07fc09d150 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q635_InTheDimensionalRift/Q635_InTheDimensionalRift.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q635_InTheDimensionalRift/Q635_InTheDimensionalRift.java
@@ -55,7 +55,6 @@ public class Q635_InTheDimensionalRift extends Quest
public Q635_InTheDimensionalRift()
{
super(635, "In the Dimensional Rift");
-
for (int i = 31494; i <= 31508; i++)
{
addTalkId(i);
@@ -89,7 +88,7 @@ public class Q635_InTheDimensionalRift extends Quest
}
qs.set("count", "" + (count + 1));
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
qs.getPlayer().teleToLocation(-114790, -180576, -6781);
}
else
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q636_TheTruthBeyondTheGate/Q636_TheTruthBeyondTheGate.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q636_TheTruthBeyondTheGate/Q636_TheTruthBeyondTheGate.java
index 16b2d94e0a..bcbc24682e 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q636_TheTruthBeyondTheGate/Q636_TheTruthBeyondTheGate.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q636_TheTruthBeyondTheGate/Q636_TheTruthBeyondTheGate.java
@@ -37,7 +37,6 @@ public class Q636_TheTruthBeyondTheGate extends Quest
public Q636_TheTruthBeyondTheGate()
{
super(636, "Truth Beyond the Gate");
-
addStartNpc(ELIYAH);
addTalkId(ELIYAH, FLAURON);
}
@@ -54,13 +53,11 @@ public class Q636_TheTruthBeyondTheGate extends Quest
if (event.equals("31329-04.htm"))
{
- qs.set("cond", "1");
- qs.setState(State.STARTED);
- qs.playSound("ItemSound.quest_accept");
+ qs.startQuest();
}
else if (event.equals("32010-02.htm"))
{
- qs.playSound("ItemSound.quest_finish");
+ qs.playSound(QuestState.SOUND_FINISH);
qs.giveItems(MARK, 1);
qs.unset("cond");
qs.exitQuest(true);
@@ -81,7 +78,7 @@ public class Q636_TheTruthBeyondTheGate extends Quest
final int npcId = npc.getNpcId();
final int id = qs.getState();
- final int cond = qs.getInt("cond");
+ final int cond = qs.getCond();
if ((cond == 0) && (id == State.CREATED))
{
if (npcId == ELIYAH)
@@ -108,7 +105,7 @@ public class Q636_TheTruthBeyondTheGate extends Quest
if (cond == 1)
{
htmltext = "32010-01.htm";
- qs.set("cond", "2");
+ qs.setCond(2);
}
else
{
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q637_ThroughTheGateOnceMore/Q637_ThroughTheGateOnceMore.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q637_ThroughTheGateOnceMore/Q637_ThroughTheGateOnceMore.java
index 5dcd4e1eb3..a5852e4950 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q637_ThroughTheGateOnceMore/Q637_ThroughTheGateOnceMore.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q637_ThroughTheGateOnceMore/Q637_ThroughTheGateOnceMore.java
@@ -26,23 +26,18 @@ public class Q637_ThroughTheGateOnceMore extends Quest
{
// NPC
private static final int FLAURON = 32010;
-
// Items
private static final int FADED_VISITOR_MARK = 8065;
private static final int NECROMANCER_HEART = 8066;
-
// Reward
private static final int PAGAN_MARK = 8067;
public Q637_ThroughTheGateOnceMore()
{
super(637, "Through the Gate Once More");
-
registerQuestItems(NECROMANCER_HEART);
-
addStartNpc(FLAURON);
addTalkId(FLAURON);
-
addKillId(21565, 21566, 21567);
}
@@ -58,9 +53,7 @@ public class Q637_ThroughTheGateOnceMore extends Quest
if (event.equals("32010-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("32010-10.htm"))
{
@@ -83,6 +76,7 @@ public class Q637_ThroughTheGateOnceMore extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if ((player.getLevel() < 73) || !st.hasQuestItems(FADED_VISITOR_MARK))
{
htmltext = "32010-01a.htm";
@@ -96,9 +90,10 @@ public class Q637_ThroughTheGateOnceMore extends Quest
htmltext = "32010-01.htm";
}
break;
-
+ }
case State.STARTED:
- if (st.getInt("cond") == 2)
+ {
+ if (st.isCond(2))
{
if (st.getQuestItemsCount(NECROMANCER_HEART) == 10)
{
@@ -112,7 +107,7 @@ public class Q637_ThroughTheGateOnceMore extends Quest
}
else
{
- st.set("cond", "1");
+ st.setCond(1);
}
}
else
@@ -120,6 +115,7 @@ public class Q637_ThroughTheGateOnceMore extends Quest
htmltext = "32010-05.htm";
}
break;
+ }
}
return htmltext;
@@ -128,7 +124,7 @@ public class Q637_ThroughTheGateOnceMore extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -142,7 +138,7 @@ public class Q637_ThroughTheGateOnceMore extends Quest
if (st.dropItems(NECROMANCER_HEART, 1, 10, 400000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q638_SeekersOfTheHolyGrail/Q638_SeekersOfTheHolyGrail.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q638_SeekersOfTheHolyGrail/Q638_SeekersOfTheHolyGrail.java
index 1d3c218a52..5b3ffbbed8 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q638_SeekersOfTheHolyGrail/Q638_SeekersOfTheHolyGrail.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q638_SeekersOfTheHolyGrail/Q638_SeekersOfTheHolyGrail.java
@@ -27,19 +27,15 @@ public class Q638_SeekersOfTheHolyGrail extends Quest
{
// NPC
private static final int INNOCENTIN = 31328;
-
// Item
private static final int PAGAN_TOTEM = 8068;
public Q638_SeekersOfTheHolyGrail()
{
super(638, "Seekers of the Holy Grail");
-
registerQuestItems(PAGAN_TOTEM);
-
addStartNpc(INNOCENTIN);
addTalkId(INNOCENTIN);
-
for (int i = 22138; i < 22175; i++)
{
addKillId(i);
@@ -58,9 +54,7 @@ public class Q638_SeekersOfTheHolyGrail extends Quest
if (event.equals("31328-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31328-06.htm"))
{
@@ -84,10 +78,12 @@ public class Q638_SeekersOfTheHolyGrail extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 73) ? "31328-00.htm" : "31328-01.htm";
break;
-
+ }
case State.STARTED:
+ {
if (st.getQuestItemsCount(PAGAN_TOTEM) >= 2000)
{
htmltext = "31328-03.htm";
@@ -113,6 +109,7 @@ public class Q638_SeekersOfTheHolyGrail extends Quest
htmltext = "31328-04.htm";
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q639_GuardiansOfTheHolyGrail/Q639_GuardiansOfTheHolyGrail.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q639_GuardiansOfTheHolyGrail/Q639_GuardiansOfTheHolyGrail.java
index 22f2a1b0ea..5353654cf8 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q639_GuardiansOfTheHolyGrail/Q639_GuardiansOfTheHolyGrail.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q639_GuardiansOfTheHolyGrail/Q639_GuardiansOfTheHolyGrail.java
@@ -31,12 +31,10 @@ public class Q639_GuardiansOfTheHolyGrail extends Quest
private static final int DOMINIC = 31350;
private static final int GREMORY = 32008;
private static final int HOLY_GRAIL = 32028;
-
// Items
private static final int SCRIPTURE = 8069;
private static final int WATER_BOTTLE = 8070;
private static final int HOLY_WATER_BOTTLE = 8071;
-
private static final Map CHANCES = new HashMap<>();
static
{
@@ -59,16 +57,10 @@ public class Q639_GuardiansOfTheHolyGrail extends Quest
public Q639_GuardiansOfTheHolyGrail()
{
super(639, "Guardians of the Holy Grail");
-
registerQuestItems(SCRIPTURE, WATER_BOTTLE, HOLY_WATER_BOTTLE);
-
addStartNpc(DOMINIC);
addTalkId(DOMINIC, GREMORY, HOLY_GRAIL);
-
- for (int id : CHANCES.keySet())
- {
- addKillId(id);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -81,62 +73,68 @@ public class Q639_GuardiansOfTheHolyGrail extends Quest
return htmltext;
}
- // DOMINIC
- if (event.equals("31350-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31350-08.htm"))
- {
- final int count = st.getQuestItemsCount(SCRIPTURE);
- st.takeItems(SCRIPTURE, -1);
- st.rewardItems(57, (1625 * count) + ((count >= 10) ? 33940 : 0));
- }
- else if (event.equals("31350-09.htm"))
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
- }
- // GREMORY
- else if (event.equals("32008-05.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.giveItems(WATER_BOTTLE, 1);
- }
- else if (event.equals("32008-09.htm"))
- {
- st.set("cond", "4");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(HOLY_WATER_BOTTLE, 1);
- }
- else if (event.equals("32008-12.htm"))
- {
- if (st.getQuestItemsCount(SCRIPTURE) >= 4000)
+ case "31350-04.htm":
{
- htmltext = "32008-11.htm";
- st.takeItems(SCRIPTURE, 4000);
- st.rewardItems(959, 1);
+ st.startQuest();
+ break;
}
- }
- else if (event.equals("32008-14.htm"))
- {
- if (st.getQuestItemsCount(SCRIPTURE) >= 400)
+ case "31350-08.htm":
{
- htmltext = "32008-13.htm";
- st.takeItems(SCRIPTURE, 400);
- st.rewardItems(960, 1);
+ final int count = st.getQuestItemsCount(SCRIPTURE);
+ st.takeItems(SCRIPTURE, -1);
+ st.rewardItems(57, (1625 * count) + ((count >= 10) ? 33940 : 0));
+ break;
+ }
+ case "31350-09.htm":
+ {
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
+ }
+ case "32008-05.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.giveItems(WATER_BOTTLE, 1);
+ break;
+ }
+ case "32008-09.htm":
+ {
+ st.setCond(4);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(HOLY_WATER_BOTTLE, 1);
+ break;
+ }
+ case "32008-12.htm":
+ {
+ if (st.getQuestItemsCount(SCRIPTURE) >= 4000)
+ {
+ htmltext = "32008-11.htm";
+ st.takeItems(SCRIPTURE, 4000);
+ st.rewardItems(959, 1);
+ }
+ break;
+ }
+ case "32008-14.htm":
+ {
+ if (st.getQuestItemsCount(SCRIPTURE) >= 400)
+ {
+ htmltext = "32008-13.htm";
+ st.takeItems(SCRIPTURE, 400);
+ st.rewardItems(960, 1);
+ }
+ break;
+ }
+ case "32028-02.htm":
+ {
+ st.setCond(3);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.takeItems(WATER_BOTTLE, 1);
+ st.giveItems(HOLY_WATER_BOTTLE, 1);
+ break;
}
- }
- // HOLY GRAIL
- else if (event.equals("32028-02.htm"))
- {
- st.set("cond", "3");
- st.playSound(QuestState.SOUND_MIDDLE);
- st.takeItems(WATER_BOTTLE, 1);
- st.giveItems(HOLY_WATER_BOTTLE, 1);
}
return htmltext;
@@ -155,18 +153,22 @@ public class Q639_GuardiansOfTheHolyGrail extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 73) ? "31350-02.htm" : "31350-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
switch (npc.getNpcId())
{
case DOMINIC:
+ {
htmltext = (st.hasQuestItems(SCRIPTURE)) ? "31350-05.htm" : "31350-06.htm";
break;
-
+ }
case GREMORY:
+ {
if (cond == 1)
{
htmltext = "32008-01.htm";
@@ -184,8 +186,9 @@ public class Q639_GuardiansOfTheHolyGrail extends Quest
htmltext = "32008-10.htm";
}
break;
-
+ }
case HOLY_GRAIL:
+ {
if (cond == 2)
{
htmltext = "32028-01.htm";
@@ -195,8 +198,10 @@ public class Q639_GuardiansOfTheHolyGrail extends Quest
htmltext = "32028-03.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q640_TheZeroHour/Q640_TheZeroHour.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q640_TheZeroHour/Q640_TheZeroHour.java
index dedd82550e..3da7359e9c 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q640_TheZeroHour/Q640_TheZeroHour.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q640_TheZeroHour/Q640_TheZeroHour.java
@@ -29,68 +29,29 @@ public class Q640_TheZeroHour extends Quest
{
// NPC
private static final int KAHMAN = 31554;
-
// Item
private static final int FANG_OF_STAKATO = 8085;
-
private static final int[][] REWARDS =
{
- {
- 12,
- 4042,
- 1
- },
- {
- 6,
- 4043,
- 1
- },
- {
- 6,
- 4044,
- 1
- },
- {
- 81,
- 1887,
- 10
- },
- {
- 33,
- 1888,
- 5
- },
- {
- 30,
- 1889,
- 10
- },
- {
- 150,
- 5550,
- 10
- },
- {
- 131,
- 1890,
- 10
- },
- {
- 123,
- 1893,
- 5
- }
+ // @formatter:off
+ {12, 4042, 1},
+ {6, 4043, 1},
+ {6, 4044, 1},
+ {81, 1887, 10},
+ {33, 1888, 5},
+ {30, 1889, 10},
+ {150, 5550, 10},
+ {131, 1890, 10},
+ {123, 1893, 5}
+ // @formatter:on
};
public Q640_TheZeroHour()
{
super(640, "The Zero Hour");
-
registerQuestItems(FANG_OF_STAKATO);
-
addStartNpc(KAHMAN);
addTalkId(KAHMAN);
-
// All "spiked" stakatos types, except babies and cannibalistic followers.
addKillId(22105, 22106, 22107, 22108, 22109, 22110, 22111, 22113, 22114, 22115, 22116, 22117, 22118, 22119, 22121);
}
@@ -107,9 +68,7 @@ public class Q640_TheZeroHour extends Quest
if (event.equals("31554-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("31554-05.htm"))
{
@@ -154,6 +113,7 @@ public class Q640_TheZeroHour extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 66)
{
htmltext = "31554-00.htm";
@@ -164,10 +124,12 @@ public class Q640_TheZeroHour extends Quest
htmltext = ((st2 != null) && st2.isCompleted()) ? "31554-01.htm" : "31554-10.htm";
}
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasQuestItems(FANG_OF_STAKATO)) ? "31554-04.htm" : "31554-03.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q641_AttackSailren/Q641_AttackSailren.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q641_AttackSailren/Q641_AttackSailren.java
index 651a7901ef..0af349abac 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q641_AttackSailren/Q641_AttackSailren.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q641_AttackSailren/Q641_AttackSailren.java
@@ -27,9 +27,8 @@ import quests.Q126_TheNameOfEvil_2.Q126_TheNameOfEvil_2;
public class Q641_AttackSailren extends Quest
{
- // NPCs
+ // NPC
private static final int STATUE = 32109;
-
// Quest Item
private static final int GAZKH_FRAGMENT = 8782;
private static final int GAZKH = 8784;
@@ -37,30 +36,25 @@ public class Q641_AttackSailren extends Quest
public Q641_AttackSailren()
{
super(641, "Attack Sailren!");
-
registerQuestItems(GAZKH_FRAGMENT);
-
addStartNpc(STATUE);
addTalkId(STATUE);
-
addKillId(22196, 22197, 22198, 22199, 22218, 22223);
}
@Override
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{
- String htmltext = event;
final QuestState st = player.getQuestState(getName());
if (st == null)
{
return null;
}
+ String htmltext = event;
if (event.equals("32109-5.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("32109-8.htm"))
{
@@ -75,7 +69,7 @@ public class Q641_AttackSailren extends Quest
else
{
htmltext = "32109-6.htm";
- st.set("cond", "1");
+ st.setCond(1);
}
}
@@ -95,6 +89,7 @@ public class Q641_AttackSailren extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
if (player.getLevel() < 77)
{
htmltext = "32109-3.htm";
@@ -105,9 +100,10 @@ public class Q641_AttackSailren extends Quest
htmltext = ((st2 != null) && st2.isCompleted()) ? "32109-1.htm" : "32109-2.htm";
}
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "32109-5.htm";
@@ -117,6 +113,7 @@ public class Q641_AttackSailren extends Quest
htmltext = "32109-7.htm";
}
break;
+ }
}
return htmltext;
@@ -125,7 +122,7 @@ public class Q641_AttackSailren extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "cond", "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -139,7 +136,7 @@ public class Q641_AttackSailren extends Quest
if (st.dropItems(GAZKH_FRAGMENT, 1, 30, 50000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q642_APowerfulPrimevalCreature/Q642_APowerfulPrimevalCreature.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q642_APowerfulPrimevalCreature/Q642_APowerfulPrimevalCreature.java
index c52ed11c6b..28dc320caa 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q642_APowerfulPrimevalCreature/Q642_APowerfulPrimevalCreature.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q642_APowerfulPrimevalCreature/Q642_APowerfulPrimevalCreature.java
@@ -25,12 +25,11 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q642_APowerfulPrimevalCreature extends Quest
{
+ // NPC
+ private static final int ANCIENT_EGG = 18344;
// Items
private static final int DINOSAUR_TISSUE = 8774;
private static final int DINOSAUR_EGG = 8775;
-
- private static final int ANCIENT_EGG = 18344;
-
// Rewards
private static final int[] REWARDS =
{
@@ -50,12 +49,9 @@ public class Q642_APowerfulPrimevalCreature extends Quest
public Q642_APowerfulPrimevalCreature()
{
super(642, "A Powerful Primeval Creature");
-
registerQuestItems(DINOSAUR_TISSUE, DINOSAUR_EGG);
-
addStartNpc(32105); // Dinn
addTalkId(32105);
-
// Dinosaurs + egg
addKillId(22196, 22197, 22198, 22199, 22200, 22201, 22202, 22203, 22204, 22205, 22218, 22219, 22220, 22223, 22224, 22225, ANCIENT_EGG);
}
@@ -72,9 +68,7 @@ public class Q642_APowerfulPrimevalCreature extends Quest
if (event.equals("32105-04.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("32105-08.htm"))
{
@@ -128,12 +122,15 @@ public class Q642_APowerfulPrimevalCreature extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 75) ? "32105-00.htm" : "32105-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (!st.hasQuestItems(DINOSAUR_TISSUE)) ? "32105-08.htm" : "32105-05.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q643_RiseAndFallOfTheElrokiTribe/Q643_RiseAndFallOfTheElrokiTribe.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q643_RiseAndFallOfTheElrokiTribe/Q643_RiseAndFallOfTheElrokiTribe.java
index 8e0e78527d..4be1a42ac8 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q643_RiseAndFallOfTheElrokiTribe/Q643_RiseAndFallOfTheElrokiTribe.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q643_RiseAndFallOfTheElrokiTribe/Q643_RiseAndFallOfTheElrokiTribe.java
@@ -28,19 +28,15 @@ public class Q643_RiseAndFallOfTheElrokiTribe extends Quest
// NPCs
private static final int SINGSING = 32106;
private static final int KARAKAWEI = 32117;
-
// Items
private static final int BONES = 8776;
public Q643_RiseAndFallOfTheElrokiTribe()
{
super(643, "Rise and Fall of the Elroki Tribe");
-
registerQuestItems(BONES);
-
addStartNpc(SINGSING);
addTalkId(SINGSING, KARAKAWEI);
-
addKillId(22208, 22209, 22210, 22211, 22212, 22213, 22221, 22222, 22226, 22227);
}
@@ -54,34 +50,39 @@ public class Q643_RiseAndFallOfTheElrokiTribe extends Quest
return htmltext;
}
- if (event.equals("32106-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("32106-07.htm"))
- {
- final int count = st.getQuestItemsCount(BONES);
- st.takeItems(BONES, count);
- st.rewardItems(57, count * 1374);
- }
- else if (event.equals("32106-09.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("32117-03.htm"))
- {
- final int count = st.getQuestItemsCount(BONES);
- if (count >= 300)
+ case "32106-03.htm":
{
- st.takeItems(BONES, 300);
- st.rewardItems(Rnd.get(8712, 8722), 5);
+ st.startQuest();
+ break;
}
- else
+ case "32106-07.htm":
{
- htmltext = "32117-04.htm";
+ final int count = st.getQuestItemsCount(BONES);
+ st.takeItems(BONES, count);
+ st.rewardItems(57, count * 1374);
+ break;
+ }
+ case "32106-09.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "32117-03.htm":
+ {
+ final int count = st.getQuestItemsCount(BONES);
+ if (count >= 300)
+ {
+ st.takeItems(BONES, 300);
+ st.rewardItems(Rnd.get(8712, 8722), 5);
+ }
+ else
+ {
+ htmltext = "32117-04.htm";
+ }
+ break;
}
}
@@ -101,21 +102,27 @@ public class Q643_RiseAndFallOfTheElrokiTribe extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 75) ? "32106-00.htm" : "32106-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case SINGSING:
+ {
htmltext = (st.hasQuestItems(BONES)) ? "32106-06.htm" : "32106-05.htm";
break;
-
+ }
case KARAKAWEI:
+ {
htmltext = "32117-01.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q644_GraveRobberAnnihilation/Q644_GraveRobberAnnihilation.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q644_GraveRobberAnnihilation/Q644_GraveRobberAnnihilation.java
index ca83d216b1..be6adc4811 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q644_GraveRobberAnnihilation/Q644_GraveRobberAnnihilation.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q644_GraveRobberAnnihilation/Q644_GraveRobberAnnihilation.java
@@ -25,50 +25,29 @@ import org.l2jmobius.gameserver.util.Util;
public class Q644_GraveRobberAnnihilation extends Quest
{
+ // NPC
+ private static final int KARUDA = 32017;
// Item
private static final int ORC_GRAVE_GOODS = 8088;
-
// Rewards
private static final int[][] REWARDS =
{
- {
- 1865,
- 30
- },
- {
- 1867,
- 40
- },
- {
- 1872,
- 40
- },
- {
- 1871,
- 30
- },
- {
- 1870,
- 30
- },
- {
- 1869,
- 30
- }
+ // @formatter:off
+ {1865, 30},
+ {1867, 40},
+ {1872, 40},
+ {1871, 30},
+ {1870, 30},
+ {1869, 30}
+ // @formatter:on
};
- // NPC
- private static final int KARUDA = 32017;
-
public Q644_GraveRobberAnnihilation()
{
super(644, "Grave Robber Annihilation");
-
registerQuestItems(ORC_GRAVE_GOODS);
-
addStartNpc(KARUDA);
addTalkId(KARUDA);
-
addKillId(22003, 22004, 22005, 22006, 22008);
}
@@ -84,9 +63,7 @@ public class Q644_GraveRobberAnnihilation extends Quest
if (event.equals("32017-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (Util.isDigit(event))
{
@@ -116,11 +93,13 @@ public class Q644_GraveRobberAnnihilation extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 20) ? "32017-06.htm" : "32017-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "32017-05.htm";
@@ -130,6 +109,7 @@ public class Q644_GraveRobberAnnihilation extends Quest
htmltext = "32017-07.htm";
}
break;
+ }
}
return htmltext;
@@ -138,7 +118,7 @@ public class Q644_GraveRobberAnnihilation extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -152,7 +132,7 @@ public class Q644_GraveRobberAnnihilation extends Quest
if (st.dropItems(ORC_GRAVE_GOODS, 1, 120, 500000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q645_GhostsOfBatur/Q645_GhostsOfBatur.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q645_GhostsOfBatur/Q645_GhostsOfBatur.java
index cbbf01c558..f041c945e6 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q645_GhostsOfBatur/Q645_GhostsOfBatur.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q645_GhostsOfBatur/Q645_GhostsOfBatur.java
@@ -27,46 +27,26 @@ public class Q645_GhostsOfBatur extends Quest
{
// NPC
private static final int KARUDA = 32017;
-
// Item
private static final int CURSED_GRAVE_GOODS = 8089;
-
// Rewards
private static final int[][] REWARDS =
{
- {
- 1878,
- 18
- },
- {
- 1879,
- 7
- },
- {
- 1880,
- 4
- },
- {
- 1881,
- 6
- },
- {
- 1882,
- 10
- },
- {
- 1883,
- 2
- }
+ // @formatter:off
+ {1878, 18},
+ {1879, 7},
+ {1880, 4},
+ {1881, 6},
+ {1882, 10},
+ {1883, 2}
+ // @formatter:on
};
public Q645_GhostsOfBatur()
{
super(645, "Ghosts of Batur");
-
addStartNpc(KARUDA);
addTalkId(KARUDA);
-
addKillId(22007, 22009, 22010, 22011, 22012, 22013, 22014, 22015, 22016);
}
@@ -82,9 +62,7 @@ public class Q645_GhostsOfBatur extends Quest
if (event.equals("32017-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (Util.isDigit(event))
{
@@ -114,11 +92,13 @@ public class Q645_GhostsOfBatur extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 23) ? "32017-02.htm" : "32017-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "32017-04.htm";
@@ -128,6 +108,7 @@ public class Q645_GhostsOfBatur extends Quest
htmltext = "32017-05.htm";
}
break;
+ }
}
return htmltext;
@@ -136,7 +117,7 @@ public class Q645_GhostsOfBatur extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -150,7 +131,7 @@ public class Q645_GhostsOfBatur extends Quest
if (st.dropItems(CURSED_GRAVE_GOODS, 1, 180, 750000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q646_SignsOfRevolt/Q646_SignsOfRevolt.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q646_SignsOfRevolt/Q646_SignsOfRevolt.java
index 429855df2f..138ed3ee95 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q646_SignsOfRevolt/Q646_SignsOfRevolt.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q646_SignsOfRevolt/Q646_SignsOfRevolt.java
@@ -27,40 +27,25 @@ public class Q646_SignsOfRevolt extends Quest
{
// NPC
private static final int TORRANT = 32016;
-
// Item
private static final int CURSED_DOLL = 8087;
-
// Rewards
private static final int[][] REWARDS =
{
- {
- 1880,
- 9
- },
- {
- 1881,
- 12
- },
- {
- 1882,
- 20
- },
- {
- 57,
- 21600
- }
+ // @formatter:off
+ {1880, 9},
+ {1881, 12},
+ {1882, 20},
+ {57, 21600}
+ // @formatter:on
};
public Q646_SignsOfRevolt()
{
super(646, "Signs of Revolt");
-
registerQuestItems(CURSED_DOLL);
-
addStartNpc(TORRANT);
addTalkId(TORRANT);
-
addKillId(22029, 22030, 22031, 22032, 22033, 22034, 22035, 22036, 22037, 22038, 22039, 22040, 22041, 22042, 22043, 22044, 22045, 22047, 22049);
}
@@ -76,9 +61,7 @@ public class Q646_SignsOfRevolt extends Quest
if (event.equals("32016-03.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (Util.isDigit(event))
{
@@ -108,11 +91,13 @@ public class Q646_SignsOfRevolt extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 40) ? "32016-02.htm" : "32016-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "32016-04.htm";
@@ -122,6 +107,7 @@ public class Q646_SignsOfRevolt extends Quest
htmltext = "32016-05.htm";
}
break;
+ }
}
return htmltext;
@@ -130,7 +116,7 @@ public class Q646_SignsOfRevolt extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -144,7 +130,7 @@ public class Q646_SignsOfRevolt extends Quest
if (st.dropItems(CURSED_DOLL, 1, 180, 750000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q647_InfluxOfMachines/Q647_InfluxOfMachines.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q647_InfluxOfMachines/Q647_InfluxOfMachines.java
index e16094a999..a85740c2ad 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q647_InfluxOfMachines/Q647_InfluxOfMachines.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q647_InfluxOfMachines/Q647_InfluxOfMachines.java
@@ -25,21 +25,17 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q647_InfluxOfMachines extends Quest
{
- // Item
- private static final int DESTROYED_GOLEM_SHARD = 8100;
-
// NPC
private static final int GUTENHAGEN = 32069;
+ // Item
+ private static final int DESTROYED_GOLEM_SHARD = 8100;
public Q647_InfluxOfMachines()
{
super(647, "Influx of Machines");
-
registerQuestItems(DESTROYED_GOLEM_SHARD);
-
addStartNpc(GUTENHAGEN);
addTalkId(GUTENHAGEN);
-
for (int i = 22052; i < 22079; i++)
{
addKillId(i);
@@ -58,9 +54,7 @@ public class Q647_InfluxOfMachines extends Quest
if (event.equals("32069-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("32069-06.htm"))
{
@@ -86,11 +80,13 @@ public class Q647_InfluxOfMachines extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 46) ? "32069-03.htm" : "32069-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "32069-04.htm";
@@ -100,6 +96,7 @@ public class Q647_InfluxOfMachines extends Quest
htmltext = "32069-05.htm";
}
break;
+ }
}
return htmltext;
@@ -108,7 +105,7 @@ public class Q647_InfluxOfMachines extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "1");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 1);
if (partyMember == null)
{
return null;
@@ -122,7 +119,7 @@ public class Q647_InfluxOfMachines extends Quest
if (st.dropItems(DESTROYED_GOLEM_SHARD, 1, 500, 300000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q648_AnIceMerchantsDream/Q648_AnIceMerchantsDream.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q648_AnIceMerchantsDream/Q648_AnIceMerchantsDream.java
index 8d7301a0ad..08918fd660 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q648_AnIceMerchantsDream/Q648_AnIceMerchantsDream.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q648_AnIceMerchantsDream/Q648_AnIceMerchantsDream.java
@@ -41,150 +41,45 @@ public class Q648_AnIceMerchantsDream extends Quest
private static final Map REWARDS = new HashMap<>();
static
{
- REWARDS.put("a", new int[]
- {
- SILVER_ICE_CRYSTAL,
- 23,
- 1894 // Crafted Leather
- });
- REWARDS.put("b", new int[]
- {
- SILVER_ICE_CRYSTAL,
- 6,
- 1881 // Coarse Bone Powder
- });
- REWARDS.put("c", new int[]
- {
- SILVER_ICE_CRYSTAL,
- 8,
- 1880 // Steel
- });
- REWARDS.put("d", new int[]
- {
- BLACK_ICE_CRYSTAL,
- 1800,
- 729 // Scroll: Enchant Weapon (A-Grade)
- });
- REWARDS.put("e", new int[]
- {
- BLACK_ICE_CRYSTAL,
- 240,
- 730 // Scroll: Enchant Armor (A-Grade)
- });
- REWARDS.put("f", new int[]
- {
- BLACK_ICE_CRYSTAL,
- 500,
- 947 // Scroll: Enchant Weapon (B-Grade)
- });
- REWARDS.put("g", new int[]
- {
- BLACK_ICE_CRYSTAL,
- 80,
- 948 // Scroll: Enchant Armor (B-Grade)
- });
+ // @formatter:off
+ REWARDS.put("a", new int[]{SILVER_ICE_CRYSTAL, 23, 1894}); // Crafted Leather
+ REWARDS.put("b", new int[]{SILVER_ICE_CRYSTAL, 6, 1881}); // Coarse Bone Powder
+ REWARDS.put("c", new int[]{SILVER_ICE_CRYSTAL, 8, 1880}); // Steel
+ REWARDS.put("d", new int[]{BLACK_ICE_CRYSTAL, 1800, 729}); // Scroll: Enchant Weapon (A-Grade)
+ REWARDS.put("e", new int[]{BLACK_ICE_CRYSTAL, 240, 730}); // Scroll: Enchant Armor (A-Grade)
+ REWARDS.put("f", new int[]{BLACK_ICE_CRYSTAL, 500, 947}); // Scroll: Enchant Weapon (B-Grade)
+ REWARDS.put("g", new int[]{BLACK_ICE_CRYSTAL, 80, 948}); // Scroll: Enchant Armor (B-Grade)
}
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
{
- CHANCES.put(22080, new int[]
- {
- 285000,
- 48000
- }); // Massive Maze Bandersnatch
- CHANCES.put(22081, new int[]
- {
- 443000,
- 0
- }); // Lost Watcher
- CHANCES.put(22082, new int[]
- {
- 510000,
- 0
- });// Baby Panthera
- CHANCES.put(22083, new int[]
- {
- 510000,
- 0
- }); // Elder Lost Watcher
- CHANCES.put(22084, new int[]
- {
- 477000,
- 49000
- }); // Panthera
- CHANCES.put(22085, new int[]
- {
- 420000,
- 43000
- }); // Lost Gargoyle
- CHANCES.put(22086, new int[]
- {
- 490000,
- 50000
- }); // Lost Gargoyle Youngling
- CHANCES.put(22087, new int[]
- {
- 787000,
- 81000
- }); // Pronghorn Spirit
- CHANCES.put(22088, new int[]
- {
- 480000,
- 49000
- }); // Pronghorn
- CHANCES.put(22089, new int[]
- {
- 550000,
- 56000
- }); // Ice Tarantula
- CHANCES.put(22090, new int[]
- {
- 570000,
- 58000
- }); // Frost Tarantula
- CHANCES.put(22092, new int[]
- {
- 623000,
- 0
- }); // Frost Iron Golem
- CHANCES.put(22093, new int[]
- {
- 910000,
- 93000
- }); // Lost Buffalo
- CHANCES.put(22094, new int[]
- {
- 553000,
- 57000
- }); // Frost Buffalo
- CHANCES.put(22096, new int[]
- {
- 593000,
- 61000
- }); // Ursus
- CHANCES.put(22097, new int[]
- {
- 693000,
- 71000
- }); // Lost Yeti
- CHANCES.put(22098, new int[]
- {
- 717000,
- 74000
- }); // Frost Yeti
+ CHANCES.put(22080, new int[]{285000, 48000}); // Massive Maze Bandersnatch
+ CHANCES.put(22081, new int[]{443000, 0}); // Lost Watcher
+ CHANCES.put(22082, new int[]{510000, 0}); // Baby Panthera
+ CHANCES.put(22083, new int[]{510000, 0}); // Elder Lost Watcher
+ CHANCES.put(22084, new int[]{477000, 49000}); // Panthera
+ CHANCES.put(22085, new int[]{420000, 43000}); // Lost Gargoyle
+ CHANCES.put(22086, new int[]{490000, 50000}); // Lost Gargoyle Youngling
+ CHANCES.put(22087, new int[]{787000, 81000}); // Pronghorn Spirit
+ CHANCES.put(22088, new int[]{480000, 49000}); // Pronghorn
+ CHANCES.put(22089, new int[]{550000, 56000}); // Ice Tarantula
+ CHANCES.put(22090, new int[]{570000, 58000}); // Frost Tarantula
+ CHANCES.put(22092, new int[]{623000, 0}); // Frost Iron Golem
+ CHANCES.put(22093, new int[]{910000, 93000}); // Lost Buffalo
+ CHANCES.put(22094, new int[]{553000, 57000}); // Frost Buffalo
+ CHANCES.put(22096, new int[]{593000, 61000}); // Ursus
+ CHANCES.put(22097, new int[]{693000, 71000}); // Lost Yeti
+ CHANCES.put(22098, new int[]{717000, 74000}); // Frost Yeti
+ // @formatter:on
}
public Q648_AnIceMerchantsDream()
{
super(648, "An Ice Merchant's Dream");
-
addStartNpc(RAFFORTY, ICE_SHELF);
addTalkId(RAFFORTY, ICE_SHELF);
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -194,103 +89,107 @@ public class Q648_AnIceMerchantsDream extends Quest
QuestState st = player.getQuestState(getName());
if (st == null)
{
- return event;
+ return htmltext;
}
- if (event.equals("32020-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound("ItemSound.quest_accept");
- }
- else if (event.equals("32020-05.htm"))
- {
- st.setState(State.STARTED);
- st.set("cond", "2");
- st.playSound("ItemSound.quest_accept");
- }
- else
- {
- int exCond;
- int val;
- if (!event.equals("32020-14.htm") && !event.equals("32020-15.htm"))
+ case "32020-04.htm":
{
- if (event.startsWith("32020-17"))
+ st.startQuest();
+ break;
+ }
+ case "32020-05.htm":
+ {
+ st.setState(State.STARTED);
+ st.setCond(2);
+ st.playSound("ItemSound.quest_accept");
+ break;
+ }
+ default:
+ {
+ int exCond;
+ int val;
+ if (!event.equals("32020-14.htm") && !event.equals("32020-15.htm"))
{
-
- int[] reward = REWARDS.get(event.substring(8, 9));
- if (st.getQuestItemsCount(reward[0]) >= reward[1])
+ if (event.startsWith("32020-17"))
{
- st.takeItems(reward[0], reward[1]);
- st.rewardItems(reward[2], 1);
+
+ int[] reward = REWARDS.get(event.substring(8, 9));
+ if (st.getQuestItemsCount(reward[0]) >= reward[1])
+ {
+ st.takeItems(reward[0], reward[1]);
+ st.rewardItems(reward[2], 1);
+ }
+ else
+ {
+ htmltext = "32020-15a.htm";
+ }
+ }
+ else if (!event.equals("32020-20.htm") && !event.equals("32020-22.htm"))
+ {
+ if (event.equals("32023-05.htm"))
+ {
+ if (st.getInt("exCond") == 0)
+ {
+ st.set("exCond", String.valueOf((Rnd.get(4) + 1) * 10));
+ }
+ }
+ else if (event.startsWith("32023-06-"))
+ {
+ exCond = st.getInt("exCond");
+ if (exCond > 0)
+ {
+ htmltext = "32023-06.htm";
+ st.set("exCond", String.valueOf(exCond + (event.endsWith("chisel") ? 1 : 2)));
+ st.playSound("ItemSound2.broken_key");
+ st.takeItems(8077, 1);
+ }
+ }
+ else if (event.startsWith("32023-07-"))
+ {
+ exCond = st.getInt("exCond");
+ if (exCond > 0)
+ {
+ val = exCond / 10;
+ if (val == ((exCond - (val * 10)) + (event.endsWith("knife") ? 0 : 2)))
+ {
+ htmltext = "32023-07.htm";
+ st.playSound("ItemSound3.sys_enchant_success");
+ st.rewardItems(8078, 1);
+ }
+ else
+ {
+ htmltext = "32023-08.htm";
+ st.playSound("ItemSound3.sys_enchant_failed");
+ }
+
+ st.set("exCond", "0");
+ }
+ }
}
else
{
- htmltext = "32020-15a.htm";
- }
- }
- else if (!event.equals("32020-20.htm") && !event.equals("32020-22.htm"))
- {
- if (event.equals("32023-05.htm"))
- {
- if (st.getInt("exCond") == 0)
- {
- st.set("exCond", String.valueOf((Rnd.get(4) + 1) * 10));
- }
- }
- else if (event.startsWith("32023-06-"))
- {
- exCond = st.getInt("exCond");
- if (exCond > 0)
- {
- htmltext = "32023-06.htm";
- st.set("exCond", String.valueOf(exCond + (event.endsWith("chisel") ? 1 : 2)));
- st.playSound("ItemSound2.broken_key");
- st.takeItems(8077, 1);
- }
- }
- else if (event.startsWith("32023-07-"))
- {
- exCond = st.getInt("exCond");
- if (exCond > 0)
- {
- val = exCond / 10;
- if (val == ((exCond - (val * 10)) + (event.endsWith("knife") ? 0 : 2)))
- {
- htmltext = "32023-07.htm";
- st.playSound("ItemSound3.sys_enchant_success");
- st.rewardItems(8078, 1);
- }
- else
- {
- htmltext = "32023-08.htm";
- st.playSound("ItemSound3.sys_enchant_failed");
- }
-
- st.set("exCond", "0");
- }
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
}
}
else
{
- st.playSound("ItemSound.quest_finish");
- st.exitQuest(true);
- }
- }
- else
- {
- exCond = st.getQuestItemsCount(8078);
- val = st.getQuestItemsCount(8077);
- if ((val + exCond) > 0)
- {
- st.takeItems(8078, -1);
- st.takeItems(8077, -1);
- st.rewardItems(57, (val * 300) + (exCond * 1200));
- }
- else
- {
- htmltext = "32020-16a.htm";
+ exCond = st.getQuestItemsCount(8078);
+ val = st.getQuestItemsCount(8077);
+ if ((val + exCond) > 0)
+ {
+ st.takeItems(8078, -1);
+ st.takeItems(8077, -1);
+ st.rewardItems(57, (val * 300) + (exCond * 1200));
+ }
+ else
+ {
+ htmltext = "32020-16a.htm";
+ }
}
+ break;
}
}
@@ -338,9 +237,9 @@ public class Q648_AnIceMerchantsDream extends Quest
if ((st2 != null) && st2.isCompleted())
{
htmltext = (hasItem) ? "32020-11.htm" : "32020-09.htm";
- if (st.getInt("cond") == 1)
+ if (st.isCond(1))
{
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
}
@@ -391,7 +290,7 @@ public class Q648_AnIceMerchantsDream extends Quest
final int[] chance = CHANCES.get(npc.getNpcId());
st.dropItems(SILVER_ICE_CRYSTAL, 1, 0, chance[0]);
- if ((st.getInt("cond") == 2) && (chance[1] > 0))
+ if (st.isCond(2) && (chance[1] > 0))
{
st.dropItems(SILVER_HEMOCYTE, 1, 0, chance[1]);
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q649_ALooterAndARailroadMan/Q649_ALooterAndARailroadMan.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q649_ALooterAndARailroadMan/Q649_ALooterAndARailroadMan.java
index fa2fe864f4..771905e465 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q649_ALooterAndARailroadMan/Q649_ALooterAndARailroadMan.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q649_ALooterAndARailroadMan/Q649_ALooterAndARailroadMan.java
@@ -24,21 +24,17 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q649_ALooterAndARailroadMan extends Quest
{
- // Item
- private static final int THIEF_GUILD_MARK = 8099;
-
// NPC
private static final int OBI = 32052;
+ // Item
+ private static final int THIEF_GUILD_MARK = 8099;
public Q649_ALooterAndARailroadMan()
{
super(649, "A Looter and a Railroad Man");
-
registerQuestItems(THIEF_GUILD_MARK);
-
addStartNpc(OBI);
addTalkId(OBI);
-
addKillId(22017, 22018, 22019, 22021, 22022, 22023, 22024, 22026);
}
@@ -54,9 +50,7 @@ public class Q649_ALooterAndARailroadMan extends Quest
if (event.equals("32052-1.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
}
else if (event.equals("32052-3.htm"))
{
@@ -89,11 +83,13 @@ public class Q649_ALooterAndARailroadMan extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 30) ? "32052-0a.htm" : "32052-0.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "32052-2a.htm";
@@ -103,6 +99,7 @@ public class Q649_ALooterAndARailroadMan extends Quest
htmltext = "32052-2.htm";
}
break;
+ }
}
return htmltext;
}
@@ -110,7 +107,7 @@ public class Q649_ALooterAndARailroadMan extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "1");
+ final QuestState st = checkPlayerCondition(player, npc, 1);
if (st == null)
{
return null;
@@ -118,7 +115,7 @@ public class Q649_ALooterAndARailroadMan extends Quest
if (st.dropItems(THIEF_GUILD_MARK, 1, 200, 800000))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q650_ABrokenDream/Q650_ABrokenDream.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q650_ABrokenDream/Q650_ABrokenDream.java
index 9341755145..4ffd71c1aa 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q650_ABrokenDream/Q650_ABrokenDream.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q650_ABrokenDream/Q650_ABrokenDream.java
@@ -28,20 +28,16 @@ public class Q650_ABrokenDream extends Quest
{
// NPC
private static final int GHOST = 32054;
-
- // Item
- private static final int DREAM_FRAGMENT = 8514;
-
// Monsters
private static final int CREWMAN = 22027;
private static final int VAGABOND = 22028;
+ // Item
+ private static final int DREAM_FRAGMENT = 8514;
public Q650_ABrokenDream()
{
super(650, "A Broken Dream");
-
registerQuestItems(DREAM_FRAGMENT);
-
addStartNpc(GHOST);
addTalkId(GHOST);
addKillId(CREWMAN, VAGABOND);
@@ -57,23 +53,27 @@ public class Q650_ABrokenDream extends Quest
return htmltext;
}
- if (event.equals("32054-01a.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("32054-03.htm"))
- {
- if (!st.hasQuestItems(DREAM_FRAGMENT))
+ case "32054-01a.htm":
{
- htmltext = "32054-04.htm";
+ st.startQuest();
+ break;
+ }
+ case "32054-03.htm":
+ {
+ if (!st.hasQuestItems(DREAM_FRAGMENT))
+ {
+ htmltext = "32054-04.htm";
+ }
+ break;
+ }
+ case "32054-05.htm":
+ {
+ st.playSound(QuestState.SOUND_GIVEUP);
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("32054-05.htm"))
- {
- st.playSound(QuestState.SOUND_GIVEUP);
- st.exitQuest(true);
}
return htmltext;
@@ -92,6 +92,7 @@ public class Q650_ABrokenDream extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
final QuestState st2 = player.getQuestState(Q117_TheOceanOfDistantStars.class.getSimpleName());
if ((st2 != null) && st2.isCompleted() && (player.getLevel() >= 39))
{
@@ -103,10 +104,12 @@ public class Q650_ABrokenDream extends Quest
st.exitQuest(true);
}
break;
-
+ }
case State.STARTED:
+ {
htmltext = "32054-02.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q651_RunawayYouth/Q651_RunawayYouth.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q651_RunawayYouth/Q651_RunawayYouth.java
index 746c0f579c..d5b383954e 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q651_RunawayYouth/Q651_RunawayYouth.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q651_RunawayYouth/Q651_RunawayYouth.java
@@ -30,10 +30,8 @@ public class Q651_RunawayYouth extends Quest
// NPCs
private static final int IVAN = 32014;
private static final int BATIDAE = 31989;
-
// Item
private static final int SCROLL_OF_ESCAPE = 736;
-
// Table of possible spawns
private static final Location[] SPAWNS =
{
@@ -41,17 +39,14 @@ public class Q651_RunawayYouth extends Quest
new Location(108380, -150268, -2376, 0),
new Location(123254, -148126, -3425, 0)
};
-
// Current position
private int _currentPosition = 0;
public Q651_RunawayYouth()
{
super(651, "Runaway Youth");
-
addStartNpc(IVAN);
addTalkId(IVAN, BATIDAE);
-
addSpawn(IVAN, 118600, -161235, -1119, 0, false, 0);
}
@@ -69,14 +64,11 @@ public class Q651_RunawayYouth extends Quest
{
if (st.hasQuestItems(SCROLL_OF_ESCAPE))
{
- htmltext = "32014-03.htm";
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.takeItems(SCROLL_OF_ESCAPE, 1);
-
npc.broadcastPacket(new MagicSkillUse(npc, npc, 2013, 1, 3500, 0));
startQuestTimer("apparition_npc", 4000, npc, player, false);
+ htmltext = "32014-03.htm";
}
else
{
@@ -117,24 +109,30 @@ public class Q651_RunawayYouth extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 26) ? "32014-01.htm" : "32014-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case BATIDAE:
+ {
htmltext = "31989-01.htm";
st.rewardItems(57, 2883);
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
break;
-
+ }
case IVAN:
+ {
htmltext = "32014-04a.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q652_AnAgedExAdventurer/Q652_AnAgedExAdventurer.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q652_AnAgedExAdventurer/Q652_AnAgedExAdventurer.java
index 3ad053b0cc..dbfc67d4e2 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q652_AnAgedExAdventurer/Q652_AnAgedExAdventurer.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q652_AnAgedExAdventurer/Q652_AnAgedExAdventurer.java
@@ -30,13 +30,10 @@ public class Q652_AnAgedExAdventurer extends Quest
// NPCs
private static final int TANTAN = 32012;
private static final int SARA = 30180;
-
// Item
private static final int SOULSHOT_C = 1464;
-
// Reward
private static final int ENCHANT_ARMOR_D = 956;
-
// Table of possible spawns
private static final Location[] SPAWNS =
{
@@ -46,17 +43,14 @@ public class Q652_AnAgedExAdventurer extends Quest
new Location(94500, -10129, -3290, 0),
new Location(96534, -1237, -3677, 0)
};
-
// Current position
private int _currentPosition = 0;
public Q652_AnAgedExAdventurer()
{
super(652, "An Aged Ex-Adventurer");
-
addStartNpc(TANTAN);
addTalkId(TANTAN, SARA);
-
addSpawn(TANTAN, 78355, -1325, -3659, 0, false, 0);
}
@@ -74,11 +68,8 @@ public class Q652_AnAgedExAdventurer extends Quest
{
if (st.getQuestItemsCount(SOULSHOT_C) >= 100)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.takeItems(SOULSHOT_C, 100);
-
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(85326, 7869, -3620));
startQuestTimer("apparition_npc", 6000, npc, player, false);
}
@@ -122,13 +113,16 @@ public class Q652_AnAgedExAdventurer extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 46) ? "32012-00.htm" : "32012-01.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case SARA:
+ {
if (Rnd.get(100) < 50)
{
htmltext = "30180-01.htm";
@@ -143,12 +137,15 @@ public class Q652_AnAgedExAdventurer extends Quest
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
break;
-
+ }
case TANTAN:
+ {
htmltext = "32012-04a.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q653_WildMaiden/Q653_WildMaiden.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q653_WildMaiden/Q653_WildMaiden.java
index 063fac421b..41d0d37fde 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q653_WildMaiden/Q653_WildMaiden.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q653_WildMaiden/Q653_WildMaiden.java
@@ -30,10 +30,8 @@ public class Q653_WildMaiden extends Quest
// NPCs
private static final int SUKI = 32013;
private static final int GALIBREDO = 30181;
-
// Item
private static final int SCROLL_OF_ESCAPE = 736;
-
// Table of possible spawns
private static final Location[] SPAWNS =
{
@@ -42,17 +40,14 @@ public class Q653_WildMaiden extends Quest
new Location(71809, 67377, -3675, 29130),
new Location(69166, 88825, -3447, 43886)
};
-
// Current position
private int _currentPosition = 0;
public Q653_WildMaiden()
{
super(653, "Wild Maiden");
-
addStartNpc(SUKI);
addTalkId(SUKI, GALIBREDO);
-
addSpawn(SUKI, 66578, 72351, -3731, 0, false, 0);
}
@@ -70,11 +65,8 @@ public class Q653_WildMaiden extends Quest
{
if (st.hasQuestItems(SCROLL_OF_ESCAPE))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
+ st.startQuest();
st.takeItems(SCROLL_OF_ESCAPE, 1);
-
npc.broadcastPacket(new MagicSkillUse(npc, npc, 2013, 1, 3500, 0));
startQuestTimer("apparition_npc", 4000, npc, player, false);
}
@@ -118,24 +110,30 @@ public class Q653_WildMaiden extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 36) ? "32013-01.htm" : "32013-02.htm";
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case GALIBREDO:
+ {
htmltext = "30181-01.htm";
st.rewardItems(57, 2883);
st.playSound(QuestState.SOUND_FINISH);
st.exitQuest(true);
break;
-
+ }
case SUKI:
+ {
htmltext = "32013-04a.htm";
break;
+ }
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q654_JourneyToASettlement/Q654_JourneyToASettlement.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q654_JourneyToASettlement/Q654_JourneyToASettlement.java
index bb7a4c4bb2..13620169e6 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q654_JourneyToASettlement/Q654_JourneyToASettlement.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q654_JourneyToASettlement/Q654_JourneyToASettlement.java
@@ -28,19 +28,15 @@ public class Q654_JourneyToASettlement extends Quest
{
// Item
private static final int ANTELOPE_SKIN = 8072;
-
// Reward
private static final int FORCE_FIELD_REMOVAL_SCROLL = 8073;
public Q654_JourneyToASettlement()
{
super(654, "Journey to a Settlement");
-
registerQuestItems(ANTELOPE_SKIN);
-
addStartNpc(31453); // Nameless Spirit
addTalkId(31453);
-
addKillId(21294, 21295); // Canyon Antelope, Canyon Antelope Slave
}
@@ -54,23 +50,27 @@ public class Q654_JourneyToASettlement extends Quest
return htmltext;
}
- if (event.equals("31453-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("31453-03.htm"))
- {
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_MIDDLE);
- }
- else if (event.equals("31453-06.htm"))
- {
- st.takeItems(ANTELOPE_SKIN, -1);
- st.giveItems(FORCE_FIELD_REMOVAL_SCROLL, 1);
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
+ case "31453-02.htm":
+ {
+ st.startQuest();
+ break;
+ }
+ case "31453-03.htm":
+ {
+ st.setCond(2);
+ st.playSound(QuestState.SOUND_MIDDLE);
+ break;
+ }
+ case "31453-06.htm":
+ {
+ st.takeItems(ANTELOPE_SKIN, -1);
+ st.giveItems(FORCE_FIELD_REMOVAL_SCROLL, 1);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
}
return htmltext;
@@ -89,12 +89,14 @@ public class Q654_JourneyToASettlement extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
final QuestState prevSt = player.getQuestState(Q119_LastImperialPrince.class.getSimpleName());
htmltext = ((prevSt == null) || !prevSt.isCompleted() || (player.getLevel() < 74)) ? "31453-00.htm" : "31453-01.htm";
break;
-
+ }
case State.STARTED:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31453-02.htm";
@@ -108,6 +110,7 @@ public class Q654_JourneyToASettlement extends Quest
htmltext = "31453-05.htm";
}
break;
+ }
}
return htmltext;
@@ -116,7 +119,7 @@ public class Q654_JourneyToASettlement extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final QuestState st = checkPlayerCondition(player, npc, "cond", "2");
+ final QuestState st = checkPlayerCondition(player, npc, 2);
if (st == null)
{
return null;
@@ -124,7 +127,7 @@ public class Q654_JourneyToASettlement extends Quest
if (st.dropItems(ANTELOPE_SKIN, 1, 1, 50000))
{
- st.set("cond", "3");
+ st.setCond(3);
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q655_AGrandPlanForTamingWildBeasts/Q655_AGrandPlanForTamingWildBeasts.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q655_AGrandPlanForTamingWildBeasts/Q655_AGrandPlanForTamingWildBeasts.java
index 5dd3a40f14..e1d85e4cb5 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q655_AGrandPlanForTamingWildBeasts/Q655_AGrandPlanForTamingWildBeasts.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q655_AGrandPlanForTamingWildBeasts/Q655_AGrandPlanForTamingWildBeasts.java
@@ -21,7 +21,6 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState;
-import org.l2jmobius.gameserver.model.quest.State;
/**
* @author Mobius
@@ -38,7 +37,6 @@ public class Q655_AGrandPlanForTamingWildBeasts extends Quest
public Q655_AGrandPlanForTamingWildBeasts()
{
super(655, "A Grand Plan for Taming Wild Beasts");
-
addStartNpc(MESSENGER);
addTalkId(MESSENGER);
}
@@ -55,9 +53,7 @@ public class Q655_AGrandPlanForTamingWildBeasts extends Quest
if (event.equals("a2.htm"))
{
- qs.set("cond", "1");
- qs.setState(State.STARTED);
- qs.playSound("ItemSound.quest_accept");
+ qs.startQuest();
}
else if (event.equals("a4.htm"))
{
@@ -65,7 +61,7 @@ public class Q655_AGrandPlanForTamingWildBeasts extends Quest
{
qs.takeItems(CRYSTAL_PURITY, -10);
qs.giveItems(LICENSE, 1);
- qs.set("cond", "3");
+ qs.setCond(3);
}
else
{
@@ -85,23 +81,26 @@ public class Q655_AGrandPlanForTamingWildBeasts extends Quest
return htmltext;
}
- final int npcId = npc.getNpcId();
- final int cond = qs.getInt("cond");
final Clan clan = player.getClan();
if (clan == null)
{
return "a6.htm";
}
+
if (clan.getLevel() < 4)
{
return "a6.htm";
}
- if (clan.getLeaderName() != player.getName())
+
+ if (!clan.getLeaderName().equals(player.getName()))
{
return "a6.htm";
}
+
+ final int npcId = npc.getNpcId();
if (npcId == MESSENGER)
{
+ final int cond = qs.getCond();
if (cond == 0)
{
htmltext = "a1.htm";
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q659_IdRatherBeCollectingFairyBreath/Q659_IdRatherBeCollectingFairyBreath.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q659_IdRatherBeCollectingFairyBreath/Q659_IdRatherBeCollectingFairyBreath.java
index 2012162f61..42d6dd30c0 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q659_IdRatherBeCollectingFairyBreath/Q659_IdRatherBeCollectingFairyBreath.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q659_IdRatherBeCollectingFairyBreath/Q659_IdRatherBeCollectingFairyBreath.java
@@ -26,24 +26,19 @@ public class Q659_IdRatherBeCollectingFairyBreath extends Quest
{
// NPCs
private static final int GALATEA = 30634;
-
- // Item
- private static final int FAIRY_BREATH = 8286;
-
// Monsters
private static final int SOBBING_WIND = 21023;
private static final int BABBLING_WIND = 21024;
private static final int GIGGLING_WIND = 21025;
+ // Item
+ private static final int FAIRY_BREATH = 8286;
public Q659_IdRatherBeCollectingFairyBreath()
{
super(659, "I'd Rather Be Collecting Fairy Breath");
-
registerQuestItems(FAIRY_BREATH);
-
addStartNpc(GALATEA);
addTalkId(GALATEA);
-
addKillId(GIGGLING_WIND, BABBLING_WIND, SOBBING_WIND);
}
@@ -57,31 +52,35 @@ public class Q659_IdRatherBeCollectingFairyBreath extends Quest
return htmltext;
}
- if (event.equals("30634-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30634-06.htm"))
- {
- final int count = st.getQuestItemsCount(FAIRY_BREATH);
- if (count > 0)
+ case "30634-03.htm":
{
- st.takeItems(FAIRY_BREATH, count);
- if (count < 10)
- {
- st.rewardItems(57, count * 50);
- }
- else
- {
- st.rewardItems(57, (count * 50) + 5365);
- }
+ st.startQuest();
+ break;
+ }
+ case "30634-06.htm":
+ {
+ final int count = st.getQuestItemsCount(FAIRY_BREATH);
+ if (count > 0)
+ {
+ st.takeItems(FAIRY_BREATH, count);
+ if (count < 10)
+ {
+ st.rewardItems(57, count * 50);
+ }
+ else
+ {
+ st.rewardItems(57, (count * 50) + 5365);
+ }
+ }
+ break;
+ }
+ case "30634-08.htm":
+ {
+ st.exitQuest(true);
+ break;
}
- }
- else if (event.equals("30634-08.htm"))
- {
- st.exitQuest(true);
}
return htmltext;
@@ -100,12 +99,15 @@ public class Q659_IdRatherBeCollectingFairyBreath extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 26) ? "30634-01.htm" : "30634-02.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (!st.hasQuestItems(FAIRY_BREATH)) ? "30634-04.htm" : "30634-05.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q660_AidingTheFloranVillage/Q660_AidingTheFloranVillage.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q660_AidingTheFloranVillage/Q660_AidingTheFloranVillage.java
index ed4700066e..64d7eeb057 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q660_AidingTheFloranVillage/Q660_AidingTheFloranVillage.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q660_AidingTheFloranVillage/Q660_AidingTheFloranVillage.java
@@ -28,13 +28,7 @@ public class Q660_AidingTheFloranVillage extends Quest
// NPCs
private static final int MARIA = 30608;
private static final int ALEX = 30291;
-
- // Items
- private static final int WATCHING_EYES = 8074;
- private static final int GOLEM_SHARD = 8075;
- private static final int LIZARDMEN_SCALE = 8076;
-
- // Mobs
+ // Monsters
private static final int PLAIN_WATCHMAN = 21102;
private static final int ROCK_GOLEM = 21103;
private static final int LIZARDMEN_SUPPLIER = 21104;
@@ -42,7 +36,10 @@ public class Q660_AidingTheFloranVillage extends Quest
private static final int CURSED_SEER = 21106;
private static final int LIZARDMEN_COMMANDER = 21107;
private static final int LIZARDMEN_SHAMAN = 20781;
-
+ // Items
+ private static final int WATCHING_EYES = 8074;
+ private static final int GOLEM_SHARD = 8075;
+ private static final int LIZARDMEN_SCALE = 8076;
// Rewards
private static final int ADENA = 57;
private static final int ENCHANT_WEAPON_D = 955;
@@ -51,12 +48,9 @@ public class Q660_AidingTheFloranVillage extends Quest
public Q660_AidingTheFloranVillage()
{
super(660, "Aiding the Floran Village");
-
registerQuestItems(WATCHING_EYES, LIZARDMEN_SCALE, GOLEM_SHARD);
-
addStartNpc(MARIA, ALEX);
addTalkId(MARIA, ALEX);
-
addKillId(CURSED_SEER, PLAIN_WATCHMAN, ROCK_GOLEM, LIZARDMEN_SHAMAN, LIZARDMEN_SUPPLIER, LIZARDMEN_COMMANDER, LIZARDMEN_AGENT);
}
@@ -70,120 +64,128 @@ public class Q660_AidingTheFloranVillage extends Quest
return htmltext;
}
- if (event.equals("30608-04.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30291-02.htm"))
- {
- if (player.getLevel() < 30)
+ case "30608-04.htm":
{
- htmltext = "30291-02a.htm";
+ st.startQuest();
+ break;
}
- else
+ case "30291-02.htm":
{
- st.setState(State.STARTED);
- st.set("cond", "2");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- }
- else if (event.equals("30291-05.htm"))
- {
- final int count = st.getQuestItemsCount(WATCHING_EYES) + st.getQuestItemsCount(LIZARDMEN_SCALE) + st.getQuestItemsCount(GOLEM_SHARD);
- if (count == 0)
- {
- htmltext = "30291-05a.htm";
- }
- else
- {
- st.takeItems(GOLEM_SHARD, -1);
- st.takeItems(LIZARDMEN_SCALE, -1);
- st.takeItems(WATCHING_EYES, -1);
- st.rewardItems(ADENA, (count * 100) + ((count >= 45) ? 9000 : 0));
- }
- }
- else if (event.equals("30291-06.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30291-11.htm"))
- {
- if (!verifyAndRemoveItems(st, 100))
- {
- htmltext = "30291-11a.htm";
- }
- else
- {
- if (Rnd.get(10) < 8)
+ if (player.getLevel() < 30)
{
- st.rewardItems(ADENA, 1000);
+ htmltext = "30291-02a.htm";
}
else
{
- st.rewardItems(ADENA, 13000);
- st.rewardItems(ENCHANT_ARMOR_D, 1);
+ st.startQuest();
+ st.setCond(2);
}
+ break;
}
- }
- else if (event.equals("30291-12.htm"))
- {
- if (!verifyAndRemoveItems(st, 200))
+ case "30291-05.htm":
{
- htmltext = "30291-12a.htm";
- }
- else
- {
- final int luck = Rnd.get(15);
- if (luck < 8)
+ final int count = st.getQuestItemsCount(WATCHING_EYES) + st.getQuestItemsCount(LIZARDMEN_SCALE) + st.getQuestItemsCount(GOLEM_SHARD);
+ if (count == 0)
{
- st.rewardItems(ADENA, 2000);
- }
- else if (luck < 12)
- {
- st.rewardItems(ADENA, 20000);
- st.rewardItems(ENCHANT_ARMOR_D, 1);
+ htmltext = "30291-05a.htm";
}
else
{
- st.rewardItems(ENCHANT_WEAPON_D, 1);
+ st.takeItems(GOLEM_SHARD, -1);
+ st.takeItems(LIZARDMEN_SCALE, -1);
+ st.takeItems(WATCHING_EYES, -1);
+ st.rewardItems(ADENA, (count * 100) + ((count >= 45) ? 9000 : 0));
}
+ break;
}
- }
- else if (event.equals("30291-13.htm"))
- {
- if (!verifyAndRemoveItems(st, 500))
+ case "30291-06.htm":
{
- htmltext = "30291-13a.htm";
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- else
+ case "30291-11.htm":
{
- if (Rnd.get(10) < 8)
+ if (!verifyAndRemoveItems(st, 100))
{
- st.rewardItems(ADENA, 5000);
+ htmltext = "30291-11a.htm";
}
else
{
- st.rewardItems(ADENA, 45000);
- st.rewardItems(ENCHANT_WEAPON_D, 1);
+ if (Rnd.get(10) < 8)
+ {
+ st.rewardItems(ADENA, 1000);
+ }
+ else
+ {
+ st.rewardItems(ADENA, 13000);
+ st.rewardItems(ENCHANT_ARMOR_D, 1);
+ }
}
+ break;
}
- }
- else if (event.equals("30291-17.htm"))
- {
- final int count = st.getQuestItemsCount(WATCHING_EYES) + st.getQuestItemsCount(LIZARDMEN_SCALE) + st.getQuestItemsCount(GOLEM_SHARD);
- if (count != 0)
+ case "30291-12.htm":
{
- htmltext = "30291-17a.htm";
- st.takeItems(WATCHING_EYES, -1);
- st.takeItems(LIZARDMEN_SCALE, -1);
- st.takeItems(GOLEM_SHARD, -1);
- st.rewardItems(ADENA, (count * 100) + ((count >= 45) ? 9000 : 0));
+ if (!verifyAndRemoveItems(st, 200))
+ {
+ htmltext = "30291-12a.htm";
+ }
+ else
+ {
+ final int luck = Rnd.get(15);
+ if (luck < 8)
+ {
+ st.rewardItems(ADENA, 2000);
+ }
+ else if (luck < 12)
+ {
+ st.rewardItems(ADENA, 20000);
+ st.rewardItems(ENCHANT_ARMOR_D, 1);
+ }
+ else
+ {
+ st.rewardItems(ENCHANT_WEAPON_D, 1);
+ }
+ }
+ break;
+ }
+ case "30291-13.htm":
+ {
+ if (!verifyAndRemoveItems(st, 500))
+ {
+ htmltext = "30291-13a.htm";
+ }
+ else
+ {
+ if (Rnd.get(10) < 8)
+ {
+ st.rewardItems(ADENA, 5000);
+ }
+ else
+ {
+ st.rewardItems(ADENA, 45000);
+ st.rewardItems(ENCHANT_WEAPON_D, 1);
+ }
+ }
+ break;
+ }
+ case "30291-17.htm":
+ {
+ final int count = st.getQuestItemsCount(WATCHING_EYES) + st.getQuestItemsCount(LIZARDMEN_SCALE) + st.getQuestItemsCount(GOLEM_SHARD);
+ if (count != 0)
+ {
+ htmltext = "30291-17a.htm";
+ st.takeItems(WATCHING_EYES, -1);
+ st.takeItems(LIZARDMEN_SCALE, -1);
+ st.takeItems(GOLEM_SHARD, -1);
+ st.rewardItems(ADENA, (count * 100) + ((count >= 45) ? 9000 : 0));
+ }
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -202,6 +204,7 @@ public class Q660_AidingTheFloranVillage extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
switch (npc.getNpcId())
{
case MARIA:
@@ -213,20 +216,23 @@ public class Q660_AidingTheFloranVillage extends Quest
break;
}
break;
-
+ }
case State.STARTED:
+ {
switch (npc.getNpcId())
{
case MARIA:
+ {
htmltext = "30608-06.htm";
break;
-
+ }
case ALEX:
- final int cond = st.getInt("cond");
+ {
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "30291-03.htm";
- st.set("cond", "2");
+ st.setCond(2);
st.playSound(QuestState.SOUND_MIDDLE);
}
else if (cond == 2)
@@ -234,8 +240,10 @@ public class Q660_AidingTheFloranVillage extends Quest
htmltext = (st.hasAtLeastOneQuestItem(WATCHING_EYES, LIZARDMEN_SCALE, GOLEM_SHARD)) ? "30291-04.htm" : "30291-05a.htm";
}
break;
+ }
}
break;
+ }
}
return htmltext;
@@ -244,7 +252,7 @@ public class Q660_AidingTheFloranVillage extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
- final PlayerInstance partyMember = getRandomPartyMember(player, npc, "2");
+ final PlayerInstance partyMember = getRandomPartyMember(player, npc, 2);
if (partyMember == null)
{
return null;
@@ -260,19 +268,23 @@ public class Q660_AidingTheFloranVillage extends Quest
{
case PLAIN_WATCHMAN:
case CURSED_SEER:
+ {
st.dropItems(WATCHING_EYES, 1, 0, 790000);
break;
-
+ }
case ROCK_GOLEM:
+ {
st.dropItems(GOLEM_SHARD, 1, 0, 750000);
break;
-
+ }
case LIZARDMEN_SHAMAN:
case LIZARDMEN_SUPPLIER:
case LIZARDMEN_AGENT:
case LIZARDMEN_COMMANDER:
+ {
st.dropItems(LIZARDMEN_SCALE, 1, 0, 670000);
break;
+ }
}
return null;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q661_MakingTheHarvestGroundsSafe/Q661_MakingTheHarvestGroundsSafe.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q661_MakingTheHarvestGroundsSafe/Q661_MakingTheHarvestGroundsSafe.java
index 5f15c0e49c..17ea5469f9 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q661_MakingTheHarvestGroundsSafe/Q661_MakingTheHarvestGroundsSafe.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q661_MakingTheHarvestGroundsSafe/Q661_MakingTheHarvestGroundsSafe.java
@@ -26,29 +26,23 @@ public class Q661_MakingTheHarvestGroundsSafe extends Quest
{
// NPC
private static final int NORMAN = 30210;
-
- // Items
- private static final int STING_OF_GIANT_POISON_BEE = 8283;
- private static final int CLOUDY_GEM = 8284;
- private static final int TALON_OF_YOUNG_ARANEID = 8285;
-
- // Reward
- private static final int ADENA = 57;
-
// Monsters
private static final int GIANT_POISON_BEE = 21095;
private static final int CLOUDY_BEAST = 21096;
private static final int YOUNG_ARANEID = 21097;
+ // Items
+ private static final int STING_OF_GIANT_POISON_BEE = 8283;
+ private static final int CLOUDY_GEM = 8284;
+ private static final int TALON_OF_YOUNG_ARANEID = 8285;
+ // Reward
+ private static final int ADENA = 57;
public Q661_MakingTheHarvestGroundsSafe()
{
super(661, "Making the Harvest Grounds Safe");
-
registerQuestItems(STING_OF_GIANT_POISON_BEE, CLOUDY_GEM, TALON_OF_YOUNG_ARANEID);
-
addStartNpc(NORMAN);
addTalkId(NORMAN);
-
addKillId(GIANT_POISON_BEE, CLOUDY_BEAST, YOUNG_ARANEID);
}
@@ -62,32 +56,35 @@ public class Q661_MakingTheHarvestGroundsSafe extends Quest
return htmltext;
}
- if (event.equals("30210-02.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30210-04.htm"))
- {
- final int item1 = st.getQuestItemsCount(STING_OF_GIANT_POISON_BEE);
- final int item2 = st.getQuestItemsCount(CLOUDY_GEM);
- final int item3 = st.getQuestItemsCount(TALON_OF_YOUNG_ARANEID);
- int sum = 0;
- sum = (item1 * 57) + (item2 * 56) + (item3 * 60);
- if ((item1 + item2 + item3) >= 10)
+ case "30210-02.htm":
{
- sum += 2871;
+ st.startQuest();
+ break;
+ }
+ case "30210-04.htm":
+ {
+ final int item1 = st.getQuestItemsCount(STING_OF_GIANT_POISON_BEE);
+ final int item2 = st.getQuestItemsCount(CLOUDY_GEM);
+ final int item3 = st.getQuestItemsCount(TALON_OF_YOUNG_ARANEID);
+ int sum = 0;
+ sum = (item1 * 57) + (item2 * 56) + (item3 * 60);
+ if ((item1 + item2 + item3) >= 10)
+ {
+ sum += 2871;
+ }
+ st.takeItems(STING_OF_GIANT_POISON_BEE, item1);
+ st.takeItems(CLOUDY_GEM, item2);
+ st.takeItems(TALON_OF_YOUNG_ARANEID, item3);
+ st.rewardItems(ADENA, sum);
+ break;
+ }
+ case "30210-06.htm":
+ {
+ st.exitQuest(true);
+ break;
}
-
- st.takeItems(STING_OF_GIANT_POISON_BEE, item1);
- st.takeItems(CLOUDY_GEM, item2);
- st.takeItems(TALON_OF_YOUNG_ARANEID, item3);
- st.rewardItems(ADENA, sum);
- }
- else if (event.equals("30210-06.htm"))
- {
- st.exitQuest(true);
}
return htmltext;
@@ -106,12 +103,15 @@ public class Q661_MakingTheHarvestGroundsSafe extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 21) ? "30210-01a.htm" : "30210-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (st.hasAtLeastOneQuestItem(STING_OF_GIANT_POISON_BEE, CLOUDY_GEM, TALON_OF_YOUNG_ARANEID)) ? "30210-03.htm" : "30210-05.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q662_AGameOfCards/Q662_AGameOfCards.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q662_AGameOfCards/Q662_AGameOfCards.java
index f9c1e0f698..488ff8de0d 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q662_AGameOfCards/Q662_AGameOfCards.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q662_AGameOfCards/Q662_AGameOfCards.java
@@ -32,10 +32,8 @@ public class Q662_AGameOfCards extends Quest
{
// NPC
private static final int KLUMP = 30845;
-
// Quest Item
private static final int RED_GEM = 8765;
-
// Reward Items
private static final int EW_S = 959;
private static final int EW_A = 729;
@@ -44,7 +42,6 @@ public class Q662_AGameOfCards extends Quest
private static final int EW_D = 955;
private static final int EA_D = 956;
private static final int ZIGGO_GEMSTONE = 8868;
-
// All cards
private static final Map CARDS = new HashMap<>();
static
@@ -65,7 +62,6 @@ public class Q662_AGameOfCards extends Quest
CARDS.put(13, "I");
CARDS.put(14, "N");
}
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -115,16 +111,10 @@ public class Q662_AGameOfCards extends Quest
public Q662_AGameOfCards()
{
super(662, "A Game of Cards");
-
registerQuestItems(RED_GEM);
-
addStartNpc(KLUMP);
addTalkId(KLUMP);
-
- for (int monster : CHANCES.keySet())
- {
- addKillId(monster);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -137,382 +127,384 @@ public class Q662_AGameOfCards extends Quest
return htmltext;
}
- if (event.equals("30845-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("state", "0");
- st.set("stateEx", "0");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30845-04.htm"))
- {
- final int state = st.getInt("state");
- final int stateEx = st.getInt("stateEx");
- if ((state == 0) && (stateEx == 0) && (st.getQuestItemsCount(RED_GEM) >= 50))
+ case "30845-03.htm":
{
- htmltext = "30845-05.htm";
- }
- }
- else if (event.equals("30845-07.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("30845-11.htm"))
- {
- final int state = st.getInt("state");
- final int stateEx = st.getInt("stateEx");
- if ((state == 0) && (stateEx == 0) && (st.getQuestItemsCount(RED_GEM) >= 50))
- {
- int i1 = Rnd.get(70) + 1;
- int i2 = Rnd.get(70) + 1;
- int i3 = Rnd.get(70) + 1;
- int i4 = Rnd.get(70) + 1;
- int i5 = Rnd.get(70) + 1;
- if (i1 >= 57)
- {
- i1 = i1 - 56;
- }
- else if (i1 >= 43)
- {
- i1 = i1 - 42;
- }
- else if (i1 >= 29)
- {
- i1 = i1 - 28;
- }
- else if (i1 >= 15)
- {
- i1 = i1 - 14;
- }
-
- if (i2 >= 57)
- {
- i2 = i2 - 56;
- }
- else if (i2 >= 43)
- {
- i2 = i2 - 42;
- }
- else if (i2 >= 29)
- {
- i2 = i2 - 28;
- }
- else if (i2 >= 15)
- {
- i2 = i2 - 14;
- }
-
- if (i3 >= 57)
- {
- i3 = i3 - 56;
- }
- else if (i3 >= 43)
- {
- i3 = i3 - 42;
- }
- else if (i3 >= 29)
- {
- i3 = i3 - 28;
- }
- else if (i3 >= 15)
- {
- i3 = i3 - 14;
- }
-
- if (i4 >= 57)
- {
- i4 = i4 - 56;
- }
- else if (i4 >= 43)
- {
- i4 = i4 - 42;
- }
- else if (i4 >= 29)
- {
- i4 = i4 - 28;
- }
- else if (i4 >= 15)
- {
- i4 = i4 - 14;
- }
-
- if (i5 >= 57)
- {
- i5 = i5 - 56;
- }
- else if (i5 >= 43)
- {
- i5 = i5 - 42;
- }
- else if (i5 >= 29)
- {
- i5 = i5 - 28;
- }
- else if (i5 >= 15)
- {
- i5 = i5 - 14;
- }
-
- st.set("state", String.valueOf((i4 * 1000000) + (i3 * 10000) + (i2 * 100) + i1));
- st.set("stateEx", String.valueOf(i5));
- st.takeItems(RED_GEM, 50);
- }
- }
- else if (event.equals("First") || event.equals("Second") || event.equals("Third") || event.equals("Fourth") || event.equals("Fifth")) // reply 11 12 13 14 15
- {
- final int state = st.getInt("state");
- final int stateEx = st.getInt("stateEx");
- int i0;
- int i1;
- int i2;
- int i3;
- int i4;
- int i5;
- int i6;
- int i8;
- int i9;
- i0 = state;
- i1 = stateEx;
- i5 = i1 % 100;
- i9 = i1 / 100;
- i1 = i0 % 100;
- i2 = (i0 % 10000) / 100;
- i3 = (i0 % 1000000) / 10000;
- i4 = (i0 % 100000000) / 1000000;
- if (event.equals("First"))
- {
- if ((i9 % 2) < 1)
- {
- i9 = i9 + 1;
- }
- }
- else if (event.equals("Second"))
- {
- if ((i9 % 4) < 2)
- {
- i9 = i9 + 2;
- }
- }
- else if (event.equals("Third"))
- {
- if ((i9 % 8) < 4)
- {
- i9 = i9 + 4;
- }
- }
- else if (event.equals("Fourth"))
- {
- if ((i9 % 16) < 8)
- {
- i9 = i9 + 8;
- }
- }
- else if (event.equals("Fifth"))
- {
- if ((i9 % 32) < 16)
- {
- i9 = i9 + 16;
- }
- }
-
- if ((i9 % 32) < 31)
- {
- st.set("stateEx", String.valueOf((i9 * 100) + i5));
- htmltext = getHtmlText("30845-12.htm");
- }
- else if ((i9 % 32) == 31)
- {
- i6 = 0;
- i8 = 0;
- if ((i1 >= 1) && (i1 <= 14) && (i2 >= 1) && (i2 <= 14) && (i3 >= 1) && (i3 <= 14) && (i4 >= 1) && (i4 <= 14) && (i5 >= 1) && (i5 <= 14))
- {
- if (i1 == i2)
- {
- i6 = i6 + 10;
- i8 = i8 + 8;
- }
-
- if (i1 == i3)
- {
- i6 = i6 + 10;
- i8 = i8 + 4;
- }
-
- if (i1 == i4)
- {
- i6 = i6 + 10;
- i8 = i8 + 2;
- }
-
- if (i1 == i5)
- {
- i6 = i6 + 10;
- i8 = i8 + 1;
- }
-
- if ((i6 % 100) < 10)
- {
- if ((i8 % 16) < 8)
- {
- if (((i8 % 8) < 4) && (i2 == i3))
- {
- i6 = i6 + 10;
- i8 = i8 + 4;
- }
-
- if (((i8 % 4) < 2) && (i2 == i4))
- {
- i6 = i6 + 10;
- i8 = i8 + 2;
- }
-
- if (((i8 % 2) < 1) && (i2 == i5))
- {
- i6 = i6 + 10;
- i8 = i8 + 1;
- }
- }
- }
- else if ((i6 % 10) == 0)
- {
- if ((i8 % 16) < 8)
- {
- if (((i8 % 8) < 4) && (i2 == i3))
- {
- i6 = i6 + 1;
- i8 = i8 + 4;
- }
-
- if (((i8 % 4) < 2) && (i2 == i4))
- {
- i6 = i6 + 1;
- i8 = i8 + 2;
- }
-
- if (((i8 % 2) < 1) && (i2 == i5))
- {
- i6 = i6 + 1;
- i8 = i8 + 1;
- }
- }
- }
-
- if ((i6 % 100) < 10)
- {
- if ((i8 % 8) < 4)
- {
- if (((i8 % 4) < 2) && (i3 == i4))
- {
- i6 = i6 + 10;
- i8 = i8 + 2;
- }
-
- if (((i8 % 2) < 1) && (i3 == i5))
- {
- i6 = i6 + 10;
- i8 = i8 + 1;
- }
- }
- }
- else if ((i6 % 10) == 0)
- {
- if ((i8 % 8) < 4)
- {
- if (((i8 % 4) < 2) && (i3 == i4))
- {
- i6 = i6 + 1;
- i8 = i8 + 2;
- }
-
- if (((i8 % 2) < 1) && (i3 == i5))
- {
- i6 = i6 + 1;
- i8 = i8 + 1;
- }
- }
- }
-
- if ((i6 % 100) < 10)
- {
- if ((i8 % 4) < 2)
- {
- if (((i8 % 2) < 1) && (i4 == i5))
- {
- i6 = i6 + 10;
- i8 = i8 + 1;
- }
- }
- }
- else if ((i6 % 10) == 0)
- {
- if ((i8 % 4) < 2)
- {
- if (((i8 % 2) < 1) && (i4 == i5))
- {
- i6 = i6 + 1;
- i8 = i8 + 1;
- }
- }
- }
- }
-
- if (i6 == 40)
- {
- giveReward(st, ZIGGO_GEMSTONE, 43);
- giveReward(st, EW_S, 3);
- giveReward(st, EW_A, 1);
- htmltext = getHtmlText("30845-13.htm");
- }
- else if (i6 == 30)
- {
- giveReward(st, EW_S, 2);
- giveReward(st, EW_C, 2);
- htmltext = getHtmlText("30845-14.htm");
- }
- else if ((i6 == 21) || (i6 == 12))
- {
- giveReward(st, EW_A, 1);
- giveReward(st, EW_B, 2);
- giveReward(st, EW_D, 1);
- htmltext = getHtmlText("30845-15.htm");
- }
- else if (i6 == 20)
- {
- giveReward(st, EW_C, 2);
- htmltext = getHtmlText("30845-16.htm");
- }
- else if (i6 == 11)
- {
- giveReward(st, EW_C, 1);
- htmltext = getHtmlText("30845-17.htm");
- }
- else if (i6 == 10)
- {
- giveReward(st, EA_D, 2);
- htmltext = getHtmlText("30845-18.htm");
- }
- else if (i6 == 0)
- {
- htmltext = getHtmlText("30845-19.htm");
- }
-
+ st.startQuest();
st.set("state", "0");
st.set("stateEx", "0");
+ break;
}
-
- htmltext = htmltext.replace("%FontColor1%", ((i9 % 2) < 1) ? "ffff00" : "ff6f6f").replace("%Cell1%", ((i9 % 2) < 1) ? CARDS.get(0) : CARDS.get(i1));
- htmltext = htmltext.replace("%FontColor2%", ((i9 % 4) < 2) ? "ffff00" : "ff6f6f").replace("%Cell2%", ((i9 % 4) < 2) ? CARDS.get(0) : CARDS.get(i2));
- htmltext = htmltext.replace("%FontColor3%", ((i9 % 8) < 4) ? "ffff00" : "ff6f6f").replace("%Cell3%", ((i9 % 8) < 4) ? CARDS.get(0) : CARDS.get(i3));
- htmltext = htmltext.replace("%FontColor4%", ((i9 % 16) < 8) ? "ffff00" : "ff6f6f").replace("%Cell4%", ((i9 % 16) < 8) ? CARDS.get(0) : CARDS.get(i4));
- htmltext = htmltext.replace("%FontColor5%", ((i9 % 32) < 16) ? "ffff00" : "ff6f6f").replace("%Cell5%", ((i9 % 32) < 16) ? CARDS.get(0) : CARDS.get(i5));
- }
- else if (event.equals("30845-20.htm")) // reply 20
- {
- if (st.getQuestItemsCount(RED_GEM) < 50)
+ case "30845-04.htm":
{
- htmltext = "30845-21.htm";
+ final int state = st.getInt("state");
+ final int stateEx = st.getInt("stateEx");
+ if ((state == 0) && (stateEx == 0) && (st.getQuestItemsCount(RED_GEM) >= 50))
+ {
+ htmltext = "30845-05.htm";
+ }
+ break;
+ }
+ case "30845-07.htm":
+ {
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "30845-11.htm":
+ {
+ final int state = st.getInt("state");
+ final int stateEx = st.getInt("stateEx");
+ if ((state == 0) && (stateEx == 0) && (st.getQuestItemsCount(RED_GEM) >= 50))
+ {
+ int i1 = Rnd.get(70) + 1;
+ int i2 = Rnd.get(70) + 1;
+ int i3 = Rnd.get(70) + 1;
+ int i4 = Rnd.get(70) + 1;
+ int i5 = Rnd.get(70) + 1;
+ if (i1 >= 57)
+ {
+ i1 = i1 - 56;
+ }
+ else if (i1 >= 43)
+ {
+ i1 = i1 - 42;
+ }
+ else if (i1 >= 29)
+ {
+ i1 = i1 - 28;
+ }
+ else if (i1 >= 15)
+ {
+ i1 = i1 - 14;
+ }
+
+ if (i2 >= 57)
+ {
+ i2 = i2 - 56;
+ }
+ else if (i2 >= 43)
+ {
+ i2 = i2 - 42;
+ }
+ else if (i2 >= 29)
+ {
+ i2 = i2 - 28;
+ }
+ else if (i2 >= 15)
+ {
+ i2 = i2 - 14;
+ }
+
+ if (i3 >= 57)
+ {
+ i3 = i3 - 56;
+ }
+ else if (i3 >= 43)
+ {
+ i3 = i3 - 42;
+ }
+ else if (i3 >= 29)
+ {
+ i3 = i3 - 28;
+ }
+ else if (i3 >= 15)
+ {
+ i3 = i3 - 14;
+ }
+
+ if (i4 >= 57)
+ {
+ i4 = i4 - 56;
+ }
+ else if (i4 >= 43)
+ {
+ i4 = i4 - 42;
+ }
+ else if (i4 >= 29)
+ {
+ i4 = i4 - 28;
+ }
+ else if (i4 >= 15)
+ {
+ i4 = i4 - 14;
+ }
+
+ if (i5 >= 57)
+ {
+ i5 = i5 - 56;
+ }
+ else if (i5 >= 43)
+ {
+ i5 = i5 - 42;
+ }
+ else if (i5 >= 29)
+ {
+ i5 = i5 - 28;
+ }
+ else if (i5 >= 15)
+ {
+ i5 = i5 - 14;
+ }
+
+ st.set("state", String.valueOf((i4 * 1000000) + (i3 * 10000) + (i2 * 100) + i1));
+ st.set("stateEx", String.valueOf(i5));
+ st.takeItems(RED_GEM, 50);
+ }
+ break;
+ }
+ case "First":
+ case "Second":
+ case "Third":
+ case "Fourth":
+ case "Fifth":
+ {
+ final int state = st.getInt("state");
+ final int stateEx = st.getInt("stateEx");
+ int i0;
+ int i1;
+ int i2;
+ int i3;
+ int i4;
+ int i5;
+ int i6;
+ int i8;
+ int i9;
+ i0 = state;
+ i1 = stateEx;
+ i5 = i1 % 100;
+ i9 = i1 / 100;
+ i1 = i0 % 100;
+ i2 = (i0 % 10000) / 100;
+ i3 = (i0 % 1000000) / 10000;
+ i4 = (i0 % 100000000) / 1000000;
+ switch (event)
+ {
+ case "First":
+ {
+ if ((i9 % 2) < 1)
+ {
+ i9 = i9 + 1;
+ }
+ break;
+ }
+ case "Second":
+ {
+ if ((i9 % 4) < 2)
+ {
+ i9 = i9 + 2;
+ }
+ break;
+ }
+ case "Third":
+ {
+ if ((i9 % 8) < 4)
+ {
+ i9 = i9 + 4;
+ }
+ break;
+ }
+ case "Fourth":
+ {
+ if ((i9 % 16) < 8)
+ {
+ i9 = i9 + 8;
+ }
+ break;
+ }
+ case "Fifth":
+ {
+ if ((i9 % 32) < 16)
+ {
+ i9 = i9 + 16;
+ }
+ break;
+ }
+ }
+ if ((i9 % 32) < 31)
+ {
+ st.set("stateEx", String.valueOf((i9 * 100) + i5));
+ htmltext = getHtmlText("30845-12.htm");
+ }
+ else if ((i9 % 32) == 31)
+ {
+ i6 = 0;
+ i8 = 0;
+ if ((i1 >= 1) && (i1 <= 14) && (i2 >= 1) && (i2 <= 14) && (i3 >= 1) && (i3 <= 14) && (i4 >= 1) && (i4 <= 14) && (i5 >= 1) && (i5 <= 14))
+ {
+ if (i1 == i2)
+ {
+ i6 = i6 + 10;
+ i8 = i8 + 8;
+ }
+
+ if (i1 == i3)
+ {
+ i6 = i6 + 10;
+ i8 = i8 + 4;
+ }
+
+ if (i1 == i4)
+ {
+ i6 = i6 + 10;
+ i8 = i8 + 2;
+ }
+
+ if (i1 == i5)
+ {
+ i6 = i6 + 10;
+ i8 = i8 + 1;
+ }
+
+ if ((i6 % 100) < 10)
+ {
+ if ((i8 % 16) < 8)
+ {
+ if (((i8 % 8) < 4) && (i2 == i3))
+ {
+ i6 = i6 + 10;
+ i8 = i8 + 4;
+ }
+
+ if (((i8 % 4) < 2) && (i2 == i4))
+ {
+ i6 = i6 + 10;
+ i8 = i8 + 2;
+ }
+
+ if (((i8 % 2) < 1) && (i2 == i5))
+ {
+ i6 = i6 + 10;
+ i8 = i8 + 1;
+ }
+ }
+ }
+ else if (((i6 % 10) == 0) && ((i8 % 16) < 8))
+ {
+ if (((i8 % 8) < 4) && (i2 == i3))
+ {
+ i6 = i6 + 1;
+ i8 = i8 + 4;
+ }
+
+ if (((i8 % 4) < 2) && (i2 == i4))
+ {
+ i6 = i6 + 1;
+ i8 = i8 + 2;
+ }
+
+ if (((i8 % 2) < 1) && (i2 == i5))
+ {
+ i6 = i6 + 1;
+ i8 = i8 + 1;
+ }
+ }
+
+ if ((i6 % 100) < 10)
+ {
+ if ((i8 % 8) < 4)
+ {
+ if (((i8 % 4) < 2) && (i3 == i4))
+ {
+ i6 = i6 + 10;
+ i8 = i8 + 2;
+ }
+
+ if (((i8 % 2) < 1) && (i3 == i5))
+ {
+ i6 = i6 + 10;
+ i8 = i8 + 1;
+ }
+ }
+ }
+ else if (((i6 % 10) == 0) && ((i8 % 8) < 4))
+ {
+ if (((i8 % 4) < 2) && (i3 == i4))
+ {
+ i6 = i6 + 1;
+ i8 = i8 + 2;
+ }
+
+ if (((i8 % 2) < 1) && (i3 == i5))
+ {
+ i6 = i6 + 1;
+ i8 = i8 + 1;
+ }
+ }
+
+ if ((i6 % 100) < 10)
+ {
+ if (((i8 % 4) < 2) && ((i8 % 2) < 1) && (i4 == i5))
+ {
+ i6 = i6 + 10;
+ i8 = i8 + 1;
+ }
+ }
+ else if (((i6 % 10) == 0) && ((i8 % 4) < 2) && ((i8 % 2) < 1) && (i4 == i5))
+ {
+ i6 = i6 + 1;
+ i8 = i8 + 1;
+ }
+ }
+
+ if (i6 == 40)
+ {
+ giveReward(st, ZIGGO_GEMSTONE, 43);
+ giveReward(st, EW_S, 3);
+ giveReward(st, EW_A, 1);
+ htmltext = getHtmlText("30845-13.htm");
+ }
+ else if (i6 == 30)
+ {
+ giveReward(st, EW_S, 2);
+ giveReward(st, EW_C, 2);
+ htmltext = getHtmlText("30845-14.htm");
+ }
+ else if ((i6 == 21) || (i6 == 12))
+ {
+ giveReward(st, EW_A, 1);
+ giveReward(st, EW_B, 2);
+ giveReward(st, EW_D, 1);
+ htmltext = getHtmlText("30845-15.htm");
+ }
+ else if (i6 == 20)
+ {
+ giveReward(st, EW_C, 2);
+ htmltext = getHtmlText("30845-16.htm");
+ }
+ else if (i6 == 11)
+ {
+ giveReward(st, EW_C, 1);
+ htmltext = getHtmlText("30845-17.htm");
+ }
+ else if (i6 == 10)
+ {
+ giveReward(st, EA_D, 2);
+ htmltext = getHtmlText("30845-18.htm");
+ }
+ else if (i6 == 0)
+ {
+ htmltext = getHtmlText("30845-19.htm");
+ }
+
+ st.set("state", "0");
+ st.set("stateEx", "0");
+ }
+ htmltext = htmltext.replace("%FontColor1%", ((i9 % 2) < 1) ? "ffff00" : "ff6f6f").replace("%Cell1%", ((i9 % 2) < 1) ? CARDS.get(0) : CARDS.get(i1));
+ htmltext = htmltext.replace("%FontColor2%", ((i9 % 4) < 2) ? "ffff00" : "ff6f6f").replace("%Cell2%", ((i9 % 4) < 2) ? CARDS.get(0) : CARDS.get(i2));
+ htmltext = htmltext.replace("%FontColor3%", ((i9 % 8) < 4) ? "ffff00" : "ff6f6f").replace("%Cell3%", ((i9 % 8) < 4) ? CARDS.get(0) : CARDS.get(i3));
+ htmltext = htmltext.replace("%FontColor4%", ((i9 % 16) < 8) ? "ffff00" : "ff6f6f").replace("%Cell4%", ((i9 % 16) < 8) ? CARDS.get(0) : CARDS.get(i4));
+ htmltext = htmltext.replace("%FontColor5%", ((i9 % 32) < 16) ? "ffff00" : "ff6f6f").replace("%Cell5%", ((i9 % 32) < 16) ? CARDS.get(0) : CARDS.get(i5));
+ break;
+ }
+ case "30845-20.htm":
+ {
+ if (st.getQuestItemsCount(RED_GEM) < 50)
+ {
+ htmltext = "30845-21.htm";
+ }
+ break;
}
}
@@ -532,10 +524,12 @@ public class Q662_AGameOfCards extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 61) ? "30845-02.htm" : "30845-01.htm";
break;
-
+ }
case State.STARTED:
+ {
final int state = st.getInt("state");
final int stateEx = st.getInt("stateEx");
if ((state == 0) && (stateEx == 0))
@@ -567,6 +561,7 @@ public class Q662_AGameOfCards extends Quest
htmltext = htmltext.replace("%FontColor5%", ((i9 % 32) < 16) ? "ffff00" : "ff6f6f").replace("%Cell5%", ((i9 % 32) < 16) ? CARDS.get(0) : CARDS.get(i5));
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q663_SeductiveWhispers/Q663_SeductiveWhispers.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q663_SeductiveWhispers/Q663_SeductiveWhispers.java
index 3ae99018a7..3c03b6a969 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q663_SeductiveWhispers/Q663_SeductiveWhispers.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q663_SeductiveWhispers/Q663_SeductiveWhispers.java
@@ -30,10 +30,8 @@ public class Q663_SeductiveWhispers extends Quest
{
// NPC
private static final int WILBERT = 30846;
-
// Quest item
private static final int SPIRIT_BEAD = 8766;
-
// Rewards
private static final int ADENA = 57;
private static final int ENCHANT_WEAPON_A = 729;
@@ -42,7 +40,6 @@ public class Q663_SeductiveWhispers extends Quest
private static final int ENCHANT_ARMOR_B = 948;
private static final int ENCHANT_WEAPON_C = 951;
private static final int ENCHANT_WEAPON_D = 955;
-
private static final int[] RECIPES =
{
2353,
@@ -56,7 +53,6 @@ public class Q663_SeductiveWhispers extends Quest
5006,
5007
};
-
private static final int[] BLADES =
{
2115,
@@ -70,7 +66,6 @@ public class Q663_SeductiveWhispers extends Quest
4120,
4121
};
-
// Text of cards
private static final Map CARDS = new HashMap<>();
static
@@ -87,7 +82,6 @@ public class Q663_SeductiveWhispers extends Quest
CARDS.put(24, " Moon Card: 4 ");
CARDS.put(25, " Moon Card: 5 ");
}
-
// Drop chances
private static final Map CHANCES = new HashMap<>();
static
@@ -124,16 +118,10 @@ public class Q663_SeductiveWhispers extends Quest
public Q663_SeductiveWhispers()
{
super(663, "Seductive Whispers");
-
registerQuestItems(SPIRIT_BEAD);
-
addStartNpc(WILBERT);
addTalkId(WILBERT);
-
- for (int npcId : CHANCES.keySet())
- {
- addKillId(npcId);
- }
+ addKillId(CHANCES.keySet());
}
@Override
@@ -147,283 +135,318 @@ public class Q663_SeductiveWhispers extends Quest
}
final int state = st.getInt("state");
- if (event.equals("30846-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.set("state", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("30846-09.htm") && ((state % 10) <= 4))
- {
- if ((state / 10) < 1)
+ case "30846-03.htm":
{
- if (st.getQuestItemsCount(SPIRIT_BEAD) >= 50)
- {
- st.takeItems(SPIRIT_BEAD, 50);
- st.set("state", "5");
- }
- else
- {
- htmltext = "30846-10.htm";
- }
+ st.startQuest();
+ st.set("state", "1");
+ break;
}
- else
+ case "30846-09.htm":
{
- st.set("state", String.valueOf(((state / 10) * 10) + 5));
- st.set("stateEx", "0");
- htmltext = "30846-09a.htm";
- }
- }
- else if (event.equals("30846-14.htm") && ((state % 10) == 5) && ((state / 1000) == 0))
- {
- final int i0 = st.getInt("stateEx");
- final int i1 = i0 % 10;
- final int i2 = (i0 - i1) / 10;
- final int param1 = Rnd.get(2) + 1;
- final int param2 = Rnd.get(5) + 1;
- final int i5 = state / 10;
- final int param3 = (param1 * 10) + param2;
- if (param1 == i2)
- {
- final int i3 = param2 + i1;
- if (((i3 % 5) == 0) && (i3 != 10))
+ if (((state % 10) <= 4))
{
- if (((state % 100) / 10) >= 7)
+ if ((state / 10) < 1)
{
- st.set("state", "4");
- st.rewardItems(ADENA, 2384000);
- st.rewardItems(ENCHANT_WEAPON_A, 1);
- st.rewardItems(ENCHANT_ARMOR_A, 1);
- st.rewardItems(ENCHANT_ARMOR_A, 1);
- htmltext = getHTML("30846-14.htm", i0, param3, player.getName());
+ if (st.getQuestItemsCount(SPIRIT_BEAD) >= 50)
+ {
+ st.takeItems(SPIRIT_BEAD, 50);
+ st.set("state", "5");
+ }
+ else
+ {
+ htmltext = "30846-10.htm";
+ }
}
else
{
- st.set("state", String.valueOf(((state / 10) * 10) + 7));
- htmltext = getHTML("30846-13.htm", i0, param3, player.getName()).replace("%wincount%", String.valueOf(i5 + 1));
+ st.set("state", String.valueOf(((state / 10) * 10) + 5));
+ st.set("stateEx", "0");
+ htmltext = "30846-09a.htm";
}
}
- else
- {
- st.set("state", String.valueOf(((state / 10) * 10) + 6));
- st.set("stateEx", String.valueOf(param3));
- htmltext = getHTML("30846-12.htm", i0, param3, player.getName());
- }
+ break;
}
- else
+ case "30846-14.htm":
{
- if ((param2 == 5) || (i1 == 5))
+ if (((state % 10) == 5) && ((state / 1000) == 0))
{
- if (((state % 100) / 10) >= 7)
+ final int i0 = st.getInt("stateEx");
+ final int i1 = i0 % 10;
+ final int i2 = (i0 - i1) / 10;
+ final int param1 = Rnd.get(2) + 1;
+ final int param2 = Rnd.get(5) + 1;
+ final int i5 = state / 10;
+ final int param3 = (param1 * 10) + param2;
+ if (param1 == i2)
{
- st.set("state", "4");
- st.rewardItems(ADENA, 2384000);
- st.rewardItems(ENCHANT_WEAPON_A, 1);
- st.rewardItems(ENCHANT_ARMOR_A, 1);
- st.rewardItems(ENCHANT_ARMOR_A, 1);
- htmltext = getHTML("30846-14.htm", i0, param3, player.getName());
+ final int i3 = param2 + i1;
+ if (((i3 % 5) == 0) && (i3 != 10))
+ {
+ if (((state % 100) / 10) >= 7)
+ {
+ st.set("state", "4");
+ st.rewardItems(ADENA, 2384000);
+ st.rewardItems(ENCHANT_WEAPON_A, 1);
+ st.rewardItems(ENCHANT_ARMOR_A, 1);
+ st.rewardItems(ENCHANT_ARMOR_A, 1);
+ htmltext = getHTML("30846-14.htm", i0, param3, player.getName());
+ }
+ else
+ {
+ st.set("state", String.valueOf(((state / 10) * 10) + 7));
+ htmltext = getHTML("30846-13.htm", i0, param3, player.getName()).replace("%wincount%", String.valueOf(i5 + 1));
+ }
+ }
+ else
+ {
+ st.set("state", String.valueOf(((state / 10) * 10) + 6));
+ st.set("stateEx", String.valueOf(param3));
+ htmltext = getHTML("30846-12.htm", i0, param3, player.getName());
+ }
}
else
{
- st.set("state", String.valueOf(((state / 10) * 10) + 7));
- htmltext = getHTML("30846-13.htm", i0, param3, player.getName()).replace("%wincount%", String.valueOf(i5 + 1));
+ if ((param2 == 5) || (i1 == 5))
+ {
+ if (((state % 100) / 10) >= 7)
+ {
+ st.set("state", "4");
+ st.rewardItems(ADENA, 2384000);
+ st.rewardItems(ENCHANT_WEAPON_A, 1);
+ st.rewardItems(ENCHANT_ARMOR_A, 1);
+ st.rewardItems(ENCHANT_ARMOR_A, 1);
+ htmltext = getHTML("30846-14.htm", i0, param3, player.getName());
+ }
+ else
+ {
+ st.set("state", String.valueOf(((state / 10) * 10) + 7));
+ htmltext = getHTML("30846-13.htm", i0, param3, player.getName()).replace("%wincount%", String.valueOf(i5 + 1));
+ }
+ }
+ else
+ {
+ st.set("state", String.valueOf(((state / 10) * 10) + 6));
+ st.set("stateEx", String.valueOf((param1 * 10) + param2));
+ htmltext = getHTML("30846-12.htm", i0, param3, player.getName());
+ }
}
}
- else
- {
- st.set("state", String.valueOf(((state / 10) * 10) + 6));
- st.set("stateEx", String.valueOf((param1 * 10) + param2));
- htmltext = getHTML("30846-12.htm", i0, param3, player.getName());
- }
+ break;
}
- }
- else if (event.equals("30846-19.htm") && ((state % 10) == 6) && ((state / 1000) == 0))
- {
- final int i0 = st.getInt("stateEx");
- final int i1 = i0 % 10;
- final int i2 = (i0 - i1) / 10;
- final int param1 = Rnd.get(2) + 1;
- final int param2 = Rnd.get(5) + 1;
- final int param3 = (param1 * 10) + param2;
- if (param1 == i2)
+ case "30846-19.htm":
{
- final int i3 = param1 + i1;
- if (((i3 % 5) == 0) && (i3 != 10))
+ if (((state % 10) == 6) && ((state / 1000) == 0))
{
+ final int i0 = st.getInt("stateEx");
+ final int i1 = i0 % 10;
+ final int i2 = (i0 - i1) / 10;
+ final int param1 = Rnd.get(2) + 1;
+ final int param2 = Rnd.get(5) + 1;
+ final int param3 = (param1 * 10) + param2;
+ if (param1 == i2)
+ {
+ final int i3 = param1 + i1;
+ if (((i3 % 5) == 0) && (i3 != 10))
+ {
+ st.set("state", "1");
+ st.set("stateEx", "0");
+ htmltext = getHTML("30846-19.htm", i0, param3, player.getName());
+ }
+ else
+ {
+ st.set("state", String.valueOf(((state / 10) * 10) + 5));
+ st.set("stateEx", String.valueOf(param3));
+ htmltext = getHTML("30846-18.htm", i0, param3, player.getName());
+ }
+ }
+ else
+ {
+ if ((param2 == 5) || (i1 == 5))
+ {
+ st.set("state", "1");
+ htmltext = getHTML("30846-19.htm", i0, param3, player.getName());
+ }
+ else
+ {
+ st.set("state", String.valueOf(((state / 10) * 10) + 5));
+ st.set("stateEx", String.valueOf(param3));
+ htmltext = getHTML("30846-18.htm", i0, param3, player.getName());
+ }
+ }
+ }
+ break;
+ }
+ case "30846-20.htm":
+ {
+ if (((state % 10) == 7) && ((state / 1000) == 0))
+ {
+ st.set("state", String.valueOf((((state / 10) + 1) * 10) + 4));
+ st.set("stateEx", "0");
+ }
+ break;
+ }
+ case "30846-21.htm":
+ {
+ if (((state % 10) == 7) && ((state / 1000) == 0))
+ {
+ final int round = state / 10;
+ if (round == 0)
+ {
+ st.rewardItems(ADENA, 40000);
+ }
+ else if (round == 1)
+ {
+ st.rewardItems(ADENA, 80000);
+ }
+ else if (round == 2)
+ {
+ st.rewardItems(ADENA, 110000);
+ st.rewardItems(ENCHANT_WEAPON_D, 1);
+ }
+ else if (round == 3)
+ {
+ st.rewardItems(ADENA, 199000);
+ st.rewardItems(ENCHANT_WEAPON_C, 1);
+ }
+ else if (round == 4)
+ {
+ st.rewardItems(ADENA, 388000);
+ st.rewardItems(RECIPES[Rnd.get(RECIPES.length)], 1);
+ }
+ else if (round == 5)
+ {
+ st.rewardItems(ADENA, 675000);
+ st.rewardItems(BLADES[Rnd.get(BLADES.length)], 1);
+ }
+ else if (round == 6)
+ {
+ st.rewardItems(ADENA, 1284000);
+ st.rewardItems(ENCHANT_WEAPON_B, 1);
+ st.rewardItems(ENCHANT_ARMOR_B, 1);
+ st.rewardItems(ENCHANT_WEAPON_B, 1);
+ st.rewardItems(ENCHANT_ARMOR_B, 1);
+ }
+
st.set("state", "1");
st.set("stateEx", "0");
- htmltext = getHTML("30846-19.htm", i0, param3, player.getName());
}
- else
+ break;
+ }
+ case "30846-22.htm":
+ {
+ if ((state % 10) == 1)
{
- st.set("state", String.valueOf(((state / 10) * 10) + 5));
- st.set("stateEx", String.valueOf(param3));
- htmltext = getHTML("30846-18.htm", i0, param3, player.getName());
+ if (st.hasQuestItems(SPIRIT_BEAD))
+ {
+ st.set("state", "1005");
+ st.takeItems(SPIRIT_BEAD, 1);
+ }
+ else
+ {
+ htmltext = "30846-22a.htm";
+ }
}
+ break;
}
- else
+ case "30846-25.htm":
{
- if ((param2 == 5) || (i1 == 5))
+ if (state == 1005)
{
- st.set("state", "1");
- htmltext = getHTML("30846-19.htm", i0, param3, player.getName());
+ final int i0 = st.getInt("stateEx");
+ final int i1 = i0 % 10;
+ final int i2 = (i0 - i1) / 10;
+ final int param1 = Rnd.get(2) + 1;
+ final int param2 = Rnd.get(5) + 1;
+ final int param3 = (param1 * 10) + param2;
+ if (param1 == i2)
+ {
+ final int i3 = param2 + i1;
+ if (((i3 % 5) == 0) && (i3 != 10))
+ {
+ st.set("state", "1");
+ st.set("stateEx", "0");
+ st.rewardItems(ADENA, 800);
+ htmltext = getHTML("30846-25.htm", i0, param3, player.getName()).replace("%card1%", String.valueOf(i1));
+ }
+ else
+ {
+ st.set("state", "1006");
+ st.set("stateEx", String.valueOf(param3));
+ htmltext = getHTML("30846-24.htm", i0, param3, player.getName());
+ }
+ }
+ else
+ {
+ if ((param2 == 5) || (i2 == 5))
+ {
+ st.set("state", "1");
+ st.set("stateEx", "0");
+ st.rewardItems(ADENA, 800);
+ htmltext = getHTML("30846-25.htm", i0, param3, player.getName()).replace("%card1%", String.valueOf(i1));
+ }
+ else
+ {
+ st.set("state", "1006");
+ st.set("stateEx", String.valueOf(param3));
+ htmltext = getHTML("30846-24.htm", i0, param3, player.getName());
+ }
+ }
}
- else
+ break;
+ }
+ case "30846-29.htm":
+ {
+ if (state == 1006)
{
- st.set("state", String.valueOf(((state / 10) * 10) + 5));
- st.set("stateEx", String.valueOf(param3));
- htmltext = getHTML("30846-18.htm", i0, param3, player.getName());
+ final int i0 = st.getInt("stateEx");
+ final int i1 = i0 % 10;
+ final int i2 = (i0 - i1) / 10;
+ final int param1 = Rnd.get(2) + 1;
+ final int param2 = Rnd.get(5) + 1;
+ final int param3 = (param1 * 10) + param2;
+ if (param1 == i2)
+ {
+ final int i3 = param2 + i1;
+ if (((i3 % 5) == 0) && (i3 != 10))
+ {
+ st.set("state", "1");
+ st.set("stateEx", "0");
+ st.rewardItems(ADENA, 800);
+ htmltext = getHTML("30846-29.htm", i0, param3, player.getName()).replace("%card1%", String.valueOf(i1));
+ }
+ else
+ {
+ st.set("state", "1005");
+ st.set("stateEx", String.valueOf(param3));
+ htmltext = getHTML("30846-28.htm", i0, param3, player.getName());
+ }
+ }
+ else
+ {
+ if ((param2 == 5) || (i1 == 5))
+ {
+ st.set("state", "1");
+ st.set("stateEx", "0");
+ htmltext = getHTML("30846-29.htm", i0, param3, player.getName());
+ }
+ else
+ {
+ st.set("state", "1005");
+ st.set("stateEx", String.valueOf(param3));
+ htmltext = getHTML("30846-28.htm", i0, param3, player.getName());
+ }
+ }
}
+ break;
}
- }
- else if (event.equals("30846-20.htm") && ((state % 10) == 7) && ((state / 1000) == 0))
- {
- st.set("state", String.valueOf((((state / 10) + 1) * 10) + 4));
- st.set("stateEx", "0");
- }
- else if (event.equals("30846-21.htm") && ((state % 10) == 7) && ((state / 1000) == 0))
- {
- final int round = state / 10;
- if (round == 0)
+ case "30846-30.htm":
{
- st.rewardItems(ADENA, 40000);
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
}
- else if (round == 1)
- {
- st.rewardItems(ADENA, 80000);
- }
- else if (round == 2)
- {
- st.rewardItems(ADENA, 110000);
- st.rewardItems(ENCHANT_WEAPON_D, 1);
- }
- else if (round == 3)
- {
- st.rewardItems(ADENA, 199000);
- st.rewardItems(ENCHANT_WEAPON_C, 1);
- }
- else if (round == 4)
- {
- st.rewardItems(ADENA, 388000);
- st.rewardItems(RECIPES[Rnd.get(RECIPES.length)], 1);
- }
- else if (round == 5)
- {
- st.rewardItems(ADENA, 675000);
- st.rewardItems(BLADES[Rnd.get(BLADES.length)], 1);
- }
- else if (round == 6)
- {
- st.rewardItems(ADENA, 1284000);
- st.rewardItems(ENCHANT_WEAPON_B, 1);
- st.rewardItems(ENCHANT_ARMOR_B, 1);
- st.rewardItems(ENCHANT_WEAPON_B, 1);
- st.rewardItems(ENCHANT_ARMOR_B, 1);
- }
-
- st.set("state", "1");
- st.set("stateEx", "0");
- }
- else if (event.equals("30846-22.htm") && ((state % 10) == 1))
- {
- if (st.hasQuestItems(SPIRIT_BEAD))
- {
- st.set("state", "1005");
- st.takeItems(SPIRIT_BEAD, 1);
- }
- else
- {
- htmltext = "30846-22a.htm";
- }
- }
- else if (event.equals("30846-25.htm") && (state == 1005))
- {
- final int i0 = st.getInt("stateEx");
- final int i1 = i0 % 10;
- final int i2 = (i0 - i1) / 10;
- final int param1 = Rnd.get(2) + 1;
- final int param2 = Rnd.get(5) + 1;
- final int param3 = (param1 * 10) + param2;
- if (param1 == i2)
- {
- final int i3 = param2 + i1;
- if (((i3 % 5) == 0) && (i3 != 10))
- {
- st.set("state", "1");
- st.set("stateEx", "0");
- st.rewardItems(ADENA, 800);
- htmltext = getHTML("30846-25.htm", i0, param3, player.getName()).replace("%card1%", String.valueOf(i1));
- }
- else
- {
- st.set("state", "1006");
- st.set("stateEx", String.valueOf(param3));
- htmltext = getHTML("30846-24.htm", i0, param3, player.getName());
- }
- }
- else
- {
- if ((param2 == 5) || (i2 == 5))
- {
- st.set("state", "1");
- st.set("stateEx", "0");
- st.rewardItems(ADENA, 800);
- htmltext = getHTML("30846-25.htm", i0, param3, player.getName()).replace("%card1%", String.valueOf(i1));
- }
- else
- {
- st.set("state", "1006");
- st.set("stateEx", String.valueOf(param3));
- htmltext = getHTML("30846-24.htm", i0, param3, player.getName());
- }
- }
- }
- else if (event.equals("30846-29.htm") && (state == 1006))
- {
- final int i0 = st.getInt("stateEx");
- final int i1 = i0 % 10;
- final int i2 = (i0 - i1) / 10;
- final int param1 = Rnd.get(2) + 1;
- final int param2 = Rnd.get(5) + 1;
- final int param3 = (param1 * 10) + param2;
- if (param1 == i2)
- {
- final int i3 = param2 + i1;
- if (((i3 % 5) == 0) && (i3 != 10))
- {
- st.set("state", "1");
- st.set("stateEx", "0");
- st.rewardItems(ADENA, 800);
- htmltext = getHTML("30846-29.htm", i0, param3, player.getName()).replace("%card1%", String.valueOf(i1));
- }
- else
- {
- st.set("state", "1005");
- st.set("stateEx", String.valueOf(param3));
- htmltext = getHTML("30846-28.htm", i0, param3, player.getName());
- }
- }
- else
- {
- if ((param2 == 5) || (i1 == 5))
- {
- st.set("state", "1");
- st.set("stateEx", "0");
- htmltext = getHTML("30846-29.htm", i0, param3, player.getName());
- }
- else
- {
- st.set("state", "1005");
- st.set("stateEx", String.valueOf(param3));
- htmltext = getHTML("30846-28.htm", i0, param3, player.getName());
- }
- }
- }
- else if (event.equals("30846-30.htm"))
- {
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
}
return htmltext;
@@ -442,10 +465,12 @@ public class Q663_SeductiveWhispers extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 50) ? "30846-02.htm" : "30846-01.htm";
break;
-
+ }
case State.STARTED:
+ {
final int state = st.getInt("state");
if (state < 4)
{
@@ -495,6 +520,7 @@ public class Q663_SeductiveWhispers extends Quest
htmltext = "30846-26.htm";
}
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q688_DefeatTheElrokianRaiders/Q688_DefeatTheElrokianRaiders.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q688_DefeatTheElrokianRaiders/Q688_DefeatTheElrokianRaiders.java
index cdf655ace9..71582d3b95 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q688_DefeatTheElrokianRaiders/Q688_DefeatTheElrokianRaiders.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q688_DefeatTheElrokianRaiders/Q688_DefeatTheElrokianRaiders.java
@@ -24,24 +24,19 @@ import org.l2jmobius.gameserver.model.quest.State;
public class Q688_DefeatTheElrokianRaiders extends Quest
{
- // Item
- private static final int DINOSAUR_FANG_NECKLACE = 8785;
-
// NPC
private static final int DINN = 32105;
-
// Monster
private static final int ELROKI = 22214;
+ // Item
+ private static final int DINOSAUR_FANG_NECKLACE = 8785;
public Q688_DefeatTheElrokianRaiders()
{
super(688, "Defeat the Elrokian Raiders!");
-
registerQuestItems(DINOSAUR_FANG_NECKLACE);
-
addStartNpc(DINN);
addTalkId(DINN);
-
addKillId(ELROKI);
}
@@ -55,40 +50,45 @@ public class Q688_DefeatTheElrokianRaiders extends Quest
return htmltext;
}
- if (event.equals("32105-03.htm"))
+ switch (event)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- st.playSound(QuestState.SOUND_ACCEPT);
- }
- else if (event.equals("32105-08.htm"))
- {
- final int count = st.getQuestItemsCount(DINOSAUR_FANG_NECKLACE);
- if (count > 0)
+ case "32105-03.htm":
{
+ st.startQuest();
+ break;
+ }
+ case "32105-08.htm":
+ {
+ final int count = st.getQuestItemsCount(DINOSAUR_FANG_NECKLACE);
+ if (count > 0)
+ {
+ st.takeItems(DINOSAUR_FANG_NECKLACE, -1);
+ st.rewardItems(57, count * 3000);
+ }
+ st.playSound(QuestState.SOUND_FINISH);
+ st.exitQuest(true);
+ break;
+ }
+ case "32105-06.htm":
+ {
+ final int count = st.getQuestItemsCount(DINOSAUR_FANG_NECKLACE);
st.takeItems(DINOSAUR_FANG_NECKLACE, -1);
st.rewardItems(57, count * 3000);
+ break;
}
- st.playSound(QuestState.SOUND_FINISH);
- st.exitQuest(true);
- }
- else if (event.equals("32105-06.htm"))
- {
- final int count = st.getQuestItemsCount(DINOSAUR_FANG_NECKLACE);
- st.takeItems(DINOSAUR_FANG_NECKLACE, -1);
- st.rewardItems(57, count * 3000);
- }
- else if (event.equals("32105-07.htm"))
- {
- final int count = st.getQuestItemsCount(DINOSAUR_FANG_NECKLACE);
- if (count >= 100)
+ case "32105-07.htm":
{
- st.takeItems(DINOSAUR_FANG_NECKLACE, 100);
- st.rewardItems(57, 450000);
- }
- else
- {
- htmltext = "32105-04.htm";
+ final int count = st.getQuestItemsCount(DINOSAUR_FANG_NECKLACE);
+ if (count >= 100)
+ {
+ st.takeItems(DINOSAUR_FANG_NECKLACE, 100);
+ st.rewardItems(57, 450000);
+ }
+ else
+ {
+ htmltext = "32105-04.htm";
+ }
+ break;
}
}
@@ -108,12 +108,15 @@ public class Q688_DefeatTheElrokianRaiders extends Quest
switch (st.getState())
{
case State.CREATED:
+ {
htmltext = (player.getLevel() < 75) ? "32105-00.htm" : "32105-01.htm";
break;
-
+ }
case State.STARTED:
+ {
htmltext = (!st.hasQuestItems(DINOSAUR_FANG_NECKLACE)) ? "32105-04.htm" : "32105-05.htm";
break;
+ }
}
return htmltext;
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/SagasSuperClass.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/SagasSuperClass.java
index 828cb2db32..b7e32f3069 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/SagasSuperClass.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/SagasSuperClass.java
@@ -238,9 +238,7 @@ public class SagasSuperClass extends Quest
}
else if (event.equals("accept"))
{
- st.set("cond", "1");
- st.setState(State.STARTED);
- st.playSound("ItemSound.quest_accept");
+ st.startQuest();
st.giveItems(_items[10], 1);
htmltext = "0-03.htm";
}
@@ -263,8 +261,8 @@ public class SagasSuperClass extends Quest
{
if (player.getLevel() >= 76)
{
+ st.setCond(0);
st.exitQuest(false);
- st.set("cond", "0");
htmltext = "0-07.htm";
st.takeItems(_items[10], -1);
st.rewardExpAndSp(2299404, 0);
@@ -290,19 +288,19 @@ public class SagasSuperClass extends Quest
else
{
st.takeItems(_items[10], -1);
- st.playSound("ItemSound.quest_middle");
- st.set("cond", "20");
+ st.playSound(QuestState.SOUND_MIDDLE);
+ st.setCond(20);
htmltext = "0-08.htm";
}
}
else if (event.equals("1-3"))
{
- st.set("cond", "3");
+ st.setCond(3);
htmltext = "1-05.htm";
}
else if (event.equals("1-4"))
{
- st.set("cond", "4");
+ st.setCond(4);
st.takeItems(_items[0], 1);
if (_items[11] != 0)
{
@@ -313,12 +311,12 @@ public class SagasSuperClass extends Quest
}
else if (event.equals("2-1"))
{
- st.set("cond", "2");
+ st.setCond(2);
htmltext = "2-05.htm";
}
else if (event.equals("2-2"))
{
- st.set("cond", "5");
+ st.setCond(5);
st.takeItems(_items[1], 1);
st.giveItems(_items[4], 1);
htmltext = "2-06.htm";
@@ -329,17 +327,17 @@ public class SagasSuperClass extends Quest
}
else if (event.equals("3-6"))
{
- st.set("cond", "11");
+ st.setCond(11);
htmltext = "3-02.htm";
}
else if (event.equals("3-7"))
{
- st.set("cond", "12");
+ st.setCond(12);
htmltext = "3-03.htm";
}
else if (event.equals("3-8"))
{
- st.set("cond", "13");
+ st.setCond(13);
st.takeItems(_items[2], 1);
st.giveItems(_items[7], 1);
htmltext = "3-08.htm";
@@ -351,35 +349,35 @@ public class SagasSuperClass extends Quest
else if (event.equals("4-2"))
{
st.giveItems(_items[9], 1);
- st.set("cond", "18");
- st.playSound("ItemSound.quest_middle");
+ st.setCond(18);
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "4-011.htm";
}
else if (event.equals("4-3"))
{
st.giveItems(_items[9], 1);
- st.set("cond", "18");
+ st.setCond(18);
npc.broadcastNpcSay(_text[13].replace("PLAYERNAME", player.getName()));
st.set("Quest0", "0");
cancelQuestTimer("Mob_2 has despawned", npc, player);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
deleteSpawn(npc);
return null;
}
else if (event.equals("5-1"))
{
- st.set("cond", "6");
+ st.setCond(6);
st.takeItems(_items[4], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "5-02.htm";
}
else if (event.equals("6-1"))
{
- st.set("cond", "8");
+ st.setCond(8);
st.takeItems(_items[5], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "6-03.htm";
}
else if (event.equals("7-1"))
@@ -404,26 +402,26 @@ public class SagasSuperClass extends Quest
}
else if (event.equals("7-2"))
{
- st.set("cond", "10");
+ st.setCond(10);
st.takeItems(_items[6], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "7-06.htm";
}
else if (event.equals("8-1"))
{
- st.set("cond", "14");
+ st.setCond(14);
st.takeItems(_items[7], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "8-02.htm";
}
else if (event.equals("9-1"))
{
- st.set("cond", "17");
+ st.setCond(17);
st.takeItems(_items[8], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "9-03.htm";
}
else if (event.equals("10-1"))
@@ -454,15 +452,15 @@ public class SagasSuperClass extends Quest
}
else if (event.equals("10-2"))
{
- st.set("cond", "19");
+ st.setCond(19);
st.takeItems(_items[9], 1);
Cast(npc, player, 4546, 1);
- st.playSound("ItemSound.quest_middle");
+ st.playSound(QuestState.SOUND_MIDDLE);
htmltext = "10-06.htm";
}
else if (event.equals("11-9"))
{
- st.set("cond", "15");
+ st.setCond(15);
htmltext = "11-03.htm";
}
else if (event.equals("Mob_1 Timer 1"))
@@ -580,7 +578,7 @@ public class SagasSuperClass extends Quest
}
else if (st.getPlayer().getClassId().getId() == getPrevClass(st.getPlayer()))
{
- switch (st.getInt("cond"))
+ switch (st.getCond())
{
case 0:
{
@@ -803,8 +801,8 @@ public class SagasSuperClass extends Quest
htmltext = "0-09.htm";
if ((getClassId(st.getPlayer()) < 131) || (getClassId(st.getPlayer()) > 135)) // in Kamael quests, npc wants to chat for a bit before changing class
{
+ st.setCond(0);
st.exitQuest(false);
- st.set("cond", "0");
st.rewardExpAndSp(2299404, 0);
st.giveItems(57, 5000000);
st.giveItems(6622, 1);
@@ -847,7 +845,7 @@ public class SagasSuperClass extends Quest
final int npcId = npc.getNpcId();
if (st != null)
{
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (npcId == _npc[4])
{
if (cond == 17)
@@ -925,7 +923,8 @@ public class SagasSuperClass extends Quest
{
return super.onAttack(npc, player, damage, isPet);
}
- final int cond = st2.getInt("cond");
+
+ final int cond = st2.getCond();
final QuestState st = player.getQuestState(getName());
final int npcId = npc.getNpcId();
if ((npcId == _mob[2]) && (st == st2) && (cond == 17))
@@ -987,10 +986,9 @@ public class SagasSuperClass extends Quest
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
{
final int npcId = npc.getNpcId();
- QuestState st = player.getQuestState(getName());
- for (int Archon_Minion = 21646; Archon_Minion < 21652; Archon_Minion++)
+ for (int archonMinion = 21646; archonMinion < 21652; archonMinion++)
{
- if (npcId == Archon_Minion)
+ if (npcId == archonMinion)
{
final Party party = player.getParty();
if (party != null)
@@ -999,7 +997,7 @@ public class SagasSuperClass extends Quest
for (PlayerInstance player1 : party.getPartyMembers())
{
final QuestState st1 = findQuest(player1);
- if ((st1 != null) && (st1.getInt("cond") == 15))
+ if ((st1 != null) && st1.isCond(15))
{
partyQuestMembers.add(st1);
}
@@ -1013,7 +1011,7 @@ public class SagasSuperClass extends Quest
else
{
final QuestState st1 = findQuest(player);
- if ((st1 != null) && (st1.getInt("cond") == 15))
+ if ((st1 != null) && st1.isCond(15))
{
giveHallishaMark(st1);
}
@@ -1027,14 +1025,14 @@ public class SagasSuperClass extends Quest
if (npcId == element)
{
final QuestState st1 = findQuest(player);
- if ((st1 != null) && (st1.getInt("cond") == 15))
+ if ((st1 != null) && st1.isCond(15))
{
// This is just a guess....not really sure what it actually says, if anything
npc.broadcastNpcSay(_text[4].replace("PLAYERNAME", st1.getPlayer().getName()));
st1.giveItems(_items[8], 1);
st1.takeItems(_items[3], -1);
- st1.set("cond", "16");
- st1.playSound("ItemSound.quest_middle");
+ st1.setCond(16);
+ st1.playSound(QuestState.SOUND_MIDDLE);
}
return super.onKill(npc, player, isPet);
}
@@ -1045,7 +1043,7 @@ public class SagasSuperClass extends Quest
if (npcId == guardianAngel)
{
final QuestState st1 = findQuest(player);
- if ((st1 != null) && (st1.getInt("cond") == 6))
+ if ((st1 != null) && st1.isCond(6))
{
if (st1.getInt("kills") < 9)
{
@@ -1053,14 +1051,16 @@ public class SagasSuperClass extends Quest
}
else
{
- st1.playSound("ItemSound.quest_middle");
+ st1.playSound(QuestState.SOUND_MIDDLE);
st1.giveItems(_items[5], 1);
- st1.set("cond", "7");
+ st1.setCond(7);
}
}
return super.onKill(npc, player, isPet);
}
}
+
+ QuestState st = player.getQuestState(getName());
if ((st != null) && (npcId != _mob[2]))
{
final QuestState st2 = findRightState(npc);
@@ -1068,21 +1068,20 @@ public class SagasSuperClass extends Quest
{
return super.onKill(npc, player, isPet);
}
- final int cond = st.getInt("cond");
- if ((npcId == _mob[0]) && (cond == 8))
+ if ((npcId == _mob[0]) && st.isCond(8))
{
if (!player.isInParty() && (st == st2))
{
npc.broadcastNpcSay(_text[12].replace("PLAYERNAME", player.getName()));
st.giveItems(_items[6], 1);
- st.set("cond", "9");
- st.playSound("ItemSound.quest_middle");
+ st.setCond(9);
+ st.playSound(QuestState.SOUND_MIDDLE);
}
cancelQuestTimer("Mob_1 has despawned", npc, st2.getPlayer());
st2.set("spawned", "0");
deleteSpawn(npc);
}
- else if ((npcId == _mob[1]) && (cond == 15))
+ else if ((npcId == _mob[1]) && st.isCond(15))
{
if (!player.isInParty())
{
@@ -1091,8 +1090,8 @@ public class SagasSuperClass extends Quest
npc.broadcastNpcSay(_text[4].replace("PLAYERNAME", player.getName()));
st.giveItems(_items[8], 1);
st.takeItems(_items[3], -1);
- st.set("cond", "16");
- st.playSound("ItemSound.quest_middle");
+ st.setCond(16);
+ st.playSound(QuestState.SOUND_MIDDLE);
}
else
{
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/IdManager.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
index 2b5b3c70ac..998c980293 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/IdManager.java
@@ -39,7 +39,7 @@ public class IdManager
{
private static final Logger LOGGER = Logger.getLogger(IdManager.class.getName());
- //@formatter:off
+ // @formatter:off
private static final String[][] ID_EXTRACTS =
{
{"characters","charId"},
@@ -47,7 +47,7 @@ public class IdManager
{"clan_data","clan_id"},
{"itemsonground","object_id"}
};
- //@formatter:on
+ // @formatter:on
private static final String[] TIMESTAMPS_CLEAN =
{
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java
index 4722a611c4..4d22691ad7 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java
@@ -1601,7 +1601,7 @@ public class NpcInstance extends Creature
final QuestState qs = player.getQuestState(q.getName());
if (qs != null)
{
- if (qs.isStarted() && (qs.getInt("cond") > 0))
+ if (qs.getCond() > 0)
{
state = " (In Progress)";
}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/Quest.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/Quest.java
index aae93fcea3..f40ea0e7bd 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/Quest.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/Quest.java
@@ -1242,11 +1242,10 @@ public class Quest extends ManagedScript
* Auxiliary function for party quests. Checks the player's condition. Player member must be within Config.PARTY_RANGE distance from the npc. If npc is null, distance condition is ignored.
* @param player : the instance of a player whose party is to be searched
* @param npc : the instance of a Npc to compare distance
- * @param var : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
- * @param value : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
+ * @param cond : an integer specifying a quest condition that must be satisfied for a party member to be considered.
* @return QuestState : The QuestState of that player.
*/
- public QuestState checkPlayerCondition(PlayerInstance player, NpcInstance npc, String var, String value)
+ public QuestState checkPlayerCondition(PlayerInstance player, NpcInstance npc, int cond)
{
// No valid player or npc instance is passed, there is nothing to check.
if ((player == null) || (npc == null))
@@ -1261,8 +1260,8 @@ public class Quest extends ManagedScript
return null;
}
- // Condition exists? Condition has correct value?
- if ((qs.get(var) == null) || !value.equalsIgnoreCase(qs.get(var).toString()))
+ // Condition has correct value?
+ if (!qs.isCond(cond))
{
return null;
}
@@ -1347,12 +1346,11 @@ public class Quest extends ManagedScript
* Auxiliary function for party quests. Note: This function is only here because of how commonly it may be used by quest developers. For any variations on this function, the quest script can always handle things on its own
* @param player : the instance of a player whose party is to be searched
* @param npc : the instance of a Npc to compare distance
- * @param var : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
- * @param value : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
+ * @param cond : an integer specifying a quest condition that must be satisfied for a party member to be considered.
* @return List : List of party members that matches the specified condition, empty list if none matches. If the var is null, empty list is returned (i.e. no condition is applied). The party member must be within Config.PARTY_RANGE distance from the npc. If npc is null, distance
* condition is ignored.
*/
- public List getPartyMembers(PlayerInstance player, NpcInstance npc, String var, String value)
+ public List getPartyMembers(PlayerInstance player, NpcInstance npc, int cond)
{
if (player == null)
{
@@ -1362,13 +1360,13 @@ public class Quest extends ManagedScript
final Party party = player.getParty();
if (party == null)
{
- return (checkPlayerCondition(player, npc, var, value) != null) ? Arrays.asList(player) : Collections.emptyList();
+ return (checkPlayerCondition(player, npc, cond) != null) ? Arrays.asList(player) : Collections.emptyList();
}
final List result = new ArrayList<>();
for (PlayerInstance member : party.getPartyMembers())
{
- if (checkPlayerCondition(member, npc, var, value) != null)
+ if (checkPlayerCondition(member, npc, cond) != null)
{
result.add(member);
}
@@ -1381,11 +1379,10 @@ public class Quest extends ManagedScript
* Auxiliary function for party quests. Note: This function is only here because of how commonly it may be used by quest developers. For any variations on this function, the quest script can always handle things on its own
* @param player : the instance of a player whose party is to be searched
* @param npc : the instance of a Npc to compare distance
- * @param var : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
- * @param value : a tuple specifying a quest condition that must be satisfied for a party member to be considered.
- * @return Player : Player for a random party member that matches the specified condition, or null if no match. If the var is null, null is returned (i.e. no condition is applied). The party member must be within 1500 distance from the npc. If npc is null, distance condition is ignored.
+ * @param cond : an integer specifying a quest condition that must be satisfied for a party member to be considered.
+ * @return Player : Player for a random party member that matches the specified condition, or null if no match. If the cond is null, null is returned (i.e. no condition is applied). The party member must be within 1500 distance from the npc. If npc is null, distance condition is ignored.
*/
- public PlayerInstance getRandomPartyMember(PlayerInstance player, NpcInstance npc, String var, String value)
+ public PlayerInstance getRandomPartyMember(PlayerInstance player, NpcInstance npc, int cond)
{
// No valid player instance is passed, there is nothing to check.
if (player == null)
@@ -1394,44 +1391,28 @@ public class Quest extends ManagedScript
}
// Return random candidate.
- final List members = getPartyMembers(player, npc, var, value);
+ final List members = getPartyMembers(player, npc, cond);
if (members.isEmpty())
{
final QuestState qs = player.getQuestState(getName());
- if (qs != null)
+ if ((qs != null) && qs.isCond(cond))
{
- final Object sVar = qs.get(var);
- if ((sVar != null) && ((String) sVar).equalsIgnoreCase(value))
- {
- return player; // match
- }
+ return player; // match
}
return null; // no match
}
return members.get(Rnd.get(members.size()));
}
- /**
- * Auxiliary function for party quests. Note: This function is only here because of how commonly it may be used by quest developers. For any variations on this function, the quest script can always handle things on its own.
- * @param player : the instance of a player whose party is to be searched
- * @param npc : the instance of a Npc to compare distance
- * @param value : the value of the "cond" variable that must be matched
- * @return Player : Player for a random party member that matches the specified condition, or null if no match.
- */
- public PlayerInstance getRandomPartyMember(PlayerInstance player, NpcInstance npc, String value)
- {
- return getRandomPartyMember(player, npc, "cond", value);
- }
-
/**
* Auxiliary function for party quests. Note: This function is only here because of how commonly it may be used by quest developers. For any variations on this function, the quest script can always handle things on its own
* @param player the instance of a player whose party is to be searched
- * @param var a tuple specifying a quest condition that must be satisfied for a party member to be considered.
+ * @param variable a tuple specifying a quest condition that must be satisfied for a party member to be considered.
* @param value
* @return PlayerInstance: PlayerInstance for a random party member that matches the specified condition, or null if no match. If the var is null, any random party member is returned (i.e. no condition is applied). The party member must be within 1500 distance from the target of the reference
* player, or if no target exists, 1500 distance from the player itself.
*/
- public PlayerInstance getRandomPartyMember(PlayerInstance player, String var, String value)
+ public PlayerInstance getRandomPartyMember(PlayerInstance player, String variable, String value)
{
// if no valid player instance is passed, there is nothing to check...
if (player == null)
@@ -1440,7 +1421,7 @@ public class Quest extends ManagedScript
}
// for null var condition, return any random party member.
- if (var == null)
+ if (variable == null)
{
return getRandomPartyMember(player);
}
@@ -1454,7 +1435,7 @@ public class Quest extends ManagedScript
final QuestState qs = player.getQuestState(getName());
if (qs != null)
{
- final Object sVar = qs.get(var);
+ final Object sVar = qs.get(variable);
if ((sVar != null) && ((String) sVar).equalsIgnoreCase(value))
{
return player; // match
@@ -1478,7 +1459,7 @@ public class Quest extends ManagedScript
final QuestState qs = partyMember.getQuestState(getName());
if (qs != null)
{
- final Object sVar = qs.get(var);
+ final Object sVar = qs.get(variable);
if ((sVar != null) && ((String) sVar).equalsIgnoreCase(value) && partyMember.isInsideRadius3D(target, Config.ALT_PARTY_RANGE))
{
candidates.add(partyMember);
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index a5dd291caa..fa4a80bb70 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.quest;
import java.util.HashMap;
import java.util.Map;
+import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jmobius.Config;
@@ -49,6 +50,9 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+
public static final String SOUND_ACCEPT = "ItemSound.quest_accept";
public static final String SOUND_ITEMGET = "ItemSound.quest_itemget";
public static final String SOUND_MIDDLE = "ItemSound.quest_middle";
@@ -72,16 +76,14 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** A map of key->value pairs containing the quest state variables and their values */
private Map _vars;
/**
- * Constructor of the QuestState : save the quest in the list of quests of the player.
- *
- * Actions :
- * - Save informations in the object QuestState created (Quest, Player, Completion, State)
- * - Add the QuestState in the player's list of quests by using setQuestState()
- * - Add drops gotten by the quest
+ * Constructor of the QuestState. Creates the QuestState object and sets the player's progress of the quest to this QuestState.
* @param quest the {@link Quest} object associated with the QuestState
* @param player the owner of this {@link QuestState} object
* @param state the initial state of the quest
@@ -210,9 +212,9 @@ public class QuestState
// Otherwise, delete variables for quest and update database (quest CANNOT be created again => not repeatable)
if (_vars != null)
{
- for (String var : _vars.keySet())
+ for (String variable : _vars.keySet())
{
- Quest.deleteQuestVarInDb(this, var);
+ Quest.deleteQuestVarInDb(this, variable);
}
_vars.clear();
}
@@ -222,60 +224,74 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
- * @param val String pointing out the value of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
+ * @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String val)
+ public void setInternal(String variable, String value)
{
if (_vars == null)
{
_vars = new HashMap<>();
}
- String value = val;
if (value == null)
{
- value = "";
+ _vars.put(variable, "");
+ return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
/**
* Return value of parameter "value" after adding the couple (var,value) in class variable "vars".
- * Actions :
- * - Initialize class variable "vars" if is null
+ * Actions:
+ *
+ * - Initialize class variable "vars" if is null.
* - Initialize parameter "value" if is null
* - Add/Update couple (var,value) in class variable Map "vars"
- * - If the key represented by "var" exists in Map "vars", the couple (var,value) is updated in the database. The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
- * If the key doesn't exist, the couple is added/created in the database
- * @param var : String indicating the name of the variable for quest
- * @param val : String indicating the value of the variable for quest
+ * - If the key represented by "var" exists in Map "vars", the couple (var,value) is updated in the database.
+ * The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
+ * If the key doesn't exist, the couple is added/created in the database
+ *
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_vars == null)
{
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if (var.equals("cond"))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -284,29 +300,40 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
}
catch (Exception e)
{
- LOGGER.finer(_player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
/**
- * Internally handles the progression of the quest so that it is ready for sending appropriate packets to the client
+ * Internally handles the progression of the quest so that it is ready for sending appropriate packets to the client.
* Actions :
- * - Check if the new progress number resets the quest to a previous (smaller) step
- * - If not, check if quest progress steps have been skipped
- * - If skipped, prepare the variable completedStateFlags appropriately to be ready for sending to clients
+ *
+ * - Check if the new progress number resets the quest to a previous (smaller) step.
+ * - If not, check if quest progress steps have been skipped.
+ * - If skipped, prepare the variable completedStateFlags appropriately to be ready for sending to clients.
* - If no steps were skipped, flags do not need to be prepared...
- * - If the passed step resets the quest to a previous step, reset such that steps after the parameter are not considered, while skipped steps before the parameter, if any, maintain their info
- * @param cond : int indicating the step number for the current quest progress (as will be shown to the client)
- * @param old : int indicating the previously noted step For more info on the variable communicating the progress steps to the client, please see
+ * - If the passed step resets the quest to a previous step, reset such that steps after the parameter are not considered, while skipped steps before the parameter, if any, maintain their info.
+ *
+ * @param cond the current quest progress condition (0 - 31 including)
+ * @param old the previous quest progress condition to check against
*/
private void setCond(int cond, int old)
{
@@ -386,75 +413,120 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_vars == null)
{
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * Return the value of the variable of quest represented by "var"
- * @param var : name of the variable of quest
- * @return Object
+ * @param variable the name of the variable to get
+ * @return the value of the variable from the list of quest variables
*/
- public Object get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
+ }
+
+ /**
+ * @param variable the name of the variable to get
+ * @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
+ */
+ public int getInt(String variable)
+ {
+ int varInt = 0;
+ if (_vars != null)
+ {
+ final String value = _vars.get(variable);
+ if (value != null)
+ {
+ try
+ {
+ varInt = Integer.parseInt(value);
+ }
+ catch (Exception e)
+ {
+ LOGGER.info(_player.getName() + ": variable " + variable + " isn't an integer: returned value will be " + varInt + e);
+ if (Config.AUTODELETE_INVALID_QUEST_DATA)
+ {
+ exitQuest(true);
+ }
+ }
+ }
+ }
+ return varInt;
}
/**
* Return the value of the variable of quest represented by "var"
- * @param var : name of the variable of quest
+ * @param variable : name of the variable of quest
* @return String
*/
- public String getString(String var)
+ public String getString(String variable)
{
if (_vars == null)
{
return "";
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * Return the value of the variable of quest represented by "var"
- * @param var : String designating the variable for the quest
- * @return int
+ * Checks if the quest state progress ({@code cond}) is at the specified step.
+ * @param condition the condition to check against
+ * @return {@code true} if the quest condition is equal to {@code condition}, {@code false} otherwise
+ * @see #getInt(String var)
*/
- public int getInt(String var)
+ public boolean isCond(int condition)
{
- int varint = 0;
- String value = "";
- if ((_vars != null) && ((value = _vars.get(var)) != null))
+ return _cond == condition;
+ }
+
+ /**
+ * Sets the quest state progress ({@code cond}) to the specified step.
+ * @param value the new value of the quest state progress
+ * @see #set(String var, String value)
+ */
+ public void setCond(int value)
+ {
+ if (isStarted())
{
- try
- {
- varint = Integer.parseInt(value);
- }
- catch (Exception e)
- {
- LOGGER.info(_player.getName() + ": variable " + var + " isn't an integer: returned value will be " + varint + e);
- if (Config.AUTODELETE_INVALID_QUEST_DATA)
- {
- exitQuest(true);
- }
- }
+ set(COND_VAR, Integer.toString(value));
}
- return varint;
+ }
+
+ /**
+ * @return the current quest progress ({@code cond})
+ */
+ public int getCond()
+ {
+ if (isStarted())
+ {
+ return _cond;
+ }
+
+ return 0;
}
/**
@@ -879,14 +951,14 @@ public class QuestState
*/
public void rewardItems(int itemId, int itemCount)
{
- if (itemId == 57)
- {
- giveItems(itemId, (int) (itemCount * Config.RATE_QUESTS_REWARD), 0); // TODO: RATE_QUEST_REWARD_ADENA
- }
- else
- {
- giveItems(itemId, (int) (itemCount * Config.RATE_QUESTS_REWARD), 0);
- }
+ // if (itemId == 57)
+ // {
+ // giveItems(itemId, (int) (itemCount * Config.RATE_QUEST_REWARD_ADENA), 0); // TODO: RATE_QUEST_REWARD_ADENA
+ // }
+ // else
+ // {
+ giveItems(itemId, (int) (itemCount * Config.RATE_QUESTS_REWARD), 0);
+ // }
}
/**
@@ -1068,6 +1140,20 @@ public class QuestState
return getQuest().addSpawn(npcId, x, y, z, heading, randomOffset, despawnDelay);
}
+ /**
+ * Set condition to 1, state to STARTED and play the "ItemSound.quest_accept".
+ * Works only if state is CREATED and the quest is not a custom quest.
+ */
+ public void startQuest()
+ {
+ if (isCreated())
+ {
+ set(COND_VAR, "1");
+ setState(State.STARTED);
+ _player.sendPacket(new PlaySound(QuestState.SOUND_ACCEPT));
+ }
+ }
+
public void showQuestionMark(int number)
{
_player.sendPacket(new TutorialShowQuestionMark(number));
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/ExCaptureOrc.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/ExCaptureOrc.java
index a052512523..e2b2d7e57a 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/ExCaptureOrc.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/ExCaptureOrc.java
@@ -28,7 +28,7 @@ public class ExCaptureOrc implements IClientOutgoingPacket
static
{
// TODO: Verify the data
- //@formatter:off
+ // @formatter:off
_test = new byte[]
{
(byte) 0xE4 ,(byte) 0xAB ,(byte) 0x8E ,(byte) 0xC5 ,(byte) 0xE9 ,(byte) 0xF9 ,(byte) 0x86 ,(byte) 0x7B,
@@ -40,7 +40,7 @@ public class ExCaptureOrc implements IClientOutgoingPacket
(byte) 0x5E ,(byte) 0x1C ,(byte) 0x59 ,(byte) 0x8E ,(byte) 0x74 ,(byte) 0x01 ,(byte) 0x9E ,(byte) 0xC2,
(byte) 0x00 ,(byte) 0x95 ,(byte) 0xB0 ,(byte) 0x1D ,(byte) 0x87 ,(byte) 0xED ,(byte) 0x9C ,(byte) 0x8A
};
- //@formatter:on
+ // @formatter:on
}
@Override
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/GMViewQuestList.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/GMViewQuestList.java
index c90c3135d6..6de298cefe 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/GMViewQuestList.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/GMViewQuestList.java
@@ -55,7 +55,7 @@ public class GMViewQuestList implements IClientOutgoingPacket
continue;
}
- packet.writeD(qs.getInt("cond")); // stage of quest progress
+ packet.writeD(qs.getCond()); // stage of quest progress
}
return true;
}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 1c662efed9..ee3a3f27e9 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -48,7 +48,7 @@ public class QuestList implements IClientOutgoingPacket
}
else
{
- packet.writeD(qs.getInt("cond"));
+ packet.writeD(qs.getCond());
}
}
return true;
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java
index 3996426996..f51259f642 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java
@@ -145,7 +145,7 @@ public class LoginServer
InputStreamReader is = new InputStreamReader(fis);
LineNumberReader lnr = new LineNumberReader(is))
{
- //@formatter:off
+ // @formatter:off
lnr.lines()
.map(String::trim)
.filter(l -> !l.isEmpty() && (l.charAt(0) != '#'))
@@ -179,7 +179,7 @@ public class LoginServer
LOGGER.warning("Skipped: Invalid address (" + address + ") on (" + bannedFile.getName() + "). Line: " + lnr.getLineNumber());
}
});
- //@formatter:on
+ // @formatter:on
}
catch (IOException e)
{
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java
index 307467b717..e52b4e75d9 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java
@@ -567,7 +567,7 @@ public class HallOfErosionAttack extends AbstractNpcAI
if (plr != null)
{
final QuestState qs = plr.getQuestState(Q00696_ConquerTheHallOfErosion.class.getSimpleName());
- if ((qs != null) && (qs.getInt("cond") == 1))
+ if ((qs != null) && qs.isCond(1))
{
qs.set("cohemenes", "1");
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java
index de81a0481d..fd9c311ed1 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java
@@ -620,7 +620,7 @@ public class HallOfErosionDefence extends AbstractNpcAI
if (player != null)
{
final QuestState qs = player.getQuestState(Q00697_DefendTheHallOfErosion.class.getSimpleName());
- if ((qs != null) && (qs.getInt("cond") == 1))
+ if ((qs != null) && qs.isCond(1))
{
qs.set("defenceDone", 1);
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java
index 6f7c9fbe40..2f47efb647 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/ai/areas/Gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java
@@ -674,7 +674,7 @@ public class HeartInfinityDefence extends AbstractNpcAI
for (PlayerInstance player : _world.getAllowed())
{
final QuestState qs = player.getQuestState(Q00697_DefendTheHallOfErosion.class.getSimpleName());
- if ((qs != null) && (qs.getInt("cond") == 1))
+ if ((qs != null) && qs.isCond(1))
{
qs.set("defenceDone", 1);
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index a3bf0f727d..cfba47843c 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -334,7 +334,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00012_SecretMeetingWithVarkaSilenos/Q00012_SecretMeetingWithVarkaSilenos.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00012_SecretMeetingWithVarkaSilenos/Q00012_SecretMeetingWithVarkaSilenos.java
index 18b258f002..17d3276a88 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00012_SecretMeetingWithVarkaSilenos/Q00012_SecretMeetingWithVarkaSilenos.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00012_SecretMeetingWithVarkaSilenos/Q00012_SecretMeetingWithVarkaSilenos.java
@@ -111,7 +111,7 @@ public class Q00012_SecretMeetingWithVarkaSilenos extends Quest
}
case State.STARTED:
{
- final int cond = qs.getInt("cond");
+ final int cond = qs.getCond();
if ((npcId == CADMON) && (cond == 1))
{
htmltext = "31296-04.html";
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00019_GoToThePastureland/Q00019_GoToThePastureland.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00019_GoToThePastureland/Q00019_GoToThePastureland.java
index 19579fc60a..2de20eae6b 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00019_GoToThePastureland/Q00019_GoToThePastureland.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00019_GoToThePastureland/Q00019_GoToThePastureland.java
@@ -54,9 +54,7 @@ public class Q00019_GoToThePastureland extends Quest
if (event.equals("31302-01.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- playSound(player, QuestSound.ITEMSOUND_QUEST_ACCEPT);
+ st.startQuest();
giveItems(player, YOUNG_WILD_BEAST_MEAT, 1);
}
else if (event.equals("019_finish"))
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java
index 71e83ab8ec..ded81e1d83 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java
@@ -104,7 +104,7 @@ public class Q00182_NewRecruits extends Quest
}
case State.STARTED:
{
- if (qs.getInt("cond") == 1)
+ if (qs.isCond(1))
{
htmltext = "32138-04.html";
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00241_PossessorOfAPreciousSoul1/Q00241_PossessorOfAPreciousSoul1.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00241_PossessorOfAPreciousSoul1/Q00241_PossessorOfAPreciousSoul1.java
index 990b6cfe05..f805c496a4 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00241_PossessorOfAPreciousSoul1/Q00241_PossessorOfAPreciousSoul1.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00241_PossessorOfAPreciousSoul1/Q00241_PossessorOfAPreciousSoul1.java
@@ -95,86 +95,85 @@ public class Q00241_PossessorOfAPreciousSoul1 extends Quest
// Talien
if (event.equalsIgnoreCase("31739-03.htm"))
{
- st.set("cond", "1");
- st.setState(State.STARTED);
+ st.startQuest();
}
else if (event.equalsIgnoreCase("31739-07.htm"))
{
- st.set("cond", "5");
+ st.setCond(5);
takeItems(player, LEGEND_OF_SEVENTEEN, 1);
}
else if (event.equalsIgnoreCase("31739-10.htm"))
{
- st.set("cond", "9");
+ st.setCond(9);
takeItems(player, ECHO_CRYSTAL, 1);
}
else if (event.equalsIgnoreCase("31739-13.htm"))
{
- st.set("cond", "11");
+ st.setCond(11);
takeItems(player, POETRY_BOOK, 1);
}
// Gabrielle
else if (event.equalsIgnoreCase("30753-02.htm"))
{
- st.set("cond", "2");
+ st.setCond(2);
}
// Gilmore
else if (event.equalsIgnoreCase("30754-02.htm"))
{
- st.set("cond", "3");
+ st.setCond(3);
}
// Kantabilon
else if (event.equalsIgnoreCase("31042-02.htm"))
{
- st.set("cond", "6");
+ st.setCond(6);
}
else if (event.equalsIgnoreCase("31042-05.htm"))
{
- st.set("cond", "8");
+ st.setCond(8);
takeItems(player, MALRUK_SUCCUBUS_CLAW, 10);
giveItems(player, ECHO_CRYSTAL, 1);
}
// Stedmiel
else if (event.equalsIgnoreCase("30692-02.htm"))
{
- st.set("cond", "10");
+ st.setCond(10);
giveItems(player, POETRY_BOOK, 1);
}
// Virgil
else if (event.equalsIgnoreCase("31742-02.htm"))
{
- st.set("cond", "12");
+ st.setCond(12);
}
else if (event.equalsIgnoreCase("31742-05.htm"))
{
- st.set("cond", "18");
+ st.setCond(18);
}
// Ogmar
else if (event.equalsIgnoreCase("31744-02.htm"))
{
- st.set("cond", "13");
+ st.setCond(13);
}
// Rahorakti
else if (event.equalsIgnoreCase("31336-02.htm"))
{
- st.set("cond", "14");
+ st.setCond(14);
}
else if (event.equalsIgnoreCase("31336-05.htm"))
{
- st.set("cond", "16");
+ st.setCond(16);
takeItems(player, CRIMSON_MOSS, 5);
giveItems(player, RAHORAKTIS_MEDICINE, 1);
}
// Kassandra
else if (event.equalsIgnoreCase("31743-02.htm"))
{
- st.set("cond", "17");
+ st.setCond(17);
takeItems(player, RAHORAKTIS_MEDICINE, 1);
}
// Caradine
else if (event.equalsIgnoreCase("31740-02.htm"))
{
- st.set("cond", "19");
+ st.setCond(19);
}
else if (event.equalsIgnoreCase("31740-05.htm"))
{
@@ -185,7 +184,7 @@ public class Q00241_PossessorOfAPreciousSoul1 extends Quest
// Noel
else if (event.equalsIgnoreCase("31272-02.htm"))
{
- st.set("cond", "20");
+ st.setCond(20);
}
else if (event.equalsIgnoreCase("31272-05.htm"))
{
@@ -193,7 +192,7 @@ public class Q00241_PossessorOfAPreciousSoul1 extends Quest
{
takeItems(player, LUNARGENT, 5);
takeItems(player, HELLFIRE_OIL, 1);
- st.set("cond", "21");
+ st.setCond(21);
}
else
{
@@ -230,7 +229,7 @@ public class Q00241_PossessorOfAPreciousSoul1 extends Quest
break;
}
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
switch (npc.getId())
{
case TALIEN:
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00246_PossessorOfAPreciousSoul3/Q00246_PossessorOfAPreciousSoul3.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00246_PossessorOfAPreciousSoul3/Q00246_PossessorOfAPreciousSoul3.java
index 19f681f6b2..fbb7e0216f 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00246_PossessorOfAPreciousSoul3/Q00246_PossessorOfAPreciousSoul3.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00246_PossessorOfAPreciousSoul3/Q00246_PossessorOfAPreciousSoul3.java
@@ -74,20 +74,19 @@ public class Q00246_PossessorOfAPreciousSoul3 extends Quest
// Caradine
if (event.equalsIgnoreCase("31740-04.htm"))
{
- st.set("cond", "1");
+ st.startQuest();
takeItems(player, CARADINE_LETTER_2, 1);
- st.setState(State.STARTED);
}
// Ossian
else if (event.equalsIgnoreCase("31741-02.htm"))
{
- st.set("cond", "2");
+ st.setCond(2);
}
else if (event.equalsIgnoreCase("31741-05.htm"))
{
if (hasQuestItems(player, WATERBINDER) && hasQuestItems(player, EVERGREEN))
{
- st.set("cond", "4");
+ st.setCond(4);
takeItems(player, WATERBINDER, 1);
takeItems(player, EVERGREEN, 1);
}
@@ -100,7 +99,7 @@ public class Q00246_PossessorOfAPreciousSoul3 extends Quest
{
if (hasQuestItems(player, RAIN_SONG))
{
- st.set("cond", "6");
+ st.setCond(6);
takeItems(player, RAIN_SONG, 1);
giveItems(player, RELIC_BOX, 1);
}
@@ -157,12 +156,11 @@ public class Q00246_PossessorOfAPreciousSoul3 extends Quest
break;
}
- final int cond = st.getInt("cond");
switch (npc.getId())
{
case CARADINE:
{
- if (cond == 1)
+ if (st.isCond(1))
{
htmltext = "31740-05.htm";
}
@@ -170,7 +168,7 @@ public class Q00246_PossessorOfAPreciousSoul3 extends Quest
}
case OSSIAN:
{
- switch (cond)
+ switch (st.getCond())
{
case 1:
{
@@ -213,7 +211,7 @@ public class Q00246_PossessorOfAPreciousSoul3 extends Quest
}
case LADD:
{
- if ((cond == 6) && hasQuestItems(player, RELIC_BOX))
+ if (st.isCond(6) && hasQuestItems(player, RELIC_BOX))
{
htmltext = "30721-01.htm";
}
@@ -285,7 +283,7 @@ public class Q00246_PossessorOfAPreciousSoul3 extends Quest
}
else
{
- st.set("cond", "3");
+ st.setCond(3);
}
}
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00311_ExpulsionOfEvilSpirits/Q00311_ExpulsionOfEvilSpirits.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00311_ExpulsionOfEvilSpirits/Q00311_ExpulsionOfEvilSpirits.java
index b44d6c7c79..c6108b7e7c 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00311_ExpulsionOfEvilSpirits/Q00311_ExpulsionOfEvilSpirits.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00311_ExpulsionOfEvilSpirits/Q00311_ExpulsionOfEvilSpirits.java
@@ -219,7 +219,7 @@ public class Q00311_ExpulsionOfEvilSpirits extends Quest
final PlayerInstance member = qs.getPlayer();
if (npc.getId() == VARANGKA)
{
- if ((qs.getInt("cond") != 1))
+ if (!qs.isCond(1))
{
return null;
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
index 4eca3ba212..a76a7903e9 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
@@ -219,10 +219,6 @@ public class Q00350_EnhanceYourWeapon extends Quest
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
if (qs.getState() == State.CREATED)
- {
- qs.set("cond", "0");
- }
- if (qs.getInt("cond") == 0)
{
htmltext = npc.getId() + "-01.htm";
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java
index 8dfe3cf530..f506ec8807 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java
@@ -209,7 +209,7 @@ public class Q00511_AwlUnderFoot extends Quest
for (PlayerInstance partyMember : party.getMembers())
{
final QuestState qs = getQuestState(partyMember, false);
- if ((qs == null) || (qs.getInt("cond") < 1))
+ if ((qs == null) || (qs.getCond() < 1))
{
return getHtm(player, "FortressWarden-05.htm").replace("%player%", partyMember.getName());
}
@@ -418,15 +418,7 @@ public class Q00511_AwlUnderFoot extends Quest
else if (qs != null)
{
final int npcId = npc.getId();
- int cond = 0;
- if (qs.getState() == State.CREATED)
- {
- qs.set("cond", "0");
- }
- else
- {
- cond = qs.getInt("cond");
- }
+ final int cond = qs.getCond();
if (_fortDungeons.containsKey(npcId) && (cond == 0))
{
if (player.getLevel() >= 60)
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00631_DeliciousTopChoiceMeat/Q00631_DeliciousTopChoiceMeat.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00631_DeliciousTopChoiceMeat/Q00631_DeliciousTopChoiceMeat.java
index 37d8aab1dd..170da835c7 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00631_DeliciousTopChoiceMeat/Q00631_DeliciousTopChoiceMeat.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00631_DeliciousTopChoiceMeat/Q00631_DeliciousTopChoiceMeat.java
@@ -123,9 +123,7 @@ public class Q00631_DeliciousTopChoiceMeat extends Quest
{
if (player.getLevel() >= 65)
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- playSound(player, QuestSound.ITEMSOUND_QUEST_ACCEPT);
+ st.startQuest();
}
else
{
@@ -147,7 +145,7 @@ public class Q00631_DeliciousTopChoiceMeat extends Quest
}
else
{
- st.set("cond", "1");
+ st.setCond(1);
htmltext = "31537-07.htm";
}
}
@@ -167,7 +165,7 @@ public class Q00631_DeliciousTopChoiceMeat extends Quest
break;
case State.STARTED:
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "31537-03a.htm";
@@ -180,7 +178,7 @@ public class Q00631_DeliciousTopChoiceMeat extends Quest
}
else
{
- st.set("cond", "1");
+ st.setCond(1);
htmltext = "31537-03a.htm";
}
}
@@ -206,7 +204,7 @@ public class Q00631_DeliciousTopChoiceMeat extends Quest
if (giveItemRandomly(partyMember, npc, TOP_QUALITY_MEAT, 1, 120, CHANCES.get(npc.getId()), true))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00647_InfluxOfMachines/Q00647_InfluxOfMachines.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00647_InfluxOfMachines/Q00647_InfluxOfMachines.java
index 8b96d5c4a8..5b0ea6963f 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00647_InfluxOfMachines/Q00647_InfluxOfMachines.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00647_InfluxOfMachines/Q00647_InfluxOfMachines.java
@@ -59,9 +59,7 @@ public class Q00647_InfluxOfMachines extends Quest
if (event.equals("32069-02.htm"))
{
- st.setState(State.STARTED);
- st.set("cond", "1");
- playSound(player, QuestSound.ITEMSOUND_QUEST_ACCEPT);
+ st.startQuest();
}
else if (event.equals("32069-06.htm"))
{
@@ -86,7 +84,7 @@ public class Q00647_InfluxOfMachines extends Quest
break;
case State.STARTED:
- final int cond = st.getInt("cond");
+ final int cond = st.getCond();
if (cond == 1)
{
htmltext = "32069-04.htm";
@@ -117,7 +115,7 @@ public class Q00647_InfluxOfMachines extends Quest
if (giveItemRandomly(partyMember, npc, DESTROYED_GOLEM_SHARD, 1, 500, 0.3, true))
{
- st.set("cond", "2");
+ st.setCond(2);
}
return null;
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00694_BreakThroughTheHallOfSuffering/Q00694_BreakThroughTheHallOfSuffering.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00694_BreakThroughTheHallOfSuffering/Q00694_BreakThroughTheHallOfSuffering.java
index 32b2b52eec..8906fbb50e 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00694_BreakThroughTheHallOfSuffering/Q00694_BreakThroughTheHallOfSuffering.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00694_BreakThroughTheHallOfSuffering/Q00694_BreakThroughTheHallOfSuffering.java
@@ -57,9 +57,7 @@ public class Q00694_BreakThroughTheHallOfSuffering extends Quest
if (event.equals("32603-02.html"))
{
- qs.set("cond", "1");
- qs.setState(State.STARTED);
- playSound(player, "ItemSound.quest_accept");
+ qs.startQuest();
}
return htmltext;
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00695_DefendTheHallOfSuffering/Q00695_DefendTheHallOfSuffering.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00695_DefendTheHallOfSuffering/Q00695_DefendTheHallOfSuffering.java
index 9fbce9be83..b4d157e30b 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00695_DefendTheHallOfSuffering/Q00695_DefendTheHallOfSuffering.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00695_DefendTheHallOfSuffering/Q00695_DefendTheHallOfSuffering.java
@@ -57,9 +57,7 @@ public class Q00695_DefendTheHallOfSuffering extends Quest
if (event.equals("32603-02.html"))
{
- qs.set("cond", "1");
- qs.setState(State.STARTED);
- playSound(player, "ItemSound.quest_accept");
+ qs.startQuest();
}
return htmltext;
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00708_PathToBecomingALordGludio/Q00708_PathToBecomingALordGludio.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00708_PathToBecomingALordGludio/Q00708_PathToBecomingALordGludio.java
index 70cdf19f5e..239b98a516 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00708_PathToBecomingALordGludio/Q00708_PathToBecomingALordGludio.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00708_PathToBecomingALordGludio/Q00708_PathToBecomingALordGludio.java
@@ -244,7 +244,7 @@ public final class Q00708_PathToBecomingALordGludio extends Quest
}
else if (qs.isCond(4))
{
- qs.set("cond", "5");
+ qs.setCond(5);
htmltext = "35100-09.html";
}
else if (qs.isCond(5))
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00709_PathToBecomingALordDion/Q00709_PathToBecomingALordDion.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00709_PathToBecomingALordDion/Q00709_PathToBecomingALordDion.java
index 5701359643..0a92ef4b27 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00709_PathToBecomingALordDion/Q00709_PathToBecomingALordDion.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00709_PathToBecomingALordDion/Q00709_PathToBecomingALordDion.java
@@ -125,13 +125,13 @@ public final class Q00709_PathToBecomingALordDion extends Quest
}
case "30735-02.html":
{
- qs.set("cond", "6");
+ qs.setCond(6);
break;
}
case "30735-05.html":
{
takeItems(player, BLOODY_AXE_BLACK_EPAULETTE, 1);
- qs.set("cond", "8");
+ qs.setCond(8);
break;
}
case "31418-05.html":
@@ -232,7 +232,7 @@ public final class Q00709_PathToBecomingALordDion extends Quest
}
else if (qs.isCond(1))
{
- qs.set("cond", "2");
+ qs.setCond(2);
htmltext = "35142-04.html";
}
else if (qs.isCond(2) || qs.isCond(3))
@@ -241,7 +241,7 @@ public final class Q00709_PathToBecomingALordDion extends Quest
}
else if (qs.isCond(4))
{
- qs.set("cond", "5");
+ qs.setCond(5);
htmltext = "35142-07.html";
}
else if (qs.isCond(5))
diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index ed746c33ad..655408d86c 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -45,6 +45,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -54,6 +60,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** A map of key->value pairs containing the quest state variables and their values */
private Map _vars;
@@ -158,6 +167,7 @@ public class QuestState
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -177,28 +187,39 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
- * @param val String pointing out the value of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
+ * @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String val)
+ public void setInternal(String variable, String value)
{
if (_vars == null)
{
_vars = new HashMap<>();
}
- String value = val;
if (value == null)
{
- value = "";
+ _vars.put(variable, "");
+ return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
- set(var, Integer.toString(value));
+ set(variable, Integer.toString(value));
}
/**
@@ -212,33 +233,33 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_vars == null)
{
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -247,15 +268,24 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -351,63 +381,69 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_vars == null)
{
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + getQuestName() + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -418,7 +454,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -431,7 +467,7 @@ public class QuestState
{
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -442,8 +478,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("cond");
+ return _cond;
}
+
return 0;
}
@@ -473,7 +510,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -482,7 +520,7 @@ public class QuestState
public void setMemoState(int value)
{
- set("memoState", String.valueOf(value));
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -492,14 +530,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -511,8 +550,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -523,7 +563,7 @@ public class QuestState
*/
public void setMemoStateEx(int slot, int value)
{
- set("memoStateEx" + slot, String.valueOf(value));
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -575,7 +615,7 @@ public class QuestState
{
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
}
@@ -683,7 +723,7 @@ public class QuestState
_player.sendPacket(new TutorialShowQuestionMark(number));
}
- // TODO make tutorial voices the same as quest sounds
+ // TODO: make tutorial voices the same as quest sounds
public void playTutorialVoice(String voice)
{
_player.sendPacket(new PlaySound(2, voice, 0, 0, _player.getX(), _player.getY(), _player.getZ()));
@@ -703,7 +743,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -712,7 +752,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java
index 5907113925..d9eca87d22 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java
@@ -64,7 +64,7 @@ public class GmViewQuestInfo implements IClientOutgoingPacket
continue;
}
- packet.writeD(qs.getInt("cond")); // stage of quest progress
+ packet.writeD(qs.getCond()); // stage of quest progress
}
return true;
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 2e9dba25ad..054ed59412 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -89,7 +89,7 @@ public class QuestList implements IClientOutgoingPacket
}
else
{
- packet.writeD(qs.getInt("cond"));
+ packet.writeD(qs.getCond());
}
}
packet.writeB(new byte[128]);
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java
index 307467b717..e52b4e75d9 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionAttack/HallOfErosionAttack.java
@@ -567,7 +567,7 @@ public class HallOfErosionAttack extends AbstractNpcAI
if (plr != null)
{
final QuestState qs = plr.getQuestState(Q00696_ConquerTheHallOfErosion.class.getSimpleName());
- if ((qs != null) && (qs.getInt("cond") == 1))
+ if ((qs != null) && qs.isCond(1))
{
qs.set("cohemenes", "1");
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java
index de81a0481d..fd9c311ed1 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HallOfErosionDefence/HallOfErosionDefence.java
@@ -620,7 +620,7 @@ public class HallOfErosionDefence extends AbstractNpcAI
if (player != null)
{
final QuestState qs = player.getQuestState(Q00697_DefendTheHallOfErosion.class.getSimpleName());
- if ((qs != null) && (qs.getInt("cond") == 1))
+ if ((qs != null) && qs.isCond(1))
{
qs.set("defenceDone", 1);
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java
index 6f7c9fbe40..2f47efb647 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/areas/Gracia/instances/HeartInfinityDefence/HeartInfinityDefence.java
@@ -674,7 +674,7 @@ public class HeartInfinityDefence extends AbstractNpcAI
for (PlayerInstance player : _world.getAllowed())
{
final QuestState qs = player.getQuestState(Q00697_DefendTheHallOfErosion.class.getSimpleName());
- if ((qs != null) && (qs.getInt("cond") == 1))
+ if ((qs != null) && qs.isCond(1))
{
qs.set("defenceDone", 1);
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index a3bf0f727d..cfba47843c 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -334,7 +334,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00012_SecretMeetingWithVarkaSilenos/Q00012_SecretMeetingWithVarkaSilenos.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00012_SecretMeetingWithVarkaSilenos/Q00012_SecretMeetingWithVarkaSilenos.java
index 18b258f002..17d3276a88 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00012_SecretMeetingWithVarkaSilenos/Q00012_SecretMeetingWithVarkaSilenos.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00012_SecretMeetingWithVarkaSilenos/Q00012_SecretMeetingWithVarkaSilenos.java
@@ -111,7 +111,7 @@ public class Q00012_SecretMeetingWithVarkaSilenos extends Quest
}
case State.STARTED:
{
- final int cond = qs.getInt("cond");
+ final int cond = qs.getCond();
if ((npcId == CADMON) && (cond == 1))
{
htmltext = "31296-04.html";
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java
index 71e83ab8ec..ded81e1d83 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java
@@ -104,7 +104,7 @@ public class Q00182_NewRecruits extends Quest
}
case State.STARTED:
{
- if (qs.getInt("cond") == 1)
+ if (qs.isCond(1))
{
htmltext = "32138-04.html";
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00311_ExpulsionOfEvilSpirits/Q00311_ExpulsionOfEvilSpirits.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00311_ExpulsionOfEvilSpirits/Q00311_ExpulsionOfEvilSpirits.java
index b44d6c7c79..c6108b7e7c 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00311_ExpulsionOfEvilSpirits/Q00311_ExpulsionOfEvilSpirits.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00311_ExpulsionOfEvilSpirits/Q00311_ExpulsionOfEvilSpirits.java
@@ -219,7 +219,7 @@ public class Q00311_ExpulsionOfEvilSpirits extends Quest
final PlayerInstance member = qs.getPlayer();
if (npc.getId() == VARANGKA)
{
- if ((qs.getInt("cond") != 1))
+ if (!qs.isCond(1))
{
return null;
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
index 4eca3ba212..a76a7903e9 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
@@ -219,10 +219,6 @@ public class Q00350_EnhanceYourWeapon extends Quest
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
if (qs.getState() == State.CREATED)
- {
- qs.set("cond", "0");
- }
- if (qs.getInt("cond") == 0)
{
htmltext = npc.getId() + "-01.htm";
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java
index 8dfe3cf530..f506ec8807 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00511_AwlUnderFoot/Q00511_AwlUnderFoot.java
@@ -209,7 +209,7 @@ public class Q00511_AwlUnderFoot extends Quest
for (PlayerInstance partyMember : party.getMembers())
{
final QuestState qs = getQuestState(partyMember, false);
- if ((qs == null) || (qs.getInt("cond") < 1))
+ if ((qs == null) || (qs.getCond() < 1))
{
return getHtm(player, "FortressWarden-05.htm").replace("%player%", partyMember.getName());
}
@@ -418,15 +418,7 @@ public class Q00511_AwlUnderFoot extends Quest
else if (qs != null)
{
final int npcId = npc.getId();
- int cond = 0;
- if (qs.getState() == State.CREATED)
- {
- qs.set("cond", "0");
- }
- else
- {
- cond = qs.getInt("cond");
- }
+ final int cond = qs.getCond();
if (_fortDungeons.containsKey(npcId) && (cond == 0))
{
if (player.getLevel() >= 60)
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00694_BreakThroughTheHallOfSuffering/Q00694_BreakThroughTheHallOfSuffering.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00694_BreakThroughTheHallOfSuffering/Q00694_BreakThroughTheHallOfSuffering.java
index 32b2b52eec..8906fbb50e 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00694_BreakThroughTheHallOfSuffering/Q00694_BreakThroughTheHallOfSuffering.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00694_BreakThroughTheHallOfSuffering/Q00694_BreakThroughTheHallOfSuffering.java
@@ -57,9 +57,7 @@ public class Q00694_BreakThroughTheHallOfSuffering extends Quest
if (event.equals("32603-02.html"))
{
- qs.set("cond", "1");
- qs.setState(State.STARTED);
- playSound(player, "ItemSound.quest_accept");
+ qs.startQuest();
}
return htmltext;
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00695_DefendTheHallOfSuffering/Q00695_DefendTheHallOfSuffering.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00695_DefendTheHallOfSuffering/Q00695_DefendTheHallOfSuffering.java
index 9fbce9be83..b4d157e30b 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00695_DefendTheHallOfSuffering/Q00695_DefendTheHallOfSuffering.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00695_DefendTheHallOfSuffering/Q00695_DefendTheHallOfSuffering.java
@@ -57,9 +57,7 @@ public class Q00695_DefendTheHallOfSuffering extends Quest
if (event.equals("32603-02.html"))
{
- qs.set("cond", "1");
- qs.setState(State.STARTED);
- playSound(player, "ItemSound.quest_accept");
+ qs.startQuest();
}
return htmltext;
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00708_PathToBecomingALordGludio/Q00708_PathToBecomingALordGludio.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00708_PathToBecomingALordGludio/Q00708_PathToBecomingALordGludio.java
index 70cdf19f5e..239b98a516 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00708_PathToBecomingALordGludio/Q00708_PathToBecomingALordGludio.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00708_PathToBecomingALordGludio/Q00708_PathToBecomingALordGludio.java
@@ -244,7 +244,7 @@ public final class Q00708_PathToBecomingALordGludio extends Quest
}
else if (qs.isCond(4))
{
- qs.set("cond", "5");
+ qs.setCond(5);
htmltext = "35100-09.html";
}
else if (qs.isCond(5))
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00709_PathToBecomingALordDion/Q00709_PathToBecomingALordDion.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00709_PathToBecomingALordDion/Q00709_PathToBecomingALordDion.java
index 5701359643..0a92ef4b27 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00709_PathToBecomingALordDion/Q00709_PathToBecomingALordDion.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00709_PathToBecomingALordDion/Q00709_PathToBecomingALordDion.java
@@ -125,13 +125,13 @@ public final class Q00709_PathToBecomingALordDion extends Quest
}
case "30735-02.html":
{
- qs.set("cond", "6");
+ qs.setCond(6);
break;
}
case "30735-05.html":
{
takeItems(player, BLOODY_AXE_BLACK_EPAULETTE, 1);
- qs.set("cond", "8");
+ qs.setCond(8);
break;
}
case "31418-05.html":
@@ -232,7 +232,7 @@ public final class Q00709_PathToBecomingALordDion extends Quest
}
else if (qs.isCond(1))
{
- qs.set("cond", "2");
+ qs.setCond(2);
htmltext = "35142-04.html";
}
else if (qs.isCond(2) || qs.isCond(3))
@@ -241,7 +241,7 @@ public final class Q00709_PathToBecomingALordDion extends Quest
}
else if (qs.isCond(4))
{
- qs.set("cond", "5");
+ qs.setCond(5);
htmltext = "35142-07.html";
}
else if (qs.isCond(5))
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index ed746c33ad..655408d86c 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -45,6 +45,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -54,6 +60,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** A map of key->value pairs containing the quest state variables and their values */
private Map _vars;
@@ -158,6 +167,7 @@ public class QuestState
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -177,28 +187,39 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
- * @param val String pointing out the value of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
+ * @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String val)
+ public void setInternal(String variable, String value)
{
if (_vars == null)
{
_vars = new HashMap<>();
}
- String value = val;
if (value == null)
{
- value = "";
+ _vars.put(variable, "");
+ return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
- set(var, Integer.toString(value));
+ set(variable, Integer.toString(value));
}
/**
@@ -212,33 +233,33 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_vars == null)
{
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -247,15 +268,24 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -351,63 +381,69 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_vars == null)
{
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + getQuestName() + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -418,7 +454,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -431,7 +467,7 @@ public class QuestState
{
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -442,8 +478,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("cond");
+ return _cond;
}
+
return 0;
}
@@ -473,7 +510,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -482,7 +520,7 @@ public class QuestState
public void setMemoState(int value)
{
- set("memoState", String.valueOf(value));
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -492,14 +530,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -511,8 +550,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -523,7 +563,7 @@ public class QuestState
*/
public void setMemoStateEx(int slot, int value)
{
- set("memoStateEx" + slot, String.valueOf(value));
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -575,7 +615,7 @@ public class QuestState
{
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
}
@@ -683,7 +723,7 @@ public class QuestState
_player.sendPacket(new TutorialShowQuestionMark(number));
}
- // TODO make tutorial voices the same as quest sounds
+ // TODO: make tutorial voices the same as quest sounds
public void playTutorialVoice(String voice)
{
_player.sendPacket(new PlaySound(2, voice, 0, 0, _player.getX(), _player.getY(), _player.getZ()));
@@ -703,7 +743,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -712,7 +752,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java
index 5907113925..d9eca87d22 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/GmViewQuestInfo.java
@@ -64,7 +64,7 @@ public class GmViewQuestInfo implements IClientOutgoingPacket
continue;
}
- packet.writeD(qs.getInt("cond")); // stage of quest progress
+ packet.writeD(qs.getCond()); // stage of quest progress
}
return true;
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 2e9dba25ad..054ed59412 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -89,7 +89,7 @@ public class QuestList implements IClientOutgoingPacket
}
else
{
- packet.writeD(qs.getInt("cond"));
+ packet.writeD(qs.getCond());
}
}
packet.writeB(new byte[128]);
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
index ca30a274fe..94215baf44 100644
--- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
+++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/quests/Q00350_EnhanceYourWeapon/Q00350_EnhanceYourWeapon.java
@@ -222,10 +222,6 @@ public class Q00350_EnhanceYourWeapon extends Quest
String htmltext = getNoQuestMsg(player);
if (qs.getState() == State.CREATED)
- {
- qs.set("cond", "0");
- }
- if (qs.getInt("cond") == 0)
{
htmltext = npc.getId() + "-01.htm";
}
diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
index 20f2fc7da9..38667121f3 100644
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java
@@ -336,7 +336,7 @@ public class AdminShowQuests implements IAdminCommandHandler
{
qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target);
qs.setState(State.STARTED);
- qs.set("cond", "1");
+ qs.setCond(1);
target.sendPacket(new QuestList(target));
target.sendPacket(new ExShowQuestMark(qs.getQuest().getId(), qs.getCond()));
val[0] = qs.getQuest().getName();
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/quest/QuestState.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/quest/QuestState.java
index 4264d72834..4dd252076a 100644
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/quest/QuestState.java
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/quest/QuestState.java
@@ -40,6 +40,12 @@ public class QuestState
{
protected static final Logger LOGGER = Logger.getLogger(QuestState.class.getName());
+ // Constants
+ private static final String COND_VAR = "cond";
+ private static final String RESTART_VAR = "restartTime";
+ private static final String MEMO_VAR = "memoState";
+ private static final String MEMO_EX_VAR = "memoStateEx";
+
/** The name of the quest of this QuestState */
private final String _questName;
@@ -49,6 +55,9 @@ public class QuestState
/** The current state of the quest */
private byte _state;
+ /** The current condition of the quest */
+ private int _cond = 0;
+
/** Used for simulating Quest onTalk */
private boolean _simulated = false;
@@ -156,10 +165,12 @@ public class QuestState
{
return;
}
+
if (_state == state)
{
return;
}
+
final boolean newQuest = isCreated();
_state = state;
if (saveInDb)
@@ -179,10 +190,10 @@ public class QuestState
/**
* Add parameter used in quests.
- * @param var String pointing out the name of the variable for quest
+ * @param variable String pointing out the name of the variable for quest
* @param value String pointing out the value of the variable for quest
*/
- public void setInternal(String var, String value)
+ public void setInternal(String variable, String value)
{
if (_simulated)
{
@@ -196,20 +207,32 @@ public class QuestState
if (value == null)
{
- _vars.put(var, "");
+ _vars.put(variable, "");
return;
}
- _vars.put(var, value);
+ if (COND_VAR.equals(variable))
+ {
+ try
+ {
+ _cond = Integer.parseInt(value);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+
+ _vars.put(variable, value);
}
- public void set(String var, int value)
+ public void set(String variable, int value)
{
if (_simulated)
{
return;
}
- set(var, Integer.toString(value));
+
+ set(variable, Integer.toString(value));
}
/**
@@ -223,10 +246,10 @@ public class QuestState
* The key is known as existing if the preceding value of the key (given as result of function put()) is not null.
* If the key doesn't exist, the couple is added/created in the database
*
- * @param var String indicating the name of the variable for quest
- * @param val String indicating the value of the variable for quest
+ * @param variable String indicating the name of the variable for quest
+ * @param value String indicating the value of the variable for quest
*/
- public void set(String var, String val)
+ public void set(String variable, String value)
{
if (_simulated)
{
@@ -238,23 +261,23 @@ public class QuestState
_vars = new HashMap<>();
}
- String value = val;
- if (value == null)
+ String newValue = value;
+ if (newValue == null)
{
- value = "";
+ newValue = "";
}
- final String old = _vars.put(var, value);
+ final String old = _vars.put(variable, newValue);
if (old != null)
{
- Quest.updateQuestVarInDb(this, var, value);
+ Quest.updateQuestVarInDb(this, variable, newValue);
}
else
{
- Quest.createQuestVarInDb(this, var, value);
+ Quest.createQuestVarInDb(this, variable, newValue);
}
- if ("cond".equals(var))
+ if (COND_VAR.equals(variable))
{
try
{
@@ -263,16 +286,25 @@ public class QuestState
{
previousVal = Integer.parseInt(old);
}
- catch (Exception ex)
+ catch (Exception ignored)
{
- previousVal = 0;
}
- setCond(Integer.parseInt(value), previousVal);
+ int newCond = 0;
+ try
+ {
+ newCond = Integer.parseInt(newValue);
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ _cond = newCond;
+ setCond(newCond, previousVal);
getQuest().sendNpcLogList(getPlayer());
}
catch (Exception e)
{
- LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + value + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
+ LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + newValue + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
}
}
}
@@ -373,9 +405,9 @@ public class QuestState
/**
* Removes a quest variable from the list of existing quest variables.
- * @param var the name of the variable to remove
+ * @param variable the name of the variable to remove
*/
- public void unset(String var)
+ public void unset(String variable)
{
if (_simulated)
{
@@ -387,54 +419,60 @@ public class QuestState
return;
}
- final String old = _vars.remove(var);
+ final String old = _vars.remove(variable);
if (old != null)
{
- Quest.deleteQuestVarInDb(this, var);
+ if (COND_VAR.equals(variable))
+ {
+ _cond = 0;
+ }
+
+ Quest.deleteQuestVarInDb(this, variable);
}
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the value of the variable from the list of quest variables
*/
- public String get(String var)
+ public String get(String variable)
{
if (_vars == null)
{
return null;
}
- return _vars.get(var);
+
+ return _vars.get(variable);
}
/**
- * @param var the name of the variable to get
+ * @param variable the name of the variable to get
* @return the integer value of the variable or 0 if the variable does not exist or its value is not an integer
*/
- public int getInt(String var)
+ public int getInt(String variable)
{
if (_vars == null)
{
return 0;
}
- final String variable = _vars.get(var);
- if ((variable == null) || variable.isEmpty())
+ final String varStr = _vars.get(variable);
+ if ((varStr == null) || varStr.isEmpty())
{
return 0;
}
- int varint = 0;
+ int varInt = 0;
try
{
- varint = Integer.parseInt(variable);
+ varInt = Integer.parseInt(varStr);
}
catch (NumberFormatException nfe)
{
- LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
+ LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + variable + "), tried to parse a non-integer value (" + varStr + "). Char Id: " + _player.getObjectId(), nfe);
}
- return varint;
+ return varInt;
}
/**
@@ -445,7 +483,7 @@ public class QuestState
*/
public boolean isCond(int condition)
{
- return getInt("cond") == condition;
+ return _cond == condition;
}
/**
@@ -463,7 +501,7 @@ public class QuestState
if (isStarted())
{
- set("cond", Integer.toString(value));
+ set(COND_VAR, Integer.toString(value));
}
}
@@ -474,7 +512,21 @@ public class QuestState
{
if (isStarted())
{
- int val = getInt("cond");
+ return _cond;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get bit set representing completed conds.
+ * @return if none cond is set {@code 0}, otherwise cond bit set.
+ */
+ public int getCondBitSet()
+ {
+ if (isStarted())
+ {
+ int val = getInt(COND_VAR);
if ((val & 0x80000000) != 0)
{
val &= 0x7fffffff;
@@ -524,7 +576,8 @@ public class QuestState
{
return;
}
- set("cond", String.valueOf(value));
+
+ set(COND_VAR, String.valueOf(value));
if (playQuestMiddle)
{
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_MIDDLE.getPacket());
@@ -537,7 +590,8 @@ public class QuestState
{
return;
}
- set("memoState", String.valueOf(value));
+
+ set(MEMO_VAR, String.valueOf(value));
}
/**
@@ -547,14 +601,15 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoState");
+ return getInt(MEMO_VAR);
}
+
return 0;
}
public boolean isMemoState(int memoState)
{
- return getInt("memoState") == memoState;
+ return getInt(MEMO_VAR) == memoState;
}
/**
@@ -566,8 +621,9 @@ public class QuestState
{
if (isStarted())
{
- return getInt("memoStateEx" + slot);
+ return getInt(MEMO_EX_VAR + slot);
}
+
return 0;
}
@@ -582,7 +638,8 @@ public class QuestState
{
return;
}
- set("memoStateEx" + slot, String.valueOf(value));
+
+ set(MEMO_EX_VAR + slot, String.valueOf(value));
}
/**
@@ -613,6 +670,7 @@ public class QuestState
{
return;
}
+
_isExitQuestOnCleanUp = isExitQuestOnCleanUp;
}
@@ -626,9 +684,10 @@ public class QuestState
{
return;
}
+
if (isCreated() && !getQuest().isCustomQuest())
{
- set("cond", "1");
+ set(COND_VAR, "1");
setState(State.STARTED);
_player.sendPacket(QuestSound.ITEMSOUND_QUEST_ACCEPT.getPacket());
getQuest().sendNpcLogList(getPlayer());
@@ -686,6 +745,7 @@ public class QuestState
{
return;
}
+
exitQuest(type);
if (playExitQuest)
{
@@ -776,7 +836,7 @@ public class QuestState
}
reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour());
reDo.set(Calendar.MINUTE, getQuest().getResetMinutes());
- set("restartTime", String.valueOf(reDo.getTimeInMillis()));
+ set(RESTART_VAR, String.valueOf(reDo.getTimeInMillis()));
}
/**
@@ -785,7 +845,7 @@ public class QuestState
*/
public boolean isNowAvailable()
{
- final String val = get("restartTime");
+ final String val = get(RESTART_VAR);
return (val != null) && (Long.parseLong(val) <= Chronos.currentTimeMillis());
}
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
index 8e687b18c5..d906cfdf58 100644
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/QuestList.java
@@ -58,7 +58,7 @@ public class QuestList implements IClientOutgoingPacket
for (QuestState qs : _activeQuests)
{
packet.writeD(qs.getQuest().getId());
- packet.writeD(qs.getCond());
+ packet.writeD(qs.getCondBitSet());
}
packet.writeB(_oneTimeQuestMask);
return true;