Question - fixing spells (I used to know this...)

This used to be something relatively easy to do but it’s been a while since I’ve touched SQL and the DB has changed some.

I reported a bug where an NPC is using the wrong spell and was wondering where this information is stored now. Normally for simple bugs like these I like to include a suggested fix or even a PR but I couldn’t find where the bad spell is even being taken from.

Any hints so I can fix this (and maybe future issues)?

What is this “NPC” ? is it a boss, or just a normal creature?

my first guess would be to look in the AI scripts table

Well First you get the NPCs ID. You look it up in DB in creature_template under world. There you must check if NPC is scripted. At the end of template there will be script_name. If there is anything named in there than creature is running on Cpp script. If it doesnt have any data there you must check “AIName”.

Creatures in general have EventAI or SmartAI. If creature is using EventAI you will have to look into “creature_ai_scripts” table in world. Or if it is using SmartAI you will have to look into “smart_scripts”. Once there the “fun” begins. You can try find all info about SAI on wiki. Also to help you work with simple scripting; You could use Event Horizon program. You can find it on this forum. Has nice documentation and simple to work with.

Thanks everyone, it’s been a long time since I’ve looked at the DB side of things.

Incidentally, Aokromes and Rochet2 replied to the bug report. There was a problem with smart_scripts for this NPC.