mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-23 00:05:52 +01:00
Allows timer triggers, tested with passive class skills:
```yml name: Panic Attacks passive-type: TIMER_100 lore: - '<#FFE6EE>Occasional huge speed increase for short time.' - '' - 'Speed Intensity: &fVII' - 'Speed Duration &b&o♥&7: &f{duration}s' ``` duration: base: 5.6667 per-level: 0.6667 mana: base: 0 per-level: 0 stamina: base: 5 per-level: 0 cooldown: base: 60 per-level: -1
This commit is contained in:
parent
d7929ebd64
commit
e20eb8b547
2
pom.xml
2
pom.xml
@ -140,7 +140,7 @@
|
||||
<dependency>
|
||||
<groupId>io.lumine</groupId>
|
||||
<artifactId>MythicLib-dist</artifactId>
|
||||
<version>1.3-R24-SNAPSHOT</version>
|
||||
<version>1.3-R25-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class MMOCore extends LuminePlugin {
|
||||
|
||||
public boolean shouldDebugSQL = false;
|
||||
|
||||
private static final int MYTHICLIB_COMPATIBILITY_INDEX = 5;
|
||||
private static final int MYTHICLIB_COMPATIBILITY_INDEX = 6;
|
||||
|
||||
public MMOCore() {
|
||||
plugin = this;
|
||||
|
@ -6,6 +6,7 @@ import io.lumine.mythic.lib.player.cooldown.CooldownInfo;
|
||||
import io.lumine.mythic.lib.skill.Skill;
|
||||
import io.lumine.mythic.lib.skill.SkillMetadata;
|
||||
import io.lumine.mythic.lib.skill.handler.SkillHandler;
|
||||
import io.lumine.mythic.lib.skill.trigger.TriggerType;
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.event.PlayerResourceUpdateEvent;
|
||||
import net.Indyuce.mmocore.api.player.PlayerActivity;
|
||||
@ -27,10 +28,11 @@ public class CastableSkill extends Skill {
|
||||
@Override
|
||||
public boolean getResult(SkillMetadata skillMeta) {
|
||||
PlayerData playerData = PlayerData.get(skillMeta.getCaster().getData().getUniqueId());
|
||||
boolean loud = !skill.getSkill().hasTrigger() || !skill.getSkill().getTrigger().isSilent();
|
||||
|
||||
// If the caster has unlocked that skill
|
||||
if (!playerData.hasSkillUnlocked(skill)) {
|
||||
MMOCore.plugin.configManager.getSimpleMessage("not-unlocked-skill").send(playerData.getPlayer());
|
||||
if (loud) MMOCore.plugin.configManager.getSimpleMessage("not-unlocked-skill").send(playerData.getPlayer());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -40,19 +42,19 @@ public class CastableSkill extends Skill {
|
||||
|
||||
// Cooldown check
|
||||
if (skillMeta.getCaster().getData().getCooldownMap().isOnCooldown(this)) {
|
||||
MMOCore.plugin.configManager.getSimpleMessage("casting.on-cooldown").send(playerData.getPlayer());
|
||||
if (loud) MMOCore.plugin.configManager.getSimpleMessage("casting.on-cooldown").send(playerData.getPlayer());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Mana cost
|
||||
if (playerData.getMana() < getModifier("mana")) {
|
||||
MMOCore.plugin.configManager.getSimpleMessage("casting.no-mana", "mana", playerData.getProfess().getManaDisplay().getName()).send(playerData.getPlayer());
|
||||
if (loud) MMOCore.plugin.configManager.getSimpleMessage("casting.no-mana", "mana", playerData.getProfess().getManaDisplay().getName()).send(playerData.getPlayer());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Stamina cost
|
||||
if (playerData.getStamina() < getModifier("stamina")) {
|
||||
MMOCore.plugin.configManager.getSimpleMessage("casting.no-stamina").send(playerData.getPlayer());
|
||||
if (loud) MMOCore.plugin.configManager.getSimpleMessage("casting.no-stamina").send(playerData.getPlayer());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user