Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class SpellHandler
- {
- static Dictionary<int,ISpellHandler> _spellHandlers = new Dictionary<int, ISpellHandler>();
- public static void Initialize()
- {
- EventManager.SpellEvent += HandleSpellEvent;
- AddHandler(349 /* Fiery Strike */, new FieryStrikeHandler());
- }
- public static void AddHandler(int spellId, ISpellHandler handler)
- {
- if (_spellHandlers.ContainsKey(spellId))
- _spellHandlers[spellId] = handler;
- else
- _spellHandlers.Add(spellId, handler);
- }
- private static int HandleSpellEvent(SpellEventArgs args)
- {
- if (_spellHandlers.ContainsKey(args.Spell.Id))
- return _spellHandlers[args.Spell.Id].Handle(args);
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement