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 #144

Open
Cloticc opened this issue May 31, 2023 · 3 comments
Open

[Issue] Method Global:RegisterPlayerEvent apply and remove aura #144

Cloticc opened this issue May 31, 2023 · 3 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 changed the title Issue Method Global:RegisterPlayerEvent apply and remove aura [Issue] Method Global:RegisterPlayerEvent apply and remove aura May 31, 2023
@r-o-b-o-t-o
Copy link
Member

See #137 (comment), the events weren't implemented properly, probably imported from a fork of AC that has aura hooks in the PlayerScript.

@Cloticc
Copy link
Author

Cloticc commented Jun 1, 2023

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
Copy link
Member

Yep, will do as soon as I can

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

2 participants