Fully working type 20 ornaments for UF/ROF (propbably SoD too)

This commit is contained in:
ricardocampos23 2014-04-13 22:45:56 +01:00
parent 72825c6bc0
commit acc24f1154
3 changed files with 41 additions and 20 deletions

View File

@ -3531,7 +3531,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
}
// Moofta: if the item has an aug of type 20 (ornamentation) then we use the ID file of that when serializing.
// the only thing we should probably worry about is generating a wear change packet to all cl;ients in zone if someone adds a type 20 aug.
// the only thing we should probably worry about is generating a wear change packet to all clients in zone if someone adds a type 20 aug.
if (inst && inst->HasOrnamentation()) //instance is not null and does have an ornament aug (slot 20)
{
ItemInst* ornamentation = inst->GetOrnamentation();

View File

@ -1907,14 +1907,36 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.colors[MaterialFeet].color = GetEquipmentColor(MaterialFeet);
}
if ((inst = m_inv[SLOT_PRIMARY]) && inst->IsType(ItemClassCommon)) {
item = inst->GetItem();
if (strlen(item->IDFile) > 2)
ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]);
if (inst->HasOrnamentation())
{
ItemInst* ornament = inst->GetOrnamentation();
if (strlen(ornament->GetItem()->IDFile) > 2)
{
ns->spawn.equipment[MaterialPrimary]= atoi(&ornament->GetItem()->IDFile[2]);
}
}
else
{
item = inst->GetItem();
if (strlen(item->IDFile) > 2)
ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]);
}
}
if ((inst = m_inv[SLOT_SECONDARY]) && inst->IsType(ItemClassCommon)) {
item = inst->GetItem();
if (strlen(item->IDFile) > 2)
if (inst->HasOrnamentation())
{
ItemInst* ornament = inst->GetOrnamentation();
if (strlen(ornament->GetItem()->IDFile) > 2)
{
ns->spawn.equipment[MaterialPrimary]= atoi(&ornament->GetItem()->IDFile[2]);
}
}
else
{
item = inst->GetItem();
if (strlen(item->IDFile) > 2)
ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]);
}
}
//these two may be related to ns->spawn.texture

View File

@ -1899,26 +1899,25 @@ int32 Client::GetEquipmentMaterial(uint8 material_slot) const
const ItemInst* inst = m_inv.GetItem(inventorySlot);
if (inst != nullptr)
{
if (strlen(inst->GetItem()->IDFile) > 2)
if (inst->HasOrnamentation())
{
if (inst->HasOrnamentation())
ItemInst* ornament = inst->GetOrnamentation();
if (strlen(ornament->GetItem()->IDFile) > 2)
{
ItemInst* ornament = inst->GetOrnamentation();
if (strlen(ornament->GetItem()->IDFile) > 2)
{
return atoi(&ornament->GetItem()->IDFile[2]);
}
return atoi(&ornament->GetItem()->IDFile[2]);
}
else
}
else
{
if (strlen(inst->GetItem()->IDFile) > 2)
{
return atoi(&inst->GetItem()->IDFile[2]);
}
}
else //may as well try this, since were going to 0 anyways
{
return inst->GetItem()->Material;
}
else //may as well try this, since were going to 0 anyways
{
return inst->GetItem()->Material;
}
}
}
}
else