Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Adding a monster spawn

Joined
Sep 30, 2006
Messages
735
Reaction score
207
I use 010 Editor for this so the tutorial will explain how to do it in that

First off you need to take this and make a file called monster.bt(or anything you want .bt)
Code:
typedef struct{    signed int nCount;
}header;


typedef struct{
   signed int spawn_id;
   signed int type;
   signed int guessed_enable;
   float guessed_spawntime;
   float fInterval2;
   signed int groupID;
   float tempPosx;
   float tempPosy;
   float tempPosz;
   float gen_fMinRadius;
   float gen_fMaxRadius;
   float act_fMinRadius;
   float act_fMaxRadius;  
   signed int waypointcount;
} mob;


typedef struct{
    float tempPosx;
    float tempPosy;
    float tempPosz;
} waypoint;


while( !FEof() )
{
    local int i = 0;
    local int j = 0;


    header header_;
    for( i = 0; i < header_.nCount; ++i )
    {
        mob mob_;
        for( j = 0; j < mob_.waypointcount; ++j )
        {
          waypoint waypoint_;   
        }
    }
}
Now to add a spawn

Decide where you want to add a mob and go there ingame and type /mypos
This will output your coords in client end numbers, enter these coords into my coord converter View attachment MapCoordGui.rar here and click convert

The output will be a lower X and Y + a map on the server end data in the world folder look for a folder named what the map output was IE if it says 1-1 go to the 1-1 directory and open 1-1.monster in that directory using 010 Editor

Click Run Template and open the monster.bt you made earlier you will get a new window called template results
Change the header-> nCount to 1 higher then it was.

Scroll to the bottom and find the last time it says "struct mob mob_" click that and it will select it on the hex window. Select from the start of the selected window until the end of the file and copy that.

Select the very end of the file and paste(this is easier to do then writing it all from scratch)

Now run the template again and go to the last "struct mob mob_" Click the arrow beside it
Edit spawn_id to 1 higher then it is
Edit type to the monster type you want to spawn(from monster.bin)
Edit guessed_spawntime to the respawn time you want
Edit tempPosx, y and z use the x and y from the coord tool and the z from the output of /mypos
Edit Waypoints as needed

Now go to the next entry on the template output that should be "struct waypoint waypoint_" and click the arrow beside it if you edited waypointCount you will need to either add more of these or remove some there should be 1 waypoint_ for each waypointCount so 1 of them if you put 1 2 if you put 2 and so on edit those at this point by selecting it and copy -> pasting the data to the end of the file

Once you have the right number of them run the template again and go back to the bottom and edit the waypoint_'s you just made
Edit tempPosx, y and z use the x and y from the coord tool and the z from the output of /mypos


Anyone with time can also use this .BT struct to create a spawn editor... I had one working but lost it and don't have time to rewrite it sadly.



EDIT - Thx Yurn for minor corrections there it's been a while since I worked with these
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Dec 5, 2012
Messages
31
Reaction score
3
You should rework parts of this since its not entirly correct.

Code:
int _mobCount;

struct MonsterData {
	int _internalMobID;		// Internall Mob ID
	int _mobID;			// Reference to the Monster.bin
	int _enabled			// 1 == enabled

	float _respawnTime;				
	float _respawnTimeDynamic;	// If 0 then only _respawnTime is used, else itll have a respawn time between those two values
	
	int _groupID;			// Mobs with the same ID share the same group, 0 == no group
	
	float _spawnX;
	float _spawnY;
	float _spawnZ;

	float _unknown1;				
	float _unknown2;
	float _unknown3;				
	float _unknown4; 				
	
	int _nodeCount;			// Waypoint count
	
	struct Node {
		float _nodeX;
		float _nodeY;
		float _nodeZ;
	} [_nodeCount]
} [_mobCount]

The crucial thing here is the groupID and waypoints you mistaken. Not the "patrol" stuff does set the grouping but the groupID does. Aswell as "patrol" are the acctual waypoints the current mob in the entry takes. It spawns at the spawnX-Y,Z and walks the waypoints in the specified order.

E/: Oh and "nPatrolCount", so the nodeCount CAN BE 0. Itll be a mob which simply doesnt move.
 
Joined
Sep 30, 2006
Messages
735
Reaction score
207
Updated original post thx >_< working off old BTs I had made in 2011 and trying to remember how it went... I didn't even test this before posting lol.
 
Last edited:
Newbie Spellweaver
Joined
Dec 5, 2012
Messages
31
Reaction score
3
Yea, that's common stuff I had to reverse/import since I didnt want to setup 60k mobs by hand. :p:
 
Junior Spellweaver
Joined
Oct 12, 2013
Messages
128
Reaction score
10
You have to edit the .npc file for the relevant map. The structure isn't complicated (nearly identical to the .monster files) but the editing needed can be tricky plus you may need a special tool for getting the correct map co-ordinates (what you get shown in-game isn't correct in relation to what's in the .npc file).

Unless you have a LOT of time on your hands I would recommend placing the NPC manually where you want it, type /mypos and make a note of those co-ordinates so you can manually replace it after a server restart. A knowledgeable developer could even create a script to auto-place these NPCs at restart.

Not ideal I know but all things considered it's probably the best option.
 
Last edited:
Initiate Mage
Joined
Jun 5, 2015
Messages
1
Reaction score
0
float guessed_spawntime = 6600
What it's mean ?
(6600/60)/60 = 1,8 hours,
Or 6600 = 66 Minutes ?
 
Joined
Sep 30, 2006
Messages
735
Reaction score
207
You have to edit the .npc file for the relevant map. The structure isn't complicated (nearly identical to the .monster files) but the editing needed can be tricky plus you may need a special tool for getting the correct map co-ordinates (what you get shown in-game isn't correct in relation to what's in the .npc file).

Unless you have a LOT of time on your hands I would recommend placing the NPC manually where you want it, type /mypos and make a note of those co-ordinates so you can manually replace it after a server restart. A knowledgeable developer could even create a script to auto-place these NPCs at restart.

Not ideal I know but all things considered it's probably the best option.
Maps are all 262,144 units in each direction, in game get your position, divide it by 262,144. the whole number you get is the map it's on and the remainder is the location on the map... Super easy
 
Newbie Spellweaver
Joined
Feb 8, 2014
Messages
51
Reaction score
0
Hunin, i tried to use rohan strs for editing monster.bin and i have a problem after editing the monster levels.
i got this error monster.bin [ERROR] LoadBinFile monster.bin on mapid logs
 
Back
Top