Permalink
Browse files

Priest: Mind Sear is working as it should be, triggered spell should …

…get Aura's Caster as m_caster and m_DestX/Y/Z as Aura target's XYZ.

Signed-off-by: Neo_mat <neomat.github@gmail.com>
  • Loading branch information...
1 parent 3c38247 commit 86bb53fc1e221c52473bd645d58b7a6b5a17b262 @neo-mat committed Jan 25, 2012
Showing with 46 additions and 2 deletions.
  1. +8 −0 src/arcemu-world/Player.h
  2. +1 −0 src/arcemu-world/Spell.h
  3. +19 −2 src/arcemu-world/SpellAuras.cpp
  4. +18 −0 src/arcemu-world/SpellTarget.cpp
@@ -326,6 +326,14 @@ enum PlayerFlags
PLAYER_FLAG_PVP = 0x40000,
};
+// used in PLAYER_FIELD_BYTES2 values
+enum PlayerFieldByte2Flags
+{
+ PLAYER_FIELD_BYTE2_NONE = 0x00,
+ PLAYER_FIELD_BYTE2_STEALTH = 0x20,
+ PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW = 0x40,
+};
+
enum CharterTypes
{
CHARTER_TYPE_GUILD = 0,
View
@@ -2219,6 +2219,7 @@ class SERVER_DECL Spell : public EventableObject
TargetsList m_targetUnits[3];
void SafeAddTarget(TargetsList* tgt, uint64 guid);
+ void RemoveTarget(uint32 i, Object* obj);
void SafeAddMissedTarget(uint64 guid);
void SafeAddModeratedTarget(uint64 guid, uint16 type);
@@ -2713,7 +2713,7 @@ void Aura::SpellAuraModStealth(bool apply)
m_target->SetFlag(UNIT_FIELD_BYTES_1, 0x020000);
if(m_target->IsPlayer())
- m_target->SetFlag(PLAYER_FIELD_BYTES2, 0x2000);
+ m_target->SetByteFlag(PLAYER_FIELD_BYTES2, 3, PLAYER_FIELD_BYTE2_STEALTH);
m_target->RemoveAurasByInterruptFlag(AURA_INTERRUPT_ON_STEALTH | AURA_INTERRUPT_ON_INVINCIBLE);
m_target->m_stealthLevel += mod->m_amount;
@@ -2796,7 +2796,7 @@ void Aura::SpellAuraModStealth(bool apply)
if(p_target != NULL)
{
- p_target->RemoveFlag(PLAYER_FIELD_BYTES2, 0x2000);
+ p_target->RemoveByteFlag(PLAYER_FIELD_BYTES2, 3, PLAYER_FIELD_BYTE2_STEALTH);
p_target->SendSpellCooldownEvent(m_spellProto->Id);
if(p_target->m_outStealthDamageBonusPeriod && p_target->m_outStealthDamageBonusPct)
@@ -3103,6 +3103,22 @@ void Aura::SpellAuraPeriodicTriggerSpell(bool apply)
void Aura::EventPeriodicTriggerSpell(SpellEntry* spellInfo, bool overridevalues, int32 overridevalue)
{
+ Unit* u_caster = GetUnitCaster();
+
+ if(spellInfo->NameHash == SPELL_HASH_MIND_SEAR)
+ {
+ Spell *spell = sSpellFactoryMgr.NewSpell(u_caster, spellInfo, true, this);
+ SpellCastTargets targets;
+ //Mind Sear hackz
+ targets.m_unitTarget = m_target->GetGUID();
+ targets.m_destX = m_target->GetPositionX();
+ targets.m_destY = m_target->GetPositionY();
+ targets.m_destZ = m_target->GetPositionZ();
+ spell->prepare(&targets);
+ return;
+ }
+ else
+ {
Spell* spell = sSpellFactoryMgr.NewSpell(m_target, spellInfo, true, this);
if(overridevalues)
{
@@ -3113,6 +3129,7 @@ void Aura::EventPeriodicTriggerSpell(SpellEntry* spellInfo, bool overridevalues,
SpellCastTargets targets;
spell->GenerateTargets(&targets);
spell->prepare(&targets);
+ }
}
void Aura::SpellAuraPeriodicEnergize(bool apply)
@@ -165,6 +165,13 @@ void Spell::FillTargetMap(uint32 i)
if(TargetType & SPELL_TARGET_OBJECT_SCRIPTED)
AddScriptedOrSpellFocusTargets(i, TargetType, GetRadius(i), m_spellInfo->MaxTargets);
+
+ //Mind Sear hackz
+ if(GetProto()->Id == 53022 || GetProto()->Id == 49821)
+ {
+ Object* target = m_caster->GetMapMgr()->_GetObject(m_targets.m_unitTarget);
+ RemoveTarget(i, target);
+ }
}
void Spell::AddScriptedOrSpellFocusTargets(uint32 i, uint32 TargetType, float r, uint32 maxtargets)
@@ -386,6 +393,17 @@ void Spell::AddAOETargets(uint32 i, uint32 TargetType, float r, uint32 maxtarget
}
}
+void Spell::RemoveTarget(uint32 i, Object* obj)
+{
+ TargetsList* t = &m_targetUnits[i];
+
+ if(obj == NULL || !obj->IsInWorld())
+ return;
+
+ t->erase(std::remove(t->begin(), t->end(), obj->GetGUID()), t->end());
+
+}
+
bool Spell::AddTarget(uint32 i, uint32 TargetType, Object* obj)
{
TargetsList* t = &m_targetUnits[i];

0 comments on commit 86bb53f

Please sign in to comment.