Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.83 KB | None | 0 0
  1. ptsEarned = (deadLevel+GetLevel())/2;
  2.  
  3.             // point variation depending on K/D ratios of the dead player
  4.             if ( deadPlayerDeathCount < 1 )
  5.                 deadPlayerDeathCount = 1;
  6.             if ( deadPlayerKillCount < 1 )
  7.                 deadPlayerKillCount = 1;
  8.  
  9.             double ratioDiff = (double)deadPlayerKillCount/(double)deadPlayerDeathCount;
  10.  
  11.             ratioDiff += ratioDiff * (((float)zone->IsPVPHotzone()/100.0f) * ((float)GetLevel()/((float)RuleI(PVPCombat, PCChanceLevelCap)+1.0f)));
  12.  
  13.             if ( ratioDiff > RuleR(PVPCombat,PVPPointRatioMaxCap) )
  14.                 ratioDiff = RuleR(PVPCombat,PVPPointRatioMaxCap);
  15.             if ( ratioDiff < RuleR(PVPCombat,PVPPointRatioMinCap) )
  16.                 ratioDiff = RuleR(PVPCombat,PVPPointRatioMinCap);
  17.        
  18.             ptsEarned = (uint32)(double)ptsEarned * ratioDiff; // use ratio diff to make ultimate amount
  19.  
  20.             bool gaveGroupPts = false;
  21.             bool isGrouped = false;
  22.  
  23.             if ( !RuleB(PVPCombat, PVPPoints) )
  24.                 ptsEarned = 0;
  25.             else
  26.             {
  27.                 if ( IsGrouped() && this->GetGroup() != NULL )
  28.                 {
  29.                     isGrouped = true;
  30.  
  31.                     int8 groupCount = this->GetGroup()->GroupCount();
  32.                     if ( groupCount < 1 )
  33.                         groupCount = 1;
  34.                
  35.                     ptsEarned = (uint32)(float)ptsEarned / groupCount;
  36.  
  37.                     if ( ptsEarned < 1 )
  38.                         ptsEarned = RuleI(PVPCombat,DefaultGroupPointEarning);
  39.  
  40.                     if ( legitKill )
  41.                         gaveGroupPts = GetGroup()->GivePVPPoints(this, ptsEarned, zoneID);
  42.                 }
  43.                 else
  44.                 {
  45.                     ptsEarned = (uint32)(float)ptsEarned * RuleR(PVPCombat,PVPPointReductionNonGroup);
  46.  
  47.                     if ( ptsEarned < 1 )
  48.                         ptsEarned = RuleI(PVPCombat,DefaultNoGroupPointEarning);
  49.                 }
  50.  
  51.                 if ( isGrouped && !gaveGroupPts && zoneID == zone->GetZoneID() )
  52.                 {
  53.                     ptsEarned = (uint32)(float)ptsEarned * RuleR(PVPCombat,PVPPointReductionNonGroup);
  54.  
  55.                     if ( ptsEarned < 1 )
  56.                         ptsEarned = RuleI(PVPCombat,DefaultNoGroupPointEarning);
  57.                 }
  58.             }
  59.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement