- Joined
- Jan 4, 2006
- Messages
- 46
- Reaction score
- 9
So, for our next guide, let's see how we can make our own monsters and monster spawns. A minor problem may be, that we can use only the models of monsters, that are already implemented in the game (maybe this will change in some time ;]). But we know there are some unused monsters in the game - the golden doggebi with a moon around him for example - so we'll use this one, although it is already defined... But we'll just use it as a reference.
Step 1 : Server side setup
Ok, first let's see what we need to create on the server. All monsters are stored in InitMonster.txt, so we'll open that. The golden doggebi is also stored here as monster with the index 51 (you can find that name in the message-e.dat in the client as Elder Doggebi. Let's copy that out:
This is the definition of a monster (particularly the Elder Doggebi in this case). We will now look at the parameters:
- name: index of the name in message-e.dat
- index: unique number of the monster. Would be nice if you keep name and index the same :>
- country: for which version of the client the monster is available
- race: not sure what this means
- level: level of course :>
- ai: 1 = not aggressive, 2 = aggressive, 3 = bosses have this, 4 = uses magical skills (like demon workers), 5 = like managers probably (magic + physical attacks)... But you won't be needing more imho, 1 and 2 are enough for normal mobs ;>
- range: attack range (how close a mob must come to hit you ;]).
- sight: how far can the monster spot you. The second number defines how close you need to be when hitting the mob for it to start following you.
- exp: how much exp the mob will give you if you kill it when it's yellow without exp stone and event
- itemgroup: itemgroups from ItemGroup.txt that are added to this mob. 1 word: drops. You can add more itemgroups for 1 mob. The second number means how many times this itemgroup will be called (eg Queen drops 20x it's itemgroup)
- str, hth, int, wis, dex, hp, mp: mobs stats
- aspeed: attack speed
- hit: otp
- dodge: evasion
- attack: first number: dunno, it's always 0... second: min attack, third: max attack
- magic: magical attack of the mob. Probably. No mob has it (only hermits have 0 1)
- defense: mobs defense. don't know why 2 numbers
- absorb: absorbtion rate
- mspeed: move speed. First is running, second walking (probably =P)
- resist: elemental resistances
- quest: links to Quest.txt... Not sure about this so we'll skip it xD
So let's make a mob that is something different.
Really tough mob hmm ^^ now we put it in the InitMonster.txt and save it.
Next we want it to spawn somewhere right? So we'll open GenMonster.txt where the spawns are defined. Here we can see something like this:
- index: the index we gave the mob in InitMonster.
- map: the map where it will spawn (0 is outside)
- area: unique index for the spawn
- max: max number of mobs spawned at a time
- cycle: how long will it take to respawn when 1 mob is killed. 1 is instant, higher number -> longer wait
- rect: this is a rectangle that defines the spawn area. The numbers are coordinates of the corners of the rectangle (x,y, x2,y2). The coordinates are calculated like this: (thnx to Bodonko for explanation)
So let's make our mob spawn in some area, maybe something we can easily test. So we'll use the narooth vulgar spawn as reference for coordinates ;>
Now our new mob is defined and has a spawn. On to the client :]
Step 2: Client setup
We will need just a few things. First we decrypt and open macro.dat from config.pk. Here we will find rows that say monsterinfo and find our golden doggebi (key 51)
This defines how the client shows the monster.
- key: the mobs index on the server.
- bone: index of the 'bone'... this is defined in macro.dat too and it has something to do with the monster model.
- level: what level is the mob - make it the same as on the server, so you can see the right mob colour.
- scale: size of the mob in comparison to something (maybe the player char as 1.0). The second number looks maybe like the height in which the name of the mob should fly :>
So we'll make our own row, to make it interesting ^^:
The last thing we need to edit in config files is the mobs name. That is of course in message-e.txt. So we add something like
Now if we would leave it like this, we would get the monster but we still can't see it's model. So we go into Data/Monster/Clothes and we copy M050_B1.gb,M050_B2.gb and M050_B2.gb as M500_B1.gb,M500_B2.gb and M500_B2.gb. Every mob has it's own model here. Now in Tex we also need it's texture, so we copy M051.GTX as M500.GTX.
Finished, done ^^
Step 1 : Server side setup
Ok, first let's see what we need to create on the server. All monsters are stored in InitMonster.txt, so we'll open that. The golden doggebi is also stored here as monster with the index 51 (you can find that name in the message-e.dat in the client as Elder Doggebi. Let's copy that out:
Code:
(monster (name 51) (index 51) (country 0 2) (race 1) (level 72) (ai 2) (range 28) (sight 200 320) (exp 9960) (itemgroup 1 1)
(str 150) (hth 129) (int 10) (wis 10) (dex 85) (hp 3000) (mp 70) (aspeed 1500) (hit 121) (dodge 78)
(attack 0 400 520) (magic 0 0) (defense 164 139) (absorb 23) (mspeed 1600 500) (resist 38 38 38 40 40)
(quest ))
- name: index of the name in message-e.dat
- index: unique number of the monster. Would be nice if you keep name and index the same :>
- country: for which version of the client the monster is available
- race: not sure what this means
- level: level of course :>
- ai: 1 = not aggressive, 2 = aggressive, 3 = bosses have this, 4 = uses magical skills (like demon workers), 5 = like managers probably (magic + physical attacks)... But you won't be needing more imho, 1 and 2 are enough for normal mobs ;>
- range: attack range (how close a mob must come to hit you ;]).
- sight: how far can the monster spot you. The second number defines how close you need to be when hitting the mob for it to start following you.
- exp: how much exp the mob will give you if you kill it when it's yellow without exp stone and event
- itemgroup: itemgroups from ItemGroup.txt that are added to this mob. 1 word: drops. You can add more itemgroups for 1 mob. The second number means how many times this itemgroup will be called (eg Queen drops 20x it's itemgroup)
- str, hth, int, wis, dex, hp, mp: mobs stats
- aspeed: attack speed
- hit: otp
- dodge: evasion
- attack: first number: dunno, it's always 0... second: min attack, third: max attack
- magic: magical attack of the mob. Probably. No mob has it (only hermits have 0 1)
- defense: mobs defense. don't know why 2 numbers
- absorb: absorbtion rate
- mspeed: move speed. First is running, second walking (probably =P)
- resist: elemental resistances
- quest: links to Quest.txt... Not sure about this so we'll skip it xD
So let's make a mob that is something different.
Code:
(monster (name 500) (index 500) (country 0 2) (race 1) (level 80) (ai 2) (range 28) (sight 200 10) (exp 500000) (itemgroup 199 20)
(str 200) (hth 430) (int 10) (wis 10) (dex 150) (hp 30000) (mp 70) (aspeed 1500) (hit 180) (dodge 120)
(attack 0 1000 2000) (magic 0 0) (defense 180 100) (absorb 50) (mspeed 1600 20) (resist 80 80 80 80 80)
(quest ))
Next we want it to spawn somewhere right? So we'll open GenMonster.txt where the spawns are defined. Here we can see something like this:
Code:
(genmonster (index 4) (map 0) (area 17) (max 10) (cycle 1) (rect 8171 8010 8208 8114))
- map: the map where it will spawn (0 is outside)
- area: unique index for the spawn
- max: max number of mobs spawned at a time
- cycle: how long will it take to respawn when 1 mob is killed. 1 is instant, higher number -> longer wait
- rect: this is a rectangle that defines the spawn area. The numbers are coordinates of the corners of the rectangle (x,y, x2,y2). The coordinates are calculated like this: (thnx to Bodonko for explanation)
Bodonko said:You need 2 points (coordinates) to define a spawn rectangle.
Go to the south/west corner of the (virtual) rectangle type /coordinates and write them down, now do thes ame with the north/east corner and write the coordinates down.
Lets say s/w = (257925 276013 16966) and n/e = (258648 276331 16811)
Now how to get (rect x y x2 y2) out of this coordinates?
Easy, take the first number of s/w coord. and divide it by 32 = x
Second number of s/w divided by 32 = y
First number of n/e divided by 32 = x2
Second number of n/e divided by 32 = y2
So the coordinates for the spawn rectangle would be:
(rect 8060 8625 8082 8635)
So let's make our mob spawn in some area, maybe something we can easily test. So we'll use the narooth vulgar spawn as reference for coordinates ;>
Code:
(genmonster (index 500) (map 0) (area 110) (max 10) (cycle 1) (rect 8058 8145 8091 8177))
Step 2: Client setup
We will need just a few things. First we decrypt and open macro.dat from config.pk. Here we will find rows that say monsterinfo and find our golden doggebi (key 51)
Code:
( monsterinfo ( key 51) ( bone 8 ) (level 72) ( scale 2.0 8) ( motion "GGGAAGAAGG" ) (mspeed 1600 500) (attheight 18))
- key: the mobs index on the server.
- bone: index of the 'bone'... this is defined in macro.dat too and it has something to do with the monster model.
- level: what level is the mob - make it the same as on the server, so you can see the right mob colour.
- scale: size of the mob in comparison to something (maybe the player char as 1.0). The second number looks maybe like the height in which the name of the mob should fly :>
So we'll make our own row, to make it interesting ^^:
Code:
( monsterinfo ( key 500) ( bone 8 ) (level 80) ( scale 3.0 8) ( motion "GGGAAGAAGG" ) (mspeed 1600 20) (attheight 18))
The last thing we need to edit in config files is the mobs name. That is of course in message-e.txt. So we add something like
Code:
( monstername 500 "Stupid Doggebi")
Now if we would leave it like this, we would get the monster but we still can't see it's model. So we go into Data/Monster/Clothes and we copy M050_B1.gb,M050_B2.gb and M050_B2.gb as M500_B1.gb,M500_B2.gb and M500_B2.gb. Every mob has it's own model here. Now in Tex we also need it's texture, so we copy M051.GTX as M500.GTX.
Finished, done ^^
Last edited: