Jump to content

[11695] Implement spell Dream Fog (24780)


Schmoozerd
 Share

Recommended Posts

Description of the feature?

Implement spell 24780 (switching target every 10s)

For which repository revision was the patch created?

11662

Is there a thread in the bug report section or at lighthouse?

no

Who has been writing this patch?

me

Small Note:

This spell is used with sapphiron adds (blizzard) - and they do change target every 10s, so I think it is safe to assume that is caused by this spell;

according to click this spell is also used with the emerald dragons (which is likely from the naming), and there the adds should also behave this way (switching targets now and then)

As the adds also change targets aside from the 10s ticker, we can assume that they also select targets by threat (ie healers) - so I think this can only work proper if the threat is dropped, too.

From 2518a1713242b3889631e1fb401262742585857e Mon Sep 17 00:00:00 2001
From: Schmoozerd <[email protected]>
Date: Sun, 26 Jun 2011 12:42:44 +0200
Subject: [PATCH 1/6] Implement spell 24780

---
src/game/SpellAuras.cpp |   23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 4d01f1b..c3555a3 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1159,8 +1159,27 @@ void Aura::TriggerSpell()
//                    case 24379: break;
//                    // Happy Pet
//                    case 24716: break;
-//                    // Dream Fog
-//                    case 24780: break;
+                    case 24780:                             // Dream Fog
+                    {
+                        // Note: In 1.12 triggered spell 24781 still exists, need to script dummy effect for this spell then
+                        // Select an unfriendly enemy in 100y range and attack it
+                        if (target->GetTypeId() != TYPEID_UNIT)
+                            return;
+
+                        ThreatList const& tList = target->getThreatManager().getThreatList();
+                        for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr)
+                        {
+                            Unit* pUnit = target->GetMap()->GetUnit((*itr)->getUnitGuid());
+
+                            if (pUnit && target->getThreatManager().getThreat(pUnit))
+                                target->getThreatManager().modifyThreatPercent(pUnit, -100);
+                        }
+
+                        if (Unit* pEnemy = target->SelectRandomUnfriendlyTarget(target->getVictim(), 100.0f))
+                            ((Creature*)target)->AI()->AttackStart(pEnemy);
+
+                        return;
+                    }
//                    // Cannon Prep
//                    case 24832: break;
                    case 24834:                             // Shadow Bolt Whirl
-- 
1.7.3.1.msysgit.0

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use