Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Method Global:RegisterPlayerEvent apply and remove aura #434

Closed
Cloticc opened this issue May 31, 2023 · 0 comments
Closed

Issue Method Global:RegisterPlayerEvent apply and remove aura #434

Cloticc opened this issue May 31, 2023 · 0 comments

Comments

@Cloticc
Copy link

Cloticc commented May 31, 2023

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)

@Cloticc Cloticc closed this as completed May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant