Spell Scripts:
* add new file spell_item.cpp for spells used by items (but not by quests) * move some dummy effects of generic spells to scripts * implement spell for quest 12937 Relief for the Fallen. Closes issue #3070 --HG-- branch : trunk
This commit is contained in:
@@ -537,6 +537,7 @@ void AddSC_shaman_spell_scripts();
|
||||
void AddSC_warlock_spell_scripts();
|
||||
void AddSC_warrior_spell_scripts();
|
||||
void AddSC_quest_spell_scripts();
|
||||
void AddSC_item_spell_scripts();
|
||||
void AddSC_example_spell_scripts();
|
||||
|
||||
// battlegrounds
|
||||
@@ -595,6 +596,7 @@ void AddSpellScripts()
|
||||
AddSC_warlock_spell_scripts();
|
||||
AddSC_warrior_spell_scripts();
|
||||
AddSC_quest_spell_scripts();
|
||||
AddSC_item_spell_scripts();
|
||||
AddSC_example_spell_scripts();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -778,39 +778,6 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
case 8063: // Deviate Fish
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spell_id = 0;
|
||||
switch(urand(1,5))
|
||||
{
|
||||
case 1: spell_id = 8064; break; // Sleepy
|
||||
case 2: spell_id = 8065; break; // Invigorate
|
||||
case 3: spell_id = 8066; break; // Shrink
|
||||
case 4: spell_id = 8067; break; // Party Time!
|
||||
case 5: spell_id = 8068; break; // Healthy Spirit
|
||||
}
|
||||
m_caster->CastSpell(m_caster, spell_id, true, NULL);
|
||||
return;
|
||||
}
|
||||
case 8213: // Savory Deviate Delight
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spell_id = 0;
|
||||
switch(urand(1,2))
|
||||
{
|
||||
// Flip Out - ninja
|
||||
case 1: spell_id = (m_caster->getGender() == GENDER_MALE ? 8219 : 8220); break;
|
||||
// Yaaarrrr - pirate
|
||||
case 2: spell_id = (m_caster->getGender() == GENDER_MALE ? 8221 : 8222); break;
|
||||
}
|
||||
m_caster->CastSpell(m_caster,spell_id,true,NULL);
|
||||
return;
|
||||
}
|
||||
case 8593: // Symbol of life (restore creature to life)
|
||||
case 31225: // Shimmering Vessel (restore creature to life)
|
||||
{
|
||||
@@ -857,53 +824,6 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
m_caster->CastCustomSpell(unitTarget, 12721, &deepWoundsDotBasePoints0, NULL, NULL, true, NULL);
|
||||
return;
|
||||
}
|
||||
case 13120: // net-o-matic
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
uint32 spell_id = 0;
|
||||
|
||||
uint32 roll = urand(0, 99);
|
||||
|
||||
if (roll < 2) // 2% for 30 sec self root (off-like chance unknown)
|
||||
spell_id = 16566;
|
||||
else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown)
|
||||
spell_id = 13119;
|
||||
else // normal root
|
||||
spell_id = 13099;
|
||||
|
||||
m_caster->CastSpell(unitTarget,spell_id,true,NULL);
|
||||
return;
|
||||
}
|
||||
case 67019: // Flask of the North
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spell_id;
|
||||
switch(urand(1, 3))
|
||||
{
|
||||
case 1: spell_id = 67016; break;
|
||||
case 2: spell_id = 67017; break;
|
||||
default:spell_id = 67018; break;
|
||||
}
|
||||
|
||||
m_caster->CastSpell(m_caster, spell_id, true, NULL);
|
||||
return;
|
||||
}
|
||||
case 13280: // Gnomish Death Ray
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
if (urand(0, 99) < 15)
|
||||
m_caster->CastSpell(m_caster, 13493, true, NULL); // failure
|
||||
else
|
||||
m_caster->CastSpell(unitTarget, 13279, true, NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
case 13567: // Dummy Trigger
|
||||
{
|
||||
// can be used for different aura triggering, so select by aura
|
||||
@@ -961,22 +881,6 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
m_caster->CastSpell(unitTarget, effect, true);
|
||||
return;
|
||||
}
|
||||
case 16589: // Noggenfogger Elixir
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spell_id = 0;
|
||||
switch (urand(1, 3))
|
||||
{
|
||||
case 1: spell_id = 16595; break;
|
||||
case 2: spell_id = 16593; break;
|
||||
default:spell_id = 16591; break;
|
||||
}
|
||||
|
||||
m_caster->CastSpell(m_caster, spell_id, true, NULL);
|
||||
return;
|
||||
}
|
||||
case 17251: // Spirit Healer Res
|
||||
{
|
||||
if (!unitTarget || !m_originalCaster)
|
||||
@@ -1126,25 +1030,6 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
else // Poultryized! - backfire 20%
|
||||
m_caster->CastSpell(unitTarget, 30504, true, m_CastItem);
|
||||
return;
|
||||
case 33060: // Make a Wish
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spell_id = 0;
|
||||
|
||||
switch(urand(1,5))
|
||||
{
|
||||
case 1: spell_id = 33053; break; // Mr Pinchy's Blessing
|
||||
case 2: spell_id = 33057; break; // Summon Mighty Mr. Pinchy
|
||||
case 3: spell_id = 33059; break; // Summon Furious Mr. Pinchy
|
||||
case 4: spell_id = 33062; break; // Tiny Magical Crawdad
|
||||
case 5: spell_id = 33064; break; // Mr. Pinchy's Gift
|
||||
}
|
||||
|
||||
m_caster->CastSpell(m_caster, spell_id, true, NULL);
|
||||
return;
|
||||
}
|
||||
case 34665: //Administer Antidote
|
||||
{
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT
|
||||
@@ -1369,24 +1254,6 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
m_caster->CastSpell(m_caster, 30452, true, NULL);
|
||||
return;
|
||||
}
|
||||
case 52308: // Take Sputum Sample
|
||||
{
|
||||
switch(effIndex)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
uint32 spellID = SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 0);
|
||||
uint32 reqAuraID = SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 1);
|
||||
|
||||
if (m_caster->HasAuraEffect(reqAuraID,0))
|
||||
m_caster->CastSpell(m_caster,spellID,true,NULL);
|
||||
return;
|
||||
}
|
||||
case 1:
|
||||
return; // additional data for dummy[0]
|
||||
}
|
||||
return;
|
||||
}
|
||||
case 52759: // Ancestral Awakening
|
||||
if (!unitTarget)
|
||||
return;
|
||||
@@ -1400,21 +1267,6 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
case 58418: // Portal to Orgrimmar
|
||||
case 58420: // Portal to Stormwind
|
||||
return; // implemented in EffectScript[0]
|
||||
case 59640: // Underbelly Elixir
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spell_id = 0;
|
||||
switch(urand(1,3))
|
||||
{
|
||||
case 1: spell_id = 59645; break;
|
||||
case 2: spell_id = 59831; break;
|
||||
case 3: spell_id = 59843; break;
|
||||
}
|
||||
m_caster->CastSpell(m_caster,spell_id,true,NULL);
|
||||
return;
|
||||
}
|
||||
case 62324: // Throw Passenger
|
||||
{
|
||||
if (m_targets.HasTraj())
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
|
||||
|
||||
enum NPCEntries
|
||||
{
|
||||
NPC_DOOMGUARD = 11859,
|
||||
@@ -32,34 +31,6 @@ enum NPCEntries
|
||||
NPC_IMP = 416,
|
||||
};
|
||||
|
||||
class spell_gen_remove_flight_auras : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_remove_flight_auras() : SpellScriptLoader("spell_gen_remove_flight_auras") {}
|
||||
|
||||
class spell_gen_remove_flight_auras_SpellScript : public SpellScript
|
||||
{
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit *target = GetHitUnit();
|
||||
if (!target)
|
||||
return;
|
||||
target->RemoveAurasByType(SPELL_AURA_FLY);
|
||||
target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_gen_remove_flight_auras_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gen_remove_flight_auras_SpellScript;
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_pet_summoned : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -112,12 +83,40 @@ public:
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gen_pet_summonedSpellScript;
|
||||
return new spell_gen_pet_summonedSpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_remove_flight_auras : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_remove_flight_auras() : SpellScriptLoader("spell_gen_remove_flight_auras") {}
|
||||
|
||||
class spell_gen_remove_flight_auras_SpellScript : public SpellScript
|
||||
{
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit *target = GetHitUnit();
|
||||
if (!target)
|
||||
return;
|
||||
target->RemoveAurasByType(SPELL_AURA_FLY);
|
||||
target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_gen_remove_flight_auras_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gen_remove_flight_auras_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_generic_spell_scripts()
|
||||
{
|
||||
new spell_gen_remove_flight_auras;
|
||||
new spell_gen_pet_summoned;
|
||||
new spell_gen_pet_summoned();
|
||||
new spell_gen_remove_flight_auras();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,460 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Scripts for spells with SPELLFAMILY_GENERIC spells used by items.
|
||||
* Ordered alphabetically using scriptname.
|
||||
* Scriptnames of files in this file should be prefixed with "spell_item_".
|
||||
*/
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
|
||||
enum eDeviateFishSpells
|
||||
{
|
||||
SPELL_SLEEPY = 8064,
|
||||
SPELL_INVIGORATE = 8065,
|
||||
SPELL_SHRINK = 8066,
|
||||
SPELL_PARTY_TIME = 8067,
|
||||
SPELL_HEALTHY_SPIRIT = 8068,
|
||||
};
|
||||
|
||||
// 8063 Deviate Fish
|
||||
class spell_item_deviate_fish : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_deviate_fish() : SpellScriptLoader("spell_item_deviate_fish") { }
|
||||
|
||||
class spell_item_deviate_fish_SpellScript : public SpellScript
|
||||
{
|
||||
public:
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
for (uint32 spellId = SPELL_SLEEPY; spellId <= SPELL_HEALTHY_SPIRIT; ++spellId)
|
||||
if (!sSpellStore.LookupEntry(spellId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* pCaster = GetCaster();
|
||||
if (pCaster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spellId = urand(SPELL_SLEEPY, SPELL_HEALTHY_SPIRIT);
|
||||
pCaster->CastSpell(pCaster, spellId, true, NULL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_item_deviate_fish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_item_deviate_fish_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum eFlaskOfTheNorthSpells
|
||||
{
|
||||
SPELL_FLASK_OF_THE_NORTH_TRIGGERED1 = 67016,
|
||||
SPELL_FLASK_OF_THE_NORTH_TRIGGERED2 = 67017,
|
||||
SPELL_FLASK_OF_THE_NORTH_TRIGGERED3 = 67018,
|
||||
};
|
||||
|
||||
// 67019 Flask of the North
|
||||
class spell_item_flask_of_the_north : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_flask_of_the_north() : SpellScriptLoader("spell_item_flask_of_the_north") { }
|
||||
|
||||
class spell_item_flask_of_the_north_SpellScript : public SpellScript
|
||||
{
|
||||
public:
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_FLASK_OF_THE_NORTH_TRIGGERED1))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_FLASK_OF_THE_NORTH_TRIGGERED2))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_FLASK_OF_THE_NORTH_TRIGGERED3))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* pCaster = GetCaster();
|
||||
if (pCaster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spellId = urand(SPELL_FLASK_OF_THE_NORTH_TRIGGERED1, SPELL_FLASK_OF_THE_NORTH_TRIGGERED3);
|
||||
pCaster->CastSpell(pCaster, spellId, true, NULL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_item_flask_of_the_north_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_item_flask_of_the_north_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum eGnomishDeathRay
|
||||
{
|
||||
SPELL_GNOMISH_DEATH_RAY_SELF = 13493,
|
||||
SPELL_GNOMISH_DEATH_RAY_TARGET = 13279,
|
||||
};
|
||||
|
||||
// 13280 Gnomish Death Ray
|
||||
class spell_item_gnomish_death_ray : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_gnomish_death_ray() : SpellScriptLoader("spell_item_gnomish_death_ray") { }
|
||||
|
||||
class spell_item_gnomish_death_ray_SpellScript : public SpellScript
|
||||
{
|
||||
public:
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_GNOMISH_DEATH_RAY_SELF))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_GNOMISH_DEATH_RAY_TARGET))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* pTarget = GetHitUnit())
|
||||
{
|
||||
Unit* pCaster = GetCaster();
|
||||
if (urand(0, 99) < 15)
|
||||
pCaster->CastSpell(pCaster, SPELL_GNOMISH_DEATH_RAY_SELF, true, NULL); // failure
|
||||
else
|
||||
pCaster->CastSpell(pTarget, SPELL_GNOMISH_DEATH_RAY_TARGET, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_item_gnomish_death_ray_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_item_gnomish_death_ray_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum eMakeAWish
|
||||
{
|
||||
SPELL_MR_PINCHYS_BLESSING = 33053,
|
||||
SPELL_SUMMON_MIGHTY_MR_PINCHY = 33057,
|
||||
SPELL_SUMMON_FURIOUS_MR_PINCHY = 33059,
|
||||
SPELL_TINY_MAGICAL_CRAWDAD = 33062,
|
||||
SPELL_MR_PINCHYS_GIFT = 33064,
|
||||
};
|
||||
|
||||
// 33060 Make a Wish
|
||||
class spell_item_make_a_wish : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_make_a_wish() : SpellScriptLoader("spell_item_make_a_wish") { }
|
||||
|
||||
class spell_item_make_a_wish_SpellScript : public SpellScript
|
||||
{
|
||||
public:
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_MR_PINCHYS_BLESSING))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_SUMMON_MIGHTY_MR_PINCHY))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_SUMMON_FURIOUS_MR_PINCHY))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_TINY_MAGICAL_CRAWDAD))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_MR_PINCHYS_GIFT))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* pCaster = GetCaster();
|
||||
if (pCaster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spellId = SPELL_MR_PINCHYS_GIFT;
|
||||
switch (urand(1, 5))
|
||||
{
|
||||
case 1: spellId = SPELL_MR_PINCHYS_BLESSING; break;
|
||||
case 2: spellId = SPELL_SUMMON_MIGHTY_MR_PINCHY; break;
|
||||
case 3: spellId = SPELL_SUMMON_FURIOUS_MR_PINCHY; break;
|
||||
case 4: spellId = SPELL_TINY_MAGICAL_CRAWDAD; break;
|
||||
}
|
||||
pCaster->CastSpell(pCaster, spellId, true, NULL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_item_make_a_wish_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_item_make_a_wish_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum eNetOMaticSpells
|
||||
{
|
||||
SPELL_NET_O_MATIC_TRIGGERED1 = 16566,
|
||||
SPELL_NET_O_MATIC_TRIGGERED2 = 13119,
|
||||
SPELL_NET_O_MATIC_TRIGGERED3 = 13099,
|
||||
};
|
||||
|
||||
// 13120 Net-o-Matic
|
||||
class spell_item_net_o_matic : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_net_o_matic() : SpellScriptLoader("spell_item_net_o_matic") { }
|
||||
|
||||
class spell_item_net_o_matic_SpellScript : public SpellScript
|
||||
{
|
||||
public:
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_NET_O_MATIC_TRIGGERED1))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_NET_O_MATIC_TRIGGERED2))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_NET_O_MATIC_TRIGGERED3))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* pTarget = GetHitUnit())
|
||||
{
|
||||
uint32 spellId = SPELL_NET_O_MATIC_TRIGGERED3;
|
||||
uint32 roll = urand(0, 99);
|
||||
if (roll < 2) // 2% for 30 sec self root (off-like chance unknown)
|
||||
spellId = SPELL_NET_O_MATIC_TRIGGERED1;
|
||||
else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown)
|
||||
spellId = SPELL_NET_O_MATIC_TRIGGERED2;
|
||||
|
||||
GetCaster()->CastSpell(pTarget, spellId, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_item_net_o_matic_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_item_net_o_matic_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum eNoggenfoggerElixirSpells
|
||||
{
|
||||
SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1 = 16595,
|
||||
SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2 = 16593,
|
||||
SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3 = 16591,
|
||||
};
|
||||
|
||||
// 16589 Noggenfogger Elixir
|
||||
class spell_item_noggenfogger_elixir : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_noggenfogger_elixir() : SpellScriptLoader("spell_item_noggenfogger_elixir") { }
|
||||
|
||||
class spell_item_noggenfogger_elixir_SpellScript : public SpellScript
|
||||
{
|
||||
public:
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* pCaster = GetCaster();
|
||||
if (pCaster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3;
|
||||
switch (urand(1, 3))
|
||||
{
|
||||
case 1: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1; break;
|
||||
case 2: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2; break;
|
||||
}
|
||||
|
||||
pCaster->CastSpell(pCaster, spellId, true, NULL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_item_noggenfogger_elixir_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_item_noggenfogger_elixir_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum eSavoryDeviateDelight
|
||||
{
|
||||
SPELL_FLIP_OUT_MALE = 8219,
|
||||
SPELL_FLIP_OUT_FEMALE = 8220,
|
||||
SPELL_YAAARRRR_MALE = 8221,
|
||||
SPELL_YAAARRRR_FEMALE = 8222,
|
||||
};
|
||||
|
||||
// 8213 Savory Deviate Delight
|
||||
class spell_item_savory_deviate_delight : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_savory_deviate_delight() : SpellScriptLoader("spell_item_savory_deviate_delight") { }
|
||||
|
||||
class spell_item_savory_deviate_delight_SpellScript : public SpellScript
|
||||
{
|
||||
public:
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
for (uint32 spellId = SPELL_FLIP_OUT_MALE; spellId <= SPELL_YAAARRRR_FEMALE; ++spellId)
|
||||
if (!sSpellStore.LookupEntry(spellId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* pCaster = GetCaster();
|
||||
if (pCaster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spellId = 0;
|
||||
switch (urand(1, 2))
|
||||
{
|
||||
// Flip Out - ninja
|
||||
case 1: spellId = (pCaster->getGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break;
|
||||
// Yaaarrrr - pirate
|
||||
case 2: spellId = (pCaster->getGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break;
|
||||
}
|
||||
pCaster->CastSpell(pCaster, spellId, true, NULL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_item_savory_deviate_delight_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_item_savory_deviate_delight_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum eUnderbellyElixirSpells
|
||||
{
|
||||
SPELL_UNDERBELLY_ELIXIR_TRIGGERED1 = 59645,
|
||||
SPELL_UNDERBELLY_ELIXIR_TRIGGERED2 = 59831,
|
||||
SPELL_UNDERBELLY_ELIXIR_TRIGGERED3 = 59843,
|
||||
};
|
||||
|
||||
// 59640 Underbelly Elixir
|
||||
class spell_item_underbelly_elixir : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_underbelly_elixir() : SpellScriptLoader("spell_item_underbelly_elixir") { }
|
||||
|
||||
class spell_item_underbelly_elixir_SpellScript : public SpellScript
|
||||
{
|
||||
public:
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_UNDERBELLY_ELIXIR_TRIGGERED1))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_UNDERBELLY_ELIXIR_TRIGGERED2))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SPELL_UNDERBELLY_ELIXIR_TRIGGERED3))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* pCaster = GetCaster();
|
||||
if (pCaster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED3;
|
||||
switch (urand(1, 3))
|
||||
{
|
||||
case 1: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED1; break;
|
||||
case 2: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED2; break;
|
||||
}
|
||||
pCaster->CastSpell(pCaster, spellId, true, NULL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_item_underbelly_elixir_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_item_underbelly_elixir_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_item_spell_scripts()
|
||||
{
|
||||
new spell_item_deviate_fish();
|
||||
new spell_item_flask_of_the_north();
|
||||
new spell_item_gnomish_death_ray();
|
||||
new spell_item_make_a_wish();
|
||||
new spell_item_net_o_matic();
|
||||
new spell_item_noggenfogger_elixir();
|
||||
new spell_item_savory_deviate_delight();
|
||||
new spell_item_underbelly_elixir();
|
||||
}
|
||||
@@ -158,8 +158,93 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// http://www.wowhead.com/quest=12683 Burning to Help
|
||||
// 52308 Take Sputum Sample
|
||||
class spell_q12683_take_sputum_sample : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q12683_take_sputum_sample() : SpellScriptLoader("spell_q12683_take_sputum_sample") { }
|
||||
|
||||
class spell_q12683_take_sputum_sample_SpellScript : public SpellScript
|
||||
{
|
||||
public:
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
uint32 reqAuraId = SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), 1);
|
||||
|
||||
Unit* pCaster = GetCaster();
|
||||
if (pCaster->HasAuraEffect(reqAuraId, 0))
|
||||
{
|
||||
uint32 spellId = SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), 0);
|
||||
pCaster->CastSpell(pCaster, spellId, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_q12683_take_sputum_sample_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q12683_take_sputum_sample_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum eQuest12937Spells
|
||||
{
|
||||
SPELL_TRIGGER_AID_OF_THE_EARTHEN = 55809,
|
||||
NPC_FALLEN_EARTHEN_DEFENDER = 30035,
|
||||
};
|
||||
|
||||
// http://www.wowhead.com/quest=12937 Relief for the Fallen
|
||||
// 55804 Healing Finished
|
||||
class spell_q12937_relief_for_the_fallen : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q12937_relief_for_the_fallen() : SpellScriptLoader("spell_q12937_relief_for_the_fallen") { }
|
||||
|
||||
class spell_q12937_relief_for_the_fallen_SpellScript : public SpellScript
|
||||
{
|
||||
public:
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_TRIGGER_AID_OF_THE_EARTHEN))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* pCaster = GetCaster();
|
||||
if (Player* pPlayer = pCaster->ToPlayer())
|
||||
{
|
||||
if(Creature* pTarget = GetHitCreature())
|
||||
{
|
||||
pPlayer->CastSpell(pPlayer, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true, NULL);
|
||||
pPlayer->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER, pTarget->GetGUID());
|
||||
pTarget->ForcedDespawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_q12937_relief_for_the_fallen_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q12937_relief_for_the_fallen_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_quest_spell_scripts()
|
||||
{
|
||||
new spell_q11587_arcane_prisoner_rescue();
|
||||
new spell_q11730_ultrasonic_screwdriver();
|
||||
new spell_q12683_take_sputum_sample();
|
||||
new spell_q12937_relief_for_the_fallen();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user