Thursday, September 24, 2009

Hello World! - Your First AddOn

It's no secret that I'm a UI nut. I redesign my UI constantly, trying out new mods that will help me react faster, make the UI look more streamlined or just reduce the lag my UI imposes on my computer. One thing that may not be as well known is that I run my own personal AddOn that isn't published on it's own anywhere to help accomplish many trivial things that I don't want to download a bloated AddOn to do.

This AddOn is called OobieUtil and it does everything for me from automatically repairing my gear to rewriting my bandage macro to use the highest bandage available and automatically accepting invites from the guild leader during raid times.

OobieUtil does next to nothing graphically speaking, but it keeps my UI running smoothly - like engine oil as it were. I code into this mod many repetitive or convoluted procedures that clutter up the UI, distract me from the game or just plain annoy me.

To me, OobieUtil is as indispensable as DeadlyBossMods or a good action bar AddOn - I can't imagine playing without it. With a little inscturction anybody can accomplish much of what I do in my utility AddOn, it just takes a bit of copy/paste action and the right resources.

In this first tutorial I'll go over the basics of what you need for an AddOn... the basic infrastructure that you'll need to start coding modifications into your UI to streamline it. Here are some examples of things I do with this utility:

  • Provides notifications when my character is running low on ammunition i.e. Hunter ammo pouch or Warlock soul bag is below a certain percent full.
  • Rewrites a bandage macro to use the highest available bandage. All characters share the same macro and it's automatically rewritten on character changes and inventory updates.
  • Rewrites an assist macro via a slash command - more advanced version scans a party and automatically find the tank and rewrites the macro.
  • Automatically watches a faction you've recently gained reputation with.
  • Automatically repairs gear at a vendor using guild funds if the option is available.
  • Rewrites a macro that will equip a lance or the weapon equipped at the time the lance was picked up. Knows which lance you picked up and adjusts the macro accordingly.
My current iteration of the utility does more than the above, but these are examples of some repetitive tasks that can be accomplished with just a little knowledge. And without further adieu here is a step by step guide to creating your first AddOn...

Note: This tutorial is for Windows PCs, though AddOns for Mac follow the same format some specific instructions in terms of how you interact with your OS may not translate properly.


If you already know a bit about programming chances are that you've made a "Hello World" program before. It's generally the first program written when learning a new language - but don't let that intimidate you. There are a small handful of programming techniques that will help accomplishing certain tasks in an AddOn but for the most part the WoW API is very user friendly and a great deal of things can be accomplished without advanced programming techniques.

For this tutorial, however, I won't be talking about any techniques, just the framework needed for an AddOn.

The first step is to create a folder for your AddOn. Whatever name you use for the folder will be the name of the AddOn, but for this tutorial we'll stick with 'HelloWorld'.

Next you'll want to open Notepad or another text editor of your choice. Stay away from Office products when editing AddOn files, though. They tend to add unnecessary formatting tags that could cause your AddOn to not work properly. My own personal favorite is Notepad++.

Type or copy/paste the following into your text editor of choice:
## Interface: 30200
## Title: HelloWorld

Once you have this much typed in save the file with the name 'HelloWorld.toc' inside the folder we made earlier. Before you save make sure to change drop down menu below the file name box to say 'All Files' otherwise you may end up accidentally saving the file with an extra file extension, which WoW will not know what to do with.

Next, open a new text file and type in the following:
print("Hello World!")
Once that's done save the file in the same folder with the name 'HelloWorld.lua'.

That's it! Make sure the AddOn folder is nestled into your AddOns directory along with the other mods you use and log in to the game, the end result is that the words in quotes are printed to the chat window. Generally this is a technique used when a mod author wants to post a message to chat that the AddOn has been loaded.

For the AddOn to do anything really meaningful in the game world you need to get into registering and handling events but that, dear reader, is for another tutorial.

Tuesday, September 15, 2009

Everybody Was Kung Fu Fighting!

Patch 3.2.2 is grinding inexorably closer. And so far, it looks like it's going to be a great patch... but not this week. Here's a quick review of some of the highlights:

Many whelps, handle it!

Onyxia is back - and I hear she deep breaths more!

For those who don't know Onyxia is a classic WoW raid encounter that was a proving ground for guild looking to prove that they could not only down the first tier of content but were ready to dig into the next.

Of course, this was back in the day when a raid instance wasn't a completely self contained tier of gear. Although most of Molten Core was dropped tier 1 gear, the end boss Ragnaros dropped tier 2. Onyxia also dropped tier 2, and happened to be the boss most guild cut their tier 2 teeth on.

Of course, what mention of Onyxia would be complete without raging along with the legendary Onyxia video!

The original video was of the actual encounter, but somehow this animation makes it even funnier. Whoever can lay claim to the voiceover in the video has gone down in WoW history along with Leeroy Jenkins and his 'At least I got chicken!'. Members of Prime are still calling out 'More dots! More dots!' and 'That's a 50 fucking DKP minus!' years after the fact.

And not only is this classic encounter back but Blizzard has built in a shout out to that classic video with their list of achievements for the new Onyxia: MMO-Champion. Among these achievements are 'Many whelps! Handle it!' where you intentionally spawn 50 whelps during a kill and 'More dots!' for the simple speed kill achievement.

It's unknown how this encounter will be revamped specifically, but it's been said that there will be both new and old aspects to this encounter. So who know... maybe she will deep breath more!

Elemental Changes

To understand where they're going with this you kind of have to understand where we've been since the debut of the Wrath of the Lich King(WotLK) expansion.

Before the current expansion elemental shaman were lightning factories. At any given time while a shaman was DPSing with this spec you may or may not actually see the separation between lightning bolts they were slung so fast. But when the expansion went live a new couple new spells were thrust into our rotation: Flame Shock (a damage over time debuff) and Lava Burst (a large direct damage effect that would automatically crit if Flame Shock was in use, consuming the remainder of the Flame Shock debuff).

Another introduction to the expansion were glyphs, scrolls that could be scribed into the glyph interface to make certain spells more powerful. This feature was initially touted as being a fun and interesting way to change your spells. Well, for elemental shaman we were relegated to a specific set of glyphs for raiding in order to continue to put out compeditive DPS. None of these glyphs were fun, in fact one of them removed the knockback from Thunderstorm, one of my favorite and most fun spells - and they removed the fun from it!

So now, finally, they've brough forth the following spell changes:
  • Flame Shock: The duration of all ranks has been increased by 6 seconds.
  • Lava Burst: This ability no longer ever consumes a Flame Shock debuff off of the target.
Free at last! Free at Last! Thank.... nevermind. But anyway, this seems lackluster at first. I mean, they're just shuffling around our abilities for the same net effect. But in the end we end up with an extra glyph available. The word on these glyphs is already in as per what will be the best for DPS, but it feels a little freer in here, like a breeze up the kilt on a cool spring day... Ami, c'est l'amour!

Another issue they addressed a little more fully was the Shaman lack of scalability. I believe next to Shadow Priests, Elemental Shaman currently have the worst scaling in the game, and I'm incredibly happy with the fact that it's being addressed (much unlike the ghost Lava Burst bug of 3.2!).
"Put another way, if you and your friend start an instance at 5000 dps and then as you get gear she goes to 7000 dps while you go to 6000 dps, then that's a scaling problem."
From: MMO-Champion

And the following change was put into place:
  • Shamanism: Your Lightning Bolt and Chain Lightning spells gain an additional 3/6/9/12/15% and your Lava Burst gains an additional 4/8/12/16/20% of your bonus damage effects.
From: MMO-Champion

Did you catch it? The stealth buff in the text? Let me help you out by showing what Shamanism currently does:
  • Shamanism: Your Lightning Bolt spell gain an additional 2/4/6/8/10% and your Lava Burst gains an additional 4/8/12/16/20% of your bonus damage effects.
That's right bitches and bitchettes, it's the return of Chain Lightning! Back before WotLK I was a lean, mean, Chain Lightning slingin' machine! I can't say yet as to whether or not this will be a standard part of the rotation again, but one thing's for sure: If the goal was to make us start paying attention to our mana pool, this will do it!

I Bring Pandamonium!

Last - but certainly not least - is the introduction of the Panderan companion pet.

This song has been stuck in my head for days and I don't care! This pet is so awesome words cannot describe it and oh yes... it will be mine!

Of course, if you were into Warcraft 3: the Frozen Throne then you may remember the brewmaster. In order to unlock him you would have to play through the third Alliance mission where Kael'Thas and Vashj are escaping from the sewers beneath Dalaran. Towards the middle of the map you'll find a door leading to a room with three sheep in cages and a panel in front of each cage.

When you step on each panel it says either "Bah", "Ram" or "Ewe". And it you step on each panel in that specific order it will unlock a secret tower defense leve that, once beaten, unlocks the Paneran Brewmaster for the very next level!

In this level you've just escaped the dungeons of Dalaran and, along with all the innocent Blood Elves you saved during the tower defense level, departed for Outland through a portal. Taking up the search for Illidan in an effort to sate his peoples lust for magic, Kal'Thas finds him being carted off in a cage by Maiev. With the assistance of Lady Vashj and your new Pandaren Brewmaster this is actually one of the funner missions in the game.

The Panderan has been around ever since. He's popped his head for April fool's day on the Blizzard website, advertising for the phony Panderan Express. And before Dranei had been officially announced as the Alliance race for the Burning crusade expansion, fan-made pics and rumors of Panderan characters were circulating the web.

The community loves this guy, and this Shaman is no different. I just hope the companion pet is rare enough that not everyone has it, and reasonable enough to obtain that the only resort isn't to mindlessly buy booster packs for a card game I have no interest in ever playing!