From 31a42fc96a8b4e579cf057315dca984ac570bf24 Mon Sep 17 00:00:00 2001
From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com>
Date: Mon, 29 Jun 2015 12:24:23 +0000
Subject: [PATCH] IgnoreDeath effect. Contributed by NviX.
---
.../scripts/handlers/EffectMasterHandler.java | 1 +
.../handlers/effecthandlers/IgnoreDeath.java | 61 +++++++++++++++++++
.../game/data/stats/skills/10000-10099.xml | 16 ++---
.../model/actor/status/PcStatus.java | 2 +-
4 files changed, 71 insertions(+), 9 deletions(-)
create mode 100644 trunk/dist/game/data/scripts/handlers/effecthandlers/IgnoreDeath.java
diff --git a/trunk/dist/game/data/scripts/handlers/EffectMasterHandler.java b/trunk/dist/game/data/scripts/handlers/EffectMasterHandler.java
index 26c1f946e4..ed14495d87 100644
--- a/trunk/dist/game/data/scripts/handlers/EffectMasterHandler.java
+++ b/trunk/dist/game/data/scripts/handlers/EffectMasterHandler.java
@@ -108,6 +108,7 @@ public final class EffectMasterHandler
HpByLevel.class,
HpCpHeal.class,
HpDrain.class,
+ IgnoreDeath.class,
ImmobileBuff.class,
ImmobilePetBuff.class,
Invincible.class,
diff --git a/trunk/dist/game/data/scripts/handlers/effecthandlers/IgnoreDeath.java b/trunk/dist/game/data/scripts/handlers/effecthandlers/IgnoreDeath.java
new file mode 100644
index 0000000000..5d61fdb2e2
--- /dev/null
+++ b/trunk/dist/game/data/scripts/handlers/effecthandlers/IgnoreDeath.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2004-2015 L2J Server
+ *
+ * This file is part of L2J Server.
+ *
+ * L2J Server 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.
+ *
+ * L2J Server 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 com.l2jserver.gameserver.model.StatsSet;
+import com.l2jserver.gameserver.model.conditions.Condition;
+import com.l2jserver.gameserver.model.effects.AbstractEffect;
+import com.l2jserver.gameserver.model.effects.L2EffectType;
+import com.l2jserver.gameserver.model.skills.BuffInfo;
+
+/**
+ * IgnoreDeath effect implementation
+ */
+public final class IgnoreDeath extends AbstractEffect
+{
+
+ /**
+ * @param attachCond
+ * @param applyCond
+ * @param set
+ * @param params
+ */
+ public IgnoreDeath(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
+ {
+ super(attachCond, applyCond, set, params);
+ }
+
+ @Override
+ public L2EffectType getEffectType()
+ {
+ return L2EffectType.BUFF;
+ }
+
+ @Override
+ public void onStart(BuffInfo info)
+ {
+ info.getEffected().setIsMortal(false);
+ }
+
+ @Override
+ public void onExit(BuffInfo info)
+ {
+ info.getEffected().setIsMortal(true);
+ }
+}
\ No newline at end of file
diff --git a/trunk/dist/game/data/stats/skills/10000-10099.xml b/trunk/dist/game/data/stats/skills/10000-10099.xml
index 78fdc2b29e..6d40519a89 100644
--- a/trunk/dist/game/data/stats/skills/10000-10099.xml
+++ b/trunk/dist/game/data/stats/skills/10000-10099.xml
@@ -949,10 +949,12 @@
-
+
35 33 31 28 26 24 22 19 17 15
11 12 13 14 15 16 17 18 19 20
+
+
@@ -963,16 +965,14 @@
-
+
+
-
-
-
-
+
- -->
+
133 124 116 107 99 90 82 73 65 56
diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/status/PcStatus.java b/trunk/java/com/l2jserver/gameserver/model/actor/status/PcStatus.java
index 2e11c7954f..e24d31194e 100644
--- a/trunk/java/com/l2jserver/gameserver/model/actor/status/PcStatus.java
+++ b/trunk/java/com/l2jserver/gameserver/model/actor/status/PcStatus.java
@@ -293,7 +293,7 @@ public class PcStatus extends PlayableStatus
setCurrentHp(value);
}
- if ((getActiveChar().getCurrentHp() < 0.5) && !isHPConsumption)
+ if ((getActiveChar().getCurrentHp() < 0.5) && !isHPConsumption && getActiveChar().isMortal())
{
getActiveChar().abortAttack();
getActiveChar().abortCast();