Pets must share their master buffs.
Thanks to petryxa.
This commit is contained in:
@@ -32,6 +32,7 @@ import org.l2jmobius.gameserver.model.effects.EffectType;
|
||||
import org.l2jmobius.gameserver.model.holders.PetEvolveHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.PetItemHolder;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.skill.BuffInfo;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
|
||||
@@ -97,6 +98,17 @@ public class SummonPet extends AbstractEffect
|
||||
final Pet pet = Pet.spawnPet(npcTemplate, player, collar);
|
||||
player.setPet(pet);
|
||||
pet.setShowSummonAnimation(true);
|
||||
|
||||
// Pets must have their master buffs upon spawn.
|
||||
for (BuffInfo effect : player.getEffectList().getEffects())
|
||||
{
|
||||
final Skill sk = effect.getSkill();
|
||||
if (!sk.isBad() && !sk.isTransformation() && skill.isSharedWithSummon())
|
||||
{
|
||||
sk.applyEffects(player, pet, false, effect.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
if (!pet.isRespawned())
|
||||
{
|
||||
pet.setCurrentHp(pet.getMaxHp());
|
||||
|
@@ -1345,10 +1345,17 @@ public class Skill implements IIdentifiable
|
||||
}
|
||||
|
||||
// Support for buff sharing feature including healing herbs.
|
||||
if (_isSharedWithSummon && effected.isPlayer() && effected.hasServitors() && !isTransformation() && ((addContinuousEffects && isContinuous() && !_isDebuff) || _isRecoveryHerb))
|
||||
if (_isSharedWithSummon && effected.isPlayer() && !isTransformation() && ((addContinuousEffects && isContinuous() && !_isDebuff) || _isRecoveryHerb))
|
||||
{
|
||||
if (effected.hasServitors())
|
||||
{
|
||||
effected.getServitors().values().forEach(s -> applyEffects(effector, s, _isRecoveryHerb, 0));
|
||||
}
|
||||
if (effected.hasPet())
|
||||
{
|
||||
applyEffects(effector, effector.getPet(), _isRecoveryHerb, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (self)
|
||||
|
@@ -32,6 +32,7 @@ import org.l2jmobius.gameserver.model.effects.EffectType;
|
||||
import org.l2jmobius.gameserver.model.holders.PetEvolveHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.PetItemHolder;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.skill.BuffInfo;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
|
||||
@@ -97,6 +98,17 @@ public class SummonPet extends AbstractEffect
|
||||
final Pet pet = Pet.spawnPet(npcTemplate, player, collar);
|
||||
player.setPet(pet);
|
||||
pet.setShowSummonAnimation(true);
|
||||
|
||||
// Pets must have their master buffs upon spawn.
|
||||
for (BuffInfo effect : player.getEffectList().getEffects())
|
||||
{
|
||||
final Skill sk = effect.getSkill();
|
||||
if (!sk.isBad() && !sk.isTransformation() && skill.isSharedWithSummon())
|
||||
{
|
||||
sk.applyEffects(player, pet, false, effect.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
if (!pet.isRespawned())
|
||||
{
|
||||
pet.setCurrentHp(pet.getMaxHp());
|
||||
|
@@ -1345,10 +1345,17 @@ public class Skill implements IIdentifiable
|
||||
}
|
||||
|
||||
// Support for buff sharing feature including healing herbs.
|
||||
if (_isSharedWithSummon && effected.isPlayer() && effected.hasServitors() && !isTransformation() && ((addContinuousEffects && isContinuous() && !_isDebuff) || _isRecoveryHerb))
|
||||
if (_isSharedWithSummon && effected.isPlayer() && !isTransformation() && ((addContinuousEffects && isContinuous() && !_isDebuff) || _isRecoveryHerb))
|
||||
{
|
||||
if (effected.hasServitors())
|
||||
{
|
||||
effected.getServitors().values().forEach(s -> applyEffects(effector, s, _isRecoveryHerb, 0));
|
||||
}
|
||||
if (effected.hasPet())
|
||||
{
|
||||
applyEffects(effector, effector.getPet(), _isRecoveryHerb, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (self)
|
||||
|
@@ -32,6 +32,7 @@ import org.l2jmobius.gameserver.model.effects.EffectType;
|
||||
import org.l2jmobius.gameserver.model.holders.PetEvolveHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.PetItemHolder;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.skill.BuffInfo;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
|
||||
@@ -97,6 +98,17 @@ public class SummonPet extends AbstractEffect
|
||||
final Pet pet = Pet.spawnPet(npcTemplate, player, collar);
|
||||
player.setPet(pet);
|
||||
pet.setShowSummonAnimation(true);
|
||||
|
||||
// Pets must have their master buffs upon spawn.
|
||||
for (BuffInfo effect : player.getEffectList().getEffects())
|
||||
{
|
||||
final Skill sk = effect.getSkill();
|
||||
if (!sk.isBad() && !sk.isTransformation() && skill.isSharedWithSummon())
|
||||
{
|
||||
sk.applyEffects(player, pet, false, effect.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
if (!pet.isRespawned())
|
||||
{
|
||||
pet.setCurrentHp(pet.getMaxHp());
|
||||
|
@@ -1345,10 +1345,17 @@ public class Skill implements IIdentifiable
|
||||
}
|
||||
|
||||
// Support for buff sharing feature including healing herbs.
|
||||
if (_isSharedWithSummon && effected.isPlayer() && effected.hasServitors() && !isTransformation() && ((addContinuousEffects && isContinuous() && !_isDebuff) || _isRecoveryHerb))
|
||||
if (_isSharedWithSummon && effected.isPlayer() && !isTransformation() && ((addContinuousEffects && isContinuous() && !_isDebuff) || _isRecoveryHerb))
|
||||
{
|
||||
if (effected.hasServitors())
|
||||
{
|
||||
effected.getServitors().values().forEach(s -> applyEffects(effector, s, _isRecoveryHerb, 0));
|
||||
}
|
||||
if (effected.hasPet())
|
||||
{
|
||||
applyEffects(effector, effector.getPet(), _isRecoveryHerb, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (self)
|
||||
|
Reference in New Issue
Block a user