TrinityCore/TrinityCore — Issue #4512: Remove Redundent EAI Scripts
Author: Svannon
Created: 2011-12-28 05:48:43+00:00
State: open

```sql
-- Remove Redundent EAI Scripts because these are core Scripted
UPDATE `creature_template` SET `AIName`='' WHERE `ScriptName` <>'';
DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (SELECT `entry` FROM `creature_template` WHERE `AIName`='');
```

There are multiple creatures that are core scripted that still have EAI/SAI scripts in the Data Base;
```sql
-- Check for Redundent EAI Scripts
select `entry`,`name`,`AIName`,`ScriptName` from `creature_template` where `AIName`='EventAI' and `ScriptName` <> '';
-- Check for Redundent SAI Scripts
select `entry`,`name`,`AIName`,`ScriptName` from `creature_template` where `AIName`='SmartAI' and `ScriptName` <> '';
```