Changeset 139 for trunk/src/game

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

[svn] Spell target selection improvement. Remove most mangos hacks in spell target selection. (work almost done)
Merge mangos svn rev 6744.

Original author: megamage
Date: 2008-10-31 11:04:32-05:00

Location:
trunk/src/game
Files:
9 modified

Legend:

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

    r102 r139  
    773773        ignoreResult = FRIEND_IGNORE_ADDED; 
    774774 
    775         _player->GetSocial()->AddToSocialList(GUID_LOPART(IgnoreGuid), true); 
     775        if(!_player->GetSocial()->AddToSocialList(GUID_LOPART(IgnoreGuid), true)) 
     776            ignoreResult = FRIEND_IGNORE_FULL; 
    776777    } 
    777778    else if(ignoreResult==FRIEND_IGNORE_ALREADY) 
  • trunk/src/game/SharedDefines.h

    r112 r139  
    600600    SPELL_EFFECT_THREAT_ALL                = 91, 
    601601    SPELL_EFFECT_ENCHANT_HELD_ITEM         = 92, 
    602     SPELL_EFFECT_SUMMON_PHANTASM           = 93, 
     602    SPELL_EFFECT_SUMMON_PHANTASM           = 93, //unused 
    603603    SPELL_EFFECT_SELF_RESURRECT            = 94, 
    604604    SPELL_EFFECT_SKINNING                  = 95, 
  • trunk/src/game/SocialMgr.cpp

    r102 r139  
    4242} 
    4343 
     44uint32 PlayerSocial::GetNumberOfSocialsWithFlag(SocialFlag flag) 
     45{ 
     46    uint32 counter = 0; 
     47    for(PlayerSocialMap::iterator itr = m_playerSocialMap.begin(); itr != m_playerSocialMap.end(); ++itr) 
     48    { 
     49        if(itr->second.Flags & flag) 
     50            counter++; 
     51    } 
     52    return counter; 
     53} 
     54 
    4455bool PlayerSocial::AddToSocialList(uint32 friend_guid, bool ignore) 
    4556{ 
    46     // client limit 
    47     if(m_playerSocialMap.size() >= 50) 
    48         return false; 
     57    // check client limits 
     58    if(ignore) 
     59    { 
     60        if(GetNumberOfSocialsWithFlag(SOCIAL_FLAG_IGNORED) >= SOCIALMGR_IGNORE_LIMIT) 
     61            return false; 
     62    } 
     63    else 
     64    { 
     65        if(GetNumberOfSocialsWithFlag(SOCIAL_FLAG_FRIEND) >= SOCIALMGR_FRIEND_LIMIT) 
     66            return false; 
     67    } 
    4968 
    5069    uint32 flag = SOCIAL_FLAG_FRIEND; 
  • trunk/src/game/SocialMgr.h

    r102 r139  
    112112}; 
    113113 
     114#define SOCIALMGR_FRIEND_LIMIT  50 
     115#define SOCIALMGR_IGNORE_LIMIT  25 
     116 
    114117class PlayerSocial 
    115118{ 
     
    129132        uint32 GetPlayerGUID() { return m_playerGUID; } 
    130133        void SetPlayerGUID(uint32 guid) { m_playerGUID = guid; } 
     134        uint32 GetNumberOfSocialsWithFlag(SocialFlag flag); 
    131135    private: 
    132136        PlayerSocialMap m_playerSocialMap; 
  • trunk/src/game/Spell.cpp

    r138 r139  
    7676 
    7777    m_srcX = m_srcY = m_srcZ = m_destX = m_destY = m_destZ = 0; 
     78    m_hasDest = false; 
    7879    m_strTarget = ""; 
    7980    m_targetMask = 0; 
     
    8788{ 
    8889    if (!target) 
     90        return; 
     91 
     92    m_unitTarget = target; 
     93    m_unitTargetGUID = target->GetGUID(); 
     94    m_targetMask |= TARGET_FLAG_UNIT; 
     95} 
     96 
     97void SpellCastTargets::setDestination(float x, float y, float z, bool send) 
     98{ 
     99    m_destX = x; 
     100    m_destY = y; 
     101    m_destZ = z; 
     102    m_hasDest = true; 
     103    if(send) 
     104        m_targetMask |= TARGET_FLAG_DEST_LOCATION; 
     105} 
     106 
     107void SpellCastTargets::setDestination(Unit *target, bool send) 
     108{ 
     109    if(!target) 
    89110        return; 
    90111 
     
    92113    m_destY = target->GetPositionY(); 
    93114    m_destZ = target->GetPositionZ(); 
    94     m_unitTarget = target; 
    95     m_unitTargetGUID = target->GetGUID(); 
    96     m_targetMask |= TARGET_FLAG_UNIT; 
    97 } 
    98  
    99 void SpellCastTargets::setDestination(float x, float y, float z) 
    100 { 
    101     m_destX = x; 
    102     m_destY = y; 
    103     m_destZ = z; 
    104     m_targetMask |= TARGET_FLAG_DEST_LOCATION; 
     115    m_hasDest = true; 
     116    if(send) 
     117        m_targetMask |= TARGET_FLAG_DEST_LOCATION; 
    105118} 
    106119 
     
    160173    if(m_targetMask == TARGET_FLAG_SELF) 
    161174    { 
    162         m_destX = caster->GetPositionX(); 
    163         m_destY = caster->GetPositionY(); 
    164         m_destZ = caster->GetPositionZ(); 
     175        //m_destX = caster->GetPositionX(); 
     176        //m_destY = caster->GetPositionY(); 
     177        //m_destZ = caster->GetPositionZ(); 
    165178        m_unitTarget = caster; 
    166179        m_unitTargetGUID = caster->GetGUID(); 
     
    180193            return false; 
    181194 
    182     if( m_targetMask & TARGET_FLAG_SOURCE_LOCATION ) 
     195    /*if( m_targetMask & TARGET_FLAG_SOURCE_LOCATION ) 
    183196    { 
    184197        if(data->rpos()+4+4+4 > data->size()) 
     
    188201        if(!Trinity::IsValidMapCoord(m_srcX, m_srcY, m_srcZ)) 
    189202            return false; 
    190     } 
    191  
    192     if( m_targetMask & TARGET_FLAG_DEST_LOCATION ) 
     203    }*/ 
     204 
     205    if( m_targetMask & (TARGET_FLAG_SOURCE_LOCATION | TARGET_FLAG_DEST_LOCATION) ) 
    193206    { 
    194207        if(data->rpos()+4+4+4 > data->size()) 
     
    196209 
    197210        *data >> m_destX >> m_destY >> m_destZ; 
     211        m_hasDest = true; 
    198212        if(!Trinity::IsValidMapCoord(m_destX, m_destY, m_destZ)) 
    199213            return false; 
     
    415429        } 
    416430 
     431        if(m_targets.HasDest()) 
     432        { 
     433            switch(m_spellInfo->Effect[i]) 
     434            { 
     435                case SPELL_EFFECT_SUMMON: 
     436                case SPELL_EFFECT_SUMMON_WILD: 
     437                case SPELL_EFFECT_SUMMON_GUARDIAN: 
     438                case SPELL_EFFECT_SUMMON_PET: 
     439                case SPELL_EFFECT_SUMMON_POSSESSED: 
     440                case SPELL_EFFECT_SUMMON_TOTEM: 
     441                case SPELL_EFFECT_SUMMON_OBJECT_WILD: 
     442                case SPELL_EFFECT_SUMMON_TOTEM_SLOT1: 
     443                case SPELL_EFFECT_SUMMON_TOTEM_SLOT2: 
     444                case SPELL_EFFECT_SUMMON_TOTEM_SLOT3: 
     445                case SPELL_EFFECT_SUMMON_TOTEM_SLOT4: 
     446                case SPELL_EFFECT_SUMMON_CRITTER: 
     447                case SPELL_EFFECT_SUMMON_OBJECT_SLOT1: 
     448                case SPELL_EFFECT_SUMMON_OBJECT_SLOT2: 
     449                case SPELL_EFFECT_SUMMON_OBJECT_SLOT3: 
     450                case SPELL_EFFECT_SUMMON_OBJECT_SLOT4: 
     451                case SPELL_EFFECT_SUMMON_DEAD_PET: 
     452                case SPELL_EFFECT_SUMMON_DEMON: 
     453                { 
     454                    tmpUnitMap.push_back(m_caster); 
     455                    break; 
     456                } 
     457            } 
     458        } 
     459 
     460        if(!m_spellInfo->EffectImplicitTargetA[i]) 
     461        { 
     462            switch(m_spellInfo->Effect[i]) 
     463            { 
     464                case SPELL_EFFECT_PARRY: 
     465                case SPELL_EFFECT_BLOCK: 
     466                case SPELL_EFFECT_SKILL: // always with dummy 3 as A 
     467                case SPELL_EFFECT_LEARN_SPELL: 
     468                    tmpUnitMap.push_back(m_caster); 
     469                    break; 
     470            } 
     471        } 
     472 
    417473        if(tmpUnitMap.empty()) 
    418474        { 
    419             if( m_spellInfo->EffectImplicitTargetA[i]==TARGET_SCRIPT || 
     475            /*if( m_spellInfo->EffectImplicitTargetA[i]==TARGET_SCRIPT || 
    420476                m_spellInfo->EffectImplicitTargetB[i]==TARGET_SCRIPT || 
    421477                m_spellInfo->EffectImplicitTargetA[i]==TARGET_SCRIPT_COORDINATES || 
     
    424480                if(!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)) 
    425481                    continue; 
    426             } 
     482            }*/ 
     483 
    427484            // add here custom effects that need default target. 
    428485            // FOR EVERY TARGET TYPE THERE IS A DIFFERENT FILL!! 
     
    500557                } 
    501558                case SPELL_EFFECT_RESURRECT: 
    502                 case SPELL_EFFECT_PARRY: 
    503                 case SPELL_EFFECT_BLOCK: 
    504559                case SPELL_EFFECT_CREATE_ITEM: 
    505560                case SPELL_EFFECT_TRIGGER_SPELL: 
    506561                case SPELL_EFFECT_TRIGGER_MISSILE: 
    507                 case SPELL_EFFECT_LEARN_SPELL: 
    508562                case SPELL_EFFECT_SKILL_STEP: 
    509563                case SPELL_EFFECT_PROFICIENCY: 
    510                 case SPELL_EFFECT_SUMMON_POSSESSED: 
    511                 case SPELL_EFFECT_SUMMON_OBJECT_WILD: 
    512564                case SPELL_EFFECT_SELF_RESURRECT: 
    513565                case SPELL_EFFECT_REPUTATION: 
     
    537589                    } 
    538590                    break; 
    539                 case SPELL_EFFECT_SUMMON: 
    540                     if(m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED || m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2) 
    541                     { 
    542                         if(m_targets.getUnitTarget()) 
    543                             tmpUnitMap.push_back(m_targets.getUnitTarget()); 
    544                     } 
    545                     else 
    546                         tmpUnitMap.push_back(m_caster); 
    547                     break; 
    548591                case SPELL_EFFECT_SUMMON_CHANGE_ITEM: 
    549                 case SPELL_EFFECT_SUMMON_WILD: 
    550                 case SPELL_EFFECT_SUMMON_GUARDIAN: 
    551592                case SPELL_EFFECT_TRANS_DOOR: 
    552593                case SPELL_EFFECT_ADD_FARSIGHT: 
    553594                case SPELL_EFFECT_STUCK: 
    554595                case SPELL_EFFECT_DESTROY_ALL_TOTEMS: 
    555                 case SPELL_EFFECT_SUMMON_DEMON: 
    556                 case SPELL_EFFECT_SKILL: 
    557                 case SPELL_EFFECT_SUMMON_OBJECT_SLOT1: 
    558                 case SPELL_EFFECT_SUMMON_OBJECT_SLOT2: 
    559                 case SPELL_EFFECT_SUMMON_OBJECT_SLOT3: 
    560                 case SPELL_EFFECT_SUMMON_OBJECT_SLOT4: 
    561596                    tmpUnitMap.push_back(m_caster); 
    562597                    break; 
     
    12181253void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, const uint32 &type, SpellTargets TargetType, uint32 entry) 
    12191254{ 
    1220     if(type == PUSH_DEST_CENTER && !m_targets.m_destX && !m_targets.m_destY && !m_targets.m_destZ) 
     1255    if(type == PUSH_DEST_CENTER && !m_targets.HasDest()) 
    12211256    { 
    12221257        sLog.outError( "SPELL: cannot find destination for spell ID %u\n", m_spellInfo->Id ); 
     
    12971332    uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i]; 
    12981333    uint32 unMaxTargets = m_spellInfo->MaxAffectedTargets; 
     1334    if(!unMaxTargets) 
     1335        unMaxTargets = spellmgr.GetSpellExtraAttr(m_spellInfo->Id, SPELL_EXTRA_ATTR_MAX_TARGETS); 
    12991336    if(m_originalCaster) 
    13001337    { 
     
    13611398        }break; 
    13621399 
     1400        // channel 
     1401        case TARGET_SINGLE_ENEMY: 
     1402            if(m_caster->m_currentSpells[CURRENT_CHANNELED_SPELL]) 
     1403            { 
     1404                if(Unit* target = m_caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_targets.getUnitTarget()) 
     1405                    TagUnitMap.push_back(target); 
     1406                else 
     1407                    sLog.outError( "SPELL: cannot find channel spell target for spell ID %u\n", m_spellInfo->Id ); 
     1408            } 
     1409            else 
     1410                sLog.outError( "SPELL: no current channeled spell for spell ID %u\n", m_spellInfo->Id ); 
     1411            break; 
     1412        case TARGET_DEST_CHANNEL: 
     1413            if(m_caster->m_currentSpells[CURRENT_CHANNELED_SPELL]) 
     1414            { 
     1415                if(m_caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_targets.HasDest()) 
     1416                    m_targets = m_caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_targets; 
     1417                else 
     1418                    sLog.outError( "SPELL: cannot find channel spell destination for spell ID %u\n", m_spellInfo->Id ); 
     1419            } 
     1420            else 
     1421                sLog.outError( "SPELL: no current channeled spell for spell ID %u\n", m_spellInfo->Id ); 
     1422            break; 
     1423 
    13631424        // reference dest 
    13641425        case TARGET_EFFECT_SELECT: 
    1365             m_targets.m_targetMask |= TARGET_FLAG_DEST_LOCATION; 
     1426            m_targets.setDestination(m_caster, true); 
     1427            break; 
    13661428        case TARGET_ALL_AROUND_CASTER: 
    1367         { 
    1368             if(!unMaxTargets) 
    1369                 unMaxTargets = spellmgr.GetSpellExtraAttr(m_spellInfo->Id, SPELL_EXTRA_ATTR_MAX_TARGETS); 
    1370             m_caster->GetPosition(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ); 
    1371         }break; 
     1429            m_targets.setDestination(m_caster, false); 
     1430            break; 
    13721431        case TARGET_CURRENT_ENEMY_COORDINATES: 
    1373             m_targets.m_targetMask |= TARGET_FLAG_DEST_LOCATION; 
     1432            m_targets.setDestination(m_targets.getUnitTarget(), true); 
     1433            break; 
    13741434        case TARGET_DUELVSPLAYER_COORDINATES: // no ground? 
    1375         { 
    1376             if(Unit* currentTarget = m_targets.getUnitTarget()) 
    1377                 currentTarget->GetPosition(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ); 
    1378         }break; 
     1435            m_targets.setDestination(m_targets.getUnitTarget(), false); 
     1436            break; 
    13791437        case TARGET_DEST_TABLE_UNKNOWN2: 
    13801438        case TARGET_TABLE_X_Y_Z_COORDINATES: 
    1381         { 
    1382             SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id); 
    1383             if(st) 
     1439            if(SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id)) 
    13841440            { 
    13851441                if (st->target_mapId == m_caster->GetMapId()) 
     
    13881444            else 
    13891445                sLog.outError( "SPELL: unknown target coordinates for spell ID %u\n", m_spellInfo->Id ); 
    1390         }break; 
     1446            break; 
    13911447 
    13921448        // area targets 
    13931449                case TARGET_AREAEFFECT_CUSTOM: 
    13941450        case TARGET_ALL_ENEMY_IN_AREA_INSTANT: 
    1395         { 
    13961451            if(m_spellInfo->Effect[i] == SPELL_EFFECT_PERSISTENT_AREA_AURA) 
    13971452                break; 
    13981453            m_targets.m_targetMask |= TARGET_FLAG_DEST_LOCATION; 
    1399         } 
    14001454        case TARGET_ALL_ENEMY_IN_AREA: 
    1401         { 
    14021455            SearchAreaTarget(TagUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_AOE_DAMAGE); 
    1403         }break; 
     1456            break; 
    14041457        case TARGET_ALL_FRIENDLY_UNITS_IN_AREA: 
    14051458            m_targets.m_targetMask |= TARGET_FLAG_DEST_LOCATION; 
    14061459        case TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER: 
    1407         { 
    14081460            SearchAreaTarget(TagUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_FRIENDLY); 
    1409         }break; 
     1461            break; 
    14101462        //case TARGET_AREAEFFECT_CUSTOM: 
    14111463        //    m_targets.m_targetMask |= TARGET_FLAG_DEST_LOCATION; 
     
    14511503            SearchAreaTarget(TagUnitMap, radius, PUSH_IN_FRONT, SPELL_TARGETS_FRIENDLY); 
    14521504        }break; 
    1453  
    14541505 
    14551506        // nearby target 
     
    16951746            } 
    16961747        }break; 
    1697         case TARGET_MINION: 
    1698         { 
    1699             if(m_spellInfo->Effect[i] != SPELL_EFFECT_DUEL) 
    1700                 TagUnitMap.push_back(m_caster); 
    1701         }break; 
    1702         case TARGET_SINGLE_ENEMY: 
    1703         { 
    1704             Unit* pUnitTarget = SelectMagnetTarget(); 
    1705             if(pUnitTarget) 
    1706                 TagUnitMap.push_back(pUnitTarget); 
    1707         }break; 
    17081748        case TARGET_AREAEFFECT_PARTY: 
    17091749        { 
     
    18791919        case TARGET_DEST_CASTER_FRONT_RIGHT: 
    18801920        case TARGET_DEST_CASTER_FRONT: 
     1921        case TARGET_MINION: 
     1922        case TARGET_DEST_CASTER_FRONT_LEAP: 
     1923        case TARGET_DEST_CASTER_FRONT_UNKNOWN: 
    18811924        case TARGET_DEST_CASTER_BACK: 
    18821925        case TARGET_DEST_CASTER_RIGHT: 
     
    19031946                case TARGET_DEST_CASTER_BACK_RIGHT: angle = 3*M_PI/4;   break; 
    19041947                case TARGET_DEST_CASTER_FRONT_RIGHT:angle = M_PI/4;     break; 
     1948                case TARGET_MINION: 
     1949                case TARGET_DEST_CASTER_FRONT_LEAP: 
     1950                case TARGET_DEST_CASTER_FRONT_UNKNOWN: 
    19051951                case TARGET_DEST_CASTER_FRONT:      angle = 0.0f;       break; 
    19061952                case TARGET_DEST_CASTER_BACK:       angle = M_PI;       break; 
     
    19712017        }break; 
    19722018        case TARGET_SELF2: 
     2019            m_targets.m_hasDest = true; 
    19732020            break; 
    19742021        default: 
  • trunk/src/game/Spell.h

    r110 r139  
    108108            m_itemTargetEntry  = target.m_itemTargetEntry; 
    109109 
    110             m_srcX = target.m_srcX; 
    111             m_srcY = target.m_srcY; 
    112             m_srcZ = target.m_srcZ; 
     110            //m_srcX = target.m_srcX; 
     111            //m_srcY = target.m_srcY; 
     112            //m_srcZ = target.m_srcZ; 
    113113 
    114114            m_destX = target.m_destX; 
    115115            m_destY = target.m_destY; 
    116116            m_destZ = target.m_destZ; 
     117            m_hasDest = target.m_hasDest; 
    117118 
    118119            m_strTarget = target.m_strTarget; 
     
    126127        Unit *getUnitTarget() const { return m_unitTarget; } 
    127128        void setUnitTarget(Unit *target); 
    128         void setDestination(float x, float y, float z); 
     129        void setDestination(float x, float y, float z, bool send = true); 
     130        void setDestination(Unit *target, bool send = true); 
    129131 
    130132        uint64 getGOTargetGUID() const { return m_GOTargetGUID; } 
     
    148150 
    149151        bool IsEmpty() const { return m_GOTargetGUID==0 && m_unitTargetGUID==0 && m_itemTarget==0 && m_CorpseTargetGUID==0; } 
     152        bool HasDest() const { return m_hasDest; } 
    150153 
    151154        void Update(Unit* caster); 
     
    153156        float m_srcX, m_srcY, m_srcZ; 
    154157        float m_destX, m_destY, m_destZ; 
     158        bool m_hasDest; 
    155159        std::string m_strTarget; 
    156160 
     
    552556            : i_data(&data), i_spell(spell), i_push_type(type), i_radius(radius), i_TargetType(TargetType), i_entry(entry) 
    553557        { 
    554             i_originalCaster = spell.GetOriginalCaster(); 
     558            i_originalCaster = spell.GetCaster(); 
    555559        } 
    556560 
  • trunk/src/game/SpellAuras.cpp

    r123 r139  
    472472} 
    473473 
    474 SingleEnemyTargetAura::SingleEnemyTargetAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, 
    475 Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, target, caster, castItem) 
    476 { 
    477     if (caster) 
    478         m_casters_target_guid = caster->GetTypeId()==TYPEID_PLAYER ? ((Player*)caster)->GetSelection() : caster->GetUInt64Value(UNIT_FIELD_TARGET); 
    479     else 
    480         m_casters_target_guid = 0; 
    481 } 
    482  
    483 SingleEnemyTargetAura::~SingleEnemyTargetAura() 
    484 { 
    485 } 
    486  
    487 Unit* SingleEnemyTargetAura::GetTriggerTarget() const 
    488 { 
    489     return ObjectAccessor::GetUnit(*m_target, m_casters_target_guid); 
    490 } 
    491  
    492474Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem) 
    493475{ 
    494476    if (IsAreaAuraEffect(spellproto->Effect[eff])) 
    495477        return new AreaAura(spellproto, eff, currentBasePoints, target, caster, castItem); 
    496  
    497     uint32 triggeredSpellId = spellproto->EffectTriggerSpell[eff]; 
    498  
    499     SpellEntry const* triggredSpellInfo = sSpellStore.LookupEntry(triggeredSpellId); 
    500     if (triggredSpellInfo) 
    501         for (int i = 0; i < 3; ++i) 
    502             if (triggredSpellInfo->EffectImplicitTargetA[i] == TARGET_SINGLE_ENEMY) 
    503                 return new SingleEnemyTargetAura(spellproto, eff, currentBasePoints, target, caster, castItem); 
    504478 
    505479    return new Aura(spellproto, eff, currentBasePoints, target, caster, castItem); 
     
    19081882    } 
    19091883    // All ok cast by default case 
    1910     Spell *spell = new Spell(caster, triggredSpellInfo, true, originalCasterGUID ); 
     1884    Spell *spell = new Spell(m_target, triggredSpellInfo, true, originalCasterGUID ); 
    19111885 
    19121886    SpellCastTargets targets; 
  • trunk/src/game/SpellAuras.h

    r102 r139  
    362362}; 
    363363 
    364 class TRINITY_DLL_SPEC SingleEnemyTargetAura : public Aura 
    365 { 
    366     friend Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem); 
    367  
    368     public: 
    369         ~SingleEnemyTargetAura(); 
    370         Unit* GetTriggerTarget() const; 
    371  
    372     protected: 
    373         SingleEnemyTargetAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster  = NULL, Item* castItem = NULL); 
    374         uint64 m_casters_target_guid; 
    375 }; 
    376  
    377364Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL); 
    378365#endif 
  • trunk/src/game/Unit.cpp

    r138 r139  
    50865086 
    50875087                    // Cast finish spell (triggeredByAura already not exist!) 
    5088                     CastSpell(this, 27285, true, castItem, NULL, casterGuid); 
     5088                    if(Unit* caster = GetUnit(*this, casterGuid)) 
     5089                        caster->CastSpell(this, 27285, true, castItem); 
    50895090                    return true;                            // no hidden cooldown 
    50905091                } 
     
    51085109 
    51095110                    // Cast finish spell (triggeredByAura already not exist!) 
    5110                     CastSpell(this, 32865, true, castItem, NULL, casterGuid); 
     5111                    if(Unit* caster = GetUnit(*this, casterGuid)) 
     5112                        caster->CastSpell(this, 32865, true, castItem); 
    51115113                    return true;                            // no hidden cooldown 
    51125114                }