Implemented EQEmu::TextureProfile

This commit is contained in:
Uleat
2016-06-01 08:54:26 -04:00
parent ae3c98c692
commit cd8cd90a38
29 changed files with 467 additions and 462 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ Beacon::Beacon(Mob *at_mob, int lifetime)
:Mob
(
nullptr, nullptr, 0, 0, 0, INVISIBLE_MAN, 0, BT_NoTarget, 0, 0, 0, 0, 0, at_mob->GetPosition(), 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, EQEmu::TintProfile(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
),
remove_timer(lifetime),
spell_timer(0)
+9 -9
View File
@@ -2961,16 +2961,16 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
if (inst) {
item = inst->GetItem();
if (item != 0) {
ns->spawn.equipment[i].Material = item->Material;
ns->spawn.equipment[i].EliteMaterial = item->EliteMaterial;
ns->spawn.equipment[i].HeroForgeModel = item->HerosForgeModel;
if (armor_tint[i])
ns->spawn.equipment_tint.Slot[i].Color = armor_tint[i];
ns->spawn.equipment.Slot[i].Material = item->Material;
ns->spawn.equipment.Slot[i].EliteMaterial = item->EliteMaterial;
ns->spawn.equipment.Slot[i].HeroForgeModel = item->HerosForgeModel;
if (armor_tint.Slot[i].Color)
ns->spawn.equipment_tint.Slot[i].Color = armor_tint.Slot[i].Color;
else
ns->spawn.equipment_tint.Slot[i].Color = item->Color;
} else {
if (armor_tint[i])
ns->spawn.equipment_tint.Slot[i].Color = armor_tint[i];
if (armor_tint.Slot[i].Color)
ns->spawn.equipment_tint.Slot[i].Color = armor_tint.Slot[i].Color;
}
}
}
@@ -2980,7 +2980,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
item = inst->GetItem();
if(item) {
if(strlen(item->IDFile) > 2)
ns->spawn.equipment[EQEmu::textures::TexturePrimary].Material = atoi(&item->IDFile[2]);
ns->spawn.equipment.Primary.Material = atoi(&item->IDFile[2]);
ns->spawn.equipment_tint.Primary.Color = GetEquipmentColor(EQEmu::textures::TexturePrimary);
}
@@ -2991,7 +2991,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
item = inst->GetItem();
if(item) {
if(strlen(item->IDFile) > 2)
ns->spawn.equipment[EQEmu::textures::TextureSecondary].Material = atoi(&item->IDFile[2]);
ns->spawn.equipment.Secondary.Material = atoi(&item->IDFile[2]);
ns->spawn.equipment_tint.Secondary.Color = GetEquipmentColor(EQEmu::textures::TextureSecondary);
}
+3 -3
View File
@@ -100,7 +100,7 @@ Client::Client(EQStreamInterface* ieqs)
0, // Drakkin Heritage
0, // Drakkin Tattoo
0, // Drakkin Details
0, // Armor Tint
EQEmu::TintProfile(), // Armor Tint
0xff, // AA Title
0, // see_invis
0, // see_invis_undead
@@ -2732,7 +2732,7 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id) {
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
if (matslot != EQEmu::textures::TextureInvalid)
{
m_pp.item_material[matslot] = GetEquipmentMaterial(matslot);
m_pp.item_material.Slot[matslot].Material = GetEquipmentMaterial(matslot);
}
}
}
@@ -6286,7 +6286,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
made_npc->d_melee_texture1 = GetEquipmentMaterial(EQEmu::textures::TexturePrimary);
made_npc->d_melee_texture2 = GetEquipmentMaterial(EQEmu::textures::TextureSecondary);
for (int i = EQEmu::textures::TextureBegin; i <= EQEmu::textures::LastTexture; i++) {
made_npc->armor_tint[i] = GetEquipmentColor(i);
made_npc->armor_tint.Slot[i].Color = GetEquipmentColor(i);
}
made_npc->loottable_id = 0;
+3 -3
View File
@@ -153,7 +153,7 @@ Corpse::Corpse(NPC* in_npc, ItemList* in_itemlist, uint32 in_npctypeid, const NP
in_npc->GetDeity(),in_npc->GetLevel(),in_npc->GetNPCTypeID(),in_npc->GetSize(),0,
in_npc->GetPosition(), in_npc->GetInnateLightType(), in_npc->GetTexture(),in_npc->GetHelmTexture(),
0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0xff,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
0,0,0,0,0,0,0,0,0,0,EQEmu::TintProfile(),0xff,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
corpse_decay_timer(in_decaytime),
corpse_rez_timer(0),
corpse_delay_timer(RuleI(NPC, CorpseUnlockTimer)),
@@ -244,7 +244,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
client->GetPP().drakkin_heritage, // uint32 in_drakkin_heritage,
client->GetPP().drakkin_tattoo, // uint32 in_drakkin_tattoo,
client->GetPP().drakkin_details, // uint32 in_drakkin_details,
0, // uint32 in_armor_tint[_MaterialCount],
EQEmu::TintProfile(), // uint32 in_armor_tint[_MaterialCount],
0xff, // uint8 in_aa_title,
0, // uint8 in_see_invis, // see through invis
0, // uint8 in_see_invis_undead, // see through invis vs. undead
@@ -474,7 +474,7 @@ in_helmtexture,
0,
0,
0,
0,
EQEmu::TintProfile(),
0xff,
0,
0,
+1 -1
View File
@@ -36,7 +36,7 @@ Encounter::Encounter(const char* enc_name)
:Mob
(
nullptr, nullptr, 0, 0, 0, INVISIBLE_MAN, 0, BT_NoTarget, 0, 0, 0, 0, 0, glm::vec4(0,0,0,0), 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, EQEmu::TintProfile(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
)
{
encounter_name[0] = 0;
+9 -9
View File
@@ -1400,15 +1400,15 @@ void lua_create_npc(luabind::adl::object table, float x, float y, float z, float
LuaCreateNPCParse(drakkin_heritage, uint32, 0);
LuaCreateNPCParse(drakkin_tattoo, uint32, 0);
LuaCreateNPCParse(drakkin_details, uint32, 0);
LuaCreateNPCParse(armor_tint[0], uint32, 0);
LuaCreateNPCParse(armor_tint[1], uint32, 0);
LuaCreateNPCParse(armor_tint[2], uint32, 0);
LuaCreateNPCParse(armor_tint[3], uint32, 0);
LuaCreateNPCParse(armor_tint[4], uint32, 0);
LuaCreateNPCParse(armor_tint[5], uint32, 0);
LuaCreateNPCParse(armor_tint[6], uint32, 0);
LuaCreateNPCParse(armor_tint[7], uint32, 0);
LuaCreateNPCParse(armor_tint[8], uint32, 0);
LuaCreateNPCParse(armor_tint.Head.Color, uint32, 0);
LuaCreateNPCParse(armor_tint.Chest.Color, uint32, 0);
LuaCreateNPCParse(armor_tint.Arms.Color, uint32, 0);
LuaCreateNPCParse(armor_tint.Wrist.Color, uint32, 0);
LuaCreateNPCParse(armor_tint.Hands.Color, uint32, 0);
LuaCreateNPCParse(armor_tint.Legs.Color, uint32, 0);
LuaCreateNPCParse(armor_tint.Feet.Color, uint32, 0);
LuaCreateNPCParse(armor_tint.Primary.Color, uint32, 0);
LuaCreateNPCParse(armor_tint.Secondary.Color, uint32, 0);
LuaCreateNPCParse(min_dmg, uint32, 2);
LuaCreateNPCParse(max_dmg, uint32, 4);
LuaCreateNPCParse(attack_count, int16, 0);
+9 -16
View File
@@ -73,7 +73,7 @@ Mob::Mob(const char* in_name,
uint32 in_drakkin_heritage,
uint32 in_drakkin_tattoo,
uint32 in_drakkin_details,
uint32 in_armor_tint[EQEmu::textures::TextureCount],
EQEmu::TintProfile in_armor_tint,
uint8 in_aa_title,
uint8 in_see_invis, // see through invis/ivu
@@ -280,14 +280,7 @@ Mob::Mob(const char* in_name,
for (i = 0; i < EQEmu::textures::TextureCount; i++)
{
if (in_armor_tint)
{
armor_tint[i] = in_armor_tint[i];
}
else
{
armor_tint[i] = 0;
}
armor_tint.Slot[i].Color = in_armor_tint.Slot[i].Color;
}
m_Delta = glm::vec4();
@@ -1159,9 +1152,9 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
// Only Player Races Wear Armor
if (Mob::IsPlayerRace(race) || i > 6)
{
ns->spawn.equipment[i].Material = GetEquipmentMaterial(i);
ns->spawn.equipment[i].EliteMaterial = IsEliteMaterialItem(i);
ns->spawn.equipment[i].HeroForgeModel = GetHerosForgeModel(i);
ns->spawn.equipment.Slot[i].Material = GetEquipmentMaterial(i);
ns->spawn.equipment.Slot[i].EliteMaterial = IsEliteMaterialItem(i);
ns->spawn.equipment.Slot[i].HeroForgeModel = GetHerosForgeModel(i);
ns->spawn.equipment_tint.Slot[i].Color = GetEquipmentColor(i);
}
}
@@ -2821,7 +2814,7 @@ void Mob::SetSlotTint(uint8 material_slot, uint8 red_tint, uint8 green_tint, uin
color |= (green_tint & 0xFF) << 8;
color |= (blue_tint & 0xFF);
color |= (color) ? (0xFF << 24) : 0;
armor_tint[material_slot] = color;
armor_tint.Slot[material_slot].Color = color;
auto outapp = new EQApplicationPacket(OP_WearChange, sizeof(WearChange_Struct));
WearChange_Struct* wc = (WearChange_Struct*)outapp->pBuffer;
@@ -2838,7 +2831,7 @@ void Mob::SetSlotTint(uint8 material_slot, uint8 red_tint, uint8 green_tint, uin
void Mob::WearChange(uint8 material_slot, uint16 texture, uint32 color, uint32 hero_forge_model)
{
armor_tint[material_slot] = color;
armor_tint.Slot[material_slot].Color = color;
auto outapp = new EQApplicationPacket(OP_WearChange, sizeof(WearChange_Struct));
WearChange_Struct* wc = (WearChange_Struct*)outapp->pBuffer;
@@ -2966,9 +2959,9 @@ uint32 Mob::GetEquipmentColor(uint8 material_slot) const
{
const EQEmu::ItemBase *item;
if (armor_tint[material_slot])
if (armor_tint.Slot[material_slot].Color)
{
return armor_tint[material_slot];
return armor_tint.Slot[material_slot].Color;
}
item = database.GetItem(GetEquipment(material_slot));
+3 -3
View File
@@ -113,7 +113,7 @@ public:
uint32 in_drakkin_heritage,
uint32 in_drakkin_tattoo,
uint32 in_drakkin_details,
uint32 in_armor_tint[EQEmu::textures::TextureCount],
EQEmu::TintProfile in_armor_tint,
uint8 in_aa_title,
uint8 in_see_invis, // see through invis
uint8 in_see_invis_undead, // see through invis vs. undead
@@ -384,7 +384,7 @@ public:
inline uint8 GetDrakkinHeritage() const { return drakkin_heritage; }
inline uint8 GetDrakkinTattoo() const { return drakkin_tattoo; }
inline uint8 GetDrakkinDetails() const { return drakkin_details; }
inline uint32 GetArmorTint(uint8 i) const { return armor_tint[(i < EQEmu::textures::TextureCount) ? i : 0]; }
inline uint32 GetArmorTint(uint8 i) const { return armor_tint.Slot[(i < EQEmu::textures::TextureCount) ? i : 0].Color; }
inline uint8 GetClass() const { return class_; }
inline uint8 GetLevel() const { return level; }
inline uint8 GetOrigLevel() const { return orig_level; }
@@ -1248,7 +1248,7 @@ protected:
uint32 drakkin_heritage;
uint32 drakkin_tattoo;
uint32 drakkin_details;
uint32 armor_tint[EQEmu::textures::TextureCount];
EQEmu::TintProfile armor_tint;
uint8 aa_title;
+1 -1
View File
@@ -94,7 +94,7 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, const glm::vec4& position, int if
d->drakkin_heritage,
d->drakkin_tattoo,
d->drakkin_details,
(uint32*)d->armor_tint,
d->armor_tint,
0,
d->see_invis, // pass see_invis/see_ivu flags to mob constructor
d->see_invis_undead,
+19 -19
View File
@@ -2068,10 +2068,10 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
uint32 armor_tint_id = atoi(row[63]);
temp_npctype_data->armor_tint[0] = (atoi(row[64]) & 0xFF) << 16;
temp_npctype_data->armor_tint[0] |= (atoi(row[65]) & 0xFF) << 8;
temp_npctype_data->armor_tint[0] |= (atoi(row[66]) & 0xFF);
temp_npctype_data->armor_tint[0] |= (temp_npctype_data->armor_tint[0]) ? (0xFF << 24) : 0;
temp_npctype_data->armor_tint.Head.Color = (atoi(row[64]) & 0xFF) << 16;
temp_npctype_data->armor_tint.Head.Color |= (atoi(row[65]) & 0xFF) << 8;
temp_npctype_data->armor_tint.Head.Color |= (atoi(row[66]) & 0xFF);
temp_npctype_data->armor_tint.Head.Color |= (temp_npctype_data->armor_tint.Head.Color) ? (0xFF << 24) : 0;
if (armor_tint_id != 0) {
std::string armortint_query = StringFormat(
@@ -2093,17 +2093,17 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
auto armorTint_row = armortint_results.begin();
for (int index = EQEmu::textures::TextureBegin; index <= EQEmu::textures::LastTexture; index++) {
temp_npctype_data->armor_tint[index] = atoi(armorTint_row[index * 3]) << 16;
temp_npctype_data->armor_tint[index] |= atoi(armorTint_row[index * 3 + 1]) << 8;
temp_npctype_data->armor_tint[index] |= atoi(armorTint_row[index * 3 + 2]);
temp_npctype_data->armor_tint[index] |= (temp_npctype_data->armor_tint[index]) ? (0xFF << 24) : 0;
temp_npctype_data->armor_tint.Slot[index].Color = atoi(armorTint_row[index * 3]) << 16;
temp_npctype_data->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 1]) << 8;
temp_npctype_data->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 2]);
temp_npctype_data->armor_tint.Slot[index].Color |= (temp_npctype_data->armor_tint.Slot[index].Color) ? (0xFF << 24) : 0;
}
}
}
// Try loading npc_types tint fields if armor tint is 0 or query failed to get results
if (armor_tint_id == 0) {
for (int index = EQEmu::textures::TextureChest; index < EQEmu::textures::TextureCount; index++) {
temp_npctype_data->armor_tint[index] = temp_npctype_data->armor_tint[0];
temp_npctype_data->armor_tint.Slot[index].Color = temp_npctype_data->armor_tint.Slot[0].Color; // odd way to 'zero-out' the array...
}
}
@@ -2301,15 +2301,15 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
tmpNPCType->bodytype = 1;
uint32 armor_tint_id = atoi(row[36]);
tmpNPCType->armor_tint[0] = (atoi(row[37]) & 0xFF) << 16;
tmpNPCType->armor_tint[0] |= (atoi(row[38]) & 0xFF) << 8;
tmpNPCType->armor_tint[0] |= (atoi(row[39]) & 0xFF);
tmpNPCType->armor_tint[0] |= (tmpNPCType->armor_tint[0]) ? (0xFF << 24) : 0;
tmpNPCType->armor_tint.Slot[0].Color = (atoi(row[37]) & 0xFF) << 16;
tmpNPCType->armor_tint.Slot[0].Color |= (atoi(row[38]) & 0xFF) << 8;
tmpNPCType->armor_tint.Slot[0].Color |= (atoi(row[39]) & 0xFF);
tmpNPCType->armor_tint.Slot[0].Color |= (tmpNPCType->armor_tint.Slot[0].Color) ? (0xFF << 24) : 0;
if (armor_tint_id == 0)
for (int index = EQEmu::textures::TextureChest; index <= EQEmu::textures::LastTexture; index++)
tmpNPCType->armor_tint[index] = tmpNPCType->armor_tint[0];
else if (tmpNPCType->armor_tint[0] == 0) {
tmpNPCType->armor_tint.Slot[index].Color = tmpNPCType->armor_tint.Slot[0].Color;
else if (tmpNPCType->armor_tint.Slot[0].Color == 0) {
std::string armorTint_query = StringFormat("SELECT red1h, grn1h, blu1h, "
"red2c, grn2c, blu2c, "
"red3a, grn3a, blu3a, "
@@ -2328,10 +2328,10 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
auto armorTint_row = results.begin();
for (int index = EQEmu::textures::TextureBegin; index <= EQEmu::textures::LastTexture; index++) {
tmpNPCType->armor_tint[index] = atoi(armorTint_row[index * 3]) << 16;
tmpNPCType->armor_tint[index] |= atoi(armorTint_row[index * 3 + 1]) << 8;
tmpNPCType->armor_tint[index] |= atoi(armorTint_row[index * 3 + 2]);
tmpNPCType->armor_tint[index] |= (tmpNPCType->armor_tint[index]) ? (0xFF << 24) : 0;
tmpNPCType->armor_tint.Slot[index].Color = atoi(armorTint_row[index * 3]) << 16;
tmpNPCType->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 1]) << 8;
tmpNPCType->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 2]);
tmpNPCType->armor_tint.Slot[index].Color |= (tmpNPCType->armor_tint.Slot[index].Color) ? (0xFF << 24) : 0;
}
}
} else
+1 -1
View File
@@ -86,7 +86,7 @@ struct NPCType
uint32 drakkin_heritage;
uint32 drakkin_tattoo;
uint32 drakkin_details;
uint32 armor_tint[EQEmu::textures::TextureCount];
EQEmu::TintProfile armor_tint;
uint32 min_dmg;
uint32 max_dmg;
int16 attack_count;