more updates

This commit is contained in:
joschiwald
2012-06-03 02:35:00 +02:00
parent 1bfd6605af
commit 7e454b26ac
15 changed files with 882 additions and 544 deletions
@@ -15,13 +15,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptPCH.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "hyjal.h"
#include "hyjal_trash.h"
#define SPELL_CLEAVE 31436
#define SPELL_WARSTOMP 31480
#define SPELL_MARK 31447
enum Spells
{
SPELL_CLEAVE = 31436,
SPELL_WARSTOMP = 31480,
SPELL_MARK = 31447,
SPELL_MARK_DAMAGE = 31463
};
#define SOUND_ONDEATH 11018
@@ -162,22 +169,10 @@ public:
WarStompTimer = 60000;
} else WarStompTimer -= diff;
if (me->HasAura(SPELL_MARK))
me->RemoveAurasDueToSpell(SPELL_MARK);
if (MarkTimer <= diff)
{
//cast dummy, useful for bos addons
me->CastCustomSpell(me, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, me->GetGUID());
DoCastAOE(SPELL_MARK);
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA)
{
target->CastSpell(target, SPELL_MARK, true);//only cast on mana users
}
}
MarkTimerBase -= 5000;
if (MarkTimerBase < 5500)
MarkTimerBase = 5500;
@@ -201,7 +196,80 @@ public:
};
class MarkTargetFilter
{
public:
bool operator()(Unit* target) const
{
if (target->getPowerType() != POWER_MANA)
return true;
return false;
}
};
class spell_mark_of_kazrogal : public SpellScriptLoader
{
public:
spell_mark_of_kazrogal() : SpellScriptLoader("spell_mark_of_kazrogal") { }
class spell_mark_of_kazrogal_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mark_of_kazrogal_SpellScript);
void FilterTargets(std::list<Unit*>& unitList)
{
unitList.remove_if(MarkTargetFilter());
}
void Register()
{
OnUnitTargetSelect += SpellUnitTargetFn(spell_mark_of_kazrogal_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
class spell_mark_of_kazrogal_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mark_of_kazrogal_AuraScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_DAMAGE))
return false;
return true;
}
void OnPeriodic(AuraEffect const* aurEff)
{
Unit* target = GetTarget();
if (target->GetPower(POWER_MANA) == 0)
{
target->CastSpell(target, SPELL_MARK_DAMAGE, true, NULL, aurEff);
// Remove aura
SetDuration(0);
}
}
void Register()
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazrogal_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
}
};
SpellScript* GetSpellScript() const
{
return new spell_mark_of_kazrogal_SpellScript();
}
AuraScript* GetAuraScript() const
{
return new spell_mark_of_kazrogal_AuraScript();
}
};
void AddSC_boss_kazrogal()
{
new boss_kazrogal();
new spell_mark_of_kazrogal();
}