[Issue] Method Global:RegisterPlayerEvent apply and remove aura
Opened this issue · 3 comments
Cloticc commented
azerothcore
Two of the events not working. I don't think I am doing anything wrong even tried using the aura in different ways
https://www.azerothcore.org/pages/eluna/Global/RegisterPlayerEvent.html
PLAYER_EVENT_ON_APPLY_AURA = 57, // (event, player, aura, isNewAura)
PLAYER_EVENT_ON_REMOVE_AURA = 58, // (event, player, aura, isExpired)
local voidSpell = 168
local PLAYER_EVENT_ON_APPLY_AURA = 57 --, // (event, player, aura, isNewAura)
local PLAYER_EVENT_ON_REMOVE_AURA = 58 --, // (event, player, aura, isExpired)
local function OnApplyAura(event, player, aura, isNewAura)
print("FUNCTION START")
if aura:GetAuraId() == voidSpell then
print("is this on?")
player:SetFaction(14)
player:SetPvP(true) -- Enable PvP
end
print("FUNCTION END")
end
local function OnRemoveAura(event, player, aura, isExpired)
print("FUNCTION START")
if aura:GetAuraId() == voidSpell then
player:SetFaction(player:GetTeam()) -- Set faction back to original faction
player:SetPvP(false) -- Disable PvP
end
print("FUNCTION END")
end
RegisterPlayerEvent(PLAYER_EVENT_ON_APPLY_AURA, OnApplyAura)
RegisterPlayerEvent(PLAYER_EVENT_ON_REMOVE_AURA, OnRemoveAura)
r-o-b-o-t-o commented
See #137 (comment), the events weren't implemented properly, probably imported from a fork of AC that has aura hooks in the PlayerScript.
Cloticc commented
ah, that makes sense now then u probably should remove them from Eluna API Documentation so more people don't ask why it's not working :D
r-o-b-o-t-o commented
Yep, will do as soon as I can