Remove buff info from target.

Contributed by proGenitor.
This commit is contained in:
MobiusDev
2018-01-24 07:08:17 +00:00
parent ad7fef7d49
commit 67567ef8f6
2 changed files with 20 additions and 30 deletions

View File

@@ -18,15 +18,17 @@ package com.l2jmobius.gameserver.network.serverpackets;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.l2jmobius.commons.network.PacketWriter;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.skills.BuffInfo;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.OutgoingPackets;
/**
* @author proGenitor <br>
* Experimental packet compatible for L2Classic 2.0.
*/
public class ExAbnormalStatusUpdateFromTarget implements IClientOutgoingPacket
{
private final L2Character _character;
@@ -43,19 +45,12 @@ public class ExAbnormalStatusUpdateFromTarget implements IClientOutgoingPacket
public Effect(BuffInfo info)
{
final Skill skill = info.getSkill();
final L2Character caster = info.getEffector();
int casterId = 0;
if (caster != null)
{
casterId = caster.getObjectId();
}
_skillId = skill.getDisplayId();
_level = skill.getDisplayLevel();
_subLevel = skill.getSubLevel();
_abnormalType = skill.getAbnormalType().getClientId();
_duration = skill.isAura() ? -1 : info.getTime();
_caster = casterId;
}
}
@@ -66,9 +61,6 @@ public class ExAbnormalStatusUpdateFromTarget implements IClientOutgoingPacket
_character = character;
_effects = character.getEffectList().getEffects()
.stream()
.filter(Objects::nonNull)
.filter(BuffInfo::isInUse)
.filter(b -> !b.getSkill().isToggle())
.map(Effect::new)
.collect(Collectors.toList());
//@formatter:on

View File

@@ -19,9 +19,7 @@ package com.l2jmobius.gameserver.network.serverpackets;
import com.l2jmobius.Config;
import com.l2jmobius.commons.network.PacketWriter;
import com.l2jmobius.gameserver.data.xml.impl.ExperienceData;
import com.l2jmobius.gameserver.enums.AttributeType;
import com.l2jmobius.gameserver.enums.UserInfoType;
import com.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -30,7 +28,8 @@ import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.network.OutgoingPackets;
/**
* @author Sdw, UnAfraid
* @author Sdw, UnAfraid, proGenitor <br>
* Experimental packet compatible for L2Classic 2.0.
*/
public class UserInfo extends AbstractMaskPacket<UserInfoType>
{
@@ -161,8 +160,8 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
packet.writeH(_activeChar.getINT());
packet.writeH(_activeChar.getWIT());
packet.writeH(_activeChar.getMEN());
packet.writeH(_activeChar.getLUC());
packet.writeH(_activeChar.getCHA());
packet.writeH(0x00);
packet.writeH(0x00);
}
if (containsMask(UserInfoType.MAX_HPCPMP))
@@ -206,7 +205,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
packet.writeC(_activeChar.getMountType().ordinal());
packet.writeC(_activeChar.getPrivateStoreType().getId());
packet.writeC(_activeChar.hasDwarvenCraft() || (_activeChar.getSkillLevel(248) > 0) ? 1 : 0);
packet.writeC(_activeChar.getAbilityPointsUsed());
packet.writeC(0x00);
}
if (containsMask(UserInfoType.STATS))
@@ -231,12 +230,12 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
if (containsMask(UserInfoType.ELEMENTALS))
{
packet.writeH(14);
packet.writeH(_activeChar.getDefenseElementValue(AttributeType.FIRE));
packet.writeH(_activeChar.getDefenseElementValue(AttributeType.WATER));
packet.writeH(_activeChar.getDefenseElementValue(AttributeType.WIND));
packet.writeH(_activeChar.getDefenseElementValue(AttributeType.EARTH));
packet.writeH(_activeChar.getDefenseElementValue(AttributeType.HOLY));
packet.writeH(_activeChar.getDefenseElementValue(AttributeType.DARK));
packet.writeH(0x00);
packet.writeH(0x00);
packet.writeH(0x00);
packet.writeH(0x00);
packet.writeH(0x00);
packet.writeH(0x00);
}
if (containsMask(UserInfoType.POSITION))
@@ -278,9 +277,8 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
if (containsMask(UserInfoType.ATK_ELEMENTAL))
{
packet.writeH(5);
final AttributeType attackAttribute = _activeChar.getAttackElement();
packet.writeC(attackAttribute.getClientId());
packet.writeH(_activeChar.getAttackElementValue(attackAttribute));
packet.writeC(0x00);
packet.writeH(0x00);
}
if (containsMask(UserInfoType.CLAN))
@@ -303,7 +301,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
packet.writeH(22);
packet.writeC(_activeChar.getPvpFlag());
packet.writeD(_activeChar.getReputation()); // Reputation
packet.writeC(_activeChar.isNoble() ? 0x01 : 0x00);
packet.writeC(0x00);
packet.writeC(_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) ? 1 : 0);
packet.writeC(_activeChar.getPledgeClass());
packet.writeD(_activeChar.getPkKills());
@@ -315,7 +313,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
if (containsMask(UserInfoType.VITA_FAME))
{
packet.writeH(15);
packet.writeD(_activeChar.getVitalityPoints());
packet.writeD(0x00);
packet.writeC(0x00); // Vita Bonus
packet.writeD(_activeChar.getFame());
packet.writeD(_activeChar.getRaidbossPoints());
@@ -353,7 +351,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
packet.writeH(0x00);
packet.writeH(0x00);
packet.writeH(_activeChar.getInventoryLimit());
packet.writeC(_activeChar.isCursedWeaponEquipped() ? CursedWeaponsManager.getInstance().getLevel(_activeChar.getCursedWeaponEquippedId()) : 0);
packet.writeC(0);
}
if (containsMask(UserInfoType.UNK_3))