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/Level3.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 
     
    7476    HandleReloadCommandCommand(""); 
    7577    HandleReloadReservedNameCommand(""); 
    76     HandleReloadMangosStringCommand(""); 
     78    HandleReloadTrinityStringCommand(""); 
    7779    HandleReloadGameTeleCommand(""); 
    7880    return true; 
     
    325327} 
    326328 
    327 bool ChatHandler::HandleReloadMangosStringCommand(const char*) 
    328 { 
    329     sLog.outString( "Re-Loading mangos_string Table!" ); 
    330     objmgr.LoadMangosStrings(); 
    331     SendGlobalSysMessage("DB table `mangos_string` reloaded."); 
     329bool ChatHandler::HandleReloadTrinityStringCommand(const char*) 
     330{ 
     331    sLog.outString( "Re-Loading trinity_string Table!" ); 
     332    objmgr.LoadTrinityStrings(); 
     333    SendGlobalSysMessage("DB table `trinity_string` reloaded."); 
    332334    return true; 
    333335} 
     
    850852        if(!sSpellStore.LookupEntry(spell_id)) 
    851853        { 
    852             PSendSysMessage(LANG_UNKNOWN_SPELL, target==m_session->GetPlayer() ? GetMangosString(LANG_YOU) : target->GetName()); 
     854            PSendSysMessage(LANG_UNKNOWN_SPELL, target==m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : target->GetName()); 
    853855            SetSentErrorMessage(true); 
    854856            return false; 
     
    860862        target->GetSession()->SendPacket(&data); 
    861863        target->RemoveSpellCooldown(spell_id); 
    862         PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target==m_session->GetPlayer() ? GetMangosString(LANG_YOU) : target->GetName()); 
     864        PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target==m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : target->GetName()); 
    863865    } 
    864866    return true; 
     
    17711773        plTarget = pl; 
    17721774 
    1773     sLog.outDetail(GetMangosString(LANG_ADDITEM), itemId, count); 
     1775    sLog.outDetail(GetTrinityString(LANG_ADDITEM), itemId, count); 
    17741776 
    17751777    ItemPrototype const *pProto = objmgr.GetItemPrototype(itemId); 
     
    18501852        plTarget = pl; 
    18511853 
    1852     sLog.outDetail(GetMangosString(LANG_ADDITEMSET), itemsetId); 
     1854    sLog.outDetail(GetTrinityString(LANG_ADDITEMSET), itemsetId); 
    18531855 
    18541856    QueryResult *result = WorldDatabase.PQuery("SELECT entry FROM item_template WHERE itemset = %u",itemsetId); 
     
    24482450            { 
    24492451                // send skill in "id - [namedlink locale]" format 
    2450                 PSendSysMessage(LANG_SKILL_LIST,id,id,name.c_str(),localeNames[loc],(target->HasSkill(id) ? m_session->GetMangosString(LANG_KNOWN) : "")); 
     2452                PSendSysMessage(LANG_SKILL_LIST,id,id,name.c_str(),localeNames[loc],(target->HasSkill(id) ? m_session->GetTrinityString(LANG_KNOWN) : "")); 
    24512453 
    24522454                ++counter; 
     
    25322534                // include rank in link name 
    25332535                if(rank) 
    2534                     ss << GetMangosString(LANG_SPELL_RANK) << rank; 
     2536                    ss << GetTrinityString(LANG_SPELL_RANK) << rank; 
    25352537 
    25362538                ss << " " << localeNames[loc] << "]|h|r"; 
    25372539 
    25382540                if(talent) 
    2539                     ss << GetMangosString(LANG_TALENT); 
     2541                    ss << GetTrinityString(LANG_TALENT); 
    25402542                if(passive) 
    2541                     ss << GetMangosString(LANG_PASSIVE); 
     2543                    ss << GetTrinityString(LANG_PASSIVE); 
    25422544                if(learn) 
    2543                     ss << GetMangosString(LANG_LEARN); 
     2545                    ss << GetTrinityString(LANG_LEARN); 
    25442546                if(known) 
    2545                     ss << GetMangosString(LANG_KNOWN); 
     2547                    ss << GetTrinityString(LANG_KNOWN); 
    25462548                if(active) 
    2547                     ss << GetMangosString(LANG_ACTIVE); 
     2549                    ss << GetTrinityString(LANG_ACTIVE); 
    25482550 
    25492551                SendSysMessage(ss.str().c_str()); 
     
    26052607                        { 
    26062608                            if(target->GetQuestRewardStatus(qinfo->GetQuestId())) 
    2607                                 statusStr = GetMangosString(LANG_COMMAND_QUEST_REWARDED); 
     2609                                statusStr = GetTrinityString(LANG_COMMAND_QUEST_REWARDED); 
    26082610                            else 
    2609                                 statusStr = GetMangosString(LANG_COMMAND_QUEST_COMPLETE); 
     2611                                statusStr = GetTrinityString(LANG_COMMAND_QUEST_COMPLETE); 
    26102612                        } 
    26112613                        else if(status == QUEST_STATUS_INCOMPLETE) 
    2612                             statusStr = GetMangosString(LANG_COMMAND_QUEST_ACTIVE); 
    2613  
    2614                         PSendSysMessage(LANG_QUEST_LIST,qinfo->GetQuestId(),qinfo->GetQuestId(),title.c_str(),(status == QUEST_STATUS_COMPLETE ? GetMangosString(LANG_COMPLETE) : (status == QUEST_STATUS_INCOMPLETE ? GetMangosString(LANG_ACTIVE) : "") )); 
     2614                            statusStr = GetTrinityString(LANG_COMMAND_QUEST_ACTIVE); 
     2615 
     2616                        PSendSysMessage(LANG_QUEST_LIST,qinfo->GetQuestId(),qinfo->GetQuestId(),title.c_str(),(status == QUEST_STATUS_COMPLETE ? GetTrinityString(LANG_COMPLETE) : (status == QUEST_STATUS_INCOMPLETE ? GetTrinityString(LANG_ACTIVE) : "") )); 
    26152617                        ++counter; 
    26162618                        continue; 
     
    26322634            { 
    26332635                if(target->GetQuestRewardStatus(qinfo->GetQuestId())) 
    2634                     statusStr = GetMangosString(LANG_COMMAND_QUEST_REWARDED); 
     2636                    statusStr = GetTrinityString(LANG_COMMAND_QUEST_REWARDED); 
    26352637                else 
    2636                     statusStr = GetMangosString(LANG_COMMAND_QUEST_COMPLETE); 
     2638                    statusStr = GetTrinityString(LANG_COMMAND_QUEST_COMPLETE); 
    26372639            } 
    26382640            else if(status == QUEST_STATUS_INCOMPLETE) 
    2639                 statusStr = GetMangosString(LANG_COMMAND_QUEST_ACTIVE); 
    2640  
    2641             PSendSysMessage(LANG_QUEST_LIST,qinfo->GetQuestId(),qinfo->GetQuestId(), title.c_str(),(status == QUEST_STATUS_COMPLETE ? GetMangosString(LANG_COMPLETE) : (status == QUEST_STATUS_INCOMPLETE ? GetMangosString(LANG_ACTIVE) : "") )); 
     2641                statusStr = GetTrinityString(LANG_COMMAND_QUEST_ACTIVE); 
     2642 
     2643            PSendSysMessage(LANG_QUEST_LIST,qinfo->GetQuestId(),qinfo->GetQuestId(), title.c_str(),(status == QUEST_STATUS_COMPLETE ? GetTrinityString(LANG_COMPLETE) : (status == QUEST_STATUS_INCOMPLETE ? GetTrinityString(LANG_ACTIVE) : "") )); 
    26422644            ++counter; 
    26432645        } 
     
    33663368        g_team = data->team; 
    33673369 
    3368         std::string team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_NOTEAM); 
     3370        std::string team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_NOTEAM); 
    33693371 
    33703372        if(g_team == 0) 
    3371             team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_ANY); 
     3373            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY); 
    33723374        else if(g_team == HORDE) 
    3373             team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_HORDE); 
     3375            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE); 
    33743376        else if(g_team == ALLIANCE) 
    3375             team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_ALLIANCE); 
     3377            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE); 
    33763378 
    33773379        PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, g_id,team_name.c_str(),player->GetZoneId()); 
     
    33823384 
    33833385        if(g_team == 0) 
    3384             team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_ANY); 
     3386            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY); 
    33853387        else if(g_team == HORDE) 
    3386             team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_HORDE); 
     3388            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE); 
    33873389        else if(g_team == ALLIANCE) 
    3388             team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_ALLIANCE); 
     3390            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE); 
    33893391 
    33903392        if(g_team == ~uint32(0)) 
     
    38313833    { 
    38323834        iValue = (uint32)atoi(py); 
    3833         sLog.outDebug(GetMangosString(LANG_SET_UINT), GUID_LOPART(guid), Opcode, iValue); 
     3835        sLog.outDebug(GetTrinityString(LANG_SET_UINT), GUID_LOPART(guid), Opcode, iValue); 
    38343836        target->SetUInt32Value( Opcode , iValue ); 
    38353837        PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), Opcode,iValue); 
     
    38383840    { 
    38393841        fValue = (float)atof(py); 
    3840         sLog.outDebug(GetMangosString(LANG_SET_FLOAT), GUID_LOPART(guid), Opcode, fValue); 
     3842        sLog.outDebug(GetTrinityString(LANG_SET_FLOAT), GUID_LOPART(guid), Opcode, fValue); 
    38413843        target->SetFloatValue( Opcode , fValue ); 
    38423844        PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), Opcode,fValue); 
     
    38823884    { 
    38833885        iValue = target->GetUInt32Value( Opcode ); 
    3884         sLog.outDebug(GetMangosString(LANG_GET_UINT), GUID_LOPART(guid), Opcode, iValue); 
     3886        sLog.outDebug(GetTrinityString(LANG_GET_UINT), GUID_LOPART(guid), Opcode, iValue); 
    38853887        PSendSysMessage(LANG_GET_UINT_FIELD, GUID_LOPART(guid), Opcode,    iValue); 
    38863888    } 
     
    38883890    { 
    38893891        fValue = target->GetFloatValue( Opcode ); 
    3890         sLog.outDebug(GetMangosString(LANG_GET_FLOAT), GUID_LOPART(guid), Opcode, fValue); 
     3892        sLog.outDebug(GetTrinityString(LANG_GET_FLOAT), GUID_LOPART(guid), Opcode, fValue); 
    38913893        PSendSysMessage(LANG_GET_FLOAT_FIELD, GUID_LOPART(guid), Opcode, fValue); 
    38923894    } 
     
    39113913        return false; 
    39123914 
    3913     sLog.outDebug(GetMangosString(LANG_SET_32BIT), Opcode, Value); 
     3915    sLog.outDebug(GetTrinityString(LANG_SET_32BIT), Opcode, Value); 
    39143916 
    39153917    m_session->GetPlayer( )->SetUInt32Value( Opcode , 2^Value ); 
     
    39393941    } 
    39403942 
    3941     sLog.outDebug(GetMangosString(LANG_CHANGE_32BIT), Opcode, Value); 
     3943    sLog.outDebug(GetTrinityString(LANG_CHANGE_32BIT), Opcode, Value); 
    39423944 
    39433945    int CurrentValue = (int)m_session->GetPlayer( )->GetUInt32Value( Opcode ); 
     
    40194021    } 
    40204022 
    4021     char const* talentStr = GetMangosString(LANG_TALENT); 
    4022     char const* passiveStr = GetMangosString(LANG_PASSIVE); 
     4023    char const* talentStr = GetTrinityString(LANG_TALENT); 
     4024    char const* passiveStr = GetTrinityString(LANG_PASSIVE); 
    40234025 
    40244026    Unit::AuraMap const& uAuras = unit->GetAuras(); 
     
    47904792                active = true; 
    47914793            bool permanent = (fields[1].GetUInt64() == (uint64)0); 
    4792             std::string bantime = permanent?GetMangosString(LANG_BANINFO_INFINITE):secsToTimeString(fields[1].GetUInt64(), true); 
     4794            std::string bantime = permanent?GetTrinityString(LANG_BANINFO_INFINITE):secsToTimeString(fields[1].GetUInt64(), true); 
    47934795            PSendSysMessage(LANG_BANINFO_HISTORYENTRY, 
    4794                 fields[0].GetString(), bantime.c_str(), active ? GetMangosString(LANG_BANINFO_YES):GetMangosString(LANG_BANINFO_NO), fields[4].GetString(), fields[5].GetString()); 
     4796                fields[0].GetString(), bantime.c_str(), active ? GetTrinityString(LANG_BANINFO_YES):GetTrinityString(LANG_BANINFO_NO), fields[4].GetString(), fields[5].GetString()); 
    47954797        }while (result->NextRow()); 
    47964798 
     
    48094811        bool permanent = (fields[6].GetUInt64()==(uint64)0); 
    48104812        PSendSysMessage(LANG_BANINFO_IPENTRY, 
    4811             fields[0].GetString(), fields[1].GetString(), permanent ? GetMangosString(LANG_BANINFO_NEVER):fields[2].GetString(), 
    4812             permanent ? GetMangosString(LANG_BANINFO_INFINITE):secsToTimeString(fields[3].GetUInt64(), true).c_str(), fields[4].GetString(), fields[5].GetString()); 
     4813            fields[0].GetString(), fields[1].GetString(), permanent ? GetTrinityString(LANG_BANINFO_NEVER):fields[2].GetString(), 
     4814            permanent ? GetTrinityString(LANG_BANINFO_INFINITE):secsToTimeString(fields[3].GetUInt64(), true).c_str(), fields[4].GetString(), fields[5].GetString()); 
    48134815        delete result; 
    48144816    } 
     
    49024904    Player* pl = m_session->GetPlayer(); 
    49034905 
    4904     CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY())); 
     4906    CellPair p(Trinity::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY())); 
    49054907    Cell cell(p); 
    49064908    cell.data.Part.reserved = ALL_DISTRICT; 
    49074909    cell.SetNoCreate(); 
    49084910 
    4909     MaNGOS::RespawnDo u_do; 
    4910     MaNGOS::WorldObjectWorker<MaNGOS::RespawnDo> worker(u_do); 
    4911  
    4912     TypeContainerVisitor<MaNGOS::WorldObjectWorker<MaNGOS::RespawnDo>, GridTypeMapContainer > obj_worker(worker); 
     4911    Trinity::RespawnDo u_do; 
     4912    Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(u_do); 
     4913 
     4914    TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker); 
    49134915    CellLock<GridReadGuard> cell_lock(cell, p); 
    49144916    cell_lock->Visit(cell_lock, obj_worker, *MapManager::Instance().GetMap(pl->GetMapId(), pl));