mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-26 00:35:17 +01:00
The skill buffs associated to a slot will only trigger if the item bound matches the corresponding formula.
This commit is contained in:
parent
8e93c83c0d
commit
6fd15725bb
@ -25,6 +25,7 @@ import net.Indyuce.mmocore.api.player.profess.skillbinding.SkillSlot;
|
|||||||
import net.Indyuce.mmocore.api.player.social.FriendRequest;
|
import net.Indyuce.mmocore.api.player.social.FriendRequest;
|
||||||
import net.Indyuce.mmocore.api.player.stats.PlayerStats;
|
import net.Indyuce.mmocore.api.player.stats.PlayerStats;
|
||||||
import net.Indyuce.mmocore.api.quest.PlayerQuests;
|
import net.Indyuce.mmocore.api.quest.PlayerQuests;
|
||||||
|
import net.Indyuce.mmocore.api.quest.trigger.SkillBuffTrigger;
|
||||||
import net.Indyuce.mmocore.api.quest.trigger.StatTrigger;
|
import net.Indyuce.mmocore.api.quest.trigger.StatTrigger;
|
||||||
import net.Indyuce.mmocore.api.util.Closable;
|
import net.Indyuce.mmocore.api.util.Closable;
|
||||||
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
||||||
@ -1214,13 +1215,14 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
|||||||
public void bindSkill(int slot, ClassSkill skill) {
|
public void bindSkill(int slot, ClassSkill skill) {
|
||||||
Validate.notNull(skill, "Skill cannot be null");
|
Validate.notNull(skill, "Skill cannot be null");
|
||||||
//Unbinds the previous skill (Important for passive skills.
|
//Unbinds the previous skill (Important for passive skills.
|
||||||
|
String skillId = skill.getSkill().getHandler().getId();
|
||||||
if (boundSkills.containsKey(slot))
|
if (boundSkills.containsKey(slot))
|
||||||
boundSkills.get(slot).unbind();
|
boundSkills.get(slot).unbind();
|
||||||
if (slot >= 0) {
|
if (slot >= 0) {
|
||||||
//We apply the skill buffs associated with the slot to the skill.
|
//We apply the skill buffs associated with the slot to the skill.
|
||||||
profess.getSkillSlot(slot).getSkillBuffTriggers().forEach(skillBuffTrigger ->
|
for (SkillBuffTrigger skillBuffTrigger : profess.getSkillSlot(slot).getSkillBuffTriggers())
|
||||||
skillBuffTrigger.apply(this, skill.getSkill().getHandler().getId()));
|
if (skillBuffTrigger.getTargetSkills().contains(skillId))
|
||||||
|
skillBuffTrigger.apply(this, skill.getSkill().getHandler().getId());
|
||||||
|
|
||||||
if (skill.getSkill().getTrigger().isPassive()) {
|
if (skill.getSkill().getTrigger().isPassive()) {
|
||||||
PassiveSkill passiveSkill = skill.toPassive(this);
|
PassiveSkill passiveSkill = skill.toPassive(this);
|
||||||
|
@ -37,6 +37,11 @@ public class SkillBuffTrigger extends Trigger implements Removable {
|
|||||||
skillBuff = new SkillBuff(buffKey, skillModifier, targetSkills, amount, ModifierType.valueOf(type));
|
skillBuff = new SkillBuff(buffKey, skillModifier, targetSkills, amount, ModifierType.valueOf(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<String> getTargetSkills() {
|
||||||
|
return skillBuff.getSkills();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply(PlayerData player) {
|
public void apply(PlayerData player) {
|
||||||
if (player.getMMOPlayerData().getSkillBuffMap().hasSkillBuff(buffKey)) {
|
if (player.getMMOPlayerData().getSkillBuffMap().hasSkillBuff(buffKey)) {
|
||||||
@ -58,6 +63,7 @@ public class SkillBuffTrigger extends Trigger implements Removable {
|
|||||||
public void apply(PlayerData playerData, String skill) {
|
public void apply(PlayerData playerData, String skill) {
|
||||||
skillBuff.register(playerData.getMMOPlayerData(), skill);
|
skillBuff.register(playerData.getMMOPlayerData(), skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used by skill slots to remove a skillBuff from a specific skill dynamically chosen.
|
* Used by skill slots to remove a skillBuff from a specific skill dynamically chosen.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user