Sync with L2JServer Jan 9th 2015.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -9508,7 +9508,7 @@ public final class SystemMessageId
|
||||
@ClientString(id = 3306, message = "You are declaring Clan War against $s1. If you withdraw from the war, your clan will lose 5,000 Reputation points. Proceed?")
|
||||
public static SystemMessageId YOU_ARE_DECLARING_CLAN_WAR_AGAINST_S1_IF_YOU_WITHDRAW_FROM_THE_WAR_YOUR_CLAN_WILL_LOSE_5_000_REPUTATION_POINTS_PROCEED;
|
||||
|
||||
@ClientString(id = 3307, message = "$s1 will be deleted from Friend List.nDo you want to continue? ")
|
||||
@ClientString(id = 3307, message = "$s1 will be deleted from Friend List.nDo you want to continue?")
|
||||
public static SystemMessageId S1_WILL_BE_DELETED_FROM_FRIEND_LIST_NDO_YOU_WANT_TO_CONTINUE;
|
||||
|
||||
@ClientString(id = 3308, message = "No character is selected to add to the list. Please select a character.")
|
||||
@@ -14167,4 +14167,4 @@ public final class SystemMessageId
|
||||
return _builder.toString(params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ import com.l2jserver.gameserver.network.serverpackets.ExNewSkillToLearnByLevelUp
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExNoticePostArrived;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExNotifyPremiumItem;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExPledgeCount;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExPledgeWaitingListAlarm;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExShowUsm;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
@@ -80,6 +81,7 @@ import com.l2jserver.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExVitalityEffectInfo;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExVoteSystemInfo;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExWorldChatCnt;
|
||||
import com.l2jserver.gameserver.network.serverpackets.HennaInfo;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ItemList;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
@@ -358,9 +360,13 @@ public class EnterWorld extends L2GameClientPacket
|
||||
final L2Clan clan = activeChar.getClan();
|
||||
clan.broadcastToOnlineMembers(new PledgeShowMemberListUpdate(activeChar));
|
||||
sendPacket(new PledgeShowMemberListAll(clan));
|
||||
activeChar.sendPacket(new ExPledgeCount(clan));
|
||||
clan.broadcastToOnlineMembers(new ExPledgeCount(clan));
|
||||
activeChar.sendPacket(new PledgeSkillList(clan));
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.sendPacket(ExPledgeWaitingListAlarm.STATIC_PACKET);
|
||||
}
|
||||
|
||||
activeChar.broadcastUserInfo();
|
||||
|
||||
@@ -594,6 +600,7 @@ public class EnterWorld extends L2GameClientPacket
|
||||
}
|
||||
|
||||
activeChar.sendPacket(new ExAcquireAPSkillList(activeChar));
|
||||
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.datatables.SkillTreesData;
|
||||
import com.l2jserver.gameserver.enums.CategoryType;
|
||||
import com.l2jserver.gameserver.enums.IllegalActionPunishmentType;
|
||||
import com.l2jserver.gameserver.enums.Race;
|
||||
import com.l2jserver.gameserver.enums.UserInfoType;
|
||||
@@ -74,6 +75,18 @@ public final class RequestAcquireSkill extends L2GameClientPacket
|
||||
"ClassAbility80-"
|
||||
};
|
||||
|
||||
private static final String[] REVELATION_VAR_NAMES =
|
||||
{
|
||||
"RevelationSkill1",
|
||||
"RevelationSkill2"
|
||||
};
|
||||
|
||||
private static final String[] DUALCLASS_REVELATION_VAR_NAMES =
|
||||
{
|
||||
"DualclassRevelationSkill1",
|
||||
"DualclassRevelationSkill2"
|
||||
};
|
||||
|
||||
private int _id;
|
||||
private int _level;
|
||||
private AcquireSkillType _skillType;
|
||||
@@ -414,6 +427,91 @@ public final class RequestAcquireSkill extends L2GameClientPacket
|
||||
|
||||
break;
|
||||
}
|
||||
case REVELATION:
|
||||
{
|
||||
if (activeChar.isSubClassActive())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THIS_SKILL_CANNOT_BE_LEARNED_WHILE_IN_THE_SUBCLASS_STATE_PLEASE_TRY_AGAIN_AFTER_CHANGING_TO_THE_MAIN_CLASS);
|
||||
Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " is requesting skill Id: " + _id + " level " + _level + " while Sub-Class is active!", IllegalActionPunishmentType.NONE);
|
||||
return;
|
||||
}
|
||||
if ((activeChar.getLevel() < 85) || !activeChar.isInCategory(CategoryType.AWAKEN_GROUP))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_THE_NECESSARY_MATERIALS_OR_PREREQUISITES_TO_LEARN_THIS_SKILL);
|
||||
Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " is requesting skill Id: " + _id + " level " + _level + " while not being level 85 or awaken!", IllegalActionPunishmentType.NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
|
||||
for (String varName : REVELATION_VAR_NAMES)
|
||||
{
|
||||
if (activeChar.getVariables().getInt(varName, 0) > 0)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (count >= 2)
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_THE_NECESSARY_MATERIALS_OR_PREREQUISITES_TO_LEARN_THIS_SKILL);
|
||||
Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " is requesting skill Id: " + _id + " level " + _level + " while having already learned 2 skills!", IllegalActionPunishmentType.NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkPlayerSkill(activeChar, trainer, s))
|
||||
{
|
||||
final String varName = count == 0 ? REVELATION_VAR_NAMES[0] : REVELATION_VAR_NAMES[1];
|
||||
|
||||
activeChar.getVariables().set(varName, skill.getId());
|
||||
|
||||
giveSkill(activeChar, trainer, skill);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case REVELATION_DUALCLASS:
|
||||
{
|
||||
if (activeChar.isSubClassActive() && !activeChar.isDualClassActive())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THIS_SKILL_CANNOT_BE_LEARNED_WHILE_IN_THE_SUBCLASS_STATE_PLEASE_TRY_AGAIN_AFTER_CHANGING_TO_THE_MAIN_CLASS);
|
||||
Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " is requesting skill Id: " + _id + " level " + _level + " while Sub-Class is active!", IllegalActionPunishmentType.NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((activeChar.getLevel() < 85) || !activeChar.isInCategory(CategoryType.AWAKEN_GROUP))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_THE_NECESSARY_MATERIALS_OR_PREREQUISITES_TO_LEARN_THIS_SKILL);
|
||||
Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " is requesting skill Id: " + _id + " level " + _level + " while not being level 85 or awaken!", IllegalActionPunishmentType.NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
|
||||
for (String varName : DUALCLASS_REVELATION_VAR_NAMES)
|
||||
{
|
||||
if (activeChar.getVariables().getInt(varName, 0) > 0)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (count >= 2)
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_THE_NECESSARY_MATERIALS_OR_PREREQUISITES_TO_LEARN_THIS_SKILL);
|
||||
Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " is requesting skill Id: " + _id + " level " + _level + " while having already learned 2 skills!", IllegalActionPunishmentType.NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkPlayerSkill(activeChar, trainer, s))
|
||||
{
|
||||
final String varName = count == 0 ? DUALCLASS_REVELATION_VAR_NAMES[0] : DUALCLASS_REVELATION_VAR_NAMES[1];
|
||||
|
||||
activeChar.getVariables().set(varName, skill.getId());
|
||||
|
||||
giveSkill(activeChar, trainer, skill);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
_log.warning("Recived Wrong Packet Data in Aquired Skill, unknown skill type:" + _skillType);
|
||||
|
||||
@@ -20,6 +20,7 @@ package com.l2jserver.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.datatables.SkillTreesData;
|
||||
import com.l2jserver.gameserver.enums.CategoryType;
|
||||
import com.l2jserver.gameserver.enums.Race;
|
||||
import com.l2jserver.gameserver.model.ClanPrivilege;
|
||||
import com.l2jserver.gameserver.model.L2SkillLearn;
|
||||
@@ -148,6 +149,24 @@ public final class RequestAcquireSkillInfo extends L2GameClientPacket
|
||||
sendPacket(new AcquireSkillInfo(_skillType, s));
|
||||
break;
|
||||
}
|
||||
case REVELATION:
|
||||
{
|
||||
if ((activeChar.getLevel() < 85) || !activeChar.isInCategory(CategoryType.AWAKEN_GROUP))
|
||||
{
|
||||
return;
|
||||
}
|
||||
sendPacket(new AcquireSkillInfo(_skillType, s));
|
||||
break;
|
||||
}
|
||||
case REVELATION_DUALCLASS:
|
||||
{
|
||||
if (!activeChar.isSubClassActive() || !activeChar.isDualClassActive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
sendPacket(new AcquireSkillInfo(_skillType, s));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.l2jserver.gameserver.instancemanager.FortManager;
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExPledgeCount;
|
||||
import com.l2jserver.gameserver.network.serverpackets.JoinPledge;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PledgeShowInfoUpdate;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListAdd;
|
||||
@@ -77,7 +78,7 @@ public final class RequestAnswerJoinPledge extends L2GameClientPacket
|
||||
}
|
||||
|
||||
RequestJoinPledge requestPacket = (RequestJoinPledge) requestor.getRequest().getRequestPacket();
|
||||
L2Clan clan = requestor.getClan();
|
||||
final L2Clan clan = requestor.getClan();
|
||||
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
||||
if (clan.checkClanJoinCondition(requestor, activeChar, requestPacket.getPledgeType()))
|
||||
{
|
||||
@@ -102,18 +103,19 @@ public final class RequestAnswerJoinPledge extends L2GameClientPacket
|
||||
sm.addString(activeChar.getName());
|
||||
clan.broadcastToOnlineMembers(sm);
|
||||
|
||||
if (activeChar.getClan().getCastleId() > 0)
|
||||
if (clan.getCastleId() > 0)
|
||||
{
|
||||
CastleManager.getInstance().getCastleByOwner(activeChar.getClan()).giveResidentialSkills(activeChar);
|
||||
CastleManager.getInstance().getCastleByOwner(clan).giveResidentialSkills(activeChar);
|
||||
}
|
||||
if (activeChar.getClan().getFortId() > 0)
|
||||
if (clan.getFortId() > 0)
|
||||
{
|
||||
FortManager.getInstance().getFortByOwner(activeChar.getClan()).giveResidentialSkills(activeChar);
|
||||
FortManager.getInstance().getFortByOwner(clan).giveResidentialSkills(activeChar);
|
||||
}
|
||||
activeChar.sendSkillList();
|
||||
|
||||
clan.broadcastToOtherOnlineMembers(new PledgeShowMemberListAdd(activeChar), activeChar);
|
||||
clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
|
||||
clan.broadcastToOnlineMembers(new ExPledgeCount(clan));
|
||||
|
||||
// this activates the clan tab on the new member
|
||||
activeChar.sendPacket(new PledgeShowMemberListAll(clan));
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
* L2J Server is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* L2J Server is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.events.EventDispatcher;
|
||||
import com.l2jserver.gameserver.model.events.impl.character.player.OnPlayerChangeToAwakenedClass;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class RequestChangeToAwakenedClass extends L2GameClientPacket
|
||||
{
|
||||
private static final String _C__D0_A1_REQUESTCHANGETOAWAKENEDCLASS = "[C] D0;A2 RequestChangeToAwakenedClass";
|
||||
|
||||
private boolean _change;
|
||||
|
||||
@Override
|
||||
protected void readImpl()
|
||||
{
|
||||
_change = readD() == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void runImpl()
|
||||
{
|
||||
final L2PcInstance player = getClient().getActiveChar();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_change)
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerChangeToAwakenedClass(player), player);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return _C__D0_A1_REQUESTCHANGETOAWAKENEDCLASS;
|
||||
}
|
||||
}
|
||||
@@ -18,28 +18,50 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExPledgeCrestLarge;
|
||||
import com.l2jserver.gameserver.datatables.CrestTable;
|
||||
import com.l2jserver.gameserver.model.L2Crest;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExPledgeEmblem;
|
||||
|
||||
/**
|
||||
* Fomat : chd c: (id) 0xD0 h: (subid) 0x10 d: the crest id This is a trigger
|
||||
* @author -Wooden-
|
||||
* @author -Wooden-, Sdw
|
||||
*/
|
||||
public final class RequestExPledgeCrestLarge extends L2GameClientPacket
|
||||
{
|
||||
private static final String _C__D0_10_REQUESTEXPLEDGECRESTLARGE = "[C] D0:10 RequestExPledgeCrestLarge";
|
||||
|
||||
private int _crestId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
protected void readImpl()
|
||||
{
|
||||
_crestId = readD();
|
||||
_clanId = readD();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void runImpl()
|
||||
{
|
||||
sendPacket(new ExPledgeCrestLarge(_crestId));
|
||||
final L2Crest crest = CrestTable.getInstance().getCrest(_crestId);
|
||||
final byte[] data = crest != null ? crest.getData() : null;
|
||||
if (data != null)
|
||||
{
|
||||
for (int i = 0; i <= 4; i++)
|
||||
{
|
||||
if (i < 4)
|
||||
{
|
||||
final byte[] fullChunk = new byte[14336];
|
||||
System.arraycopy(data, (14336 * i), fullChunk, 0, 14336);
|
||||
sendPacket(new ExPledgeEmblem(_crestId, fullChunk, _clanId, i, 14336));
|
||||
}
|
||||
else
|
||||
{
|
||||
final byte[] lastChunk = new byte[8320];
|
||||
System.arraycopy(data, (14336 * i), lastChunk, 0, 8320);
|
||||
sendPacket(new ExPledgeEmblem(_crestId, lastChunk, _clanId, i, 8320));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.l2jserver.gameserver.model.L2Clan;
|
||||
import com.l2jserver.gameserver.model.L2ClanMember;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExPledgeCount;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListDelete;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
@@ -46,7 +47,7 @@ public final class RequestOustPledgeMember extends L2GameClientPacket
|
||||
@Override
|
||||
protected void runImpl()
|
||||
{
|
||||
L2PcInstance activeChar = getClient().getActiveChar();
|
||||
final L2PcInstance activeChar = getClient().getActiveChar();
|
||||
if (activeChar == null)
|
||||
{
|
||||
return;
|
||||
@@ -94,6 +95,7 @@ public final class RequestOustPledgeMember extends L2GameClientPacket
|
||||
|
||||
// Remove the Player From the Member list
|
||||
clan.broadcastToOnlineMembers(new PledgeShowMemberListDelete(_target));
|
||||
clan.broadcastToOnlineMembers(new ExPledgeCount(clan));
|
||||
|
||||
if (member.isOnline())
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ public class RequestPledgeWaitingApply extends L2GameClientPacket
|
||||
|
||||
if (clanLeader != null)
|
||||
{
|
||||
clanLeader.sendPacket(new ExPledgeWaitingListAlarm());
|
||||
clanLeader.sendPacket(ExPledgeWaitingListAlarm.STATIC_PACKET);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExPledgeCount;
|
||||
import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListDelete;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
@@ -73,6 +74,7 @@ public final class RequestWithdrawalPledge extends L2GameClientPacket
|
||||
|
||||
// Remove the Player From the Member list
|
||||
clan.broadcastToOnlineMembers(new PledgeShowMemberListDelete(activeChar.getName()));
|
||||
clan.broadcastToOnlineMembers(new ExPledgeCount(clan));
|
||||
|
||||
activeChar.sendPacket(SystemMessageId.YOU_HAVE_WITHDRAWN_FROM_THE_CLAN);
|
||||
activeChar.sendPacket(SystemMessageId.AFTER_LEAVING_OR_HAVING_BEEN_DISMISSED_FROM_A_CLAN_YOU_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_JOINING_ANOTHER_CLAN);
|
||||
|
||||
@@ -70,6 +70,8 @@ public final class Say2 extends L2GameClientPacket
|
||||
public static final int MPCC_ROOM = 21;
|
||||
public static final int NPC_ALL = 22;
|
||||
public static final int NPC_SHOUT = 23;
|
||||
public static final int NPC_TELL = 24;
|
||||
public static final int GLOBAL = 25;
|
||||
|
||||
private static final String[] CHAT_NAMES =
|
||||
{
|
||||
@@ -94,7 +96,11 @@ public final class Say2 extends L2GameClientPacket
|
||||
"CRITICAL_ANNOUNCE",
|
||||
"SCREEN_ANNOUNCE",
|
||||
"BATTLEFIELD",
|
||||
"MPCC_ROOM"
|
||||
"MPCC_ROOM",
|
||||
"NPC_ALL",
|
||||
"NPC_SHOUT",
|
||||
"NEW_TELL",
|
||||
"GLOBAL"
|
||||
};
|
||||
|
||||
private static final String[] WALKER_COMMAND_LIST =
|
||||
|
||||
@@ -308,6 +308,16 @@ public final class UseItem extends L2GameClientPacket
|
||||
activeChar.sendPacket(SystemMessageId.YOU_DO_NOT_MEET_THE_REQUIRED_CONDITION_TO_EQUIP_THAT_ITEM);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case L2Item.SLOT_BROOCH_JEWEL:
|
||||
{
|
||||
if (!item.isEquipped() && (activeChar.getInventory().getBroochJewelSlots() == 0))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_EQUIP_S1_WITHOUT_EQUIPPING_A_BROOCH);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ public class AcquireSkillList extends L2GameServerPacket
|
||||
public AcquireSkillList(L2PcInstance activeChar)
|
||||
{
|
||||
_learnable = SkillTreesData.getInstance().getAvailableSkills(activeChar, activeChar.getClassId(), false, false);
|
||||
_learnable.addAll(SkillTreesData.getInstance().getNextAvailableSkills(activeChar, activeChar.getClassId(), false, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,7 +50,7 @@ public class AcquireSkillList extends L2GameServerPacket
|
||||
writeH(skill.getSkillLevel());
|
||||
writeQ(skill.getLevelUpSp());
|
||||
writeC(skill.getGetLevel());
|
||||
writeC(skill.getGetLevel()); // Dual Class Level Required
|
||||
writeC(0x00); // Dual Class Level Required
|
||||
writeC(skill.getRequiredItems().size());
|
||||
for (ItemHolder item : skill.getRequiredItems())
|
||||
{
|
||||
|
||||
@@ -90,6 +90,14 @@ public final class CreatureSay extends L2GameServerPacket
|
||||
_text = text;
|
||||
}
|
||||
|
||||
public CreatureSay(L2PcInstance player, int messageType, String text)
|
||||
{
|
||||
_objectId = player.getObjectId();
|
||||
_textType = messageType;
|
||||
_charName = player.getAppearance().getVisibleName();
|
||||
_text = text;
|
||||
}
|
||||
|
||||
public CreatureSay(int objectId, int messageType, int charId, NpcStringId npcString)
|
||||
{
|
||||
_objectId = objectId;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.gameserver.enums.CastleSide;
|
||||
import com.l2jserver.gameserver.model.entity.Castle;
|
||||
|
||||
/**
|
||||
@@ -26,12 +27,12 @@ import com.l2jserver.gameserver.model.entity.Castle;
|
||||
public class ExCastleState extends L2GameServerPacket
|
||||
{
|
||||
private final int _castleId;
|
||||
private final int _state;
|
||||
private final CastleSide _castleSide;
|
||||
|
||||
public ExCastleState(Castle castle)
|
||||
{
|
||||
_castleId = castle.getResidenceId();
|
||||
_state = castle.getState();
|
||||
_castleSide = castle.getSide();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,6 +41,6 @@ public class ExCastleState extends L2GameServerPacket
|
||||
writeC(0xFE);
|
||||
writeH(0x12D);
|
||||
writeD(_castleId);
|
||||
writeD(_state);
|
||||
writeD(_castleSide.ordinal());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
* L2J Server is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* L2J Server is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class ExChangeToAwakenedClass extends L2GameServerPacket
|
||||
{
|
||||
private final int _classId;
|
||||
|
||||
public ExChangeToAwakenedClass(int classId)
|
||||
{
|
||||
_classId = classId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xFF);
|
||||
|
||||
writeD(_classId);
|
||||
}
|
||||
}
|
||||
@@ -18,28 +18,27 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.CrestTable;
|
||||
import com.l2jserver.gameserver.model.L2Crest;
|
||||
import com.l2jserver.Config;
|
||||
|
||||
/**
|
||||
* @author -Wooden-
|
||||
* @author -Wooden-, Sdw
|
||||
*/
|
||||
public class ExPledgeCrestLarge extends L2GameServerPacket
|
||||
public class ExPledgeEmblem extends L2GameServerPacket
|
||||
{
|
||||
private final int _crestId;
|
||||
private final int _clanId;
|
||||
private final byte[] _data;
|
||||
private final int _chunkId;
|
||||
private final int _chunkSize;
|
||||
private static final int TOTAL_SIZE = 65664;
|
||||
|
||||
public ExPledgeCrestLarge(int crestId)
|
||||
public ExPledgeEmblem(int crestId, byte[] chunkedData, int clanId, int chunkId, int chunkSize)
|
||||
{
|
||||
_crestId = crestId;
|
||||
final L2Crest crest = CrestTable.getInstance().getCrest(crestId);
|
||||
_data = crest != null ? crest.getData() : null;
|
||||
}
|
||||
|
||||
public ExPledgeCrestLarge(int crestId, byte[] data)
|
||||
{
|
||||
_crestId = crestId;
|
||||
_data = data;
|
||||
_data = chunkedData;
|
||||
_clanId = clanId;
|
||||
_chunkId = chunkId;
|
||||
_chunkSize = chunkSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,8 +46,12 @@ public class ExPledgeCrestLarge extends L2GameServerPacket
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x1B);
|
||||
writeD(0x00);
|
||||
writeD(Config.SERVER_ID);
|
||||
writeD(_clanId);
|
||||
writeD(_crestId);
|
||||
writeD(_chunkId);
|
||||
writeD(TOTAL_SIZE);
|
||||
writeD(_chunkSize);
|
||||
if (_data != null)
|
||||
{
|
||||
writeD(_data.length);
|
||||
@@ -23,6 +23,8 @@ package com.l2jserver.gameserver.network.serverpackets;
|
||||
*/
|
||||
public class ExPledgeWaitingListAlarm extends L2GameServerPacket
|
||||
{
|
||||
public static final ExPledgeWaitingListAlarm STATIC_PACKET = new ExPledgeWaitingListAlarm();
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ExSubjobInfo extends L2GameServerPacket
|
||||
_index = sub.getClassIndex();
|
||||
_classId = sub.getClassId();
|
||||
_level = sub.getLevel();
|
||||
_type = SubclassType.SUBCLASS.ordinal();
|
||||
_type = sub.isDualClass() ? SubclassType.DUALCLASS.ordinal() : SubclassType.SUBCLASS.ordinal();
|
||||
}
|
||||
|
||||
public SubInfo(L2PcInstance player)
|
||||
|
||||
@@ -18,7 +18,11 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.stat.PcStat;
|
||||
import com.l2jserver.gameserver.model.variables.AccountVariables;
|
||||
import com.l2jserver.gameserver.network.L2GameClient;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -32,6 +36,12 @@ public class ExVitalityEffectInfo extends L2GameServerPacket
|
||||
_points = cha.getVitalityPoints();
|
||||
}
|
||||
|
||||
public ExVitalityEffectInfo(L2GameClient client)
|
||||
{
|
||||
final AccountVariables vars = new AccountVariables(client.getAccountName());
|
||||
_points = vars.getInt(PcStat.VITALITY_VARIABLE, Config.STARTING_VITALITY_POINTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
@@ -39,7 +49,7 @@ public class ExVitalityEffectInfo extends L2GameServerPacket
|
||||
writeH(0x118);
|
||||
|
||||
writeD(_points);
|
||||
writeD(0x00); // Vitality Bonus
|
||||
writeD((int) (Config.RATE_VITALITY_EXP_MULTIPLIER * 100)); // Vitality Bonus
|
||||
writeH(0x05); // How much vitality items remaining for use
|
||||
writeH(0x05); // Max number of items for use
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.entity.RecoBonus;
|
||||
|
||||
/**
|
||||
* ExVoteSystemInfo packet implementation.
|
||||
@@ -37,9 +36,9 @@ public class ExVoteSystemInfo extends L2GameServerPacket
|
||||
{
|
||||
_recomLeft = player.getRecomLeft();
|
||||
_recomHave = player.getRecomHave();
|
||||
_bonusTime = player.getRecomBonusTime();
|
||||
_bonusVal = RecoBonus.getRecoBonus(player);
|
||||
_bonusType = player.getRecomBonusType();
|
||||
_bonusTime = 0;
|
||||
_bonusVal = 0;
|
||||
_bonusType = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
* L2J Server is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* L2J Server is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ExWorldChatCnt extends L2GameServerPacket
|
||||
{
|
||||
private final int _points;
|
||||
|
||||
public ExWorldChatCnt(L2PcInstance activeChar)
|
||||
{
|
||||
_points = activeChar.getLevel() < Config.WORLD_CHAT_MIN_LEVEL ? 0 : activeChar.getWorldChatPoints();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0x173);
|
||||
writeD(_points);
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,8 @@ public final class GMHennaInfo extends L2GameServerPacket
|
||||
writeC(_activeChar.getHennaStatMEN()); // equip MEN
|
||||
writeC(_activeChar.getHennaStatDEX()); // equip DEX
|
||||
writeC(_activeChar.getHennaStatWIT()); // equip WIT
|
||||
writeC(0x00); // equip LUC
|
||||
writeC(0x00); // equip CHA
|
||||
writeD(3); // Slots
|
||||
writeD(_hennas.size()); // Size
|
||||
for (L2Henna henna : _hennas)
|
||||
@@ -62,5 +64,8 @@ public final class GMHennaInfo extends L2GameServerPacket
|
||||
writeD(henna.getDyeId());
|
||||
writeD(0x01);
|
||||
}
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,8 +109,8 @@ public class GMViewCharacterInfo extends L2GameServerPacket
|
||||
writeD(_activeChar.getPAtkSpd());
|
||||
|
||||
writeD(_activeChar.getMDef(null, null));
|
||||
writeD(0x00); // magic evasion
|
||||
writeD(0x00); // magic accuracy
|
||||
writeD(_activeChar.getMagicEvasionRate(null));
|
||||
writeD(_activeChar.getMagicAccuracy());
|
||||
writeD(_activeChar.getMCriticalHit(null, null));
|
||||
|
||||
writeD(_activeChar.getPvpFlag()); // 0-non-pvp 1-pvp = violett name
|
||||
|
||||
@@ -37,11 +37,13 @@ public class GMViewPledgeInfo extends L2GameServerPacket
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x96);
|
||||
writeD(0x00);
|
||||
writeS(_activeChar.getName());
|
||||
writeD(_clan.getId());
|
||||
writeD(0x00);
|
||||
writeS(_clan.getName());
|
||||
writeS(_clan.getLeaderName());
|
||||
|
||||
writeD(_clan.getCrestId()); // -> no, it's no longer used (nuocnam) fix by game
|
||||
writeD(_clan.getLevel());
|
||||
writeD(_clan.getCastleId());
|
||||
@@ -51,14 +53,14 @@ public class GMViewPledgeInfo extends L2GameServerPacket
|
||||
writeD(_clan.getReputationScore());
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
|
||||
writeD(0x00);
|
||||
writeD(_clan.getAllyId()); // c2
|
||||
writeS(_clan.getAllyName()); // c2
|
||||
writeD(_clan.getAllyCrestId()); // c2
|
||||
writeD(_clan.isAtWar() ? 1 : 0); // c3
|
||||
writeD(0x00); // T3 Unknown
|
||||
writeD(_clan.getMembers().length);
|
||||
|
||||
writeD(_clan.getMembers().size());
|
||||
for (L2ClanMember member : _clan.getMembers())
|
||||
{
|
||||
if (member != null)
|
||||
|
||||
@@ -50,6 +50,7 @@ public class GMViewSkillInfo extends L2GameServerPacket
|
||||
writeD(skill.isPassive() ? 1 : 0);
|
||||
writeD(skill.getDisplayLevel());
|
||||
writeD(skill.getDisplayId());
|
||||
writeD(0x00);
|
||||
writeC(isDisabled && skill.isClanSkill() ? 1 : 0);
|
||||
writeC(SkillData.getInstance().isEnchantable(skill.getDisplayId()) ? 1 : 0);
|
||||
}
|
||||
|
||||
@@ -43,29 +43,16 @@ public class GmViewQuestInfo extends L2GameServerPacket
|
||||
|
||||
Quest[] questList = _activeChar.getAllActiveQuests();
|
||||
|
||||
if (questList.length == 0)
|
||||
{
|
||||
writeC(0);
|
||||
writeH(0);
|
||||
writeH(0);
|
||||
return;
|
||||
}
|
||||
|
||||
writeH(questList.length); // quest count
|
||||
|
||||
for (Quest q : questList)
|
||||
{
|
||||
final QuestState qs = _activeChar.getQuestState(q.getName());
|
||||
|
||||
writeD(q.getId());
|
||||
|
||||
QuestState qs = _activeChar.getQuestState(q.getName());
|
||||
|
||||
if (qs == null)
|
||||
{
|
||||
writeD(0);
|
||||
continue;
|
||||
}
|
||||
|
||||
writeD(qs.getInt("cond")); // stage of quest progress
|
||||
writeD(qs == null ? 0 : qs.getInt("cond"));
|
||||
}
|
||||
writeH(0x00); // some size
|
||||
// for size; ddQQ
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.mmocore.network.SendablePacket;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.interfaces.IPositionable;
|
||||
import com.l2jserver.gameserver.model.interfaces.IUpdateTypeComponent;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
||||
@@ -178,8 +179,23 @@ public abstract class L2GameServerPacket extends SendablePacket<L2GameClient>
|
||||
|
||||
protected abstract void writeImpl();
|
||||
|
||||
/**
|
||||
* @param masks
|
||||
* @param type
|
||||
* @return {@code true} if the mask contains the current update component type
|
||||
*/
|
||||
protected static boolean containsMask(int masks, IUpdateTypeComponent type)
|
||||
{
|
||||
return (masks & type.getMask()) == type.getMask();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends this packet to the target player, useful for lambda operations like <br>
|
||||
* {@code L2World.getInstance().getPlayers().forEach(packet::sendTo)}
|
||||
* @param player
|
||||
*/
|
||||
public void sendTo(L2PcInstance player)
|
||||
{
|
||||
player.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
import com.l2jserver.gameserver.model.L2Clan.SubPledge;
|
||||
import com.l2jserver.gameserver.model.L2ClanMember;
|
||||
@@ -27,7 +29,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
public class PledgeShowMemberListAll extends L2GameServerPacket
|
||||
{
|
||||
private final L2Clan _clan;
|
||||
private final L2ClanMember[] _members;
|
||||
private final Collection<L2ClanMember> _members;
|
||||
private int _pledgeType;
|
||||
|
||||
public PledgeShowMemberListAll(L2Clan clan)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.ClanTable;
|
||||
import com.l2jserver.gameserver.enums.SiegeClanType;
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
import com.l2jserver.gameserver.model.L2SiegeClan;
|
||||
import com.l2jserver.gameserver.model.entity.Castle;
|
||||
@@ -60,69 +61,71 @@ public final class SiegeDefenderList extends L2GameServerPacket
|
||||
{
|
||||
writeC(0xcb);
|
||||
writeD(_castle.getResidenceId());
|
||||
writeD(0x00); // 0
|
||||
writeD(0x01); // 1
|
||||
writeD(0x00); // 0
|
||||
int size = _castle.getSiege().getDefenderClans().size() + _castle.getSiege().getDefenderWaitingClans().size();
|
||||
if (size > 0)
|
||||
writeD(0x00); // Unknown
|
||||
writeD(0x01); // Unknown
|
||||
writeD(0x00); // Unknown
|
||||
|
||||
final int size = _castle.getSiege().getDefenderWaitingClans().size() + _castle.getSiege().getDefenderClans().size() + (_castle.getOwner() != null ? 1 : 0);
|
||||
|
||||
writeD(size);
|
||||
writeD(size);
|
||||
|
||||
// Add owners
|
||||
final L2Clan ownerClan = _castle.getOwner();
|
||||
if (ownerClan != null)
|
||||
{
|
||||
L2Clan clan;
|
||||
|
||||
writeD(size);
|
||||
writeD(size);
|
||||
// Listing the Lord and the approved clans
|
||||
for (L2SiegeClan siegeclan : _castle.getSiege().getDefenderClans())
|
||||
{
|
||||
clan = ClanTable.getInstance().getClan(siegeclan.getClanId());
|
||||
if (clan == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
writeD(clan.getId());
|
||||
writeS(clan.getName());
|
||||
writeS(clan.getLeaderName());
|
||||
writeD(clan.getCrestId());
|
||||
writeD(0x00); // signed time (seconds) (not storated by L2J)
|
||||
switch (siegeclan.getType())
|
||||
{
|
||||
case OWNER:
|
||||
writeD(0x01); // owner
|
||||
break;
|
||||
case DEFENDER_PENDING:
|
||||
writeD(0x02); // approved
|
||||
break;
|
||||
case DEFENDER:
|
||||
writeD(0x03); // waiting approved
|
||||
break;
|
||||
default:
|
||||
writeD(0x00);
|
||||
break;
|
||||
}
|
||||
writeD(clan.getAllyId());
|
||||
writeS(clan.getAllyName());
|
||||
writeS(""); // AllyLeaderName
|
||||
writeD(clan.getAllyCrestId());
|
||||
}
|
||||
for (L2SiegeClan siegeclan : _castle.getSiege().getDefenderWaitingClans())
|
||||
{
|
||||
clan = ClanTable.getInstance().getClan(siegeclan.getClanId());
|
||||
writeD(clan.getId());
|
||||
writeS(clan.getName());
|
||||
writeS(clan.getLeaderName());
|
||||
writeD(clan.getCrestId());
|
||||
writeD(0x00); // signed time (seconds) (not storated by L2J)
|
||||
writeD(0x02); // waiting approval
|
||||
writeD(clan.getAllyId());
|
||||
writeS(clan.getAllyName());
|
||||
writeS(""); // AllyLeaderName
|
||||
writeD(clan.getAllyCrestId());
|
||||
}
|
||||
writeD(ownerClan.getId());
|
||||
writeS(ownerClan.getName());
|
||||
writeS(ownerClan.getLeaderName());
|
||||
writeD(ownerClan.getCrestId());
|
||||
writeD(0x00); // signed time (seconds) (not storated by L2J)
|
||||
writeD(SiegeClanType.OWNER.ordinal());
|
||||
writeD(ownerClan.getAllyId());
|
||||
writeS(ownerClan.getAllyName());
|
||||
writeS(""); // AllyLeaderName
|
||||
writeD(ownerClan.getAllyCrestId());
|
||||
}
|
||||
else
|
||||
|
||||
// List of confirmed defenders
|
||||
for (L2SiegeClan siegeClan : _castle.getSiege().getDefenderClans())
|
||||
{
|
||||
writeD(0x00);
|
||||
writeD(0x00);
|
||||
final L2Clan defendingClan = ClanTable.getInstance().getClan(siegeClan.getClanId());
|
||||
if ((defendingClan == null) || (defendingClan == _castle.getOwner()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
writeD(defendingClan.getId());
|
||||
writeS(defendingClan.getName());
|
||||
writeS(defendingClan.getLeaderName());
|
||||
writeD(defendingClan.getCrestId());
|
||||
writeD(0x00); // signed time (seconds) (not storated by L2J)
|
||||
writeD(SiegeClanType.DEFENDER.ordinal());
|
||||
writeD(defendingClan.getAllyId());
|
||||
writeS(defendingClan.getAllyName());
|
||||
writeS(""); // AllyLeaderName
|
||||
writeD(defendingClan.getAllyCrestId());
|
||||
}
|
||||
|
||||
// List of not confirmed defenders
|
||||
for (L2SiegeClan siegeClan : _castle.getSiege().getDefenderWaitingClans())
|
||||
{
|
||||
final L2Clan defendingClan = ClanTable.getInstance().getClan(siegeClan.getClanId());
|
||||
if (defendingClan == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
writeD(defendingClan.getId());
|
||||
writeS(defendingClan.getName());
|
||||
writeS(defendingClan.getLeaderName());
|
||||
writeD(defendingClan.getCrestId());
|
||||
writeD(0x00); // signed time (seconds) (not storated by L2J)
|
||||
writeD(SiegeClanType.DEFENDER_PENDING.ordinal());
|
||||
writeD(defendingClan.getAllyId());
|
||||
writeS(defendingClan.getAllyName());
|
||||
writeS(""); // AllyLeaderName
|
||||
writeD(defendingClan.getAllyCrestId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,389 +1,389 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
* L2J Server is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* L2J Server is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.ExperienceTable;
|
||||
import com.l2jserver.gameserver.enums.UserInfoType;
|
||||
import com.l2jserver.gameserver.instancemanager.RaidBossPointsManager;
|
||||
import com.l2jserver.gameserver.model.Elementals;
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
import com.l2jserver.gameserver.model.L2Party;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.zone.ZoneId;
|
||||
|
||||
/**
|
||||
* @author Sdw, UnAfraid
|
||||
*/
|
||||
public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
|
||||
private final int _relation;
|
||||
private final int _runSpd;
|
||||
private final int _walkSpd;
|
||||
private final int _swimRunSpd;
|
||||
private final int _swimWalkSpd;
|
||||
private final int _flRunSpd = 0;
|
||||
private final int _flWalkSpd = 0;
|
||||
private final int _flyRunSpd;
|
||||
private final int _flyWalkSpd;
|
||||
private final double _moveMultiplier;
|
||||
private int _enchantLevel = 0;
|
||||
private int _armorEnchant = 0;
|
||||
|
||||
private final byte[] _masks = new byte[]
|
||||
{
|
||||
(byte) 0x00,
|
||||
(byte) 0x00,
|
||||
(byte) 0x00
|
||||
};
|
||||
|
||||
private int _initSize = 5;
|
||||
|
||||
public UserInfo(L2PcInstance cha)
|
||||
{
|
||||
this(cha, true);
|
||||
}
|
||||
|
||||
public UserInfo(L2PcInstance cha, boolean addAll)
|
||||
{
|
||||
_activeChar = cha;
|
||||
|
||||
_relation = calculateRelation(cha);
|
||||
_moveMultiplier = cha.getMovementSpeedMultiplier();
|
||||
_runSpd = (int) Math.round(cha.getRunSpeed() / _moveMultiplier);
|
||||
_walkSpd = (int) Math.round(cha.getWalkSpeed() / _moveMultiplier);
|
||||
_swimRunSpd = (int) Math.round(cha.getSwimRunSpeed() / _moveMultiplier);
|
||||
_swimWalkSpd = (int) Math.round(cha.getSwimWalkSpeed() / _moveMultiplier);
|
||||
_flyRunSpd = cha.isFlying() ? _runSpd : 0;
|
||||
_flyWalkSpd = cha.isFlying() ? _walkSpd : 0;
|
||||
_enchantLevel = cha.getInventory().getWeaponEnchant();
|
||||
_armorEnchant = cha.getInventory().getArmorMinEnchant();
|
||||
|
||||
if (addAll)
|
||||
{
|
||||
addComponentType(UserInfoType.values());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected byte[] getMasks()
|
||||
{
|
||||
return _masks;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewMaskAdded(UserInfoType component)
|
||||
{
|
||||
calcBlockSize(component);
|
||||
}
|
||||
|
||||
private void calcBlockSize(UserInfoType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case BASIC_INFO:
|
||||
{
|
||||
_initSize += type.getBlockLength() + (_activeChar.getName().length() * 2);
|
||||
break;
|
||||
}
|
||||
case CLAN:
|
||||
{
|
||||
_initSize += type.getBlockLength() + (_activeChar.getTitle().length() * 2);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
_initSize += type.getBlockLength();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0x32);
|
||||
|
||||
writeD(_activeChar.getObjectId());
|
||||
writeD(_initSize);
|
||||
writeH(23);
|
||||
writeB(_masks);
|
||||
|
||||
if (containsMask(UserInfoType.RELATION))
|
||||
{
|
||||
writeD(_relation);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.BASIC_INFO))
|
||||
{
|
||||
writeH(16 + (_activeChar.getName().length() * 2));
|
||||
writeString(_activeChar.getName());
|
||||
writeC(_activeChar.isGM() ? 0x01 : 0x00);
|
||||
writeC(_activeChar.getRace().ordinal());
|
||||
writeC(_activeChar.getAppearance().getSex() ? 0x01 : 0x00);
|
||||
writeD(_activeChar.getBaseClass());
|
||||
writeD(_activeChar.getClassId().getId());
|
||||
writeC(_activeChar.getLevel());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.BASE_STATS))
|
||||
{
|
||||
writeH(18);
|
||||
writeH(_activeChar.getSTR());
|
||||
writeH(_activeChar.getDEX());
|
||||
writeH(_activeChar.getCON());
|
||||
writeH(_activeChar.getINT());
|
||||
writeH(_activeChar.getWIT());
|
||||
writeH(_activeChar.getMEN());
|
||||
writeH(_activeChar.getLUC());
|
||||
writeH(_activeChar.getCHA());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.MAX_HPCPMP))
|
||||
{
|
||||
writeH(14);
|
||||
writeD(_activeChar.getMaxHp());
|
||||
writeD(_activeChar.getMaxMp());
|
||||
writeD(_activeChar.getMaxCp());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.CURRENT_HPMPCP_EXP_SP))
|
||||
{
|
||||
writeH(38);
|
||||
writeD((int) Math.round(_activeChar.getCurrentHp()));
|
||||
writeD((int) Math.round(_activeChar.getCurrentMp()));
|
||||
writeD((int) Math.round(_activeChar.getCurrentCp()));
|
||||
writeQ(_activeChar.getSp());
|
||||
writeQ(_activeChar.getExp());
|
||||
writeF((float) (_activeChar.getExp() - ExperienceTable.getInstance().getExpForLevel(_activeChar.getLevel())) / (ExperienceTable.getInstance().getExpForLevel(_activeChar.getLevel() + 1) - ExperienceTable.getInstance().getExpForLevel(_activeChar.getLevel())));
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.ENCHANTLEVEL))
|
||||
{
|
||||
writeH(4);
|
||||
writeC(_enchantLevel);
|
||||
writeC(_armorEnchant);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.APPAREANCE))
|
||||
{
|
||||
writeH(15);
|
||||
writeD(_activeChar.getVisualHair());
|
||||
writeD(_activeChar.getVisualHairColor());
|
||||
writeD(_activeChar.getVisualFace());
|
||||
writeC(_activeChar.isHairAccessoryEnabled() ? 0x01 : 0x00);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.STATUS))
|
||||
{
|
||||
writeH(6);
|
||||
writeC(_activeChar.getMountType().ordinal());
|
||||
writeC(_activeChar.getPrivateStoreType().getId());
|
||||
writeC(_activeChar.hasDwarvenCraft() ? 1 : 0);
|
||||
writeC(0x00);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.STATS))
|
||||
{
|
||||
writeH(56);
|
||||
writeH(_activeChar.getActiveWeaponItem() != null ? 40 : 20);
|
||||
writeD(_activeChar.getPAtk(null));
|
||||
writeD(_activeChar.getPAtkSpd());
|
||||
writeD(_activeChar.getPDef(null));
|
||||
writeD(_activeChar.getEvasionRate(null));
|
||||
writeD(_activeChar.getAccuracy());
|
||||
writeD(_activeChar.getCriticalHit(null, null));
|
||||
writeD(_activeChar.getMAtk(null, null));
|
||||
writeD(_activeChar.getMAtkSpd());
|
||||
writeD(_activeChar.getPAtkSpd()); // Seems like atk speed - 1
|
||||
writeD(_activeChar.getMagicEvasionRate(null));
|
||||
writeD(_activeChar.getMDef(null, null));
|
||||
writeD(_activeChar.getMagicAccuracy());
|
||||
writeD(_activeChar.getMCriticalHit(null, null));
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.ELEMENTALS))
|
||||
{
|
||||
writeH(14);
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.FIRE));
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.WATER));
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.WIND));
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.EARTH));
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.HOLY));
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.DARK));
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.POSITION))
|
||||
{
|
||||
writeH(18);
|
||||
writeD(_activeChar.getX());
|
||||
writeD(_activeChar.getY());
|
||||
writeD(_activeChar.getZ());
|
||||
writeD(_activeChar.getHeading());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.SPEED))
|
||||
{
|
||||
writeH(18);
|
||||
writeH(_runSpd);
|
||||
writeH(_walkSpd);
|
||||
writeH(_swimRunSpd);
|
||||
writeH(_swimWalkSpd);
|
||||
writeH(_flRunSpd);
|
||||
writeH(_flWalkSpd);
|
||||
writeH(_flyRunSpd);
|
||||
writeH(_flyWalkSpd);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.MULTIPLIER))
|
||||
{
|
||||
writeH(18);
|
||||
writeF(_moveMultiplier);
|
||||
writeF(_activeChar.getAttackSpeedMultiplier());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.COL_RADIUS_HEIGHT))
|
||||
{
|
||||
writeH(18);
|
||||
writeF(_activeChar.getCollisionRadius());
|
||||
writeF(_activeChar.getCollisionHeight());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.ATK_ELEMENTAL))
|
||||
{
|
||||
writeH(5);
|
||||
byte attackAttribute = _activeChar.getAttackElement();
|
||||
writeC(attackAttribute);
|
||||
writeH(_activeChar.getAttackElementValue(attackAttribute));
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.CLAN))
|
||||
{
|
||||
writeH(32 + (_activeChar.getTitle().length() * 2));
|
||||
writeString(_activeChar.getTitle());
|
||||
writeH(_activeChar.getPledgeType());
|
||||
writeD(_activeChar.getClanId());
|
||||
writeD(_activeChar.getClanCrestLargeId());
|
||||
writeD(_activeChar.getClanCrestId());
|
||||
writeC(_activeChar.isClanLeader() ? -1 : 0x00);
|
||||
writeD(_activeChar.getClanPrivileges().getBitmask());
|
||||
writeD(_activeChar.getAllyId());
|
||||
writeD(_activeChar.getAllyCrestId());
|
||||
writeC(_activeChar.isInPartyMatchRoom() ? 0x01 : 0x00);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.SOCIAL))
|
||||
{
|
||||
writeH(22);
|
||||
writeC(_activeChar.getPvpFlag());
|
||||
writeD(_activeChar.getKarma()); // Reputation
|
||||
writeC(_activeChar.isNoble() ? 0x01 : 0x00);
|
||||
writeC(_activeChar.isHero() ? 0x01 : 0x00);
|
||||
writeC(_activeChar.getPledgeClass());
|
||||
writeD(_activeChar.getPkKills());
|
||||
writeD(_activeChar.getPvpKills());
|
||||
writeD(_activeChar.getRecomLeft());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.VITA_FAME))
|
||||
{
|
||||
writeH(15);
|
||||
writeD(_activeChar.getVitalityPoints());
|
||||
writeC(0x00); // Vita Bonus
|
||||
writeD(_activeChar.getFame());
|
||||
writeD(RaidBossPointsManager.getInstance().getPointsByOwnerId(_activeChar.getObjectId()));
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.SLOTS))
|
||||
{
|
||||
writeH(9);
|
||||
writeC(_activeChar.getInventory().getTalismanSlots()); // Confirmed
|
||||
writeC(_activeChar.getInventory().getBroochJewelSlots()); // Confirmed
|
||||
writeC(_activeChar.getTeam().getId()); // Confirmed
|
||||
writeC(0x00); // Red dotted ring on the floor
|
||||
writeC(0x00);
|
||||
writeC(0x00);
|
||||
writeC(0x00);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.MOVEMENTS))
|
||||
{
|
||||
writeH(4);
|
||||
writeC(_activeChar.isInsideZone(ZoneId.WATER) ? 1 : _activeChar.isFlyingMounted() ? 2 : 0);
|
||||
writeC(_activeChar.isRunning() ? 0x01 : 0x00);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.COLOR))
|
||||
{
|
||||
writeH(10);
|
||||
writeD(_activeChar.getAppearance().getNameColor());
|
||||
writeD(_activeChar.getAppearance().getTitleColor());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.INVENTORY_LIMIT))
|
||||
{
|
||||
writeH(9);
|
||||
writeH(0x00);
|
||||
writeH(0x00);
|
||||
writeH(_activeChar.getInventoryLimit());
|
||||
writeC(0x00); // if greater than 1 show the attack cursor when interacting
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.UNK_3))
|
||||
{
|
||||
writeH(9);
|
||||
writeC(0x00);
|
||||
writeH(0x00);
|
||||
writeD(0x00);
|
||||
}
|
||||
}
|
||||
|
||||
private int calculateRelation(L2PcInstance activeChar)
|
||||
{
|
||||
int relation = 0;
|
||||
final L2Party party = activeChar.getParty();
|
||||
final L2Clan clan = activeChar.getClan();
|
||||
|
||||
if (party != null)
|
||||
{
|
||||
relation |= 0x08; // Party member
|
||||
if (party.getLeader() == _activeChar)
|
||||
{
|
||||
relation |= 0x10; // Party leader
|
||||
}
|
||||
}
|
||||
|
||||
if (clan != null)
|
||||
{
|
||||
relation |= 0x20; // Clan member
|
||||
if (clan.getLeaderId() == activeChar.getObjectId())
|
||||
{
|
||||
relation |= 0x40; // Clan leader
|
||||
}
|
||||
}
|
||||
|
||||
if (activeChar.isInSiege())
|
||||
{
|
||||
relation |= 0x80; // In siege
|
||||
}
|
||||
|
||||
return relation;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
* L2J Server is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* L2J Server is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.ExperienceTable;
|
||||
import com.l2jserver.gameserver.enums.UserInfoType;
|
||||
import com.l2jserver.gameserver.instancemanager.RaidBossPointsManager;
|
||||
import com.l2jserver.gameserver.model.Elementals;
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
import com.l2jserver.gameserver.model.L2Party;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.zone.ZoneId;
|
||||
|
||||
/**
|
||||
* @author Sdw, UnAfraid
|
||||
*/
|
||||
public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
||||
{
|
||||
private final L2PcInstance _activeChar;
|
||||
|
||||
private final int _relation;
|
||||
private final int _runSpd;
|
||||
private final int _walkSpd;
|
||||
private final int _swimRunSpd;
|
||||
private final int _swimWalkSpd;
|
||||
private final int _flRunSpd = 0;
|
||||
private final int _flWalkSpd = 0;
|
||||
private final int _flyRunSpd;
|
||||
private final int _flyWalkSpd;
|
||||
private final double _moveMultiplier;
|
||||
private int _enchantLevel = 0;
|
||||
private int _armorEnchant = 0;
|
||||
|
||||
private final byte[] _masks = new byte[]
|
||||
{
|
||||
(byte) 0x00,
|
||||
(byte) 0x00,
|
||||
(byte) 0x00
|
||||
};
|
||||
|
||||
private int _initSize = 5;
|
||||
|
||||
public UserInfo(L2PcInstance cha)
|
||||
{
|
||||
this(cha, true);
|
||||
}
|
||||
|
||||
public UserInfo(L2PcInstance cha, boolean addAll)
|
||||
{
|
||||
_activeChar = cha;
|
||||
|
||||
_relation = calculateRelation(cha);
|
||||
_moveMultiplier = cha.getMovementSpeedMultiplier();
|
||||
_runSpd = (int) Math.round(cha.getRunSpeed() / _moveMultiplier);
|
||||
_walkSpd = (int) Math.round(cha.getWalkSpeed() / _moveMultiplier);
|
||||
_swimRunSpd = (int) Math.round(cha.getSwimRunSpeed() / _moveMultiplier);
|
||||
_swimWalkSpd = (int) Math.round(cha.getSwimWalkSpeed() / _moveMultiplier);
|
||||
_flyRunSpd = cha.isFlying() ? _runSpd : 0;
|
||||
_flyWalkSpd = cha.isFlying() ? _walkSpd : 0;
|
||||
_enchantLevel = cha.getInventory().getWeaponEnchant();
|
||||
_armorEnchant = cha.getInventory().getArmorMinEnchant();
|
||||
|
||||
if (addAll)
|
||||
{
|
||||
addComponentType(UserInfoType.values());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected byte[] getMasks()
|
||||
{
|
||||
return _masks;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewMaskAdded(UserInfoType component)
|
||||
{
|
||||
calcBlockSize(component);
|
||||
}
|
||||
|
||||
private void calcBlockSize(UserInfoType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case BASIC_INFO:
|
||||
{
|
||||
_initSize += type.getBlockLength() + (_activeChar.getName().length() * 2);
|
||||
break;
|
||||
}
|
||||
case CLAN:
|
||||
{
|
||||
_initSize += type.getBlockLength() + (_activeChar.getTitle().length() * 2);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
_initSize += type.getBlockLength();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
writeC(0x32);
|
||||
|
||||
writeD(_activeChar.getObjectId());
|
||||
writeD(_initSize);
|
||||
writeH(23);
|
||||
writeB(_masks);
|
||||
|
||||
if (containsMask(UserInfoType.RELATION))
|
||||
{
|
||||
writeD(_relation);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.BASIC_INFO))
|
||||
{
|
||||
writeH(16 + (_activeChar.getName().length() * 2));
|
||||
writeString(_activeChar.getName());
|
||||
writeC(_activeChar.isGM() ? 0x01 : 0x00);
|
||||
writeC(_activeChar.getRace().ordinal());
|
||||
writeC(_activeChar.getAppearance().getSex() ? 0x01 : 0x00);
|
||||
writeD(_activeChar.getBaseClass());
|
||||
writeD(_activeChar.getClassId().getId());
|
||||
writeC(_activeChar.getLevel());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.BASE_STATS))
|
||||
{
|
||||
writeH(18);
|
||||
writeH(_activeChar.getSTR());
|
||||
writeH(_activeChar.getDEX());
|
||||
writeH(_activeChar.getCON());
|
||||
writeH(_activeChar.getINT());
|
||||
writeH(_activeChar.getWIT());
|
||||
writeH(_activeChar.getMEN());
|
||||
writeH(_activeChar.getLUC());
|
||||
writeH(_activeChar.getCHA());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.MAX_HPCPMP))
|
||||
{
|
||||
writeH(14);
|
||||
writeD(_activeChar.getMaxHp());
|
||||
writeD(_activeChar.getMaxMp());
|
||||
writeD(_activeChar.getMaxCp());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.CURRENT_HPMPCP_EXP_SP))
|
||||
{
|
||||
writeH(38);
|
||||
writeD((int) Math.round(_activeChar.getCurrentHp()));
|
||||
writeD((int) Math.round(_activeChar.getCurrentMp()));
|
||||
writeD((int) Math.round(_activeChar.getCurrentCp()));
|
||||
writeQ(_activeChar.getSp());
|
||||
writeQ(_activeChar.getExp());
|
||||
writeF((float) (_activeChar.getExp() - ExperienceTable.getInstance().getExpForLevel(_activeChar.getLevel())) / (ExperienceTable.getInstance().getExpForLevel(_activeChar.getLevel() + 1) - ExperienceTable.getInstance().getExpForLevel(_activeChar.getLevel())));
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.ENCHANTLEVEL))
|
||||
{
|
||||
writeH(4);
|
||||
writeC(_enchantLevel);
|
||||
writeC(_armorEnchant);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.APPAREANCE))
|
||||
{
|
||||
writeH(15);
|
||||
writeD(_activeChar.getVisualHair());
|
||||
writeD(_activeChar.getVisualHairColor());
|
||||
writeD(_activeChar.getVisualFace());
|
||||
writeC(_activeChar.isHairAccessoryEnabled() ? 0x01 : 0x00);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.STATUS))
|
||||
{
|
||||
writeH(6);
|
||||
writeC(_activeChar.getMountType().ordinal());
|
||||
writeC(_activeChar.getPrivateStoreType().getId());
|
||||
writeC(_activeChar.hasDwarvenCraft() ? 1 : 0);
|
||||
writeC(_activeChar.getAbilityPointsUsed());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.STATS))
|
||||
{
|
||||
writeH(56);
|
||||
writeH(_activeChar.getActiveWeaponItem() != null ? 40 : 20);
|
||||
writeD(_activeChar.getPAtk(null));
|
||||
writeD(_activeChar.getPAtkSpd());
|
||||
writeD(_activeChar.getPDef(null));
|
||||
writeD(_activeChar.getEvasionRate(null));
|
||||
writeD(_activeChar.getAccuracy());
|
||||
writeD(_activeChar.getCriticalHit(null, null));
|
||||
writeD(_activeChar.getMAtk(null, null));
|
||||
writeD(_activeChar.getMAtkSpd());
|
||||
writeD(_activeChar.getPAtkSpd()); // Seems like atk speed - 1
|
||||
writeD(_activeChar.getMagicEvasionRate(null));
|
||||
writeD(_activeChar.getMDef(null, null));
|
||||
writeD(_activeChar.getMagicAccuracy());
|
||||
writeD(_activeChar.getMCriticalHit(null, null));
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.ELEMENTALS))
|
||||
{
|
||||
writeH(14);
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.FIRE));
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.WATER));
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.WIND));
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.EARTH));
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.HOLY));
|
||||
writeH(_activeChar.getDefenseElementValue(Elementals.DARK));
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.POSITION))
|
||||
{
|
||||
writeH(18);
|
||||
writeD(_activeChar.getX());
|
||||
writeD(_activeChar.getY());
|
||||
writeD(_activeChar.getZ());
|
||||
writeD(_activeChar.getHeading());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.SPEED))
|
||||
{
|
||||
writeH(18);
|
||||
writeH(_runSpd);
|
||||
writeH(_walkSpd);
|
||||
writeH(_swimRunSpd);
|
||||
writeH(_swimWalkSpd);
|
||||
writeH(_flRunSpd);
|
||||
writeH(_flWalkSpd);
|
||||
writeH(_flyRunSpd);
|
||||
writeH(_flyWalkSpd);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.MULTIPLIER))
|
||||
{
|
||||
writeH(18);
|
||||
writeF(_moveMultiplier);
|
||||
writeF(_activeChar.getAttackSpeedMultiplier());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.COL_RADIUS_HEIGHT))
|
||||
{
|
||||
writeH(18);
|
||||
writeF(_activeChar.getCollisionRadius());
|
||||
writeF(_activeChar.getCollisionHeight());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.ATK_ELEMENTAL))
|
||||
{
|
||||
writeH(5);
|
||||
byte attackAttribute = _activeChar.getAttackElement();
|
||||
writeC(attackAttribute);
|
||||
writeH(_activeChar.getAttackElementValue(attackAttribute));
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.CLAN))
|
||||
{
|
||||
writeH(32 + (_activeChar.getTitle().length() * 2));
|
||||
writeString(_activeChar.getTitle());
|
||||
writeH(_activeChar.getPledgeType());
|
||||
writeD(_activeChar.getClanId());
|
||||
writeD(_activeChar.getClanCrestLargeId());
|
||||
writeD(_activeChar.getClanCrestId());
|
||||
writeC(_activeChar.isClanLeader() ? -1 : 0x00);
|
||||
writeD(_activeChar.getClanPrivileges().getBitmask());
|
||||
writeD(_activeChar.getAllyId());
|
||||
writeD(_activeChar.getAllyCrestId());
|
||||
writeC(_activeChar.isInPartyMatchRoom() ? 0x01 : 0x00);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.SOCIAL))
|
||||
{
|
||||
writeH(22);
|
||||
writeC(_activeChar.getPvpFlag());
|
||||
writeD(_activeChar.getKarma()); // Reputation
|
||||
writeC(_activeChar.isNoble() ? 0x01 : 0x00);
|
||||
writeC(_activeChar.isHero() ? 0x01 : 0x00);
|
||||
writeC(_activeChar.getPledgeClass());
|
||||
writeD(_activeChar.getPkKills());
|
||||
writeD(_activeChar.getPvpKills());
|
||||
writeD(_activeChar.getRecomLeft());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.VITA_FAME))
|
||||
{
|
||||
writeH(15);
|
||||
writeD(_activeChar.getVitalityPoints());
|
||||
writeC(0x00); // Vita Bonus
|
||||
writeD(_activeChar.getFame());
|
||||
writeD(RaidBossPointsManager.getInstance().getPointsByOwnerId(_activeChar.getObjectId()));
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.SLOTS))
|
||||
{
|
||||
writeH(9);
|
||||
writeC(_activeChar.getInventory().getTalismanSlots()); // Confirmed
|
||||
writeC(_activeChar.getInventory().getBroochJewelSlots()); // Confirmed
|
||||
writeC(_activeChar.getTeam().getId()); // Confirmed
|
||||
writeC(0x00); // Red dotted ring on the floor
|
||||
writeC(0x00);
|
||||
writeC(0x00);
|
||||
writeC(0x00);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.MOVEMENTS))
|
||||
{
|
||||
writeH(4);
|
||||
writeC(_activeChar.isInsideZone(ZoneId.WATER) ? 1 : _activeChar.isFlyingMounted() ? 2 : 0);
|
||||
writeC(_activeChar.isRunning() ? 0x01 : 0x00);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.COLOR))
|
||||
{
|
||||
writeH(10);
|
||||
writeD(_activeChar.getAppearance().getNameColor());
|
||||
writeD(_activeChar.getAppearance().getTitleColor());
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.INVENTORY_LIMIT))
|
||||
{
|
||||
writeH(9);
|
||||
writeH(0x00);
|
||||
writeH(0x00);
|
||||
writeH(_activeChar.getInventoryLimit());
|
||||
writeC(0x00); // if greater than 1 show the attack cursor when interacting
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.UNK_3))
|
||||
{
|
||||
writeH(9);
|
||||
writeC(0x00);
|
||||
writeH(0x00);
|
||||
writeD(0x00);
|
||||
}
|
||||
}
|
||||
|
||||
private int calculateRelation(L2PcInstance activeChar)
|
||||
{
|
||||
int relation = 0;
|
||||
final L2Party party = activeChar.getParty();
|
||||
final L2Clan clan = activeChar.getClan();
|
||||
|
||||
if (party != null)
|
||||
{
|
||||
relation |= 0x08; // Party member
|
||||
if (party.getLeader() == _activeChar)
|
||||
{
|
||||
relation |= 0x10; // Party leader
|
||||
}
|
||||
}
|
||||
|
||||
if (clan != null)
|
||||
{
|
||||
relation |= 0x20; // Clan member
|
||||
if (clan.getLeaderId() == activeChar.getObjectId())
|
||||
{
|
||||
relation |= 0x40; // Clan leader
|
||||
}
|
||||
}
|
||||
|
||||
if (activeChar.isInSiege())
|
||||
{
|
||||
relation |= 0x80; // In siege
|
||||
}
|
||||
|
||||
return relation;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user