Fixed remaining scaling mounts that have 310% speed when you have other 310% mount: Celestial Steed and X-53 Touring Rocket

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-05-24 16:11:35 +02:00
parent ffe78ba600
commit 2f5e46ee89
3 changed files with 127 additions and 0 deletions

View File

@@ -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;