support flight paths in KoS and earlier clients, also start of showing loot to other group/raid members
This commit is contained in:
parent
5430823352
commit
1cc7d22a44
@ -19224,6 +19224,8 @@ to zero and treated like placeholders." />
|
|||||||
<Data ElementName="unknown6" Type="int8" Size="1" /> <!--First byte may be range and melee toggle-->
|
<Data ElementName="unknown6" Type="int8" Size="1" /> <!--First byte may be range and melee toggle-->
|
||||||
</Struct>
|
</Struct>
|
||||||
<Struct Name="WS_ClearForTakeOff" ClientVersion="1" OpcodeName="OP_ClearForTakeOffMsg">
|
<Struct Name="WS_ClearForTakeOff" ClientVersion="1" OpcodeName="OP_ClearForTakeOffMsg">
|
||||||
|
</Struct>
|
||||||
|
<Struct Name="WS_ClearForTakeOff" ClientVersion="562" OpcodeName="OP_ClearForTakeOffMsg">
|
||||||
<Data ElementName="spawn_id" Type="int32" />
|
<Data ElementName="spawn_id" Type="int32" />
|
||||||
<Data ElementName="path_id" Type="int8" />
|
<Data ElementName="path_id" Type="int8" />
|
||||||
<Data ElementName="speed" Type="float" />
|
<Data ElementName="speed" Type="float" />
|
||||||
@ -20914,15 +20916,6 @@ to zero and treated like placeholders." />
|
|||||||
<Data ElementName="z" Type="float" />
|
<Data ElementName="z" Type="float" />
|
||||||
</Data>
|
</Data>
|
||||||
</Data>
|
</Data>
|
||||||
<Data ElementName="number_of_routes3" Type="int16" IfVariableNotSet="number_of_routes" />
|
|
||||||
<Data ElementName="route_info" Type="Array" ArraySizeVariable="number_of_routes3">
|
|
||||||
<Data ElementName="ground_mount" Type="int8" />
|
|
||||||
<Data ElementName="allow_dismount" Type="int8" />
|
|
||||||
</Data>
|
|
||||||
<Data ElementName="number_of_routes4" Type="int16" IfVariableNotSet="number_of_routes" />
|
|
||||||
<Data ElementName="route_unknown" Type="Array" ArraySizeVariable="number_of_routes4">
|
|
||||||
<Data ElementName="unknown" Type="int16" />
|
|
||||||
</Data>
|
|
||||||
</Struct>
|
</Struct>
|
||||||
<Struct Name="WS_FlightPathsMsg" ClientVersion="1193" OpcodeName="OP_RestartZoneMsg">
|
<Struct Name="WS_FlightPathsMsg" ClientVersion="1193" OpcodeName="OP_RestartZoneMsg">
|
||||||
<Data ElementName="number_of_routes" Type="int16" />
|
<Data ElementName="number_of_routes" Type="int16" />
|
||||||
@ -21035,4 +21028,7 @@ to zero and treated like placeholders." />
|
|||||||
<Data ElementName="unknown5" Type="int8"/>
|
<Data ElementName="unknown5" Type="int8"/>
|
||||||
<Data ElementName="unknown6" Type="int8"/>
|
<Data ElementName="unknown6" Type="int8"/>
|
||||||
</Struct>
|
</Struct>
|
||||||
|
<Struct Name="WS_CreateBoatTransportMsg" ClientVersion="1" OpcodeName="OP_CreateBoatTransportsMsg">
|
||||||
|
<Data ElementName="path_id" Type="int8" />
|
||||||
|
</Struct>
|
||||||
</EQ2Emulator>
|
</EQ2Emulator>
|
||||||
|
@ -1035,7 +1035,7 @@ void PlayerGroupManager::SendGroupChatMessage(int32 group_id, int16 channel, con
|
|||||||
if (m_groups.count(group_id) > 0) {
|
if (m_groups.count(group_id) > 0) {
|
||||||
std::vector<int32> raidGroups;
|
std::vector<int32> raidGroups;
|
||||||
|
|
||||||
if (channel == CHANNEL_RAID_SAY || channel == CHANNEL_LOOT_ROLLS)
|
if (channel == CHANNEL_RAID_SAY || channel == CHANNEL_LOOT_ROLLS || channel == CHANNEL_LOOT)
|
||||||
m_groups[group_id]->GetRaidGroups(&raidGroups);
|
m_groups[group_id]->GetRaidGroups(&raidGroups);
|
||||||
|
|
||||||
if (raidGroups.size() < 1)
|
if (raidGroups.size() < 1)
|
||||||
|
@ -2649,6 +2649,10 @@ void Spawn::InitializeInfoPacketData(Player* spawn, PacketStruct* packet) {
|
|||||||
vis_flag += INFO_VIS_FLAG_HIDE_HOOD;
|
vis_flag += INFO_VIS_FLAG_HIDE_HOOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(spawn == this && IsPlayer() && ((Player*)this)->GetClient() && ((Player*)this)->GetClient()->GetOnAutoMount()) {
|
||||||
|
classicFlags += INFO_CLASSIC_FLAG_AUTOMOUNT;
|
||||||
|
}
|
||||||
|
|
||||||
if(version <= 561) {
|
if(version <= 561) {
|
||||||
packet->setDataByName("flags", classicFlags);
|
packet->setDataByName("flags", classicFlags);
|
||||||
}
|
}
|
||||||
|
@ -201,6 +201,7 @@
|
|||||||
#define INFO_CLASSIC_FLAG_SHOW_HOOD 2
|
#define INFO_CLASSIC_FLAG_SHOW_HOOD 2
|
||||||
#define INFO_CLASSIC_FLAG_NOLOOK 4
|
#define INFO_CLASSIC_FLAG_NOLOOK 4
|
||||||
#define INFO_CLASSIC_FLAG_CROUCH 8
|
#define INFO_CLASSIC_FLAG_CROUCH 8
|
||||||
|
#define INFO_CLASSIC_FLAG_AUTOMOUNT 32
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
class Spell;
|
class Spell;
|
||||||
|
@ -2920,6 +2920,10 @@ bool Client::HandleLootItem(Spawn* entity, Item* item, Spawn* target, bool overr
|
|||||||
int8 type = CHANNEL_LOOT;
|
int8 type = CHANNEL_LOOT;
|
||||||
if (entity) {
|
if (entity) {
|
||||||
lootingClient->Message(type, "You loot %s from the corpse of %s", item->CreateItemLink(GetVersion()).c_str(), entity->GetName());
|
lootingClient->Message(type, "You loot %s from the corpse of %s", item->CreateItemLink(GetVersion()).c_str(), entity->GetName());
|
||||||
|
if(entity->GetLootGroupID()) {
|
||||||
|
// TODO: Item link for each client
|
||||||
|
world.GetGroupManager()->SendGroupChatMessage(entity->GetLootGroupID(), CHANNEL_LOOT, "%s looted %s from the corpse of %s.", lootingPlayer->GetName(), item->name.c_str(), entity->GetName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lootingClient->Message(type, "You found a %s.", item->CreateItemLink(GetVersion()).c_str());
|
lootingClient->Message(type, "You found a %s.", item->CreateItemLink(GetVersion()).c_str());
|
||||||
@ -11637,7 +11641,9 @@ void Client::AttemptStartAutoMount() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Client::EndAutoMount() {
|
void Client::EndAutoMount() {
|
||||||
PacketStruct* packet = configReader.getStruct("WS_ServerControlFlags", GetVersion());
|
PacketStruct* packet = nullptr;
|
||||||
|
if(GetVersion() > 561) {
|
||||||
|
packet = configReader.getStruct("WS_ServerControlFlags", GetVersion());
|
||||||
if (packet) {
|
if (packet) {
|
||||||
packet->setDataByName("parameter1", 128);
|
packet->setDataByName("parameter1", 128);
|
||||||
packet->setDataByName("parameter2", 64);
|
packet->setDataByName("parameter2", 64);
|
||||||
@ -11661,7 +11667,15 @@ void Client::EndAutoMount() {
|
|||||||
QueuePacket(packet->serialize());
|
QueuePacket(packet->serialize());
|
||||||
safe_delete(packet);
|
safe_delete(packet);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(GetVersion() <= 561) {
|
||||||
|
packet = configReader.getStruct("WS_CreateBoatTransportMsg", GetVersion());
|
||||||
|
if (packet) {
|
||||||
|
QueuePacket(packet->serialize());
|
||||||
|
safe_delete(packet);
|
||||||
|
}
|
||||||
|
}
|
||||||
on_auto_mount = false;
|
on_auto_mount = false;
|
||||||
|
|
||||||
player->SetMount(((Player*)player)->GetTempMount());
|
player->SetMount(((Player*)player)->GetTempMount());
|
||||||
@ -12244,7 +12258,6 @@ void Client::SendMoveObjectMode(Spawn* spawn, uint8 placementMode, float unknown
|
|||||||
void Client::SendFlightAutoMount(int32 path_id, int16 mount_id, int8 mount_red_color, int8 mount_green_color, int8 mount_blue_color)
|
void Client::SendFlightAutoMount(int32 path_id, int16 mount_id, int8 mount_red_color, int8 mount_green_color, int8 mount_blue_color)
|
||||||
{
|
{
|
||||||
SetPendingFlightPath(path_id);
|
SetPendingFlightPath(path_id);
|
||||||
|
|
||||||
((Player*)player)->SetTempMount(((Entity*)player)->GetMount());
|
((Player*)player)->SetTempMount(((Entity*)player)->GetMount());
|
||||||
((Player*)player)->SetTempMountColor(((Entity*)player)->GetMountColor());
|
((Player*)player)->SetTempMountColor(((Entity*)player)->GetMountColor());
|
||||||
((Player*)player)->SetTempMountSaddleColor(((Entity*)player)->GetMountSaddleColor());
|
((Player*)player)->SetTempMountSaddleColor(((Entity*)player)->GetMountSaddleColor());
|
||||||
|
@ -8738,39 +8738,26 @@ void ZoneServer::SendFlightPathsPackets(Client* client) {
|
|||||||
if (m_flightPathRoutes.size() > 0) {
|
if (m_flightPathRoutes.size() > 0) {
|
||||||
PacketStruct* packet = configReader.getStruct("WS_FlightPathsMsg", client->GetVersion());
|
PacketStruct* packet = configReader.getStruct("WS_FlightPathsMsg", client->GetVersion());
|
||||||
if (packet) {
|
if (packet) {
|
||||||
|
|
||||||
int32 num_routes = m_flightPaths.size();
|
int32 num_routes = m_flightPaths.size();
|
||||||
packet->setArrayLengthByName("number_of_routes", num_routes);
|
packet->setArrayLengthByName("number_of_routes", num_routes);
|
||||||
packet->setArrayLengthByName("number_of_routes2", num_routes);
|
packet->setArrayLengthByName("number_of_routes2", num_routes);
|
||||||
packet->setArrayLengthByName("number_of_routes3", num_routes);
|
packet->setArrayLengthByName("number_of_routes3", num_routes);
|
||||||
packet->setArrayLengthByName("number_of_routes4", num_routes);
|
packet->setArrayLengthByName("number_of_routes4", num_routes);
|
||||||
|
|
||||||
map<int32, FlightPathInfo*>::iterator itr;
|
map<int32, FlightPathInfo*>::iterator itr;
|
||||||
int32 i = 0;
|
int32 i = 0;
|
||||||
for (itr = m_flightPaths.begin(); itr != m_flightPaths.end(); itr++, i++) {
|
for (itr = m_flightPaths.begin(); itr != m_flightPaths.end(); itr++, i++) {
|
||||||
packet->setArrayDataByName("route_length", m_flightPathRoutes[itr->first].size(), i);
|
packet->setArrayDataByName("route_length", m_flightPathRoutes[itr->first].size(), i);
|
||||||
packet->setArrayDataByName("ground_mount", itr->second->flying ? 0 : 1, i);
|
packet->setArrayDataByName("ground_mount", itr->second->flying ? 0 : 1, i);
|
||||||
packet->setArrayDataByName("allow_dismount", itr->second->dismount ? 1 : 0, i);
|
packet->setArrayDataByName("allow_dismount", itr->second->dismount ? 1 : 0, i);
|
||||||
|
|
||||||
|
|
||||||
packet->setSubArrayLengthByName("route_length2", m_flightPathRoutes[itr->first].size(), i);
|
packet->setSubArrayLengthByName("route_length2", m_flightPathRoutes[itr->first].size(), i);
|
||||||
vector<FlightPathLocation*>::iterator itr2;
|
vector<FlightPathLocation*>::iterator itr2;
|
||||||
int32 j = 0;
|
int32 j = 0;
|
||||||
for (itr2 = m_flightPathRoutes[itr->first].begin(); itr2 != m_flightPathRoutes[itr->first].end(); itr2++, j++) {
|
for (itr2 = m_flightPathRoutes[itr->first].begin(); itr2 != m_flightPathRoutes[itr->first].end(); itr2++, j++) {
|
||||||
if(client->GetVersion() <= 561) {
|
|
||||||
std::string fieldNum = std::to_string(i) + "_" + std::to_string(j);
|
|
||||||
packet->setDataByName(("x" + fieldNum).c_str(), (*itr2)->X);
|
|
||||||
packet->setDataByName(("y" + fieldNum).c_str(), (*itr2)->Y);
|
|
||||||
packet->setDataByName(("z" + fieldNum).c_str(), (*itr2)->Z);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
packet->setSubArrayDataByName("x", (*itr2)->X, i, j);
|
packet->setSubArrayDataByName("x", (*itr2)->X, i, j);
|
||||||
packet->setSubArrayDataByName("y", (*itr2)->Y, i, j);
|
packet->setSubArrayDataByName("y", (*itr2)->Y, i, j);
|
||||||
packet->setSubArrayDataByName("z", (*itr2)->Z, i, j);
|
packet->setSubArrayDataByName("z", (*itr2)->Z, i, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//packet->PrintPacket();
|
|
||||||
client->QueuePacket(packet->serialize());
|
client->QueuePacket(packet->serialize());
|
||||||
safe_delete(packet);
|
safe_delete(packet);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user