Thread Tools Display Modes
06-07-05, 01:48 PM   #1
Macer
A Defias Bandit
Join Date: Jun 2005
Posts: 2
Need Help Detecting Who Made a Critical Hit

Ok, a mod I use (CombatSounds) detects critical hits and plays special sounds.

My problem is it detects anyone's critical hits on my target. I want to modift the lua to only play the sound on my critical hits.

Here is the current code:

Code:
function CombatSound_OnEvent() 
   if( event == "UNIT_COMBAT") then 
      if (CombatSoundConfig.useCrit) then 
	if (arg1=="target") and arg3=="CRITICAL") then 
	PlaySoundFile "Interface\\AddOns\\CombatSound\\Sounds\\crit.mp3"); 
	end 
      end 
   end 
end
Can I add UnitIsPlayer() somehow in there? If so, how? I checked thottbot and they only list 2 arguments for UNIT_COMBAT, yet this code references arg1 and arg3
  Reply With Quote
06-07-05, 01:52 PM   #2
Macer
A Defias Bandit
Join Date: Jun 2005
Posts: 2
Oops, I think this is the wrong forum...going to try posting in the LUA folder.
  Reply With Quote
06-07-05, 01:54 PM   #3
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 7,134
I'll move it for you.

/edit Tada!
__________________
“Do what you feel in your heart to be right — for you’ll be criticized anyway.” ~ Eleanor Roosevelt
~~~~~~~~~~~~~~~~~~~
Co-Founder & Admin: MMOUI
FaceBook Profile, Page, Group
Avatar Image by RaffaeleMarinetti
  Reply With Quote
07-18-05, 11:48 AM   #4
Drowsey
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 7
if (arg1=="target") and arg3=="CRITICAL") then

change to
if (arg1=="target" and UnitIsUnit("target", "player") and arg3=="CRITICAL") then
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Need Help Detecting Who Made a Critical Hit

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off