[7797] Use DBC data for mount model selection in more cases. Author: VladimirMangos
* Use alt.team mount data for take player team model id if DB not provide own team creature id in spell taxi call case.
* Remove unddeded hacks for model ids from Spell::EffectSendTaxi
* Provide spell target for SPELL_EFFECT_SEND_TAXI for spell with target mode 0 for this effect.
--HG--
branch : trunk
This commit is contained in:
@@ -769,7 +769,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
|||||||
{
|
{
|
||||||
sLog.outDebug( "WORLD: Restart character %u taxi flight", pCurrChar->GetGUIDLow() );
|
sLog.outDebug( "WORLD: Restart character %u taxi flight", pCurrChar->GetGUIDLow() );
|
||||||
|
|
||||||
uint32 MountId = objmgr.GetTaxiMount(sourceNode, pCurrChar->GetTeam());
|
uint32 MountId = objmgr.GetTaxiMount(sourceNode, pCurrChar->GetTeam(),true);
|
||||||
uint32 path = pCurrChar->m_taxi.GetCurrentTaxiPath();
|
uint32 path = pCurrChar->m_taxi.GetCurrentTaxiPath();
|
||||||
|
|
||||||
// search appropriate start path node
|
// search appropriate start path node
|
||||||
|
|||||||
@@ -4837,7 +4837,7 @@ void ObjectMgr::GetTaxiPath( uint32 source, uint32 destination, uint32 &path, ui
|
|||||||
path = dest_i->second.ID;
|
path = dest_i->second.ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 ObjectMgr::GetTaxiMount( uint32 id, uint32 team )
|
uint16 ObjectMgr::GetTaxiMount( uint32 id, uint32 team, bool allowed_alt_team /* = false */)
|
||||||
{
|
{
|
||||||
uint16 mount_entry = 0;
|
uint16 mount_entry = 0;
|
||||||
uint16 mount_id = 0;
|
uint16 mount_id = 0;
|
||||||
@@ -4848,6 +4848,9 @@ uint16 ObjectMgr::GetTaxiMount( uint32 id, uint32 team )
|
|||||||
if (team == ALLIANCE)
|
if (team == ALLIANCE)
|
||||||
{
|
{
|
||||||
mount_entry = node->MountCreatureID[1];
|
mount_entry = node->MountCreatureID[1];
|
||||||
|
if(!mount_entry && allowed_alt_team)
|
||||||
|
mount_entry = node->MountCreatureID[0];
|
||||||
|
|
||||||
CreatureInfo const *ci = GetCreatureTemplate(mount_entry);
|
CreatureInfo const *ci = GetCreatureTemplate(mount_entry);
|
||||||
if(ci)
|
if(ci)
|
||||||
mount_id = ci->Modelid_A1;
|
mount_id = ci->Modelid_A1;
|
||||||
@@ -4855,6 +4858,10 @@ uint16 ObjectMgr::GetTaxiMount( uint32 id, uint32 team )
|
|||||||
if (team == HORDE)
|
if (team == HORDE)
|
||||||
{
|
{
|
||||||
mount_entry = node->MountCreatureID[0];
|
mount_entry = node->MountCreatureID[0];
|
||||||
|
|
||||||
|
if(!mount_entry && allowed_alt_team)
|
||||||
|
mount_entry = node->MountCreatureID[1];
|
||||||
|
|
||||||
CreatureInfo const *ci = GetCreatureTemplate(mount_entry);
|
CreatureInfo const *ci = GetCreatureTemplate(mount_entry);
|
||||||
if(ci)
|
if(ci)
|
||||||
mount_id = ci->Modelid_H1;
|
mount_id = ci->Modelid_H1;
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ class ObjectMgr
|
|||||||
|
|
||||||
uint32 GetNearestTaxiNode( float x, float y, float z, uint32 mapid, uint32 team );
|
uint32 GetNearestTaxiNode( float x, float y, float z, uint32 mapid, uint32 team );
|
||||||
void GetTaxiPath( uint32 source, uint32 destination, uint32 &path, uint32 &cost);
|
void GetTaxiPath( uint32 source, uint32 destination, uint32 &path, uint32 &cost);
|
||||||
uint16 GetTaxiMount( uint32 id, uint32 team );
|
uint16 GetTaxiMount( uint32 id, uint32 team, bool allowed_alt_team = false);
|
||||||
void GetTaxiPathNodes( uint32 path, Path &pathnodes, std::vector<uint32>& mapIds );
|
void GetTaxiPathNodes( uint32 path, Path &pathnodes, std::vector<uint32>& mapIds );
|
||||||
void GetTransportPathNodes( uint32 path, TransportPath &pathnodes );
|
void GetTransportPathNodes( uint32 path, TransportPath &pathnodes );
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -230,7 +230,7 @@ bool PlayerTaxi::LoadTaxiDestinationsFromString( const std::string& values, uint
|
|||||||
}
|
}
|
||||||
|
|
||||||
// can't load taxi path without mount set (quest taxi path?)
|
// can't load taxi path without mount set (quest taxi path?)
|
||||||
if(!objmgr.GetTaxiMount(GetTaxiSource(),team))
|
if(!objmgr.GetTaxiMount(GetTaxiSource(),team,true))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -17232,8 +17232,8 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, uint32 mount_i
|
|||||||
prevnode = lastnode;
|
prevnode = lastnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!mount_id) // if not provide then attempt use default.
|
if(!mount_id) // if not provide then attempt use default, allow seelct alt team mount creature model but for proper team in spell case.
|
||||||
mount_id = objmgr.GetTaxiMount(sourcenode, GetTeam());
|
mount_id = objmgr.GetTaxiMount(sourcenode, GetTeam(), npc == NULL);
|
||||||
|
|
||||||
if (mount_id == 0 || sourcepath == 0)
|
if (mount_id == 0 || sourcepath == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -598,6 +598,7 @@ void Spell::FillTargetMap()
|
|||||||
case SPELL_EFFECT_SELF_RESURRECT:
|
case SPELL_EFFECT_SELF_RESURRECT:
|
||||||
case SPELL_EFFECT_REPUTATION:
|
case SPELL_EFFECT_REPUTATION:
|
||||||
case SPELL_EFFECT_LEARN_SPELL:
|
case SPELL_EFFECT_LEARN_SPELL:
|
||||||
|
case SPELL_EFFECT_SEND_TAXI:
|
||||||
if(m_targets.getUnitTarget())
|
if(m_targets.getUnitTarget())
|
||||||
AddUnitTarget(m_targets.getUnitTarget(), i);
|
AddUnitTarget(m_targets.getUnitTarget(), i);
|
||||||
// Triggered spells have additional spell targets - cast them even if no explicit unit target is given (required for spell 50516 for example)
|
// Triggered spells have additional spell targets - cast them even if no explicit unit target is given (required for spell 50516 for example)
|
||||||
|
|||||||
@@ -5901,36 +5901,7 @@ void Spell::EffectSendTaxi(uint32 i)
|
|||||||
nodes[0] = entry->from;
|
nodes[0] = entry->from;
|
||||||
nodes[1] = entry->to;
|
nodes[1] = entry->to;
|
||||||
|
|
||||||
uint32 mountid = 0;
|
((Player*)unitTarget)->ActivateTaxiPathTo(nodes);
|
||||||
switch(m_spellInfo->Id)
|
|
||||||
{
|
|
||||||
case 31606: //Stormcrow Amulet
|
|
||||||
mountid = 17447;
|
|
||||||
break;
|
|
||||||
case 45071: //Quest - Sunwell Daily - Dead Scar Bombing Run
|
|
||||||
case 45113: //Quest - Sunwell Daily - Ship Bombing Run
|
|
||||||
case 45353: //Quest - Sunwell Daily - Ship Bombing Run Return
|
|
||||||
mountid = 22840;
|
|
||||||
break;
|
|
||||||
case 34905: //Stealth Flight
|
|
||||||
mountid = 6851;
|
|
||||||
break;
|
|
||||||
case 45883: //Amber Ledge to Beryl Point
|
|
||||||
mountid = 23524;
|
|
||||||
break;
|
|
||||||
case 46064: //Amber Ledge to Coldarra
|
|
||||||
mountid = 6371;
|
|
||||||
break;
|
|
||||||
case 53335: //Stormwind Harbor Flight - Peaceful
|
|
||||||
mountid = 6852;
|
|
||||||
break;
|
|
||||||
case 41533: //Fly of the Netherwing
|
|
||||||
case 41540: //Fly of the Netherwing
|
|
||||||
mountid = 23468;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
((Player*)unitTarget)->ActivateTaxiPathTo(nodes,mountid);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user