Wednesday, March 25, 2009

3.1 second time around

I earlier (my first post actually) posted what I took notice in with the upcoming patch. Now about a month later I've decided to put my thoughts down again (this time I've fooled around with pictures in my post as well). I will most likely (read: definitely) miss a lot, but these are the things that I took note of (some date back to my previous pos, and I'll present them in an order only known to no one.

Typhoon, which is a spell I always loved as an idea, but when ever I've gone Moonkin I never really used it :(. Well with the recent 3 second daze change to this spell I'm liking it even more, and (this not being the only reason) in 3.1 I'll be trying to give Balance PvP a more serious try. (as a side note I've also read that typhoon now knocks 10 yards.

Tree of Life, making the 20% reduced mana reduction work in caster form as well is lovely. In PvP it's an obvious improvement, since we're running around in caster most of the time. But in serious raiding we'll still be in ToL for the added spell power from spirit, and to some extend the 6% healing aura, except paladins can provide this one as well Improved Devotion Aura.

Innervate, just a quick note about this FINALLY! costing 0 mana.

Starfall, reduced CD to 1½min, which is much more deserving compared to what it does and being an end tier talent Glyph of Starfall, and it's down to 1 min, which could be useful in PvP, and maybe even as a 3rd glyph for PvE, personally I use the Glyph of Insect Swarm when I play moonkin ... Actually I always use it, I glyphed for moonkin when I hit 80, and have mainly been playing resto with Starfire, Moonfire & Insect Swarm glyphs, because I'm to cheap and lazy to reglyph properly, looking forward to playing with the Glyph of Swiftmend(hehe sry for removing your HoTs other resto druids of Trollbane EU).

Nourish, this spell is the reason I turned up my spell details (and my crappy FPS the reason I turned it down shortly after). Now I'm not a raider anymore (haven't been a serious raider since vanilla), but I do a few pugs when I get the time, but so far I still don't have the 4s bonus from my resto gear. But with the new Glyph of Nourish coming, I'm really glad I've forced my self to use the spell more when healing. Anyway what I'm getting at is, I'm glad the nourish glyph finally came, and I'm looking forward to using it (if I get around to switching my glyphs :)).

Arena enemy frame, I'm looking forward to see how this is done. Maybe it'll replace my Gladius addon for arena (propably not, usually I'm not that fond of blizzards way of making the unit frames).

DoTs that crit, I would love for our DoTs to be able to crit (through talents ofc), like some of the other classes and specs have been given. And well actually it wouldn't be to bad for our HoTs to crit either hehe :)

Hmm all this talk about arena makes me want to focus a lot more on arena instead of PvE, would love to try out feral PvP as well (and PvE for that matter haven't played feral since BC), problem is just gathering gear, having to get both moonkin & feral PvP gear is a pain, already now I've been trying to get some resot & moonkin. Anyway, I'm looking forward to this patch, and to get started on WoW again, after I got home from snowboarding this sunday I haven't been home (in my actual appartment) yet, so haven't logged in WoW now for almost 2 weeks .... SCARY!

Tuesday, March 03, 2009

Armory grinding [Part 1]: Getting started

First off this is mainly about programming, and is only connected to WoW since it shows how to get data off the armory.

There are 2 ways (actually there are several, but 2 major ways - actually maybe 3 major ways, but the 3rd one being less ... legal) of getting data from the WoW Armory using PHP.
  1. Web scraping, here we'll simply get the whole HTML page, and start scrapping the tags, and getting out the information we want.
  2. Simply getting the XML sheet, and using the already structured data.

I'll be using the 2nd method, because it's obviously the fastest, since the actually amount of bytes send is way less and the script performance is better because there's no need for making a big script scraping the data.

Getting the data
There's several methods getting the actual data, I've decided to write a (very) simple HTTP get function, and then using the more common PHP functions.
I've just looked around the net on how other people are fetching the data, the most popular way is using cURL (and honestly this is the way I would use if I ever was to make something serious), some also spoofs the User-Agent (explained later) by setting it in the php.ini. Unfortunately not everyone has access to these options (I for one don't have access to any of these 2 methods on my cheap cheap web host).

To my surprise the armory is sending chunked data (transfer-coding: Chunked), so my (very) simple HTTP get, just got upgraded to a plain simple function :).
To open the actual connection I'm using fsockopen, after this I'll use the standard file functions available to PHP.
I will not be handling errors in the code examples, it serves no purpose to what I want to show in these posts. Meaning I wont check if I got the connection I'll just assume it worked. This is of course very very bad coding practice, but like I said it's not what I'll be going over in these posts.

Right enough chit chat, let me get started.
First off we'll have to setup the GET request. We need to spoof our User-Agent to get the XML, if the armory server doesn't recognize the user-agent as a browser that support the styling of their XML, it'll send it as HTML (and we would have to scrape the page). So we'll make the armory think we're using FireFox, giving us a request that needs to follow this setup:
User-Agent: Firefox/3.0.5

We could also use an actual user-agent string such as Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/2008120122 Firefox/3.0.5 (.NET CLR 3.5.30729) but my simplified version will give the same result.
The rest of the code is pretty self-explanatory, except for how I get the chunks, which I'll explain below the code:
function httpGetRequest($host, $absPath, $query, $port = 80) {
$newLine = "\r\n";
$request = 'GET /'. $absPath .'?'. $query .' HTTP/1.1'. $newLine;
$request .= 'Host: '. $host . $newLine;
$request .= 'User-Agent: Firefox/3.0.5'. $newLine . $newLine;

$handle = fsockopen($host, $port, $errNo, $errStr, 10);
fwrite($handle, $request);

$response = "";
$nextChunk = 1;
while ($nextChunk > 0 && !feof($handle)) {
if (fgets($handle) == $newLine) {
$nextChunk = hexdec(fgets($handle));
if ($nextChunk > 0) {
for ($i = 0; $i < $nextChunk; $i++) {
$response .= fgetc($handle);
return $response;
(oh if this is totally freakish to some of you, go read up on the HTTP protocol, it's a pretty simple protocol and very easy to understand)
Now I read the chunked data by looking for the the "\r\n" and then a number (in hex). As an added bonus this will get me through the headers, and on to the body. When we encounter a "\r\n", then the number followed is the number of bytes in the next chunk of data. So basically just read the next X bytes and ask for the number of bytes in the next chunk.
Then to use the function I'll simply call it as following (this will give my character XML sheet):
var_dump(httpGetRequest($url, 'character-sheet.xml', 'r=Trollbane&n=Apollonaris'));
I'm not going to post the XML here, because it is actually rather big, and would do no good, since you can just copy paste the above code, and give it a try.

Anyway hope this helps someone, I know I had some troubles getting started with this, because all the examples where using cURL. Having been busy busy at work lately I haven't gotten around to fooling around with this, but when a project at work needed for a custom HTTP Get function it was easy to port :)
(hmm I must try to make this field a bit widder, so my code actually is readable without scrolling)

Tuesday, February 24, 2009

3.1 &Me

So I've just read up on the 3.1.0 Patch Notes and compared to what I've read earlier on the subject I am personally very pleased. I'll start with things I've noticed in general before moving on to my main love in this game druids.

Dual Spec. This will cost 1000g, which is equivalent to 20 respecs. Personally I stopped respeccing and have been resto for a while now, maybe I'm even down to 45g each spec :) Anyway this is awesome and I'm going to get it first thing (although I don't know what my 2nd spec would be). I wonder how the hotkey switching will work with addons
Staff enchants.This is great for those that use staffs I've always been 1H + OH my self tho. We can hope for more weapon type specific enchants in the future, that would be good fun.
Gear manager. This equals 1 less addon (if Blizzard did it right), so thats a good thing
Ground mounts can swim. This is good for those jumps over lakes that I never make, and have to mount again, for longer swims I'll always prefer my swimform.
BG queue from anyway. I wonder where I come out after the BG?

(back in TBC I was mostly feral, but I haven't read up about that ever since, so honestly I have no thoughts there).
The balance part of the patch, there are actually nothing really. There is the Owlkin Frenzy nerf which is of no matter really, I have never found any effective use for this talent. And then the Predatory Strikes is fixed so it now adds to attack power in moonkin form as well (just a slap in the face). So nothing for balance druids this patch :(

But I like the new resto changes!
Replenish, which is renamed to Revitalize now works with Wild Growth. I've never had this talent before, but with this improvement I might actually think about taking it. But then again it all depends on the mana situation after the patch.
Improved Mark of the Wild, now adds 1/2% to your total attributes, which gives us a tiny Kings, that's great (but do they stack?).
Improved Regrowth, now called Nature's Bounty, has been changed to give 25% crit to Nourish & Regrowth. So a nerf for some a buff for others, depending on your play style. I've tried to use nourish more lately to get used to it, in hope of a buff (& maybe a glyph) in the near future.
Improved Barkskin looks good for a PvP spec (and I haven't really played PvP since season 3 I think), the extra damage reduction is good, and the dispel resistance is great, specially when strugling to keep yourself alive agains a DK.

Anyway lets see how it all turns out once 3.1 actually goes live, all in all I'm excited with the new changes, and I'll propably play my low level lock some more as well with those new changes, although I should focus on getting my 70 mage to 80 instead :)