From 681cc6ecf478b4ef08c9b7ba712c39e5e5a9eda4 Mon Sep 17 00:00:00 2001 From: arrai Date: Sun, 16 Nov 2008 13:00:03 +0100 Subject: [PATCH] Fixed SMSG_RESURRECT_REQUEST for NPC resurrection --- src/game/Spell.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 0854606bd..2963925d5 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3006,16 +3006,19 @@ void Spell::SendChannelStart(uint32 duration) void Spell::SendResurrectRequest(Player* target) { - WorldPacket data(SMSG_RESURRECT_REQUEST, (8+4+2+4)); + // Both players and NPCs can resurrect using spells - have a look at creature 28487 for example + // However, the packet structure differs slightly + + const char* sentName = m_caster->GetTypeId()==TYPEID_PLAYER ?"":m_caster->GetName(); + + WorldPacket data(SMSG_RESURRECT_REQUEST, (8+4+strlen(sentName)+1+1+4)); data << uint64(m_caster->GetGUID()); - uint32 count = 1; - data << uint32(count); // amount of bytes to read + data << uint32(strlen(sentName)+1); - for(uint32 i = 0; i < count; ++i) - data << uint8(0); + data << sentName; + data << uint8(0); - data << uint8(0); - data << uint8(0); + data << uint32(m_caster->GetTypeId()==TYPEID_PLAYER ?0:1); target->GetSession()->SendPacket(&data); }