mangosArchives / Mangos-One-server-old

This repo has been moved to https://githubs.com/mangosone/server
http://getmangos.eu/
GNU General Public License v2.0
95 stars 54 forks source link

Healing Stream/Mana Spring Totem #20

Closed DomGries closed 12 years ago

DomGries commented 12 years ago

"are immune to their own spell"

https://github.com/mangos-one/server/commit/850d0db97384e3934710a49b84fe87174a05a550#comments

Nighoo commented 12 years ago

patch was not created on latest mangos-one version?

Ve1vet commented 12 years ago

Stfx, first of all, this patch not for mangos-one :) m_sender not declared. Second, don't invent the bicycle :) Totems fixes very easy, just put next code at the start of function bool Totem::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const next code in which Laise broke totems:

switch(spellInfo->SpellFamilyName) { case SPELLFAMILY_SHAMAN: if ( spellInfo->IsFitToFamilyMask(UI64LIT(0x00000002000)) || spellInfo->IsFitToFamilyMask(UI64LIT(0x00000004000)) ) return false; break; default: break; }

This is check for Healing Stream Totem & Mana Spring Totem :) Here is commit for totem.cpp => https://github.com/FreestylerUA/mangos-bc/commit/705f65307e89f7b11872a638955999e7d142beb8 Best regards ;)

Nighoo commented 12 years ago

Could be inserted into repo, works fine, ofc.

diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp
index 9b09bff..f029473 100644
--- a/src/game/Totem.cpp
+++ b/src/game/Totem.cpp
@@ -187,6 +187,18 @@ void Totem::SetTypeBySummonSpell(SpellEntry const * spellProto)

 bool Totem::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const
 {
+    // Check for Mana Spring & Healing Stream totems
+    switch (spellInfo->SpellFamilyName)
+    {
+        case SPELLFAMILY_SHAMAN:
+            if (spellInfo->IsFitToFamilyMask(UI64LIT(0x00000002000)) ||
+                spellInfo->IsFitToFamilyMask(UI64LIT(0x00000004000)))
+                return false;
+            break;
+        default:
+            break;
+    }
+
     switch(spellInfo->Effect[index])
     {
         case SPELL_EFFECT_ATTACK_ME:

thanks vovk

Nighoo commented 12 years ago

yes, would generalize this case and hit the check if (IsPeriodicRegenerateEffect(spellInfo, index)) in our IsImmuneToSpellEffect function! :)

Ve1vet commented 12 years ago

First of all. If you write this check in periodic check it wont work because of first check for heal & energize in which function just return true & close. Second. Laise patch brokes everyting. Totems become imune even for periodic damage, but they should not be imune for them. And so on. This patch for totems very horrible. Thats why i wrote this check at the start of the function. There is only two ways to fix. Rewrite whole function or place that check at the begining of function. Other ways = horrible hacks & they have no sence.

fr1nge commented 12 years ago

Tested vovk's patch for over a month, works great,no side effects or errors, should be pushed.