Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Database/World Building

Development::Database/World Building World Building forum, dedicated to the EQEmu MySQL Database. Post partial/complete databases for spawns, items, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-22-2004, 06:23 AM
sandy
Hill Giant
 
Join Date: Oct 2002
Posts: 212
Default NPC Editing Tutorial

Usefull tools :

- MYSQL Control Center : it is usefull to edit rows of a sql table, it's exactly what we need for npc editing

See Here :
http://www.eqemulator.net/forums/viewtopic.php?t=11440

- my LootEditor's Program : for loot =)

See Here :
http://www.eqemulator.net/forums/viewtopic.php?t=14357

- Mongrel's Spell Editor : to find spells !

See Here :
http://camongrel.hbnet.de/files/

- EQEmu's server GuideBook v1.3 : for races index, materials, textures for example =)

See Here :
http://www.eqemulator.net/forums/viewtopic.php?t=10900

- And IEQ for merchants

See Here :
http://www.eqemulator.net/forums/viewtopic.php?t=13944


The NPC_TYPES Table :

I will explain all fields one by one =)

The SQL Table :

Code:
CREATE TABLE `npc_types` (
  `id` int(11) NOT NULL auto_increment,
  `name` text NOT NULL,
  `lastname` varchar(32) default NULL,
  `level` tinyint(2) unsigned NOT NULL default '0',
  `race` smallint(5) unsigned NOT NULL default '0',
  `class` tinyint(2) unsigned NOT NULL default '0',
  `bodytype` int(11) default NULL,
  `hp` int(11) NOT NULL default '0',
  `gender` tinyint(2) unsigned NOT NULL default '0',
  `texture` tinyint(2) unsigned NOT NULL default '0',
  `helmtexture` tinyint(2) unsigned NOT NULL default '0',
  `size` float NOT NULL default '0',
  `hp_regen_rate` int(11) unsigned NOT NULL default '0',
  `mana_regen_rate` int(11) unsigned NOT NULL default '0',
  `loottable_id` int(11) unsigned NOT NULL default '0',
  `merchant_id` int(11) unsigned NOT NULL default '0',
  `npc_spells_id` int(11) unsigned NOT NULL default '0',
  `npc_faction_id` int(11) NOT NULL default '0',
  `mindmg` int(10) unsigned NOT NULL default '0',
  `maxdmg` int(10) unsigned NOT NULL default '0',
  `npcspecialattks` varchar(36) NOT NULL default '',
  `banish` int(10) unsigned NOT NULL default '0',
  `aggroradius` int(10) unsigned NOT NULL default '0',
  `social` int(10) unsigned NOT NULL default '0',
  `face` int(10) unsigned NOT NULL default '1',
  `luclin_hairstyle` int(10) unsigned NOT NULL default '1',
  `luclin_haircolor` int(10) unsigned NOT NULL default '1',
  `luclin_eyecolor` int(10) unsigned NOT NULL default '1',
  `luclin_beardcolor` int(10) unsigned NOT NULL default '1',
  `fixedz` tinyint(2) unsigned NOT NULL default '0',
  `d_meele_texture1` int(10) unsigned NOT NULL default '0',
  `d_meele_texture2` int(10) unsigned NOT NULL default '0',
  `walkspeed` float NOT NULL default '0',
  `runspeed` float NOT NULL default '0',
  `MR` smallint(5) NOT NULL default '0',
  `CR` smallint(5) NOT NULL default '0',
  `DR` smallint(5) NOT NULL default '0',
  `FR` smallint(5) NOT NULL default '0',
  `PR` smallint(5) NOT NULL default '0',
  `ipc` tinyint(1) NOT NULL default '0',
  `see_invis` tinyint(4) NOT NULL default '0',
  `see_invis_undead` tinyint(4) NOT NULL default '1',
  `qglobal` int(2) unsigned default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=88441 ;

1) ID

the id =)


2) name and lastname

npc names must have no blanks, use '_' character if u want that a blank appears in its name in the game
a npc with only '_' as its name will have no name in the game
that's usefull if you want to make untargetable statues for example
, or invisible npcs


3) level

the npc level


4) race, gender, texture and helmtexture

the npc race number
see the eqemu's server guidebook about races, it have a race index with images of each race by gender and material ( texture and helmtexture ) =)

race = 1 is a human for example
race = 288 is Rallos Zek himself =)

for a race number, it can exist different models
the most often there is a male and female model ( gender )
gender = 0 is a male
gender = 1 is a female
gender = 2 is neutral ( for monsters )

but for example for velious dragons, it can exist several different models and combinations ( with body and heads )
texture is used for the body
helmtexture is used for the head

all this is explained in the guidebook


5) class

it's the class of the npc :

Code:
warrior = 1
cleric = 2
paladin = 3
ranger = 4
shadowknight = 5
druid = 6
monk = 7
bard = 8
rogue = 9
shaman = 10
necromancer = 11
wizard = 12
magician = 13
enchanter = 14
beastlord = 15
gm warrior = 20
gm cleric = 21
gm paladin = 22
gm ranger = 23
gm shadowknight = 24
gm druid = 25
gm monk = 26
gm bard = 27
gm rogue = 28
gm shaman = 29
gm necromancer = 30
gm wizard = 31
gm magician = 32
gm enchanter = 33
gm beastlord = 34
banker = 40
merchant = 41
adventuremerchant = 61

6) Body Type

everything about body type is not discovered yet, it seems to be used by everquest's client program to identify which type of npc it is

here is a small list :

Code:
1 => "Normal" ( default ), 
2 => "Lycanthrope", 
3 => "Undead", 
4 => "Giant", 
5 => "Construct", 
6 => "Extraplanar", 
7 => "Monster", 
8 => "Flying Monsters", 
9 => "Unknown_9", 
10 => "Unknown_10", 
11 => "Untargetable", 
12 => "Vampyre", 
13 => "Atenha Ra", 
14 => "Greater Akheva", 
15 => "Khati Sha", 
16 => "Unknown_16", 
18 => "Unknown_18", 
19 => "God",
20 => "Unknown_20",
21 => "Animal", 
22 => "Insect", 
23 => "Fire Creature", 
24 => "Construct/Elemental/Gargoyle", 
25 => "Plant", 
26 => "Dragon", 
27 => "Unknown_27", 
28 => "Summoned Creature", 
29 => "Unknown_29", 
30 => "Unknown_30", 
31 => "Unknown_31", 
32 => "Illusion", 
65 => "Unknown_65", 
66 => "Unknown_66", 
67 => "Unknown_67"
you should use 0 as default

to make a npc act as an undead ( for spells etc ... )
it is bodytype = 3

bodytype = 11 is used to create untargetable type npcs

so for example to create a gargoyle statue npc :
give it bodytype = 11
give it "_" as its name so no name will appear
give it no faction so it won't attack anyone
give it the race 203 of the gargoyle and texture = 0 helm = 0
then you have your gargoyle statue =)

7) hp, hp_regen_rate, mana regen_rate

hp : it's the hit points of the npc
hp_regen_rate : it is the number of hp it regens by ticks
0 makes a npc to not regen its hit points
mana_regen_rate : same but for mana

be carefull, npcs with an insane hp regen can be impossible to kill

8 ) size

it's the size of the npc =)
some examples :
humans => size = 6
dwarf => size = 4
big boss/giants => size = 20


9) loottable_id

it's the id of its loottable
it points to the 'id' field in the 'loottable' sql table
no loottable => loottable_id = 0

see in the loottable table section below for more information


10) merchant_id

it's the id of its merchant item list
it points to the 'merchantid' field in the 'merchantlist' sql table

see in the merchantlist table section below for more information


11) npc_spells id

it's the id of its spells list
it points to the 'id' field in the 'npc_spells' sql table

see in the npc_spells table section below for more information


12) npc_faction_id

it's the id of its faction list
it points to the 'id' field of the 'npc_faction' sql table

same =) see below for more information


13) mindmg and maxdmg

minimum damage and maximum damage of the npc =)


14) npcspecialattks

it's the special abilities of the npc, it uses letters like 'S' or 'Q' for each ability
here's the list of all special abilities :

Code:
E => Enrage
F => Flurry
R => Rampage
S => Summon
T => Triple Attack
Q => Quadruple Attack
U => Unslowable
M => Unmezzable
C => Uncharmable
N => Unstunable
for example :
if you specify 'SQFRU' to a npc :
he will summon, quad, flurry, rampage, and is unslowable, conclusion, it's a very nasty npc !
there is no order in the letters

you see it lacks the Unrootable/Unsnarable ability or the death touch ability ... devs have work ! =)


15) Banish

let it to 0 don't touch =)
it's an ability for a monster to banish people who have lvl 52+, it's used for nagafen and lady vox


16) Aggroradius

it's the distance of aggro from the position of the npc around him
default in eqemu is 70
so if you let 0, it will be 70

when a player will enter this distance, the npc will aggro, if other npcs are in this distance too, and if they have the same faction, they will help him and aggro too

mobai must be changed because at this moment, if all monsters are in aggro radius of other monsters, they will chain aggro and you can aggro all the zone like this
in eqlive the distance and line of sight to the npc interacts so it won't happen but not yet in eqemu =(

so be careful with aggro radius and npc placement =)


17) face, luclin_hairstyle, luclin_haircolor, luclin_eyecolor and luclin_beardcolor

it's used for luclin player models
see in eqemu's guidebook for more information


18 ) fixedz, dmelee_texture1, dmelee_texture2

don't touch =) not usefull I think


19) walkspeed and runspeed

when a npc move and has noone in its hate list, he is walking
if he aggroes, he is running

default speed are : walkspeed = 0.67 and runspeed = 1.25
fastest mounts speed = 1.75


20) MR, CR, DR, FR and PR

MR => Magic Resistance
CR => Cold Resistance
DR => Disease Resistance
FR => Fire Resistance
PR => Poison Resistance

the resistance system doesn't work perfectly yet, but it's a start =)
so don't bother too much with that, formulas have yet to be tweaked


21) ipc

If you don't know what it is, do like me =) Don't touch =)


22 ) see_invis and see_invis_undead

see_invis = 1 if you want that your npc sees invisible, else 0
see_invis_undead = 1 if you want that your npc sees invisible versus undead, else 0

normal npcs don't see invis, but sees invisible to undead
undead npcs don't see invisible versus undead but sees invisible

23 ) qglobal

it's a field used for perl global quests
don't touch =)


now you know everything about the npc_types table


Spawn Tables

here are the 3 sql tables that manage the npc spawns :

Code:
CREATE TABLE `spawngroup` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`)
) TYPE=MyISAM;

CREATE TABLE `spawn2` (
  `id` int(11) NOT NULL auto_increment,
  `spawngroupID` int(11) NOT NULL default '0',
  `zone` varchar(16) NOT NULL default '',
  `x` float NOT NULL default '0',
  `y` float NOT NULL default '0',
  `z` float NOT NULL default '0',
  `heading` float NOT NULL default '0',
  `respawntime` int(11) NOT NULL default '0',
  `variance` smallint(4) NOT NULL default '0',
  `pathgrid` int(10) NOT NULL default '0',
  `timeleft` bigint(16) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

CREATE TABLE `spawnentry` (
  `spawngroupID` int(11) NOT NULL default '0',
  `npcID` int(11) NOT NULL default '0',
  `chance` smallint(4) NOT NULL default '0',
  PRIMARY KEY  (`spawngroupID`,`npcID`)
) TYPE=MyISAM;
spawngroup => spawn table
spawn2 => spawn location
spawnentry => mob

it works like this :
a) you define at first a spawngroup
b) you add mobs to this spawngroup
c) and then you specify at which locations this spawngroup will pop

a) you define at first a spawngroup :

so I look to the spawngroup table :
I need a unique spawngroup id
and I need to give to the spawngroup a name

for example :
I have no spawn yet in my database, I create the 1rst one at ID=1, it will be a spawngroup of rats in planes of disease

So I obtain this spawngroup :
spawngroupID=>1,name=>Plane of Disease Rats

b) I add mobs into this spawngroup

I look then at the spawnentry table:
I need the id of the spawngroup, the id of the npc, and its chance to spawn in percent
And i have to do that for each npc in the spawn group

In my example :
the spawngroupID is 1
I want that a diseased rat spawn as often as a swamp rat
disease rat can be lvl 50 to 52
swamp rat is lvl 52 or lvl 54

in my database I see that :
- a_diseased_rat lvl 50 is npcid 40010
- a_diseased_rat lvl 51 is npcid 40011
- a_diseased_rat lvl 52 is npcid 40012
- a_swamp_rat lvl 52 is npcid 40020
- a_swamp_rat lvl 54 is npcid 40021

a_diseased_rat must have in total 50% chance so I divide it for all the different diseased rat
same for the swamp rat

so I add 4 spawnentry rows :
spawngroupID=>1,npcid=>40010,chance=>20
spawngroupID=>1,npcid=>40011,chance=>20
spawngroupID=>1,npcid=>40012,chance=>10
spawngroupID=>1,npcid=>40020,chance=>25
spawngroupID=>1,npcid=>40021,chance=>25

I have now my spawn table, I just have to specify where it will pop

c) spawn locations

If you look at the spawn2 table :
we need a unique id, a spawngroupid, a zone name, a location ( x,y,z,heading), a respawntime

variance is a random time added or substracted to the respawntime =), you should use this only for boss monsters

pathgrid is a grid id if you want that the monsters that spawn at this point follow a grid

timeleft, don't touch it's used by eq to count how many time is left until a mob respawn

for our example we need that the rats spawn at 2 locations :
1rst one : x=1000, y=10, z=100, heading=0
2nd one : x=500, y=500, z=100, heading=0
I want they respawn in 2 minutes ( 120 sec ) after they are killed at the 2 locations

so we add 2 spawn2 rows :
id=>1, spawngroupID=>1, zone=>podisease, x=>1000, y=>10, z=>100, heading=>0, respawntime=>120, variance=>0, pathgrid=>0, timeleft=>0
and
id=>2, spawngroupID=>1, zone=>podisease, x=>500, y=>500, z=>100, heading=>0, respawntime=>120, variance=>0, pathgrid=>0, timeleft=>0

now i launch the server and the game i go in podisease and I can see a diseased rat at the 1rst location and a 2nd one at the 2nd location
I kill this last one, I wait and 2 minutes after that, a swamp rat spawn =)
__________________
Sandy
Reply With Quote
  #2  
Old 04-22-2004, 07:15 AM
Gossamer
Sarnak
 
Join Date: Apr 2004
Posts: 92
Default

Excellent stuff! Thanks for the information. I cant wait for the next one!
Reply With Quote
  #3  
Old 04-22-2004, 07:35 AM
Jezebell
Discordant
 
Join Date: Feb 2004
Location: Florida
Posts: 441
Default

Sandy.....you rock! Thanks for coming up with this, you should "Sticky" it.
__________________
Eru, the Creator of Arda
ServerOwner for The First Age
An EQEMulator Roleplaying [Custom-Legit] Server
The First Age Website

Running on: Asus A7N8X-Deluxe, AMD Athlon XP 2100+, Geil 1024MB PC3200 Ultra DDR RAM,
WD 40GB 7200rpm ATA-100 HDD, Visiontek 128MB Geforce4 TI 4400, Windows XP Pro SP2
Reply With Quote
  #4  
Old 04-24-2004, 11:24 AM
Cripp's Avatar
Cripp
Discordant
 
Join Date: Oct 2003
Location: The Shire
Posts: 474
Default

very nice, we need something like this for all the tables.
1 question tho, what exactly is the lastname column?

also would be wonderful to know how to add the text in parenthesis underneath the name(if this even relates to npc_types)
thanks
__________________
Nug Blazers - ServerOP / founder
^^comming... later!

www.nugblazers.com
Reply With Quote
  #5  
Old 04-24-2004, 07:02 PM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

Just some info about what ipc used to be. I'm not sure if this was ever finished or if it was completed the way originally intended, but ipc was planned to be an npc that helped you(and leveled as well?).
__________________
Xeldan
Lead Content Designer
Shards of Dalaya
Reply With Quote
  #6  
Old 04-24-2004, 07:32 PM
RangerDown
Demi-God
 
Join Date: Mar 2004
Posts: 1,066
Default

I'd assume that dmelee_texture1, dmelee_texture2 fields make the NPC wield certain weapons.
Reply With Quote
  #7  
Old 04-25-2004, 02:59 AM
sandy
Hill Giant
 
Join Date: Oct 2002
Posts: 212
Default

are they still usefull ?
npcs wear weapons with the lootdrop_entries equip_item field I know
__________________
Sandy
Reply With Quote
  #8  
Old 04-25-2004, 03:53 AM
Gossamer
Sarnak
 
Join Date: Apr 2004
Posts: 92
Default

Crip. That field is for a player character. The lastname field for an NPC is not used. If you were to name your mob THE DARK PRINCE you would have to put an _ between the names to make it appear correctly in game. So THE DARK PRINCE becomes THE_DARK_PRINCE.
Hope it helps!
Reply With Quote
  #9  
Old 04-25-2004, 04:29 AM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

Actually lastname is used - it just didn't work until 5.5 or 5.6 - it puts whatever is in the field under the NPCs name in parentheses.
__________________
Xeldan
Lead Content Designer
Shards of Dalaya
Reply With Quote
  #10  
Old 04-26-2004, 08:21 AM
Gossamer
Sarnak
 
Join Date: Apr 2004
Posts: 92
Default

Thanks Killspree! I didnt know that
Reply With Quote
  #11  
Old 04-26-2004, 09:44 AM
Cripp's Avatar
Cripp
Discordant
 
Join Date: Oct 2003
Location: The Shire
Posts: 474
Default

hmmm still doesnt seem to be workin for me :cry:
only way i could find to add parenthesis was a change in the source. but it is limited, can only make so many different "parenthesis"(guess we can call it that hehe)
__________________
Nug Blazers - ServerOP / founder
^^comming... later!

www.nugblazers.com
Reply With Quote
  #12  
Old 04-26-2004, 09:52 AM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

Erm, no...you don't do that. You just put whatever into the field. Like say you have a character named Bob and he's the warrior trainer. You put Warrior Trainer(spaces are allowed here) in the lastname field, and it would show up like this ingame:

Bob
(Warrior Trainer)
__________________
Xeldan
Lead Content Designer
Shards of Dalaya
Reply With Quote
  #13  
Old 04-26-2004, 09:56 AM
mikenune
Discordant
 
Join Date: Apr 2004
Location: Gukta
Posts: 359
Default

So I could change Cazic Thule to say:

Quote:
Cazic Thule
(Supreme lord of chewing gum)
Kewl!
Reply With Quote
  #14  
Old 04-26-2004, 04:07 PM
Shadow-Wolf
Dragon
 
Join Date: Oct 2003
Posts: 511
Default

hmmmm, what body type would boats be? all i know is that they are non-con =/.
Reply With Quote
  #15  
Old 04-29-2004, 10:00 AM
sandy
Hill Giant
 
Join Date: Oct 2002
Posts: 212
Default

I think boats are not npcs but objects no ?
__________________
Sandy
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:17 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3