Limit for Aeore, Iss and Sigel skills.

Contributed by Ofelin.
This commit is contained in:
MobiusDev
2018-09-14 16:42:59 +00:00
parent b8eee1a198
commit a31a265459
20 changed files with 812 additions and 102 deletions

View File

@@ -185,6 +185,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("LimitCp", LimitCp::new);
EffectHandler.getInstance().registerHandler("LimitHp", LimitHp::new);
EffectHandler.getInstance().registerHandler("LimitMp", LimitMp::new);
EffectHandler.getInstance().registerHandler("LimitSkill", LimitSkill::new);
EffectHandler.getInstance().registerHandler("Lucky", Lucky::new);
EffectHandler.getInstance().registerHandler("MagicAccuracy", MagicAccuracy::new);
EffectHandler.getInstance().registerHandler("MagicalAbnormalDispelAttack", MagicalAbnormalDispelAttack::new);
@@ -340,6 +341,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("TeleportToPlayer", TeleportToPlayer::new);
EffectHandler.getInstance().registerHandler("TeleportToSummon", TeleportToSummon::new);
EffectHandler.getInstance().registerHandler("TeleportToTarget", TeleportToTarget::new);
EffectHandler.getInstance().registerHandler("TrackLimitedSkill", TrackLimitedSkill::new);
EffectHandler.getInstance().registerHandler("FlyAway", FlyAway::new);
EffectHandler.getInstance().registerHandler("TransferDamageToPlayer", TransferDamageToPlayer::new);
EffectHandler.getInstance().registerHandler("TransferDamageToSummon", TransferDamageToSummon::new);

View File

@@ -0,0 +1,132 @@
/*
* 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.skills.BuffInfo;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Ofelin
*/
public class LimitSkill extends AbstractEffect
{
private final static int LIMIT_OF_AEORE = 11833;
private final static int LIMIT_OF_SIGEL = 19526;
private final static int LIMIT_OF_ISS = 19527;
private final static int BATTLE_RAPSODY = 11544;
private final static int OVERLORDS_DIGNITY = 19439;
private final static int PROTECTION_OF_FATE = 10019;
private final static int NINE_AEGIS = 10024;
private final static int CELESTIAL_PROTECTION = 11758;
private final static int CELESTIAL_PARTY_PROTECTION = 11759;
public LimitSkill(StatsSet params)
{
}
@Override
public void onStart(L2Character effector, L2Character effected, Skill skill)
{
switch (skill.getId())
{
case LIMIT_OF_AEORE: // Limit of Aeore
{
decreaseAeoreBuffDuration(effector, effected, skill);
break;
}
case LIMIT_OF_SIGEL: // Limit of Sigel
{
decreaseSigelBuffDuration(effector, effected, skill);
break;
}
case LIMIT_OF_ISS: // Limit of Iss
{
decreaseIssBuffDuration(effector, effected, skill);
break;
}
}
}
private void decreaseAeoreBuffDuration(L2Character effector, L2Character effected, Skill skill)
{
switch (skill.getLevel())
{
case 1:
case 2:
{
modifyDuration(CELESTIAL_PROTECTION, effected, (int) (10 * 0.50)); // Decrease active effect of Celestial Protection by 50%
modifyDuration(CELESTIAL_PARTY_PROTECTION, effected, (int) (10 * 0.50)); // Decrease active effect of Celestial Party Protection by 50%
break;
}
}
}
private void decreaseSigelBuffDuration(L2Character effector, L2Character effected, Skill skill)
{
switch (skill.getLevel())
{
case 1:
{
modifyDuration(PROTECTION_OF_FATE, effected, (int) (30 * 0.80)); // Decrease active effect of Protection of Fate by 20%
modifyDuration(NINE_AEGIS, effected, (int) (30 * 0.80)); // Decrease active effect of Nine Aegis by 20%
break;
}
case 2:
{
modifyDuration(PROTECTION_OF_FATE, effected, (int) (30 * 0.20)); // Decrease active effect of Protection of Fate by 80%
modifyDuration(NINE_AEGIS, effected, (int) (30 * 0.20)); // Decrease active effect of Nine Aegis by 80%
break;
}
}
}
private void decreaseIssBuffDuration(L2Character effector, L2Character effected, Skill skill)
{
switch (skill.getLevel())
{
case 1:
{
modifyDuration(BATTLE_RAPSODY, effected, (int) (30 * 0.80)); // Decrease active effect of Battle Rhapsody by 20%
modifyDuration(OVERLORDS_DIGNITY, effected, (int) (30 * 0.80)); // Decrease active effect of Overlord's Dignity by 20%
break;
}
case 2:
{
modifyDuration(BATTLE_RAPSODY, effected, (int) (30 * 0.20)); // Decrease active effect of Battle Rhapsody by 80%
modifyDuration(OVERLORDS_DIGNITY, effected, (int) (30 * 0.20)); // Decrease active effect of Overlord's Dignity by 80%
break;
}
}
}
private void modifyDuration(int skillId, L2Character effected, int duration)
{
for (BuffInfo buff : effected.getEffectList().getEffects())
{
if (buff.getSkill().getId() == skillId)
{
if (duration > 0)
{
buff.setAbnormalTime(duration);
}
}
}
}
}

View File

@@ -0,0 +1,170 @@
/*
* 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.CharEffectList;
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.holders.SkillHolder;
import com.l2jmobius.gameserver.model.skills.BuffInfo;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Ofelin
*/
public class TrackLimitedSkill extends AbstractEffect
{
private final static int LIMIT_OF_AEORE = 11833;
private final static int LIMIT_OF_SIGEL = 19526;
private final static int LIMIT_OF_ISS = 19527;
private final static int BATTLE_RAPSODY = 11544;
private final static int OVERLORDS_DIGNITY = 19439;
private final static int PROTECTION_OF_FATE = 10019;
private final static int NINE_AEGIS = 10024;
private final static int CELESTIAL_PROTECTION = 11758;
private final static int CELESTIAL_PARTY_PROTECTION = 11759;
private int limitAeoreLevel = 0;
private int limitSigelLevel = 0;
private int limitIssLevel = 0;
public TrackLimitedSkill(StatsSet param)
{
}
@Override
public void onStart(L2Character effector, L2Character effected, Skill skill)
{
trackAeoreLimit(effector, effected, skill, LIMIT_OF_AEORE); // Tracking Aeore Limit Debuff
trackSigelLimit(effector, effected, skill, LIMIT_OF_SIGEL); // Tracking Sigel Limit Debuff
trackIssLimit(effector, effected, skill, LIMIT_OF_ISS); // Tracking Iss Limit Debuff
}
@Override
public void onExit(L2Character effector, L2Character effected, Skill skill)
{
if ((skill.getId() == BATTLE_RAPSODY) || (skill.getId() == OVERLORDS_DIGNITY))
{
increaseLimit(effector, effected, skill, limitIssLevel);
}
else if ((skill.getId() == PROTECTION_OF_FATE) || (skill.getId() == NINE_AEGIS))
{
increaseLimit(effector, effected, skill, limitSigelLevel);
}
else if ((skill.getId() == CELESTIAL_PROTECTION) || (skill.getId() == CELESTIAL_PARTY_PROTECTION))
{
increaseLimit(effector, effected, skill, limitAeoreLevel);
}
}
private void trackAeoreLimit(L2Character effector, L2Character effected, Skill skill, int limitSkillId)
{
limitAeoreLevel = 0;
CharEffectList effectList = effected.getEffectList();
for (BuffInfo debuff : effectList.getDebuffs())
{
if (debuff.getSkill().getId() == limitSkillId)
{
limitAeoreLevel = debuff.getSkill().getLevel();
if (limitAeoreLevel == 3)
{
effected.getEffectList().remove(effectList.getBuffInfoBySkillId(CELESTIAL_PROTECTION), false, false, false); // Remove Celestial Protection
effected.getEffectList().remove(effectList.getBuffInfoBySkillId(CELESTIAL_PARTY_PROTECTION), false, false, false); // Remove Celestial Party Protection
}
else
{
new SkillHolder(LIMIT_OF_AEORE, limitAeoreLevel).getSkill().applyEffects(effector, effected);
}
}
}
}
private void trackSigelLimit(L2Character effector, L2Character effected, Skill skill, int limitSkillId)
{
limitSigelLevel = 0;
CharEffectList effectList = effected.getEffectList();
for (BuffInfo debuff : effectList.getDebuffs())
{
if (debuff.getSkill().getId() == limitSkillId)
{
limitSigelLevel = debuff.getSkill().getLevel();
if (limitSigelLevel == 3)
{
effected.getEffectList().remove(effectList.getBuffInfoBySkillId(PROTECTION_OF_FATE), false, false, false); // Remove Protection of Fate
effected.getEffectList().remove(effectList.getBuffInfoBySkillId(NINE_AEGIS), false, false, false); // Remove Nine Aegis
}
else
{
new SkillHolder(LIMIT_OF_SIGEL, limitSigelLevel).getSkill().applyEffects(effector, effected);
}
}
}
}
private void trackIssLimit(L2Character effector, L2Character effected, Skill skill, int limitSkillId)
{
limitIssLevel = 0;
CharEffectList effectList = effected.getEffectList();
for (BuffInfo debuff : effectList.getDebuffs())
{
if (debuff.getSkill().getId() == limitSkillId)
{
limitIssLevel = debuff.getSkill().getLevel();
if (limitIssLevel == 3)
{
effected.getEffectList().remove(effectList.getBuffInfoBySkillId(BATTLE_RAPSODY), false, false, false); // Remove Battle Rhapsody
effected.getEffectList().remove(effectList.getBuffInfoBySkillId(OVERLORDS_DIGNITY), false, false, false); // Remove Overlord's Dignity
}
else
{
new SkillHolder(LIMIT_OF_ISS, limitIssLevel).getSkill().applyEffects(effector, effected);
}
}
}
}
private void increaseLimit(L2Character effector, L2Character effected, Skill skill, int limitLevel)
{
if (limitLevel < 3)
{
switch (skill.getId())
{
case BATTLE_RAPSODY: // Battle Rhapsody
case OVERLORDS_DIGNITY: // Overlord's Dignity
{
// limitIssLevel++;
new SkillHolder(LIMIT_OF_ISS, ++limitIssLevel).getSkill().applyEffects(effector, effected);
break;
}
case PROTECTION_OF_FATE: // Protection of Fate
case NINE_AEGIS: // Nine Aegis
{
new SkillHolder(LIMIT_OF_SIGEL, ++limitSigelLevel).getSkill().applyEffects(effector, effected);
break;
}
case CELESTIAL_PROTECTION: // Celestial Protection
case CELESTIAL_PARTY_PROTECTION: // Celestial Party Protection
{
new SkillHolder(LIMIT_OF_AEORE, ++limitAeoreLevel).getSkill().applyEffects(effector, effected);
break;
}
}
}
}
}