[Opcode] Implement SetFace opcode (#2167)

* Implement SetFace opcode

This implements the opcode that's used to update zone clients when a
client updates their face

* Use SetFace in #feature command

Add check for valid number

This adds the #feature eyes command which isn't in the illusion struct
This commit is contained in:
hg
2022-05-11 19:57:20 -04:00
committed by GitHub
parent 29cdd91ca0
commit d8aa8f7e7a
18 changed files with 140 additions and 65 deletions
+21
View File
@@ -2606,6 +2606,27 @@ void Mob::SendIllusionPacket(
);
}
void Mob::SetFaceAppearance(const FaceChange_Struct& face, bool skip_sender)
{
haircolor = face.haircolor;
beardcolor = face.beardcolor;
eyecolor1 = face.eyecolor1;
eyecolor2 = face.eyecolor2;
hairstyle = face.hairstyle;
luclinface = face.face;
beard = face.beard;
drakkin_heritage = face.drakkin_heritage;
drakkin_tattoo = face.drakkin_tattoo;
drakkin_details = face.drakkin_details;
EQApplicationPacket outapp(OP_SetFace, sizeof(FaceChange_Struct));
memcpy(outapp.pBuffer, &face, sizeof(FaceChange_Struct));
auto buf = reinterpret_cast<FaceChange_Struct*>(outapp.pBuffer);
buf->entity_id = GetID();
entity_list.QueueClients(this, &outapp, skip_sender);
}
bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
{
if (IsPlayerRace(GetRace())) {