public bool SendLearnNewTaxiNode(Creature unit) { // find current node uint curloc = Global.ObjectMgr.GetNearestTaxiNode(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZ(), unit.GetMapId(), GetPlayer().GetTeam()); if (curloc == 0) { return(true); } if (GetPlayer().m_taxi.SetTaximaskNode(curloc)) { SendPacket(new NewTaxiPath()); TaxiNodeStatusPkt data = new TaxiNodeStatusPkt(); data.Unit = unit.GetGUID(); data.Status = TaxiNodeStatus.Learned; SendPacket(data); return(true); } else { return(false); } }
public void SendTaxiStatus(ObjectGuid guid) { // cheating checks Creature unit = ObjectAccessor.GetCreature(GetPlayer(), guid); if (unit == null) { Log.outDebug(LogFilter.Network, "WorldSession.SendTaxiStatus - {0} not found.", guid.ToString()); return; } uint curloc = Global.ObjectMgr.GetNearestTaxiNode(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZ(), unit.GetMapId(), GetPlayer().GetTeam()); TaxiNodeStatusPkt data = new TaxiNodeStatusPkt(); data.Unit = guid; if (curloc == 0) { data.Status = TaxiNodeStatus.None; } else if (unit.GetReactionTo(GetPlayer()) >= ReputationRank.Neutral) { data.Status = GetPlayer().m_taxi.IsTaximaskNodeKnown(curloc) ? TaxiNodeStatus.Learned : TaxiNodeStatus.Unlearned; } else { data.Status = TaxiNodeStatus.NotEligible; } SendPacket(data); }
public void SendTaxiStatus(ObjectGuid guid) { // cheating checks Player player = GetPlayer(); Creature unit = ObjectAccessor.GetCreature(player, guid); if (!unit || unit.IsHostileTo(player) || !unit.HasNpcFlag(NPCFlags.FlightMaster)) { Log.outDebug(LogFilter.Network, "WorldSession.SendTaxiStatus - {0} not found.", guid.ToString()); return; } // find taxi node uint nearest = Global.ObjectMgr.GetNearestTaxiNode(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZ(), unit.GetMapId(), player.GetTeam()); TaxiNodeStatusPkt data = new TaxiNodeStatusPkt(); data.Unit = guid; if (nearest == 0) { data.Status = TaxiNodeStatus.None; } else if (unit.GetReactionTo(player) >= ReputationRank.Neutral) { data.Status = player.m_taxi.IsTaximaskNodeKnown(nearest) ? TaxiNodeStatus.Learned : TaxiNodeStatus.Unlearned; } else { data.Status = TaxiNodeStatus.NotEligible; } SendPacket(data); }