Implement RoF + UF ornament augmentation.. thanks for the help Drajor!

This commit is contained in:
Natedog2012
2014-11-08 21:11:21 -08:00
committed by SecretsOTheP
parent d4139b98e3
commit efdc177b78
14 changed files with 247 additions and 62 deletions
+45 -12
View File
@@ -4807,6 +4807,7 @@ namespace RoF
char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint8 depth)
{
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
uint8 null_term = 0;
bool stackable = inst->IsStackable();
uint32 merchant_slot = inst->GetMerchantSlot();
@@ -4847,20 +4848,52 @@ namespace RoF
hdr.unknown044 = 0;
hdr.unknown048 = 0;
hdr.unknown052 = 0;
hdr.unknown056 = 0;
hdr.unknown060 = 0;
hdr.unknown061 = 0;
hdr.unknown062 = 0;
hdr.unknowna1 = 0xffffffff;
hdr.unknowna2 = 0;
hdr.unknown063 = 0;
hdr.unknowna3 = 0;
hdr.unknowna4 = 0xffffffff;
hdr.unknowna5 = 0;
hdr.ItemClass = item->ItemClass;
hdr.isEvolving = item->EvolvingLevel > 0 ? 1 : 0;
ss.write((const char*)&hdr, sizeof(RoF::structs::ItemSerializationHeader));
if (item->EvolvingLevel > 0) {
RoF::structs::EvolvingItem evotop;
evotop.unknown001 = 0;
evotop.unknown002 = 0;
evotop.unknown003 = 0;
evotop.unknown004 = 0;
evotop.evoLevel = item->EvolvingLevel;
evotop.progress = 95.512;
evotop.Activated = 1;
evotop.evomaxlevel = 7;
ss.write((const char*)&evotop, sizeof(RoF::structs::EvolvingItem));
}
//ORNAMENT IDFILE / ICON
uint16 ornaIcon = 0;
if (inst->GetOrnamentationAug(ornamentationAugtype)) {
const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
//Mainhand
ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
ss.write((const char*)&null_term, sizeof(uint8));
//Offhand
ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
ss.write((const char*)&null_term, sizeof(uint8));
//Icon
ornaIcon = aug_weap->Icon;
}
else {
ss.write((const char*)&null_term, sizeof(uint8)); //no mh
ss.write((const char*)&null_term, sizeof(uint8));//no of
}
RoF::structs::ItemSerializationHeaderFinish hdrf;
hdrf.ornamentIcon = ornaIcon;
hdrf.unknown061 = 0;
hdrf.unknown062 = 0;
hdrf.unknowna1 = 0xffffffff;
hdrf.unknowna2 = 0;
hdrf.unknown063 = 0;
hdrf.unknowna3 = 0;
hdrf.unknowna4 = 0xffffffff;
hdrf.unknowna5 = 0;
hdrf.ItemClass = item->ItemClass;
ss.write((const char*)&hdrf, sizeof(RoF::structs::ItemSerializationHeaderFinish));
if (strlen(item->Name) > 0)
{
ss.write(item->Name, strlen(item->Name));