Brooch jewel effects.
This commit is contained in:
@ -76,6 +76,7 @@ import com.l2jmobius.gameserver.data.xml.impl.SkillData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
|
||||
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||
import com.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||
import com.l2jmobius.gameserver.enums.BroochJewel;
|
||||
import com.l2jmobius.gameserver.enums.CastleSide;
|
||||
import com.l2jmobius.gameserver.enums.CategoryType;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
@ -711,6 +712,9 @@ public final class L2PcInstance extends L2Playable
|
||||
private final Map<Integer, CubicInstance> _cubics = new ConcurrentSkipListMap<>();
|
||||
/** Active shots. */
|
||||
protected Set<Integer> _activeSoulShots = ConcurrentHashMap.newKeySet();
|
||||
/** Active Brooch Jewels **/
|
||||
private BroochJewel _activeRubyJewel = null;
|
||||
private BroochJewel _activeShappireJewel = null;
|
||||
|
||||
public final ReentrantLock soulShotLock = new ReentrantLock();
|
||||
|
||||
@ -8650,6 +8654,26 @@ public final class L2PcInstance extends L2Playable
|
||||
_activeSoulShots.clear();
|
||||
}
|
||||
|
||||
public BroochJewel getActiveRubyJewel()
|
||||
{
|
||||
return _activeRubyJewel;
|
||||
}
|
||||
|
||||
public void setActiveRubyJewel(BroochJewel jewel)
|
||||
{
|
||||
_activeRubyJewel = jewel;
|
||||
}
|
||||
|
||||
public BroochJewel getActiveShappireJewel()
|
||||
{
|
||||
return _activeShappireJewel;
|
||||
}
|
||||
|
||||
public void setActiveShappireJewel(BroochJewel jewel)
|
||||
{
|
||||
_activeShappireJewel = jewel;
|
||||
}
|
||||
|
||||
private ScheduledFuture<?> _taskWarnUserTakeBreak;
|
||||
|
||||
public EnumIntBitmask<ClanPrivilege> getClanPrivileges()
|
||||
@ -13870,5 +13894,4 @@ public final class L2PcInstance extends L2Playable
|
||||
addStatusUpdateValue(StatusUpdateType.MAX_CP);
|
||||
addStatusUpdateValue(StatusUpdateType.CUR_CP);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ import com.l2jmobius.commons.database.DatabaseFactory;
|
||||
import com.l2jmobius.commons.util.CommonUtil;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ArmorSetsData;
|
||||
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||
import com.l2jmobius.gameserver.enums.BroochJewel;
|
||||
import com.l2jmobius.gameserver.enums.ItemLocation;
|
||||
import com.l2jmobius.gameserver.enums.ItemSkillType;
|
||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
@ -388,6 +389,11 @@ public abstract class Inventory extends ItemContainer
|
||||
{
|
||||
player.sendPacket(new SkillCoolTime(player));
|
||||
}
|
||||
|
||||
if ((item.getItem().getBodyPart() == L2Item.SLOT_BROOCH_JEWEL) || (item.getItem().getBodyPart() == L2Item.SLOT_BROOCH))
|
||||
{
|
||||
updateActiveBroochJewel(player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -471,6 +477,49 @@ public abstract class Inventory extends ItemContainer
|
||||
{
|
||||
player.handleAutoShots(Config.ENABLE_AUTO_SHOTS);
|
||||
}
|
||||
|
||||
if ((item.getItem().getBodyPart() == L2Item.SLOT_BROOCH_JEWEL) || (item.getItem().getBodyPart() == L2Item.SLOT_BROOCH))
|
||||
{
|
||||
updateActiveBroochJewel(player);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateActiveBroochJewel(L2PcInstance player)
|
||||
{
|
||||
// Update active Ruby jewel.
|
||||
if ((player.getInventory().getItemByItemId(BroochJewel.RUBY_LV5.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.RUBY_LV5.getItemId()).isEquipped()))
|
||||
{
|
||||
player.setActiveRubyJewel(BroochJewel.RUBY_LV5);
|
||||
}
|
||||
else if ((player.getInventory().getItemByItemId(BroochJewel.RUBY_LV4.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.RUBY_LV4.getItemId()).isEquipped()))
|
||||
{
|
||||
player.setActiveRubyJewel(BroochJewel.RUBY_LV4);
|
||||
}
|
||||
else if ((player.getInventory().getItemByItemId(BroochJewel.RUBY_LV3.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.RUBY_LV5.getItemId()).isEquipped()))
|
||||
{
|
||||
player.setActiveRubyJewel(BroochJewel.RUBY_LV3);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setActiveRubyJewel(null);
|
||||
}
|
||||
// Update active Sapphire jewel.
|
||||
if ((player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV5.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV5.getItemId()).isEquipped()))
|
||||
{
|
||||
player.setActiveShappireJewel(BroochJewel.SHAPPHIRE_LV5);
|
||||
}
|
||||
else if ((player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV4.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV4.getItemId()).isEquipped()))
|
||||
{
|
||||
player.setActiveShappireJewel(BroochJewel.SHAPPHIRE_LV4);
|
||||
}
|
||||
else if ((player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV3.getItemId()) != null) && (player.getInventory().getItemByItemId(BroochJewel.SHAPPHIRE_LV3.getItemId()).isEquipped()))
|
||||
{
|
||||
player.setActiveShappireJewel(BroochJewel.SHAPPHIRE_LV3);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setActiveShappireJewel(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -862,7 +862,12 @@ public final class Formulas
|
||||
|
||||
// Bonus Spiritshot
|
||||
final double shotsBonus = attacker.getStat().getValue(Stats.SHOTS_BONUS);
|
||||
mAtk *= bss ? 4 * shotsBonus : sps ? 2 * shotsBonus : 1;
|
||||
double sapphireBonus = 0;
|
||||
if (attacker.isPlayer() && (attacker.getActingPlayer().getActiveShappireJewel() != null))
|
||||
{
|
||||
sapphireBonus = attacker.getActingPlayer().getActiveShappireJewel().getBonus();
|
||||
}
|
||||
mAtk *= bss ? 4 * (shotsBonus + sapphireBonus) : sps ? 2 * (shotsBonus + sapphireBonus) : 1;
|
||||
|
||||
double damage = (Math.sqrt(mAtk) * power * (mp / 97)) / mDef;
|
||||
damage *= calcGeneralTraitBonus(attacker, target, skill.getTraitType(), false);
|
||||
|
@ -36,6 +36,7 @@ public class ShotsBonusFinalizer implements IStatsFunction
|
||||
throwIfPresent(base);
|
||||
|
||||
double baseValue = 1;
|
||||
double rubyBonus = 0;
|
||||
final L2PcInstance player = creature.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
@ -44,7 +45,11 @@ public class ShotsBonusFinalizer implements IStatsFunction
|
||||
{
|
||||
baseValue += (weapon.getEnchantLevel() * 0.7) / 100;
|
||||
}
|
||||
if (player.getActiveRubyJewel() != null)
|
||||
{
|
||||
rubyBonus = player.getActiveRubyJewel().getBonus();
|
||||
}
|
||||
}
|
||||
return CommonUtil.constrain(baseValue, 1.0, 1.21);
|
||||
return Stats.defaultValue(creature, stat, CommonUtil.constrain(baseValue, 1.0, 1.21) + rubyBonus);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user