Description: When an objective is completed 2 https://woehead.way-of-elendil.fr/?npc=18904 spawns and whisper something to the player
This npcs are summoned by https://woehead.way-of-elendil.fr/?spell=33122
This npcs: 18840, 18841, 18842, 18843 have this script "npc_creditmarker_visit_with_ancestors" to just give quest credit, we must add to extra cast done by the player with 2 secs interval for spell=33122
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/Outland/zone_nagrand.cpp#L225
The issue here I'm not sure we have a something to check quest objective as the player must cast spell=33122 only if the quest is not complete and the objective related to the npc is not fulfill.
UPDATE `creature_template` SET `flags_extra`= `flags_extra`|128 WHERE `entry` IN (18840, 18841, 18842, 18843);
UPDATE `creature_template` SET `AIName`="SmartAI",`unit_flags`= `unit_flags`|768 WHERE `entry` IN (18904);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18904) 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
(18904,0,0,0,54,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Vision of the Forgotten - On Just summoned - Say text");
DELETE FROM `creature_text` WHERE `CreatureID`=18904;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(18904,0,0,"Turn back, mortal... This is not your battle.",15,0,100,0,0,0,16007,0,"Vision of the Forgotten"),
(18904,0,1,"You cannot stop them...",15,0,100,0,0,0,16008,0,"Vision of the Forgotten"),
(18904,0,2,"We are infinite... eternal.",15,0,100,0,0,0,16009,0,"Vision of the Forgotten"),
(18904,0,3,"They lack control... Oshu'gun calls to them...",15,0,100,0,0,0,16010,0,"Vision of the Forgotten"),
(18904,0,4,"It is a beacon. A remnant of a forgotten era.",15,0,100,0,0,0,16011,0,"Vision of the Forgotten");
Branch(es): both
TC rev. hash/commit: rev. 79b90f9d3afb
We need this https://github.com/TrinityCore/TrinityCore/commit/945cfce1f63f2d629d32da8be2e696900e81d835 to be cherry pick to 3.3.5
Kinda relevant, in the quest The Great Hunter's Challenge a NPC is summoned, does some talk/cosmetic effect and then despawns every time the player reaches a certain progress in the quest (the quest requires 60 kills, events trigger at 6/11/21/28/35/41/49/56 kills), so it would be nice if this script hook also exposes the objective counter too.
Yes we have an open issue for this quest https://github.com/TrinityCore/TrinityCore/issues/16037
Looks like it's handled by areatriggers
Yes this ones: 4368,4369,4372,4371
So as player enters areatrigger only once it can be done without checks. From my own experience multiple unique checks implemented in TC/CMaNGOS are completely guessed
why Only once? he can return to this area trigger and trigger it again.
Maybe :) Anyway the only way to be sure is check it in retail
wip
``sql
UPDATEspell_dbcSETDurationIndex=39 WHEREidIN (33122);
UPDATEcreature_templateSETflags_extra=flags_extra|128,ScriptName="" WHEREentryIN (18840, 18841, 18842, 18843);
DELETE FROMareatrigger_scriptsWHEREentryIN (4368,4369,4372,4371);
INSERT INTOareatrigger_scripts(entry,ScriptName) VALUES
(4368,'SmartTrigger'),(4369,'SmartTrigger'),(4372,'SmartTrigger'),(4371,'SmartTrigger');
UPDATEcreature_templateSETAIName="SmartAI",unit_flags=unit_flags|768 WHEREentryIN (18904);
DELETE FROMsmart_scriptsWHEREentryorguidIN (18904) ANDsource_type=0;
DELETE FROMsmart_scriptsWHEREentryorguidIN (4368,4369,4372,4371) ANDsource_type=2;
INSERT INTOsmart_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
(18904,0,0,0,54,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Vision of the Forgotten - On Just summoned - Say text"),
(4368,2,0,1,46,0,100,0,4368,0,0,0,85,33122,0,0,0,0,0,7,0,0,0,0,0,0,0,"Area Trigger 4368 - On Trigger - Self cast Serverside - A Vision of the Forgotten"),
(4368,2,1,0,61,0,100,0,0,0,0,0,33,18843,0,0,0,0,0,7,0,0,0,0,0,0,0,"Area Trigger 4368 - On Trigger - Kill credit"),
(4369,2,0,1,46,0,100,0,4369,0,0,0,85,33122,0,0,0,0,0,7,0,0,0,0,0,0,0,"Area Trigger 4368 - On Trigger - Self cast Serverside - A Vision of the Forgotten"),
(4369,2,1,0,61,0,100,0,0,0,0,0,33,18840,0,0,0,0,0,7,0,0,0,0,0,0,0,"Area Trigger 4368 - On Trigger - Kill credit"),
(4372,2,0,1,46,0,100,0,4372,0,0,0,85,33122,0,0,0,0,0,7,0,0,0,0,0,0,0,"Area Trigger 4368 - On Trigger - Self cast Serverside - A Vision of the Forgotten"),
(4372,2,1,0,61,0,100,0,0,0,0,0,33,18842,0,0,0,0,0,7,0,0,0,0,0,0,0,"Area Trigger 4368 - On Trigger - Kill credit"),
(4371,2,0,1,46,0,100,0,4371,0,0,0,85,33122,0,0,0,0,0,7,0,0,0,0,0,0,0,"Area Trigger 4368 - On Trigger - Self cast Serverside - A Vision of the Forgotten"),
(4371,2,1,0,61,0,100,0,0,0,0,0,33,18841,0,0,0,0,0,7,0,0,0,0,0,0,0,"Area Trigger 4368 - On Trigger - Kill credit");
DELETE FROM creature_text WHERE CreatureID=18904;
INSERT INTO creature_text (CreatureID, GroupID, ID, Text, Type, Language, Probability, Emote, Duration, Sound, BroadcastTextId, TextRange, comment) VALUES
(18904,0,0,"Turn back, mortal... This is not your battle.",15,0,100,0,0,0,16007,0,"Vision of the Forgotten"),
(18904,0,1,"You cannot stop them...",15,0,100,0,0,0,16008,0,"Vision of the Forgotten"),
(18904,0,2,"We are infinite... eternal.",15,0,100,0,0,0,16009,0,"Vision of the Forgotten"),
(18904,0,3,"They lack control... Oshu'gun calls to them...",15,0,100,0,0,0,16010,0,"Vision of the Forgotten"),
(18904,0,4,"It is a beacon. A remnant of a forgotten era.",15,0,100,0,0,0,16011,0,"Vision of the Forgotten");
DELETE FROM conditions WHERE SourceTypeOrReferenceId=22 AND SourceEntry=4368 AND SourceId=2;
INSERT INTO conditions (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorType, ErrorTextId, ScriptName, Comment) VALUES
(22, 1, 4369, 2, 0, 48, 0, 10085, 0, 0, 0, 0, 0, "", "Run SAI only if objective 1 is not complete"),
(22, 1, 4371, 2, 0, 48, 0, 10085, 1, 0, 0, 0, 0, "", "Run SAI only if objective 2 is not complete"),
(22, 1, 4372, 2, 0, 48, 0, 10085, 2, 0, 0, 0, 0, "", "Run SAI only if objective 3 is not complete"),
(22, 1, 4368, 2, 0, 48, 0, 10085, 3, 0, 0, 0, 0, "", "Run SAI only if objective 4 is not complete");