From 7800cbbe964e6c5b8bdc96244d413436c31e019e Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 1 Oct 2014 16:22:45 -0400 Subject: [PATCH] Initial work on OP_ItemRecastDelay --- common/emu_oplist.h | 1 + common/eq_packet_structs.h | 7 +++++++ common/opcode_dispatch.h | 1 + utils/patches/patch_RoF.conf | 2 ++ utils/patches/patch_SoD.conf | 2 ++ utils/patches/patch_Underfoot.conf | 2 ++ zone/spells.cpp | 13 +++++++++++++ 7 files changed, 28 insertions(+) diff --git a/common/emu_oplist.h b/common/emu_oplist.h index af871ec6a..8126fc773 100644 --- a/common/emu_oplist.h +++ b/common/emu_oplist.h @@ -542,4 +542,5 @@ N(OP_ZoneServerInfo), N(OP_ZoneServerReady), N(OP_ZoneSpawns), N(OP_ZoneUnavail), +N(OP_ItemRecastDelay), // mail and chat opcodes located in ../mail_oplist.h diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index ea0acaa90..2e4b29261 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -4264,6 +4264,13 @@ struct ItemVerifyReply_Struct { /*012*/ }; +struct ItemRecastDelay_Struct { +/*000*/ uint32 recast_delay; // in seconds +/*004*/ uint32 recast_type; +/*008*/ uint32 unknown008; +/*012*/ +}; + /** * Shroud yourself. For yourself shrouding, this has your spawnId, spawnStruct, * bits of your charProfileStruct (no checksum, then charProfile up till diff --git a/common/opcode_dispatch.h b/common/opcode_dispatch.h index 3920dd3f7..46e8b9099 100644 --- a/common/opcode_dispatch.h +++ b/common/opcode_dispatch.h @@ -306,6 +306,7 @@ OUTz(OP_FinishWindow2); //OUTv(OP_AdventureMerchantResponse, strlen(msg)+2); OUTv(OP_ItemPacket, ItemPacket_Struct); OUTv(OP_ColoredText, ColoredText_Struct); +OUTv(OP_ItemRecastDelay, ItemRecastDelay_Struct); OUTv(OP_FormattedMessage, FormattedMessage_Struct); OUTv(OP_GuildMemberList, uint32); //variable length, but nasty OUTv(OP_InterruptCast, InterruptCast_Struct); diff --git a/utils/patches/patch_RoF.conf b/utils/patches/patch_RoF.conf index 728676b2d..16197c0da 100644 --- a/utils/patches/patch_RoF.conf +++ b/utils/patches/patch_RoF.conf @@ -653,3 +653,5 @@ OP_RAWOutOfSession=0x0000 # we need to document the differences between these packets to make identifying them easier OP_Some3ByteHPUpdate=0x0000 # initial HP update for mobs OP_InitialHPUpdate=0x0000 + +OP_ItemRecastDelay=0x57ed diff --git a/utils/patches/patch_SoD.conf b/utils/patches/patch_SoD.conf index 10df077f7..f0d223edb 100644 --- a/utils/patches/patch_SoD.conf +++ b/utils/patches/patch_SoD.conf @@ -660,3 +660,5 @@ OP_RAWOutOfSession=0x0000 # # we need to document the differences between these packets to make identifying them easier OP_Some3ByteHPUpdate=0x0000 # initial HP update for mobs OP_InitialHPUpdate=0x0000 # + +OP_ItemRecastDelay=0x15c4 diff --git a/utils/patches/patch_Underfoot.conf b/utils/patches/patch_Underfoot.conf index 4621a74a9..1b65a6481 100644 --- a/utils/patches/patch_Underfoot.conf +++ b/utils/patches/patch_Underfoot.conf @@ -654,3 +654,5 @@ OP_RAWOutOfSession=0x0000 # # we need to document the differences between these packets to make identifying them easier OP_Some3ByteHPUpdate=0x0000 # initial HP update for mobs OP_InitialHPUpdate=0x0000 # + +OP_ItemRecastDelay=0x82d7 diff --git a/zone/spells.cpp b/zone/spells.cpp index a18eabe20..5205176a9 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -484,6 +484,19 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, return false; } + // This needs a bit more work for saving timer to PP for zoning etc + if (IsClient() && item_slot) { + ItemInst *itm = CastToClient()->GetInv().GetItem(item_slot); + if (itm->GetItem()->RecastDelay) { + outapp = new EQApplicationPacket(OP_ItemRecastDelay, sizeof(ItemRecastDelay_Struct)); + ItemRecastDelay_Struct *ird = (ItemRecastDelay_Struct *)outapp->pBuffer; + ird->recast_delay = itm->GetItem()->RecastDelay; + ird->recast_type = itm->GetItem()->RecastType; + CastToClient()->QueuePacket(outapp); + safe_delete(outapp); + } + } + return(true); }