trickerer / Trinity-Bots

NPCBots for TrinityCore and AzerothCore 3.3.5
https://github.com/trickerer/TrinityCore-3.3.5-with-NPCBots/
465 stars 155 forks source link

Deleting newly created and corrupted Bot Entries (7080x) #305

Closed HerrDave closed 1 year ago

HerrDave commented 1 year ago

Howdy folks

I've been playing on a WoW Repack lately This one -> https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-emulator-servers/wow-emu-general-releases/976782-azerothcore-wrath-of-lich-king-single-player-repack.html Your mod is one of the highlighted features of the repack, so I figured I'd come to you for assistance.

I've been trying to fiddle with it to create an NPC hireling of an old friend, but I've hit a few nasty bumps. 1 - When I used (.npcbot createnew Edwin 1 1 0 7 11 5 0 4 1) I somehow ended up with an Ogre Warrior instead of a Human Warrior. 2 - Searching around for how to delete messed up Bot entries (70800) I found basically nothing, but a line I recognized from HeidiSQL came up: "Creature_template" 3 - So I used (.npcbot delete) to remove the Ogre NPC, opened HeidiSQL and deleted the 70800 entry (Right-click, delete selected row) and restarted the server. 4 - Experimentally I tried to summon him again to make sure he was gone, and it said "missing character/class data for bla" instead of "bla does not exist!" (great) 5 - I manually recreated the line in HeidiSQL and tried to spawn him again, it said he already existed in the world (huh?) 6 - I typed .npcbot move 70800, and the server crashed

So uh-- now that I've managed to surround myself with blue Ogres and set my server on fire, I suppose it's time to cave and ask you guys for help

trickerer commented 1 year ago

What you need to do in your situation is create the bot again. Use .npcbot createnew Edwin 1 1 0 7 11 5 0 4 2, make sure it is creature_template entry 70800, then restart the server. After that, spawn the bot again.

trickerer commented 1 year ago

If you run into errors about duplicated entry and transaction aborted, use this SQL script:

DROP TEMPORARY TABLE IF EXISTS creature_template_temp_npcbot_create;
CREATE TEMPORARY TABLE creature_template_temp_npcbot_create ENGINE=MEMORY SELECT * FROM creature_template WHERE entry = (SELECT entry FROM creature_template_npcbot_extras WHERE class = 1 LIMIT 1);
UPDATE creature_template_temp_npcbot_create SET entry = 70800, name = "Edwin", modelid1 = 1492;
INSERT INTO creature_template SELECT * FROM creature_template_temp_npcbot_create;
DROP TEMPORARY TABLE creature_template_temp_npcbot_create;

then restart the server and spawn the bot

HerrDave commented 1 year ago

I left the server up overnight, but when I tried to join it this morning it wouldn't connect (odd) Restarted it, and the move npc command no longer crashes it, but he's still an Ogre (Not sure how to delete the entry)

I'm now up to entry 70808, but changing that last number to 2 worked - this new one's human! :D

I'm baffled as to why that worked though: I thought the numbers were in this order: .createnew (Bot'sName) (Class) (Race) (Gender) (Skin) (Face) (Hairstyle) (Haircolor) (Features) (Soundset(Voice?)

How would I go about deleting the older entries, 70800-70807, so I can reuse the slots for other custom bots? Or are those permanently a bunch of Ogres? OgreAgain

trickerer commented 1 year ago

Read carefully the Database section of README, there it is explained how to modify/delete static bot data

The initial problem was me screwing up those model ids for voices. Instead of 3192 it must be 1492. See the refered commit for full chanelist

HerrDave commented 1 year ago

Thanks man :)

I read it carefully and followed it step-by-step

Going to go to bed and tell you how it went in the morning

HerrDave commented 1 year ago

Worked perfectly!

Thanks for the help, trickerer!