Fixed Armor Tinting (players and NPCs) that was broken during a previous update.

This commit is contained in:
Trevius 2014-12-19 15:46:01 -06:00
parent fce52d7186
commit ef287bc857
9 changed files with 42 additions and 44 deletions

View File

@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 12/19/2014 ==
Trevius: (RoF2) Fixed Leadership AA Purchasing and Recipe Search by correcting opcodes.
Trevius: Fixed Armor Tinting (players and NPCs) that was broken during a previous update.
== 12/18/2014 ==
Trevius: Finished lining up the RoF2 Player Profile Struct. Zone times are now normal, and everything from the PP is accurate in game now.

View File

@ -5061,11 +5061,6 @@ namespace RoF
isbs.augslots[x].unknown = item->AugSlotUnk2[x];
}
// Increased to 6 max aug slots
//isbs.augslots[5].type = 0;
//isbs.augslots[5].visible = 1;
//isbs.augslots[5].unknown = 0;
isbs.ldonpoint_type = item->PointType;
isbs.ldontheme = item->LDoNTheme;
isbs.ldonprice = item->LDoNPrice;

View File

@ -5076,11 +5076,6 @@ namespace RoF2
isbs.augslots[x].unknown = item->AugSlotUnk2[x];
}
// Increased to 6 max aug slots
//isbs.augslots[5].type = 0;
//isbs.augslots[5].visible = 1;
//isbs.augslots[5].unknown = 0;
isbs.ldonpoint_type = item->PointType;
isbs.ldontheme = item->LDoNTheme;
isbs.ldonprice = item->LDoNPrice;

View File

@ -213,11 +213,21 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct*
}
else
{
uint32 color = 0;
if (pp.item_tint[matslot].rgb.use_tint)
{
color = pp.item_tint[matslot].color;
}
else
{
color = inst->GetColor();
}
// Armor Materials/Models
cs->equip[char_num][matslot].material = item->Material;
cs->equip[char_num][matslot].elitematerial = item->EliteMaterial;
cs->equip[char_num][matslot].heroforgemodel = inst->GetOrnamentHeroModel(matslot);
cs->equip[char_num][matslot].color.color = inst->GetColor();
cs->equip[char_num][matslot].color.color = color;
}
}
}

View File

@ -11276,7 +11276,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
if(!results.Success())
return;
int slotmaterial = Inventory::CalcMaterialFromSlot(setslot);
uint8 slotmaterial = Inventory::CalcMaterialFromSlot(setslot);
c->GetTarget()->CastToBot()->SendWearChange(slotmaterial);
}
else {

View File

@ -2685,8 +2685,11 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id) {
const Item_Struct* item = database.GetItem(item_id);
if (item && (item->ItemClass==ItemClassCommon))
{
uint32 matslot = Inventory::CalcMaterialFromSlot(in_slot);
m_pp.item_material[matslot] = GetEquipmentMaterial(matslot);
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
if (matslot != _MaterialInvalid)
{
m_pp.item_material[matslot] = GetEquipmentMaterial(matslot);
}
}
}
@ -3016,31 +3019,14 @@ void Client::SetTint(int16 in_slot, uint32 color) {
// Still need to reconcile bracer01 versus bracer02
void Client::SetTint(int16 in_slot, Color_Struct& color) {
if (in_slot==MainHead)
m_pp.item_tint[MaterialHead].color=color.color;
else if (in_slot==MainArms)
m_pp.item_tint[MaterialArms].color=color.color;
else if (in_slot==MainWrist1)
m_pp.item_tint[MaterialWrist].color=color.color;
/*
// non-live behavior
else if (in_slot==SLOT_BRACER02)
m_pp.item_tint[MaterialWrist].color=color.color;
*/
else if (in_slot==MainHands)
m_pp.item_tint[MaterialHands].color=color.color;
else if (in_slot==MainPrimary)
m_pp.item_tint[MaterialPrimary].color=color.color;
else if (in_slot==MainSecondary)
m_pp.item_tint[MaterialSecondary].color=color.color;
else if (in_slot==MainChest)
m_pp.item_tint[MaterialChest].color=color.color;
else if (in_slot==MainLegs)
m_pp.item_tint[MaterialLegs].color=color.color;
else if (in_slot==MainFeet)
m_pp.item_tint[MaterialFeet].color=color.color;
database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color.color);
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
if (matslot != _MaterialInvalid)
{
m_pp.item_tint[matslot].color = color.color;
database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color.color);
}
}
void Client::SetHideMe(bool flag)

View File

@ -1425,8 +1425,12 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
/* Set item material tint */
for (int i = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_END; i++)
if (m_pp.item_tint[i].rgb.use_tint == 1 || m_pp.item_tint[i].rgb.use_tint == 255)
m_pp.item_tint[i].rgb.use_tint = 0xFF;
{
if (m_pp.item_tint[i].rgb.use_tint == 1 || m_pp.item_tint[i].rgb.use_tint == 255)
{
m_pp.item_tint[i].rgb.use_tint = 0xFF;
}
}
if (level){ level = m_pp.level; }

View File

@ -2781,10 +2781,17 @@ uint32 Mob::GetEquipmentColor(uint8 material_slot) const
{
const Item_Struct *item;
item = database.GetItem(GetEquipment(material_slot));
if(item != 0)
if (armor_tint[material_slot])
{
return item->Color;
return armor_tint[material_slot];
}
else
{
item = database.GetItem(GetEquipment(material_slot));
if (item != 0)
{
return item->Color;
}
}
return 0;

View File

@ -476,7 +476,7 @@ void NPC::CheckMinMaxLevel(Mob *them)
if(themlevel < (*cur)->min_level || themlevel > (*cur)->max_level)
{
material = Inventory::CalcMaterialFromSlot((*cur)->equip_slot);
if(material != 0xFF)
if (material != _MaterialInvalid)
SendWearChange(material);
cur = itemlist.erase(cur);