Retail Servitor Share implementation.
Contributed by Sahar.
This commit is contained in:
@@ -16,14 +16,16 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.effects.EffectFlag;
|
||||
import org.l2jmobius.gameserver.model.effects.EffectType;
|
||||
import org.l2jmobius.gameserver.model.skills.BuffInfo;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
|
||||
/**
|
||||
* Servitor Share effect implementation.<br>
|
||||
@@ -33,27 +35,16 @@ import org.l2jmobius.gameserver.model.skills.BuffInfo;
|
||||
*/
|
||||
public class ServitorShare extends AbstractEffect
|
||||
{
|
||||
private static final class ScheduledEffectExitTask implements Runnable
|
||||
{
|
||||
private final Creature _effected;
|
||||
private final int _skillId;
|
||||
|
||||
public ScheduledEffectExitTask(Creature effected, int skillId)
|
||||
{
|
||||
_effected = effected;
|
||||
_skillId = skillId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_effected.stopSkillEffects(false, _skillId);
|
||||
}
|
||||
}
|
||||
private final Map<Stat, Double> _stats = new HashMap<>(9);
|
||||
|
||||
public ServitorShare(Condition attachCond, Condition applyCond, StatSet set, StatSet params)
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
|
||||
for (String key : params.getSet().keySet())
|
||||
{
|
||||
_stats.put(Stat.valueOfXml(key), params.getDouble(key, 1.));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,13 +59,34 @@ public class ServitorShare extends AbstractEffect
|
||||
return EffectType.BUFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
super.onStart(info);
|
||||
|
||||
info.getEffected().getActingPlayer().setServitorShare(_stats);
|
||||
if (info.getEffected().getActingPlayer().getSummon() != null)
|
||||
{
|
||||
info.getEffected().getActingPlayer().getSummon().broadcastInfo();
|
||||
info.getEffected().getActingPlayer().getSummon().getStatus().startHpMpRegeneration();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExit(BuffInfo info)
|
||||
{
|
||||
final Creature effected = info.getEffected().isPlayer() ? info.getEffected().getSummon() : info.getEffected().getActingPlayer();
|
||||
if (effected != null)
|
||||
info.getEffected().getActingPlayer().setServitorShare(null);
|
||||
if (info.getEffected().getSummon() != null)
|
||||
{
|
||||
ThreadPool.schedule(new ScheduledEffectExitTask(effected, info.getSkill().getId()), 100);
|
||||
if (info.getEffected().getSummon().getCurrentHp() > info.getEffected().getSummon().getMaxHp())
|
||||
{
|
||||
info.getEffected().getSummon().setCurrentHp(info.getEffected().getSummon().getMaxHp());
|
||||
}
|
||||
if (info.getEffected().getSummon().getCurrentMp() > info.getEffected().getSummon().getMaxMp())
|
||||
{
|
||||
info.getEffected().getSummon().setCurrentMp(info.getEffected().getSummon().getMaxMp());
|
||||
}
|
||||
info.getEffected().getSummon().broadcastInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1445,24 +1445,4 @@
|
||||
<effect name="Fear" />
|
||||
</for>
|
||||
</skill>
|
||||
<!-- For 20 minutes, increases the user's P. Atk. by 3%, M. Atk. by 3%, skill P. Atk. by 5%, Atk. Spd. by 2%, Casting Spd. by 1%, and Critical Rate by 5%. The master's abilities are extended to the servitor. -->
|
||||
<!-- Increases Resistance to Earth attacks by 10 for 20 minutes. -->
|
||||
<!-- For 20 minutes, increases the elemental attribute of all party members by 20. -->
|
||||
<!-- Cures all poisoned party members. -->
|
||||
<!-- Cancels paralysis and petrification effects, and also cures poison and bleed condition of all party members. -->
|
||||
<!-- Restores HP of party members with 796 Power, and also cures poison and bleed condition of all party members. -->
|
||||
<!-- Recovers the target and the 10 most injured allies around the target by 30% of their Max HP. The recovery amount decreases starting from the most injured person. Requires 4 Spirit Ore. -->
|
||||
<!-- Inflicts non-attribute damage on the target and enemies around the target with 141 Power added to M. Atk., and recovers MP. Inflicts additional non-attribute damage with 58 Power if the target is a monster. -->
|
||||
<!-- Inflicts non-attribute damage on the enemy with 178 Power added to M. Atk. and recovers MP. Inflicts additional non-attribute damage with 124 Power if the target is a monster. -->
|
||||
<!-- For 10 seconds, decreases the damage received by 70% and turns the remaining damage into MP consumption. When MP becomes 0, the skill's effect disappears. -->
|
||||
<!-- Extends the summoner's abilities to the servitor. Using the summoner's abilities as the basis, extends to the servitor P. Atk./P. Def. by 50%, M. Atk./M. Def. by 25%, Max HP/MP by 10%, Critical Rate by 20%, Atk. Spd. by 10%, and Casting Spd. by 3%. -->
|
||||
<!-- Note: 0.5 means 50% of owner's patk! -->
|
||||
<!-- Creates a tear in the dimension to inflict damage on the enemy with 57 Power added to M. Atk. Over-hit is possible. -->
|
||||
<!-- When equipped with a dagger or a dual dagger, increases Critical Rate by 20% and Critical Damage by 177. Requires a light armor to be equipped. -->
|
||||
<!-- Attacks the target's vital points with 11234 Power added to P. Atk., causing a Spoiled state. Lethal strike, half Kill, critical hit, and over-hit are possible. Requires a dual dagger. -->
|
||||
<!-- Regenerates 15% of Max HP and increases one's own Max HP by 15% for 10 minutes. -->
|
||||
<!-- Decreases all party members' P. Def. by 5%, M. Def. by 10% and Evasion by 2, and increases P. Atk. by 5%, M. Atk. by 10%, Atk. Spd. by 5%, Casting Spd. by 5%, and Speed by 5 for 20 minutes. -->
|
||||
<!-- Increases party or clan members' Atk. Spd. by 15% for 20 minutes. -->
|
||||
<!-- Chance to decrease the enemy's P. Def. by 23% under normal attacks. -->
|
||||
<!-- Increases Max MP by 70. -->
|
||||
</list>
|
||||
|
||||
Reference in New Issue
Block a user