Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/Handlers/ChatHandler.cpp
	src/server/game/Spells/Auras/SpellAuraEffects.cpp
	src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
	src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
	src/server/scripts/Spells/spell_rogue.cpp
This commit is contained in:
Vincent_Michael committed 2014-01-24 19:36:32 +01:00
commit a5ade26fa0
76 files changed
+576 -465

No files matched your search

+105
View File
@@ -25,6 +25,7 @@
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "Containers.h"
enum RogueSpells
{
@@ -33,6 +34,10 @@ enum RogueSpells
SPELL_ROGUE_CHEAT_DEATH_COOLDOWN = 31231,
SPELL_ROGUE_CRIPPLING_POISON = 3409,
SPELL_ROGUE_GLYPH_OF_PREPARATION = 56819,
SPELL_ROGUE_KILLING_SPREE = 51690,
SPELL_ROGUE_KILLING_SPREE_TELEPORT = 57840,
SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG = 57841,
SPELL_ROGUE_KILLING_SPREE_DMG_BUFF = 61851,
SPELL_ROGUE_MASTER_OF_SUBTLETY_DAMAGE_PERCENT = 31665,
SPELL_ROGUE_MASTER_OF_SUBTLETY_PASSIVE = 31223,
SPELL_ROGUE_MASTER_OF_SUBTLETY_PERIODIC = 31666,
@@ -333,6 +338,105 @@ class spell_rog_deadly_poison : public SpellScriptLoader
}
};
// 51690 - Killing Spree
class spell_rog_killing_spree : public SpellScriptLoader
{
public:
spell_rog_killing_spree() : SpellScriptLoader("spell_rog_killing_spree") { }
class spell_rog_killing_spree_SpellScript : public SpellScript
{
PrepareSpellScript(spell_rog_killing_spree_SpellScript);
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.empty() || GetCaster()->GetVehicleBase())
FinishCast(SPELL_FAILED_OUT_OF_RANGE);
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Aura* aura = GetCaster()->GetAura(SPELL_ROGUE_KILLING_SPREE))
{
if (spell_rog_killing_spree_AuraScript* script = dynamic_cast<spell_rog_killing_spree_AuraScript*>(aura->GetScriptByName("spell_rog_killing_spree")))
script->AddTarget(GetHitUnit());
}
}
void Register() OVERRIDE
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rog_killing_spree_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_rog_killing_spree_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_rog_killing_spree_SpellScript();
}
class spell_rog_killing_spree_AuraScript : public AuraScript
{
PrepareAuraScript(spell_rog_killing_spree_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_KILLING_SPREE_TELEPORT)
|| !sSpellMgr->GetSpellInfo(SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG)
|| !sSpellMgr->GetSpellInfo(SPELL_ROGUE_KILLING_SPREE_DMG_BUFF))
return false;
return true;
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->CastSpell(GetTarget(), SPELL_ROGUE_KILLING_SPREE_DMG_BUFF, true);
}
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
while (!_targets.empty())
{
uint64 guid = Trinity::Containers::SelectRandomContainerElement(_targets);
if (Unit* target = ObjectAccessor::GetUnit(*GetTarget(), guid))
{
GetTarget()->CastSpell(target, SPELL_ROGUE_KILLING_SPREE_TELEPORT, true);
GetTarget()->CastSpell(target, SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG, true);
break;
}
else
_targets.remove(guid);
}
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(SPELL_ROGUE_KILLING_SPREE_DMG_BUFF);
}
void Register() OVERRIDE
{
AfterEffectApply += AuraEffectApplyFn(spell_rog_killing_spree_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_killing_spree_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
AfterEffectRemove += AuraEffectRemoveFn(spell_rog_killing_spree_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
public:
void AddTarget(Unit* target)
{
_targets.push_back(target->GetGUID());
}
private:
std::list<uint64> _targets;
};
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_rog_killing_spree_AuraScript();
}
};
// 31666 - Master of Subtlety
class spell_rog_master_of_subtlety : public SpellScriptLoader
{
@@ -863,6 +967,7 @@ void AddSC_rogue_spell_scripts()
new spell_rog_crippling_poison();
new spell_rog_cut_to_the_chase();
new spell_rog_deadly_poison();
new spell_rog_killing_spree();
new spell_rog_master_of_subtlety();
new spell_rog_nerves_of_steel();
new spell_rog_overkill();