I’m facing a major issue in Nostale where certain packets are not loading correctly. Sometimes, I can’t see the reputation of a character, their fairy, or other important information. Additionally, when I click on a character and the st packet is sent, the faction is simply not displayed.
I don’t understand why this is happening, and I’d really appreciate any help!
Here’s the relevant part of my code:
Quote:
public void GetNamedCharacterInformation(NcifPacket ncifPacket)
{
switch (ncifPacket.Type)
{
// Player characters
case 1:
var targetSession = ServerManager.Instance.GetSessionByCharacterId(nci fPacket.TargetId);
if (targetSession?.Character != null)
{
Character target = targetSession.Character;
int hpPercentage = (int)((float)target.Hp / target.HPLoad() * 100);
int mpPercentage = (int)((float)target.Mp / target.MPLoad() * 100);
// Setting the correct Faction ID
int factionId = target.Faction switch
{
FactionType.Angel => 1,
FactionType.Demon => 2,
_ => 3 // Default: Neutral
};
// Debugging logs
Console.WriteLine($"Faction-ID for {target.Name}: {factionId}");
Console.WriteLine($"Reputation for {target.Name}: {target.Reputation.ToString("F2", CultureInfo.InvariantCulture)}");
// Sending updated data to the client
Session.SendPacket($"ncif 1 {target.CharacterId}");
Session.SendPacket($"st 1 {target.CharacterId} {target.Level} {target.HeroLevel} {hpPercentage} {mpPercentage} {target.Hp} {target.Mp} {target.HPLoad()} {target.MPLoad()} {factionId} {target.Reputation.ToString("F2", CultureInfo.InvariantCulture)}");
}
break;
}
}
What’s the Issue?
- Some packets (Reputation, Fairy, Faction) are not being received correctly.
- The faction is missing when the st packet is opened.
- I’m not sure what’s causing this issue.
If anyone has experience with this and can help, please leave your Discord so we can discuss further. Of course, I’m willing to pay for the help!
Thanks in advance!