From 4e3842b9d80a29b98678569fb1d7600e7c12ca1d Mon Sep 17 00:00:00 2001 From: Natedog2012 Date: Thu, 27 Nov 2014 13:05:50 -0800 Subject: [PATCH] Detransformation of mold type ornamentations. --- zone/string_ids.h | 1 + zone/tradeskills.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/zone/string_ids.h b/zone/string_ids.h index 044dd215f..e1e1bc7b3 100644 --- a/zone/string_ids.h +++ b/zone/string_ids.h @@ -298,6 +298,7 @@ #define GUILD_BANK_EMPTY_HANDS 6108 // You must empty your hands to withdraw from the Guild Bank. #define TRANSFORM_FAILED 6326 //This mold cannot be applied to your %1. #define TRANSFORM_COMPLETE 6327 //You have successfully transformed your %1. +#define DETRANSFORM_FAILED 6341 //%1 has no transformation that can be removed. #define GENERIC_STRING 6688 //%1 (used to any basic message) #define SENTINEL_TRIG_YOU 6724 //You have triggered your sentinel. #define SENTINEL_TRIG_OTHER 6725 //%1 has triggered your sentinel. diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index e9de6c4a6..da5114ed2 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -304,6 +304,24 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob return; } + if (container->GetItem()->BagType == BagTypeDetransformationmold) { + const ItemInst* inst = container->GetItem(0); + if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIcon()) { + const Item_Struct* new_weapon = inst->GetItem(); + user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true); + container->Clear(); + user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->IsInstNoDrop(), MainCursor, 0, 0); + user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name); + } + else if (inst) { + user->Message_StringID(4, DETRANSFORM_FAILED, inst->GetItem()->Name); + } + EQApplicationPacket* outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0); + user->QueuePacket(outapp); + safe_delete(outapp); + return; + } + DBTradeskillRecipe_Struct spec; if (!database.GetTradeRecipe(container, c_type, some_id, user->CharacterID(), &spec)) { user->Message_StringID(MT_Emote,TRADESKILL_NOCOMBINE);