From 58bb384a49de7395fd7665ff8e2ddd13eda40aed Mon Sep 17 00:00:00 2001 From: inklesspen1scripter Date: Tue, 7 Jul 2020 17:29:42 +0300 Subject: [PATCH] Trait "Medic Pistol" applying on purchasing now --- ServerExt/Classes/Ext_TraitMedicPistol.uc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ServerExt/Classes/Ext_TraitMedicPistol.uc b/ServerExt/Classes/Ext_TraitMedicPistol.uc index 2437dd0..9ec9ab6 100644 --- a/ServerExt/Classes/Ext_TraitMedicPistol.uc +++ b/ServerExt/Classes/Ext_TraitMedicPistol.uc @@ -6,6 +6,22 @@ static function AddDefaultInventory( KFPawn Player, Ext_PerkBase Perk, byte Leve Player.DefaultInventory.AddItem(class'ExtWeap_Pistol_MedicS'); } +static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +{ + local Inventory Inv; + + Inv = Player.FindInventoryType(class'ExtWeap_Pistol_9mm'); + if( Inv!=None ) + Inv.Destroy(); + + if( Player.FindInventoryType(class'ExtWeap_Pistol_MedicS')==None ) + { + Inv = Player.CreateInventory(class'ExtWeap_Pistol_MedicS',Player.Weapon!=None); + if ( KFWeapon(Inv)!=None ) + KFWeapon(Inv).bGivenAtStart = true; + } +} + defaultproperties { TraitName="Medic Pistol"