Trinitycore: DB/Quest: It Goes to 11...

Created on 19 Jun 2012  路  39Comments  路  Source: TrinityCore/TrinityCore

The quest It Goes to 11 (http://www.wowhead.com/quest=11421) in Howling Fjord is bugged.

How it should work :

Use the item in your bag [Harpoon Control Mechanism] and you should "mount" the harpoon changing your UI with 2 possible attacks.

Use the attacks to target and destroy the buildings and kill the Dragonflayer Defenders.

How it does work :

Using the item in front of a harpoon gun does not give you control over it making it impossible to complete the quest.

On rev : 225d264 TDB 11.47+

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Comp-Database Feedback-FixOutdatedMissingWIP Sub-Quests

Most helpful comment

After tweaking some of the SQL to make it compatible with the current DB schema, I've tested it and this works quite well now and the quest (11421) can be completed. Thank you @Rushor for the script.

I've taken the liberty of adding a few more Defender spawns in the SAI Actionlist script.

Here's my adapted SQL:

DELETE FROM `creature_text` WHERE `creatureid` = 27992;
INSERT INTO `creature_text` (`creatureid`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `TextRange`, `comment`) VALUES 
(27992, 0, 0, 'The longhouse is destroyed! Alarms can be heard in the distance.', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...'),
(27992, 1, 0, 'Direct hit on the Dockhouse! Dragonflyer Defenders have been alerted!', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...'),
(27992, 2, 0, 'The Vrykul Storage facility is up in flames! Dragonflyer Defenders have been alerted!', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...');

UPDATE creature SET spawndist=0, MovementType=0 WHERE id=24701;
DELETE FROM creature_addon WHERE guid IN(SELECT guid FROM creature WHERE id IN(27992, 27993));
DELETE FROM creature WHERE id IN(27992, 27993);
UPDATE `creature_template` SET `speed_walk`='0.001', `speed_run`='0.001' WHERE  `entry`=27992;
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES (1976229, 27992, 571, 1, 1, 0, 0, 925.647, -5299.53, 175.687, 1.90241, 300, 0, 0, 26946, 0, 0, 0, 0, 0);
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES (1976228, 27992, 571, 1, 1, 0, 0, 994.286, -5312, 175.674, 1.18682, 300, 0, 0, 26946, 0, 0, 0, 0, 0);
UPDATE `creature` SET `phasemask` = 169 WHERE `guid` IN (1976229, 1976228);
UPDATE creature_template SET unit_flags=4 WHERE entry IN(27992, 27993);
DELETE FROM `creature_template_spell` WHERE `CreatureID` IN (27992, 27993);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27992, 0, 43986, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27992, 1, 43997, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27993, 0, 43986, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27993, 1, 43997, 12340);

-- Vrykul Harpoon Gun SAI
SET @ENTRY := 27992;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,25,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Reset - Stop Attacking"),
(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Reset - Disable Combat Movement"),
(@ENTRY,0,2,5,38,0,100,0,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 1 - Say Line 0"),
(@ENTRY,0,3,5,38,0,100,0,1,2,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 2 - Say Line 1"),
(@ENTRY,0,4,5,38,0,100,0,1,3,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 3 - Say Line 2"),
(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 0 0 - Run Script"),
(@ENTRY,0,6,0,31,0,100,0,43997,0,0,0,11,43998,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Target Spellhit 'Fiery Lance' - Cast 'Fiery Lance'");

-- Actionlist SAI
SET @ENTRY := 2799200;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
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,9,0,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,970,-5250,195,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,1,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,978,-5272,204,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,2,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,956,-5267,198,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,3,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,965,-5241,189,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,4,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,948,-5247,200,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,5,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,920,-5251,193,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,6,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,928,-5269,206,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,7,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,906,-5263,196,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,8,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,915,-5238,187,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,9,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,898,-5245,202,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'");

UPDATE creature_template SET AIName='SmartAI' WHERE entry=24533;
DELETE FROM `creature_template_addon` WHERE `entry` = 24533;
INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES (24533, 0, 22657, 50331648, 1, 0, '');
-- Dragonflayer Defender SAI
SET @ENTRY := 24533;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,0,0,0,100,0,500,500,1500,1500,11,44188,0,0,0,0,0,2,0,0,0,0,0,0,0,"Dragonflayer Defender - In Combat - Cast 'Harpoon Toss'"),
(@ENTRY,0,1,2,8,0,100,0,43997,0,0,0,33,24533,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Defender - On Spellhit 'Fiery Lance' - Quest Credit ''"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Defender - On Spellhit - Kill Self");

DELETE FROM `creature_template_movement` WHERE `CreatureId` = 24533;
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`) VALUES 
(24533, 0, 0, 1, 0);

DELETE FROM creature WHERE id=24533;
UPDATE creature_template SET flags_extra=130, AIName='SmartAI' WHERE entry IN(24538, 24646, 24647);

-- Dragonflayer Installation I SAI
SET @ENTRY := 24538;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24538,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit - Set Data 1 1"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

-- Dragonflayer Installation II SAI
SET @ENTRY := 24646;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24646,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,2,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit - Set Data 1 2"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

-- Dragonflayer Installation III SAI
SET @ENTRY := 24647;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24647,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,3,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit - Set Data 1 3"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry IN(43986, 43990);
INSERT INTO conditions VALUES (13, 1, 43986, 0, 0, 31, 0, 3, 24538, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43986, 0, 1, 31, 0, 3, 24646, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43986, 0, 2, 31, 0, 3, 24647, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 0, 31, 0, 3, 24538, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 1, 31, 0, 3, 24646, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 2, 31, 0, 3, 24647, 0, 0, 0, 0, '', 'Target Quest Trigger');
DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry IN(50331);
INSERT INTO conditions VALUES (13, 1, 50331, 0, 0, 31, 0, 3, 27992, 0, 0, 0, 0, '', 'Target Valkry Harpoon Gun');
INSERT INTO conditions VALUES (13, 1, 50331, 0, 1, 31, 0, 3, 27993, 0, 0, 0, 0, '', 'Target Valkry Harpoon Gun');

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=43997;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,43997,0,0,31,0,3,24533,0,0,0,0,"","Fiery Lance only targets Dragonflayer Defender");

All 39 comments

confirm. Even with fixed conditions there is no scripted event (mobs, triggers, texts)

confirm 634b364

confirm
Core: a65caa6da2d6090ca23018706029f3a96a035b55
TDB: 49+

confirm quest is not working latest Db and rev

No

Still dont work
rev. a4b62d873fc797bdd9dc29ac7f086a815ba50c37
last db

I found this, I hope it helps.
I can't make to mount de Harpoon Gun when using item quest. If someone could make that, maybe i could continue with the rest.

-- http://www.wowhead.com/npc=27993 -- Vrykul Harpoon Gun
-- http://www.wowhead.com/npc=24701 -- Large Vrykul Harpoon Gun
-- http://www.wowhead.com/spell=44213 -- Fiery Harpoon (spell 1 del arp贸n)
-- http://www.wowhead.com/spell=43997 -- Fiery Lance (spell 2 del arp贸n)
-- http://www.wowhead.com/spell=50331 -- Vrykul Harpoon Control (spell del item)
-- http://www.wowhead.com/npc=24533 -- Dragonflayer Defender
-- http://www.wowhead.com/npc=24538 -- Dragonflayer Installation 1
-- http://www.wowhead.com/npc=24646 -- Dragonflayer Installation 2
-- http://www.wowhead.com/npc=24647 -- Dragonflayer Installation 3
-- http://www.wowhead.com/spell=43990 -- Fiery Harpoon (required spellcast, en la quest)
-- http://www.wowhead.com/spell=44091 -- Kill Credit (Dragonflayer Defender)
-- http://www.wowhead.com/spell=44092 -- Kill Credit (Dragonflayer Installation I)
-- http://www.wowhead.com/spell=44128 -- Kill Credit (Dragonflayer Installation II)
-- http://www.wowhead.com/spell=44129 -- Kill Credit (Dragonflayer Installation III)
-- http://www.wowhead.com/spell=44093 -- QC 驴?
-- http://www.wowhead.com/spell=44095 -- QC 驴?
-- http://www.wowhead.com/spell=44126 -- QC 驴?
-- http://www.wowhead.com/spell=44127 -- QC 驴?

Confirmed

Confirmed.
I just tested this quest an appear to be not working.
When you accept the quest, questgiver give you the item Harpoon Control Mechanism. When you use the item you get buff Vrykul Harpoon Control, but that's it. You can't control any harpoon and you't can finish quest requirements.

Quest Giver: Lieutenant Icehammer
Quest: It Goes to 11...

Trinity Core: 8197da7
Database: TDB_full_335.57_2014_10_19 + updates to the core above.

Regards.

Still an issue a08611dfefc60d9092b7c36c7553a41ed04be187

If anyone wanna fix it i can supply sniff for it.

I'd take a stab at it if I can get sniff data for it.

@aokromes ^

@Aokromes If I can be provided a sniff for this, I'll try to fix it.

@Silvertower : I recommend joining the TC IRC channel #trinity @ irc.rizon.net and talk with him.
(https://trinitycore.atlassian.net/wiki/display/tc/IRC)

any news?

Confirmed, on latest TDB.

@MehdiAria : Please add your core revision hash in your comment, so we are able to see when you confirmed this issue at a later date.
"on latest TDB." only means TDB 335.62 (any time between 2016-10-16 and now) and does not help us to know
which core revision you are using (see it as a "time stamp" for tracking which release users report on in the TC issue tracker).

@Aokromes Provide a fix, please:)

6490408d4ef5 still broken

... and it will stay that way until someone decides to write a script for it.

True. I see now that my comment was poorly chosen. I did not mean to blame anyone. I tried looking into how to write a script, but I tend to get distracted with other stuff, so my comment came out of despair of not finding out how to make it work.

Fix for Vrykul Harpoon Gun (27992):

UPDATE `creature_template` SET `unit_flags`=`unit_flags`|4, `spell1`=43986, `spell2`=43997, `AIName`='SmartAI' WHERE `entry`=27992;

Forgot about the condition :)

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=50331;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,50331,0,0,31,0,3,27992,0,0,0,0,'', 'Target Valkry Harpoon Gun');

Looks OK to me, but I would like to see the word "Valkry" in the comment corrected to Valkyr just to avoid confusion.
( 'Target Valkyr Harpoon Gun' )


edit: Oh, and BTW, not sure if it makes any difference, maybe combine the SQL queries into 1 code block?
(or maybe the TC member who commits the solution will just combine them as they are)

Anyone tested if it works with the suggested DB update from @Sorikoff yet?

UPDATE `creature_template` SET `unit_flags`=`unit_flags`|4, `spell1`=43986, `spell2`=43997, `AIName`='SmartAI' WHERE `entry`=27992;

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=50331;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,50331,0,0,31,0,3,27992,0,0,0,0,'', 'spell Vrykul Harpoon Control targets Vrykul Harpoon Gun');

(corrected the name "Valkry" from the suggested condition SQL above to "Vrykul")

The SQL needed some fixing up to apply to the current DB:

UPDATE `creature_template` SET `unit_flags`=`unit_flags`|4, `AIName`='SmartAI' WHERE `entry`=27992;

DELETE FROM `creature_template_spell` WHERE `CreatureID` = 27992;
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27992, 0, 43986, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27992, 1, 43997, 12340);

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=50331;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,50331,0,0,31,0,3,27992,0,0,0,0,'', 'spell Vrykul Harpoon Control targets Vrykul Harpoon Gun');

I've tested this and it now results in "No Target" error whenever the quest item is used next to the harpoon gun. So it does not quite work just yet unfortunately.

Hmm. Oh well. Thanks for the testing and feedback. Could there be a missing GameObject or too short spell distance in this case?

I have a follow-up.

UPDATE `creature_template` SET `unit_flags`=`unit_flags`|4, `AIName`='SmartAI' WHERE `entry` IN (27992, 27993);

DELETE FROM `creature_template_spell` WHERE `CreatureID` IN (27992, 27993);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27992, 0, 43986, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27992, 1, 43997, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27993, 0, 43986, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27993, 1, 43997, 12340);

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=50331;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,50331,0,0,31,0,3,27992,0,0,0,0,'', 'spell Vrykul Harpoon Control targets Vrykul Harpoon Gun #27992');
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,50331,0,1,31,0,3,27993,0,0,0,0,'', 'spell Vrykul Harpoon Control targets Vrykul Harpoon Gun #27993');

There are two different creature entries for the harpoon guns. With the above SQL, players will be properly mounted into the guns and have the two abilities.

However, the quest can still not be completed. There are no Defender spawns, and the buildings cannot be destroyed.

DELETE FROM `creature_text` WHERE `creatureid` = 27992;
INSERT INTO `creature_text` (`creatureid`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `TextRange`, `comment`) VALUES 
(27992, 0, 0, 'The longhouse is destroyed! Alarms can be heard in the distance.', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...'),
(27992, 1, 0, 'Direct hit on the Dockhouse! Dragonflyer Defenders have been alerted!', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...'),
(27992, 2, 0, 'The Vrykul Storage facility is up in flames! Dragonflyer Defenders have been alerted!', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...');

UPDATE creature SET spawndist=0, MovementType=0 WHERE id=24701;
DELETE FROM creature_addon WHERE guid IN(SELECT guid FROM creature WHERE id IN(27992, 27993));
DELETE FROM creature WHERE id IN(27992, 27993);
UPDATE `creature_template` SET `speed_walk`='0.001', `speed_run`='0.001' WHERE  `entry`=27992;
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES (1976229, 27992, 571, 1, 1, 0, 0, 925.647, -5299.53, 175.687, 1.90241, 300, 0, 0, 26946, 0, 0, 0, 0, 0);
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES (1976228, 27992, 571, 1, 1, 0, 0, 994.286, -5312, 175.674, 1.18682, 300, 0, 0, 26946, 0, 0, 0, 0, 0);
UPDATE `creature` SET `phaseid` = 169 WHERE `guid` IN (1976229, 1976228);
UPDATE creature_template SET unit_flags=4, spell1=43986, spell2=43997, AIName='SmartAI' WHERE entry IN(27992, 27993);
-- Vrykul Harpoon Gun SAI
SET @ENTRY := 27992;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,25,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Reset - Stop Attacking"),
(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Reset - Disable Combat Movement"),
(@ENTRY,0,2,5,38,0,100,0,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 1 - Say Line 0"),
(@ENTRY,0,3,5,38,0,100,0,1,2,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 2 - Say Line 1"),
(@ENTRY,0,4,5,38,0,100,0,1,3,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 3 - Say Line 2"),
(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 0 0 - Run Script"),
(@ENTRY,0,6,0,31,0,100,0,43997,0,0,0,11,43998,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Target Spellhit 'Fiery Lance' - Cast 'Fiery Lance'");

-- Actionlist SAI
SET @ENTRY := 2799200;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
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,9,0,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,970,-5250,195,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,1,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,978,-5272,204,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,2,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,956,-5267,198,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,3,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,965,-5241,189,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'");

UPDATE creature_template SET AIName='SmartAI' WHERE entry=24533;
DELETE FROM `creature_template_addon` WHERE `entry` = 24533;
INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES (24533, 0, 22657, 50331648, 1, 0, '');
-- Dragonflayer Defender SAI
SET @ENTRY := 24533;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,0,0,0,100,0,500,500,1500,1500,11,44188,0,0,0,0,0,2,0,0,0,0,0,0,0,"Dragonflayer Defender - In Combat - Cast 'Harpoon Toss'"),
(@ENTRY,0,1,2,8,0,100,0,43997,0,0,0,33,24533,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Defender - On Spellhit 'Fiery Lance' - Quest Credit ''"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Defender - On Spellhit - Kill Self");

DELETE FROM `creature_template_movement` WHERE `CreatureId` = 24533;
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`) VALUES 
(24533, 0, 0, 1, 0);

DELETE FROM creature WHERE id=24533;
UPDATE creature_template SET flags_extra=130, AIName='SmartAI' WHERE entry IN(24538, 24646, 24647);

-- Dragonflayer Installation I SAI
SET @ENTRY := 24538;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24538,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit - Set Data 1 1"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

-- Dragonflayer Installation II SAI
SET @ENTRY := 24646;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24646,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,2,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit - Set Data 1 2"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

-- Dragonflayer Installation III SAI
SET @ENTRY := 24647;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24647,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,3,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit - Set Data 1 3"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry IN(43986, 43990);
INSERT INTO conditions VALUES (13, 1, 43986, 0, 0, 31, 0, 3, 24538, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43986, 0, 1, 31, 0, 3, 24646, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43986, 0, 2, 31, 0, 3, 24647, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 0, 31, 0, 3, 24538, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 1, 31, 0, 3, 24646, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 2, 31, 0, 3, 24647, 0, 0, 0, 0, '', 'Target Quest Trigger');
DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry IN(50331);
INSERT INTO conditions VALUES (13, 1, 50331, 0, 0, 31, 0, 3, 27992, 0, 0, 0, 0, '', 'Target Valkry Harpoon Gun');
INSERT INTO conditions VALUES (13, 1, 50331, 0, 1, 31, 0, 3, 27993, 0, 0, 0, 0, '', 'Target Valkry Harpoon Gun');

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=43997;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,43997,0,0,31,0,3,24533,0,0,0,0,"","Fiery Lance only targets Dragonflayer Defender");

馃憤 Thank you for adding the MarkDown syntax highlighting. Makes it easier to read the SQL syntax (and also decreases my OCD feelings, thank you 馃槈 ) .

After tweaking some of the SQL to make it compatible with the current DB schema, I've tested it and this works quite well now and the quest (11421) can be completed. Thank you @Rushor for the script.

I've taken the liberty of adding a few more Defender spawns in the SAI Actionlist script.

Here's my adapted SQL:

DELETE FROM `creature_text` WHERE `creatureid` = 27992;
INSERT INTO `creature_text` (`creatureid`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `TextRange`, `comment`) VALUES 
(27992, 0, 0, 'The longhouse is destroyed! Alarms can be heard in the distance.', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...'),
(27992, 1, 0, 'Direct hit on the Dockhouse! Dragonflyer Defenders have been alerted!', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...'),
(27992, 2, 0, 'The Vrykul Storage facility is up in flames! Dragonflyer Defenders have been alerted!', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...');

UPDATE creature SET spawndist=0, MovementType=0 WHERE id=24701;
DELETE FROM creature_addon WHERE guid IN(SELECT guid FROM creature WHERE id IN(27992, 27993));
DELETE FROM creature WHERE id IN(27992, 27993);
UPDATE `creature_template` SET `speed_walk`='0.001', `speed_run`='0.001' WHERE  `entry`=27992;
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES (1976229, 27992, 571, 1, 1, 0, 0, 925.647, -5299.53, 175.687, 1.90241, 300, 0, 0, 26946, 0, 0, 0, 0, 0);
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES (1976228, 27992, 571, 1, 1, 0, 0, 994.286, -5312, 175.674, 1.18682, 300, 0, 0, 26946, 0, 0, 0, 0, 0);
UPDATE `creature` SET `phasemask` = 169 WHERE `guid` IN (1976229, 1976228);
UPDATE creature_template SET unit_flags=4 WHERE entry IN(27992, 27993);
DELETE FROM `creature_template_spell` WHERE `CreatureID` IN (27992, 27993);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27992, 0, 43986, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27992, 1, 43997, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27993, 0, 43986, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27993, 1, 43997, 12340);

-- Vrykul Harpoon Gun SAI
SET @ENTRY := 27992;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,25,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Reset - Stop Attacking"),
(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Reset - Disable Combat Movement"),
(@ENTRY,0,2,5,38,0,100,0,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 1 - Say Line 0"),
(@ENTRY,0,3,5,38,0,100,0,1,2,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 2 - Say Line 1"),
(@ENTRY,0,4,5,38,0,100,0,1,3,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 3 - Say Line 2"),
(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 0 0 - Run Script"),
(@ENTRY,0,6,0,31,0,100,0,43997,0,0,0,11,43998,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Target Spellhit 'Fiery Lance' - Cast 'Fiery Lance'");

-- Actionlist SAI
SET @ENTRY := 2799200;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
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,9,0,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,970,-5250,195,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,1,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,978,-5272,204,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,2,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,956,-5267,198,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,3,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,965,-5241,189,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,4,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,948,-5247,200,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,5,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,920,-5251,193,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,6,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,928,-5269,206,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,7,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,906,-5263,196,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,8,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,915,-5238,187,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,9,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,898,-5245,202,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'");

UPDATE creature_template SET AIName='SmartAI' WHERE entry=24533;
DELETE FROM `creature_template_addon` WHERE `entry` = 24533;
INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES (24533, 0, 22657, 50331648, 1, 0, '');
-- Dragonflayer Defender SAI
SET @ENTRY := 24533;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,0,0,0,100,0,500,500,1500,1500,11,44188,0,0,0,0,0,2,0,0,0,0,0,0,0,"Dragonflayer Defender - In Combat - Cast 'Harpoon Toss'"),
(@ENTRY,0,1,2,8,0,100,0,43997,0,0,0,33,24533,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Defender - On Spellhit 'Fiery Lance' - Quest Credit ''"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Defender - On Spellhit - Kill Self");

DELETE FROM `creature_template_movement` WHERE `CreatureId` = 24533;
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`) VALUES 
(24533, 0, 0, 1, 0);

DELETE FROM creature WHERE id=24533;
UPDATE creature_template SET flags_extra=130, AIName='SmartAI' WHERE entry IN(24538, 24646, 24647);

-- Dragonflayer Installation I SAI
SET @ENTRY := 24538;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24538,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit - Set Data 1 1"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

-- Dragonflayer Installation II SAI
SET @ENTRY := 24646;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24646,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,2,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit - Set Data 1 2"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

-- Dragonflayer Installation III SAI
SET @ENTRY := 24647;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24647,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,3,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit - Set Data 1 3"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry IN(43986, 43990);
INSERT INTO conditions VALUES (13, 1, 43986, 0, 0, 31, 0, 3, 24538, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43986, 0, 1, 31, 0, 3, 24646, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43986, 0, 2, 31, 0, 3, 24647, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 0, 31, 0, 3, 24538, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 1, 31, 0, 3, 24646, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 2, 31, 0, 3, 24647, 0, 0, 0, 0, '', 'Target Quest Trigger');
DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry IN(50331);
INSERT INTO conditions VALUES (13, 1, 50331, 0, 0, 31, 0, 3, 27992, 0, 0, 0, 0, '', 'Target Valkry Harpoon Gun');
INSERT INTO conditions VALUES (13, 1, 50331, 0, 1, 31, 0, 3, 27993, 0, 0, 0, 0, '', 'Target Valkry Harpoon Gun');

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=43997;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,43997,0,0,31,0,3,24533,0,0,0,0,"","Fiery Lance only targets Dragonflayer Defender");

@Killyana : Is this still considered WIP? If not, do we need a PR for it?

we don't PR sql only fixes.

Yes it's a wip, spawns are correct in TC there's 27992 and 27993, also there's many "hacks" like the target: 19,27992,1000

Alright, thanks for clearing that up. @Aokromes, @Killyana

Colum in table creature changed from spawndist to wander_distance so the fix is:

DELETE FROM `creature_text` WHERE `creatureid` = 27992;
INSERT INTO `creature_text` (`creatureid`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `TextRange`, `comment`) VALUES 
(27992, 0, 0, 'The longhouse is destroyed! Alarms can be heard in the distance.', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...'),
(27992, 1, 0, 'Direct hit on the Dockhouse! Dragonflyer Defenders have been alerted!', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...'),
(27992, 2, 0, 'The Vrykul Storage facility is up in flames! Dragonflyer Defenders have been alerted!', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...');

UPDATE creature SET wander_distance=0, MovementType=0 WHERE id=24701;
DELETE FROM creature_addon WHERE guid IN(SELECT guid FROM creature WHERE id IN(27992, 27993));
DELETE FROM creature WHERE id IN(27992, 27993);
UPDATE `creature_template` SET `speed_walk`='0.001', `speed_run`='0.001' WHERE  `entry`=27992;
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES (1976229, 27992, 571, 1, 1, 0, 0, 925.647, -5299.53, 175.687, 1.90241, 300, 0, 0, 26946, 0, 0, 0, 0, 0);
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES (1976228, 27992, 571, 1, 1, 0, 0, 994.286, -5312, 175.674, 1.18682, 300, 0, 0, 26946, 0, 0, 0, 0, 0);
UPDATE `creature` SET `phasemask` = 169 WHERE `guid` IN (1976229, 1976228);
UPDATE creature_template SET unit_flags=4 WHERE entry IN(27992, 27993);
DELETE FROM `creature_template_spell` WHERE `CreatureID` IN (27992, 27993);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27992, 0, 43986, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27992, 1, 43997, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27993, 0, 43986, 12340);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES (27993, 1, 43997, 12340);

-- Vrykul Harpoon Gun SAI
SET @ENTRY := 27992;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,25,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Reset - Stop Attacking"),
(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Reset - Disable Combat Movement"),
(@ENTRY,0,2,5,38,0,100,0,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 1 - Say Line 0"),
(@ENTRY,0,3,5,38,0,100,0,1,2,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 2 - Say Line 1"),
(@ENTRY,0,4,5,38,0,100,0,1,3,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 1 3 - Say Line 2"),
(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Data Set 0 0 - Run Script"),
(@ENTRY,0,6,0,31,0,100,0,43997,0,0,0,11,43998,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Target Spellhit 'Fiery Lance' - Cast 'Fiery Lance'");

-- Actionlist SAI
SET @ENTRY := 2799200;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
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,9,0,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,970,-5250,195,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,1,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,978,-5272,204,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,2,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,956,-5267,198,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,3,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,965,-5241,189,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,4,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,948,-5247,200,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,5,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,920,-5251,193,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,6,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,928,-5269,206,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,7,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,906,-5263,196,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,8,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,915,-5238,187,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'"),
(@ENTRY,9,9,0,0,0,100,0,3000,3000,0,0,12,24533,4,60000,0,1,0,8,0,0,0,898,-5245,202,4.5,"Vrykul Harpoon Gun - On Script - Summon Creature 'Dragonflayer Defender'");

UPDATE creature_template SET AIName='SmartAI' WHERE entry=24533;
DELETE FROM `creature_template_addon` WHERE `entry` = 24533;
INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES (24533, 0, 22657, 50331648, 1, 0, '');
-- Dragonflayer Defender SAI
SET @ENTRY := 24533;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,0,0,0,100,0,500,500,1500,1500,11,44188,0,0,0,0,0,2,0,0,0,0,0,0,0,"Dragonflayer Defender - In Combat - Cast 'Harpoon Toss'"),
(@ENTRY,0,1,2,8,0,100,0,43997,0,0,0,33,24533,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Defender - On Spellhit 'Fiery Lance' - Quest Credit ''"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Defender - On Spellhit - Kill Self");

DELETE FROM `creature_template_movement` WHERE `CreatureId` = 24533;
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`) VALUES 
(24533, 0, 0, 1, 0);

DELETE FROM creature WHERE id=24533;
UPDATE creature_template SET flags_extra=130, AIName='SmartAI' WHERE entry IN(24538, 24646, 24647);

-- Dragonflayer Installation I SAI
SET @ENTRY := 24538;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24538,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit - Set Data 1 1"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

-- Dragonflayer Installation II SAI
SET @ENTRY := 24646;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24646,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,2,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit - Set Data 1 2"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

-- Dragonflayer Installation III SAI
SET @ENTRY := 24647;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
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,0,0,1,8,0,100,0,43990,0,0,0,33,24647,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit 'Fiery Harpoon' - Quest Credit ''"),
(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,3,0,0,0,0,19,27992,1000,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit - Set Data 1 3"),
(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry IN(43986, 43990);
INSERT INTO conditions VALUES (13, 1, 43986, 0, 0, 31, 0, 3, 24538, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43986, 0, 1, 31, 0, 3, 24646, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43986, 0, 2, 31, 0, 3, 24647, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 0, 31, 0, 3, 24538, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 1, 31, 0, 3, 24646, 0, 0, 0, 0, '', 'Target Quest Trigger');
INSERT INTO conditions VALUES (13, 1, 43990, 0, 2, 31, 0, 3, 24647, 0, 0, 0, 0, '', 'Target Quest Trigger');
DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry IN(50331);
INSERT INTO conditions VALUES (13, 1, 50331, 0, 0, 31, 0, 3, 27992, 0, 0, 0, 0, '', 'Target Valkry Harpoon Gun');
INSERT INTO conditions VALUES (13, 1, 50331, 0, 1, 31, 0, 3, 27993, 0, 0, 0, 0, '', 'Target Valkry Harpoon Gun');

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=43997;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,43997,0,0,31,0,3,24533,0,0,0,0,"","Fiery Lance only targets Dragonflayer Defender");

This is a clean-up of the SQL above, making typo corrections, merging queries where the arguments are the same, added missing backticks around column names, added as many replacement variables as I could, adjusted some queries to adhere to TC codestyle, and so on. My view is that it is always possible to use multiple variables in parallel, making it easier to read what is going on in the query, as well as keeping the rows more tidy.

_I have not tested the SQL_ , _so please beware of possible issues_ .

You want to review, check and test it before use.

-- Vrykul Harpoon Gun
SET @VHG1 := 27992;
SET @VHG2 := 27993;

DELETE FROM `creature_text` WHERE `creatureid` = @VHG1;
INSERT INTO `creature_text` (`creatureid`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `TextRange`, `comment`) VALUES
(@VHG1, 0, 0, 'The longhouse is destroyed! Alarms can be heard in the distance.', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...'),
(@VHG1, 1, 0, 'Direct hit on the Dockhouse! Dragonflyer Defenders have been alerted!', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...'),
(@VHG1, 2, 0, 'The Vrykul Storage facility is up in flames! Dragonflyer Defenders have been alerted!', 41, 0, 100, 0, 0, 0, 2, 'It Goes to 11...');

UPDATE `creature` SET `wander_distance`= 0, `MovementType`= 0 WHERE `id`= 24701;
UPDATE `creature` SET `phasemask` = 169 WHERE `guid` IN (1976229, 1976228);

DELETE FROM `creature` WHERE `id` IN (24533, @VHG1, @VHG2);
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
(1976229, @VHG1, 571, 1, 1, 0, 0, 925.647, -5299.53, 175.687, 1.90241, 300, 0, 0, 26946, 0, 0, 0, 0, 0),
(1976228, @VHG1, 571, 1, 1, 0, 0, 994.286, -5312,    175.674, 1.18682, 300, 0, 0, 26946, 0, 0, 0, 0, 0);

DELETE FROM `creature_addon` WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id` IN (@VHG1, @VHG2));

UPDATE `creature_template` SET `speed_walk`= 0.001, `speed_run`= 0.001 WHERE `entry`= @VHG1;
UPDATE `creature_template` SET `unit_flags`= 4 WHERE `entry` IN (@VHG1, @VHG2);

-- Spells
SET @FH1 := 43986;
SET @FH2 := 43990;
SET @FiL := 43997;

DELETE FROM `creature_template_spell` WHERE `CreatureID` IN (@VHG1, @VHG2);
INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES
(@VHG1, 0, @FH1, 12340),
(@VHG1, 1, @FiL, 12340),
(@VHG2, 0, @FH1, 12340),
(@VHG2, 1, @FiL, 12340);

-- Vrykul Harpoon Gun SAI
SET @VHG1 := 27992;

UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= @VHG1;

DELETE FROM `smart_scripts` WHERE `entryorguid`= @VHG1 AND `source_type`= 0;
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
(@VHG1,0,0,1,25,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vrykul Harpoon Gun - On Reset - Stop Attacking'),
(@VHG1,0,1,0,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vrykul Harpoon Gun - On Reset - Disable Combat Movement'),
(@VHG1,0,2,5,38,0,100,0,1,1,0,0, 1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vrykul Harpoon Gun - On Data Set 1 1 - Say Line 0'),
(@VHG1,0,3,5,38,0,100,0,1,2,0,0, 1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vrykul Harpoon Gun - On Data Set 1 2 - Say Line 1'),
(@VHG1,0,4,5,38,0,100,0,1,3,0,0, 1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vrykul Harpoon Gun - On Data Set 1 3 - Say Line 2'),
(@VHG1,0,5,0,61,0,100,0,0,0,0,0,80,@VHG1*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Vrykul Harpoon Gun - On Data Set 0 0 - Run Script'),
(@VHG1,0,6,0,31,0,100,0,@FiL,0,0,0,11,43998,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vrykul Harpoon Gun - On Target Spellhit 'Fiery Lance' - Cast 'Fiery Lance'");

-- Dragonflayer Defender SAI
SET @DDEF := 24533;

UPDATE `creature_template` SET `AIName`= "SmartAI" WHERE `entry`= @DDEF;

DELETE FROM `smart_scripts` WHERE `entryorguid`= @DDEF AND `source_type`= 0;
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
(@DDEF,0,0,0,0,0,100,0,500,500,1500,1500,11,44188,0,0,0,0,0,2,0,0,0,0,0,0,0,"Dragonflayer Defender - In Combat - Cast 'Harpoon Toss'"),
(@DDEF,0,1,2,8,0,100,0,@FiL,0,0,0,33,@DDEF,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Defender - On Spellhit 'Fiery Lance' - Call Kill Credit"),
(@DDEF,0,2,0,61,0,100,0,0,0,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Defender - On Spellhit - Kill Self");

-- Actionlist SAI
SET @ALIST := 2799200;

DELETE FROM `smart_scripts` WHERE `entryorguid`= @ALIST AND `source_type`= 9;
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
(@ALIST,9,0,0,0,0,100,0,3000,3000,0,0,12,@DDEF,4,60000,0,1,0,8,0,0,0,970,-5250,195,4.5,"Vrykul Harpoon Gun - On Script - Summon creature 'Dragonflayer Defender'"),
(@ALIST,9,1,0,0,0,100,0,3000,3000,0,0,12,@DDEF,4,60000,0,1,0,8,0,0,0,978,-5272,204,4.5,"Vrykul Harpoon Gun - On Script - Summon creature 'Dragonflayer Defender'"),
(@ALIST,9,2,0,0,0,100,0,3000,3000,0,0,12,@DDEF,4,60000,0,1,0,8,0,0,0,956,-5267,198,4.5,"Vrykul Harpoon Gun - On Script - Summon creature 'Dragonflayer Defender'"),
(@ALIST,9,3,0,0,0,100,0,3000,3000,0,0,12,@DDEF,4,60000,0,1,0,8,0,0,0,965,-5241,189,4.5,"Vrykul Harpoon Gun - On Script - Summon creature 'Dragonflayer Defender'"),
(@ALIST,9,4,0,0,0,100,0,3000,3000,0,0,12,@DDEF,4,60000,0,1,0,8,0,0,0,948,-5247,200,4.5,"Vrykul Harpoon Gun - On Script - Summon creature 'Dragonflayer Defender'"),
(@ALIST,9,5,0,0,0,100,0,3000,3000,0,0,12,@DDEF,4,60000,0,1,0,8,0,0,0,920,-5251,193,4.5,"Vrykul Harpoon Gun - On Script - Summon creature 'Dragonflayer Defender'"),
(@ALIST,9,6,0,0,0,100,0,3000,3000,0,0,12,@DDEF,4,60000,0,1,0,8,0,0,0,928,-5269,206,4.5,"Vrykul Harpoon Gun - On Script - Summon creature 'Dragonflayer Defender'"),
(@ALIST,9,7,0,0,0,100,0,3000,3000,0,0,12,@DDEF,4,60000,0,1,0,8,0,0,0,906,-5263,196,4.5,"Vrykul Harpoon Gun - On Script - Summon creature 'Dragonflayer Defender'"),
(@ALIST,9,8,0,0,0,100,0,3000,3000,0,0,12,@DDEF,4,60000,0,1,0,8,0,0,0,915,-5238,187,4.5,"Vrykul Harpoon Gun - On Script - Summon creature 'Dragonflayer Defender'"),
(@ALIST,9,9,0,0,0,100,0,3000,3000,0,0,12,@DDEF,4,60000,0,1,0,8,0,0,0,898,-5245,202,4.5,"Vrykul Harpoon Gun - On Script - Summon creature 'Dragonflayer Defender'");

DELETE FROM `creature_template_addon` WHERE `entry` = @DDEF;
INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
(@DDEF, 0, 22657, 50331648, 1, 0, '');

DELETE FROM `creature_template_movement` WHERE `CreatureId` = @DDEF;
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`) VALUES
(@DDEF, 0, 0, 1, 0);

-- Dragonflayer Installation I & II & III
SET @DI1 := 24538;
SET @DI2 := 24646;
SET @DI3 := 24647;

UPDATE `creature_template` SET `flags_extra`= 130, AIName= 'SmartAI' WHERE `entry` IN (@DI1, @DI2, @DI3);

-- Dragonflayer Installation I, II, III SAI
DELETE FROM `smart_scripts` WHERE `source_type`= 0 AND `entryorguid` IN (@DI1, @DI2, @DI3);
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
(@DI1,0,0,1, 8,0,100,0,@FH2,0,0,0,33,@DI1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit 'Fiery Harpoon' - Call Kill Credit"),
(@DI1,0,1,2,61,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,@VHG1,1000,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit - Set Data 1 1"),
(@DI1,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation I - On Spellhit - Cast 'Cosmetic - Low Poly Fire'"),
(@DI2,0,0,1, 8,0,100,0,@FH2,0,0,0,33,@DI2,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit 'Fiery Harpoon' - Call Kill Credit"),
(@DI2,0,1,2,61,0,100,0,0,0,0,0,45,1,2,0,0,0,0,19,@VHG1,1000,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit - Set Data 1 2"),
(@DI2,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation II - On Spellhit - Cast 'Cosmetic - Low Poly Fire'"),
(@DI3,0,0,1, 8,0,100,0,@FH2,0,0,0,33,@DI3,0,0,0,0,0,7,0,0,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit 'Fiery Harpoon' - Call Kill Credit"),
(@DI3,0,1,2,61,0,100,0,0,0,0,0,45,1,3,0,0,0,0,19,@VHG1,1000,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit - Set Data 1 3"),
(@DI3,0,2,0,61,0,100,0,0,0,0,0,11,57931,0,0,0,0,0,1,0,0,0,0,0,0,0,"Dragonflayer Installation III - On Spellhit - Cast 'Cosmetic - Low Poly Fire'");

-- Spell target conditions
SET @VHC := 50331;

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 13 AND `SourceEntry` IN (@FH1, @FH2, @FiL, @VHC);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13, 1, @FH1, 0, 0, 31, 0, 3, @DI1, 0, 0, 0, 0, '', 'Fiery Harpoon 1 targets Quest Trigger'),
(13, 1, @FH1, 0, 1, 31, 0, 3, @DI2, 0, 0, 0, 0, '', 'Fiery Harpoon 1 targets Quest Trigger'),
(13, 1, @FH1, 0, 2, 31, 0, 3, @DI3, 0, 0, 0, 0, '', 'Fiery Harpoon 1 targets Quest Trigger'),
(13, 1, @FH2, 0, 0, 31, 0, 3, @DI1, 0, 0, 0, 0, '', 'Fiery Harpoon 2 targets Quest Trigger'),
(13, 1, @FH2, 0, 1, 31, 0, 3, @DI2, 0, 0, 0, 0, '', 'Fiery Harpoon 2 targets Quest Trigger'),
(13, 1, @FH2, 0, 2, 31, 0, 3, @DI3, 0, 0, 0, 0, '', 'Fiery Harpoon 2 targets Quest Trigger'),
(13, 1, @FiL, 0, 0, 31, 0, 3, @DDEF, 0, 0, 0, 0, '', 'Fiery Lance targets only Dragonflayer Defender'),
(13, 1, @VHC, 0, 0, 31, 0, 3, @VHG1, 0, 0, 0, 0, '', 'Vrykul Harpoon Control targets Valkyr Harpoon Gun'),
(13, 1, @VHC, 0, 1, 31, 0, 3, @VHG2, 0, 0, 0, 0, '', 'Vrykul Harpoon Control targets Valkyr Harpoon Gun');

Feel free to use any part of it, or borrow any of my ideas. You may want to replace my conditions comment text "Fiery Harpoon 1|2" with a more precise description.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Keader picture Keader  路  119Comments

MrSmite picture MrSmite  路  60Comments

click picture click  路  51Comments

Amit86 picture Amit86  路  58Comments

Albis picture Albis  路  67Comments