mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Core/SSC): Fix Lady Vashj summons (#17982)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
--
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceGroup` = 1 AND `SourceEntry` IN (38017, 38140, 38241, 38248) AND `ConditionTypeOrReference` = 31 AND `ConditionValue2` = 22057;
|
||||
|
||||
UPDATE `creature_template` SET `AIName` = '' WHERE `entry` = 22057;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` = 22057 AND `source_type` = 0;
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` IN (38017, 38140, 38241, 38248) AND `ScriptName` IN ('spell_lady_vashj_summons', 'spell_gen_select_target_count_7_1');
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(38017, 'spell_lady_vashj_summons'),
|
||||
(38140, 'spell_lady_vashj_summons'),
|
||||
(38241, 'spell_lady_vashj_summons'),
|
||||
(38248, 'spell_lady_vashj_summons');
|
||||
@@ -65,6 +65,8 @@ enum Misc
|
||||
ITEM_TAINTED_CORE = 31088,
|
||||
|
||||
POINT_HOME = 1,
|
||||
|
||||
NPC_TRIGGER = 15384
|
||||
};
|
||||
|
||||
struct boss_lady_vashj : public BossAI
|
||||
@@ -331,6 +333,73 @@ class spell_lady_vashj_spore_drop_effect : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_lady_vashj_summons : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_lady_vashj_summons);
|
||||
|
||||
enum SpellIds : uint32
|
||||
{
|
||||
SPELL_SUMMON_WAVE_A_MOB = 38019,
|
||||
SPELL_SUMMON_WAVE_B_MOB = 38247,
|
||||
SPELL_SUMMON_WAVE_C_MOB = 38242,
|
||||
SPELL_SUMMON_WAVE_D_MOB = 38244
|
||||
};
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_WAVE_A_MOB, SPELL_SUMMON_WAVE_B_MOB, SPELL_SUMMON_WAVE_C_MOB, SPELL_SUMMON_WAVE_D_MOB });
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
// Filter targets by distance depending on the spell
|
||||
// Coilfang Elites/Striders spawns on top of the stairs. The others at the foot of the stairs.
|
||||
bool top = GetSpellInfo()->Id == SPELL_SUMMON_COILFANG_ELITE || GetSpellInfo()->Id == SPELL_SUMMON_COILFANG_STRIDER;
|
||||
float minDist = top ? 25.f : 60.f;
|
||||
float maxDist = top ? 60.f : 100.f;
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
targets.remove(caster);
|
||||
targets.remove_if([caster, minDist, maxDist](WorldObject const* target) -> bool
|
||||
{
|
||||
float dist = caster->GetExactDist2d(target);
|
||||
return target->GetEntry() != NPC_TRIGGER || (dist < minDist || dist > maxDist);
|
||||
});
|
||||
|
||||
Acore::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void HandleHit()
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
switch (GetSpellInfo()->Id)
|
||||
{
|
||||
case SPELL_SUMMON_ENCHANTED_ELEMENTAL:
|
||||
target->CastSpell(target, SPELL_SUMMON_WAVE_A_MOB, true);
|
||||
break;
|
||||
case SPELL_SUMMON_COILFANG_ELITE:
|
||||
target->CastSpell(target, SPELL_SUMMON_WAVE_B_MOB, true);
|
||||
break;
|
||||
case SPELL_SUMMON_COILFANG_STRIDER:
|
||||
target->CastSpell(target, SPELL_SUMMON_WAVE_C_MOB, true);
|
||||
break;
|
||||
case SPELL_SUMMON_TAINTED_ELEMENTAL:
|
||||
target->CastSpell(target, SPELL_SUMMON_WAVE_D_MOB, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_lady_vashj_summons::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
OnHit += SpellHitFn(spell_lady_vashj_summons::HandleHit);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_lady_vashj()
|
||||
{
|
||||
RegisterSerpentShrineAI(boss_lady_vashj);
|
||||
@@ -338,5 +407,6 @@ void AddSC_boss_lady_vashj()
|
||||
RegisterSpellScript(spell_lady_vashj_remove_tainted_cores);
|
||||
RegisterSpellScript(spell_lady_vashj_summon_sporebat);
|
||||
RegisterSpellScript(spell_lady_vashj_spore_drop_effect);
|
||||
RegisterSpellScript(spell_lady_vashj_summons);
|
||||
}
|
||||
|
||||
|
||||
@@ -653,7 +653,6 @@ class spell_gen_area_aura_select_players : public AuraScript
|
||||
54847 - Mojo Volley (spell_gen_select_target_count_15_2)
|
||||
59452 - Mojo Volley (spell_gen_select_target_count_15_2)
|
||||
46008 - Negative Energy (spell_gen_select_target_count_15_5)
|
||||
38017 - Wave A - 1 (spell_gen_select_target_count_7_1)
|
||||
40851 - Disgruntled (spell_gen_select_target_count_7_1)
|
||||
45680 - Shadow Bolt (spell_gen_select_target_count_7_1)
|
||||
45976 - Open Portal (spell_gen_select_target_count_7_1)
|
||||
@@ -5161,7 +5160,6 @@ void AddSC_generic_spell_scripts()
|
||||
RegisterSpellScriptWithArgs(spell_gen_select_target_count, "spell_gen_select_target_count_15_1", TARGET_UNIT_SRC_AREA_ENEMY, 1);
|
||||
RegisterSpellScriptWithArgs(spell_gen_select_target_count, "spell_gen_select_target_count_15_2", TARGET_UNIT_SRC_AREA_ENEMY, 2);
|
||||
RegisterSpellScriptWithArgs(spell_gen_select_target_count, "spell_gen_select_target_count_15_5", TARGET_UNIT_SRC_AREA_ENEMY, 5);
|
||||
RegisterSpellScriptWithArgs(spell_gen_select_target_count, "spell_gen_select_target_count_7_1", TARGET_UNIT_SRC_AREA_ENTRY, 1);
|
||||
RegisterSpellScriptWithArgs(spell_gen_select_target_count, "spell_gen_select_target_count_24_1", TARGET_UNIT_CONE_ENEMY_24, 1);
|
||||
RegisterSpellScriptWithArgs(spell_gen_select_target_count, "spell_gen_select_target_count_30_1", TARGET_UNIT_SRC_AREA_ALLY, 1);
|
||||
RegisterSpellScript(spell_gen_use_spell_base_level_check);
|
||||
|
||||
Reference in New Issue
Block a user