-Fix bug when character w\o weapon can't attack.

-Update HpCpHeal effect & fix system msg typo.

Contributed by NviX.
This commit is contained in:
MobiusDev
2015-07-11 21:02:06 +00:00
parent 5a5dad9c9d
commit 4966433091
2 changed files with 39 additions and 26 deletions

View File

@@ -130,7 +130,7 @@ public final class HpCpHeal extends AbstractEffect
{ {
target.sendPacket(SystemMessageId.REJUVENATING_HP); target.sendPacket(SystemMessageId.REJUVENATING_HP);
} }
else else if (healAmount != 0)
{ {
if (activeChar.isPlayer() && (activeChar != target)) if (activeChar.isPlayer() && (activeChar != target))
{ {
@@ -152,21 +152,21 @@ public final class HpCpHeal extends AbstractEffect
if (amount != 0) if (amount != 0)
{ {
target.setCurrentCp(amount + target.getCurrentCp()); target.setCurrentCp(amount + target.getCurrentCp());
}
if (activeChar.isPlayer() && (activeChar != target))
if (activeChar.isPlayer() && (activeChar != target)) {
{ SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_CP_HAS_BEEN_RESTORED_BY_C1);
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_CP_HAS_BEEN_RESTORED_BY_C1); sm.addString(activeChar.getName());
sm.addString(activeChar.getName()); sm.addInt((int) amount);
sm.addInt((int) amount); target.sendPacket(sm);
target.sendPacket(sm); }
} else
else {
{ SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CP_HAS_BEEN_RESTORED);
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CP_HAS_BEEN_RESTORED); sm.addInt((int) amount);
sm.addInt((int) healAmount); target.sendPacket(sm);
target.sendPacket(sm); }
} }
} }
} }
} }

View File

@@ -714,6 +714,7 @@ public final class Formulas
// Add soulshot boost. // Add soulshot boost.
double ssBoost; double ssBoost;
double ssEnchBonus = 0;
if (attacker.isPlayer()) if (attacker.isPlayer())
{ {
double rubyBonus = 0; double rubyBonus = 0;
@@ -729,10 +730,13 @@ public final class Formulas
{ {
rubyBonus = 0.075; rubyBonus = 0.075;
} }
double ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007; if (attacker.getActiveWeaponInstance() != null)
if (ssEnchBonus > 0.21)
{ {
ssEnchBonus = 0.21; ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007;
if (ssEnchBonus > 0.21)
{
ssEnchBonus = 0.21;
}
} }
ssBoost = ss ? (2 + rubyBonus + ssEnchBonus) : 1; ssBoost = ss ? (2 + rubyBonus + ssEnchBonus) : 1;
} }
@@ -900,6 +904,7 @@ public final class Formulas
if (attacker.isPlayer()) if (attacker.isPlayer())
{ {
double sapphireBonus = 0; double sapphireBonus = 0;
double ssEnchBonus = 0;
if ((attacker.getInventory().getItemByItemId(38931) != null) && (attacker.getInventory().getItemByItemId(38931).isEquipped())) if ((attacker.getInventory().getItemByItemId(38931) != null) && (attacker.getInventory().getItemByItemId(38931).isEquipped()))
{ {
sapphireBonus = 0.2; sapphireBonus = 0.2;
@@ -912,10 +917,13 @@ public final class Formulas
{ {
sapphireBonus = 0.075; sapphireBonus = 0.075;
} }
double ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007; if (attacker.getActiveWeaponInstance() != null)
if (ssEnchBonus > 0.21)
{ {
ssEnchBonus = 0.21; ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007;
if (ssEnchBonus > 0.21)
{
ssEnchBonus = 0.21;
}
} }
mAtk *= bss ? (4 + sapphireBonus + ssEnchBonus) : sps ? (2 + sapphireBonus + ssEnchBonus) : 1; mAtk *= bss ? (4 + sapphireBonus + ssEnchBonus) : sps ? (2 + sapphireBonus + ssEnchBonus) : 1;
} }
@@ -1554,6 +1562,7 @@ public final class Formulas
if (attacker.isPlayer()) if (attacker.isPlayer())
{ {
double sapphireBonus = 0; double sapphireBonus = 0;
double ssEnchBonus = 0;
if ((attacker.getInventory().getItemByItemId(38931) != null) && (attacker.getInventory().getItemByItemId(38931).isEquipped())) if ((attacker.getInventory().getItemByItemId(38931) != null) && (attacker.getInventory().getItemByItemId(38931).isEquipped()))
{ {
sapphireBonus = 0.2; sapphireBonus = 0.2;
@@ -1566,10 +1575,13 @@ public final class Formulas
{ {
sapphireBonus = 0.075; sapphireBonus = 0.075;
} }
double ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007; if (attacker.getActiveWeaponInstance() != null)
if (ssEnchBonus > 0.21)
{ {
ssEnchBonus = 0.21; ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007;
if (ssEnchBonus > 0.21)
{
ssEnchBonus = 0.21;
}
} }
mAtk *= bss ? (4 + sapphireBonus + ssEnchBonus) : sps ? (2 + sapphireBonus + ssEnchBonus) : 1; mAtk *= bss ? (4 + sapphireBonus + ssEnchBonus) : sps ? (2 + sapphireBonus + ssEnchBonus) : 1;
} }
@@ -2138,7 +2150,8 @@ public final class Formulas
} }
/** /**
* Calculates karma gain upon playable kill.</br> Updated to High Five on 10.09.2014 by Zealar tested in retail. * Calculates karma gain upon playable kill.</br>
* Updated to High Five on 10.09.2014 by Zealar tested in retail.
* @param pkCount * @param pkCount
* @param isSummon * @param isSummon
* @return karma points that will be added to the player. * @return karma points that will be added to the player.