Log in

View Full Version : #logspawn - near complete, need help


Wynsom
10-28-2002, 05:52 PM
I made a function called #logspawn that takes NPC data and writes it to a file. I want to use this to help create SQL files from inside the emulator to save work from recreating already correct npcs in my new classic db. However, 3 of the data pieces are not logging correctly. Here is a sample output file:

(25111, Guard_Doolin000, 40, 44, 1, 3776, 0, 0, 0, -1074790400, 1, 0, 0, 4429024, 0, 0, 0, 0, 0, 0, 0, -937796802, 0, 0, 0, 0, 0, 0, 0, 1)
(25110, Guard_Jacsen000, 40, 44, 1, 3776, 0, 0, 0, -1074790400, 1, 0, 0, 4429024, 0, 0, 0, 0, 0, 0, 0, -1159557055, 0, 0, 0, 0, 0, 0, 0, 1)
(25109, Guard_Munden000, 40, 44, 1, 3776, 0, 0, 0, -1074790400, 1, 0, 0, 4429024, 0, 0, 0, 0, 0, 0, 0, -1280860619, 0, 0, 0, 0, 0, 0, 0, 1)
(25102, a_decaying_skeleton002, 1, 60, 1, 17, 2, 0, 0, -1074790400, 0, 0, 0, 4429024, 0, 0, 0, 0, 0, 0, 0, -1161115389, 0, 0, 0, 0, 0, 0, 0, 1)
(25100, a_bat008, 1, 34, 1, 17, 2, 0, 0, 1074266112, 0, 0, 0, 4429024, 0, 0, 0, 0, 0, 0, 0, -2037461023, 0, 0, 0, 0, 0, 0, 0, 1)
(25106, a_large_rat001, 1, 36, 1, 17, 2, 0, 0, 1075576832, 0, 0, 0, 4429024, 0, 0, 0, 0, 0, 0, 0, -2070752937, 0, 0, 0, 0, 0, 0, 0, 1)

And here is the function segment:

void Mob::LogStats(Client* client) {
client->Message(0, "Logged %s to spawnlog.log", this->GetName());

FilePrint("spawnlog.log", true, true, "(%i, %s, %i, %i, %i, %i, %i, %i, %i, %i, %i, 0, 0, %i, 0, 0, 0, 0, 0, 0, 0, %i, 0, 0, 0, 0, 0, 0, 0, 1)", this->CastToNPC()->GetNPCTypeID(), this->GetName(), this->GetLevel(), this->GetRace(), this->GetClass(), this->GetMaxHP(), this->GetGender(), this->CastToNPC()->GetLoottableID(), this->GetSize(), this->GetTexture(), this->GetHelmTexture, this->CastToNPC()->GetMerchantID(), this->GetFace());
}

My problem is i am getting outrageous numbers for GetTexture( ), GetMerchantID( ) and GetFace( ). They are all int8 too. Get MerchID and Face are 2 that I added but I dont see why they shouldnt work. Let me know if you have any tips for me.

Thanks!

kathgar
10-29-2002, 04:11 AM
Would it not be easier just to have it added to the db?

Trumpcard
10-29-2002, 05:19 AM
This makes it more nice and portable though... Be easy at that point to wrap it into a sql statement..

Wynsom
10-29-2002, 07:20 AM
Well, I am building a new db from scratch for my EQ Classic project. Considering 80% of the db is kunark+ material that I am throwing away, and the fact that there are so many junk spawns, i found it easier to start over. I like modularizaton alot, so i am making each zone its own db to keep things under control until they are finalized, then i can merge them into 1 when im ready.

kunta
10-29-2002, 08:52 AM
maybe that would be a better way to make the spawns easier to conrtol? put each zone in a different table?

Trumpcard
10-29-2002, 10:44 AM
I think it would definately make it a helluva lot easier to distribute work to multiple people... Then just wrap all the zone.sql files in one big npcload.sql that sources in the existing resource files..

Things should be nice and modular, makes it easier to get right to what you want to change.. not doing that way is like not bothering using seperate .cpp files, just make one huge source code file!

Wynsom
10-30-2002, 06:34 AM
I've advertised for help in the WorldBuilding forum under the EQ Classic Project post. So far I got one person helping but I will need more than that. I'm mainly just looking for people who have time to do population and know mysql enough to do the required work.

Lyenu X`Arie
10-30-2002, 05:27 PM
Wynsom: I still have a lot of code I wrote a long time ago for EQEmu that I never put in called "#dbspawn". Has things like add, remove, edit. It only lets you mess with the X,Y,Z of a mob and assign it a faction. If you want just PM me about it.