26 lines
		
	
	
		
			884 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
		
		
			
		
	
	
			26 lines
		
	
	
		
			884 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
|  | local Ability = {} | ||
|  | local GetGameplayTag = require("GamePlay.Utils").GetGameplayTag | ||
|  | local BlueprintGameplayTagLibrary = import("BlueprintGameplayTagLibrary") | ||
|  | local AbilitySystemBlueprintLibrary = import("AbilitySystemBlueprintLibrary") | ||
|  | 
 | ||
|  | function Ability:K2_ActivateAbilityFromEvent(EventData) | ||
|  | 
 | ||
|  |     local tag = EventData.tag | ||
|  |     local value = EventData.EventMagnitude | ||
|  |     local asc = AbilitySystemBlueprintLibrary.GetAbilitySystemComponent(self.target) | ||
|  | 
 | ||
|  |     if tag == "Recover.Role.Health" then | ||
|  |         local spec_handle = asc:MakeOutgoingSpec( | ||
|  |             self.AbilityEffectConfigs:Get("Role"), 1, asc:MakeEffectContext() | ||
|  |         ) | ||
|  |         AbilitySystemBlueprintLibrary.AssignTagSetByCallerMagnitude( | ||
|  |             spec_handle, GetGameplayTag("Change.Role.Health"), value | ||
|  |         ) | ||
|  |         asc:BP_ApplyGameplayEffectSpecToSelf(spec_handle) | ||
|  |     end | ||
|  | 
 | ||
|  | end | ||
|  | 
 | ||
|  | 
 | ||
|  | 
 | ||
|  | return Class(nil, nil, Ability) |