Selaa lähdekoodia

BETA: Unhardcoding Wyvern Manager:
* Unified AI for castle, forts and halls.
* Merged bypass handler and core AI in a single AI script in Datapack.

Reviewed by: jurchiks, UnAfraid, Zoey76

Zoey76 12 vuotta sitten
vanhempi
sitoutus
f946dbc8ad

+ 5 - 0
L2J_Server_BETA/dist/game/config/Feature.properties

@@ -390,6 +390,11 @@ ClanLevel11Requirement = 170
 # Other
 # ---------------------------------------------------------------------------
 
+# Allow riding wyvern ignoring 7 Signs status
+# This will allow Castle Lords to ride wyvern even when Dusk has won Seal of Strife
+# Default: False
+AllowRideWyvernAlways = False
+
 # Allow riding wyvern during Castle/Fort Siege
 # Default: True
 AllowRideWyvernDuringSiege = True

+ 3 - 0
L2J_Server_BETA/java/com/l2jserver/Config.java

@@ -415,7 +415,9 @@ public final class Config
 	public static int CLAN_LEVEL_9_REQUIREMENT;
 	public static int CLAN_LEVEL_10_REQUIREMENT;
 	public static int CLAN_LEVEL_11_REQUIREMENT;
+	public static boolean ALLOW_WYVERN_ALWAYS;
 	public static boolean ALLOW_WYVERN_DURING_SIEGE;
+	
 	// --------------------------------------------------
 	// General Settings
 	// --------------------------------------------------
@@ -1466,6 +1468,7 @@ public final class Config
 			CLAN_LEVEL_9_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel9Requirement", "120"));
 			CLAN_LEVEL_10_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel10Requirement", "140"));
 			CLAN_LEVEL_11_REQUIREMENT = Integer.parseInt(Feature.getProperty("ClanLevel11Requirement", "170"));
+			ALLOW_WYVERN_ALWAYS = Boolean.parseBoolean(Feature.getProperty("AllowRideWyvernAlways", "False"));
 			ALLOW_WYVERN_DURING_SIEGE = Boolean.parseBoolean(Feature.getProperty("AllowRideWyvernDuringSiege", "True"));
 			
 			// Load Character L2Properties file (if exists)

+ 0 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2Object.java

@@ -162,7 +162,6 @@ public abstract class L2Object
 		L2TrainerInstance(L2NpcInstance),
 		L2TrainerHealersInstance(L2TrainerInstance),
 		L2VillageMasterInstance(L2NpcInstance),
-		L2WyvernManagerInstance(L2NpcInstance),
 		// Doormens
 		L2DoormenInstance(L2NpcInstance),
 		L2CastleDoormenInstance(L2DoormenInstance),

+ 0 - 48
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2CastleWyvernManagerInstance.java

@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2004-2013 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.model.actor.templates.L2NpcTemplate;
-
-public class L2CastleWyvernManagerInstance extends L2WyvernManagerInstance
-{
-	public L2CastleWyvernManagerInstance(int objectId, L2NpcTemplate template)
-	{
-		super(objectId, template);
-	}
-	
-	@Override
-	public final boolean isOwnerClan(L2PcInstance player)
-	{
-		if ((player.getClan() != null) && (getCastle() != null))
-		{
-			if ((player.getClanId() == getCastle().getOwnerId()) && player.isClanLeader())
-			{
-				return true;
-			}
-		}
-		return false;
-	}
-	
-	@Override
-	public boolean isInSiege()
-	{
-		return getCastle().getZone().isActive();
-	}
-}

+ 0 - 48
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2FortWyvernManagerInstance.java

@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2004-2013 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.model.actor.templates.L2NpcTemplate;
-
-public class L2FortWyvernManagerInstance extends L2WyvernManagerInstance
-{
-	public L2FortWyvernManagerInstance(int objectId, L2NpcTemplate template)
-	{
-		super(objectId, template);
-	}
-	
-	@Override
-	public final boolean isOwnerClan(L2PcInstance player)
-	{
-		if ((player.getClan() != null) && (getFort() != null) && (getFort().getOwnerClan() != null))
-		{
-			if ((player.getClanId() == getFort().getOwnerClan().getClanId()) && player.isClanLeader())
-			{
-				return true;
-			}
-		}
-		return false;
-	}
-	
-	@Override
-	public boolean isInSiege()
-	{
-		return getFort().getZone().isActive();
-	}
-}

+ 0 - 78
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2WyvernManagerInstance.java

@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2004-2013 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.model.L2Clan;
-import com.l2jserver.gameserver.model.actor.L2Npc;
-import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
-import com.l2jserver.gameserver.model.entity.ClanHall;
-import com.l2jserver.gameserver.model.entity.clanhall.SiegableHall;
-import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
-import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
-
-public class L2WyvernManagerInstance extends L2Npc
-{
-	public L2WyvernManagerInstance(int objectId, L2NpcTemplate template)
-	{
-		super(objectId, template);
-		setInstanceType(InstanceType.L2WyvernManagerInstance);
-	}
-	
-	@Override
-	public void showChatWindow(L2PcInstance player)
-	{
-		player.sendPacket(ActionFailed.STATIC_PACKET);
-		String filename = "data/html/wyvernmanager/wyvernmanager-no.htm";
-		
-		if (isOwnerClan(player))
-		{
-			filename = "data/html/wyvernmanager/wyvernmanager.htm"; // Owner message window
-		}
-		
-		NpcHtmlMessage html = new NpcHtmlMessage(1);
-		html.setFile(player.getHtmlPrefix(), filename);
-		html.replace("%objectId%", String.valueOf(getObjectId()));
-		html.replace("%npcname%", getName());
-		player.sendPacket(html);
-	}
-	
-	public boolean isOwnerClan(L2PcInstance player)
-	{
-		L2Clan clan = player.getClan();
-		if (clan != null)
-		{
-			ClanHall hall = getConquerableHall();
-			if (hall != null)
-			{
-				return hall.getOwnerId() == clan.getClanId();
-			}
-		}
-		return false;
-	}
-	
-	public boolean isInSiege()
-	{
-		SiegableHall hall = getConquerableHall();
-		if (hall != null)
-		{
-			return hall.isInSiege();
-		}
-		return getCastle().getSiege().getIsInProgress();
-	}
-}