From 23bda717187619b6829cae34833a766d19891992 Mon Sep 17 00:00:00 2001 From: inklesspen1scripter Date: Tue, 7 Jul 2020 00:12:25 +0300 Subject: [PATCH] Trader, MedicPistol and Perk fixes MedicPistol has no weight in upgrades now Fixed weight and damage for upgrades in trader Fixed initial secondary ammo for weapons in trader Fixed secondary ammo icon in trader Fixed error when perk hasn't HeadDamage stat --- ServerExt/Classes/ExtPlayerReplicationInfo.uc | 19 ++++++++++++--- ServerExt/Classes/ExtWeap_Pistol_MedicS.uc | 5 ++++ ServerExt/Classes/Ext_PerkBase.uc | 23 ++++++++++++++++++- ServerExtMut/Classes/ServerExtMut.uc | 1 - 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/ServerExt/Classes/ExtPlayerReplicationInfo.uc b/ServerExt/Classes/ExtPlayerReplicationInfo.uc index 8a7c6a4..b457582 100644 --- a/ServerExt/Classes/ExtPlayerReplicationInfo.uc +++ b/ServerExt/Classes/ExtPlayerReplicationInfo.uc @@ -257,6 +257,7 @@ simulated static final function KFGFxObject_TraderItems CreateNewList() simulated static final function SetWeaponInfo( bool bDedicated, int Index, FCustomTraderItem Item, KFGFxObject_TraderItems List ) { local array S; + local int i; if( List.SaleItems.Length<=Index ) List.SaleItems.Length = Index+1; @@ -268,16 +269,24 @@ simulated static final function SetWeaponInfo( bool bDedicated, int Index, FCust else List.SaleItems[Index].SingleClassName = ''; List.SaleItems[Index].DualClassName = Item.WeaponClass.Default.DualClass!=None ? Item.WeaponClass.Default.DualClass.Name : ''; List.SaleItems[Index].AssociatedPerkClasses = Item.WeaponClass.Static.GetAssociatedPerkClasses(); + List.SaleItems[Index].MaxSpareAmmo = Item.WeaponClass.Default.SpareAmmoCapacity[0]; List.SaleItems[Index].MagazineCapacity = Item.WeaponClass.Default.MagazineCapacity[0]; List.SaleItems[Index].InitialSpareMags = Item.WeaponClass.Default.InitialSpareMags[0]; - List.SaleItems[Index].MaxSpareAmmo = Item.WeaponClass.Default.SpareAmmoCapacity[0]; List.SaleItems[Index].MaxSecondaryAmmo = Item.WeaponClass.Default.MagazineCapacity[1] * Item.WeaponClass.Default.SpareAmmoCapacity[1]; List.SaleItems[Index].BlocksRequired = Item.WeaponClass.Default.InventorySize; List.SaleItems[Index].ItemID = Index; - + + List.SaleItems[Index].InitialSecondaryAmmo = Item.WeaponClass.Default.InitialSpareMags[1]; + List.SaleItems[Index].WeaponUpgradeDmgMultiplier[0] = 1.0; + for(i = 0;i TraitClasses; @@ -405,6 +406,12 @@ function LoadData( ExtSaveDataBase Data ) local string S; CurrentEXP = Data.ReadInt(3); + // if(MinimalDataLevel > 0) + // { + // i = GetNeededExp(MinimalDataLevel-1) + // if(i > CurrentEXP) + // CurrentEXP = i + // } if( Data.GetArVer()>=1 ) CurrentPrestige = Data.ReadInt(3); @@ -465,6 +472,13 @@ function SetInitialLevel() local int i,a,b; local byte MT,j; + if(MinimalDataLevel > 0) + { + i = GetNeededExp(MinimalDataLevel-1); + if(i > CurrentEXP) + CurrentEXP = i; + } + // Set to initial level player is on after configures has loaded. CurrentLevel = CalcLevelForExp(CurrentEXP); CurrentSP = CurrentLevel*(StarPointsPerLevel+CurrentPrestige*PrestigeSPIncrease); @@ -605,6 +619,7 @@ static function UpdateConfigs( int OldVer ) Default.MinLevelForPrestige = 140; Default.PrestigeSPIncrease = 1; Default.MaxPrestige = 20; + Default.MinimalDataLevel = 0; Default.PrestigeXPReduce = 0.05; Default.PerkStats.Length = 0; @@ -707,6 +722,8 @@ static function string GetValue( name PropName, int ElementIndex ) return string(Default.MinLevelForPrestige); case 'PrestigeSPIncrease': return string(Default.PrestigeSPIncrease); + case 'MinimalDataLevel': + return string(Default.MinimalDataLevel); case 'MaxPrestige': return string(Default.MaxPrestige); case 'PrestigeXPReduce': @@ -721,6 +738,8 @@ static function ApplyValue( name PropName, int ElementIndex, string Value ) Default.FirstLevelExp = int(Value); break; case 'LevelUpExpCost': Default.LevelUpExpCost = int(Value); break; + case 'MinimalDataLevel': + Default.MinimalDataLevel = int(Value); break; case 'LevelUpIncCost': Default.LevelUpIncCost = int(Value); break; case 'MinimumLevel': @@ -1418,6 +1437,7 @@ defaultproperties WebConfigs.Add((PropType=0,PropName="PrestigeSPIncrease",UIName="Prestige SP Increase",UIDesc="Star points increase per level for every prestige")) WebConfigs.Add((PropType=0,PropName="MaxPrestige",UIName="Max Prestige",UIDesc="Maximum prestige level")) WebConfigs.Add((PropType=0,PropName="PrestigeXPReduce",UIName="Prestige XP Reduce",UIDesc="Percent amount of XP cost is reduced for each prestige (1.0 = 1/2, or 50 % of XP)")) + // WebConfigs.Add((PropType=0,PropName="MinimalDataLevel",UIName="Minimal Real Level",UIDesc="Minimal level for new players or who loads from saves")) DefPerkStats(0)=(MaxValue=50,CostPerValue=1,StatType="Speed",UIName="Movement Speed (+&%)",Progress=0.4) DefPerkStats(1)=(MaxValue=1000,CostPerValue=1,StatType="Damage",UIName="Perk Damage (+&%)",Progress=0.5) @@ -1459,6 +1479,7 @@ defaultproperties Modifiers.Add(1.f) Modifiers.Add(1.f) Modifiers.Add(1.f) + Modifiers.Add(0.f) EnemyDistDraw.Add(500) EnemyDistDraw.Add(700) diff --git a/ServerExtMut/Classes/ServerExtMut.uc b/ServerExtMut/Classes/ServerExtMut.uc index fb34fe7..696be4f 100644 --- a/ServerExtMut/Classes/ServerExtMut.uc +++ b/ServerExtMut/Classes/ServerExtMut.uc @@ -273,7 +273,6 @@ function EditTraiderItems() // local STraderItem SI; // var config bool bDLCWeaponsForFree; // var config bool bDontUseOriginalWeaponry; - if(!bDontUseOriginalWeaponry) { Trad = KFGameReplicationInfo(WorldInfo.GRI).TraderItems;