Addition of BonusSpoilRate effect.

This commit is contained in:
MobiusDev
2017-10-16 16:52:50 +00:00
parent 64690e989e
commit e407b31cd0
28 changed files with 216 additions and 128 deletions

View File

@@ -61,6 +61,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); EffectHandler.getInstance().registerHandler("Bluff", Bluff::new);
EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new); EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new);
EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new); EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new);
EffectHandler.getInstance().registerHandler("BonusSpoilRate", BonusSpoilRate::new);
EffectHandler.getInstance().registerHandler("Breath", Breath::new); EffectHandler.getInstance().registerHandler("Breath", Breath::new);
EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new);
EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new);

View File

@@ -401,8 +401,9 @@ public class NpcViewMod implements IBypassHandler
int leftHeight = 0; int leftHeight = 0;
int rightHeight = 0; int rightHeight = 0;
final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
final double spoilRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
final StringBuilder leftSb = new StringBuilder(); final StringBuilder leftSb = new StringBuilder();
final StringBuilder rightSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder();
String limitReachedMsg = ""; String limitReachedMsg = "";
@@ -428,6 +429,9 @@ public class NpcViewMod implements IBypassHandler
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT;
} }
// bonus spoil rate effect
rateChance *= spoilRateEffectBonus;
} }
else else
{ {
@@ -504,16 +508,9 @@ public class NpcViewMod implements IBypassHandler
} }
// bonus drop amount effect // bonus drop amount effect
if (dropAmountEffectBonus > 0) rateAmount *= dropAmountEffectBonus;
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// bonus drop rate effect // bonus drop rate effect
if (dropRateEffectBonus > 0) rateChance *= dropRateEffectBonus;
{
rateChance += rateChance * dropRateEffectBonus;
}
} }
sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">"); sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");

View File

@@ -168,8 +168,9 @@ public class DropSearchBoard implements IParseBoardHandler
int start = (page - 1) * 14; int start = (page - 1) * 14;
int end = Math.min(list.size() - 1, start + 14); int end = Math.min(list.size() - 1, start + 14);
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
final double spoilRateEffectBonus = player.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
for (int index = start; index <= end; index++) for (int index = start; index <= end; index++)
{ {
CBDropHolder cbDropHolder = list.get(index); CBDropHolder cbDropHolder = list.get(index);
@@ -188,6 +189,9 @@ public class DropSearchBoard implements IParseBoardHandler
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT;
} }
// bonus spoil rate effect
rateChance *= spoilRateEffectBonus;
} }
else else
{ {
@@ -266,16 +270,9 @@ public class DropSearchBoard implements IParseBoardHandler
} }
// bonus drop amount effect // bonus drop amount effect
if (dropAmountEffectBonus > 0) rateAmount *= dropAmountEffectBonus;
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// bonus drop rate effect // bonus drop rate effect
if (dropRateEffectBonus > 0) rateChance *= dropRateEffectBonus;
{
rateChance += rateChance * dropRateEffectBonus;
}
} }
builder.append("<tr>"); builder.append("<tr>");

View File

@@ -0,0 +1,31 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.effecthandlers;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.stats.Stats;
/**
* @author Mobius
*/
public class BonusSpoilRate extends AbstractStatEffect
{
public BonusSpoilRate(StatsSet params)
{
super(params, Stats.BONUS_SPOIL_RATE);
}
}

View File

@@ -29,6 +29,7 @@ BlockTarget: Causes the target to become untargetable.
Bluff: Rotates the target so you face its back. Bluff: Rotates the target so you face its back.
BonusDropAmount: Bonus amount for dropped items. (l2jmobius) BonusDropAmount: Bonus amount for dropped items. (l2jmobius)
BonusDropRate: Bonus chance for dropping items. (l2jmobius) BonusDropRate: Bonus chance for dropping items. (l2jmobius)
BonusSpoilRate: Bonus chance for acquiring spoil items. (l2jmobius)
Breath: Underwater breathing stat. Breath: Underwater breathing stat.
BuffBlock: Blocks target from receiving buffs. BuffBlock: Blocks target from receiving buffs.
CallParty: Recalls whole party. CallParty: Recalls whole party.

View File

@@ -716,11 +716,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
} }
// bonus drop rate effect // bonus drop rate effect
final double dropRateEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_RATE, 0); rateChance *= killer.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
if (dropRateEffectBonus > 0)
{
rateChance += rateChance * dropRateEffectBonus;
}
// calculate if item will drop // calculate if item will drop
if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance))
@@ -766,11 +762,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
} }
// bonus drop amount effect // bonus drop amount effect
final double dropAmountEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); rateAmount *= killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
if (dropAmountEffectBonus > 0)
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// finally // finally
return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount)); return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount));
@@ -786,6 +778,8 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
{ {
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
} }
// bonus drop rate effect
rateChance *= killer.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
// calculate if item will be rewarded // calculate if item will be rewarded
if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance))

View File

@@ -132,6 +132,7 @@ public enum Stats
BONUS_SP("bonusSp"), BONUS_SP("bonusSp"),
BONUS_DROP_AMOUNT("bonusDropAmount"), BONUS_DROP_AMOUNT("bonusDropAmount"),
BONUS_DROP_RATE("bonusDropRate"), BONUS_DROP_RATE("bonusDropRate"),
BONUS_SPOIL_RATE("bonusSpoilRate"),
ATTACK_CANCEL("cancel"), ATTACK_CANCEL("cancel"),
// ACCURACY & RANGE // ACCURACY & RANGE

View File

@@ -61,6 +61,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); EffectHandler.getInstance().registerHandler("Bluff", Bluff::new);
EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new); EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new);
EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new); EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new);
EffectHandler.getInstance().registerHandler("BonusSpoilRate", BonusSpoilRate::new);
EffectHandler.getInstance().registerHandler("Breath", Breath::new); EffectHandler.getInstance().registerHandler("Breath", Breath::new);
EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new);
EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new);

View File

@@ -401,8 +401,9 @@ public class NpcViewMod implements IBypassHandler
int leftHeight = 0; int leftHeight = 0;
int rightHeight = 0; int rightHeight = 0;
final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
final double spoilRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
final StringBuilder leftSb = new StringBuilder(); final StringBuilder leftSb = new StringBuilder();
final StringBuilder rightSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder();
String limitReachedMsg = ""; String limitReachedMsg = "";
@@ -428,6 +429,9 @@ public class NpcViewMod implements IBypassHandler
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT;
} }
// bonus spoil rate effect
rateChance *= spoilRateEffectBonus;
} }
else else
{ {
@@ -504,16 +508,9 @@ public class NpcViewMod implements IBypassHandler
} }
// bonus drop amount effect // bonus drop amount effect
if (dropAmountEffectBonus > 0) rateAmount *= dropAmountEffectBonus;
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// bonus drop rate effect // bonus drop rate effect
if (dropRateEffectBonus > 0) rateChance *= dropRateEffectBonus;
{
rateChance += rateChance * dropRateEffectBonus;
}
} }
sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">"); sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");

View File

@@ -168,8 +168,9 @@ public class DropSearchBoard implements IParseBoardHandler
int start = (page - 1) * 14; int start = (page - 1) * 14;
int end = Math.min(list.size() - 1, start + 14); int end = Math.min(list.size() - 1, start + 14);
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
final double spoilRateEffectBonus = player.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
for (int index = start; index <= end; index++) for (int index = start; index <= end; index++)
{ {
CBDropHolder cbDropHolder = list.get(index); CBDropHolder cbDropHolder = list.get(index);
@@ -188,6 +189,9 @@ public class DropSearchBoard implements IParseBoardHandler
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT;
} }
// bonus spoil rate effect
rateChance *= spoilRateEffectBonus;
} }
else else
{ {
@@ -266,16 +270,9 @@ public class DropSearchBoard implements IParseBoardHandler
} }
// bonus drop amount effect // bonus drop amount effect
if (dropAmountEffectBonus > 0) rateAmount *= dropAmountEffectBonus;
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// bonus drop rate effect // bonus drop rate effect
if (dropRateEffectBonus > 0) rateChance *= dropRateEffectBonus;
{
rateChance += rateChance * dropRateEffectBonus;
}
} }
builder.append("<tr>"); builder.append("<tr>");

View File

@@ -0,0 +1,31 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.effecthandlers;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.stats.Stats;
/**
* @author Mobius
*/
public class BonusSpoilRate extends AbstractStatEffect
{
public BonusSpoilRate(StatsSet params)
{
super(params, Stats.BONUS_SPOIL_RATE);
}
}

View File

@@ -29,6 +29,7 @@ BlockTarget: Causes the target to become untargetable.
Bluff: Rotates the target so you face its back. Bluff: Rotates the target so you face its back.
BonusDropAmount: Bonus amount for dropped items. (l2jmobius) BonusDropAmount: Bonus amount for dropped items. (l2jmobius)
BonusDropRate: Bonus chance for dropping items. (l2jmobius) BonusDropRate: Bonus chance for dropping items. (l2jmobius)
BonusSpoilRate: Bonus chance for acquiring spoil items. (l2jmobius)
Breath: Underwater breathing stat. Breath: Underwater breathing stat.
BuffBlock: Blocks target from receiving buffs. BuffBlock: Blocks target from receiving buffs.
CallParty: Recalls whole party. CallParty: Recalls whole party.

View File

@@ -716,11 +716,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
} }
// bonus drop rate effect // bonus drop rate effect
final double dropRateEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_RATE, 0); rateChance *= killer.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
if (dropRateEffectBonus > 0)
{
rateChance += rateChance * dropRateEffectBonus;
}
// calculate if item will drop // calculate if item will drop
if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance))
@@ -766,11 +762,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
} }
// bonus drop amount effect // bonus drop amount effect
final double dropAmountEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); rateAmount *= killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
if (dropAmountEffectBonus > 0)
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// finally // finally
return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount)); return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount));
@@ -786,6 +778,8 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
{ {
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
} }
// bonus drop rate effect
rateChance *= killer.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
// calculate if item will be rewarded // calculate if item will be rewarded
if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance))

View File

@@ -132,6 +132,7 @@ public enum Stats
BONUS_SP("bonusSp"), BONUS_SP("bonusSp"),
BONUS_DROP_AMOUNT("bonusDropAmount"), BONUS_DROP_AMOUNT("bonusDropAmount"),
BONUS_DROP_RATE("bonusDropRate"), BONUS_DROP_RATE("bonusDropRate"),
BONUS_SPOIL_RATE("bonusSpoilRate"),
ATTACK_CANCEL("cancel"), ATTACK_CANCEL("cancel"),
// ACCURACY & RANGE // ACCURACY & RANGE

View File

@@ -61,6 +61,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); EffectHandler.getInstance().registerHandler("Bluff", Bluff::new);
EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new); EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new);
EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new); EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new);
EffectHandler.getInstance().registerHandler("BonusSpoilRate", BonusSpoilRate::new);
EffectHandler.getInstance().registerHandler("Breath", Breath::new); EffectHandler.getInstance().registerHandler("Breath", Breath::new);
EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new);
EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new);

View File

@@ -401,8 +401,9 @@ public class NpcViewMod implements IBypassHandler
int leftHeight = 0; int leftHeight = 0;
int rightHeight = 0; int rightHeight = 0;
final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
final double spoilRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
final StringBuilder leftSb = new StringBuilder(); final StringBuilder leftSb = new StringBuilder();
final StringBuilder rightSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder();
String limitReachedMsg = ""; String limitReachedMsg = "";
@@ -428,6 +429,9 @@ public class NpcViewMod implements IBypassHandler
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT;
} }
// bonus spoil rate effect
rateChance *= spoilRateEffectBonus;
} }
else else
{ {
@@ -504,16 +508,9 @@ public class NpcViewMod implements IBypassHandler
} }
// bonus drop amount effect // bonus drop amount effect
if (dropAmountEffectBonus > 0) rateAmount *= dropAmountEffectBonus;
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// bonus drop rate effect // bonus drop rate effect
if (dropRateEffectBonus > 0) rateChance *= dropRateEffectBonus;
{
rateChance += rateChance * dropRateEffectBonus;
}
} }
sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">"); sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");

View File

@@ -168,8 +168,9 @@ public class DropSearchBoard implements IParseBoardHandler
int start = (page - 1) * 14; int start = (page - 1) * 14;
int end = Math.min(list.size() - 1, start + 14); int end = Math.min(list.size() - 1, start + 14);
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
final double spoilRateEffectBonus = player.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
for (int index = start; index <= end; index++) for (int index = start; index <= end; index++)
{ {
CBDropHolder cbDropHolder = list.get(index); CBDropHolder cbDropHolder = list.get(index);
@@ -188,6 +189,9 @@ public class DropSearchBoard implements IParseBoardHandler
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT;
} }
// bonus spoil rate effect
rateChance *= spoilRateEffectBonus;
} }
else else
{ {
@@ -266,16 +270,9 @@ public class DropSearchBoard implements IParseBoardHandler
} }
// bonus drop amount effect // bonus drop amount effect
if (dropAmountEffectBonus > 0) rateAmount *= dropAmountEffectBonus;
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// bonus drop rate effect // bonus drop rate effect
if (dropRateEffectBonus > 0) rateChance *= dropRateEffectBonus;
{
rateChance += rateChance * dropRateEffectBonus;
}
} }
builder.append("<tr>"); builder.append("<tr>");

View File

@@ -0,0 +1,31 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.effecthandlers;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.stats.Stats;
/**
* @author Mobius
*/
public class BonusSpoilRate extends AbstractStatEffect
{
public BonusSpoilRate(StatsSet params)
{
super(params, Stats.BONUS_SPOIL_RATE);
}
}

View File

@@ -29,6 +29,7 @@ BlockTarget: Causes the target to become untargetable.
Bluff: Rotates the target so you face its back. Bluff: Rotates the target so you face its back.
BonusDropAmount: Bonus amount for dropped items. (l2jmobius) BonusDropAmount: Bonus amount for dropped items. (l2jmobius)
BonusDropRate: Bonus chance for dropping items. (l2jmobius) BonusDropRate: Bonus chance for dropping items. (l2jmobius)
BonusSpoilRate: Bonus chance for acquiring spoil items. (l2jmobius)
Breath: Underwater breathing stat. Breath: Underwater breathing stat.
BuffBlock: Blocks target from receiving buffs. BuffBlock: Blocks target from receiving buffs.
CallParty: Recalls whole party. CallParty: Recalls whole party.

View File

@@ -716,11 +716,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
} }
// bonus drop rate effect // bonus drop rate effect
final double dropRateEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_RATE, 0); rateChance *= killer.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
if (dropRateEffectBonus > 0)
{
rateChance += rateChance * dropRateEffectBonus;
}
// calculate if item will drop // calculate if item will drop
if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance))
@@ -766,11 +762,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
} }
// bonus drop amount effect // bonus drop amount effect
final double dropAmountEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); rateAmount *= killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
if (dropAmountEffectBonus > 0)
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// finally // finally
return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount)); return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount));
@@ -786,6 +778,8 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
{ {
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
} }
// bonus drop rate effect
rateChance *= killer.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
// calculate if item will be rewarded // calculate if item will be rewarded
if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance))

View File

@@ -132,6 +132,7 @@ public enum Stats
BONUS_SP("bonusSp"), BONUS_SP("bonusSp"),
BONUS_DROP_AMOUNT("bonusDropAmount"), BONUS_DROP_AMOUNT("bonusDropAmount"),
BONUS_DROP_RATE("bonusDropRate"), BONUS_DROP_RATE("bonusDropRate"),
BONUS_SPOIL_RATE("bonusSpoilRate"),
ATTACK_CANCEL("cancel"), ATTACK_CANCEL("cancel"),
// ACCURACY & RANGE // ACCURACY & RANGE

View File

@@ -61,6 +61,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); EffectHandler.getInstance().registerHandler("Bluff", Bluff::new);
EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new); EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new);
EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new); EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new);
EffectHandler.getInstance().registerHandler("BonusSpoilRate", BonusSpoilRate::new);
EffectHandler.getInstance().registerHandler("Breath", Breath::new); EffectHandler.getInstance().registerHandler("Breath", Breath::new);
EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new);
EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new);

View File

@@ -401,8 +401,9 @@ public class NpcViewMod implements IBypassHandler
int leftHeight = 0; int leftHeight = 0;
int rightHeight = 0; int rightHeight = 0;
final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
final double spoilRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
final StringBuilder leftSb = new StringBuilder(); final StringBuilder leftSb = new StringBuilder();
final StringBuilder rightSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder();
String limitReachedMsg = ""; String limitReachedMsg = "";
@@ -428,6 +429,9 @@ public class NpcViewMod implements IBypassHandler
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT;
} }
// bonus spoil rate effect
rateChance *= spoilRateEffectBonus;
} }
else else
{ {
@@ -504,16 +508,9 @@ public class NpcViewMod implements IBypassHandler
} }
// bonus drop amount effect // bonus drop amount effect
if (dropAmountEffectBonus > 0) rateAmount *= dropAmountEffectBonus;
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// bonus drop rate effect // bonus drop rate effect
if (dropRateEffectBonus > 0) rateChance *= dropRateEffectBonus;
{
rateChance += rateChance * dropRateEffectBonus;
}
} }
sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">"); sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");

View File

@@ -168,8 +168,9 @@ public class DropSearchBoard implements IParseBoardHandler
int start = (page - 1) * 14; int start = (page - 1) * 14;
int end = Math.min(list.size() - 1, start + 14); int end = Math.min(list.size() - 1, start + 14);
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
final double spoilRateEffectBonus = player.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
for (int index = start; index <= end; index++) for (int index = start; index <= end; index++)
{ {
CBDropHolder cbDropHolder = list.get(index); CBDropHolder cbDropHolder = list.get(index);
@@ -188,6 +189,9 @@ public class DropSearchBoard implements IParseBoardHandler
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT;
} }
// bonus spoil rate effect
rateChance *= spoilRateEffectBonus;
} }
else else
{ {
@@ -266,16 +270,9 @@ public class DropSearchBoard implements IParseBoardHandler
} }
// bonus drop amount effect // bonus drop amount effect
if (dropAmountEffectBonus > 0) rateAmount *= dropAmountEffectBonus;
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// bonus drop rate effect // bonus drop rate effect
if (dropRateEffectBonus > 0) rateChance *= dropRateEffectBonus;
{
rateChance += rateChance * dropRateEffectBonus;
}
} }
builder.append("<tr>"); builder.append("<tr>");

View File

@@ -0,0 +1,31 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.effecthandlers;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.stats.Stats;
/**
* @author Mobius
*/
public class BonusSpoilRate extends AbstractStatEffect
{
public BonusSpoilRate(StatsSet params)
{
super(params, Stats.BONUS_SPOIL_RATE);
}
}

View File

@@ -29,6 +29,7 @@ BlockTarget: Causes the target to become untargetable.
Bluff: Rotates the target so you face its back. Bluff: Rotates the target so you face its back.
BonusDropAmount: Bonus amount for dropped items. (l2jmobius) BonusDropAmount: Bonus amount for dropped items. (l2jmobius)
BonusDropRate: Bonus chance for dropping items. (l2jmobius) BonusDropRate: Bonus chance for dropping items. (l2jmobius)
BonusSpoilRate: Bonus chance for acquiring spoil items. (l2jmobius)
Breath: Underwater breathing stat. Breath: Underwater breathing stat.
BuffBlock: Blocks target from receiving buffs. BuffBlock: Blocks target from receiving buffs.
CallParty: Recalls whole party. CallParty: Recalls whole party.

View File

@@ -716,11 +716,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
} }
// bonus drop rate effect // bonus drop rate effect
final double dropRateEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_RATE, 0); rateChance *= killer.getStat().getValue(Stats.BONUS_DROP_RATE, 1);
if (dropRateEffectBonus > 0)
{
rateChance += rateChance * dropRateEffectBonus;
}
// calculate if item will drop // calculate if item will drop
if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance))
@@ -766,11 +762,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
} }
// bonus drop amount effect // bonus drop amount effect
final double dropAmountEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); rateAmount *= killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1);
if (dropAmountEffectBonus > 0)
{
rateAmount += rateAmount * dropAmountEffectBonus;
}
// finally // finally
return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount)); return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount));
@@ -786,6 +778,8 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
{ {
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
} }
// bonus drop rate effect
rateChance *= killer.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1);
// calculate if item will be rewarded // calculate if item will be rewarded
if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance))

View File

@@ -132,6 +132,7 @@ public enum Stats
BONUS_SP("bonusSp"), BONUS_SP("bonusSp"),
BONUS_DROP_AMOUNT("bonusDropAmount"), BONUS_DROP_AMOUNT("bonusDropAmount"),
BONUS_DROP_RATE("bonusDropRate"), BONUS_DROP_RATE("bonusDropRate"),
BONUS_SPOIL_RATE("bonusSpoilRate"),
ATTACK_CANCEL("cancel"), ATTACK_CANCEL("cancel"),
// ACCURACY & RANGE // ACCURACY & RANGE