• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[XML] How to make a monster? FULLY EXPLAINED

Zysen

=)
Joined
Sep 18, 2010
Messages
2,270
Reaction score
170
Location
Bosnia & Herzegovina
Hello.I will explain you how to make a monster.
My monster will be named Zarkon.

STEPS:


1.Create XML file called Zarkon and Open It;
2.Put this code:
Code:
<?xml version="1.0" encoding="UTF-8"?>

That should be in every xml script as far as i know.

3.Now add this:
Code:
<monster name="Zarkon" nameDescription="a Zarkon" race="blood" experience="45000" speed="999" manacost="320">

I will explain all:

monster name - it's monsters name
description - Here add a description, this is how the monster is explained in tibia if you look at it for example "You see a Zarkon."
race - your monsters race
experience - when you kill it how much exp it will give to you
speed - how much the monster is fast
manacost - rhis is the mana cost if you are going to summon the monster

4.Add this below:
Code:
<health now="500000" max="500000"/>

Explain:

health now - the hp the monster will spawn with
max [hp] - the max hp of the monster

5.Add this below also:
Code:
<look type="69" corpse="6007"/>
	<targetchange interval="2000" chance="0"/>
	<strategy attack="100" defense="0"/>


Explain:

looktype - outfit id of the monster
corpse - the monsters corpse item id
targetchange interval - this is how often the monster should change the target
chance - this is the chance of the monsters target changing
strategy attack - im not 100% sure on this one, i think it is the monsters attack power
defense - defense rate of the monster

6.Now you should add this:
Code:
<flags>
		<flag summonable="0"/>
		<flag attackable="1"/>
		<flag hostile="1"/>
		<flag illusionable="1"/>
		<flag convinceable="1"/>
		<flag pushable="1"/>
		<flag canpushitems="0"/>
		<flag canpushcreatures="0"/>
		<flag targetdistance="1"/>
		<flag staticattack="90"/>
		<flag runonhealth="0"/>
	</flags>

Explain:

flag summonable - this means thats if it set on 0 monster is not summonable,if you want it summonable change it to 1
flag attackable - this means that monster is attackable
flag hostile - this means that it will attack you if you see the monster, set to 0 if you want the monster to act like a rabbit
flag illusionable - this means that use utevo res ina to get the same outfit as the monster
flag convinceable - this means you can use a convince rune to make the monster your own pet
flag pushable - this means that you can push the monster
flag canpushitems - this means that the monster cant move objects like crates that is blocking the way, set to 1 if you want the monster to be able to push items
flag canpushcreatures - set it to 1 if you want the monster push creatures
flag targetdistance - this means that the monster will target people in a distance
flag staticattack - not sure what this is
flag runonhealth - this means that the monster wont run when it gets low health. Set this to the hp you want the monster to run on

7.Now add this things:
Code:
<attacks>
		<attack name="melee" interval="2000" skill="15" attack="1000"/>
		<attack name="physical" interval="1000" chance="9" range="7" min="-300" max="-600">
			<attribute key="shootEffect" value="smallstone"/>
		</attack> 
</attacks>

Explain:

attack name - this is the name of the attack , there's many more that you can find in other monster files
interval - this means how often the monster will attack you, it's counted in milliseconds so 2000ms=2 seconds
skill - the skill, it works like sword fighting and increases the hit rate
attack name - a attack style
interval - same as above
chance - chance of the attack being used by the monster
range - the range the monster will max throw ,its counted in sqm
min - the minimum damage dealed [remember to use or it will heal]
max - the maximum damage dealed
attribute key - the effect used, for this instance it is a shootEffect, it is like a bolt or something like that
value - the item used in the shootEffect

8.Add this to your xml file:
Code:
<defenses armor="8" defense="10"/>

Explain:

defense armor - works as armor , like plate armor its the arm value
defense - works as shield , the shield value

9.Now add:
Code:
	<elements>
		<element energyPercent="20"/>
		<element holyPercent="20"/>
		<element earthPercent="-10"/>
		<element deathPercent="-5"/>
	</elements>

Explain:

element energyPercent - means that the monster is 20% immune against energy
element holyPercent - means that the monster is 20% immune against holy damage
element earthPercent - means that the monster takes 10% more damage from earth damage
element deathPercent - means that the monster takes 5% more damage from death damage

10.Add this now:
Code:
	<voices interval="5000" chance="10">
		<voice sentence="RARGH"/>
		<voice sentence="SELL SELL SELL DEVILS WORKS"/>
		<voice sentence="KILL ????"/>
		<voice sentence="LEAVE PLZ I NEED TO WORK!"/>
	</voices>

Explain:

voices interval - this means that the monster will talk X seconds [how much you put]
chance - chance for each voice sentence
voice sentence - this is a sentence the monster will say in orange text

11.Now the last part of the script:
Code:
	<loot>
		<item id="2148" countmax="9" chance="100000"/>
		<item id="2461" chance="10000"/>
		<item id="1987" chance="100000">
			<inside>
				<item id="2559" chance="10000"/><!-- small axe -->
			</inside>
		</item>
	</loot>
</monster>

Explain:

item id - this is the item being looted
countmax - the max amount of the item looted , works only with stacks
chance - the chance of the looting item

If you want the monster to drop a bag with a item inside use this code:

Code:
		<item id="1987" chance="100000">
			<inside>
				<item id="2559" chance="10000"/>
			</inside>


12.The conclusion:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Zarkon" nameDescription="a Gold Farmer" race="blood" experience="45000" speed="999" manacost="320">
	<health now="500000" max="500000"/>
	<look type="69" corpse="6007"/>
	<targetchange interval="2000" chance="0"/>
	<strategy attack="100" defense="0"/>
	<flags>
		<flag summonable="0"/>
		<flag attackable="1"/>
		<flag hostile="1"/>
		<flag illusionable="1"/>
		<flag convinceable="1"/>
		<flag pushable="1"/>
		<flag canpushitems="0"/>
		<flag canpushcreatures="0"/>
		<flag targetdistance="1"/>
		<flag staticattack="90"/>
		<flag runonhealth="0"/>
	</flags>
	<attacks>
		<attack name="melee" interval="2000" skill="15" attack="1000"/>
		<attack name="physical" interval="1000" chance="9" range="7" min="-300" max="-600">
			<attribute key="shootEffect" value="smallstone"/>
		</attack>
        </attacks>
	<defenses armor="8" defense="10"/>
         <elements>
		<element energyPercent="20"/>
		<element holyPercent="20"/>
		<element earthPercent="-10"/>
		<element deathPercent="-5"/>
	</elements>
	<voices interval="5000" chance="10">
		<voice sentence="RARGH!"/>
		<voice sentence="SELL SELL SELL DEVILS WORKS"/>
		<voice sentence="KILL ????"/>
		<voice sentence="LEAVE PLZ I NEED TO WORK!"/>
	</voices>
<loot>
		<item id="1987" chance="100000">
			<inside>
				<item id="2559" chance="10000"/>
			</inside> 
</loot>
</monster>



Now if you want to add this to your server just go to monsters.xml and add this line:

Code:
<monster name="Zarkon" file="Zarkon.xml"/>




Hope you like it!





Regards,
Zysen




 
i guess its alright. but u skipped summons and other defenses too. and honestly you have to be an idiot with no common sense if you cant figure out how to make monsters.
 
Very good. Completely detailed :)
 
I won't be negative... but theres a lot you didn't cover. Once I rebuild FrozenHell's old forum database and rebuild it's content I'll share my tutorial. If you want to bring yours up to the standards I had:

Where's TypeEx? Also perhaps a link to one of those outfit lists.

Explain these <flag skull> <flag emblem>

You should probably include a note that corpseID doesn't have to be a dead body or even a container, but that loot section is obviously unused in such case.

<defense>
you missed this concept and also note you can use custom spells by calling thier ID as assigned in spells.xml
</defense>

You got some of the flags way wrong.
flag targetdistance - this means that the monster will target people in a distance
Your wording is confusing. 'This is the distance the monster will try to stay from it's target'
flag staticattack - not sure what this is
when you are standing still and the monster is adjacent, how much does it still move around?

also this is a pretty big miss:
<immunities>
<immunity name="death"/>
<immunity name="drown"/>
<immunity name="drunk"/>
<immunity name="earth"/>
<immunity name="energy"/>
<immunity name="fire"/>
<immunity name="holy"/>
<immunity name="ice"/>
<immunity name="invisible"/>
<immunity name="lifedrain"/>
<immunity name="outfit"/>
<immunity name="paralyze"/>
<immunity name="physical"/>
<immunity name="poison"/>
</immunities>

There are more <elements> too.

Add that anyone wanting more indepth knowledge should direct their search to examining the monster.cpp

Also the whole 'everything is bold and italic/oblique is super annoying to see for an entire 'article.'

This constructive criticism was sponsor in part by: Demonoid BitTorrent Tracker.
--Xaekai
 
Last edited:
Very nice tutorial! I've added for later to use when I want to change something or create a new monster :)

Currently I'm trying to fix 1 of the several problems that I'm experiecing and I'm wondering if somebody can help me..

It seems to be getting errors on shootEffect and areaEffects which use "suddendeath" or "energyarea". Does anybody know why this is and how to solve it?
monsterbugs.png
 
More or less helpful...
If I wanted a monster to not be hostile or even follow me until I attack it, how would I do it?
 
Nice tutorial. I simply have one question.
- What units does the item chance use? (Is it promil?)
If I write chance="1000", will that equal a 1% drop chance? (If so, it seems like I have a lot of work to do... drop chances seem to be wrong everyhere ;_; )
 
Yes, but you can easily change it for all by editing the loot rate in config.lua.
 
Thank you @Limos
I know that I can change the lootrate in config.lua however, it seems like the monster files I've got have had their drop chances of rare items changed by quite a bit!
(An example would be Royal Helmet in DL's, which is at 725, meaning 0.725%, (right?), while it's supposed to be at 0.26% according to the loot statistics I found at the tibia wiki)
 
Back
Top