Ability points rework.
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../data/xsd/AbilityPoints.xsd">
|
|
||||||
<points from="1" to="4" costs="200000000" />
|
|
||||||
<points from="5" to="8" costs="400000000" />
|
|
||||||
<points from="9" to="12" costs="600000000" />
|
|
||||||
<points from="13" to="16" costs="800000000" />
|
|
||||||
</list>
|
|
@@ -25,7 +25,6 @@ import com.l2jmobius.Config;
|
|||||||
import com.l2jmobius.gameserver.cache.HtmCache;
|
import com.l2jmobius.gameserver.cache.HtmCache;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.TeleportLocationTable;
|
import com.l2jmobius.gameserver.data.sql.impl.TeleportLocationTable;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.AbilityPointsData;
|
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
|
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.AppearanceItemData;
|
import com.l2jmobius.gameserver.data.xml.impl.AppearanceItemData;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.ArmorSetsData;
|
import com.l2jmobius.gameserver.data.xml.impl.ArmorSetsData;
|
||||||
@@ -267,12 +266,6 @@ public class AdminReload implements IAdminCommandHandler
|
|||||||
AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded Prime Shop data.");
|
AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded Prime Shop data.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "ability":
|
|
||||||
{
|
|
||||||
AbilityPointsData.getInstance().load();
|
|
||||||
AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded ability points data.");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "appearance":
|
case "appearance":
|
||||||
{
|
{
|
||||||
AppearanceItemData.getInstance().load();
|
AppearanceItemData.getInstance().load();
|
||||||
|
@@ -25,7 +25,6 @@ import com.l2jmobius.Config;
|
|||||||
import com.l2jmobius.gameserver.cache.HtmCache;
|
import com.l2jmobius.gameserver.cache.HtmCache;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.TeleportLocationTable;
|
import com.l2jmobius.gameserver.data.sql.impl.TeleportLocationTable;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.AbilityPointsData;
|
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
|
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.AppearanceItemData;
|
import com.l2jmobius.gameserver.data.xml.impl.AppearanceItemData;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.ArmorSetsData;
|
import com.l2jmobius.gameserver.data.xml.impl.ArmorSetsData;
|
||||||
@@ -222,11 +221,6 @@ public class Reload implements ITelnetCommand
|
|||||||
ItemCrystalizationData.getInstance().load();
|
ItemCrystalizationData.getInstance().load();
|
||||||
return AdminData.getInstance().broadcastMessageToGMs("Telnet Admin: Reloaded item crystalization data.");
|
return AdminData.getInstance().broadcastMessageToGMs("Telnet Admin: Reloaded item crystalization data.");
|
||||||
}
|
}
|
||||||
case "ability":
|
|
||||||
{
|
|
||||||
AbilityPointsData.getInstance().load();
|
|
||||||
return AdminData.getInstance().broadcastMessageToGMs("Telnet Admin: Reloaded ability points data.");
|
|
||||||
}
|
|
||||||
case "appearance":
|
case "appearance":
|
||||||
{
|
{
|
||||||
AppearanceItemData.getInstance().load();
|
AppearanceItemData.getInstance().load();
|
||||||
|
@@ -39,7 +39,6 @@ import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
|
|||||||
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
|
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
|
||||||
import com.l2jmobius.gameserver.data.sql.impl.TeleportLocationTable;
|
import com.l2jmobius.gameserver.data.sql.impl.TeleportLocationTable;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.AbilityPointsData;
|
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.ActionData;
|
import com.l2jmobius.gameserver.data.xml.impl.ActionData;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
|
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.AlchemyData;
|
import com.l2jmobius.gameserver.data.xml.impl.AlchemyData;
|
||||||
@@ -207,7 +206,6 @@ public class GameServer
|
|||||||
ActionData.getInstance();
|
ActionData.getInstance();
|
||||||
CategoryData.getInstance();
|
CategoryData.getInstance();
|
||||||
SecondaryAuthData.getInstance();
|
SecondaryAuthData.getInstance();
|
||||||
AbilityPointsData.getInstance();
|
|
||||||
SayuneData.getInstance();
|
SayuneData.getInstance();
|
||||||
ClanRewardData.getInstance();
|
ClanRewardData.getInstance();
|
||||||
DailyMissionHandler.getInstance().executeScript();
|
DailyMissionHandler.getInstance().executeScript();
|
||||||
|
@@ -1,113 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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 com.l2jmobius.gameserver.data.xml.impl;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import org.w3c.dom.Document;
|
|
||||||
import org.w3c.dom.NamedNodeMap;
|
|
||||||
import org.w3c.dom.Node;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.IGameXmlReader;
|
|
||||||
import com.l2jmobius.gameserver.model.holders.RangeAbilityPointsHolder;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author UnAfraid
|
|
||||||
*/
|
|
||||||
public final class AbilityPointsData implements IGameXmlReader
|
|
||||||
{
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(AbilityPointsData.class.getName());
|
|
||||||
private final List<RangeAbilityPointsHolder> _points = new ArrayList<>();
|
|
||||||
|
|
||||||
protected AbilityPointsData()
|
|
||||||
{
|
|
||||||
load();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public synchronized void load()
|
|
||||||
{
|
|
||||||
_points.clear();
|
|
||||||
parseDatapackFile("config/AbilityPoints.xml");
|
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _points.size() + " range fees.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void parseDocument(Document doc, File f)
|
|
||||||
{
|
|
||||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
|
||||||
{
|
|
||||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("points".equalsIgnoreCase(d.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = d.getAttributes();
|
|
||||||
final int from = parseInteger(attrs, "from");
|
|
||||||
final int to = parseInteger(attrs, "to");
|
|
||||||
final int costs = parseInteger(attrs, "costs");
|
|
||||||
_points.add(new RangeAbilityPointsHolder(from, to, costs));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public RangeAbilityPointsHolder getHolder(int points)
|
|
||||||
{
|
|
||||||
for (RangeAbilityPointsHolder holder : _points)
|
|
||||||
{
|
|
||||||
if ((holder.getMin() <= points) && (holder.getMax() >= points))
|
|
||||||
{
|
|
||||||
return holder;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getPrice(int points)
|
|
||||||
{
|
|
||||||
points++; // for next point
|
|
||||||
final RangeAbilityPointsHolder holder = getHolder(points);
|
|
||||||
if (holder == null)
|
|
||||||
{
|
|
||||||
final RangeAbilityPointsHolder prevHolder = getHolder(points - 1);
|
|
||||||
if (prevHolder != null)
|
|
||||||
{
|
|
||||||
return prevHolder.getSP();
|
|
||||||
}
|
|
||||||
|
|
||||||
// No data found
|
|
||||||
return points >= 13 ? 1_000_000_000 : points >= 9 ? 750_000_000 : points >= 5 ? 500_000_000 : 250_000_000;
|
|
||||||
}
|
|
||||||
return holder.getSP();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AbilityPointsData getInstance()
|
|
||||||
{
|
|
||||||
return SingletonHolder._instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class SingletonHolder
|
|
||||||
{
|
|
||||||
protected static final AbilityPointsData _instance = new AbilityPointsData();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -13475,16 +13475,8 @@ public final class L2PcInstance extends L2Playable
|
|||||||
*/
|
*/
|
||||||
public int getAbilityPoints()
|
public int getAbilityPoints()
|
||||||
{
|
{
|
||||||
return getVariables().getInt(isDualClassActive() ? PlayerVariables.ABILITY_POINTS_DUAL_CLASS : PlayerVariables.ABILITY_POINTS_MAIN_CLASS, 0);
|
// Grand Crusade: 1 point per level after 84
|
||||||
}
|
return getLevel() - 84;
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the amount of ability points player can spend on learning skills.
|
|
||||||
* @param points
|
|
||||||
*/
|
|
||||||
public void setAbilityPoints(int points)
|
|
||||||
{
|
|
||||||
getVariables().set(isDualClassActive() ? PlayerVariables.ABILITY_POINTS_DUAL_CLASS : PlayerVariables.ABILITY_POINTS_MAIN_CLASS, points);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user