mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
feat: add player event OnFfaPvpStateUpdate (#63)
This commit is contained in:
@@ -741,6 +741,11 @@ public:
|
|||||||
{
|
{
|
||||||
sEluna->OnAchiComplete(player, achievement);
|
sEluna->OnAchiComplete(player, achievement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnFfaPvpStateUpdate(Player* player, bool IsFlaggedForFfaPvp) override
|
||||||
|
{
|
||||||
|
sEluna->OnFfaPvpStateUpdate(player, IsFlaggedForFfaPvp);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Eluna_ServerScript : public ServerScript
|
class Eluna_ServerScript : public ServerScript
|
||||||
|
|||||||
@@ -708,6 +708,7 @@ namespace LuaGlobalFunctions
|
|||||||
* PLAYER_EVENT_ON_PET_ADDED_TO_WORLD = 43, // (event, player, pet)
|
* PLAYER_EVENT_ON_PET_ADDED_TO_WORLD = 43, // (event, player, pet)
|
||||||
* PLAYER_EVENT_ON_LEARN_SPELL = 44, // (event, player, spellId)
|
* PLAYER_EVENT_ON_LEARN_SPELL = 44, // (event, player, spellId)
|
||||||
* PLAYER_EVENT_ON_ACHIEVEMENT_COMPLETE = 45, // (event, player, achievement)
|
* PLAYER_EVENT_ON_ACHIEVEMENT_COMPLETE = 45, // (event, player, achievement)
|
||||||
|
* PLAYER_EVENT_ON_FFAPVP_CHANGE = 46, // (event, player, hasFfaPvp)
|
||||||
* };
|
* };
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ namespace Hooks
|
|||||||
|
|
||||||
// AddOns
|
// AddOns
|
||||||
ADDON_EVENT_ON_MESSAGE = 30, // (event, sender, type, prefix, msg, target) - target can be nil/whisper_target/guild/group/channel. Can return false
|
ADDON_EVENT_ON_MESSAGE = 30, // (event, sender, type, prefix, msg, target) - target can be nil/whisper_target/guild/group/channel. Can return false
|
||||||
|
|
||||||
WORLD_EVENT_ON_DELETE_CREATURE = 31, // (event, creature)
|
WORLD_EVENT_ON_DELETE_CREATURE = 31, // (event, creature)
|
||||||
WORLD_EVENT_ON_DELETE_GAMEOBJECT = 32, // (event, gameobject)
|
WORLD_EVENT_ON_DELETE_GAMEOBJECT = 32, // (event, gameobject)
|
||||||
|
|
||||||
@@ -207,6 +207,7 @@ namespace Hooks
|
|||||||
PLAYER_EVENT_ON_PET_ADDED_TO_WORLD = 43, // (event, player, pet)
|
PLAYER_EVENT_ON_PET_ADDED_TO_WORLD = 43, // (event, player, pet)
|
||||||
PLAYER_EVENT_ON_LEARN_SPELL = 44, // (event, player, spellId)
|
PLAYER_EVENT_ON_LEARN_SPELL = 44, // (event, player, spellId)
|
||||||
PLAYER_EVENT_ON_ACHIEVEMENT_COMPLETE = 45, // (event, player, achievement)
|
PLAYER_EVENT_ON_ACHIEVEMENT_COMPLETE = 45, // (event, player, achievement)
|
||||||
|
PLAYER_EVENT_ON_FFAPVP_CHANGE = 46, // (event, player, hasFfaPvp)
|
||||||
|
|
||||||
PLAYER_EVENT_COUNT
|
PLAYER_EVENT_COUNT
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -474,6 +474,7 @@ public:
|
|||||||
void HandleGossipSelectOption(Player* pPlayer, uint32 menuId, uint32 sender, uint32 action, const std::string& code);
|
void HandleGossipSelectOption(Player* pPlayer, uint32 menuId, uint32 sender, uint32 action, const std::string& code);
|
||||||
void OnLearnSpell(Player* player, uint32 spellId);
|
void OnLearnSpell(Player* player, uint32 spellId);
|
||||||
void OnAchiComplete(Player* player, AchievementEntry const* achievement);
|
void OnAchiComplete(Player* player, AchievementEntry const* achievement);
|
||||||
|
void OnFfaPvpStateUpdate(Player* player, bool hasFfaPvp);
|
||||||
|
|
||||||
#ifndef CLASSIC
|
#ifndef CLASSIC
|
||||||
#ifndef TBC
|
#ifndef TBC
|
||||||
|
|||||||
@@ -574,3 +574,12 @@ void Eluna::OnAchiComplete(Player* player, AchievementEntry const* achievement)
|
|||||||
Push(achievement);
|
Push(achievement);
|
||||||
CallAllFunctions(PlayerEventBindings, key);
|
CallAllFunctions(PlayerEventBindings, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Eluna::OnFfaPvpStateUpdate(Player* player, bool hasFfaPvp)
|
||||||
|
{
|
||||||
|
START_HOOK(PLAYER_EVENT_ON_FFAPVP_CHANGE);
|
||||||
|
Push(player);
|
||||||
|
Push(hasFfaPvp);
|
||||||
|
CallAllFunctions(PlayerEventBindings, key);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user