Addition of BonusExpType enumeration.
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@@ -38,11 +39,27 @@ public class ExpModify extends AbstractStatAddEffect
|
|||||||
{
|
{
|
||||||
effected.getStat().mergeAdd(Stat.BONUS_EXP, _amount);
|
effected.getStat().mergeAdd(Stat.BONUS_EXP, _amount);
|
||||||
|
|
||||||
// Send exp bonus to player.
|
if (skill != null)
|
||||||
|
{
|
||||||
|
if (skill.isActive())
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.ACTIVE_BONUS_EXP, _amount);
|
||||||
|
effected.getStat().mergeAdd(Stat.BONUS_EXP_BUFFS, 1);
|
||||||
final PlayerInstance player = effected.getActingPlayer();
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExUserBoostStat(player));
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.BONUS_EXP_PASSIVES, 1);
|
||||||
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@@ -38,11 +39,14 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
|||||||
{
|
{
|
||||||
effected.getStat().mergeMul(Stat.VITALITY_EXP_RATE, (_amount / 100) + 1);
|
effected.getStat().mergeMul(Stat.VITALITY_EXP_RATE, (_amount / 100) + 1);
|
||||||
|
|
||||||
// Send exp bonus to player.
|
if (skill != null)
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.VITALITY_SKILLS, 1);
|
||||||
final PlayerInstance player = effected.getActingPlayer();
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExUserBoostStat(player));
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* 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.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public enum BonusExpType
|
||||||
|
{
|
||||||
|
VITALITY(1),
|
||||||
|
BUFFS(2),
|
||||||
|
PASSIVE(3);
|
||||||
|
|
||||||
|
private int _id;
|
||||||
|
|
||||||
|
private BonusExpType(int id)
|
||||||
|
{
|
||||||
|
_id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId()
|
||||||
|
{
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -144,6 +144,9 @@ public enum Stat
|
|||||||
DEFENCE_CRITICAL_DAMAGE_SKILL_ADD("defCAtkSkillAdd"),
|
DEFENCE_CRITICAL_DAMAGE_SKILL_ADD("defCAtkSkillAdd"),
|
||||||
INSTANT_KILL_RESIST("instantKillResist"),
|
INSTANT_KILL_RESIST("instantKillResist"),
|
||||||
EXPSP_RATE("rExp"),
|
EXPSP_RATE("rExp"),
|
||||||
|
ACTIVE_BONUS_EXP("activeBonusExp"), // Used to measure active skill bonus exp.
|
||||||
|
BONUS_EXP_BUFFS("bonusExpBuffs"), // Used to count active skill exp.
|
||||||
|
BONUS_EXP_PASSIVES("bonusExpPassives"), // Used to count passive skill exp.
|
||||||
BONUS_EXP("bonusExp"),
|
BONUS_EXP("bonusExp"),
|
||||||
BONUS_SP("bonusSp"),
|
BONUS_SP("bonusSp"),
|
||||||
BONUS_DROP_ADENA("bonusDropAdena"),
|
BONUS_DROP_ADENA("bonusDropAdena"),
|
||||||
@@ -251,6 +254,7 @@ public enum Stat
|
|||||||
// Vitality
|
// Vitality
|
||||||
VITALITY_CONSUME_RATE("vitalityConsumeRate"),
|
VITALITY_CONSUME_RATE("vitalityConsumeRate"),
|
||||||
VITALITY_EXP_RATE("vitalityExpRate"),
|
VITALITY_EXP_RATE("vitalityExpRate"),
|
||||||
|
VITALITY_SKILLS("vitalitySkills"), // Used to count vitality skill bonuses.
|
||||||
|
|
||||||
// Souls
|
// Souls
|
||||||
MAX_SOULS("maxSouls"),
|
MAX_SOULS("maxSouls"),
|
||||||
|
|||||||
@@ -19,12 +19,14 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Summon;
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.skills.AbnormalType;
|
import org.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author KenM
|
* @author KenM
|
||||||
@@ -78,6 +80,8 @@ public class RequestDispel implements IClientIncomingPacket
|
|||||||
if (player.getObjectId() == _objectId)
|
if (player.getObjectId() == _objectId)
|
||||||
{
|
{
|
||||||
player.stopSkillEffects(SkillFinishType.REMOVED, _skillId);
|
player.stopSkillEffects(SkillFinishType.REMOVED, _skillId);
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, skill.isActive() ? BonusExpType.BUFFS : BonusExpType.PASSIVE));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package org.l2jmobius.gameserver.network.serverpackets;
|
package org.l2jmobius.gameserver.network.serverpackets;
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
@@ -27,10 +28,12 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
|
|||||||
public class ExUserBoostStat implements IClientOutgoingPacket
|
public class ExUserBoostStat implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private final PlayerInstance _player;
|
private final PlayerInstance _player;
|
||||||
|
private final BonusExpType _type;
|
||||||
|
|
||||||
public ExUserBoostStat(PlayerInstance player)
|
public ExUserBoostStat(PlayerInstance player, BonusExpType type)
|
||||||
{
|
{
|
||||||
_player = player;
|
_player = player;
|
||||||
|
_type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -38,29 +41,57 @@ public class ExUserBoostStat implements IClientOutgoingPacket
|
|||||||
{
|
{
|
||||||
OutgoingPackets.EX_USER_BOOST_STAT.writeId(packet);
|
OutgoingPackets.EX_USER_BOOST_STAT.writeId(packet);
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
int bonus = 0;
|
||||||
|
switch (_type)
|
||||||
|
{
|
||||||
|
case VITALITY:
|
||||||
|
{
|
||||||
final int currentVitalityPoints = _player.getStat().getVitalityPoints();
|
final int currentVitalityPoints = _player.getStat().getVitalityPoints();
|
||||||
int vitalityBonus = 0;
|
|
||||||
if (currentVitalityPoints > 105000)
|
if (currentVitalityPoints > 105000)
|
||||||
{
|
{
|
||||||
vitalityBonus = 300;
|
count = 1;
|
||||||
|
bonus = 300;
|
||||||
}
|
}
|
||||||
else if (currentVitalityPoints > 70000)
|
else if (currentVitalityPoints > 70000)
|
||||||
{
|
{
|
||||||
vitalityBonus = 250;
|
count = 1;
|
||||||
|
bonus = 250;
|
||||||
}
|
}
|
||||||
else if (currentVitalityPoints > 35000)
|
else if (currentVitalityPoints > 35000)
|
||||||
{
|
{
|
||||||
vitalityBonus = 200;
|
count = 1;
|
||||||
|
bonus = 200;
|
||||||
}
|
}
|
||||||
else if (currentVitalityPoints > 0)
|
else if (currentVitalityPoints > 0)
|
||||||
{
|
{
|
||||||
vitalityBonus = 150;
|
count = 1;
|
||||||
|
bonus = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
// final int bonus = (int) (_player.getStat().getExpBonusMultiplier() * 100);
|
if (bonus > 0)
|
||||||
final int bonus = (int) (_player.getStat().getValue(Stat.BONUS_EXP, 0) + vitalityBonus);
|
{
|
||||||
packet.writeC(bonus > 0 ? 2 : 0);
|
count += (int) _player.getStat().getValue(Stat.VITALITY_SKILLS, 0);
|
||||||
packet.writeC(bonus > 0 ? 2 : 0);
|
bonus += (int) ((_player.getStat().getMul(Stat.VITALITY_EXP_RATE, 1) - 1) * 100);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BUFFS:
|
||||||
|
{
|
||||||
|
count = (int) _player.getStat().getValue(Stat.BONUS_EXP_BUFFS, 0);
|
||||||
|
bonus = (int) _player.getStat().getValue(Stat.ACTIVE_BONUS_EXP, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PASSIVE:
|
||||||
|
{
|
||||||
|
count = (int) _player.getStat().getValue(Stat.BONUS_EXP_PASSIVES, 0);
|
||||||
|
bonus = (int) (_player.getStat().getValue(Stat.BONUS_EXP, 0) - _player.getStat().getValue(Stat.ACTIVE_BONUS_EXP, 0));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
packet.writeC(_type.getId());
|
||||||
|
packet.writeC(count);
|
||||||
packet.writeH(bonus);
|
packet.writeH(bonus);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.l2jmobius.Config;
|
|||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.ClassId;
|
import org.l2jmobius.gameserver.enums.ClassId;
|
||||||
import org.l2jmobius.gameserver.enums.ItemGrade;
|
import org.l2jmobius.gameserver.enums.ItemGrade;
|
||||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||||
@@ -460,7 +461,9 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
|||||||
// Send exp bonus change.
|
// Send exp bonus change.
|
||||||
if (containsMask(UserInfoType.VITA_FAME))
|
if (containsMask(UserInfoType.VITA_FAME))
|
||||||
{
|
{
|
||||||
_player.sendPacket(new ExUserBoostStat(_player));
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
||||||
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
||||||
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@@ -38,11 +39,27 @@ public class ExpModify extends AbstractStatAddEffect
|
|||||||
{
|
{
|
||||||
effected.getStat().mergeAdd(Stat.BONUS_EXP, _amount);
|
effected.getStat().mergeAdd(Stat.BONUS_EXP, _amount);
|
||||||
|
|
||||||
// Send exp bonus to player.
|
if (skill != null)
|
||||||
|
{
|
||||||
|
if (skill.isActive())
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.ACTIVE_BONUS_EXP, _amount);
|
||||||
|
effected.getStat().mergeAdd(Stat.BONUS_EXP_BUFFS, 1);
|
||||||
final PlayerInstance player = effected.getActingPlayer();
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExUserBoostStat(player));
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.BONUS_EXP_PASSIVES, 1);
|
||||||
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@@ -38,11 +39,14 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
|||||||
{
|
{
|
||||||
effected.getStat().mergeMul(Stat.VITALITY_EXP_RATE, (_amount / 100) + 1);
|
effected.getStat().mergeMul(Stat.VITALITY_EXP_RATE, (_amount / 100) + 1);
|
||||||
|
|
||||||
// Send exp bonus to player.
|
if (skill != null)
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.VITALITY_SKILLS, 1);
|
||||||
final PlayerInstance player = effected.getActingPlayer();
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExUserBoostStat(player));
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* 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.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public enum BonusExpType
|
||||||
|
{
|
||||||
|
VITALITY(1),
|
||||||
|
BUFFS(2),
|
||||||
|
PASSIVE(3);
|
||||||
|
|
||||||
|
private int _id;
|
||||||
|
|
||||||
|
private BonusExpType(int id)
|
||||||
|
{
|
||||||
|
_id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId()
|
||||||
|
{
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -144,6 +144,9 @@ public enum Stat
|
|||||||
DEFENCE_CRITICAL_DAMAGE_SKILL_ADD("defCAtkSkillAdd"),
|
DEFENCE_CRITICAL_DAMAGE_SKILL_ADD("defCAtkSkillAdd"),
|
||||||
INSTANT_KILL_RESIST("instantKillResist"),
|
INSTANT_KILL_RESIST("instantKillResist"),
|
||||||
EXPSP_RATE("rExp"),
|
EXPSP_RATE("rExp"),
|
||||||
|
ACTIVE_BONUS_EXP("activeBonusExp"), // Used to measure active skill bonus exp.
|
||||||
|
BONUS_EXP_BUFFS("bonusExpBuffs"), // Used to count active skill exp.
|
||||||
|
BONUS_EXP_PASSIVES("bonusExpPassives"), // Used to count passive skill exp.
|
||||||
BONUS_EXP("bonusExp"),
|
BONUS_EXP("bonusExp"),
|
||||||
BONUS_SP("bonusSp"),
|
BONUS_SP("bonusSp"),
|
||||||
BONUS_DROP_ADENA("bonusDropAdena"),
|
BONUS_DROP_ADENA("bonusDropAdena"),
|
||||||
@@ -251,6 +254,7 @@ public enum Stat
|
|||||||
// Vitality
|
// Vitality
|
||||||
VITALITY_CONSUME_RATE("vitalityConsumeRate"),
|
VITALITY_CONSUME_RATE("vitalityConsumeRate"),
|
||||||
VITALITY_EXP_RATE("vitalityExpRate"),
|
VITALITY_EXP_RATE("vitalityExpRate"),
|
||||||
|
VITALITY_SKILLS("vitalitySkills"), // Used to count vitality skill bonuses.
|
||||||
|
|
||||||
// Souls
|
// Souls
|
||||||
MAX_SOULS("maxSouls"),
|
MAX_SOULS("maxSouls"),
|
||||||
|
|||||||
@@ -19,12 +19,14 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Summon;
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.skills.AbnormalType;
|
import org.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author KenM
|
* @author KenM
|
||||||
@@ -78,6 +80,8 @@ public class RequestDispel implements IClientIncomingPacket
|
|||||||
if (player.getObjectId() == _objectId)
|
if (player.getObjectId() == _objectId)
|
||||||
{
|
{
|
||||||
player.stopSkillEffects(SkillFinishType.REMOVED, _skillId);
|
player.stopSkillEffects(SkillFinishType.REMOVED, _skillId);
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, skill.isActive() ? BonusExpType.BUFFS : BonusExpType.PASSIVE));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package org.l2jmobius.gameserver.network.serverpackets;
|
package org.l2jmobius.gameserver.network.serverpackets;
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
@@ -27,10 +28,12 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
|
|||||||
public class ExUserBoostStat implements IClientOutgoingPacket
|
public class ExUserBoostStat implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private final PlayerInstance _player;
|
private final PlayerInstance _player;
|
||||||
|
private final BonusExpType _type;
|
||||||
|
|
||||||
public ExUserBoostStat(PlayerInstance player)
|
public ExUserBoostStat(PlayerInstance player, BonusExpType type)
|
||||||
{
|
{
|
||||||
_player = player;
|
_player = player;
|
||||||
|
_type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -38,29 +41,57 @@ public class ExUserBoostStat implements IClientOutgoingPacket
|
|||||||
{
|
{
|
||||||
OutgoingPackets.EX_USER_BOOST_STAT.writeId(packet);
|
OutgoingPackets.EX_USER_BOOST_STAT.writeId(packet);
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
int bonus = 0;
|
||||||
|
switch (_type)
|
||||||
|
{
|
||||||
|
case VITALITY:
|
||||||
|
{
|
||||||
final int currentVitalityPoints = _player.getStat().getVitalityPoints();
|
final int currentVitalityPoints = _player.getStat().getVitalityPoints();
|
||||||
int vitalityBonus = 0;
|
|
||||||
if (currentVitalityPoints > 105000)
|
if (currentVitalityPoints > 105000)
|
||||||
{
|
{
|
||||||
vitalityBonus = 300;
|
count = 1;
|
||||||
|
bonus = 300;
|
||||||
}
|
}
|
||||||
else if (currentVitalityPoints > 70000)
|
else if (currentVitalityPoints > 70000)
|
||||||
{
|
{
|
||||||
vitalityBonus = 250;
|
count = 1;
|
||||||
|
bonus = 250;
|
||||||
}
|
}
|
||||||
else if (currentVitalityPoints > 35000)
|
else if (currentVitalityPoints > 35000)
|
||||||
{
|
{
|
||||||
vitalityBonus = 200;
|
count = 1;
|
||||||
|
bonus = 200;
|
||||||
}
|
}
|
||||||
else if (currentVitalityPoints > 0)
|
else if (currentVitalityPoints > 0)
|
||||||
{
|
{
|
||||||
vitalityBonus = 150;
|
count = 1;
|
||||||
|
bonus = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
// final int bonus = (int) (_player.getStat().getExpBonusMultiplier() * 100);
|
if (bonus > 0)
|
||||||
final int bonus = (int) (_player.getStat().getValue(Stat.BONUS_EXP, 0) + vitalityBonus);
|
{
|
||||||
packet.writeC(bonus > 0 ? 2 : 0);
|
count += (int) _player.getStat().getValue(Stat.VITALITY_SKILLS, 0);
|
||||||
packet.writeC(bonus > 0 ? 2 : 0);
|
bonus += (int) ((_player.getStat().getMul(Stat.VITALITY_EXP_RATE, 1) - 1) * 100);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BUFFS:
|
||||||
|
{
|
||||||
|
count = (int) _player.getStat().getValue(Stat.BONUS_EXP_BUFFS, 0);
|
||||||
|
bonus = (int) _player.getStat().getValue(Stat.ACTIVE_BONUS_EXP, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PASSIVE:
|
||||||
|
{
|
||||||
|
count = (int) _player.getStat().getValue(Stat.BONUS_EXP_PASSIVES, 0);
|
||||||
|
bonus = (int) (_player.getStat().getValue(Stat.BONUS_EXP, 0) - _player.getStat().getValue(Stat.ACTIVE_BONUS_EXP, 0));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
packet.writeC(_type.getId());
|
||||||
|
packet.writeC(count);
|
||||||
packet.writeH(bonus);
|
packet.writeH(bonus);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.l2jmobius.Config;
|
|||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.ClassId;
|
import org.l2jmobius.gameserver.enums.ClassId;
|
||||||
import org.l2jmobius.gameserver.enums.ItemGrade;
|
import org.l2jmobius.gameserver.enums.ItemGrade;
|
||||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||||
@@ -460,7 +461,9 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
|||||||
// Send exp bonus change.
|
// Send exp bonus change.
|
||||||
if (containsMask(UserInfoType.VITA_FAME))
|
if (containsMask(UserInfoType.VITA_FAME))
|
||||||
{
|
{
|
||||||
_player.sendPacket(new ExUserBoostStat(_player));
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
||||||
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
||||||
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@@ -38,11 +39,27 @@ public class ExpModify extends AbstractStatAddEffect
|
|||||||
{
|
{
|
||||||
effected.getStat().mergeAdd(Stat.BONUS_EXP, _amount);
|
effected.getStat().mergeAdd(Stat.BONUS_EXP, _amount);
|
||||||
|
|
||||||
// Send exp bonus to player.
|
if (skill != null)
|
||||||
|
{
|
||||||
|
if (skill.isActive())
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.ACTIVE_BONUS_EXP, _amount);
|
||||||
|
effected.getStat().mergeAdd(Stat.BONUS_EXP_BUFFS, 1);
|
||||||
final PlayerInstance player = effected.getActingPlayer();
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExUserBoostStat(player));
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.BONUS_EXP_PASSIVES, 1);
|
||||||
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@@ -38,11 +39,14 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
|||||||
{
|
{
|
||||||
effected.getStat().mergeMul(Stat.VITALITY_EXP_RATE, (_amount / 100) + 1);
|
effected.getStat().mergeMul(Stat.VITALITY_EXP_RATE, (_amount / 100) + 1);
|
||||||
|
|
||||||
// Send exp bonus to player.
|
if (skill != null)
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.VITALITY_SKILLS, 1);
|
||||||
final PlayerInstance player = effected.getActingPlayer();
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExUserBoostStat(player));
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* 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.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public enum BonusExpType
|
||||||
|
{
|
||||||
|
VITALITY(1),
|
||||||
|
BUFFS(2),
|
||||||
|
PASSIVE(3);
|
||||||
|
|
||||||
|
private int _id;
|
||||||
|
|
||||||
|
private BonusExpType(int id)
|
||||||
|
{
|
||||||
|
_id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId()
|
||||||
|
{
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -84,6 +84,7 @@ import org.l2jmobius.gameserver.data.xml.SkillData;
|
|||||||
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.BroochJewel;
|
import org.l2jmobius.gameserver.enums.BroochJewel;
|
||||||
import org.l2jmobius.gameserver.enums.CastleSide;
|
import org.l2jmobius.gameserver.enums.CastleSide;
|
||||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||||
@@ -11785,7 +11786,7 @@ public class PlayerInstance extends Playable
|
|||||||
if (getVariables().getLong(PlayerVariables.SAYHA_GRACE_SUPPORT_ENDTIME, 0) < Chronos.currentTimeMillis())
|
if (getVariables().getLong(PlayerVariables.SAYHA_GRACE_SUPPORT_ENDTIME, 0) < Chronos.currentTimeMillis())
|
||||||
{
|
{
|
||||||
getVariables().set(PlayerVariables.SAYHA_GRACE_SUPPORT_ENDTIME, endTime);
|
getVariables().set(PlayerVariables.SAYHA_GRACE_SUPPORT_ENDTIME, endTime);
|
||||||
sendPacket(new ExUserBoostStat(this));
|
sendPacket(new ExUserBoostStat(this, BonusExpType.VITALITY));
|
||||||
sendPacket(new ExVitalityEffectInfo(this));
|
sendPacket(new ExVitalityEffectInfo(this));
|
||||||
sendPacket(new ExVitalExInfo(this));
|
sendPacket(new ExVitalExInfo(this));
|
||||||
}
|
}
|
||||||
@@ -11801,7 +11802,7 @@ public class PlayerInstance extends Playable
|
|||||||
if (endTime > getVariables().getLong(PlayerVariables.LIMITED_SAYHA_GRACE_ENDTIME, 0))
|
if (endTime > getVariables().getLong(PlayerVariables.LIMITED_SAYHA_GRACE_ENDTIME, 0))
|
||||||
{
|
{
|
||||||
getVariables().set(PlayerVariables.LIMITED_SAYHA_GRACE_ENDTIME, endTime);
|
getVariables().set(PlayerVariables.LIMITED_SAYHA_GRACE_ENDTIME, endTime);
|
||||||
sendPacket(new ExUserBoostStat(this));
|
sendPacket(new ExUserBoostStat(this, BonusExpType.VITALITY));
|
||||||
sendPacket(new ExVitalityEffectInfo(this));
|
sendPacket(new ExVitalityEffectInfo(this));
|
||||||
sendPacket(new ExVitalExInfo(this));
|
sendPacket(new ExVitalExInfo(this));
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -480,16 +480,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
final double bonus = (getVitalityPoints() > 0) ? getMul(Stat.VITALITY_EXP_RATE, Config.RATE_VITALITY_EXP_MULTIPLIER) : 1;
|
final double bonus = (getVitalityPoints() > 0) ? getMul(Stat.VITALITY_EXP_RATE, Config.RATE_VITALITY_EXP_MULTIPLIER) : 1;
|
||||||
if ((bonus == 1) && (getActiveChar().getLimitedSayhaGraceEndTime() > Chronos.currentTimeMillis()))
|
if ((bonus == 1) && (getActiveChar().getLimitedSayhaGraceEndTime() > Chronos.currentTimeMillis()))
|
||||||
{
|
{
|
||||||
return getLimitedSayhaGraceExpBonus();
|
return Config.RATE_LIMITED_SAYHA_GRACE_EXP_MULTIPLIER;
|
||||||
}
|
}
|
||||||
return bonus;
|
return bonus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getLimitedSayhaGraceExpBonus()
|
|
||||||
{
|
|
||||||
return Config.RATE_LIMITED_SAYHA_GRACE_EXP_MULTIPLIER;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVitalityPoints(int value)
|
public void setVitalityPoints(int value)
|
||||||
{
|
{
|
||||||
if (getActiveChar().isSubClassActive())
|
if (getActiveChar().isSubClassActive())
|
||||||
|
|||||||
@@ -158,6 +158,9 @@ public enum Stat
|
|||||||
DEFENCE_CRITICAL_DAMAGE_SKILL_ADD("defCAtkSkillAdd"),
|
DEFENCE_CRITICAL_DAMAGE_SKILL_ADD("defCAtkSkillAdd"),
|
||||||
INSTANT_KILL_RESIST("instantKillResist"),
|
INSTANT_KILL_RESIST("instantKillResist"),
|
||||||
EXPSP_RATE("rExp"),
|
EXPSP_RATE("rExp"),
|
||||||
|
ACTIVE_BONUS_EXP("activeBonusExp"), // Used to measure active skill bonus exp.
|
||||||
|
BONUS_EXP_BUFFS("bonusExpBuffs"), // Used to count active skill exp.
|
||||||
|
BONUS_EXP_PASSIVES("bonusExpPassives"), // Used to count passive skill exp.
|
||||||
BONUS_EXP("bonusExp"),
|
BONUS_EXP("bonusExp"),
|
||||||
BONUS_SP("bonusSp"),
|
BONUS_SP("bonusSp"),
|
||||||
BONUS_DROP_ADENA("bonusDropAdena"),
|
BONUS_DROP_ADENA("bonusDropAdena"),
|
||||||
@@ -263,6 +266,7 @@ public enum Stat
|
|||||||
// Vitality
|
// Vitality
|
||||||
VITALITY_CONSUME_RATE("vitalityConsumeRate"),
|
VITALITY_CONSUME_RATE("vitalityConsumeRate"),
|
||||||
VITALITY_EXP_RATE("vitalityExpRate"),
|
VITALITY_EXP_RATE("vitalityExpRate"),
|
||||||
|
VITALITY_SKILLS("vitalitySkills"), // Used to count vitality skill bonuses.
|
||||||
|
|
||||||
// Magic Lamp
|
// Magic Lamp
|
||||||
MAGIC_LAMP_EXP_RATE("magicLampExpRate"),
|
MAGIC_LAMP_EXP_RATE("magicLampExpRate"),
|
||||||
|
|||||||
@@ -19,12 +19,14 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Summon;
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.skills.AbnormalType;
|
import org.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author KenM
|
* @author KenM
|
||||||
@@ -78,6 +80,8 @@ public class RequestDispel implements IClientIncomingPacket
|
|||||||
if (player.getObjectId() == _objectId)
|
if (player.getObjectId() == _objectId)
|
||||||
{
|
{
|
||||||
player.stopSkillEffects(SkillFinishType.REMOVED, _skillId);
|
player.stopSkillEffects(SkillFinishType.REMOVED, _skillId);
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, skill.isActive() ? BonusExpType.BUFFS : BonusExpType.PASSIVE));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
@@ -28,10 +29,12 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
|
|||||||
public class ExUserBoostStat implements IClientOutgoingPacket
|
public class ExUserBoostStat implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private final PlayerInstance _player;
|
private final PlayerInstance _player;
|
||||||
|
private final BonusExpType _type;
|
||||||
|
|
||||||
public ExUserBoostStat(PlayerInstance player)
|
public ExUserBoostStat(PlayerInstance player, BonusExpType type)
|
||||||
{
|
{
|
||||||
_player = player;
|
_player = player;
|
||||||
|
_type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -39,17 +42,41 @@ public class ExUserBoostStat implements IClientOutgoingPacket
|
|||||||
{
|
{
|
||||||
OutgoingPackets.EX_USER_BOOST_STAT.writeId(packet);
|
OutgoingPackets.EX_USER_BOOST_STAT.writeId(packet);
|
||||||
|
|
||||||
final int currentVitalityPoints = _player.getStat().getVitalityPoints();
|
int count = 0;
|
||||||
int vitalityBonus = 0;
|
int bonus = 0;
|
||||||
if (currentVitalityPoints > 0)
|
switch (_type)
|
||||||
{
|
{
|
||||||
vitalityBonus = (int) (Config.RATE_VITALITY_EXP_MULTIPLIER * 100);
|
case VITALITY:
|
||||||
|
{
|
||||||
|
if (_player.getStat().getVitalityPoints() > 0)
|
||||||
|
{
|
||||||
|
count = 1;
|
||||||
|
bonus = (int) (Config.RATE_VITALITY_EXP_MULTIPLIER * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
// final int bonus = (int) (_player.getStat().getExpBonusMultiplier() * 100);
|
if (bonus > 0)
|
||||||
final int bonus = (int) (_player.getStat().getValue(Stat.BONUS_EXP, 0) + vitalityBonus);
|
{
|
||||||
packet.writeC(bonus > 0 ? 2 : 0);
|
count += (int) _player.getStat().getValue(Stat.VITALITY_SKILLS, 0);
|
||||||
packet.writeC(bonus > 0 ? 2 : 0);
|
bonus += (int) ((_player.getStat().getMul(Stat.VITALITY_EXP_RATE, 1) - 1) * 100);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BUFFS:
|
||||||
|
{
|
||||||
|
count = (int) _player.getStat().getValue(Stat.BONUS_EXP_BUFFS, 0);
|
||||||
|
bonus = (int) _player.getStat().getValue(Stat.ACTIVE_BONUS_EXP, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PASSIVE:
|
||||||
|
{
|
||||||
|
count = (int) _player.getStat().getValue(Stat.BONUS_EXP_PASSIVES, 0);
|
||||||
|
bonus = (int) (_player.getStat().getValue(Stat.BONUS_EXP, 0) - _player.getStat().getValue(Stat.ACTIVE_BONUS_EXP, 0));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
packet.writeC(_type.getId());
|
||||||
|
packet.writeC(count);
|
||||||
packet.writeH(bonus);
|
packet.writeH(bonus);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.network.serverpackets;
|
package org.l2jmobius.gameserver.network.serverpackets;
|
||||||
|
|
||||||
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
@@ -38,7 +39,7 @@ public class ExVitalExInfo implements IClientOutgoingPacket
|
|||||||
OutgoingPackets.EX_VITAL_EX_INFO.writeId(packet);
|
OutgoingPackets.EX_VITAL_EX_INFO.writeId(packet);
|
||||||
packet.writeD((int) (_player.getLimitedSayhaGraceEndTime() / 1000)); // currentmilis / 1000, when limited sayha ends
|
packet.writeD((int) (_player.getLimitedSayhaGraceEndTime() / 1000)); // currentmilis / 1000, when limited sayha ends
|
||||||
packet.writeD((int) (_player.getSayhaGraceSupportEndTime() / 1000)); // currentmilis / 1000, when sayha grace suport ends
|
packet.writeD((int) (_player.getSayhaGraceSupportEndTime() / 1000)); // currentmilis / 1000, when sayha grace suport ends
|
||||||
packet.writeD((int) (_player.getStat().getLimitedSayhaGraceExpBonus() * 100)); // Limited sayha bonus
|
packet.writeD((int) (Config.RATE_LIMITED_SAYHA_GRACE_EXP_MULTIPLIER * 100)); // Limited sayha bonus
|
||||||
packet.writeD(0x82); // Limited sayha bonus adena (shown as 130%, actually 30%)
|
packet.writeD(0x82); // Limited sayha bonus adena (shown as 130%, actually 30%)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.ClassId;
|
import org.l2jmobius.gameserver.enums.ClassId;
|
||||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
@@ -458,7 +459,9 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
|||||||
// Send exp bonus change.
|
// Send exp bonus change.
|
||||||
if (containsMask(UserInfoType.VITA_FAME))
|
if (containsMask(UserInfoType.VITA_FAME))
|
||||||
{
|
{
|
||||||
_player.sendPacket(new ExUserBoostStat(_player));
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
||||||
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
||||||
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
||||||
if (Config.ENABLE_VITALITY)
|
if (Config.ENABLE_VITALITY)
|
||||||
{
|
{
|
||||||
_player.sendPacket(new ExVitalityEffectInfo(_player));
|
_player.sendPacket(new ExVitalityEffectInfo(_player));
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@@ -38,11 +39,27 @@ public class ExpModify extends AbstractStatAddEffect
|
|||||||
{
|
{
|
||||||
effected.getStat().mergeAdd(Stat.BONUS_EXP, _amount);
|
effected.getStat().mergeAdd(Stat.BONUS_EXP, _amount);
|
||||||
|
|
||||||
// Send exp bonus to player.
|
if (skill != null)
|
||||||
|
{
|
||||||
|
if (skill.isActive())
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.ACTIVE_BONUS_EXP, _amount);
|
||||||
|
effected.getStat().mergeAdd(Stat.BONUS_EXP_BUFFS, 1);
|
||||||
final PlayerInstance player = effected.getActingPlayer();
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExUserBoostStat(player));
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.BONUS_EXP_PASSIVES, 1);
|
||||||
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@@ -38,11 +39,14 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
|||||||
{
|
{
|
||||||
effected.getStat().mergeMul(Stat.VITALITY_EXP_RATE, (_amount / 100) + 1);
|
effected.getStat().mergeMul(Stat.VITALITY_EXP_RATE, (_amount / 100) + 1);
|
||||||
|
|
||||||
// Send exp bonus to player.
|
if (skill != null)
|
||||||
|
{
|
||||||
|
effected.getStat().mergeAdd(Stat.VITALITY_SKILLS, 1);
|
||||||
final PlayerInstance player = effected.getActingPlayer();
|
final PlayerInstance player = effected.getActingPlayer();
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExUserBoostStat(player));
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* 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.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public enum BonusExpType
|
||||||
|
{
|
||||||
|
VITALITY(1),
|
||||||
|
BUFFS(2),
|
||||||
|
PASSIVE(3);
|
||||||
|
|
||||||
|
private int _id;
|
||||||
|
|
||||||
|
private BonusExpType(int id)
|
||||||
|
{
|
||||||
|
_id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId()
|
||||||
|
{
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -86,6 +86,7 @@ import org.l2jmobius.gameserver.data.xml.SkillData;
|
|||||||
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.BroochJewel;
|
import org.l2jmobius.gameserver.enums.BroochJewel;
|
||||||
import org.l2jmobius.gameserver.enums.CastleSide;
|
import org.l2jmobius.gameserver.enums.CastleSide;
|
||||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||||
@@ -11851,7 +11852,7 @@ public class PlayerInstance extends Playable
|
|||||||
if (getVariables().getLong(PlayerVariables.SAYHA_GRACE_SUPPORT_ENDTIME, 0) < Chronos.currentTimeMillis())
|
if (getVariables().getLong(PlayerVariables.SAYHA_GRACE_SUPPORT_ENDTIME, 0) < Chronos.currentTimeMillis())
|
||||||
{
|
{
|
||||||
getVariables().set(PlayerVariables.SAYHA_GRACE_SUPPORT_ENDTIME, endTime);
|
getVariables().set(PlayerVariables.SAYHA_GRACE_SUPPORT_ENDTIME, endTime);
|
||||||
sendPacket(new ExUserBoostStat(this));
|
sendPacket(new ExUserBoostStat(this, BonusExpType.VITALITY));
|
||||||
sendPacket(new ExVitalityEffectInfo(this));
|
sendPacket(new ExVitalityEffectInfo(this));
|
||||||
sendPacket(new ExVitalExInfo(this));
|
sendPacket(new ExVitalExInfo(this));
|
||||||
}
|
}
|
||||||
@@ -11867,7 +11868,7 @@ public class PlayerInstance extends Playable
|
|||||||
if (endTime > getVariables().getLong(PlayerVariables.LIMITED_SAYHA_GRACE_ENDTIME, 0))
|
if (endTime > getVariables().getLong(PlayerVariables.LIMITED_SAYHA_GRACE_ENDTIME, 0))
|
||||||
{
|
{
|
||||||
getVariables().set(PlayerVariables.LIMITED_SAYHA_GRACE_ENDTIME, endTime);
|
getVariables().set(PlayerVariables.LIMITED_SAYHA_GRACE_ENDTIME, endTime);
|
||||||
sendPacket(new ExUserBoostStat(this));
|
sendPacket(new ExUserBoostStat(this, BonusExpType.VITALITY));
|
||||||
sendPacket(new ExVitalityEffectInfo(this));
|
sendPacket(new ExVitalityEffectInfo(this));
|
||||||
sendPacket(new ExVitalExInfo(this));
|
sendPacket(new ExVitalExInfo(this));
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -480,16 +480,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
final double bonus = (getVitalityPoints() > 0) ? getMul(Stat.VITALITY_EXP_RATE, Config.RATE_VITALITY_EXP_MULTIPLIER) : 1;
|
final double bonus = (getVitalityPoints() > 0) ? getMul(Stat.VITALITY_EXP_RATE, Config.RATE_VITALITY_EXP_MULTIPLIER) : 1;
|
||||||
if ((bonus == 1) && (getActiveChar().getLimitedSayhaGraceEndTime() > Chronos.currentTimeMillis()))
|
if ((bonus == 1) && (getActiveChar().getLimitedSayhaGraceEndTime() > Chronos.currentTimeMillis()))
|
||||||
{
|
{
|
||||||
return getLimitedSayhaGraceExpBonus();
|
return Config.RATE_LIMITED_SAYHA_GRACE_EXP_MULTIPLIER;
|
||||||
}
|
}
|
||||||
return bonus;
|
return bonus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getLimitedSayhaGraceExpBonus()
|
|
||||||
{
|
|
||||||
return Config.RATE_LIMITED_SAYHA_GRACE_EXP_MULTIPLIER;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVitalityPoints(int value)
|
public void setVitalityPoints(int value)
|
||||||
{
|
{
|
||||||
if (getActiveChar().isSubClassActive())
|
if (getActiveChar().isSubClassActive())
|
||||||
|
|||||||
@@ -158,6 +158,9 @@ public enum Stat
|
|||||||
DEFENCE_CRITICAL_DAMAGE_SKILL_ADD("defCAtkSkillAdd"),
|
DEFENCE_CRITICAL_DAMAGE_SKILL_ADD("defCAtkSkillAdd"),
|
||||||
INSTANT_KILL_RESIST("instantKillResist"),
|
INSTANT_KILL_RESIST("instantKillResist"),
|
||||||
EXPSP_RATE("rExp"),
|
EXPSP_RATE("rExp"),
|
||||||
|
ACTIVE_BONUS_EXP("activeBonusExp"), // Used to measure active skill bonus exp.
|
||||||
|
BONUS_EXP_BUFFS("bonusExpBuffs"), // Used to count active skill exp.
|
||||||
|
BONUS_EXP_PASSIVES("bonusExpPassives"), // Used to count passive skill exp.
|
||||||
BONUS_EXP("bonusExp"),
|
BONUS_EXP("bonusExp"),
|
||||||
BONUS_SP("bonusSp"),
|
BONUS_SP("bonusSp"),
|
||||||
BONUS_DROP_ADENA("bonusDropAdena"),
|
BONUS_DROP_ADENA("bonusDropAdena"),
|
||||||
@@ -263,6 +266,7 @@ public enum Stat
|
|||||||
// Vitality
|
// Vitality
|
||||||
VITALITY_CONSUME_RATE("vitalityConsumeRate"),
|
VITALITY_CONSUME_RATE("vitalityConsumeRate"),
|
||||||
VITALITY_EXP_RATE("vitalityExpRate"),
|
VITALITY_EXP_RATE("vitalityExpRate"),
|
||||||
|
VITALITY_SKILLS("vitalitySkills"), // Used to count vitality skill bonuses.
|
||||||
|
|
||||||
// Magic Lamp
|
// Magic Lamp
|
||||||
MAGIC_LAMP_EXP_RATE("magicLampExpRate"),
|
MAGIC_LAMP_EXP_RATE("magicLampExpRate"),
|
||||||
|
|||||||
@@ -19,12 +19,14 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Summon;
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.skills.AbnormalType;
|
import org.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author KenM
|
* @author KenM
|
||||||
@@ -78,6 +80,8 @@ public class RequestDispel implements IClientIncomingPacket
|
|||||||
if (player.getObjectId() == _objectId)
|
if (player.getObjectId() == _objectId)
|
||||||
{
|
{
|
||||||
player.stopSkillEffects(SkillFinishType.REMOVED, _skillId);
|
player.stopSkillEffects(SkillFinishType.REMOVED, _skillId);
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||||
|
player.sendPacket(new ExUserBoostStat(player, skill.isActive() ? BonusExpType.BUFFS : BonusExpType.PASSIVE));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
@@ -28,10 +29,12 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
|
|||||||
public class ExUserBoostStat implements IClientOutgoingPacket
|
public class ExUserBoostStat implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private final PlayerInstance _player;
|
private final PlayerInstance _player;
|
||||||
|
private final BonusExpType _type;
|
||||||
|
|
||||||
public ExUserBoostStat(PlayerInstance player)
|
public ExUserBoostStat(PlayerInstance player, BonusExpType type)
|
||||||
{
|
{
|
||||||
_player = player;
|
_player = player;
|
||||||
|
_type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -39,17 +42,41 @@ public class ExUserBoostStat implements IClientOutgoingPacket
|
|||||||
{
|
{
|
||||||
OutgoingPackets.EX_USER_BOOST_STAT.writeId(packet);
|
OutgoingPackets.EX_USER_BOOST_STAT.writeId(packet);
|
||||||
|
|
||||||
final int currentVitalityPoints = _player.getStat().getVitalityPoints();
|
int count = 0;
|
||||||
int vitalityBonus = 0;
|
int bonus = 0;
|
||||||
if (currentVitalityPoints > 0)
|
switch (_type)
|
||||||
{
|
{
|
||||||
vitalityBonus = (int) (Config.RATE_VITALITY_EXP_MULTIPLIER * 100);
|
case VITALITY:
|
||||||
|
{
|
||||||
|
if (_player.getStat().getVitalityPoints() > 0)
|
||||||
|
{
|
||||||
|
count = 1;
|
||||||
|
bonus = (int) (Config.RATE_VITALITY_EXP_MULTIPLIER * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
// final int bonus = (int) (_player.getStat().getExpBonusMultiplier() * 100);
|
if (bonus > 0)
|
||||||
final int bonus = (int) (_player.getStat().getValue(Stat.BONUS_EXP, 0) + vitalityBonus);
|
{
|
||||||
packet.writeC(bonus > 0 ? 2 : 0);
|
count += (int) _player.getStat().getValue(Stat.VITALITY_SKILLS, 0);
|
||||||
packet.writeC(bonus > 0 ? 2 : 0);
|
bonus += (int) ((_player.getStat().getMul(Stat.VITALITY_EXP_RATE, 1) - 1) * 100);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BUFFS:
|
||||||
|
{
|
||||||
|
count = (int) _player.getStat().getValue(Stat.BONUS_EXP_BUFFS, 0);
|
||||||
|
bonus = (int) _player.getStat().getValue(Stat.ACTIVE_BONUS_EXP, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PASSIVE:
|
||||||
|
{
|
||||||
|
count = (int) _player.getStat().getValue(Stat.BONUS_EXP_PASSIVES, 0);
|
||||||
|
bonus = (int) (_player.getStat().getValue(Stat.BONUS_EXP, 0) - _player.getStat().getValue(Stat.ACTIVE_BONUS_EXP, 0));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
packet.writeC(_type.getId());
|
||||||
|
packet.writeC(count);
|
||||||
packet.writeH(bonus);
|
packet.writeH(bonus);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.network.serverpackets;
|
package org.l2jmobius.gameserver.network.serverpackets;
|
||||||
|
|
||||||
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
@@ -38,7 +39,7 @@ public class ExVitalExInfo implements IClientOutgoingPacket
|
|||||||
OutgoingPackets.EX_VITAL_EX_INFO.writeId(packet);
|
OutgoingPackets.EX_VITAL_EX_INFO.writeId(packet);
|
||||||
packet.writeD((int) (_player.getLimitedSayhaGraceEndTime() / 1000)); // currentmilis / 1000, when limited sayha ends
|
packet.writeD((int) (_player.getLimitedSayhaGraceEndTime() / 1000)); // currentmilis / 1000, when limited sayha ends
|
||||||
packet.writeD((int) (_player.getSayhaGraceSupportEndTime() / 1000)); // currentmilis / 1000, when sayha grace suport ends
|
packet.writeD((int) (_player.getSayhaGraceSupportEndTime() / 1000)); // currentmilis / 1000, when sayha grace suport ends
|
||||||
packet.writeD((int) (_player.getStat().getLimitedSayhaGraceExpBonus() * 100)); // Limited sayha bonus
|
packet.writeD((int) (Config.RATE_LIMITED_SAYHA_GRACE_EXP_MULTIPLIER * 100)); // Limited sayha bonus
|
||||||
packet.writeD(0x82); // Limited sayha bonus adena (shown as 130%, actually 30%)
|
packet.writeD(0x82); // Limited sayha bonus adena (shown as 130%, actually 30%)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.ClassId;
|
import org.l2jmobius.gameserver.enums.ClassId;
|
||||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
@@ -458,7 +459,9 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
|||||||
// Send exp bonus change.
|
// Send exp bonus change.
|
||||||
if (containsMask(UserInfoType.VITA_FAME))
|
if (containsMask(UserInfoType.VITA_FAME))
|
||||||
{
|
{
|
||||||
_player.sendPacket(new ExUserBoostStat(_player));
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
||||||
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
||||||
|
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
||||||
if (Config.ENABLE_VITALITY)
|
if (Config.ENABLE_VITALITY)
|
||||||
{
|
{
|
||||||
_player.sendPacket(new ExVitalityEffectInfo(_player));
|
_player.sendPacket(new ExVitalityEffectInfo(_player));
|
||||||
|
|||||||
Reference in New Issue
Block a user