Skip to content

Commit

Permalink
Set default skill delay for queued skills
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-dev committed Aug 5, 2024
1 parent 9ba6e1a commit 37ace8b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,42 +67,42 @@ private void debuffTarget() {
getOwner().getSkillCoolDowns().clear(); // Make CD rank-dependent, not skill-dependent

if (challengerRank >= CustomInstanceRankEnum.ANCIENT.getMinRank())
getOwner().queueSkill(3539, 65); // Ignite Aether
getOwner().queueSkill(3539, 65, 0); // Ignite Aether

if (challengerRank >= CustomInstanceRankEnum.CERANIUM.getMinRank())
getOwner().queueSkill(618, 65); // Ankle Snare
getOwner().queueSkill(618, 65, 0); // Ankle Snare
else if (challengerRank >= CustomInstanceRankEnum.GOLD.getMinRank())
getOwner().queueSkill(1328, 65); // Restraint (^)
getOwner().queueSkill(1328, 65, 0); // Restraint (^)

if (challengerRank >= CustomInstanceRankEnum.ANCIENT_PLUS.getMinRank())
getOwner().queueSkill(3775, 65); // Fear
getOwner().queueSkill(3775, 65, 0); // Fear
else if (challengerRank >= CustomInstanceRankEnum.GOLD.getMinRank())
getOwner().queueSkill(1417, 65); // Curse Tree (^)
getOwner().queueSkill(1417, 65, 0); // Curse Tree (^)

// SILVER:
getOwner().queueSkill(3581, 65); // Withering Gloom
getOwner().queueSkill(3581, 65, 0); // Withering Gloom

if (challengerRank >= CustomInstanceRankEnum.PLATINUM.getMinRank())
getOwner().queueSkill(3574, 65); // Shackle of Vulnerability
getOwner().queueSkill(3574, 65, 0); // Shackle of Vulnerability
else // SILVER:
getOwner().queueSkill(3780, 65); // Root of Enervation (^)
getOwner().queueSkill(3780, 65, 0); // Root of Enervation (^)

if (challengerRank >= CustomInstanceRankEnum.MITHRIL.getMinRank())
if (getOwner().getTarget() != null && getOwner().getTarget() instanceof Player
&& ((Player) (getOwner().getTarget())).getPlayerClass().isPhysicalClass())
getOwner().queueSkill(3571, 65); // Body Root
getOwner().queueSkill(3571, 65, 0); // Body Root
else
getOwner().queueSkill(3572, 65); // Sigil of Silence
getOwner().queueSkill(3572, 65, 0); // Sigil of Silence

if (challengerRank >= CustomInstanceRankEnum.CERANIUM.getMinRank())
if (getOwner().getTarget() != null && getOwner().getTarget() instanceof Player
&& ((Player) (getOwner().getTarget())).getPlayerClass().isPhysicalClass())
getOwner().queueSkill(4135, 65); // Blinding Light
getOwner().queueSkill(4135, 65, 0); // Blinding Light
else
getOwner().queueSkill(1336, 65); // Curse of Weakness
getOwner().queueSkill(1336, 65, 0); // Curse of Weakness

if (challengerRank >= CustomInstanceRankEnum.ANCIENT.getMinRank())
getOwner().queueSkill(4490, 65); // Paralysis Resonation
getOwner().queueSkill(4490, 65, 0); // Paralysis Resonation

debuffTask = ThreadPoolManager.getInstance().schedule(this::debuffTarget, 30000 - challengerRank * 1000 / 3); // 30s ... 20s
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void handleHpPhase(int phaseHpPercent) {
private void offerAtrocityEvent() {
if (!isDead() && hasAggro.get()) {
if (getLifeStats().getHpPercentage() <= 50)
getOwner().queueSkill(20921, 1);
getOwner().queueSkill(20921, 1, 0);
getOwner().queueSkill(calculateAtrocitySkillId(), 1);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ protected void handleBuffsRemovedByNpc() {
int chainId = getOwner().getGameStats().getLastSkill().getNextChainId();
NpcSkillEntry entry = getOwner().getSkillList().getNpcSkills().stream().filter(nse -> nse.getChainId() == chainId).findAny().orElse(null);

getOwner().queueSkill(21604, 56);
getOwner().queueSkill(21603, 56);
getOwner().queueSkill(21604, 56, 0);
getOwner().queueSkill(21603, 56, entry == null ? -1 : 0);
if (entry != null)
getOwner().getQueuedSkills().offer(entry);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void onEndUseSkill(SkillTemplate st, int skillLevel) {
spawnFrigidCrystals();
task = ThreadPoolManager.getInstance().schedule(() -> {
getOwner().clearQueuedSkills();
getOwner().queueSkill(21632, 1); // Frigid Blast
getOwner().queueSkill(21632, 1, 0); // Frigid Blast
getOwner().queueSkill(21633, 1, 8000); // Ice Explosion
}, 10000);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void handleHpPhase(int phaseHpPercent) {
case 45, 30, 17 -> spawnAncientTyrhund(4);
case 65, 50, 25, 20 -> {
stage++;
getOwner().queueSkill(21253, 56);
getOwner().queueSkill(21253, 56, 0);
getOwner().queueSkill(21244, 56, 5000);
}
case 40 -> spawnSummons(++stage);
Expand Down Expand Up @@ -215,8 +215,8 @@ private Point3D getRndPos(WorldPosition p, float distanceMod) {
}

private void queuePowerfulEnergyBlast() {
getOwner().queueSkill(21241, 56);
getOwner().queueSkill(21241, 56);
getOwner().queueSkill(21241, 56, 0);
getOwner().queueSkill(21241, 56, 0);
getOwner().queueSkill(21241, 56, 8000);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void scheduleFlameShieldBuffEvent(int delay) {
private void handleEnrageEvent() {
getOwner().clearQueuedSkills();
getOwner().queueSkill(19962, 1, 15000); // Purple Flame Weapon
getOwner().queueSkill(19907, 1); // Chastise
getOwner().queueSkill(19907, 1, 0); // Chastise
}

private void handleSeaOfFireEvent() {
Expand Down Expand Up @@ -99,7 +99,7 @@ public void onStartUseSkill(SkillTemplate skillTemplate, int skillLevel) {
public void onEndUseSkill(SkillTemplate skillTemplate, int skillLevel) {
switch (skillTemplate.getSkillId()) {
case 19907: // repeat until reset
getOwner().queueSkill(19907, 1); // Chastise
getOwner().queueSkill(19907, 1, 0); // Chastise
break;
case 20530:
case 20531:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public CaptainLakharaAI(Npc owner) {
@Override
protected void handleIndividualSpawnedSummons(Percentage percent) {
getOwner().clearQueuedSkills();
getOwner().queueSkill(17497, 65);
getOwner().queueSkill(17497, 65, 0);
cancelDespawnTask();
percent.getSummons().forEach(this::summonNpcWithSmoke);
despawnTask = ThreadPoolManager.getInstance().schedule(() -> percent.getSummons().forEach(group -> despawnNpc(group.getNpcId())), 25000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ protected void handleAttack(Creature creature) {
}

private void startTasks() {
enrageTask = ThreadPoolManager.getInstance()
.schedule(() -> getOwner().queueSkill(19098, 55), 600000);
enrageTask = ThreadPoolManager.getInstance().schedule(() -> getOwner().queueSkill(19098, 55, 0), 600000);
portalTask = ThreadPoolManager.getInstance().schedule(() -> spawnPortals(false), 60000);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
public class QueuedNpcSkillTemplate extends NpcSkillTemplate {

public QueuedNpcSkillTemplate(int id, int lv) {
this(id, lv, 0, NpcSkillTargetAttribute.MOST_HATED);
this(id, lv, -1);
}

public QueuedNpcSkillTemplate(int id, int lv, int nextSkillTime) {
this(id, lv, nextSkillTime, NpcSkillTargetAttribute.MOST_HATED);
}

public QueuedNpcSkillTemplate(int id, int lv, int nextSkillTime, NpcSkillTargetAttribute npcSkillTargetAttribute) {
Expand Down

0 comments on commit 37ace8b

Please sign in to comment.