|  |  |  | @ -5,7 +5,6 @@ import engine.gameManager.*;@@ -5,7 +5,6 @@ import engine.gameManager.*; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.job.JobContainer; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.job.JobScheduler; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.jobs.FinishRecycleTimeJob; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.jobs.UsePowerJob; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.jobs.WpakUsePowerJob; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.math.Vector3fImmutable; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.mbEnums; | 
			
		
	
	
		
			
				
					|  |  |  | @ -16,14 +15,11 @@ import engine.net.client.msg.PerformActionMsg;@@ -16,14 +15,11 @@ import engine.net.client.msg.PerformActionMsg; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.net.client.msg.RecyclePowerMsg; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.net.client.msg.UpdateStateMsg; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.objects.*; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.powers.PowersBase; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.server.MBServerStatics; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.util.Hasher; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.wpak.data.*; | 
			
		
	
		
			
				
					|  |  |  |  | import engine.wpak.data.Effect; | 
			
		
	
		
			
				
					|  |  |  |  | import org.pmw.tinylog.Logger; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.ArrayList; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.HashMap; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.HashSet; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -31,42 +27,18 @@ import static engine.math.FastMath.sqr;@@ -31,42 +27,18 @@ import static engine.math.FastMath.sqr; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | public class WpakPowerManager { | 
			
		
	
		
			
				
					|  |  |  |  |     public static HashMap<String, Effect> effect_data = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |  |     public static HashMap<Integer, PowerAction> power_actions= new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |  |     public static HashMap<Integer, Power> powers= new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |  |     public static HashMap<Integer, PowerAction> power_actions = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |  |     public static HashMap<Integer, Power> powers = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     private static JobScheduler js; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     public static void usePower(final PerformActionMsg msg, ClientConnection origin, boolean sendCastToSelf) { | 
			
		
	
		
			
				
					|  |  |  |  |     public static void init(){ | 
			
		
	
		
			
				
					|  |  |  |  |         EffectsParser.parseWpakFile(); | 
			
		
	
		
			
				
					|  |  |  |  |         PowersParser.parseWpakFile(); | 
			
		
	
		
			
				
					|  |  |  |  |         PowerActionParser.parseWpakFile(); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (ConfigManager.MB_RULESET.getValue().equals("LORE")) { | 
			
		
	
		
			
				
					|  |  |  |  |             PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID()); | 
			
		
	
		
			
				
					|  |  |  |  |             PlayerCharacter caster = origin.getPlayerCharacter(); | 
			
		
	
		
			
				
					|  |  |  |  |             PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID()); | 
			
		
	
		
			
				
					|  |  |  |  |             if (pb != null && pb.enforceLore()) { | 
			
		
	
		
			
				
					|  |  |  |  |                 //if (caster.guild.equals(Guild.getErrantGuild()))
 | 
			
		
	
		
			
				
					|  |  |  |  |                 //    return;
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(mbEnums.GameObjectType.Building) == false) { | 
			
		
	
		
			
				
					|  |  |  |  |                     RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID()); | 
			
		
	
		
			
				
					|  |  |  |  |                     Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg); | 
			
		
	
		
			
				
					|  |  |  |  |                     DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     // Send Fail to cast message
 | 
			
		
	
		
			
				
					|  |  |  |  |                     PlayerCharacter pc = SessionManager | 
			
		
	
		
			
				
					|  |  |  |  |                             .getPlayerCharacter(origin); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     if (pc != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                         sendPowerMsg(pc, 2, msg); | 
			
		
	
		
			
				
					|  |  |  |  |                         if (pc.isCasting()) { | 
			
		
	
		
			
				
					|  |  |  |  |                             pc.update(); | 
			
		
	
		
			
				
					|  |  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                         pc.setIsCasting(false); | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |  |                     return; | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |     public static void usePower(final PerformActionMsg msg, ClientConnection origin, boolean sendCastToSelf) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (castPower(msg, origin, sendCastToSelf)) { | 
			
		
	
		
			
				
					|  |  |  |  |             // Cast failed for some reason, reset timer
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -87,7 +59,6 @@ public class WpakPowerManager {@@ -87,7 +59,6 @@ public class WpakPowerManager { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 pc.setIsCasting(false); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |