Updated pledge bonus packets.
This commit is contained in:
@@ -17,7 +17,6 @@
|
|||||||
package com.l2jmobius.gameserver.network.serverpackets.pledgebonus;
|
package com.l2jmobius.gameserver.network.serverpackets.pledgebonus;
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketWriter;
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.ClanRewardData;
|
import com.l2jmobius.gameserver.data.xml.impl.ClanRewardData;
|
||||||
@@ -27,49 +26,24 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
|
|||||||
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author UnAfraid
|
* @author Mobius
|
||||||
*/
|
*/
|
||||||
public class ExPledgeBonusList implements IClientOutgoingPacket
|
public class ExPledgeBonusList implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = Logger.getLogger(ExPledgeBonusList.class.getName());
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
OutgoingPackets.EX_PLEDGE_BONUS_LIST.writeId(packet);
|
OutgoingPackets.EX_PLEDGE_BONUS_LIST.writeId(packet);
|
||||||
for (ClanRewardType type : ClanRewardType.values())
|
packet.writeC(0x00); // 140
|
||||||
|
ClanRewardData.getInstance().getClanRewardBonuses(ClanRewardType.MEMBERS_ONLINE).stream().sorted(Comparator.comparingInt(ClanRewardBonus::getLevel)).forEach(bonus ->
|
||||||
{
|
{
|
||||||
ClanRewardData.getInstance().getClanRewardBonuses(type).stream().sorted(Comparator.comparingInt(ClanRewardBonus::getLevel)).forEach(bonus ->
|
|
||||||
{
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case MEMBERS_ONLINE:
|
|
||||||
{
|
|
||||||
if (bonus.getSkillReward() == null)
|
|
||||||
{
|
|
||||||
LOGGER.warning("Missing clan reward skill for reward level: " + bonus.getLevel());
|
|
||||||
packet.writeD(0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
packet.writeD(bonus.getSkillReward().getSkillId());
|
packet.writeD(bonus.getSkillReward().getSkillId());
|
||||||
break;
|
|
||||||
}
|
|
||||||
case HUNTING_MONSTERS:
|
|
||||||
{
|
|
||||||
if (bonus.getItemReward() == null)
|
|
||||||
{
|
|
||||||
LOGGER.warning("Missing clan reward skill for reward level: " + bonus.getLevel());
|
|
||||||
packet.writeD(0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
packet.writeD(bonus.getItemReward().getId());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
packet.writeC(0x01); // 140
|
||||||
|
ClanRewardData.getInstance().getClanRewardBonuses(ClanRewardType.HUNTING_MONSTERS).stream().sorted(Comparator.comparingInt(ClanRewardBonus::getLevel)).forEach(bonus ->
|
||||||
|
{
|
||||||
|
packet.writeD(bonus.getItemReward().getId());
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -82,6 +82,7 @@ public class ExPledgeBonusOpen implements IClientOutgoingPacket
|
|||||||
// Members online bonus
|
// Members online bonus
|
||||||
packet.writeD(highestMembersOnlineBonus.getRequiredAmount());
|
packet.writeD(highestMembersOnlineBonus.getRequiredAmount());
|
||||||
packet.writeD(clan.getMaxOnlineMembers());
|
packet.writeD(clan.getMaxOnlineMembers());
|
||||||
|
packet.writeC(0x00); // 140
|
||||||
packet.writeD(membersOnlineBonus != null ? highestMembersOnlineBonus.getSkillReward().getSkillId() : 0x00);
|
packet.writeD(membersOnlineBonus != null ? highestMembersOnlineBonus.getSkillReward().getSkillId() : 0x00);
|
||||||
packet.writeC(membersOnlineBonus != null ? membersOnlineBonus.getLevel() : 0x00);
|
packet.writeC(membersOnlineBonus != null ? membersOnlineBonus.getLevel() : 0x00);
|
||||||
packet.writeC(membersOnlineBonus != null ? 0x01 : 0x00);
|
packet.writeC(membersOnlineBonus != null ? 0x01 : 0x00);
|
||||||
@@ -89,6 +90,7 @@ public class ExPledgeBonusOpen implements IClientOutgoingPacket
|
|||||||
// Hunting bonus
|
// Hunting bonus
|
||||||
packet.writeD(highestHuntingBonus.getRequiredAmount());
|
packet.writeD(highestHuntingBonus.getRequiredAmount());
|
||||||
packet.writeD(clan.getHuntingPoints());
|
packet.writeD(clan.getHuntingPoints());
|
||||||
|
packet.writeC(0x00); // 140
|
||||||
packet.writeD(huntingBonus != null ? highestHuntingBonus.getItemReward().getId() : 0x00);
|
packet.writeD(huntingBonus != null ? highestHuntingBonus.getItemReward().getId() : 0x00);
|
||||||
packet.writeC(huntingBonus != null ? huntingBonus.getLevel() : 0x00);
|
packet.writeC(huntingBonus != null ? huntingBonus.getLevel() : 0x00);
|
||||||
packet.writeC(huntingBonus != null ? 0x01 : 0x00);
|
packet.writeC(huntingBonus != null ? 0x01 : 0x00);
|
||||||
|
Reference in New Issue
Block a user