Fixed display of Honor Coin special item.

This commit is contained in:
MobiusDevelopment 2021-05-23 01:34:38 +00:00
parent 346e29bce0
commit d7f7c3fb72
16 changed files with 136 additions and 56 deletions

View File

@ -26,7 +26,7 @@ public enum SpecialItemType
FAME(-300), FAME(-300),
FIELD_CYCLE_POINTS(-400), FIELD_CYCLE_POINTS(-400),
RAIDBOSS_POINTS(-500), RAIDBOSS_POINTS(-500),
HONOR_POINTS(-700); HONOR_COINS(-700);
private int _clientId; private int _clientId;

View File

@ -305,6 +305,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
import org.l2jmobius.gameserver.network.serverpackets.ExGetOnAirShip; import org.l2jmobius.gameserver.network.serverpackets.ExGetOnAirShip;
import org.l2jmobius.gameserver.network.serverpackets.ExMagicAttackInfo; import org.l2jmobius.gameserver.network.serverpackets.ExMagicAttackInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode; import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCoinInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount; import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
import org.l2jmobius.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg; import org.l2jmobius.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg;
import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList; import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
@ -12980,14 +12981,15 @@ public class PlayerInstance extends Playable
_pcCafePoints = count < Config.PC_CAFE_MAX_POINTS ? count : Config.PC_CAFE_MAX_POINTS; _pcCafePoints = count < Config.PC_CAFE_MAX_POINTS ? count : Config.PC_CAFE_MAX_POINTS;
} }
public long getHonorPoints() public long getHonorCoins()
{ {
return getVariables().getLong("HONOR_POINTS", 0); return getVariables().getLong("HONOR_COINS", 0);
} }
public void setHonorPoints(long value) public void setHonorCoins(long value)
{ {
getVariables().set("HONOR_POINTS", value); getVariables().set("HONOR_COINS", value);
sendPacket(new ExPledgeCoinInfo(this));
} }
/** /**

View File

@ -359,7 +359,7 @@ public class TeleportHolder
{ {
return "Raid Points"; return "Raid Points";
} }
case HONOR_POINTS: case HONOR_COINS:
{ {
return "Honor Points"; return "Honor Points";
} }

View File

@ -82,6 +82,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
import org.l2jmobius.gameserver.network.serverpackets.ExNoticePostArrived; import org.l2jmobius.gameserver.network.serverpackets.ExNoticePostArrived;
import org.l2jmobius.gameserver.network.serverpackets.ExNotifyPremiumItem; import org.l2jmobius.gameserver.network.serverpackets.ExNotifyPremiumItem;
import org.l2jmobius.gameserver.network.serverpackets.ExPCCafePointInfo; import org.l2jmobius.gameserver.network.serverpackets.ExPCCafePointInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCoinInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount; import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeWaitingListAlarm; import org.l2jmobius.gameserver.network.serverpackets.ExPledgeWaitingListAlarm;
import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList; import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
@ -402,6 +403,9 @@ public class EnterWorld implements IClientIncomingPacket
// Send Adena / Inventory Count Info // Send Adena / Inventory Count Info
player.sendPacket(new ExAdenaInvenCount(player)); player.sendPacket(new ExAdenaInvenCount(player));
// Send honor coin count.
player.sendPacket(new ExPledgeCoinInfo(player));
// Send Unread Mail Count // Send Unread Mail Count
if (MailManager.getInstance().hasUnreadPost(player)) if (MailManager.getInstance().hasUnreadPost(player))
{ {

View File

@ -365,9 +365,9 @@ public class MultiSellChoose implements IClientIncomingPacket
player.sendPacket(new ExPCCafePointInfo(player.getPcCafePoints(), (int) -totalCount, 1)); player.sendPacket(new ExPCCafePointInfo(player.getPcCafePoints(), (int) -totalCount, 1));
break; break;
} }
case HONOR_POINTS: case HONOR_COINS:
{ {
player.setHonorPoints(player.getHonorPoints() - totalCount); player.setHonorCoins(player.getHonorCoins() - totalCount);
break; break;
} }
default: default:
@ -468,9 +468,9 @@ public class MultiSellChoose implements IClientIncomingPacket
player.sendPacket(new UserInfo(player)); player.sendPacket(new UserInfo(player));
break; break;
} }
case HONOR_POINTS: case HONOR_COINS:
{ {
player.setHonorPoints(player.getHonorPoints() + totalCount); player.setHonorCoins(player.getHonorCoins() + totalCount);
break; break;
} }
default: default:
@ -665,9 +665,9 @@ public class MultiSellChoose implements IClientIncomingPacket
} }
return true; return true;
} }
case HONOR_POINTS: case HONOR_COINS:
{ {
if (player.getHonorPoints() < totalCount) if (player.getHonorCoins() < totalCount)
{ {
player.sendMessage("You are short of Honor Points."); player.sendMessage("You are short of Honor Points.");
return false; return false;

View File

@ -0,0 +1,42 @@
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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 org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
/**
* @author Mobius
*/
public class ExPledgeCoinInfo implements IClientOutgoingPacket
{
private final long _count;
public ExPledgeCoinInfo(PlayerInstance player)
{
_count = player.getHonorCoins();
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_PLEDGE_COIN_INFO.writeId(packet);
packet.writeQ(_count);
return true;
}
}

View File

@ -1,35 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LimitShop.xsd"> <list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LimitShop.xsd">
<product id="300" category="100"> <product id="300" category="100">
<ingredient id="91663" count="8" /> <!-- L-Coin --> <ingredient id="-700" count="8" /> <!-- Honor Coin -->
<production id="91641" accountDailyLimit="15" /> <!-- Sayha's Blessing --> <production id="91641" accountDailyLimit="15" /> <!-- Sayha's Blessing -->
</product> </product>
<product id="400" category="100"> <product id="400" category="100">
<ingredient id="91663" count="3" /> <!-- L-Coin --> <ingredient id="-700" count="3" /> <!-- Honor Coin -->
<production id="91690" accountDailyLimit="200" /> <!-- Special HP Recovery Potion --> <production id="91690" accountDailyLimit="200" /> <!-- Special HP Recovery Potion -->
</product> </product>
<product id="500" category="100"> <product id="500" category="100">
<ingredient id="91663" count="1012" /> <!-- L-Coin --> <ingredient id="-700" count="1012" /> <!-- Honor Coin -->
<production id="95583" accountDailyLimit="1" /> <!-- Hardin's Notes - Page 1 --> <production id="95583" accountDailyLimit="1" /> <!-- Hardin's Notes - Page 1 -->
</product> </product>
<product id="501" category="100"> <product id="501" category="100">
<ingredient id="91663" count="200" /> <!-- L-Coin --> <ingredient id="-700" count="200" /> <!-- Honor Coin -->
<production id="95636" accountDailyLimit="4" /> <!-- Clan Cloak --> <production id="95636" accountDailyLimit="4" /> <!-- Clan Cloak -->
</product> </product>
<product id="502" category="100"> <product id="502" category="100">
<ingredient id="91663" count="2" /> <!-- L-Coin --> <ingredient id="-700" count="2" /> <!-- Honor Coin -->
<production id="95638" accountDailyLimit="10" /> <!-- Scroll: Enchant Clan Equipment --> <production id="95638" accountDailyLimit="10" /> <!-- Scroll: Enchant Clan Equipment -->
</product> </product>
<product id="600" category="100"> <product id="600" category="100">
<ingredient id="91663" count="3375" /> <!-- L-Coin --> <ingredient id="-700" count="3375" /> <!-- Honor Coin -->
<production id="95584" accountDailyLimit="1" /> <!-- Hardin's Notes - Page 2 --> <production id="95584" accountDailyLimit="1" /> <!-- Hardin's Notes - Page 2 -->
</product> </product>
<product id="601" category="100"> <product id="601" category="100">
<ingredient id="91663" count="200" /> <!-- L-Coin --> <ingredient id="-700" count="200" /> <!-- Honor Coin -->
<production id="95637" accountDailyLimit="4" /> <!-- Clan Circlet --> <production id="95637" accountDailyLimit="4" /> <!-- Clan Circlet -->
</product> </product>
<product id="700" category="100"> <product id="700" category="100">
<ingredient id="91663" count="5062" /> <!-- L-Coin --> <ingredient id="-700" count="5062" /> <!-- Honor Coin -->
<production id="95585" accountDailyLimit="1" /> <!-- Hardin's Notes - Page 3 --> <production id="95585" accountDailyLimit="1" /> <!-- Hardin's Notes - Page 3 -->
</product> </product>
</list> </list>

View File

@ -27,10 +27,8 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.l2jmobius.commons.util.IXmlReader; import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder; import org.l2jmobius.gameserver.model.holders.LimitShopProductHolder;
import org.l2jmobius.gameserver.model.items.Item;
/** /**
* @author Mobius * @author Mobius
@ -121,13 +119,6 @@ public class LimitShopClanData implements IXmlReader
final long ingredientQuantity = parseLong(attrs, "count", 1L); final long ingredientQuantity = parseLong(attrs, "count", 1L);
final int ingredientEnchant = parseInteger(attrs, "enchant", 0); final int ingredientEnchant = parseInteger(attrs, "enchant", 0);
final Item item = ItemTable.getInstance().getTemplate(ingredientId);
if (item == null)
{
LOGGER.severe(getClass().getSimpleName() + ": Item template null for itemId: " + productionId + " productId: " + id);
continue;
}
if (ingredientIds[0] == 0) if (ingredientIds[0] == 0)
{ {
ingredientIds[0] = ingredientId; ingredientIds[0] = ingredientId;
@ -196,13 +187,6 @@ public class LimitShopClanData implements IXmlReader
productionId = parseInteger(attrs, "id"); productionId = parseInteger(attrs, "id");
accountDailyLimit = parseInteger(attrs, "accountDailyLimit", 0); accountDailyLimit = parseInteger(attrs, "accountDailyLimit", 0);
accountBuyLimit = parseInteger(attrs, "accountBuyLimit", 0); accountBuyLimit = parseInteger(attrs, "accountBuyLimit", 0);
final Item item = ItemTable.getInstance().getTemplate(productionId);
if (item == null)
{
LOGGER.severe(getClass().getSimpleName() + ": Item template null for itemId: " + productionId + " productId: " + id);
continue;
}
} }
} }

View File

@ -26,7 +26,7 @@ public enum SpecialItemType
FAME(-300), FAME(-300),
FIELD_CYCLE_POINTS(-400), FIELD_CYCLE_POINTS(-400),
RAIDBOSS_POINTS(-500), RAIDBOSS_POINTS(-500),
HONOR_POINTS(-700); HONOR_COINS(-700);
private int _clientId; private int _clientId;

View File

@ -316,6 +316,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
import org.l2jmobius.gameserver.network.serverpackets.ExGetOnAirShip; import org.l2jmobius.gameserver.network.serverpackets.ExGetOnAirShip;
import org.l2jmobius.gameserver.network.serverpackets.ExMagicAttackInfo; import org.l2jmobius.gameserver.network.serverpackets.ExMagicAttackInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode; import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCoinInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount; import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
import org.l2jmobius.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg; import org.l2jmobius.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg;
import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList; import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
@ -12992,14 +12993,15 @@ public class PlayerInstance extends Playable
_pcCafePoints = count < Config.PC_CAFE_MAX_POINTS ? count : Config.PC_CAFE_MAX_POINTS; _pcCafePoints = count < Config.PC_CAFE_MAX_POINTS ? count : Config.PC_CAFE_MAX_POINTS;
} }
public long getHonorPoints() public long getHonorCoins()
{ {
return getVariables().getLong("HONOR_POINTS", 0); return getVariables().getLong("HONOR_COINS", 0);
} }
public void setHonorPoints(long value) public void setHonorCoins(long value)
{ {
getVariables().set("HONOR_POINTS", value); getVariables().set("HONOR_COINS", value);
sendPacket(new ExPledgeCoinInfo(this));
} }
/** /**

View File

@ -359,7 +359,7 @@ public class TeleportHolder
{ {
return "Raid Points"; return "Raid Points";
} }
case HONOR_POINTS: case HONOR_COINS:
{ {
return "Honor Points"; return "Honor Points";
} }

View File

@ -83,6 +83,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
import org.l2jmobius.gameserver.network.serverpackets.ExNoticePostArrived; import org.l2jmobius.gameserver.network.serverpackets.ExNoticePostArrived;
import org.l2jmobius.gameserver.network.serverpackets.ExNotifyPremiumItem; import org.l2jmobius.gameserver.network.serverpackets.ExNotifyPremiumItem;
import org.l2jmobius.gameserver.network.serverpackets.ExPCCafePointInfo; import org.l2jmobius.gameserver.network.serverpackets.ExPCCafePointInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCoinInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount; import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeWaitingListAlarm; import org.l2jmobius.gameserver.network.serverpackets.ExPledgeWaitingListAlarm;
import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList; import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
@ -398,6 +399,9 @@ public class EnterWorld implements IClientIncomingPacket
// Send LCoin count. // Send LCoin count.
player.sendPacket(new ExBloodyCoinCount(player)); player.sendPacket(new ExBloodyCoinCount(player));
// Send honor coin count.
player.sendPacket(new ExPledgeCoinInfo(player));
// Send VIP/Premium Info // Send VIP/Premium Info
player.sendPacket(new ExBrPremiumState(player)); player.sendPacket(new ExBrPremiumState(player));

View File

@ -365,9 +365,9 @@ public class MultiSellChoose implements IClientIncomingPacket
player.sendPacket(new ExPCCafePointInfo(player.getPcCafePoints(), (int) -totalCount, 1)); player.sendPacket(new ExPCCafePointInfo(player.getPcCafePoints(), (int) -totalCount, 1));
break; break;
} }
case HONOR_POINTS: case HONOR_COINS:
{ {
player.setHonorPoints(player.getHonorPoints() - totalCount); player.setHonorCoins(player.getHonorCoins() - totalCount);
break; break;
} }
default: default:
@ -468,9 +468,9 @@ public class MultiSellChoose implements IClientIncomingPacket
player.sendPacket(new UserInfo(player)); player.sendPacket(new UserInfo(player));
break; break;
} }
case HONOR_POINTS: case HONOR_COINS:
{ {
player.setHonorPoints(player.getHonorPoints() + totalCount); player.setHonorCoins(player.getHonorCoins() + totalCount);
break; break;
} }
default: default:
@ -665,9 +665,9 @@ public class MultiSellChoose implements IClientIncomingPacket
} }
return true; return true;
} }
case HONOR_POINTS: case HONOR_COINS:
{ {
if (player.getHonorPoints() < totalCount) if (player.getHonorCoins() < totalCount)
{ {
player.sendMessage("You are short of Honor Points."); player.sendMessage("You are short of Honor Points.");
return false; return false;

View File

@ -160,9 +160,9 @@ public class RequestPurchaseLimitShopItemBuy implements IClientIncomingPacket
return; return;
} }
} }
else if (_product.getIngredientIds()[i] == SpecialItemType.HONOR_POINTS.getClientId()) else if (_product.getIngredientIds()[i] == SpecialItemType.HONOR_COINS.getClientId())
{ {
if (player.getHonorPoints() < (_product.getIngredientQuantities()[i] * _amount)) if (player.getHonorCoins() < (_product.getIngredientQuantities()[i] * _amount))
{ {
player.sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT_2); player.sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT_2);
player.removeRequest(PrimeShopRequest.class); player.removeRequest(PrimeShopRequest.class);
@ -188,9 +188,9 @@ public class RequestPurchaseLimitShopItemBuy implements IClientIncomingPacket
{ {
player.reduceAdena("LCoinShop", _product.getIngredientQuantities()[i] * _amount, player, true); player.reduceAdena("LCoinShop", _product.getIngredientQuantities()[i] * _amount, player, true);
} }
else if (_product.getIngredientIds()[i] == SpecialItemType.HONOR_POINTS.getClientId()) else if (_product.getIngredientIds()[i] == SpecialItemType.HONOR_COINS.getClientId())
{ {
player.setHonorPoints(player.getHonorPoints() - (_product.getIngredientQuantities()[i] * _amount)); player.setHonorCoins(player.getHonorCoins() - (_product.getIngredientQuantities()[i] * _amount));
} }
else else
{ {

View File

@ -80,7 +80,7 @@ public class RequestExPledgeDonationRequest implements IClientIncomingPacket
if (player.getInventory().destroyItemByItemId("pledge donation", Inventory.LCOIN_ID, 100, player, null) != null) if (player.getInventory().destroyItemByItemId("pledge donation", Inventory.LCOIN_ID, 100, player, null) != null)
{ {
clan.addExp(player.getObjectId(), 10, true); clan.addExp(player.getObjectId(), 10, true);
player.addItem("pledge donation", 95570, 100, null, true); player.setHonorCoins(player.getHonorCoins() + 100);
} }
else else
{ {
@ -100,7 +100,7 @@ public class RequestExPledgeDonationRequest implements IClientIncomingPacket
if (player.getInventory().destroyItemByItemId("pledge donation", Inventory.LCOIN_ID, 500, player, null) != null) if (player.getInventory().destroyItemByItemId("pledge donation", Inventory.LCOIN_ID, 500, player, null) != null)
{ {
clan.addExp(player.getObjectId(), 50, true); clan.addExp(player.getObjectId(), 50, true);
player.addItem("pledge donation", 95570, 500, null, true); player.setHonorCoins(player.getHonorCoins() + 500);
} }
else else
{ {
@ -127,7 +127,7 @@ public class RequestExPledgeDonationRequest implements IClientIncomingPacket
{ {
if (Rnd.get(100) < 10) if (Rnd.get(100) < 10)
{ {
player.addItem("pledge critical success: type" + type, 95570, 200, null, true); player.setHonorCoins(player.getHonorCoins() + 200);
clan.getMembers().forEach(clanMember -> clan.getMembers().forEach(clanMember ->
{ {
sendMail(clanMember.getObjectId(), 1, player.getName()); sendMail(clanMember.getObjectId(), 1, player.getName());
@ -138,7 +138,7 @@ public class RequestExPledgeDonationRequest implements IClientIncomingPacket
{ {
if (Rnd.get(100) < 5) if (Rnd.get(100) < 5)
{ {
player.addItem("pledge critical success: type" + type, 95570, 1000, null, true); player.setHonorCoins(player.getHonorCoins() + 1000);
clan.getMembers().forEach(clanMember -> clan.getMembers().forEach(clanMember ->
{ {
sendMail(clanMember.getObjectId(), 5, player.getName()); sendMail(clanMember.getObjectId(), 5, player.getName());

View File

@ -0,0 +1,42 @@
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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 org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.OutgoingPackets;
/**
* @author Mobius
*/
public class ExPledgeCoinInfo implements IClientOutgoingPacket
{
private final long _count;
public ExPledgeCoinInfo(PlayerInstance player)
{
_count = player.getHonorCoins();
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_PLEDGE_COIN_INFO.writeId(packet);
packet.writeQ(_count);
return true;
}
}