Brooch enum support for Sapphire and skill level.

Thanks to nasseka.
This commit is contained in:
MobiusDevelopment
2021-12-11 01:59:47 +00:00
parent a8be08b4e3
commit f47a1a6264
168 changed files with 1259 additions and 927 deletions

View File

@@ -126,7 +126,7 @@ public class BeastSoulShot implements IItemHandler
// Visual effect change if player has equipped Ruby level 3 or higher
if (activeOwner.getActiveRubyJewel() != null)
{
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, activeOwner.getActiveRubyJewel().getEffectId(), 1, 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, activeOwner.getActiveRubyJewel().getSkillId(), activeOwner.getActiveRubyJewel().getSkillLevel(), 0, 0), 600);
}
else
{
@@ -143,7 +143,7 @@ public class BeastSoulShot implements IItemHandler
// Visual effect change if player has equipped Ruby level 3 or higher
if (activeOwner.getActiveRubyJewel() != null)
{
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(s, s, activeOwner.getActiveRubyJewel().getEffectId(), 1, 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(s, s, activeOwner.getActiveRubyJewel().getSkillId(), activeOwner.getActiveRubyJewel().getSkillLevel(), 0, 0), 600);
}
else
{

View File

@@ -127,7 +127,7 @@ public class BeastSpiritShot implements IItemHandler
// Visual effect change if player has equipped Sapphire level 3 or higher
if (activeOwner.getActiveShappireJewel() != null)
{
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, activeOwner.getActiveShappireJewel().getEffectId(), 2, 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, activeOwner.getActiveShappireJewel().getSkillId(), activeOwner.getActiveShappireJewel().getSkillLevel(), 0, 0), 600);
}
else
{
@@ -144,7 +144,7 @@ public class BeastSpiritShot implements IItemHandler
// Visual effect change if player has equipped Sapphire level 3 or higher
if (activeOwner.getActiveShappireJewel() != null)
{
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(s, s, activeOwner.getActiveShappireJewel().getEffectId(), 2, 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(s, s, activeOwner.getActiveShappireJewel().getSkillId(), activeOwner.getActiveShappireJewel().getSkillLevel(), 0, 0), 600);
}
else
{

View File

@@ -112,7 +112,7 @@ public class BlessedSoulShots implements IItemHandler
// Visual effect change if player has equipped Ruby level 3 or higher
if (player.getActiveRubyJewel() != null)
{
Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, player.getActiveRubyJewel().getEffectId(), 1, 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, player.getActiveRubyJewel().getSkillId(), player.getActiveRubyJewel().getSkillLevel(), 0, 0), 600);
}
else
{

View File

@@ -104,7 +104,7 @@ public class BlessedSpiritShot implements IItemHandler
// Visual effect change if player has equipped Sapphire level 3 or higher
if (player.getActiveShappireJewel() != null)
{
Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, player.getActiveShappireJewel().getEffectId(), 1, 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, player.getActiveShappireJewel().getSkillId(), player.getActiveShappireJewel().getSkillLevel(), 0, 0), 600);
}
else
{

View File

@@ -109,7 +109,7 @@ public class SoulShots implements IItemHandler
// Visual effect change if player has equipped Ruby level 3 or higher
if (player.getActiveRubyJewel() != null)
{
Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, player.getActiveRubyJewel().getEffectId(), 1, 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, player.getActiveRubyJewel().getSkillId(), player.getActiveRubyJewel().getSkillLevel(), 0, 0), 600);
}
else
{

View File

@@ -104,7 +104,7 @@ public class SpiritShot implements IItemHandler
// Visual effect change if player has equipped Sapphire level 3 or higher
if (player.getActiveShappireJewel() != null)
{
Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, player.getActiveShappireJewel().getEffectId(), 1, 0, 0), 600);
Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, player.getActiveShappireJewel().getSkillId(), player.getActiveShappireJewel().getSkillLevel(), 0, 0), 600);
}
else
{

View File

@@ -21,28 +21,33 @@ package org.l2jmobius.gameserver.enums;
*/
public enum BroochJewel
{
RUBY_LV1(38855, 17814, 0.01, true),
RUBY_LV2(38856, 17814, 0.035, true),
RUBY_LV3(38857, 17815, 0.075, true),
RUBY_LV4(38858, 17816, 0.125, true),
RUBY_LV5(38859, 17817, 0.2, true),
SHAPPHIRE_LV1(38927, 17818, 0.01, false),
SHAPPHIRE_LV2(38928, 17818, 0.035, false),
SHAPPHIRE_LV3(38929, 17819, 0.075, false),
SHAPPHIRE_LV4(38930, 17820, 0.125, false),
SHAPPHIRE_LV5(38931, 17821, 0.2, false);
RUBY_LV1(38855, 17814, 1, 0.01, true, false),
RUBY_LV2(38856, 17814, 1, 0.035, true, false),
RUBY_LV3(38857, 17815, 1, 0.075, true, false),
RUBY_LV4(38858, 17816, 1, 0.125, true, false),
RUBY_LV5(38859, 17817, 1, 0.2, true, false),
SAPPHIRE_LV1(38927, 17818, 1, 0.01, false, true),
SAPPHIRE_LV2(38928, 17818, 1, 0.035, false, true),
SAPPHIRE_LV3(38929, 17819, 1, 0.075, false, true),
SAPPHIRE_LV4(38930, 17820, 1, 0.125, false, true),
SAPPHIRE_LV5(38931, 17821, 1, 0.2, false, true);
private int _itemId;
private int _effectId;
private int _skillId;
private int _skillLevel;
private double _bonus;
private boolean _isRuby; // If not, it is sapphire.
private boolean _isRuby;
private boolean _isSapphire;
private BroochJewel(int itemId, int effectId, double bonus, boolean isRuby)
private BroochJewel(int itemId, int skillId, int skillLevel, double bonus, boolean isRuby, boolean isSapphire)
{
_itemId = itemId;
_effectId = effectId;
_skillId = skillId;
_skillLevel = skillLevel;
_bonus = bonus;
_isRuby = isRuby;
_isSapphire = isSapphire;
}
public int getItemId()
@@ -50,9 +55,14 @@ public enum BroochJewel
return _itemId;
}
public int getEffectId()
public int getSkillId()
{
return _effectId;
return _skillId;
}
public int getSkillLevel()
{
return _skillLevel;
}
public double getBonus()
@@ -64,4 +74,9 @@ public enum BroochJewel
{
return _isRuby;
}
public boolean isSapphire()
{
return _isSapphire;
}
}

View File

@@ -8882,7 +8882,7 @@ public class Player extends Playable
for (int i = broochJewels.length - 1; i > 0; i--)
{
final BroochJewel jewel = broochJewels[i];
if (!jewel.isRuby() && _inventory.isItemEquipped(jewel.getItemId()))
if (jewel.isSapphire() && _inventory.isItemEquipped(jewel.getItemId()))
{
setActiveShappireJewel(jewel);
break;