Addition of BonusDropAdena effect.
This commit is contained in:
		@@ -64,6 +64,7 @@ public class EffectMasterHandler
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("BlockSkill", BlockSkill::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("BlockTarget", BlockTarget::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("Bluff", Bluff::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("BonusDropAdena", BonusDropAdena::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("BonusSpoilRate", BonusSpoilRate::new);
 | 
			
		||||
 
 | 
			
		||||
@@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.model.actor.Creature;
 | 
			
		||||
import org.l2jmobius.gameserver.model.actor.Npc;
 | 
			
		||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
 | 
			
		||||
import org.l2jmobius.gameserver.model.holders.DropHolder;
 | 
			
		||||
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
 | 
			
		||||
import org.l2jmobius.gameserver.model.items.Item;
 | 
			
		||||
import org.l2jmobius.gameserver.model.stats.Stat;
 | 
			
		||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
 | 
			
		||||
@@ -385,6 +386,7 @@ public class NpcViewMod implements IBypassHandler
 | 
			
		||||
		final DecimalFormat chanceFormat = new DecimalFormat("0.00##");
 | 
			
		||||
		int leftHeight = 0;
 | 
			
		||||
		int rightHeight = 0;
 | 
			
		||||
		final double dropAmountAdenaEffectBonus = player.getStat().getValue(Stat.BONUS_DROP_ADENA, 1);
 | 
			
		||||
		final double dropAmountEffectBonus = player.getStat().getValue(Stat.BONUS_DROP_AMOUNT, 1);
 | 
			
		||||
		final double dropRateEffectBonus = player.getStat().getValue(Stat.BONUS_DROP_RATE, 1);
 | 
			
		||||
		final double spoilRateEffectBonus = player.getStat().getValue(Stat.BONUS_SPOIL_RATE, 1);
 | 
			
		||||
@@ -492,6 +494,10 @@ public class NpcViewMod implements IBypassHandler
 | 
			
		||||
				
 | 
			
		||||
				// bonus drop amount effect
 | 
			
		||||
				rateAmount *= dropAmountEffectBonus;
 | 
			
		||||
				if (item.getId() == Inventory.ADENA_ID)
 | 
			
		||||
				{
 | 
			
		||||
					rateAmount *= dropAmountAdenaEffectBonus;
 | 
			
		||||
				}
 | 
			
		||||
				// bonus drop rate effect
 | 
			
		||||
				rateChance *= dropRateEffectBonus;
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -169,6 +169,7 @@ public class DropSearchBoard implements IParseBoardHandler
 | 
			
		||||
				final int start = (page - 1) * 14;
 | 
			
		||||
				final int end = Math.min(list.size() - 1, start + 14);
 | 
			
		||||
				final StringBuilder builder = new StringBuilder();
 | 
			
		||||
				final double dropAmountAdenaEffectBonus = player.getStat().getValue(Stat.BONUS_DROP_ADENA, 1);
 | 
			
		||||
				final double dropAmountEffectBonus = player.getStat().getValue(Stat.BONUS_DROP_AMOUNT, 1);
 | 
			
		||||
				final double dropRateEffectBonus = player.getStat().getValue(Stat.BONUS_DROP_RATE, 1);
 | 
			
		||||
				final double spoilRateEffectBonus = player.getStat().getValue(Stat.BONUS_SPOIL_RATE, 1);
 | 
			
		||||
@@ -271,6 +272,10 @@ public class DropSearchBoard implements IParseBoardHandler
 | 
			
		||||
						
 | 
			
		||||
						// bonus drop amount effect
 | 
			
		||||
						rateAmount *= dropAmountEffectBonus;
 | 
			
		||||
						if (item.getId() == Inventory.ADENA_ID)
 | 
			
		||||
						{
 | 
			
		||||
							rateAmount *= dropAmountAdenaEffectBonus;
 | 
			
		||||
						}
 | 
			
		||||
						// bonus drop rate effect
 | 
			
		||||
						rateChance *= dropRateEffectBonus;
 | 
			
		||||
					}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BonusDropAdena.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BonusDropAdena.java
									
									
									
									
										vendored
									
									
										Normal 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 org.l2jmobius.gameserver.model.StatSet;
 | 
			
		||||
import org.l2jmobius.gameserver.model.stats.Stat;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Mobius
 | 
			
		||||
 */
 | 
			
		||||
public class BonusDropAdena extends AbstractStatPercentEffect
 | 
			
		||||
{
 | 
			
		||||
	public BonusDropAdena(StatSet params)
 | 
			
		||||
	{
 | 
			
		||||
		super(params, Stat.BONUS_DROP_ADENA);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -34,6 +34,7 @@ BlockResurrection: Blocked target from getting ressurected.
 | 
			
		||||
BlockSkill: Blocks usage of given skill magic types. Identity Crysis.
 | 
			
		||||
BlockTarget: Causes the target to become untargetable.
 | 
			
		||||
Bluff: Rotates the target so you face its back.
 | 
			
		||||
BonusDropAdena: Bonus amount for dropped adena. (l2jmobius)
 | 
			
		||||
BonusDropAmount: Bonus amount for dropped items. (l2jmobius)
 | 
			
		||||
BonusDropRate: Bonus chance for dropping items. (l2jmobius)
 | 
			
		||||
BonusSpoilRate: Bonus chance for acquiring spoil items. (l2jmobius)
 | 
			
		||||
 
 | 
			
		||||
@@ -890,6 +890,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
 | 
			
		||||
					
 | 
			
		||||
					// bonus drop amount effect
 | 
			
		||||
					rateAmount *= killer.getStat().getValue(Stat.BONUS_DROP_AMOUNT, 1);
 | 
			
		||||
					if (itemId == Inventory.ADENA_ID)
 | 
			
		||||
					{
 | 
			
		||||
						rateAmount *= killer.getStat().getValue(Stat.BONUS_DROP_ADENA, 1);
 | 
			
		||||
					}
 | 
			
		||||
					
 | 
			
		||||
					// finally
 | 
			
		||||
					return new ItemHolder(itemId, (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount));
 | 
			
		||||
 
 | 
			
		||||
@@ -143,6 +143,7 @@ public enum Stat
 | 
			
		||||
	EXPSP_RATE("rExp"),
 | 
			
		||||
	BONUS_EXP("bonusExp"),
 | 
			
		||||
	BONUS_SP("bonusSp"),
 | 
			
		||||
	BONUS_DROP_ADENA("bonusDropAdena"),
 | 
			
		||||
	BONUS_DROP_AMOUNT("bonusDropAmount"),
 | 
			
		||||
	BONUS_DROP_RATE("bonusDropRate"),
 | 
			
		||||
	BONUS_SPOIL_RATE("bonusSpoilRate"),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user