Fancy Fishing Rods bonus exp/sp calculation.
This commit is contained in:
parent
433a701b16
commit
302341b110
@ -291,7 +291,7 @@ public class Fishing
|
|||||||
// TODO: verify, totally guessed
|
// TODO: verify, totally guessed
|
||||||
final FishingData fishingData = FishingData.getInstance();
|
final FishingData fishingData = FishingData.getInstance();
|
||||||
final int lvlModifier = _player.getLevel() * _player.getLevel();
|
final int lvlModifier = _player.getLevel() * _player.getLevel();
|
||||||
_player.addExpAndSp(Rnd.get(fishingData.getExpRateMin(), fishingData.getExpRateMax()) * lvlModifier, Rnd.get(fishingData.getSpRateMin(), fishingData.getSpRateMax()) * lvlModifier);
|
_player.addExpAndSp(Rnd.get(fishingData.getExpRateMin(), fishingData.getExpRateMax()) * lvlModifier, Rnd.get(fishingData.getSpRateMin(), fishingData.getSpRateMax()) * lvlModifier, true);
|
||||||
final int fishId = baitData.getRewards().get(Rnd.get(0, numRewards - 1));
|
final int fishId = baitData.getRewards().get(Rnd.get(0, numRewards - 1));
|
||||||
_player.getInventory().addItem("Fishing Reward", fishId, 1, _player, null);
|
_player.getInventory().addItem("Fishing Reward", fishId, 1, _player, null);
|
||||||
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
|
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
|
||||||
|
@ -28,6 +28,9 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
|||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
import com.l2jmobius.gameserver.model.events.EventDispatcher;
|
import com.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLevelChanged;
|
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLevelChanged;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.type.WeaponType;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||||
@ -56,6 +59,8 @@ public class PcStat extends PlayableStat
|
|||||||
public static final int MAX_VITALITY_POINTS = 140000;
|
public static final int MAX_VITALITY_POINTS = 140000;
|
||||||
public static final int MIN_VITALITY_POINTS = 0;
|
public static final int MIN_VITALITY_POINTS = 0;
|
||||||
|
|
||||||
|
private final static int FANCY_FISHING_ROD_SKILL = 21484;
|
||||||
|
|
||||||
public PcStat(L2PcInstance activeChar)
|
public PcStat(L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
super(activeChar);
|
super(activeChar);
|
||||||
@ -110,8 +115,27 @@ public class PcStat extends PlayableStat
|
|||||||
|
|
||||||
if (useBonuses)
|
if (useBonuses)
|
||||||
{
|
{
|
||||||
bonusExp = getExpBonusMultiplier();
|
if (activeChar.isFishing())
|
||||||
bonusSp = getSpBonusMultiplier();
|
{
|
||||||
|
// rod fishing skills
|
||||||
|
final L2ItemInstance rod = activeChar.getActiveWeaponInstance();
|
||||||
|
if ((rod != null) && (rod.getItemType() == WeaponType.FISHINGROD) && (rod.getItem().getAllSkills() != null))
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder s : rod.getItem().getAllSkills())
|
||||||
|
{
|
||||||
|
if (s.getSkill().getId() == FANCY_FISHING_ROD_SKILL)
|
||||||
|
{
|
||||||
|
bonusExp *= 1.5;
|
||||||
|
bonusSp *= 1.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bonusExp = getExpBonusMultiplier();
|
||||||
|
bonusSp = getSpBonusMultiplier();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addToExp *= bonusExp;
|
addToExp *= bonusExp;
|
||||||
|
@ -291,7 +291,7 @@ public class Fishing
|
|||||||
// TODO: verify, totally guessed
|
// TODO: verify, totally guessed
|
||||||
final FishingData fishingData = FishingData.getInstance();
|
final FishingData fishingData = FishingData.getInstance();
|
||||||
final int lvlModifier = _player.getLevel() * _player.getLevel();
|
final int lvlModifier = _player.getLevel() * _player.getLevel();
|
||||||
_player.addExpAndSp(Rnd.get(fishingData.getExpRateMin(), fishingData.getExpRateMax()) * lvlModifier, Rnd.get(fishingData.getSpRateMin(), fishingData.getSpRateMax()) * lvlModifier);
|
_player.addExpAndSp(Rnd.get(fishingData.getExpRateMin(), fishingData.getExpRateMax()) * lvlModifier, Rnd.get(fishingData.getSpRateMin(), fishingData.getSpRateMax()) * lvlModifier, true);
|
||||||
final int fishId = baitData.getRewards().get(Rnd.get(0, numRewards - 1));
|
final int fishId = baitData.getRewards().get(Rnd.get(0, numRewards - 1));
|
||||||
_player.getInventory().addItem("Fishing Reward", fishId, 1, _player, null);
|
_player.getInventory().addItem("Fishing Reward", fishId, 1, _player, null);
|
||||||
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
|
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
|
||||||
|
@ -28,6 +28,9 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
|||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
import com.l2jmobius.gameserver.model.events.EventDispatcher;
|
import com.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLevelChanged;
|
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLevelChanged;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.type.WeaponType;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||||
@ -56,6 +59,8 @@ public class PcStat extends PlayableStat
|
|||||||
public static final int MAX_VITALITY_POINTS = 140000;
|
public static final int MAX_VITALITY_POINTS = 140000;
|
||||||
public static final int MIN_VITALITY_POINTS = 0;
|
public static final int MIN_VITALITY_POINTS = 0;
|
||||||
|
|
||||||
|
private final static int FANCY_FISHING_ROD_SKILL = 21484;
|
||||||
|
|
||||||
public PcStat(L2PcInstance activeChar)
|
public PcStat(L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
super(activeChar);
|
super(activeChar);
|
||||||
@ -110,8 +115,27 @@ public class PcStat extends PlayableStat
|
|||||||
|
|
||||||
if (useBonuses)
|
if (useBonuses)
|
||||||
{
|
{
|
||||||
bonusExp = getExpBonusMultiplier();
|
if (activeChar.isFishing())
|
||||||
bonusSp = getSpBonusMultiplier();
|
{
|
||||||
|
// rod fishing skills
|
||||||
|
final L2ItemInstance rod = activeChar.getActiveWeaponInstance();
|
||||||
|
if ((rod != null) && (rod.getItemType() == WeaponType.FISHINGROD) && (rod.getItem().getAllSkills() != null))
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder s : rod.getItem().getAllSkills())
|
||||||
|
{
|
||||||
|
if (s.getSkill().getId() == FANCY_FISHING_ROD_SKILL)
|
||||||
|
{
|
||||||
|
bonusExp *= 1.5;
|
||||||
|
bonusSp *= 1.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bonusExp = getExpBonusMultiplier();
|
||||||
|
bonusSp = getSpBonusMultiplier();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addToExp *= bonusExp;
|
addToExp *= bonusExp;
|
||||||
|
Loading…
Reference in New Issue
Block a user