Support for honor points.
This commit is contained in:
parent
c9e2128873
commit
45c02973b7
@ -25,7 +25,8 @@ public enum SpecialItemType
|
|||||||
CLAN_REPUTATION(-200),
|
CLAN_REPUTATION(-200),
|
||||||
FAME(-300),
|
FAME(-300),
|
||||||
FIELD_CYCLE_POINTS(-400),
|
FIELD_CYCLE_POINTS(-400),
|
||||||
RAIDBOSS_POINTS(-500);
|
RAIDBOSS_POINTS(-500),
|
||||||
|
HONOR_POINTS(-700);
|
||||||
|
|
||||||
private int _clientId;
|
private int _clientId;
|
||||||
|
|
||||||
|
@ -12916,6 +12916,16 @@ 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()
|
||||||
|
{
|
||||||
|
return getVariables().getLong("HONOR_POINTS", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHonorPoints(long value)
|
||||||
|
{
|
||||||
|
getVariables().set("HONOR_POINTS", value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check all player skills for skill level. If player level is lower than skill learn level - 9, skill level is decreased to next possible level.
|
* Check all player skills for skill level. If player level is lower than skill learn level - 9, skill level is decreased to next possible level.
|
||||||
*/
|
*/
|
||||||
|
@ -359,6 +359,10 @@ public class TeleportHolder
|
|||||||
{
|
{
|
||||||
return "Raid Points";
|
return "Raid Points";
|
||||||
}
|
}
|
||||||
|
case HONOR_POINTS:
|
||||||
|
{
|
||||||
|
return "Honor Points";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "Unknown item: " + itemId;
|
return "Unknown item: " + itemId;
|
||||||
|
@ -218,7 +218,6 @@ public class MultiSellChoose implements IClientIncomingPacket
|
|||||||
player.sendPacket(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER_AND_CANNOT_PERFORM_THIS_ACTION);
|
player.sendPacket(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER_AND_CANNOT_PERFORM_THIS_ACTION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,6 +365,11 @@ 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:
|
||||||
|
{
|
||||||
|
player.setHonorPoints(player.getHonorPoints() - totalCount);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
LOGGER.severe("Character: " + player.getName() + " has suffered possible item loss by using multisell " + _listId + " which has non-implemented special ingredient with id: " + ingredient.getId() + ".");
|
LOGGER.severe("Character: " + player.getName() + " has suffered possible item loss by using multisell " + _listId + " which has non-implemented special ingredient with id: " + ingredient.getId() + ".");
|
||||||
@ -464,6 +468,11 @@ public class MultiSellChoose implements IClientIncomingPacket
|
|||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case HONOR_POINTS:
|
||||||
|
{
|
||||||
|
player.setHonorPoints(player.getHonorPoints() + totalCount);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
LOGGER.severe("Character: " + player.getName() + " has suffered possible item loss by using multisell " + _listId + " which has non-implemented special product with id: " + product.getId() + ".");
|
LOGGER.severe("Character: " + player.getName() + " has suffered possible item loss by using multisell " + _listId + " which has non-implemented special product with id: " + product.getId() + ".");
|
||||||
@ -656,6 +665,15 @@ public class MultiSellChoose implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
case HONOR_POINTS:
|
||||||
|
{
|
||||||
|
if (player.getHonorPoints() < totalCount)
|
||||||
|
{
|
||||||
|
player.sendMessage("You are short of Honor Points.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
LOGGER.severe("Multisell: " + _listId + " is using a non-implemented special ingredient with id: " + ingredientId + ".");
|
LOGGER.severe("Multisell: " + _listId + " is using a non-implemented special ingredient with id: " + ingredientId + ".");
|
||||||
|
@ -25,7 +25,8 @@ public enum SpecialItemType
|
|||||||
CLAN_REPUTATION(-200),
|
CLAN_REPUTATION(-200),
|
||||||
FAME(-300),
|
FAME(-300),
|
||||||
FIELD_CYCLE_POINTS(-400),
|
FIELD_CYCLE_POINTS(-400),
|
||||||
RAIDBOSS_POINTS(-500);
|
RAIDBOSS_POINTS(-500),
|
||||||
|
HONOR_POINTS(-700);
|
||||||
|
|
||||||
private int _clientId;
|
private int _clientId;
|
||||||
|
|
||||||
|
@ -12874,6 +12874,16 @@ 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()
|
||||||
|
{
|
||||||
|
return getVariables().getLong("HONOR_POINTS", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHonorPoints(long value)
|
||||||
|
{
|
||||||
|
getVariables().set("HONOR_POINTS", value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check all player skills for skill level. If player level is lower than skill learn level - 9, skill level is decreased to next possible level.
|
* Check all player skills for skill level. If player level is lower than skill learn level - 9, skill level is decreased to next possible level.
|
||||||
*/
|
*/
|
||||||
|
@ -359,6 +359,10 @@ public class TeleportHolder
|
|||||||
{
|
{
|
||||||
return "Raid Points";
|
return "Raid Points";
|
||||||
}
|
}
|
||||||
|
case HONOR_POINTS:
|
||||||
|
{
|
||||||
|
return "Honor Points";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "Unknown item: " + itemId;
|
return "Unknown item: " + itemId;
|
||||||
|
@ -218,7 +218,6 @@ public class MultiSellChoose implements IClientIncomingPacket
|
|||||||
player.sendPacket(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER_AND_CANNOT_PERFORM_THIS_ACTION);
|
player.sendPacket(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER_AND_CANNOT_PERFORM_THIS_ACTION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,6 +365,11 @@ 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:
|
||||||
|
{
|
||||||
|
player.setHonorPoints(player.getHonorPoints() - totalCount);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
LOGGER.severe("Character: " + player.getName() + " has suffered possible item loss by using multisell " + _listId + " which has non-implemented special ingredient with id: " + ingredient.getId() + ".");
|
LOGGER.severe("Character: " + player.getName() + " has suffered possible item loss by using multisell " + _listId + " which has non-implemented special ingredient with id: " + ingredient.getId() + ".");
|
||||||
@ -464,6 +468,11 @@ public class MultiSellChoose implements IClientIncomingPacket
|
|||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case HONOR_POINTS:
|
||||||
|
{
|
||||||
|
player.setHonorPoints(player.getHonorPoints() + totalCount);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
LOGGER.severe("Character: " + player.getName() + " has suffered possible item loss by using multisell " + _listId + " which has non-implemented special product with id: " + product.getId() + ".");
|
LOGGER.severe("Character: " + player.getName() + " has suffered possible item loss by using multisell " + _listId + " which has non-implemented special product with id: " + product.getId() + ".");
|
||||||
@ -656,6 +665,15 @@ public class MultiSellChoose implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
case HONOR_POINTS:
|
||||||
|
{
|
||||||
|
if (player.getHonorPoints() < totalCount)
|
||||||
|
{
|
||||||
|
player.sendMessage("You are short of Honor Points.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
LOGGER.severe("Multisell: " + _listId + " is using a non-implemented special ingredient with id: " + ingredientId + ".");
|
LOGGER.severe("Multisell: " + _listId + " is using a non-implemented special ingredient with id: " + ingredientId + ".");
|
||||||
|
@ -20,6 +20,7 @@ import org.l2jmobius.commons.network.PacketReader;
|
|||||||
import org.l2jmobius.commons.util.Chronos;
|
import org.l2jmobius.commons.util.Chronos;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.data.xml.LCoinShopData;
|
import org.l2jmobius.gameserver.data.xml.LCoinShopData;
|
||||||
|
import org.l2jmobius.gameserver.enums.SpecialItemType;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest;
|
import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest;
|
||||||
import org.l2jmobius.gameserver.model.holders.LCoinShopProductHolder;
|
import org.l2jmobius.gameserver.model.holders.LCoinShopProductHolder;
|
||||||
@ -124,6 +125,15 @@ public class RequestPurchaseLimitShopItemBuy implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (product.getIngredientIds()[i] == SpecialItemType.HONOR_POINTS.getClientId())
|
||||||
|
{
|
||||||
|
if (player.getHonorPoints() < (product.getIngredientQuantities()[i] * _amount))
|
||||||
|
{
|
||||||
|
player.sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT_2);
|
||||||
|
player.removeRequest(PrimeShopRequest.class);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (player.getInventory().getInventoryItemCount(product.getIngredientIds()[i], -1, true) < (product.getIngredientQuantities()[i] * _amount))
|
else if (player.getInventory().getInventoryItemCount(product.getIngredientIds()[i], -1, true) < (product.getIngredientQuantities()[i] * _amount))
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT_2);
|
player.sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT_2);
|
||||||
@ -143,6 +153,10 @@ 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())
|
||||||
|
{
|
||||||
|
player.setHonorPoints(player.getHonorPoints() - (product.getIngredientQuantities()[i] * _amount));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.destroyItemByItemId("LCoinShop", product.getIngredientIds()[i], product.getIngredientQuantities()[i] * _amount, player, true);
|
player.destroyItemByItemId("LCoinShop", product.getIngredientIds()[i], product.getIngredientQuantities()[i] * _amount, player, true);
|
||||||
|
@ -54,6 +54,7 @@ public class ExPurchaseLimitShopItemListNew implements IClientOutgoingPacket
|
|||||||
_products = LCoinShopSpecialCraftData.getInstance().getProducts();
|
_products = LCoinShopSpecialCraftData.getInstance().getProducts();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 100: // Clan Shop
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
_products = LCoinShopData.getInstance().getProducts();
|
_products = LCoinShopData.getInstance().getProducts();
|
||||||
|
Loading…
Reference in New Issue
Block a user