[x] I have followed [proper The Forgotten Server code styling][code].
[x] I have read and understood the [contribution guidelines][cont] before making this PR.
[x] I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.
Changes Proposed
Did you ever think about blocking all spells, or maybe just one specific spell for a player? Or for a group of players? Or maybe something even crazier?
Well, it's actually possible to do that using global variables or player storage. However, in order for it to work properly, we really have to modify and add some extra conditionals to all the spells we want to control. This is totally horrible.
This new event comes to solve this problem. The onSpellCheck event has two arguments: one is the player and the other is a table with some fields. In these fields, you can find some properties of the spell in question, for example the name.
Here is an example code fragment using the new event:
local event = Event()
function event.onSpellCheck(player, spell)
if BossEvent:hasPlayer(player) then
player:sendCancelMessage("You can't use spells in this event.")
return false
end
return true
end
event:register()
Pull Request Prelude
Changes Proposed
Did you ever think about blocking all spells, or maybe just one specific spell for a player? Or for a group of players? Or maybe something even crazier?
Well, it's actually possible to do that using global variables or player storage. However, in order for it to work properly, we really have to modify and add some extra conditionals to all the spells we want to control. This is totally horrible.
This new event comes to solve this problem. The
onSpellCheck
event has two arguments: one is the player and the other is a table with some fields. In these fields, you can find some properties of the spell in question, for example the name.Here is an example code fragment using the new event:
Issues addressed: Nothing!