소스 검색

BETA: Black Judge rework.

Patch by: St3eT
Reviewed by: Zoey76, UnAfraid, jurchiks, xban1x, Adry_85
Zoey76 12 년 전
부모
커밋
1176aa912c

+ 0 - 5
L2J_DataPack_BETA/dist/game/data/html/default/30981-1.htm

@@ -1,5 +0,0 @@
-<html><body>Black Judge:<br>
-Death leaves a scar which all must bear.<br>
-Do you wish it to be healed completely?<br>
- As I see you are a true adventurer, I will heal this wound and remove death's scar.<br>
-<a action="bypass -h npc_%objectId%_remove_dp 2">Remove 1 level of Death Penalty (%dp_price% adena).</a></body></html>

+ 1 - 0
L2J_DataPack_BETA/dist/game/data/scripts.cfg

@@ -14,6 +14,7 @@ handlers/admincommandhandlers/AdminScan.js
 # Npc
 ai/npc/ArenaManager/ArenaManager.java
 ai/npc/AvantGarde/AvantGarde.java
+ai/npc/BlackJudge/BlackJudge.java
 ai/npc/BlackMarketeerOfMammon/BlackMarketeerOfMammon.java
 ai/npc/CastleBlacksmith/CastleBlacksmith.java
 ai/npc/CastleChamberlain/CastleChamberlain.java

+ 6 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackJudge/30981-01.html

@@ -0,0 +1,6 @@
+<html><body>Black Judge:<br>
+Death leaves a scar which all must bear.<br>
+Do you wish it to be healed completely?<br>
+Ah, I perceive that you have long been apart from this world. I am strangely heartened by your return. I will heal this wound and remove death's scar.<br>
+<a action="bypass -h Quest BlackJudge remove_dp">Remove 1 level of Death Penalty (3600 Adena).</a>
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackJudge/30981-02.html

@@ -0,0 +1,6 @@
+<html><body>Black Judge:<br>
+Death leaves a scar which all must bear.<br>
+Do you wish it to be healed completely?<br>
+You have only recently begun your journey in this world, and your youth touches me. I will heal this wound and remove death's scar.<br>
+<a action="bypass -h Quest BlackJudge remove_dp">Remove 1 level of Death Penalty (8640 Adena)</a>
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackJudge/30981-03.html

@@ -0,0 +1,6 @@
+<html><body>Black Judge:<br>
+Death leaves a scar which all must bear.<br>
+Do you wish it to be healed completely?<br>
+You have only begun to learn the world, and your innocence touches me. I will heal this wound and remove death's scar.<br>
+<a action="bypass -h Quest BlackJudge remove_dp">Remove 1 level of Death Penalty (25200 Adena).</a>
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackJudge/30981-04.html

@@ -0,0 +1,6 @@
+<html><body>Black Judge:<br>
+Death leaves a scar which all must bear.<br>
+Do you wish it to be healed completely?<br>
+As I see you are a true adventurer, I will heal this wound and remove death's scar.<br>
+<a action="bypass -h Quest BlackJudge remove_dp">Remove 1 level of Death Penalty (50400 Adena).</a>
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackJudge/30981-05.html

@@ -0,0 +1,6 @@
+<html><body>Black Judge:<br>
+Death leaves a scar which all must bear.<br>
+Do you wish it to be healed completely?<br>
+Great adventurer, I will heal this wound and remove death's scar.<br>
+<a action="bypass -h Quest BlackJudge remove_dp">Remove 1 level of Death Penalty (86400 Adena)</a>
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackJudge/30981-06.html

@@ -0,0 +1,6 @@
+<html><body>Black Judge:<br>
+Death leaves a scar which all must bear.<br>
+Do you wish it to be healed completely?<br>
+Because you walk the hero's path, I will heal this wound and remove death's scar.<br>
+<a action="bypass -h Quest BlackJudge remove_dp">Remove 1 level of Death Penalty (144000 Adena).</a>
+</body></html>

+ 3 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackJudge/30981-07.html

@@ -0,0 +1,3 @@
+<html><body>Black Judge:<br>
+The wound you have received from death's touch is too deep to be healed for the money you have to give me. Find more money if you wish death's mark to be fully removed from you.
+</body></html>

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/html/default/30981-2.htm → L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackJudge/30981-08.html

@@ -1,4 +1,4 @@
 <html><body>Black Judge:<br>
 You have no more death wounds that require healing.<br>
 Go forth and fight, both for this world and your own glory.
-</body></html>
+</body></html>

+ 3 - 2
L2J_DataPack_BETA/dist/game/data/html/default/30981.htm → L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackJudge/30981.html

@@ -1,4 +1,5 @@
 <html><body>Black Judge:<br>
 I came to this land to save those poor souls who are contaminated by sin. We black judges do not divide good and evil by light and darkness. We help instead those with strong wills and noble souls -- whether or not they wish our help. Come, sinners, come to us . . .<br>
-<a action="bypass -h npc_%objectId%_remove_dp 1">Remove Death Penalties.</a><br>
-<a action="bypass -h npc_%objectId%_Quest">Quest</a></body></html>
+<a action="bypass -h Quest BlackJudge remove_info">Remove Death Penalties.</a><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 166 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackJudge/BlackJudge.java

@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2004-2013 L2J DataPack
+ * 
+ * This file is part of L2J DataPack.
+ * 
+ * L2J DataPack 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 DataPack is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package ai.npc.BlackJudge;
+
+import ai.npc.AbstractNpcAI;
+
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
+import com.l2jserver.gameserver.network.SystemMessageId;
+import com.l2jserver.gameserver.network.serverpackets.EtcStatusUpdate;
+
+/**
+ * Black Judge AI.
+ * @author St3eT
+ */
+public class BlackJudge extends AbstractNpcAI
+{
+	// NPC
+	private static final int BLACK_JUDGE = 30981;
+	
+	// Misc
+	private static final int COST_NOGR = 3600;
+	private static final int COST_D = 8640;
+	private static final int COST_C = 25200;
+	private static final int COST_B = 50400;
+	private static final int COST_A = 86400;
+	private static final int COST_S = 144000;
+	
+	private BlackJudge()
+	{
+		super(BlackJudge.class.getSimpleName(), "ai/npc");
+		addStartNpc(BLACK_JUDGE);
+		addTalkId(BLACK_JUDGE);
+		addFirstTalkId(BLACK_JUDGE);
+	}
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		String htmltext = null;
+		switch (event)
+		{
+			case "remove_info":
+			{
+				switch (player.getExpertiseLevel())
+				{
+					case 0:
+					{
+						htmltext = "30981-01.html";
+						break;
+					}
+					case 1:
+					{
+						htmltext = "30981-02.html";
+						break;
+					}
+					case 2:
+					{
+						htmltext = "30981-03.html";
+						break;
+					}
+					case 3:
+					{
+						htmltext = "30981-04.html";
+						break;
+					}
+					case 4:
+					{
+						htmltext = "30981-05.html";
+						break;
+					}
+					case 5:
+					case 6:
+					case 7:
+					{
+						htmltext = "30981-06.html";
+						break;
+					}
+				}
+				break;
+			}
+			case "remove_dp":
+			{
+				if (player.getDeathPenaltyBuffLevel() > 0)
+				{
+					int cost = 0;
+					switch (player.getExpertiseLevel())
+					{
+						case 0:
+						{
+							cost = COST_NOGR;
+							break;
+						}
+						case 1:
+						{
+							cost = COST_D;
+							break;
+						}
+						case 2:
+						{
+							cost = COST_C;
+							break;
+						}
+						case 3:
+						{
+							cost = COST_B;
+							break;
+						}
+						case 4:
+						{
+							cost = COST_A;
+							break;
+						}
+						case 5:
+						case 6:
+						case 7:
+						{
+							cost = COST_S;
+							break;
+						}
+					}
+					
+					if (player.getAdena() >= cost)
+					{
+						takeItems(player, PcInventory.ADENA_ID, cost);
+						player.setDeathPenaltyBuffLevel(player.getDeathPenaltyBuffLevel() - 1);
+						player.sendPacket(SystemMessageId.DEATH_PENALTY_LIFTED);
+						player.sendPacket(new EtcStatusUpdate(player));
+					}
+					else
+					{
+						htmltext = "30981-07.html";
+					}
+				}
+				else
+				{
+					htmltext = "30981-08.html";
+				}
+				break;
+			}
+		}
+		return htmltext;
+	}
+	
+	public static void main(String[] args)
+	{
+		new BlackJudge();
+	}
+}

+ 0 - 2
L2J_DataPack_BETA/dist/game/data/scripts/handlers/MasterHandler.java

@@ -148,7 +148,6 @@ import handlers.bypasshandlers.QuestLink;
 import handlers.bypasshandlers.QuestList;
 import handlers.bypasshandlers.ReceivePremium;
 import handlers.bypasshandlers.ReleaseAttribute;
-import handlers.bypasshandlers.RemoveDeathPenalty;
 import handlers.bypasshandlers.RentPet;
 import handlers.bypasshandlers.Rift;
 import handlers.bypasshandlers.SkillList;
@@ -439,7 +438,6 @@ public class MasterHandler
 			QuestList.class,
 			ReceivePremium.class,
 			ReleaseAttribute.class,
-			RemoveDeathPenalty.class,
 			RentPet.class,
 			Rift.class,
 			SkillList.class,

+ 0 - 114
L2J_DataPack_BETA/dist/game/data/scripts/handlers/bypasshandlers/RemoveDeathPenalty.java

@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2004-2013 L2J DataPack
- * 
- * This file is part of L2J DataPack.
- * 
- * L2J DataPack 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 DataPack 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 handlers.bypasshandlers;
-
-import com.l2jserver.gameserver.handler.IBypassHandler;
-import com.l2jserver.gameserver.model.actor.L2Character;
-import com.l2jserver.gameserver.model.actor.L2Npc;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.serverpackets.EtcStatusUpdate;
-import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
-import com.l2jserver.util.StringUtil;
-
-public class RemoveDeathPenalty implements IBypassHandler
-{
-	private static final String[] COMMANDS =
-	{
-		"remove_dp"
-	};
-	
-	private static final int[] PEN_CLEAR_PRICE =
-	{
-		3600,
-		8640,
-		25200,
-		50400,
-		86400,
-		144000,
-		144000,
-		144000
-	};
-	
-	@Override
-	public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
-	{
-		if (!target.isNpc())
-		{
-			return false;
-		}
-		
-		try
-		{
-			final int cmdChoice = Integer.parseInt(command.substring(10, 11).trim());
-			final L2Npc npc = (L2Npc) target;
-			switch (cmdChoice)
-			{
-				case 1:
-					String filename = "data/html/default/30981-1.htm";
-					NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
-					html.setFile(activeChar.getHtmlPrefix(), filename);
-					html.replace("%objectId%", String.valueOf(npc.getObjectId()));
-					html.replace("%dp_price%", String.valueOf(PEN_CLEAR_PRICE[activeChar.getExpertiseLevel()]));
-					activeChar.sendPacket(html);
-					break;
-				case 2:
-					NpcHtmlMessage Reply = new NpcHtmlMessage(npc.getObjectId());
-					final StringBuilder replyMSG = StringUtil.startAppend(400, "<html><body>Black Judge:<br>");
-					
-					if (activeChar.getDeathPenaltyBuffLevel() > 0)
-					{
-						if (activeChar.getAdena() >= PEN_CLEAR_PRICE[activeChar.getExpertiseLevel()])
-						{
-							if (!activeChar.reduceAdena("DeathPenality", PEN_CLEAR_PRICE[activeChar.getExpertiseLevel()], npc, true))
-							{
-								return false;
-							}
-							activeChar.setDeathPenaltyBuffLevel(activeChar.getDeathPenaltyBuffLevel() - 1);
-							activeChar.sendPacket(SystemMessageId.DEATH_PENALTY_LIFTED);
-							activeChar.sendPacket(new EtcStatusUpdate(activeChar));
-							return true;
-						}
-						replyMSG.append("The wound you have received from death's touch is too deep to be healed for the money you have to give me. Find more money if you wish death's mark to be fully removed from you.");
-					}
-					else
-					{
-						replyMSG.append("You have no more death wounds that require healing.<br>" + "Go forth and fight, both for this world and your own glory.");
-					}
-					
-					replyMSG.append("</body></html>");
-					Reply.setHtml(replyMSG.toString());
-					activeChar.sendPacket(Reply);
-					break;
-			}
-			return true;
-		}
-		catch (Exception e)
-		{
-			_log.info("Exception in " + getClass().getSimpleName());
-		}
-		return false;
-	}
-	
-	@Override
-	public String[] getBypassList()
-	{
-		return COMMANDS;
-	}
-}