Dimensional Blessing addition.

Contributed by Iris and quangnguyen.
This commit is contained in:
MobiusDevelopment
2019-03-15 13:12:17 +00:00
parent 1d1de7a03b
commit c0184f6233
45 changed files with 1540 additions and 324 deletions

View File

@@ -155,6 +155,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("GetDamageLimit", GetDamageLimit::new);
EffectHandler.getInstance().registerHandler("GetMomentum", GetMomentum::new);
EffectHandler.getInstance().registerHandler("GiveClanReputation", GiveClanReputation::new);
EffectHandler.getInstance().registerHandler("GiveExpAndSp", GiveExpAndSp::new);
EffectHandler.getInstance().registerHandler("GiveFame", GiveFame::new);
EffectHandler.getInstance().registerHandler("GiveRecommendation", GiveRecommendation::new);
EffectHandler.getInstance().registerHandler("GiveSp", GiveSp::new);

View File

@@ -0,0 +1,70 @@
/*
* 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;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
/**
* Give XP and SP effect implementation.
* @author quangnguyen
*/
public final class GiveExpAndSp extends AbstractEffect
{
private final int _xp;
private final int _sp;
public GiveExpAndSp(StatsSet params)
{
_xp = params.getInt("xp", 0);
_sp = params.getInt("sp", 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;
}
if ((_sp != 0) && (_xp != 0))
{
effector.getActingPlayer().getStat().addExp(_xp);
effector.getActingPlayer().getStat().addSp(_sp);
SystemMessage sm = null;
sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_ACQUIRED_S1_XP_BONUS_S2_AND_S3_SP_BONUS_S4);
sm.addLong(_xp);
sm.addLong(0);
sm.addLong(_sp);
sm.addLong(0);
effector.sendPacket(sm);
}
}
}

View File

@@ -125,6 +125,7 @@ GetAgro: Causes enemy NPC to attack you.
GetDamageLimit: Sets the maximum amount of damage you can receive.
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)
GiveRecommendation: Gives recommendations to a player. Blue name.
GiveSp: Gives a given amount of SP.