From 6833a38d937040f8804aa720c59fbd42a12e9a5f Mon Sep 17 00:00:00 2001
From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com>
Date: Mon, 20 Dec 2021 22:36:04 +0000
Subject: [PATCH] Addition of Ignition effect.
---
.../scripts/handlers/EffectMasterHandler.java | 1 +
.../handlers/effecthandlers/Ignition.java | 62 +++++++++++++++++++
.../game/data/stats/skills/30900-30999.xml | 2 +-
.../game/data/stats/skills/documentation.txt | 1 +
.../gameserver/model/effects/EffectFlag.java | 3 +-
.../model/itemcontainer/Inventory.java | 13 +++-
6 files changed, 79 insertions(+), 3 deletions(-)
create mode 100644 L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/effecthandlers/Ignition.java
diff --git a/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java
index bc12b89b60..b8cbb863bb 100644
--- a/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java
+++ b/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java
@@ -193,6 +193,7 @@ public class EffectMasterHandler
EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new);
EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new);
EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new);
+ EffectHandler.getInstance().registerHandler("Ignition", Ignition::new);
EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new);
EffectHandler.getInstance().registerHandler("ImmobileDamageBonus", ImmobileDamageBonus::new);
EffectHandler.getInstance().registerHandler("ImmobileDamageResist", ImmobileDamageResist::new);
diff --git a/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/effecthandlers/Ignition.java b/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/effecthandlers/Ignition.java
new file mode 100644
index 0000000000..58335d4220
--- /dev/null
+++ b/L2J_Mobius_10.0_MasterClass/dist/game/data/scripts/handlers/effecthandlers/Ignition.java
@@ -0,0 +1,62 @@
+/*
+ * 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 .
+ */
+package handlers.effecthandlers;
+
+import org.l2jmobius.commons.threads.ThreadPool;
+import org.l2jmobius.gameserver.model.StatSet;
+import org.l2jmobius.gameserver.model.actor.Creature;
+import org.l2jmobius.gameserver.model.effects.AbstractEffect;
+import org.l2jmobius.gameserver.model.effects.EffectFlag;
+import org.l2jmobius.gameserver.model.item.instance.Item;
+import org.l2jmobius.gameserver.model.skill.Skill;
+import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
+
+/**
+ * @author Mobius
+ */
+public class Ignition extends AbstractEffect
+{
+ public Ignition(StatSet params)
+ {
+ }
+
+ @Override
+ public long getEffectFlags()
+ {
+ return EffectFlag.IGNITION.getMask();
+ }
+
+ @Override
+ public void onStart(Creature effector, Creature effected, Skill skill, Item item)
+ {
+ ThreadPool.schedule(() ->
+ {
+ effector.sendPacket(new ExUserInfoEquipSlot(effector.getActingPlayer()));
+ effector.broadcastInfo();
+ }, 100);
+ }
+
+ @Override
+ public void onExit(Creature effector, Creature effected, Skill skill)
+ {
+ ThreadPool.schedule(() ->
+ {
+ effector.sendPacket(new ExUserInfoEquipSlot(effector.getActingPlayer()));
+ effector.broadcastInfo();
+ }, 100);
+ }
+}
diff --git a/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/30900-30999.xml b/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/30900-30999.xml
index f6982a4f3f..2f154a1ff2 100644
--- a/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/30900-30999.xml
+++ b/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/30900-30999.xml
@@ -929,7 +929,7 @@
5
1785
-
+
10
diff --git a/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/documentation.txt
index 05a42fb735..f63b61693b 100644
--- a/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/documentation.txt
+++ b/L2J_Mobius_10.0_MasterClass/dist/game/data/stats/skills/documentation.txt
@@ -163,6 +163,7 @@ HpDrain: Magical attack that absorbs given percentage of the damage inflicted as
Hp: Increases current HP by a static value.
HpRegen: HP Regeneration stat.
HpToOwner: DOT effect that absorbs HP over time.
+Ignition: Transforms sword to Death Knight's Flame Sword. (l2jmobius)
IgnoreDeath: Become undying. Hp cannot decrease below 1.
ImmobileDamageBonus: Bonus damage to immobile targets. (l2jmobius)
ImmobileDamageResist: Resist damage while immobile. (l2jmobius)
diff --git a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/effects/EffectFlag.java b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/effects/EffectFlag.java
index a4dbf0cc2a..211f8337e2 100644
--- a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/effects/EffectFlag.java
+++ b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/effects/EffectFlag.java
@@ -58,7 +58,8 @@ public enum EffectFlag
CHAT_BLOCK,
FAKE_DEATH,
DUELIST_FURY,
- FEAR;
+ FEAR,
+ IGNITION;
public long getMask()
{
diff --git a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java
index 50fb82f05c..9ff1d69150 100644
--- a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java
+++ b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java
@@ -49,6 +49,7 @@ import org.l2jmobius.gameserver.model.VariationInstance;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.effects.EffectFlag;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder;
@@ -1379,7 +1380,17 @@ public abstract class Inventory extends ItemContainer
public int getPaperdollItemVisualId(int slot)
{
final Item item = _paperdoll[slot];
- return (item != null) ? item.getVisualId() : 0;
+ if (item == null)
+ {
+ return 0;
+ }
+
+ if (item.isWeapon() && getOwner().isAffected(EffectFlag.IGNITION) && (item.getWeaponItem().getItemType() == WeaponType.SWORD) && (item.getWeaponItem().getBodyPart() != ItemTemplate.SLOT_LR_HAND))
+ {
+ return 82118; // Death Knight's Flame Sword
+ }
+
+ return item.getVisualId();
}
public VariationInstance getPaperdollAugmentation(int slot)