[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
This commit is contained in:
gvcoman
2008-11-05 20:51:05 -06:00
parent 8d331f2b10
commit 44bdb135f4
41 changed files with 1105 additions and 374 deletions

View File

@@ -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)