Created
May 25, 2012 14:06
-
-
Save walkline/2788323 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp | |
index 88caece..200b893 100644 | |
--- a/src/server/game/Scripting/ScriptLoader.cpp | |
+++ b/src/server/game/Scripting/ScriptLoader.cpp | |
@@ -34,6 +34,7 @@ void AddSC_boss_kill_history(); | |
void AddSC_trial(); | |
void AddSC_npc_completer(); | |
void AddSC_command_arena(); | |
+void AddSC_ResetGlyphAura(); | |
// spells | |
void AddSC_deathknight_spell_scripts(); | |
@@ -1276,5 +1277,6 @@ void AddCustomScripts() | |
AddSC_trial(); | |
AddSC_npc_completer(); | |
AddSC_command_arena(); | |
+ AddSC_ResetGlyphAura(); | |
#endif | |
} | |
diff --git a/src/server/scripts/Custom/CMakeLists.txt b/src/server/scripts/Custom/CMakeLists.txt | |
index dbfb2b3..2b4080c 100644 | |
--- a/src/server/scripts/Custom/CMakeLists.txt | |
+++ b/src/server/scripts/Custom/CMakeLists.txt | |
@@ -21,6 +21,7 @@ set(scripts_STAT_SRCS | |
Custom/command_talentsreset.cpp | |
Custom/npc_completer.cpp | |
Custom/command_arena.cpp | |
+ Custom/reset_glyph_aura.cpp | |
) | |
message(" -> Prepared: Custom") | |
diff --git a/src/server/scripts/Custom/reset_glyph_aura.cpp b/src/server/scripts/Custom/reset_glyph_aura.cpp | |
new file mode 100644 | |
index 0000000..cef21ba | |
--- /dev/null | |
+++ b/src/server/scripts/Custom/reset_glyph_aura.cpp | |
@@ -0,0 +1,36 @@ | |
+#include "ScriptPCH.h" | |
+ | |
+enum GlyphOfQuickDecay { | |
+ RESET_DATA_SPELL = 70947, | |
+ RESET_DATA_GLYPH = 911 | |
+}; | |
+ | |
+class reset_glyph_aura : public PlayerScript | |
+{ | |
+public: | |
+ reset_glyph_aura() : PlayerScript("reset_glyph_aura") {} | |
+ | |
+ void OnUpdateZone(Player *player, uint32, uint32) | |
+ { | |
+ Map *pMap = player->GetMap(); | |
+ if (!pMap) | |
+ return; | |
+ | |
+ if (!pMap->IsBattlegroundOrArena()) | |
+ { | |
+ for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) | |
+ if (player->GetGlyph(i) == RESET_DATA_GLYPH) | |
+ { | |
+ player->AddAura(RESET_DATA_SPELL, player); | |
+ break; | |
+ } | |
+ } | |
+ else | |
+ player->RemoveAurasDueToSpell(RESET_DATA_SPELL); | |
+ } | |
+}; | |
+ | |
+void AddSC_ResetGlyphAura() | |
+{ | |
+ new reset_glyph_aura(); | |
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment