*Implement SPELL_EFFECT_FORCE_CAST_WITH_VALUE(141).

--HG--
branch : trunk
This commit is contained in:
QAston
2010-07-19 22:52:21 +02:00
parent 6a9e6f258d
commit b5f7ac86ea
2 changed files with 25 additions and 2 deletions

View File

@@ -111,7 +111,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectTeleUnitsFaceCaster, // 43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER
&Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP
&Spell::EffectAddHonor, // 45 SPELL_EFFECT_ADD_HONOR honor/pvp related
&Spell::EffectNULL, // 46 SPELL_EFFECT_SPAWN we must spawn pet there
&Spell::EffectUnused, // 46 SPELL_EFFECT_SPAWN clientside, unit appears as if it was just spawned
&Spell::EffectTradeSkill, // 47 SPELL_EFFECT_TRADE_SKILL
&Spell::EffectUnused, // 48 SPELL_EFFECT_STEALTH one spell: Base Stealth
&Spell::EffectUnused, // 49 SPELL_EFFECT_DETECT one spell: Detect
@@ -206,7 +206,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectLeapBack, //138 SPELL_EFFECT_LEAP_BACK Leap back
&Spell::EffectQuestClear, //139 SPELL_EFFECT_CLEAR_QUEST Reset quest status (miscValue - quest ID)
&Spell::EffectForceCast, //140 SPELL_EFFECT_FORCE_CAST
&Spell::EffectNULL, //141 SPELL_EFFECT_141 damage and reduce speed?
&Spell::EffectForceCastWithValue, //141 SPELL_EFFECT_FORCE_CAST_WITH_VALUE
&Spell::EffectTriggerSpellWithValue, //142 SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE
&Spell::EffectApplyAreaAura, //143 SPELL_EFFECT_APPLY_AREA_AURA_OWNER
&Spell::EffectKnockBack, //144 SPELL_EFFECT_KNOCK_BACK_2 Spectral Blast
@@ -2307,6 +2307,28 @@ void Spell::EffectForceCast(uint32 i)
caster->CastSpell(unitTarget, spellInfo, true, NULL, NULL, m_originalCasterGUID);
}
void Spell::EffectForceCastWithValue(uint32 i)
{
if (!unitTarget)
return;
uint32 triggered_spell_id = m_spellInfo->EffectTriggerSpell[i];
// normal case
SpellEntry const *spellInfo = sSpellStore.LookupEntry(triggered_spell_id);
if (!spellInfo)
{
sLog.outError("EffectForceCastWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id);
return;
}
int32 bp = damage;
Unit * caster = GetTriggeredSpellCaster(spellInfo, m_caster, unitTarget);
caster->CastCustomSpell(unitTarget, spellInfo->Id, &bp, &bp, &bp, true, NULL, NULL, m_originalCasterGUID);
}
void Spell::EffectTriggerSpell(uint32 effIndex)
{
// only unit case known

View File

@@ -318,6 +318,7 @@ class Spell
void EffectLearnPetSpell(uint32 i);
void EffectWeaponDmg(uint32 i);
void EffectForceCast(uint32 i);
void EffectForceCastWithValue(uint32 i);
void EffectTriggerSpell(uint32 i);
void EffectTriggerMissileSpell(uint32 i);
void EffectThreat(uint32 i);