actual freya branch
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<html><body>Rignos:<br>
|
||||
Welcome, welcome! I am Rignos. Parme and I are old friends, so I've come here to help. It's been a long time since I've traveled this far, but beautiful Isle of Prayer always makes me feel like I'm on vacation. Now then, how can I help? A race! You know I always say, "Joy and energy, all the time and in every way!" I call it the <font color="LEVEL">Grand Isle of Prayer Race</font>!<br>
|
||||
You're a little late, though -- the race is already underway!<br>
|
||||
Come back another time.
|
||||
</body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><body>Rignos:<br>
|
||||
Great! You collected 4 ride medals? You does not cheat and not copy them, yes?<br>
|
||||
Then take this key -- you will need it for saving Parme!<br>
|
||||
<a action="bypass -h Quest IOPRace finish">Exchange ride medals to the Secret Garden Key.</a>
|
||||
</body></html>
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package custom.IOPRace;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.SkillTable;
|
||||
import com.l2jserver.gameserver.model.L2Skill;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.model.quest.QuestState;
|
||||
|
||||
public class IOPRace extends Quest
|
||||
{
|
||||
final private static int RIGNOS = 32349;
|
||||
final private static int STAMP = 10013;
|
||||
final private static int KEY = 9694;
|
||||
|
||||
private int _player = -1;
|
||||
|
||||
public IOPRace(int id, String name, String descr)
|
||||
{
|
||||
super(id, name, descr);
|
||||
addStartNpc(RIGNOS);
|
||||
addTalkId(RIGNOS);
|
||||
addFirstTalkId(RIGNOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
QuestState st = player.getQuestState(getName());
|
||||
if (st == null)
|
||||
st = newQuestState(player);
|
||||
|
||||
if (player.getLevel() < 78)
|
||||
return "32349-notavailable.htm";
|
||||
else if ((_player != -1) && (_player == player.getObjectId()) && (st.getQuestItemsCount(STAMP) == 4))
|
||||
return "32349-return.htm";
|
||||
else if (_player != -1)
|
||||
return "32349-notavailable.htm";
|
||||
|
||||
npc.showChatWindow(player);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
QuestState st = player.getQuestState(getName());
|
||||
if (st == null)
|
||||
st = newQuestState(player);
|
||||
|
||||
if (_player == -1)
|
||||
{
|
||||
// clean old data
|
||||
player.stopSkillEffects(5239);
|
||||
if (player.getPet() != null)
|
||||
player.getPet().stopSkillEffects(5239);
|
||||
|
||||
st.takeItems(STAMP, -1);
|
||||
st.set("1st", "0");
|
||||
st.set("2nd", "0");
|
||||
st.set("3rd", "0");
|
||||
st.set("4th", "0");
|
||||
|
||||
L2Skill skill = SkillTable.getInstance().getInfo(5239, 5);
|
||||
if (skill != null)
|
||||
{
|
||||
skill.getEffects(npc, player);
|
||||
if (player.getPet() != null)
|
||||
skill.getEffects(npc, player.getPet());
|
||||
}
|
||||
|
||||
startQuestTimer("timer", 1800000, null, null); // 30 min
|
||||
_player = player.getObjectId();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
|
||||
if (event.equalsIgnoreCase("timer"))
|
||||
{
|
||||
_player = -1;
|
||||
return null;
|
||||
}
|
||||
else if (event.equalsIgnoreCase("finish"))
|
||||
{
|
||||
if (_player == player.getObjectId())
|
||||
{
|
||||
QuestState st = player.getQuestState(getName());
|
||||
st.giveItems(KEY, 3);
|
||||
st.takeItems(STAMP, -1);
|
||||
st.exitQuest(true);
|
||||
}
|
||||
}
|
||||
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new IOPRace(-1, "IOPRace", "custom");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user