Skip to content

Commit

Permalink
fix(Scripts/BlackwingLair): Nefarian (#10536)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nefertumm committed Mar 9, 2022
1 parent 59b5568 commit 707968e
Show file tree
Hide file tree
Showing 6 changed files with 813 additions and 193 deletions.
53 changes: 53 additions & 0 deletions data/sql/updates/pending_db_world/rev_1643946548773673200.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1643946548773673200');

DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_class_call_handler', 'spell_corrupted_totems', 'spell_class_call_polymorph', 'aura_class_call_wild_magic', 'aura_class_call_siphon_blessing', 'aura_class_call_berserk', 'spell_shadowblink');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(23410, 'spell_class_call_handler'), -- Mage
(23397, 'spell_class_call_handler'), -- Warrior
(23398, 'spell_class_call_handler'), -- Druid
(23401, 'spell_class_call_handler'), -- Priest
(23418, 'spell_class_call_handler'), -- Paladin
(23425, 'spell_class_call_handler'), -- Shaman
(23427, 'spell_class_call_handler'), -- Warlock
(23436, 'spell_class_call_handler'), -- Hunter
(23414, 'spell_class_call_handler'), -- Rogue
(23424, 'spell_corrupted_totems'),
(23603, 'spell_class_call_polymorph'),
(23410, 'aura_class_call_wild_magic'),
(23418, 'aura_class_call_siphon_blessing'),
(23397, 'aura_class_call_berserk'),
(22664, 'spell_shadowblink');

DELETE FROM `spell_target_position` WHERE `ID` IN (22668, 22669, 22670, 22671, 22672, 22673, 22674, 22675, 22676);
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`) VALUES
(22668, 0, 469, -7581.11, -1216.19, 476.800, 0),
(22669, 0, 469, -7561.54, -1244.01, 476.800, 0),
(22670, 0, 469, -7542.47, -1191.92, 476.355, 0),
(22671, 0, 469, -7538.63, -1273.64, 476.800, 0),
(22672, 0, 469, -7524.36, -1219.12, 476.794, 0),
(22673, 0, 469, -7506.58, -1165.26, 476.796, 0),
(22674, 0, 469, -7500.70, -1249.89, 476.798, 0),
(22675, 0, 469, -7486.36, -1194.32, 476.800, 0),
(22676, 0, 469, -7469.93, -1227.93, 476.777, 0);

DELETE FROM `waypoint_data` WHERE `id` = 11583;
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
(11583, 1, -7348.85, -1495.13, 552.515, 2.190162, 0, 2, 0, 100, 0),
(11583, 2, -7348.54, -1494.18, 552.515, 2.190162, 0, 2, 0, 100, 0),
(11583, 3, -7392.87, -1475.70, 544.619, 2.190162, 0, 2, 0, 100, 0),
(11583, 4, -7423.42, -1437.66, 535.314, 2.190162, 0, 2, 0, 100, 0),
(11583, 5, -7445.25, -1402.11, 523.842, 2.190162, 0, 2, 0, 100, 0),
(11583, 6, -7460.38, -1372.60, 513.092, 2.190162, 0, 2, 0, 100, 0),
(11583, 7, -7479.81, -1331.76, 498.759, 2.190162, 0, 2, 0, 100, 0),
(11583, 8, -7492.58, -1295.35, 488.091, 2.190162, 0, 2, 0, 100, 0),
(11583, 9, -7502.00, -1256.50, 476.758, 2.174731, 0, 2, 0, 100, 0);

UPDATE `creature_template_movement` SET `Flight` = 2 WHERE `CreatureID` = 11583;

UPDATE `creature_template` SET `unit_flags` = `unit_flags`|2|256|131072|33554432, `flags_extra` = `flags_extra`|128|256 WHERE `entry` = 14667;

UPDATE `creature_template` SET `unit_flags` = `unit_flags`|131072, `flags_extra` = `flags_extra`|1|256|16384|4194304, `mechanic_immune_mask`=`mechanic_immune_mask`|1|2|4|8|16|128|256|512|1024|2048|4096|8192|16384|65536|131072|4194304|8388608|33554432|67108864|536870912 , `ScriptName` = 'npc_corrupted_totem' WHERE `entry` IN (14662, 14663, 14664, 14666);

UPDATE `creature_template` SET `mingold` = 0, `maxgold` = 0 WHERE `entry` = 14668;

DELETE FROM `creature_loot_template` WHERE `entry` = 11583 AND `Item` = 19364;
8 changes: 8 additions & 0 deletions src/server/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6377,6 +6377,14 @@ SpellCastResult Spell::CheckCast(bool strict)
}
break;
}
case SPELL_AURA_MOD_SHAPESHIFT:
{
if (m_caster && m_caster->HasAura(23397)) // Nefarian Class Call (Warrior): Berserk -- Nefertum: I don't really like this but I didn't find another way.
{
return SPELL_FAILED_NOT_SHAPESHIFT;
}
break;
}
default:
break;
}
Expand Down
13 changes: 13 additions & 0 deletions src/server/game/Spells/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,19 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
addhealth = unitTarget->SpellHealingBonusTaken(caster, m_spellInfo, addhealth, HEAL);
}

// Implemented this way as there is no other way to do it currently (that I know :P)...
if (caster->ToPlayer() && caster->ToPlayer()->HasAura(23401)) // Nefarian Corrupted Healing (priest)
{
if (m_spellInfo->Effects[EFFECT_0].ApplyAuraName != SPELL_AURA_PERIODIC_HEAL ||
m_spellInfo->Effects[EFFECT_1].ApplyAuraName != SPELL_AURA_PERIODIC_HEAL ||
m_spellInfo->Effects[EFFECT_2].ApplyAuraName != SPELL_AURA_PERIODIC_HEAL)
{
m_damage = 0;
caster->CastSpell(unitTarget, 23402, false); // Nefarian Corrupted Healing Periodic Damage effect.
return;
}
}

m_damage -= addhealth;
}
}
Expand Down
20 changes: 20 additions & 0 deletions src/server/game/Spells/SpellInfoCorrections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4154,6 +4154,20 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Effects[EFFECT_1].SpellClassMask[1] = 0x00020000;
});

// Nefarian: Shadowbolt, Shadow Command
ApplySpellFix({ 22667, 22677 }, [](SpellInfo* spellInfo)
{
spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(152); // 150 yards
});

// Shadowbolt Volley
ApplySpellFix({ 22665 }, [](SpellInfo* spellInfo)
{
spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(152); // 150 yards
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(41); // 150 yards
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
});

// Manastorm
ApplySpellFix({ 21097 }, [](SpellInfo* spellInfo)
{
Expand All @@ -4180,6 +4194,12 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
});

// Improved Blessing Protection (Nefarian Class Call)
ApplySpellFix({ 23415 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ENEMY);
});

// Bestial Wrath
ApplySpellFix({ 19574 }, [](SpellInfo* spellInfo)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,6 @@ inline AI* GetBlackwingLairAI(T* obj)
return GetInstanceAI<AI>(obj, BWLScriptName);
}

#define RegisterBlackwingLairCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetBlackwingLairAI)

#endif
Loading

0 comments on commit 707968e

Please sign in to comment.