Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ulduar: Convert Flame Leviathan to BossAI & Spell Lists #429

Draft
wants to merge 104 commits into
base: master
Choose a base branch
from

Conversation

insunaa
Copy link
Contributor

@insunaa insunaa commented Jan 9, 2023

🍰 Pullrequest

This PR converts Flame Leviathan to BossAI and adds Spell Lists

Todo / Checklist

  • Add SQL
  • Fix Turret respawn bug
  • Fix Hardmode NPCs not despawning
DELETE FROM `creature_spell_list` WHERE `Id`=3311300;
INSERT INTO `creature_spell_list` (`Id`, `Position`, `SpellId`, `InitialMin`, `InitialMax`, `RepeatMin`, `RepeatMax`, `Flags`, `TargetId`, `ScriptId`, `Availability`, `Probability`, `Comments`) VALUES
(3311300, 0, 62376, 10000, 10000,  1000,  1000, 0, 1, 0, 100, 0, 'Flame Leviathan - Battering Ram'),
(3311300, 1, 62396, 30000, 30000, 15000, 25000, 0, 0, 0, 100, 0, 'Flame Leviathan - Flame Vents'),
(3311300, 2, 62400,  1000,  1000,  1000,  2000, 0, 0, 0, 100, 0, 'Flame Leviathan - Missile Barrage'),
(3311300, 3, 62374,  1000,  1000, 30000, 30000, 0, 0, 0, 100, 0, 'Flame Leviathan - Pursue'),
(3311300, 4, 62375, 10000, 10000, 10000, 10000, 0, 0, 0, 100, 0, 'Flame Leviathan - Gathering Speed');

DELETE FROM `creature_spell_list_entry` WHERE `Id`=3311300;
INSERT INTO `creature_spell_list_entry` VALUES
(3311300, 'Ulduar - Flame Leviathan', 100, 100);

UPDATE `creature_template` SET `SpellList`=3311300 WHERE `entry`=33113;
UPDATE `creature_template` SET `SpellList`=3311300 WHERE `entry`=34003;

DELETE FROM `creature_spell_list` WHERE (`Id` = 3314200) AND (`Position` = 0);
INSERT INTO `creature_spell_list` (`Id`, `Position`, `SpellId`, `InitialMin`, `InitialMax`, `RepeatMin`, `RepeatMax`, `Flags`, `TargetId`, `ScriptId`, `Availability`, `Probability`, `Comments`) VALUES
(3314200, 0, 62402, 2000, 2000, 2000, 4000, 2, 100, 0, 100, 0, 'Leviathan Defense Turret - Searing Flame');

DELETE FROM `creature_spell_list_entry` WHERE `Id`=3314200;
INSERT INTO `creature_spell_list_entry` VALUES
(3314200, 'Ulduar - Leviathan Defense Turret', 100, 100);

UPDATE `creature_template` SET `SpellList`=3314200 WHERE `entry`=33142;

DELETE FROM `creature_spell_list` WHERE (`Id` = 3306200);
INSERT INTO `creature_spell_list` (`Id`, `Position`, `SpellId`, `InitialMin`, `InitialMax`, `RepeatMin`, `RepeatMax`, `Flags`, `TargetId`, `ScriptId`, `Availability`, `Probability`, `Comments`) VALUES
(3306200, 0, 62974, 0, 0, 0,     0,     0, 0, 0, 100, 0, 'Salvaged Chopper - Sonic Horn'),
(3306200, 1, 62286, 0, 0, 15000, 15000, 0, 0, 0, 100, 0, 'Salvaged Chopper - Tar'),
(3306200, 2, 62299, 0, 0, 0,     0,     0, 0, 0, 100, 0, 'Salvaged Chopper - Speed Boost'),
(3306200, 3, 67372, 0, 0, 0,     0,     0, 0, 0, 100, 0, 'Salvaged Chopper - Grab Pyrite'),
(3306200, 5, 64660, 0, 0, 60000, 60000, 0, 0, 0, 100, 0, 'Salvaged Chopper - First Aid Kit');

UPDATE `creature_template` SET `SpellList`=3306200 WHERE `Entry`=33062;

UPDATE `creature_template` SET `ScriptName`='npc_salvaged_chopper' WHERE `Entry`=33062;
UPDATE `creature_template` SET `ScriptName`='npc_pyrite_safety_container' WHERE `Entry`=33218;
UPDATE `creature_template` SET `ScriptName`='npc_liquid_pyrite' WHERE `Entry`=33189;

UPDATE `vehicle_accessory` SET `seat`=0 WHERE `vehicle_entry` IN (33364, 33369, 33108, 33366);

DELETE FROM `spell_template` WHERE `Id`=62474;
INSERT INTO `spell_template` (Id, Attributes, AttributesEx, AttributesEx3, AttributesEx4, AttributesEx6, CastingTimeIndex, MaxLevel, BaseLevel, SpellLevel, RangeIndex, Effect1, EffectDieSides1, EffectBasePoints1, EffectImplicitTargetA1, EffectMultipleValue1, EffectMiscValue1, SpellIconID, SpellName, SpellFamilyFlags) VALUES
(62474, 553648256, 1024, 262144, 128, 16777216, 1, 83, 80, 80, 12, 62, 1, 4, 97, 1, 3, 3779, '(Serverside/Non-DB2) Hurl Boulder (Power Burn)', 16);
DELETE FROM `spell_template` WHERE `Id`=64998;
INSERT INTO `spell_template` (Id, Attributes, AttributesEx, AttributesEx3, AttributesEx4, AttributesEx6, CastingTimeIndex, MaxLevel, BaseLevel, SpellLevel, RangeIndex, Effect1, Effect2, EffectImplicitTargetA1, EffectImplicitTargetA2, SpellName, SpellFamilyFlags, IsServerSide) VALUES
(64998, 553648256, 1024, 262144, 128, 16777216, 1, 83, 80, 80, 1, 3, 3, 94, 1, '(Serverside/Non-DB2) Say you''re ready to fly!', 16, 1);
DELETE FROM `spell_template` WHERE `Id`=62543;
INSERT INTO `spell_template` (Id, Attributes, CastingTimeIndex, DurationIndex, RangeIndex, Effect1, EffectDieSides1, EffectImplicitTargetA1, EffectRadiusIndex1, EffectMiscValue1, EffectMiscValueB1, SpellVisual, SpellIconID, SpellName, SchoolMask, IsServerSide) VALUES
(62543, 384, 1, 9, 1, 28, 1, 22, 36, 33189, 64, 215, 2651, '(Serverside/Non-DB2) Spawn Pyrite', 1, 1);

UPDATE `creature_template` SET `UnitFlags`=`UnitFlags`|33554432 WHERE `entry`=33142;
UPDATE `creature_template` SET `StaticFlags1`=`StaticFlags1`|512 WHERE `entry`=33142;

UPDATE `creature_template` SET `DisplayIdProbability1`=100,`DisplayIdProbability2`=0,`DisplayIdProbability3`=0,`DisplayIdProbability4`=0 WHERE `entry` IN (33189, 33114, 33167);
UPDATE `creature_template` SET `DisplayIdProbability1`=0,`DisplayIdProbability2`=100,`DisplayIdProbability3`=0,`DisplayIdProbability4`=0 WHERE `entry` IN (33264);

UPDATE `creature_ai_scripts` SET `action1_type`=11,`action1_param1`=62987,`action1_param3`=2 WHERE `id`=3321401;

UPDATE `creature_template` SET `InhabitType`=1 WHERE entry=33218;

UPDATE `broadcast_text` SET `ChatTypeID`=3 WHERE `Id`=33746;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15506 WHERE `Id`=33487;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15521 WHERE `Id`=33507;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15520 WHERE `Id`=33506;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15507 WHERE `Id`=33488;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15508 WHERE `Id`=33489;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15509 WHERE `Id`=33490;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15516 WHERE `Id`=33501;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15517 WHERE `Id`=33503;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15518 WHERE `Id`=33504;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15519 WHERE `Id`=33505;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15510 WHERE `Id`=33491;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15512 WHERE `Id`=33493;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15513 WHERE `Id`=33495;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15515 WHERE `Id`=33499;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15514 WHERE `Id`=33497;
UPDATE `broadcast_text` SET `ChatTypeID`=1,`SoundEntriesID1`=15511 WHERE `Id`=33492;
UPDATE `broadcast_text` SET `ChatTypeID`=3 WHERE `Id`=33502;
UPDATE `broadcast_text` SET `ChatTypeID`=3 WHERE `Id`=33494;
UPDATE `broadcast_text` SET `ChatTypeID`=3 WHERE `Id`=33498;
UPDATE `broadcast_text` SET `ChatTypeID`=3 WHERE `Id`=33496;
UPDATE `broadcast_text` SET `ChatTypeID`=3 WHERE `Id`=33500;

DELETE FROM `string_id` WHERE `Id` IN (6030001, 6030002);
INSERT INTO `string_id` (`Id`, `Name`) VALUES
(6030001,'ULDUAR_PLAYER_VEHICLES'),
(6030002,'ULDUAR_FLAME_LEVIATHAN_PARTY');

UPDATE `creature_template` SET `StringId1`=6030001 WHERE `entry` IN (33060, 33062, 33067, 33109, 33167);
UPDATE `creature_template` SET `StringId1`=6030002 WHERE `entry` IN (33113, 33114, 33139, 33142, 33143, 34286);

--UPDATE `creature_template` SET `VisibilityDistanceType`=4 WHERE `entry`=33113;

UPDATE `creature_template` SET `VehicleTemplateId`=340 WHERE `entry`=34003;

DELETE FROM `vehicle_accessory` WHERE `vehicle_entry`=33113 AND `seat` IN (0, 1);
INSERT INTO `vehicle_accessory` VALUES
(33113,0,33114,'Flame Leviathan(25)'),
(33113,1,33114,'Flame Leviathan(25)');

DELETE FROM `spell_script_target` WHERE `entry` IN (62323, 62399);
INSERT INTO `spell_script_target` VALUES (62323, 1, 33114, 6);
INSERT INTO `spell_script_target` VALUES (62399, 1, 33113, 0);
INSERT INTO `spell_script_target` VALUES (62399, 1, 33139, 6);

UPDATE `spell_template` SET `ChannelInterruptFlags`=0 WHERE Id=62399;
UPDATE `creature_template` SET `RegenerateStats`=12 WHERE entry=33142;
UPDATE `creature_template` SET `ScriptName`='npc_mimiron_inferno' WHERE `entry`=33369;
UPDATE `creature_template` SET `ScriptName`='npc_hodir_fury' WHERE `entry`=33212;
UPDATE `creature_template` SET `ScriptName`='npc_hodir_fury_reticle' WHERE `entry`=33108;
UPDATE `creature_template` SET `ScriptName`='npc_freya_ward' WHERE `entry`=33366;
UPDATE `creature_template` SET `ScriptName`='npc_salvaged_demolisher' WHERE `entry`=33109;
UPDATE `creature_template` SET `ScriptName`='npc_leviathan_defense_turret',`UnitFlags`=`UnitFlags`-33554432 WHERE `entry`=33142;

INSERT INTO `creature_ai_scripts` (`id`, `creature_id`, `event_type`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `action1_type`, `comment`) VALUES
(3313903, 33139, 30, 100, 6, 5, 33113, 38, 'Flame Leviathan Turret - Set Turrent in Combat with Zone on Receive AI_EVENT_CUSTOM_EVENTAI_A');

-- for testing purposes only:

DELETE FROM `spell_scripts` WHERE `Id` IN (62482, 62374, 62297, 62323, 62324, 62907, 62910, 62912, 62336, 64414, 62399, 62475, 60603, 63575, 63605, 63618, 61242, 64979, 64998, 65045, 60075, 60076, 60077);
INSERT INTO `spell_scripts` VALUES
(62482,'spell_grab_crate_leviathan'),
(62374,'spell_pursue_leviathan'),
(62297,'spell_hodirs_fury_leviathan'),
(62323,'spell_hookshot'),
(62324,'spell_throw_passenger'),
(62907,'spell_freyas_ward_leviathan'),
(62910,'spell_mimirons_inferno_leviathan'),
(62912,'spell_thorims_hammer_leviathan'),
(62336,'spell_hookshot_aura'),
(64414,'spell_load_into_catapult_leviathan'),
(62399,'spell_overload_circuit'),
(62475,'spell_systems_shutdown'),
(60603,'spell_eject_passenger_1'),
(63575,'spell_smoke_trail_leviathan'),
(63605,'spell_rope_beam'),
(63618,'spell_overload_leviathan'),
(61242,'spell_parachute_leviathan'),
(64979,'spell_anti_air_rocket'),
(62363,'spell_anti_air_rocket'),
(62634,'spell_demolisher_mortar'),
(62635,'spell_demolisher_mortar'),
(64998,'spell_ready_to_fly'),
(65044,'spell_flames_leviathan'),
(65045,'spell_flames_leviathan'),
(60075,'spell_flame_leviathan_buff'),
(60076,'spell_flame_leviathan_buff'),
(60077,'spell_flame_leviathan_buff');

Random notes:

    /*
Areatrigger left Repair: 5369
Areatrigger right repair: 5423
    */

@insunaa
Copy link
Contributor Author

insunaa commented Jan 16, 2023

OK I consider this PR as functionally complete.
The following things related to the encounter either don't work or don't work correctly:

  • The pyrite helicopter things don't have waypoints
  • The shot down pyrite things have the display ID of boxes instead of the blue pyrite containers they should be
  • The vehicles aside from the Demolisher are untested
  • The demolisher doesn't correctly share its Pyrite/Power meter with the passenger/mechanic seat
  • The spell projectiles for the hardmode spells aren't really projectiles, or at least aren't visible
  • The defense turrets are not uninteractible for players who are not on top of the leviathan (no clear evidence found for either way, if this mechanic exists it's a deeper core issue)
  • The summoned creatures from Freya's hardmode despawn when their spell timer is up, when they should instead stay and attack players.
  • The viewing distance causes the vehicles to bug out clientside. When the vehicles go out of viewing distance and back in the client doesn't see the passengers of the leviathan (turrets+overload devices) attached to the Leviathan anymore, instead they're in the location where the Leviathan spawned.
  • Vehicle seats have unknown position offsets. This probably warrants an entirely new DB table with hand-entered offsets

I don't have the patience to fix these issues right now and I'd appreciate it a lot if someone else would consider helping me 👍

@@ -174,7 +174,7 @@ void TemporarySpawn::Update(const uint32 diff)
}
if (!GetCharmerGuid())
{
if (IsExpired())
if (IsExpired() && !IsInCombat())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm this behavior with ai findings related to npc Dread Tactician 16959 using s.33679 (15000 duration), he can have multiple adds up during combat which will be despawned on combat end/reached home.

grafik

src/game/Spells/Spell.cpp Outdated Show resolved Hide resolved
src/game/Entities/Unit.cpp Outdated Show resolved Hide resolved
@insunaa insunaa marked this pull request as ready for review July 10, 2024 09:55
@insunaa
Copy link
Contributor Author

insunaa commented Jul 10, 2024

For easier review I created a new PR on my fork which has the Meson commits stripped and the Leviathan commits squashed: https://github.com/insunaa/mangos-wotlk/pull/1/files

Please someone take the 30 minutes it takes to review. Thank you!

@al3xc1985
Copy link

Any news on this one @insunaa, I mean since my last test. Cause this one would fix a lot of problems in game when merged

@insunaa
Copy link
Contributor Author

insunaa commented Oct 11, 2024

@al3xc1985 I'm catching up on work due to illness right now, so little time for this, hopefully soon.

@al3xc1985
Copy link

Hope to get well! God bless!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants