Recipes rework.
Adapted from: L2jUnity free files.
This commit is contained in:
		@@ -90,12 +90,16 @@ public final class EffectMasterHandler
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CpHealOverTime", CpHealOverTime::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CpHealPercent", CpHealPercent::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CpRegen", CpRegen::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CraftingCritical", CraftingCritical::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CreateCommonItem", CreateCommonItem::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CreateItem", CreateItem::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CreateItemRandom", CreateItemRandom::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CriticalDamage", CriticalDamage::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CriticalDamagePosition", CriticalDamagePosition::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CriticalRate", CriticalRate::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CriticalRatePositionBonus", CriticalRatePositionBonus::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CrystalGradeModify", CrystalGradeModify::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("Crystallize", Crystallize::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("DamageShield", DamageShield::new);
 | 
			
		||||
@@ -265,6 +269,7 @@ public final class EffectMasterHandler
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("ReflectSkill", ReflectSkill::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("RefuelAirship", RefuelAirship::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("Relax", Relax::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("RemoveEquipPenalty", RemoveEquipPenalty::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("ResetInstanceEntry", ResetInstanceEntry::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("ResistAbnormalByCategory", ResistAbnormalByCategory::new);
 | 
			
		||||
		EffectHandler.getInstance().registerHandler("ResistDDMagic", ResistDDMagic::new);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CraftingCritical.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CraftingCritical.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 com.l2jmobius.gameserver.model.StatsSet;
 | 
			
		||||
import com.l2jmobius.gameserver.model.stats.Stats;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Nik
 | 
			
		||||
 */
 | 
			
		||||
public class CraftingCritical extends AbstractStatAddEffect
 | 
			
		||||
{
 | 
			
		||||
	public CraftingCritical(StatsSet params)
 | 
			
		||||
	{
 | 
			
		||||
		super(params, Stats.CRAFTING_CRITICAL);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										64
									
								
								L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CreateCommonItem.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CreateCommonItem.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,64 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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.actor.L2Character;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * An effect that allows the player to create common recipe items up to a certain level.
 | 
			
		||||
 * @author Nik
 | 
			
		||||
 */
 | 
			
		||||
public final class CreateCommonItem extends AbstractEffect
 | 
			
		||||
{
 | 
			
		||||
	private final int _recipeLevel;
 | 
			
		||||
	
 | 
			
		||||
	public CreateCommonItem(StatsSet params)
 | 
			
		||||
	{
 | 
			
		||||
		_recipeLevel = params.getInt("value");
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean canStart(BuffInfo info)
 | 
			
		||||
	{
 | 
			
		||||
		return info.getEffected().isPlayer();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onStart(L2Character effector, L2Character effected, Skill skill)
 | 
			
		||||
	{
 | 
			
		||||
		final L2PcInstance player = effected.getActingPlayer();
 | 
			
		||||
		if (player != null)
 | 
			
		||||
		{
 | 
			
		||||
			player.setCreateCommonItemLevel(_recipeLevel);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onExit(BuffInfo info)
 | 
			
		||||
	{
 | 
			
		||||
		final L2PcInstance player = info.getEffected().getActingPlayer();
 | 
			
		||||
		if (player != null)
 | 
			
		||||
		{
 | 
			
		||||
			player.setCreateCommonItemLevel(0);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										64
									
								
								L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CreateItem.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CreateItem.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,64 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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.actor.L2Character;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * An effect that allows the player to create dwarven recipe items up to a certain level.
 | 
			
		||||
 * @author Nik
 | 
			
		||||
 */
 | 
			
		||||
public final class CreateItem extends AbstractEffect
 | 
			
		||||
{
 | 
			
		||||
	private final int _recipeLevel;
 | 
			
		||||
	
 | 
			
		||||
	public CreateItem(StatsSet params)
 | 
			
		||||
	{
 | 
			
		||||
		_recipeLevel = params.getInt("value");
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean canStart(BuffInfo info)
 | 
			
		||||
	{
 | 
			
		||||
		return info.getEffected().isPlayer();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onStart(L2Character effector, L2Character effected, Skill skill)
 | 
			
		||||
	{
 | 
			
		||||
		final L2PcInstance player = effected.getActingPlayer();
 | 
			
		||||
		if (player != null)
 | 
			
		||||
		{
 | 
			
		||||
			player.setCreateItemLevel(_recipeLevel);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onExit(BuffInfo info)
 | 
			
		||||
	{
 | 
			
		||||
		final L2PcInstance player = info.getEffected().getActingPlayer();
 | 
			
		||||
		if (player != null)
 | 
			
		||||
		{
 | 
			
		||||
			player.setCreateItemLevel(0);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -29,11 +29,11 @@ import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
 */
 | 
			
		||||
public final class CrystalGradeModify extends AbstractEffect
 | 
			
		||||
{
 | 
			
		||||
	private final int _grade;
 | 
			
		||||
	private final int _amount;
 | 
			
		||||
	
 | 
			
		||||
	public CrystalGradeModify(StatsSet params)
 | 
			
		||||
	{
 | 
			
		||||
		_grade = params.getInt("grade", 0);
 | 
			
		||||
		_amount = params.getInt("_amount", 0);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
@@ -45,7 +45,7 @@ public final class CrystalGradeModify extends AbstractEffect
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onStart(L2Character effector, L2Character effected, Skill skill)
 | 
			
		||||
	{
 | 
			
		||||
		effected.getActingPlayer().setExpertisePenaltyBonus(_grade);
 | 
			
		||||
		effected.getActingPlayer().setExpertisePenaltyBonus(_amount);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										65
									
								
								L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Crystallize.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Crystallize.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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.enums.ItemGrade;
 | 
			
		||||
import com.l2jmobius.gameserver.model.StatsSet;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.L2Character;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * An effect that allows the player to crystallize items up to a certain grade.
 | 
			
		||||
 * @author Nik
 | 
			
		||||
 */
 | 
			
		||||
public final class Crystallize extends AbstractEffect
 | 
			
		||||
{
 | 
			
		||||
	private final ItemGrade _grade;
 | 
			
		||||
	
 | 
			
		||||
	public Crystallize(StatsSet params)
 | 
			
		||||
	{
 | 
			
		||||
		_grade = params.getEnum("grade", ItemGrade.class);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean canStart(BuffInfo info)
 | 
			
		||||
	{
 | 
			
		||||
		return info.getEffected().isPlayer();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onStart(L2Character effector, L2Character effected, Skill skill)
 | 
			
		||||
	{
 | 
			
		||||
		final L2PcInstance player = effected.getActingPlayer();
 | 
			
		||||
		if (player != null)
 | 
			
		||||
		{
 | 
			
		||||
			player.setCrystallizeGrade(_grade);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onExit(BuffInfo info)
 | 
			
		||||
	{
 | 
			
		||||
		final L2PcInstance player = info.getEffected().getActingPlayer();
 | 
			
		||||
		if (player != null)
 | 
			
		||||
		{
 | 
			
		||||
			player.setCrystallizeGrade(null);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -16,7 +16,6 @@
 | 
			
		||||
 */
 | 
			
		||||
package handlers.effecthandlers;
 | 
			
		||||
 | 
			
		||||
import com.l2jmobius.gameserver.RecipeController;
 | 
			
		||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
 | 
			
		||||
import com.l2jmobius.gameserver.model.StatsSet;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.L2Character;
 | 
			
		||||
@@ -25,6 +24,7 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
 | 
			
		||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
import com.l2jmobius.gameserver.network.SystemMessageId;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.RecipeBookItemList;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Open Common Recipe Book effect implementation.
 | 
			
		||||
@@ -45,18 +45,24 @@ public final class OpenCommonRecipeBook extends AbstractEffect
 | 
			
		||||
	@Override
 | 
			
		||||
	public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
 | 
			
		||||
	{
 | 
			
		||||
		if (!effector.isPlayer())
 | 
			
		||||
		final L2PcInstance casterPlayer = effector.getActingPlayer();
 | 
			
		||||
		if (casterPlayer == null)
 | 
			
		||||
		{
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		final L2PcInstance player = effector.getActingPlayer();
 | 
			
		||||
		if (player.getPrivateStoreType() != PrivateStoreType.NONE)
 | 
			
		||||
		if (casterPlayer.getPrivateStoreType() == PrivateStoreType.MANUFACTURE)
 | 
			
		||||
		{
 | 
			
		||||
			player.sendPacket(SystemMessageId.ITEM_CREATION_IS_NOT_POSSIBLE_WHILE_ENGAGED_IN_A_TRADE);
 | 
			
		||||
			casterPlayer.sendPacket(SystemMessageId.YOU_MAY_NOT_ALTER_YOUR_RECIPE_BOOK_WHILE_ENGAGED_IN_MANUFACTURING);
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		RecipeController.getInstance().requestBookOpen(player, false);
 | 
			
		||||
		if (casterPlayer.isProcessingTransaction())
 | 
			
		||||
		{
 | 
			
		||||
			casterPlayer.sendPacket(SystemMessageId.ITEM_CREATION_IS_NOT_POSSIBLE_WHILE_ENGAGED_IN_A_TRADE);
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		casterPlayer.sendPacket(new RecipeBookItemList(casterPlayer, false));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,6 @@
 | 
			
		||||
 */
 | 
			
		||||
package handlers.effecthandlers;
 | 
			
		||||
 | 
			
		||||
import com.l2jmobius.gameserver.RecipeController;
 | 
			
		||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
 | 
			
		||||
import com.l2jmobius.gameserver.model.StatsSet;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.L2Character;
 | 
			
		||||
@@ -25,6 +24,7 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
 | 
			
		||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
import com.l2jmobius.gameserver.network.SystemMessageId;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.RecipeBookItemList;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Open Dwarf Recipe Book effect implementation.
 | 
			
		||||
@@ -45,18 +45,24 @@ public final class OpenDwarfRecipeBook extends AbstractEffect
 | 
			
		||||
	@Override
 | 
			
		||||
	public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
 | 
			
		||||
	{
 | 
			
		||||
		if (!effector.isPlayer())
 | 
			
		||||
		final L2PcInstance casterPlayer = effector.getActingPlayer();
 | 
			
		||||
		if (casterPlayer == null)
 | 
			
		||||
		{
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		final L2PcInstance player = effector.getActingPlayer();
 | 
			
		||||
		if (player.getPrivateStoreType() != PrivateStoreType.NONE)
 | 
			
		||||
		if (casterPlayer.getPrivateStoreType() == PrivateStoreType.MANUFACTURE)
 | 
			
		||||
		{
 | 
			
		||||
			player.sendPacket(SystemMessageId.ITEM_CREATION_IS_NOT_POSSIBLE_WHILE_ENGAGED_IN_A_TRADE);
 | 
			
		||||
			casterPlayer.sendPacket(SystemMessageId.YOU_MAY_NOT_ALTER_YOUR_RECIPE_BOOK_WHILE_ENGAGED_IN_MANUFACTURING);
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		RecipeController.getInstance().requestBookOpen(player, true);
 | 
			
		||||
		if (casterPlayer.isProcessingTransaction())
 | 
			
		||||
		{
 | 
			
		||||
			casterPlayer.sendPacket(SystemMessageId.ITEM_CREATION_IS_NOT_POSSIBLE_WHILE_ENGAGED_IN_A_TRADE);
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		casterPlayer.sendPacket(new RecipeBookItemList(casterPlayer, true));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,65 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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.actor.L2Character;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
 | 
			
		||||
import com.l2jmobius.gameserver.model.items.type.CrystalType;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * An effect that removes equipment grade penalty. Its the base effect for the grade penalty mechanics.
 | 
			
		||||
 * @author Nik
 | 
			
		||||
 */
 | 
			
		||||
public final class RemoveEquipPenalty extends AbstractEffect
 | 
			
		||||
{
 | 
			
		||||
	private final CrystalType _grade;
 | 
			
		||||
	
 | 
			
		||||
	public RemoveEquipPenalty(StatsSet params)
 | 
			
		||||
	{
 | 
			
		||||
		_grade = params.getEnum("grade", CrystalType.class);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean canStart(BuffInfo info)
 | 
			
		||||
	{
 | 
			
		||||
		return info.getEffected().isPlayer();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onStart(L2Character effector, L2Character effected, Skill skill)
 | 
			
		||||
	{
 | 
			
		||||
		final L2PcInstance player = effected.getActingPlayer();
 | 
			
		||||
		if (player != null)
 | 
			
		||||
		{
 | 
			
		||||
			player.setExpertiseLevel(_grade);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onExit(BuffInfo info)
 | 
			
		||||
	{
 | 
			
		||||
		final L2PcInstance player = info.getEffected().getActingPlayer();
 | 
			
		||||
		if (player != null)
 | 
			
		||||
		{
 | 
			
		||||
			player.setExpertiseLevel(null);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -42,7 +42,7 @@ public class CharmOfCourage implements IItemHandler
 | 
			
		||||
		final L2PcInstance activeChar = playable.getActingPlayer();
 | 
			
		||||
		
 | 
			
		||||
		int level = activeChar.getLevel();
 | 
			
		||||
		final int itemLevel = item.getItem().getCrystalType().getId();
 | 
			
		||||
		final int itemLevel = item.getItem().getCrystalType().getLevel();
 | 
			
		||||
		
 | 
			
		||||
		if (level < 20)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -18,9 +18,9 @@ package handlers.itemhandlers;
 | 
			
		||||
 | 
			
		||||
import com.l2jmobius.gameserver.data.xml.impl.RecipeData;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.IItemHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.model.L2RecipeList;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.holders.RecipeHolder;
 | 
			
		||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.network.SystemMessageId;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
 | 
			
		||||
@@ -40,15 +40,16 @@ public class Recipes implements IItemHandler
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		final L2PcInstance activeChar = playable.getActingPlayer();
 | 
			
		||||
		if (activeChar.isInCraftMode())
 | 
			
		||||
		if (activeChar.isCrafting())
 | 
			
		||||
		{
 | 
			
		||||
			activeChar.sendPacket(SystemMessageId.YOU_MAY_NOT_ALTER_YOUR_RECIPE_BOOK_WHILE_ENGAGED_IN_MANUFACTURING);
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		final L2RecipeList rp = RecipeData.getInstance().getRecipeByItemId(item.getId());
 | 
			
		||||
		final RecipeHolder rp = RecipeData.getInstance().getRecipeByRecipeItemId(item.getId());
 | 
			
		||||
		if (rp == null)
 | 
			
		||||
		{
 | 
			
		||||
			activeChar.sendPacket(SystemMessageId.THE_RECIPE_IS_INCORRECT);
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
@@ -63,15 +64,15 @@ public class Recipes implements IItemHandler
 | 
			
		||||
		boolean recipeLimit = false;
 | 
			
		||||
		if (rp.isDwarvenRecipe())
 | 
			
		||||
		{
 | 
			
		||||
			canCraft = activeChar.hasDwarvenCraft();
 | 
			
		||||
			recipeLevel = (rp.getLevel() > activeChar.getDwarvenCraft());
 | 
			
		||||
			recipeLimit = (activeChar.getDwarvenRecipeBook().length >= activeChar.getDwarfRecipeLimit());
 | 
			
		||||
			canCraft = activeChar.getCreateItemLevel() > 0;
 | 
			
		||||
			recipeLevel = (rp.getLevel() > activeChar.getCreateItemLevel());
 | 
			
		||||
			recipeLimit = (activeChar.getDwarvenRecipeBook().size() >= activeChar.getDwarfRecipeLimit());
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			canCraft = activeChar.hasCommonCraft();
 | 
			
		||||
			recipeLevel = (rp.getLevel() > activeChar.getCommonCraft());
 | 
			
		||||
			recipeLimit = (activeChar.getCommonRecipeBook().length >= activeChar.getCommonRecipeLimit());
 | 
			
		||||
			canCraft = activeChar.getCreateCommonItemLevel() > 0;
 | 
			
		||||
			recipeLevel = (rp.getLevel() > activeChar.getCreateCommonItemLevel());
 | 
			
		||||
			recipeLimit = (activeChar.getCommonRecipeBook().size() >= activeChar.getCommonRecipeLimit());
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		if (!canCraft)
 | 
			
		||||
 
 | 
			
		||||
@@ -119,7 +119,7 @@ public final class SocialAction implements IPlayerActionHandler
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		SystemMessage sm;
 | 
			
		||||
		if (player.isInStoreMode() || player.isInCraftMode())
 | 
			
		||||
		if (player.isInStoreMode() || player.isCrafting())
 | 
			
		||||
		{
 | 
			
		||||
			sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_PRIVATE_STORE_MODE_OR_IN_A_BATTLE_AND_CANNOT_BE_REQUESTED_FOR_A_COUPLE_ACTION);
 | 
			
		||||
			sm.addPcName(player);
 | 
			
		||||
@@ -198,7 +198,7 @@ public final class SocialAction implements IPlayerActionHandler
 | 
			
		||||
		
 | 
			
		||||
		// Checks for partner.
 | 
			
		||||
		final L2PcInstance partner = target.getActingPlayer();
 | 
			
		||||
		if (partner.isInStoreMode() || partner.isInCraftMode())
 | 
			
		||||
		if (partner.isInStoreMode() || partner.isCrafting())
 | 
			
		||||
		{
 | 
			
		||||
			sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_PRIVATE_STORE_MODE_OR_IN_A_BATTLE_AND_CANNOT_BE_REQUESTED_FOR_A_COUPLE_ACTION);
 | 
			
		||||
			sm.addPcName(partner);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user