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

07-28-2013, 06:13 PM
|
Fire Beetle
|
|
Join Date: May 2011
Posts: 2
|
|
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.
|

07-28-2013, 06:47 PM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,603
|
|
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.
|
 |
|
 |

07-28-2013, 11:41 PM
|
 |
Developer
|
|
Join Date: Dec 2012
Posts: 515
|
|
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
;
|
 |
|
 |

07-29-2013, 11:26 AM
|
 |
Discordant
|
|
Join Date: Aug 2010
Location: Colorado
Posts: 410
|
|
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.
|
 |
|
 |

07-29-2013, 12:05 PM
|
Dragon
|
|
Join Date: May 2010
Posts: 965
|
|
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.
|
 |
|
 |

07-29-2013, 12:11 PM
|
Dragon
|
|
Join Date: May 2010
Posts: 965
|
|
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';
|

07-29-2013, 12:52 PM
|
Discordant
|
|
Join Date: Dec 2005
Posts: 435
|
|
Notepad++ and column edit for those times when you just really really really want to add 1000 new npc to the database!
|

07-29-2013, 03:35 PM
|
 |
Developer
|
|
Join Date: Dec 2012
Posts: 515
|
|
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.
|

07-29-2013, 05:05 PM
|
Fire Beetle
|
|
Join Date: May 2011
Posts: 2
|
|
Thank you for all the help.
|

07-29-2013, 11:22 PM
|
Dragon
|
|
Join Date: May 2010
Posts: 965
|
|
Quote:
Originally Posted by NatedogEZ
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.
|

07-30-2013, 10:01 AM
|
Discordant
|
|
Join Date: Dec 2005
Posts: 435
|
|
Quote:
Originally Posted by NatedogEZ
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.
|

07-30-2013, 10:38 AM
|
Hill Giant
|
|
Join Date: Aug 2008
Location: melbourne
Posts: 187
|
|
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.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 05:26 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |