Explorar o código

continue [2634], anyone can resurrect a siege participant
inside the siege zone, but non-participants cannot be
resurrected. charm of courage should be a self-resurrect.

Sami %!s(int64=16) %!d(string=hai) anos
pai
achega
d3a6cdc026

+ 18 - 6
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Character.java

@@ -1969,14 +1969,26 @@ public abstract class L2Character extends L2Object
 		getNotifyQuestOfDeath().clear();
 
 		getAttackByList().clear();
-		//If character is PhoenixBlessed a resurrection popup will show up
-        if (this instanceof L2PlayableInstance && ((L2PlayableInstance)this).isPhoenixBlessed())
+		// If character is PhoenixBlessed 
+		// or has charm of courage inside siege battlefield (exact operation to be confirmed)
+		// a resurrection popup will show up
+        if (this instanceof L2Summon)
         {
-           if (this instanceof L2Summon) {
-              ((L2Summon)this).getOwner().reviveRequest(((L2Summon)this).getOwner(), null, true);
-           }
-           else ((L2PcInstance)this).reviveRequest(((L2PcInstance)this),null,false);
+        	if (((L2Summon)this).isPhoenixBlessed() && ((L2Summon)this).getOwner() != null)
+        		((L2Summon)this).getOwner().reviveRequest(((L2Summon)this).getOwner(), null, true);
         }
+		if (this instanceof L2PcInstance)
+        {
+			if(((L2PlayableInstance)this).isPhoenixBlessed())
+				((L2PcInstance)this).reviveRequest(((L2PcInstance)this),null,false);
+			else if (((L2PcInstance)this).getCharmOfCourage() 
+					&& this.isInsideZone(ZONE_SIEGE)
+					&& ((L2PcInstance)this).getSiegeState() != 0) // could check it more accurately too
+			{
+				((L2PcInstance)this).reviveRequest(((L2PcInstance)this),null,false);
+			}
+        }
+        
 		return true;
 	}
 

+ 3 - 9
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Skill.java

@@ -2441,17 +2441,11 @@ public abstract class L2Skill
 								{
 									if (!((L2PcInstance) newTarget).isDead())
 										continue;
+									// Siege battlefield resurrect has been made possible for participants
 									if (getSkillType() == L2SkillType.RESURRECT)
 									{
-										// check for charm of courage and caster being a siege participant, otherwise do not allow resurrection
-										// on siege battlefield
-										if (((L2PcInstance) newTarget).isInsideZone(L2Character.ZONE_SIEGE))
-										{
-											// could/should be a more accurate check for siege clans	
-											if (!((L2PcInstance) newTarget).getCharmOfCourage() || player.getSiegeState() == 0)
-													continue;	
-										}		
-										
+										if (((L2PcInstance) newTarget).isInsideZone(L2Character.ZONE_SIEGE) && ((L2PcInstance) newTarget).getSiegeState() == 0)
+													continue;
 									}
 								}
 								

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

@@ -543,6 +543,9 @@ public final class L2PcInstance extends L2PlayableInstance
 
 	//Death Penalty Buff Level
 	private int _deathPenaltyBuffLevel = 0;
+	
+	// self resurrect during siege
+	private boolean _charmOfCourage = false;
 
 	// Absorbed Souls
     private int _souls = 0;
@@ -9979,7 +9982,7 @@ public final class L2PcInstance extends L2PlayableInstance
 	{
 		if (_reviveRequested != 1 || (!isDead() && !_revivePet) || (_revivePet && getPet() != null && !getPet().isDead()))
 			return;
-		//If character refuses a PhoenixBless autoress, cancell all buffs he had
+		//If character refuses a PhoenixBless autoress, cancel all buffs he had
 		if (answer == 0 && isPhoenixBlessed())
 		{
 		    stopPhoenixBlessing(null);
@@ -11086,8 +11089,6 @@ public final class L2PcInstance extends L2PlayableInstance
         _combatFlagEquippedId = value;
     }
 
-	private boolean _charmOfCourage = false;
-
 	public boolean getCharmOfCourage()
 	{
 		return _charmOfCourage;