From 96820c4a310637c86341db4379ac055dbdb6ca84 Mon Sep 17 00:00:00 2001 From: Trevius Date: Sun, 18 Jan 2015 23:04:21 -0600 Subject: [PATCH] Some work on RoF Guild Banks (still not functional). --- zone/client.cpp | 4 ++-- zone/client.h | 2 +- zone/client_packet.cpp | 27 +++++++++++++++++++++------ zone/merc.cpp | 4 ++-- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index f640fa77b..dbf9508d4 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -5741,14 +5741,14 @@ void Client::GuildBankAck() FastQueuePacket(&outapp); } -void Client::GuildBankDepositAck(bool Fail) +void Client::GuildBankDepositAck(bool Fail, int8 action) { EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildBank, sizeof(GuildBankDepositAck_Struct)); GuildBankDepositAck_Struct *gbdas = (GuildBankDepositAck_Struct*) outapp->pBuffer; - gbdas->Action = GuildBankDeposit; + gbdas->Action = action; gbdas->Fail = Fail ? 1 : 0; diff --git a/zone/client.h b/zone/client.h index 8dd343c80..c89dc017c 100644 --- a/zone/client.h +++ b/zone/client.h @@ -1097,7 +1097,7 @@ public: QGlobalCache *GetQGlobals() { return qGlobals; } QGlobalCache *CreateQGlobals() { qGlobals = new QGlobalCache(); return qGlobals; } void GuildBankAck(); - void GuildBankDepositAck(bool Fail); + void GuildBankDepositAck(bool Fail, int8 action); inline bool IsGuildBanker() { return GuildBanker; } void ClearGuildBank(); void SendGroupCreatePacket(); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 88fb64e6d..2ba7c1b82 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -6843,13 +6843,28 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) char *Buffer = (char *)app->pBuffer; uint32 Action = VARSTRUCT_DECODE_TYPE(uint32, Buffer); + uint32 sentAction = Action; + + if (GetClientVersion() >= EQClientRoF) + { + Action += 1; + /* + // Need to find all of the action types for RoF and switch case here + switch(Action) + { + case 4: + Action = 5; + break; + } + */ + } if (!IsInAGuild()) { Message(13, "You must be in a Guild to use the Guild Bank."); if (Action == GuildBankDeposit) - GuildBankDepositAck(true); + GuildBankDepositAck(true, sentAction); else GuildBankAck(); @@ -6876,7 +6891,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { Message_StringID(13, GUILD_BANK_FULL); - GuildBankDepositAck(true); + GuildBankDepositAck(true, sentAction); return; } @@ -6925,7 +6940,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { Message_StringID(13, GUILD_BANK_FULL); - GuildBankDepositAck(true); + GuildBankDepositAck(true, sentAction); return; } @@ -6938,7 +6953,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { Message(13, "No Item on the cursor."); - GuildBankDepositAck(true); + GuildBankDepositAck(true, sentAction); return; } @@ -6969,14 +6984,14 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (!Allowed) { Message_StringID(13, GUILD_BANK_CANNOT_DEPOSIT); - GuildBankDepositAck(true); + GuildBankDepositAck(true, sentAction); return; } if (GuildBanks->AddItem(GuildID(), GuildBankDepositArea, CursorItem->ID, CursorItemInst->GetCharges(), GetName(), GuildBankBankerOnly, "")) { - GuildBankDepositAck(false); + GuildBankDepositAck(false, sentAction); DeleteItemInInventory(MainCursor, 0, false); } diff --git a/zone/merc.cpp b/zone/merc.cpp index 700287ffe..2f17d7ca3 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1336,7 +1336,7 @@ void Merc::AI_Process() { if(IsCasting()) return; - // A bot wont start its AI if not grouped + // A merc wont start its AI if not grouped if(!HasGroup()) { return; } @@ -5474,7 +5474,7 @@ bool Client::MercOnlyOrNoGroup() { } if (GetMerc()) { - if (GetMerc()->HasGroup() && GetMerc()->GetGroup() == GetGroup()) + if (GetMerc()->GetGroup() == GetGroup()) { if (GetGroup()->GroupCount() < 3) {