mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
* First push * Final push. * Consolidate zone commands in to one. * Update command.cpp * Remove debug messages. * Test * Add support for sub command status levels. * Update command.cpp * Update client.cpp * Update database_update_manifest.cpp * Update version.h * Update item.cpp * Update version.h * Update database_update_manifest.cpp * Fix command arguments. * Help message. * Update command.cpp * Do DB injection/deletion * Indent * Update server_locked.cpp * Update set.cpp * Lock aliases * Update command_subsettings_repository.h * Update set.cpp * Fix --------- Co-authored-by: Akkadius <akkadius1@gmail.com>
57 lines
1.2 KiB
C++
Executable File
57 lines
1.2 KiB
C++
Executable File
#include "../../client.h"
|
|
|
|
void SetTexture(Client *c, const Seperator *sep)
|
|
{
|
|
const auto arguments = sep->argnum;
|
|
if (arguments < 2 || !sep->IsNumber(2)) {
|
|
c->Message(Chat::White, "Usage: #set texture [Texture] [Helmet Texture]");
|
|
return;
|
|
}
|
|
|
|
const uint16 texture = Strings::ToUnsignedInt(sep->arg[2]);
|
|
const uint8 helmet_texture = (
|
|
sep->IsNumber(3) ?
|
|
Strings::ToUnsignedInt(sep->arg[3]) :
|
|
0
|
|
);
|
|
|
|
Mob* t = c;
|
|
if (c->GetTarget()) {
|
|
t = c->GetTarget();
|
|
}
|
|
|
|
if (IsPlayerRace(t->GetModel())) { // Player Races Wear Armor, so Wearchange is sent instead
|
|
for (
|
|
int texture_slot = EQ::textures::textureBegin;
|
|
texture_slot <= EQ::textures::LastTintableTexture;
|
|
texture_slot++
|
|
) {
|
|
t->SendTextureWC(texture_slot, texture);
|
|
}
|
|
} else { // Non-Player Races only need Illusion Packets to be sent for texture
|
|
t->SendIllusionPacket(
|
|
t->GetModel(),
|
|
t->GetGender(),
|
|
texture,
|
|
helmet_texture
|
|
);
|
|
}
|
|
|
|
c->Message(
|
|
Chat::White,
|
|
fmt::format(
|
|
"Texture Changed for {} | Texture: {}{}",
|
|
c->GetTargetDescription(t, TargetDescriptionType::UCSelf),
|
|
texture,
|
|
(
|
|
IsPlayerRace(t->GetModel()) ?
|
|
"" :
|
|
fmt::format(
|
|
" Helmet Texture: {}",
|
|
helmet_texture
|
|
)
|
|
)
|
|
).c_str()
|
|
);
|
|
}
|