[Hotfix] Illusion Revert (#1398)

* Revert some "fixes", clean some code up

* Use RaceGender default height data for when calculating size during SendIllusionPacket which should alleviate some inconsistencies for new clients zoning in and seeing the entity

* Some code cleanup
This commit is contained in:
Chris Miles 2021-06-13 18:06:27 -05:00 committed by GitHub
parent e1e5873398
commit 8d90b5a2e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 103 additions and 102 deletions

View File

@ -1811,23 +1811,25 @@ void Mob::SendIllusionPacket(
new_drakkin_details = (in_drakkin_details == 0xFFFFFFFF) ? GetDrakkinDetails() : in_drakkin_details; new_drakkin_details = (in_drakkin_details == 0xFFFFFFFF) ? GetDrakkinDetails() : in_drakkin_details;
new_aa_title = in_aa_title; new_aa_title = in_aa_title;
// Reset features to Base from the Player Profile bool reset_features_to_player_profile = IsClient() && in_race == 0;
if (IsClient() && in_race == 0) { if (reset_features_to_player_profile) {
race = CastToClient()->GetBaseRace(); auto c = CastToClient();
gender = CastToClient()->GetBaseGender(); race = c->GetBaseRace();
gender = c->GetBaseGender();
new_texture = texture = 0xFF; new_texture = texture = 0xFF;
new_helmtexture = helmtexture = 0xFF; new_helmtexture = helmtexture = 0xFF;
new_haircolor = haircolor = CastToClient()->GetBaseHairColor(); new_haircolor = haircolor = c->GetBaseHairColor();
new_beardcolor = beardcolor = CastToClient()->GetBaseBeardColor(); new_beardcolor = beardcolor = c->GetBaseBeardColor();
new_eyecolor1 = eyecolor1 = CastToClient()->GetBaseEyeColor(); new_eyecolor1 = eyecolor1 = c->GetBaseEyeColor();
new_eyecolor2 = eyecolor2 = CastToClient()->GetBaseEyeColor(); new_eyecolor2 = eyecolor2 = c->GetBaseEyeColor();
new_hairstyle = hairstyle = CastToClient()->GetBaseHairStyle(); new_hairstyle = hairstyle = c->GetBaseHairStyle();
new_luclinface = luclinface = CastToClient()->GetBaseFace(); new_luclinface = luclinface = c->GetBaseFace();
new_beard = beard = CastToClient()->GetBaseBeard(); new_beard = beard = c->GetBaseBeard();
new_aa_title = aa_title = 0xFF; new_aa_title = aa_title = 0xFF;
new_drakkin_heritage = drakkin_heritage = CastToClient()->GetBaseHeritage(); new_drakkin_heritage = drakkin_heritage = c->GetBaseHeritage();
new_drakkin_tattoo = drakkin_tattoo = CastToClient()->GetBaseTattoo(); new_drakkin_tattoo = drakkin_tattoo = c->GetBaseTattoo();
new_drakkin_details = drakkin_details = CastToClient()->GetBaseDetails(); new_drakkin_details = drakkin_details = c->GetBaseDetails();
switch (race) { switch (race) {
case OGRE: case OGRE:
size = 9; size = 9;
@ -1858,50 +1860,52 @@ void Mob::SendIllusionPacket(
} }
} }
// update internal values for mob // update internal values for mob from illusion
// TODO: Move this to its own SetIllusion function later size = (in_size <= 0.0f) ? GetRaceGenderDefaultHeight(race, gender) : in_size;
// size = (in_size <= 0.0f) ? GetSize() : in_size; texture = new_texture;
// texture = new_texture; helmtexture = new_helmtexture;
// helmtexture = new_helmtexture; haircolor = new_haircolor;
// haircolor = new_haircolor; beardcolor = new_beardcolor;
// beardcolor = new_beardcolor; eyecolor1 = new_eyecolor1;
// eyecolor1 = new_eyecolor1; eyecolor2 = new_eyecolor2;
// eyecolor2 = new_eyecolor2; hairstyle = new_hairstyle;
// hairstyle = new_hairstyle; luclinface = new_luclinface;
// luclinface = new_luclinface; beard = new_beard;
// beard = new_beard; drakkin_heritage = new_drakkin_heritage;
// drakkin_heritage = new_drakkin_heritage; drakkin_tattoo = new_drakkin_tattoo;
// drakkin_tattoo = new_drakkin_tattoo; drakkin_details = new_drakkin_details;
// drakkin_details = new_drakkin_details;
// send packet
auto outapp = new EQApplicationPacket(OP_Illusion, sizeof(Illusion_Struct)); auto outapp = new EQApplicationPacket(OP_Illusion, sizeof(Illusion_Struct));
Illusion_Struct *is = (Illusion_Struct *) outapp->pBuffer; auto *i = (Illusion_Struct *) outapp->pBuffer;
is->spawnid = GetID(); i->spawnid = GetID();
strcpy(is->charname, GetCleanName()); strcpy(i->charname, GetCleanName());
is->race = race; i->race = race;
is->gender = gender; i->gender = gender;
is->texture = new_texture; i->texture = new_texture;
is->helmtexture = new_helmtexture; i->helmtexture = new_helmtexture;
is->haircolor = new_haircolor; i->haircolor = new_haircolor;
is->beardcolor = new_beardcolor; i->beardcolor = new_beardcolor;
is->beard = new_beard; i->beard = new_beard;
is->eyecolor1 = new_eyecolor1; i->eyecolor1 = new_eyecolor1;
is->eyecolor2 = new_eyecolor2; i->eyecolor2 = new_eyecolor2;
is->hairstyle = new_hairstyle; i->hairstyle = new_hairstyle;
is->face = new_luclinface; i->face = new_luclinface;
is->drakkin_heritage = new_drakkin_heritage; i->drakkin_heritage = new_drakkin_heritage;
is->drakkin_tattoo = new_drakkin_tattoo; i->drakkin_tattoo = new_drakkin_tattoo;
is->drakkin_details = new_drakkin_details; i->drakkin_details = new_drakkin_details;
is->size = size; i->size = size;
entity_list.QueueClients(this, outapp); entity_list.QueueClients(this, outapp);
safe_delete(outapp); safe_delete(outapp);
/* Refresh armor and tints after send illusion packet */ // Refresh armor and tints after send illusion packet
SendArmorAppearance(); SendArmorAppearance();
LogSpells( LogMobAppearance(
"Illusion: Race [{}] Gender [{}] Texture [{}] HelmTexture [{}] HairColor [{}] BeardColor [{}] EyeColor1 [{}] EyeColor2 [{}] HairStyle [{}] Face [{}] DrakkinHeritage [{}] DrakkinTattoo [{}] DrakkinDetails [{}] Size [{}]", "[SendIllusionPacket] race [{}] gender [{}] new_texture [{}] new_helmtexture [{}] new_haircolor [{}] new_beardcolor [{}] "
"new_eyecolor1 [{}] new_eyecolor2 [{}] new_hairstyle [{}] new_luclinface [{}] new_drakkin_heritage [{}] "
"new_drakkin_tattoo [{}] new_drakkin_details [{}] size [{}]",
race, race,
gender, gender,
new_texture, new_texture,

View File

@ -378,9 +378,7 @@ void Mob::SendArmorAppearance(Client *one_client)
* The other packets work for primary/secondary. * The other packets work for primary/secondary.
*/ */
Log(Logs::Detail, Logs::MobAppearance, "Mob::SendArmorAppearance [%s]", LogMobAppearance("[SendArmorAppearance] [{}]", GetCleanName());
this->GetCleanName()
);
if (IsPlayerRace(race)) { if (IsPlayerRace(race)) {
if (!IsClient()) { if (!IsClient()) {

View File

@ -1476,8 +1476,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
} }
} }
for (int x = EQ::textures::textureBegin; x <= EQ::textures::LastTintableTexture; x++) SendArmorAppearance();
SendWearChange(x);
if (caster == this && spell.id != 287 && spell.id != 601 && if (caster == this && spell.id != 287 && spell.id != 601 &&
(spellbonuses.IllusionPersistence || aabonuses.IllusionPersistence || (spellbonuses.IllusionPersistence || aabonuses.IllusionPersistence ||
@ -3878,30 +3877,30 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
case SE_Illusion: case SE_Illusion:
{ {
SendIllusionPacket(0, GetBaseGender()); SendIllusionPacket(0, GetBaseGender());
if(GetRace() == OGRE){ if (GetRace() == OGRE) {
SendAppearancePacket(AT_Size, 9); SendAppearancePacket(AT_Size, 9);
} }
else if(GetRace() == TROLL){ else if (GetRace() == TROLL) {
SendAppearancePacket(AT_Size, 8); SendAppearancePacket(AT_Size, 8);
} }
else if(GetRace() == VAHSHIR || GetRace() == FROGLOK || GetRace() == BARBARIAN){ else if (GetRace() == VAHSHIR || GetRace() == FROGLOK || GetRace() == BARBARIAN) {
SendAppearancePacket(AT_Size, 7); SendAppearancePacket(AT_Size, 7);
} }
else if(GetRace() == HALF_ELF || GetRace() == WOOD_ELF || GetRace() == DARK_ELF){ else if (GetRace() == HALF_ELF || GetRace() == WOOD_ELF || GetRace() == DARK_ELF) {
SendAppearancePacket(AT_Size, 5); SendAppearancePacket(AT_Size, 5);
} }
else if(GetRace() == DWARF){ else if (GetRace() == DWARF) {
SendAppearancePacket(AT_Size, 4); SendAppearancePacket(AT_Size, 4);
} }
else if(GetRace() == HALFLING || GetRace() == GNOME){ else if (GetRace() == HALFLING || GetRace() == GNOME) {
SendAppearancePacket(AT_Size, 3); SendAppearancePacket(AT_Size, 3);
} }
else{ else {
SendAppearancePacket(AT_Size, 6); SendAppearancePacket(AT_Size, 6);
} }
for (int x = EQ::textures::textureBegin; x <= EQ::textures::LastTintableTexture; x++){
SendWearChange(x); SendArmorAppearance();
}
break; break;
} }