浏览代码

BETA: Updating '''Arena Manager'''
Patch by: St3eT
Reviewed by: !UnAfraid, Zoey76, malyelfik

malyelfik 12 年之前
父节点
当前提交
f520e80165

+ 0 - 8
L2J_DataPack_BETA/dist/game/data/html/default/31226.htm

@@ -1,8 +0,0 @@
-<html><body>Arena Director:<br>
-Play the game according to the rules! The loser should be silent! What? Unfair? Then, why don't you hold your tonque and give it another try!<br>
-(Be careful! CP/HP will not get recovered inside the fence.)<br>
-<a action="bypass -h npc_%objectId%_CPRecovery">CP Recovery : 1,000 Adena</a><br>
-<a action="bypass -h npc_%objectId%_HPRecovery">HP Recovery : 1,000 Adena</a><br><br>
-<a action="bypass -h npc_%objectId%_ArenaBuffs">Buff for Battle Ground : 1,000 Adena</a><br><br>
-<a action="bypass -h npc_%objectId%_Quest">Quest</a>
-</body></html>

+ 0 - 10
L2J_DataPack_BETA/dist/game/data/html/warehouse/31225.htm

@@ -1,10 +0,0 @@
-<html><body>Arena Manager:<br>
-Way to go! Hooray! Hooray!!!<br>
-(Be careful! CP/HP will not get recovered inside the fence.)<br><br>
-<a action="bypass -h npc_%objectId%_CPRecovery">CP Recovery : 1,000 Adena</a><br>
-<a action="bypass -h npc_%objectId%_HPRecovery">HP Recovery : 1,000 Adena</a><br><br>
-<a action="bypass -h npc_%objectId%_ArenaBuffs">Buff for Battle Ground : 2,000 Adena</a><br><br>
-<a action="bypass -h npc_%objectId%_DepositP">Private Warehouse: Deposit an Item</a><br1>
-<a action="bypass -h npc_%objectId%_WithdrawP">Private Warehouse: Withdraw an Item</a><br>
-<a action="bypass -h npc_%objectId%_Quest">Quest</a>
-</body></html>

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

@@ -12,6 +12,7 @@ handlers/admincommandhandlers/AdminScan.js
 # AI Section
 
 # Npc
+ai/npc/ArenaManager/ArenaManager.java
 ai/npc/AvantGarde/AvantGarde.java
 ai/npc/BlackMarketeerOfMammon/BlackMarketeerOfMammon.java
 ai/npc/CastleBlacksmith/CastleBlacksmith.java

+ 10 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ArenaManager/31225.html

@@ -0,0 +1,10 @@
+<html><body>Arena Manager:<br>
+Way to go! Hooray! Hooray!!!<br>
+(Be careful! CP/HP will not get recovered inside the fence.)<br><br>
+<a action="bypass -h Quest ArenaManager CPrecovery">CP Recovery : 1,000 Adena</a><br>
+<a action="bypass -h Quest ArenaManager HPrecovery">HP Recovery : 1,000 Adena</a><br><br>
+<a action="bypass -h Quest ArenaManager Buff">Buff for Battle Ground : 2,000 Adena</a><br><br>
+<a action="bypass -h npc_%objectId%_DepositP">Private Warehouse: Deposit an item.</a><br>
+<a action="bypass -h npc_%objectId%_WithdrawP">Private Warehouse: Withdraw an item.</a><br><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 9 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ArenaManager/31226.html

@@ -0,0 +1,9 @@
+<html><body>Arena Director:<br>
+Play the game according to the rules! The loser should be silent! What? Unfair? Then, why don't you hold your tongue and give it another try!<br><br>
+<a action="bypass -h Quest ArenaManager CPrecovery">CP Recovery : 1,000 Adena</a><br>
+<a action="bypass -h Quest ArenaManager HPrecovery">HP Recovery : 1,000 Adena</a><br><br>
+<a action="bypass -h Quest ArenaManager Buff">Buff for Battle Ground : 2,000 Adena</a><br><br>
+<a action="bypass -h npc_%objectId%_DepositP">Private Warehouse: Deposit an item.</a><br>
+<a action="bypass -h npc_%objectId%_WithdrawP">Private Warehouse: Withdraw an item.</a><br><br>
+<a action="bypass -h npc_%objectId%_Quest">Quest</a>
+</body></html>

+ 141 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ArenaManager/ArenaManager.java

@@ -0,0 +1,141 @@
+/*
+ * 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.ArenaManager;
+
+import ai.npc.AbstractNpcAI;
+
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.holders.SkillHolder;
+import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
+import com.l2jserver.gameserver.model.zone.ZoneId;
+import com.l2jserver.gameserver.network.SystemMessageId;
+
+/**
+ * Arena Manager AI.
+ * @author St3eT
+ */
+public class ArenaManager extends AbstractNpcAI
+{
+	// NPCs
+	private static final int[] ARENA_MANAGER =
+	{
+		31226, // Arena Director (MDT)
+		31225, // Arena Manager (Coliseum)
+	};
+	// Skill
+	private static final SkillHolder[] BUFFS =
+	{
+		new SkillHolder(6805, 1), // Arena Empower
+		new SkillHolder(6806, 1), // Arena Acumen
+		new SkillHolder(6807, 1), // Arena Concentration
+		new SkillHolder(6808, 1), // Arena Might
+		new SkillHolder(6804, 1), // Arena Wind Walk
+		new SkillHolder(6812, 1), // Arena Berserker Spirit
+	};
+	private static final SkillHolder CP_RECOVERY = new SkillHolder(4380, 1); // Arena: CP Recovery
+	private static final SkillHolder HP_RECOVERY = new SkillHolder(6817, 1); // Arena HP Recovery
+	// Misc
+	private static final int CP_COST = 1000;
+	private static final int HP_COST = 1000;
+	private static final int BUFF_COST = 2000;
+	
+	private ArenaManager()
+	{
+		super(ArenaManager.class.getSimpleName(), "ai/npc");
+		addStartNpc(ARENA_MANAGER);
+		addTalkId(ARENA_MANAGER);
+		addFirstTalkId(ARENA_MANAGER);
+	}
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		switch (event)
+		{
+			case "CPrecovery":
+			{
+				if (player.getAdena() >= CP_COST)
+				{
+					takeItems(player, PcInventory.ADENA_ID, CP_COST);
+					startQuestTimer("CPrecovery_delay", 2000, npc, player);
+				}
+				else
+				{
+					player.sendPacket(SystemMessageId.YOU_NOT_ENOUGH_ADENA);
+				}
+				break;
+			}
+			case "CPrecovery_delay":
+			{
+				if ((player != null) && !player.isInsideZone(ZoneId.PVP))
+				{
+					npc.setTarget(player);
+					npc.doCast(CP_RECOVERY.getSkill());
+				}
+				break;
+			}
+			case "HPrecovery":
+			{
+				if (player.getAdena() >= HP_COST)
+				{
+					takeItems(player, PcInventory.ADENA_ID, HP_COST);
+					startQuestTimer("HPrecovery_delay", 2000, npc, player);
+				}
+				else
+				{
+					player.sendPacket(SystemMessageId.YOU_NOT_ENOUGH_ADENA);
+				}
+				break;
+			}
+			case "HPrecovery_delay":
+			{
+				if ((player != null) && !player.isInsideZone(ZoneId.PVP))
+				{
+					npc.setTarget(player);
+					npc.doCast(HP_RECOVERY.getSkill());
+				}
+				break;
+			}
+			case "Buff":
+			{
+				if (player.getAdena() >= BUFF_COST)
+				{
+					takeItems(player, PcInventory.ADENA_ID, BUFF_COST);
+					npc.setTarget(player);
+					for (SkillHolder skill : BUFFS)
+					{
+						npc.doCast(skill.getSkill());
+					}
+				}
+				else
+				{
+					player.sendPacket(SystemMessageId.YOU_NOT_ENOUGH_ADENA);
+				}
+				break;
+			}
+		}
+		return null;
+	}
+	
+	public static void main(String[] args)
+	{
+		new ArenaManager();
+	}
+}

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

@@ -124,7 +124,6 @@ import handlers.admincommandhandlers.AdminTvTEvent;
 import handlers.admincommandhandlers.AdminUnblockIp;
 import handlers.admincommandhandlers.AdminVitality;
 import handlers.admincommandhandlers.AdminZone;
-import handlers.bypasshandlers.ArenaBuff;
 import handlers.bypasshandlers.Augment;
 import handlers.bypasshandlers.Buy;
 import handlers.bypasshandlers.BuyShadowItem;
@@ -426,7 +425,6 @@ public class MasterHandler
 		{
 			// Bypass Handlers
 			Augment.class,
-			ArenaBuff.class,
 			Buy.class,
 			BuyShadowItem.class,
 			ChatLink.class,

+ 0 - 146
L2J_DataPack_BETA/dist/game/data/scripts/handlers/bypasshandlers/ArenaBuff.java

@@ -1,146 +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 java.util.StringTokenizer;
-import java.util.logging.Level;
-
-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.model.holders.SkillHolder;
-import com.l2jserver.gameserver.model.zone.ZoneId;
-
-/**
- * @author Xaras2
- */
-public class ArenaBuff implements IBypassHandler
-{
-	private static final String[] COMMANDS =
-	{
-		"ArenaBuffs",
-		"HPRecovery",
-		"CPRecovery"
-	};
-	
-	private final int[][] BUFFS =
-	{
-		{ // Fighter Buffs
-			6803,
-			6804,
-			6808,
-			6809,
-			6811,
-			6812
-		},
-		{ // Mage Buffs
-			6804,
-			6805,
-			6806,
-			6807,
-			6812
-		}
-	};
-	
-	@Override
-	public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
-	{
-		if (!target.isNpc())
-		{
-			return false;
-		}
-		
-		final L2Npc npc = (L2Npc) target;
-		final StringTokenizer st = new StringTokenizer(command);
-		try
-		{
-			String cmd = st.nextToken();
-			
-			if (cmd.equalsIgnoreCase(COMMANDS[0]))
-			{
-				if (!activeChar.reduceAdena("ArenaBuffs", 2000, activeChar.getLastFolkNPC(), true))
-				{
-					return false;
-				}
-				
-				for (int skillId : BUFFS[activeChar.isMageClass() ? 1 : 0])
-				{
-					SkillHolder skill = new SkillHolder(skillId, 1);
-					
-					if (skill.getSkill() != null)
-					{
-						npc.setTarget(activeChar);
-						npc.doCast(skill.getSkill());
-					}
-				}
-				return true;
-			}
-			else if (cmd.equalsIgnoreCase(COMMANDS[1]))
-			{
-				if (activeChar.isInsideZone(ZoneId.PVP)) // Cannot be used while inside the pvp zone
-				{
-					return false;
-				}
-				else if (!activeChar.reduceAdena("RestoreHP", 1000, activeChar.getLastFolkNPC(), true))
-				{
-					return false;
-				}
-				
-				SkillHolder skill = new SkillHolder(6817, 1);
-				if (skill.getSkill() != null)
-				{
-					npc.setTarget(activeChar);
-					npc.doCast(skill.getSkill());
-				}
-				return true;
-			}
-			else if (cmd.equalsIgnoreCase(COMMANDS[2]))
-			{
-				if (activeChar.isInsideZone(ZoneId.PVP)) // Cannot be used while inside the pvp zone
-				{
-					return false;
-				}
-				else if (!activeChar.reduceAdena("RestoreCP", 1000, activeChar.getLastFolkNPC(), true))
-				{
-					return false;
-				}
-				
-				SkillHolder skill = new SkillHolder(4380, 1);
-				if (skill.getSkill() != null)
-				{
-					npc.setTarget(activeChar);
-					npc.doCast(skill.getSkill());
-				}
-				return true;
-			}
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.WARNING, "Exception in " + getClass().getSimpleName(), e);
-		}
-		return false;
-	}
-	
-	@Override
-	public String[] getBypassList()
-	{
-		return COMMANDS;
-	}
-}

+ 2 - 2
L2J_DataPack_BETA/dist/game/data/stats/skills/06800-06899.xml

@@ -230,10 +230,10 @@
 		<set name="castRange" val="400" />
 		<set name="effectRange" val="900" />
 		<set name="magicLvl" val="1" />
-		<set name="operateType" val="A1" /> <!-- FIXME: value unconfirmed -->
+		<set name="operateType" val="A1" />
 		<set name="targetType" val="ONE" />
 		<for>
-			<effect name="Heal" noicon="1" val="5000" /> <!-- FIXME: value unconfirmed -->
+			<effect name="HealPercent" noicon="1" val="100" />
 		</for>
 	</skill>
 	<skill id="6818" levels="1" name="Powerful Rage">

+ 1 - 1
L2J_DataPack_BETA/dist/sql/game/npc.sql

@@ -7295,7 +7295,7 @@ INSERT INTO `npc` VALUES
 (31223, 31223, "Event Gatekeeper", 0, "", 0, "LineageMonster.cutie_cat", 8, 15, 70, "female", "L2Teleporter", 40, 2444.46819, 1345.8, 7.5, 2.7, 40, 43, 30, 21, 20, 20, 0, 0, 688.86373, 295.91597, 470.40463, 216.53847, 253, 4, 333, 0, 0, 0, 48, 120, 0, 1),
 (31224, 31224, "Event Gatekeeper", 0, "", 0, "LineageMonster.cutie_cat", 8, 15, 70, "female", "L2Teleporter", 40, 2444.46819, 1345.8, 7.5, 2.7, 40, 43, 30, 21, 20, 20, 0, 0, 688.86373, 295.91597, 470.40463, 216.53847, 253, 4, 333, 0, 0, 0, 48, 120, 0, 1),
 (31225, 31225, "Arena Manager", 0, "", 0, "LineageNPC.e_teleporter_FDwarf", 8, 21.3, 70, "female", "L2Warehouse", 40, 2444.46819, 1345.8, 7.5, 2.7, 40, 43, 30, 21, 20, 20, 0, 0, 688.86373, 295.91597, 470.40463, 216.53847, 253, 4, 333, 0, 0, 0, 50, 120, 0, 1),
-(31226, 31226, "Arena Director", 0, "", 0, "LineageNPC.a_fighterguild_teacher_MHuman", 8, 23, 70, "male", "L2Npc", 40, 2444.46819, 1345.8, 7.5, 2.7, 40, 43, 30, 21, 20, 20, 0, 0, 688.86373, 295.91597, 470.40463, 216.53847, 253, 4, 333, 0, 0, 0, 50, 120, 0, 1),
+(31226, 31226, "Arena Director", 0, "", 0, "LineageNPC.a_fighterguild_teacher_MHuman", 8, 23, 70, "male", "L2Warehouse", 40, 2444.46819, 1345.8, 7.5, 2.7, 40, 43, 30, 21, 20, 20, 0, 0, 688.86373, 295.91597, 470.40463, 216.53847, 253, 4, 333, 0, 0, 0, 50, 120, 0, 1),
 (31227, 31227, "Buzz the Cat", 0, "Event Manager", 0, "LineageMonster.cat_the_cat", 9, 16, 70, "male", "L2Npc", 40, 2444.46819, 1345.8, 7.5, 2.7, 40, 43, 30, 21, 20, 20, 0, 0, 688.86373, 295.91597, 470.40463, 216.53847, 253, 4, 333, 0, 0, 0, 80, 120, 0, 1),
 (31228, 31228, "Roy the Cat", 0, "Event Manager", 0, "LineageMonster.cat_the_cat", 9, 16, 70, "male", "L2Npc", 40, 2444.46819, 1345.8, 7.5, 2.7, 40, 43, 30, 21, 20, 20, 0, 0, 688.86373, 295.91597, 470.40463, 216.53847, 253, 4, 333, 0, 0, 0, 80, 120, 0, 1),
 (31229, 31229, "Winnie the Cat", 0, "Event Manager", 0, "LineageMonster.cutie_cat", 8, 15, 70, "female", "L2Npc", 40, 2444.46819, 1345.8, 7.5, 2.7, 40, 43, 30, 21, 20, 20, 0, 0, 688.86373, 295.91597, 470.40463, 216.53847, 253, 4, 333, 0, 0, 0, 48, 120, 0, 1),