[Smart_AI] HELP

Hello, I’ve been trying to fix a quest on my test server, and it’s been annoying me that I cannot seem to manage it.

The quest is called “The Dreghood Elders” (10368). You are supposed to talk to 3 of the Broken, and by doing so, free them. This is the query I had used, it works only on Aylaan, and that’s only for the first time I try to finish it (if I retake the quest, I won’t be able to finish even that 1 objective).


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

(20679, 0, 0, 0, 62, 0, 100, 0, 8161, 0, 0, 0, 33, 20679, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Give Kill Credit for Aylaan the Waterwalker, 10368 Quest');


UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` =20678 ;


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

(20678, 0, 0, 0, 62, 0, 100, 0, 8163, 0, 0, 0, 33, 20678, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Give Kill Credit for Akoru the Firecaller, 10368 Quest');


UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` =20679 ;


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

(20677, 0, 0, 0, 62, 0, 100, 0, 8162, 0, 0, 0, 33, 20677, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Give Kill Credit for Morod the Windstirrer, 10368 Quest');


UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` =20677 ;

I hope someone can help me figure out what I’ve been doing wrong, cause I’d like to learn.

Please do your SQL in the standard format used by Trinity.

http://www.trinitycore.org/f/topic/2588-sql-guidelines/ ?

UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` IN (20678,20679,20677);
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (20678,20679,20677);
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
(20679, 0, 0, 0, 62, 0, 100, 0, 8161, 0, 0, 0, 33, 20679, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Aylaan the Waterwalker - On gossip select give killcredit for The Dreghood Elders (10368)'),
(20678, 0, 0, 0, 62, 0, 100, 0, 8163, 0, 0, 0, 33, 20678, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Akoru the Firecaller - On gossip select give killcredit for The Dreghood Elders (10368)'),
(20677, 0, 0, 0, 62, 0, 100, 0, 8162, 0, 0, 0, 33, 20677, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Morod the Windstirrer - On gossip select give killcredit for The Dreghood Elders (10368)');

Edit:

I can’t find why it is not working, it should… the values are correct.

[/CODE]

There were not any smart_scripts for the three npcs so I did not put a delete from in there, and yes I’ve obeyed every law of common sense, sql syntax and the smart_scripts structure and it still does not work.

It works for Aylaan, and that’s only for the first time (need to restart the server if I want that objective completed if i re-take the quest) and the other two just won’t work at all :confused:

I can’t see why its not working either, though I must say its strange that it doesn’t work more than once for Aylaan, that really makes no sense since the event is not set to happen only once.

Has anyone else tried this on their own test server? I just need confirmation if they experience the same thing :confused:

I have deleted all the posts not related to the initial topic. We really do not need (old?) flame wars here, so just stop it.

Thank you. I’ve double checked everything yet again and it is still bugging out…

Works fine for me. Probably an old issue that got fixed now I guess? Anyway, added closing of gossips and conditions because you missed that. /emoticons/default_smile.png

[CODE]-- [Q] The Dreghood Elder
SET @ENTRY_AYLAAN := 20679;
SET @ENTRY_AKORU := 20678;
SET @ENTRY_MOROD := 20677;

– Aylaan the Waterwalker - Akoru the Firecaller - Morod the Windstirrer SAI
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry IN (@ENTRY_AKORU,@ENTRY_AYLAAN,@ENTRY_MOROD);
DELETE FROM smart_scripts WHERE entryorguid IN (@ENTRY_AKORU,@ENTRY_AYLAAN,@ENTRY_MOROD);
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_AYLAAN,0,0,0,62,0,100,0,8161,0,0,0,33,@ENTRY_AYLAAN,0,0,0,0,0,7,0,0,0,0,0,0,0,“Aylaan the Waterwalker - On Gossip Select - Quest Credit The Dreghood Elders”),
(@ENTRY_AYLAAN,0,1,0,62,0,100,0,8161,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,“Aylaan the Waterwalker - On gossip option select - Close gossip”),
(@ENTRY_AKORU,0,0,0,62,0,100,0,8163,0,0,0,33,@ENTRY_AKORU,0,0,0,0,0,7,0,0,0,0,0,0,0,“Akoru the Firecaller - On Gossip Select - Quest Credit The Dreghood Elders”),
(@ENTRY_AKORU,0,1,0,62,0,100,0,8163,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,“Akoru the Firecaller - On gossip option select - Close gossip”),
(@ENTRY_MOROD,0,0,0,62,0,100,0,8162,0,0,0,33,@ENTRY_MOROD,0,0,0,0,0,7,0,0,0,0,0,0,0,“Morod the Windstirrer - On Gossip Select - Quest Credit The Dreghood Elders”),
(@ENTRY_MOROD,0,1,0,62,0,100,0,8162,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,“Morod the Windstirrer - On gossip option select - Close gossip”);

– Only show first gossip if player is on quest The Dreghood Elders
DELETE FROM conditions WHERE SourceGroup IN (8161,8163,8162) AND ConditionValue1 IN (10368);
INSERT INTO conditions (SourceTypeOrReferenceId,SourceGroup,SourceEntry,ElseGroup,ConditionTypeOrReference,ConditionValue1,ConditionValue2,ConditionValue3,ErrorTextId,ScriptName,Comment) VALUES
(15,8161,0,0,9,10368,0,0,0,‘’,“Only show gossip if player is on quest The Dreghood Elders”),
(15,8163,0,0,9,10368,0,0,0,‘’,“Only show gossip if player is on quest The Dreghood Elders”),
(15,8162,0,0,9,10368,0,0,0,‘’,“Only show gossip if player is on quest The Dreghood Elders”);[/sql]

Ready for push, complete.

Closes issue #1787.

[/CODE]