The below cant be commited yet as is reliant on instance header data for diremaul which does not yet exist on TC, @Mik1983 has done some work on this but still needs testing as I have not yet, believe @Mik1983 will make PR for the cpp stuff once it has been tested
Broadcast texts for creature_text and gossip_menu_option
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID` = 9103 WHERE `menu_id` = 5602 AND `id` = 0;
UPDATE `creature_text` SET `BroadcastTextId` = 9104 WHERE `entry` = 11491 AND `groupid` = 0;
UPDATE `creature_text` SET `BroadcastTextId` = 9099 WHERE `entry` = 11491 AND `groupid` = 1;
UPDATE `creature_text` SET `BroadcastTextId` = 9100 WHERE `entry` = 11491 AND `groupid` = 2;
Yes I know had not added those yet since other things need resolving before can be pushed anyway
i don't think that both ironbarks should have a gossip, only the redeemed one
that will also make the event 0 of the smartscript obsolete
and i think it is better to handle the bossstate stuff in cpp, like we do it with all other bosses
i guess the current part will not work correctly, because setdata and getbossstate mismatch
well a several old world instances including dire maul only have a placeholder instance script which does nothing really ie https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp and no instance headers as a lot of bosses in vanilla instances are in sai too as was converted from eai the method of set data and conditions for setting instance data are already used on several bosses like shadowfang keep and sunken temple but those still have a header file defining the encounters even though the bosses are in sai and have sai to save instance data.
when ive bought this up before about some bosses been in sai still the outcome was that it was thought these really did not need cpp as most have very few abillities and are fairly basic compared to tbc/wotlk bosses
tested this https://github.com/Rushor/TrinityCore/commit/45c59c928c957f7c54bcb6adb2ed7425dc2e883a by @Mik1983 and sadly it does not work
proof: http://i.imgur.com/gZJxbKg.jpg - dead Zevrim Thornhoof, but Ironbark stays in it's normal form :/
Of course it doesn't, the data being set by the SAI is unhandled. If you wanted it to work, then it would need to be handled by the instance SetData(). But currently there's no variable storing that data whatsoever so it falls under an unhandled case and nothing happens (I guess I was right about this assumption few days ago when we discussed it :P)
Anyway joschiwald is probably right and maybe it'd indeed be better to be handed with cpp boss states.
@dr-j this now can be implemented.
working version
~~~sql
SET @OGUID=XXXXXXX;
DELETE FROM gameobject WHERE id=176907;
INSERT INTO gameobject (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES
(@OGUID, 176907, 429, 1, 1, 131.3599, -278.9299, -56.00667, 3.141593, 0, 0, 1, -4.371139E-08, 7200, 255, 1); -- 176907 (Area: 5913)
DELETE FROM smart_scripts WHERE entryorguid=11490 AND source_type=0 AND id=2;
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
(11490, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 34, 3, 3, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Zevrim Thornhoof - On Death - Set Bossstate');
UPDATE creature_template SET npcflag=1,gossip_menu_id=5602 WHERE entryIN(14241);
DELETE FROM creature WHERE guid=84262; -- Delete the permament spawn of Ironbark the redeemed
DELETE FROM gossip_menu WHERE Menuid=5602;
INSERT INTO gossip_menu (MenuID, TextID) VALUES
(5602, 6695); -- 11491
DELETE FROM gossip_menu_option WHERE MenuID=5602 AND OptionID=0;
INSERT INTO gossip_menu_option (MenuID, OptionID, OptionIcon, OptionText, OptionBroadcastTextID, OptionType, OptionNpcFlag, ActionMenuID, ActionPoiID, BoxCoded, BoxMoney, BoxText, BoxBroadcastTextID, VerifiedBuild) VALUES
(5602, 0, 0, 'Thank you, Ironbark. We are ready for you to open the door.', 9103, 1, 1, 0, 0, 0, 0, NULL, 0, 0);
DELETE FROM creature_text WHERE CreatureID=14241;
INSERT INTO creature_text (CreatureID, GroupID, ID, Text, Type, Language, Probability, Emote, Duration, Sound, BroadcastTextId, TextRange, comment) VALUES
(14241, 2, 0, 'My strength wanes, mortal. I have done as promised, the way is clear. I now return to whence I came.', 12, 0, 100, 0, 0, 0, 9100, 0, 'Old Ironbark');
(14241, 1, 0, 'As you wish...', 12, 0, 100, 0, 0, 0, 9099, 0, 'Old Ironbark');
(14241, 0, 0, 'At last... Freed from his cursed grasp!', 14, 0, 100, 0, 0, 0, 9104, 2, 'Old Ironbark');
DELETE FROM waypoints where entry=11491;
INSERT INTO waypoints (entry, pointid, position_x, position_y, position_z, point_comment) VALUES
(11491, 1, -46.50295, -268.5359, -57.49783, 'Old Ironbark'),
(11491, 2, -10.61148, -281.6762, -53.74153, 'Old Ironbark'),
(11491, 3, 17.28245, -286.9468, -52.28185, 'Old Ironbark'),
(11491, 4, 51.79745, -270.5228, -53.03123, 'Old Ironbark'),
(11491, 5, 74.17236, -272.7652, -54.82667, 'Old Ironbark'),
(11491, 6, 117.4012, -277.8298, -55.85518, 'Old Ironbark');
UPDATE creature_template SET AIName='SmartAI' WHERE entryIN(11491,14241);
DELETE FROM smart_scripts WHERE entryorguid=11491 AND source_type=0;
DELETE FROM smart_scripts WHERE entryorguid=1149100 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
(11491, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Spawn - Set NPC Flags'),
(11491, 0, 1, 2, 1, 0, 100, 1, 0, 0, 0, 0, 36, 14241, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - OOC - Change Entry (No repeat)'),
(11491, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Data Set - Change Entry'),
(11491, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Data Set - Say Line 0'),
(11491, 0, 4, 5, 62, 0, 100, 0, 5602, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Gossip Option Select - Say Line 1'),
(11491, 0, 5, 6, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Gossip Option Select - Close Gossip'),
(11491, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Gossip Option Select - Set NPC Flags'),
(11491, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 11491, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Gossip Option Select - Start WP'),
(11491, 0, 8, 0, 40, 0, 100, 0, 6, 11491, 0, 0, 80, 1149100, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Reached WP6 - Run Script'),
(1149100, 9, 0, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Play Emote OneShotAttackUnarmed'),
(1149100, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Play Emote OneShotAttackUnarmed'),
(1149100, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Play Emote OneShotAttackUnarmed'),
(1149100, 9, 3, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 118, 2, 0, 0, 0, 0, 0, 14, @OGUID, 176907, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Set Gameobject State'),
(1149100, 9, 4, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Say Line 2'),
(1149100, 9, 5, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 90, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Set Bytes 1'),
(1149100, 9, 6, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Despawn');
DELETE FROM conditions WHERE SourceTypeOrReferenceId=22 AND SourceEntry=11491;
INSERT INTO conditions (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorType, ErrorTextId, ScriptName, Comment) VALUES
(22, 2, 11491, 0, 0, 13, 1, 3, 3, 2, 0, 0, 0, '', 'Execute SAI only if Zevrim Thornhoof (Encounter 3) Done');
And now sets correct state on door so its smashed instead of opened
Any update yet on this issue?
I encountered the same problem as this one: #22594, as of 43986954fddc05e0fe1f225b0cf38a7b01f775bb.
Better to involve instance script here, SAI is not designed to work with instances in such cases
(11491, 0, 1, 2, 1, 0, 100, 1, 0, 0, 0, 0, 36, 14241, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - OOC - Change Entry (No repeat)'),
(22, 2, 11491, 0, 0, 13, 1, 3, 3, 2, 0, 0, 0, '', 'Execute SAI only if Zevrim Thornhoof (Encounter 3) Done');
Most helpful comment
working version
~~~sql
SET @OGUID=XXXXXXX;
DELETE FROM
gameobjectWHEREid=176907;INSERT INTO
gameobject(guid,id,map,spawnMask,phaseMask,position_x,position_y,position_z,orientation,rotation0,rotation1,rotation2,rotation3,spawntimesecs,animprogress,state) VALUES(@OGUID, 176907, 429, 1, 1, 131.3599, -278.9299, -56.00667, 3.141593, 0, 0, 1, -4.371139E-08, 7200, 255, 1); -- 176907 (Area: 5913)
DELETE FROM
smart_scriptsWHEREentryorguid=11490 ANDsource_type=0 ANDid=2;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(11490, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 34, 3, 3, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Zevrim Thornhoof - On Death - Set Bossstate');
UPDATE
creature_templateSETnpcflag=1,gossip_menu_id=5602 WHEREentryIN(14241);DELETE FROM
creatureWHEREguid=84262; -- Delete the permament spawn of Ironbark the redeemedDELETE FROM
gossip_menuWHEREMenuid=5602;INSERT INTO
gossip_menu(MenuID,TextID) VALUES(5602, 6695); -- 11491
DELETE FROM
gossip_menu_optionWHEREMenuID=5602 ANDOptionID=0;INSERT INTO
gossip_menu_option(MenuID,OptionID,OptionIcon,OptionText,OptionBroadcastTextID,OptionType,OptionNpcFlag,ActionMenuID,ActionPoiID,BoxCoded,BoxMoney,BoxText,BoxBroadcastTextID,VerifiedBuild) VALUES(5602, 0, 0, 'Thank you, Ironbark. We are ready for you to open the door.', 9103, 1, 1, 0, 0, 0, 0, NULL, 0, 0);
DELETE FROM
creature_textWHERECreatureID=14241;INSERT INTO
creature_text(CreatureID,GroupID,ID,Text,Type,Language,Probability,Emote,Duration,Sound,BroadcastTextId,TextRange,comment) VALUES(14241, 2, 0, 'My strength wanes, mortal. I have done as promised, the way is clear. I now return to whence I came.', 12, 0, 100, 0, 0, 0, 9100, 0, 'Old Ironbark');
(14241, 1, 0, 'As you wish...', 12, 0, 100, 0, 0, 0, 9099, 0, 'Old Ironbark');
(14241, 0, 0, 'At last... Freed from his cursed grasp!', 14, 0, 100, 0, 0, 0, 9104, 2, 'Old Ironbark');
DELETE FROM
waypointswhereentry=11491;INSERT INTO
waypoints(entry,pointid,position_x,position_y,position_z,point_comment) VALUES(11491, 1, -46.50295, -268.5359, -57.49783, 'Old Ironbark'),
(11491, 2, -10.61148, -281.6762, -53.74153, 'Old Ironbark'),
(11491, 3, 17.28245, -286.9468, -52.28185, 'Old Ironbark'),
(11491, 4, 51.79745, -270.5228, -53.03123, 'Old Ironbark'),
(11491, 5, 74.17236, -272.7652, -54.82667, 'Old Ironbark'),
(11491, 6, 117.4012, -277.8298, -55.85518, 'Old Ironbark');
UPDATE
creature_templateSETAIName='SmartAI' WHEREentryIN(11491,14241);DELETE FROM
smart_scriptsWHEREentryorguid=11491 ANDsource_type=0;DELETE FROM
smart_scriptsWHEREentryorguid=1149100 ANDsource_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(11491, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Spawn - Set NPC Flags'),
(11491, 0, 1, 2, 1, 0, 100, 1, 0, 0, 0, 0, 36, 14241, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - OOC - Change Entry (No repeat)'),
(11491, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Data Set - Change Entry'),
(11491, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Data Set - Say Line 0'),
(11491, 0, 4, 5, 62, 0, 100, 0, 5602, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Gossip Option Select - Say Line 1'),
(11491, 0, 5, 6, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Gossip Option Select - Close Gossip'),
(11491, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Gossip Option Select - Set NPC Flags'),
(11491, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 11491, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Gossip Option Select - Start WP'),
(11491, 0, 8, 0, 40, 0, 100, 0, 6, 11491, 0, 0, 80, 1149100, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - On Reached WP6 - Run Script'),
(1149100, 9, 0, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Play Emote OneShotAttackUnarmed'),
(1149100, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Play Emote OneShotAttackUnarmed'),
(1149100, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Play Emote OneShotAttackUnarmed'),
(1149100, 9, 3, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 118, 2, 0, 0, 0, 0, 0, 14, @OGUID, 176907, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Set Gameobject State'),
(1149100, 9, 4, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Say Line 2'),
(1149100, 9, 5, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 90, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Set Bytes 1'),
(1149100, 9, 6, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Old Ironbark - Script - Despawn');
DELETE FROM
conditionsWHERESourceTypeOrReferenceId=22 ANDSourceEntry=11491;INSERT INTO
conditions(SourceTypeOrReferenceId,SourceGroup,SourceEntry,SourceId,ElseGroup,ConditionTypeOrReference,ConditionTarget,ConditionValue1,ConditionValue2,ConditionValue3,NegativeCondition,ErrorType,ErrorTextId,ScriptName,Comment) VALUES(22, 2, 11491, 0, 0, 13, 1, 3, 3, 2, 0, 0, 0, '', 'Execute SAI only if Zevrim Thornhoof (Encounter 3) Done');