4

I want to create a simple addon that will play sound files when the player kills an enemy player (gets a killing blow). I've looked around on Google but haven't found much in terms of documentation or guides.

Can anyone point me to some up-to-date documentation or some places where I can just find better guides?

AakashM
  • 62,551
  • 17
  • 151
  • 186
Adam
  • 49
  • 1
  • 2
  • I would ask this on gamedev.stackexchange.com – Neil Knight Mar 20 '11 at 16:26
  • 1
    Addon Studio is pretty cool as well as it gives you a nice IDE to work with: http://www.wowwiki.com/AddOn_Studio_2010 – eandersson Mar 20 '11 at 16:37
  • Also you have to regularly check Blizzard's changelog about the their API, which is the reason why addons stop working after major patches expansions. So you have to update your code to match the new standards and take advantage of the new addon functions Blizzard implements. – Placeholder Aug 21 '11 at 13:09

2 Answers2

9

Getting started: http://www.wowpedia.org/Getting_started_with_writing_addons

API: http://www.wowpedia.org/World_of_Warcraft_API

What you want to do is to add a trigger for the combat log event for a killing blow. Shouldn't be to hard. And then play a sound, using the API for that.

Claus Jørgensen
  • 25,882
  • 9
  • 87
  • 150
4

Addons for the game are created, most simply, by making a new folder in the Interface/AddOns directory in your game folder and populating this with the core files for your addon. These files should include a "Table Of Contents" file which contains information about your addon, and script(s) which are created using the Lua scripting language (with some custom WoW functions and tables and other bits). To properly get started with this, Wowpedia is generally a pretty good guide, and I also recommend this tutorial.

In your specific situation you should just be able to listen for a game event and then do your custom stuff (i.e. playing a sound) in the desired situation. There isn't actually an event for killing blows at the time of writing, however if you register the COMBAT_LOG_EVENT_UNFILTERED event and look for the PARTY_KILL combat event, calling playSoundFile if the sourceName (arg4) matches the player's name (UnitName("Player")), you should be set.