TrinityCore/TrinityCore — Issue #4876: [DB/FIX][QUEST] A Forgotten Tale
Author: Valcorb
Created: 2012-01-18 13:17:34+00:00
State: open

http://www.wowhead.com/quest=12301

SAI lines were wrong, he used some kind of spell but it didn't work.
That's why i used type 33.

```sql

-- [QUEST] The Forgotten Tale (12291)
SET @ENTRY_PEASANT := 27226;
SET @ENTRY_RIFLEMAN := 27225;
SET @ENTRY_KNIGHT := 27224;
SET @ENTRY_FOOTMAN := 27229;

-- [SAI] Forgotten Peasant
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY_PEASANT AND `id` IN (0, 1); -- Need to delete 2 ID's, they are incorrect
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY_PEASANT;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`)
VALUES
(@ENTRY_PEASANT, 0, 0, 1, 62, 0, 100, 0, 9541, 0, 0, 0, 33, 27472, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Forgotten Peasant - On Gossip Select - Give Kill Credit'),
(@ENTRY_PEASANT, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Forgotten Peasant - On Gossip Select - Close Gossip');

-- [SAI] Forgotten Rifleman
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY_RIFLEMAN AND `id` IN (0, 1); -- Need to delete 2 ID's, they are incorrect
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY_RIFLEMAN;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`)
VALUES
(@ENTRY_RIFLEMAN, 0, 0, 1, 62, 0, 100, 0, 9543, 0, 0, 0, 33, 27471, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Forgotten Rifleman - On Gossip Select - Give Kill Credit'),
(@ENTRY_RIFLEMAN, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Forgotten Rifleman - On Gossip Select - Close Gossip');

-- [SAI] Forgotten Knight
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY_KNIGHT AND `id` IN (0, 1); -- Need to delete 2 ID's, they are incorrect
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY_KNIGHT;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`)
VALUES
(@ENTRY_KNIGHT, 0, 0, 1, 62, 0, 100, 0, 9544, 0, 0, 0, 33, 27473, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Forgotten Knight - On Gossip Select - Give Kill Credit'),
(@ENTRY_KNIGHT, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Forgotten Knight - On Gossip Select - Close Gossip');

-- [SAI] Forgotten Footman
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY_FOOTMAN AND `id` IN (0, 1); -- Need to delete 2 ID's, they are incorrect
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY_FOOTMAN;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`)
VALUES
(@ENTRY_FOOTMAN, 0, 0, 1, 62, 0, 100, 0, 9545, 0, 0, 0, 33, 27474, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Forgotten Footman - On Gossip Select - Give Kill Credit'),
(@ENTRY_FOOTMAN, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Forgotten Footman - On Gossip Select - Close Gossip');