Browse Source

BETA: Core-Part for ​​[DP10202].
* Reviewed by: !UnAfraid, Adry_85, malyelfik

St3eT 11 năm trước cách đây
mục cha
commit
e5f9335121

+ 0 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/enums/InstanceType.java

@@ -83,7 +83,6 @@ public enum InstanceType
 	// Fort Siege
 	L2FortCommanderInstance(L2DefenderInstance),
 	// Fort NPCs
-	L2FortEnvoyInstance(L2Npc),
 	L2FortLogisticsInstance(L2MerchantInstance),
 	L2FortManagerInstance(L2MerchantInstance),
 	L2FortSiegeNpcInstance(L2Npc),

+ 0 - 105
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2FortEnvoyInstance.java

@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2004-2014 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 com.l2jserver.gameserver.model.actor.instance;
-
-import com.l2jserver.gameserver.enums.InstanceType;
-import com.l2jserver.gameserver.model.actor.L2Npc;
-import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
-import com.l2jserver.gameserver.model.entity.Castle;
-import com.l2jserver.gameserver.model.entity.Fort;
-import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
-import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
-import com.l2jserver.gameserver.util.Util;
-
-public class L2FortEnvoyInstance extends L2Npc
-{
-	public L2FortEnvoyInstance(int objectID, L2NpcTemplate template)
-	{
-		super(objectID, template);
-		setInstanceType(InstanceType.L2FortEnvoyInstance);
-	}
-	
-	@Override
-	public void showChatWindow(L2PcInstance player)
-	{
-		String filePath;
-		final Fort fortress = getFort();
-		if (!player.isClanLeader() || (fortress.getResidenceId() != player.getClan().getFortId()))
-		{
-			filePath = "data/html/fortress/ambassador-not-leader.htm";
-		}
-		else if (fortress.getFortState() == 1)
-		{
-			filePath = "data/html/fortress/ambassador-rejected.htm";
-		}
-		else if (fortress.getFortState() == 2)
-		{
-			filePath = "data/html/fortress/ambassador-signed.htm";
-		}
-		else if (fortress.isBorderFortress())
-		{
-			// border fortresses may only declare independence
-			filePath = "data/html/fortress/ambassador-border.htm";
-		}
-		else
-		{
-			// normal fortresses can swear fealty or declare independence
-			filePath = "data/html/fortress/ambassador.htm";
-		}
-		
-		player.sendPacket(ActionFailed.STATIC_PACKET);
-		final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
-		html.setFile(player.getHtmlPrefix(), filePath);
-		html.replace("%objectId%", String.valueOf(getObjectId()));
-		html.replace("%castleName%", String.valueOf(fortress.getCastleByAmbassador(getId()).getName()));
-		player.sendPacket(html);
-	}
-	
-	@Override
-	public void onBypassFeedback(L2PcInstance player, String command)
-	{
-		if (command.startsWith("select "))
-		{
-			String param = command.substring(7);
-			Fort fortress = getFort();
-			Castle castle = fortress.getCastleByAmbassador(getId());
-			String filePath;
-			
-			if (castle.getOwnerId() == 0)
-			{
-				filePath = "data/html/fortress/ambassador-not-owned.htm";
-			}
-			else
-			{
-				int choice = Util.isDigit(param) ? Integer.parseInt(param) : 0;
-				fortress.setFortState(choice, castle.getResidenceId());
-				filePath = (choice == 1) ? "data/html/fortress/ambassador-independent.htm" : "data/html/fortress/ambassador-signed.htm";
-			}
-			
-			final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
-			html.setFile(player.getHtmlPrefix(), filePath);
-			html.replace("%castleName%", castle.getName());
-			player.sendPacket(html);
-		}
-		else
-		{
-			super.onBypassFeedback(player, command);
-		}
-	}
-}

+ 0 - 39
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Fort.java

@@ -264,7 +264,6 @@ public final class Fort extends AbstractResidence
 		if ((getOwnerClan() != null) && (getFortState() == 0))
 		{
 			spawnSpecialEnvoys();
-			ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleSpecialEnvoysDeSpawn(this), 3600000); // Prepare 1hr task for special envoys despawn
 		}
 	}
 	
@@ -282,34 +281,6 @@ public final class Fort extends AbstractResidence
 		return null;
 	}
 	
-	public static class ScheduleSpecialEnvoysDeSpawn implements Runnable
-	{
-		private final Fort _fortInst;
-		
-		public ScheduleSpecialEnvoysDeSpawn(Fort pFort)
-		{
-			_fortInst = pFort;
-		}
-		
-		@Override
-		public void run()
-		{
-			try
-			{
-				// if state not decided, change state to indenpendent
-				if (_fortInst.getFortState() == 0)
-				{
-					_fortInst.setFortState(1, 0);
-				}
-				_fortInst.despawnSpecialEnvoys();
-			}
-			catch (Exception e)
-			{
-				_log.log(Level.WARNING, "Exception: ScheduleSpecialEnvoysSpawn() for Fort " + _fortInst.getName() + ": " + e.getMessage(), e);
-			}
-		}
-	}
-	
 	public void endOfSiege(L2Clan clan)
 	{
 		ThreadPoolManager.getInstance().scheduleGeneral(new endFortressSiege(this, clan), 1000);
@@ -460,7 +431,6 @@ public final class Fort extends AbstractResidence
 		}
 		
 		spawnSpecialEnvoys();
-		ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleSpecialEnvoysDeSpawn(this), 3600000); // Prepare 1hr task for special envoys despawn
 		// if clan have already fortress, remove it
 		if (clan.getFortId() > 0)
 		{
@@ -1187,15 +1157,6 @@ public final class Fort extends AbstractResidence
 		}
 	}
 	
-	public void despawnSpecialEnvoys()
-	{
-		for (L2Spawn spawnDat : _specialEnvoys)
-		{
-			spawnDat.stopRespawn();
-			spawnDat.getLastSpawn().deleteMe();
-		}
-	}
-	
 	private void initNpcs()
 	{
 		try (Connection con = L2DatabaseFactory.getInstance().getConnection();

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestAcquireSkill.java

@@ -279,7 +279,7 @@ public final class RequestAcquireSkill extends L2GameClientPacket
 				clan.broadcastToOnlineMembers(new PledgeSkillList(clan));
 				activeChar.sendPacket(new AcquireSkillDone());
 				
-				showSUbUnitSkillList(activeChar);
+				showSubUnitSkillList(activeChar);
 				break;
 			}
 			case TRANSFER:
@@ -376,7 +376,7 @@ public final class RequestAcquireSkill extends L2GameClientPacket
 		}
 	}
 	
-	public static void showSUbUnitSkillList(L2PcInstance activeChar)
+	public static void showSubUnitSkillList(L2PcInstance activeChar)
 	{
 		final List<L2SkillLearn> skills = SkillTreesData.getInstance().getAvailableSubPledgeSkills(activeChar.getClan());
 		final AcquireSkillList asl = new AcquireSkillList(AcquireSkillType.SUBPLEDGE);