EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Creating NPC Error (https://www.eqemulator.org/forums/showthread.php?t=37110)

xible77 07-28-2013 06:13 PM

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.

Kingly_Krab 07-28-2013 06:47 PM

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.

NatedogEZ 07-28-2013 11:41 PM

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
;


Nightrider84 07-29-2013 11:26 AM

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.

sorvani 07-29-2013 12:05 PM

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.

sorvani 07-29-2013 12:11 PM

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';


wolfwalkereci 07-29-2013 12:52 PM

Notepad++ and column edit for those times when you just really really really want to add 1000 new npc to the database!

NatedogEZ 07-29-2013 03:35 PM

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.

xible77 07-29-2013 05:05 PM

Thank you for all the help.

sorvani 07-29-2013 11:22 PM

Quote:

Originally Posted by NatedogEZ (Post 222870)
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.

wolfwalkereci 07-30-2013 10:01 AM

Quote:

Originally Posted by NatedogEZ (Post 222870)
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.

jsr 07-30-2013 10:38 AM

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.


All times are GMT -4. The time now is 10:46 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.