Fixed lag while enchanting homunculus (adding xp).
Contributed by nasseka.
This commit is contained in:
@@ -50,13 +50,14 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) == 0)
|
|
||||||
|
if ((player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) == 0) || (player.getHomunculusList().get(_slot).getExp() >= player.getHomunculusList().get(_slot).getTemplate().getExpToLevel6()))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(false, false));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(false, false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int points = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) - 1;
|
final int points = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) - 1;
|
||||||
player.getVariables().set(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, points);
|
player.getVariables().set(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, points);
|
||||||
final Homunculus homunculus = player.getHomunculusList().get(_slot);
|
final Homunculus homunculus = player.getHomunculusList().get(_slot);
|
||||||
if (homunculus == null)
|
if (homunculus == null)
|
||||||
@@ -74,6 +75,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel2())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel2())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(2);
|
homunculus.setLevel(2);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -87,6 +89,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel3())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel3())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(3);
|
homunculus.setLevel(3);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -100,6 +103,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel4())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel4())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(4);
|
homunculus.setLevel(4);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -113,6 +117,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel5())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel5())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(5);
|
homunculus.setLevel(5);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -136,7 +141,6 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.getHomunculusList().update(homunculus);
|
player.getHomunculusList().update(homunculus);
|
||||||
player.getHomunculusList().refreshStats(true);
|
|
||||||
player.sendPacket(new ExShowHomunculusList(player));
|
player.sendPacket(new ExShowHomunculusList(player));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -50,13 +50,14 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) == 0)
|
|
||||||
|
if ((player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) == 0) || (player.getHomunculusList().get(_slot).getExp() >= player.getHomunculusList().get(_slot).getTemplate().getExpToLevel6()))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(false, false));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(false, false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int points = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) - 1;
|
final int points = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) - 1;
|
||||||
player.getVariables().set(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, points);
|
player.getVariables().set(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, points);
|
||||||
final Homunculus homunculus = player.getHomunculusList().get(_slot);
|
final Homunculus homunculus = player.getHomunculusList().get(_slot);
|
||||||
if (homunculus == null)
|
if (homunculus == null)
|
||||||
@@ -74,6 +75,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel2())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel2())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(2);
|
homunculus.setLevel(2);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -87,6 +89,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel3())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel3())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(3);
|
homunculus.setLevel(3);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -100,6 +103,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel4())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel4())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(4);
|
homunculus.setLevel(4);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -113,6 +117,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel5())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel5())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(5);
|
homunculus.setLevel(5);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -136,7 +141,6 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.getHomunculusList().update(homunculus);
|
player.getHomunculusList().update(homunculus);
|
||||||
player.getHomunculusList().refreshStats(true);
|
|
||||||
player.sendPacket(new ExShowHomunculusList(player));
|
player.sendPacket(new ExShowHomunculusList(player));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -50,13 +50,14 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) == 0)
|
|
||||||
|
if ((player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) == 0) || (player.getHomunculusList().get(_slot).getExp() >= player.getHomunculusList().get(_slot).getTemplate().getExpToLevel6()))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(false, false));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(false, false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int points = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) - 1;
|
final int points = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) - 1;
|
||||||
player.getVariables().set(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, points);
|
player.getVariables().set(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, points);
|
||||||
final Homunculus homunculus = player.getHomunculusList().get(_slot);
|
final Homunculus homunculus = player.getHomunculusList().get(_slot);
|
||||||
if (homunculus == null)
|
if (homunculus == null)
|
||||||
@@ -74,6 +75,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel2())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel2())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(2);
|
homunculus.setLevel(2);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -87,6 +89,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel3())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel3())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(3);
|
homunculus.setLevel(3);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -100,6 +103,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel4())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel4())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(4);
|
homunculus.setLevel(4);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -113,6 +117,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel5())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel5())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(5);
|
homunculus.setLevel(5);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -136,7 +141,6 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.getHomunculusList().update(homunculus);
|
player.getHomunculusList().update(homunculus);
|
||||||
player.getHomunculusList().refreshStats(true);
|
|
||||||
player.sendPacket(new ExShowHomunculusList(player));
|
player.sendPacket(new ExShowHomunculusList(player));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -50,13 +50,14 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) == 0)
|
|
||||||
|
if ((player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) == 0) || (player.getHomunculusList().get(_slot).getExp() >= player.getHomunculusList().get(_slot).getTemplate().getExpToLevel6()))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(false, false));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(false, false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int points = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) - 1;
|
final int points = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) - 1;
|
||||||
player.getVariables().set(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, points);
|
player.getVariables().set(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, points);
|
||||||
final Homunculus homunculus = player.getHomunculusList().get(_slot);
|
final Homunculus homunculus = player.getHomunculusList().get(_slot);
|
||||||
if (homunculus == null)
|
if (homunculus == null)
|
||||||
@@ -74,6 +75,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel2())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel2())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(2);
|
homunculus.setLevel(2);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -87,6 +89,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel3())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel3())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(3);
|
homunculus.setLevel(3);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -100,6 +103,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel4())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel4())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(4);
|
homunculus.setLevel(4);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -113,6 +117,7 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel5())
|
if (homunculus.getExp() >= homunculus.getTemplate().getExpToLevel5())
|
||||||
{
|
{
|
||||||
homunculus.setLevel(5);
|
homunculus.setLevel(5);
|
||||||
|
player.getHomunculusList().refreshStats(true);
|
||||||
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
player.sendPacket(new ExHomunculusEnchantEXPResult(true, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -136,7 +141,6 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.getHomunculusList().update(homunculus);
|
player.getHomunculusList().update(homunculus);
|
||||||
player.getHomunculusList().refreshStats(true);
|
|
||||||
player.sendPacket(new ExShowHomunculusList(player));
|
player.sendPacket(new ExShowHomunculusList(player));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user