aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index a68cbbbd194..cbd5b71246b 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4193,19 +4193,21 @@ void Spell::SendChannelStart(uint32 duration)
void Spell::SendResurrectRequest(Player* target)
{
- // Both players and NPCs can resurrect using spells - have a look at creature 28487 for example
- // However, the packet structure differs slightly
+ // get ressurector name for creature resurrections, otherwise packet will be not accepted
+ // for player resurrections the name is looked up by guid
+ char const* resurrectorName = m_caster->GetTypeId() == TYPEID_PLAYER ? "" : m_caster->GetNameForLocaleIdx(target->GetSession()->GetSessionDbLocaleIndex());
- const char* sentName = m_caster->GetTypeId() == TYPEID_PLAYER ? "" : m_caster->GetNameForLocaleIdx(target->GetSession()->GetSessionDbLocaleIndex());
+ WorldPacket data(SMSG_RESURRECT_REQUEST, (8+4+strlen(resurrectorName)+1+1+1+4));
+ data << uint64(m_caster->GetGUID()); // resurrector guid
+ data << uint32(strlen(resurrectorName) + 1);
- WorldPacket data(SMSG_RESURRECT_REQUEST, (8+4+strlen(sentName)+1+1+1));
- data << uint64(m_caster->GetGUID());
- data << uint32(strlen(sentName) + 1);
+ data << resurrectorName;
+ data << uint8(0); // null terminator
- data << sentName;
- data << uint8(0);
-
- data << uint8(m_caster->GetTypeId() == TYPEID_PLAYER ? 0 : 1);
+ data << uint8(m_caster->GetTypeId() == TYPEID_PLAYER ? 0 : 1); // "you'll be afflicted with resurrection sickness"
+ // override delay sent with SMSG_CORPSE_RECLAIM_DELAY, set instant resurrection for spells with this attribute
+ if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_IGNORE_RESURRECTION_TIMER)
+ data << uint32(0);
target->GetSession()->SendPacket(&data);
}
@@ -4731,7 +4733,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
- // Do not these spells to target creatures not tapped by us (Banish, Polymorph, many quest spells)
+ // Do not allow these spells to target creatures not tapped by us (Banish, Polymorph, many quest spells)
if (m_spellInfo->AttributesEx2 & SPELL_ATTR2_CANT_TARGET_TAPPED)
if (Creature *targetCreature = target->ToCreature())
if (targetCreature->hasLootRecipient() && !targetCreature->isTappedBy(m_caster->ToPlayer()))