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/Object.cpp

    r42 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 
     
    330332                *data << (uint32)((Player*)this)->GetTransTime(); 
    331333            } 
    332             //MaNGOS currently not have support for other than player on transport 
     334            //TrinIty currently not have support for other than player on transport 
    333335        } 
    334336 
     
    541543                updateMask->SetBit(GAMEOBJECT_DYN_FLAGS); 
    542544            } 
     545            if (GetUInt32Value(GAMEOBJECT_ARTKIT)) 
     546                updateMask->SetBit(GAMEOBJECT_ARTKIT); 
    543547        } 
    544548    } 
     
    569573            { 
    570574                // remove custom flag before send 
     575 
    571576                if( index == UNIT_NPC_FLAGS ) 
    572                     *data << uint32(m_uint32Values[ index ] & ~UNIT_NPC_FLAG_GUARD); 
     577                    *data << uint32(m_uint32Values[ index ] & ~(UNIT_NPC_FLAG_GUARD + UNIT_NPC_FLAG_OUTDOORPVP)); 
    573578                // FIXME: Some values at server stored in float format but must be sent to client in uint32 format 
    574579                else if(index >= UNIT_FIELD_BASEATTACKTIME && index <= UNIT_FIELD_RANGEDATTACKTIME) 
     
    11171122    rand_z = z; 
    11181123 
    1119     MaNGOS::NormalizeMapCoord(rand_x); 
    1120     MaNGOS::NormalizeMapCoord(rand_y); 
     1124    Trinity::NormalizeMapCoord(rand_x); 
     1125    Trinity::NormalizeMapCoord(rand_y); 
    11211126    UpdateGroundPositionZ(rand_x,rand_y,rand_z);            // update to LOS height if available 
    11221127} 
     
    11311136bool WorldObject::IsPositionValid() const 
    11321137{ 
    1133     return MaNGOS::IsValidMapCoord(m_positionX,m_positionY,m_positionZ,m_orientation); 
     1138    return Trinity::IsValidMapCoord(m_positionX,m_positionY,m_positionZ,m_orientation); 
    11341139} 
    11351140 
     
    11771182} 
    11781183 
    1179 namespace MaNGOS 
     1184namespace Trinity 
    11801185{ 
    11811186    class MessageChatLocaleCacheDo 
     
    12101215                        i_data_cache.resize(cache_idx+1); 
    12111216 
    1212                     char const* text = objmgr.GetMangosString(i_textId,loc_idx); 
     1217                    char const* text = objmgr.GetTrinityString(i_textId,loc_idx); 
    12131218 
    12141219                    data = new WorldPacket(SMSG_MESSAGECHAT, 200); 
     
    12341239            std::vector<WorldPacket*> i_data_cache;             // 0 = default, i => i-1 locale index 
    12351240    }; 
    1236 }                                                           // namespace MaNGOS 
     1241}                                                           // namespace Trinity 
    12371242 
    12381243void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid) 
    12391244{ 
    1240     CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()); 
     1245    CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY()); 
    12411246 
    12421247    Cell cell(p); 
     
    12441249    cell.SetNoCreate(); 
    12451250 
    1246     MaNGOS::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY)); 
    1247     MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo> say_worker(say_do); 
    1248     TypeContainerVisitor<MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker); 
     1251    Trinity::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY)); 
     1252    Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do); 
     1253    TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker); 
    12491254    CellLock<GridReadGuard> cell_lock(cell, p); 
    12501255    cell_lock->Visit(cell_lock, message, *GetMap()); 
     
    12531258void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) 
    12541259{ 
    1255     CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()); 
     1260    CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY()); 
    12561261 
    12571262    Cell cell(p); 
     
    12591264    cell.SetNoCreate(); 
    12601265 
    1261     MaNGOS::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL)); 
    1262     MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo> say_worker(say_do); 
    1263     TypeContainerVisitor<MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker); 
     1266    Trinity::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL)); 
     1267    Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do); 
     1268    TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker); 
    12641269    CellLock<GridReadGuard> cell_lock(cell, p); 
    12651270    cell_lock->Visit(cell_lock, message, *GetMap()); 
     
    12681273void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote) 
    12691274{ 
    1270     CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()); 
     1275    CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY()); 
    12711276 
    12721277    Cell cell(p); 
     
    12741279    cell.SetNoCreate(); 
    12751280 
    1276     MaNGOS::MessageChatLocaleCacheDo say_do(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); 
    1277     MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo> say_worker(say_do); 
    1278     TypeContainerVisitor<MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker); 
     1281    Trinity::MessageChatLocaleCacheDo say_do(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); 
     1282    Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do); 
     1283    TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker); 
    12791284    CellLock<GridReadGuard> cell_lock(cell, p); 
    12801285    cell_lock->Visit(cell_lock, message, *GetMap()); 
     
    12881293 
    12891294    uint32 loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); 
    1290     char const* text = objmgr.GetMangosString(textId,loc_idx); 
     1295    char const* text = objmgr.GetTrinityString(textId,loc_idx); 
    12911296 
    12921297    WorldPacket data(SMSG_MESSAGECHAT, 200); 
     
    14361441    y = GetPositionY() + (GetObjectSize() + distance2d) * sin(absAngle); 
    14371442 
    1438     MaNGOS::NormalizeMapCoord(x); 
    1439     MaNGOS::NormalizeMapCoord(y); 
     1443    Trinity::NormalizeMapCoord(x); 
     1444    Trinity::NormalizeMapCoord(y); 
    14401445} 
    14411446