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

[svn] * Merge Temp dev SVN with Assembla.
* Changes include:

  • Implementation of w12x's Outdoor PvP and Game Event Systems.
  • Temporary removal of IRC Chat Bot (until infinite loop when disabled is fixed).
  • All mangos -> trinity (to convert your mangos_string table, please run mangos_string_to_trinity_string.sql).
  • Improved Config cleanup.
  • And many more changes.

Original author: Seline
Date: 2008-10-14 11:57:03-05:00

Files:
1 modified

Legend:

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

    r37 r44  
    11/* 
    2  * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> 
     2 * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> 
     3 * 
     4 * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/> 
    35 * 
    46 * This program is free software; you can redistribute it and/or modify 
     
    911 * This program is distributed in the hope that it will be useful, 
    1012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    1214 * GNU General Public License for more details. 
    1315 * 
    1416 * You should have received a copy of the GNU General Public License 
    1517 * along with this program; if not, write to the Free Software 
    16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
    1719 */ 
    1820 
     
    4143#include "Formulas.h" 
    4244#include "BattleGround.h" 
     45#include "OutdoorPvP.h" 
     46#include "OutdoorPvPMgr.h" 
    4347#include "CreatureAI.h" 
    4448#include "Util.h" 
     
    663667                case AREA_AURA_FRIEND: 
    664668                { 
    665                     CellPair p(MaNGOS::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY())); 
     669                    CellPair p(Trinity::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY())); 
    666670                    Cell cell(p); 
    667671                    cell.data.Part.reserved = ALL_DISTRICT; 
    668672                    cell.SetNoCreate(); 
    669673 
    670                     MaNGOS::AnyFriendlyUnitInObjectRangeCheck u_check(caster, owner, m_radius); 
    671                     MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(targets, u_check); 
    672                     TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); 
    673                     TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher); 
     674                    Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(caster, owner, m_radius); 
     675                    Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(targets, u_check); 
     676                    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); 
     677                    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher); 
    674678                    CellLock<GridReadGuard> cell_lock(cell, p); 
    675679                    cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster)); 
     
    679683                case AREA_AURA_ENEMY: 
    680684                { 
    681                     CellPair p(MaNGOS::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY())); 
     685                    CellPair p(Trinity::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY())); 
    682686                    Cell cell(p); 
    683687                    cell.data.Part.reserved = ALL_DISTRICT; 
    684688                    cell.SetNoCreate(); 
    685689 
    686                     MaNGOS::AnyAoETargetUnitInObjectRangeCheck u_check(caster, owner, m_radius); // No GetCharmer in searcher 
    687                     MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(targets, u_check); 
    688                     TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); 
    689                     TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher); 
     690                    Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(caster, owner, m_radius); // No GetCharmer in searcher 
     691                    Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(targets, u_check); 
     692                    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); 
     693                    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher); 
    690694                    CellLock<GridReadGuard> cell_lock(cell, p); 
    691695                    cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster)); 
     
    28122816        // Soul Shard only from non-grey units 
    28132817        if( spellInfo->EffectItemType[m_effIndex] == 6265 && 
    2814             (victim->getLevel() <= MaNGOS::XP::GetGrayLevel(caster->getLevel()) || 
     2818            (victim->getLevel() <= Trinity::XP::GetGrayLevel(caster->getLevel()) || 
    28152819             victim->GetTypeId()==TYPEID_UNIT && !((Player*)caster)->isAllowedToLoot((Creature*)victim)) ) 
    28162820            return; 
     
    32633267    if(apply) 
    32643268    { 
    3265         // drop flag at stealth in bg 
    3266         if(Real && m_target->GetTypeId()==TYPEID_PLAYER && ((Player*)m_target)->InBattleGround()) 
    3267             if(BattleGround *bg = ((Player*)m_target)->GetBattleGround()) 
    3268                 bg->EventPlayerDroppedFlag((Player*)m_target); 
     3269        if(Real && m_target->GetTypeId()==TYPEID_PLAYER) 
     3270        { 
     3271            // drop flag at stealth in bg 
     3272            if(((Player*)m_target)->InBattleGround()) 
     3273            { 
     3274                if(BattleGround *bg = ((Player*)m_target)->GetBattleGround()) 
     3275                    bg->EventPlayerDroppedFlag((Player*)m_target); 
     3276            } 
     3277            // remove player from the objective's active player count at stealth 
     3278            if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP()) 
     3279                pvp->HandlePlayerActivityChanged((Player*)m_target); 
     3280        } 
    32693281 
    32703282        // only at real aura add 
     
    33103322                } 
    33113323                else 
     3324                { 
    33123325                    m_target->SetVisibility(VISIBILITY_ON); 
     3326                    if(m_target->GetTypeId() == TYPEID_PLAYER) 
     3327                        if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP()) 
     3328                            pvp->HandlePlayerActivityChanged((Player*)m_target); 
     3329                } 
    33133330            } 
    33143331        } 
     
    33433360            // apply glow vision 
    33443361            m_target->SetFlag(PLAYER_FIELD_BYTES2,PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW); 
     3362            // remove player from the objective's active player count at invisibility 
     3363            if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP()) 
     3364                pvp->HandlePlayerActivityChanged((Player*)m_target); 
    33453365 
    33463366            // drop flag at invisible in bg 
     
    33783398                // if have stealth aura then already have stealth visibility 
    33793399                if(!m_target->HasAuraType(SPELL_AURA_MOD_STEALTH)) 
     3400                { 
    33803401                    m_target->SetVisibility(VISIBILITY_ON); 
     3402                    if(m_target->GetTypeId() == TYPEID_PLAYER) 
     3403                        if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP()) 
     3404                            pvp->HandlePlayerActivityChanged((Player*)m_target); 
     3405                } 
    33813406            } 
    33823407        } 
     
    38203845                } 
    38213846            } 
     3847            else 
     3848                sOutdoorPvPMgr.HandleDropFlag((Player*)m_target,GetSpellProto()->Id); 
    38223849        } 
    38233850    }