Trinitycore: DB/Creature: Convert Sayge to SAI

Created on 20 May 2020  路  12Comments  路  Source: TrinityCore/TrinityCore

https://tcubuntu.northeurope.cloudapp.azure.com/aowow/?spell=23770 is not applied to player and I don't know why. Without it we can't use anything here. I can try later to cast it with linked event but I don't really want to do it. Maybe later I'll try to check what is wrong with this spell.

ActionMenuID was messed up. We have to check some sniffs to be sure everything is correct now with ActionMenuID.

--
DELETE FROM `gossip_menu` WHERE `MenuID` = 6186 AND `TextID` = 7393;
INSERT INTO `gossip_menu` (`MenuID`,`TextID`,`VerifiedBuild`) VALUES
(6186,7393,0);

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 14 AND `SourceGroup` = 6186;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(14,6186,7339,0,0,1,0,23770,0,0,1,0,0,"","Group 0: Show gossip text 7339 if player does not have aura 'Sayge's Carnie Buff'"),
(14,6186,7393,0,0,1,0,23770,0,0,0,0,0,"","Group 0: Show gossip text 7393 if player does have aura 'Sayge's Carnie Buff'");

UPDATE `gossip_menu_option` SET `ActionMenuID` = 6208 WHERE `MenuID` = 6185 AND `OptionID` = 1;
UPDATE `gossip_menu_option` SET `ActionMenuID` = 6209 WHERE `MenuID` = 6185 AND `OptionID` = 2;
UPDATE `gossip_menu_option` SET `ActionMenuID` = 6210 WHERE `MenuID` = 6185 AND `OptionID` = 3;
UPDATE `gossip_menu_option` SET `ActionMenuID` = 6211 WHERE `MenuID` IN (6187,6208,6209,6210);
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID` = 10087 WHERE `MenuID` = 6210 AND `OptionID` = 0;
UPDATE `gossip_menu_option` SET `ActionMenuID` = 6212 WHERE `MenuID` = 6211;

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 6186;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,6186,0,0,0,1,0,23770,0,0,1,0,0,"","Group 0: Show Gossip Option 0 if player does not have aura 'Sayge's Carnie Buff'");

-- Sayge SAI
SET @ID := 14822;
UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID 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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ID,0,0,0,10,0,100,0,1,10,120000,120000,1,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - Within 0-10 Range Out of Combat LoS - Say Line 0"),

(@ID,0,1,0,62,0,100,0,6187,0,0,0,0,11,23768,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 0 Selected - Cast 'Sayge's Dark Fortune of Damage'"),
(@ID,0,2,0,62,0,100,0,6187,1,0,0,0,11,23769,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 1 Selected - Cast 'Sayge's Dark Fortune of Resistance'"),
(@ID,0,3,0,62,0,100,0,6187,2,0,0,0,11,23767,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 2 Selected - Cast 'Sayge's Dark Fortune of Armor'"),

(@ID,0,4,0,62,0,100,0,6208,0,0,0,0,11,23738,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 0 Selected - Cast 'Sayge's Dark Fortune of Spirit'"),
(@ID,0,5,0,62,0,100,0,6208,1,0,0,0,11,23766,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 1 Selected - Cast 'Sayge's Dark Fortune of Intelligence'"),
(@ID,0,6,0,62,0,100,0,6208,2,0,0,0,11,23769,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 2 Selected - Cast 'Sayge's Dark Fortune of Resistance'"),

(@ID,0,7,0,62,0,100,0,6209,0,0,0,0,11,23737,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 0 Selected - Cast 'Sayge's Dark Fortune of Stamina'"),
(@ID,0,8,0,62,0,100,0,6209,1,0,0,0,11,23735,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 1 Selected - Cast 'Sayge's Dark Fortune of Strength'"),
(@ID,0,9,0,62,0,100,0,6209,2,0,0,0,11,23736,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 2 Selected - Cast 'Sayge's Dark Fortune of Agility'"),

(@ID,0,10,0,62,0,100,0,6210,0,0,0,0,11,23766,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 0 Selected - Cast 'Sayge's Dark Fortune of Intelligence'"),
(@ID,0,11,0,62,0,100,0,6210,1,0,0,0,11,23738,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 1 Selected - Cast 'Sayge's Dark Fortune of Spirit'"),
(@ID,0,12,0,62,0,100,0,6210,2,0,0,0,11,23767,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 2 Selected - Cast 'Sayge's Dark Fortune of Armor'"),

(@ID,0,13,0,62,0,100,0,6211,0,0,0,0,11,23765,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 0 Selected - Cast 'Darkmoon Faire Fortune'");

DELETE FROM `creature_text` WHERE `CreatureID` = @ID;
INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
(@ID,0,0,"Come to me and see what the future holds for you!",12,0,100,0,0,0,10125,0,"Sayge"),
(@ID,0,1,"Come speak with me, and what once was cloudy shall become crystal clear.",12,0,100,0,0,0,10126,0,"Sayge"),
(@ID,0,2,"Fear not!  All fortunes can be discerned for those who know the way.",12,0,100,0,0,0,10127,0,"Sayge"),
(@ID,0,3,"The longer you wait, the less future you have for me to foretell.",12,0,100,0,0,0,10128,0,"Sayge");

Branch: 3.3.5
TC rev. hash/commit: 69dc704cd5cf
Operating system: Windows 8.1

Branch-3.3.5a Comp-Database Feedback-PatchFix

All 12 comments

Neat. I remember back when I updated the CPP script for this NPC gossip, moving #define text to DB.
At least it worked OK back then, but something must have gone wrong in the meanwhile.
Thank you for working on this.

Everything was ok (except one messed up broadcast text) in-game only because the core script overrides db data

Working version with hacky linked event:

--
DELETE FROM `gossip_menu` WHERE `MenuID` = 6186 AND `TextID` = 7393;
INSERT INTO `gossip_menu` (`MenuID`,`TextID`,`VerifiedBuild`) VALUES
(6186,7393,0);

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 14 AND `SourceGroup` = 6186;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(14,6186,7339,0,0,1,0,23770,0,0,1,0,0,"","Group 0: Show gossip text 7339 if player does not have aura 'Sayge's Carnie Buff'"),
(14,6186,7393,0,0,1,0,23770,0,0,0,0,0,"","Group 0: Show gossip text 7393 if player does have aura 'Sayge's Carnie Buff'");

UPDATE `gossip_menu_option` SET `ActionMenuID` = 6208 WHERE `MenuID` = 6185 AND `OptionID` = 1;
UPDATE `gossip_menu_option` SET `ActionMenuID` = 6209 WHERE `MenuID` = 6185 AND `OptionID` = 2;
UPDATE `gossip_menu_option` SET `ActionMenuID` = 6210 WHERE `MenuID` = 6185 AND `OptionID` = 3;
UPDATE `gossip_menu_option` SET `ActionMenuID` = 6211 WHERE `MenuID` IN (6187,6208,6209,6210);
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID` = 10087 WHERE `MenuID` = 6210 AND `OptionID` = 0;
UPDATE `gossip_menu_option` SET `ActionMenuID` = 6212 WHERE `MenuID` = 6211;

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 6186;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,6186,0,0,0,1,0,23770,0,0,1,0,0,"","Group 0: Show Gossip Option 0 if player does not have aura 'Sayge's Carnie Buff'");

-- Sayge SAI
SET @ID := 14822;
UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID 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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ID,0,0,0,10,0,100,0,1,10,120000,120000,1,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - Within 0-10 Range Out of Combat LoS - Say Line 0"),

(@ID,0,1,14,62,0,100,0,6187,0,0,0,0,11,23768,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 0 Selected - Cast 'Sayge's Dark Fortune of Damage'"),
(@ID,0,2,14,62,0,100,0,6187,1,0,0,0,11,23769,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 1 Selected - Cast 'Sayge's Dark Fortune of Resistance'"),
(@ID,0,3,14,62,0,100,0,6187,2,0,0,0,11,23767,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 2 Selected - Cast 'Sayge's Dark Fortune of Armor'"),

(@ID,0,4,14,62,0,100,0,6208,0,0,0,0,11,23738,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 0 Selected - Cast 'Sayge's Dark Fortune of Spirit'"),
(@ID,0,5,14,62,0,100,0,6208,1,0,0,0,11,23766,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 1 Selected - Cast 'Sayge's Dark Fortune of Intelligence'"),
(@ID,0,6,14,62,0,100,0,6208,2,0,0,0,11,23769,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 2 Selected - Cast 'Sayge's Dark Fortune of Resistance'"),

(@ID,0,7,14,62,0,100,0,6209,0,0,0,0,11,23737,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 0 Selected - Cast 'Sayge's Dark Fortune of Stamina'"),
(@ID,0,8,14,62,0,100,0,6209,1,0,0,0,11,23735,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 1 Selected - Cast 'Sayge's Dark Fortune of Strength'"),
(@ID,0,9,14,62,0,100,0,6209,2,0,0,0,11,23736,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 2 Selected - Cast 'Sayge's Dark Fortune of Agility'"),

(@ID,0,10,14,62,0,100,0,6210,0,0,0,0,11,23766,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 0 Selected - Cast 'Sayge's Dark Fortune of Intelligence'"),
(@ID,0,11,14,62,0,100,0,6210,1,0,0,0,11,23738,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 1 Selected - Cast 'Sayge's Dark Fortune of Spirit'"),
(@ID,0,12,14,62,0,100,0,6210,2,0,0,0,11,23767,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 2 Selected - Cast 'Sayge's Dark Fortune of Armor'"),

(@ID,0,13,0,62,0,100,0,6211,0,0,0,0,11,23765,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Gossip Option 0 Selected - Cast 'Darkmoon Faire Fortune'"),
(@ID,0,14,0,61,0,100,0,0,0,0,0,0,11,23770,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Sayge - On Link - Cast 'Sayge's Carnie Buff'");

DELETE FROM `creature_text` WHERE `CreatureID` = @ID;
INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
(@ID,0,0,"Come to me and see what the future holds for you!",12,0,100,0,0,0,10125,0,"Sayge"),
(@ID,0,1,"Come speak with me, and what once was cloudy shall become crystal clear.",12,0,100,0,0,0,10126,0,"Sayge"),
(@ID,0,2,"Fear not!  All fortunes can be discerned for those who know the way.",12,0,100,0,0,0,10127,0,"Sayge"),
(@ID,0,3,"The longer you wait, the less future you have for me to foretell.",12,0,100,0,0,0,10128,0,"Sayge");

From my point of view, the linked event does not appear to be a hack.
How to trigger 2 events by the same gossip option, if not via Link?

OK, thanks. I forgot about those details. What is needed for that to work, extra spell script or more aura scripting?

Somebody with more experience in this

Fair enough, good point. Anyway, good work so far. Thanks.

I forgot to notice that actually this is based also on video which is no longer available or maybe I just saved wrong url.
https://www.youtube.com/watch?v=hyKjJER2zog
And the LoS event is here https://www.youtube.com/watch?v=B_eOJXHr6n0

Are you sure https://woehead.way-of-elendil.fr/?spell=23770 is used to handle the gossip?
Because it looks it's used to avoid having an other buff for 4h
https://tcubuntu.northeurope.cloudapp.azure.com/aowow/?spell=23770

It's the original way to prevent people obtain buff more than once in 4 hours
If player does have this aura, the gossip option will be not available

(15,6186,0,0,0,1,0,23770,0,0,1,0,0,"","Group 0: Show Gossip Option
0 if player does not have aura 'Sayge's Carnie Buff'");

and the gossip text will be different

(14,6186,7339,0,0,1,0,23770,0,0,1,0,0,"","Group 0: Show gossip text 7339
 if player does not have aura 'Sayge's Carnie Buff'"),
(14,6186,7393,0,0,1,0,23770,0,0,0,0,0,"","Group 0: Show gossip text 7393
 if player does have aura 'Sayge's Carnie Buff'");

Replaces this hack
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/World/npcs_special.cpp#L1314-L1317
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/World/npcs_special.cpp#L1213-L1221

Yes the issue is with the DBC spell, I will try to fix it
The only solution I find is to change the target from 25 to 1 and cast the spell by the player, so better to keep this hack for the moment.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jonne733 picture Jonne733  路  3Comments

Rochet2 picture Rochet2  路  3Comments

Rushor picture Rushor  路  3Comments

Lopfest picture Lopfest  路  3Comments

Rushor picture Rushor  路  3Comments