Skip to content

Commit

Permalink
Adjust Barbershop handling
Browse files Browse the repository at this point in the history
  • Loading branch information
LtRipley36706 committed Dec 29, 2023
1 parent 343a8a9 commit 9be0e2a
Show file tree
Hide file tree
Showing 3 changed files with 378 additions and 65 deletions.
1 change: 1 addition & 0 deletions Source/ACE.Server/Command/Handlers/DeveloperCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ public static void MoveTo(Session session, params string[] parameters)
[CommandHandler("barbershop", AccessLevel.Developer, CommandHandlerFlag.RequiresWorld, "Displays the barber ui")]
public static void BarberShop(Session session, params string[] parameters)
{
session.Player.BarberActive = true;
session.Network.EnqueueSend(new GameEventStartBarber(session));
}

Expand Down
66 changes: 1 addition & 65 deletions Source/ACE.Server/WorldObjects/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -675,71 +675,7 @@ public void SendAutonomousPosition()



public void HandleActionFinishBarber(ClientMessage message)
{
// Read the payload sent from the client...
PaletteBaseId = message.Payload.ReadUInt32();
HeadObjectDID = message.Payload.ReadUInt32();
Character.HairTexture = message.Payload.ReadUInt32();
Character.DefaultHairTexture = message.Payload.ReadUInt32();
CharacterChangesDetected = true;
EyesTextureDID = message.Payload.ReadUInt32();
DefaultEyesTextureDID = message.Payload.ReadUInt32();
NoseTextureDID = message.Payload.ReadUInt32();
DefaultNoseTextureDID = message.Payload.ReadUInt32();
MouthTextureDID = message.Payload.ReadUInt32();
DefaultMouthTextureDID = message.Payload.ReadUInt32();
SkinPaletteDID = message.Payload.ReadUInt32();
HairPaletteDID = message.Payload.ReadUInt32();
EyesPaletteDID = message.Payload.ReadUInt32();
SetupTableId = message.Payload.ReadUInt32();

uint option_bound = message.Payload.ReadUInt32(); // Supress Levitation - Empyrean Only
uint option_unk = message.Payload.ReadUInt32(); // Unknown - Possibly set aside for future use?

// Check if Character is Empyrean, and if we need to set/change/send new motion table
if (Heritage == 9)
{
// These are the motion tables for Empyrean float and not-float (one for each gender). They are hard-coded into the client.
const uint EmpyreanMaleFloatMotionDID = 0x0900020Bu;
const uint EmpyreanFemaleFloatMotionDID = 0x0900020Au;
const uint EmpyreanMaleMotionDID = 0x0900020Eu;
const uint EmpyreanFemaleMotionDID = 0x0900020Du;

// Check for the Levitation option for Empyrean. Shadow crown and Undead flames are handled by client.
if (Gender == 1) // Male
{
if (option_bound == 1 && MotionTableId != EmpyreanMaleMotionDID)
{
MotionTableId = EmpyreanMaleMotionDID;
Session.Network.EnqueueSend(new GameMessagePrivateUpdateDataID(this, PropertyDataId.MotionTable, (uint)MotionTableId));
}
else if (option_bound == 0 && MotionTableId != EmpyreanMaleFloatMotionDID)
{
MotionTableId = EmpyreanMaleFloatMotionDID;
Session.Network.EnqueueSend(new GameMessagePrivateUpdateDataID(this, PropertyDataId.MotionTable, (uint)MotionTableId));
}
}
else // Female
{
if (option_bound == 1 && MotionTableId != EmpyreanFemaleMotionDID)
{
MotionTableId = EmpyreanFemaleMotionDID;
Session.Network.EnqueueSend(new GameMessagePrivateUpdateDataID(this, PropertyDataId.MotionTable, (uint)MotionTableId));
}
else if (option_bound == 0 && MotionTableId != EmpyreanFemaleFloatMotionDID)
{
MotionTableId = EmpyreanFemaleFloatMotionDID;
Session.Network.EnqueueSend(new GameMessagePrivateUpdateDataID(this, PropertyDataId.MotionTable, (uint)MotionTableId));
}
}
}


// Broadcast updated character appearance
EnqueueBroadcast(new GameMessageObjDescEvent(this));
BarberActive = false;
}


/// <summary>
/// Sends object description if the client requests it
Expand Down
Loading

0 comments on commit 9be0e2a

Please sign in to comment.