Addition of AddSkillBySkill effect handler.
This commit is contained in:
		| @@ -37,6 +37,7 @@ public final class EffectMasterHandler | ||||
| 		EffectHandler.getInstance().registerHandler("AbsorbDamage", AbsorbDamage::new); | ||||
| 		EffectHandler.getInstance().registerHandler("Accuracy", Accuracy::new); | ||||
| 		EffectHandler.getInstance().registerHandler("AddHate", AddHate::new); | ||||
| 		EffectHandler.getInstance().registerHandler("AddSkillBySkill", AddSkillBySkill::new); | ||||
| 		EffectHandler.getInstance().registerHandler("AddTeleportBookmarkSlot", AddTeleportBookmarkSlot::new); | ||||
| 		EffectHandler.getInstance().registerHandler("AirBind", AirBind::new); | ||||
| 		EffectHandler.getInstance().registerHandler("AreaDamage", AreaDamage::new); | ||||
|   | ||||
							
								
								
									
										59
									
								
								L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AddSkillBySkill.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AddSkillBySkill.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,59 @@ | ||||
| /* | ||||
|  * 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.data.xml.impl.SkillData; | ||||
| import com.l2jmobius.gameserver.model.StatsSet; | ||||
| import com.l2jmobius.gameserver.model.actor.L2Character; | ||||
| import com.l2jmobius.gameserver.model.effects.AbstractEffect; | ||||
| import com.l2jmobius.gameserver.model.skills.BuffInfo; | ||||
| import com.l2jmobius.gameserver.model.skills.Skill; | ||||
|  | ||||
| /** | ||||
|  * @author Mobius | ||||
|  */ | ||||
| public class AddSkillBySkill extends AbstractEffect | ||||
| { | ||||
| 	private final int _existingSkillId; | ||||
| 	private final int _existingSkillLevel; | ||||
| 	private final Skill _addedSkill; | ||||
| 	 | ||||
| 	public AddSkillBySkill(StatsSet params) | ||||
| 	{ | ||||
| 		_existingSkillId = params.getInt("existingSkillId"); | ||||
| 		_existingSkillLevel = params.getInt("existingSkillLevel"); | ||||
| 		_addedSkill = SkillData.getInstance().getSkill(params.getInt("addedSkillId"), params.getInt("addedSkillLevel")); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public boolean canPump(L2Character effector, L2Character effected, Skill skill) | ||||
| 	{ | ||||
| 		return effector.isPlayer() && (effector.getSkillLevel(_existingSkillId) == _existingSkillLevel); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public void pump(L2Character effected, Skill skill) | ||||
| 	{ | ||||
| 		effected.addSkill(_addedSkill); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public void onExit(BuffInfo info) | ||||
| 	{ | ||||
| 		info.getEffected().removeSkill(_addedSkill, true); | ||||
| 	} | ||||
| } | ||||
| @@ -6,6 +6,7 @@ AbstractStatAddEffect: Abstract class for managing stat adding. | ||||
| AbstractStatEffect: Abstract class for managing stats. | ||||
| Accuracy: P. Accuracy stat. | ||||
| AddHate: Instant effect that increases target's hate towards you. | ||||
| AddSkillBySkill: Add skill when other skill already exists. (l2jmobius) | ||||
| AddTeleportBookmarkSlot: Instant effect that increases the amount of My Teleport slots. | ||||
| AirBind: Used by airbind chain skills. (l2jmobius) | ||||
| AreaDamage: Topography (Danger Zone) resistance stat. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDev
					MobiusDev