mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Feat(LuaEngine/PlayerHooks): Add OnCanPlayerResurrect (#236)
This commit is contained in:
@@ -812,6 +812,11 @@ public:
|
|||||||
{
|
{
|
||||||
sEluna->OnCreatureKilledByPet(player, killed);
|
sEluna->OnCreatureKilledByPet(player, killed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CanPlayerResurrect(Player* player) override
|
||||||
|
{
|
||||||
|
return sEluna->CanPlayerResurrect(player);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Eluna_ServerScript : public ServerScript
|
class Eluna_ServerScript : public ServerScript
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ namespace Hooks
|
|||||||
PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM = 56, // (event, player, item, count, voteType, roll)
|
PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM = 56, // (event, player, item, count, voteType, roll)
|
||||||
PLAYER_EVENT_ON_BG_DESERTION = 57, // (event, player, type)
|
PLAYER_EVENT_ON_BG_DESERTION = 57, // (event, player, type)
|
||||||
PLAYER_EVENT_ON_PET_KILL = 58, // (event, player, killer)
|
PLAYER_EVENT_ON_PET_KILL = 58, // (event, player, killer)
|
||||||
|
PLAYER_EVENT_ON_CAN_RESURRECT = 59, // (event, player)
|
||||||
|
|
||||||
PLAYER_EVENT_COUNT
|
PLAYER_EVENT_COUNT
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -451,6 +451,7 @@ public:
|
|||||||
void OnGroupRollRewardItem(Player* player, Item* item, uint32 count, RollVote voteType, Roll* roll);
|
void OnGroupRollRewardItem(Player* player, Item* item, uint32 count, RollVote voteType, Roll* roll);
|
||||||
void OnBattlegroundDesertion(Player* player, const BattlegroundDesertionType type);
|
void OnBattlegroundDesertion(Player* player, const BattlegroundDesertionType type);
|
||||||
void OnCreatureKilledByPet(Player* player, Creature* killed);
|
void OnCreatureKilledByPet(Player* player, Creature* killed);
|
||||||
|
bool CanPlayerResurrect(Player* player);
|
||||||
|
|
||||||
/* Vehicle */
|
/* Vehicle */
|
||||||
void OnInstall(Vehicle* vehicle);
|
void OnInstall(Vehicle* vehicle);
|
||||||
|
|||||||
@@ -706,3 +706,11 @@ void Eluna::OnCreatureKilledByPet(Player* player, Creature* killed)
|
|||||||
Push(killed);
|
Push(killed);
|
||||||
CallAllFunctions(PlayerEventBindings, key);
|
CallAllFunctions(PlayerEventBindings, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Eluna::CanPlayerResurrect(Player* player)
|
||||||
|
{
|
||||||
|
START_HOOK_WITH_RETVAL(PLAYER_EVENT_ON_CAN_RESURRECT, true);
|
||||||
|
Push(player);
|
||||||
|
return CallAllFunctionsBool(PlayerEventBindings, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -716,6 +716,8 @@ namespace LuaGlobalFunctions
|
|||||||
* PLAYER_EVENT_ON_CAN_GROUP_INVITE = 55, // (event, player, memberName) - Can return false to prevent inviting
|
* PLAYER_EVENT_ON_CAN_GROUP_INVITE = 55, // (event, player, memberName) - Can return false to prevent inviting
|
||||||
* PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM = 56, // (event, player, item, count, voteType, roll)
|
* PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM = 56, // (event, player, item, count, voteType, roll)
|
||||||
* PLAYER_EVENT_ON_BG_DESERTION = 57, // (event, player, type)
|
* PLAYER_EVENT_ON_BG_DESERTION = 57, // (event, player, type)
|
||||||
|
* PLAYER_EVENT_ON_PET_KILL = 58, // (event, player, killer)
|
||||||
|
* PLAYER_EVENT_ON_CAN_RESURRECT = 59, // (event, player)
|
||||||
* };
|
* };
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user