Skip to content

Instantly share code, notes, and snippets.

@neo-mat
Created January 30, 2012 22:40
Show Gist options
  • Save neo-mat/1707263 to your computer and use it in GitHub Desktop.
Save neo-mat/1707263 to your computer and use it in GitHub Desktop.
Rogue Killing Spree
diff --git a/sql/world_updates/2012-01-31_02-35_killing_spree.sql b/sql/world_updates/2012-01-31_02-35_killing_spree.sql
new file mode 100644
index 0000000..b1a98e2
--- /dev/null
+++ b/sql/world_updates/2012-01-31_02-35_killing_spree.sql
@@ -0,0 +1 @@
+INSERT INTO `spell_effects_override` (`spellId`, `EffectCustomFlag`) VALUES ('57840', '4');
diff --git a/src/arcemu-world/SpellEffects.cpp b/src/arcemu-world/SpellEffects.cpp
index 9e019b8..a8b8827 100644
--- a/src/arcemu-world/SpellEffects.cpp
+++ b/src/arcemu-world/SpellEffects.cpp
@@ -910,7 +910,7 @@ void Spell::SpellEffectTeleportUnits(uint32 i) // Teleport Units
if(unitTarget == m_caster)
{
/* try to get a selection */
- unitTarget = m_caster->GetMapMgr()->GetUnit(p_caster->GetSelection());
+ unitTarget = m_caster->GetMapMgr()->GetUnit(m_targets.m_unitTarget);
if((!unitTarget) || !isAttackable(p_caster, unitTarget, !(GetProto()->c_is_flags & SPELL_FLAG_IS_TARGETINGSTEALTHED)) || (unitTarget->CalcDistance(p_caster) > 28.0f))
{
return;
diff --git a/src/scripts/src/SpellHandlers/RogueSpells.cpp b/src/scripts/src/SpellHandlers/RogueSpells.cpp
index 725eb32..e4ff1d9 100644
--- a/src/scripts/src/SpellHandlers/RogueSpells.cpp
+++ b/src/scripts/src/SpellHandlers/RogueSpells.cpp
@@ -230,6 +230,47 @@ bool PreyOnTheWeakPeriodicDummy(uint32 i, Aura* a, bool apply)
return true;
}
+bool KillingSpreePeriodicDummy(uint32 i, Aura* a, bool apply)
+{
+ Unit* m_target = a->GetTarget();
+ if(!m_target->IsPlayer())
+ return true;
+
+ Player* p_target = TO_PLAYER(m_target);
+
+ for(std::set<Object*>::iterator itr = p_target->GetInRangeSetBegin(); itr != p_target->GetInRangeSetEnd(); ++itr)
+ {
+ float r = 10.0f;
+ LocationVector source = p_target->GetPosition();
+ float dist = (*itr)->CalcDistance(source);
+
+ if(dist <= r)
+ {
+ if(!(*itr)->IsUnit() || !TO_UNIT((*itr))->isAlive())
+ continue;
+
+ uint64 spellTarget = (*itr)->GetGUID();
+ p_target->CastSpell(spellTarget, 57840, true);
+ p_target->CastSpell(spellTarget, 57841, true);
+ }
+
+ }
+ return true;
+
+}
+
+bool KillingSpreeEffectDummy(uint32 i, Spell* s)
+{
+ Player* playerTarget = s->p_caster;
+
+ if(playerTarget == NULL)
+ return false;
+
+ playerTarget->CastSpell(playerTarget, 61851, true);
+
+ return true;
+}
+
void SetupRogueSpells(ScriptMgr* mgr)
{
mgr->register_dummy_spell(5938, &Shiv);
@@ -266,4 +307,7 @@ void SetupRogueSpells(ScriptMgr* mgr)
0
};
mgr->register_dummy_aura(preyontheweakids, &PreyOnTheWeakPeriodicDummy);
+
+ mgr->register_dummy_aura(51690, &KillingSpreePeriodicDummy);
+ mgr->register_dummy_spell(51690, &KillingSpreeEffectDummy);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment