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-->
|
||||
</Struct>
|
||||
<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="path_id" Type="int8" />
|
||||
<Data ElementName="speed" Type="float" />
|
||||
@ -20914,15 +20916,6 @@ to zero and treated like placeholders." />
|
||||
<Data ElementName="z" Type="float" />
|
||||
</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 Name="WS_FlightPathsMsg" ClientVersion="1193" OpcodeName="OP_RestartZoneMsg">
|
||||
<Data ElementName="number_of_routes" Type="int16" />
|
||||
@ -21035,4 +21028,7 @@ to zero and treated like placeholders." />
|
||||
<Data ElementName="unknown5" Type="int8"/>
|
||||
<Data ElementName="unknown6" Type="int8"/>
|
||||
</Struct>
|
||||
<Struct Name="WS_CreateBoatTransportMsg" ClientVersion="1" OpcodeName="OP_CreateBoatTransportsMsg">
|
||||
<Data ElementName="path_id" Type="int8" />
|
||||
</Struct>
|
||||
</EQ2Emulator>
|
||||
|
@ -1035,7 +1035,7 @@ void PlayerGroupManager::SendGroupChatMessage(int32 group_id, int16 channel, con
|
||||
if (m_groups.count(group_id) > 0) {
|
||||
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);
|
||||
|
||||
if (raidGroups.size() < 1)
|
||||
|
@ -2648,7 +2648,11 @@ void Spawn::InitializeInfoPacketData(Player* spawn, PacketStruct* packet) {
|
||||
if(!vis_hide_hood && appearance.hide_hood && version > 561) {
|
||||
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) {
|
||||
packet->setDataByName("flags", classicFlags);
|
||||
}
|
||||
|
@ -201,6 +201,7 @@
|
||||
#define INFO_CLASSIC_FLAG_SHOW_HOOD 2
|
||||
#define INFO_CLASSIC_FLAG_NOLOOK 4
|
||||
#define INFO_CLASSIC_FLAG_CROUCH 8
|
||||
#define INFO_CLASSIC_FLAG_AUTOMOUNT 32
|
||||
|
||||
using namespace std;
|
||||
class Spell;
|
||||
|
@ -2920,6 +2920,10 @@ bool Client::HandleLootItem(Spawn* entity, Item* item, Spawn* target, bool overr
|
||||
int8 type = CHANNEL_LOOT;
|
||||
if (entity) {
|
||||
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 {
|
||||
lootingClient->Message(type, "You found a %s.", item->CreateItemLink(GetVersion()).c_str());
|
||||
@ -11637,31 +11641,41 @@ void Client::AttemptStartAutoMount() {
|
||||
}
|
||||
|
||||
void Client::EndAutoMount() {
|
||||
PacketStruct* packet = configReader.getStruct("WS_ServerControlFlags", GetVersion());
|
||||
if (packet) {
|
||||
packet->setDataByName("parameter1", 128);
|
||||
packet->setDataByName("parameter2", 64);
|
||||
packet->setDataByName("value", 1);
|
||||
QueuePacket(packet->serialize());
|
||||
safe_delete(packet);
|
||||
PacketStruct* packet = nullptr;
|
||||
if(GetVersion() > 561) {
|
||||
packet = configReader.getStruct("WS_ServerControlFlags", GetVersion());
|
||||
if (packet) {
|
||||
packet->setDataByName("parameter1", 128);
|
||||
packet->setDataByName("parameter2", 64);
|
||||
packet->setDataByName("value", 1);
|
||||
QueuePacket(packet->serialize());
|
||||
safe_delete(packet);
|
||||
}
|
||||
|
||||
packet = configReader.getStruct("WS_ServerControlFlags", GetVersion());
|
||||
if (packet) {
|
||||
packet->setDataByName("parameter3", 4);
|
||||
packet->setDataByName("parameter5", 2);
|
||||
packet->setDataByName("value", 0);
|
||||
QueuePacket(packet->serialize());
|
||||
safe_delete(packet);
|
||||
}
|
||||
|
||||
packet = configReader.getStruct("WS_ClearForLanding", GetVersion());
|
||||
if (packet) {
|
||||
packet->setDataByName("spawn_id", GetPlayer()->GetIDWithPlayerSpawn(GetPlayer()));
|
||||
QueuePacket(packet->serialize());
|
||||
safe_delete(packet);
|
||||
}
|
||||
}
|
||||
|
||||
packet = configReader.getStruct("WS_ServerControlFlags", GetVersion());
|
||||
if (packet) {
|
||||
packet->setDataByName("parameter3", 4);
|
||||
packet->setDataByName("parameter5", 2);
|
||||
packet->setDataByName("value", 0);
|
||||
QueuePacket(packet->serialize());
|
||||
safe_delete(packet);
|
||||
if(GetVersion() <= 561) {
|
||||
packet = configReader.getStruct("WS_CreateBoatTransportMsg", GetVersion());
|
||||
if (packet) {
|
||||
QueuePacket(packet->serialize());
|
||||
safe_delete(packet);
|
||||
}
|
||||
}
|
||||
|
||||
packet = configReader.getStruct("WS_ClearForLanding", GetVersion());
|
||||
if (packet) {
|
||||
packet->setDataByName("spawn_id", GetPlayer()->GetIDWithPlayerSpawn(GetPlayer()));
|
||||
QueuePacket(packet->serialize());
|
||||
safe_delete(packet);
|
||||
}
|
||||
|
||||
on_auto_mount = false;
|
||||
|
||||
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)
|
||||
{
|
||||
SetPendingFlightPath(path_id);
|
||||
|
||||
((Player*)player)->SetTempMount(((Entity*)player)->GetMount());
|
||||
((Player*)player)->SetTempMountColor(((Entity*)player)->GetMountColor());
|
||||
((Player*)player)->SetTempMountSaddleColor(((Entity*)player)->GetMountSaddleColor());
|
||||
|
@ -8738,39 +8738,26 @@ void ZoneServer::SendFlightPathsPackets(Client* client) {
|
||||
if (m_flightPathRoutes.size() > 0) {
|
||||
PacketStruct* packet = configReader.getStruct("WS_FlightPathsMsg", client->GetVersion());
|
||||
if (packet) {
|
||||
|
||||
int32 num_routes = m_flightPaths.size();
|
||||
packet->setArrayLengthByName("number_of_routes", num_routes);
|
||||
packet->setArrayLengthByName("number_of_routes2", num_routes);
|
||||
packet->setArrayLengthByName("number_of_routes3", num_routes);
|
||||
packet->setArrayLengthByName("number_of_routes4", num_routes);
|
||||
|
||||
map<int32, FlightPathInfo*>::iterator itr;
|
||||
int32 i = 0;
|
||||
for (itr = m_flightPaths.begin(); itr != m_flightPaths.end(); itr++, i++) {
|
||||
packet->setArrayDataByName("route_length", m_flightPathRoutes[itr->first].size(), i);
|
||||
packet->setArrayDataByName("ground_mount", itr->second->flying ? 0 : 1, i);
|
||||
packet->setArrayDataByName("allow_dismount", itr->second->dismount ? 1 : 0, i);
|
||||
|
||||
|
||||
packet->setSubArrayLengthByName("route_length2", m_flightPathRoutes[itr->first].size(), i);
|
||||
vector<FlightPathLocation*>::iterator itr2;
|
||||
int32 j = 0;
|
||||
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("y", (*itr2)->Y, i, j);
|
||||
packet->setSubArrayDataByName("z", (*itr2)->Z, i, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
//packet->PrintPacket();
|
||||
client->QueuePacket(packet->serialize());
|
||||
safe_delete(packet);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user