aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r--src/game/SpellEffects.cpp73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 08dd692fa1d..acd610d20fb 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5729,6 +5729,79 @@ void Spell::EffectScriptEffect(uint32 effIndex)
}
return;
}
+ case 75614: // Celestial Steed
+ {
+ if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ // Prevent stacking of mounts and client crashes upon dismounting
+ unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
+
+ // Triggered spell id dependent on riding skill and zone
+ bool canFly = true;
+ uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId());
+ if (v_map != 530 && v_map != 571)
+ canFly = false;
+
+ if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197))
+ canFly = false;
+
+ float x, y, z;
+ unitTarget->GetPosition(x, y, z);
+ uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
+ AreaTableEntry const *pArea = sAreaStore.LookupEntry(areaFlag);
+ if (canFly && pArea->flags & AREA_FLAG_NO_FLY_ZONE)
+ canFly = false;
+
+ switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
+ {
+ case 75: unitTarget->CastSpell(unitTarget, 75619, true); break;
+ case 150: unitTarget->CastSpell(unitTarget, 75620, true); break;
+ case 225:
+ {
+ if (canFly)
+ unitTarget->CastSpell(unitTarget, 75617, true);
+ else
+ unitTarget->CastSpell(unitTarget, 75620, true);
+ }break;
+ case 300:
+ {
+ if (canFly)
+ {
+ if (unitTarget->ToPlayer()->Has310Flyer(false))
+ unitTarget->CastSpell(unitTarget, 76153, true);
+ else
+ unitTarget->CastSpell(unitTarget, 75618, true);
+ }
+ else
+ unitTarget->CastSpell(unitTarget, 75620, true);
+ }break;
+ }
+ return;
+ }
+ case 75973: // X-53 Touring Rocket
+ {
+ if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ // Prevent stacking of mounts
+ unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
+
+ // Triggered spell id dependent on riding skill
+ if (uint16 skillval = unitTarget->ToPlayer()->GetSkillValue(SKILL_RIDING))
+ {
+ if (skillval >= 300)
+ {
+ if (unitTarget->ToPlayer()->Has310Flyer(false))
+ unitTarget->CastSpell(unitTarget, 76154, true);
+ else
+ unitTarget->CastSpell(unitTarget, 75972, true);
+ }
+ else
+ unitTarget->CastSpell(unitTarget, 75957, true);
+ }
+ return;
+ }
case 59317: // Teleporting
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;