From 44bfdfebc201c61c5a030f92fe7eca20412305db Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 14 Nov 2014 23:45:56 -0500 Subject: [PATCH] Correct charm scaling for RoF Other clients should actually work the same as well --- changelog.txt | 1 + common/patches/rof.cpp | 5 +++-- common/patches/rof_structs.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index eac7536d8f..1f9930ffa1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) == 11/14/2014 == Secrets: Identified object size and solidtype as flags. Exported them as functions to Perl. +demonstar55: Don't use the hack for charms that doesn't work on RoF == 11/13/2014 == Kayen: Implemented target type (44) 'Beams' (which projects an AE infront of caster with a specified length and width). diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 3f39b71875..95e0047e82 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -4817,7 +4817,7 @@ namespace RoF std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); - const Item_Struct *item = inst->GetItem(); + const Item_Struct *item = inst->GetUnscaledItem(); //_log(NET__ERROR, "Serialize called for: %s", item->Name); RoF::structs::ItemSerializationHeader hdr; @@ -4839,7 +4839,7 @@ namespace RoF hdr.price = inst->GetPrice(); hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount(); //hdr.merchant_slot = (merchant_slot == 0) ? 1 : 0xffffffff; - hdr.unknown020 = 0; + hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0; hdr.instance_id = (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot; hdr.unknown028 = 0; hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0); @@ -5009,6 +5009,7 @@ namespace RoF ibs.SpellShield = item->SpellShield; ibs.Avoidance = item->Avoidance; ibs.Accuracy = item->Accuracy; + ibs.CharmFileID = item->CharmFileID; ibs.FactionAmt1 = item->FactionAmt1; ibs.FactionMod1 = item->FactionMod1; ibs.FactionAmt2 = item->FactionAmt2; diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index 604da1bd71..f3a6209b87 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -4396,7 +4396,7 @@ struct ItemSerializationHeader /*030*/ uint16 unknown013; // 0xffff /*032*/ uint32 price; /*036*/ uint32 merchant_slot; //1 if not a merchant item -/*040*/ uint32 unknown020; //0 +/*040*/ uint32 scaled_value; //0 /*044*/ uint32 instance_id; //unique instance id if not merchant item, else is merchant slot /*048*/ uint32 unknown028; //0 /*052*/ uint32 last_cast_time; // Unix Time from PP of last cast for this recast type if recast delay > 0