|
@@ -122,6 +122,7 @@ public final class QuestState
|
|
|
|
|
|
/**
|
|
|
* @return the current State of this QuestState
|
|
|
+ * @see com.l2jserver.gameserver.model.quest.State
|
|
|
*/
|
|
|
public byte getState()
|
|
|
{
|
|
@@ -130,6 +131,7 @@ public final class QuestState
|
|
|
|
|
|
/**
|
|
|
* @return {@code true} if the State of this QuestState is CREATED, {@code false} otherwise
|
|
|
+ * @see com.l2jserver.gameserver.model.quest.State
|
|
|
*/
|
|
|
public boolean isCreated()
|
|
|
{
|
|
@@ -138,6 +140,7 @@ public final class QuestState
|
|
|
|
|
|
/**
|
|
|
* @return {@code true} if the State of this QuestState is STARTED, {@code false} otherwise
|
|
|
+ * @see com.l2jserver.gameserver.model.quest.State
|
|
|
*/
|
|
|
public boolean isStarted()
|
|
|
{
|
|
@@ -146,6 +149,7 @@ public final class QuestState
|
|
|
|
|
|
/**
|
|
|
* @return {@code true} if the State of this QuestState is COMPLETED, {@code false} otherwise
|
|
|
+ * @see com.l2jserver.gameserver.model.quest.State
|
|
|
*/
|
|
|
public boolean isCompleted()
|
|
|
{
|
|
@@ -156,6 +160,7 @@ public final class QuestState
|
|
|
* @param state the new state of the quest to set
|
|
|
* @return {@code true} if state was changed, {@code false} otherwise
|
|
|
* @see #setState(byte state, boolean saveInDb)
|
|
|
+ * @see com.l2jserver.gameserver.model.quest.State
|
|
|
*/
|
|
|
public boolean setState(byte state)
|
|
|
{
|
|
@@ -167,6 +172,7 @@ public final class QuestState
|
|
|
* @param state the new state of the quest to set
|
|
|
* @param saveInDb if {@code true}, will save the state change in the database
|
|
|
* @return {@code true} if state was changed, {@code false} otherwise
|
|
|
+ * @see com.l2jserver.gameserver.model.quest.State
|
|
|
*/
|
|
|
public boolean setState(byte state, boolean saveInDb)
|
|
|
{
|
|
@@ -216,7 +222,7 @@ public final class QuestState
|
|
|
|
|
|
public String set(String var, int val)
|
|
|
{
|
|
|
- return set(var, String.valueOf(val));
|
|
|
+ return set(var, Integer.toString(val));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -537,7 +543,7 @@ public final class QuestState
|
|
|
{
|
|
|
if (isStarted())
|
|
|
{
|
|
|
- set("cond", String.valueOf(value));
|
|
|
+ set("cond", Integer.toString(value));
|
|
|
}
|
|
|
return this;
|
|
|
}
|
|
@@ -585,7 +591,7 @@ public final class QuestState
|
|
|
|
|
|
if (playQuestMiddle)
|
|
|
{
|
|
|
- playSound(QuestSound.ITEMSOUND_QUEST_MIDDLE);
|
|
|
+ Quest.playSound(_player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
|
|
|
}
|
|
|
return this;
|
|
|
}
|
|
@@ -613,7 +619,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public long getQuestItemsCount(int itemId)
|
|
|
{
|
|
|
- return Quest.getQuestItemsCount(getPlayer(), itemId);
|
|
|
+ return Quest.getQuestItemsCount(_player, itemId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -622,7 +628,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public boolean hasQuestItems(int itemId)
|
|
|
{
|
|
|
- return Quest.hasQuestItems(getPlayer(), itemId);
|
|
|
+ return Quest.hasQuestItems(_player, itemId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -631,7 +637,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public boolean hasQuestItems(int... itemIds)
|
|
|
{
|
|
|
- return Quest.hasQuestItems(getPlayer(), itemIds);
|
|
|
+ return Quest.hasQuestItems(_player, itemIds);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -641,7 +647,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public int getEnchantLevel(int itemId)
|
|
|
{
|
|
|
- return Quest.getEnchantLevel(getPlayer(), itemId);
|
|
|
+ return Quest.getEnchantLevel(_player, itemId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -661,7 +667,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public void rewardItems(int itemId, long count)
|
|
|
{
|
|
|
- Quest.rewardItems(getPlayer(), itemId, count);
|
|
|
+ Quest.rewardItems(_player, itemId, count);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -671,22 +677,22 @@ public final class QuestState
|
|
|
*/
|
|
|
public void giveItems(int itemId, long count)
|
|
|
{
|
|
|
- giveItems(itemId, count, 0);
|
|
|
+ Quest.giveItems(_player, itemId, count, 0);
|
|
|
}
|
|
|
|
|
|
public void giveItems(ItemHolder holder)
|
|
|
{
|
|
|
- giveItems(holder.getId(), holder.getCount(), 0);
|
|
|
+ Quest.giveItems(_player, holder.getId(), holder.getCount(), 0);
|
|
|
}
|
|
|
|
|
|
public void giveItems(int itemId, long count, int enchantlevel)
|
|
|
{
|
|
|
- Quest.giveItems(getPlayer(), itemId, count, enchantlevel);
|
|
|
+ Quest.giveItems(_player, itemId, count, enchantlevel);
|
|
|
}
|
|
|
|
|
|
public void giveItems(int itemId, long count, byte attributeId, int attributeLevel)
|
|
|
{
|
|
|
- Quest.giveItems(getPlayer(), itemId, count, attributeId, attributeLevel);
|
|
|
+ Quest.giveItems(_player, itemId, count, attributeId, attributeLevel);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -700,12 +706,12 @@ public final class QuestState
|
|
|
*/
|
|
|
public boolean dropQuestItems(int itemId, int count, long neededCount, int dropChance, boolean sound)
|
|
|
{
|
|
|
- return dropQuestItems(itemId, count, count, neededCount, dropChance, sound);
|
|
|
+ return Quest.dropQuestItems(_player, itemId, count, count, neededCount, dropChance, sound);
|
|
|
}
|
|
|
|
|
|
public boolean dropQuestItems(int itemId, int minCount, int maxCount, long neededCount, int dropChance, boolean sound)
|
|
|
{
|
|
|
- return Quest.dropQuestItems(getPlayer(), itemId, minCount, maxCount, neededCount, dropChance, sound);
|
|
|
+ return Quest.dropQuestItems(_player, itemId, minCount, maxCount, neededCount, dropChance, sound);
|
|
|
}
|
|
|
|
|
|
// TODO: More radar functions need to be added when the radar class is complete.
|
|
@@ -739,7 +745,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public void takeItems(int itemId, long count)
|
|
|
{
|
|
|
- Quest.takeItems(getPlayer(), itemId, count);
|
|
|
+ Quest.takeItems(_player, itemId, count);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -748,7 +754,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public void playSound(String sound)
|
|
|
{
|
|
|
- Quest.playSound(getPlayer(), sound);
|
|
|
+ Quest.playSound(_player, sound);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -757,7 +763,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public void playSound(QuestSound sound)
|
|
|
{
|
|
|
- Quest.playSound(getPlayer(), sound);
|
|
|
+ Quest.playSound(_player, sound);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -767,7 +773,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public void addExpAndSp(int exp, int sp)
|
|
|
{
|
|
|
- Quest.addExpAndSp(getPlayer(), exp, sp);
|
|
|
+ Quest.addExpAndSp(_player, exp, sp);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -776,7 +782,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public int getItemEquipped(int loc)
|
|
|
{
|
|
|
- return Quest.getItemEquipped(getPlayer(), loc);
|
|
|
+ return Quest.getItemEquipped(_player, loc);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -803,7 +809,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public void startQuestTimer(String name, long time)
|
|
|
{
|
|
|
- getQuest().startQuestTimer(name, time, null, getPlayer(), false);
|
|
|
+ getQuest().startQuestTimer(name, time, null, _player, false);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -815,7 +821,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public void startQuestTimer(String name, long time, L2Npc npc)
|
|
|
{
|
|
|
- getQuest().startQuestTimer(name, time, npc, getPlayer(), false);
|
|
|
+ getQuest().startQuestTimer(name, time, npc, _player, false);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -826,7 +832,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public void startRepeatingQuestTimer(String name, long time)
|
|
|
{
|
|
|
- getQuest().startQuestTimer(name, time, null, getPlayer(), true);
|
|
|
+ getQuest().startQuestTimer(name, time, null, _player, true);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -838,7 +844,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public void startRepeatingQuestTimer(String name, long time, L2Npc npc)
|
|
|
{
|
|
|
- getQuest().startQuestTimer(name, time, npc, getPlayer(), true);
|
|
|
+ getQuest().startQuestTimer(name, time, npc, _player, true);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -847,7 +853,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public final QuestTimer getQuestTimer(String name)
|
|
|
{
|
|
|
- return getQuest().getQuestTimer(name, null, getPlayer());
|
|
|
+ return getQuest().getQuestTimer(name, null, _player);
|
|
|
}
|
|
|
|
|
|
// --- Spawn methods ---
|
|
@@ -993,7 +999,7 @@ public final class QuestState
|
|
|
*/
|
|
|
public String showHtmlFile(String fileName)
|
|
|
{
|
|
|
- return getQuest().showHtmlFile(getPlayer(), fileName);
|
|
|
+ return getQuest().showHtmlFile(_player, fileName);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1128,6 +1134,10 @@ public final class QuestState
|
|
|
_player.sendPacket(new PlaySound(2, voice, 0, 0, _player.getX(), _player.getY(), _player.getZ()));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Used only in 255_Tutorial
|
|
|
+ * @param html
|
|
|
+ */
|
|
|
public void showTutorialHTML(String html)
|
|
|
{
|
|
|
String text = HtmCache.getInstance().getHtm(_player.getHtmlPrefix(), "data/scripts/quests/255_Tutorial/" + html);
|
|
@@ -1139,11 +1149,18 @@ public final class QuestState
|
|
|
_player.sendPacket(new TutorialShowHtml(text));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Used only in 255_Tutorial
|
|
|
+ */
|
|
|
public void closeTutorialHtml()
|
|
|
{
|
|
|
_player.sendPacket(TutorialCloseHtml.STATIC_PACKET);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Used only in 255_Tutorial
|
|
|
+ * @param number
|
|
|
+ */
|
|
|
public void onTutorialClientEvent(int number)
|
|
|
{
|
|
|
_player.sendPacket(new TutorialEnableClientEvent(number));
|