Homunculus summon result packet improvements.

Contributed by nasseka.
This commit is contained in:
MobiusDevelopment
2022-07-14 09:53:03 +00:00
parent a72aa6a826
commit fbee304684
11 changed files with 34 additions and 45 deletions

View File

@@ -70,6 +70,7 @@ public class RequestExHomunculusSummon implements IClientIncomingPacket
if (chance > TEMPLATE.getMaxChance())
{
player.sendMessage("Homunculus is not created!");
player.sendPacket(new ExHomunculusSummonResult(0));
return;
}
for (int i = 0; i < TEMPLATE.getCreationChance().size(); i++)
@@ -99,8 +100,8 @@ public class RequestExHomunculusSummon implements IClientIncomingPacket
player.getVariables().set(PlayerVariables.HOMUNCULUS_SP_POINTS, 0);
player.getVariables().set(PlayerVariables.HOMUNCULUS_VP_POINTS, 0);
player.sendPacket(new ExShowHomunculusBirthInfo(player));
player.sendPacket(new ExHomunculusSummonResult(1));
player.sendPacket(new ExShowHomunculusList(player));
player.sendPacket(new ExHomunculusSummonResult());
}
}
}

View File

@@ -23,15 +23,18 @@ import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
public class ExHomunculusSummonResult implements IClientOutgoingPacket
{
public ExHomunculusSummonResult()
private final int _success;
public ExHomunculusSummonResult(int success)
{
_success = success;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_HOMUNCULUS_SUMMON_RESULT.writeId(packet);
packet.writeD(1); // 1 - success
packet.writeD(_success); // 1 - success
packet.writeD(SystemMessageId.A_NEW_HOMUNCULUS_IS_CREATED.getId());
return true;
}