Jump to content

[Guide-PartI]How to create your own Npc +++

Recommended Posts

Hello MaxCheaters.Well today i will try to learn you from the most basics things about npcs.

I know that there are already other guides that explaining many things about npcs but i'm trying to gather all here,write them with my own "style",explain more things that didn't explained at none topic yet.Also i will post links from other guides if someone would like to see how to import npcs etc & if wants to learn about npcs from another topic.So this is like AIO topic,oh i tried :D .But this guide is most for interlude client as i don't explain the code tags(html) that can be used at epilogue/freya/high five but anyway...If you learn & understand this guide,you will surely find out more by yourself.

If i missed anything,feel free to tell me.I will update it at any time.


  • So,in this guide i will show how to ::
    • Create the HTML part of npc
    • Create the XML part of npc
    • Create the SQL part of npc

    [*]How to create your own icon/button to your npc,which you can find the guide on Client Mod Section


Part 1 : HTML


a)Html part is from the most important & the most intresting,but to make it intresting you must know the html tags which can help you so much to make your npc beautiful.

Also an impressive thing is that you can put images into html part :) and i will learn to you how you can create your own icons & how to import them into game.This will be the part II of guide.


So let's start explaining the most importants(from my opinion ofc) html tags.

<html> You will put EVERY time at top ,when you start writing the html part

<title> Is the chat window's name

<body> This will be after <html> ,it is the text of html

<br> It directs you to next line

<center> To be the text you will write at center

<left> =||= at left

<right> =||= at right

<table> Defines a table

<tr> Defines a table row

<td> Defines a table cell

<img src="image.image" width=256 height 32> The tag for image/icon you want to put on your npc.The max width and height is 256.

<brl>switch on the next line without space

<font color="html code">text</font>Color for a text,you can find the html codes at google


For other tags & more examples you can found out by download others npcs & pay attention at html files,as i did.


b)Now we will see some examples of html into our npc.


Let's see...

<html> //As we said before we always start with this on the begin of a html file
<body> //We put this before we begin writing our text
<title>GM Shop - MaxCheaters</title> //here is the title of npc
<center> //with this,our text will me in the middle
<font color="FF0000">WelCome To Maxcheater's shop</font>  //a colored text
<br> //with this,it directs as to the next line
Here You Can Buy The Custom Armor! //a simple text
<button value="Consumbles" action="bypass -h npc_%objectId%_multisell 50001" width=196 height=22 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"> //I will explain after about buttons
</center> //as our text finished we put it off.If we write something else after that ,it will not be in the middle
</body> //Our text finished,so we must close it
</html> //In the end of the html file


You can see informations about each tag inside of "example-html"


Explanation about button:

<button // this will be always in the begin when we want to create a button

value="Consumbles" //this is name of button which we will click

actions="bypass -h npc_%objectId&_ //with this we can make the action we want with the button

for example if after that actions="bypass -h npc_%objectId&_ write multisell 50001(like at the example-html),when we will click the button it will redirects us to file multisell 50001 ,which is located at multisell folder and the file with name 50001.xml

back="L2L2UI_ct1.button_df" //this is the image of button when you will click the button it,you can see it

fore="L2UI_ct1.button_df" //this is the image of button too which appears without click the button. As here is the same image on back and fore ,there isn't a change when you will click it.


If we don't write the back="blabla and fore="blabla ,it will not have a image for button,but only a text.

A pic for preview for what we made :




b.1)Let's find out more intresting options that you can make on html part.


You want to press the x button and redirect to next html file of npc?

For example let's say that npc's id is 7100,so your html is 7100.htm .

1st you must create new file with name 7100-1.htm & write whatever you want.

Now how you can go from 7100 to 7100-1 by clicking a button?

at action of button you write this <button value="Text" action="bypass -h npc_%objectId%_Chat 1" width=196 height=22>

ATTENTION: These 2 files must be at the same folder to work.

I hope you get it :) .


c)Here are some usefull actions for your npcs


  • action="bypass -h npc_%objectId&_Sell //with this,you can sell your items for adena to the npc
  • action="bypass -h npc_%objectId&_Back //with,you can go back to previous html file of the x npc
  • action="bypass -h npc_%objectId&_Augment 1 //with this,it pops up the window for augment your weapon
  • action="bypass -h npc_%objectId&_Augment 2 //with this,it pops up the window to cancel the augment of your weapon
  • action="bypass -h npc_%objectId&_DepositP //with this,it pops up the window to deposit your items at the warehouse
  • action="bypass -h npc_%objectId&_WithdrawP //with this,it pops up the window to withdraw your items from the warehouse
  • action="bypass -h npc_%objectId%_DepositF" //with this,it pops up the window to deposit your items at the freightservice
  • action="bypass -h npc_%objectId%_WithdrawF" //with this,it pops up the window to withdraw your items from the freightservice
  • action="bypass -h npc_%objectId%_DepositC" //with this,it pops up the window to deposit your items at the warehouse of clan
  • action="bypass -h npc_%objectId%_WithdrawC" //with this,it pops up the window to withdrawyour items from the warehouse of clan
  • action="bypass -h npc_%objectId%_goto xxx(the id for teleport location)" //with this,it redirecting to the teleports.sql at the id for the x location.You click at and teleport you to x location,but you have to make the custom teleports.sql file with custom location(which will have an id also)


For furthermore you can find out alone,by checking out the default npcs which there are to all packs.

For example you want the action of adding dyes?Find the html file of the npc and see the action ;) .


d)There is a nice guide which explains you how you can see the images that your client already contains,so you can use any

of them for your npc.

[Guide]How to put icons on your NPCS by Devangell


e)Small Explanations about 3 most basic npc types

If you want to make a Seller(custom shop,gm shop etc.) put the html file at ...\data\html\merchant\       folder

If you want to make a Gatekeeper put the html file at ...\data\html\teleporter\       folder

If you want to make an info npc/buffer put the html at ...\data\html\default\       folder



Every time when you finish a html ,remember that you must save it as .htm



In the end you want to learn how you can import from the download npc the html file?Simple.

Just copy paste the html files to the proper folder.See the e)


Part 2  : XML

Here it doesn't to explain much as everything is simple

At lines next to these // it's just COMMENTS for you.


Let's see an example of a xml file

<?xml version='1.0' encoding='utf-8'?> //always at begin of a xml file
 <!-- The action of 1st Obtain Item.You can put here the name of item,just to remember it-->
 <item id="1"> //At 1st item you will write id="1" .For another one,under of it ,you will write id="2".
   <ingredient id="The Id Of Ingredient" count="How many of them" />
   <production id="The Of production" count="How many of them" />
 </item> //At the end of x item

 <!-- The action of 2nd Obtain Item.You can put here the name of item,just to remember it-->
 <item id="2"> //At 1st item you will write id="1" .For another one,under of it ,you will write id="3".
   <ingredient id="The Id Of Ingredient" count="How many of them" />
   <production id="The Of production" count="How many of them" />


Ingredient ID //Here you put the id of item which needs the player to get the production item

Ingredient Count  //How many of them must have?

Production ID //The id of item which will buy the player

Production Count //How many of these items will buy


b)To import the xml files from a download npc,you must copy paste them to the proper folder.Simple


c)Here is a intresting tool about multisell so it might help you out with your creations

[Tool] Elements Multisell [1.0] by Dysfaction


c)Then you save it as .xml

These files are located at the multisell folder.

That's all!


Part 3  : SQL

a)About SQL which is the easy step.


If you want to create a npc you can copy paste the above and fill in the id/idtemplate/etc... of your npc.

INSERT INTO custom_npc
  (`id`, `idTemplate`, `name`, `serverSideName`, `title`, `serverSideTitle`, `class`, `collision_radius`, `collision_height`, `level`, `sex`, `type`, `attackrange`, `hp`, `mp`, `hpreg`, `mpreg`, `str`, `con`, `dex`, `int`, `wit`, `men`, `exp`, `sp`, `patk`, `pdef`, `matk`, `mdef`, `atkspd`, `aggro`, `matkspd`, `rhand`, `lhand`, `armor`, `walkspd`, `runspd`, `faction_id`, `faction_range`, `isUndead`, `absorb_level`, `absorb_type`, `ss`, `bss`, `ss_rate`, `AI`, `drop_herbs`)
  (ID NPC, Template ID, 'Name', 1, 'Title', 1, 'LineageMonster4.Keyache_tr', 12.00, 29.00, 70, 'female', 'L2Teleport', 40, 3862, 1493, 11.85, 2.78, 40, 43, 30, 21, 20, 10, 0, 0, 1314, 470, 780, 382, 278, 0, 333, 0, 0, 0, 55, 132, 'NULL', 0, 1, 0, 'LAST_HIT', 0, 0, 0, 'fighter', 'false');

You must pay attention to these 3 most.

ID //you will put the id of npc(html file must have the same number)

TemplateId //You can find the templateid from others npcs at game(target npc,alt+shift and see the teplateid))

Type //the most important.If you npc is trade(gmshop/etc..)you will write L2Merchant,if it's gatekeeper L2Teleporter & if it is buffer or an info npc L2Npc


b)There is also another way to create your npc,too simple.

Open Navicat,next open your database,find npc.sql & open it.

Then down you will see bar.Click the button + and then fill in the gaps for your npc.

Too easy huh? :) .


c)To create a new sql file for custom locations,there are 2 ways.


c.1Open navicat,open your database and then find & open teleports.sql

Click the button + and fill in the gaps


Description :

Description //the name of location

Id //the id of location which you must remember it for each location to write on action from button of html file (_goto Id,see upper on actions)

loc_x ,loc_y ,loc_z //when you will find the place in game which you want to spawn after pressing the x button at gatekeeper,press /loc and you will at systemmessage some numbers.Take the and fill in the loc_x ,loc_y ,loc_z

price //how many adena they will give to teleported to x location

fornoble //if you put 1 to see,the players who are noblessed could teleport only


c.2Create a query sql like the above.

INSERT INTO table_name (Description, Id , loc_x, loc_y, loc_z, price, fornoble)
VALUES (value1, value2, value3, value4, value5, value6, value7)

So at table_name you will write the name of the table of course ;D .

After that ,there are the columns from the table.

Then the values will be inserted into the columns that's why you must write them.

In the end save this file as .sql and then extract it at your l2jdatabase from navicat.


Otherwise you can do it with newbie way but is ok :).

Download a gatekeeper from forum and change everything on how you want them.

It can waste you less time ;) .


d)All npcs have also npc settings for outlook.

You can change them at how you want from navicat or ingame.

I suggest in game as we talk about outlook so we want to see how it look like on every change.


ID //the id of npc(it must be an unique number,it must not exist to other npc)

ID Template //Here the id template that we chose,the outlook of npc

name/title //the name & the title of npc.

serverSideName/serverSideTitle //here if we want to put a name/title,we must write here 1.If we leave ,the name/title will not change

Class //the class of npc/mob that we chose (for example "Monster2.ifrit_30_bi")

rhand //what weapon will hold the npc at his right hand (we must write the id of weapon)

lhand  //what weapon will the npc at his left hand (we must write the id of weapon)

aggro //This must stay 0.Don't touch it.Except if you want to create a pk killer

All the others setting is your personal choise with not a real prob.You can put random numbers.

e)Here is a guide generally about sql commands which you should know them.

It can helps you of course for your npc creations and not only

[Guide]SQL COMMANDS by Leki

f)Here are some usefull links that shared at mxc which you may help you,related to sql ofc.

It can helps you i think.

[Guide]How to import your NPC normally by Leki

[GUIDE]How to add SQL files by LordOfDarkness

[share]L2J DataBase Editor by NeXiM

[share]SQL Creator [interlude to CT2.5] by CriticalError


Part 4 : Usefull links

I think that you learned much from this guide.Let me give you some last links generally for npcs.

Link to comment
Share on other sites

I'd have to say it looks cool. havent read it just did overfly it.

//me too xD

come on!!!

25 posts ?

im new =/ im try to edit L2 servers come onnnn

please send me on private =]

//fack off :)



EDIT: well explained :D .. for newbies and not that newbie people :)

Thanks for this guide ;)

Link to comment
Share on other sites

Ok ....! This sure will help many newbies and will decrease topics without reason for Npc's ...!



Thanks for this Guide...!

Link to comment
Share on other sites

well done fb,

even if a little part of your guide its shared,you work is awesome.Gj.

Plus,someone should reward you with this fvcking pixel >.>(If i were vip I would do that).


Anyway,again gj.

Link to comment
Share on other sites

come on!!!

25 posts ?

im new =/ im try to edit L2 servers come onnnn

please send me on private =]

If you don't have even 25 posts,you are just like bot.

I won't share my guides to bots.

I can avoid leech also in this way,anyway.




Thanx for your comments ;D .

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Posts

    • Lineage 2M Mobile Web Template:     You can buy it here: https://templstock.com/en/product/lineage-2m-landing
    • ReAwaken Cream:-Consumers in India tend to switch brands if products of similar quality are available at lower price points. Though brand awareness is high among Indian consumers, however, they still switch brands frequently and have low brand loyalty, which presents a challenge for the companies operating in this market. They come as lotions, creams, gels, and cleansing pads. If you use them too much or too often, they can irritate your skin and cause more blemishes.   ReAwaken Anti – Aging ReAwaken Anti - Aging Cream   Official Website:- https://www.24x7healthnews.com/skin-care/reawaken-cream/ https://www.24x7healthnews.com/skin-care/hydrationlabs-anti-aging-cream/ https://www.scoop.it/topic/reawaken-cream?&kind=crawled&fId=1740421 https://sites.google.com/view/reawaken-cream/home https://twitter.com/CreamReawakena https://twitter.com/CreamReawaken/status/1617850072376696835 https://natural-health-support-info.blogspot.com/2023/01/reawaken-cream-reduce-tan-marks.html https://youtu.be/aEJM9URkmPw https://techplanet.today/post/reawaken-cream-bright-youthful-skin-everyday
    • Okay, seriously, i wouldn't even dare to call this a server share & files topic, since not a single person managed to share a working client which can be used with the server files which are also long long gone. Yet there are people who are posting screenshots of their clients being ingame, yet not one of them managed to share at least their system dir or something.   So here's the link from a guy who at least reshared most of the files which got shared on ragezone during those 22 pages long discussion from Fryye.   But seriously, this is just a pathetic, @irk for example has a working system directory with killed gg and whatnot, yet couldn't even share that.   (i found someone who actually fixed the system directory, but obviously you can't just download the system and be happy... https://mmo-dev.info/threads/system-287-kr-nogg-strings-eng.22712/)   Leecher bunch...
    • Hello I am looking for a client developer to make some changes on my interface.my client is classic p166 version .
    • thanks guys very mutch the problem is chronical Hi5
  • Topics

  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock