浏览代码

Gnacik: additional target for summoners skills.

JIV 15 年之前
父节点
当前提交
90b40f38f7

+ 37 - 1
L2_GameServer/java/com/l2jserver/gameserver/model/L2Skill.java

@@ -115,7 +115,8 @@ public abstract class L2Skill implements IChanceSkillTrigger
         TARGET_ENEMY_SUMMON,
         TARGET_OWNER_PET,
         TARGET_GROUND,
-        TARGET_PARTY_NOTME
+        TARGET_PARTY_NOTME,
+        TARGET_AREA_SUMMON
     }
     
     //conditional values
@@ -1398,6 +1399,41 @@ public abstract class L2Skill implements IChanceSkillTrigger
 				}
                 return targetList.toArray(new L2Character[targetList.size()]);
             }
+            case TARGET_AREA_SUMMON:
+            {
+            	target = activeChar.getPet();
+            	if (target == null || !(target instanceof L2SummonInstance) || target.isDead())
+            		return _emptyTargetList;            		
+
+            	if(onlyFirst)
+            		return new L2Character[]{target};
+
+            	final boolean srcInArena = (activeChar.isInsideZone(L2Character.ZONE_PVP) && !activeChar.isInsideZone(L2Character.ZONE_SIEGE));
+            	final Collection<L2Character> objs = target.getKnownList().getKnownCharacters();
+            	final int radius = getSkillRadius();
+
+            	for (L2Character obj : objs)
+            	{
+            		if (obj == null || obj == target || obj == activeChar)
+            			continue;
+
+            		if (!Util.checkIfInRange(radius, target, obj, true))
+            			continue;
+
+            		if (!(obj instanceof L2Attackable || obj instanceof L2Playable))
+            			continue;
+
+            		if (!checkForAreaOffensiveSkills(activeChar, obj, this, srcInArena))
+            			continue;
+
+            		targetList.add(obj);
+            	}
+
+            	if (targetList.isEmpty())
+            		return _emptyTargetList;
+
+            	return targetList.toArray(new L2Character[targetList.size()]);
+            }
             case TARGET_AREA:
             case TARGET_FRONT_AREA:
             case TARGET_BEHIND_AREA:

+ 13 - 2
L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -1510,6 +1510,9 @@ public abstract class L2Character extends L2Object
         // AURA skills should always be using caster as target
         switch (skill.getTargetType())
         {
+        	case TARGET_AREA_SUMMON:	// We need it to correct facing
+        		target = getPet();
+        		break;
         	case TARGET_AURA:
         	case TARGET_FRONT_AURA:
         	case TARGET_BEHIND_AURA:
@@ -2879,6 +2882,8 @@ public abstract class L2Character extends L2Object
 		abortCast();
 		stopMove(null);
 		getAI().notifyEvent(CtrlEvent.EVT_STUNNED);
+		if (!(this instanceof L2Summon))
+			getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
 		updateAbnormalEffect();
 	}
 
@@ -6175,8 +6180,14 @@ public abstract class L2Character extends L2Object
 				&& getTarget() instanceof L2Character
 				&& getTarget() != this
 				&& getTarget() == target)
-			getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
-
+		{
+			if(getAI() == null
+				|| getAI().getNextIntention() == null
+				|| getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)
+			{
+				getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
+			}
+		}
         if (skill.isOffensive() && !skill.isNeutral() && !(skill.getSkillType() == L2SkillType.UNLOCK) && !(skill.getSkillType() == L2SkillType.DELUXE_KEY_UNLOCK))
             getAI().clientStartAutoAttack();
 

+ 2 - 0
L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -8799,6 +8799,7 @@ public final class L2PcInstance extends L2Playable
         	case TARGET_PARTY_CLAN:
         	case TARGET_GROUND:
         	case TARGET_SELF:
+        	case TARGET_AREA_SUMMON:
         		target = this;
         		break;
         	case TARGET_PET:
@@ -8975,6 +8976,7 @@ public final class L2PcInstance extends L2Playable
 					case TARGET_PARTY:
 					case TARGET_SELF:
 					case TARGET_GROUND:
+					case TARGET_AREA_SUMMON:
 						break;
 					default: // Send a Server->Client packet ActionFailed to the L2PcInstance
 						sendPacket(ActionFailed.STATIC_PACKET);