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

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

View File

@@ -375,7 +375,7 @@ enum SpellAttr3
SPELL_ATTR3_UNK1 = 0x00000002, // 1
SPELL_ATTR3_UNK2 = 0x00000004, // 2
SPELL_ATTR3_BLOCKABLE_SPELL = 0x00000008, // 3 Only dmg class melee in 3.1.3
SPELL_ATTR3_UNK4 = 0x00000010, // 4 Druid Rebirth only this spell have this flag
SPELL_ATTR3_IGNORE_RESURRECTION_TIMER = 0x00000010, // 4 you don't have to wait to be resurrected with these spells
SPELL_ATTR3_UNK5 = 0x00000020, // 5
SPELL_ATTR3_UNK6 = 0x00000040, // 6
SPELL_ATTR3_STACK_FOR_DIFF_CASTERS = 0x00000080, // 7 separate stack for every caster

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()))