Download
(38 Kb)
Download
Updated: 10-21-10 10:05 AM
Pictures
File Info
Updated:10-21-10 10:05 AM
Created:10-13-09 06:58 AM
Downloads:3,776
Favorites:17
MD5:
TCL(True Chain Lightning)
Version: 4.0
by: Castle [More]
Old Chain Lightning sound effect for shaman's Chain Lightning spell.

KAPOW! Instead of...bzzzt...

Renamed and completely re-written. Uses 1 small .mp3 sound file, checked in-game myself many times, everything works. So yes, you can use mp3 instead of .ogg.

ENJOY!

Patch 4.0 Ready!

Optional Files (0)


Archived Files (1)
File Name
Version
Size
Author
Date
3.3.5
297kB
Castle
06-29-10 07:16 AM


Post A Reply Comment Options
Unread 12-19-10, 01:18 PM  
Caramirdan
A Kobold Labourer
 
Caramirdan's Avatar

Forum posts: 0
File comments: 45
Uploads: 0
LOL, I didn't realize how much I missed this sound--thanks!
Caramirdan is offline Report comment to moderator  
Reply With Quote
Unread 10-21-10, 05:42 PM  
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view AddOns

Forum posts: 759
File comments: 382
Uploads: 39
I see you are new at LUA and welcomed shall you be!

Now just a small sidenote, you could remove the .xml entirely and replace the content in the .lua by:
Code:
-- if the character is the wrong class, do not load the addon!
if select(2, UnitClass("player")) ~= "SHAMAN" then -- select() picks the 2nd argument returned by UnitClass() API. The 1st argument is always localized so avoid using that if you wish to have a mod that works on all game versions of WoW!
  return -- Used in functions, in addon root it stops reading at this line, sort of speak.
end

local f = CreateFrame("Frame") -- hidden frame
f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") -- register the spell cast succeeded event with the frame
-- register a scriptwhen the event occurs. Usually we would watch "event" argument and match it up to UNIT_SPELLCAST_SUCCEEDED but as we only monitor one event the function will only fire when that event occurs.
f:SetScript("OnEvent", function(self, event, unit, _, _, _, spellid) -- the parameters can be found on wowwiki or wowprogramming article for "UNIT_SPELLCAST_SUCCEEDED" event, also what each of them means and returns.
  if unit == "player" and spellid == 421 then -- we only want to play the sound when the spell cast source is the player, and when it's Chain Lightning. I use spellid to match it as we again won't have cross locale problems.
    PlaySoundFile("Interface\\AddOns\\TCL\\ChainLightning.mp3") -- 'nuff said
  end
end)
Added some comments to try and enlighten you. About "self", "this" and argN where N={0, 1, 2, ... n+1} they are reserved names and will only be usable in some situations.
Doing 'local self = "Hello"' should error at some point. Besides as the SetScript() line you see "self" in the function, that self points at our frame "f", if it had a name it would point to that too. That frame has no name and is invisible on the screen, just a background worker that monitors spell casts.

A small sample where you can use "self":
Code:
local addon = CreateFrame("Frame", "MyCoolAddonFrame")
addon.totaltime = 0
addon:SetScript("OnUpdate", function(self, elapsed)
  self.totaltime =   self.totaltime + elapsed -- adding the seconds since last "OnUpdate" ran, thus counting each call the total seconds since last time the function ran
  if self.totaltime >= 5 then
    print("This message will show up each 5 seconds.")
    self.totaltime = 0
  end
end)
Notice how self.totaltime is the same as addon.totaltime or even MyCoolAddonFrame.totaltime -the only difference is that self.totaltime is only usable within the function. addon.totaltime can be used in the entire addon (in that file only) and since MyCoolAddonFrame is globally available in the game, it can be called by anything. Thus it also lets access to the key "totaltime" in the table "MyCoolAddonFrame".
Note that frames actually count as tables, a table is a list and they can reference to elements using keys. local t = {"hello", "bob"} t[1] is "hello" and t[2] is "bob". Or local t = {LOL="kek", BUR="lol"} t.LOL is "kek" and t.BUR is "lol". Now you can have more compelx tables like using an addon frame to combine event tracking and variable keeping, for example our "f" we could f.test = {} thus we can now do table.insert(f.test, "test") and it would insert "test" to f.test[1] as it was the first element.
Feel free to read up on these core LUA functions on:
http://www.wowwiki.com/Lua_functions

You can find all API to WoW at:
http://www.wowwiki.com/World_of_Warcraft_API

All Events are here:
http://www.wowwiki.com/Events_(API)

Widget API are special API only usable on some interface elements, widgets are ultimately the interface of the game. It's more advanced but as CreateFrame API is a part of that as "Frame" is a widget, here you go:
http://www.wowwiki.com/Widget_API#Frame

Look around and have fun coding, I enjoy it and wish you to do the same!
Last edited by Vlad : 10-21-10 at 05:42 PM.
Vlad is offline Report comment to moderator  
Reply With Quote
Unread 10-21-10, 10:08 AM  
Castle
A Murloc Raider
 
Castle's Avatar
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 56
Uploads: 6
Originally posted by Decabah
Would be great to see this updated for the patch, where the only sound files supported are OGG.

I also receive this error upon login:

Code:
1x <string>:"ChainLightning:OnLoad":1: attempt to index global 'this' (a nil value)

Locals:

  ---
Updated and re-written, I disabled every AddOn while testing the new remake and there are no errors, and works perfectly with .mp3.

If necessary I will format the mp3 into a ogg file later, but doubt it's needed.
__________________
CError :: Remove red text spam from your screen!
TCL :: True Chain Lightning! Bringing back epic sounds since 2005.
Castle is offline Report comment to moderator  
Reply With Quote
Unread 10-15-10, 11:51 AM  
Moxie
A Cobalt Mageweaver
 
Moxie's Avatar
AddOn Author - Click to view AddOns

Forum posts: 203
File comments: 122
Uploads: 2
Would be great to see this updated for the patch, where the only sound files supported are OGG.

I also receive this error upon login:

Code:
1x <string>:"ChainLightning:OnLoad":1: attempt to index global 'this' (a nil value)

Locals:

  ---
__________________
"Someday we'll look back on this, laugh nervously and quickly change the subject."

"The truth is like sunlight: people used to think it was good for you."
Moxie is offline Report comment to moderator  
Reply With Quote
Unread 06-29-10, 03:04 PM  
Folji
A Wyrmkin Dreamwalker
 
Folji's Avatar

Forum posts: 54
File comments: 82
Uploads: 0
<3
Folji is offline Report comment to moderator  
Reply With Quote
Unread 06-29-10, 07:44 AM  
Phewx2
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 5
File comments: 63
Uploads: 2
It reminds me of this video http://www.youtube.com/watch?v=Ghu7cBG_cQA
Phewx2 is offline Report comment to moderator  
Reply With Quote
Unread 02-21-10, 01:39 PM  
OarisJM
A Murloc Raider

Forum posts: 4
File comments: 28
Uploads: 0
I really had fun with this mod -- the old sounds are soooo much more SATISFYING. But I noticed that it can get quite spammy in Wintergrasp -- I'm not sure what it is with that zone, some ambient of the cannons or something? That's the only downside I can see.
OarisJM is offline Report comment to moderator  
Reply With Quote
Unread 10-13-09, 05:42 PM  
Cralor
Mmm... cookies!!!
 
Cralor's Avatar
AddOn Author - Click to view AddOns

Forum posts: 767
File comments: 321
Uploads: 7
While I haven't used it, I would be curious to hear both sounds. Is there a way where we can listen to them from the internet?
__________________
Never be satisfied with satisfactory.
Last edited by Cralor : 10-13-09 at 07:13 PM.
Cralor is offline Report comment to moderator  
Reply With Quote
Unread 10-13-09, 09:21 AM  
Tageshi
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 256
Uploads: 16
Nice.
I love this old Chain Lightning sound.
Tageshi is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: