Bot Invite/Accept cleanup

This commit is contained in:
neckkola
2022-01-12 18:47:56 -04:00
parent d62171f34d
commit 6411c2335e
3 changed files with 553 additions and 556 deletions
+1 -1
View File
@@ -10115,7 +10115,7 @@ void Bot::StopMoving(float new_heading)
uint8 Bot::spell_casting_chances[SPELL_TYPE_COUNT][PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND] = { 0 }; uint8 Bot::spell_casting_chances[SPELL_TYPE_COUNT][PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND] = { 0 };
void Bot::ProcessRaidInvite2(Client* invitee, Client* invitor) { void Bot::ProcessRaidInvite(Client* invitee, Client* invitor) {
Raid* raid = entity_list.GetRaidByClient(invitor); Raid* raid = entity_list.GetRaidByClient(invitor);
Group* g_invitee = invitee->GetGroup(); Group* g_invitee = invitee->GetGroup();
+2 -2
View File
@@ -362,8 +362,8 @@ public:
static std::string RaceIdToString(uint16 raceId); static std::string RaceIdToString(uint16 raceId);
static bool IsBotAttackAllowed(Mob* attacker, Mob* target, bool& hasRuleDefined); static bool IsBotAttackAllowed(Mob* attacker, Mob* target, bool& hasRuleDefined);
static Bot* GetBotByBotClientOwnerAndBotName(Client* c, std::string botName); static Bot* GetBotByBotClientOwnerAndBotName(Client* c, std::string botName);
static void ProcessRaidInvite(Bot* player_accepting_invite, Client* b_owner); //Mitch static void ProcessRaidInvite(Bot* invitee, Client* invitor); //Mitch
static void ProcessRaidInvite2(Client* invitee, Client* invitor); //Mitch static void ProcessRaidInvite(Client* invitee, Client* invitor); //Mitch
static void ProcessBotGroupInvite(Client* c, std::string botName); static void ProcessBotGroupInvite(Client* c, std::string botName);
static void ProcessBotGroupDisband(Client* c, std::string botName); static void ProcessBotGroupDisband(Client* c, std::string botName);
static void BotOrderCampAll(Client* c); static void BotOrderCampAll(Client* c);
+67 -70
View File
@@ -11309,7 +11309,7 @@ void Client::Handle_OP_QueryUCSServerStatus(const EQApplicationPacket *app)
} }
} }
void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
{ {
if (app->size < sizeof(RaidGeneral_Struct)) { if (app->size < sizeof(RaidGeneral_Struct)) {
LogError("Wrong size: OP_RaidCommand, size=[{}], expected at least [{}]", app->size, sizeof(RaidGeneral_Struct)); LogError("Wrong size: OP_RaidCommand, size=[{}], expected at least [{}]", app->size, sizeof(RaidGeneral_Struct));
@@ -11317,43 +11317,42 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
return; return;
} }
RaidGeneral_Struct *raid_command_packet = (RaidGeneral_Struct*)app->pBuffer; RaidGeneral_Struct* raid_command_packet = (RaidGeneral_Struct*)app->pBuffer;
switch (raid_command_packet->action) switch (raid_command_packet->action)
{ {
case RaidCommandInviteIntoExisting: case RaidCommandInviteIntoExisting:
case RaidCommandInvite: { case RaidCommandInvite: {
//Mitch
#ifdef BOTS #ifdef BOTS //Mitch
Bot* player_to_invite = nullptr; Bot* player_to_invite = nullptr;
Client* player_to_invite_owner = nullptr; Client* player_to_invite_owner = nullptr;
if (entity_list.GetBotByBotName(raid_command_packet->player_name) ) { if (entity_list.GetBotByBotName(raid_command_packet->player_name)) {
Bot* player_to_invite = entity_list.GetBotByBotName(raid_command_packet->player_name); Bot* player_to_invite = entity_list.GetBotByBotName(raid_command_packet->player_name);
Client* player_to_invite_owner = player_to_invite->GetOwner()->CastToClient(); Client* player_to_invite_owner = player_to_invite->GetOwner()->CastToClient();
Group* player_to_invite_group = player_to_invite->GetGroup();
if (!player_to_invite) { if (!player_to_invite) {
break; break;
} }
Group* player_to_invite_group = player_to_invite->GetGroup(); //Not allowed: Invite a bot that is already within a raid.
// Not allowed: Invite a bot that is not owned by the inviter and is not in a group. They could be in a group with their owner! if (player_to_invite->IsRaidGrouped()) {
if (player_to_invite->GetOwnerID() != player_to_invite_owner->CharacterID() && !player_to_invite_group) { MessageString(Chat::White, ALREADY_IN_RAID, GetName()); //must invite members not in raid...
Message(Chat::Red, "%s is not grouped and not your Bot. You can only invite your Bots, or Bots grouped with others.", player_to_invite->GetName()); return;
} }
//Not allowed: Invite a bot that is already within a raid. // Not allowed: Invite a bot that is not owned by the invitor
if (player_to_invite->HasRaid()) { if (player_to_invite->IsBot() &&
Message(Chat::Red, "%s is already in a raid.", player_to_invite->GetName()); player_to_invite->CastToBot()->GetOwner()->CastToClient()->CharacterID() !=
break; player_to_invite_owner->CharacterID()) {
Message(Chat::Red, "%s is not your Bot. You can only invite your Bots, or players grouped with bots.", player_to_invite->GetName());
} }
// Not allowed: Invite a bot that is in a group that is already a member
if (player_to_invite_group && player_to_invite_group->IsGroupMember(this)) { // Not allowed: Invite a bot that is in a group but the bot is not the group leader
MessageString(Chat::Red, ALREADY_IN_PARTY); if (player_to_invite_group && !player_to_invite_group->IsLeader(player_to_invite->CastToMob())) {
break; Message(Chat::Red, "You can only invite group leaders or ungrouped bots. Try %s instead.", player_to_invite_group->GetLeader()->GetName());
}
// Not allowed: Invite a bot that is in a group but not the groupleader
if (player_to_invite_group && !player_to_invite_group->IsLeader(player_to_invite)) {
Message(Chat::Red, "You can only invite an ungrouped player or group leader to join your raid.");
break; break;
} }
@@ -11403,12 +11402,11 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
} }
case RaidCommandAcceptInvite: { case RaidCommandAcceptInvite: {
Client *player_accepting_invite = entity_list.GetClientByName(raid_command_packet->player_name); Client* player_accepting_invite = entity_list.GetClientByName(raid_command_packet->player_name);
#ifdef BOTS #ifdef BOTS
// If the accepting client is in a group with a Bot, send the invite to Bot:ProcessRaidInvite // If the accepting client is in a group with a Bot or the invitor is in a group with a Bot, send the invite to Bot:ProcessRaidInvite
// instead of remaining here. // instead of remaining here.
Bot* b = nullptr; Bot* b = nullptr;
Client* invitee = entity_list.GetClientByName(raid_command_packet->leader_name); Client* invitee = entity_list.GetClientByName(raid_command_packet->leader_name);
@@ -11416,6 +11414,11 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
Group* g_invitee = invitee->GetGroup(); Group* g_invitee = invitee->GetGroup();
Group* g_invitor = invitor->GetGroup(); Group* g_invitor = invitor->GetGroup();
if (invitee && invitee->IsRaidGrouped()) {
invitor->MessageString(Chat::White, ALREADY_IN_RAID, GetName()); //group failed, must invite members not in raid...
return;
}
bool invitor_has_bot = false; bool invitor_has_bot = false;
bool invitee_has_bot = false; bool invitee_has_bot = false;
@@ -11443,13 +11446,12 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
} }
if (invitor_has_bot || invitee_has_bot) { if (invitor_has_bot || invitee_has_bot) {
Bot::ProcessRaidInvite2(invitee, invitor); Bot::ProcessRaidInvite(invitee, invitor); //two clients with one or both having groups with bots
break; break;
} }
else else if (invitee->IsBot())
if (invitee->IsBot())
{ {
Bot::ProcessRaidInvite(b, player_accepting_invite); Bot::ProcessRaidInvite(b, player_accepting_invite); //client inviting a bot
break; break;
} }
@@ -11459,10 +11461,10 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
player_accepting_invite->MessageString(Chat::White, ALREADY_IN_RAID, GetName()); //group failed, must invite members not in raid... player_accepting_invite->MessageString(Chat::White, ALREADY_IN_RAID, GetName()); //group failed, must invite members not in raid...
return; return;
} }
Raid *raid = entity_list.GetRaidByClient(player_accepting_invite); Raid* raid = entity_list.GetRaidByClient(player_accepting_invite);
if (raid) { if (raid) {
raid->VerifyRaid(); raid->VerifyRaid();
Group *group = GetGroup(); Group* group = GetGroup();
if (group) { if (group) {
if (group->GroupCount() + raid->RaidCount() > MAX_RAID_MEMBERS) { if (group->GroupCount() + raid->RaidCount() > MAX_RAID_MEMBERS) {
player_accepting_invite->Message(Chat::Red, "Invite failed, group invite would create a raid larger than the maximum number of members allowed."); player_accepting_invite->Message(Chat::Red, "Invite failed, group invite would create a raid larger than the maximum number of members allowed.");
@@ -11477,10 +11479,10 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
if (group) {//add us all if (group) {//add us all
uint32 free_group_id = raid->GetFreeGroup(); uint32 free_group_id = raid->GetFreeGroup();
Client *addClient = nullptr; Client* addClient = nullptr;
for (int x = 0; x < 6; x++) { for (int x = 0; x < 6; x++) {
if (group->members[x]) { if (group->members[x]) {
Client *c = nullptr; Client* c = nullptr;
if (group->members[x]->IsClient()) if (group->members[x]->IsClient())
c = group->members[x]->CastToClient(); c = group->members[x]->CastToClient();
else else
@@ -11520,8 +11522,8 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
else else
{ {
Group *player_invited_group = player_accepting_invite->GetGroup(); Group* player_invited_group = player_accepting_invite->GetGroup();
Group *group = GetGroup(); Group* group = GetGroup();
if (group) //if our target has a group if (group) //if our target has a group
{ {
raid = new Raid(player_accepting_invite); raid = new Raid(player_accepting_invite);
@@ -11532,7 +11534,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
/* If we already have a group then cycle through adding us... */ /* If we already have a group then cycle through adding us... */
if (player_invited_group) { if (player_invited_group) {
Client *client_to_be_leader = nullptr; Client* client_to_be_leader = nullptr;
for (int x = 0; x < 6; x++) { for (int x = 0; x < 6; x++) {
if (player_invited_group->members[x]) { if (player_invited_group->members[x]) {
if (!client_to_be_leader) { if (!client_to_be_leader) {
@@ -11542,7 +11544,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
} }
if (player_invited_group->IsLeader(player_invited_group->members[x])) { if (player_invited_group->IsLeader(player_invited_group->members[x])) {
Client *c = nullptr; Client* c = nullptr;
if (player_invited_group->members[x]->IsClient()) if (player_invited_group->members[x]->IsClient())
c = player_invited_group->members[x]->CastToClient(); c = player_invited_group->members[x]->CastToClient();
@@ -11559,7 +11561,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
} }
else { else {
Client *c = nullptr; Client* c = nullptr;
if (player_invited_group->members[x]->IsClient()) if (player_invited_group->members[x]->IsClient())
c = player_invited_group->members[x]->CastToClient(); c = player_invited_group->members[x]->CastToClient();
@@ -11587,7 +11589,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
raid->AddMember(player_accepting_invite, 0xFFFFFFFF, true, false, true); raid->AddMember(player_accepting_invite, 0xFFFFFFFF, true, false, true);
} }
Client *client_to_add = nullptr; Client* client_to_add = nullptr;
/* Add client to an existing group */ /* Add client to an existing group */
for (int x = 0; x < 6; x++) { for (int x = 0; x < 6; x++) {
if (group->members[x]) { if (group->members[x]) {
@@ -11598,7 +11600,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
} }
if (group->IsLeader(group->members[x])) { if (group->IsLeader(group->members[x])) {
Client *c = nullptr; Client* c = nullptr;
if (group->members[x]->IsClient()) if (group->members[x]->IsClient())
c = group->members[x]->CastToClient(); c = group->members[x]->CastToClient();
@@ -11616,7 +11618,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
else else
{ {
Client *c = nullptr; Client* c = nullptr;
if (group->members[x]->IsClient()) if (group->members[x]->IsClient())
c = group->members[x]->CastToClient(); c = group->members[x]->CastToClient();
@@ -11647,7 +11649,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
entity_list.AddRaid(raid); entity_list.AddRaid(raid);
raid->SetRaidDetails(); raid->SetRaidDetails();
Client *addClientig = nullptr; Client* addClientig = nullptr;
for (int x = 0; x < 6; x++) { for (int x = 0; x < 6; x++) {
if (player_invited_group->members[x]) { if (player_invited_group->members[x]) {
if (!addClientig) { if (!addClientig) {
@@ -11657,7 +11659,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
} }
if (player_invited_group->IsLeader(player_invited_group->members[x])) { if (player_invited_group->IsLeader(player_invited_group->members[x])) {
Client *c = nullptr; Client* c = nullptr;
if (player_invited_group->members[x]->IsClient()) if (player_invited_group->members[x]->IsClient())
c = player_invited_group->members[x]->CastToClient(); c = player_invited_group->members[x]->CastToClient();
@@ -11675,7 +11677,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
else else
{ {
Client *c = nullptr; Client* c = nullptr;
if (player_invited_group->members[x]->IsClient()) if (player_invited_group->members[x]->IsClient())
c = player_invited_group->members[x]->CastToClient(); c = player_invited_group->members[x]->CastToClient();
else else
@@ -11722,7 +11724,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
break; break;
} }
case RaidCommandDisband: { case RaidCommandDisband: {
Raid *raid = entity_list.GetRaidByClient(this); Raid* raid = entity_list.GetRaidByClient(this);
Client* c = entity_list.GetClientByName(raid_command_packet->leader_name); Client* c = entity_list.GetClientByName(raid_command_packet->leader_name);
if (raid) { if (raid) {
@@ -11756,17 +11758,12 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
} }
raid->RemoveMember(raid_command_packet->leader_name); raid->RemoveMember(raid_command_packet->leader_name);
Client *c = entity_list.GetClientByName(raid_command_packet->leader_name); Client* c = entity_list.GetClientByName(raid_command_packet->leader_name);
if (c) { if (c) {
#ifdef BOTS #ifdef BOTS
//check to see if the leader_name has any bots in the raid
//if so, remove them as well
// for (int i = 0; i < MAX_RAID_MEMBERS; ++i) //Mitch added to remove all bots if the Bot_Owner is removed from the Raid
// { //Does not camp the Bots, just removes from the raid
// if (raid->members[i].member && raid->members[i].member->IsBot() && raid->members[i].member->CastToBot()->GetOwner()->CastToClient()->CharacterID() == entity_list.GetClientByName(raid_command_packet->leader_name)->CharacterID())
// raid->RemoveMember(raid->members[i].membername);
// }
std::vector<Bot*> raid_members_bots; std::vector<Bot*> raid_members_bots;
int owner_id = entity_list.GetClientByName(raid_command_packet->leader_name)->CharacterID(); int owner_id = entity_list.GetClientByName(raid_command_packet->leader_name)->CharacterID();
for (int i = 0; i < MAX_RAID_MEMBERS; ++i) for (int i = 0; i < MAX_RAID_MEMBERS; ++i)
@@ -11803,14 +11800,14 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
case RaidCommandMoveGroup: case RaidCommandMoveGroup:
{ {
Raid *raid = entity_list.GetRaidByClient(this); Raid* raid = entity_list.GetRaidByClient(this);
if (raid) { if (raid) {
/* Moving to group */ /* Moving to group */
if (raid_command_packet->parameter < 12) { if (raid_command_packet->parameter < 12) {
uint8 group_count = raid->GroupCount(raid_command_packet->parameter); uint8 group_count = raid->GroupCount(raid_command_packet->parameter);
if (group_count < 6) { if (group_count < 6) {
Client *c = entity_list.GetClientByName(raid_command_packet->leader_name); Client* c = entity_list.GetClientByName(raid_command_packet->leader_name);
uint32 old_group = raid->GetGroup(raid_command_packet->leader_name); uint32 old_group = raid->GetGroup(raid_command_packet->leader_name);
if (raid_command_packet->parameter == old_group) //don't rejoin grp if we order to join same group. if (raid_command_packet->parameter == old_group) //don't rejoin grp if we order to join same group.
break; break;
@@ -11827,7 +11824,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
raid->SetGroupLeader(raid->members[x].membername); raid->SetGroupLeader(raid->members[x].membername);
raid->UpdateGroupAAs(old_group); raid->UpdateGroupAAs(old_group);
Client *client_to_update = entity_list.GetClientByName(raid->members[x].membername); Client* client_to_update = entity_list.GetClientByName(raid->members[x].membername);
if (client_to_update) { if (client_to_update) {
raid->SendRaidRemove(raid->members[x].membername, client_to_update); raid->SendRaidRemove(raid->members[x].membername, client_to_update);
raid->SendRaidCreate(client_to_update); raid->SendRaidCreate(client_to_update);
@@ -11840,7 +11837,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
else { else {
auto pack = new ServerPacket(ServerOP_RaidChangeGroup, sizeof(ServerRaidGeneralAction_Struct)); auto pack = new ServerPacket(ServerOP_RaidChangeGroup, sizeof(ServerRaidGeneralAction_Struct));
ServerRaidGeneralAction_Struct *raid_command_packet = (ServerRaidGeneralAction_Struct*)pack->pBuffer; ServerRaidGeneralAction_Struct* raid_command_packet = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
raid_command_packet->rid = raid->GetID(); raid_command_packet->rid = raid->GetID();
raid_command_packet->zoneid = zone->GetZoneID(); raid_command_packet->zoneid = zone->GetZoneID();
@@ -11888,17 +11885,17 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
/* Move player to ungrouped bank */ /* Move player to ungrouped bank */
else { else {
Client *c = entity_list.GetClientByName(raid_command_packet->leader_name); Client* c = entity_list.GetClientByName(raid_command_packet->leader_name);
uint32 oldgrp = raid->GetGroup(raid_command_packet->leader_name); uint32 oldgrp = raid->GetGroup(raid_command_packet->leader_name);
if (raid->members[raid->GetPlayerIndex(raid_command_packet->leader_name)].IsGroupLeader) { if (raid->members[raid->GetPlayerIndex(raid_command_packet->leader_name)].IsGroupLeader) {
raid->SetGroupLeader(raid_command_packet->leader_name, false); raid->SetGroupLeader(raid_command_packet->leader_name, false);
for (int x = 0; x < MAX_RAID_MEMBERS; x++) { for (int x = 0; x < MAX_RAID_MEMBERS; x++) {
if (raid->members[x].GroupNumber == oldgrp && strlen(raid->members[x].membername) > 0 && strcmp(raid->members[x].membername, raid_command_packet->leader_name) != 0){ if (raid->members[x].GroupNumber == oldgrp && strlen(raid->members[x].membername) > 0 && strcmp(raid->members[x].membername, raid_command_packet->leader_name) != 0) {
raid->SetGroupLeader(raid->members[x].membername); raid->SetGroupLeader(raid->members[x].membername);
raid->UpdateGroupAAs(oldgrp); raid->UpdateGroupAAs(oldgrp);
Client *client_leaving_group = entity_list.GetClientByName(raid->members[x].membername); Client* client_leaving_group = entity_list.GetClientByName(raid->members[x].membername);
if (client_leaving_group) { if (client_leaving_group) {
raid->SendRaidRemove(raid->members[x].membername, client_leaving_group); raid->SendRaidRemove(raid->members[x].membername, client_leaving_group);
raid->SendRaidCreate(client_leaving_group); raid->SendRaidCreate(client_leaving_group);
@@ -11910,8 +11907,8 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
} }
else { else {
auto pack = new ServerPacket( ServerOP_RaidChangeGroup, sizeof(ServerRaidGeneralAction_Struct)); auto pack = new ServerPacket(ServerOP_RaidChangeGroup, sizeof(ServerRaidGeneralAction_Struct));
ServerRaidGeneralAction_Struct *raid_command = (ServerRaidGeneralAction_Struct*)pack->pBuffer; ServerRaidGeneralAction_Struct* raid_command = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
raid_command->rid = raid->GetID(); raid_command->rid = raid->GetID();
strn0cpy(raid_command->playername, raid->members[x].membername, 64); strn0cpy(raid_command->playername, raid->members[x].membername, 64);
@@ -11947,7 +11944,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
} }
Client *client_moved = entity_list.GetClientByName(raid_command_packet->leader_name); Client* client_moved = entity_list.GetClientByName(raid_command_packet->leader_name);
if (client_moved && client_moved->GetRaid()) { if (client_moved && client_moved->GetRaid()) {
client_moved->GetRaid()->SendHPManaEndPacketsTo(client_moved); client_moved->GetRaid()->SendHPManaEndPacketsTo(client_moved);
@@ -11963,7 +11960,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
case RaidCommandRaidLock: case RaidCommandRaidLock:
{ {
Raid *raid = entity_list.GetRaidByClient(this); Raid* raid = entity_list.GetRaidByClient(this);
if (raid) { if (raid) {
if (!raid->IsLocked()) if (!raid->IsLocked())
raid->LockRaid(true); raid->LockRaid(true);
@@ -11974,7 +11971,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
} }
case RaidCommandRaidUnlock: case RaidCommandRaidUnlock:
{ {
Raid *raid = entity_list.GetRaidByClient(this); Raid* raid = entity_list.GetRaidByClient(this);
if (raid) if (raid)
{ {
if (raid->IsLocked()) if (raid->IsLocked())
@@ -11987,7 +11984,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
case RaidCommandLootType2: case RaidCommandLootType2:
case RaidCommandLootType: case RaidCommandLootType:
{ {
Raid *raid = entity_list.GetRaidByClient(this); Raid* raid = entity_list.GetRaidByClient(this);
if (raid) { if (raid) {
Message(Chat::Yellow, "Loot type changed to: %d.", raid_command_packet->parameter); Message(Chat::Yellow, "Loot type changed to: %d.", raid_command_packet->parameter);
raid->ChangeLootType(raid_command_packet->parameter); raid->ChangeLootType(raid_command_packet->parameter);
@@ -11998,7 +11995,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
case RaidCommandAddLooter2: case RaidCommandAddLooter2:
case RaidCommandAddLooter: case RaidCommandAddLooter:
{ {
Raid *raid = entity_list.GetRaidByClient(this); Raid* raid = entity_list.GetRaidByClient(this);
if (raid) { if (raid) {
Message(Chat::Yellow, "Adding %s as a raid looter.", raid_command_packet->leader_name); Message(Chat::Yellow, "Adding %s as a raid looter.", raid_command_packet->leader_name);
raid->AddRaidLooter(raid_command_packet->leader_name); raid->AddRaidLooter(raid_command_packet->leader_name);
@@ -12009,7 +12006,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
case RaidCommandRemoveLooter2: case RaidCommandRemoveLooter2:
case RaidCommandRemoveLooter: case RaidCommandRemoveLooter:
{ {
Raid *raid = entity_list.GetRaidByClient(this); Raid* raid = entity_list.GetRaidByClient(this);
if (raid) { if (raid) {
Message(Chat::Yellow, "Removing %s as a raid looter.", raid_command_packet->leader_name); Message(Chat::Yellow, "Removing %s as a raid looter.", raid_command_packet->leader_name);
raid->RemoveRaidLooter(raid_command_packet->leader_name); raid->RemoveRaidLooter(raid_command_packet->leader_name);
@@ -12019,7 +12016,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
case RaidCommandMakeLeader: case RaidCommandMakeLeader:
{ {
Raid *raid = entity_list.GetRaidByClient(this); Raid* raid = entity_list.GetRaidByClient(this);
if (raid) { if (raid) {
if (strcmp(raid->leadername, GetName()) == 0) { if (strcmp(raid->leadername, GetName()) == 0) {
raid->SetRaidLeader(GetName(), raid_command_packet->leader_name); raid->SetRaidLeader(GetName(), raid_command_packet->leader_name);
@@ -12032,11 +12029,11 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
case RaidCommandSetMotd: case RaidCommandSetMotd:
{ {
Raid *raid = entity_list.GetRaidByClient(this); Raid* raid = entity_list.GetRaidByClient(this);
if (!raid) if (!raid)
break; break;
// we don't use the RaidGeneral here! // we don't use the RaidGeneral here!
RaidMOTD_Struct *motd = (RaidMOTD_Struct *)app->pBuffer; RaidMOTD_Struct* motd = (RaidMOTD_Struct*)app->pBuffer;
raid->SetRaidMOTD(std::string(motd->motd)); raid->SetRaidMOTD(std::string(motd->motd));
raid->SaveRaidMOTD(); raid->SaveRaidMOTD();
raid->SendRaidMOTDToWorld(); raid->SendRaidMOTDToWorld();