Changeset 174 for trunk/src/game/SpellAuras.cpp
- Timestamp:
- 11/19/08 13:43:15 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/SpellAuras.cpp
r173 r174 50 50 #include "GridNotifiersImpl.h" 51 51 #include "CellImpl.h" 52 #include "TemporarySummon.h" 52 53 53 54 #define NULL_AURA_SLOT 0xFF … … 528 529 } 529 530 530 // Channeled aura required check distance from caster 531 if(IsChanneledSpell(m_spellProto) && m_caster_guid != m_target->GetGUID() )531 // Channeled aura required check distance from caster except in possessed cases 532 if(IsChanneledSpell(m_spellProto) && m_caster_guid != m_target->GetGUID() && !m_target->isPossessed()) 532 533 { 533 534 Unit* caster = GetCaster(); … … 2004 2005 return; 2005 2006 } 2007 2006 2008 // Dark Fiend 2007 2009 if(GetId()==45934) … … 2017 2019 { 2018 2020 m_target->CastSpell(m_target,47287,true,NULL,this); 2021 return; 2022 } 2023 2024 // Eye of Kilrogg, unsummon eye when aura is gone 2025 if(GetId() == 126 && caster->GetTypeId() == TYPEID_PLAYER && caster->GetCharm()) 2026 { 2027 ((TemporarySummon*)caster->GetCharm())->UnSummon(); 2019 2028 return; 2020 2029 } … … 2887 2896 if( apply ) 2888 2897 { 2889 m_target->SetCharmerGUID(GetCasterGUID()); 2890 m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,caster->getFaction()); 2891 caster->SetCharm(m_target); 2892 2893 m_target->CombatStop(); 2894 m_target->DeleteThreatList(); 2895 if(m_target->GetTypeId() == TYPEID_UNIT) 2896 { 2897 m_target->StopMoving(); 2898 m_target->GetMotionMaster()->Clear(); 2899 m_target->GetMotionMaster()->MoveIdle(); 2900 CharmInfo *charmInfo = ((Creature*)m_target)->InitCharmInfo(m_target); 2901 charmInfo->InitPossessCreateSpells(); 2902 } 2903 2904 if(caster->GetTypeId() == TYPEID_PLAYER) 2905 { 2906 ((Player*)caster)->PossessSpellInitialize(); 2907 } 2898 if (caster->GetTypeId() == TYPEID_PLAYER) 2899 ((Player*)caster)->Possess(m_target); 2908 2900 } 2909 2901 else 2910 { 2911 m_target->SetCharmerGUID(0); 2912 2913 if(m_target->GetTypeId() == TYPEID_PLAYER) 2914 ((Player*)m_target)->setFactionForRace(m_target->getRace()); 2915 else if(m_target->GetTypeId() == TYPEID_UNIT) 2916 { 2917 CreatureInfo const *cinfo = ((Creature*)m_target)->GetCreatureInfo(); 2918 m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,cinfo->faction_A); 2919 } 2920 2921 caster->SetCharm(0); 2922 2923 if(caster->GetTypeId() == TYPEID_PLAYER) 2924 { 2925 WorldPacket data(SMSG_PET_SPELLS, 8); 2926 data << uint64(0); 2927 ((Player*)caster)->GetSession()->SendPacket(&data); 2928 } 2929 if(m_target->GetTypeId() == TYPEID_UNIT) 2930 { 2931 ((Creature*)m_target)->AIM_Initialize(); 2932 2933 if (((Creature*)m_target)->AI()) 2934 ((Creature*)m_target)->AI()->AttackStart(caster); 2935 } 2936 } 2937 if(caster->GetTypeId() == TYPEID_PLAYER) 2938 caster->SetUInt64Value(PLAYER_FARSIGHT,apply ? m_target->GetGUID() : 0); 2902 m_target->UnpossessSelf(true); 2939 2903 } 2940 2904 … … 2952 2916 if(apply) 2953 2917 { 2954 caster->SetUInt64Value(PLAYER_FARSIGHT, m_target->GetGUID()); 2955 m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5); 2918 ((Player*)caster)->Possess(m_target); 2956 2919 } 2957 2920 else 2958 2921 { 2959 caster->SetUInt64Value(PLAYER_FARSIGHT, 0); 2960 m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5); 2922 ((Player*)caster)->RemovePossess(false); 2961 2923 } 2962 2924 }