Hershe's fix
Matthew Cooney [06-27-11 - 08:44]
diff --git a/LightwellBuddy.toc b/LightwellBuddy.toc
index 3957364..30daf17 100644
--- a/LightwellBuddy.toc
+++ b/LightwellBuddy.toc
@@ -1,6 +1,6 @@
## Title: Lightwell Buddy
## Interface: 40100
## Notes: Says a random message when someone uses your Lightwell.
-## Version: 0.01
+## Version: @project-version@
core.lua
\ No newline at end of file
diff --git a/README b/README
index c28c830..722367f 100644
--- a/README
+++ b/README
@@ -2,4 +2,6 @@ To install the AddOn, follow either of these instructions:
http://www.curse.com/content/AddonInstallGuide.aspx
http://www.wowinterface.com/forums/faq.php?faq=install#faq_howto_install
-To configure the AddOn, simply edit the core.lua file (in any text editor) as instructed.
\ No newline at end of file
+To configure the AddOn, simply edit the core.lua file (in any text editor) as instructed.
+
+Thanks to Hershe of Silver Hand US for the concept and for testing and fixing my initial version.
\ No newline at end of file
diff --git a/core.lua b/core.lua
index ea060ef..a1b152f 100644
--- a/core.lua
+++ b/core.lua
@@ -8,9 +8,6 @@ local PLAYER_NAME = UnitName("player")
local PLAYER_GUID = UnitGUID("player")
local LIGHTWELL_SPELLID = 724
local RENEW_SPELLID = 7001
-local Lightwell_GUID;
-
-local isLightwellDown = false
local message;
@@ -37,13 +34,8 @@ To use the \ (backslash) or | (vertical bar) characters in the phrase, you may n
}
function LWB_events:COMBAT_LOG_EVENT_UNFILTERED(timestamp, event, hideCaster, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags, spellId, spellName, spellSchool, ...)
- if event == "SPELL_CAST_SUCCESS" and sourceGUID == PLAYER_GUID and spellId == LIGHTWELL_SPELLID then
- isLightwellDown = true
- Lightwell_GUID = destGUID
-
- elseif event == ("UNIT_DESTROYED" or "UNIT_DIED") and destGUID == Lightwell_GUID then
- isLightwellDown = false
- elseif event == "SPELL_AURA_APPLIED" and sourceGUID == Lightwell_GUID and spellId == RENEW_SPELLID and isLightwellDown then
+
+ if event == "SPELL_AURA_APPLIED" and sourceGUID == PLAYER_GUID and spellId == RENEW_SPELLID then
message = nil --reset the message
repeat --keep trying to pick a random message until we get one