Hunt for Santa improvements.

Contributed by gigilo1968.
This commit is contained in:
MobiusDev
2016-12-23 21:57:23 +00:00
parent cbb1d57077
commit 039bff7a80
8 changed files with 200 additions and 11 deletions

View File

@@ -38,6 +38,8 @@ public final class HuntForSanta extends LongTimeEvent
private static final SkillHolder BUFF_STOCKING = new SkillHolder(16419, 1);
private static final SkillHolder BUFF_TREE = new SkillHolder(16420, 1);
private static final SkillHolder BUFF_SNOWMAN = new SkillHolder(16421, 1);
// Item
// private static final int SANTAS_MARK = 40313;
private HuntForSanta()
{

View File

@@ -264,6 +264,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("Resurrection", Resurrection::new);
EffectHandler.getInstance().registerHandler("ResurrectionSpecial", ResurrectionSpecial::new);
EffectHandler.getInstance().registerHandler("Reuse", Reuse::new);
EffectHandler.getInstance().registerHandler("RewardItemOnExit",RewardItemOnExit::new);
EffectHandler.getInstance().registerHandler("Root", Root::new);
EffectHandler.getInstance().registerHandler("SafeFallHeight", SafeFallHeight::new);
EffectHandler.getInstance().registerHandler("SendSystemMessageToClan", SendSystemMessageToClan::new);

View File

@@ -0,0 +1,46 @@
/*
* 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.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.skills.BuffInfo;
/**
* Reward Item on Exit effect implementation.
* @author Mobius
*/
public final class RewardItemOnExit extends AbstractEffect
{
private final int _itemId;
private final long _itemCount;
public RewardItemOnExit(StatsSet params)
{
_itemId = params.getInt("itemId", 40313); // Default item is Santa's Mark.
_itemCount = params.getLong("itemCount", 1);
}
@Override
public void onExit(BuffInfo info)
{
if (!info.isRemoved() && info.getEffected().isPlayer() && !info.getEffected().getActingPlayer().isDead())
{
info.getEffected().getActingPlayer().addItem("RewardItemOnExitEffect", _itemId, _itemCount, info.getEffected().getActingPlayer(), true);
}
}
}