Show
Ignore:
Timestamp:
11/19/08 13:43:15 (17 years ago)
Author:
yumileroy
Message:

[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

Original author: gvcoman
Date: 2008-11-05 20:51:05-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/SpellEffects.cpp

    r168 r174  
    133133    &Spell::EffectPickPocket,                               // 71 SPELL_EFFECT_PICKPOCKET 
    134134    &Spell::EffectAddFarsight,                              // 72 SPELL_EFFECT_ADD_FARSIGHT 
    135     &Spell::EffectSummonGuardian,                           // 73 SPELL_EFFECT_SUMMON_POSSESSED 
     135    &Spell::EffectSummonPossessed,                          // 73 SPELL_EFFECT_SUMMON_POSSESSED 
    136136    &Spell::EffectSummonTotem,                              // 74 SPELL_EFFECT_SUMMON_TOTEM 
    137137    &Spell::EffectHealMechanical,                           // 75 SPELL_EFFECT_HEAL_MECHANICAL          one spell: Mechanical Patch Kit 
     
    31283128    { 
    31293129        case SUMMON_TYPE_GUARDIAN: 
     3130            EffectSummonGuardian(i); 
     3131            break; 
    31303132        case SUMMON_TYPE_POSESSED: 
    31313133        case SUMMON_TYPE_POSESSED2: 
    3132             EffectSummonGuardian(i); 
     3134            EffectSummonPossessed(i); 
    31333135            break; 
    31343136        case SUMMON_TYPE_WILD: 
     
    36763678        map->Add((Creature*)spawnCreature); 
    36773679    } 
     3680} 
     3681 
     3682void Spell::EffectSummonPossessed(uint32 i) 
     3683{ 
     3684    uint32 creatureEntry = m_spellInfo->EffectMiscValue[i]; 
     3685    if(!creatureEntry) 
     3686        return; 
     3687 
     3688    if(m_caster->GetTypeId() != TYPEID_PLAYER) 
     3689        return; 
     3690 
     3691    uint32 level = m_caster->getLevel(); 
     3692 
     3693    float px, py, pz; 
     3694    m_caster->GetClosePoint(px, py, pz, DEFAULT_WORLD_OBJECT_SIZE); 
     3695 
     3696    int32 duration = GetSpellDuration(m_spellInfo); 
     3697 
     3698    TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_OR_DEAD_DESPAWN; 
     3699 
     3700    Creature* c = m_caster->SummonCreature(creatureEntry, px, py, pz, m_caster->GetOrientation(), summonType, duration); 
     3701    ((Player*)m_caster)->Possess(c); 
    36783702} 
    36793703