From b1e31a6886b02ac05b83f4d28d4d15c9341d2db9 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Sat, 16 Sep 2017 02:56:43 +0300 Subject: [PATCH] Add function to check if player is immune to everything (divine shield) --- LuaFunctions.cpp | 1 + PlayerMethods.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index cb8f5c1..95e3287 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -561,6 +561,7 @@ ElunaRegister PlayerMethods[] = { "IsInGroup", &LuaPlayer::IsInGroup }, { "IsInGuild", &LuaPlayer::IsInGuild }, { "IsGM", &LuaPlayer::IsGM }, + { "IsImmuneToDamage", &LuaPlayer::IsImmuneToDamage }, { "IsAlliance", &LuaPlayer::IsAlliance }, { "IsHorde", &LuaPlayer::IsHorde }, #ifndef CLASSIC diff --git a/PlayerMethods.h b/PlayerMethods.h index 3c9678b..1ad7491 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -429,6 +429,13 @@ namespace LuaPlayer } #endif + int IsImmuneToDamage(lua_State* L, Player* player) + { + Eluna::Push(L, player->isTotalImmune()); + + return 1; + } + /** * Returns 'true' if the [Player] satisfies all requirements to complete the quest entry. *