Addition of symbol seal data.

Contributed by NviX.
This commit is contained in:
MobiusDevelopment
2019-10-14 16:05:02 +00:00
parent ef88526bef
commit 3f2c76f960
22 changed files with 2250 additions and 202 deletions

View File

@@ -293,6 +293,7 @@ public class EffectMasterHandler
EffectHandler.getInstance().registerHandler("ResistSkill", ResistSkill::new);
EffectHandler.getInstance().registerHandler("Restoration", Restoration::new);
EffectHandler.getInstance().registerHandler("RestorationRandom", RestorationRandom::new);
EffectHandler.getInstance().registerHandler("RestoreSymbolSeal", RestoreSymbolSeal::new);
EffectHandler.getInstance().registerHandler("Resurrection", Resurrection::new);
EffectHandler.getInstance().registerHandler("ResurrectionSpecial", ResurrectionSpecial::new);
EffectHandler.getInstance().registerHandler("Reuse", Reuse::new);

View File

@@ -84,6 +84,7 @@ public class ClassChange extends AbstractEffect
msg.addClassId(player.getClassId().getId());
player.sendPacket(msg);
player.updateSymbolSealSkills();
player.broadcastUserInfo();
player.sendPacket(new AcquireSkillList(player));
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));

View File

@@ -0,0 +1,82 @@
/*
* 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.Config;
import org.l2jmobius.gameserver.enums.StatModifierType;
import org.l2jmobius.gameserver.model.StatsSet;
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 NviX
*/
public class RestoreSymbolSeal extends AbstractEffect
{
private final int _amount;
private final StatModifierType _mode;
public RestoreSymbolSeal(StatsSet params)
{
_amount = params.getInt("amount", 0);
_mode = params.getEnum("mode", StatModifierType.class, StatModifierType.PER);
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
if (effected.isDead() || effected.isDoor())
{
return;
}
PlayerInstance player = effected.getActingPlayer();
int basicAmount = _amount;
double amount = 0;
switch (_mode)
{
case DIFF:
{
amount = Math.min(basicAmount, Config.MAX_SYMBOL_SEAL_POINTS - player.getSymbolSealPoints());
break;
}
case PER:
{
amount = Math.min((Config.MAX_SYMBOL_SEAL_POINTS * basicAmount) / 100, Config.MAX_SYMBOL_SEAL_POINTS - player.getSymbolSealPoints());
break;
}
}
if (amount > 0)
{
final double newSymbolSealPoints = amount + effected.getActingPlayer().getSymbolSealPoints();
player.setSymbolSealPoints((int) newSymbolSealPoints);
player.updateSymbolSealSkills();
player.sendSkillList();
player.broadcastUserInfo();
}
}
}