Premium system changes.
This commit is contained in:
@ -20,6 +20,7 @@ package com.l2jserver.gameserver.model.drops;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.drops.strategy.IAmountMultiplierStrategy;
|
||||
import com.l2jserver.gameserver.model.drops.strategy.IChanceMultiplierStrategy;
|
||||
@ -146,10 +147,19 @@ public final class GeneralDropItem implements IDropItem
|
||||
/**
|
||||
* Gets the min drop count modified by server rates
|
||||
* @param victim the victim who drops the item
|
||||
* @param killer who kills the victim
|
||||
* @return the min modified by any rates.
|
||||
*/
|
||||
public final long getMin(L2Character victim)
|
||||
public final long getMin(L2Character victim, L2Character killer)
|
||||
{
|
||||
if (Config.PREMIUM_SYSTEM_ENABLED && killer.isPlayer() && killer.getActingPlayer().hasPremiumStatus())
|
||||
{
|
||||
if (Config.PREMIUM_RATE_DROP_AMOUNT_MULTIPLIER.get(_itemId) != null)
|
||||
{
|
||||
return (long) (getMin() * getAmountMultiplier(victim) * Config.PREMIUM_RATE_DROP_AMOUNT_MULTIPLIER.get(_itemId));
|
||||
}
|
||||
return (long) (getMin() * getAmountMultiplier(victim) * Config.PREMIUM_RATE_DROP_AMOUNT);
|
||||
}
|
||||
return (long) (getMin() * getAmountMultiplier(victim));
|
||||
}
|
||||
|
||||
@ -165,10 +175,19 @@ public final class GeneralDropItem implements IDropItem
|
||||
/**
|
||||
* Gets the max drop count modified by server rates
|
||||
* @param victim the victim who drops the item
|
||||
* @param killer who kills the victim
|
||||
* @return the max modified by any rates.
|
||||
*/
|
||||
public final long getMax(L2Character victim)
|
||||
public final long getMax(L2Character victim, L2Character killer)
|
||||
{
|
||||
if (Config.PREMIUM_SYSTEM_ENABLED && killer.isPlayer() && killer.getActingPlayer().hasPremiumStatus())
|
||||
{
|
||||
if (Config.PREMIUM_RATE_DROP_AMOUNT_MULTIPLIER.get(_itemId) != null)
|
||||
{
|
||||
return (long) (getMax() * getAmountMultiplier(victim) * Config.PREMIUM_RATE_DROP_AMOUNT_MULTIPLIER.get(_itemId));
|
||||
}
|
||||
return (long) (getMax() * getAmountMultiplier(victim) * Config.PREMIUM_RATE_DROP_AMOUNT);
|
||||
}
|
||||
return (long) (getMax() * getAmountMultiplier(victim));
|
||||
}
|
||||
|
||||
@ -201,7 +220,15 @@ public final class GeneralDropItem implements IDropItem
|
||||
*/
|
||||
public final double getChance(L2Character victim, L2Character killer)
|
||||
{
|
||||
return (getKillerChanceModifier(victim, killer) * getChance(victim));
|
||||
if (Config.PREMIUM_SYSTEM_ENABLED && killer.isPlayer() && killer.getActingPlayer().hasPremiumStatus())
|
||||
{
|
||||
if (Config.PREMIUM_RATE_DROP_CHANCE_MULTIPLIER.get(_itemId) != null)
|
||||
{
|
||||
return getKillerChanceModifier(victim, killer) * getChance(victim) * Config.PREMIUM_RATE_DROP_CHANCE_MULTIPLIER.get(_itemId);
|
||||
}
|
||||
return getKillerChanceModifier(victim, killer) * getChance(victim) * Config.PREMIUM_RATE_DROP_CHANCE;
|
||||
}
|
||||
return getKillerChanceModifier(victim, killer) * getChance(victim);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user