-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);
}
else
else if (healAmount != 0)
{
if (activeChar.isPlayer() && (activeChar != target))
{
@ -152,7 +152,6 @@ public final class HpCpHeal extends AbstractEffect
if (amount != 0)
{
target.setCurrentCp(amount + target.getCurrentCp());
}
if (activeChar.isPlayer() && (activeChar != target))
{
@ -164,9 +163,10 @@ public final class HpCpHeal extends AbstractEffect
else
{
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CP_HAS_BEEN_RESTORED);
sm.addInt((int) healAmount);
sm.addInt((int) amount);
target.sendPacket(sm);
}
}
}
}
}

View File

@ -714,6 +714,7 @@ public final class Formulas
// Add soulshot boost.
double ssBoost;
double ssEnchBonus = 0;
if (attacker.isPlayer())
{
double rubyBonus = 0;
@ -729,11 +730,14 @@ public final class Formulas
{
rubyBonus = 0.075;
}
double ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007;
if (attacker.getActiveWeaponInstance() != null)
{
ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007;
if (ssEnchBonus > 0.21)
{
ssEnchBonus = 0.21;
}
}
ssBoost = ss ? (2 + rubyBonus + ssEnchBonus) : 1;
}
else
@ -900,6 +904,7 @@ public final class Formulas
if (attacker.isPlayer())
{
double sapphireBonus = 0;
double ssEnchBonus = 0;
if ((attacker.getInventory().getItemByItemId(38931) != null) && (attacker.getInventory().getItemByItemId(38931).isEquipped()))
{
sapphireBonus = 0.2;
@ -912,11 +917,14 @@ public final class Formulas
{
sapphireBonus = 0.075;
}
double ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007;
if (attacker.getActiveWeaponInstance() != null)
{
ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007;
if (ssEnchBonus > 0.21)
{
ssEnchBonus = 0.21;
}
}
mAtk *= bss ? (4 + sapphireBonus + ssEnchBonus) : sps ? (2 + sapphireBonus + ssEnchBonus) : 1;
}
else
@ -1554,6 +1562,7 @@ public final class Formulas
if (attacker.isPlayer())
{
double sapphireBonus = 0;
double ssEnchBonus = 0;
if ((attacker.getInventory().getItemByItemId(38931) != null) && (attacker.getInventory().getItemByItemId(38931).isEquipped()))
{
sapphireBonus = 0.2;
@ -1566,11 +1575,14 @@ public final class Formulas
{
sapphireBonus = 0.075;
}
double ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007;
if (attacker.getActiveWeaponInstance() != null)
{
ssEnchBonus = attacker.getActiveWeaponInstance().getEnchantLevel() * 0.007;
if (ssEnchBonus > 0.21)
{
ssEnchBonus = 0.21;
}
}
mAtk *= bss ? (4 + sapphireBonus + ssEnchBonus) : sps ? (2 + sapphireBonus + ssEnchBonus) : 1;
}
else
@ -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 isSummon
* @return karma points that will be added to the player.