Addition of ResetInstanceEntry effect handler.

This commit is contained in:
MobiusDev
2017-10-30 22:22:56 +00:00
parent 2173a49eb8
commit 64f3191c4d
12 changed files with 280 additions and 0 deletions

View File

@@ -262,6 +262,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("ReflectSkill", ReflectSkill::new);
EffectHandler.getInstance().registerHandler("RefuelAirship", RefuelAirship::new);
EffectHandler.getInstance().registerHandler("Relax", Relax::new);
EffectHandler.getInstance().registerHandler("ResetInstanceEntry", ResetInstanceEntry::new);
EffectHandler.getInstance().registerHandler("ResistAbnormalByCategory", ResistAbnormalByCategory::new);
EffectHandler.getInstance().registerHandler("ResistDDMagic", ResistDDMagic::new);
EffectHandler.getInstance().registerHandler("ResistDispelByCategory", ResistDispelByCategory::new);

View File

@@ -0,0 +1,68 @@
/*
* 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 java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
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;
/**
* @author Mobius
*/
public class ResetInstanceEntry extends AbstractEffect
{
private final Set<Integer> _instanceId;
public ResetInstanceEntry(StatsSet params)
{
final String instanceIds = params.getString("instanceId", null);
if ((instanceIds != null) && !instanceIds.isEmpty())
{
_instanceId = new HashSet<>();
for (String id : instanceIds.split(";"))
{
_instanceId.add(Integer.parseInt(id));
}
}
else
{
_instanceId = Collections.<Integer> emptySet();
}
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
for (int instanceId : _instanceId)
{
InstanceManager.getInstance().deleteInstanceTime(effector.getActingPlayer(), instanceId);
}
}
}

View File

@@ -230,6 +230,7 @@ ReflectMagic: Deflects magical damage back to the attacker.
ReflectSkill: Deflects physical/magical debuffs back to the attacker.
RefuelAirship: Increases Airship's fuel.
Relax: Sits down and increases HP regeneration until full.
ResetInstanceEntry: Resets instance re-entry time. (l2jmobius)
ResistAbnormalByCategory: Buff/debuff resist stat.
ResistDDMagic: Magic resist stat (magic attack 50% effective or 1 damage)
ResistDispelByCategory: Buff/Debuff cancellation resist.

View File

@@ -262,6 +262,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("ReflectSkill", ReflectSkill::new);
EffectHandler.getInstance().registerHandler("RefuelAirship", RefuelAirship::new);
EffectHandler.getInstance().registerHandler("Relax", Relax::new);
EffectHandler.getInstance().registerHandler("ResetInstanceEntry", ResetInstanceEntry::new);
EffectHandler.getInstance().registerHandler("ResistAbnormalByCategory", ResistAbnormalByCategory::new);
EffectHandler.getInstance().registerHandler("ResistDDMagic", ResistDDMagic::new);
EffectHandler.getInstance().registerHandler("ResistDispelByCategory", ResistDispelByCategory::new);

View File

@@ -0,0 +1,68 @@
/*
* 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 java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
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;
/**
* @author Mobius
*/
public class ResetInstanceEntry extends AbstractEffect
{
private final Set<Integer> _instanceId;
public ResetInstanceEntry(StatsSet params)
{
final String instanceIds = params.getString("instanceId", null);
if ((instanceIds != null) && !instanceIds.isEmpty())
{
_instanceId = new HashSet<>();
for (String id : instanceIds.split(";"))
{
_instanceId.add(Integer.parseInt(id));
}
}
else
{
_instanceId = Collections.<Integer> emptySet();
}
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
for (int instanceId : _instanceId)
{
InstanceManager.getInstance().deleteInstanceTime(effector.getActingPlayer(), instanceId);
}
}
}

View File

@@ -230,6 +230,7 @@ ReflectMagic: Deflects magical damage back to the attacker.
ReflectSkill: Deflects physical/magical debuffs back to the attacker.
RefuelAirship: Increases Airship's fuel.
Relax: Sits down and increases HP regeneration until full.
ResetInstanceEntry: Resets instance re-entry time. (l2jmobius)
ResistAbnormalByCategory: Buff/debuff resist stat.
ResistDDMagic: Magic resist stat (magic attack 50% effective or 1 damage)
ResistDispelByCategory: Buff/Debuff cancellation resist.

View File

@@ -262,6 +262,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("ReflectSkill", ReflectSkill::new);
EffectHandler.getInstance().registerHandler("RefuelAirship", RefuelAirship::new);
EffectHandler.getInstance().registerHandler("Relax", Relax::new);
EffectHandler.getInstance().registerHandler("ResetInstanceEntry", ResetInstanceEntry::new);
EffectHandler.getInstance().registerHandler("ResistAbnormalByCategory", ResistAbnormalByCategory::new);
EffectHandler.getInstance().registerHandler("ResistDDMagic", ResistDDMagic::new);
EffectHandler.getInstance().registerHandler("ResistDispelByCategory", ResistDispelByCategory::new);

View File

@@ -0,0 +1,68 @@
/*
* 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 java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
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;
/**
* @author Mobius
*/
public class ResetInstanceEntry extends AbstractEffect
{
private final Set<Integer> _instanceId;
public ResetInstanceEntry(StatsSet params)
{
final String instanceIds = params.getString("instanceId", null);
if ((instanceIds != null) && !instanceIds.isEmpty())
{
_instanceId = new HashSet<>();
for (String id : instanceIds.split(";"))
{
_instanceId.add(Integer.parseInt(id));
}
}
else
{
_instanceId = Collections.<Integer> emptySet();
}
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
for (int instanceId : _instanceId)
{
InstanceManager.getInstance().deleteInstanceTime(effector.getActingPlayer(), instanceId);
}
}
}

View File

@@ -230,6 +230,7 @@ ReflectMagic: Deflects magical damage back to the attacker.
ReflectSkill: Deflects physical/magical debuffs back to the attacker.
RefuelAirship: Increases Airship's fuel.
Relax: Sits down and increases HP regeneration until full.
ResetInstanceEntry: Resets instance re-entry time. (l2jmobius)
ResistAbnormalByCategory: Buff/debuff resist stat.
ResistDDMagic: Magic resist stat (magic attack 50% effective or 1 damage)
ResistDispelByCategory: Buff/Debuff cancellation resist.

View File

@@ -262,6 +262,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("ReflectSkill", ReflectSkill::new);
EffectHandler.getInstance().registerHandler("RefuelAirship", RefuelAirship::new);
EffectHandler.getInstance().registerHandler("Relax", Relax::new);
EffectHandler.getInstance().registerHandler("ResetInstanceEntry", ResetInstanceEntry::new);
EffectHandler.getInstance().registerHandler("ResistAbnormalByCategory", ResistAbnormalByCategory::new);
EffectHandler.getInstance().registerHandler("ResistDDMagic", ResistDDMagic::new);
EffectHandler.getInstance().registerHandler("ResistDispelByCategory", ResistDispelByCategory::new);

View File

@@ -0,0 +1,68 @@
/*
* 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 java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
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;
/**
* @author Mobius
*/
public class ResetInstanceEntry extends AbstractEffect
{
private final Set<Integer> _instanceId;
public ResetInstanceEntry(StatsSet params)
{
final String instanceIds = params.getString("instanceId", null);
if ((instanceIds != null) && !instanceIds.isEmpty())
{
_instanceId = new HashSet<>();
for (String id : instanceIds.split(";"))
{
_instanceId.add(Integer.parseInt(id));
}
}
else
{
_instanceId = Collections.<Integer> emptySet();
}
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
for (int instanceId : _instanceId)
{
InstanceManager.getInstance().deleteInstanceTime(effector.getActingPlayer(), instanceId);
}
}
}

View File

@@ -230,6 +230,7 @@ ReflectMagic: Deflects magical damage back to the attacker.
ReflectSkill: Deflects physical/magical debuffs back to the attacker.
RefuelAirship: Increases Airship's fuel.
Relax: Sits down and increases HP regeneration until full.
ResetInstanceEntry: Resets instance re-entry time. (l2jmobius)
ResistAbnormalByCategory: Buff/debuff resist stat.
ResistDDMagic: Magic resist stat (magic attack 50% effective or 1 damage)
ResistDispelByCategory: Buff/Debuff cancellation resist.