Add more methods to SpellScript.

Spells cleanup: move spells from the core to scripts.

* Shaman spells: 39610 Mana Tide Totem, 1535 Fire Nova (and ranks)
* Death Knight spells: 55090 Scourge Strike (and ranks), 49158 Corpse Explosion (and ranks), 50524 Runic Power Feed
* Druid spells: 54846 Glyph of Starfire
* Warlock spells: 6201 Create Healthstone (and ranks), 47422 Everlasting Affliction, 47193 Demonic Empowerment, 63521 Guarded by The Light
* Hunter spells: 37506 Scatter Shot, 53412 Invigoration, 53209 Chimera Shot
* Quest spells: 45449 Arcane Prisoner Rescue (quest 11587), 46023 The Ultrasonic Screwdriver (quest 11730). Closes issue #3068

Clean old code for hunter's Heart of the Phoenix, move script effect of hunter's Master's Call to corresponding script.
Move DK's Hungering Cold to spell_scripts table (needs DB support)

--HG--
branch : trunk
This commit is contained in:
azazel committed 2010-08-18 00:20:23 +06:00
1 parent 0284ed4cfe
commit 66fcd52106
12 files changed
+1127 -520

No files matched your search

+60 -1
View File
@@ -22,8 +22,67 @@
*/
#include "ScriptPCH.h"
#include "SpellAuraEffects.h"
enum DruidSpells
{
DRUID_INCREASED_MOONFIRE_DURATION = 38414,
DRUID_NATURES_SPLENDOR = 57865
};
// 54846 Glyph of Starfire
class spell_dru_glyph_of_starfire : public SpellHandlerScript
{
public:
spell_dru_glyph_of_starfire() : SpellHandlerScript("spell_dru_glyph_of_starfire") { }
class spell_dru_glyph_of_starfire_SpellScript : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
{
if (!sSpellStore.LookupEntry(DRUID_INCREASED_MOONFIRE_DURATION))
return false;
if (!sSpellStore.LookupEntry(DRUID_NATURES_SPLENDOR))
return false;
return true;
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit())
if (AuraEffect const * aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE,SPELLFAMILY_DRUID, 0x00000002, 0, 0, caster->GetGUID()))
{
Aura* aura = aurEff->GetBase();
uint32 countMin = aura->GetMaxDuration();
uint32 countMax = 18000;
if (caster->HasAura(DRUID_INCREASED_MOONFIRE_DURATION))
countMax += 3000;
if (caster->HasAura(DRUID_NATURES_SPLENDOR))
countMax += 3000;
if (countMin < countMax)
{
aura->SetDuration(uint32(aura->GetDuration() + 3000));
aura->SetMaxDuration(countMin + 3000);
}
}
}
void Register()
{
EffectHandlers += EffectHandlerFn(spell_dru_glyph_of_starfire_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_dru_glyph_of_starfire_SpellScript();
}
};
void AddSC_druid_spell_scripts()
{
new spell_dru_glyph_of_starfire();
}