mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-17 05:29:43 -04:00
Scripts/Spells: Migrate Some Scripted Spells to Scripts (#23185)
* Migrate spells to scripts * Simplify code * I need to sleep * Update chapter1.cpp * Use actual damage * No need in null check here
This commit is contained in:
committed by
Giacomo Pozzoni
parent
50d32fe493
commit
2cfaeb1400
@@ -87,6 +87,33 @@ class spell_q55_sacred_cleansing : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
enum BendingShinbone
|
||||
{
|
||||
SPELL_BENDING_SHINBONE1 = 8854,
|
||||
SPELL_BENDING_SHINBONE2 = 8855
|
||||
};
|
||||
|
||||
class spell_q1846_bending_shinbone : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q1846_bending_shinbone);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
Item* target = GetHitItem();
|
||||
Unit* caster = GetCaster();
|
||||
if (!target && caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 const spellId = roll_chance_i(20) ? SPELL_BENDING_SHINBONE1 : SPELL_BENDING_SHINBONE2;
|
||||
caster->CastSpell(caster, spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q1846_bending_shinbone::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
// 9712 - Thaumaturgy Channel
|
||||
enum ThaumaturgyChannel
|
||||
{
|
||||
@@ -2869,6 +2896,7 @@ public:
|
||||
void AddSC_quest_spell_scripts()
|
||||
{
|
||||
new spell_q55_sacred_cleansing();
|
||||
RegisterSpellScript(spell_q1846_bending_shinbone);
|
||||
new spell_q2203_thaumaturgy_channel();
|
||||
new spell_q5206_test_fetid_skull();
|
||||
new spell_q6124_6129_apply_salve();
|
||||
|
||||
Reference in New Issue
Block a user