diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
index 02f29f0a1a..488c79adfb 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
@@ -16,58 +16,53 @@
*/
package handlers.effecthandlers;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
-import com.l2jmobius.gameserver.model.actor.L2Summon;
+import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
-import com.l2jmobius.gameserver.model.effects.EffectFlag;
-import com.l2jmobius.gameserver.model.skills.BuffInfo;
+import com.l2jmobius.gameserver.model.skills.Skill;
+import com.l2jmobius.gameserver.model.stats.Stats;
/**
- * Servitor Share effect implementation.
- * Synchronizing effects on player and servitor if one of them gets removed for some reason the same will happen to another. Partner's effect exit is executed in own thread, since there is no more queue to schedule the effects,
- * partner's effect is called while this effect is still exiting issuing an exit call for the effect, causing a stack over flow.
- * @author UnAfraid, Zoey76
+ * Servitor Share effect implementation.
*/
public final class ServitorShare extends AbstractEffect
{
- private static final class ScheduledEffectExitTask implements Runnable
- {
- private final L2Character _effected;
- private final int _skillId;
-
- public ScheduledEffectExitTask(L2Character effected, int skillId)
- {
- _effected = effected;
- _skillId = skillId;
- }
-
- @Override
- public void run()
- {
- _effected.stopSkillEffects(false, _skillId);
- }
- }
+ private final Map _sharedStats = new HashMap<>();
public ServitorShare(StatsSet params)
{
- }
-
- @Override
- public long getEffectFlags()
- {
- return EffectFlag.SERVITOR_SHARE.getMask();
- }
-
- @Override
- public void onExit(BuffInfo info)
- {
- final L2Character effected = info.getEffected().isSummon() ? ((L2Summon) info.getEffected()).getOwner() : info.getEffected();
-
- if (effected != null)
+ if (params.isEmpty())
{
- ThreadPoolManager.schedule(new ScheduledEffectExitTask(effected, info.getSkill().getId()), 100);
+ return;
+ }
+
+ for (Entry param : params.getSet().entrySet())
+ {
+ _sharedStats.put(Stats.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue())) / 100);
}
}
-}
+
+ @Override
+ public boolean canPump(L2Character effector, L2Character effected, Skill skill)
+ {
+ return effected.isSummon();
+ }
+
+ @Override
+ public void pump(L2Character effected, Skill skill)
+ {
+ final L2PcInstance owner = effected.getActingPlayer();
+ if (owner != null)
+ {
+ for (Entry stats : _sharedStats.entrySet())
+ {
+ effected.getStat().mergeAdd(stats.getKey(), owner.getStat().getValue(stats.getKey()) * stats.getValue());
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/01500-01599.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/01500-01599.xml
index 39b9e29c0b..e2919f1355 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/01500-01599.xml
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/01500-01599.xml
@@ -3427,14 +3427,10 @@
-
-
1
1200
ABILITY_CHANGE
- 400
379
- 900
1000
icon.skill1557
1
@@ -3448,30 +3444,25 @@
5
-1
true
-
SELF
SINGLE
+ false
-
-
-
-
-
-
-
-
-
-
-
+ 50
+ 50
+ 25
+ 25
+ 10
+ 10
+ 20
+ 10
+ 3
+
-
-
-
-
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/11200-11299.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/11200-11299.xml
index 1354eab5b8..3b799a0714 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/11200-11299.xml
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/11200-11299.xml
@@ -2937,16 +2937,30 @@
-
-
-
-
-
-
-
-
-
+
+ 60
+ 65
+ 70
+ 70
+
+
+ 50
+ 53
+ 55
+ 60
+
+
+ 30
+ 35
+ 40
+ 50
+
+ 15
+ 15
+ 10
+ 30
+ 15
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/engines/DocumentBase.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/engines/DocumentBase.java
index 81915d1bab..0050c0a281 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/engines/DocumentBase.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/engines/DocumentBase.java
@@ -239,7 +239,6 @@ public abstract class DocumentBase
case "mul":
case "div":
case "set":
- case "share":
case "enchant":
case "enchanthp":
{
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/enums/StatFunction.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/enums/StatFunction.java
index ddec5b37a4..6459f45c24 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/enums/StatFunction.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/enums/StatFunction.java
@@ -27,7 +27,6 @@ public enum StatFunction
ENCHANTHP("EnchantHp", 40),
MUL("Mul", 20),
SET("Set", 0),
- SHARE("Share", 30),
SUB("Sub", 30);
String name;
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index 218b2ffb9e..3b82438d72 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -3009,7 +3009,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
broadcastPacket(su);
}
- if (hasServitors() && isAffected(EffectFlag.SERVITOR_SHARE))
+ if (hasServitors() && hasAbnormalType(AbnormalType.ABILITY_CHANGE))
{
getServitors().values().forEach(L2Summon::broadcastStatusUpdate);
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
index 702435946f..7a246b1195 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
@@ -40,6 +40,7 @@ import com.l2jmobius.gameserver.enums.Position;
import com.l2jmobius.gameserver.model.CharEffectList;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
+import com.l2jmobius.gameserver.model.skills.AbnormalType;
import com.l2jmobius.gameserver.model.skills.BuffInfo;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillConditionScope;
@@ -784,6 +785,19 @@ public class CharStat
.forEach(effect -> effect.pump(info.getEffected(), info.getSkill())));
//@formatter:on
+ if (_activeChar.isSummon() && (_activeChar.getActingPlayer() != null) && _activeChar.getActingPlayer().hasAbnormalType(AbnormalType.ABILITY_CHANGE))
+ {
+ //@formatter:off
+ _activeChar.getActingPlayer().getEffectList().getEffects().stream()
+ .filter(BuffInfo::isInUse)
+ .filter(info -> info.isAbnormalType(AbnormalType.ABILITY_CHANGE))
+ .forEach(info -> info.getEffects().stream()
+ .filter(effect -> effect.canStart(info))
+ .filter(effect -> effect.canPump(_activeChar, _activeChar, info.getSkill()))
+ .forEach(effect -> effect.pump(_activeChar, info.getSkill())));
+ //@formatter:on
+ }
+
// Merge with additional stats
_additionalAdd.stream().filter(holder -> holder.verifyCondition(_activeChar)).forEach(holder -> mergeAdd(holder.getStat(), holder.getValue()));
_additionalMul.stream().filter(holder -> holder.verifyCondition(_activeChar)).forEach(holder -> mergeMul(holder.getStat(), holder.getValue()));
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
index 2374117ee9..609e9fbdd7 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
@@ -31,6 +31,7 @@ import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLevel
import com.l2jmobius.gameserver.model.holders.ItemSkillHolder;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.items.type.WeaponType;
+import com.l2jmobius.gameserver.model.skills.AbnormalType;
import com.l2jmobius.gameserver.model.stats.Formulas;
import com.l2jmobius.gameserver.model.stats.Stats;
import com.l2jmobius.gameserver.model.zone.ZoneId;
@@ -665,13 +666,7 @@ public class PcStat extends PlayableStat
super.onRecalculateStats(broadcast);
final L2PcInstance player = getActiveChar();
-
- // Upon master stats recalculation trigger pet/servitor recalculation too
- if (player.hasPet())
- {
- player.getPet().getStat().recalculateStats(broadcast);
- }
- if (player.hasServitors())
+ if (player.hasAbnormalType(AbnormalType.ABILITY_CHANGE) && player.hasServitors())
{
player.getServitors().values().forEach(servitor -> servitor.getStat().recalculateStats(broadcast));
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
index 4f264de881..559593b5bf 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
@@ -43,7 +43,6 @@ public enum EffectFlag
DEBUFF_BLOCK,
ABNORMAL_SHIELD,
BLOCK_RESURRECTION,
- SERVITOR_SHARE,
UNTARGETABLE,
CANNOT_ESCAPE,
DOUBLE_CAST,
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
index 83cb08e95d..cdf5e35d1c 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
@@ -451,4 +451,9 @@ public final class BuffInfo
_scheduledFutureTimeTask = ThreadPoolManager.scheduleAtFixedRate(new BuffTimeTask(this), 0, 1000L);
}
}
+
+ public boolean isAbnormalType(AbnormalType type)
+ {
+ return _skill.getAbnormalType().equals(type);
+ }
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
index cc2846bd84..5c2486e7dc 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
@@ -47,7 +47,6 @@ public enum CommonSkill
ONYX_BEAST_TRANSFORMATION(617, 1),
CREATE_COMMON(1320, 1),
DIVINE_INSPIRATION(1405, 1),
- SERVITOR_SHARE(1557, 1),
CARAVANS_SECRET_MEDICINE(2341, 1),
SHILENS_BREATH(14571, 1),
IMPRIT_OF_LIGHT(19034, 1),
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/Skill.java
index 2b568af5e3..2f77777daf 100644
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/Skill.java
+++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/skills/Skill.java
@@ -1525,7 +1525,7 @@ public final class Skill implements IIdentifiable
*/
public boolean canBeStolen()
{
- return !isPassive() && !isToggle() && !isDebuff() && !isHeroSkill() && !isGMSkill() && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && canBeDispelled() && (getId() != CommonSkill.SERVITOR_SHARE.getId());
+ return !isPassive() && !isToggle() && !isDebuff() && !isIrreplacableBuff() && !isHeroSkill() && !isGMSkill() && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && canBeDispelled();
}
public boolean isClanSkill()
diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java
deleted file mode 100644
index ab8c68d16f..0000000000
--- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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 com.l2jmobius.gameserver.model.stats.functions;
-
-import com.l2jmobius.gameserver.model.actor.L2Character;
-import com.l2jmobius.gameserver.model.actor.L2Summon;
-import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jmobius.gameserver.model.conditions.Condition;
-import com.l2jmobius.gameserver.model.skills.Skill;
-import com.l2jmobius.gameserver.model.stats.Stats;
-
-/**
- * @author UnAfraid
- */
-public class FuncShare extends AbstractFunction
-{
- public FuncShare(Stats stat, int order, Object owner, double value, Condition applayCond)
- {
- super(stat, order, owner, value, applayCond);
- }
-
- @Override
- public double calc(L2Character effector, L2Character effected, Skill skill, double initVal)
- {
- if ((getApplayCond() == null) || getApplayCond().test(effector, effected, skill))
- {
- if ((effector != null) && effector.isServitor())
- {
- final L2Summon summon = (L2Summon) effector;
- final L2PcInstance player = summon.getOwner();
- if (player != null)
- {
- return initVal + (getBaseValue(getStat(), player) * getValue());
- }
- }
- }
- return initVal;
- }
-
- public static double getBaseValue(Stats stat, L2PcInstance player)
- {
- switch (stat)
- {
- case MAX_HP:
- {
- return player.getMaxHp();
- }
- case MAX_MP:
- {
- return player.getMaxMp();
- }
- case PHYSICAL_ATTACK:
- {
- return player.getPAtk();
- }
- case MAGIC_ATTACK:
- {
- return player.getMAtk();
- }
- case PHYSICAL_DEFENCE:
- {
- return player.getPDef();
- }
- case MAGICAL_DEFENCE:
- {
- return player.getMDef();
- }
- case CRITICAL_RATE:
- {
- return player.getCriticalHit();
- }
- case PHYSICAL_ATTACK_SPEED:
- {
- return player.getPAtkSpd();
- }
- case MAGIC_ATTACK_SPEED:
- {
- return player.getMAtkSpd();
- }
- default:
- {
- return player.getStat().getValue(stat, 0);
- }
- }
- }
-}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
index 02f29f0a1a..488c79adfb 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
@@ -16,58 +16,53 @@
*/
package handlers.effecthandlers;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
-import com.l2jmobius.gameserver.model.actor.L2Summon;
+import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
-import com.l2jmobius.gameserver.model.effects.EffectFlag;
-import com.l2jmobius.gameserver.model.skills.BuffInfo;
+import com.l2jmobius.gameserver.model.skills.Skill;
+import com.l2jmobius.gameserver.model.stats.Stats;
/**
- * Servitor Share effect implementation.
- * Synchronizing effects on player and servitor if one of them gets removed for some reason the same will happen to another. Partner's effect exit is executed in own thread, since there is no more queue to schedule the effects,
- * partner's effect is called while this effect is still exiting issuing an exit call for the effect, causing a stack over flow.
- * @author UnAfraid, Zoey76
+ * Servitor Share effect implementation.
*/
public final class ServitorShare extends AbstractEffect
{
- private static final class ScheduledEffectExitTask implements Runnable
- {
- private final L2Character _effected;
- private final int _skillId;
-
- public ScheduledEffectExitTask(L2Character effected, int skillId)
- {
- _effected = effected;
- _skillId = skillId;
- }
-
- @Override
- public void run()
- {
- _effected.stopSkillEffects(false, _skillId);
- }
- }
+ private final Map _sharedStats = new HashMap<>();
public ServitorShare(StatsSet params)
{
- }
-
- @Override
- public long getEffectFlags()
- {
- return EffectFlag.SERVITOR_SHARE.getMask();
- }
-
- @Override
- public void onExit(BuffInfo info)
- {
- final L2Character effected = info.getEffected().isSummon() ? ((L2Summon) info.getEffected()).getOwner() : info.getEffected();
-
- if (effected != null)
+ if (params.isEmpty())
{
- ThreadPoolManager.schedule(new ScheduledEffectExitTask(effected, info.getSkill().getId()), 100);
+ return;
+ }
+
+ for (Entry param : params.getSet().entrySet())
+ {
+ _sharedStats.put(Stats.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue())) / 100);
}
}
-}
+
+ @Override
+ public boolean canPump(L2Character effector, L2Character effected, Skill skill)
+ {
+ return effected.isSummon();
+ }
+
+ @Override
+ public void pump(L2Character effected, Skill skill)
+ {
+ final L2PcInstance owner = effected.getActingPlayer();
+ if (owner != null)
+ {
+ for (Entry stats : _sharedStats.entrySet())
+ {
+ effected.getStat().mergeAdd(stats.getKey(), owner.getStat().getValue(stats.getKey()) * stats.getValue());
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/01500-01599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/01500-01599.xml
index f103f5edfa..ee2264b754 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/01500-01599.xml
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/01500-01599.xml
@@ -3427,14 +3427,10 @@
-
-
1
1200
ABILITY_CHANGE
- 400
379
- 900
1000
icon.skill1557
1
@@ -3448,30 +3444,25 @@
5
-1
true
-
SELF
SINGLE
+ false
-
-
-
-
-
-
-
-
-
-
-
+ 50
+ 50
+ 25
+ 25
+ 10
+ 10
+ 20
+ 10
+ 3
+
-
-
-
-
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/11200-11299.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/11200-11299.xml
index 6a74d70104..6fe5f4e338 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/11200-11299.xml
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/11200-11299.xml
@@ -2950,16 +2950,30 @@
-
-
-
-
-
-
-
-
-
+
+ 60
+ 65
+ 70
+ 70
+
+
+ 50
+ 53
+ 55
+ 60
+
+
+ 30
+ 35
+ 40
+ 50
+
+ 15
+ 15
+ 10
+ 30
+ 15
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/engines/DocumentBase.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/engines/DocumentBase.java
index 81915d1bab..0050c0a281 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/engines/DocumentBase.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/engines/DocumentBase.java
@@ -239,7 +239,6 @@ public abstract class DocumentBase
case "mul":
case "div":
case "set":
- case "share":
case "enchant":
case "enchanthp":
{
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/enums/StatFunction.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/enums/StatFunction.java
index ddec5b37a4..6459f45c24 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/enums/StatFunction.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/enums/StatFunction.java
@@ -27,7 +27,6 @@ public enum StatFunction
ENCHANTHP("EnchantHp", 40),
MUL("Mul", 20),
SET("Set", 0),
- SHARE("Share", 30),
SUB("Sub", 30);
String name;
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index 218b2ffb9e..3b82438d72 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -3009,7 +3009,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
broadcastPacket(su);
}
- if (hasServitors() && isAffected(EffectFlag.SERVITOR_SHARE))
+ if (hasServitors() && hasAbnormalType(AbnormalType.ABILITY_CHANGE))
{
getServitors().values().forEach(L2Summon::broadcastStatusUpdate);
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
index 702435946f..7a246b1195 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
@@ -40,6 +40,7 @@ import com.l2jmobius.gameserver.enums.Position;
import com.l2jmobius.gameserver.model.CharEffectList;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
+import com.l2jmobius.gameserver.model.skills.AbnormalType;
import com.l2jmobius.gameserver.model.skills.BuffInfo;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillConditionScope;
@@ -784,6 +785,19 @@ public class CharStat
.forEach(effect -> effect.pump(info.getEffected(), info.getSkill())));
//@formatter:on
+ if (_activeChar.isSummon() && (_activeChar.getActingPlayer() != null) && _activeChar.getActingPlayer().hasAbnormalType(AbnormalType.ABILITY_CHANGE))
+ {
+ //@formatter:off
+ _activeChar.getActingPlayer().getEffectList().getEffects().stream()
+ .filter(BuffInfo::isInUse)
+ .filter(info -> info.isAbnormalType(AbnormalType.ABILITY_CHANGE))
+ .forEach(info -> info.getEffects().stream()
+ .filter(effect -> effect.canStart(info))
+ .filter(effect -> effect.canPump(_activeChar, _activeChar, info.getSkill()))
+ .forEach(effect -> effect.pump(_activeChar, info.getSkill())));
+ //@formatter:on
+ }
+
// Merge with additional stats
_additionalAdd.stream().filter(holder -> holder.verifyCondition(_activeChar)).forEach(holder -> mergeAdd(holder.getStat(), holder.getValue()));
_additionalMul.stream().filter(holder -> holder.verifyCondition(_activeChar)).forEach(holder -> mergeMul(holder.getStat(), holder.getValue()));
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
index 2c56c10bc2..4d84c6c29d 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
@@ -31,6 +31,7 @@ import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLevel
import com.l2jmobius.gameserver.model.holders.ItemSkillHolder;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.items.type.WeaponType;
+import com.l2jmobius.gameserver.model.skills.AbnormalType;
import com.l2jmobius.gameserver.model.stats.Formulas;
import com.l2jmobius.gameserver.model.stats.Stats;
import com.l2jmobius.gameserver.model.zone.ZoneId;
@@ -667,13 +668,7 @@ public class PcStat extends PlayableStat
super.onRecalculateStats(broadcast);
final L2PcInstance player = getActiveChar();
-
- // Upon master stats recalculation trigger pet/servitor recalculation too
- if (player.hasPet())
- {
- player.getPet().getStat().recalculateStats(broadcast);
- }
- if (player.hasServitors())
+ if (player.hasAbnormalType(AbnormalType.ABILITY_CHANGE) && player.hasServitors())
{
player.getServitors().values().forEach(servitor -> servitor.getStat().recalculateStats(broadcast));
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
index 4f264de881..559593b5bf 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
@@ -43,7 +43,6 @@ public enum EffectFlag
DEBUFF_BLOCK,
ABNORMAL_SHIELD,
BLOCK_RESURRECTION,
- SERVITOR_SHARE,
UNTARGETABLE,
CANNOT_ESCAPE,
DOUBLE_CAST,
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
index 83cb08e95d..cdf5e35d1c 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
@@ -451,4 +451,9 @@ public final class BuffInfo
_scheduledFutureTimeTask = ThreadPoolManager.scheduleAtFixedRate(new BuffTimeTask(this), 0, 1000L);
}
}
+
+ public boolean isAbnormalType(AbnormalType type)
+ {
+ return _skill.getAbnormalType().equals(type);
+ }
}
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
index cc2846bd84..5c2486e7dc 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
@@ -47,7 +47,6 @@ public enum CommonSkill
ONYX_BEAST_TRANSFORMATION(617, 1),
CREATE_COMMON(1320, 1),
DIVINE_INSPIRATION(1405, 1),
- SERVITOR_SHARE(1557, 1),
CARAVANS_SECRET_MEDICINE(2341, 1),
SHILENS_BREATH(14571, 1),
IMPRIT_OF_LIGHT(19034, 1),
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/Skill.java
index 2b568af5e3..2f77777daf 100644
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/Skill.java
+++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/skills/Skill.java
@@ -1525,7 +1525,7 @@ public final class Skill implements IIdentifiable
*/
public boolean canBeStolen()
{
- return !isPassive() && !isToggle() && !isDebuff() && !isHeroSkill() && !isGMSkill() && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && canBeDispelled() && (getId() != CommonSkill.SERVITOR_SHARE.getId());
+ return !isPassive() && !isToggle() && !isDebuff() && !isIrreplacableBuff() && !isHeroSkill() && !isGMSkill() && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && canBeDispelled();
}
public boolean isClanSkill()
diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java
deleted file mode 100644
index ab8c68d16f..0000000000
--- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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 com.l2jmobius.gameserver.model.stats.functions;
-
-import com.l2jmobius.gameserver.model.actor.L2Character;
-import com.l2jmobius.gameserver.model.actor.L2Summon;
-import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jmobius.gameserver.model.conditions.Condition;
-import com.l2jmobius.gameserver.model.skills.Skill;
-import com.l2jmobius.gameserver.model.stats.Stats;
-
-/**
- * @author UnAfraid
- */
-public class FuncShare extends AbstractFunction
-{
- public FuncShare(Stats stat, int order, Object owner, double value, Condition applayCond)
- {
- super(stat, order, owner, value, applayCond);
- }
-
- @Override
- public double calc(L2Character effector, L2Character effected, Skill skill, double initVal)
- {
- if ((getApplayCond() == null) || getApplayCond().test(effector, effected, skill))
- {
- if ((effector != null) && effector.isServitor())
- {
- final L2Summon summon = (L2Summon) effector;
- final L2PcInstance player = summon.getOwner();
- if (player != null)
- {
- return initVal + (getBaseValue(getStat(), player) * getValue());
- }
- }
- }
- return initVal;
- }
-
- public static double getBaseValue(Stats stat, L2PcInstance player)
- {
- switch (stat)
- {
- case MAX_HP:
- {
- return player.getMaxHp();
- }
- case MAX_MP:
- {
- return player.getMaxMp();
- }
- case PHYSICAL_ATTACK:
- {
- return player.getPAtk();
- }
- case MAGIC_ATTACK:
- {
- return player.getMAtk();
- }
- case PHYSICAL_DEFENCE:
- {
- return player.getPDef();
- }
- case MAGICAL_DEFENCE:
- {
- return player.getMDef();
- }
- case CRITICAL_RATE:
- {
- return player.getCriticalHit();
- }
- case PHYSICAL_ATTACK_SPEED:
- {
- return player.getPAtkSpd();
- }
- case MAGIC_ATTACK_SPEED:
- {
- return player.getMAtkSpd();
- }
- default:
- {
- return player.getStat().getValue(stat, 0);
- }
- }
- }
-}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
index 02f29f0a1a..488c79adfb 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
@@ -16,58 +16,53 @@
*/
package handlers.effecthandlers;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
-import com.l2jmobius.gameserver.model.actor.L2Summon;
+import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
-import com.l2jmobius.gameserver.model.effects.EffectFlag;
-import com.l2jmobius.gameserver.model.skills.BuffInfo;
+import com.l2jmobius.gameserver.model.skills.Skill;
+import com.l2jmobius.gameserver.model.stats.Stats;
/**
- * Servitor Share effect implementation.
- * Synchronizing effects on player and servitor if one of them gets removed for some reason the same will happen to another. Partner's effect exit is executed in own thread, since there is no more queue to schedule the effects,
- * partner's effect is called while this effect is still exiting issuing an exit call for the effect, causing a stack over flow.
- * @author UnAfraid, Zoey76
+ * Servitor Share effect implementation.
*/
public final class ServitorShare extends AbstractEffect
{
- private static final class ScheduledEffectExitTask implements Runnable
- {
- private final L2Character _effected;
- private final int _skillId;
-
- public ScheduledEffectExitTask(L2Character effected, int skillId)
- {
- _effected = effected;
- _skillId = skillId;
- }
-
- @Override
- public void run()
- {
- _effected.stopSkillEffects(false, _skillId);
- }
- }
+ private final Map _sharedStats = new HashMap<>();
public ServitorShare(StatsSet params)
{
- }
-
- @Override
- public long getEffectFlags()
- {
- return EffectFlag.SERVITOR_SHARE.getMask();
- }
-
- @Override
- public void onExit(BuffInfo info)
- {
- final L2Character effected = info.getEffected().isSummon() ? ((L2Summon) info.getEffected()).getOwner() : info.getEffected();
-
- if (effected != null)
+ if (params.isEmpty())
{
- ThreadPoolManager.schedule(new ScheduledEffectExitTask(effected, info.getSkill().getId()), 100);
+ return;
+ }
+
+ for (Entry param : params.getSet().entrySet())
+ {
+ _sharedStats.put(Stats.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue())) / 100);
}
}
-}
+
+ @Override
+ public boolean canPump(L2Character effector, L2Character effected, Skill skill)
+ {
+ return effected.isSummon();
+ }
+
+ @Override
+ public void pump(L2Character effected, Skill skill)
+ {
+ final L2PcInstance owner = effected.getActingPlayer();
+ if (owner != null)
+ {
+ for (Entry stats : _sharedStats.entrySet())
+ {
+ effected.getStat().mergeAdd(stats.getKey(), owner.getStat().getValue(stats.getKey()) * stats.getValue());
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/01500-01599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/01500-01599.xml
index 39b9e29c0b..e2919f1355 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/01500-01599.xml
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/01500-01599.xml
@@ -3427,14 +3427,10 @@
-
-
1
1200
ABILITY_CHANGE
- 400
379
- 900
1000
icon.skill1557
1
@@ -3448,30 +3444,25 @@
5
-1
true
-
SELF
SINGLE
+ false
-
-
-
-
-
-
-
-
-
-
-
+ 50
+ 50
+ 25
+ 25
+ 10
+ 10
+ 20
+ 10
+ 3
+
-
-
-
-
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/11200-11299.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/11200-11299.xml
index 6a74d70104..6fe5f4e338 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/11200-11299.xml
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/11200-11299.xml
@@ -2950,16 +2950,30 @@
-
-
-
-
-
-
-
-
-
+
+ 60
+ 65
+ 70
+ 70
+
+
+ 50
+ 53
+ 55
+ 60
+
+
+ 30
+ 35
+ 40
+ 50
+
+ 15
+ 15
+ 10
+ 30
+ 15
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/engines/DocumentBase.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/engines/DocumentBase.java
index 81915d1bab..0050c0a281 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/engines/DocumentBase.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/engines/DocumentBase.java
@@ -239,7 +239,6 @@ public abstract class DocumentBase
case "mul":
case "div":
case "set":
- case "share":
case "enchant":
case "enchanthp":
{
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/enums/StatFunction.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/enums/StatFunction.java
index ddec5b37a4..6459f45c24 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/enums/StatFunction.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/enums/StatFunction.java
@@ -27,7 +27,6 @@ public enum StatFunction
ENCHANTHP("EnchantHp", 40),
MUL("Mul", 20),
SET("Set", 0),
- SHARE("Share", 30),
SUB("Sub", 30);
String name;
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index 218b2ffb9e..3b82438d72 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -3009,7 +3009,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
broadcastPacket(su);
}
- if (hasServitors() && isAffected(EffectFlag.SERVITOR_SHARE))
+ if (hasServitors() && hasAbnormalType(AbnormalType.ABILITY_CHANGE))
{
getServitors().values().forEach(L2Summon::broadcastStatusUpdate);
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
index 702435946f..7a246b1195 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
@@ -40,6 +40,7 @@ import com.l2jmobius.gameserver.enums.Position;
import com.l2jmobius.gameserver.model.CharEffectList;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
+import com.l2jmobius.gameserver.model.skills.AbnormalType;
import com.l2jmobius.gameserver.model.skills.BuffInfo;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillConditionScope;
@@ -784,6 +785,19 @@ public class CharStat
.forEach(effect -> effect.pump(info.getEffected(), info.getSkill())));
//@formatter:on
+ if (_activeChar.isSummon() && (_activeChar.getActingPlayer() != null) && _activeChar.getActingPlayer().hasAbnormalType(AbnormalType.ABILITY_CHANGE))
+ {
+ //@formatter:off
+ _activeChar.getActingPlayer().getEffectList().getEffects().stream()
+ .filter(BuffInfo::isInUse)
+ .filter(info -> info.isAbnormalType(AbnormalType.ABILITY_CHANGE))
+ .forEach(info -> info.getEffects().stream()
+ .filter(effect -> effect.canStart(info))
+ .filter(effect -> effect.canPump(_activeChar, _activeChar, info.getSkill()))
+ .forEach(effect -> effect.pump(_activeChar, info.getSkill())));
+ //@formatter:on
+ }
+
// Merge with additional stats
_additionalAdd.stream().filter(holder -> holder.verifyCondition(_activeChar)).forEach(holder -> mergeAdd(holder.getStat(), holder.getValue()));
_additionalMul.stream().filter(holder -> holder.verifyCondition(_activeChar)).forEach(holder -> mergeMul(holder.getStat(), holder.getValue()));
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
index 2c56c10bc2..4d84c6c29d 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
@@ -31,6 +31,7 @@ import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLevel
import com.l2jmobius.gameserver.model.holders.ItemSkillHolder;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.items.type.WeaponType;
+import com.l2jmobius.gameserver.model.skills.AbnormalType;
import com.l2jmobius.gameserver.model.stats.Formulas;
import com.l2jmobius.gameserver.model.stats.Stats;
import com.l2jmobius.gameserver.model.zone.ZoneId;
@@ -667,13 +668,7 @@ public class PcStat extends PlayableStat
super.onRecalculateStats(broadcast);
final L2PcInstance player = getActiveChar();
-
- // Upon master stats recalculation trigger pet/servitor recalculation too
- if (player.hasPet())
- {
- player.getPet().getStat().recalculateStats(broadcast);
- }
- if (player.hasServitors())
+ if (player.hasAbnormalType(AbnormalType.ABILITY_CHANGE) && player.hasServitors())
{
player.getServitors().values().forEach(servitor -> servitor.getStat().recalculateStats(broadcast));
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
index 4f264de881..559593b5bf 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
@@ -43,7 +43,6 @@ public enum EffectFlag
DEBUFF_BLOCK,
ABNORMAL_SHIELD,
BLOCK_RESURRECTION,
- SERVITOR_SHARE,
UNTARGETABLE,
CANNOT_ESCAPE,
DOUBLE_CAST,
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
index 83cb08e95d..cdf5e35d1c 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
@@ -451,4 +451,9 @@ public final class BuffInfo
_scheduledFutureTimeTask = ThreadPoolManager.scheduleAtFixedRate(new BuffTimeTask(this), 0, 1000L);
}
}
+
+ public boolean isAbnormalType(AbnormalType type)
+ {
+ return _skill.getAbnormalType().equals(type);
+ }
}
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
index cc2846bd84..5c2486e7dc 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
@@ -47,7 +47,6 @@ public enum CommonSkill
ONYX_BEAST_TRANSFORMATION(617, 1),
CREATE_COMMON(1320, 1),
DIVINE_INSPIRATION(1405, 1),
- SERVITOR_SHARE(1557, 1),
CARAVANS_SECRET_MEDICINE(2341, 1),
SHILENS_BREATH(14571, 1),
IMPRIT_OF_LIGHT(19034, 1),
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/Skill.java
index 2b568af5e3..2f77777daf 100644
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/Skill.java
+++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/skills/Skill.java
@@ -1525,7 +1525,7 @@ public final class Skill implements IIdentifiable
*/
public boolean canBeStolen()
{
- return !isPassive() && !isToggle() && !isDebuff() && !isHeroSkill() && !isGMSkill() && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && canBeDispelled() && (getId() != CommonSkill.SERVITOR_SHARE.getId());
+ return !isPassive() && !isToggle() && !isDebuff() && !isIrreplacableBuff() && !isHeroSkill() && !isGMSkill() && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && canBeDispelled();
}
public boolean isClanSkill()
diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java
deleted file mode 100644
index ab8c68d16f..0000000000
--- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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 com.l2jmobius.gameserver.model.stats.functions;
-
-import com.l2jmobius.gameserver.model.actor.L2Character;
-import com.l2jmobius.gameserver.model.actor.L2Summon;
-import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jmobius.gameserver.model.conditions.Condition;
-import com.l2jmobius.gameserver.model.skills.Skill;
-import com.l2jmobius.gameserver.model.stats.Stats;
-
-/**
- * @author UnAfraid
- */
-public class FuncShare extends AbstractFunction
-{
- public FuncShare(Stats stat, int order, Object owner, double value, Condition applayCond)
- {
- super(stat, order, owner, value, applayCond);
- }
-
- @Override
- public double calc(L2Character effector, L2Character effected, Skill skill, double initVal)
- {
- if ((getApplayCond() == null) || getApplayCond().test(effector, effected, skill))
- {
- if ((effector != null) && effector.isServitor())
- {
- final L2Summon summon = (L2Summon) effector;
- final L2PcInstance player = summon.getOwner();
- if (player != null)
- {
- return initVal + (getBaseValue(getStat(), player) * getValue());
- }
- }
- }
- return initVal;
- }
-
- public static double getBaseValue(Stats stat, L2PcInstance player)
- {
- switch (stat)
- {
- case MAX_HP:
- {
- return player.getMaxHp();
- }
- case MAX_MP:
- {
- return player.getMaxMp();
- }
- case PHYSICAL_ATTACK:
- {
- return player.getPAtk();
- }
- case MAGIC_ATTACK:
- {
- return player.getMAtk();
- }
- case PHYSICAL_DEFENCE:
- {
- return player.getPDef();
- }
- case MAGICAL_DEFENCE:
- {
- return player.getMDef();
- }
- case CRITICAL_RATE:
- {
- return player.getCriticalHit();
- }
- case PHYSICAL_ATTACK_SPEED:
- {
- return player.getPAtkSpd();
- }
- case MAGIC_ATTACK_SPEED:
- {
- return player.getMAtkSpd();
- }
- default:
- {
- return player.getStat().getValue(stat, 0);
- }
- }
- }
-}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
index 02f29f0a1a..488c79adfb 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/ServitorShare.java
@@ -16,58 +16,53 @@
*/
package handlers.effecthandlers;
-import com.l2jmobius.gameserver.ThreadPoolManager;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
-import com.l2jmobius.gameserver.model.actor.L2Summon;
+import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
-import com.l2jmobius.gameserver.model.effects.EffectFlag;
-import com.l2jmobius.gameserver.model.skills.BuffInfo;
+import com.l2jmobius.gameserver.model.skills.Skill;
+import com.l2jmobius.gameserver.model.stats.Stats;
/**
- * Servitor Share effect implementation.
- * Synchronizing effects on player and servitor if one of them gets removed for some reason the same will happen to another. Partner's effect exit is executed in own thread, since there is no more queue to schedule the effects,
- * partner's effect is called while this effect is still exiting issuing an exit call for the effect, causing a stack over flow.
- * @author UnAfraid, Zoey76
+ * Servitor Share effect implementation.
*/
public final class ServitorShare extends AbstractEffect
{
- private static final class ScheduledEffectExitTask implements Runnable
- {
- private final L2Character _effected;
- private final int _skillId;
-
- public ScheduledEffectExitTask(L2Character effected, int skillId)
- {
- _effected = effected;
- _skillId = skillId;
- }
-
- @Override
- public void run()
- {
- _effected.stopSkillEffects(false, _skillId);
- }
- }
+ private final Map _sharedStats = new HashMap<>();
public ServitorShare(StatsSet params)
{
- }
-
- @Override
- public long getEffectFlags()
- {
- return EffectFlag.SERVITOR_SHARE.getMask();
- }
-
- @Override
- public void onExit(BuffInfo info)
- {
- final L2Character effected = info.getEffected().isSummon() ? ((L2Summon) info.getEffected()).getOwner() : info.getEffected();
-
- if (effected != null)
+ if (params.isEmpty())
{
- ThreadPoolManager.schedule(new ScheduledEffectExitTask(effected, info.getSkill().getId()), 100);
+ return;
+ }
+
+ for (Entry param : params.getSet().entrySet())
+ {
+ _sharedStats.put(Stats.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue())) / 100);
}
}
-}
+
+ @Override
+ public boolean canPump(L2Character effector, L2Character effected, Skill skill)
+ {
+ return effected.isSummon();
+ }
+
+ @Override
+ public void pump(L2Character effected, Skill skill)
+ {
+ final L2PcInstance owner = effected.getActingPlayer();
+ if (owner != null)
+ {
+ for (Entry stats : _sharedStats.entrySet())
+ {
+ effected.getStat().mergeAdd(stats.getKey(), owner.getStat().getValue(stats.getKey()) * stats.getValue());
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01500-01599.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01500-01599.xml
index 5585bd0d61..df8c5ec3bf 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01500-01599.xml
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01500-01599.xml
@@ -3318,9 +3318,7 @@
1
1200
ABILITY_CHANGE
- 400
379
- 900
1000
icon.skill1557
1
@@ -3334,29 +3332,25 @@
5
-1
true
-
SELF
SINGLE
+ false
-
-
-
-
-
-
-
-
-
-
+ 50
+ 50
+ 25
+ 25
+ 10
+ 10
+ 20
+ 10
+ 3
+
-
-
-
-
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/engines/DocumentBase.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/engines/DocumentBase.java
index 81915d1bab..0050c0a281 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/engines/DocumentBase.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/engines/DocumentBase.java
@@ -239,7 +239,6 @@ public abstract class DocumentBase
case "mul":
case "div":
case "set":
- case "share":
case "enchant":
case "enchanthp":
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/enums/StatFunction.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/enums/StatFunction.java
index ddec5b37a4..6459f45c24 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/enums/StatFunction.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/enums/StatFunction.java
@@ -27,7 +27,6 @@ public enum StatFunction
ENCHANTHP("EnchantHp", 40),
MUL("Mul", 20),
SET("Set", 0),
- SHARE("Share", 30),
SUB("Sub", 30);
String name;
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java
index 218b2ffb9e..3b82438d72 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java
@@ -3009,7 +3009,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
broadcastPacket(su);
}
- if (hasServitors() && isAffected(EffectFlag.SERVITOR_SHARE))
+ if (hasServitors() && hasAbnormalType(AbnormalType.ABILITY_CHANGE))
{
getServitors().values().forEach(L2Summon::broadcastStatusUpdate);
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
index 702435946f..7a246b1195 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/stat/CharStat.java
@@ -40,6 +40,7 @@ import com.l2jmobius.gameserver.enums.Position;
import com.l2jmobius.gameserver.model.CharEffectList;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
+import com.l2jmobius.gameserver.model.skills.AbnormalType;
import com.l2jmobius.gameserver.model.skills.BuffInfo;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillConditionScope;
@@ -784,6 +785,19 @@ public class CharStat
.forEach(effect -> effect.pump(info.getEffected(), info.getSkill())));
//@formatter:on
+ if (_activeChar.isSummon() && (_activeChar.getActingPlayer() != null) && _activeChar.getActingPlayer().hasAbnormalType(AbnormalType.ABILITY_CHANGE))
+ {
+ //@formatter:off
+ _activeChar.getActingPlayer().getEffectList().getEffects().stream()
+ .filter(BuffInfo::isInUse)
+ .filter(info -> info.isAbnormalType(AbnormalType.ABILITY_CHANGE))
+ .forEach(info -> info.getEffects().stream()
+ .filter(effect -> effect.canStart(info))
+ .filter(effect -> effect.canPump(_activeChar, _activeChar, info.getSkill()))
+ .forEach(effect -> effect.pump(_activeChar, info.getSkill())));
+ //@formatter:on
+ }
+
// Merge with additional stats
_additionalAdd.stream().filter(holder -> holder.verifyCondition(_activeChar)).forEach(holder -> mergeAdd(holder.getStat(), holder.getValue()));
_additionalMul.stream().filter(holder -> holder.verifyCondition(_activeChar)).forEach(holder -> mergeMul(holder.getStat(), holder.getValue()));
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
index 2c56c10bc2..4d84c6c29d 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/stat/PcStat.java
@@ -31,6 +31,7 @@ import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLevel
import com.l2jmobius.gameserver.model.holders.ItemSkillHolder;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.items.type.WeaponType;
+import com.l2jmobius.gameserver.model.skills.AbnormalType;
import com.l2jmobius.gameserver.model.stats.Formulas;
import com.l2jmobius.gameserver.model.stats.Stats;
import com.l2jmobius.gameserver.model.zone.ZoneId;
@@ -667,13 +668,7 @@ public class PcStat extends PlayableStat
super.onRecalculateStats(broadcast);
final L2PcInstance player = getActiveChar();
-
- // Upon master stats recalculation trigger pet/servitor recalculation too
- if (player.hasPet())
- {
- player.getPet().getStat().recalculateStats(broadcast);
- }
- if (player.hasServitors())
+ if (player.hasAbnormalType(AbnormalType.ABILITY_CHANGE) && player.hasServitors())
{
player.getServitors().values().forEach(servitor -> servitor.getStat().recalculateStats(broadcast));
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
index 4f264de881..559593b5bf 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/effects/EffectFlag.java
@@ -43,7 +43,6 @@ public enum EffectFlag
DEBUFF_BLOCK,
ABNORMAL_SHIELD,
BLOCK_RESURRECTION,
- SERVITOR_SHARE,
UNTARGETABLE,
CANNOT_ESCAPE,
DOUBLE_CAST,
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
index 83cb08e95d..cdf5e35d1c 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/BuffInfo.java
@@ -451,4 +451,9 @@ public final class BuffInfo
_scheduledFutureTimeTask = ThreadPoolManager.scheduleAtFixedRate(new BuffTimeTask(this), 0, 1000L);
}
}
+
+ public boolean isAbnormalType(AbnormalType type)
+ {
+ return _skill.getAbnormalType().equals(type);
+ }
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
index cc2846bd84..5c2486e7dc 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/CommonSkill.java
@@ -47,7 +47,6 @@ public enum CommonSkill
ONYX_BEAST_TRANSFORMATION(617, 1),
CREATE_COMMON(1320, 1),
DIVINE_INSPIRATION(1405, 1),
- SERVITOR_SHARE(1557, 1),
CARAVANS_SECRET_MEDICINE(2341, 1),
SHILENS_BREATH(14571, 1),
IMPRIT_OF_LIGHT(19034, 1),
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/Skill.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/Skill.java
index 2b568af5e3..2f77777daf 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/Skill.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/skills/Skill.java
@@ -1525,7 +1525,7 @@ public final class Skill implements IIdentifiable
*/
public boolean canBeStolen()
{
- return !isPassive() && !isToggle() && !isDebuff() && !isHeroSkill() && !isGMSkill() && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && canBeDispelled() && (getId() != CommonSkill.SERVITOR_SHARE.getId());
+ return !isPassive() && !isToggle() && !isDebuff() && !isIrreplacableBuff() && !isHeroSkill() && !isGMSkill() && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && canBeDispelled();
}
public boolean isClanSkill()
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java
deleted file mode 100644
index ab8c68d16f..0000000000
--- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/functions/FuncShare.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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 com.l2jmobius.gameserver.model.stats.functions;
-
-import com.l2jmobius.gameserver.model.actor.L2Character;
-import com.l2jmobius.gameserver.model.actor.L2Summon;
-import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jmobius.gameserver.model.conditions.Condition;
-import com.l2jmobius.gameserver.model.skills.Skill;
-import com.l2jmobius.gameserver.model.stats.Stats;
-
-/**
- * @author UnAfraid
- */
-public class FuncShare extends AbstractFunction
-{
- public FuncShare(Stats stat, int order, Object owner, double value, Condition applayCond)
- {
- super(stat, order, owner, value, applayCond);
- }
-
- @Override
- public double calc(L2Character effector, L2Character effected, Skill skill, double initVal)
- {
- if ((getApplayCond() == null) || getApplayCond().test(effector, effected, skill))
- {
- if ((effector != null) && effector.isServitor())
- {
- final L2Summon summon = (L2Summon) effector;
- final L2PcInstance player = summon.getOwner();
- if (player != null)
- {
- return initVal + (getBaseValue(getStat(), player) * getValue());
- }
- }
- }
- return initVal;
- }
-
- public static double getBaseValue(Stats stat, L2PcInstance player)
- {
- switch (stat)
- {
- case MAX_HP:
- {
- return player.getMaxHp();
- }
- case MAX_MP:
- {
- return player.getMaxMp();
- }
- case PHYSICAL_ATTACK:
- {
- return player.getPAtk();
- }
- case MAGIC_ATTACK:
- {
- return player.getMAtk();
- }
- case PHYSICAL_DEFENCE:
- {
- return player.getPDef();
- }
- case MAGICAL_DEFENCE:
- {
- return player.getMDef();
- }
- case CRITICAL_RATE:
- {
- return player.getCriticalHit();
- }
- case PHYSICAL_ATTACK_SPEED:
- {
- return player.getPAtkSpd();
- }
- case MAGIC_ATTACK_SPEED:
- {
- return player.getMAtkSpd();
- }
- default:
- {
- return player.getStat().getValue(stat, 0);
- }
- }
- }
-}