mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-25 21:02:26 +00:00
[Bug Fix] #peqzone no longer bypass Handle_OP_ZoneChange (#2063)
* [Bug Fix] #peqzone no longer bypass Handle_OP_ZoneChange * Force other quest functions to trigger EVENT_ZONE properly * call MovePC * Use MoveZone to keep things uniform
This commit is contained in:
parent
5275201713
commit
b6b662f1c7
@ -397,18 +397,7 @@ void QuestManager::Zone(const char *zone_name) {
|
|||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (initiator && initiator->IsClient())
|
if (initiator && initiator->IsClient())
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_ZoneToZoneRequest, sizeof(ZoneToZone_Struct));
|
initiator->MoveZone(zone_name);
|
||||||
ZoneToZone_Struct* ztz = (ZoneToZone_Struct*) pack->pBuffer;
|
|
||||||
ztz->response = 0;
|
|
||||||
ztz->current_zone_id = zone->GetZoneID();
|
|
||||||
ztz->current_instance_id = zone->GetInstanceID();
|
|
||||||
ztz->requested_zone_id = ZoneID(zone_name);
|
|
||||||
ztz->admin = initiator->Admin();
|
|
||||||
strcpy(ztz->name, initiator->GetName());
|
|
||||||
ztz->guild_id = initiator->GuildID();
|
|
||||||
ztz->ignorerestrictions = 3;
|
|
||||||
worldserver.SendPacket(pack);
|
|
||||||
safe_delete(pack);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,35 +405,13 @@ void QuestManager::ZoneGroup(const char *zone_name) {
|
|||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (initiator && initiator->IsClient()) {
|
if (initiator && initiator->IsClient()) {
|
||||||
if (!initiator->GetGroup()) {
|
if (!initiator->GetGroup()) {
|
||||||
auto pack = new ServerPacket(ServerOP_ZoneToZoneRequest, sizeof(ZoneToZone_Struct));
|
initiator->MoveZone(zone_name);
|
||||||
ZoneToZone_Struct* ztz = (ZoneToZone_Struct*) pack->pBuffer;
|
|
||||||
ztz->response = 0;
|
|
||||||
ztz->current_zone_id = zone->GetZoneID();
|
|
||||||
ztz->current_instance_id = zone->GetInstanceID();
|
|
||||||
ztz->requested_zone_id = ZoneID(zone_name);
|
|
||||||
ztz->admin = initiator->Admin();
|
|
||||||
strcpy(ztz->name, initiator->GetName());
|
|
||||||
ztz->guild_id = initiator->GuildID();
|
|
||||||
ztz->ignorerestrictions = 3;
|
|
||||||
worldserver.SendPacket(pack);
|
|
||||||
safe_delete(pack);
|
|
||||||
} else {
|
} else {
|
||||||
auto client_group = initiator->GetGroup();
|
auto client_group = initiator->GetGroup();
|
||||||
for (int member_index = 0; member_index < MAX_GROUP_MEMBERS; member_index++) {
|
for (int member_index = 0; member_index < MAX_GROUP_MEMBERS; member_index++) {
|
||||||
if (client_group->members[member_index] && client_group->members[member_index]->IsClient()) {
|
if (client_group->members[member_index] && client_group->members[member_index]->IsClient()) {
|
||||||
auto group_member = client_group->members[member_index]->CastToClient();
|
auto group_member = client_group->members[member_index]->CastToClient();
|
||||||
auto pack = new ServerPacket(ServerOP_ZoneToZoneRequest, sizeof(ZoneToZone_Struct));
|
group_member->MoveZone(zone_name);
|
||||||
ZoneToZone_Struct* ztz = (ZoneToZone_Struct*) pack->pBuffer;
|
|
||||||
ztz->response = 0;
|
|
||||||
ztz->current_zone_id = zone->GetZoneID();
|
|
||||||
ztz->current_instance_id = zone->GetInstanceID();
|
|
||||||
ztz->requested_zone_id = ZoneID(zone_name);
|
|
||||||
ztz->admin = group_member->Admin();
|
|
||||||
strcpy(ztz->name, group_member->GetName());
|
|
||||||
ztz->guild_id = group_member->GuildID();
|
|
||||||
ztz->ignorerestrictions = 3;
|
|
||||||
worldserver.SendPacket(pack);
|
|
||||||
safe_delete(pack);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -455,35 +422,13 @@ void QuestManager::ZoneRaid(const char *zone_name) {
|
|||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (initiator && initiator->IsClient()) {
|
if (initiator && initiator->IsClient()) {
|
||||||
if (!initiator->GetRaid()) {
|
if (!initiator->GetRaid()) {
|
||||||
auto pack = new ServerPacket(ServerOP_ZoneToZoneRequest, sizeof(ZoneToZone_Struct));
|
initiator->MoveZone(zone_name);
|
||||||
ZoneToZone_Struct* ztz = (ZoneToZone_Struct*) pack->pBuffer;
|
|
||||||
ztz->response = 0;
|
|
||||||
ztz->current_zone_id = zone->GetZoneID();
|
|
||||||
ztz->current_instance_id = zone->GetInstanceID();
|
|
||||||
ztz->requested_zone_id = ZoneID(zone_name);
|
|
||||||
ztz->admin = initiator->Admin();
|
|
||||||
strcpy(ztz->name, initiator->GetName());
|
|
||||||
ztz->guild_id = initiator->GuildID();
|
|
||||||
ztz->ignorerestrictions = 3;
|
|
||||||
worldserver.SendPacket(pack);
|
|
||||||
safe_delete(pack);
|
|
||||||
} else {
|
} else {
|
||||||
auto client_raid = initiator->GetRaid();
|
auto client_raid = initiator->GetRaid();
|
||||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||||
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||||
auto pack = new ServerPacket(ServerOP_ZoneToZoneRequest, sizeof(ZoneToZone_Struct));
|
raid_member->MoveZone(zone_name);
|
||||||
ZoneToZone_Struct* ztz = (ZoneToZone_Struct*) pack->pBuffer;
|
|
||||||
ztz->response = 0;
|
|
||||||
ztz->current_zone_id = zone->GetZoneID();
|
|
||||||
ztz->current_instance_id = zone->GetInstanceID();
|
|
||||||
ztz->requested_zone_id = ZoneID(zone_name);
|
|
||||||
ztz->admin = raid_member->Admin();
|
|
||||||
strcpy(ztz->name, raid_member->GetName());
|
|
||||||
ztz->guild_id = raid_member->GuildID();
|
|
||||||
ztz->ignorerestrictions = 3;
|
|
||||||
worldserver.SendPacket(pack);
|
|
||||||
safe_delete(pack);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -533,18 +533,7 @@ void Client::MovePC(uint32 zoneID, uint32 instanceID, float x, float y, float z,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Client::MoveZone(const char *zone_short_name) {
|
void Client::MoveZone(const char *zone_short_name) {
|
||||||
auto pack = new ServerPacket(ServerOP_ZoneToZoneRequest, sizeof(ZoneToZone_Struct));
|
ProcessMovePC(ZoneID(zone_short_name), 0, 0.0f, 0.0f, 0.0f, 0.0f, 3, ZoneToSafeCoords);
|
||||||
ZoneToZone_Struct* ztz = (ZoneToZone_Struct*) pack->pBuffer;
|
|
||||||
ztz->response = 0;
|
|
||||||
ztz->current_zone_id = zone->GetZoneID();
|
|
||||||
ztz->current_instance_id = zone->GetInstanceID();
|
|
||||||
ztz->requested_zone_id = ZoneID(zone_short_name);
|
|
||||||
ztz->admin = Admin();
|
|
||||||
strcpy(ztz->name, GetName());
|
|
||||||
ztz->guild_id = GuildID();
|
|
||||||
ztz->ignorerestrictions = 3;
|
|
||||||
worldserver.SendPacket(pack);
|
|
||||||
safe_delete(pack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::MoveZoneGroup(const char *zone_short_name) {
|
void Client::MoveZoneGroup(const char *zone_short_name) {
|
||||||
@ -579,19 +568,7 @@ void Client::MoveZoneInstance(uint16 instance_id) {
|
|||||||
if (!database.CharacterInInstanceGroup(instance_id, CharacterID())) {
|
if (!database.CharacterInInstanceGroup(instance_id, CharacterID())) {
|
||||||
database.AddClientToInstance(instance_id, CharacterID());
|
database.AddClientToInstance(instance_id, CharacterID());
|
||||||
}
|
}
|
||||||
auto pack = new ServerPacket(ServerOP_ZoneToZoneRequest, sizeof(ZoneToZone_Struct));
|
ProcessMovePC(database.ZoneIDFromInstanceID(instance_id), instance_id, 0.0f, 0.0f, 0.0f, 0.0f, 3, ZoneToSafeCoords);
|
||||||
ZoneToZone_Struct* ztz = (ZoneToZone_Struct*) pack->pBuffer;
|
|
||||||
ztz->response = 0;
|
|
||||||
ztz->current_zone_id = zone->GetZoneID();
|
|
||||||
ztz->current_instance_id = zone->GetInstanceID();
|
|
||||||
ztz->requested_zone_id = database.ZoneIDFromInstanceID(instance_id);
|
|
||||||
ztz->requested_instance_id = instance_id;
|
|
||||||
ztz->admin = Admin();
|
|
||||||
strcpy(ztz->name, GetName());
|
|
||||||
ztz->guild_id = GuildID();
|
|
||||||
ztz->ignorerestrictions = 3;
|
|
||||||
worldserver.SendPacket(pack);
|
|
||||||
safe_delete(pack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::MoveZoneInstanceGroup(uint16 instance_id) {
|
void Client::MoveZoneInstanceGroup(uint16 instance_id) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user