Fortune Pocket items.

This commit is contained in:
MobiusDev
2016-07-08 11:56:11 +00:00
parent 75251f7c00
commit a77c8fe253
4 changed files with 241 additions and 19 deletions

View File

@@ -140,6 +140,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("GetMomentum", GetMomentum::new);
EffectHandler.getInstance().registerHandler("GiveRecommendation", GiveRecommendation::new);
EffectHandler.getInstance().registerHandler("GiveSp", GiveSp::new);
EffectHandler.getInstance().registerHandler("GiveXp", GiveXp::new);
EffectHandler.getInstance().registerHandler("Grow", Grow::new);
EffectHandler.getInstance().registerHandler("HairAccessorySet", HairAccessorySet::new);
EffectHandler.getInstance().registerHandler("Harvesting", Harvesting::new);

View File

@@ -0,0 +1,54 @@
/*
* 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.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* Give XP effect implementation.
* @author Mobius
*/
public final class GiveXp extends AbstractEffect
{
private final int _xp;
public GiveXp(StatsSet params)
{
_xp = params.getInt("xp", 0);
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (!effector.isPlayer() || !effected.isPlayer() || effected.isAlikeDead())
{
return;
}
effector.getActingPlayer().addExpAndSp(_xp, 0);
}
}