Ru-MaNGOS

Ru-MaNGOS (http://mangos.ytdb.ru/index.php)
-   Отвергнутые патчи (http://mangos.ytdb.ru/forumdisplay.php?f=50)
-   -   [patch] Glyph of Sunder Armor (http://mangos.ytdb.ru/showthread.php?t=4568)

Den 28.05.2011 12:28

[patch] Glyph of Sunder Armor
 
Код:

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp
index 6fe03b1..7e12c73 100644
--- a/src/game/UnitAuraProcHandler.cpp
+++ b/src/game/UnitAuraProcHandler.cpp
@@ -1198,6 +1198,20 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
                triggered_spell_id = 26654;
                break;
            }
+
+            // Glyph of Sunder Armor
+            if (dummySpell->Id == 58387)
+            {
+                if (!pVictim || !pVictim->isAlive())
+                    return SPELL_AURA_PROC_FAILED;
+
+                target = SelectRandomUnfriendlyTarget(pVictim);
+                if (!target)
+                    return SPELL_AURA_PROC_FAILED;
+
+                CastSpell(target, 58567, true, NULL, triggeredByAura, GetObjectGuid());
+                return SPELL_AURA_PROC_OK;
+            }
            break;
        }
        case SPELLFAMILY_WARLOCK:

Код:

INSERT INTO `spell_proc_event` VALUES
(58387, 0x00, 4, 0x00004000, 0x00004000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0x0000000, 0.000000, 0.000000,  0);

Не ясно только одно, почему на рандомную цель вешается сразу два стака О_о

Den 18.06.2011 16:21

Этот вариант работает правильно:
Код:

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 4161aa2..5b0f0ab 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -3005,6 +3005,18 @@ void Spell::cast(bool skipCheck)
                if (m_caster->HasAura(58375))              // Glyph of Blocking
                    AddTriggeredSpell(58374);              // Glyph of Blocking
            }
+            // Sunder Armor
+            else if (m_spellInfo->Id == 7386)
+            {
+                if (m_caster->HasAura(58387))              // Glyph of Sunder Armor
+                {
+                    if (Unit* target = m_targets.getUnitTarget())
+                    {
+                        target = m_caster->SelectRandomUnfriendlyTarget(m_targets.getUnitTarget());
+                        m_caster->CastSpell(target, 58567, true);
+                    }
+                }
+            }
            // Bloodsurge (triggered), Sudden Death (triggered)
            else if (m_spellInfo->Id == 46916 || m_spellInfo->Id == 52437)
                // Item - Warrior T10 Melee 4P Bonus
diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp


Vladimir 19.06.2011 00:51

Проще выставить правильное количество целей, чем вручную кастать спел.
Alt.patch добавлен в [11647]

Den 19.06.2011 08:39

Проблема в том, что вешается сразу два стака раскола брони, чего быть не должно...

Vladimir 21.06.2011 22:48

Должно быть поправлено в [11660].


Текущее время: 11:46. Часовой пояс GMT +3.

ru-mangos.ru - Русское сообщество MaNGOS