Alex King e55f9b9d27
[Feature] Add Support for item textures higher than 65,535 (#3494)
* [Feature] Add Support for item textures higher than 65,535

# Notes
- We were previously using `uint16` which has a max of `65,535`, but some of the new Live textures that are being used have values way beyond this.
- Updates quest API, commands, and database tables that also used `uint16`.

* Update version.h
2023-07-14 18:49:59 -04:00

46 lines
1.1 KiB
C++
Executable File

#include "../client.h"
#include "../../common/data_verification.h"
void command_wc(Client *c, const Seperator *sep)
{
const auto arguments = sep->argnum;
if (
arguments < 2 ||
!sep->IsNumber(1) ||
!sep->IsNumber(2)
) {
c->Message(Chat::White, "Usage: #wc [Slot ID] [Material]");
c->Message(Chat::White, "Usage: #wc [Slot ID] [Material] [Hero Forge Model] [Elite Material]");
return;
}
Mob* t = c;
if (c->GetTarget()) {
t = c->GetTarget();
}
const uint8 slot_id = Strings::ToUnsignedInt(sep->arg[1]);
const uint32 texture = Strings::ToUnsignedInt(sep->arg[2]);
uint32 hero_forge_model = 0;
uint32 elite_material = 0;
if (arguments >= 3 && sep->IsNumber(3)) {
hero_forge_model = Strings::ToUnsignedInt(sep->arg[3]);
if (EQ::ValueWithin(hero_forge_model, 1, 999)) { // Shorthand Hero Forge ID. Otherwise use the value the user entered.
hero_forge_model = (hero_forge_model * 100) + slot_id;
}
}
if (arguments >= 4 && sep->IsNumber(4)) {
elite_material = Strings::ToUnsignedInt(sep->arg[4]);
}
t->SendTextureWC(
slot_id,
texture,
hero_forge_model,
elite_material
);
}