Added support to fire off a discord alert to a webhook (set in server config as server.openrsc_integration_webhook) when Wormbrain's map piece is collected so that rsc plate pures are possible

This commit is contained in:
Ceikry
2023-03-02 12:53:12 +00:00
committed by Ryan
parent 35e1477c24
commit 97f4fa91ca
11 changed files with 531 additions and 354 deletions
@@ -1,8 +1,10 @@
package content.global.skill.magic
import core.game.event.SpellCastEvent
import core.api.log
import core.game.node.Node
import core.game.node.entity.player.Player
import core.game.node.entity.player.link.SpellBookManager
import core.tools.Log
import core.tools.SystemLogger
@@ -34,6 +36,7 @@ object SpellListeners {
val method = get(button,type,node?.id ?: 0,book) ?: get(button,type,book) ?: return
try {
method.invoke(player, node)
player.dispatch(SpellCastEvent(SpellBookManager.SpellBook.valueOf(book.uppercase()), button, node))
} catch (e: IllegalStateException){
player.removeAttribute("spell:runes")
return