@ -11,6 +11,7 @@ package engine.objects;
@@ -11,6 +11,7 @@ package engine.objects;
import engine.Enum ;
import engine.Enum.TargetColor ;
import engine.gameManager.ConfigManager ;
import engine.gameManager.ZoneManager ;
import engine.math.Vector3fImmutable ;
import engine.server.MBServerStatics ;
@ -332,12 +333,7 @@ public class Experience {
@@ -332,12 +333,7 @@ public class Experience {
if ( killer = = null | | mob = = null )
return ;
double xp = 0 . 0 ;
//Get the xp modifier for the world
float xpMod = Enum . DropRateType . EXP_RATE_MOD . rate ;
double grantedExperience = 0 . 0 ;
if ( g ! = null ) { // Do group EXP stuff
@ -374,18 +370,18 @@ public class Experience {
@@ -374,18 +370,18 @@ public class Experience {
}
// Process every player in the group getting XP
for ( PlayerCharacter pc : giveEXPTo ) {
if ( pc . getLevel ( ) > = MBServerStatics . LEVELCAP )
for ( PlayerCharacter playerChara cter : giveEXPTo ) {
if ( playerChara cter . getLevel ( ) > = MBServerStatics . LEVELCAP )
continue ;
// Sets Max XP with server exp mod taken into account.
xp = ( double ) xpMod * maxXPPerKill ( pc . getLevel ( ) ) ;
grantedE xperience = ( double ) Float . parseFloat ( ConfigManager . MB_NORMAL_EXP_RATE . getValue ( ) ) * maxXPPerKill ( playerChara cter . getLevel ( ) ) ;
// Adjust XP for Mob Level
xp * = getConMod ( pc , mob ) ;
grantedE xperience * = getConMod ( playerChara cter , mob ) ;
// Process XP for this member
penalty = getGroupMemberPenalty ( leadership , pc , giveEXPTo ,
penalty = getGroupMemberPenalty ( leadership , playerChara cter , giveEXPTo ,
highestLevel ) ;
// Leadership Penalty Reduction
@ -393,27 +389,27 @@ public class Experience {
@@ -393,27 +389,27 @@ public class Experience {
penalty - = ( ( leadership ) * 0 . 01 ) * penalty ;
// Modify for hotzone
if ( xp ! = 0 )
if ( grantedE xperience ! = 0 )
if ( ZoneManager . inHotZone ( mob . getLoc ( ) ) )
xp * = Enum . DropRateType . HOT_EXP_RATE_MOD . rate ;
grantedE xperience * = Float . parseFloat ( ConfigManager . MB_HOTZONE_EXP_RATE . getValue ( ) ) ;
// Check for 0 XP due to white mob, otherwise subtract penalty
// xp
if ( xp = = 0 ) {
xp = 1 ;
if ( grantedE xperience = = 0 ) {
grantedE xperience = 1 ;
} else {
xp - = ( penalty * 0 . 01 ) * xp ;
grantedE xperience - = ( penalty * 0 . 01 ) * grantedE xperience ;
// Errant Penalty Calculation
if ( pc . getGuild ( ) . isEmptyGuild ( ) )
xp * = 0 . 6 ;
if ( playerChara cter . getGuild ( ) . isEmptyGuild ( ) )
grantedE xperience * = 0 . 6 ;
}
if ( xp = = 0 )
xp = 1 ;
if ( grantedE xperience = = 0 )
grantedE xperience = 1 ;
// Grant the player the EXP
pc . grantXP ( ( int ) Math . floor ( xp ) ) ;
playerChara cter . grantXP ( ( int ) Math . floor ( grantedE xperience ) ) ;
}
} else { // Give EXP to a single character
@ -424,20 +420,20 @@ public class Experience {
@@ -424,20 +420,20 @@ public class Experience {
return ;
// Get XP and adjust for Mob Level with world xp modifier taken into account
xp = ( double ) xpMod * maxXPPerKill ( killer . getLevel ( ) ) ;
xp * = getConMod ( killer , mob ) ;
grantedE xperience = ( double ) Float . parseFloat ( ConfigManager . MB_NORMAL_EXP_RATE . getValue ( ) ) * maxXPPerKill ( killer . getLevel ( ) ) ;
grantedE xperience * = getConMod ( killer , mob ) ;
// Modify for hotzone
if ( ZoneManager . inHotZone ( mob . getLoc ( ) ) )
xp * = Enum . DropRateType . HOT_EXP_RATE_MOD . rate ;
grantedE xperience * = Float . parseFloat ( ConfigManager . MB_HOTZONE_EXP_RATE . getValue ( ) ) ;
// Errant penalty
if ( xp ! = 1 )
if ( grantedE xperience ! = 1 )
if ( killer . getGuild ( ) . isEmptyGuild ( ) )
xp * = . 6 ;
grantedE xperience * = . 6 ;
// Grant XP
killer . grantXP ( ( int ) Math . floor ( xp ) ) ;
killer . grantXP ( ( int ) Math . floor ( grantedE xperience ) ) ;
}
}
}