Procházet zdrojové kódy

Pet/Summon Spawn Protection, thanks GodKratos

DrHouse před 16 roky
rodič
revize
ef914a03f1

+ 9 - 0
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Summon.java

@@ -589,6 +589,15 @@ public abstract class L2Summon extends L2PlayableInstance
 		return null;
 	}
 
+	/**
+	 * Return True if the L2Summon is invulnerable or if the summoner is in spawn protection.<BR><BR>
+	 */
+	@Override
+	public boolean isInvul()
+	{
+		return _isInvul  || _isTeleporting ||  getOwner().isSpawnProtected();
+	}
+
 	/**
 	 * Return the L2Party object of its L2PcInstance owner or null.<BR><BR>
 	 */

+ 1 - 0
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

@@ -569,6 +569,7 @@ public final class L2PcInstance extends L2PlayableInstance
 
 	// Used for protection after teleport
 	private long _protectEndTime = 0;
+	public boolean isSpawnProtected() { return (_protectEndTime > 0); }
 
 	// protects a char from agro mobs when getting up from fake death
 	private long _recentFakeDeathEndTime = 0;

+ 1 - 0
L2_GameServer/java/net/sf/l2j/gameserver/network/clientpackets/L2GameClientPacket.java

@@ -76,6 +76,7 @@ public abstract class L2GameClientPacket extends ReceivablePacket<L2GameClient>
 			runImpl();
             if (this instanceof MoveBackwardToLocation 
             	|| this instanceof AttackRequest 
+            	|| this instanceof RequestActionUse
             	|| this instanceof RequestMagicSkillUse)
             	// could include pickup and talk too, but less is better
             {