From d25109fcf646bd6cf75d2989bb2aa0f9e7a3e09f Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 16 Mar 2025 14:42:15 -0500 Subject: [PATCH] return summon recycle timer when declined --- src/engine/gameManager/PowersManager.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index 87d2d403..e039956e 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -244,6 +244,10 @@ public enum PowersManager { if (playerCharacter == null) return false; + if(playerCharacter.getRecycleTimers().containsKey(msg.getPowerUsedID())){ + return false; + } + boolean CSRCast = false; if(msg.getPowerUsedID() == 430628895) { @@ -1501,7 +1505,7 @@ public enum PowersManager { // Handle Accepting or Denying a summons. // set timer based on summon type. boolean wentThrough = false; - if (msg.accepted()) + if (msg.accepted()) { // summons accepted, let's move the player if within time if (source.isAlive()) { @@ -1547,14 +1551,14 @@ public enum PowersManager { duration = 45000; // Belgosh Summons, 45 seconds boolean enemiesNear = false; - for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(pc.loc,MBServerStatics.CHARACTER_LOAD_RANGE, MBServerStatics.MASK_PLAYER)){ - PlayerCharacter playerCharacter = (PlayerCharacter)awo; - if(!playerCharacter.guild.getNation().equals(pc.guild.getNation())){ + for (AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(pc.loc, MBServerStatics.CHARACTER_LOAD_RANGE, MBServerStatics.MASK_PLAYER)) { + PlayerCharacter playerCharacter = (PlayerCharacter) awo; + if (!playerCharacter.guild.getNation().equals(pc.guild.getNation())) { enemiesNear = true; } } - if(enemiesNear && !pc.isInSafeZone()) + if (enemiesNear && !pc.isInSafeZone()) duration += 60000; // Teleport to summoners location @@ -1565,7 +1569,10 @@ public enum PowersManager { timers.put("Summon", jc); wentThrough = true; } - + }else{ + // recycle summons power + finishRecycleTime(428523680, source, true); + } // Summons failed if (!wentThrough) // summons refused. Let's be nice and reset recycle timer