aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp132
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp49
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp41
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp35
-rw-r--r--src/server/scripts/Spells/spell_item.cpp68
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp29
6 files changed, 222 insertions, 132 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 2d8fd4e2394..8a8c9c7af80 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -3054,17 +3054,6 @@ void Spell::EffectScriptEffect()
return;
unitTarget->RemoveAurasDueToSpell(effectInfo->CalcValue());
break;
- // Bending Shinbone
- case 8856:
- {
- if (!itemTarget && m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- uint32 const spell_id = roll_chance_i(20) ? 8854 : 8855;
- m_caster->CastSpell(m_caster, spell_id, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
- .SetOriginalCastId(m_castId));
- return;
- }
// Brittle Armor - need remove one 24575 Brittle Armor aura
case 24590:
unitTarget->RemoveAuraFromStack(24575);
@@ -3100,33 +3089,6 @@ void Spell::EffectScriptEffect()
.SetOriginalCastId(m_castId));
return;
}
- // Mirren's Drinking Hat
- case 29830:
- {
- uint32 item = 0;
- switch (urand(1, 6))
- {
- case 1:
- case 2:
- case 3:
- item = 23584; break; // Loch Modan Lager
- case 4:
- case 5:
- item = 23585; break; // Stouthammer Lite
- case 6:
- item = 23586; break; // Aerie Peak Pale Ale
- }
- if (item)
- DoCreateItem(item);
- break;
- }
- case 20589: // Escape artist
- case 30918: // Improved Sprint
- {
- // Removes snares and roots.
- unitTarget->RemoveMovementImpairingAuras(true);
- break;
- }
// Mug Transformation
case 41931:
{
@@ -3173,71 +3135,6 @@ void Spell::EffectScriptEffect()
break;
}
- // Goblin Weather Machine
- case 46203:
- {
- if (!unitTarget)
- return;
-
- uint32 spellId = 0;
- switch (rand32() % 4)
- {
- case 0: spellId = 46740; break;
- case 1: spellId = 46739; break;
- case 2: spellId = 46738; break;
- case 3: spellId = 46736; break;
- }
- unitTarget->CastSpell(unitTarget, spellId, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
- .SetOriginalCastId(m_castId));
- break;
- }
- // 5,000 Gold
- case 46642:
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- unitTarget->ToPlayer()->ModifyMoney(5000 * GOLD);
- break;
- }
- // Death Knight Initiate Visual
- case 51519:
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
- return;
-
- uint32 iTmpSpellId = 0;
- switch (unitTarget->GetDisplayId())
- {
- case 25369: iTmpSpellId = 51552; break; // bloodelf female
- case 25373: iTmpSpellId = 51551; break; // bloodelf male
- case 25363: iTmpSpellId = 51542; break; // draenei female
- case 25357: iTmpSpellId = 51541; break; // draenei male
- case 25361: iTmpSpellId = 51537; break; // dwarf female
- case 25356: iTmpSpellId = 51538; break; // dwarf male
- case 25372: iTmpSpellId = 51550; break; // forsaken female
- case 25367: iTmpSpellId = 51549; break; // forsaken male
- case 25362: iTmpSpellId = 51540; break; // gnome female
- case 25359: iTmpSpellId = 51539; break; // gnome male
- case 25355: iTmpSpellId = 51534; break; // human female
- case 25354: iTmpSpellId = 51520; break; // human male
- case 25360: iTmpSpellId = 51536; break; // nightelf female
- case 25358: iTmpSpellId = 51535; break; // nightelf male
- case 25368: iTmpSpellId = 51544; break; // orc female
- case 25364: iTmpSpellId = 51543; break; // orc male
- case 25371: iTmpSpellId = 51548; break; // tauren female
- case 25366: iTmpSpellId = 51547; break; // tauren male
- case 25370: iTmpSpellId = 51545; break; // troll female
- case 25365: iTmpSpellId = 51546; break; // troll male
- default: return;
- }
-
- unitTarget->CastSpell(unitTarget, iTmpSpellId, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
- .SetOriginalCastId(m_castId));
- Creature* npc = unitTarget->ToCreature();
- npc->LoadEquipment();
- return;
- }
// Deathbolt from Thalgran Blightbringer
// reflected by Freya's Ward
// Retribution by Sevenfold Retribution
@@ -3385,35 +3282,6 @@ void Spell::EffectScriptEffect()
return;
}
- // Stoneclaw Totem
- case 55328: // Rank 1
- case 55329: // Rank 2
- case 55330: // Rank 3
- case 55332: // Rank 4
- case 55333: // Rank 5
- case 55335: // Rank 6
- case 55278: // Rank 7
- case 58589: // Rank 8
- case 58590: // Rank 9
- case 58591: // Rank 10
- {
- // Cast Absorb on totems
- for (uint8 slot = SUMMON_SLOT_TOTEM; slot < MAX_TOTEM_SLOT; ++slot)
- {
- if (!unitTarget->m_SummonSlot[slot])
- continue;
-
- Creature* totem = unitTarget->GetMap()->GetCreature(unitTarget->m_SummonSlot[slot]);
- if (totem && totem->IsTotem())
- {
- CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
- args.SetOriginalCastId(m_castId);
- args.AddSpellMod(SPELLVALUE_BASE_POINT0, damage);
- m_caster->CastSpell(totem, 55277, args);
- }
- }
- break;
- }
case 45668: // Ultra-Advanced Proto-Typical Shortening Blaster
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index d23bdaded9a..bb20934ac42 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -28,6 +28,7 @@
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
+#include "Spell.h"
#include "SpellScript.h"
#include "SpellInfo.h"
#include "TemporarySummon.h"
@@ -350,6 +351,53 @@ class go_acherus_soul_prison : public GameObjectScript
}
};
+class spell_death_knight_initiate_visual : public SpellScript
+{
+ PrepareSpellScript(spell_death_knight_initiate_visual);
+
+ void HandleScriptEffect(SpellEffIndex /* effIndex */)
+ {
+ Creature* target = GetHitCreature();
+ if (!target)
+ return;
+
+ uint32 spellId;
+ switch (target->GetDisplayId())
+ {
+ case 25369: spellId = 51552; break; // bloodelf female
+ case 25373: spellId = 51551; break; // bloodelf male
+ case 25363: spellId = 51542; break; // draenei female
+ case 25357: spellId = 51541; break; // draenei male
+ case 25361: spellId = 51537; break; // dwarf female
+ case 25356: spellId = 51538; break; // dwarf male
+ case 25372: spellId = 51550; break; // forsaken female
+ case 25367: spellId = 51549; break; // forsaken male
+ case 25362: spellId = 51540; break; // gnome female
+ case 25359: spellId = 51539; break; // gnome male
+ case 25355: spellId = 51534; break; // human female
+ case 25354: spellId = 51520; break; // human male
+ case 25360: spellId = 51536; break; // nightelf female
+ case 25358: spellId = 51535; break; // nightelf male
+ case 25368: spellId = 51544; break; // orc female
+ case 25364: spellId = 51543; break; // orc male
+ case 25371: spellId = 51548; break; // tauren female
+ case 25366: spellId = 51547; break; // tauren male
+ case 25370: spellId = 51545; break; // troll female
+ case 25365: spellId = 51546; break; // troll male
+ default: return;
+ }
+
+ target->CastSpell(target, spellId, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
+ .SetOriginalCastId(GetSpell()->m_castId));
+ target->LoadEquipment();
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_death_knight_initiate_visual::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
/*######
## npc_eye_of_acherus
######*/
@@ -1241,6 +1289,7 @@ void AddSC_the_scarlet_enclave_c1()
new npc_unworthy_initiate();
new npc_unworthy_initiate_anchor();
new go_acherus_soul_prison();
+ RegisterSpellScript(spell_death_knight_initiate_visual);
new npc_eye_of_acherus();
new npc_death_knight_initiate();
RegisterCreatureAI(npc_dark_rider_of_acherus);
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 3f61ed7058c..bff1d8a1ba3 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -597,6 +597,46 @@ class spell_dk_ghoul_explode : public SpellScript
}
};
+// 69961 - Glyph of Scourge Strike
+class spell_dk_glyph_of_scourge_strike_script : public SpellScript
+{
+ PrepareSpellScript(spell_dk_glyph_of_scourge_strike_script);
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ Unit* target = GetHitUnit();
+
+ Unit::AuraEffectList const& mPeriodic = target->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
+ for (Unit::AuraEffectList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
+ {
+ AuraEffect const* aurEff = *i;
+ SpellInfo const* spellInfo = aurEff->GetSpellInfo();
+ // search our Blood Plague and Frost Fever on target
+ if (spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && spellInfo->SpellFamilyFlags[2] & 0x2 &&
+ aurEff->GetCasterGUID() == caster->GetGUID())
+ {
+ uint32 countMin = aurEff->GetBase()->GetMaxDuration();
+ uint32 countMax = spellInfo->GetMaxDuration();
+
+ // this Glyph
+ countMax += 9000;
+
+ if (countMin < countMax)
+ {
+ aurEff->GetBase()->SetDuration(aurEff->GetBase()->GetDuration() + 3000);
+ aurEff->GetBase()->SetMaxDuration(countMin + 3000);
+ }
+ }
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_dk_glyph_of_scourge_strike_script::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
// 206940 - Mark of Blood
class spell_dk_mark_of_blood : public AuraScript
{
@@ -789,6 +829,7 @@ void AddSC_deathknight_spell_scripts()
RegisterAuraScript(spell_dk_death_strike_enabler);
RegisterSpellScript(spell_dk_festering_strike);
RegisterSpellScript(spell_dk_ghoul_explode);
+ RegisterSpellScript(spell_dk_glyph_of_scourge_strike_script);
RegisterAuraScript(spell_dk_mark_of_blood);
RegisterAuraScript(spell_dk_necrosis);
RegisterSpellScript(spell_dk_pet_geist_transform);
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 5c680852ab5..4d4d760fd68 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -1657,6 +1657,23 @@ class spell_steal_essence_visual : public AuraScript
}
};
+// 46642 - 5,000 Gold
+class spell_gen_5000_gold : public SpellScript
+{
+ PrepareSpellScript(spell_gen_5000_gold);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Player* target = GetHitPlayer())
+ target->ModifyMoney(5000 * GOLD);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_5000_gold::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
enum FishingSpells
{
SPELL_FISHING_NO_FISHING_POLE = 131476,
@@ -2635,6 +2652,22 @@ class spell_gen_remove_flight_auras : public SpellScript
}
};
+// 20589 - Escape artist
+class spell_gen_remove_impairing_auras : public SpellScript
+{
+ PrepareSpellScript(spell_gen_remove_impairing_auras);
+
+ void HandleScriptEffect(SpellEffIndex /* effIndex */)
+ {
+ GetHitUnit()->RemoveMovementImpairingAuras(true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_remove_impairing_auras::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
// 23493 - Restoration
// 24379 - Restoration
class spell_gen_restoration : public AuraScript
@@ -4438,6 +4471,7 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_ethereal_pet_onsummon);
RegisterSpellScript(spell_ethereal_pet_aura_remove);
RegisterAuraScript(spell_steal_essence_visual);
+ RegisterSpellScript(spell_gen_5000_gold);
RegisterSpellScript(spell_gen_fishing);
RegisterSpellScript(spell_gen_gadgetzan_transporter_backfire);
RegisterAuraScript(spell_gen_gift_of_naaru);
@@ -4475,6 +4509,7 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_profession_research);
RegisterSpellScript(spell_gen_pvp_trinket);
RegisterSpellScript(spell_gen_remove_flight_auras);
+ RegisterSpellScript(spell_gen_remove_impairing_auras);
RegisterAuraScript(spell_gen_restoration);
RegisterSpellAndAuraScriptPair(spell_gen_replenishment, spell_gen_replenishment_aura);
// Running Wild
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 37d2664ec72..db9a822dab8 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -651,6 +651,35 @@ class spell_item_decahedral_dwarven_dice : public SpellScript
}
};
+enum GoblinWeatherMachine
+{
+ SPELL_PERSONALIZED_WEATHER1 = 46740,
+ SPELL_PERSONALIZED_WEATHER2 = 46739,
+ SPELL_PERSONALIZED_WEATHER3 = 46738,
+ SPELL_PERSONALIZED_WEATHER4 = 46736
+};
+
+// 46203 - Goblin Weather Machine
+class spell_item_goblin_weather_machine : public SpellScript
+{
+ PrepareSpellScript(spell_item_goblin_weather_machine);
+
+ void HandleScript(SpellEffIndex /* effIndex */)
+ {
+ Unit* target = GetHitUnit();
+
+ uint32 spellId = RAND(SPELL_PERSONALIZED_WEATHER1, SPELL_PERSONALIZED_WEATHER2, SPELL_PERSONALIZED_WEATHER3,
+ SPELL_PERSONALIZED_WEATHER4);
+ target->CastSpell(target, spellId, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
+ .SetOriginalCastId(GetSpell()->m_castId));
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_goblin_weather_machine::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
// 8342 - Defibrillate (Goblin Jumper Cables) have 33% chance on success
// 22999 - Defibrillate (Goblin Jumper Cables XL) have 50% chance on success
// 54732 - Defibrillate (Gnomish Army Knife) have 67% chance on success
@@ -3629,6 +3658,43 @@ class spell_item_taunt_flag_targeting : public SpellScript
}
};
+enum MirrensDrinkingHat
+{
+ ITEM_LOCH_MODAN_LAGER = 23584,
+ ITEM_STOUTHAMMER_LITE = 23585,
+ ITEM_AERIE_PEAK_PALE_ALE = 23586
+};
+
+// 29830 - Mirren's Drinking Hat
+class spell_item_mirrens_drinking_hat : public SpellScript
+{
+ PrepareSpellScript(spell_item_mirrens_drinking_hat);
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ uint32 itemId;
+ switch (urand(1, 6))
+ {
+ case 1:
+ case 2:
+ case 3:
+ itemId = ITEM_LOCH_MODAN_LAGER; break;
+ case 4:
+ case 5:
+ itemId = ITEM_STOUTHAMMER_LITE; break;
+ case 6:
+ itemId = ITEM_AERIE_PEAK_PALE_ALE; break;
+ }
+ if (itemId)
+ CreateItem(itemId, ItemContext::NONE);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_mirrens_drinking_hat::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
// 13180 - Gnomish Mind Control Cap
enum MindControlCap
{
@@ -4141,6 +4207,7 @@ void AddSC_item_spell_scripts()
new spell_item_deathbringers_will<SPELL_STRENGTH_OF_THE_TAUNKA, SPELL_AGILITY_OF_THE_VRYKUL, SPELL_POWER_OF_THE_TAUNKA, SPELL_AIM_OF_THE_IRON_DWARVES, SPELL_SPEED_OF_THE_VRYKUL>("spell_item_deathbringers_will_normal");
new spell_item_deathbringers_will<SPELL_STRENGTH_OF_THE_TAUNKA_HERO, SPELL_AGILITY_OF_THE_VRYKUL_HERO, SPELL_POWER_OF_THE_TAUNKA_HERO, SPELL_AIM_OF_THE_IRON_DWARVES_HERO, SPELL_SPEED_OF_THE_VRYKUL_HERO>("spell_item_deathbringers_will_heroic");
RegisterSpellScript(spell_item_decahedral_dwarven_dice);
+ RegisterSpellScript(spell_item_goblin_weather_machine);
new spell_item_defibrillate("spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL);
new spell_item_defibrillate("spell_item_goblin_jumper_cables_xl", 50, SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL);
new spell_item_defibrillate("spell_item_gnomish_army_knife", 33);
@@ -4226,6 +4293,7 @@ void AddSC_item_spell_scripts()
RegisterAuraScript(spell_item_darkmoon_card_greatness);
RegisterAuraScript(spell_item_mana_drain);
RegisterSpellScript(spell_item_taunt_flag_targeting);
+ RegisterSpellScript(spell_item_mirrens_drinking_hat);
RegisterSpellScript(spell_item_mind_control_cap);
RegisterSpellScript(spell_item_universal_remote);
new spell_item_zandalarian_charm("spell_item_unstable_power", SPELL_UNSTABLE_POWER_AURA_STACK);
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index de570569a09..924024dbba5 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -87,6 +87,34 @@ 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, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
+ .SetOriginalCastId(GetSpell()->m_castId));
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q1846_bending_shinbone::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
// 9712 - Thaumaturgy Channel
enum ThaumaturgyChannel
{
@@ -2979,6 +3007,7 @@ class spell_q14386_call_attack_mastiffs : public SpellScript
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();