소스 검색

Seal of Strife bonuses by Kreastr, quote:
- Dawn/Rookie Mercenarie tickets are now with correct handlers.
- Seal of Strife blocks use of "wrong" tickets during the seal validation period.
- You cannot post any mercenaries during competition period.
- You cannot ride wyveren on validation period if the Seal of Strife is controlled by Dusk
- Seal of Strife now increase/decrease Pdef/Mdef of Gates/Walls when is controlled.
What is missing:
- Price difference of upgrading walls/gates cannot be implemented without working system of upgrading castle defences(I'm going to fix this issue).

DP support needed

I also changed some code about to-castle teleporting (outside of this
patch) since they seemed strange (if (true || condition) ...).

Sami 16 년 전
부모
커밋
dae84c2eb5

+ 9 - 0
L2_GameServer/java/config/Feature.properties

@@ -280,3 +280,12 @@ AltFestivalSecondSwarm = 720000
 # At what point the Chests Spawn in.
 #   Default : 15 minutes
 AltFestivalChestspawn = 900000
+
+# -----------------------------------------
+# Seal of Strife bonuses
+# -----------------------------------------
+#This multipliers are used to change Pdef/Mdef of castle Gates/Walls while Seal of Strife is controlled by one of the sides.
+AltDawnGatesPdefMult = 1.1
+AltDuskGatesPdefMult = 0.8
+AltDawnGatesMdefMult = 1.1
+AltDuskGatesMdefMult = 0.8

+ 9 - 2
L2_GameServer/java/net/sf/l2j/Config.java

@@ -692,7 +692,11 @@ public final class Config
     public static long		ALT_FESTIVAL_SECOND_SPAWN;
     public static long		ALT_FESTIVAL_SECOND_SWARM;
     public static long		ALT_FESTIVAL_CHEST_SPAWN;
-	
+    public static double	ALT_SIEGE_DAWN_GATES_PDEF_MULT;
+    public static double	ALT_SIEGE_DUSK_GATES_PDEF_MULT;
+    public static double	ALT_SIEGE_DAWN_GATES_MDEF_MULT;
+    public static double	ALT_SIEGE_DUSK_GATES_MDEF_MULT;    
+    
     /** ************************************************** **/
 	/** SevinSigns Settings -End                           **/
 	/** ************************************************** **/
@@ -1089,7 +1093,10 @@ public final class Config
                 ALT_FESTIVAL_FIRST_SWARM       						= Long.parseLong(Feature.getProperty("AltFestivalFirstSwarm", "300000"));                ALT_FESTIVAL_SECOND_SPAWN       = Long.parseLong(Feature.getProperty("AltFestivalSecondSpawn", "540000"));
                 ALT_FESTIVAL_SECOND_SWARM       					= Long.parseLong(Feature.getProperty("AltFestivalSecondSwarm", "720000"));
                 ALT_FESTIVAL_CHEST_SPAWN       						= Long.parseLong(Feature.getProperty("AltFestivalChestSpawn", "900000"));
-
+                ALT_SIEGE_DAWN_GATES_PDEF_MULT						= Double.parseDouble(Feature.getProperty("AltDawnGatesPdefMult", "1.1"));
+                ALT_SIEGE_DUSK_GATES_PDEF_MULT						= Double.parseDouble(Feature.getProperty("AltDuskGatesPdefMult", "0.8"));
+                ALT_SIEGE_DAWN_GATES_MDEF_MULT						= Double.parseDouble(Feature.getProperty("AltDawnGatesMdefMult", "1.1"));
+                ALT_SIEGE_DUSK_GATES_MDEF_MULT						= Double.parseDouble(Feature.getProperty("AltDuskGatesMdefMult", "0.8"));
             }
             catch (Exception e)
             {

+ 62 - 7
L2_GameServer/java/net/sf/l2j/gameserver/SevenSigns.java

@@ -28,6 +28,7 @@ import javolution.util.FastMap;
 import net.sf.l2j.Config;
 import net.sf.l2j.L2DatabaseFactory;
 import net.sf.l2j.gameserver.datatables.MapRegionTable;
+import net.sf.l2j.gameserver.datatables.SkillTable;
 import net.sf.l2j.gameserver.instancemanager.CastleManager;
 import net.sf.l2j.gameserver.model.AutoChatHandler;
 import net.sf.l2j.gameserver.model.AutoSpawnHandler;
@@ -44,8 +45,8 @@ import net.sf.l2j.gameserver.util.Broadcast;
 /**
  *  Seven Signs Engine
  *
- *  TODO:
- *  - Implementation of the Seal of Strife for sieges.
+ * 
+ *  
  *
  *  @author Tempy
  */
@@ -1406,7 +1407,8 @@ public class SevenSigns
 
                     // Perform initial Seal Validation set up.
                     initializeSeals();
-
+                    //Buff/Debuff members of the event when Seal of Strife captured. 
+                    GiveCPMult(getSealOwner(SEAL_STRIFE));
                     // Send message that Seal Validation has begun.
                     sendMessageToAll(SystemMessageId.SEAL_VALIDATION_PERIOD_BEGUN);
 
@@ -1421,7 +1423,8 @@ public class SevenSigns
 
 	                // Send message that Seal Validation has ended.
 	                sendMessageToAll(SystemMessageId.SEAL_VALIDATION_PERIOD_ENDED);
-
+	                //Clear Seal of Strife influence.
+	                RemoveCPMult();
 	                // Reset all data
 	                resetPlayerData();
 	                resetSeals();
@@ -1462,7 +1465,59 @@ public class SevenSigns
             }
 
 	        SevenSignsPeriodChange sspc = new SevenSignsPeriodChange();
-	        ThreadPoolManager.getInstance().scheduleGeneral(sspc, getMilliToPeriodChange());
-	    }
+ 	        ThreadPoolManager.getInstance().scheduleGeneral(sspc, getMilliToPeriodChange());
+ 	    }
+ 	}
+	public boolean CheckIsDawnPostingTicket(int itemId){
+		//TODO I think it should be some kind of a list in the datapack for compare;
+		if (itemId > 6114 && itemId < 6175) return true;
+		if (itemId > 6801 && itemId < 6812) return true;
+		if (itemId > 7997 && itemId < 8008) return true;
+		if (itemId > 7940 && itemId < 7951) return true;
+		if (itemId > 6294 && itemId < 6307) return true;
+		if (itemId > 6831 && itemId < 6834) return true;
+		if (itemId > 8027 && itemId < 8030) return true;
+		if (itemId > 7970 && itemId < 7973) return true;
+		return false;	
 	}
-}
+	public boolean CheckIsRookiePostingTicket(int itemId){
+		//TODO I think it should be some kind of a list in the datapack for compare;
+		if (itemId > 6174 && itemId < 6295) return true;
+		if (itemId > 6811 && itemId < 6832) return true;
+		if (itemId > 7950 && itemId < 7971) return true;
+		if (itemId > 8007 && itemId < 8028) return true;
+		return false;	
+		}
+	public void GiveCPMult(int StrifeOwner){
+		//Gives "Victor of War" passive skill to all online characters with Cabal, which controls Seal of Strife 
+	for (L2PcInstance character : L2World.getInstance().getAllPlayers().values()){
+    	if (getPlayerCabal(character) != SevenSigns.CABAL_NULL)
+    		if (getPlayerCabal(character) == StrifeOwner)
+    			character.addSkill(SkillTable.getInstance().getInfo(5074,1));
+    		else
+    			//Gives "The Vanquished of War" passive skill to all online characters with Cabal, which does not control Seal of Strife
+    			character.addSkill(SkillTable.getInstance().getInfo(5075,1));		
+		}			
+	}
+	public void RemoveCPMult(){
+		for (L2PcInstance character : L2World.getInstance().getAllPlayers().values()){
+			//Remove SevenSigns' buffs/debuffs.
+        	character.removeSkill(SkillTable.getInstance().getInfo(5074,1));
+        	character.removeSkill(SkillTable.getInstance().getInfo(5075,1));   			
+		}
+	}
+	public boolean CheckSummonConditions(L2PcInstance activeChar){
+	if (activeChar == null) return true;
+	//Golems cannot be summoned by Dusk when the Seal of Strife is controlled by the Dawn
+	if (isSealValidationPeriod())
+		if (getSealOwner(SEAL_STRIFE) == CABAL_DAWN)
+			if (getPlayerCabal(activeChar) == CABAL_DUSK)
+			{
+				activeChar.sendMessage("You cannot summon Siege Golem or Cannon while Seal of Strife posessed by Lords of Dawn.");
+				return true;	
+			}
+					
+	return false;	
+	}
+ }
+

+ 34 - 13
L2_GameServer/java/net/sf/l2j/gameserver/datatables/MapRegionTable.java

@@ -36,6 +36,7 @@ import net.sf.l2j.gameserver.model.entity.ClanHall;
 import net.sf.l2j.gameserver.model.entity.Fort;
 import net.sf.l2j.gameserver.model.zone.type.L2ArenaZone;
 import net.sf.l2j.gameserver.model.zone.type.L2ClanHallZone;
+import net.sf.l2j.gameserver.SevenSigns;
 
 /**
  * This class ...
@@ -396,19 +397,21 @@ public class MapRegionTable
 				if (teleportWhere == TeleportWhereType.Castle)
 				{
 					castle = CastleManager.getInstance().getCastleByOwner(player.getClan());
-					// Check if player is on castle or fortress ground
+					// Otherwise check if player is on castle or fortress ground
+					// and player's clan is defender
 					if (castle == null)
+					{
 						castle = CastleManager.getInstance().getCastle(player);
+						if (!(castle != null 
+								&& castle.getSiege().getIsInProgress() 
+								&& castle.getSiege().getDefenderClan(player.getClan()) != null))
+							castle = null;
+					}
 					
 					if (castle != null && castle.getCastleId() > 0)
 					{
-						// If Teleporting to castle or
-						// If is on caslte with siege and player's clan is defender
-						if (teleportWhere == TeleportWhereType.Castle || (teleportWhere == TeleportWhereType.Castle && castle.getSiege().getIsInProgress() && castle.getSiege().getDefenderClan(player.getClan()) != null))
-						{
 							coord = castle.getZone().getSpawn();
 							return new Location(coord[0], coord[1], coord[2]);
-						}
 					}
 				}
 				
@@ -416,18 +419,21 @@ public class MapRegionTable
 				if (teleportWhere == TeleportWhereType.Fortress)
 				{
 					fort = FortManager.getInstance().getFortByOwner(player.getClan());
+					// Otherwise check if player is on castle or fortress ground
+					// and player's clan is defender
 					if (fort == null)
+					{
 						fort = FortManager.getInstance().getFort(player);
+						if (!(fort != null 
+								&& fort.getSiege().getIsInProgress() 
+								&& fort.getSiege().getDefenderClan(player.getClan()) != null))
+							fort = null;
+					}
 					
 					if (fort != null && fort.getFortId() > 0)
 					{
-						// If Teleporting to castle or
-						// If is on caslte with siege and player's clan is defender
-						if (teleportWhere == TeleportWhereType.Fortress || (teleportWhere == TeleportWhereType.Fortress && fort.getSiege().getIsInProgress() && fort.getSiege().getDefenderClan(player.getClan()) != null))
-						{
-							coord = fort.getZone().getSpawn();
-							return new Location(coord[0], coord[1], coord[2]);
-						}
+						coord = fort.getZone().getSpawn();
+						return new Location(coord[0], coord[1], coord[2]);
 					}
 				}
 				
@@ -488,6 +494,21 @@ public class MapRegionTable
 				coord = arena.getSpawnLoc();
 				return new Location(coord[0], coord[1], coord[2]);
 			}
+			//Checking if needed to be respawned in "far" town from the castle;
+			castle = CastleManager.getInstance().getCastle(player);
+			if ( castle != null)
+			{
+				if (castle.getSiege().getIsInProgress())
+				{
+					// Check if player's clan is participating
+					if ((castle.getSiege().checkIsDefender(player.getClan()) ||	castle.getSiege().checkIsAttacker(player.getClan())) 
+							&& SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DAWN)
+					{
+						coord = TownManager.getInstance().getSecondClosestTown(activeChar).getSpawnLoc();
+						return new Location(coord[0], coord[1], coord[2]);
+					}
+				}
+			}    
 		}
 		
 		// Get the nearest town

+ 47 - 12
L2_GameServer/java/net/sf/l2j/gameserver/handler/itemhandlers/MercTicket.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.handler.itemhandlers;
 
+import net.sf.l2j.gameserver.SevenSigns;
 import net.sf.l2j.gameserver.handler.IItemHandler;
 import net.sf.l2j.gameserver.instancemanager.CastleManager;
 import net.sf.l2j.gameserver.instancemanager.MercTicketManager;
@@ -53,15 +54,22 @@ public class MercTicket implements IItemHandler
 		int castleId = -1;
 		if (castle != null)
 			castleId = castle.getCastleId();
-		
+
 		//add check that certain tickets can only be placed in certain castles
 		if (MercTicketManager.getInstance().getTicketCastleId(itemId) != castleId)
 		{
-			switch (castleId)
+			if (castleId == -1)
+			{
+				// player is not in a castle
+				activeChar.sendMessage("Mercenary Tickets can only be used in a castle.");
+				return;  			
+			}
+
+			switch (MercTicketManager.getInstance().getTicketCastleId(itemId))
 			{
 				case 1:
 					activeChar.sendMessage("This Mercenary Ticket can only be used in Gludio.");
-					return;
+		     		return;
 				case 2:
 					activeChar.sendMessage("This Mercenary Ticket can only be used in Dion.");
 					return;
@@ -86,10 +94,6 @@ public class MercTicket implements IItemHandler
 				case 9:
 					activeChar.sendMessage("This Mercenary Ticket can only be used in Schuttgart.");
 					return;
-					// player is not in a castle
-				default:
-					activeChar.sendMessage("Mercenary Tickets can only be used in a castle.");
-					return;
 			}
 		}
 		
@@ -103,13 +107,44 @@ public class MercTicket implements IItemHandler
 		{
 			activeChar.sendMessage("You cannot hire mercenary while siege is in progress!");
 			return;
-		}
-		
-		if (MercTicketManager.getInstance().isAtCasleLimit(item.getItemId()))
-		{
-			activeChar.sendMessage("You cannot hire any more mercenaries");
+         }
+ 
+        //Checking Seven Signs Quest Period
+        if (SevenSigns.getInstance().getCurrentPeriod() != SevenSigns.PERIOD_SEAL_VALIDATION) 
+        {
+        	//_log.warning("Someone has tried to spawn a guardian during Quest Event Period of The Seven Signs.");       	
+        	activeChar.sendMessage("You cannot position any Mercenaries during Quest Period.");
+        	return;
+        }
+        //Checking the Seal of Strife status
+        switch (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE))
+        {
+        	case SevenSigns.CABAL_NULL:
+        		if (SevenSigns.getInstance().CheckIsDawnPostingTicket(itemId))
+        		{
+                	//_log.warning("Someone has tried to spawn a Dawn Mercenary though the Seal of Strife is not controlled by anyone.");       	
+                	activeChar.sendMessage("You cannot position any Dawn Mercenaries at this time.");        		
+        			return;
+        		}        			
+        		break;
+        	case SevenSigns.CABAL_DUSK:
+        		if (!SevenSigns.getInstance().CheckIsRookiePostingTicket(itemId))
+        		{
+                	//_log.warning("Someone has tried to spawn a non-Rookie Mercenary though the Seal of Strife is controlled by Revolutionaries of Dusk.");       	
+                	activeChar.sendMessage("You can position only Rookie Mercenaries at this time.");        		
+        			return;
+        		}          		
+        		break;
+        	case SevenSigns.CABAL_DAWN:        	
+        		break;
+        }                
+        
+        if(MercTicketManager.getInstance().isAtCasleLimit(item.getItemId()))
+        {
+        	activeChar.sendMessage("You cannot hire any more mercenaries");
 			return;
 		}
+		
 		if (MercTicketManager.getInstance().isAtTypeLimit(item.getItemId()))
 		{
 			activeChar.sendMessage("You cannot hire any more mercenaries of this type.  You may still hire other types of mercenaries");

+ 43 - 52
L2_GameServer/java/net/sf/l2j/gameserver/instancemanager/MercTicketManager.java

@@ -74,20 +74,20 @@ public class MercTicketManager
 
     //TODO move all these values into siege.properties
     // max tickets per merc type = 10 + (castleid * 2)?
-	// max ticker per castle = 40 + (castleid * 20)?
-    private static final int[] MAX_MERC_PER_TYPE = {
-            10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, // Gludio
-            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, // Dion
-            10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, // Giran
-            10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, // Oren
-            20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // Aden
-            20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // Innadril
-            20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // Goddard
-            20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // Rune
-            20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20  // Schuttgart
-            };
-    private static final int[] MERCS_MAX_PER_CASTLE = {
-            100,  // Gludio
+ 	// max ticker per castle = 40 + (castleid * 20)?
+     private static final int[] MAX_MERC_PER_TYPE = {
+            10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, // Gludio
+            15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, // Dion
+            10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, // Giran
+            10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, // Oren
+            20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // Aden
+            20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // Innadril
+            20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // Goddard
+            20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // Rune
+            20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20  // Schuttgart
+             };
+     private static final int[] MERCS_MAX_PER_CASTLE = {
+             100,  // Gludio
             150,  // Dion
             200, // Giran
             300, // Oren
@@ -96,30 +96,30 @@ public class MercTicketManager
             400, // Goddard
             400, // Rune
             400  // Schuttgart
-            };
-
+    };
+    
     private static final int[] ITEM_IDS = {
-	3960, 3961, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3969, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, 6047, 	// Gludio
-	3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 6051, 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 	// Dion
-	3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 3995, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 	// Giran
-	3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 	// Oren
-	4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 	// Aden
-	5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 	// Innadril
-	6779, 6780, 6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6792, 6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 	// Goddard
-	7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 7995, 7996, 7997, 	// Rune
-	7918, 7919, 7920, 7921, 7922, 7923, 7924, 7925, 7926, 7927, 7931, 7932, 7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940		// Schuttgart
+	3960, 3961, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3969, 6115, 6116, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, 6047, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 6235, 6236, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 6295, 6296,	// Gludio
+	3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6133, 6134, 6051, 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 6194, 6245, 6246, 6247, 6248, 6249, 6250, 6251, 6252, 6253, 6254, 6297, 6298,	// Dion
+	3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 3995, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 6142, 6143, 6144, 6064, 6065, 6066, 6067, 6068, 6069, 6070, 6071, 6072, 6073, 6195, 6196, 6197, 6198, 6199, 6200, 6201, 6202, 6203, 6204, 6255, 6256, 6257, 6258, 6259, 6260, 6261, 6262, 6263, 6264, 6299, 6300,	// Giran
+	3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6154, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 6212, 6213, 6214, 6265, 6266, 6267, 6268, 6269, 6270, 6271, 6272, 6273, 6274, 6301, 6302,	// Oren
+	4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 6164, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 6097, 6098, 6099, 6215, 6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 6275, 6276, 6277, 6278, 6279, 6280, 6281, 6282, 6283, 6284, 6303, 6304,	// Aden
+	5205, 5206, 5207, 5208, 5209, 5210, 5211, 5212, 5213, 5214, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6172, 6173, 6174, 6105, 6106, 6107, 6108, 6109, 6110, 6111, 6112, 6113, 6114, 6225, 6226, 6227, 6228, 6229, 6230, 6231, 6232, 6233, 6234, 6285, 6286, 6287, 6288, 6289, 6290, 6291, 6292, 6293, 6294, 6305, 6306,	// Innadril
+	6779, 6780, 6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6802, 6803, 6804, 6805, 6806, 6807, 6808, 6809, 6810, 6811, 6792, 6793, 6794, 6795, 6796, 6797, 6798, 6799, 6800, 6801, 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824, 6825, 6826, 6827, 6828, 6829, 6830, 6831, 6832, 6833,	// Goddard
+	7973, 7974, 7975, 7976, 7977, 7978, 7979, 7980, 7981, 7982, 7998, 7999, 8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007, 7988, 7989, 7990, 7991, 7992, 7993, 7994, 7995, 7996, 7997, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8029,	// Rune
+	7918, 7919, 7920, 7921, 7922, 7923, 7924, 7925, 7926, 7927, 7941, 7942, 7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7931, 7932, 7933, 7934, 7935, 7936, 7937, 7938, 7939, 7940, 7951, 7952, 7953, 7954, 7955, 7956, 7957, 7958, 7959, 7960, 7961, 7962, 7963, 7964, 7965, 7966, 7967, 7968, 7969, 7970, 7971, 7972	// Schuttgart
 	};
 
     private static final int[] NPC_IDS = {
-           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, // Gludio
-           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, // Dion
-           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, // Giran
-           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, // Oren
-           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, // Aden
-           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, // Innadril
-           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, // Goddard
-           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, // Rune
-           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039  // Schuttgart
+           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35020, 35021, 35022, 35023, 3502, 35025, 35026, 35027, 35028, 35029, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, 35040, 35041, 35042, 35043, 35044, 35045, 35046, 35047, 35048, 35049, 35050, 35051, 35052, 35053, 35054, 35055, 35056, 35057, 35058, 35059, 35060, 35061, // Gludio
+           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35020, 35021, 35022, 35023, 3502, 35025, 35026, 35027, 35028, 35029, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, 35040, 35041, 35042, 35043, 35044, 35045, 35046, 35047, 35048, 35049, 35050, 35051, 35052, 35053, 35054, 35055, 35056, 35057, 35058, 35059, 35060, 35061, // Dion
+           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35020, 35021, 35022, 35023, 3502, 35025, 35026, 35027, 35028, 35029, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, 35040, 35041, 35042, 35043, 35044, 35045, 35046, 35047, 35048, 35049, 35050, 35051, 35052, 35053, 35054, 35055, 35056, 35057, 35058, 35059, 35060, 35061, // Giran
+           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35020, 35021, 35022, 35023, 3502, 35025, 35026, 35027, 35028, 35029, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, 35040, 35041, 35042, 35043, 35044, 35045, 35046, 35047, 35048, 35049, 35050, 35051, 35052, 35053, 35054, 35055, 35056, 35057, 35058, 35059, 35060, 35061, // Oren
+           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35020, 35021, 35022, 35023, 3502, 35025, 35026, 35027, 35028, 35029, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, 35040, 35041, 35042, 35043, 35044, 35045, 35046, 35047, 35048, 35049, 35050, 35051, 35052, 35053, 35054, 35055, 35056, 35057, 35058, 35059, 35060, 35061, // Aden
+           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35020, 35021, 35022, 35023, 3502, 35025, 35026, 35027, 35028, 35029, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, 35040, 35041, 35042, 35043, 35044, 35045, 35046, 35047, 35048, 35049, 35050, 35051, 35052, 35053, 35054, 35055, 35056, 35057, 35058, 35059, 35060, 35061, // Innadril
+           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35020, 35021, 35022, 35023, 3502, 35025, 35026, 35027, 35028, 35029, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, 35040, 35041, 35042, 35043, 35044, 35045, 35046, 35047, 35048, 35049, 35050, 35051, 35052, 35053, 35054, 35055, 35056, 35057, 35058, 35059, 35060, 35061, // Goddard
+           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35020, 35021, 35022, 35023, 3502, 35025, 35026, 35027, 35028, 35029, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, 35040, 35041, 35042, 35043, 35044, 35045, 35046, 35047, 35048, 35049, 35050, 35051, 35052, 35053, 35054, 35055, 35056, 35057, 35058, 35059, 35060, 35061, // Rune
+           35010, 35011, 35012, 35013, 35014, 35015, 35016, 35017, 35018, 35019, 35020, 35021, 35022, 35023, 3502, 35025, 35026, 35027, 35028, 35029, 35030,35031,35032,35033,35034,35035,35036,35037,35038,35039, 35040, 35041, 35042, 35043, 35044, 35045, 35046, 35047, 35048, 35049, 35050, 35051, 35052, 35053, 35054, 35055, 35056, 35057, 35058, 35059, 35060, 35061, // Schuttgart
            };
 
     // =========================================================
@@ -133,24 +133,15 @@ public class MercTicketManager
     // returns the castleId for the passed ticket item id
     public int getTicketCastleId(int itemId)
     {
-    	if ((itemId >= ITEM_IDS[0] &&  itemId <= ITEM_IDS[9]) || (itemId >= ITEM_IDS[10] &&  itemId <= ITEM_IDS[19]))
-    		return 1;	// Gludio
-    	if ((itemId >= ITEM_IDS[20] &&  itemId <= ITEM_IDS[29]) || (itemId >= ITEM_IDS[30] &&  itemId <= ITEM_IDS[39]))
-    		return 2;	// Dion
-    	if ((itemId >= ITEM_IDS[40] &&  itemId <= ITEM_IDS[49]) || (itemId >= ITEM_IDS[50] &&  itemId <= ITEM_IDS[59]))
-    		return 3;	// Giran
-    	if ((itemId >= ITEM_IDS[60] &&  itemId <= ITEM_IDS[69]) || (itemId >= ITEM_IDS[70] &&  itemId <= ITEM_IDS[79]))
-    		return 4;	// Oren
-    	if ((itemId >= ITEM_IDS[80] &&  itemId <= ITEM_IDS[89]) || (itemId >= ITEM_IDS[90] &&  itemId <= ITEM_IDS[99]))
-    		return 5;	// Aden
-    	if ((itemId >= ITEM_IDS[100] &&  itemId <= ITEM_IDS[109]) || (itemId >= ITEM_IDS[110] &&  itemId <= ITEM_IDS[119]))
-    		return 6;	// Innadril
-    	if ((itemId >= ITEM_IDS[120] &&  itemId <= ITEM_IDS[129]) || (itemId >= ITEM_IDS[130] &&  itemId <= ITEM_IDS[139]))
-    		return 7;	// Goddard
-    	if ((itemId >= ITEM_IDS[140] &&  itemId <= ITEM_IDS[149]) || (itemId >= ITEM_IDS[150] &&  itemId <= ITEM_IDS[159]))
-    		return 8;	// Rune
-    	if ((itemId >= ITEM_IDS[160] &&  itemId <= ITEM_IDS[169]) || (itemId >= ITEM_IDS[170] &&  itemId <= ITEM_IDS[179]))
-    		return 9;	// Schuttgart
+    	int GUARDIAN_TYPES_COUNT = 52; 
+    	for (int i = 0; i < 9; i++) //CastleID`s from 1 to 9 minus;
+    	{ 
+    		for (int i2 = 0; i2 < 50; i2 += 10) //Simplified if statement;
+    			if ((itemId >= ITEM_IDS[i2 + i*GUARDIAN_TYPES_COUNT] &&  itemId <= ITEM_IDS[i2 + 9 + i*GUARDIAN_TYPES_COUNT]))
+    				return i + 1;
+    		if (itemId >= ITEM_IDS[50] &&  itemId <= ITEM_IDS[51])
+    			return i + 1;
+    	}
     	return -1;
     }
 

+ 54 - 0
L2_GameServer/java/net/sf/l2j/gameserver/instancemanager/TownManager.java

@@ -114,6 +114,60 @@ public class TownManager
         return getTown(16); // Default to floran
     }
 
+    public final L2TownZone getSecondClosestTown(L2Object activeObject)
+    {
+        switch (MapRegionTable.getInstance().getMapRegion(activeObject.getPosition().getX(), activeObject.getPosition().getY()))
+		{
+			case 0:
+				return getTown(5); // TI
+			case 1:
+				return getTown(5); // Elven
+			case 2:
+				return getTown(5); // DE
+			case 3:
+				return getTown(4); // Orc
+			case 4:
+				return getTown(6); // Dwarven
+			case 5:
+				return getTown(5); // Gludio
+			case 6:
+				return getTown(5); // Gludin
+			case 7:
+				return getTown(7); // Dion
+			case 8:
+				return getTown(11); // Giran
+			case 9:
+				return getTown(11); // Oren
+			case 10:
+				return getTown(11); // Aden
+			case 11:
+				return getTown(11); // HV
+			case 12:
+				return getTown(16); // Giran Harbour
+			case 13:
+				return getTown(16); // Heine
+			case 14:
+				return getTown(13); // Rune
+			case 15:
+				return getTown(12); // Goddard
+			case 16:
+				return getTown(6); // Schuttgart
+			case 17:
+				return getTown(16); // Floran
+			case 18:
+				return getTown(19); //Primeval Isle
+            case 19:
+                return getTown(20); //Kamael Village
+            case 20:
+                return getTown(21); //South of Wastelands Camp
+            case 21:
+                return getTown(22); //Fantasy Island
+		}
+
+        return getTown(16); // Default to floran
+    }
+    
+    
     public final boolean townHasCastleInSiege(int townId)
     {
     	//int[] castleidarray = {0,0,0,0,0,0,0,1,2,3,4,0,5,0,0,6,0};

+ 5 - 2
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Character.java

@@ -316,8 +316,11 @@ public abstract class L2Character extends L2Object
 		if (template != null && this instanceof L2NpcInstance)
 		{
 			// Copy the Standard Calcultors of the L2NPCInstance in _calculators
-			_calculators = NPC_STD_CALCULATOR;
-
+			if (this instanceof L2DoorInstance)
+				_calculators = Formulas.getInstance().getStdDoorCalculators();
+			else
+				_calculators = NPC_STD_CALCULATOR;
+			
 			// Copy the skills of the L2NPCInstance from its template to the L2Character Instance
 			// The skills list can be affected by spell effects so it's necessary to make a copy
 			// to avoid that a spell affecting a L2NPCInstance, affects others L2NPCInstance of the same type too.

+ 3 - 4
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

@@ -7870,11 +7870,10 @@ public final class L2PcInstance extends L2PlayableInstance
 		// Check if it's ok to summon
         // siege golem (13), Wild Hog Cannon (299), Swoop Cannon (448)
         if ((skill.getId() == 13 || skill.getId() == 299 || skill.getId() == 448)
-        		&& !SiegeManager.getInstance().checkIfOkToSummon(this, false) 
-                && !FortSiegeManager.getInstance().checkIfOkToSummon(this, false))
+        		&& ((!SiegeManager.getInstance().checkIfOkToSummon(this, false) 
+                && !FortSiegeManager.getInstance().checkIfOkToSummon(this, false))||(SevenSigns.getInstance().CheckSummonConditions(this))))
 			return;
-
-
+        
         //************************************* Check Casting in Progress *******************************************
 
         // If a skill is currently being used, queue this one if this is not the same

+ 6 - 0
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2WyvernManagerInstance.java

@@ -14,6 +14,7 @@
  */
 package net.sf.l2j.gameserver.model.actor.instance;
 
+import net.sf.l2j.gameserver.SevenSigns;
 import net.sf.l2j.gameserver.ai.CtrlIntention;
 import net.sf.l2j.gameserver.datatables.SkillTable;
 import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
@@ -40,6 +41,11 @@ public class L2WyvernManagerInstance extends L2CastleChamberlainInstance
         		player.sendMessage("Only clan leaders are allowed.");
         		return;
         	}
+        	if ((SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DUSK) && SevenSigns.getInstance().isSealValidationPeriod())
+        	{
+        		player.sendMessage("You cannot ride wyvern while Seal of Strife controlled by Dusk.");
+        		return;     		
+        	}
         	if(player.getPet() == null)
         	{
         		if(player.isMounted())

+ 15 - 0
L2_GameServer/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java

@@ -32,6 +32,7 @@ import net.sf.l2j.gameserver.cache.HtmCache;
 import net.sf.l2j.gameserver.communitybbs.Manager.RegionBBSManager;
 import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
 import net.sf.l2j.gameserver.datatables.MapRegionTable;
+import net.sf.l2j.gameserver.datatables.SkillTable;
 import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
 import net.sf.l2j.gameserver.instancemanager.CoupleManager;
 import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
@@ -159,6 +160,20 @@ public class EnterWorld extends L2GameClientPacket
                 Hero.getInstance().getHeroes().containsKey(activeChar.getObjectId()))
             activeChar.setHero(true);
 
+        //Updating Seal of Strife Buff/Debuff 
+        if (SevenSigns.getInstance().isSealValidationPeriod()){
+        	if (SevenSigns.getInstance().getPlayerCabal(activeChar) != SevenSigns.CABAL_NULL)
+        		if (SevenSigns.getInstance().getPlayerCabal(activeChar) == SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE))
+        			activeChar.addSkill(SkillTable.getInstance().getInfo(5074,1));
+        		else
+        			activeChar.addSkill(SkillTable.getInstance().getInfo(5075,1));
+        }
+        else
+        {
+        	activeChar.removeSkill(SkillTable.getInstance().getInfo(5074,1));
+        	activeChar.removeSkill(SkillTable.getInstance().getInfo(5075,1));        	
+        }
+        
         setPledgeClass(activeChar);
 
         activeChar.sendPacket(new UserInfo(activeChar));

+ 69 - 0
L2_GameServer/java/net/sf/l2j/gameserver/skills/Formulas.java

@@ -285,6 +285,54 @@ public final class Formulas
 		}
 	}
 
+	static class FuncGatesPDefMod extends Func
+	{
+		static final FuncGatesPDefMod _fmm_instance = new FuncGatesPDefMod();
+
+		static Func getInstance()
+		{
+			return _fmm_instance;
+		}
+
+		private FuncGatesPDefMod()
+		{
+			super(Stats.POWER_DEFENCE, 0x20, null);
+		}
+
+		@Override
+		public void calc(Env env)
+		{
+			if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DAWN)
+				env.value *= Config.ALT_SIEGE_DAWN_GATES_PDEF_MULT; 
+			else if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DUSK)
+				env.value *= Config.ALT_SIEGE_DUSK_GATES_PDEF_MULT;
+		}
+	}
+	
+	static class FuncGatesMDefMod extends Func
+	{
+		static final FuncGatesMDefMod _fmm_instance = new FuncGatesMDefMod();
+
+		static Func getInstance()
+		{
+			return _fmm_instance;
+		}
+
+		private FuncGatesMDefMod()
+		{
+			super(Stats.MAGIC_DEFENCE, 0x20, null);
+		}
+
+		@Override
+		public void calc(Env env)
+		{
+			if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DAWN)
+				env.value *= Config.ALT_SIEGE_DAWN_GATES_MDEF_MULT;
+			else if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DUSK)
+				env.value *= Config.ALT_SIEGE_DUSK_GATES_MDEF_MULT;
+		}
+	}
+
 	static class FuncBowAtkRange extends Func
 	{
 		private static final FuncBowAtkRange _fbar_instance = new FuncBowAtkRange();
@@ -837,6 +885,27 @@ public final class Formulas
 		return std;
 	}
 
+	public Calculator[] getStdDoorCalculators()
+	{
+		Calculator[] std = new Calculator[Stats.NUM_STATS];
+
+		// Add the FuncAtkAccuracy to the Standard Calculator of ACCURACY_COMBAT
+		std[Stats.ACCURACY_COMBAT.ordinal()] = new Calculator();
+		std[Stats.ACCURACY_COMBAT.ordinal()].addFunc(FuncAtkAccuracy.getInstance());
+
+		// Add the FuncAtkEvasion to the Standard Calculator of EVASION_RATE
+		std[Stats.EVASION_RATE.ordinal()] = new Calculator();
+		std[Stats.EVASION_RATE.ordinal()].addFunc(FuncAtkEvasion.getInstance());
+		
+		//SevenSigns PDEF Modifier
+		std[Stats.POWER_DEFENCE.ordinal()].addFunc(FuncGatesPDefMod.getInstance());
+		
+		//SevenSigns MDEF Modifier
+		std[Stats.MAGIC_DEFENCE.ordinal()].addFunc(FuncGatesMDefMod.getInstance());		
+		
+		return std;
+	}	
+
 	/**
 	 * Add basics Func objects to L2PcInstance and L2Summon.<BR><BR>
 	 *