diff options
| author | gvcoman <none@none> | 2008-11-05 20:51:05 -0600 |
|---|---|---|
| committer | gvcoman <none@none> | 2008-11-05 20:51:05 -0600 |
| commit | 44bdb135f4ed5bb834795cfb928ccbb0504cf834 (patch) | |
| tree | 7995df4957fb2e0e6cde895fbe3e85b7efde5fa7 /src/game/SpellEffects.cpp | |
| parent | 8d331f2b10cff29ee0571f7056ad353df6a3eabd (diff) | |
[svn] Implemented player on player and player on creature possession:
* Implemented packet and vision forwarding through possessed units
* Added new OnPossess script call alerting scripts on when possession is applied/removed
* Moved fall damage and fall under map calculations into the Player class
* Added new PossessedAI that is applied only while possession on creature is active
* Implemented summon possessed spell effect
* Fixed Eyes of the Beast
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
| -rw-r--r-- | src/game/SpellEffects.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 39329e58bfd..e8060d282e6 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -132,7 +132,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectPull, // 70 SPELL_EFFECT_PULL one spell: Distract Move &Spell::EffectPickPocket, // 71 SPELL_EFFECT_PICKPOCKET &Spell::EffectAddFarsight, // 72 SPELL_EFFECT_ADD_FARSIGHT - &Spell::EffectSummonGuardian, // 73 SPELL_EFFECT_SUMMON_POSSESSED + &Spell::EffectSummonPossessed, // 73 SPELL_EFFECT_SUMMON_POSSESSED &Spell::EffectSummonTotem, // 74 SPELL_EFFECT_SUMMON_TOTEM &Spell::EffectHealMechanical, // 75 SPELL_EFFECT_HEAL_MECHANICAL one spell: Mechanical Patch Kit &Spell::EffectSummonObjectWild, // 76 SPELL_EFFECT_SUMMON_OBJECT_WILD @@ -3127,9 +3127,11 @@ void Spell::EffectSummonType(uint32 i) switch(m_spellInfo->EffectMiscValueB[i]) { case SUMMON_TYPE_GUARDIAN: + EffectSummonGuardian(i); + break; case SUMMON_TYPE_POSESSED: case SUMMON_TYPE_POSESSED2: - EffectSummonGuardian(i); + EffectSummonPossessed(i); break; case SUMMON_TYPE_WILD: EffectSummonWild(i); @@ -3677,6 +3679,28 @@ void Spell::EffectSummonGuardian(uint32 i) } } +void Spell::EffectSummonPossessed(uint32 i) +{ + uint32 creatureEntry = m_spellInfo->EffectMiscValue[i]; + if(!creatureEntry) + return; + + if(m_caster->GetTypeId() != TYPEID_PLAYER) + return; + + uint32 level = m_caster->getLevel(); + + float px, py, pz; + m_caster->GetClosePoint(px, py, pz, DEFAULT_WORLD_OBJECT_SIZE); + + int32 duration = GetSpellDuration(m_spellInfo); + + TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_OR_DEAD_DESPAWN; + + Creature* c = m_caster->SummonCreature(creatureEntry, px, py, pz, m_caster->GetOrientation(), summonType, duration); + ((Player*)m_caster)->Possess(c); +} + void Spell::EffectTeleUnitsFaceCaster(uint32 i) { if(!unitTarget) |
