Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-28-2013, 06:13 PM
xible77
Fire Beetle
 
Join Date: May 2011
Posts: 2
Default Creating NPC Error

I get this error when I try to create a new npc.

Code:
---------------------------------------------
[07.28. - 09:49:24] Starting Log: logs/eqemu_error_zone_11364.log
[07.28. - 09:49:24] NPCSpawnDB Error: INSERT INTO npc_types (name, level, race, class, hp, gender, texture, helmtexture, size, loottable_id, merchant_id, face, runspeed, prim_melee_type, sec_melee_type) values("Server_Greeter",1,1,1,31,0,0,0,0.000000,0,0,0,1.250000,28,28) #1364: Field 'special_abilities' doesn't have a default value
Running latest peq database dump. Any help appreciated, Thanks.
Reply With Quote
  #2  
Old 07-28-2013, 06:47 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Code:
Field 'special_abilities' doesn't have a default value
Likely you're not inserting a value in to this column some how and it doesn't default to anything thus causing this error.
Reply With Quote
  #3  
Old 07-28-2013, 11:41 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

This is what I do to add new NPCs.. just copy old ones lol


Code:
SELECT 1337 INTO @COPY;                  #ID of NPC to copy from
SELECT "Uber_new_guy" INTO @NAME;   #New NPCs name

INSERT INTO npc_types SELECT 
'',
@NAME,
`lastname`,
`level`,
`race`,
`class`,
`bodytype`,
`hp`,
`mana`,
`gender`,
`texture`,
`helmtexture`,
`size`,
`hp_regen_rate`,
`mana_regen_rate`,
`loottable_id`,
`merchant_id`,
`alt_currency_id`,
`npc_spells_id`,
`npc_faction_id`,
`adventure_template_id`,
`trap_template`,
`mindmg`,
`maxdmg`,
`attack_count`,
`special_abilities`,
`aggroradius`,
`face`,
`luclin_hairstyle`,
`luclin_haircolor`,
`luclin_eyecolor`,
`luclin_eyecolor2`,
`luclin_beardcolor`,
`luclin_beard`,
`drakkin_heritage`,
`drakkin_tattoo`,
`drakkin_details`,
`armortint_id`,
`armortint_red`,
`armortint_green`,
`armortint_blue`,
`d_meele_texture1`,
`d_meele_texture2`,
`prim_melee_type`,
`sec_melee_type`,
`runspeed`,
`MR`,
`CR`,
`DR`,
`FR`,
`PR`,
`Corrup`,
`see_invis`,
`see_invis_undead`,
`qglobal`,
`AC`,
`npc_aggro`,
`spawn_limit`,
`attack_speed`,
`findable`,
`STR`,
`STA`,
`DEX`,
`AGI`,
`_INT`,
`WIS`,
`CHA`,
`see_hide`,
`see_improved_hide`,
`trackable`,
`isbot`,
`exclude`,
`ATK`,
`Accuracy`,
`slow_mitigation`,
`version`,
`maxlevel`,
`scalerate`,
`private_corpse`,
`unique_spawn_by_name`,
`underwater`,
`isquest`,
`emoteid`,
`spellscale`,
`healscale` 
FROM npc_types
WHERE id = @COPY
;
Reply With Quote
  #4  
Old 07-29-2013, 11:26 AM
Nightrider84's Avatar
Nightrider84
Discordant
 
Join Date: Aug 2010
Location: Colorado
Posts: 410
Default

Could always do it a different way just do #spawn (nameofnpc) to create the npc. then just do #npcspawn create and that adds it to your zone and all thats left is either modify him in the DB or do #npcedit in game to modify him that way.
Reply With Quote
  #5  
Old 07-29-2013, 12:05 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

you are doing an insert without declaring the columns.. this is a horrible practice and leads specifically to this type of issue.

Here:
Code:
INSERT INTO `npc_types` (`id`,`name`,`lastname`,`level`,`race`,`class`,`bodytype`,`hp`,`mana`,`gender`,`texture`,
		`helmtexture`,`size`,`hp_regen_rate`,`mana_regen_rate`,`loottable_id`,`merchant_id`,`alt_currency_id`,
		`npc_spells_id`,`npc_faction_id`,`adventure_template_id`,`trap_template`,`mindmg`,`maxdmg`,`attack_count`,
		`special_abilities`,`aggroradius`,`face`,`luclin_hairstyle`,`luclin_haircolor`,`luclin_eyecolor`,`luclin_eyecolor2`,
		`luclin_beardcolor`,`luclin_beard`,`drakkin_heritage`,`drakkin_tattoo`,`drakkin_details`,`armortint_id`,
		`armortint_red`,`armortint_green`,`armortint_blue`,`d_meele_texture1`,`d_meele_texture2`,`prim_melee_type`,
		`sec_melee_type`,`runspeed`,`MR`,`CR`,`DR`,`FR`,`PR`,`Corrup`,`see_invis`,`see_invis_undead`,`qglobal`,`AC`,
		`npc_aggro`,`spawn_limit`,`attack_speed`,`findable`,`STR`,`STA`,`DEX`,`AGI`,`_INT`,`WIS`,`CHA`,`see_hide`,
		`see_improved_hide`,`trackable`,`isbot`,`exclude`,`ATK`,`Accuracy`,`slow_mitigation`,`version`,`maxlevel`,
		`scalerate`,`private_corpse`,`unique_spawn_by_name`,`underwater`,`isquest`,`emoteid`,`spellscale`,`healscale`)
	SELECT 223097 AS `id`,'zone_status' AS `name`,`lastname`,`level`,`race`,`class`,`bodytype`,`hp`,`mana`,`gender`,
		`texture`,`helmtexture`,`size`,`hp_regen_rate`,`mana_regen_rate`,`loottable_id`,`merchant_id`,`alt_currency_id`,
		`npc_spells_id`,`npc_faction_id`,`adventure_template_id`,`trap_template`,`mindmg`,`maxdmg`,`attack_count`,
		`special_abilities`,`aggroradius`,`face`,`luclin_hairstyle`,`luclin_haircolor`,`luclin_eyecolor`,`luclin_eyecolor2`,
		`luclin_beardcolor`,`luclin_beard`,`drakkin_heritage`,`drakkin_tattoo`,`drakkin_details`,`armortint_id`,`armortint_red`,
		`armortint_green`,`armortint_blue`,`d_meele_texture1`,`d_meele_texture2`,`prim_melee_type`,`sec_melee_type`,
		`runspeed`,`MR`,`CR`,`DR`,`FR`,`PR`,`Corrup`,`see_invis`,`see_invis_undead`,`qglobal`,`AC`,`npc_aggro`,`spawn_limit`,
		`attack_speed`,`findable`,`STR`,`STA`,`DEX`,`AGI`,`_INT`,`WIS`,`CHA`,`see_hide`,`see_improved_hide`,`trackable`,
		`isbot`,`exclude`,`ATK`,`Accuracy`,`slow_mitigation`,`version`,`maxlevel`,`scalerate`,`private_corpse`,`unique_spawn_by_name`,
		`underwater`,`isquest`,`emoteid`,`spellscale`,`healscale`
	FROM `npc_types` WHERE `id` = 223171;
Note, you should be specifying the id of the new NPC also.
Reply With Quote
  #6  
Old 07-29-2013, 12:11 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

if you really like variables for no reason (it is a single statement, but I guess you could make a loop or just easier copy/paste), use as appropriate in the above statement:

Code:
SET @CopyFrom = 12345;
SET @CopyTo = 12346;
SET @NewName = 'Bob';
Reply With Quote
  #7  
Old 07-29-2013, 12:52 PM
wolfwalkereci
Discordant
 
Join Date: Dec 2005
Posts: 435
Default

Notepad++ and column edit for those times when you just really really really want to add 1000 new npc to the database!
Reply With Quote
  #8  
Old 07-29-2013, 03:35 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

the ID field in npc_types is auto increment why would you need to specify it unless you really want it to be a certain number.
Reply With Quote
  #9  
Old 07-29-2013, 05:05 PM
xible77
Fire Beetle
 
Join Date: May 2011
Posts: 2
Default

Thank you for all the help.
Reply With Quote
  #10  
Old 07-29-2013, 11:22 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

Quote:
Originally Posted by NatedogEZ View Post
the ID field in npc_types is auto increment why would you need to specify it unless you really want it to be a certain number.
You do not have to, but there is a reason for the design as is. It makes it simpler for people who have no idea what they are doing to keep things organized.
Reply With Quote
  #11  
Old 07-30-2013, 10:01 AM
wolfwalkereci
Discordant
 
Join Date: Dec 2005
Posts: 435
Default

Quote:
Originally Posted by NatedogEZ View Post
the ID field in npc_types is auto increment why would you need to specify it unless you really want it to be a certain number.
Really? I guess you would be the type to enjoy remembering that 999231-999245 go in your starter zone and 999246-999300 go in newb zone one....

Or could just go with the standard established by peq.
Reply With Quote
  #12  
Old 07-30-2013, 10:38 AM
jsr
Hill Giant
 
Join Date: Aug 2008
Location: melbourne
Posts: 187
Default

I think what wolfwalker is trying to say is that he is possessed of intelligence rarely seen in the world, and that NPC's in the PEQ database are numbered with the first 3 digits of the npc_id representing the zone_id that is their home.
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:31 AM.


 

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