Jump to content

[Partially fix] Headless Horseman's Mount


Guest OPenaz
 Share

Recommended Posts

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

Allow this mount to be summoned, added dependency on riding skill

* For which repository revision was the patch created?

8746

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

No

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

Me, OPenaz

index 8e60f11..5ae3fe8 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5200,8 +5200,36 @@ void Spell::EffectScriptEffect(uint32 effIndex)
                    unitTarget->CastSpell(unitTarget, damage, false);
                    break;
                }
+               case 48025:                                 // Headless Horseman Mount
+               {
+                   if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
+                       return;
+
+                   // Prevent stacking of mounts
+                   unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
+
+                   // Triggered spell id dependent of riding skill
+                   uint16 skillval = ((Player*)unitTarget)->GetSkillValue(SKILL_RIDING);
+                   uint32 zone, area;
+                   unitTarget->GetZoneAndAreaId(zone, area);
+                   switch (skillval)
+                   {
+                       case 75:
+                           unitTarget->CastSpell(unitTarget, 51621, true);
+                           return;
+                       case 150:
+                           unitTarget->CastSpell(unitTarget, 48024, true);
+                           return;
+                       case 225:
+                           if ((((Player*)unitTarget)->IsKnowHowFlyIn(((Player*)unitTarget)->GetMapId(), zone) && area != 4395 && ((Player*)unitTarget)->GetMapId() == 571) || ((Player*)unitTarget)->GetMapId() == 530)
+                               unitTarget->CastSpell(unitTarget, 51617, true);
+                           else
+                               unitTarget->CastSpell(unitTarget, 48024, true);
+                           return;
+                       case 300:
+                           if ((((Player*)unitTarget)->IsKnowHowFlyIn(((Player*)unitTarget)->GetMapId(), zone) && area != 4395 && ((Player*)unitTarget)->GetMapId() == 571) || ((Player*)unitTarget)->GetMapId() == 530)
+                               unitTarget->CastSpell(unitTarget, 48023, true);
+                           else
+                               unitTarget->CastSpell(unitTarget, 48024, true);
+                           return;
+                       default:
+                           break;
+                   }
+                   return;
+               }
              // Winged Steed of the Ebon Blade
              case 54729:                                

Known problems:

None

How it works:

Headless Horseman's Mount now scales with your riding with this exceptions:

If u have skill higher than 150, u will summon him as 100% ground mount in Azeroth, Kalimdor and Dalaran (except Krasus Landing)

If u have skill higher than 150 and not learned spell Cold Weather Flying, u will summon him as 100% ground mount in whole Northrend

Link to comment
Share on other sites

unitTarget->GetMapId() this is not working...also (Player*)unitTarget too...

EDIT: My fault, case typo (GetMapId and Getmapid)

EDIT2: compilled, will test in about 10 minutes

Test result: In northrend, it can be summoned as ground mount, without cold weather flying...but forget about old world...will update later (players aren't happy due to restarts :) )

Link to comment
Share on other sites

  • 10 months later...
 Share

×
×
  • 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