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

    r39 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 
     
    5456#include "BattleGround.h" 
    5557#include "BattleGroundMgr.h" 
     58#include "OutdoorPvP.h" 
     59#include "OutdoorPvPMgr.h" 
    5660#include "ArenaTeam.h" 
    5761#include "Chat.h" 
     
    5963#include "Spell.h" 
    6064#include "SocialMgr.h" 
    61 #include "IRCClient.h" 
     65#include "GameEvent.h" 
    6266 
    6367#include <cmath> 
     
    580584 
    581585    // set starting level 
    582         if(GetSession()->GetSecurity() >= SEC_MODERATOR) 
    583                 SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_GM_START_LEVEL) ); //ImpConfig 
    584         else 
    585                 SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) ); 
    586         // set starting gold 
    587         SetUInt32Value( PLAYER_FIELD_COINAGE, sWorld.PlayerStartGold()*10000 ); 
    588  
    589         // set starting honor 
    590         SetUInt32Value( PLAYER_FIELD_HONOR_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_HONOR) ); 
    591  
    592         // set starting arena pts 
    593         SetUInt32Value( PLAYER_FIELD_ARENA_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_ARENAPTS) ); 
    594  
    595         // start with every map explored 
    596         if(sWorld.getConfig(CONFIG_START_ALL_EXPLORED)) 
    597         { 
    598                 for (uint8 i=0; i<64; i++) 
    599                         SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF); 
    600         } 
     586    if(GetSession()->GetSecurity() >= SEC_MODERATOR) 
     587        SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_GM_START_LEVEL) ); 
     588    else 
     589        SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) ); 
     590    // set starting gold 
     591    SetUInt32Value( PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_PLAYER_START_GOLD)*10000 ); 
     592 
     593    // set starting honor 
     594    SetUInt32Value( PLAYER_FIELD_HONOR_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_HONOR) ); 
     595 
     596    // set starting arena pts 
     597    SetUInt32Value( PLAYER_FIELD_ARENA_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_ARENAPTS) ); 
     598 
     599    // start with every map explored 
     600    if(sWorld.getConfig(CONFIG_START_ALL_EXPLORED)) 
     601    { 
     602        for (uint8 i=0; i<64; i++) 
     603            SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF); 
     604    } 
     605 
     606    //Reputations if "StartAllReputation" is enabled, -- TODO: Fix this in a better way 
     607    if(sWorld.getConfig(CONFIG_START_ALL_REP)) 
     608    { 
     609        SetFactionReputation(sFactionStore.LookupEntry(942),42999); 
     610        SetFactionReputation(sFactionStore.LookupEntry(935),42999); 
     611        SetFactionReputation(sFactionStore.LookupEntry(936),42999); 
     612        SetFactionReputation(sFactionStore.LookupEntry(1011),42999); 
     613        SetFactionReputation(sFactionStore.LookupEntry(970),42999); 
     614        SetFactionReputation(sFactionStore.LookupEntry(967),42999); 
     615        SetFactionReputation(sFactionStore.LookupEntry(989),42999); 
     616        SetFactionReputation(sFactionStore.LookupEntry(932),42999); 
     617        SetFactionReputation(sFactionStore.LookupEntry(934),42999); 
     618        SetFactionReputation(sFactionStore.LookupEntry(1038),42999); 
     619        SetFactionReputation(sFactionStore.LookupEntry(1077),42999); 
     620 
     621        // Factions depending on team, like cities and some more stuff 
     622        switch(GetTeam()) 
     623        { 
     624        case ALLIANCE: 
     625            SetFactionReputation(sFactionStore.LookupEntry(72),42999); 
     626            SetFactionReputation(sFactionStore.LookupEntry(47),42999); 
     627            SetFactionReputation(sFactionStore.LookupEntry(69),42999); 
     628            SetFactionReputation(sFactionStore.LookupEntry(930),42999); 
     629            SetFactionReputation(sFactionStore.LookupEntry(730),42999); 
     630            SetFactionReputation(sFactionStore.LookupEntry(978),42999); 
     631            SetFactionReputation(sFactionStore.LookupEntry(54),42999); 
     632            SetFactionReputation(sFactionStore.LookupEntry(946),42999); 
     633            break; 
     634        case HORDE: 
     635            SetFactionReputation(sFactionStore.LookupEntry(76),42999); 
     636            SetFactionReputation(sFactionStore.LookupEntry(68),42999); 
     637            SetFactionReputation(sFactionStore.LookupEntry(81),42999); 
     638            SetFactionReputation(sFactionStore.LookupEntry(911),42999); 
     639            SetFactionReputation(sFactionStore.LookupEntry(729),42999); 
     640            SetFactionReputation(sFactionStore.LookupEntry(941),42999); 
     641            SetFactionReputation(sFactionStore.LookupEntry(530),42999); 
     642            SetFactionReputation(sFactionStore.LookupEntry(947),42999); 
     643            break; 
     644        default: 
     645            break; 
     646        } 
     647    } 
    601648 
    602649    // Played time 
     
    14531500    } 
    14541501 
     1502    if((GetSession()->GetSecurity() < SEC_GAMEMASTER) && !sWorld.IsAllowedMap(mapid)) 
     1503    { 
     1504        sLog.outError("Player %s tried to enter a forbidden map", GetName()); 
     1505        return false; 
     1506    } 
     1507 
    14551508    // preparing unsummon pet if lost (we must get pet before teleportation or will not find it later) 
    14561509    Pet* pet = GetPet(); 
     
    17181771            m_items[i]->AddToWorld(); 
    17191772    } 
    1720     if(sIRC.ajoin == 1) 
    1721         sIRC.AutoJoinChannel(this); 
    17221773} 
    17231774 
     
    18101861            if (recentCast) 
    18111862            { 
    1812                 // Mangos Updates Mana in intervals of 2s, which is correct 
     1863                // Trinity Updates Mana in intervals of 2s, which is correct 
    18131864                addvalue = GetFloatValue(PLAYER_FIELD_MOD_MANA_REGEN_INTERRUPT) *  ManaIncreaseRate * 2.00f; 
    18141865            } 
     
    21302181    GetSession()->SendPacket(&data); 
    21312182 
    2132     SetUInt32Value(PLAYER_NEXT_LEVEL_XP, MaNGOS::XP::xp_to_level(level)); 
     2183    SetUInt32Value(PLAYER_NEXT_LEVEL_XP, Trinity::XP::xp_to_level(level)); 
    21332184 
    21342185    //update level, max level of skills 
     
    21502201    UpdateAllStats(); 
    21512202 
    2152     if((sIRC.BOTMASK & 64) != 0) 
    2153     { 
    2154         char temp [5]; 
    2155         sprintf(temp, "%u", level); 
    2156         std::string plevel = temp; 
    2157         std::string pname = GetName(); 
    2158         std::string ircchan = "#"; 
    2159         ircchan += sIRC._irc_chan[sIRC.Status].c_str(); 
    2160         sIRC.Send_IRC_Channel(ircchan, "\00311["+pname+"] : Has Reached Level: "+plevel, true); 
    2161     } 
    2162  
    21632203    if(sWorld.getConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up 
    2164     UpdateSkillsToMaxSkillsForLevel(); 
     2204        UpdateSkillsToMaxSkillsForLevel(); 
    21652205 
    21662206    // set current level health and mana/energy to maximum after applying all mods. 
     
    22212261 
    22222262    SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) ); 
    2223     SetUInt32Value(PLAYER_NEXT_LEVEL_XP, MaNGOS::XP::xp_to_level(getLevel())); 
     2263    SetUInt32Value(PLAYER_NEXT_LEVEL_XP, Trinity::XP::xp_to_level(getLevel())); 
    22242264 
    22252265    UpdateMaxSkills (); 
     
    31223162    uint32 cost = 0; 
    31233163 
    3124     if(!no_cost) 
     3164    if(!no_cost && !sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST)) 
    31253165    { 
    31263166        cost = resetTalentsCost(); 
     
    36373677    CharacterDatabase.PExecute("DELETE FROM character_pet WHERE owner = '%u'",guid); 
    36383678    CharacterDatabase.PExecute("DELETE FROM character_pet_declinedname WHERE owner = '%u'",guid); 
    3639     CharacterDatabase.PExecute("DELETE FROM has_logged_in_before WHERE guid = %u",guid); 
    36403679    CharacterDatabase.CommitTransaction(); 
    36413680 
     
    37623801    DestroyZoneLimitedItem( true, GetZoneId()); 
    37633802 
    3764     if(sWorld.getConfig(CONFIG_DISABLE_RES_SICKNESS) || !applySickness || getLevel() <= 10) 
     3803    if(!applySickness || getLevel() <= 10) 
    37653804        return; 
    37663805 
     
    48354874 
    48364875    uint32 plevel = getLevel();                             // if defense than pVictim == attacker 
    4837     uint32 greylevel = MaNGOS::XP::GetGrayLevel(plevel); 
     4876    uint32 greylevel = Trinity::XP::GetGrayLevel(plevel); 
    48384877    uint32 moblevel = pVictim->getLevelForTarget(this); 
    48394878    if(moblevel < greylevel) 
     
    52165255{ 
    52175256    // prevent crash when a bad coord is sent by the client 
    5218     if(!MaNGOS::IsValidMapCoord(x,y,z,orientation)) 
     5257    if(!Trinity::IsValidMapCoord(x,y,z,orientation)) 
    52195258    { 
    52205259        sLog.outDebug("Player::SetPosition(%f, %f, %f, %f, %d) .. bad coordinates for player %d!",x,y,z,orientation,teleport,GetGUIDLow()); 
     
    58165855{ 
    58175856    // for grey creature kill received 20%, in other case 100. 
    5818     int32 percent = (!for_quest && (creatureOrQuestLevel <= MaNGOS::XP::GetGrayLevel(getLevel()))) ? 20 : 100; 
     5857    int32 percent = (!for_quest && (creatureOrQuestLevel <= Trinity::XP::GetGrayLevel(getLevel()))) ? 20 : 100; 
    58195858 
    58205859    int32 repMod = GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN); 
     
    60546093    ApplyModUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, uint32(honor), true); 
    60556094 
    6056         if( sWorld.getConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken ) 
    6057         { 
    6058                 if(!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT)) 
    6059                         return true; 
    6060  
    6061                 if(uVictim->GetTypeId() == TYPEID_PLAYER) 
    6062                 { 
    6063                         // Check if allowed to receive it in current map 
    6064                         uint8 MapType = sWorld.getConfig(CONFIG_PVP_TOKEN_MAP_TYPE); 
    6065                         if(MapType == 1 && !InBattleGround() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP) || MapType == 2 && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP) || MapType == 3 && !InBattleGround()) 
    6066                                 return true; 
    6067  
    6068                         uint32 noSpaceForCount = 0; 
    6069                         uint32 itemId = sWorld.getConfig(CONFIG_PVP_TOKEN_ID); 
    6070                         int32 count = sWorld.getConfig(CONFIG_PVP_TOKEN_COUNT); 
    6071  
    6072                         // check space and find places 
    6073                         ItemPosCountVec dest; 
    6074                         uint8 msg = CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount ); 
    6075                         if( msg != EQUIP_ERR_OK )   // convert to possible store amount 
    6076                                 count = noSpaceForCount; 
    6077  
    6078                         if( count == 0 || dest.empty()) // can't add any 
    6079                         { 
    6080                                 // -- TODO: Send to mailbox if no space 
    6081                                 ChatHandler(this).PSendSysMessage("You don't have any space in your bags for a token."); 
    6082                                 return true; 
    6083                         } 
    6084  
    6085                         Item* item = StoreNewItem( dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId)); 
    6086                         SendNewItem(item,count,true,false); 
    6087                         ChatHandler(this).PSendSysMessage("You have been awarded a token for slaying another player."); 
    6088                 } 
    6089         } 
     6095    if( sWorld.getConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken ) 
     6096    { 
     6097        if(!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT)) 
     6098            return true; 
     6099 
     6100        if(uVictim->GetTypeId() == TYPEID_PLAYER) 
     6101        { 
     6102            // Check if allowed to receive it in current map 
     6103            uint8 MapType = sWorld.getConfig(CONFIG_PVP_TOKEN_MAP_TYPE); 
     6104            if( (MapType == 1 && !InBattleGround() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP))  
     6105                || (MapType == 2 && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP)) 
     6106                || (MapType == 3 && !InBattleGround()) ) 
     6107                return true; 
     6108 
     6109            uint32 noSpaceForCount = 0; 
     6110            uint32 itemId = sWorld.getConfig(CONFIG_PVP_TOKEN_ID); 
     6111            int32 count = sWorld.getConfig(CONFIG_PVP_TOKEN_COUNT); 
     6112 
     6113            // check space and find places 
     6114            ItemPosCountVec dest; 
     6115            uint8 msg = CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount ); 
     6116            if( msg != EQUIP_ERR_OK )   // convert to possible store amount 
     6117                count = noSpaceForCount; 
     6118 
     6119            if( count == 0 || dest.empty()) // can't add any 
     6120            { 
     6121                // -- TODO: Send to mailbox if no space 
     6122                ChatHandler(this).PSendSysMessage("You don't have any space in your bags for a token."); 
     6123                return true; 
     6124            } 
     6125 
     6126            Item* item = StoreNewItem( dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId)); 
     6127            SendNewItem(item,count,true,false); 
     6128            ChatHandler(this).PSendSysMessage("You have been awarded a token for slaying another player."); 
     6129        } 
     6130    } 
    60906131 
    60916132    return true; 
     
    62406281void Player::UpdateZone(uint32 newZone) 
    62416282{ 
     6283    uint32 oldZoneId  = m_zoneUpdateId; 
    62426284    m_zoneUpdateId    = newZone; 
    62436285    m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL; 
     
    62496291    if(!zone) 
    62506292        return; 
     6293 
     6294    // inform outdoor pvp 
     6295    if(oldZoneId != m_zoneUpdateId) 
     6296    { 
     6297        sOutdoorPvPMgr.HandlePlayerLeaveZone(this, oldZoneId); 
     6298        sOutdoorPvPMgr.HandlePlayerEnterZone(this, m_zoneUpdateId); 
     6299    } 
    62516300 
    62526301    if (sWorld.getConfig(CONFIG_WEATHER)) 
     
    63816430        } 
    63826431    } 
     6432} 
     6433 
     6434bool Player::IsOutdoorPvPActive() 
     6435{ 
     6436    return (isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP) || sWorld.IsPvPRealm())  && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING2) && !isInFlight()); 
    63836437} 
    63846438 
     
    64576511        duel->opponent->ClearComboPoints(); 
    64586512 
    6459         // Honor points after duel (the winner) - ImpConfig 
    6460         if(sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL > 0)) 
    6461         { 
    6462                 uint32 amount = sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL); 
    6463                 duel->opponent->RewardHonor(NULL,1,amount); 
    6464         } 
     6513    // Honor points after duel (the winner) - ImpConfig 
     6514    if(uint32 amount = sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL)) 
     6515        duel->opponent->RewardHonor(NULL,1,amount); 
    64656516 
    64666517    //cleanups 
     
    74847535} 
    74857536 
    7486 void Player::SendInitWorldStates() 
     7537void Player::SendInitWorldStates(bool forceZone, uint32 forceZoneId) 
    74877538{ 
    74887539    // data depends on zoneid/mapid... 
     
    74907541    uint16 NumberOfFields = 0; 
    74917542    uint32 mapid = GetMapId(); 
    7492     uint32 zoneid = GetZoneId(); 
     7543    uint32 zoneid; 
     7544    if(forceZone) 
     7545        zoneid = forceZoneId; 
     7546    else 
     7547        zoneid = GetZoneId(); 
     7548    OutdoorPvP * pvp = sOutdoorPvPMgr.GetOutdoorPvPToZoneId(zoneid); 
    74937549    uint32 areaid = GetAreaId(); 
    74947550    sLog.outDebug("Sending SMSG_INIT_WORLD_STATES to Map:%u, Zone: %u", mapid, zoneid); 
     
    75157571            NumberOfFields = 6; 
    75167572            break; 
     7573        case 139: 
     7574            NumberOfFields = 39; 
     7575            break; 
     7576        case 1377: 
     7577            NumberOfFields = 13; 
     7578            break; 
    75177579        case 2597: 
    75187580            NumberOfFields = 81; 
     
    75267588            break; 
    75277589        case 3483: 
    7528             NumberOfFields = 22; 
     7590            NumberOfFields = 25; 
     7591            break; 
     7592        case 3518: 
     7593            NumberOfFields = 37; 
    75297594            break; 
    75307595        case 3519: 
     
    75757640        case 1537: 
    75767641        case 2257: 
     7642            break; 
     7643        case 139: // EPL 
     7644            { 
     7645                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_EP) 
     7646                    pvp->FillInitialWorldStates(data); 
     7647                else 
     7648                { 
     7649                    data << uint32(0x97a) << uint32(0x0); // 10 2426 
     7650                    data << uint32(0x917) << uint32(0x0); // 11 2327 
     7651                    data << uint32(0x918) << uint32(0x0); // 12 2328 
     7652                    data << uint32(0x97b) << uint32(0x32); // 13 2427 
     7653                    data << uint32(0x97c) << uint32(0x32); // 14 2428 
     7654                    data << uint32(0x933) << uint32(0x1); // 15 2355 
     7655                    data << uint32(0x946) << uint32(0x0); // 16 2374 
     7656                    data << uint32(0x947) << uint32(0x0); // 17 2375 
     7657                    data << uint32(0x948) << uint32(0x0); // 18 2376 
     7658                    data << uint32(0x949) << uint32(0x0); // 19 2377 
     7659                    data << uint32(0x94a) << uint32(0x0); // 20 2378 
     7660                    data << uint32(0x94b) << uint32(0x0); // 21 2379 
     7661                    data << uint32(0x932) << uint32(0x0); // 22 2354 
     7662                    data << uint32(0x934) << uint32(0x0); // 23 2356 
     7663                    data << uint32(0x935) << uint32(0x0); // 24 2357 
     7664                    data << uint32(0x936) << uint32(0x0); // 25 2358 
     7665                    data << uint32(0x937) << uint32(0x0); // 26 2359 
     7666                    data << uint32(0x938) << uint32(0x0); // 27 2360 
     7667                    data << uint32(0x939) << uint32(0x1); // 28 2361 
     7668                    data << uint32(0x930) << uint32(0x1); // 29 2352 
     7669                    data << uint32(0x93a) << uint32(0x0); // 30 2362 
     7670                    data << uint32(0x93b) << uint32(0x0); // 31 2363 
     7671                    data << uint32(0x93c) << uint32(0x0); // 32 2364 
     7672                    data << uint32(0x93d) << uint32(0x0); // 33 2365 
     7673                    data << uint32(0x944) << uint32(0x0); // 34 2372 
     7674                    data << uint32(0x945) << uint32(0x0); // 35 2373 
     7675                    data << uint32(0x931) << uint32(0x1); // 36 2353 
     7676                    data << uint32(0x93e) << uint32(0x0); // 37 2366 
     7677                    data << uint32(0x931) << uint32(0x1); // 38 2367 ??  grey horde not in dbc! send for consistency's sake, and to match field count 
     7678                    data << uint32(0x940) << uint32(0x0); // 39 2368 
     7679                    data << uint32(0x941) << uint32(0x0); // 7 2369 
     7680                    data << uint32(0x942) << uint32(0x0); // 8 2370 
     7681                    data << uint32(0x943) << uint32(0x0); // 9 2371 
     7682                } 
     7683            } 
     7684            break; 
     7685        case 1377: // Silithus 
     7686            { 
     7687                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_SI) 
     7688                    pvp->FillInitialWorldStates(data); 
     7689                else 
     7690                { 
     7691                    // states are always shown 
     7692                    data << uint32(2313) << uint32(0x0); // 7 ally silityst gathered 
     7693                    data << uint32(2314) << uint32(0x0); // 8 horde silityst gathered 
     7694                    data << uint32(2317) << uint32(0x0); // 9 max silithyst 
     7695                } 
     7696                // dunno about these... aq opening event maybe? 
     7697                data << uint32(2322) << uint32(0x0); // 10 sandworm N 
     7698                data << uint32(2323) << uint32(0x0); // 11 sandworm S 
     7699                data << uint32(2324) << uint32(0x0); // 12 sandworm SW 
     7700                data << uint32(2325) << uint32(0x0); // 13 sandworm E 
     7701            } 
    75777702            break; 
    75787703        case 2597:                                          // AV 
     
    77477872            } 
    77487873            break; 
     7874        // any of these needs change! the client remembers the prev setting! 
     7875        // ON EVERY ZONE LEAVE, RESET THE OLD ZONE'S WORLD STATE, BUT AT LEAST THE UI STUFF! 
    77497876        case 3483:                                          // Hellfire Peninsula 
    7750             data << uint32(0x9ba) << uint32(0x1);           // 10 
    7751             data << uint32(0x9b9) << uint32(0x1);           // 11 
    7752             data << uint32(0x9b5) << uint32(0x0);           // 12 
    7753             data << uint32(0x9b4) << uint32(0x1);           // 13 
    7754             data << uint32(0x9b3) << uint32(0x0);           // 14 
    7755             data << uint32(0x9b2) << uint32(0x0);           // 15 
    7756             data << uint32(0x9b1) << uint32(0x1);           // 16 
    7757             data << uint32(0x9b0) << uint32(0x0);           // 17 
    7758             data << uint32(0x9ae) << uint32(0x0);           // 18 horde pvp objectives captured 
    7759             data << uint32(0x9ac) << uint32(0x0);           // 19 
    7760             data << uint32(0x9a8) << uint32(0x0);           // 20 
    7761             data << uint32(0x9a7) << uint32(0x0);           // 21 
    7762             data << uint32(0x9a6) << uint32(0x1);           // 22 
     7877            { 
     7878                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_HP) 
     7879                    pvp->FillInitialWorldStates(data); 
     7880                else 
     7881                { 
     7882                    data << uint32(0x9ba) << uint32(0x1);           // 10 // add ally tower main gui icon       // maybe should be sent only on login? 
     7883                    data << uint32(0x9b9) << uint32(0x1);           // 11 // add horde tower main gui icon      // maybe should be sent only on login? 
     7884                    data << uint32(0x9b5) << uint32(0x0);           // 12 // show neutral broken hill icon      // 2485 
     7885                    data << uint32(0x9b4) << uint32(0x1);           // 13 // show icon above broken hill        // 2484 
     7886                    data << uint32(0x9b3) << uint32(0x0);           // 14 // show ally broken hill icon         // 2483 
     7887                    data << uint32(0x9b2) << uint32(0x0);           // 15 // show neutral overlook icon         // 2482 
     7888                    data << uint32(0x9b1) << uint32(0x1);           // 16 // show the overlook arrow            // 2481 
     7889                    data << uint32(0x9b0) << uint32(0x0);           // 17 // show ally overlook icon            // 2480 
     7890                    data << uint32(0x9ae) << uint32(0x0);           // 18 // horde pvp objectives captured      // 2478 
     7891                    data << uint32(0x9ac) << uint32(0x0);           // 19 // ally pvp objectives captured       // 2476 
     7892                    data << uint32(2475)  << uint32(100); //: ally / horde slider grey area                              // show only in direct vicinity! 
     7893                    data << uint32(2474)  << uint32(50);  //: ally / horde slider percentage, 100 for ally, 0 for horde  // show only in direct vicinity! 
     7894                    data << uint32(2473)  << uint32(0);   //: ally / horde slider display                                // show only in direct vicinity! 
     7895                    data << uint32(0x9a8) << uint32(0x0);           // 20 // show the neutral stadium icon      // 2472 
     7896                    data << uint32(0x9a7) << uint32(0x0);           // 21 // show the ally stadium icon         // 2471  
     7897                    data << uint32(0x9a6) << uint32(0x1);           // 22 // show the horde stadium icon        // 2470 
     7898                } 
     7899            } 
     7900            break; 
     7901        case 3518: 
     7902            { 
     7903                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_NA) 
     7904                    pvp->FillInitialWorldStates(data); 
     7905                else 
     7906                { 
     7907                    data << uint32(2503) << uint32(0x0);    // 10 
     7908                    data << uint32(2502) << uint32(0x0);    // 11 
     7909                    data << uint32(2493) << uint32(0x0);    // 12 
     7910                    data << uint32(2491) << uint32(0x0);    // 13 
     7911 
     7912                    data << uint32(2495) << uint32(0x0);    // 14 
     7913                    data << uint32(2494) << uint32(0x0);    // 15 
     7914                    data << uint32(2497) << uint32(0x0);    // 16 
     7915 
     7916                    data << uint32(2762) << uint32(0x0);    // 17 
     7917                    data << uint32(2662) << uint32(0x0);    // 18 
     7918                    data << uint32(2663) << uint32(0x0);    // 19 
     7919                    data << uint32(2664) << uint32(0x0);    // 20 
     7920 
     7921                    data << uint32(2760) << uint32(0x0);    // 21 
     7922                    data << uint32(2670) << uint32(0x0);    // 22 
     7923                    data << uint32(2668) << uint32(0x0);    // 23 
     7924                    data << uint32(2669) << uint32(0x0);    // 24 
     7925 
     7926                    data << uint32(2761) << uint32(0x0);    // 25 
     7927                    data << uint32(2667) << uint32(0x0);    // 26 
     7928                    data << uint32(2665) << uint32(0x0);    // 27 
     7929                    data << uint32(2666) << uint32(0x0);    // 28 
     7930 
     7931                    data << uint32(2763) << uint32(0x0);    // 29 
     7932                    data << uint32(2659) << uint32(0x0);    // 30 
     7933                    data << uint32(2660) << uint32(0x0);    // 31 
     7934                    data << uint32(2661) << uint32(0x0);    // 32 
     7935 
     7936                    data << uint32(2671) << uint32(0x0);    // 33 
     7937                    data << uint32(2676) << uint32(0x0);    // 34 
     7938                    data << uint32(2677) << uint32(0x0);    // 35 
     7939                    data << uint32(2672) << uint32(0x0);    // 36 
     7940                    data << uint32(2673) << uint32(0x0);    // 37 
     7941                } 
     7942            } 
    77637943            break; 
    77647944        case 3519:                                          // Terokkar Forest 
    7765             data << uint32(0xa41) << uint32(0x0);           // 10 
    7766             data << uint32(0xa40) << uint32(0x14);          // 11 
    7767             data << uint32(0xa3f) << uint32(0x0);           // 12 
    7768             data << uint32(0xa3e) << uint32(0x0);           // 13 
    7769             data << uint32(0xa3d) << uint32(0x5);           // 14 
    7770             data << uint32(0xa3c) << uint32(0x0);           // 15 
    7771             data << uint32(0xa87) << uint32(0x0);           // 16 
    7772             data << uint32(0xa86) << uint32(0x0);           // 17 
    7773             data << uint32(0xa85) << uint32(0x0);           // 18 
    7774             data << uint32(0xa84) << uint32(0x0);           // 19 
    7775             data << uint32(0xa83) << uint32(0x0);           // 20 
    7776             data << uint32(0xa82) << uint32(0x0);           // 21 
    7777             data << uint32(0xa81) << uint32(0x0);           // 22 
    7778             data << uint32(0xa80) << uint32(0x0);           // 23 
    7779             data << uint32(0xa7e) << uint32(0x0);           // 24 
    7780             data << uint32(0xa7d) << uint32(0x0);           // 25 
    7781             data << uint32(0xa7c) << uint32(0x0);           // 26 
    7782             data << uint32(0xa7b) << uint32(0x0);           // 27 
    7783             data << uint32(0xa7a) << uint32(0x0);           // 28 
    7784             data << uint32(0xa79) << uint32(0x0);           // 29 
    7785             data << uint32(0x9d0) << uint32(0x5);           // 30 
    7786             data << uint32(0x9ce) << uint32(0x0);           // 31 
    7787             data << uint32(0x9cd) << uint32(0x0);           // 32 
    7788             data << uint32(0x9cc) << uint32(0x0);           // 33 
    7789             data << uint32(0xa88) << uint32(0x0);           // 34 
    7790             data << uint32(0xad0) << uint32(0x0);           // 35 
    7791             data << uint32(0xacf) << uint32(0x1);           // 36 
     7945            { 
     7946                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_TF) 
     7947                    pvp->FillInitialWorldStates(data); 
     7948                else 
     7949                { 
     7950                    data << uint32(0xa41) << uint32(0x0);           // 10 // 2625 capture bar pos 
     7951                    data << uint32(0xa40) << uint32(0x14);          // 11 // 2624 capture bar neutral 
     7952                    data << uint32(0xa3f) << uint32(0x0);           // 12 // 2623 show capture bar 
     7953                    data << uint32(0xa3e) << uint32(0x0);           // 13 // 2622 horde towers controlled 
     7954                    data << uint32(0xa3d) << uint32(0x5);           // 14 // 2621 ally towers controlled 
     7955                    data << uint32(0xa3c) << uint32(0x0);           // 15 // 2620 show towers controlled 
     7956                    data << uint32(0xa88) << uint32(0x0);           // 16 // 2696 SE Neu 
     7957                    data << uint32(0xa87) << uint32(0x0);           // 17 // SE Horde 
     7958                    data << uint32(0xa86) << uint32(0x0);           // 18 // SE Ally 
     7959                    data << uint32(0xa85) << uint32(0x0);           // 19 //S Neu 
     7960                    data << uint32(0xa84) << uint32(0x0);           // 20 S Horde 
     7961                    data << uint32(0xa83) << uint32(0x0);           // 21 S Ally 
     7962                    data << uint32(0xa82) << uint32(0x0);           // 22 NE Neu 
     7963                    data << uint32(0xa81) << uint32(0x0);           // 23 NE Horde 
     7964                    data << uint32(0xa80) << uint32(0x0);           // 24 NE Ally 
     7965                    data << uint32(0xa7e) << uint32(0x0);           // 25 // 2686 N Neu 
     7966                    data << uint32(0xa7d) << uint32(0x0);           // 26 N Horde 
     7967                    data << uint32(0xa7c) << uint32(0x0);           // 27 N Ally 
     7968                    data << uint32(0xa7b) << uint32(0x0);           // 28 NW Ally 
     7969                    data << uint32(0xa7a) << uint32(0x0);           // 29 NW Horde 
     7970                    data << uint32(0xa79) << uint32(0x0);           // 30 NW Neutral 
     7971                    data << uint32(0x9d0) << uint32(0x5);           // 31 // 2512 locked time remaining seconds first digit 
     7972                    data << uint32(0x9ce) << uint32(0x0);           // 32 // 2510 locked time remaining seconds second digit 
     7973                    data << uint32(0x9cd) << uint32(0x0);           // 33 // 2509 locked time remaining minutes 
     7974                    data << uint32(0x9cc) << uint32(0x0);           // 34 // 2508 neutral locked time show 
     7975                    data << uint32(0xad0) << uint32(0x0);           // 35 // 2768 horde locked time show 
     7976                    data << uint32(0xacf) << uint32(0x1);           // 36 // 2767 ally locked time show 
     7977                } 
     7978            } 
    77927979            break; 
    77937980        case 3521:                                          // Zangarmarsh 
    7794             data << uint32(0x9e1) << uint32(0x0);           // 10 
    7795             data << uint32(0x9e0) << uint32(0x0);           // 11 
    7796             data << uint32(0x9df) << uint32(0x0);           // 12 
    7797             data << uint32(0xa5d) << uint32(0x1);           // 13 
    7798             data << uint32(0xa5c) << uint32(0x0);           // 14 
    7799             data << uint32(0xa5b) << uint32(0x1);           // 15 
    7800             data << uint32(0xa5a) << uint32(0x0);           // 16 
    7801             data << uint32(0xa59) << uint32(0x1);           // 17 
    7802             data << uint32(0xa58) << uint32(0x0);           // 18 
    7803             data << uint32(0xa57) << uint32(0x0);           // 19 
    7804             data << uint32(0xa56) << uint32(0x0);           // 20 
    7805             data << uint32(0xa55) << uint32(0x1);           // 21 
    7806             data << uint32(0xa54) << uint32(0x0);           // 22 
    7807             data << uint32(0x9e7) << uint32(0x0);           // 23 
    7808             data << uint32(0x9e6) << uint32(0x0);           // 24 
    7809             data << uint32(0x9e5) << uint32(0x0);           // 25 
    7810             data << uint32(0xa00) << uint32(0x0);           // 26 
    7811             data << uint32(0x9ff) << uint32(0x1);           // 27 
    7812             data << uint32(0x9fe) << uint32(0x0);           // 28 
    7813             data << uint32(0x9fd) << uint32(0x0);           // 29 
    7814             data << uint32(0x9fc) << uint32(0x1);           // 30 
    7815             data << uint32(0x9fb) << uint32(0x0);           // 31 
    7816             data << uint32(0xa62) << uint32(0x0);           // 32 
    7817             data << uint32(0xa61) << uint32(0x1);           // 33 
    7818             data << uint32(0xa60) << uint32(0x1);           // 34 
    7819             data << uint32(0xa5f) << uint32(0x0);           // 35 
     7981            { 
     7982                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_ZM) 
     7983                    pvp->FillInitialWorldStates(data); 
     7984                else 
     7985                { 
     7986                    data << uint32(0x9e1) << uint32(0x0);           // 10 //2529 
     7987                    data << uint32(0x9e0) << uint32(0x0);           // 11 
     7988                    data << uint32(0x9df) << uint32(0x0);           // 12 
     7989                    data << uint32(0xa5d) << uint32(0x1);           // 13 //2653  
     7990                    data << uint32(0xa5c) << uint32(0x0);           // 14 //2652 east beacon neutral 
     7991                    data << uint32(0xa5b) << uint32(0x1);           // 15 horde 
     7992                    data << uint32(0xa5a) << uint32(0x0);           // 16 ally 
     7993                    data << uint32(0xa59) << uint32(0x1);           // 17 // 2649 Twin spire graveyard horde  12??? 
     7994                    data << uint32(0xa58) << uint32(0x0);           // 18 ally     14 ??? 
     7995                    data << uint32(0xa57) << uint32(0x0);           // 19 neutral  7??? 
     7996                    data << uint32(0xa56) << uint32(0x0);           // 20 // 2646 west beacon neutral 
     7997                    data << uint32(0xa55) << uint32(0x1);           // 21 horde 
     7998                    data << uint32(0xa54) << uint32(0x0);           // 22 ally 
     7999                    data << uint32(0x9e7) << uint32(0x0);           // 23 // 2535 
     8000                    data << uint32(0x9e6) << uint32(0x0);           // 24 
     8001                    data << uint32(0x9e5) << uint32(0x0);           // 25 
     8002                    data << uint32(0xa00) << uint32(0x0);           // 26 // 2560 
     8003                    data << uint32(0x9ff) << uint32(0x1);           // 27 
     8004                    data << uint32(0x9fe) << uint32(0x0);           // 28 
     8005                    data << uint32(0x9fd) << uint32(0x0);           // 29  
     8006                    data << uint32(0x9fc) << uint32(0x1);           // 30 
     8007                    data << uint32(0x9fb) << uint32(0x0);           // 31 
     8008                    data << uint32(0xa62) << uint32(0x0);           // 32 // 2658 
     8009                    data << uint32(0xa61) << uint32(0x1);           // 33 
     8010                    data << uint32(0xa60) << uint32(0x1);           // 34 
     8011                    data << uint32(0xa5f) << uint32(0x0);           // 35 
     8012                } 
     8013            } 
    78208014            break; 
    78218015        case 3698:                                          // Nagrand Arena 
     
    78858079    WorldPacket data(MSG_TALENT_WIPE_CONFIRM, (8+4)); 
    78868080    data << uint64(guid); 
    7887     data << uint32(resetTalentsCost()); 
    7888         if(sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST)) 
    7889                 data << uint32(0); 
    7890         else 
    7891                 data << uint32(resetTalentsCost()); 
     8081    uint32 cost = sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : resetTalentsCost(); 
     8082    data << cost; 
     8083    data << cost; 
    78928084    GetSession()->SendPacket( &data ); 
    78938085} 
     
    1190812100        { 
    1190912101 
    11910             if ( qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) 
     12102            if ( qInfo->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) ) 
    1191112103            { 
    1191212104                for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++) 
     
    1191712109            } 
    1191812110 
    11919             if ( qInfo->HasFlag(QUEST_MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO) ) 
     12111            if ( qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO) ) 
    1192012112            { 
    1192112113                for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++) 
     
    1192912121            } 
    1193012122 
    11931             if ( qInfo->HasFlag( QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT ) && !q_status.m_explored ) 
     12123            if ( qInfo->HasFlag( QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT ) && !q_status.m_explored ) 
    1193212124                return false; 
    1193312125 
    11934             if ( qInfo->HasFlag( QUEST_MANGOS_FLAGS_TIMED ) && q_status.m_timer == 0 ) 
     12126            if ( qInfo->HasFlag( QUEST_TRINITY_FLAGS_TIMED ) && q_status.m_timer == 0 ) 
    1193512127                return false; 
    1193612128 
     
    1195912151        return false; 
    1196012152 
    11961     if (pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER) ) 
     12153    if (pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER) ) 
    1196212154        for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++) 
    1196312155            if( pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i],pQuest->ReqItemCount[i]) ) 
     
    1198512177 
    1198612178    // prevent receive reward with quest items in bank 
    11987     if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) 
     12179    if ( pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) ) 
    1198812180    { 
    1198912181        for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++) 
     
    1206212254    questStatusData.m_explored = false; 
    1206312255 
    12064     if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) 
     12256    if ( pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) ) 
    1206512257    { 
    1206612258        for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++) 
     
    1206812260    } 
    1206912261 
    12070     if ( pQuest->HasFlag(QUEST_MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO) ) 
     12262    if ( pQuest->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO) ) 
    1207112263    { 
    1207212264        for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++) 
     
    1208112273 
    1208212274    uint32 qtime = 0; 
    12083     if( pQuest->HasFlag( QUEST_MANGOS_FLAGS_TIMED ) ) 
     12275    if( pQuest->HasFlag( QUEST_TRINITY_FLAGS_TIMED ) ) 
    1208412276    { 
    1208512277        uint32 limittime = pQuest->GetLimitTime(); 
     
    1254512737bool Player::SatisfyQuestTimed( Quest const* qInfo, bool msg ) 
    1254612738{ 
    12547     if ( (find(m_timedquests.begin(), m_timedquests.end(), qInfo->GetQuestId()) != m_timedquests.end()) && qInfo->HasFlag(QUEST_MANGOS_FLAGS_TIMED) ) 
     12739    if ( (find(m_timedquests.begin(), m_timedquests.end(), qInfo->GetQuestId()) != m_timedquests.end()) && qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED) ) 
    1254812740    { 
    1254912741        if( msg ) 
     
    1277012962        if( status == QUEST_STATUS_NONE || status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE ) 
    1277112963        { 
    12772             if( qInfo->HasFlag( QUEST_MANGOS_FLAGS_TIMED ) ) 
     12964            if( qInfo->HasFlag( QUEST_TRINITY_FLAGS_TIMED ) ) 
    1277312965                m_timedquests.erase(qInfo->GetQuestId()); 
    1277412966        } 
     
    1278312975} 
    1278412976 
    12785 // not used in MaNGOS, but used in scripting code 
     12977// not used in TrinIty, but used in scripting code 
    1278612978uint32 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry) 
    1278712979{ 
     
    1279912991void Player::AdjustQuestReqItemCount( Quest const* pQuest ) 
    1280012992{ 
    12801     if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) 
     12993    if ( pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) ) 
    1280212994    { 
    1280312995        for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++) 
     
    1284713039} 
    1284813040 
    12849 //not used in mangosd, function for external script library 
     13041//not used in Trinityd, function for external script library 
    1285013042void Player::GroupEventHappens( uint32 questId, WorldObject const* pEventObject ) 
    1285113043{ 
     
    1287913071 
    1288013072        Quest const* qInfo = objmgr.GetQuestTemplate(questid); 
    12881         if( !qInfo || !qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) 
     13073        if( !qInfo || !qInfo->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) ) 
    1288213074            continue; 
    1288313075 
     
    1291613108        if ( !qInfo ) 
    1291713109            continue; 
    12918         if( !qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) ) 
     13110        if( !qInfo->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) ) 
    1291913111            continue; 
    1292013112 
     
    1296313155        if( q_status.m_status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->GetType() == QUEST_TYPE_RAID)) 
    1296413156        { 
    12965             if( qInfo->HasFlag( QUEST_MANGOS_FLAGS_KILL_OR_CAST) ) 
     13157            if( qInfo->HasFlag( QUEST_TRINITY_FLAGS_KILL_OR_CAST) ) 
    1296613158            { 
    1296713159                for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++) 
     
    1301913211        if ( q_status.m_status == QUEST_STATUS_INCOMPLETE ) 
    1302013212        { 
    13021             if( qInfo->HasFlag( QUEST_MANGOS_FLAGS_KILL_OR_CAST ) ) 
     13213            if( qInfo->HasFlag( QUEST_TRINITY_FLAGS_KILL_OR_CAST ) ) 
    1302213214            { 
    1302313215                for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++) 
     
    1308613278        if ( q_status.m_status == QUEST_STATUS_INCOMPLETE ) 
    1308713279        { 
    13088             if( qInfo->HasFlag( QUEST_MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO ) ) 
     13280            if( qInfo->HasFlag( QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO ) ) 
    1308913281            { 
    1309013282                for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++) 
     
    1322613418    uint32 questid = pQuest->GetQuestId(); 
    1322713419    sLog.outDebug( "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid ); 
     13420    gameeventmgr.HandleQuestComplete(questid); 
    1322813421    WorldPacket data( SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4+4+pQuest->GetRewItemsCount()*8) ); 
    1322913422    data << questid; 
     
    1360913802        m_movementInfo.t_o = fields[23].GetFloat(); 
    1361013803 
    13611         if( !MaNGOS::IsValidMapCoord( 
     13804        if( !Trinity::IsValidMapCoord( 
    1361213805            GetPositionX()+m_movementInfo.t_x,GetPositionY()+m_movementInfo.t_y, 
    1361313806            GetPositionZ()+m_movementInfo.t_z,GetOrientation()+m_movementInfo.t_o) || 
     
    1422314416            } 
    1422414417 
    14225             std::string subject = GetSession()->GetMangosString(LANG_NOT_EQUIPPED_ITEM); 
     14418            std::string subject = GetSession()->GetTrinityString(LANG_NOT_EQUIPPED_ITEM); 
    1422614419 
    1422714420            WorldSession::SendMailTo(this, MAIL_NORMAL, MAIL_STATIONERY_GM, GetGUIDLow(), GetGUIDLow(), subject, 0, &mi, 0, 0, MAIL_CHECK_MASK_NONE); 
     
    1438814581                time_t quest_time = time_t(fields[4].GetUInt64()); 
    1438914582 
    14390                 if( pQuest->HasFlag( QUEST_MANGOS_FLAGS_TIMED ) && !GetQuestRewardStatus(quest_id) &&  questStatusData.m_status != QUEST_STATUS_NONE ) 
     14583                if( pQuest->HasFlag( QUEST_TRINITY_FLAGS_TIMED ) && !GetQuestRewardStatus(quest_id) &&  questStatusData.m_status != QUEST_STATUS_NONE ) 
    1439114584                { 
    1439214585                    AddTimedQuest( quest_id ); 
     
    1621316406    std::list<Unit*> stealthedUnits; 
    1621416407 
    16215     CellPair p(MaNGOS::ComputeCellPair(GetPositionX(),GetPositionY())); 
     16408    CellPair p(Trinity::ComputeCellPair(GetPositionX(),GetPositionY())); 
    1621616409    Cell cell(p); 
    1621716410    cell.data.Part.reserved = ALL_DISTRICT; 
    1621816411    cell.SetNoCreate(); 
    1621916412 
    16220     MaNGOS::AnyStealthedCheck u_check; 
    16221     MaNGOS::UnitListSearcher<MaNGOS::AnyStealthedCheck > searcher(stealthedUnits, u_check); 
    16222  
    16223     TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyStealthedCheck >, WorldTypeMapContainer > world_unit_searcher(searcher); 
    16224     TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyStealthedCheck >, GridTypeMapContainer >  grid_unit_searcher(searcher); 
     16413    Trinity::AnyStealthedCheck u_check; 
     16414    Trinity::UnitListSearcher<Trinity::AnyStealthedCheck > searcher(stealthedUnits, u_check); 
     16415 
     16416    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyStealthedCheck >, WorldTypeMapContainer > world_unit_searcher(searcher); 
     16417    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyStealthedCheck >, GridTypeMapContainer >  grid_unit_searcher(searcher); 
    1622516418 
    1622616419    CellLock<GridReadGuard> cell_lock(cell, p); 
     
    1624216435            m_clientGUIDs.insert((*i)->GetGUID()); 
    1624316436 
    16244             #ifdef MANGOS_DEBUG 
     16437            #ifdef TRINITY_DEBUG 
    1624516438            if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0) 
    1624616439                sLog.outDebug("Object %u (Type: %u) is detected in stealth by player %u. Distance = %f",(*i)->GetGUIDLow(),(*i)->GetTypeId(),GetGUIDLow(),GetDistance(*i)); 
     
    1710517298            m_clientGUIDs.erase(target->GetGUID()); 
    1710617299 
    17107             #ifdef MANGOS_DEBUG 
     17300            #ifdef TRINITY_DEBUG 
    1710817301            if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0) 
    1710917302                sLog.outDebug("Object %u (Type: %u) out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); 
     
    1711917312                m_clientGUIDs.insert(target->GetGUID()); 
    1712017313 
    17121             #ifdef MANGOS_DEBUG 
     17314            #ifdef TRINITY_DEBUG 
    1712217315            if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0) 
    1712317316                sLog.outDebug("Object %u (Type: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); 
     
    1715817351            m_clientGUIDs.erase(target->GetGUID()); 
    1715917352 
    17160             #ifdef MANGOS_DEBUG 
     17353            #ifdef TRINITY_DEBUG 
    1716117354            if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0) 
    1716217355                sLog.outDebug("Object %u (Type: %u, Entry: %u) is out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); 
     
    1717317366            UpdateVisibilityOf_helper(m_clientGUIDs,target); 
    1717417367 
    17175             #ifdef MANGOS_DEBUG 
     17368            #ifdef TRINITY_DEBUG 
    1717617369            if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0) 
    1717717370                sLog.outDebug("Object %u (Type: %u, Entry: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); 
     
    1782218015} 
    1782318016 
     18017OutdoorPvP * Player::GetOutdoorPvP() const 
     18018{ 
     18019    return sOutdoorPvPMgr.GetOutdoorPvPToZoneId(GetZoneId()); 
     18020} 
     18021 
    1782418022bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item const* ignoreItem) 
    1782518023{ 
     
    1796218160        if(member_with_max_level) 
    1796318161        { 
    17964             xp = PvP ? 0 : MaNGOS::XP::Gain(member_with_max_level, pVictim); 
     18162            xp = PvP ? 0 : Trinity::XP::Gain(member_with_max_level, pVictim); 
    1796518163 
    1796618164            // skip in check PvP case (for speed, not used) 
    1796718165            bool is_raid = PvP ? false : sMapStore.LookupEntry(GetMapId())->IsRaid() && pGroup->isRaidGroup(); 
    1796818166            bool is_dungeon = PvP ? false : sMapStore.LookupEntry(GetMapId())->IsDungeon(); 
    17969             float group_rate = MaNGOS::XP::xp_in_group_rate(count,is_raid); 
     18167            float group_rate = Trinity::XP::xp_in_group_rate(count,is_raid); 
    1797018168 
    1797118169            for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) 
     
    1801418212    else                                                    // if (!pGroup) 
    1801518213    { 
    18016         xp = PvP ? 0 : MaNGOS::XP::Gain(this, pVictim); 
     18214        xp = PvP ? 0 : Trinity::XP::Gain(this, pVictim); 
    1801718215 
    1801818216        // honor can be in PvP and !PvP (racial leader) cases