Ru-MaNGOS

Ru-MaNGOS (http://mangos.ytdb.ru/index.php)
-   Принятые патчи (http://mangos.ytdb.ru/forumdisplay.php?f=5)
-   -   [patch] Предметы 37118,44314,44315 (http://mangos.ytdb.ru/showthread.php?t=6891)

NeatElves 27.03.2013 21:21

[patch] Предметы 37118,44314,44315
 
http://ru.wowhead.com/item=37118
http://ru.wowhead.com/item=44314
http://ru.wowhead.com/item=44315
Патч работает, но нужен зоркий и строгий глаз для оптимизации))
Код:

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 8065dd1..3eaf003 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3892,6 +3892,30 @@ void Spell::EffectTeleportUnits(SpellEffectIndex eff_idx)  // TODO - Use target
    if (!unitTarget || unitTarget->IsTaxiFlying())
        return;
 
+        switch (m_spellInfo->Id)
+        {
+            case 48129:                                // Scroll of Recall
+            case 60320:                                // Scroll of Recall II
+            case 60321:                                // Scroll of Recall III
+            {
+                uint8 m_CharLevel = 0;
+                switch (m_spellInfo->Id)
+                {
+                    case 48129: m_CharLevel = 40; break;
+                    case 60320: m_CharLevel = 70; break;
+                    case 60321: m_CharLevel = 80; break;
+                }
+
+                if (((Player*)unitTarget)->getLevel() > m_CharLevel)
+                {
+                    unitTarget->CastSpell(unitTarget, 60444, true);
+                    uint32 spell_id = (((Player*)unitTarget)->GetTeam() == ALLIANCE ? 60323 : 60328);
+                    unitTarget->CastSpell(unitTarget, spell_id + urand(0, 7), true);
+                    return;
+                }
+            }
+        }
+
    // Target dependend on TargetB, if there is none provided, decide dependend on A
    uint32 targetType = m_spellInfo->EffectImplicitTargetB[eff_idx];
    if (!targetType)

Идея взята из Тринити
1. https://github.com/TrinityCore/Trini...d0a31c0fad0dc7
2. https://github.com/TrinityCore/Trini...0320cb74103a20

schmoozerd 30.03.2013 03:37

Do you have any information about the not implemented fail-spell 60322 ?

NeatElves 30.03.2013 12:36

No direct information, perhaps it works when the end point, but confuses one:
POWER_MANA, Cost 21 %

schmoozerd 21.04.2013 00:53

In [12466].
Thank you :)


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

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