diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index c2c7b4f0f3beeb253b1b5640cd8cc5595369fe87..bbcf29a3dc81d665ffb4b25fd5eec5dab7743dd8 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -290,7 +290,7 @@ hellbound/TullyWorkshop/TullyWorkshop.java # Quests Section quests/SagasScripts/SagasSuperClass.java quests/TerritoryWarScripts/TerritoryWarSuperClass.java -quests/1_LettersOfLove1/__init__.py +quests/Q00001_LettersOfLove/Q00001_LettersOfLove.java quests/2_WhatWomenWant1/__init__.py quests/3_ReleaseDarkelfElder1/__init__.py quests/4_LongLiveLordOfFlame/__init__.py @@ -614,6 +614,7 @@ quests/Q00450_GraveRobberRescue/Q00450_GraveRobberRescue.java quests/Q00451_LuciensAltar/Q00451_LuciensAltar.java quests/Q00452_FindingtheLostSoldiers/Q00452_FindingtheLostSoldiers.java quests/Q00453_NotStrongEnoughAlone/Q00453_NotStrongEnoughAlone.java +quests/Q00455_WingsOfSand/Q00455_WingsOfSand.java quests/Q00457_LostAndFound/Q00457_LostAndFound.java quests/Q00458_PerfectForm/Q00458_PerfectForm.java quests/Q00461_RumbleInTheBase/Q00461_RumbleInTheBase.java diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java index 6663272fbe60ea081f9c76bbaf9e3289088c3923..f026750915a6d624dd1e60d50c65c8259126f556 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java @@ -17,6 +17,7 @@ package handlers.admincommandhandlers; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; +import java.util.logging.Logger; import javolution.text.TextBuilder; @@ -35,17 +36,26 @@ import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jserver.gameserver.network.serverpackets.QuestList; /** - * @author Korvin - * con.close() change by Zoey76 24/02/2011 + * TODO: Rework and cleanup. + * @author Korvin, Zoey76 */ public class AdminShowQuests implements IAdminCommandHandler { - private static final String[] ADMIN_COMMANDS = + private static final Logger _log = Logger.getLogger(AdminShowQuests.class.getName()); + + private static final String[] ADMIN_COMMANDS = { "admin_charquestmenu", "admin_setcharquest" }; + private static final String[] _states = + { + "CREATED", + "STARTED", + "COMPLETED" + }; + @Override public boolean useAdminCommand(String command, L2PcInstance activeChar) { @@ -60,16 +70,36 @@ public class AdminShowQuests implements IAdminCommandHandler target = L2World.getInstance().getPlayer(cmdParams[1]); if (cmdParams.length > 2) { - if (cmdParams[2].equals("0")) { val[0] = "var"; val[1] = "Start"; } - if (cmdParams[2].equals("1")) { val[0] = "var"; val[1] = "Started"; } - if (cmdParams[2].equals("2")) { val[0] = "var"; val[1] = "Completed"; } - if (cmdParams[2].equals("3")) { val[0] = "full"; } - if (cmdParams[2].indexOf("_") != -1) { val[0] = "name"; val[1] = cmdParams[2]; } + if (cmdParams[2].equals("0")) + { + val[0] = "var"; + val[1] = "Start"; + } + if (cmdParams[2].equals("1")) + { + val[0] = "var"; + val[1] = "Started"; + } + if (cmdParams[2].equals("2")) + { + val[0] = "var"; + val[1] = "Completed"; + } + if (cmdParams[2].equals("3")) + { + val[0] = "full"; + } + if (cmdParams[2].indexOf("_") != -1) + { + val[0] = "name"; + val[1] = cmdParams[2]; + } if (cmdParams.length > 3) { if (cmdParams[3].equals("custom")) { - val[0] = "custom"; val[1] = cmdParams[2]; + val[0] = "custom"; + val[1] = cmdParams[2]; } } } @@ -78,8 +108,10 @@ public class AdminShowQuests implements IAdminCommandHandler { targetObject = activeChar.getTarget(); - if (targetObject != null && targetObject instanceof L2PcInstance) - target = (L2PcInstance) targetObject; + if ((targetObject != null) && targetObject.isPlayer()) + { + target = targetObject.getActingPlayer(); + } } if (target == null) @@ -91,15 +123,13 @@ public class AdminShowQuests implements IAdminCommandHandler if (command.startsWith("admin_charquestmenu")) { if (val[0] != null) - try { - showquestmenu(target,activeChar,val); + showQuestMenu(target, activeChar, val); } - catch (Exception e) + else { + showFirstQuestMenu(target, activeChar); } - else - showfirstquestmenu(target,activeChar); } else if (command.startsWith("admin_setcharquest")) { @@ -108,43 +138,39 @@ public class AdminShowQuests implements IAdminCommandHandler val[0] = cmdParams[2]; val[1] = cmdParams[3]; val[2] = cmdParams[4]; - if (cmdParams.length == 6) val[3] = cmdParams[5]; - try - { - setquestvar(target,activeChar,val); - } - catch (Exception e) + if (cmdParams.length == 6) { + val[3] = cmdParams[5]; } + setQuestVar(target, activeChar, val); } else + { return false; + } } return true; } - private void showfirstquestmenu(L2PcInstance target, L2PcInstance actor) + private static void showFirstQuestMenu(L2PcInstance target, L2PcInstance actor) { - TextBuilder replyMSG = new TextBuilder("<html><body><table width=270>" - + "<tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" - + "<td width=180><center>Player: "+target.getName()+"</center></td>" - + "<td width=45><button value=\"Back\" action=\"bypass -h admin_admin6\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table>"); + TextBuilder replyMSG = new TextBuilder("<html><body><table width=270><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Player: " + target.getName() + "</center></td><td width=45><button value=\"Back\" action=\"bypass -h admin_admin6\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table>"); NpcHtmlMessage adminReply = new NpcHtmlMessage(5); int ID = target.getObjectId(); - replyMSG.append("Quest Menu for <font color=\"LEVEL\">"+target.getName()+"</font> (ID:"+ID+")<br><center>"); - replyMSG.append("<table width=250><tr><td><button value=\"CREATED\" action=\"bypass -h admin_charquestmenu "+target.getName()+" 0\" width=85 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); - replyMSG.append("<tr><td><button value=\"STARTED\" action=\"bypass -h admin_charquestmenu "+target.getName()+" 1\" width=85 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); - replyMSG.append("<tr><td><button value=\"COMPLETED\" action=\"bypass -h admin_charquestmenu "+target.getName()+" 2\" width=85 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); - replyMSG.append("<tr><td><br><button value=\"All\" action=\"bypass -h admin_charquestmenu "+target.getName()+" 3\" width=85 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); + replyMSG.append("Quest Menu for <font color=\"LEVEL\">" + target.getName() + "</font> (ID:" + ID + ")<br><center>"); + replyMSG.append("<table width=250><tr><td><button value=\"CREATED\" action=\"bypass -h admin_charquestmenu " + target.getName() + " 0\" width=85 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); + replyMSG.append("<tr><td><button value=\"STARTED\" action=\"bypass -h admin_charquestmenu " + target.getName() + " 1\" width=85 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); + replyMSG.append("<tr><td><button value=\"COMPLETED\" action=\"bypass -h admin_charquestmenu " + target.getName() + " 2\" width=85 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); + replyMSG.append("<tr><td><br><button value=\"All\" action=\"bypass -h admin_charquestmenu " + target.getName() + " 3\" width=85 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); replyMSG.append("<tr><td><br><br>Manual Edit by Quest number:<br></td></tr>"); - replyMSG.append("<tr><td><edit var=\"qn\" width=50 height=15><br><button value=\"Edit\" action=\"bypass -h admin_charquestmenu "+target.getName()+" $qn custom\" width=50 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); + replyMSG.append("<tr><td><edit var=\"qn\" width=50 height=15><br><button value=\"Edit\" action=\"bypass -h admin_charquestmenu " + target.getName() + " $qn custom\" width=50 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); replyMSG.append("</table></center></body></html>"); adminReply.setHtml(replyMSG.toString()); actor.sendPacket(adminReply); } - private void showquestmenu(L2PcInstance target, L2PcInstance actor, String[] val) + private static void showQuestMenu(L2PcInstance target, L2PcInstance actor, String[] val) { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { @@ -157,44 +183,51 @@ public class AdminShowQuests implements IAdminCommandHandler if (val[0].equals("full")) { - replyMSG.append("<table width=250><tr><td>Full Quest List for <font color=\"LEVEL\">"+target.getName()+"</font> (ID:"+ID+")</td></tr>"); - req = con.prepareStatement("SELECT DISTINCT name FROM character_quests WHERE charId='" + ID +"' ORDER by name"); + replyMSG.append("<table width=250><tr><td>Full Quest List for <font color=\"LEVEL\">" + target.getName() + "</font> (ID:" + ID + ")</td></tr>"); + req = con.prepareStatement("SELECT DISTINCT name FROM character_quests WHERE charId='" + ID + "' AND var='<state>' ORDER by name"); req.execute(); rs = req.getResultSet(); - while(rs.next()) replyMSG.append("<tr><td><a action=\"bypass -h admin_charquestmenu " + target.getName() + " " + rs.getString(1) + "\">"+rs.getString(1)+"</a></td></tr>"); + while (rs.next()) + { + replyMSG.append("<tr><td><a action=\"bypass -h admin_charquestmenu " + target.getName() + " " + rs.getString(1) + "\">" + rs.getString(1) + "</a></td></tr>"); + } replyMSG.append("</table></body></html>"); } else if (val[0].equals("name")) { - String[] states = {"CREATED","STARTED","COMPLETED"}; - String state = states[target.getQuestState(val[1]).getState()]; - replyMSG.append("Character: <font color=\"LEVEL\">"+target.getName()+"</font><br>Quest: <font color=\"LEVEL\">"+val[1]+"</font><br>State: <font color=\"LEVEL\">"+state+"</font><br><br>"); + QuestState qs = target.getQuestState(val[1]); + String state = (qs != null) ? _states[qs.getState()] : "CREATED"; + replyMSG.append("Character: <font color=\"LEVEL\">" + target.getName() + "</font><br>Quest: <font color=\"LEVEL\">" + val[1] + "</font><br>State: <font color=\"LEVEL\">" + state + "</font><br><br>"); replyMSG.append("<center><table width=250><tr><td>Var</td><td>Value</td><td>New Value</td><td> </td></tr>"); - req = con.prepareStatement("SELECT var,value FROM character_quests WHERE charId='" + ID +"' and name='"+val[1]+"'"); + req = con.prepareStatement("SELECT var,value FROM character_quests WHERE charId='" + ID + "' and name='" + val[1] + "'"); req.execute(); rs = req.getResultSet(); - while(rs.next()){ + while (rs.next()) + { String var_name = rs.getString(1); if (var_name.equals("<state>")) { continue; } - replyMSG.append("<tr><td>"+var_name+"</td><td>"+rs.getString(2)+"</td><td><edit var=\"var"+var_name+"\" width=80 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+val[1]+" "+var_name+" $var"+var_name+"\" width=30 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Del\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+val[1]+" "+var_name+" delete\" width=30 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); + replyMSG.append("<tr><td>" + var_name + "</td><td>" + rs.getString(2) + "</td><td><edit var=\"var" + var_name + "\" width=80 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + val[1] + " " + var_name + " $var" + var_name + "\" width=30 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Del\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + val[1] + " " + var_name + " delete\" width=30 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); } replyMSG.append("</table><br><br><table width=250><tr><td>Repeatable quest:</td><td>Unrepeatable quest:</td></tr>"); - replyMSG.append("<tr><td><button value=\"Quest Complete\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+val[1]+" state COMLETED 1\" width=120 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"); - replyMSG.append("<td><button value=\"Quest Complete\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+val[1]+" state COMLETED 0\" width=120 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); - replyMSG.append("</table><br><br><font color=\"ff0000\">Delete Quest from DB:</font><br><button value=\"Quest Delete\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+val[1]+" state DELETE\" width=120 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"); + replyMSG.append("<tr><td><button value=\"Quest Complete\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + val[1] + " state COMPLETED 1\" width=120 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"); + replyMSG.append("<td><button value=\"Quest Complete\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + val[1] + " state COMPLETED 0\" width=120 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); + replyMSG.append("</table><br><br><font color=\"ff0000\">Delete Quest from DB:</font><br><button value=\"Quest Delete\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + val[1] + " state DELETE\" width=120 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"); replyMSG.append("</center></body></html>"); } else if (val[0].equals("var")) { - replyMSG.append("Character: <font color=\"LEVEL\">"+target.getName()+"</font><br>Quests with state: <font color=\"LEVEL\">"+val[1]+"</font><br>"); + replyMSG.append("Character: <font color=\"LEVEL\">" + target.getName() + "</font><br>Quests with state: <font color=\"LEVEL\">" + val[1] + "</font><br>"); replyMSG.append("<table width=250>"); - req = con.prepareStatement("SELECT DISTINCT name FROM character_quests WHERE charId='" + ID +"' and var='<state>' and value='"+val[1]+"'"); + req = con.prepareStatement("SELECT DISTINCT name FROM character_quests WHERE charId='" + ID + "' and var='<state>' and value='" + val[1] + "'"); req.execute(); rs = req.getResultSet(); - while(rs.next()) replyMSG.append("<tr><td><a action=\"bypass -h admin_charquestmenu " + target.getName() + " " + rs.getString(1) + "\">" + rs.getString(1)+"</a></td></tr>"); + while (rs.next()) + { + replyMSG.append("<tr><td><a action=\"bypass -h admin_charquestmenu " + target.getName() + " " + rs.getString(1) + "\">" + rs.getString(1) + "</a></td></tr>"); + } replyMSG.append("</table></body></html>"); } else if (val[0].equals("custom")) @@ -205,10 +238,8 @@ public class AdminShowQuests implements IAdminCommandHandler String state = null; String qname = null; QuestState qs = null; - String[] states = {"CREATED","STARTED","COMPLETED"}; Quest quest = QuestManager.getInstance().getQuest(qnumber); - if (quest != null) { qname = quest.getName(); @@ -221,46 +252,51 @@ public class AdminShowQuests implements IAdminCommandHandler if (qs != null) { - state = states[qs.getState()]; + state = _states[qs.getState()]; + } + else + { + exqch = false; + state = "N/A"; } - else { exqch = false; state = "N/A"; } - if(exqdb) + if (exqdb) { - if(exqch) { - replyMSG.append("Character: <font color=\"LEVEL\">"+target.getName()+"</font><br>Quest: <font color=\"LEVEL\">"+qname+"</font><br>State: <font color=\"LEVEL\">"+state+"</font><br><br>"); + if (exqch) + { + replyMSG.append("Character: <font color=\"LEVEL\">" + target.getName() + "</font><br>Quest: <font color=\"LEVEL\">" + qname + "</font><br>State: <font color=\"LEVEL\">" + state + "</font><br><br>"); replyMSG.append("<center><table width=250><tr><td>Var</td><td>Value</td><td>New Value</td><td> </td></tr>"); - req = con.prepareStatement("SELECT var,value FROM character_quests WHERE charId='" + ID +"' and name='"+qname+"'"); + req = con.prepareStatement("SELECT var,value FROM character_quests WHERE charId='" + ID + "' and name='" + qname + "'"); req.execute(); rs = req.getResultSet(); - while(rs.next()) + while (rs.next()) { String var_name = rs.getString(1); if (var_name.equals("<state>")) { continue; } - replyMSG.append("<tr><td>"+var_name+"</td><td>"+rs.getString(2)+"</td><td><edit var=\"var"+var_name+"\" width=80 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+qname+" "+var_name+" $var"+var_name+"\" width=30 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Del\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+qname+" "+var_name+" delete\" width=30 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); + replyMSG.append("<tr><td>" + var_name + "</td><td>" + rs.getString(2) + "</td><td><edit var=\"var" + var_name + "\" width=80 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + qname + " " + var_name + " $var" + var_name + "\" width=30 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Del\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + qname + " " + var_name + " delete\" width=30 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); } replyMSG.append("</table><br><br><table width=250><tr><td>Repeatable quest:</td><td>Unrepeatable quest:</td></tr>"); - replyMSG.append("<tr><td><button value=\"Quest Complete\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+qname+" state COMLETED 1\" width=100 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"); - replyMSG.append("<td><button value=\"Quest Complete\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+qname+" state COMLETED 0\" width=100 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); - replyMSG.append("</table><br><br><font color=\"ff0000\">Delete Quest from DB:</font><br><button value=\"Quest Delete\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+qname+" state DELETE\" width=100 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"); + replyMSG.append("<tr><td><button value=\"Quest Complete\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + qname + " state COMPLETED 1\" width=100 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"); + replyMSG.append("<td><button value=\"Quest Complete\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + qname + " state COMPLETED 0\" width=100 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>"); + replyMSG.append("</table><br><br><font color=\"ff0000\">Delete Quest from DB:</font><br><button value=\"Quest Delete\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + qname + " state DELETE\" width=100 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"); replyMSG.append("</center></body></html>"); } else { - replyMSG.append("Character: <font color=\"LEVEL\">"+target.getName()+"</font><br>Quest: <font color=\"LEVEL\">"+qname+"</font><br>State: <font color=\"LEVEL\">"+state+"</font><br><br>"); + replyMSG.append("Character: <font color=\"LEVEL\">" + target.getName() + "</font><br>Quest: <font color=\"LEVEL\">" + qname + "</font><br>State: <font color=\"LEVEL\">" + state + "</font><br><br>"); replyMSG.append("<center>Start this Quest for player:<br>"); - replyMSG.append("<button value=\"Create Quest\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+qnumber+" state CREATE\" width=100 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br>"); + replyMSG.append("<button value=\"Create Quest\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + qnumber + " state CREATE\" width=100 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br>"); replyMSG.append("<font color=\"ee0000\">Only for Unrepeateble quests:</font><br>"); - replyMSG.append("<button value=\"Create & Complete\" action=\"bypass -h admin_setcharquest "+target.getName()+" "+qnumber+" state CC\" width=130 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br>"); + replyMSG.append("<button value=\"Create & Complete\" action=\"bypass -h admin_setcharquest " + target.getName() + " " + qnumber + " state CC\" width=130 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br>"); replyMSG.append("</center></body></html>"); } } else { - replyMSG.append("<center><font color=\"ee0000\">Quest with number </font><font color=\"LEVEL\">"+qnumber+"</font><font color=\"ee0000\"> doesn't exist!</font></center></body></html>"); + replyMSG.append("<center><font color=\"ee0000\">Quest with number </font><font color=\"LEVEL\">" + qnumber + "</font><font color=\"ee0000\"> doesn't exist!</font></center></body></html>"); } } adminReply.setHtml(replyMSG.toString()); @@ -268,29 +304,29 @@ public class AdminShowQuests implements IAdminCommandHandler } catch (Exception e) { - actor.sendMessage("Error!"); + actor.sendMessage("There was an error."); + _log.warning(AdminShowQuests.class.getSimpleName() + ": " + e.getMessage()); } } - private void setquestvar(L2PcInstance target, L2PcInstance actor, String[] val) + private static void setQuestVar(L2PcInstance target, L2PcInstance actor, String[] val) { QuestState qs = target.getQuestState(val[0]); String[] outval = new String[3]; - if(val[1].equals("state")) + if (val[1].equals("state")) { - if(val[2].equals("COMLETED")) + if (val[2].equals("COMPLETED")) { qs.exitQuest((val[3].equals("1")) ? true : false); } - else if(val[2].equals("DELETE")) + else if (val[2].equals("DELETE")) { - qs.getQuest(); - Quest.deleteQuestInDb(qs, false); + Quest.deleteQuestInDb(qs, true); target.sendPacket(new QuestList()); target.sendPacket(new ExShowQuestMark(qs.getQuest().getQuestIntId())); } - else if(val[2].equals("CREATE")) + else if (val[2].equals("CREATE")) { qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target); qs.setState(State.STARTED); @@ -299,7 +335,7 @@ public class AdminShowQuests implements IAdminCommandHandler target.sendPacket(new ExShowQuestMark(qs.getQuest().getQuestIntId())); val[0] = qs.getQuest().getName(); } - else if(val[2].equals("CC")) + else if (val[2].equals("CC")) { qs = QuestManager.getInstance().getQuest(Integer.parseInt(val[0])).newQuestState(target); qs.exitQuest(false); @@ -310,23 +346,21 @@ public class AdminShowQuests implements IAdminCommandHandler } else { - if(val[2].equals("delete")) + if (val[2].equals("delete")) + { qs.unset(val[1]); + } else + { qs.set(val[1], val[2]); + } target.sendPacket(new QuestList()); target.sendPacket(new ExShowQuestMark(qs.getQuest().getQuestIntId())); } actor.sendMessage(""); outval[0] = "name"; outval[1] = val[0]; - try - { - showquestmenu(target,actor,outval); - } - catch(Exception e) - { - } + showQuestMenu(target, actor, outval); } @Override diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java b/L2J_DataPack_BETA/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java index 29f10943058bc2b5e84564d753e8bb47e905b973..79131753c80bedc4cf3be7a425f253b5d5cda425 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java @@ -900,7 +900,7 @@ public class FinalEmperialTomb extends Quest if (rnd < element.chance) { _world.OnSong = element; - broadCastPacket(_world, new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 4000, false, null, element.songName)); + broadCastPacket(_world, new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 4000, false, null, element.songName, null)); broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, element.skill.getSkillId(), element.skill.getSkillLvl(), element.skill.getSkill().getHitTime(), 0)); _world.songEffectTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 1), element.skill.getSkill().getHitTime() - 10000); _world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), element.skill.getSkill().getHitTime()); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30006-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30006-01.htm deleted file mode 100644 index ec03fbc3e6f412b3730f6e865787f3278d80dd11..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30006-01.htm +++ /dev/null @@ -1,5 +0,0 @@ -<html><body>Roxxy:<br> -Oh my, a letter for me...? From Darin... Yes, of course I know him. I thought he had feelings for me and, actually, I like him too. I think he is a very fine person. Of course, there is that trifling matter of him being so timid...<br> -I've been waiting for him to come and talk to me, but I guess he couldn't go through with it after all, and had to ask you. Ha... well, that's okay, I don't mind.<br> -Here, please give Darin my<font color="LEVEL"> handkerchief</font>. And please deliver my message to our shy Darin that I will accept his affections with all my heart. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30006-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30006-02.htm deleted file mode 100644 index 360516266015be041ee3c30b2cd72de1b9454a50..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30006-02.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>Roxxy:<br> -I see you haven't left yet. Isn't Darin anxiously waiting for you to return? Please deliver my message to him right away, and don't make him wait. I'd like to see his happy face as soon as possible. I'm sure he will gather enough courage together once he knows my feelings, don't you think? -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30006-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30006-03.htm deleted file mode 100644 index 6577e38fcb5a2671204a4a19b3b3b8f0a648024c..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30006-03.htm +++ /dev/null @@ -1,4 +0,0 @@ -<html><body>Roxxy:<br> -Have you given Darin my handkerchief? What did he say? I thought he would rush right over and ask permission to court me... He is so timid!<br> -Of course, that is part of what makes him so attractive... For some reason, it brings out my maternal side. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30033-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30033-01.htm deleted file mode 100644 index aa584f1bedb3fd4e92a649a00ff33732a178804e..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30033-01.htm +++ /dev/null @@ -1,4 +0,0 @@ -<html><body>Magister Baulro:<br> -Huh? Darin's receipt? Ah, the magic potion. Darin is a fine lad, but he is too shy for his own good. It's good to hear that he's finally made up his mind to go and talk to Roxxy.<br> -Please deliver this to Darin now. Actually... don't tell him, but the contents of this bottle is plain water from the well in front of the temple. The talk about magic potions that have been handed down from generation to generation... well, those are stories that I made up to encourage Darin. This potion is no different from plain old water. I would appreciate it if you don't tell and just give this<font color="LEVEL"> magic potion</font> to Darin. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30033-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30033-02.htm deleted file mode 100644 index 59f1d8f17bb910a16638939132d23b374f83e5ab..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30033-02.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>Magister Baulro:<br> -Now, go and give Darin the potion that I have given you. I'm sure he is anxiously waiting for you to return. -</body></html> diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-01.htm deleted file mode 100644 index e64dcf23058985f40484187b38c6f7a9cee8d733..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-01.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>Darin:<br> -Do you know what is more dangerous than a Knight's sword or a Mystic -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-02.htm deleted file mode 100644 index 89669be6e0cab86b9379a5dbca2d56542642fd56..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-02.htm +++ /dev/null @@ -1,4 +0,0 @@ -<html><body>Darin:<br> -Do you know what is more frightening than a knight's sword or a magician's spell? It's love. Love comes unexpectedly, swallows up your soul, and never lets go. I am suffering, because of this "love" that the minstrels sing their silly ballads and noble ladies gossip about. I have no desire or appetite... I hate myself for being this way.<br> -<a action="bypass -h Quest 1_LettersOfLove1 30048-03.htm">Ask whom he loves.</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-03.htm deleted file mode 100644 index 032a73e27c4c057ceed4cc666ae9b0a556364d9b..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-03.htm +++ /dev/null @@ -1,5 +0,0 @@ -<html><body>Darin:<br> -The woman who has stolen my heart and taught me what it feels like to fall in love is<font color="LEVEL"> Roxxy</font>. Do you know her? She's our village Gatekeeper.<br> -<a action="bypass -h Quest 1_LettersOfLove1 30048-04.htm">Say that you do not know her</a><br> -<a action="bypass -h Quest 1_LettersOfLove1 30048-05.htm">Say that you know Roxxy</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-04.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-04.htm deleted file mode 100644 index ce0e30f6c3357e197ec0dd5f9d7b431559ded098..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-04.htm +++ /dev/null @@ -1,6 +0,0 @@ -<html><body>Darin:<br> -What, you don't know? How could you not know? Roxxy is the most beautiful woman on Talking Island... She's also very talented and knowledgeable in the ways of magic. They say she studied at Oren's Ivory Tower. She's also a member of the Gatekeeper Guild that uses the "Gate of Time and Space" to connect many villages.<br> -So how could such a great woman... accept my love? I think about confessing my love to her hundreds of times each day, but then I give up. I just don't have the courage to do it. When I thought about what would happen if she were to reject me... I stop walking without realizing it. It's been a week since I wrote the letter for her, but I haven't sent it.<br> -Do you think I can ask you for a favor...? Can you... deliver my letter to Roxxy for me?<br> -<a action="bypass -h Quest 1_LettersOfLove1 30048-06.htm">Say that you will do what he asks.</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-05.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-05.htm deleted file mode 100644 index 4fa426c091568a29772ec97c0c7c722a788361a5..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-05.htm +++ /dev/null @@ -1,5 +0,0 @@ -<html><body>Darin:<br> -So you know as well. Then again, you don't see a beauty like Roxxy every day. Would a woman like her... be able to accept my feelings? I think about confessing my love to her hundreds of times each day, but ... I just don't have the courage to tell her. When I thought about what would happen if she were to reject me... well, let's just say it stops me cold. It's been a week since I wrote a <font color="LEVEL">confession letter,</font> but I can't bring it to her myself.<br> -Do you think I can ask you for a favor...? Would you... deliver my letter to Roxxy for me?<br> -<a action="bypass -h Quest 1_LettersOfLove1 30048-06.htm">Say that you will do what he asks.</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-06.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-06.htm deleted file mode 100644 index ed4c36fa9e777fe5ee40b5e784a01a11058e1ab4..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-06.htm +++ /dev/null @@ -1,4 +0,0 @@ -<html><body>Darin:<br> -Thank you! Thank you so much. Do you know where the Temple of Einhasad is in the village? Go to the well in front of the temple, and you will see Roxxy ...<br> -Please... give her this letter. Thank you! -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-07.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-07.htm deleted file mode 100644 index a0fa0e9978cc916f32f9f1dc4797b13711f11e9c..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-07.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>Darin:<br> -You haven't been able to meet Roxxy yet? I am so nervous and anxious, waiting for her reply... I beg of you, please hurry. Please deliver my letter to Roxxy. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-08.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-08.htm deleted file mode 100644 index 63d801fbd263150d60be1ef44df8b9028403f243..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-08.htm +++ /dev/null @@ -1,5 +0,0 @@ -<html><body>Darin:<br> -Roxxy's kerchief! She likes me! It seems like a dream... Thank you! This is all thanks to you!<br> -Before the sun sets today... I must ask her permission to court her. I need to go and buy flowers, get dressed... But there's no time. I should hurry. Oh, and I'm really sorry, but would you do me one more favor?<br> -A while ago, I had a talk with Baulro from the temple regarding Roxxy, and he promised that he would create a magic potion for me that makes the user more eloquent, saying that it would be helpful when courting a woman. Something about being able to capture the person's heart through witty talk? It was a bit expensive, but I bought it thinking that I would need it to talk with Roxxy. Please take this receipt to<font color="LEVEL"> Baulro</font> and tell him my situation, and he will give you the potion. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-09.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-09.htm deleted file mode 100644 index 614cca585d3ae2603de2119ba7a07e8d6821e4df..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-09.htm +++ /dev/null @@ -1,4 +0,0 @@ -<html><body>Darin:<br> -Your eyes are like the moonlight...<br> -Ah! You haven't gotten the potion from Baulro yet? I'm writing a poem to recite to Roxxy when I ask her permission to court her. I have to hurry before the sun sets... -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-10.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-10.htm deleted file mode 100644 index 0bef5087cfa7c49e56bbb8ef348c85c24a276c92..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/30048-10.htm +++ /dev/null @@ -1,4 +0,0 @@ -<html><body>Darin:<br> -Ah, is this the potion? Thank you. I have finished the poem to recite to Roxxy, and bought roses too. Now that I have the potion that Baulro has made, all that is left is for me to do is to go and talk to Roxxy. For some reason, I have a feeling that things will all go well. This is all thanks to your help.<br> -Take this as a token of gratitude. Though it's not much... Please do not decline, just take my gift. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/__init__.py b/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/__init__.py deleted file mode 100644 index 3f4b8b10440a0c48a038f0d7a64ad0ada4ffb145..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/1_LettersOfLove1/__init__.py +++ /dev/null @@ -1,115 +0,0 @@ -# Made by Mr. Have fun! Version 0.2 -import sys -from com.l2jserver.gameserver.model.quest import State -from com.l2jserver.gameserver.model.quest import QuestState -from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest - -qn = "1_LettersOfLove1" - -#NPCs -DARIN = 30048 -ROXXY = 30006 -BAULRO = 30033 - -#ITEMS -DARINGS_LETTER = 687 -RAPUNZELS_KERCHIEF = 688 -DARINGS_RECEIPT = 1079 -BAULS_POTION = 1080 - -#REWARD -NECKLACE = 906 - -class Quest (JQuest) : - - def __init__(self,id,name,descr): - JQuest.__init__(self,id,name,descr) - self.questItemIds = [DARINGS_LETTER, RAPUNZELS_KERCHIEF, DARINGS_RECEIPT, BAULS_POTION] - - def onAdvEvent (self,event,npc, player) : - htmltext = event - st = player.getQuestState(qn) - if not st : return - if event == "30048-06.htm" : - st.set("cond","1") - st.setState(State.STARTED) - st.playSound("ItemSound.quest_accept") - if st.getQuestItemsCount(DARINGS_LETTER) == 0 : - st.giveItems(DARINGS_LETTER,1) - return htmltext - - def onTalk (self,npc,player): - st = player.getQuestState(qn) - htmltext = Quest.getNoQuestMsg(player) - if not st: return htmltext - - npcId = npc.getNpcId() - id = st.getState() - - cond = st.getInt("cond") - ItemsCount_DL = st.getQuestItemsCount(DARINGS_LETTER) - ItemsCount_RK = st.getQuestItemsCount(RAPUNZELS_KERCHIEF) - ItemsCount_DR = st.getQuestItemsCount(DARINGS_RECEIPT) - ItemsCount_BP = st.getQuestItemsCount(BAULS_POTION) - if id == State.COMPLETED : - htmltext = Quest.getAlreadyCompletedMsg(player) - elif npcId == DARIN and id == State.CREATED: - if player.getLevel() >= 2 : - if cond < 15 : - htmltext = "30048-02.htm" - else: - htmltext = "30048-01.htm" - st.exitQuest(1) - else: - htmltext = "<html><body>Quest for characters level 2 and above.</body></html>" - st.exitQuest(1) - elif id == State.STARTED : - if npcId == ROXXY and cond: - if ItemsCount_RK == 0 and ItemsCount_DL : - htmltext = "30006-01.htm" - st.takeItems(DARINGS_LETTER,-1) - st.giveItems(RAPUNZELS_KERCHIEF,1) - st.set("cond","2") - st.playSound("ItemSound.quest_middle") - elif ItemsCount_BP or ItemsCount_DR : - htmltext = "30006-03.htm" - elif ItemsCount_RK : - htmltext = "30006-02.htm" - elif npcId == DARIN and cond and ItemsCount_RK > 0: - htmltext = "30048-08.htm" - st.takeItems(RAPUNZELS_KERCHIEF,-1) - st.giveItems(DARINGS_RECEIPT,1) - st.set("cond","3") - st.playSound("ItemSound.quest_middle") - elif npcId == BAULRO and cond: - if ItemsCount_DR > 0 : - htmltext = "30033-01.htm" - st.takeItems(DARINGS_RECEIPT,-1) - st.giveItems(BAULS_POTION,1) - st.set("cond","4") - st.playSound("ItemSound.quest_middle") - elif ItemsCount_BP > 0 : - htmltext = "30033-02.htm" - elif npcId == DARIN and cond and ItemsCount_RK == 0: - if ItemsCount_DR > 0 : - htmltext = "30048-09.htm" - elif ItemsCount_BP > 0 : - htmltext = "30048-10.htm" - st.takeItems(BAULS_POTION,-1) - st.giveItems(57,2466) - st.giveItems(NECKLACE,1) - st.addExpAndSp(5672,446) - st.unset("cond") - st.exitQuest(False) - st.playSound("ItemSound.quest_finish") - else: - htmltext = "30048-07.htm" - return htmltext - -QUEST = Quest(1,qn,"Letters of Love") - -QUEST.addStartNpc(DARIN) - -QUEST.addTalkId(DARIN) -QUEST.addTalkId(ROXXY) -QUEST.addTalkId(BAULRO) \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30006-01.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30006-01.html new file mode 100644 index 0000000000000000000000000000000000000000..da098fe07a431d0c5c198ee47a2083297e6f9cf0 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30006-01.html @@ -0,0 +1,4 @@ +<html><body>Roxxy:<br> +A letter...for me? From Darin? What does it say, I wonder... Oh my, I had no idea he had these feelings for me. I wish he hadn't waited so long to tell me!<br> +Please give Darin my <font color="LEVEL">handkerchief</font> as a pledge of my affection for him. And tell him...tell him not to waste any more time. Tell him to come see me right away! +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30006-02.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30006-02.html new file mode 100644 index 0000000000000000000000000000000000000000..c92e88ada93ded0e2f040e65109ff5126737fd40 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30006-02.html @@ -0,0 +1,3 @@ +<html><body>Roxxy:<br> +You haven't given my handkerchief to Darin yet? He must be suffering terribly waiting for my answer. Please put his mind at ease. Hurry to him and tell him that I have feelings for him as well. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30006-03.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30006-03.html new file mode 100644 index 0000000000000000000000000000000000000000..825834cf00f23c9e671b3ce8fe443515efd51958 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30006-03.html @@ -0,0 +1,4 @@ +<html><body>Roxxy:<br> +Did you give Darin my handkerchief? What did he say? Oh... I thought he would rush over and ask permission to court me, but instead...<br> +Sometimes he acts just like a shy little boy! Although I have to confess that that's a large part of why I find him so attractive. I think he brings out the mothering instinct in me... +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30033-01.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30033-01.html new file mode 100644 index 0000000000000000000000000000000000000000..728bc0d84974843741d296895ec9be3c2b0e0397 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30033-01.html @@ -0,0 +1,4 @@ +<html><body>Magister Baulro:<br> +Darin sent you, eh? Well, well... He's a fine lad, but far too shy for his own good. I'm glad he's finally decided to tell Roxxy his feelings, though. None but the brave deserve the fair, eh!<br> +Here's the "magic potion" he ordered. Just between us, it's nothing more than water drawn from the Temple well! Calm down -- I really do have Darin's best interests at heart. Think about it: if he believes that this will make him more eloquent, his self-confidence will soar and he really will find the words he needs. Now take it to him, and remember: not a word about the ingredients! +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30033-02.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30033-02.html new file mode 100644 index 0000000000000000000000000000000000000000..ac1bdb3a6065f2bdf6dc65bfca8ce2680f2953b2 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30033-02.html @@ -0,0 +1,3 @@ +<html><body>Magister Baulro:<br> +Take this potion to Darin. I'm sure he's waiting anxiously for your return! +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-01.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-01.html new file mode 100644 index 0000000000000000000000000000000000000000..85ca5d42ca9dfb7cfea56a3aa5c9398ec05d2f7e --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-01.html @@ -0,0 +1,5 @@ +<html><body>Darin:<br> +What's more dangerous than a Knight's sword or a Wizard's staff? That thing we call love. More silently than a thief, swifter than a sunset it comes upon you and captures your soul. The minstrels were right; it's sweet and bitter all at once! One moment my heart soars to the heights of joy, the next it plummets into the depths of despair. Can you explain it?<br> +Ah, but I see you are focused on the world of adventure, not romance. Just remember: one day you too may fall under love's irresistible spell...<br> +(Only characters who are level 2 and above may undertake this quest.) +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-02.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-02.html new file mode 100644 index 0000000000000000000000000000000000000000..c7b609b2662d8cee9adb2de088c1111c28171844 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-02.html @@ -0,0 +1,4 @@ +<html><body>Darin:<br> +What's more dangerous than a Knight's sword or a Wizard's staff? That thing we call love. More silently than a thief, swifter than a sunset it comes upon you and captures your soul. The minstrels were right; it's sweet and bitter all at once! I cannot concentrate, I cannot sleep, I cannot eat!<br> +<a action="bypass -h Quest Q00001_LettersOfLove 30048-03.html">Ask whom he loves.</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-03.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-03.html new file mode 100644 index 0000000000000000000000000000000000000000..d3f9a03625e07da6154ae05f70377bc9067766c3 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-03.html @@ -0,0 +1,5 @@ +<html><body>Darin:<br> +I am in love with <font color="LEVEL">Roxxy</font>. Do you know her? She's our village Gatekeeper.<br> +<a action="bypass -h Quest Q00001_LettersOfLove 30048-04.html">Tell him you don't know her.</a><br> +<a action="bypass -h Quest Q00001_LettersOfLove 30048-05.html">Tell him you do know her.</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-04.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-04.html new file mode 100644 index 0000000000000000000000000000000000000000..bdc31bdc903fd9fff237058d9ddc852af2b9aaeb --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-04.html @@ -0,0 +1,6 @@ +<html><body>Darin:<br> +You don't know Roxxy?! She is the most beautiful woman on Talking Island... She is also very intelligent -- she was even a student at Oren's Ivory Tower! Now she belongs to the Gatekeeper Guild, able to bend time and space to connect many villages.<br> +Oh, why would a woman like that ever return the love I feel for her? For months, I vowed every day to tell her how I feel, and every day my courage deserted me. What would I do if she rejected me? Now I've written her a love letter, but I can't bring myself to deliver it.<br> +May I ask a favor? Would you deliver my letter to Roxxy?<br> +<a action="bypass -h Quest Q00001_LettersOfLove 30048-06.htm">Say yes.</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-05.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-05.html new file mode 100644 index 0000000000000000000000000000000000000000..79d07357868fe732b3a86a29c7d31b7862952a3b --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-05.html @@ -0,0 +1,5 @@ +<html><body>Darin:<br> +Ah, then you can see why I am so tormented! She is an amazing woman...in fact, why would a woman like that ever return the love I feel for her? For months, I vowed every day to tell her how I feel, and every day my courage deserted me. What would I do if she rejected me? Now I've written her a <font color="LEVEL">love letter,</font> but I can't bring myself to deliver it.<br> +May I ask a favor? Would you deliver my letter to Roxxy?<br> +<a action="bypass -h Quest Q00001_LettersOfLove 30048-06.htm">Say yes.</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-06.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-06.htm new file mode 100644 index 0000000000000000000000000000000000000000..cfaa438e234199db47c520f3e026f4ae96fbb267 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-06.htm @@ -0,0 +1,4 @@ +<html><body>Darin:<br> +Thank you! Do you know the Temple of Einhasad? You will find Roxxy at the well in front of the temple.<br> +Please give her this letter. Please hurry -- my nerves can't stand the strain of waiting! +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-07.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-07.html new file mode 100644 index 0000000000000000000000000000000000000000..08dc5e8def8fccc4a3fabe504a65987e17f9bb9f --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-07.html @@ -0,0 +1,3 @@ +<html><body>Darin:<br> +You haven't given my letter to Roxxy yet?! Please hurry! I'm so anxious that I can't eat or sleep. I must know her answer! +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-08.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-08.html new file mode 100644 index 0000000000000000000000000000000000000000..e5e651848c21fa4e10dcad080000ba30a122b704 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-08.html @@ -0,0 +1,5 @@ +<html><body>Darin:<br> +Roxxy's handkerchief! Oh, she really likes me! It seems like a dream... Thank you! If not for you, I would never have known..<br> +I must speak with her. So much to do: buy flowers, bathe, get dressed in my finest clothes... Oh, I must hurry! I hate to impose, but would you do me another favor?<br> +Baulro promised that he would brew a magic potion to make me more eloquent. I know how much a woman like Roxxy values intelligence... It wasn't cheap, but I couldn't afford not to buy it. Please take this receipt to <font color="LEVEL">Baulro</font>, and he will give you the potion to bring back to me. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-09.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-09.html new file mode 100644 index 0000000000000000000000000000000000000000..91058717a27ce870bb7b02c39487b4f6d4656065 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-09.html @@ -0,0 +1,4 @@ +<html><body>Darin:<br> +"Your eyes are like...puddles of moonlight..."<br> +Ah! You haven't brought Baulro's potion? Please hurry -- I'm writing a poem for Roxxy and I need all the help I can get. Everything must be perfect! +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-10.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-10.html new file mode 100644 index 0000000000000000000000000000000000000000..22565f9ab69bff80fde3daef9f3084e549a95176 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/30048-10.html @@ -0,0 +1,4 @@ +<html><body>Darin:<br> +You brought the potion? Thank you! I've already bought roses and even finished the poem I was writing for Roxxy. Now that I have Baulro's potion, all that's left is for me to do is to go and talk to her. I know in my heart this is meant to be! I couldn't have done any of this without your help.<br> +Please accept this small gift as a token of my gratitude. I'm afraid it's not much, but please know you have my undying thanks! +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/Q00001_LettersOfLove.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/Q00001_LettersOfLove.java new file mode 100644 index 0000000000000000000000000000000000000000..f8e403ea36faf1881384ad85e20bfd2fd346bd8a --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00001_LettersOfLove/Q00001_LettersOfLove.java @@ -0,0 +1,246 @@ +/* + * Copyright (C) 2004-2012 L2J Server + * + * This file is part of L2J Server. + * + * L2J Server 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. + * + * L2J Server is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package quests.Q00001_LettersOfLove; + +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; +import com.l2jserver.gameserver.model.quest.State; +import com.l2jserver.gameserver.network.NpcStringId; + +/** + * Letters of Love (1) + * @author Zoey76 + */ +public class Q00001_LettersOfLove extends Quest +{ + // NPC + private static final int DARIN = 30048; + private static final int ROXXY = 30006; + private static final int BAULRO = 30033; + // Items + private static final int DARINS_LETTER = 687; + private static final int ROXXYS_KERCHIEF = 688; + private static final int DARINS_RECEIPT = 1079; + private static final int BAULROS_POTION = 1080; + private static final int NECKLACE_OF_KNOWLEDGE = 906; + // Misc + private static final int MIN_LEVEL = 2; + + private Q00001_LettersOfLove(int questId, String name, String descr) + { + super(questId, name, descr); + addStartNpc(DARIN); + addTalkId(DARIN, ROXXY, BAULRO); + registerQuestItems(DARINS_LETTER, ROXXYS_KERCHIEF, DARINS_RECEIPT, BAULROS_POTION); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + final QuestState st = player.getQuestState(getName()); + if (st == null) + { + return null; + } + + String htmltext = null; + switch (event) + { + case "30048-03.html": + case "30048-04.html": + case "30048-05.html": + { + htmltext = event; + break; + } + case "30048-06.htm": + { + if (player.getLevel() >= MIN_LEVEL) + { + st.startQuest(); + st.giveItems(DARINS_LETTER, 1); + htmltext = event; + } + break; + } + } + return htmltext; + } + + @Override + public String onTalk(L2Npc npc, L2PcInstance player) + { + final QuestState st = player.getQuestState(getName()); + if (st == null) + { + return getNoQuestMsg(player); + } + + String htmltext = getNoQuestMsg(player); + switch (st.getState()) + { + case State.CREATED: + { + htmltext = (player.getLevel() < MIN_LEVEL) ? "30048-01.html" : "30048-02.html"; + break; + } + case State.STARTED: + { + switch (st.getCond()) + { + case 1: + { + switch (npc.getNpcId()) + { + case DARIN: + { + htmltext = "30048-07.html"; + break; + } + case ROXXY: + { + if (st.hasQuestItems(DARINS_LETTER) && !st.hasQuestItems(ROXXYS_KERCHIEF)) + { + st.takeItems(DARINS_LETTER, -1); + st.giveItems(ROXXYS_KERCHIEF, 1); + st.setCond(2, true); + htmltext = "30006-01.html"; + } + break; + } + } + break; + } + case 2: + { + switch (npc.getNpcId()) + { + case DARIN: + { + if (st.hasQuestItems(ROXXYS_KERCHIEF)) + { + st.takeItems(ROXXYS_KERCHIEF, -1); + st.giveItems(DARINS_RECEIPT, 1); + st.setCond(3, true); + htmltext = "30048-08.html"; + } + break; + } + case ROXXY: + { + if (st.hasQuestItems(ROXXYS_KERCHIEF)) + { + htmltext = "30006-02.html"; + } + break; + } + } + break; + } + case 3: + { + switch (npc.getNpcId()) + { + case DARIN: + { + if (st.hasQuestItems(DARINS_RECEIPT) || !st.hasQuestItems(BAULROS_POTION)) + { + htmltext = "30048-09.html"; + } + break; + } + case ROXXY: + { + if (st.hasQuestItems(DARINS_RECEIPT) || st.hasQuestItems(BAULROS_POTION)) + { + htmltext = "30006-03.html"; + } + break; + } + case BAULRO: + { + if (st.hasQuestItems(DARINS_RECEIPT)) + { + st.takeItems(DARINS_RECEIPT, -1); + st.giveItems(BAULROS_POTION, 1); + st.setCond(4, true); + htmltext = "30033-01.html"; + } + else if (st.hasQuestItems(BAULROS_POTION)) + { + htmltext = "30033-02.html"; + } + break; + } + } + break; + } + case 4: + { + switch (npc.getNpcId()) + { + case DARIN: + { + // TODO: Beside this message something should be set for the Newbie Guide. + showOnScreenMsg(player, NpcStringId.DELIVERY_DUTY_COMPLETE_N_GO_FIND_THE_NEWBIE_GUIDE, 2, 5000); + st.giveItems(NECKLACE_OF_KNOWLEDGE, 1); + st.addExpAndSp(5672, 446); + st.giveAdena(2466, false); + st.exitQuest(false, true); + htmltext = "30048-10.html"; + break; + } + case BAULRO: + { + if (st.hasQuestItems(BAULROS_POTION)) + { + htmltext = "30033-02.html"; + } + break; + } + case ROXXY: + { + if (st.hasQuestItems(BAULROS_POTION)) + { + htmltext = "30006-03.html"; + } + break; + } + } + break; + } + } + break; + } + case State.COMPLETED: + { + htmltext = getAlreadyCompletedMsg(player); + break; + } + } + return htmltext; + } + + public static void main(String[] args) + { + new Q00001_LettersOfLove(1, Q00001_LettersOfLove.class.getSimpleName(), "Letters of Love"); + } +} diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00114_ResurrectionOfAnOldManager/Q00114_ResurrectionOfAnOldManager.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00114_ResurrectionOfAnOldManager/Q00114_ResurrectionOfAnOldManager.java index d8a567d7f64af44e0cd430d56ef47d140a87bf48..09b1919c7a8fd02ab197b0bf45391a4d15a0a774 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00114_ResurrectionOfAnOldManager/Q00114_ResurrectionOfAnOldManager.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00114_ResurrectionOfAnOldManager/Q00114_ResurrectionOfAnOldManager.java @@ -27,7 +27,6 @@ import com.l2jserver.gameserver.model.quest.State; import com.l2jserver.gameserver.model.zone.L2ZoneType; import com.l2jserver.gameserver.network.NpcStringId; import com.l2jserver.gameserver.network.clientpackets.Say2; -import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage; import com.l2jserver.gameserver.network.serverpackets.NpcSay; /** @@ -43,7 +42,6 @@ public class Q00114_ResurrectionOfAnOldManager extends Quest private static final int STONES = 32046; private static final int WENDY = 32047; private static final int BOX = 32050; - // Items private static final int STARSTONE = 8287; private static final int LETTER = 8288; @@ -51,12 +49,15 @@ public class Q00114_ResurrectionOfAnOldManager extends Quest private static final int DETCTOR = 8090; private static final int DETCTOR2 = 8091; private static final int ADENA = 57; - // Monster private static final int GUARDIAN = 27318; - // Zones - private static final int[] ZONES = {200032, 200033, 200034}; + private static final int[] ZONES = + { + 200032, + 200033, + 200034 + }; private static L2Attackable golem = null; @@ -580,7 +581,7 @@ public class Q00114_ResurrectionOfAnOldManager extends Quest st.takeItems(DETCTOR, 1); st.giveItems(DETCTOR2, 1); st.setCond(18, true); - character.sendPacket(new ExShowScreenMessage(NpcStringId.THE_RADIO_SIGNAL_DETECTOR_IS_RESPONDING_A_SUSPICIOUS_PILE_OF_STONES_CATCHES_YOUR_EYE, 2, 4500)); + showOnScreenMsg(character.getActingPlayer(), NpcStringId.THE_RADIO_SIGNAL_DETECTOR_IS_RESPONDING_A_SUSPICIOUS_PILE_OF_STONES_CATCHES_YOUR_EYE, 2, 4500); } } return super.onEnterZone(character, zone); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00450_GraveRobberRescue/Q00450_GraveRobberRescue.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00450_GraveRobberRescue/Q00450_GraveRobberRescue.java index 053ee0731f80c6065434c5fdc3c1ea89288c5371..b5445f2bea9e2724da784eec0aece788b1217992 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00450_GraveRobberRescue/Q00450_GraveRobberRescue.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00450_GraveRobberRescue/Q00450_GraveRobberRescue.java @@ -25,7 +25,6 @@ import com.l2jserver.gameserver.model.quest.QuestState.QuestType; import com.l2jserver.gameserver.model.quest.State; import com.l2jserver.gameserver.network.NpcStringId; import com.l2jserver.gameserver.network.clientpackets.Say2; -import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage; import com.l2jserver.gameserver.network.serverpackets.NpcSay; /** @@ -38,13 +37,10 @@ public class Q00450_GraveRobberRescue extends Quest // NPCs private static final int KANEMIKA = 32650; private static final int WARRIOR = 32651; - // Monster private static final int WARRIOR_MON = 22741; - // Items private static final int EVIDENCE_OF_MIGRATION = 14876; - // Misc private static final int MIN_LEVEL = 80; @@ -165,7 +161,7 @@ public class Q00450_GraveRobberRescue extends Quest monster.setRunning(); monster.addDamageHate(player, 0, 999); monster.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player); - player.sendPacket(new ExShowScreenMessage(NpcStringId.THE_GRAVE_ROBBER_WARRIOR_HAS_BEEN_FILLED_WITH_DARK_ENERGY_AND_IS_ATTACKING_YOU, 5, 5000)); + showOnScreenMsg(player, NpcStringId.THE_GRAVE_ROBBER_WARRIOR_HAS_BEEN_FILLED_WITH_DARK_ENERGY_AND_IS_ATTACKING_YOU, 5, 5000); } } diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-01.htm new file mode 100644 index 0000000000000000000000000000000000000000..687a729fd0a22ee8eaf4a9710ff4b4f36a9a5824 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-01.htm @@ -0,0 +1,5 @@ +<html><body>Separated Soul:<br> +Aren't you the one that's always in the Dragon Valley? ... Or is this is the first time I've seen you? Ever since my soul has been ripped apart, my memories have become so vague.<br> +Anyhow, I have something to ask you, so could you lend me your ears?<br> +<a action="bypass -h Quest Q00455_WingsOfSand 32864-02.htm">Listen to its tale.</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-02.htm new file mode 100644 index 0000000000000000000000000000000000000000..b65ceb46693c4d1f92888dccada124e3e69d022c --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-02.htm @@ -0,0 +1,5 @@ +<html><body>Separated Soul:<br> +Looking at you all running around here! You must be confident, but don't you want to help me get my revenge?<br> +I'm asking if you can kill the Land Dragon Antharas.<br> +<a action="bypass -h Quest Q00455_WingsOfSand 32864-03.htm">"Land Dragon Antharas?"</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-03.htm new file mode 100644 index 0000000000000000000000000000000000000000..3ddae6108a13c26981c98d7cb2b2cf77006d458d --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-03.htm @@ -0,0 +1,5 @@ +<html><body>Separated Soul:<br> +Scared? Come now, I'd be embarassed if I was that easily shocked.<br> +You really can't kill that Land Dragon?<br> +<a action="bypass -h Quest Q00455_WingsOfSand 32864-04.htm">"Not alone!"</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-04.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-04.htm new file mode 100644 index 0000000000000000000000000000000000000000..386369474e41336740c69a791c9a79dc2984d693 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-04.htm @@ -0,0 +1,5 @@ +<html><body>Separated Soul:<br> +True, you have a point. How about this kind of favor? Gather up companions and as a revenge, kill his servants for me. Kill the cursed creatures called the <font color="LEVEL">Wings of Sand</font>.<br> +Wouldn't Antharas be weakened if he loses servants? Maybe I can get my revenge some day...<br> +<a action="bypass -h Quest Q00455_WingsOfSand 32864-05.htm">"Sure. Worth a go."</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-05.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-05.htm new file mode 100644 index 0000000000000000000000000000000000000000..f521423a95695fa1ef78e8624c0adf99136e72df --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-05.htm @@ -0,0 +1,4 @@ +<html><body>Separated Soul:<br> +Go on then. Kill <font color="LEVEL">Emerald Horns, Dust Riders, Bleeding Flies, Black Dagger Wings, Shadow Summoners, Spike Slashers, and Muscle Bombers</font>.<br> +You can bring back the <font color="LEVEL">Large Dragon Tooth</font>. One is good, two is better. I will reward you, now go show me your skills. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-06.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-06.html new file mode 100644 index 0000000000000000000000000000000000000000..5baed2863ea205078210550af33413f0ed8ae64f --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-06.html @@ -0,0 +1,4 @@ +<html><body>Separated Soul:<br> +Go on then. Kill <font color="LEVEL">Emerald Horns, Dust Riders, Bleeding Flies, Black Dagger Wings, Shadow Summoners, Spike Slashers, and Muscle Bombers</font>.<br> +You can bring back the <font color="LEVEL">Large Dragon Tooth</font>. One is good, two is better. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-07.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-07.html new file mode 100644 index 0000000000000000000000000000000000000000..164156e0e9e57d004d2476b60f68c554c85038fd --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-07.html @@ -0,0 +1,3 @@ +<html><body>Separated Soul:<br> +Yes take this. Thank you. I hope this weakens the army of Antharas and the day would come to avenge me someday... +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-08.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-08.html new file mode 100644 index 0000000000000000000000000000000000000000..5d8425ffb4d0da4d9f2016082b41add5a9fe6663 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/32864-08.html @@ -0,0 +1,5 @@ +<html><body>Separated Soul:<br> +I barely remember anything, but I DO remember that you're the one who did me a favor.<br> +Thank you!<br> +(You can only do this quest once a day. This quest resets everyday at 6:30 am.) +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/Q00455_WingsOfSand.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/Q00455_WingsOfSand.java new file mode 100644 index 0000000000000000000000000000000000000000..bc1e6ab8479ee2d74b279cb3e24b489b02ccdbbb --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00455_WingsOfSand/Q00455_WingsOfSand.java @@ -0,0 +1,255 @@ +/* + * Copyright (C) 2004-2012 L2J Server + * + * This file is part of L2J Server. + * + * L2J Server 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. + * + * L2J Server is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package quests.Q00455_WingsOfSand; + +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; +import com.l2jserver.gameserver.model.quest.QuestState.QuestType; +import com.l2jserver.gameserver.model.quest.State; +import com.l2jserver.gameserver.util.Util; + +/** + * Wings of Sand (455) + * @author Zoey76 + */ +public class Q00455_WingsOfSand extends Quest +{ + // NPC + private static final int[] SEPARATED_SOULS = + { + 32864, + 32865, + 32866, + 32867, + 32868, + 32869, + 32870, + 32891 + }; + // Monsters + private static final int EMERALD_HORN = 25718; + private static final int DUST_RIDER = 25719; + private static final int BLEEDING_FLY = 25720; + private static final int BLACK_DAGGER_WING = 25721; + private static final int SHADOW_SUMMONER = 25722; + private static final int SPIKE_SLASHER = 25723; + private static final int MUSCLE_BOMBER = 25724; + // Items + private static final int LARGE_BABY_DRAGON = 17250; + // Misc + private static final int MIN_LEVEL = 80; + private static final int CHANCE = 350; + + private Q00455_WingsOfSand(int questId, String name, String descr) + { + super(questId, name, descr); + addStartNpc(SEPARATED_SOULS); + addTalkId(SEPARATED_SOULS); + addKillId(EMERALD_HORN, DUST_RIDER, BLEEDING_FLY, BLACK_DAGGER_WING, SHADOW_SUMMONER, SPIKE_SLASHER, MUSCLE_BOMBER); + registerQuestItems(LARGE_BABY_DRAGON); + } + + @Override + public String onTalk(L2Npc npc, L2PcInstance player) + { + final QuestState st = player.getQuestState(getName()); + if (st == null) + { + return getNoQuestMsg(player); + } + + String htmltext = getNoQuestMsg(player); + switch (st.getState()) + { + case State.CREATED: + { + if (player.getLevel() >= MIN_LEVEL) + { + htmltext = "32864-01.htm"; + } + break; + } + case State.STARTED: + { + switch (st.getCond()) + { + case 1: + { + htmltext = "32864-06.html"; + break; + } + case 2: + { + reward(st); + htmltext = "32864-07.html"; + break; + } + case 3: + { + reward(st); + htmltext = "32864-07.html"; + break; + } + } + break; + } + case State.COMPLETED: + { + if (!st.isNowAvailable()) + { + htmltext = "32864-08.html"; + } + else + { + st.setState(State.CREATED); + if (player.getLevel() >= MIN_LEVEL) + { + htmltext = "32864-01.htm"; + } + } + break; + } + } + return htmltext; + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + final QuestState st = player.getQuestState(getName()); + if (st == null) + { + return null; + } + + String htmltext = null; + if (player.getLevel() >= MIN_LEVEL) + { + switch (event) + { + case "32864-02.htm": + case "32864-03.htm": + case "32864-04.htm": + { + htmltext = event; + break; + } + case "32864-05.htm": + { + if (player.getLevel() >= MIN_LEVEL) + { + st.startQuest(); + htmltext = event; + } + break; + } + } + } + return htmltext; + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet) + { + QuestState st; + if (killer.isInParty()) + { + for (L2PcInstance player : killer.getParty().getMembers()) + { + st = player.getQuestState(getName()); + if ((st != null) && Util.checkIfInRange(1500, npc, player, false) && (getRandom(1000) < CHANCE)) + { + st.giveItems(LARGE_BABY_DRAGON, 1); + st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET); + if (st.getQuestItemsCount(LARGE_BABY_DRAGON) == 1) + { + st.setCond(2, true); + } + else if (st.getQuestItemsCount(LARGE_BABY_DRAGON) == 2) + { + st.setCond(3, true); + } + } + } + } + else + { + st = killer.getQuestState(getName()); + if ((st != null) && Util.checkIfInRange(1500, npc, killer, false) && (getRandom(1000) < CHANCE)) + { + st.giveItems(LARGE_BABY_DRAGON, 1); + st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET); + if (st.getQuestItemsCount(LARGE_BABY_DRAGON) == 1) + { + st.setCond(2, true); + } + else if (st.getQuestItemsCount(LARGE_BABY_DRAGON) == 2) + { + st.setCond(3, true); + } + } + } + return null; + } + + /** + * Reward the player. + * @param st the quest state of the player to reward + */ + private static final void reward(QuestState st) + { + int chance; + for (int i = 1; i <= st.getCond() - 1; i++) + { + chance = getRandom(1000); + if (chance <= 250) + { + st.giveItems(getRandom(15660, 15691), 1); // Armor Parts + } + else if ((chance > 250) && (chance <= 500)) + { + st.giveItems(getRandom(15634, 15644), 1); // Weapon Parts + } + else if ((chance > 550) && (chance <= 750)) + { + st.giveItems(getRandom(15769, 15771), 1); // Jewelry Parts + } + else if ((chance > 750) && (chance <= 900)) + { + st.giveItems(getRandom(9552, 9557), 1); // Crystals + } + else if ((chance > 900) && (chance <= 970)) + { + st.giveItems(6578, 1); // Blessed Scroll: Enchant Armor (S-Grade) + } + else if (chance > 970) + { + st.giveItems(6577, 1); // Blessed Scroll: Enchant Weapon (S-Grade) + } + } + st.exitQuest(QuestType.DAILY, true); + } + + public static void main(String[] args) + { + new Q00455_WingsOfSand(455, Q00455_WingsOfSand.class.getSimpleName(), "Wings of Sand"); + } +}