aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <qaston@gmail.com>2011-07-12 10:43:58 +0200
committerQAston <qaston@gmail.com>2011-07-12 10:43:58 +0200
commit1c7616dcc8a3beef8518b24da1365f463c537634 (patch)
tree09be6a55c95091b4e0b9dd94905aece7f3cf0c29 /src
parentcd1df639b26e6c9bf6adb3f928c26d9ecfdfb087 (diff)
Core/Spells: Define and implement SPELL_ATTR3_IGNORE_RESURRECTION_TIMER - now you can instantly resurrect with Rebirth spell.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Miscellaneous/SharedDefines.h2
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp24
2 files changed, 14 insertions, 12 deletions
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 9f44b0ca1cb..2c4b68104ac 100755
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -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
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()))