Custom Mobs
Contents |
Intro
You can have up to 10,000 mob IDs. This guide was written without testing on SVN; use at your own discretion. Well, its pretty easy if you do it correctly and go step by step without rushing.
Gettings Started
Database Structure
Let's take a look at the structure of the entries in mob_db.txt:
Note: If you're adding custom mobs, it's better to add them to mob_db2.txt
ID,Name,JName,LV,HP,SP,EXP,JEXP,Range1,ATK1,ATK2,DEF,MDEF,STR,AGI,VIT,INT,DEX,LUK,Range2,Range3,Scale, Race,Element,Mode,Speed,ADelay,aMotion,dMotion,Drop1id,Drop1per,Drop2id,Drop2per,Drop3id,Drop3per, Drop4id,Drop4per,Drop5id,Drop5per,Drop6id,Drop6per,Drop7id,Drop7per,Drop8id,Drop8per,Drop9id,Drop9per, DropCardid,DropCardper,MEXP,MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per
NOTE: I had to cut the mob_db structure so it could fit. It's a whole line, not 4 lines.
Header text | Header text | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ID | ID of the mob | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Name | This first name is the DB name. When you use @spawn/@summon and you know the name of the mob, but not the ID, type this name instead. Try making the normal name the same as this so you wont get confused. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
JName | This is the name the server shows. There's another way to change it, but I'll explain that later. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
LV | Level of the mob | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
HP | HP of the mob | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
SP | SP of the mob | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXP | Exp granted by the mob | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
JEXP | Job exp granted by the mob | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Range1 | Range of the mob attack. If set to 1 or 2, it will melee. 3 or more than 3 will set it to ranged | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
ATK1 | minimum attack of the mob | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
ATK2 | maximum attack of the mob. If no maximum attack defined here, the minimum attack will count as the absolute attack. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
DEF | Defense of the mob (Tip: 100 def = Invulnerability below 8K attack. Watch out, only melee/ranged attacks, but generally direct hits attacks are drastically reduced. Setting this high enough may make monks pretty cheap to level because of of Psychic Wave/Occult Impact/Investigate.) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
MDEF | Magic Defense of the mob (Hint: 100 mdef = golden thief bug effect below 9K magic attack. It's for all magic-using skills.) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
STR | Strength of the mob | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
AGI | Agility of the mob. This also affects the mob flee rate | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
VIT | Vitality of the mob | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
INT | Intelligence of the mob. This also affects its MATK. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
DEX | Dexterity of the mob. This also affects the mob hit rate. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
LUK | Luck of the mob. This also defines the mob perfect dodge/lucky flee/perfect flee/lucky dodge rate. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Range2 | Maximum Skill Range | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Range3 | Sight limit for mobs. If set to 1000 or beyond, mobs will follow you all over the map. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Scale | 0 if its Small, 1 if its Medium, 2 if its Large | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Race | 0=formless, 1=undead, 2=animal, 3=plant, 4=insect, 5=fish, 6=demon, 7=demihuman, 8=angel, 9=dragon. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Element | This is a two-digit number representing the rank (level) and element of the mob.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Mode | This defines the mob behaves. The numbers are these:
canMove: 1 Boss:32 plant: 64 castsensor: 16 assist: 8 aggresive: 4 looter: 2 canAttack: 128 detector: 256 changetarget: 512 These are the basic modes. You add them up to make the ones below: 64: Plant 128: Immobile being, passive (Pupa) 129: normal 131: looter 132: Immobile being, attacker (Hydra) 133: aggressive 137: supportive (Wolf) 139: supportive & looter (Thief Bug) 141: aggressive & supportive 145: detectors (Giearth) 149: aggresive & detectors (Hunter Fly) 171: Boss type and looter (Golden Thief Bug) 181: Boss type | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Speed | Walking speed of the mob. 1 is the fastest, 1000 is the lowest. 100 is the normal walking speed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
ADelay | ADelay= Attack Delay, also known as ASPD. This one will change the aspd of the mob. The lower the faster, but don't make it too low or it will lag when mobbed by several of these. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
aMotion | Attack animation motion. Lower this value and the mob's attack will be displayed in higher fps (making it shorter, too) (Thanks to Wallex for this) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
dMotion | Damage animation motion, same as aMotion but used to display the "I am hit" animation. Coincidentally, this same value is used to determine how long it is before the mob/player can move again. Endure is dMotion = 0, obviously.
The following fields are for drops and drop rates. Remember that these are in percentages; i.e. 100 = 100% | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop1ID | The Item ID of the drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop1per | the rate of being dropped goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop2ID | The Item ID of the drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop2per | the rate of being dropped goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop3ID | The Item ID of the drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop3per | the rate of being dropped goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop4ID | The Item ID of the drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop4per | the rate of being dropped goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop5ID | The Item ID of the drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop5per | the rate of being dropped goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop6ID | The Item ID of the drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop6per | the rate of being dropped goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop7ID | The Item ID of the drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop7per | the rate of being dropped goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop8ID | The Item ID of the drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop8per | the rate of being dropped goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop9ID | The Item ID of the drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Drop9per | the rate of being dropped goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
DropCardid | ID of a card or item. You can make this mob drop another mob's card, even. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
DropCardper | The chance of the card being dropped goes here. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
MEXP | The MVP exp the mob gives when it is defeated (to the player who got the MVP reward) (This exp is a percentage of the exp the monster gives.) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
MVP1id | The Item ID of the MVP drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
MVP1per | The rate of being dropped goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
MVP2id | The Item ID of the MVP drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
MVP2per | The rate of being dropped goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
MVP3id | The Item ID of the MVP drop goes here | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
MVP3per | The rate of being dropped goes here |
Making it visible
Server Side
If you've got a sprite and you're happy with it, then you can skip this part. If you would like to make your mob look like another mob, or even a player, then you need to take a look at Template:Svn
For normal mobs, you can use the data that's already in the file as an example to work on:
// mob_id,sprite_id,equip # // iRO Halloween Event 2008 //3000,1015,0 //3001,1036,0 //3002,1298,0 // iRO Halloween Event 2009 //3014,1179,0 //3015,1272,0
However, if you would like to make your mob look like a character, you need to add more options:
// Valaris
MobID | SpriteID | Sex | Hair | Hair_Color | Weapon | Shield | Head_Top | Head_Middle | Head_Bottom | Option | Dye_Color |
1900, | 4013, | 1, | 1, | 1, | 1254, | 0, | 67, | 12, | 54, | 16, | 1 |
You will need to use the Item ID for your mob's weapon and shield instead of the View ID of the item. Doing so may have undesirable effects.
A more in-depth look at each value:
MobID: This is your mob ID.
SpriteID: The Job number you want it to look like. They are:
Job_Novice 0 Job_Swordman 1 Job_Mage 2 Job_Archer 3 Job_Acolyte 4 Job_Merchant 5 Job_Thief 6 Job_Knight 7 Job_Priest 8 Job_Wizard 9 Job_Blacksmith 10 etc
They can also be found on Template:Svn file.
Sex: 0 for female, 1 for male
Hair: The mob hair style, goes from 1 to 23
Hair_Color: The mob hair color. Goes from 0 to 8 or 10, but it depends on the server's palette files.
Weapon:The ID of the Weapon you want. See Custom Weapons for it. Also read at the end of the pre if you cant find the headgear you want.
Shield: Same as above
Head_Top: Same as above
Head_Middle: Same as above
Head_Bottom: Same as above
Option: this option parameter will make the mob change its status, as well as give them carts, pecopecos, and falcons. In other words, this will change the visual effects of your mobs. The options are these*:
1 Sight 32 Peco Peco riding 2048 Orc Head 2 Hide 64 GM Perfect Hide 4096 Wedding Sprites 4 Cloak 128 Level 2 Cart 8192 Ruwach 8 Level 1 Cart 256 Level 3 Cart 16 Falcon 512 Level 4 Cart 1024 Level 5 Cart
Dye_Color: Same as hair color. It goes from 0 to 77
Client Side
For your mob to exist in the client, you need to add it to a few Lua files.
datainfo/npcidentity.lua
Example at the end of the file:
["JT_4_F_TAEKWON"] = 644, ["JT_4_F_SWORDMAN"] = 645, -- Custom Mobs ["JT_JACOB"] = 2500, ["JT_AQUARING"] = 2600 }
The number after the = sign denotes the mob's database ID number. Other sprites in this file have their view ID e.g. NPC sprite number.
datainfo/jobname.lua
Example at the end of the file:
[jobtbl.JT_GIBBET] = "GIBBET", [jobtbl.JT_DULLAHAN] = "DULLAHAN", [jobtbl.JT_LOLI_RURI] = "LOLI_RURI", [jobtbl.JT_DISGUISE] = "DISGUISE", -- Custom Mobs [jobtbl.JT_JACOB] = "jacobmob", [jobtbl.JT_AQUARING] = "aquaring" }
In this file, the value after the = sign is the name of the actual sprite in your data folder/GRF
Your mob in other files
Dead Branch
Adding your mob to Template:Svn or Template:Svn will allow Dead Branches to summon it.
Bloody Branch
Adding your mob to Template:Svn or Template:Svn will allow Bloody Branches to summon it.
Poring Box
Adding your mob to Template:Svn or Template:Svn will make your mob spawnable via the Poring Box.
Monster Racial Groups
Adding your mob to Template:Svn or Template:Svn will add your mob to a Racial Group. Guardians, Goblins and other mobs are members of particular Racial Groups.
Red Pouch of Surprise
Adding your mob to Template:Svn will make your mob spawnable via the Red Pouch of Surprise.
Spawn Points
Let's look at the syntax of a mob spawn point:
<map name>,<x1>,<y1>,<x2>,<y2>%TAB%monster%TAB%<monster name>%TAB%<mob id>,<amount>,<delay1>,<delay2>,<event>{,<mob size>,<mob ai>}
Only the things between <> are changed. Do not remove or change monster after the coordinates, because that's what tells the server that this line is a monster spawn script.
map name: Name of the map. Use /where along with the following coordinates
x1: X axis coordinates. It start from the left side of the map, and the higher it gets, the more it gets closer to the right side of the map.
y1: Y axis coordinates. It start from the bottom, and the higher it gets, the more it gets closer to the top of the map.
x2: X axis coordinates. It start from the left side of the map, and the higher it gets, the more it gets closer to the right side of the map.
y2: Y axis coordinates. It start from the bottom, and the higher it gets, the more it gets closer to the top of the map.
These 4 coordinates will make a spawn area where the mob will spawn, however it won't limit its movement, so lets say you put 120,150 on the first pair, and 130,160 pair- That's a 10x10 cell area where the mob will spawn randomly.
If you want the mob to spawn at a random point, use 0 for all the coordinates.
monster name: The name of the mob you want to be shown (using --ja-- in place of a name will display the "Japanese Name" from your database).
You can specify a custom level to use for the mob different from the one of the database by adjoining the level after the name with a comma. eg: "Poring,50" for a name will spawn a monster with name Poring and level 50.
mob id: The ID of your mob.
amount: How many mobs you want to be spawned.
delay1: Minimum amount of time before a monster respawns.
delay2: Maximum amount of time before a monster respawns.
delay1 and delay2 are used to define the time it takes for a monster to respawn; in milliseconds. Normal mobs usually have 0 (Instant Respawn), while MVPs have 7200000 (2 hours). If delay2 is greater than delay 1, the mob won't respawn until the map server restarts.
event: Script event to be executed when the mob is killed. The event must be in the form "NPCName::OnEventName" to execute, and the event name label should start with "On". As with all events, if the NPC is an on-touch NPC, the player who triggers the script must be within 'trigger' range for the event to work.
size: Optional. Size can be 0 (medium), 1 (small), or 2 (big).
ai: Optional. AI can be 0 (default), 1 (attack/friendly), 2 (sphere), 3 (flora), or 4 (zanzou).
Adding Skills
Lets look at the syntax of a mob skill:
MOB_ID, a unused dummy character sequence (for information only), STATE, SKILL_ID, SKILL_LV, rate (10000 = 100%), casttime, delay, cancelable, a target, a condition type, a condition value, a value 1, a value 2, a value 3, a value 4, a value 5, emotion
NOTE: I had to cut the mob_avail structure so it could fit.
It's a whole line, not 3 lines.
MOD_ID: your mob ID.
an unused.. etc etc: you can put any text here you want, its just for information and to know what does this do.* tip tip*You will see inside this file things like Poring@TF_POISON. Well, you could use this too. It would tell you: mob_name@DB_Skill_Name. *tip tip*
state: this is the state that the mob must accomplish before being able to use this skill. The states are:
any, idle (in standby), walk (in movement), attack, dead (on killed), loot, chase (following target), counterattack.
SKILL_ID: The ID of the skill goes here. To look for one, go to your db folder and open the skill_db.txt file. You will see a lot of lines like this one:
2,0,0,0,0,0,10,0,no,0,0,0,weapon,0 //SM_SWORD#ΥCў#
And the syntax is:
id,range,hit,inf,pl,nk,max,list_num,castcancel,cast_defence_rate,inf2,maxcount,skill_type,blow_count
so, the ID of the SM_SWORD, which is the Swordman's Sword Mastery by the way, is 2:
'''2''',0,0,0,0,0,10,0,no,0,0,0,weapon,0 //SM_SWORD#ΥCў#
SKILL_LV: You can put the skill level as high as you want. Though, 100 is usually as far as most skills go.
rate: How frequent will the mob use the skill.
casttime: Skill's cast time.
delay: How much time must pass before the skill can be used again, in milliseconds.
cancelable: if the skill cast can be interrupted. Set it either yes or no.
a target: the target of the skill. It can be:
target (player), self (the mob itself), friend (slaves)
a condition type:a condition that also must be fulfilled before the mob is able to use this skill. There are two kinds of conditions:
1. Mob Condition:
//conditions: (condition type) (value which specifies a condition value) // always unconditional // myhpltmaxrate when the mob's hp drops to a certain % // mystatuson If the mob has any abnormalities in status (condition value), // mystatusoff If the mob has ended any abnormalities in status (condition value), // friendhpltmaxrate when the mobs' friend's hp drops to a certain % // friendstatuson If the friend has any abnormalities in status (condition value), // friendstatusoff If the friend has ended any abnormalities in status (condition value), // attackpcgt Attack PC becomes more than the number of specification // attackpcge Attack PC becomes equal or more than the number of specification. // slavelt when the number of slaves is lower than the original number of specification. // slavele when the number of slaves is lower or equal than the original number of specification. // closedattacked when melee attacked (close range attack) // longrangeattacked when long ranged attacked (like bows and far range weapons) // skillused when a skill is used on the mob // casttargeted when a target is in cast range. // rudeattacked when a target is rude attacked // hiding when a target is hidden *not implemented yet*
2. Target Conditions
// The character's state which can be specified to be a condition value // by the statuson/statusoff system // // anybad any type of state change // stone condition of being in stone state // freeze condition of being in frozen state // stan condition of being in stunned state // sleep condition of being in sleep state // poison condition of being in poisoned state // curse condition of being in cursed state // silence condition of being in silenced state // confusion condition of being in confusion state // blind condition of being in blind state // hiding condition of being in hidden state // sight condition of being in unhidden state
You can use only ONE of these conditions.
value1,value2,value3,value4,value5: Basically they're only the same but, when you want your mob using the same condition to trigger the skill, but in different times, in case of the myhpltmaxrate when the hp is being decreased, you can set them in a decreasing order, like:
80,60,40,20,10
emotion: Lets your mob use an emotion, at random times. The emotion IDs are:
e_gasp 0 e_what 1 e_ho 2 e_lv 3 e_swt 4 e_ic 5 etc
For more info, go to your Template:Svn file.
Making it talk!
Another add, suggested by chronocrosser_x and Fenrir Soarblade:
Well, I believe you have seen some mobs on your server talking when certain things happens. I never saw them again talking, dont know why but they used to talk. I believe they still do it.
Ok, go to your Data folder. If you look in the files, you should find a file called monstertalktable. If there isnt, we will create one with Wordpad =3!. If there is, open it with Wordpad, not Notepad.
Once there, we will copy and paste this:
<?xml version="1.0" encoding="euc-kr" ?> <enemy_monster_talk_table> <mob_db_name_here> <discovery></discovery> <attack></attack> <hp50></hp50> <hp25></hp25> <kill></kill> <dead></dead> </mob_db_name_here> </enemy_monster_talk_table>
Well, lets see step by step =3!:
<enemy_monster_talk_table>: This is the start of the monster talk table. Leave it as it is =3!
<mob_db_name_here>: The mob_db.txt first name you see, after the ID, goes here =3! Its used to identify the mob
<discovery>%TAB%Text Here%TAB%</discovery>: This is an event, same as the one below. When a monster see you, this one will be displayed =3!
<attack>%TAB%Text Here%TAB%</attack>: When a monster attacks you, this one will be displayed O_O!
<hp50>%TAB%Text Here%TAB%</hp50>: When a monster's hp is at 50%, this one will be displayed o..o!
<hp25>%TAB%Text Here%TAB%</hp25>: When a monster's hp is at 25%, this one will be displayed x,x
<kill>%TAB%Text Here%TAB%</kill>: When a monster kills a character/player, this one will be displayed T~T!
<dead>%TAB%Text Here%TAB%</dead>: When a monster dies by player hand, this one will be displayed ^__^!
</mob_db_name_here>: The same name of the mob_db.txt, the one after the ID.
</enemy_monster_talk_table>: Keep it like this.
I never messed with this, but i think its ok =3! Also for those spaces other than the messages spaces, use TAB, not the Space Bar for it ._.!