Core/Spells: More research on SPELL_ATTR6_ONLY_CAST_WHILE_POSSESSED and implement new research (original caster should be charmer or owner) and implement QAston's earlier research (only castable while possessed).
This commit is contained in:
@@ -5609,20 +5609,17 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
|
||||
{
|
||||
case 54798: // FLAMING Arrow Triggered Effect
|
||||
{
|
||||
if (!caster || !target || !target->ToCreature() || !caster->IsVehicle() || target->HasAura(54683))
|
||||
if (!caster || !target || !target->ToCreature() || !caster->GetVehicle() || target->HasAura(54683))
|
||||
break;
|
||||
|
||||
if (Unit* rider = caster->GetVehicleKit()->GetPassenger(0))
|
||||
{
|
||||
target->CastSpell(target, 54683, true);
|
||||
target->CastSpell(target, 54683, true);
|
||||
|
||||
// Credit Frostworgs
|
||||
if (target->GetEntry() == 29358)
|
||||
rider->CastSpell(rider, 54896, true);
|
||||
// Credit Frost Giants
|
||||
else if (target->GetEntry() == 29351)
|
||||
rider->CastSpell(rider, 54893, true);
|
||||
}
|
||||
// Credit Frostworgs
|
||||
if (target->GetEntry() == 29358)
|
||||
caster->CastSpell(caster, 54896, true);
|
||||
// Credit Frost Giants
|
||||
else if (target->GetEntry() == 29351)
|
||||
caster->CastSpell(caster, 54893, true);
|
||||
break;
|
||||
}
|
||||
case 62292: // Blaze (Pool of Tar)
|
||||
|
||||
@@ -498,6 +498,8 @@ m_caster(caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
|
||||
if (originalCasterGUID)
|
||||
m_originalCasterGUID = originalCasterGUID;
|
||||
else if (info->AttributesEx6 & SPELL_ATTR6_ONLY_CAST_WHILE_POSSESSED)
|
||||
m_originalCasterGUID = m_caster->GetCharmerOrOwnerGUID();
|
||||
else
|
||||
m_originalCasterGUID = m_caster->GetGUID();
|
||||
|
||||
@@ -506,7 +508,8 @@ m_caster(caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
else
|
||||
{
|
||||
m_originalCaster = ObjectAccessor::GetUnit(*m_caster, m_originalCasterGUID);
|
||||
if (m_originalCaster && !m_originalCaster->IsInWorld()) m_originalCaster = NULL;
|
||||
if (m_originalCaster && !m_originalCaster->IsInWorld())
|
||||
m_originalCaster = NULL;
|
||||
}
|
||||
|
||||
m_spellState = SPELL_STATE_NULL;
|
||||
@@ -4743,6 +4746,11 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
}
|
||||
|
||||
//! Client checks this already
|
||||
if (m_spellInfo->AttributesEx6 & SPELL_ATTR6_ONLY_CAST_WHILE_POSSESSED && !m_caster->GetCharmerOrOwnerGUID())
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
|
||||
Unit* target = m_targets.GetUnitTarget();
|
||||
// In pure self-cast spells, the client won't send any unit target
|
||||
if (!target && (m_targets.GetTargetMask() == TARGET_FLAG_SELF || m_targets.GetTargetMask() & TARGET_FLAG_UNIT_ALLY)) // TARGET_FLAG_SELF == 0, remember!
|
||||
|
||||
@@ -5062,27 +5062,18 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
m_caster->ToPlayer()->learnSpell(discoveredSpell, false);
|
||||
return;
|
||||
}
|
||||
case 62428: // Load into Catapult
|
||||
{
|
||||
if (Vehicle* seat = m_caster->GetVehicleKit())
|
||||
if (Unit* passenger = seat->GetPassenger(0))
|
||||
if (Unit* demolisher = m_caster->GetVehicleBase())
|
||||
passenger->CastSpell(demolisher, damage, true);
|
||||
return;
|
||||
}
|
||||
case 62482: // Grab Crate
|
||||
{
|
||||
if (unitTarget)
|
||||
{
|
||||
if (Vehicle* seat = m_caster->GetVehicleKit())
|
||||
if (Unit* seat = m_caster->GetVehicleBase())
|
||||
{
|
||||
if (Unit* passenger = seat->GetPassenger(1))
|
||||
if (Creature* oldContainer = passenger->ToCreature())
|
||||
oldContainer->DisappearAndDie();
|
||||
|
||||
// TODO: a hack, range = 11, should after some time cast, otherwise too far
|
||||
m_caster->CastSpell(seat->GetBase(), 62496, true);
|
||||
unitTarget->EnterVehicle(m_caster, 1);
|
||||
if (Unit* parent = seat->GetVehicleBase())
|
||||
{
|
||||
// TODO: a hack, range = 11, should after some time cast, otherwise too far
|
||||
m_caster->CastSpell(parent, 62496, true);
|
||||
unitTarget->CastSpell(parent, m_spellInfo->Effects[EFFECT_0].CalcValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user