mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 10:37:06 +00:00
[12660] Implement mount capabilities by Shauren.
Also update AreaFlags enum, implement mount capabilities check at teleport.
----------------------------
commit is partially based on ec5eabdc69
This commit is contained in:
parent
a253344a02
commit
46d4f07052
8 changed files with 105 additions and 36 deletions
|
|
@ -187,7 +187,58 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
|||
|
||||
// mount allow check
|
||||
if (!mEntry->IsMountAllowed())
|
||||
{
|
||||
_player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
|
||||
_player->RemoveSpellsCausingAura(SPELL_AURA_FLY);
|
||||
}
|
||||
else
|
||||
{
|
||||
// recheck mount capabilities at far teleport
|
||||
Unit::AuraList const& mMountAuras = _player->GetAurasByType(SPELL_AURA_MOUNTED);
|
||||
for (Unit::AuraList::const_iterator itr = mMountAuras.begin(); itr != mMountAuras.end(); )
|
||||
{
|
||||
Aura const* aura = *itr;
|
||||
|
||||
// mount is no longer suitable
|
||||
MountCapabilityEntry const* entry = _player->GetMountCapability(aura->GetSpellEffect()->EffectMiscValueB);
|
||||
if (!entry)
|
||||
{
|
||||
_player->RemoveAurasDueToSpell(aura->GetId());
|
||||
itr = mMountAuras.begin();
|
||||
continue;
|
||||
}
|
||||
|
||||
// mount capability changed
|
||||
if (entry->Id != aura->GetModifier()->m_amount)
|
||||
{
|
||||
if (MountCapabilityEntry const* oldEntry = sMountCapabilityStore.LookupEntry(aura->GetModifier()->m_amount))
|
||||
_player->RemoveAurasDueToSpell(oldEntry->SpeedModSpell);
|
||||
|
||||
_player->CastSpell(_player, entry->SpeedModSpell, true);
|
||||
|
||||
const_cast<Aura*>(aura)->ChangeAmount(entry->Id);
|
||||
}
|
||||
|
||||
++itr;
|
||||
}
|
||||
|
||||
uint32 zone, area;
|
||||
_player->GetZoneAndAreaId(zone, area);
|
||||
// recheck fly auras
|
||||
Unit::AuraList const& mFlyAuras = _player->GetAurasByType(SPELL_AURA_FLY);
|
||||
for (Unit::AuraList::const_iterator itr = mFlyAuras.begin(); itr != mFlyAuras.end(); )
|
||||
{
|
||||
Aura const* aura = *itr;
|
||||
if (!_player->CanStartFlyInArea(_player->GetMapId(), zone, area))
|
||||
{
|
||||
_player->RemoveAurasDueToSpell(aura->GetId());
|
||||
itr = mFlyAuras.begin();
|
||||
continue;
|
||||
}
|
||||
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
// honorless target
|
||||
if (GetPlayer()->pvpInfo.inHostileArea)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue