|  |  |  | @ -846,10 +846,10 @@ public enum PowersManager {@@ -846,10 +846,10 @@ public enum PowersManager { | 
			
		
	
		
			
				
					|  |  |  |  |     // called when a spell finishes casting. perform actions
 | 
			
		
	
		
			
				
					|  |  |  |  |     public static void finishUsePower(final PerformActionMsg msg, PlayerCharacter playerCharacter, int casterLiveCounter, int targetLiveCounter) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(true) { | 
			
		
	
		
			
				
					|  |  |  |  |             newFinishCast(msg); | 
			
		
	
		
			
				
					|  |  |  |  |             return; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |        // if(true) {
 | 
			
		
	
		
			
				
					|  |  |  |  |         //    newFinishCast(msg);
 | 
			
		
	
		
			
				
					|  |  |  |  |         //    return;
 | 
			
		
	
		
			
				
					|  |  |  |  |         //}
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         PerformActionMsg performActionMsg; | 
			
		
	
		
			
				
					|  |  |  |  |         Dispatch dispatch; | 
			
		
	
	
		
			
				
					|  |  |  | @ -1986,26 +1986,6 @@ public enum PowersManager {@@ -1986,26 +1986,6 @@ public enum PowersManager { | 
			
		
	
		
			
				
					|  |  |  |  |                             + ab.getEffectID()); | 
			
		
	
		
			
				
					|  |  |  |  |             return; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(AbstractCharacter.IsAbstractCharacter(awo)) { | 
			
		
	
		
			
				
					|  |  |  |  |             try { | 
			
		
	
		
			
				
					|  |  |  |  |                 boolean immune = false; | 
			
		
	
		
			
				
					|  |  |  |  |                 AbstractCharacter absChar = (AbstractCharacter) awo; | 
			
		
	
		
			
				
					|  |  |  |  |                 for (AbstractEffectModifier mod : ab.getPowerAction().getEffectsBase().getModifiers()) { | 
			
		
	
		
			
				
					|  |  |  |  |                     if (absChar.getBonuses() != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                         if (absChar.getBonuses().getBool(ModType.ImmuneTo, mod.sourceType) || absChar.getBonuses().getBool(ModType.NoMod, mod.sourceType)) | 
			
		
	
		
			
				
					|  |  |  |  |                             immune = true; | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 if (immune) | 
			
		
	
		
			
				
					|  |  |  |  |                     return; | 
			
		
	
		
			
				
					|  |  |  |  |             }catch(Exception e){ | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         pa.startAction(source, awo, targetLoc, trains, ab, pb); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -3112,65 +3092,6 @@ public enum PowersManager {@@ -3112,65 +3092,6 @@ public enum PowersManager { | 
			
		
	
		
			
				
					|  |  |  |  |         return true; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     public static void newFinishCast(PerformActionMsg msg){ | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         PlayerCharacter source = PlayerCharacter.getPlayerCharacter(msg.getSourceID()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(source == null) | 
			
		
	
		
			
				
					|  |  |  |  |             return; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(!source.isAlive()) | 
			
		
	
		
			
				
					|  |  |  |  |             return; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         PowersBase powerBase = PowersManager.getPowerByToken(msg.getPowerUsedID()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(powerBase == null) | 
			
		
	
		
			
				
					|  |  |  |  |             return; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         int trains = msg.getNumTrains(); | 
			
		
	
		
			
				
					|  |  |  |  |         if(source.getPowers().containsKey(msg.getPowerUsedID())){ | 
			
		
	
		
			
				
					|  |  |  |  |             trains = source.getPowers().get(msg.getPowerUsedID()).getTrains(); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(powerBase.targetSelf) { | 
			
		
	
		
			
				
					|  |  |  |  |             msg.setTargetID(source.getObjectUUID()); | 
			
		
	
		
			
				
					|  |  |  |  |             msg.setTargetType(GameObjectType.PlayerCharacter.ordinal()); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         AbstractWorldObject target = getTarget(msg); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(target == null) | 
			
		
	
		
			
				
					|  |  |  |  |             return; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         for(ActionsBase action : powerBase.getActions()){ | 
			
		
	
		
			
				
					|  |  |  |  |             String stackType = action.stackType; | 
			
		
	
		
			
				
					|  |  |  |  |             if(target.effects.containsKey(stackType)){ | 
			
		
	
		
			
				
					|  |  |  |  |                 Effect eff = target.effects.get(stackType); | 
			
		
	
		
			
				
					|  |  |  |  |                 if(action.greaterThan && trains <= eff.getTrains()) | 
			
		
	
		
			
				
					|  |  |  |  |                     continue; | 
			
		
	
		
			
				
					|  |  |  |  |                 if(action.greaterThanEqual && trains < eff.getTrains()) | 
			
		
	
		
			
				
					|  |  |  |  |                     continue; | 
			
		
	
		
			
				
					|  |  |  |  |                 if(AbstractCharacter.IsAbstractCharacter(target)){ | 
			
		
	
		
			
				
					|  |  |  |  |                     AbstractCharacter absTar = (AbstractCharacter) target; | 
			
		
	
		
			
				
					|  |  |  |  |                     if(absTar.getBonuses() != null){ | 
			
		
	
		
			
				
					|  |  |  |  |                         SourceType sourceType = SourceType.GetSourceType(action.stackType); | 
			
		
	
		
			
				
					|  |  |  |  |                         if(sourceType != null && absTar.getBonuses().getBool(ModType.ImmuneTo,sourceType)) | 
			
		
	
		
			
				
					|  |  |  |  |                             continue; | 
			
		
	
		
			
				
					|  |  |  |  |                         if(sourceType != null && absTar.getBonuses().getBool(ModType.NoMod,sourceType)) | 
			
		
	
		
			
				
					|  |  |  |  |                         continue; | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |             int duration = action.getDuration(trains); | 
			
		
	
		
			
				
					|  |  |  |  |             runPowerAction(source,target,target.loc,action,trains,powerBase,duration); | 
			
		
	
		
			
				
					|  |  |  |  |             //action.getPowerAction().startAction(source,target,target.loc,trains,action,powerBase);
 | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         source.setIsCasting(false); | 
			
		
	
		
			
				
					|  |  |  |  |         PerformActionMsg castMsg = new PerformActionMsg(msg); | 
			
		
	
		
			
				
					|  |  |  |  |         castMsg.setNumTrains(9999); | 
			
		
	
		
			
				
					|  |  |  |  |         castMsg.setUnknown04(2); | 
			
		
	
		
			
				
					|  |  |  |  |         DispatchMessage.dispatchMsgToInterestArea(source, castMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |