Addition of GiveHonorCoins effect.

This commit is contained in:
MobiusDevelopment 2021-05-23 02:10:39 +00:00
parent d7f7c3fb72
commit 35553698f1
3 changed files with 57 additions and 0 deletions

View File

@ -162,6 +162,7 @@ public class EffectMasterHandler
EffectHandler.getInstance().registerHandler("GiveClanReputation", GiveClanReputation::new);
EffectHandler.getInstance().registerHandler("GiveExpAndSp", GiveExpAndSp::new);
EffectHandler.getInstance().registerHandler("GiveFame", GiveFame::new);
EffectHandler.getInstance().registerHandler("GiveHonorCoins", GiveHonorCoins::new);
EffectHandler.getInstance().registerHandler("GiveRecommendation", GiveRecommendation::new);
EffectHandler.getInstance().registerHandler("GiveSp", GiveSp::new);
EffectHandler.getInstance().registerHandler("GiveXp", GiveXp::new);

View File

@ -0,0 +1,55 @@
/*
* 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.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Mobius
*/
public class GiveHonorCoins extends AbstractEffect
{
private final long _amount;
public GiveHonorCoins(StatSet params)
{
_amount = params.getLong("amount", 0);
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
if (!effector.isPlayer() || !effected.isPlayer() || effected.isAlikeDead())
{
return;
}
final PlayerInstance player = effector.getActingPlayer();
player.setHonorCoins(player.getHonorCoins() + _amount);
}
}

View File

@ -133,6 +133,7 @@ GetMomentum: Increases momentum by a given value at fixed rate.
GiveClanReputation: Gives clan reputation points to a players clan. (l2jmobius)
GiveExpAndSp: Gives a given amount of XP and SP. (l2jmobius)
GiveFame: Gives a given amount of Fame. (l2jmobius)
GiveHonorCoins: Gives a given amount of Honor Coins. (l2jmobius)
GiveRecommendation: Gives recommendations to a player. Blue name.
GiveSp: Gives a given amount of SP.
GiveXp: Gives a given amount of XP. (l2jmobius)