Partial sync L2jUnity free release Feb 23th 2015.

This commit is contained in:
MobiusDev
2016-10-30 10:55:57 +00:00
parent 9cb5043632
commit 6f92e7d596
14 changed files with 151 additions and 141 deletions

View File

@@ -29,7 +29,7 @@ import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.data.xml.impl.TransformData;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import com.l2jmobius.gameserver.model.L2Party.messageType;
import com.l2jmobius.gameserver.model.L2Party.MessageType;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -426,7 +426,7 @@ public class CursedWeapon implements INamable
_player.setPkKills(0);
if (_player.isInParty())
{
_player.getParty().removePartyMember(_player, messageType.Expelled);
_player.getParty().removePartyMember(_player, MessageType.EXPELLED);
}
// Disable All Skills

View File

@@ -106,12 +106,12 @@ public class L2Party extends AbstractPlayerGroup
/**
* The message type send to the party members.
*/
public enum messageType
public enum MessageType
{
Expelled,
Left,
None,
Disconnected
EXPELLED,
LEFT,
NONE,
DISCONNECTED
}
/**
@@ -476,9 +476,9 @@ public class L2Party extends AbstractPlayerGroup
/**
* Removes a party member using its name.
* @param name player the player to be removed from the party.
* @param type the message type {@link messageType}.
* @param type the message type {@link MessageType}.
*/
public void removePartyMember(String name, messageType type)
public void removePartyMember(String name, MessageType type)
{
removePartyMember(getPlayerByName(name), type);
}
@@ -486,9 +486,9 @@ public class L2Party extends AbstractPlayerGroup
/**
* Removes a party member instance.
* @param player the player to be removed from the party.
* @param type the message type {@link messageType}.
* @param type the message type {@link MessageType}.
*/
public void removePartyMember(L2PcInstance player, messageType type)
public void removePartyMember(L2PcInstance player, MessageType type)
{
if (!getMembers().contains(player))
{
@@ -496,7 +496,7 @@ public class L2Party extends AbstractPlayerGroup
}
final boolean isLeader = isLeader(player);
if (!_disbanding && ((getMembers().size() == 2) || (isLeader && !Config.ALT_LEAVE_PARTY_LEADER && (type != messageType.Disconnected))))
if (!_disbanding && ((getMembers().size() == 2) || (isLeader && !Config.ALT_LEAVE_PARTY_LEADER && (type != MessageType.DISCONNECTED))))
{
{
disbandParty();
@@ -525,14 +525,14 @@ public class L2Party extends AbstractPlayerGroup
}
SystemMessage msg;
if (type == messageType.Expelled)
if (type == MessageType.EXPELLED)
{
player.sendPacket(SystemMessageId.YOU_HAVE_BEEN_EXPELLED_FROM_THE_PARTY);
msg = SystemMessage.getSystemMessage(SystemMessageId.C1_WAS_EXPELLED_FROM_THE_PARTY);
msg.addString(player.getName());
broadcastPacket(msg);
}
else if ((type == messageType.Left) || (type == messageType.Disconnected))
else if ((type == MessageType.LEFT) || (type == MessageType.DISCONNECTED))
{
player.sendPacket(SystemMessageId.YOU_HAVE_WITHDRAWN_FROM_THE_PARTY);
msg = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_LEFT_THE_PARTY);
@@ -556,7 +556,7 @@ public class L2Party extends AbstractPlayerGroup
{
player.sendPacket(new ExCloseMPCC());
}
if (isLeader && (getMembers().size() > 1) && (Config.ALT_LEAVE_PARTY_LEADER || (type == messageType.Disconnected)))
if (isLeader && (getMembers().size() > 1) && (Config.ALT_LEAVE_PARTY_LEADER || (type == MessageType.DISCONNECTED)))
{
msg = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_BECOME_THE_PARTY_LEADER);
msg.addString(getLeader().getName());
@@ -613,7 +613,7 @@ public class L2Party extends AbstractPlayerGroup
{
if (member != null)
{
removePartyMember(member, messageType.None);
removePartyMember(member, MessageType.NONE);
}
}
}

View File

@@ -126,7 +126,7 @@ import com.l2jmobius.gameserver.model.L2EnchantSkillLearn;
import com.l2jmobius.gameserver.model.L2ManufactureItem;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2Party.messageType;
import com.l2jmobius.gameserver.model.L2Party.MessageType;
import com.l2jmobius.gameserver.model.L2PetLevelData;
import com.l2jmobius.gameserver.model.L2PremiumItem;
import com.l2jmobius.gameserver.model.L2Radar;
@@ -6649,7 +6649,7 @@ public final class L2PcInstance extends L2Playable
{
if (isInParty())
{
_party.removePartyMember(this, messageType.Disconnected);
_party.removePartyMember(this, MessageType.DISCONNECTED);
_party = null;
}
}
@@ -9724,7 +9724,7 @@ public final class L2PcInstance extends L2Playable
if (getParty() != null)
{
getParty().removePartyMember(this, messageType.Expelled);
getParty().removePartyMember(this, MessageType.EXPELLED);
}
_olympiadGameId = id;
@@ -13294,7 +13294,7 @@ public final class L2PcInstance extends L2Playable
final int relation1 = getRelation(activeChar);
final int relation2 = activeChar.getRelation(this);
Integer oldrelation = getKnownList().getKnownRelations().get(activeChar.getObjectId());
if ((oldrelation != null) && (oldrelation != relation1))
if ((oldrelation != null) && (oldrelation != relation1) && isVisibleFor(activeChar))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation1, isAutoAttackable(activeChar));
@@ -13313,7 +13313,7 @@ public final class L2PcInstance extends L2Playable
activeChar.sendPacket(rc);
}
oldrelation = activeChar.getKnownList().getKnownRelations().get(getObjectId());
if ((oldrelation != null) && (oldrelation != relation2))
if ((oldrelation != null) && (oldrelation != relation2) && activeChar.isVisibleFor(this))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(activeChar, relation2, activeChar.isAutoAttackable(this));

View File

@@ -18,6 +18,7 @@ package com.l2jmobius.gameserver.model.actor.request;
import java.util.Objects;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
/**
@@ -26,12 +27,15 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
public class PartyRequest extends AbstractRequest
{
private final L2PcInstance _targetPlayer;
private final L2Party _party;
public PartyRequest(L2PcInstance activeChar, L2PcInstance targetPlayer)
public PartyRequest(L2PcInstance activeChar, L2PcInstance targetPlayer, L2Party party)
{
super(activeChar);
Objects.requireNonNull(targetPlayer);
Objects.requireNonNull(party);
_targetPlayer = targetPlayer;
_party = party;
}
public L2PcInstance getTargetPlayer()
@@ -39,6 +43,11 @@ public class PartyRequest extends AbstractRequest
return _targetPlayer;
}
public L2Party getParty()
{
return _party;
}
@Override
public boolean isUsing(int objectId)
{

View File

@@ -691,7 +691,12 @@ public class CharStat
*/
public final int getMpInitialConsume(Skill skill)
{
return skill == null ? 1 : (int) calcStat(Stats.MP_CONSUME, skill.getMpInitialConsume(), null, skill);
if (skill == null)
{
return 1;
}
return (int) calcStat(Stats.MP_CONSUME, skill.getMpInitialConsume(), null, skill);
}
public byte getAttackElement()

View File

@@ -26,7 +26,7 @@ import com.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.FortManager;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2Party.messageType;
import com.l2jmobius.gameserver.model.L2Party.MessageType;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Summon;
@@ -257,7 +257,7 @@ public abstract class AbstractOlympiadGame
final L2Party party = player.getParty();
if (party != null)
{
party.removePartyMember(player, messageType.Expelled);
party.removePartyMember(player, MessageType.EXPELLED);
}
}
// Remove Agathion