Quantcast 'Buff Removed' How to Identify.. - LoTROInterface
VGInterface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Tutorials & Other Helpful Information (L)

Reply
Thread Tools Display Modes
  #1  
Unread 04-21-2019, 05:22 PM
Daorven Daorven is offline
The Wary
 
Join Date: Apr 2019
Posts: 4
'Buff Removed' How to Identify..

Hi,

To identify Effect removed (buff/debuff) , we can get the ID with GetID() function in event "EffectRemoved", dont need to search in a saved table. If this can help, have a nice day.


-- callback function (see link )
GARAN Event handling Tutorial



Code:
import "Turbine";
import "Turbine.Gameplay";

-- callback function 
(click link above to get tutorial from GARAN) 

-- get unit player
local up = Turbine.Gameplay.LocalPlayer:GetInstance();
-- get effects
local ue = up:GetEffects();   
-- create table to save effect control
local saved_effect = {};

-------------------------------------------------------------------------------------------------
-- event effect added
local effectAdded = function(sender, args)
			
	-- get effect added to unit player
	local effect = ue:Get(args.Index);

        -- save new effect control to table 
        -- we get a unique id for each new effect, new id for same effect is possible 
	local id = effect:GetID(); 				
	if saved_effect[id] == nil then
				
			(some code to create and save your own custom control to show effect)
	end


        -- debug
	Turbine.Shell.WriteLine("NEW buff name: "..tostring(effect:GetName()));  -- localized effect name
	Turbine.Shell.WriteLine("GetID(): "..tostring(effect:GetID()));  -- unique ID for this new effect added 


end
-------------------------------------------------------------------------------------------------


-------------------------------------------------------------------------------------------------
-- event effect removed
local effectRemoved = function(sender, args)
        
        -- we get the unique id for effect removed
        local id = args.Effect:GetID(); 	
        -- after we can directly access to the control saved in 'saved_effect' (the index is the id get with GetID() function)
        if saved_effect[id] then
		     
                        (some code to remove your own custom control saved in a table)
        end      


        -- debug	
        Turbine.Shell.WriteLine("REMOVED buff name "..tostring(args.Effect:GetName()));  -- localized effect name 
	Turbine.Shell.WriteLine("buff removed ID :"..tostring(args.Effect:GetID()));  -- unique ID for this effect removed 
	

end
-------------------------------------------------------------------------------------------------


-- event declaration 
AddCallback(ue, "EffectAdded", effectAdded);-- effect added
AddCallback(ue, "EffectRemoved", effectRemoved);-- effect removed

Last edited by Daorven : 04-22-2019 at 06:51 AM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Combat Analysis + Buff Bars for Hunter (problem with Barbed Arrow slow) Hollywood Released Interfaces (L) 0 11-05-2013 12:30 PM
[REQ]Buff Missing/Triggering Fixer Interface Requests (L) 1 09-28-2010 12:56 AM
Talking about Buff/Debuff display Sorane LotRO Wish List (L) 9 10-08-2009 01:56 AM
Problem with Buff/Debuff display the_archer Interface Help (L) 1 02-15-2008 03:04 PM


All times are GMT -5. The time now is 07:23 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | VGInterface | LoTROInterface | MMOInterface | Swtorui