Verify owning existing homunculus at RequestExHomunculusSummon.

This commit is contained in:
MobiusDevelopment 2021-08-01 00:59:44 +00:00
parent ec9cdcced0
commit 0297e45f3e
6 changed files with 219 additions and 162 deletions

View File

@ -78,6 +78,18 @@ public class HomunculusList
return null; return null;
} }
public boolean hasHomunculus(int templateId)
{
for (Homunculus homunculus : _homunculusList)
{
if (homunculus.getId() == templateId)
{
return true;
}
}
return false;
}
public int size() public int size()
{ {
return _homunculusList.size(); return _homunculusList.size();

View File

@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.homunculus; package org.l2jmobius.gameserver.network.clientpackets.homunculus;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.HomunculusData; import org.l2jmobius.gameserver.data.xml.HomunculusData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@ -60,103 +61,109 @@ public class RequestExHomunculusSummon implements IClientIncomingPacket
_vpPoints = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_VP_POINTS, 0); _vpPoints = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_VP_POINTS, 0);
_homunculusCreateTime = (int) (player.getVariables().getLong(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0) / 1000); _homunculusCreateTime = (int) (player.getVariables().getLong(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0) / 1000);
if (_homunculusCreateTime > 0) if ((_homunculusCreateTime > 0) && ((Chronos.currentTimeMillis() / 1000) >= _homunculusCreateTime) && (_hpPoints == 100) && (_spPoints == 10) && (_vpPoints == 5))
{ {
if (((System.currentTimeMillis() / 1000) >= _homunculusCreateTime) && (_hpPoints == 100) && (_spPoints == 10) && (_vpPoints == 5)) int chance;
int random;
int homunculusId = 0;
while (homunculusId == 0)
{ {
int homunculusId = 0; chance = Rnd.get(100);
final int chance = Rnd.get(100); random = Rnd.get(100);
if (chance >= 60) // Basic Homunculus
// Basic Homunculus
if (chance >= 60)
{ {
final int random = Rnd.get(100); if ((random >= 80) && !player.getHomunculusList().hasHomunculus(1))
if (random >= 80)
{ {
homunculusId = 1; homunculusId = 1;
} }
else if (random >= 60) else if ((random >= 60) && !player.getHomunculusList().hasHomunculus(4))
{ {
homunculusId = 4; homunculusId = 4;
} }
else if (random >= 40) else if ((random >= 40) && !player.getHomunculusList().hasHomunculus(7))
{ {
homunculusId = 7; homunculusId = 7;
} }
else if (random >= 20) else if ((random >= 20) && !player.getHomunculusList().hasHomunculus(10))
{ {
homunculusId = 10; homunculusId = 10;
} }
else else if (!player.getHomunculusList().hasHomunculus(13))
{ {
homunculusId = 13; homunculusId = 13;
} }
} }
else if (chance >= 10) // Water Homunculus
// Water Homunculus
if ((homunculusId == 0) && (chance >= 10))
{ {
final int random = Rnd.get(100); if ((random >= 80) && !player.getHomunculusList().hasHomunculus(2))
if (random >= 80)
{ {
homunculusId = 2; homunculusId = 2;
} }
else if (random >= 60) else if ((random >= 60) && !player.getHomunculusList().hasHomunculus(5))
{ {
homunculusId = 5; homunculusId = 5;
} }
else if (random >= 40) else if ((random >= 40) && !player.getHomunculusList().hasHomunculus(8))
{ {
homunculusId = 8; homunculusId = 8;
} }
else if (random >= 20) else if ((random >= 20) && !player.getHomunculusList().hasHomunculus(11))
{ {
homunculusId = 11; homunculusId = 11;
} }
else else if (!player.getHomunculusList().hasHomunculus(14))
{ {
homunculusId = 14; homunculusId = 14;
} }
} }
else // Luminous Homunculus
// Luminous Homunculus
if (homunculusId == 0)
{ {
final int random = Rnd.get(100); if ((random >= 80) && !player.getHomunculusList().hasHomunculus(3))
if (random >= 80)
{ {
homunculusId = 3; homunculusId = 3;
} }
else if (random >= 60) else if ((random >= 60) && !player.getHomunculusList().hasHomunculus(6))
{ {
homunculusId = 6; homunculusId = 6;
} }
else if (random >= 40) else if ((random >= 40) && !player.getHomunculusList().hasHomunculus(9))
{ {
homunculusId = 9; homunculusId = 9;
} }
else if (random >= 20) else if ((random >= 20) && !player.getHomunculusList().hasHomunculus(12))
{ {
homunculusId = 12; homunculusId = 12;
} }
else else if (!player.getHomunculusList().hasHomunculus(15))
{ {
homunculusId = 15; homunculusId = 15;
} }
} }
}
final HomunculusTemplate template = HomunculusData.getInstance().getTemplate(homunculusId);
if (template == null) final HomunculusTemplate template = HomunculusData.getInstance().getTemplate(homunculusId);
{ if (template == null)
LOGGER.warning("Counld not find Homunculus template " + homunculusId + "."); {
return; LOGGER.warning("Counld not find Homunculus template " + homunculusId + ".");
} return;
}
final Homunculus homunculus = new Homunculus(template, player.getHomunculusList().size(), 1, 0, 0, 0, 0, 0, 0, false);
if (player.getHomunculusList().add(homunculus)) final Homunculus homunculus = new Homunculus(template, player.getHomunculusList().size(), 1, 0, 0, 0, 0, 0, 0, false);
{ if (player.getHomunculusList().add(homunculus))
player.getVariables().set(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0); {
player.getVariables().set(PlayerVariables.HOMUNCULUS_HP_POINTS, 0); player.getVariables().set(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0);
player.getVariables().set(PlayerVariables.HOMUNCULUS_SP_POINTS, 0); player.getVariables().set(PlayerVariables.HOMUNCULUS_HP_POINTS, 0);
player.getVariables().set(PlayerVariables.HOMUNCULUS_VP_POINTS, 0); player.getVariables().set(PlayerVariables.HOMUNCULUS_SP_POINTS, 0);
player.sendPacket(new ExShowHomunculusBirthInfo(player)); player.getVariables().set(PlayerVariables.HOMUNCULUS_VP_POINTS, 0);
player.sendPacket(new ExShowHomunculusList(player)); player.sendPacket(new ExShowHomunculusBirthInfo(player));
player.sendPacket(new ExHomunculusSummonResult()); player.sendPacket(new ExShowHomunculusList(player));
} player.sendPacket(new ExHomunculusSummonResult());
} }
} }
} }

View File

@ -78,6 +78,18 @@ public class HomunculusList
return null; return null;
} }
public boolean hasHomunculus(int templateId)
{
for (Homunculus homunculus : _homunculusList)
{
if (homunculus.getId() == templateId)
{
return true;
}
}
return false;
}
public int size() public int size()
{ {
return _homunculusList.size(); return _homunculusList.size();

View File

@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.homunculus; package org.l2jmobius.gameserver.network.clientpackets.homunculus;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.HomunculusData; import org.l2jmobius.gameserver.data.xml.HomunculusData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@ -60,163 +61,169 @@ public class RequestExHomunculusSummon implements IClientIncomingPacket
_vpPoints = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_VP_POINTS, 0); _vpPoints = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_VP_POINTS, 0);
_homunculusCreateTime = (int) (player.getVariables().getLong(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0) / 1000); _homunculusCreateTime = (int) (player.getVariables().getLong(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0) / 1000);
if (_homunculusCreateTime > 0) if ((_homunculusCreateTime > 0) && ((Chronos.currentTimeMillis() / 1000) >= _homunculusCreateTime) && (_hpPoints == 100) && (_spPoints == 10) && (_vpPoints == 5))
{ {
if (((System.currentTimeMillis() / 1000) >= _homunculusCreateTime) && (_hpPoints == 100) && (_spPoints == 10) && (_vpPoints == 5)) int chance;
int random;
int homunculusId = 0;
while (homunculusId == 0)
{ {
int homunculusId = 0; chance = Rnd.get(100);
final int chance = Rnd.get(100); random = Rnd.get(100);
if (chance >= 60) // Basic Homunculus
// Basic Homunculus
if (chance >= 60)
{ {
final int random = Rnd.get(100); if ((random >= 90) && !player.getHomunculusList().hasHomunculus(1))
if (random >= 90)
{ {
homunculusId = 1; homunculusId = 1;
} }
else if (random >= 80) else if ((random >= 80) && !player.getHomunculusList().hasHomunculus(4))
{ {
homunculusId = 4; homunculusId = 4;
} }
else if (random >= 70) else if ((random >= 70) && !player.getHomunculusList().hasHomunculus(7))
{ {
homunculusId = 7; homunculusId = 7;
} }
else if (random >= 60) else if ((random >= 60) && !player.getHomunculusList().hasHomunculus(10))
{ {
homunculusId = 10; homunculusId = 10;
} }
else if (random >= 50) else if ((random >= 50) && !player.getHomunculusList().hasHomunculus(13))
{ {
homunculusId = 13; homunculusId = 13;
} }
else if (random >= 40) else if ((random >= 40) && !player.getHomunculusList().hasHomunculus(16))
{ {
homunculusId = 16; homunculusId = 16;
} }
else if (random >= 30) else if ((random >= 30) && !player.getHomunculusList().hasHomunculus(19))
{ {
homunculusId = 19; homunculusId = 19;
} }
else if (random >= 20) else if ((random >= 20) && !player.getHomunculusList().hasHomunculus(22))
{ {
homunculusId = 22; homunculusId = 22;
} }
else if (random >= 10) else if ((random >= 10) && !player.getHomunculusList().hasHomunculus(25))
{ {
homunculusId = 25; homunculusId = 25;
} }
else else if (!player.getHomunculusList().hasHomunculus(28))
{ {
homunculusId = 28; homunculusId = 28;
} }
} }
else if (chance >= 10) // Water Homunculus
// Water Homunculus
if ((homunculusId == 0) && (chance >= 10))
{ {
final int random = Rnd.get(100); if ((random >= 90) && !player.getHomunculusList().hasHomunculus(2))
if (random >= 90)
{ {
homunculusId = 2; homunculusId = 2;
} }
else if (random >= 80) else if ((random >= 80) && !player.getHomunculusList().hasHomunculus(5))
{ {
homunculusId = 5; homunculusId = 5;
} }
else if (random >= 70) else if ((random >= 70) && !player.getHomunculusList().hasHomunculus(8))
{ {
homunculusId = 8; homunculusId = 8;
} }
else if (random >= 60) else if ((random >= 60) && !player.getHomunculusList().hasHomunculus(11))
{ {
homunculusId = 11; homunculusId = 11;
} }
else if (random >= 50) else if ((random >= 50) && !player.getHomunculusList().hasHomunculus(14))
{ {
homunculusId = 14; homunculusId = 14;
} }
else if (random >= 40) else if ((random >= 40) && !player.getHomunculusList().hasHomunculus(17))
{ {
homunculusId = 17; homunculusId = 17;
} }
else if (random >= 30) else if ((random >= 30) && !player.getHomunculusList().hasHomunculus(20))
{ {
homunculusId = 20; homunculusId = 20;
} }
else if (random >= 20) else if ((random >= 20) && !player.getHomunculusList().hasHomunculus(23))
{ {
homunculusId = 23; homunculusId = 23;
} }
else if (random >= 10) else if ((random >= 10) && !player.getHomunculusList().hasHomunculus(26))
{ {
homunculusId = 26; homunculusId = 26;
} }
else else if (!player.getHomunculusList().hasHomunculus(29))
{ {
homunculusId = 29; homunculusId = 29;
} }
} }
else // Luminous Homunculus
// Luminous Homunculus
if (homunculusId == 0)
{ {
final int random = Rnd.get(100); if ((random >= 90) && !player.getHomunculusList().hasHomunculus(3))
if (random >= 90)
{ {
homunculusId = 3; homunculusId = 3;
} }
else if (random >= 80) else if ((random >= 80) && !player.getHomunculusList().hasHomunculus(6))
{ {
homunculusId = 6; homunculusId = 6;
} }
else if (random >= 70) else if ((random >= 70) && !player.getHomunculusList().hasHomunculus(9))
{ {
homunculusId = 9; homunculusId = 9;
} }
else if (random >= 60) else if ((random >= 60) && !player.getHomunculusList().hasHomunculus(12))
{ {
homunculusId = 12; homunculusId = 12;
} }
else if (random >= 50) else if ((random >= 50) && !player.getHomunculusList().hasHomunculus(15))
{ {
homunculusId = 15; homunculusId = 15;
} }
else if (random >= 40) else if ((random >= 40) && !player.getHomunculusList().hasHomunculus(18))
{ {
homunculusId = 18; homunculusId = 18;
} }
else if (random >= 30) else if ((random >= 30) && !player.getHomunculusList().hasHomunculus(21))
{ {
homunculusId = 21; homunculusId = 21;
} }
else if (random >= 20) else if ((random >= 20) && !player.getHomunculusList().hasHomunculus(24))
{ {
homunculusId = 24; homunculusId = 24;
} }
else if (random >= 10) else if ((random >= 10) && !player.getHomunculusList().hasHomunculus(27))
{ {
homunculusId = 27; homunculusId = 27;
} }
else else if (!player.getHomunculusList().hasHomunculus(30))
{ {
homunculusId = 30; homunculusId = 30;
} }
} }
}
final HomunculusTemplate template = HomunculusData.getInstance().getTemplate(homunculusId);
if (template == null) final HomunculusTemplate template = HomunculusData.getInstance().getTemplate(homunculusId);
{ if (template == null)
LOGGER.warning("Counld not find Homunculus template " + homunculusId + "."); {
return; LOGGER.warning("Counld not find Homunculus template " + homunculusId + ".");
} return;
}
final Homunculus homunculus = new Homunculus(template, player.getHomunculusList().size(), 1, 0, 0, 0, 0, 0, 0, false);
if (player.getHomunculusList().add(homunculus)) final Homunculus homunculus = new Homunculus(template, player.getHomunculusList().size(), 1, 0, 0, 0, 0, 0, 0, false);
{ if (player.getHomunculusList().add(homunculus))
player.getVariables().set(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0); {
player.getVariables().set(PlayerVariables.HOMUNCULUS_HP_POINTS, 0); player.getVariables().set(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0);
player.getVariables().set(PlayerVariables.HOMUNCULUS_SP_POINTS, 0); player.getVariables().set(PlayerVariables.HOMUNCULUS_HP_POINTS, 0);
player.getVariables().set(PlayerVariables.HOMUNCULUS_VP_POINTS, 0); player.getVariables().set(PlayerVariables.HOMUNCULUS_SP_POINTS, 0);
player.sendPacket(new ExShowHomunculusBirthInfo(player)); player.getVariables().set(PlayerVariables.HOMUNCULUS_VP_POINTS, 0);
player.sendPacket(new ExShowHomunculusList(player)); player.sendPacket(new ExShowHomunculusBirthInfo(player));
player.sendPacket(new ExHomunculusSummonResult()); player.sendPacket(new ExShowHomunculusList(player));
} player.sendPacket(new ExHomunculusSummonResult());
} }
} }
} }

View File

@ -78,6 +78,18 @@ public class HomunculusList
return null; return null;
} }
public boolean hasHomunculus(int templateId)
{
for (Homunculus homunculus : _homunculusList)
{
if (homunculus.getId() == templateId)
{
return true;
}
}
return false;
}
public int size() public int size()
{ {
return _homunculusList.size(); return _homunculusList.size();

View File

@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.clientpackets.homunculus; package org.l2jmobius.gameserver.network.clientpackets.homunculus;
import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.HomunculusData; import org.l2jmobius.gameserver.data.xml.HomunculusData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@ -60,163 +61,169 @@ public class RequestExHomunculusSummon implements IClientIncomingPacket
_vpPoints = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_VP_POINTS, 0); _vpPoints = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_VP_POINTS, 0);
_homunculusCreateTime = (int) (player.getVariables().getLong(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0) / 1000); _homunculusCreateTime = (int) (player.getVariables().getLong(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0) / 1000);
if (_homunculusCreateTime > 0) if ((_homunculusCreateTime > 0) && ((Chronos.currentTimeMillis() / 1000) >= _homunculusCreateTime) && (_hpPoints == 100) && (_spPoints == 10) && (_vpPoints == 5))
{ {
if (((System.currentTimeMillis() / 1000) >= _homunculusCreateTime) && (_hpPoints == 100) && (_spPoints == 10) && (_vpPoints == 5)) int chance;
int random;
int homunculusId = 0;
while (homunculusId == 0)
{ {
int homunculusId = 0; chance = Rnd.get(100);
final int chance = Rnd.get(100); random = Rnd.get(100);
if (chance >= 60) // Basic Homunculus
// Basic Homunculus
if (chance >= 60)
{ {
final int random = Rnd.get(100); if ((random >= 90) && !player.getHomunculusList().hasHomunculus(1))
if (random >= 90)
{ {
homunculusId = 1; homunculusId = 1;
} }
else if (random >= 80) else if ((random >= 80) && !player.getHomunculusList().hasHomunculus(4))
{ {
homunculusId = 4; homunculusId = 4;
} }
else if (random >= 70) else if ((random >= 70) && !player.getHomunculusList().hasHomunculus(7))
{ {
homunculusId = 7; homunculusId = 7;
} }
else if (random >= 60) else if ((random >= 60) && !player.getHomunculusList().hasHomunculus(10))
{ {
homunculusId = 10; homunculusId = 10;
} }
else if (random >= 50) else if ((random >= 50) && !player.getHomunculusList().hasHomunculus(13))
{ {
homunculusId = 13; homunculusId = 13;
} }
else if (random >= 40) else if ((random >= 40) && !player.getHomunculusList().hasHomunculus(16))
{ {
homunculusId = 16; homunculusId = 16;
} }
else if (random >= 30) else if ((random >= 30) && !player.getHomunculusList().hasHomunculus(19))
{ {
homunculusId = 19; homunculusId = 19;
} }
else if (random >= 20) else if ((random >= 20) && !player.getHomunculusList().hasHomunculus(22))
{ {
homunculusId = 22; homunculusId = 22;
} }
else if (random >= 10) else if ((random >= 10) && !player.getHomunculusList().hasHomunculus(25))
{ {
homunculusId = 25; homunculusId = 25;
} }
else else if (!player.getHomunculusList().hasHomunculus(28))
{ {
homunculusId = 28; homunculusId = 28;
} }
} }
else if (chance >= 10) // Water Homunculus
// Water Homunculus
if ((homunculusId == 0) && (chance >= 10))
{ {
final int random = Rnd.get(100); if ((random >= 90) && !player.getHomunculusList().hasHomunculus(2))
if (random >= 90)
{ {
homunculusId = 2; homunculusId = 2;
} }
else if (random >= 80) else if ((random >= 80) && !player.getHomunculusList().hasHomunculus(5))
{ {
homunculusId = 5; homunculusId = 5;
} }
else if (random >= 70) else if ((random >= 70) && !player.getHomunculusList().hasHomunculus(8))
{ {
homunculusId = 8; homunculusId = 8;
} }
else if (random >= 60) else if ((random >= 60) && !player.getHomunculusList().hasHomunculus(11))
{ {
homunculusId = 11; homunculusId = 11;
} }
else if (random >= 50) else if ((random >= 50) && !player.getHomunculusList().hasHomunculus(14))
{ {
homunculusId = 14; homunculusId = 14;
} }
else if (random >= 40) else if ((random >= 40) && !player.getHomunculusList().hasHomunculus(17))
{ {
homunculusId = 17; homunculusId = 17;
} }
else if (random >= 30) else if ((random >= 30) && !player.getHomunculusList().hasHomunculus(20))
{ {
homunculusId = 20; homunculusId = 20;
} }
else if (random >= 20) else if ((random >= 20) && !player.getHomunculusList().hasHomunculus(23))
{ {
homunculusId = 23; homunculusId = 23;
} }
else if (random >= 10) else if ((random >= 10) && !player.getHomunculusList().hasHomunculus(26))
{ {
homunculusId = 26; homunculusId = 26;
} }
else else if (!player.getHomunculusList().hasHomunculus(29))
{ {
homunculusId = 29; homunculusId = 29;
} }
} }
else // Luminous Homunculus
// Luminous Homunculus
if (homunculusId == 0)
{ {
final int random = Rnd.get(100); if ((random >= 90) && !player.getHomunculusList().hasHomunculus(3))
if (random >= 90)
{ {
homunculusId = 3; homunculusId = 3;
} }
else if (random >= 80) else if ((random >= 80) && !player.getHomunculusList().hasHomunculus(6))
{ {
homunculusId = 6; homunculusId = 6;
} }
else if (random >= 70) else if ((random >= 70) && !player.getHomunculusList().hasHomunculus(9))
{ {
homunculusId = 9; homunculusId = 9;
} }
else if (random >= 60) else if ((random >= 60) && !player.getHomunculusList().hasHomunculus(12))
{ {
homunculusId = 12; homunculusId = 12;
} }
else if (random >= 50) else if ((random >= 50) && !player.getHomunculusList().hasHomunculus(15))
{ {
homunculusId = 15; homunculusId = 15;
} }
else if (random >= 40) else if ((random >= 40) && !player.getHomunculusList().hasHomunculus(18))
{ {
homunculusId = 18; homunculusId = 18;
} }
else if (random >= 30) else if ((random >= 30) && !player.getHomunculusList().hasHomunculus(21))
{ {
homunculusId = 21; homunculusId = 21;
} }
else if (random >= 20) else if ((random >= 20) && !player.getHomunculusList().hasHomunculus(24))
{ {
homunculusId = 24; homunculusId = 24;
} }
else if (random >= 10) else if ((random >= 10) && !player.getHomunculusList().hasHomunculus(27))
{ {
homunculusId = 27; homunculusId = 27;
} }
else else if (!player.getHomunculusList().hasHomunculus(30))
{ {
homunculusId = 30; homunculusId = 30;
} }
} }
}
final HomunculusTemplate template = HomunculusData.getInstance().getTemplate(homunculusId);
if (template == null) final HomunculusTemplate template = HomunculusData.getInstance().getTemplate(homunculusId);
{ if (template == null)
LOGGER.warning("Counld not find Homunculus template " + homunculusId + "."); {
return; LOGGER.warning("Counld not find Homunculus template " + homunculusId + ".");
} return;
}
final Homunculus homunculus = new Homunculus(template, player.getHomunculusList().size(), 1, 0, 0, 0, 0, 0, 0, false);
if (player.getHomunculusList().add(homunculus)) final Homunculus homunculus = new Homunculus(template, player.getHomunculusList().size(), 1, 0, 0, 0, 0, 0, 0, false);
{ if (player.getHomunculusList().add(homunculus))
player.getVariables().set(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0); {
player.getVariables().set(PlayerVariables.HOMUNCULUS_HP_POINTS, 0); player.getVariables().set(PlayerVariables.HOMUNCULUS_CREATION_TIME, 0);
player.getVariables().set(PlayerVariables.HOMUNCULUS_SP_POINTS, 0); player.getVariables().set(PlayerVariables.HOMUNCULUS_HP_POINTS, 0);
player.getVariables().set(PlayerVariables.HOMUNCULUS_VP_POINTS, 0); player.getVariables().set(PlayerVariables.HOMUNCULUS_SP_POINTS, 0);
player.sendPacket(new ExShowHomunculusBirthInfo(player)); player.getVariables().set(PlayerVariables.HOMUNCULUS_VP_POINTS, 0);
player.sendPacket(new ExShowHomunculusList(player)); player.sendPacket(new ExShowHomunculusBirthInfo(player));
player.sendPacket(new ExHomunculusSummonResult()); player.sendPacket(new ExShowHomunculusList(player));
} player.sendPacket(new ExHomunculusSummonResult());
} }
} }
} }