I would like to make a custom flightmaster with a custom taxipath.
However I stuck a little bit. In Arcemu it was easy to do with a Lua script ^^
So my questions:
-
Can it be done with a custom coordinates or is the core using DBC coords only ?
-
Can it be done with smart scripts ?
-
May somebody can point me to a c++ example ?
Thank you very much.
Core is using DBC only.
With some modifications you can ofcourse make it possible for it to use non DBC data or you could edit the data loaded from DBC afterwards
etc…
It can be done with anything you implement it to afterwards /emoticons/default_tongue.png
It should be noted that flight paths should be rather static as the path the player is on is saved and when he logs in, he will continue the same path he was on.
The flight master menu can not be used with custom flight points (no custom flight masters like that) and you must use something else like gossip options to start the path. Otherwise it requires client modification.
Preferred way would ofcourse be to edit the data itself and not tamper afterwards : |
Still want it in C++ : |?
I remember one c++ script for trinity doing this, but it’s extremely outdated.
Do you happen to remember the method it used to add paths?Did it for example edit the DBC data loaded or did it alter the flight point system or …?
The way we have it atm is like spell dbc, so DBC data is loaded into a map so its easier to edit etc.
Core is using DBC only.
I was afraid about this answer but looking into the code I already thought about that.
I want to prevent client modifications.
If it would be possible to edit the dbc files on server side only, this may be worthy to give a try. However never done such things ^^
The path would be static. Just a small flight over a hill. And I wanted to use a custom NPC with gossip to start this flight.
Now i’m confused where to start. Also editing DBC files is not trivial for me.
Shame the patch link is dead
As editing DBC is not really supported here … uh … right…
And no, you dont need a client modification for things to work on the server side.
The below code should work out of the box I think if you create a function like this:
sTaxiNodesStore.SetEntry(nodeId, nodeEntry);
or similar to edit the loaded DBC or something.
class LuaTaxiMgr
{
private:
static uint32 nodeId;
public:
static void StartTaxi(Player* player, uint32 pathid);
static uint32 AddPath(std::list<TaxiPathNodeEntry> nodes, uint32 mountA, uint32 mountH, uint32 price = 0, uint32 pathId = 0);
};
[CODE]uint32 LuaTaxiMgr::nodeId = 500;
void LuaTaxiMgr::StartTaxi(Player* player, uint32 pathid)
{
if (pathid >= sTaxiPathNodesByPath.size())
return;
TaxiPathNodeList const& path = sTaxiPathNodesByPath[pathid];
if (path.size() < 2)
return;
std::vector<uint32> nodes;
nodes.resize(2);
nodes[0] = path[0].index;
nodes[1] = path[path.size() - 1].index;
player->ActivateTaxiPathTo(nodes);
}
uint32 LuaTaxiMgr::AddPath(std::list nodes, uint32 mountA, uint32 mountH, uint32 price, uint32 pathId)
{
if (nodes.size() < 2)
return 0;
if (!pathId)
pathId = sTaxiPathNodesByPath.size();
if (sTaxiPathNodesByPath.size() <= pathId)
sTaxiPathNodesByPath.resize(pathId + 1);
sTaxiPathNodesByPath[pathId].clear();
sTaxiPathNodesByPath[pathId].resize(nodes.size());
uint32 startNode = nodeId;
uint32 index = 0;
for (std::list::const_iterator it = nodes.begin(); it != nodes.end(); ++it)
{
TaxiPathNodeEntry entry = it;
entry.path = pathId;
TaxiNodesEntry nodeEntry = new TaxiNodesEntry();
nodeEntry->ID = index;
nodeEntry->map_id = entry.mapid;
nodeEntry->MountCreatureID[0] = mountH;
nodeEntry->MountCreatureID[1] = mountA;
nodeEntry->x = entry.x;
nodeEntry->y = entry.y;
nodeEntry->z = entry.z;
sTaxiNodesStore.SetEntry(nodeId, nodeEntry);
entry.index = nodeId++;
sTaxiPathNodesByPath[pathId].set(index++, TaxiPathNodePtr(new TaxiPathNodeEntry(entry)));
}
if (startNode >= nodeId)
return 0;
sTaxiPathSetBySource[startNode][nodeId - 1] = TaxiPathBySourceAndDestination(pathId, price);
return pathId;
}[/CODE]
Hmm, the movement in the video looks bad though.
Its not actual flight movement.
Editing the points is probably a lot better.