Jump to content

"Say" Client that Player regenerate no mana Aura 294


Recommended Posts

  • 41 years later...

Hi all,

i want fix the spell Aura 294.

Only one Spell 62692 has this Aura. This is a important spell from General Vezax (Ulduar).

I have a solution for no mana reg on coreside, but on clientside the player gets mana from manareg.

How I can "say" the client that the player has no manareg?

Relatet Spell from 62692 is an extra effect triggered with spell 64848

my code part till now:

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 256ba23..cff540b 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -2157,8 +2157,11 @@ void Player::RegenerateAll(uint32 diff)
    }

    Regenerate(POWER_ENERGY, diff);
-
-    Regenerate(POWER_MANA, diff);
+    
+    if (!HasAuraType(SPELL_AURA_STOP_NATURAL_MANA_REGEN))
+    {
+        Regenerate(POWER_MANA, diff);
+    }

    if (getClass() == CLASS_DEATH_KNIGHT)
        Regenerate(POWER_RUNE, diff);
diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h
index 5c6b3e5..0aaa715 100644
--- a/src/game/SpellAuraDefines.h
+++ b/src/game/SpellAuraDefines.h
@@ -329,7 +329,7 @@ enum AuraType
    SPELL_AURA_MOD_QUEST_XP_PCT = 291,
    SPELL_AURA_OPEN_STABLE = 292,
    SPELL_AURA_ADD_MECHANIC_ABILITIES = 293,
-    SPELL_AURA_294 = 294,
+    SPELL_AURA_STOP_NATURAL_MANA_REGEN = 294,
    SPELL_AURA_295 = 295,
    SPELL_AURA_296 = 296,
    SPELL_AURA_297 = 297,
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 55cad1c..ec437f2 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -345,7 +345,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
    &Aura::HandleNoImmediateEffect,                         //291 SPELL_AURA_MOD_QUEST_XP_PCT           implemented in Player::GiveXP
    &Aura::HandleAuraOpenStable,                            //292 call stabled pet
    &Aura::HandleAuraAddMechanicAbilities,                  //293 SPELL_AURA_ADD_MECHANIC_ABILITIES  replaces target's action bars with a predefined spellset
-    &Aura::HandleNULL,                                      //294 2 spells, possible prevent mana regen
+    &Aura::HandleAuraStopNaturalManaRegen,                  //294 No natural mana regen                 implemented in Player:Regenerate
    &Aura::HandleUnused,                                    //295 unused (3.2.2a)
    &Aura::HandleAuraSetVehicle,                            //296 SPELL_AURA_SET_VEHICLE_ID sets vehicle on target
    &Aura::HandleNULL,                                      //297 1 spell (counter spell school?)
@@ -10775,3 +10775,33 @@ void Aura::HandleAuraFactionChange(bool apply, bool real)
        target->setFaction(newFaction);

}
+
+void Aura::HandleAuraStopNaturalManaRegen(bool apply, bool real)
+{
+    if (!real)
+        return;
+    
+    Unit* target = GetTarget();
+
+    if (!target)
+        return;
+
+    Unit* caster = GetCaster();
+
+    if (!caster)
+        return;
+
+    switch (GetId())
+    {
+        case 62692:                                                     // Aura of Despair
+            if (apply)
+            {
+                target->CastSpell(target, 64848 , true, 0, 0, caster->GetObjectGuid());
+            }
+            else
+            {
+                target->RemoveAurasDueToSpell(64848);
+            }
+            break;
+    }
+}
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index 9fd9461..84545ed 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -374,6 +374,7 @@ class MANGOS_DLL_SPEC Aura
        void HandleAuraAddMechanicAbilities(bool apply, bool Real);
        void HandleAuraSetVehicle(bool apply, bool Real);
        void HandleAuraFactionChange(bool apply, bool real);
+        void HandleAuraStopNaturalManaRegen(bool apply, bool real);

        virtual ~Aura();

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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