Ru-MaNGOS

Ru-MaNGOS (http://mangos.ytdb.ru/index.php)
-   Принятые патчи (http://mangos.ytdb.ru/forumdisplay.php?f=5)
-   -   [patch] Спелл 17009 (http://mangos.ytdb.ru/showthread.php?t=6884)

NeatElves 25.03.2013 21:26

[patch] Спелл 17009
 
http://ru.wowhead.com/spell=17009
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
Код:

index 8065dd1..a2a047d 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -933,6 +933,26 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
                    m_caster->CastSpell(m_caster, spell_id, true, NULL);
                    return;
                }
+                case 17009:                                // Voodoo
+                {
+                    if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
+                        return;
+
+                    uint32 spell_id = 0;
+                    switch (urand(1, 7))
+                    {
+                        case 1: spell_id = 16707; break;    // Hex
+                        case 2: spell_id = 16708; break;    // Hex
+                        case 3: spell_id = 16709; break;    // Hex
+                        case 4: spell_id = 16711; break;    // Grow
+                        case 5: spell_id = 16712; break;    // Special Brew
+                        case 6: spell_id = 16713; break;    // Ghostly
+                        case 7: spell_id = 16716; break;    // Launch
+                    }
+
+                    unitTarget->CastSpell(unitTarget, spell_id, true, NULL);
+                    return;
+                }
                case 17251:                                // Spirit Healer Res
                {
                    if (!unitTarget

)

schmoozerd 28.03.2013 15:24

Prepared as the following:
Код:

commit 774b9c01aa4f55ed191b4e9fdb07dd781c745676
Author: NeatElves <NeatElves@getmangos.com>
Date:  Thu Mar 28 02:16:11 2013 +0100

    [12425] Implement spell 17009
   
    Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 8065dd1..e622609 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -933,6 +933,26 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
                    m_caster->CastSpell(m_caster, spell_id, true, NULL);
                    return;
                }
+                case 17009:                                // Voodoo
+                {
+                    if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
+                        return;
+
+                    uint32 spell_id = 0;
+                    switch (urand(0, 6))
+                    {
+                        case 0: spell_id = 16707; break;    // Hex
+                        case 1: spell_id = 16708; break;    // Hex
+                        case 2: spell_id = 16709; break;    // Hex
+                        case 3: spell_id = 16711; break;    // Grow
+                        case 4: spell_id = 16712; break;    // Special Brew
+                        case 5: spell_id = 16713; break;    // Ghostly
+                        case 6: spell_id = 16716; break;    // Launch
+                    }
+
+                    m_caster->CastSpell(unitTarget, spell_id, true, NULL, NULL, m_originalCasterGUID, m_spellInfo);
+                    return;
+                }
                case 17251:                                // Spirit Healer Res
                {
                    if (!unitTarget)
@@ -953,7 +973,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
                    if (!itemTarget && m_caster->GetTypeId() != TYPEID_PLAYER)
                        return;
 
-                    uint32 spell_id = roll_chance_i(50)
+                    uint32 spell_id = urand(0, 1)
                                      ? 17269              // Create Resonating Skull
                                      : 17270;              // Create Bone Dust
 
diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h
index f44fa3d..6722d8e 100644
--- a/src/shared/revision_nr.h
+++ b/src/shared/revision_nr.h
@@ -1,4 +1,4 @@
 #ifndef __REVISION_NR_H__
 #define __REVISION_NR_H__
- #define REVISION_NR "12424"
+ #define REVISION_NR "12425"
 #endif // __REVISION_NR_H__

Changes to your version:
* Cast by m_caster (and properly triggered)
* case ordering to 0..6

Edit: Added to [12427] Thank you!


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

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