RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Clearing EventSink

_Epila_

Sorceror
Would be greate if the EventSink class had a way to clear individual invocation list, for example, i want to clear just the CastSpellRequest, not the others
 

MarciXs

Sorceror
Be aware though that : EventSink.InvokeCastSpellRequest( new CastSpellRequestEventArgs( m, spellID, World.FindItem( serial ) ) ); is called in PacketHandler.cs to call a spell from a book.
as well as to call from Macro, etc.
Anyhow:
To clear it try this :
either open up SpellBook.cs and in Initialize method comment it out:
EventSink.OpenSpellbookRequest += new OpenSpellbookRequestEventHandler( EventSink_OpenSpellbookRequest );
EventSink.CastSpellRequest += new CastSpellRequestEventHandler( EventSink_CastSpellRequest );

Or Do
EventSink.CastSpellRequest -= new CastSpellRequestEventHandler( EventSink_CastSpellRequest ); // Which has to be done in Spellbook as it is set to private(the method which handles it..) If you made it public you could do something like:
EventSink.CastSpellRequest -= new CastSpellRequestEventHandler( SpellBook.EventSink_CastSpellRequest ); // I can't give you 100% this would work though.
 

_Epila_

Sorceror
it only work from the class the event is declared, that is why im asking for individual functions for each event
 

Jeff

Lord
We cannot just add something like this. Clearing the subscriber list can mess up to many things. Lets say you have a script that clears it, but someone else's script subscribes to it... you will detach everything, making that script useless and broken.... If you need to unsubscribe 1 thing, you need to write code to do it yourself.
 
Top