Jump to content

[fix][9021] Festive Holiday Mount


Auntie Mangos

Recommended Posts

What bug does the patch fix? What features does the patch add?

fixes reindeer mount spell applying

For which repository revision was the patch created?

9020

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

http://getmangos.eu/community/viewtopic.php?id=11497

Who has been writing this patch? Please include either forum user names or email addresses.

me

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 1577264..23e39b9 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2496,6 +2496,8 @@ void Spell::cast(bool skipCheck)
                AddPrecastSpell(23230);                     // Blood Fury - Healing Reduction
            else if(m_spellInfo->Id == 20594)               // Stoneskin
                AddTriggeredSpell(65116);                   // Stoneskin - armor 10% for 8 sec
+            else if(m_spellInfo->Id == 62061)               // Festive Holiday Mount
+                AddTriggeredSpell(25860);
            break;
        }
        case SPELLFAMILY_MAGE:
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 167d0e2..abeb53f 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -2437,6 +2437,34 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
                m_target->CastSpell(m_target, 47287, true, NULL, this);
                return;
            }
+            case 62061:                                     // Festive Holiday Mount
+            {
+                float flyspeed = m_target->GetSpeedRate(MOVE_FLIGHT);
+                float speed = m_target->GetSpeedRate(MOVE_RUN);
+                
+                Unit *caster = GetCaster();
+
+                if (!caster)
+                    return;
+
+                //5 different spells used depending on mounted speed and if mount can fly or not
+                if (flyspeed >= 4.1f)
+                    // Flying Reindeer
+                    caster->RemoveAurasDueToSpell(44827); //310% flying Reindeer
+                else if (flyspeed >= 3.8f)
+                    // Flying Reindeer
+                    caster->RemoveAurasDueToSpell(44825); //280% flying Reindeer
+                else if (flyspeed >= 1.6f)
+                    // Flying Reindeer
+                    caster->RemoveAurasDueToSpell(44824); //60% flying Reindeer
+                else if (speed >= 2.0f)
+                    // Reindeer
+                    caster->RemoveAurasDueToSpell(25859); //100% ground Reindeer
+                else
+                    // Reindeer
+                    caster->RemoveAurasDueToSpell(25858); //60% ground Reindeer
+                return;
+            }
        }

        if (m_removeMode == AURA_REMOVE_BY_DEATH)
@@ -4279,13 +4307,17 @@ void Aura::HandleAuraModIncreaseSpeed(bool /*apply*/, bool Real)
    m_target->UpdateSpeed(MOVE_RUN, true);
}

-void Aura::HandleAuraModIncreaseMountedSpeed(bool /*apply*/, bool Real)
+void Aura::HandleAuraModIncreaseMountedSpeed(bool apply, bool Real)
{
    // all applied/removed only at real aura add/remove
    if(!Real)
        return;

    m_target->UpdateSpeed(MOVE_RUN, true);
+
+    // Festive Holiday Mount
+    if (apply && GetSpellProto()->SpellIconID != 1794 && m_target->HasAura(62061))
+        m_target->CastSpell(m_target, 25860, true, NULL, this);
}

void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real)
@@ -4313,6 +4345,10 @@ void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real)
        // Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
        if( apply && m_target->HasAura(42016,0) && m_target->GetMountID())
            m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
+
+        // Festive Holiday Mount
+        if (apply && GetSpellProto()->SpellIconID != 1794 && m_target->HasAura(62061))
+            m_target->CastSpell(m_target, 25860, true, NULL, this);
    }

    m_target->UpdateSpeed(MOVE_FLIGHT, true);

hope its not too hacky

Link to comment
Share on other sites

  • 39 years later...

Why it remove mount? As i read descriptions it aplied if mount active and all duration time.

you can unmount and remount after. And it not related to bonus speed mounts in any form, just visual model replace...

Changed in 3.0.8 PTR to give you a 1 hour buff that transforms your mount into a Reindeer whenever you mount up.

That means that you don't waste this instantly when you dismount! You get a full hour out of it.Last edited by

Link to comment
Share on other sites

I am not sure. oroginaly i thionk it just replace model with not ouching aura. and in case morph expired restore original, yes.

But now not sure :/

You sure that 25860 related to this item 21213

We have

item 21213 -> dummy aura 62061 (time limit, visually reaplly at new mount while not expired)

From well know wiki:

This gives a 1 hour buff which changes your mount into a reindeer each time you mount, complete with sparkling feet that leave an energy/snowflake trail if you use a flying mount.

So look like at aura apply it just replace mount model and at mount checked for aura and do same

At aura expire model restored.

item 21212 -> dummy aura 25860 (until dismount, no time limit)

already implemented and just replace mount by same speed.

Ah, ok first also can be implemented in this way, i see now, except expire case.

Maybe i wrong and it must dismount at tine expire, or expire only meaning that new mount will not transformed?

In last cases just case 62061: redundant and better move triggered spell to Dummy aura apply code symmetric with mount cases

I will do test and apply in last version.

Link to comment
Share on other sites

another way as u said with only display id replace

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 167d0e2..80d186f 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -2587,6 +2587,31 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
                    else
                        m_target->m_AuraFlags |= ~UNIT_AURAFLAG_ALIVE_INVISIBLE;
                    return;
+                // Festive Holiday Mount
+                case 62061: 
+                    if (apply && m_target->GetMountID())
+                    {
+                        if (!m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED).empty)
+                            m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,22724);
+                        else
+                            m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,15902);
+                    }
+                    else if(!apply && m_target->GetMountID() == 15902 || m_target->GetMountID() == 22724)
+                    {
+                        if (!m_target->GetAurasByType(SPELL_AURA_MOUNTED).empty())
+                        {
+                            uint32 cr_id = m_target->GetAurasByType(SPELL_AURA_MOUNTED).front()->GetModifier()->m_miscvalue;
+                            if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(cr_id))
+                            {
+                                uint32 team = 0;
+                                if (m_target->GetTypeId() == TYPEID_PLAYER)
+                                    team = ((Player*)m_target)->GetTeam();
+
+                                uint32 display_id = sObjectMgr.ChooseDisplayId(team, ci);
+                                CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
+                                if (minfo)
+                                    display_id = minfo->modelid;
+
+                                m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, display_id);
+                            }
+                        }
+                    }
+                    return;
            }
            break;
        }
@@ -4285,6 +4310,10 @@ void Aura::HandleAuraModIncreaseMountedSpeed(bool /*apply*/, bool Real)
    if(!Real)
        return;

+    // Festive Holiday Mount
+    if (apply && m_target->HasAura(62061,0) && m_target->GetMountID())
+        m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,15902);
+
    m_target->UpdateSpeed(MOVE_RUN, true);
}

@@ -4313,6 +4342,10 @@ void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real)
        // Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
        if( apply && m_target->HasAura(42016,0) && m_target->GetMountID())
            m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
+        
+        // Festive Holiday Mount
+        if (apply && m_target->HasAura(62061,0) && m_target->GetMountID())
+            m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,22724);
    }

    m_target->UpdateSpeed(MOVE_FLIGHT, true);

Link to comment
Share on other sites

base at fact that after more look i agree mostly with you first implementaion except

1) triggred use (canbe in dummy auras)

2) unmount at expire (base how writed at well knonw wiki buf not provided time of morph but time when this morph can be applied at mounting) - so with droped this part.

I already test patch with this smalll modifications :)

Sorry for my long understanding time logic of your original patch ^^

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