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

BETA: Social Action back to (int, int) constructor.
- Also added broadcastSocialAction method in L2Character for quick usage

Rumen Nikiforov 13 éve
szülő
commit
0f4b395044

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/CursedWeapon.java

@@ -464,7 +464,7 @@ public class CursedWeapon
 		// Refresh player stats
 		_player.broadcastUserInfo();
 		
-		SocialAction atk = new SocialAction(_player, 17);
+		SocialAction atk = new SocialAction(_player.getObjectId(), 17);
 		
 		_player.broadcastPacket(atk);
 		

+ 6 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -89,6 +89,7 @@ import com.l2jserver.gameserver.network.serverpackets.MoveToLocation;
 import com.l2jserver.gameserver.network.serverpackets.Revive;
 import com.l2jserver.gameserver.network.serverpackets.ServerObjectInfo;
 import com.l2jserver.gameserver.network.serverpackets.SetupGauge;
+import com.l2jserver.gameserver.network.serverpackets.SocialAction;
 import com.l2jserver.gameserver.network.serverpackets.StatusUpdate;
 import com.l2jserver.gameserver.network.serverpackets.StopMove;
 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
@@ -7527,4 +7528,9 @@ public abstract class L2Character extends L2Object
 	{
 		return _effects.isAffected(flag);
 	}
+	
+	public void broadcastSocialAction(int id)
+	{
+		broadcastPacket(new SocialAction(getObjectId(), id));
+	}
 }

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Npc.java

@@ -459,7 +459,7 @@ public class L2Npc extends L2Character
 		if (now - _lastSocialBroadcast > _minimalSocialInterval)
 		{
 			_lastSocialBroadcast = now;
-			broadcastPacket(new SocialAction(this, animationId));
+			broadcastPacket(new SocialAction(getObjectId(), animationId));
 		}
 	}
 	

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Trap.java

@@ -298,7 +298,7 @@ public class L2Trap extends L2Character
 						_timeRemaining -= TICK;
 						if (_timeRemaining < _lifeTime - 15000)
 						{
-							SocialAction sa = new SocialAction(L2Trap.this, 2);
+							SocialAction sa = new SocialAction(getObjectId(), 2);
 							broadcastPacket(sa);
 						}
 						if (_timeRemaining < 0)

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2GuardInstance.java

@@ -217,7 +217,7 @@ public class L2GuardInstance extends L2Attackable
 				{
 					// Send a Server->Client packet SocialAction to the all L2PcInstance on the _knownPlayer of the L2NpcInstance
 					// to display a social action of the L2GuardInstance on their client
-					SocialAction sa = new SocialAction(this, Rnd.nextInt(8));
+					SocialAction sa = new SocialAction(getObjectId(), Rnd.nextInt(8));
 					broadcastPacket(sa);
 					
 					// Open a chat window on client with the text of the L2GuardInstance

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -10965,7 +10965,7 @@ public final class L2PcInstance extends L2Playable
 			_shortCuts.restore();
 			sendPacket(new ShortCutInit(this));
 			
-			broadcastPacket(new SocialAction(this, SocialAction.LEVEL_UP));
+			broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
 			sendPacket(new SkillCoolTime(this));
 			sendPacket(new ExStorageMaxCount(this));
 			

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2SepulcherNpcInstance.java

@@ -181,7 +181,7 @@ public class L2SepulcherNpcInstance extends L2Npc
 					// L2PcInstance on the _knownPlayer of the L2NpcInstance
 					// to display a social action of the L2NpcInstance on their
 					// client
-					SocialAction sa = new SocialAction(this, Rnd.get(8));
+					SocialAction sa = new SocialAction(getObjectId(), Rnd.get(8));
 					broadcastPacket(sa);
 					
 					doAction(player);

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2TamedBeastInstance.java

@@ -410,7 +410,7 @@ public final class L2TamedBeastInstance extends L2FeedableBeastInstance
 				if (item != null && item.getCount() >= 1)
 				{
 					owner.destroyItem("BeastMob", item, 1, _tamedBeast, true);
-					_tamedBeast.broadcastPacket(new SocialAction(_tamedBeast, 3));
+					_tamedBeast.broadcastPacket(new SocialAction(_tamedBeast.getObjectId(), 3));
 				}
 				else
 					_tamedBeast.deleteMe();

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/stat/PcStat.java

@@ -226,7 +226,7 @@ public class PcStat extends PlayableStat
 			}
 			
 			getActiveChar().setCurrentCp(getMaxCp());
-			getActiveChar().broadcastPacket(new SocialAction(getActiveChar(), SocialAction.LEVEL_UP));
+			getActiveChar().broadcastPacket(new SocialAction(getActiveChar().getObjectId(), SocialAction.LEVEL_UP));
 			getActiveChar().sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_INCREASED_YOUR_LEVEL));
 			
 			L2ClassMasterInstance.showQuestionMark(getActiveChar());

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/stat/PetStat.java

@@ -72,7 +72,7 @@ public class PetStat extends SummonStat
 		su.addAttribute(StatusUpdate.MAX_MP, getMaxMp());
 		getActiveChar().broadcastPacket(su);
 		if (levelIncreased)
-			getActiveChar().broadcastPacket(new SocialAction(getActiveChar(), SocialAction.LEVEL_UP));
+			getActiveChar().broadcastPacket(new SocialAction(getActiveChar().getObjectId(), SocialAction.LEVEL_UP));
 		// Send a Server->Client packet PetInfo to the L2PcInstance
 		getActiveChar().updateAndBroadcastStatus(1);
 		

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Duel.java

@@ -658,10 +658,10 @@ public class Duel
 		if (_partyDuel && looser.getParty() != null)
 		{
 			for (L2PcInstance temp : looser.getParty().getPartyMembers())
-				temp.broadcastPacket(new SocialAction(temp, 7));
+				temp.broadcastPacket(new SocialAction(temp.getObjectId(), 7));
 		}
 		else
-			looser.broadcastPacket(new SocialAction(looser, 7));
+			looser.broadcastPacket(new SocialAction(looser.getObjectId(), 7));
 	}
 	
 	/**

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/AnswerCoupleAction.java

@@ -71,8 +71,8 @@ public class AnswerCoupleAction extends L2GameClientPacket
 			heading = Util.calculateHeadingFrom(target, activeChar);
 			target.setHeading(heading);
 			target.broadcastPacket(new ExRotation(target.getObjectId(), heading));
-			activeChar.broadcastPacket(new SocialAction(activeChar, _actionId));
-			target.broadcastPacket(new SocialAction(target, _actionId));
+			activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), _actionId));
+			target.broadcastPacket(new SocialAction(_charObjId, _actionId));
 		}
 		else if (_answer == -1) // refused
 		{

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestActionUse.java

@@ -893,7 +893,7 @@ public final class RequestActionUse extends L2GameClientPacket
 		
 		if (activeChar.canMakeSocialAction())
 		{
-			activeChar.broadcastPacket(new SocialAction(activeChar, id));
+			activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), id));
 		}
 	}
 	

+ 2 - 10
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/SocialAction.java

@@ -14,7 +14,6 @@
  */
 package com.l2jserver.gameserver.network.serverpackets;
 
-import com.l2jserver.gameserver.model.actor.L2Character;
 
 /**
  * This class ...
@@ -30,16 +29,9 @@ public class SocialAction extends L2GameServerPacket
 	private final int _actionId;
 	
 	/**
-	 * 0x3d SocialAction         dd
-	 * @param cha
+	 * @param objectId
 	 * @param actionId
-	 */
-	public SocialAction(L2Character cha, int actionId)
-	{
-		_charObjId = cha.getObjectId();
-		_actionId = actionId;
-	}
-	
+	 */	
 	public SocialAction(int objectId, int actionId)
 	{
 		_charObjId = objectId;