OpenTibia (CipSoft files) monster.db - spawn extractor

TibiCAM

Well-Known Member
Joined
Feb 3, 2020
Messages
74
Reaction score
62
Hello,

Since I'm not good at programming and wanted to practice some, I made a tool that will extract all the spawns from CipSoft's "monster.db" file and output it as XML.
Few of those spawns for some reason just wouldn't get parsed so need to just manually edit their offsets.
Any monster with error has the X and Y offsets "99". So just search: x = "99" and y = "99" to find those.

If the tile contains a blocked item ID it will try to place the monster on the next tile.
All monsters are added counter-clockwise. Maybe it's accurate, maybe not. This project was just to practice my programming.
It also include function to see how many monsters should be added to the output file.
Use however you wish.

Files needed in same directory:
  • monster.db
  • the entire "origmap" directory (with sector map files)
You can get all files from [7.7] RealOTS 7.7 Cipsoft files (virgin) (https://otland.net/threads/7-7-realots-7-7-cipsoft-files-virgin.244562/)

Source: joekaizen/tibia-monster-db-extract (https://github.com/joekaizen/tibia-monster-db-extract)
Compiled: attached below and here: joekaizen/tibia-monster-db-extract (https://github.com/joekaizen/tibia-monster-db-extract/releases/tag/1.0)

You can customize it however you want, for example in line 101 you can maybe do a check if the "spawn.Monster" is a 7.4 monster specifically or something, to exclude 7.72 monsters.
 

Attachments

  • tibia-monsterdb-extract.zip
    92.8 KB · Views: 33 · VirusTotal

JamesIsAwkward

New Member
Joined
Aug 9, 2013
Messages
27
Reaction score
2
Ha I just finished up my monster.xml and was going to fire up your LUA command to find monsters stuck in blocked item IDs, this will save me a lot of time!


Once i finish this whole 7.72 pack, spawns, houses, quests, and everything, I'm going to release it here. This is a lot of work for people to keep having to do over and over lol
 
OP
TibiCAM

TibiCAM

Well-Known Member
Joined
Feb 3, 2020
Messages
74
Reaction score
62
Ha I just finished up my monster.xml and was going to fire up your LUA command to find monsters stuck in blocked item IDs, this will save me a lot of time!


Once i finish this whole 7.72 pack, spawns, houses, quests, and everything, I'm going to release it here. This is a lot of work for people to keep having to do over and over lol

Awesome man! Glad you like it. I found 3 bugged spawns in the output (set to offset: 99).
There could be some more, in case I missed some blockable item id's. I tried my best to get as many blocked items as possible.

To find the blocked items, I made a script earlier here (improvement to my lua, where i had entered item id's manually): [CipSoft Files] objects.srv - Non-walkable items? (https://otland.net/threads/cipsoft-files-objects-srv-non-walkable-items.271422/#post-2614435)
 
Last edited:

emil92b

Well-Known Member
Joined
Aug 21, 2013
Messages
241
Solutions
6
Reaction score
64
Location
Sweden
i noticed creatures spawn on blocked id's even tho they are in the invalid_items list, perhaps it doesn't check the top item and go for the ground tile instead while parsing the .sec files

444.PNG
 
OP
TibiCAM

TibiCAM

Well-Known Member
Joined
Feb 3, 2020
Messages
74
Reaction score
62
i noticed creatures spawn on blocked id's even tho they are in the invalid_items list, perhaps it doesn't check the top item and go for the ground tile instead while parsing the .sec files

View attachment 47033

I haven't got access to my computer now as I'm at work but is the tree ID in the blocked item list?
Any idea how to improve that via code and if there's any obvious bugs in it? I'm not good at programming (still learning). But I did try my best to make them go to the next index (+1). Maybe it failed, did you notice this happening a lot or just a few?
I tried my make it check the entire line. So 1 line in the file would contain everything that's on it. Signs, texts, amounts of items, all item id's, etc.
And I try with regular expression to see if that item id occurs anywhere. If I do .Contains() it would be even less accurate, because for example the id 100 may appear in like 5100 as well, etc..

Maybe my RegEx is not perfect?
https://github.com/joekaizen/tibia-monster-db-extract/blob/master/Program.cs#L355
(Line 355)

What coordinate is that on? I can try locate the file and check what's on that line.

It maybe is also an issue with this line: if (line.StartsWith($"{diffX}-{diffY}:") || line.StartsWith($"{str_spawn_offset_x}-{str_spawn_offset_y}:"))

Because perhaps in some files it has both leading zero and without it? Not sure.
So the {diffX} are without the leading zero (int). And the {str_spawn_offset_x} is a string with a leading zero.
But if the offset in the file looks like this: 08-8, then it would fail as I don't have a check for that.
Will need to add a mix of both maybe.

So from this:
if (line.StartsWith($"{diffX}-{diffY}:") || line.StartsWith($"{str_spawn_offset_x}-{str_spawn_offset_y}:"))

To this:
C#:
if (line.StartsWith($"{diffX}-{diffY}:") ||                                 // Both without leading zero's
    line.StartsWith($"{str_spawn_offset_x}-{str_spawn_offset_y}:") ||        // Both with leading zeros
    line.StartsWith($"{str_spawn_offset_x}-{diffY}:") ||                    // X with leading zero, Y without leading zero
    line.StartsWith($"{diffX}-{str_spawn_offset_y}:"))                        // X without leading zero, Y with leading zero
 
Last edited:

emil92b

Well-Known Member
Joined
Aug 21, 2013
Messages
241
Solutions
6
Reaction score
64
Location
Sweden
yes they are in the blocked item list, it happens in alot of places, not just trees but on other block ids aswell

here is a few places
32303, 31732, 7
32080, 32114, 4
32022, 32225, 7
31975, 32150, 7
32047, 32098, 7
 
OP
TibiCAM

TibiCAM

Well-Known Member
Joined
Feb 3, 2020
Messages
74
Reaction score
62
yes they are in the blocked item list, it happens in alot of places, not just trees but on other block ids aswell

here is a few places
32303, 31732, 7
32080, 32114, 4
32022, 32225, 7
31975, 32150, 7
32047, 32098, 7

Hmm... I'll have a look at that.
So this is the info I have so far:

Monster spawn: 32303, 31732, 7 (on small fir tree)
Spawn start: 32303, 31733, 7
Offset: X: 15, Y: 20
File: 1009-0991-07.sec

Line: 15-20: Content={4515, 3682}

So the item is indeed there and it's in the blocked list. I'll try to debug why this is happening.
Post automatically merged:

I'm sorry guys but I can't figure it out. I rewrote the function to get the monster spawn offsets but nothing is working as intended. Unless someone else fix it, it's going to be bugged. I won't spend more time trying to fix it
 
Last edited:

pink_panther

Premium User
Premium User
Joined
Sep 10, 2016
Messages
647
Solutions
8
Reaction score
279
Location
Kazordoon
i noticed creatures spawn on blocked id's even tho they are in the invalid_items list, perhaps it doesn't check the top item and go for the ground tile instead while parsing the .sec files

View attachment 47033
When you load up the world though, can't they just walk off the tile they're on? No tiles around them are unpassable, so they should be able to just walk off right?
 

emil92b

Well-Known Member
Joined
Aug 21, 2013
Messages
241
Solutions
6
Reaction score
64
Location
Sweden
When you load up the world though, can't they just walk off the tile they're on? No tiles around them are unpassable, so they should be able to just walk off right?
yeah i think it was coded like that
 

Boy67

Well-Known Member
Joined
Jul 4, 2007
Messages
199
Solutions
5
Reaction score
52
Location
England
When you load up the world though, can't they just walk off the tile they're on? No tiles around them are unpassable, so they should be able to just walk off right?
Yeah, the function to check if a tile is walkable doesn't concern the tile they are standing on...so a normal player wouldn't even see them there as they would of moved long before the player enters their view. Only a god character would see them there if no player has visited that area since server start.
 
Top