Post
by Grumpy » Tue Mar 01, 2005 8:31 am
I'm not going to give you a detailed answer, because I don't know, but:
It's theoretically possible to do almost anything, the main question is, "is it worth the trouble?"
You can hook any function in EQ (that's what all those offsets in eqgame.h are about) and replace it with new code in MQ2 (that's pretty much what MQ2 is all about).. That said...
Chances are, the function in EQ that writes lines of text to the log file is really simple, in fact, it's probably functionally equivalent to the code in MQ2 that handles the /mqlog function. Accept a string, open a file, append the string to the file, close the file, easy stuff.. The problem is, that string doesn't have an references to the data that created the string, so "A spider hits Nukeme for 112 points of damage." doesn't have any references to either "A spider" or "Nukeme", it's just text. So you couldn't just lookup "A spider" and "Nukeme" and add the spawn IDs.
You'd have to go back one more step in the code, to every function in EQ that might write a log entry that contains a spawn name, and change every reference to the "Spawn->Name" to "Spawn->Name (sid: Spawn->ID)", so that it would write your logs for you. This would require a new offset for every function you have to do this for (assuming that the offset is not already required for something in MQ2). Lots and lots of work every patch.
Alternately, you could just hook the function that returns a spawn's name, ad add a little snippet of code that adds the spawn's ID to the name that is returned. This solution however, would most likely break several bits of EQ, and would make every place that now displays a Spawn's name (like floating over every PC's or NPC's head in game, or in all the chat EQ sends to you). And would be VERY detectable (like if you do a /report or /etition in game).
In short, yes, you could do this, but it would likely be vastly more trouble than it was worth.
I could be wrong, if so, one of the devs will likely straighten me out.