Core/Spells: Define and implement SPELL_ATTR3_IGNORE_RESURRECTION_TIMER - now you can instantly resurrect with Rebirth spell.

This commit is contained in:
QAston committed 2011-07-12 10:43:58 +02:00
1 parent cd1df639b2
commit 1c7616dcc8
2 files changed
+14 -12

No files matched your search

+13 -11
View File
@@ -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()))