Addition of EffectZone removeEffectsOnExit parameter.

Thanks to CostyKiller and nasseka.
This commit is contained in:
MobiusDevelopment
2022-02-05 03:16:56 +00:00
parent ff1525bcc3
commit 987629ea69
57 changed files with 831 additions and 9 deletions

View File

@@ -42,6 +42,7 @@
<xs:enumeration value="restartAllowedTime" />
<xs:enumeration value="restartTime" />
<xs:enumeration value="reuse" />
<xs:enumeration value="removeEffectsOnExit" />
<xs:enumeration value="showDangerIcon" />
<xs:enumeration value="skillIdLvl" />
<xs:enumeration value="spawnMaxX" />

View File

@@ -2298,7 +2298,43 @@
<stat name="showDangerIcon" val="true" />
<stat name="initialDelay" val="3000" />
<!-- <stat name="unitTick" val="20" /> -->
<stat name="skillIdLvl" val="16734-1;" /> <!-- eaking Magic - Eradication -->
<stat name="skillIdLvl" val="16734-1;" /> <!-- Leaking Magic - Eradication -->
<node X="78023" Y="172262" />
</zone>
<!-- Primordial River - Elf Memory -->
<zone name="primordial_river_elf" type="EffectZone" shape="NPoly" minZ="-3880" maxZ="-4125">
<stat name="chance" val="100" />
<stat name="default_enabled" val="true" />
<stat name="showDangerIcon" val="false" />
<stat name="skillIdLvl" val="2994-1;" /> <!-- Aqua Elf Transformation -->
<stat name="removeEffectsOnExit" val="true" />
<node X="-8947" Y="-188486" />
<node X="-8946" Y="-188116" />
<node X="-13481" Y="-188135" />
<node X="-13502" Y="-188485" />
</zone>
<!-- Primordial River - Dark Elf - Kamael Memory -->
<zone name="primordial_river_delf_kamael" type="EffectZone" shape="NPoly" minZ="-4921" maxZ="-3950">
<stat name="chance" val="100" />
<stat name="default_enabled" val="true" />
<stat name="showDangerIcon" val="false" />
<stat name="skillIdLvl" val="2994-1;" /> <!-- Aqua Elf Transformation -->
<stat name="removeEffectsOnExit" val="true" />
<node X="-14270" Y="-185558" />
<node X="-13989" Y="-185944" />
<node X="-10107" Y="-183203" />
<node X="-10383" Y="-182826" />
</zone>
<!-- Primordial River - Dwarf - Human - Orc Memory -->
<zone name="primordial_river_delf_human_orc" type="EffectZone" shape="NPoly" minZ="-4000" maxZ="-2420">
<stat name="chance" val="100" />
<stat name="default_enabled" val="true" />
<stat name="showDangerIcon" val="false" />
<stat name="skillIdLvl" val="2994-1;" /> <!-- Aqua Elf Transformation -->
<stat name="removeEffectsOnExit" val="true" />
<node X="-16228" Y="-180440" />
<node X="-16589" Y="-180386" />
<node X="-16542" Y="-184948" />
<node X="-16241" Y="-184940" />
</zone>
</list>

View File

@@ -25,6 +25,7 @@ import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.enums.InstanceType;
import org.l2jmobius.gameserver.enums.SkillFinishType;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.zone.ZoneId;
@@ -42,6 +43,7 @@ public class EffectZone extends ZoneType
private int _reuse;
protected boolean _bypassConditions;
private boolean _isShowDangerIcon;
private boolean _removeEffectsOnExit;
protected Map<Integer, Integer> _skills;
protected volatile Future<?> _task;
@@ -54,6 +56,7 @@ public class EffectZone extends ZoneType
setTargetType(InstanceType.Playable); // default only playable
_bypassConditions = false;
_isShowDangerIcon = true;
_removeEffectsOnExit = false;
}
@Override
@@ -119,6 +122,11 @@ public class EffectZone extends ZoneType
}
break;
}
case "removeEffectsOnExit":
{
_removeEffectsOnExit = Boolean.parseBoolean(value);
break;
}
default:
{
super.setParameter(name, value);
@@ -170,6 +178,17 @@ public class EffectZone extends ZoneType
creature.sendPacket(new EtcStatusUpdate(creature.getActingPlayer()));
}
}
if (_removeEffectsOnExit && (_skills != null))
{
for (Entry<Integer, Integer> e : _skills.entrySet())
{
final Skill skill = SkillData.getInstance().getSkill(e.getKey().intValue(), e.getValue().intValue());
if ((skill != null) && creature.isAffectedBySkill(skill.getId()))
{
creature.stopSkillEffects(SkillFinishType.REMOVED, skill.getId());
}
}
}
}
if (getCharactersInside().isEmpty() && (_task != null))