Forráskód Böngészése

npc grow effect support by Kerberos

Sami 17 éve
szülő
commit
e24c6e2404

+ 25 - 4
L2_GameServer_It/java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java

@@ -130,7 +130,8 @@ public class L2NpcInstance extends L2Character
     protected RandomAnimationTask _rAniTask = null;
     private int _currentLHandId;  // normally this shouldn't change from the template, but there exist exceptions
     private int _currentRHandId;  // normally this shouldn't change from the template, but there exist exceptions
-
+    private int _currentCollisionHeight; // used for npc grow effect skills
+    private int _currentCollisionRadius; // used for npc grow effect skills
     /** Task launching the function onRandomAnimation() */
     protected class RandomAnimationTask implements Runnable
     {
@@ -265,7 +266,10 @@ public class L2NpcInstance extends L2Character
         // initialize the "current" equipment
         _currentLHandId = getTemplate().lhand;
         _currentRHandId = getTemplate().rhand;
-
+        // initialize the "current" collisions
+        _currentCollisionHeight = getTemplate().collisionHeight;
+        _currentCollisionRadius = getTemplate().collisionRadius;
+        
         if (template == null)
         {
             _log.severe("No template for Npc. Please check your datapack is setup correctly.");
@@ -2136,7 +2140,8 @@ public class L2NpcInstance extends L2Character
         // we do need to reset the weapons back to the initial templated weapon.
         _currentLHandId = getTemplate().lhand;
         _currentRHandId = getTemplate().rhand;
-
+        _currentCollisionHeight = getTemplate().collisionHeight;
+        _currentCollisionRadius = getTemplate().collisionRadius;
     	DecayTaskManager.getInstance().addDecayTask(this);
     	return true;
     }
@@ -2260,5 +2265,21 @@ public class L2NpcInstance extends L2Character
     public void setRHandId(int newWeaponId)
     {
         _currentRHandId = newWeaponId;
-    }    
+    }
+    public void setCollisionHeight(int height)
+    {
+        _currentCollisionHeight = height;
+    }
+    public void setCollisionRadius(int radius)
+    {
+    	_currentCollisionRadius = radius;
+    }
+    public int getCollisionHeight()
+    {
+    	return _currentCollisionHeight;
+    }
+    public int getColisionRadius()
+    {
+    	return _currentCollisionRadius;
+    }
 }

+ 0 - 41
L2_GameServer_It/java/net/sf/l2j/gameserver/model/actor/instance/L2SymbolMakerInstance.java

@@ -38,47 +38,6 @@ public class L2SymbolMakerInstance extends L2FolkInstance
 {
 	//private static Logger _log = Logger.getLogger(L2SymbolMakerInstance.class.getName());
 
-	private double _collisionRadius;
-	private double _collisionHeight; // this is  positioning the model relative to the ground
-
-	/**
-	 * @return Returns the zOffset.
-	 */
-	public double getCollisionHeight()
-	{
-		return _collisionHeight;
-	}
-
-	/**
-	 * @param offset The zOffset to set.
-	 */
-	public void setCollisionHeight(double offset)
-	{
-		_collisionHeight = offset;
-	}
-
-
-
-	/**
-	 * @return Returns the collisionRadius.
-	 */
-	public double getCollisionRadius()
-	{
-		return _collisionRadius;
-	}
-
-	/**
-	 * @param collisionRadius The collisionRadius to set.
-	 */
-	public void setCollisionRadius(double collisionRadius)
-	{
-		_collisionRadius = collisionRadius;
-	}
-
-	/**
-	 * @return Returns the unknown1.
-	 */
-
 	@Override
 	public void onBypassFeedback(L2PcInstance player, String command)
 	{

+ 4 - 4
L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/NpcInfo.java

@@ -58,8 +58,8 @@ public class NpcInfo extends L2GameServerPacket
 		_rhand = cha.getRightHandItem(); 
 		_lhand = cha.getLeftHandItem(); 
 		_isSummoned = false;
-        _collisionHeight = _activeChar.getTemplate().collisionHeight;
-        _collisionRadius = _activeChar.getTemplate().collisionRadius;
+        _collisionHeight = cha.getCollisionHeight();
+        _collisionRadius = cha.getColisionRadius();
         if (cha.getTemplate().serverSideName)
         	_name = cha.getTemplate().name;
 
@@ -172,8 +172,8 @@ public class NpcInfo extends L2GameServerPacket
 		writeC(0000);  // C2
 
 		writeC(0x00);  // C3  team circle 1-blue, 2-red
-		writeF(_collisionRadius);  // C4 collisionRadius a second time
-		writeF(_collisionHeight);  // C4 collisionHeight     "
+		writeF(_collisionRadius);
+		writeF(_collisionHeight);
 		writeD(0x00);  // C4
 		writeD(0x00);  // C6
 	}