class X2DLCInfo_SMGCosting extends X2DownloadableContentInfo; static function OnPostTemplatesCreated() { local X2ItemTemplateManager Mgr; local array<X2DataTemplate> SrcTemplates; local array<X2DataTemplate> DestTemplates; local int iDiff; Mgr = class'X2ItemTemplateManager'.static.GetItemTemplateManager(); if (Mgr == none) { `LOG("ERROR :: failed to find Template Manager.",, 'SMGCosting'); return; } if (!GetTemplates(Mgr, 'AssaultRifle_MG_Schematic', SrcTemplates)) return; if (!GetTemplates(Mgr, 'SMG_MG_Schematic', DestTemplates)) return; // Assumes that there's the same number of difficulty levels for (iDiff = 0; iDiff < SrcTemplates.Length; iDiff++) { X2ItemTemplate(DestTemplates[iDiff]).Cost = X2ItemTemplate(SrcTemplates[iDiff]).Cost; } if (!GetTemplates(Mgr, 'AssaultRifle_BM_Schematic', SrcTemplates)) return; if (!GetTemplates(Mgr, 'SMG_BM_Schematic', DestTemplates)) return; // Assumes that there's the same number of difficulty levels for (iDiff = 0; iDiff < SrcTemplates.Length; iDiff++) { X2ItemTemplate(DestTemplates[iDiff]).Cost = X2ItemTemplate(SrcTemplates[iDiff]).Cost; } } static private function bool GetTemplates(const X2ItemTemplateManager Mgr, const name TemplateName, out array<X2DataTemplate> Templates) { Mgr.FindDataTemplateAllDifficulties(TemplateName, Templates); if (Templates.Length == 0) { `LOG("ERROR :: failed to find Templates for" @ TemplateName,, 'SMGCosting'); return false; } return true; }