Fishing bait rework.
This commit is contained in:
9
L2J_Mobius_Helios/dist/game/data/Fishing.xml
vendored
9
L2J_Mobius_Helios/dist/game/data/Fishing.xml
vendored
@@ -1,13 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./xsd/Fishing.xsd">
|
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./xsd/Fishing.xsd">
|
||||||
<playerLevel min="85" />
|
|
||||||
<baitDistance min="90" max="250" />
|
<baitDistance min="90" max="250" />
|
||||||
<fishingTime min="45000" max="45000" />
|
|
||||||
<fishingTimeWait min="15000" max="15000" />
|
|
||||||
<expRate min="650" max="700" />
|
<expRate min="650" max="700" />
|
||||||
<spRate min="40" max="45" />
|
<spRate min="40" max="45" />
|
||||||
<baits>
|
<baits>
|
||||||
<bait level="1" itemId="45495" chance="64"> <!-- Normal Bait -->
|
<bait itemId="45495" level="1" minPlayerLevel="85" chance="64" timeMin="45000" timeMax="45000" waitMin="15000" waitMax="15000"> <!-- Normal Bait -->
|
||||||
<catch itemId="45473" /> <!-- Fresh Blue Mackerel -->
|
<catch itemId="45473" /> <!-- Fresh Blue Mackerel -->
|
||||||
<catch itemId="45474" /> <!-- Fresh Minnow -->
|
<catch itemId="45474" /> <!-- Fresh Minnow -->
|
||||||
<catch itemId="45475" /> <!-- Fresh Flatcatch -->
|
<catch itemId="45475" /> <!-- Fresh Flatcatch -->
|
||||||
@@ -18,7 +15,7 @@
|
|||||||
<catch itemId="45480" /> <!-- Fresh Eel -->
|
<catch itemId="45480" /> <!-- Fresh Eel -->
|
||||||
<catch itemId="45486" /> <!-- Wooden Treasure Chest -->
|
<catch itemId="45486" /> <!-- Wooden Treasure Chest -->
|
||||||
</bait>
|
</bait>
|
||||||
<bait level="2" itemId="45496" chance="64"> <!-- Special Bait -->
|
<bait itemId="45496" level="2" minPlayerLevel="85" chance="64" timeMin="45000" timeMax="45000" waitMin="15000" waitMax="15000"> <!-- Special Bait -->
|
||||||
<catch itemId="45481" /> <!-- Fresh Marlin -->
|
<catch itemId="45481" /> <!-- Fresh Marlin -->
|
||||||
<catch itemId="45482" /> <!-- Fresh Catcatch -->
|
<catch itemId="45482" /> <!-- Fresh Catcatch -->
|
||||||
<catch itemId="45483" /> <!-- Fresh Tuna -->
|
<catch itemId="45483" /> <!-- Fresh Tuna -->
|
||||||
@@ -27,7 +24,7 @@
|
|||||||
<catch itemId="45487" /> <!-- Silver Treasure Chest -->
|
<catch itemId="45487" /> <!-- Silver Treasure Chest -->
|
||||||
<catch itemId="45488" /> <!-- Golden Treasure Chest -->
|
<catch itemId="45488" /> <!-- Golden Treasure Chest -->
|
||||||
</bait>
|
</bait>
|
||||||
<bait level="3" itemId="46084" chance="30"> <!-- Player Commendation Special Bait -->
|
<bait itemId="46084" level="3" minPlayerLevel="85" chance="30" timeMin="45000" timeMax="45000" waitMin="15000" waitMax="15000"> <!-- Player Commendation Special Bait -->
|
||||||
<catch itemId="46085" /> <!-- Treasure Map Piece - 1 -->
|
<catch itemId="46085" /> <!-- Treasure Map Piece - 1 -->
|
||||||
<catch itemId="46086" /> <!-- Treasure Map Piece - 2 -->
|
<catch itemId="46086" /> <!-- Treasure Map Piece - 2 -->
|
||||||
<catch itemId="46087" /> <!-- Treasure Map Piece - 3 -->
|
<catch itemId="46087" /> <!-- Treasure Map Piece - 3 -->
|
||||||
|
110
L2J_Mobius_Helios/dist/game/data/xsd/Fishing.xsd
vendored
110
L2J_Mobius_Helios/dist/game/data/xsd/Fishing.xsd
vendored
@@ -1,64 +1,52 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||||
<xs:element name="list">
|
<xs:element name="list">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="playerLevel">
|
<xs:element name="baitDistance">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
||||||
</xs:element>
|
</xs:complexType>
|
||||||
<xs:element name="baitDistance">
|
</xs:element>
|
||||||
<xs:complexType>
|
<xs:element name="expRate">
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
||||||
</xs:element>
|
</xs:complexType>
|
||||||
<xs:element name="fishingTime">
|
</xs:element>
|
||||||
<xs:complexType>
|
<xs:element name="spRate">
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:nonNegativeInteger" name="max" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
||||||
</xs:element>
|
</xs:complexType>
|
||||||
<xs:element name="fishingTimeWait">
|
</xs:element>
|
||||||
<xs:complexType>
|
<xs:element name="baits">
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:nonNegativeInteger" name="max" use="required" />
|
<xs:sequence>
|
||||||
</xs:complexType>
|
<xs:element name="bait" maxOccurs="unbounded" minOccurs="1">
|
||||||
</xs:element>
|
<xs:complexType>
|
||||||
<xs:element name="expRate">
|
<xs:sequence>
|
||||||
<xs:complexType>
|
<xs:element name="catch" maxOccurs="unbounded" minOccurs="1">
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="itemId" use="required" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="spRate">
|
</xs:sequence>
|
||||||
<xs:complexType>
|
<xs:attribute type="xs:positiveInteger" name="itemId" use="required" />
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="level" use="required" />
|
||||||
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="minPlayerLevel" use="required" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:double" name="chance" use="required" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:positiveInteger" name="timeMin" use="required" />
|
||||||
<xs:element name="baits">
|
<xs:attribute type="xs:positiveInteger" name="timeMax" use="required" />
|
||||||
<xs:complexType>
|
<xs:attribute type="xs:positiveInteger" name="waitMin" use="required" />
|
||||||
<xs:sequence>
|
<xs:attribute type="xs:positiveInteger" name="waitMax" use="required" />
|
||||||
<xs:element name="bait" maxOccurs="unbounded" minOccurs="1">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:sequence>
|
</xs:sequence>
|
||||||
<xs:element name="catch" maxOccurs="unbounded" minOccurs="1">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:attribute type="xs:positiveInteger" name="itemId" use="required" />
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
|
||||||
<xs:attribute type="xs:positiveInteger" name="level" use="required" />
|
|
||||||
<xs:attribute type="xs:positiveInteger" name="itemId" use="required" />
|
|
||||||
<xs:attribute type="xs:double" name="chance" use="required" />
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:sequence>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:sequence>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
|
@@ -36,13 +36,8 @@ public final class FishingData implements IGameXmlReader
|
|||||||
{
|
{
|
||||||
private static final Logger LOGGER = Logger.getLogger(FishingData.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(FishingData.class.getName());
|
||||||
private final Map<Integer, FishingBaitData> _baitData = new HashMap<>();
|
private final Map<Integer, FishingBaitData> _baitData = new HashMap<>();
|
||||||
private int _minPlayerLevel;
|
|
||||||
private int _baitDistanceMin;
|
private int _baitDistanceMin;
|
||||||
private int _baitDistanceMax;
|
private int _baitDistanceMax;
|
||||||
private int _fishingTimeMin;
|
|
||||||
private int _fishingTimeMax;
|
|
||||||
private int _fishingTimeWaitMin;
|
|
||||||
private int _fishingTimeWaitMax;
|
|
||||||
private int _expRateMin;
|
private int _expRateMin;
|
||||||
private int _expRateMax;
|
private int _expRateMax;
|
||||||
private int _spRateMin;
|
private int _spRateMin;
|
||||||
@@ -75,29 +70,12 @@ public final class FishingData implements IGameXmlReader
|
|||||||
{
|
{
|
||||||
switch (listItem.getNodeName())
|
switch (listItem.getNodeName())
|
||||||
{
|
{
|
||||||
case "playerLevel":
|
|
||||||
{
|
|
||||||
_minPlayerLevel = parseInteger(listItem.getAttributes(), "min");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "baitDistance":
|
case "baitDistance":
|
||||||
{
|
{
|
||||||
_baitDistanceMin = parseInteger(listItem.getAttributes(), "min");
|
_baitDistanceMin = parseInteger(listItem.getAttributes(), "min");
|
||||||
_baitDistanceMax = parseInteger(listItem.getAttributes(), "max");
|
_baitDistanceMax = parseInteger(listItem.getAttributes(), "max");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "fishingTime":
|
|
||||||
{
|
|
||||||
_fishingTimeMin = parseInteger(listItem.getAttributes(), "min");
|
|
||||||
_fishingTimeMax = parseInteger(listItem.getAttributes(), "max");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "fishingTimeWait":
|
|
||||||
{
|
|
||||||
_fishingTimeWaitMin = parseInteger(listItem.getAttributes(), "min");
|
|
||||||
_fishingTimeWaitMax = parseInteger(listItem.getAttributes(), "max");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "experienceRate":
|
case "experienceRate":
|
||||||
{
|
{
|
||||||
_expRateMin = parseInteger(listItem.getAttributes(), "min");
|
_expRateMin = parseInteger(listItem.getAttributes(), "min");
|
||||||
@@ -119,8 +97,13 @@ public final class FishingData implements IGameXmlReader
|
|||||||
final NamedNodeMap attrs = bait.getAttributes();
|
final NamedNodeMap attrs = bait.getAttributes();
|
||||||
final int itemId = parseInteger(attrs, "itemId");
|
final int itemId = parseInteger(attrs, "itemId");
|
||||||
final int level = parseInteger(attrs, "level");
|
final int level = parseInteger(attrs, "level");
|
||||||
|
final int minPlayerLevel = parseInteger(attrs, "minPlayerLevel");
|
||||||
final double chance = parseDouble(attrs, "chance");
|
final double chance = parseDouble(attrs, "chance");
|
||||||
final FishingBaitData baitData = new FishingBaitData(itemId, level, chance);
|
final int timeMin = parseInteger(attrs, "timeMin");
|
||||||
|
final int timeMax = parseInteger(attrs, "timeMax");
|
||||||
|
final int waitMin = parseInteger(attrs, "waitMin");
|
||||||
|
final int waitMax = parseInteger(attrs, "waitMax");
|
||||||
|
final FishingBaitData baitData = new FishingBaitData(itemId, level, minPlayerLevel, chance, timeMin, timeMax, waitMin, waitMax);
|
||||||
|
|
||||||
for (Node c = bait.getFirstChild(); c != null; c = c.getNextSibling())
|
for (Node c = bait.getFirstChild(); c != null; c = c.getNextSibling())
|
||||||
{
|
{
|
||||||
@@ -150,11 +133,6 @@ public final class FishingData implements IGameXmlReader
|
|||||||
return _baitData.get(baitItemId);
|
return _baitData.get(baitItemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMinPlayerLevel()
|
|
||||||
{
|
|
||||||
return _minPlayerLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getBaitDistanceMin()
|
public int getBaitDistanceMin()
|
||||||
{
|
{
|
||||||
return _baitDistanceMin;
|
return _baitDistanceMin;
|
||||||
@@ -165,26 +143,6 @@ public final class FishingData implements IGameXmlReader
|
|||||||
return _baitDistanceMax;
|
return _baitDistanceMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getFishingTimeMin()
|
|
||||||
{
|
|
||||||
return _fishingTimeMin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFishingTimeMax()
|
|
||||||
{
|
|
||||||
return _fishingTimeMax;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFishingTimeWaitMin()
|
|
||||||
{
|
|
||||||
return _fishingTimeWaitMin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFishingTimeWaitMax()
|
|
||||||
{
|
|
||||||
return _fishingTimeWaitMax;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getExpRateMin()
|
public int getExpRateMin()
|
||||||
{
|
{
|
||||||
return _expRateMin;
|
return _expRateMin;
|
||||||
|
@@ -140,15 +140,15 @@ public class Fishing
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int minPlayerLevel = FishingData.getInstance().getMinPlayerLevel();
|
final FishingBaitData baitData = getCurrentBaitData();
|
||||||
|
final int minPlayerLevel = baitData == null ? 85 : baitData.getMinPlayerLevel();
|
||||||
if (_player.getLevel() < minPlayerLevel)
|
if (_player.getLevel() < minPlayerLevel)
|
||||||
{
|
{
|
||||||
if (minPlayerLevel == 85)
|
if (minPlayerLevel == 85)
|
||||||
{
|
{
|
||||||
_player.sendPacket(SystemMessageId.FISHING_IS_AVAILABLE_TO_CHARACTERS_LV_85_OR_ABOVE);
|
_player.sendPacket(SystemMessageId.FISHING_IS_AVAILABLE_TO_CHARACTERS_LV_85_OR_ABOVE);
|
||||||
}
|
}
|
||||||
else
|
else // In case of custom fishing level.
|
||||||
// In case of custom fishing level requirement set in config.
|
|
||||||
{
|
{
|
||||||
_player.sendPacket(SystemMessageId.YOU_DO_NOT_MEET_THE_FISHING_LEVEL_REQUIREMENTS);
|
_player.sendPacket(SystemMessageId.YOU_DO_NOT_MEET_THE_FISHING_LEVEL_REQUIREMENTS);
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,6 @@ public class Fishing
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final FishingBaitData baitData = getCurrentBaitData();
|
|
||||||
if (baitData == null)
|
if (baitData == null)
|
||||||
{
|
{
|
||||||
_player.sendPacket(SystemMessageId.YOU_MUST_PUT_BAIT_ON_YOUR_HOOK_BEFORE_YOU_CAN_FISH);
|
_player.sendPacket(SystemMessageId.YOU_MUST_PUT_BAIT_ON_YOUR_HOOK_BEFORE_YOU_CAN_FISH);
|
||||||
@@ -224,8 +223,8 @@ public class Fishing
|
|||||||
_reelInTask = ThreadPoolManager.getInstance().scheduleGeneral(() ->
|
_reelInTask = ThreadPoolManager.getInstance().scheduleGeneral(() ->
|
||||||
{
|
{
|
||||||
_player.getFishing().reelInWithReward();
|
_player.getFishing().reelInWithReward();
|
||||||
_startFishingTask = ThreadPoolManager.getInstance().scheduleGeneral(() -> _player.getFishing().castLine(), Rnd.get(FishingData.getInstance().getFishingTimeWaitMin(), FishingData.getInstance().getFishingTimeWaitMax()));
|
_startFishingTask = ThreadPoolManager.getInstance().scheduleGeneral(() -> _player.getFishing().castLine(), Rnd.get(baitData.getWaitMin(), baitData.getWaitMax()));
|
||||||
}, Rnd.get(FishingData.getInstance().getFishingTimeMin(), FishingData.getInstance().getFishingTimeMax()));
|
}, Rnd.get(baitData.getTimeMin(), baitData.getTimeMax()));
|
||||||
_player.stopMove(null);
|
_player.stopMove(null);
|
||||||
_player.broadcastPacket(new ExFishingStart(_player, -1, baitData.getLevel(), _baitLocation));
|
_player.broadcastPacket(new ExFishingStart(_player, -1, baitData.getLevel(), _baitLocation));
|
||||||
_player.sendPacket(new ExUserInfoFishing(_player, true, _baitLocation));
|
_player.sendPacket(new ExUserInfoFishing(_player, true, _baitLocation));
|
||||||
|
@@ -26,14 +26,24 @@ public class FishingBaitData
|
|||||||
{
|
{
|
||||||
private final int _itemId;
|
private final int _itemId;
|
||||||
private final int _level;
|
private final int _level;
|
||||||
|
private final int _minPlayerLevel;
|
||||||
private final double _chance;
|
private final double _chance;
|
||||||
|
private final int _timeMin;
|
||||||
|
private final int _timeMax;
|
||||||
|
private final int _waitMin;
|
||||||
|
private final int _waitMax;
|
||||||
private final List<Integer> _rewards = new ArrayList<>();
|
private final List<Integer> _rewards = new ArrayList<>();
|
||||||
|
|
||||||
public FishingBaitData(int itemId, int level, double chance)
|
public FishingBaitData(int itemId, int level, int minPlayerLevel, double chance, int timeMin, int timeMax, int waitMin, int waitMax)
|
||||||
{
|
{
|
||||||
_itemId = itemId;
|
_itemId = itemId;
|
||||||
_level = level;
|
_level = level;
|
||||||
|
_minPlayerLevel = minPlayerLevel;
|
||||||
_chance = chance;
|
_chance = chance;
|
||||||
|
_timeMin = timeMin;
|
||||||
|
_timeMax = timeMax;
|
||||||
|
_waitMin = waitMin;
|
||||||
|
_waitMax = waitMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getItemId()
|
public int getItemId()
|
||||||
@@ -46,11 +56,36 @@ public class FishingBaitData
|
|||||||
return _level;
|
return _level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMinPlayerLevel()
|
||||||
|
{
|
||||||
|
return _minPlayerLevel;
|
||||||
|
}
|
||||||
|
|
||||||
public double getChance()
|
public double getChance()
|
||||||
{
|
{
|
||||||
return _chance;
|
return _chance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTimeMin()
|
||||||
|
{
|
||||||
|
return _timeMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTimeMax()
|
||||||
|
{
|
||||||
|
return _timeMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWaitMin()
|
||||||
|
{
|
||||||
|
return _waitMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWaitMax()
|
||||||
|
{
|
||||||
|
return _waitMax;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Integer> getRewards()
|
public List<Integer> getRewards()
|
||||||
{
|
{
|
||||||
return _rewards;
|
return _rewards;
|
||||||
|
@@ -1,13 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./xsd/Fishing.xsd">
|
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./xsd/Fishing.xsd">
|
||||||
<playerLevel min="85" />
|
|
||||||
<baitDistance min="90" max="250" />
|
<baitDistance min="90" max="250" />
|
||||||
<fishingTime min="45000" max="45000" />
|
|
||||||
<fishingTimeWait min="15000" max="15000" />
|
|
||||||
<expRate min="650" max="700" />
|
<expRate min="650" max="700" />
|
||||||
<spRate min="40" max="45" />
|
<spRate min="40" max="45" />
|
||||||
<baits>
|
<baits>
|
||||||
<bait level="1" itemId="45495" chance="64"> <!-- Normal Bait -->
|
<bait itemId="45495" level="1" minPlayerLevel="85" chance="64" timeMin="45000" timeMax="45000" waitMin="15000" waitMax="15000"> <!-- Normal Bait -->
|
||||||
<catch itemId="45473" /> <!-- Fresh Blue Mackerel -->
|
<catch itemId="45473" /> <!-- Fresh Blue Mackerel -->
|
||||||
<catch itemId="45474" /> <!-- Fresh Minnow -->
|
<catch itemId="45474" /> <!-- Fresh Minnow -->
|
||||||
<catch itemId="45475" /> <!-- Fresh Flatcatch -->
|
<catch itemId="45475" /> <!-- Fresh Flatcatch -->
|
||||||
@@ -18,7 +15,7 @@
|
|||||||
<catch itemId="45480" /> <!-- Fresh Eel -->
|
<catch itemId="45480" /> <!-- Fresh Eel -->
|
||||||
<catch itemId="45486" /> <!-- Wooden Treasure Chest -->
|
<catch itemId="45486" /> <!-- Wooden Treasure Chest -->
|
||||||
</bait>
|
</bait>
|
||||||
<bait level="2" itemId="45496" chance="64"> <!-- Special Bait -->
|
<bait itemId="45496" level="2" minPlayerLevel="85" chance="64" timeMin="45000" timeMax="45000" waitMin="15000" waitMax="15000"> <!-- Special Bait -->
|
||||||
<catch itemId="45481" /> <!-- Fresh Marlin -->
|
<catch itemId="45481" /> <!-- Fresh Marlin -->
|
||||||
<catch itemId="45482" /> <!-- Fresh Catcatch -->
|
<catch itemId="45482" /> <!-- Fresh Catcatch -->
|
||||||
<catch itemId="45483" /> <!-- Fresh Tuna -->
|
<catch itemId="45483" /> <!-- Fresh Tuna -->
|
||||||
@@ -27,7 +24,7 @@
|
|||||||
<catch itemId="45487" /> <!-- Silver Treasure Chest -->
|
<catch itemId="45487" /> <!-- Silver Treasure Chest -->
|
||||||
<catch itemId="45488" /> <!-- Golden Treasure Chest -->
|
<catch itemId="45488" /> <!-- Golden Treasure Chest -->
|
||||||
</bait>
|
</bait>
|
||||||
<bait level="3" itemId="46084" chance="30"> <!-- Player Commendation Special Bait -->
|
<bait itemId="46084" level="3" minPlayerLevel="85" chance="30" timeMin="45000" timeMax="45000" waitMin="15000" waitMax="15000"> <!-- Player Commendation Special Bait -->
|
||||||
<catch itemId="46085" /> <!-- Treasure Map Piece - 1 -->
|
<catch itemId="46085" /> <!-- Treasure Map Piece - 1 -->
|
||||||
<catch itemId="46086" /> <!-- Treasure Map Piece - 2 -->
|
<catch itemId="46086" /> <!-- Treasure Map Piece - 2 -->
|
||||||
<catch itemId="46087" /> <!-- Treasure Map Piece - 3 -->
|
<catch itemId="46087" /> <!-- Treasure Map Piece - 3 -->
|
||||||
|
@@ -1,64 +1,52 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||||
<xs:element name="list">
|
<xs:element name="list">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="playerLevel">
|
<xs:element name="baitDistance">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
||||||
</xs:element>
|
</xs:complexType>
|
||||||
<xs:element name="baitDistance">
|
</xs:element>
|
||||||
<xs:complexType>
|
<xs:element name="expRate">
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
||||||
</xs:element>
|
</xs:complexType>
|
||||||
<xs:element name="fishingTime">
|
</xs:element>
|
||||||
<xs:complexType>
|
<xs:element name="spRate">
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:nonNegativeInteger" name="max" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
||||||
</xs:element>
|
</xs:complexType>
|
||||||
<xs:element name="fishingTimeWait">
|
</xs:element>
|
||||||
<xs:complexType>
|
<xs:element name="baits">
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:nonNegativeInteger" name="max" use="required" />
|
<xs:sequence>
|
||||||
</xs:complexType>
|
<xs:element name="bait" maxOccurs="unbounded" minOccurs="1">
|
||||||
</xs:element>
|
<xs:complexType>
|
||||||
<xs:element name="expRate">
|
<xs:sequence>
|
||||||
<xs:complexType>
|
<xs:element name="catch" maxOccurs="unbounded" minOccurs="1">
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="itemId" use="required" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="spRate">
|
</xs:sequence>
|
||||||
<xs:complexType>
|
<xs:attribute type="xs:positiveInteger" name="itemId" use="required" />
|
||||||
<xs:attribute type="xs:positiveInteger" name="min" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="level" use="required" />
|
||||||
<xs:attribute type="xs:positiveInteger" name="max" use="required" />
|
<xs:attribute type="xs:positiveInteger" name="minPlayerLevel" use="required" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:double" name="chance" use="required" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:positiveInteger" name="timeMin" use="required" />
|
||||||
<xs:element name="baits">
|
<xs:attribute type="xs:positiveInteger" name="timeMax" use="required" />
|
||||||
<xs:complexType>
|
<xs:attribute type="xs:positiveInteger" name="waitMin" use="required" />
|
||||||
<xs:sequence>
|
<xs:attribute type="xs:positiveInteger" name="waitMax" use="required" />
|
||||||
<xs:element name="bait" maxOccurs="unbounded" minOccurs="1">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:sequence>
|
</xs:sequence>
|
||||||
<xs:element name="catch" maxOccurs="unbounded" minOccurs="1">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:attribute type="xs:positiveInteger" name="itemId" use="required" />
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
|
||||||
<xs:attribute type="xs:positiveInteger" name="level" use="required" />
|
|
||||||
<xs:attribute type="xs:positiveInteger" name="itemId" use="required" />
|
|
||||||
<xs:attribute type="xs:double" name="chance" use="required" />
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:sequence>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:sequence>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
|
@@ -36,13 +36,8 @@ public final class FishingData implements IGameXmlReader
|
|||||||
{
|
{
|
||||||
private static final Logger LOGGER = Logger.getLogger(FishingData.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(FishingData.class.getName());
|
||||||
private final Map<Integer, FishingBaitData> _baitData = new HashMap<>();
|
private final Map<Integer, FishingBaitData> _baitData = new HashMap<>();
|
||||||
private int _minPlayerLevel;
|
|
||||||
private int _baitDistanceMin;
|
private int _baitDistanceMin;
|
||||||
private int _baitDistanceMax;
|
private int _baitDistanceMax;
|
||||||
private int _fishingTimeMin;
|
|
||||||
private int _fishingTimeMax;
|
|
||||||
private int _fishingTimeWaitMin;
|
|
||||||
private int _fishingTimeWaitMax;
|
|
||||||
private int _expRateMin;
|
private int _expRateMin;
|
||||||
private int _expRateMax;
|
private int _expRateMax;
|
||||||
private int _spRateMin;
|
private int _spRateMin;
|
||||||
@@ -75,29 +70,12 @@ public final class FishingData implements IGameXmlReader
|
|||||||
{
|
{
|
||||||
switch (listItem.getNodeName())
|
switch (listItem.getNodeName())
|
||||||
{
|
{
|
||||||
case "playerLevel":
|
|
||||||
{
|
|
||||||
_minPlayerLevel = parseInteger(listItem.getAttributes(), "min");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "baitDistance":
|
case "baitDistance":
|
||||||
{
|
{
|
||||||
_baitDistanceMin = parseInteger(listItem.getAttributes(), "min");
|
_baitDistanceMin = parseInteger(listItem.getAttributes(), "min");
|
||||||
_baitDistanceMax = parseInteger(listItem.getAttributes(), "max");
|
_baitDistanceMax = parseInteger(listItem.getAttributes(), "max");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "fishingTime":
|
|
||||||
{
|
|
||||||
_fishingTimeMin = parseInteger(listItem.getAttributes(), "min");
|
|
||||||
_fishingTimeMax = parseInteger(listItem.getAttributes(), "max");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "fishingTimeWait":
|
|
||||||
{
|
|
||||||
_fishingTimeWaitMin = parseInteger(listItem.getAttributes(), "min");
|
|
||||||
_fishingTimeWaitMax = parseInteger(listItem.getAttributes(), "max");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "experienceRate":
|
case "experienceRate":
|
||||||
{
|
{
|
||||||
_expRateMin = parseInteger(listItem.getAttributes(), "min");
|
_expRateMin = parseInteger(listItem.getAttributes(), "min");
|
||||||
@@ -119,8 +97,13 @@ public final class FishingData implements IGameXmlReader
|
|||||||
final NamedNodeMap attrs = bait.getAttributes();
|
final NamedNodeMap attrs = bait.getAttributes();
|
||||||
final int itemId = parseInteger(attrs, "itemId");
|
final int itemId = parseInteger(attrs, "itemId");
|
||||||
final int level = parseInteger(attrs, "level");
|
final int level = parseInteger(attrs, "level");
|
||||||
|
final int minPlayerLevel = parseInteger(attrs, "minPlayerLevel");
|
||||||
final double chance = parseDouble(attrs, "chance");
|
final double chance = parseDouble(attrs, "chance");
|
||||||
final FishingBaitData baitData = new FishingBaitData(itemId, level, chance);
|
final int timeMin = parseInteger(attrs, "timeMin");
|
||||||
|
final int timeMax = parseInteger(attrs, "timeMax");
|
||||||
|
final int waitMin = parseInteger(attrs, "waitMin");
|
||||||
|
final int waitMax = parseInteger(attrs, "waitMax");
|
||||||
|
final FishingBaitData baitData = new FishingBaitData(itemId, level, minPlayerLevel, chance, timeMin, timeMax, waitMin, waitMax);
|
||||||
|
|
||||||
for (Node c = bait.getFirstChild(); c != null; c = c.getNextSibling())
|
for (Node c = bait.getFirstChild(); c != null; c = c.getNextSibling())
|
||||||
{
|
{
|
||||||
@@ -150,11 +133,6 @@ public final class FishingData implements IGameXmlReader
|
|||||||
return _baitData.get(baitItemId);
|
return _baitData.get(baitItemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMinPlayerLevel()
|
|
||||||
{
|
|
||||||
return _minPlayerLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getBaitDistanceMin()
|
public int getBaitDistanceMin()
|
||||||
{
|
{
|
||||||
return _baitDistanceMin;
|
return _baitDistanceMin;
|
||||||
@@ -165,26 +143,6 @@ public final class FishingData implements IGameXmlReader
|
|||||||
return _baitDistanceMax;
|
return _baitDistanceMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getFishingTimeMin()
|
|
||||||
{
|
|
||||||
return _fishingTimeMin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFishingTimeMax()
|
|
||||||
{
|
|
||||||
return _fishingTimeMax;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFishingTimeWaitMin()
|
|
||||||
{
|
|
||||||
return _fishingTimeWaitMin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFishingTimeWaitMax()
|
|
||||||
{
|
|
||||||
return _fishingTimeWaitMax;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getExpRateMin()
|
public int getExpRateMin()
|
||||||
{
|
{
|
||||||
return _expRateMin;
|
return _expRateMin;
|
||||||
|
@@ -140,15 +140,15 @@ public class Fishing
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int minPlayerLevel = FishingData.getInstance().getMinPlayerLevel();
|
final FishingBaitData baitData = getCurrentBaitData();
|
||||||
|
final int minPlayerLevel = baitData == null ? 85 : baitData.getMinPlayerLevel();
|
||||||
if (_player.getLevel() < minPlayerLevel)
|
if (_player.getLevel() < minPlayerLevel)
|
||||||
{
|
{
|
||||||
if (minPlayerLevel == 85)
|
if (minPlayerLevel == 85)
|
||||||
{
|
{
|
||||||
_player.sendPacket(SystemMessageId.FISHING_IS_AVAILABLE_TO_CHARACTERS_LV_85_OR_ABOVE);
|
_player.sendPacket(SystemMessageId.FISHING_IS_AVAILABLE_TO_CHARACTERS_LV_85_OR_ABOVE);
|
||||||
}
|
}
|
||||||
else
|
else // In case of custom fishing level.
|
||||||
// In case of custom fishing level requirement set in config.
|
|
||||||
{
|
{
|
||||||
_player.sendPacket(SystemMessageId.YOU_DO_NOT_MEET_THE_FISHING_LEVEL_REQUIREMENTS);
|
_player.sendPacket(SystemMessageId.YOU_DO_NOT_MEET_THE_FISHING_LEVEL_REQUIREMENTS);
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,6 @@ public class Fishing
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final FishingBaitData baitData = getCurrentBaitData();
|
|
||||||
if (baitData == null)
|
if (baitData == null)
|
||||||
{
|
{
|
||||||
_player.sendPacket(SystemMessageId.YOU_MUST_PUT_BAIT_ON_YOUR_HOOK_BEFORE_YOU_CAN_FISH);
|
_player.sendPacket(SystemMessageId.YOU_MUST_PUT_BAIT_ON_YOUR_HOOK_BEFORE_YOU_CAN_FISH);
|
||||||
@@ -224,8 +223,8 @@ public class Fishing
|
|||||||
_reelInTask = ThreadPoolManager.getInstance().scheduleGeneral(() ->
|
_reelInTask = ThreadPoolManager.getInstance().scheduleGeneral(() ->
|
||||||
{
|
{
|
||||||
_player.getFishing().reelInWithReward();
|
_player.getFishing().reelInWithReward();
|
||||||
_startFishingTask = ThreadPoolManager.getInstance().scheduleGeneral(() -> _player.getFishing().castLine(), Rnd.get(FishingData.getInstance().getFishingTimeWaitMin(), FishingData.getInstance().getFishingTimeWaitMax()));
|
_startFishingTask = ThreadPoolManager.getInstance().scheduleGeneral(() -> _player.getFishing().castLine(), Rnd.get(baitData.getWaitMin(), baitData.getWaitMax()));
|
||||||
}, Rnd.get(FishingData.getInstance().getFishingTimeMin(), FishingData.getInstance().getFishingTimeMax()));
|
}, Rnd.get(baitData.getTimeMin(), baitData.getTimeMax()));
|
||||||
_player.stopMove(null);
|
_player.stopMove(null);
|
||||||
_player.broadcastPacket(new ExFishingStart(_player, -1, baitData.getLevel(), _baitLocation));
|
_player.broadcastPacket(new ExFishingStart(_player, -1, baitData.getLevel(), _baitLocation));
|
||||||
_player.sendPacket(new ExUserInfoFishing(_player, true, _baitLocation));
|
_player.sendPacket(new ExUserInfoFishing(_player, true, _baitLocation));
|
||||||
|
@@ -26,14 +26,24 @@ public class FishingBaitData
|
|||||||
{
|
{
|
||||||
private final int _itemId;
|
private final int _itemId;
|
||||||
private final int _level;
|
private final int _level;
|
||||||
|
private final int _minPlayerLevel;
|
||||||
private final double _chance;
|
private final double _chance;
|
||||||
|
private final int _timeMin;
|
||||||
|
private final int _timeMax;
|
||||||
|
private final int _waitMin;
|
||||||
|
private final int _waitMax;
|
||||||
private final List<Integer> _rewards = new ArrayList<>();
|
private final List<Integer> _rewards = new ArrayList<>();
|
||||||
|
|
||||||
public FishingBaitData(int itemId, int level, double chance)
|
public FishingBaitData(int itemId, int level, int minPlayerLevel, double chance, int timeMin, int timeMax, int waitMin, int waitMax)
|
||||||
{
|
{
|
||||||
_itemId = itemId;
|
_itemId = itemId;
|
||||||
_level = level;
|
_level = level;
|
||||||
|
_minPlayerLevel = minPlayerLevel;
|
||||||
_chance = chance;
|
_chance = chance;
|
||||||
|
_timeMin = timeMin;
|
||||||
|
_timeMax = timeMax;
|
||||||
|
_waitMin = waitMin;
|
||||||
|
_waitMax = waitMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getItemId()
|
public int getItemId()
|
||||||
@@ -46,11 +56,36 @@ public class FishingBaitData
|
|||||||
return _level;
|
return _level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMinPlayerLevel()
|
||||||
|
{
|
||||||
|
return _minPlayerLevel;
|
||||||
|
}
|
||||||
|
|
||||||
public double getChance()
|
public double getChance()
|
||||||
{
|
{
|
||||||
return _chance;
|
return _chance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTimeMin()
|
||||||
|
{
|
||||||
|
return _timeMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTimeMax()
|
||||||
|
{
|
||||||
|
return _timeMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWaitMin()
|
||||||
|
{
|
||||||
|
return _waitMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWaitMax()
|
||||||
|
{
|
||||||
|
return _waitMax;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Integer> getRewards()
|
public List<Integer> getRewards()
|
||||||
{
|
{
|
||||||
return _rewards;
|
return _rewards;
|
||||||
|
Reference in New Issue
Block a user