Jump to content

[fix] Druid Flight Form (temp?hack?)


Auntie Mangos

Recommended Posts

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index ae7d0ff..b544ada 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -256,7 +256,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
    &Aura::HandleNoImmediateEffect,                         //203 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE  implemented in Unit::CalculateMeleeDamage and Unit::SpellCriticalDamageBonus
    &Aura::HandleNoImmediateEffect,                         //204 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE implemented in Unit::CalculateMeleeDamage and Unit::SpellCriticalDamageBonus
    &Aura::HandleNoImmediateEffect,                         //205 SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_DAMAGE  implemented in Unit::SpellCriticalDamageBonus
-    &Aura::HandleNULL,                                      //206 SPELL_AURA_MOD_SPEED_MOUNTED
+    &Aura::HandleAuraModIncreaseFlightSpeed,                //206 SPELL_AURA_MOD_SPEED_MOUNTED
    &Aura::HandleAuraModIncreaseFlightSpeed,                //207 SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED
    &Aura::HandleAuraModIncreaseFlightSpeed,                //208 SPELL_AURA_MOD_SPEED_FLIGHT, used only in spell: Flight Form (Passive)
    &Aura::HandleAuraModIncreaseFlightSpeed,                //209 SPELL_AURA_MOD_FLIGHT_SPEED_ALWAYS
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index c980507..2006adb 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10412,7 +10412,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
            if (IsMounted()) // Use on mount auras
                main_speed_mod  = GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED);
            else             // Use not mount (shapeshift for example) auras (should stack)
-                main_speed_mod  = GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_FLIGHT);
+                main_speed_mod  = GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_FLIGHT) + GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_MOUNTED);
            stack_bonus     = GetTotalAuraMultiplier(SPELL_AURA_MOD_FLIGHT_SPEED_ALWAYS);
            non_stack_bonus = (100.0 + GetMaxPositiveAuraModifier(SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK))/100.0f;
            break;

Hope this will help you. It should be working for 9112. Have fun

Link to comment
Share on other sites

Thank you MrGhost it works perfectly. But now in another matter when you transform into biiiiirrrdddmaann and fly from a very high altitude to a place on the bottom BUT before touching the land transform into cat or bear or whatever form. You will die, this is because from the moment you went into biiiirrrdddmann the fall code was being calculated, it calculated that you jumped from the place you went to flight form up to the point where you touched the ground, but it most be done as another form instead of flight form before touching the ground. If you touch the ground as flight form then the fall is not done and it is all normal.

Link to comment
Share on other sites

I've tried hand-editing using Notepad++ ( set to language= diff ), editing the lines using Visual C++, and using 'git apply' with the options to fix whitespace errors with your updated patch, MrGhost.

Unfortunately, Git fails the patch for MaNGOS revision 9128. Visual C++ compiles the manually edited SpellAuras.cpp and Unit.cpp with no errors but mangosd.exe crashes while loading. It doesn't even have the chance to log the error, leaving an empty log file. Here's the errors Git returns when trying to apply the latest version of this patch:

$ git apply swift_flight_form.diff
swift_flight_form.diff:10: trailing whitespace.
  &Aura::HandleAuraModIncreaseFlightSpeed,                //206 SPELL_AURA_MOD_SPEED_MOUNTED
swift_flight_form.diff:23: trailing whitespace.
              main_speed_mod = GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_FLIGHT) + GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_MOUNTED);
fatal: corrupt patch at line 26

Any suggestions? I've edited the whitespace the best I can but keep getting the "trailing whitespace" error. I suppose it might help if I knew C++ beyond a novice level but isn't the MaNGOS coding standard for all tabs to be four normal spaces?

Link to comment
Share on other sites

  • 3 weeks later...

There have been some changes to the core. The lines from the patch, Unit.cpp:

if (IsMounted()) // Use on mount auras
                main_speed_mod  = GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED);
            else             // Use not mount (shapeshift for example) auras (should stack)
-                main_speed_mod  = GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_FLIGHT);
+                main_speed_mod  = GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_FLIGHT)+GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_MOUNTED);
            stack_bonus     = GetTotalAuraMultiplier(SPELL_AURA_MOD_FLIGHT_SPEED_ALWAYS);
            non_stack_bonus = (100.0 + GetMaxPositiveAuraModifier(SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK))/100.0f;
            break;

and the lines from MaNGOS 0.16-dev1 r 9310, Unit.cpp:

if (IsMounted()) // Use on mount auras
           {
               main_speed_mod  = GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED);
               stack_bonus     = GetTotalAuraMultiplier(SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS);
               non_stack_bonus = (100.0f + GetMaxPositiveAuraModifier(SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK))/100.0f;
           }
           else
           {
               main_speed_mod  = GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_SPEED);
               stack_bonus     = GetTotalAuraMultiplier(SPELL_AURA_MOD_SPEED_ALWAYS);
               non_stack_bonus = (100.0f + GetMaxPositiveAuraModifier(SPELL_AURA_MOD_SPEED_NOT_STACK))/100.0f;
           }
           break;

So, do we just apply the patch as it is, does it need updating, or has the changes to the core made this patch unnecessary?

Link to comment
Share on other sites

working hack for mangos 9348 ..

Good work.

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index ae7d0ff..b544ada 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -256,7 +256,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
    &Aura::HandleNoImmediateEffect,                         //203 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE  implemented in Unit::CalculateMeleeDamage and Unit::SpellCriticalDamageBonus
    &Aura::HandleNoImmediateEffect,                         //204 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE implemented in Unit::CalculateMeleeDamage and Unit::SpellCriticalDamageBonus
    &Aura::HandleNoImmediateEffect,                         //205 SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_DAMAGE  implemented in Unit::SpellCriticalDamageBonus
-    &Aura::HandleNULL,                                      //206 SPELL_AURA_MOD_SPEED_MOUNTED
+    &Aura::HandleAuraModIncreaseFlightSpeed,                //206 SPELL_AURA_MOD_SPEED_MOUNTED
    &Aura::HandleAuraModIncreaseFlightSpeed,                //207 SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED
    &Aura::HandleAuraModIncreaseFlightSpeed,                //208 SPELL_AURA_MOD_SPEED_FLIGHT, used only in spell: Flight Form (Passive)
    &Aura::HandleAuraModIncreaseFlightSpeed,                //209 SPELL_AURA_MOD_FLIGHT_SPEED_ALWAYS
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index c980507..2006adb 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10412,7 +10412,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
            if (IsMounted()) // Use on mount auras
                main_speed_mod  = GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED);
            else             // Use not mount (shapeshift for example) auras (should stack)
-                main_speed_mod  = GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_FLIGHT);
+                main_speed_mod  = GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_FLIGHT) + GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_MOUNTED);
            stack_bonus     = GetTotalAuraMultiplier(SPELL_AURA_MOD_FLIGHT_SPEED_ALWAYS);
            non_stack_bonus = (100.0 + GetMaxPositiveAuraModifier(SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK))/100.0f;
            break;

Link to comment
Share on other sites

i dont know how to write with rails or what your using,

but where it says:

//208 SPELL_AURA_MOD_SPEED_FLIGHT, used only in spell: Flight Form (Passive)

couldent you just add "Swift"

so it looks like:

//208 SPELL_AURA_MOD_SPEED_FLIGHT, used only in spell: Swift Flight Form (Passive

then change any other code that needs to be changed acordingly.

i dont know if that would work but could sombody try it and post back?

Link to comment
Share on other sites

Comments in the source have no effect on the compiled binaries. You could just as easily change it to say // The swift brown fox jumped over the lazy dog for all the difference it would make.

My point was the declarations for the functions controlling mounted and flying movements have changed.

Here's the line in question from the patch:

main_speed_mod = GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_FLIGHT)+GetTotalAuraModifier(SPELL_AURA_MOD_SPEED_MOUNTED);

and from 0.16-dev1 r9310:

main_speed_mod  = GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_SPEED);

SPELL_AURA_MOD_SPEED_FLIGHT was how the function was originally done in revisions prior to 0.16 ( If I recall correctly).

By the wording of the new function, SPELL_AURA_MOD_INCREASE_SPEED, it would seem the function added by the patch, SPELL_AURA_MOD_SPEED_MOUNTED, is not needed.

I'll reiterate my question. Is this patch still needed or does it require an update for the new core code?

Can one of the devs weigh in on this? I've got a few druids that would be very unhappy if their 'Swift Flight Form' were no longer so swift, should I leave this patch out while it would still be needed.

Link to comment
Share on other sites

This is like the only patch i am currently applying to the original git master. Very VERY needed for druids since how the hell am i suppose to escape son crazy enemy that almost kills me when i transform to flight form and start flying at the speed of....SNAILMAN!

Link to comment
Share on other sites

hého du bateau !

quelqu'un a-t-il testé un core compilé sans le patch et peut-il dire si la forme de vol (rapide ou non) du druide fonctionne correctement ?

hého the boat! has anyone tested a core compiled without the patch and can tell whether the flight form (fast or not) of Druid working properly?
Link to comment
Share on other sites

I've been intending to have my tester (a.k.a. "oldest nephew") verify if his druid's flight from works correctly without this patch on 3.3.0a but, I have been very busy the past several days. I'll hopefully have free time to compile and test this upcoming weekend.

UPDATE:

Still no answer at this time. I've hit a snag with some patches for MaNGOS 0.16 (9310) and have to resolve those issues first. Once I get a good compile, will test to see if the Druid Flight Forms have the correct speed bonus applied.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
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