Skip to content

Commit

Permalink
[c12950] Allow forced cast spells by vehicle to unboard the passenger…
Browse files Browse the repository at this point in the history
… if required

(based on commit [12753] - 6a5e461)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
  • Loading branch information
xfurry committed Nov 23, 2014
1 parent 9d520e1 commit bdc1dfe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/game/SpellEffects.cpp
Expand Up @@ -57,6 +57,7 @@
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
#include "Vehicle.h"

pEffect SpellEffects[TOTAL_SPELL_EFFECTS] =
{
Expand Down Expand Up @@ -3963,8 +3964,16 @@ void Spell::EffectForceCast(SpellEffectEntry const* effect)

int32 basePoints = damage;

// spell effect 141 has BasePoints greater than 1
if (basePoints > 1)
// forced cast spells by vehicle on master always unboard the master
if (m_caster->IsVehicle() && m_caster->GetVehicleInfo()->HasOnBoard(unitTarget) &&
effect->EffectImplicitTargetA == TARGET_MASTER)
{
if (sSpellStore.LookupEntry(basePoints))
m_caster->RemoveAurasDueToSpell(basePoints);
}

// spell effect 141 needs to be cast as custom with basePoints
if (effect->Effect == SPELL_EFFECT_FORCE_CAST_WITH_VALUE)
unitTarget->CastCustomSpell(unitTarget, spellInfo, &basePoints, &basePoints, &basePoints, true, NULL , NULL, m_originalCasterGUID, m_spellInfo);
else
unitTarget->CastSpell(unitTarget, spellInfo, true, NULL, NULL, m_originalCasterGUID, m_spellInfo);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12949"
#define REVISION_NR "12950"
#endif // __REVISION_NR_H__

0 comments on commit bdc1dfe

Please sign in to comment.