public void SendTaxiMenu(Creature unit) { // find current node uint curloc = Global.ObjectMgr.GetNearestTaxiNode(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZ(), unit.GetMapId(), GetPlayer().GetTeam()); if (curloc == 0) { return; } bool lastTaxiCheaterState = GetPlayer().isTaxiCheater(); if (unit.GetEntry() == 29480) { GetPlayer().SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it. } ShowTaxiNodes data = new ShowTaxiNodes(); data.WindowInfo.HasValue = true; data.WindowInfo.Value.UnitGUID = unit.GetGUID(); data.WindowInfo.Value.CurrentNode = (int)curloc; GetPlayer().m_taxi.AppendTaximaskTo(data, lastTaxiCheaterState); SendPacket(data); GetPlayer().SetTaxiCheater(lastTaxiCheaterState); }
public void AppendTaximaskTo(ShowTaxiNodes data, bool all) { if (all) { data.Nodes = CliDB.TaxiNodesMask; // all existed nodes } else { data.Nodes = m_taximask; // known nodes } }
public void AppendTaximaskTo(ShowTaxiNodes data, bool all) { data.CanLandNodes = new byte[PlayerConst.TaxiMaskSize]; data.CanUseNodes = new byte[PlayerConst.TaxiMaskSize]; if (all) { Buffer.BlockCopy(CliDB.TaxiNodesMask, 0, data.CanLandNodes, 0, PlayerConst.TaxiMaskSize); // all existed nodes Buffer.BlockCopy(CliDB.TaxiNodesMask, 0, data.CanLandNodes, 0, PlayerConst.TaxiMaskSize); } else { Buffer.BlockCopy(m_taximask, 0, data.CanLandNodes, 0, PlayerConst.TaxiMaskSize); // known nodes Buffer.BlockCopy(m_taximask, 0, data.CanUseNodes, 0, PlayerConst.TaxiMaskSize); } }
public void SendTaxiMenu(Creature unit) { // find current node uint curloc = Global.ObjectMgr.GetNearestTaxiNode(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZ(), unit.GetMapId(), GetPlayer().GetTeam()); if (curloc == 0) { return; } bool lastTaxiCheaterState = GetPlayer().isTaxiCheater(); if (unit.GetEntry() == 29480) { GetPlayer().SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it. } ShowTaxiNodes data = new ShowTaxiNodes(); data.WindowInfo.HasValue = true; data.WindowInfo.Value.UnitGUID = unit.GetGUID(); data.WindowInfo.Value.CurrentNode = (int)curloc; GetPlayer().m_taxi.AppendTaximaskTo(data, lastTaxiCheaterState); byte[] reachableNodes = new byte[PlayerConst.TaxiMaskSize]; Global.TaxiPathGraph.GetReachableNodesMask(CliDB.TaxiNodesStorage.LookupByKey(curloc), reachableNodes); for (var i = 0; i < PlayerConst.TaxiMaskSize; ++i) { data.CanLandNodes[i] &= reachableNodes[i]; data.CanUseNodes[i] &= reachableNodes[i]; } SendPacket(data); GetPlayer().SetTaxiCheater(lastTaxiCheaterState); }