Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bool IsFromMod(Object O)
- {
- local string PackageName;
- if( O == None )
- return false;
- PackageName = string(O.GetPackageName());
- return (PackageName ~= "KFGameContent" && PackageName ~= "KFGame");
- }
- function ScoreKill(Controller Killer, Controller Killed)
- {
- local KFPawn_Monster KFM;
- local int i, j;
- local KFPlayerController KFPC;
- local KFPlayerReplicationInfo DamagerKFPRI;
- local float XP;
- local KFPerk InstigatorPerk;
- KFM = KFPawn_Monster(Killed.Pawn);
- if( KFM!=None && Killed.GetTeamNum()!=0 && Killer.bIsPlayer && Killer.GetTeamNum()==0 )
- {
- if( KFM.DamageHistory.Length > 0 && IsFromMod(KFM) )
- {
- for( i = 0; i<KFM.DamageHistory.Length; i++ )
- {
- DamagerKFPRI = KFPlayerReplicationInfo(KFM.DamageHistory[i].DamagerPRI);
- if( DamagerKFPRI != None )
- {
- if( KFM.DamageHistory[i].DamagePerks.Length <= 0 )
- {
- continue;
- }
- // Distribute experience points
- KFPC = KFPlayerController(DamagerKFPRI.Owner);
- if( KFPC != none )
- {
- InstigatorPerk = KFPC.GetPerk();
- if( InstigatorPerk.ShouldGetAllTheXP() )
- {
- KFPC.OnPlayerXPAdded(KFM.static.GetXPValue(MyKFGI.GameDifficulty), InstigatorPerk.Class);
- continue;
- }
- XP = KFM.static.GetXPValue(MyKFGI.GameDifficulty) / KFM.DamageHistory[i].DamagePerks.Length;
- for( j = 0; j < KFM.DamageHistory[i].DamagePerks.Length; j++ )
- {
- KFPC.OnPlayerXPAdded(FCeil(XP), KFM.DamageHistory[i].DamagePerks[j]);
- }
- }
- }
- }
- }
- }
- Super.ScoreKill(Killer, Killed);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement