[7140] Implement 76 TARGET_DYNAMIC_OBJECT_COORDINATES

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
DiSlord 2009-01-22 02:01:46 +03:00
parent d22f915c2c
commit 2a891a8c92
4 changed files with 10 additions and 16 deletions

View file

@ -838,6 +838,7 @@ enum Targets
TARGET_AREAEFFECT_PARTY_AND_CLASS = 61, TARGET_AREAEFFECT_PARTY_AND_CLASS = 61,
TARGET_DUELVSPLAYER_COORDINATES = 63, TARGET_DUELVSPLAYER_COORDINATES = 63,
TARGET_BEHIND_VICTIM = 65, // uses in teleport behind spells TARGET_BEHIND_VICTIM = 65, // uses in teleport behind spells
TARGET_DYNAMIC_OBJECT_COORDINATES = 76,
TARGET_SINGLE_ENEMY = 77, TARGET_SINGLE_ENEMY = 77,
TARGET_SELF2 = 87, TARGET_SELF2 = 87,
TARGET_NONCOMBAT_PET = 90, TARGET_NONCOMBAT_PET = 90,

View file

@ -1988,6 +1988,12 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
m_targets.setDestination(_target_x, _target_y, _target_z); m_targets.setDestination(_target_x, _target_y, _target_z);
} }
}break; }break;
case TARGET_DYNAMIC_OBJECT_COORDINATES:
{
// if parent spell create dynamic object extract area from it
if(DynamicObject* dynObj = m_caster->GetDynObject(m_triggeredByAuraSpell ? m_triggeredByAuraSpell->Id : m_spellInfo->Id))
m_targets.setDestination(dynObj->GetPositionX(), dynObj->GetPositionY(), dynObj->GetPositionZ());
}break;
default: default:
break; break;
} }

View file

@ -1325,8 +1325,6 @@ void Aura::TriggerSpell()
// generic casting code with custom spells and target/caster customs // generic casting code with custom spells and target/caster customs
uint32 trigger_spell_id = GetSpellProto()->EffectTriggerSpell[m_effIndex]; uint32 trigger_spell_id = GetSpellProto()->EffectTriggerSpell[m_effIndex];
uint64 originalCasterGUID = GetCasterGUID();
SpellEntry const *triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id); SpellEntry const *triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id);
SpellEntry const *auraSpellInfo = GetSpellProto(); SpellEntry const *auraSpellInfo = GetSpellProto();
uint32 auraId = auraSpellInfo->Id; uint32 auraId = auraSpellInfo->Id;
@ -1980,28 +1978,18 @@ void Aura::TriggerSpell()
return; return;
caster = target; caster = target;
originalCasterGUID = 0;
break; break;
} }
// Mana Tide // Mana Tide
case 16191: case 16191:
{ {
caster->CastCustomSpell(target, trigger_spell_id, &m_modifier.m_amount, NULL, NULL, true, NULL, this, originalCasterGUID); caster->CastCustomSpell(target, trigger_spell_id, &m_modifier.m_amount, NULL, NULL, true, NULL, this);
return; return;
} }
} }
} }
// All ok cast by default case // All ok cast by default case
Spell *spell = new Spell(caster, triggeredSpellInfo, true, originalCasterGUID ); caster->CastSpell(target, triggeredSpellInfo, true, 0, this);
SpellCastTargets targets;
targets.setUnitTarget( target );
// if spell create dynamic object extract area from it
if(DynamicObject* dynObj = caster->GetDynObject(GetId()))
targets.setDestination(dynObj->GetPositionX(),dynObj->GetPositionY(),dynObj->GetPositionZ());
spell->prepare(&targets, this);
} }
void Aura::TriggerSpellWithValue() void Aura::TriggerSpellWithValue()
@ -2015,7 +2003,6 @@ void Aura::TriggerSpellWithValue()
// generic casting code with custom spells and target/caster customs // generic casting code with custom spells and target/caster customs
uint32 trigger_spell_id = GetSpellProto()->EffectTriggerSpell[m_effIndex]; uint32 trigger_spell_id = GetSpellProto()->EffectTriggerSpell[m_effIndex];
int32 basepoints0 = this->GetModifier()->m_amount; int32 basepoints0 = this->GetModifier()->m_amount;
uint64 originalCasterGUID = GetCasterGUID();
caster->CastCustomSpell(target, trigger_spell_id, &basepoints0, 0, 0, true, 0, this); caster->CastCustomSpell(target, trigger_spell_id, &basepoints0, 0, 0, true, 0, this);
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7139" #define REVISION_NR "7140"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__