<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>contrib/vmap_assembler/.gitignore</filename>
    </added>
    <added>
      <filename>contrib/vmap_assembler/VC71/.gitignore</filename>
    </added>
    <added>
      <filename>contrib/vmap_assembler/VC80/.gitignore</filename>
    </added>
    <added>
      <filename>contrib/vmap_assembler/VC90/.gitignore</filename>
    </added>
    <added>
      <filename>contrib/vmap_assembler/VC90/vmap_assembler.vcproj</filename>
    </added>
    <added>
      <filename>contrib/vmap_assembler/vmap_assemblerVC90.sln</filename>
    </added>
    <added>
      <filename>contrib/vmap_extractor_v2/vmapExtractor_VC90.sln</filename>
    </added>
    <added>
      <filename>contrib/vmap_extractor_v2/vmapExtractor_VC90.vcproj</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -17,3 +17,4 @@
 debug
 release
 *.user
+*.ilk</diff>
      <filename>contrib/extractor/.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -39,7 +39,7 @@ enum Extract
 };
 int extract = EXTRACT_MAP | EXTRACT_DBC;
 
-static char* const langs[]={&quot;enGB&quot;, &quot;enUS&quot;, &quot;deDE&quot;, &quot;esES&quot;, &quot;frFR&quot;, &quot;koKR&quot;, &quot;zhCN&quot;, &quot;zhTW&quot;, &quot;enCN&quot;, &quot;enTW&quot;, &quot;esMX&quot;, &quot;ruRU&quot; };
+static char* const langs[] = {&quot;enGB&quot;, &quot;enUS&quot;, &quot;deDE&quot;, &quot;esES&quot;, &quot;frFR&quot;, &quot;koKR&quot;, &quot;zhCN&quot;, &quot;zhTW&quot;, &quot;enCN&quot;, &quot;enTW&quot;, &quot;esMX&quot;, &quot;ruRU&quot; };
 #define LANG_COUNT 12
 
 #define ADT_RES 64
@@ -55,9 +55,9 @@ void CreateDir( const std::string&amp; Path )
 
 bool FileExists( const char* FileName )
 {
-    if( FILE* fp = fopen( FileName, &quot;rb&quot; ) )
+    if(FILE* fp = fopen( FileName, &quot;rb&quot; ))
     {
-        fclose( fp );
+        fclose(fp);
         return true;
     }
 
@@ -222,15 +222,15 @@ void ExtractDBCFiles(int locale, bool basicLocale)
         string filename = path;
         filename += (iter-&gt;c_str() + strlen(&quot;DBFilesClient\\&quot;));
 
-        FILE *output=fopen(filename.c_str(),&quot;wb&quot;);
+        FILE *output=fopen(filename.c_str(), &quot;wb&quot;);
         if(!output)
         {
-            printf(&quot;Can't create the output file '%s'\n&quot;,filename.c_str());
+            printf(&quot;Can't create the output file '%s'\n&quot;, filename.c_str());
             continue;
         }
         MPQFile m(iter-&gt;c_str());
         if(!m.isEof())
-            fwrite(m.getPointer(),1,m.getSize(),output);
+            fwrite(m.getPointer(), 1, m.getSize(), output);
 
         fclose(output);
         ++count;
@@ -242,7 +242,7 @@ void LoadLocaleMPQFiles(int const locale)
 {
     char filename[512];
 
-    sprintf(filename,&quot;%s/Data/%s/locale-%s.MPQ&quot;,input_path,langs[locale],langs[locale]);
+    sprintf(filename,&quot;%s/Data/%s/locale-%s.MPQ&quot;, input_path, langs[locale], langs[locale]);
     new MPQArchive(filename);
 
     for(int i = 1; i &lt; 5; ++i)
@@ -251,7 +251,7 @@ void LoadLocaleMPQFiles(int const locale)
         if(i &gt; 1)
             sprintf(ext, &quot;-%i&quot;, i);
 
-        sprintf(filename,&quot;%s/Data/%s/patch-%s%s.MPQ&quot;,input_path,langs[locale],langs[locale],ext);
+        sprintf(filename,&quot;%s/Data/%s/patch-%s%s.MPQ&quot;, input_path, langs[locale], langs[locale], ext);
         if(FileExists(filename))
             new MPQArchive(filename);
     }
@@ -261,9 +261,9 @@ void LoadCommonMPQFiles()
 {
     char filename[512];
 
-    sprintf(filename,&quot;%s/Data/common.MPQ&quot;,input_path);
+    sprintf(filename,&quot;%s/Data/common-2.MPQ&quot;, input_path);
     new MPQArchive(filename);
-    sprintf(filename,&quot;%s/Data/expansion.MPQ&quot;,input_path);
+    sprintf(filename,&quot;%s/Data/expansion.MPQ&quot;, input_path);
     new MPQArchive(filename);
 
     for(int i = 1; i &lt; 5; ++i)
@@ -272,7 +272,7 @@ void LoadCommonMPQFiles()
         if(i &gt; 1)
             sprintf(ext, &quot;-%i&quot;, i);
 
-        sprintf(filename,&quot;%s/Data/patch%s.MPQ&quot;,input_path,ext);
+        sprintf(filename,&quot;%s/Data/patch%s.MPQ&quot;, input_path, ext);
         if(FileExists(filename))
             new MPQArchive(filename);
     }
@@ -306,12 +306,12 @@ int main(int argc, char * arg[])
 
             if((extract &amp; EXTRACT_DBC) == 0)
             {
-                FirstLocale=i;
+                FirstLocale = i;
                 break;
             }
 
             //Extract DBC files
-            if(FirstLocale&lt;0)
+            if(FirstLocale &lt; 0)
             {
                 ExtractDBCFiles(i, true);
                 FirstLocale = i;
@@ -324,7 +324,7 @@ int main(int argc, char * arg[])
         }
     }
 
-    if(FirstLocale&lt;0)
+    if(FirstLocale &lt; 0)
     {
         printf(&quot;No locales detected\n&quot;);
         return 0;</diff>
      <filename>contrib/extractor/System.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -76,7 +76,7 @@
 				Name=&quot;VCLinkerTool&quot;
 				AdditionalDependencies=&quot;zlib.lib&quot;
 				OutputFile=&quot;ad debug.exe&quot;
-				LinkIncremental=&quot;1&quot;
+				LinkIncremental=&quot;0&quot;
 				SuppressStartupBanner=&quot;true&quot;
 				AdditionalLibraryDirectories=&quot;./debug/&quot;
 				IgnoreDefaultLibraryNames=&quot;LIBCD.lib&quot;
@@ -171,7 +171,7 @@
 				Name=&quot;VCLinkerTool&quot;
 				AdditionalDependencies=&quot;zlib.lib&quot;
 				OutputFile=&quot;./ad.exe&quot;
-				LinkIncremental=&quot;1&quot;
+				LinkIncremental=&quot;0&quot;
 				SuppressStartupBanner=&quot;true&quot;
 				AdditionalLibraryDirectories=&quot;./release/&quot;
 				IgnoreDefaultLibraryNames=&quot;LIBC.lib&quot;</diff>
      <filename>contrib/extractor/VC71_ad.vcproj</filename>
    </modified>
    <modified>
      <diff>@@ -79,7 +79,7 @@
 				Name=&quot;VCLinkerTool&quot;
 				AdditionalDependencies=&quot;zlib.lib&quot;
 				OutputFile=&quot;ad debug.exe&quot;
-				LinkIncremental=&quot;1&quot;
+				LinkIncremental=&quot;0&quot;
 				SuppressStartupBanner=&quot;true&quot;
 				AdditionalLibraryDirectories=&quot;./debug&quot;
 				IgnoreDefaultLibraryNames=&quot;LIBCD.lib&quot;
@@ -176,7 +176,7 @@
 				Name=&quot;VCLinkerTool&quot;
 				AdditionalDependencies=&quot;zlib.lib&quot;
 				OutputFile=&quot;./ad.exe&quot;
-				LinkIncremental=&quot;1&quot;
+				LinkIncremental=&quot;0&quot;
 				SuppressStartupBanner=&quot;true&quot;
 				AdditionalLibraryDirectories=&quot;./release&quot;
 				IgnoreDefaultLibraryNames=&quot;LIBC.lib&quot;</diff>
      <filename>contrib/extractor/VC80_ad.vcproj</filename>
    </modified>
    <modified>
      <diff>@@ -80,7 +80,7 @@
 				Name=&quot;VCLinkerTool&quot;
 				AdditionalDependencies=&quot;zlib.lib&quot;
 				OutputFile=&quot;ad debug.exe&quot;
-				LinkIncremental=&quot;1&quot;
+				LinkIncremental=&quot;0&quot;
 				SuppressStartupBanner=&quot;true&quot;
 				AdditionalLibraryDirectories=&quot;./debug/&quot;
 				IgnoreDefaultLibraryNames=&quot;LIBCD.lib&quot;
@@ -175,7 +175,7 @@
 				Name=&quot;VCLinkerTool&quot;
 				AdditionalDependencies=&quot;zlib.lib&quot;
 				OutputFile=&quot;./ad.exe&quot;
-				LinkIncremental=&quot;1&quot;
+				LinkIncremental=&quot;0&quot;
 				SuppressStartupBanner=&quot;true&quot;
 				AdditionalLibraryDirectories=&quot;./release/&quot;
 				IgnoreDefaultLibraryNames=&quot;LIBC.lib&quot;</diff>
      <filename>contrib/extractor/VC90_ad.vcproj</filename>
    </modified>
    <modified>
      <diff>@@ -86,8 +86,8 @@ public:
 	MTRand( const uint32&amp; oneSeed );  // initialize with a simple uint32
 	MTRand( uint32 *const bigSeed, uint32 const seedLength = N );  // or an array
 	MTRand();                         // auto-initialize with /dev/urandom or time() and clock()
-    MTRand(const MTRand&amp;);            // prevent copy constructor
-    MTRand&amp; operator=(const MTRand&amp;); // no-op operator=
+	MTRand(const MTRand&amp;);            // prevent copy constructor
+	MTRand&amp; operator=(const MTRand&amp;); // no-op operator=
 	
 	// Do NOT use for CRYPTOGRAPHY without securely hashing several returned
 	// values together, otherwise the generator state can be learned after</diff>
      <filename>dep/include/mersennetwister/MersenneTwister.h</filename>
    </modified>
    <modified>
      <diff>@@ -641,7 +641,6 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
     pCurrChar-&gt;LoadCorpse();
 
     // setting Ghost+speed if dead
-    //if ( pCurrChar-&gt;m_deathState == DEAD )
     if (pCurrChar-&gt;m_deathState != ALIVE)
     {
         // not blizz like, we must correctly save and load player instead...</diff>
      <filename>src/game/CharacterHandler.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -218,7 +218,7 @@ struct CreatureInfo
 
     bool isTameable() const
     {
-        return type == CREATURE_TYPE_BEAST &amp;&amp; family != 0 &amp;&amp; (type_flags &amp; CREATURE_TYPEFLAGS_TAMEBLE);
+        return type == CREATURE_TYPE_BEAST &amp;&amp; family != 0 &amp;&amp; (type_flags &amp; CREATURE_TYPEFLAGS_TAMEABLE);
     }
 };
 </diff>
      <filename>src/game/Creature.h</filename>
    </modified>
    <modified>
      <diff>@@ -190,7 +190,7 @@ void GameObject::Update(uint32 /*p_time*/)
                         if(caster &amp;&amp; caster-&gt;GetTypeId()==TYPEID_PLAYER)
                         {
                             SetGoState(0);
-                            SetUInt32Value(GAMEOBJECT_FLAGS, 32);
+                            SetUInt32Value(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
 
                             UpdateData udata;
                             WorldPacket packet;</diff>
      <filename>src/game/GameObject.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -128,26 +128,20 @@ void PlayerMenu::SendGossipMenu( uint32 TitleTextId, uint64 npcGUID )
     data &lt;&lt; npcGUID;
     data &lt;&lt; uint32(0);                                      // new 2.4.0
     data &lt;&lt; uint32( TitleTextId );
-    data &lt;&lt; uint32( mGossipMenu.MenuItemCount() );         // max count 0x0F
+    data &lt;&lt; uint32( mGossipMenu.MenuItemCount() );          // max count 0x0F
 
     for ( unsigned int iI = 0; iI &lt; mGossipMenu.MenuItemCount(); iI++ )
     {
         GossipMenuItem const&amp; gItem = mGossipMenu.GetItem(iI);
         data &lt;&lt; uint32( iI );
         data &lt;&lt; uint8( gItem.m_gIcon );
-        // icons:
-        // 0 unlearn talents/misc
-        // 1 trader
-        // 2 taxi
-        // 3 trainer
-        // 9 BG/arena
         data &lt;&lt; uint8( gItem.m_gCoded );                    // makes pop up box password
         data &lt;&lt; uint32(gItem.m_gBoxMoney);                  // money required to open menu, 2.0.3
         data &lt;&lt; gItem.m_gMessage;                           // text for gossip item
         data &lt;&lt; gItem.m_gBoxMessage;                        // accept text (related to money) pop up box, 2.0.3
     }
 
-    data &lt;&lt; uint32( mQuestMenu.MenuItemCount() );          // max count 0x20
+    data &lt;&lt; uint32( mQuestMenu.MenuItemCount() );           // max count 0x20
 
     for ( uint16 iI = 0; iI &lt; mQuestMenu.MenuItemCount(); iI++ )
     {
@@ -155,7 +149,7 @@ void PlayerMenu::SendGossipMenu( uint32 TitleTextId, uint64 npcGUID )
         uint32 questID = qItem.m_qId;
         Quest const* pQuest = objmgr.GetQuestTemplate(questID);
 
-        data &lt;&lt; questID;
+        data &lt;&lt; uint32(questID);
         data &lt;&lt; uint32( qItem.m_qIcon );
         data &lt;&lt; uint32( pQuest ? pQuest-&gt;GetQuestLevel() : 0 );
         std::string Title = pQuest-&gt;GetTitle();
@@ -381,8 +375,7 @@ void PlayerMenu::SendQuestGiverQuestList( QEmote eEmote, std::string Title, uint
         data &lt;&lt; title;
     }
     pSession-&gt;SendPacket( &amp;data );
-    //uint32 fqid=pQuestMenu-&gt;GetItem(0).m_qId;
-    //sLog.outDebug( &quot;WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u, questid-0=%u&quot;,npcGUID,fqid);
+    sLog.outDebug(&quot;WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u&quot;, GUID_LOPART(npcGUID));
 }
 
 void PlayerMenu::SendQuestGiverStatus( uint8 questStatus, uint64 npcGUID )
@@ -392,7 +385,7 @@ void PlayerMenu::SendQuestGiverStatus( uint8 questStatus, uint64 npcGUID )
     data &lt;&lt; uint8(questStatus);
 
     pSession-&gt;SendPacket( &amp;data );
-    sLog.outDebug( &quot;WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u&quot;,GUID_LOPART(npcGUID),questStatus);
+    sLog.outDebug( &quot;WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u&quot;, GUID_LOPART(npcGUID), questStatus);
 }
 
 void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID, bool ActivateAccept )
@@ -462,6 +455,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
             else
                 data &lt;&lt; uint32(0);
         }
+
         data &lt;&lt; uint32(pQuest-&gt;GetRewOrReqMoney());
     }
 
@@ -479,7 +473,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
     }
     pSession-&gt;SendPacket( &amp;data );
 
-    sLog.outDebug(&quot;WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u&quot;,GUID_LOPART(npcGUID),pQuest-&gt;GetQuestId());
+    sLog.outDebug(&quot;WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u&quot;, GUID_LOPART(npcGUID), pQuest-&gt;GetQuestId());
 }
 
 void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
@@ -760,8 +754,10 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
     else
         data &lt;&lt; uint32(0x03);
 
-    data &lt;&lt; uint32(0x04) &lt;&lt; uint32(0x08) &lt;&lt; uint32(0x10);
+    data &lt;&lt; uint32(0x04);
+    data &lt;&lt; uint32(0x08);
+    data &lt;&lt; uint32(0x10);
 
     pSession-&gt;SendPacket( &amp;data );
-    sLog.outDebug( &quot;WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u&quot;,GUID_LOPART(npcGUID),pQuest-&gt;GetQuestId() );
+    sLog.outDebug( &quot;WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u&quot;, GUID_LOPART(npcGUID), pQuest-&gt;GetQuestId() );
 }</diff>
      <filename>src/game/GossipDef.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -369,7 +369,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket &amp; recv_data )
         data &lt;&lt; pProto-&gt;ArcaneRes;
 
         data &lt;&lt; pProto-&gt;Delay;
-        data &lt;&lt; pProto-&gt;Ammo_type;
+        data &lt;&lt; pProto-&gt;AmmoType;
         data &lt;&lt; pProto-&gt;RangedModRange;
 
         for(int s = 0; s &lt; 5; s++)</diff>
      <filename>src/game/ItemHandler.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -443,17 +443,15 @@ inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemS
 
 struct _Damage
 {
-    float DamageMin;
-    float DamageMax;
-    uint32 DamageType;                                      // id from Resistances.dbc
-
+    float   DamageMin;
+    float   DamageMax;
+    uint32  DamageType;                                     // id from Resistances.dbc
 };
 
 struct _ItemStat
 {
-    uint32 ItemStatType;
-    int32  ItemStatValue;
-
+    uint32  ItemStatType;
+    int32   ItemStatValue;
 };
 struct _Spell
 {
@@ -464,7 +462,6 @@ struct _Spell
     int32  SpellCooldown;
     uint32 SpellCategory;                                   // id from SpellCategory.dbc
     int32  SpellCategoryCooldown;
-
 };
 
 struct _Socket
@@ -479,7 +476,7 @@ struct ItemPrototype
     uint32 Class;                                           // id from ItemClass.dbc
     uint32 SubClass;                                        // id from ItemSubClass.dbc
     uint32 Unk0;
-    char* Name1;
+    char*  Name1;
     uint32 DisplayInfoID;                                   // id from ItemDisplayInfo.dbc
     uint32 Quality;
     uint32 Flags;
@@ -511,12 +508,11 @@ struct ItemPrototype
     uint32 ShadowRes;
     uint32 ArcaneRes;
     uint32 Delay;
-    uint32 Ammo_type;
+    uint32 AmmoType;
     float  RangedModRange;
-
     _Spell Spells[5];
     uint32 Bonding;
-    char* Description;
+    char*  Description;
     uint32 PageText;
     uint32 LanguageID;
     uint32 PageMaterial;</diff>
      <filename>src/game/ItemPrototype.h</filename>
    </modified>
    <modified>
      <diff>@@ -1028,7 +1028,7 @@ bool ChatHandler::HandleModifyASpeedCommand(const char* args)
     chr-&gt;SetSpeed(MOVE_RUN,     ASpeed,true);
     chr-&gt;SetSpeed(MOVE_SWIM,    ASpeed,true);
     //chr-&gt;SetSpeed(MOVE_TURN,    ASpeed,true);
-    chr-&gt;SetSpeed(MOVE_FLY,     ASpeed,true);
+    chr-&gt;SetSpeed(MOVE_FLIGHT,     ASpeed,true);
     return true;
 }
 
@@ -1144,7 +1144,7 @@ bool ChatHandler::HandleModifyBWalkCommand(const char* args)
     if (needReportToTarget(chr))
         ChatHandler(chr).PSendSysMessage(LANG_YOURS_BACK_SPEED_CHANGED, GetName(), BSpeed);
 
-    chr-&gt;SetSpeed(MOVE_WALKBACK,BSpeed,true);
+    chr-&gt;SetSpeed(MOVE_RUN_BACK,BSpeed,true);
 
     return true;
 }
@@ -1176,7 +1176,7 @@ bool ChatHandler::HandleModifyFlyCommand(const char* args)
     if (needReportToTarget(chr))
         ChatHandler(chr).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, GetName(), FSpeed);
 
-    chr-&gt;SetSpeed(MOVE_FLY,FSpeed,true);
+    chr-&gt;SetSpeed(MOVE_FLIGHT,FSpeed,true);
 
     return true;
 }</diff>
      <filename>src/game/Level1.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -616,7 +616,6 @@ void Map::Update(const uint32 &amp;t_diff)
         }
     }
 
-
     // Don't unload grids if it's battleground, since we may have manually added GOs,creatures, those doesn't load from DB at grid re-load !
     // This isn't really bother us, since as soon as we have instanced BG-s, the whole map unloads as the BG gets ended
     if (IsBattleGroundOrArena())
@@ -697,7 +696,7 @@ Map::Remove(T *obj, bool remove)
     CellPair p = MaNGOS::ComputeCellPair(obj-&gt;GetPositionX(), obj-&gt;GetPositionY());
     if(p.x_coord &gt;= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord &gt;= TOTAL_NUMBER_OF_CELLS_PER_MAP )
     {
-        sLog.outError(&quot;Map::Remove: Object &quot; I64FMTD &quot; have invalid coordinates X:%f Y:%f grid cell [%u:%u]&quot;, obj-&gt;GetGUID(), obj-&gt;GetPositionX(), obj-&gt;GetPositionY(), p.x_coord, p.y_coord);
+        sLog.outError(&quot;Map::Remove: Object &quot; I64FMT &quot; have invalid coordinates X:%f Y:%f grid cell [%u:%u]&quot;, obj-&gt;GetGUID(), obj-&gt;GetPositionX(), obj-&gt;GetPositionY(), p.x_coord, p.y_coord);
         return;
     }
 
@@ -705,7 +704,7 @@ Map::Remove(T *obj, bool remove)
     if( !loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)) )
         return;
 
-    DEBUG_LOG(&quot;Remove object &quot; I64FMTD &quot; from grid[%u,%u]&quot;, obj-&gt;GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y);
+    DEBUG_LOG(&quot;Remove object &quot; I64FMT &quot; from grid[%u,%u]&quot;, obj-&gt;GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y);
     NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
     assert( grid != NULL );
 
@@ -959,7 +958,7 @@ bool Map::UnloadGrid(const uint32 &amp;x, const uint32 &amp;y, bool pForce)
         if (i_InstanceId == 0)
         {
             if(GridMaps[gx][gy]) delete (GridMaps[gx][gy]);
-            // x and y are swaped
+            // x and y are swapped
             VMAP::VMapFactory::createOrGetVMapManager()-&gt;unloadMap(GetId(), gy, gx);
         }
         else
@@ -1122,7 +1121,6 @@ uint8 Map::GetTerrainType(float x, float y ) const
         return GridMaps[gx][gy]-&gt;terrain_type[(int)(lx)][(int)(ly)];
     else
         return 0;
-
 }
 
 float Map::GetWaterLevel(float x, float y ) const</diff>
      <filename>src/game/Map.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -1380,7 +1380,7 @@ void WorldSession::HandleFarSightOpcode( WorldPacket &amp; recv_data )
             sLog.outDebug(&quot;Removed FarSight from player %u&quot;, _player-&gt;GetGUIDLow());
             break;
         case 1:
-            sLog.outDebug(&quot;Added FarSight &quot; I64FMTD &quot; to player %u&quot;, _player-&gt;GetUInt64Value(PLAYER_FARSIGHT), _player-&gt;GetGUIDLow());
+            sLog.outDebug(&quot;Added FarSight &quot; I64FMT &quot; to player %u&quot;, _player-&gt;GetFarSight(), _player-&gt;GetGUIDLow());
             break;
     }
 }
@@ -1395,9 +1395,9 @@ void WorldSession::HandleChooseTitleOpcode( WorldPacket &amp; recv_data )
     recv_data &gt;&gt; title;
 
     // -1 at none
-    if(title &gt; 0 &amp;&amp; title &lt; 64)
+    if(title &gt; 0 &amp;&amp; title &lt; 128)
     {
-       if(!GetPlayer()-&gt;HasFlag64(PLAYER__FIELD_KNOWN_TITLES,uint64(1) &lt;&lt; title))
+       if(!GetPlayer()-&gt;HasTitle(title))
             return;
     }
     else</diff>
      <filename>src/game/MiscHandler.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -461,19 +461,19 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &amp;recv_data)
     UnitMoveType move_type;
     UnitMoveType force_move_type;
 
-    static char const* move_type_name[MAX_MOVE_TYPE] = {  &quot;Walk&quot;, &quot;Run&quot;, &quot;Walkback&quot;, &quot;Swim&quot;, &quot;Swimback&quot;, &quot;Turn&quot;, &quot;Fly&quot;, &quot;Flyback&quot; };
+    static char const* move_type_name[MAX_MOVE_TYPE] = {  &quot;Walk&quot;, &quot;Run&quot;, &quot;RunBack&quot;, &quot;Swim&quot;, &quot;SwimBack&quot;, &quot;TurnRate&quot;, &quot;Flight&quot;, &quot;FlightBack&quot; };
 
     uint16 opcode = recv_data.GetOpcode();
     switch(opcode)
     {
-        case CMSG_FORCE_WALK_SPEED_CHANGE_ACK:          move_type = MOVE_WALK;     force_move_type = MOVE_WALK;     break;
-        case CMSG_FORCE_RUN_SPEED_CHANGE_ACK:           move_type = MOVE_RUN;      force_move_type = MOVE_RUN;      break;
-        case CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK:      move_type = MOVE_WALKBACK; force_move_type = MOVE_WALKBACK; break;
-        case CMSG_FORCE_SWIM_SPEED_CHANGE_ACK:          move_type = MOVE_SWIM;     force_move_type = MOVE_SWIM;     break;
-        case CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK:     move_type = MOVE_SWIMBACK; force_move_type = MOVE_SWIMBACK; break;
-        case CMSG_FORCE_TURN_RATE_CHANGE_ACK:           move_type = MOVE_TURN;     force_move_type = MOVE_TURN;     break;
-        case CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK:        move_type = MOVE_FLY;      force_move_type = MOVE_FLY;      break;
-        case CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK:   move_type = MOVE_FLYBACK;  force_move_type = MOVE_FLYBACK;  break;
+        case CMSG_FORCE_WALK_SPEED_CHANGE_ACK:          move_type = MOVE_WALK;          force_move_type = MOVE_WALK;        break;
+        case CMSG_FORCE_RUN_SPEED_CHANGE_ACK:           move_type = MOVE_RUN;           force_move_type = MOVE_RUN;         break;
+        case CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK:      move_type = MOVE_RUN_BACK;      force_move_type = MOVE_RUN_BACK;    break;
+        case CMSG_FORCE_SWIM_SPEED_CHANGE_ACK:          move_type = MOVE_SWIM;          force_move_type = MOVE_SWIM;        break;
+        case CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK:     move_type = MOVE_SWIM_BACK;     force_move_type = MOVE_SWIM_BACK;   break;
+        case CMSG_FORCE_TURN_RATE_CHANGE_ACK:           move_type = MOVE_TURN_RATE;     force_move_type = MOVE_TURN_RATE;   break;
+        case CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK:        move_type = MOVE_FLIGHT;        force_move_type = MOVE_FLIGHT;      break;
+        case CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK:   move_type = MOVE_FLIGHT_BACK;   force_move_type = MOVE_FLIGHT_BACK; break;
         default:
             sLog.outError(&quot;WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u&quot;, opcode);
             return;</diff>
      <filename>src/game/MovementHandler.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -551,9 +551,9 @@ void WorldSession::SendStablePet(uint64 guid )
 
 void WorldSession::HandleStablePet( WorldPacket &amp; recv_data )
 {
-    CHECK_PACKET_SIZE(recv_data,8);
+    CHECK_PACKET_SIZE(recv_data, 8);
 
-    sLog.outDebug(&quot;WORLD: Recv CMSG_STABLE_PET not dispose.&quot;);
+    sLog.outDebug(&quot;WORLD: Recv CMSG_STABLE_PET&quot;);
     uint64 npcGUID;
 
     recv_data &gt;&gt; npcGUID;
@@ -614,7 +614,7 @@ void WorldSession::HandleStablePet( WorldPacket &amp; recv_data )
 
 void WorldSession::HandleUnstablePet( WorldPacket &amp; recv_data )
 {
-    CHECK_PACKET_SIZE(recv_data,8+4);
+    CHECK_PACKET_SIZE(recv_data, 8+4);
 
     sLog.outDebug(&quot;WORLD: Recv CMSG_UNSTABLE_PET.&quot;);
     uint64 npcGUID;
@@ -674,7 +674,7 @@ void WorldSession::HandleUnstablePet( WorldPacket &amp; recv_data )
 
 void WorldSession::HandleBuyStableSlot( WorldPacket &amp; recv_data )
 {
-    CHECK_PACKET_SIZE(recv_data,8);
+    CHECK_PACKET_SIZE(recv_data, 8);
 
     sLog.outDebug(&quot;WORLD: Recv CMSG_BUY_STABLE_SLOT.&quot;);
     uint64 npcGUID;
@@ -719,7 +719,7 @@ void WorldSession::HandleStableRevivePet( WorldPacket &amp;/* recv_data */)
 
 void WorldSession::HandleStableSwapPet( WorldPacket &amp; recv_data )
 {
-    CHECK_PACKET_SIZE(recv_data,8+4);
+    CHECK_PACKET_SIZE(recv_data, 8+4);
 
     sLog.outDebug(&quot;WORLD: Recv CMSG_STABLE_SWAP_PET.&quot;);
     uint64 npcGUID;
@@ -774,7 +774,7 @@ void WorldSession::HandleStableSwapPet( WorldPacket &amp; recv_data )
 
 void WorldSession::HandleRepairItemOpcode( WorldPacket &amp; recv_data )
 {
-    CHECK_PACKET_SIZE(recv_data,8+8+1);
+    CHECK_PACKET_SIZE(recv_data, 8+8+1);
 
     sLog.outDebug(&quot;WORLD: CMSG_REPAIR_ITEM&quot;);
 </diff>
      <filename>src/game/NPCHandler.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -376,12 +376,12 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2
 
         *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_WALK );
         *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_RUN );
-        *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_SWIMBACK );
+        *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_SWIM_BACK );
         *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_SWIM );
-        *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_WALKBACK );
-        *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_FLY );
-        *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_FLYBACK );
-        *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_TURN );
+        *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_RUN_BACK );
+        *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_FLIGHT );
+        *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_FLIGHT_BACK );
+        *data &lt;&lt; ((Unit*)this)-&gt;GetSpeed( MOVE_TURN_RATE );
 
         // 0x08000000
         if(flags2 &amp; MOVEMENTFLAG_SPLINE2)
@@ -625,7 +625,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
                                 *data &lt;&lt; uint32(1);
                                 break;
                             default:
-                                *data &lt;&lt; uint32(0);         //unknown. not happen.
+                                *data &lt;&lt; uint32(0);         // unknown. not happen.
                                 break;
                         }
                     }
@@ -934,6 +934,56 @@ void Object::RemoveFlag( uint16 index, uint32 oldFlag )
     }
 }
 
+void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag )
+{
+    ASSERT( index &lt; m_valuesCount || PrintIndexError( index , true ) );
+
+    if(offset &gt; 4)
+    {
+        sLog.outError(&quot;Object::SetByteFlag: wrong offset %u&quot;, offset);
+        return;
+    }
+
+    if(!(uint8(m_uint32Values[ index ] &gt;&gt; (offset * 8)) &amp; newFlag))
+    {
+        m_uint32Values[ index ] |= uint32(uint32(newFlag) &lt;&lt; (offset * 8));
+
+        if(m_inWorld)
+        {
+            if(!m_objectUpdated)
+            {
+                ObjectAccessor::Instance().AddUpdateObject(this);
+                m_objectUpdated = true;
+            }
+        }
+    }
+}
+
+void Object::RemoveByteFlag( uint16 index, uint8 offset, uint8 oldFlag )
+{
+    ASSERT( index &lt; m_valuesCount || PrintIndexError( index , true ) );
+
+    if(offset &gt; 4)
+    {
+        sLog.outError(&quot;Object::RemoveByteFlag: wrong offset %u&quot;, offset);
+        return;
+    }
+
+    if(uint8(m_uint32Values[ index ] &gt;&gt; (offset * 8)) &amp; oldFlag)
+    {
+        m_uint32Values[ index ] &amp;= ~uint32(uint32(oldFlag) &lt;&lt; (offset * 8));
+
+        if(m_inWorld)
+        {
+            if(!m_objectUpdated)
+            {
+                ObjectAccessor::Instance().AddUpdateObject(this);
+                m_objectUpdated = true;
+            }
+        }
+    }
+}
+
 bool Object::PrintIndexError(uint32 index, bool set) const
 {
     sLog.outError(&quot;ERROR: Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u&quot;,(set ? &quot;set value to&quot; : &quot;get value from&quot;),index,m_valuesCount,GetTypeId(),m_objectType);</diff>
      <filename>src/game/Object.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -226,6 +226,24 @@ class MANGOS_DLL_SPEC Object
             return (m_uint32Values[ index ] &amp; flag) != 0;
         }
 
+        void SetByteFlag( uint16 index, uint8 offset, uint8 newFlag );
+        void RemoveByteFlag( uint16 index, uint8 offset, uint8 newFlag );
+
+        void ToggleFlag( uint16 index, uint8 offset, uint8 flag )
+        {
+            if(HasByteFlag(index, offset, flag))
+                RemoveByteFlag(index, offset, flag);
+            else
+                SetByteFlag(index, offset, flag);
+        }
+
+        bool HasByteFlag( uint16 index, uint8 offset, uint8 flag ) const
+        {
+            ASSERT( index &lt; m_valuesCount || PrintIndexError( index , false ) );
+            ASSERT( offset &lt; 4 );
+            return (((uint8*)&amp;m_uint32Values[index])[offset] &amp; flag) != 0;
+        }
+
         void ApplyModFlag( uint16 index, uint32 flag, bool apply)
         {
             if(apply) SetFlag(index,flag); else RemoveFlag(index,flag);
@@ -297,7 +315,7 @@ class MANGOS_DLL_SPEC Object
         {
             int32  *m_int32Values;
             uint32 *m_uint32Values;
-            float *m_floatValues;
+            float  *m_floatValues;
         };
 
         uint32 *m_uint32Values_mirror;</diff>
      <filename>src/game/Object.h</filename>
    </modified>
    <modified>
      <diff>@@ -45,7 +45,6 @@ INSTANTIATE_CLASS_MUTEX(ObjectAccessor, ZThread::FastMutex);
 
 namespace MaNGOS
 {
-
     struct MANGOS_DLL_DECL BuildUpdateForPlayer
     {
         Player &amp;i_player;
@@ -551,7 +550,7 @@ void ObjectAccessor::UpdateVisibilityForPlayer( Player* player )
 template &lt;class T&gt; UNORDERED_MAP&lt; uint64, T* &gt; HashMapHolder&lt;T&gt;::m_objectMap;
 template &lt;class T&gt; ZThread::FastMutex HashMapHolder&lt;T&gt;::i_lock;
 
-/// Global defintions for the hashmap storage
+/// Global definitions for the hashmap storage
 
 template class HashMapHolder&lt;Player&gt;;
 template class HashMapHolder&lt;Pet&gt;;</diff>
      <filename>src/game/ObjectAccessor.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -72,7 +72,7 @@ class HashMapHolder
         static LockType* GetLock() { return &amp;i_lock; }
     private:
 
-        //Non instanciable only static
+        //Non instanceable only static
         HashMapHolder() {}
 
         static LockType i_lock;</diff>
      <filename>src/game/ObjectAccessor.h</filename>
    </modified>
    <modified>
      <diff>@@ -50,7 +50,7 @@ ObjectGridRespawnMover::Visit(CreatureMapType &amp;m)
 {
     // creature in unloading grid can have respawn point in another grid
     // if it will be unloaded then it will not respawn in original grid until unload/load original grid
-    // move to respwn point to prevent this case. For player view in respawn grid this wll be normal respawn.
+    // move to respawn point to prevent this case. For player view in respawn grid this will be normal respawn.
     for(CreatureMapType::iterator iter=m.begin(), next; iter != m.end(); iter = next)
     {
         next = iter; ++next;</diff>
      <filename>src/game/ObjectGridLoader.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -841,6 +841,7 @@ class ObjectMgr
         int GetOrNewIndexForLocale(LocaleConstant loc);
 
         int DBCLocaleIndex;
+
     private:
         void LoadScripts(ScriptMapMap&amp; scripts, char const* tablename);
         void CheckScripts(ScriptMapMap const&amp; scripts,std::set&lt;int32&gt;&amp; ids);</diff>
      <filename>src/game/ObjectMgr.h</filename>
    </modified>
    <modified>
      <diff>@@ -138,7 +138,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
     /*0x06D*/ { &quot;CMSG_DEL_IGNORE&quot;,                  STATUS_LOGGEDIN, &amp;WorldSession::HandleDelIgnoreOpcode           },
     /*0x06E*/ { &quot;CMSG_GROUP_INVITE&quot;,                STATUS_LOGGEDIN, &amp;WorldSession::HandleGroupInviteOpcode         },
     /*0x06F*/ { &quot;SMSG_GROUP_INVITE&quot;,                STATUS_NEVER,    &amp;WorldSession::Handle_ServerSide               },
-    /*0x070*/ { &quot;CMSG_GROUP_CANCEL&quot;,                STATUS_LOGGEDIN, &amp;WorldSession::Handle_Depricated               },
+    /*0x070*/ { &quot;CMSG_GROUP_CANCEL&quot;,                STATUS_LOGGEDIN, &amp;WorldSession::Handle_Deprecated               },
     /*0x071*/ { &quot;SMSG_GROUP_CANCEL&quot;,                STATUS_NEVER,    &amp;WorldSession::Handle_ServerSide               },
     /*0x072*/ { &quot;CMSG_GROUP_ACCEPT&quot;,                STATUS_LOGGEDIN, &amp;WorldSession::HandleGroupAcceptOpcode         },
     /*0x073*/ { &quot;CMSG_GROUP_DECLINE&quot;,               STATUS_LOGGEDIN, &amp;WorldSession::HandleGroupDeclineOpcode        },</diff>
      <filename>src/game/Opcodes.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -170,7 +170,7 @@ bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool cu
     }
 
     Map *map = owner-&gt;GetMap();
-    uint32 guid=objmgr.GenerateLowGuid(HIGHGUID_PET);
+    uint32 guid = objmgr.GenerateLowGuid(HIGHGUID_PET);
     uint32 pet_number = fields[0].GetUInt32();
     if(!Create(guid, map, petentry, pet_number))
     {
@@ -179,7 +179,7 @@ bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool cu
     }
 
     float px, py, pz;
-    owner-&gt;GetClosePoint(px, py, pz,GetObjectSize(),PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
+    owner-&gt;GetClosePoint(px, py, pz, GetObjectSize(), PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
 
     Relocate(px, py, pz, owner-&gt;GetOrientation());
 
@@ -351,7 +351,7 @@ bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool cu
 
     if(owner-&gt;GetTypeId() == TYPEID_PLAYER &amp;&amp; getPetType() == HUNTER_PET)
     {
-        result = CharacterDatabase.PQuery(&quot;SELECT genitive, dative, accusative, instrumental, prepositional FROM character_pet_declinedname WHERE owner = '%u' AND id = '%u'&quot;,owner-&gt;GetGUIDLow(),GetCharmInfo()-&gt;GetPetNumber());
+        result = CharacterDatabase.PQuery(&quot;SELECT genitive, dative, accusative, instrumental, prepositional FROM character_pet_declinedname WHERE owner = '%u' AND id = '%u'&quot;, owner-&gt;GetGUIDLow(), GetCharmInfo()-&gt;GetPetNumber());
 
         if(result)
         {
@@ -950,14 +950,14 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
     }
     SetDisplayId(creature-&gt;GetDisplayId());
     SetNativeDisplayId(creature-&gt;GetNativeDisplayId());
-    SetMaxPower(POWER_HAPPINESS,GetCreatePowers(POWER_HAPPINESS));
-    SetPower(   POWER_HAPPINESS,166500);
+    SetMaxPower(POWER_HAPPINESS, GetCreatePowers(POWER_HAPPINESS));
+    SetPower(POWER_HAPPINESS, 166500);
     setPowerType(POWER_FOCUS);
-    SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP,0);
-    SetUInt32Value(UNIT_FIELD_PETEXPERIENCE,0);
+    SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
+    SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
     SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((MaNGOS::XP::xp_to_level(creature-&gt;getLevel()))/4));
     SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
-    SetUInt32Value(UNIT_NPC_FLAGS , 0);
+    SetUInt32Value(UNIT_NPC_FLAGS, 0);
 
     CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(creature-&gt;GetCreatureInfo()-&gt;family);
     if( char* familyname = cFamily-&gt;Name[sWorld.GetDefaultDbcLocale()] )
@@ -993,7 +993,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
 
     uint32 creature_ID = (getPetType() == HUNTER_PET) ? 1 : cinfo-&gt;Entry;
 
-    SetLevel( petlevel);
+    SetLevel(petlevel);
 
     SetMeleeDamageSchool(SpellSchools(cinfo-&gt;dmgschool));
 
@@ -1082,7 +1082,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
 
                 for(int stat = 0; stat &lt; MAX_STATS; ++stat)
                 {
-                    SetCreateStat(Stats(stat),float(pInfo-&gt;stats[stat]));
+                    SetCreateStat(Stats(stat), float(pInfo-&gt;stats[stat]));
                 }
             }
             else                                            // not exist in DB, use some default fake data
@@ -1093,11 +1093,11 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
                 SetCreateHealth(uint32(((float(cinfo-&gt;maxhealth) / cinfo-&gt;maxlevel) / (1 + 2 * cinfo-&gt;rank)) * petlevel) );
                 SetCreateMana(  uint32(((float(cinfo-&gt;maxmana)   / cinfo-&gt;maxlevel) / (1 + 2 * cinfo-&gt;rank)) * petlevel) );
 
-                SetCreateStat(STAT_STRENGTH,22);
-                SetCreateStat(STAT_AGILITY,22);
-                SetCreateStat(STAT_STAMINA,25);
-                SetCreateStat(STAT_INTELLECT,28);
-                SetCreateStat(STAT_SPIRIT,27);
+                SetCreateStat(STAT_STRENGTH, 22);
+                SetCreateStat(STAT_AGILITY, 22);
+                SetCreateStat(STAT_STAMINA, 25);
+                SetCreateStat(STAT_INTELLECT, 28);
+                SetCreateStat(STAT_SPIRIT, 27);
             }
             break;
         }
@@ -1132,34 +1132,35 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
                 // remove elite bonuses included in DB values
                 SetCreateHealth( uint32(((float(cinfo-&gt;maxhealth) / cinfo-&gt;maxlevel) / (1 + 2 * cinfo-&gt;rank)) * petlevel) );
 
-                SetCreateStat(STAT_STRENGTH,22);
-                SetCreateStat(STAT_AGILITY,22);
-                SetCreateStat(STAT_STAMINA,25);
-                SetCreateStat(STAT_INTELLECT,28);
-                SetCreateStat(STAT_SPIRIT,27);
+                SetCreateStat(STAT_STRENGTH, 22);
+                SetCreateStat(STAT_AGILITY, 22);
+                SetCreateStat(STAT_STAMINA, 25);
+                SetCreateStat(STAT_INTELLECT, 28);
+                SetCreateStat(STAT_SPIRIT, 27);
             }
             break;
         }
         case GUARDIAN_PET:
-            SetUInt32Value(UNIT_FIELD_PETEXPERIENCE,0);
-            SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP,1000);
+            SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
+            SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
 
-            SetCreateMana(   28 + 10*petlevel );
-            SetCreateHealth( 28 + 30*petlevel );
+            SetCreateMana(28 + 10*petlevel);
+            SetCreateHealth(28 + 30*petlevel);
 
             // FIXME: this is wrong formula, possible each guardian pet have own damage formula
             //these formula may not be correct; however, it is designed to be close to what it should be
             //this makes dps 0.5 of pets level
-            SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)) );
+            SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
             //damage range is then petlevel / 2
-            SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)) );
+            SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
             break;
         default:
-            sLog.outError(&quot;Pet have incorrect type (%u) for levelup.&quot;,getPetType());            break;
+            sLog.outError(&quot;Pet have incorrect type (%u) for levelup.&quot;, getPetType());
+            break;
     }
 
     for (int i = SPELL_SCHOOL_HOLY; i &lt; MAX_SPELL_SCHOOL; ++i)
-        SetModifierValue(UnitMods(UNIT_MOD_RESISTANCE_START + i), BASE_VALUE, float(createResistance[i]) );
+        SetModifierValue(UnitMods(UNIT_MOD_RESISTANCE_START + i), BASE_VALUE, float(createResistance[i]));
 
     UpdateAllStats();
 
@@ -1190,7 +1191,7 @@ bool Pet::HaveInDiet(ItemPrototype const* item) const
 uint32 Pet::GetCurrentFoodBenefitLevel(uint32 itemlevel)
 {
     // -5 or greater food level
-    if(getLevel() &lt;= itemlevel +5)                          //possible to feed level 60 pet with level 55 level food for full effect
+    if(getLevel() &lt;= itemlevel + 5)                         //possible to feed level 60 pet with level 55 level food for full effect
         return 35000;
     // -10..-6
     else if(getLevel() &lt;= itemlevel + 10)                   //pure guess, but sounds good
@@ -1240,7 +1241,7 @@ void Pet::_LoadSpellCooldowns()
 
             _AddCreatureSpellCooldown(spell_id,db_time);
 
-            sLog.outDebug(&quot;Pet (Number: %u) spell %u cooldown loaded (%u secs).&quot;,m_charmInfo-&gt;GetPetNumber(),spell_id,uint32(db_time-curTime));
+            sLog.outDebug(&quot;Pet (Number: %u) spell %u cooldown loaded (%u secs).&quot;, m_charmInfo-&gt;GetPetNumber(), spell_id, uint32(db_time-curTime));
         }
         while( result-&gt;NextRow() );
 
@@ -1387,7 +1388,7 @@ void Pet::_LoadAuras(uint32 timediff)
 
 void Pet::_SaveAuras()
 {
-    CharacterDatabase.PExecute(&quot;DELETE FROM pet_aura WHERE guid = '%u'&quot;,m_charmInfo-&gt;GetPetNumber());
+    CharacterDatabase.PExecute(&quot;DELETE FROM pet_aura WHERE guid = '%u'&quot;, m_charmInfo-&gt;GetPetNumber());
 
     AuraMap const&amp; auras = GetAuras();
     if (auras.empty())
@@ -1762,7 +1763,7 @@ void Pet::CastPetAuras(bool current)
     if(getPetType() != HUNTER_PET &amp;&amp; (getPetType() != SUMMON_PET || owner-&gt;getClass() != CLASS_WARLOCK))
         return;
 
-    for(PetAuraSet::iterator itr = owner-&gt;m_petAuras.begin(); itr != owner-&gt;m_petAuras.end(); )
+    for(PetAuraSet::iterator itr = owner-&gt;m_petAuras.begin(); itr != owner-&gt;m_petAuras.end();)
     {
         PetAura const* pa = *itr;
         ++itr;
@@ -1783,7 +1784,7 @@ void Pet::CastPetAura(PetAura const* aura)
     if(auraId == 35696)                                       // Demonic Knowledge
     {
         int32 basePoints = int32(aura-&gt;GetDamage() * (GetStat(STAT_STAMINA) + GetStat(STAT_INTELLECT)) / 100);
-        CastCustomSpell(this,auraId,&amp;basePoints, NULL, NULL, true );
+        CastCustomSpell(this, auraId, &amp;basePoints, NULL, NULL, true);
     }
     else
         CastSpell(this, auraId, true);</diff>
      <filename>src/game/Pet.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -78,6 +78,7 @@ struct PetSpell
 {
     uint16 slotId;
     uint16 active;
+
     PetSpellState state : 16;
     PetSpellType type   : 16;
 };
@@ -144,7 +145,7 @@ class Pet : public Creature
         bool isTemporarySummoned() const { return m_duration &gt; 0; }
 
         bool Create (uint32 guidlow, Map *map, uint32 Entry, uint32 pet_number);
-        bool CreateBaseAtCreature( Creature* creature );
+        bool CreateBaseAtCreature(Creature* creature);
         bool LoadPetFromDB( Unit* owner,uint32 petentry = 0,uint32 petnumber = 0, bool current = false );
         void SavePetToDB(PetSaveMode mode);
         void Remove(PetSaveMode mode, bool returnreagent = false);</diff>
      <filename>src/game/Pet.h</filename>
    </modified>
    <modified>
      <diff>@@ -34,7 +34,7 @@
 
 void WorldSession::HandlePetAction( WorldPacket &amp; recv_data )
 {
-    CHECK_PACKET_SIZE(recv_data,8+2+2+8);
+    CHECK_PACKET_SIZE(recv_data, 8+2+2+8);
 
     uint64 guid1;
     uint16 spellid;
@@ -46,8 +46,8 @@ void WorldSession::HandlePetAction( WorldPacket &amp; recv_data )
     recv_data &gt;&gt; guid2;                                     //tag guid
 
     // used also for charmed creature
-    Unit* pet= ObjectAccessor::GetUnit(*_player,guid1);
-    sLog.outDetail( &quot;HandlePetAction.Pet %u flag is %u, spellid is %u, target %u.\n&quot;, uint32(GUID_LOPART(guid1)), flag, spellid, uint32(GUID_LOPART(guid2)) );
+    Unit* pet= ObjectAccessor::GetUnit(*_player, guid1);
+    sLog.outDetail(&quot;HandlePetAction.Pet %u flag is %u, spellid is %u, target %u.\n&quot;, uint32(GUID_LOPART(guid1)), flag, spellid, uint32(GUID_LOPART(guid2)) );
     if(!pet)
     {
         sLog.outError( &quot;Pet %u not exist.\n&quot;, uint32(GUID_LOPART(guid1)) );
@@ -56,7 +56,7 @@ void WorldSession::HandlePetAction( WorldPacket &amp; recv_data )
 
     if(pet != GetPlayer()-&gt;GetPet() &amp;&amp; pet != GetPlayer()-&gt;GetCharm())
     {
-        sLog.outError( &quot;HandlePetAction.Pet %u isn't pet of player %s .\n&quot;, uint32(GUID_LOPART(guid1)),GetPlayer()-&gt;GetName() );
+        sLog.outError(&quot;HandlePetAction.Pet %u isn't pet of player %s.\n&quot;, uint32(GUID_LOPART(guid1)), GetPlayer()-&gt;GetName() );
         return;
     }
 
@@ -310,7 +310,7 @@ void WorldSession::SendPetNameQuery( uint64 petguid, uint32 petnumber)
 
 void WorldSession::HandlePetSetAction( WorldPacket &amp; recv_data )
 {
-    CHECK_PACKET_SIZE(recv_data,8+4+2+2);
+    CHECK_PACKET_SIZE(recv_data, 8+4+2+2);
 
     sLog.outDetail( &quot;HandlePetSetAction. CMSG_PET_SET_ACTION\n&quot; );
 </diff>
      <filename>src/game/PetHandler.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -173,7 +173,7 @@ void PlayerTaxi::AppendTaximaskTo( ByteBuffer&amp; data, bool all )
     if(all)
     {
         for (uint8 i=0; i&lt;TaxiMaskSize; i++)
-            data &lt;&lt; sTaxiNodesMask[i];                      // all existed nodes
+            data &lt;&lt; uint32(sTaxiNodesMask[i]);              // all existed nodes
     }
     else
     {
@@ -494,13 +494,6 @@ bool Player::Create( uint32 guidlow, std::string name, uint8 race, uint8 class_,
     for (int i = 0; i &lt; PLAYER_SLOTS_COUNT; i++)
         m_items[i] = NULL;
 
-    //for(int j = BUYBACK_SLOT_START; j &lt; BUYBACK_SLOT_END; j++)
-    //{
-    //    SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1+j*2,0);
-    //    SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1+j,0);
-    //    SetUInt32Value(PLAYER_FIELD_BUYBACK_TIMESTAMP_1+j,0);
-    //}
-
     m_race = race;
     m_class = class_;
 
@@ -796,9 +789,8 @@ void Player::EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 da
     data &lt;&lt; (uint32)damage;
     data &lt;&lt; (uint32)0;
     data &lt;&lt; (uint32)0;
-    //m_session-&gt;SendPacket(&amp;data);
-    //Let other players see that you get damage
     SendMessageToSet(&amp;data, true);
+
     DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
 
     if(type==DAMAGE_FALL &amp;&amp; !isAlive())                     // DealDamage not apply item durability loss at self damage
@@ -844,7 +836,7 @@ void Player::HandleDrowning()
             m_isunderwater|= 0x04;
             StartMirrorTimer(BREATH_TIMER, UnderWaterTime);
         }
-        //continius trigger drowning &quot;Damage&quot;
+        //continuous trigger drowning &quot;Damage&quot;
         if ((m_breathTimer == 0) &amp;&amp; (m_isunderwater &amp; 0x01))
         {
             //TODO: Check this formula
@@ -966,7 +958,7 @@ void Player::SetDrunkValue(uint16 newDrunkenValue, uint32 itemId)
         return;
 
     WorldPacket data(SMSG_CROSSED_INEBRIATION_THRESHOLD, (8+4+4));
-    data &lt;&lt; GetGUID();
+    data &lt;&lt; uint64(GetGUID());
     data &lt;&lt; uint32(newDrunkenState);
     data &lt;&lt; uint32(itemId);
 
@@ -1339,7 +1331,7 @@ void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
     *p_data &lt;&lt; uint8(getLevel());                           // player level
     // do not use GetMap! it will spawn a new instance since the bound instances are not loaded
     uint32 zoneId = MapManager::Instance().GetZoneId(GetMapId(), GetPositionX(),GetPositionY());
-
+    sLog.outDebug(&quot;Player::BuildEnumData: m:%u, x:%f, y:%f, z:%f zone:%u&quot;, GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), zoneId);
     *p_data &lt;&lt; zoneId;
     *p_data &lt;&lt; GetMapId();
 
@@ -2380,7 +2372,6 @@ void Player::SendInitialSpells()
             continue;
 
         data &lt;&lt; uint16(itr-&gt;first);
-        //data &lt;&lt; uint16(itr-&gt;second-&gt;slotId);
         data &lt;&lt; uint16(0);                                  // it's not slot id
 
         spellCount +=1;
@@ -2407,13 +2398,13 @@ void Player::SendInitialSpells()
         data &lt;&lt; uint16(sEntry-&gt;Category);                   // spell category
         if(sEntry-&gt;Category)                                // may be wrong, but anyway better than nothing...
         {
-            data &lt;&lt; uint32(0);
-            data &lt;&lt; uint32(cooldown);
+            data &lt;&lt; uint32(0);                              // cooldown
+            data &lt;&lt; uint32(cooldown);                       // category cooldown
         }
         else
         {
-            data &lt;&lt; uint32(cooldown);
-            data &lt;&lt; uint32(0);
+            data &lt;&lt; uint32(cooldown);                       // cooldown
+            data &lt;&lt; uint32(0);                              // category cooldown
         }
     }
 
@@ -3399,7 +3390,6 @@ void Player::DestroyForPlayer( Player *target ) const
 
     if(target == this)
     {
-
         for(int i = INVENTORY_SLOT_BAG_START; i &lt; BANK_SLOT_BAG_END; i++)
         {
             if(m_items[i] == NULL)
@@ -6453,23 +6443,23 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply)
                 break;
             case ITEM_MOD_AGILITY:                          // modify agility
                 HandleStatModifier(UNIT_MOD_STAT_AGILITY, BASE_VALUE, float(val), apply);
-                ApplyStatBuffMod(STAT_AGILITY, val, apply);
+                ApplyStatBuffMod(STAT_AGILITY, float(val), apply);
                 break;
             case ITEM_MOD_STRENGTH:                         //modify strength
                 HandleStatModifier(UNIT_MOD_STAT_STRENGTH, BASE_VALUE, float(val), apply);
-                ApplyStatBuffMod(STAT_STRENGTH, val, apply);
+                ApplyStatBuffMod(STAT_STRENGTH, float(val), apply);
                 break;
             case ITEM_MOD_INTELLECT:                        //modify intellect
                 HandleStatModifier(UNIT_MOD_STAT_INTELLECT, BASE_VALUE, float(val), apply);
-                ApplyStatBuffMod(STAT_INTELLECT, val, apply);
+                ApplyStatBuffMod(STAT_INTELLECT, float(val), apply);
                 break;
             case ITEM_MOD_SPIRIT:                           //modify spirit
                 HandleStatModifier(UNIT_MOD_STAT_SPIRIT, BASE_VALUE, float(val), apply);
-                ApplyStatBuffMod(STAT_SPIRIT, val, apply);
+                ApplyStatBuffMod(STAT_SPIRIT, float(val), apply);
                 break;
             case ITEM_MOD_STAMINA:                          //modify stamina
                 HandleStatModifier(UNIT_MOD_STAT_STAMINA, BASE_VALUE, float(val), apply);
-                ApplyStatBuffMod(STAT_STAMINA, val, apply);
+                ApplyStatBuffMod(STAT_STAMINA, float(val), apply);
                 break;
             case ITEM_MOD_DEFENSE_SKILL_RATING:
                 ApplyRatingMod(CR_DEFENSE_SKILL, int32(val), apply);
@@ -8847,7 +8837,7 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &amp;dest, uint3
             }
             else                                            // equipped bag
             {
-                // we need check 2 time (specilized/non_specialized), use NULL_BAG to prevent skipping bag
+                // we need check 2 time (specialized/non_specialized), use NULL_BAG to prevent skipping bag
                 res = _CanStoreItem_InBag(bag,dest,pProto,count,true,false,pItem,NULL_BAG,slot);
                 if(res!=EQUIP_ERR_OK)
                     res = _CanStoreItem_InBag(bag,dest,pProto,count,true,true,pItem,NULL_BAG,slot);
@@ -10305,7 +10295,6 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
 
         if( bag == INVENTORY_SLOT_BAG_0 )
         {
-
             SetUInt64Value((uint16)(PLAYER_FIELD_INV_SLOT_HEAD + (slot*2)), 0);
 
             // equipment and equipped bags can have applied bonuses
@@ -12136,7 +12125,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
     if(pQuest-&gt;GetCharTitleId())
     {
         if(CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(pQuest-&gt;GetCharTitleId()))
-            SetFlag64(PLAYER__FIELD_KNOWN_TITLES, (uint64(1) &lt;&lt; titleEntry-&gt;bit_index));
+            SetTitle(titleEntry);
     }
 
     // Send reward mail
@@ -13153,7 +13142,7 @@ void Player::SendQuestComplete( uint32 quest_id )
     if( quest_id )
     {
         WorldPacket data( SMSG_QUESTUPDATE_COMPLETE, 4 );
-        data &lt;&lt; quest_id;
+        data &lt;&lt; uint32(quest_id);
         GetSession()-&gt;SendPacket( &amp;data );
         sLog.outDebug( &quot;WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u&quot;, quest_id );
     }
@@ -13673,14 +13662,14 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
     SetUInt32Value(UNIT_CHANNEL_SPELL,0);
 
     // clear charm/summon related fields
-    SetUInt64Value(UNIT_FIELD_CHARM,0);
-    SetUInt64Value(UNIT_FIELD_SUMMON,0);
-    SetUInt64Value(UNIT_FIELD_CHARMEDBY,0);
-    SetUInt64Value(UNIT_FIELD_SUMMONEDBY,0);
-    SetUInt64Value(UNIT_FIELD_CREATEDBY,0);
+    SetCharm(NULL);
+    SetPet(NULL);
+    SetCharmerGUID(NULL);
+    SetOwnerGUID(NULL);
+    SetCreatorGUID(NULL);
 
     // reset some aura modifiers before aura apply
-    SetUInt64Value(PLAYER_FARSIGHT, 0);
+    SetFarSight(NULL);
     SetUInt32Value(PLAYER_TRACK_CREATURES, 0 );
     SetUInt32Value(PLAYER_TRACK_RESOURCES, 0 );
 
@@ -13765,7 +13754,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
     // note: PLAYER__FIELD_KNOWN_TITLES updated at quest status loaded
     if(uint32 curTitle = GetUInt32Value(PLAYER_CHOSEN_TITLE))
     {
-        if(!HasFlag64(PLAYER__FIELD_KNOWN_TITLES,uint64(1) &lt;&lt; curTitle))
+        if(!HasTitle(curTitle))
             SetUInt32Value(PLAYER_CHOSEN_TITLE,0);
     }
 
@@ -14380,7 +14369,7 @@ void Player::_LoadQuestStatus(QueryResult *result)
                     if(pQuest-&gt;GetCharTitleId())
                     {
                         if(CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(pQuest-&gt;GetCharTitleId()))
-                            SetFlag64(PLAYER__FIELD_KNOWN_TITLES, (uint64(1) &lt;&lt; titleEntry-&gt;bit_index));
+                            SetTitle(titleEntry);
                     }
                 }
 
@@ -15673,8 +15662,8 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
             m_guardianPets.erase(pet-&gt;GetGUID());
             break;
         default:
-            if(GetPetGUID()==pet-&gt;GetGUID())
-                SetPet(0);
+            if(GetPetGUID() == pet-&gt;GetGUID())
+                SetPet(NULL);
             break;
     }
 
@@ -18249,7 +18238,7 @@ Player* Player::GetNextRandomRaidMember(float radius)
 void Player::UpdateUnderwaterState( Map* m, float x, float y, float z )
 {
     float water_z  = m-&gt;GetWaterLevel(x,y);
-    float height_z = m-&gt;GetHeight(x,y,z, false);        // use .map base surface height
+    float height_z = m-&gt;GetHeight(x,y,z, false);            // use .map base surface height
     uint8 flag1    = m-&gt;GetTerrainType(x,y);
 
     //!Underwater check, not in water if underground or above water level
@@ -18292,11 +18281,28 @@ bool ItemPosCount::isContainedIn(ItemPosCountVec const&amp; vec) const
 
 bool Player::isAllowUseBattleGroundObject()
 {
-    return ( //InBattleGround() &amp;&amp;                            // in battleground - not need, check in other cases
-             !IsMounted() &amp;&amp;                                  // not mounted
-             !HasStealthAura() &amp;&amp;                             // not stealthed
-             !HasInvisibilityAura() &amp;&amp;                        // not invisible
-             !HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) &amp;&amp;      // can't pickup
-             isAlive()                                        // live player
+    return ( //InBattleGround() &amp;&amp;                          // in battleground - not need, check in other cases
+             !IsMounted() &amp;&amp;                                // not mounted
+             !HasStealthAura() &amp;&amp;                           // not stealthed
+             !HasInvisibilityAura() &amp;&amp;                      // not invisible
+             !HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) &amp;&amp;    // can't pickup
+             isAlive()                                      // live player
            );
 }
+
+bool Player::HasTitle(uint32 bitIndex)
+{
+    if (bitIndex &gt; 128)
+        return false;
+
+    uint32 fieldIndexOffset = bitIndex/32;
+    uint32 flag = 1 &lt;&lt; (bitIndex%32);
+    return HasFlag(PLAYER__FIELD_KNOWN_TITLES+fieldIndexOffset, flag);
+}
+
+void Player::SetTitle(CharTitlesEntry const* title)
+{
+    uint32 fieldIndexOffset = title-&gt;bit_index/32;
+    uint32 flag = 1 &lt;&lt; (title-&gt;bit_index%32);
+    SetFlag(PLAYER__FIELD_KNOWN_TITLES+fieldIndexOffset, flag);
+}</diff>
      <filename>src/game/Player.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -516,10 +516,10 @@ typedef std::map&lt;uint32, QuestStatusData&gt; QuestStatusMap;
 
 enum QuestSlotOffsets
 {
-    QUEST_ID_OFFSET = 0,
-    QUEST_STATE_OFFSET = 1,
+    QUEST_ID_OFFSET     = 0,
+    QUEST_STATE_OFFSET  = 1,
     QUEST_COUNTS_OFFSET = 2,
-    QUEST_TIME_OFFSET = 3
+    QUEST_TIME_OFFSET   = 3
 };
 
 #define MAX_QUEST_OFFSET 4
@@ -1683,6 +1683,7 @@ class MANGOS_DLL_SPEC Player : public Unit
 
         FactionStateList m_factions;
         ForcedReactions m_forcedReactions;
+        FactionStateList const&amp; GetFactionStateList() { return m_factions; }
         uint32 GetDefaultReputationFlags(const FactionEntry *factionEntry) const;
         int32 GetBaseReputation(const FactionEntry *factionEntry) const;
         int32 GetReputation(uint32 faction_id) const;
@@ -1919,6 +1920,9 @@ class MANGOS_DLL_SPEC Player : public Unit
 
         void SetClientControl(Unit* target, uint8 allowMove);
 
+        uint64 GetFarSight() const { return GetUInt64Value(PLAYER_FARSIGHT); }
+        void SetFarSight(uint64 guid) { SetUInt64Value(PLAYER_FARSIGHT, guid); }
+
         // Transports
         Transport * GetTransport() const { return m_transport; }
         void SetTransport(Transport * t) { m_transport = t; }
@@ -2024,6 +2028,9 @@ class MANGOS_DLL_SPEC Player : public Unit
         WorldLocation&amp; GetTeleportDest() { return m_teleport_dest; }
 
         DeclinedName const* GetDeclinedNames() const { return m_declinedname; }
+        bool HasTitle(uint32 bitIndex);
+        bool HasTitle(CharTitlesEntry const* title) { return HasTitle(title-&gt;bit_index); }
+        void SetTitle(CharTitlesEntry const* title);
 
     protected:
 </diff>
      <filename>src/game/Player.h</filename>
    </modified>
    <modified>
      <diff>@@ -112,24 +112,24 @@ enum __QuestGiverStatus
 
 enum __QuestFlags
 {
-    // Flags used at server and sended to client
-    QUEST_FLAGS_STAY_ALIVE     = 1,                         // Not used currently
-    QUEST_FLAGS_PARTY_ACCEPT   = 2,                         // Not used currently. If player in party, all players that can accept this quest will receive confirmation box to accept quest CMSG_QUEST_CONFIRM_ACCEPT/SMSG_QUEST_CONFIRM_ACCEPT
-    QUEST_FLAGS_EXPLORATION    = 4,                         // Not used currently
-    QUEST_FLAGS_SHARABLE       = 8,                         // Can be shared: Player::CanShareQuest()
-    //QUEST_FLAGS_NONE2        = 16,                        // Not used currently
-    QUEST_FLAGS_EPIC           = 32,                        // Not used currently: Unsure of content
-    QUEST_FLAGS_RAID           = 64,                        // Not used currently
-    QUEST_FLAGS_TBC            = 128,                       // Not used currently: Available if TBC expension enabled only
-    QUEST_FLAGS_UNK2           = 256,                       // Not used currently: _DELIVER_MORE Quest needs more than normal _q-item_ drops from mobs
-    QUEST_FLAGS_HIDDEN_REWARDS = 512,                       // Items and money rewarded only sent in SMSG_QUESTGIVER_OFFER_REWARD (not in SMSG_QUESTGIVER_QUEST_DETAILS or in client quest log(SMSG_QUEST_QUERY_RESPONSE))
-    QUEST_FLAGS_AUTO_REWARDED  = 1024,                      // These quests are automatically rewarded on quest complete and they will never appear in quest log client side.
-    QUEST_FLAGS_TBC_RACES      = 2048,                      // Not used currently: Bloodelf/draenei starting zone quests
-    QUEST_FLAGS_DAILY          = 4096,                      // Used to know quest is Daily one
+    // Flags used at server and sent to client
+    QUEST_FLAGS_STAY_ALIVE     = 0x00000001,                // Not used currently
+    QUEST_FLAGS_PARTY_ACCEPT   = 0x00000002,                // Not used currently. If player in party, all players that can accept this quest will receive confirmation box to accept quest CMSG_QUEST_CONFIRM_ACCEPT/SMSG_QUEST_CONFIRM_ACCEPT
+    QUEST_FLAGS_EXPLORATION    = 0x00000004,                // Not used currently
+    QUEST_FLAGS_SHARABLE       = 0x00000008,                // Can be shared: Player::CanShareQuest()
+    //QUEST_FLAGS_NONE2        = 0x00000010,                // Not used currently
+    QUEST_FLAGS_EPIC           = 0x00000020,                // Not used currently: Unsure of content
+    QUEST_FLAGS_RAID           = 0x00000040,                // Not used currently
+    QUEST_FLAGS_TBC            = 0x00000080,                // Not used currently: Available if TBC expension enabled only
+    QUEST_FLAGS_UNK2           = 0x00000100,                // Not used currently: _DELIVER_MORE Quest needs more than normal _q-item_ drops from mobs
+    QUEST_FLAGS_HIDDEN_REWARDS = 0x00000200,                // Items and money rewarded only sent in SMSG_QUESTGIVER_OFFER_REWARD (not in SMSG_QUESTGIVER_QUEST_DETAILS or in client quest log(SMSG_QUEST_QUERY_RESPONSE))
+    QUEST_FLAGS_AUTO_REWARDED  = 0x00000400,                // These quests are automatically rewarded on quest complete and they will never appear in quest log client side.
+    QUEST_FLAGS_TBC_RACES      = 0x00000800,                // Not used currently: Blood elf/Draenei starting zone quests
+    QUEST_FLAGS_DAILY          = 0x00001000,                // Used to know quest is Daily one
 
     // Mangos flags for set SpecialFlags in DB if required but used only at server
     QUEST_MANGOS_FLAGS_REPEATABLE           = 0x010000,     // Set by 1 in SpecialFlags from DB
-    QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT = 0x020000,     // Set by 2 in SpecialFlags from DB (if reequired area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script DLL)
+    QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT = 0x020000,     // Set by 2 in SpecialFlags from DB (if required area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script DLL)
     QUEST_MANGOS_FLAGS_DB_ALLOWED = 0xFFFF | QUEST_MANGOS_FLAGS_REPEATABLE | QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT,
 
     // Mangos flags for internal use only
@@ -318,7 +318,7 @@ struct QuestStatusData
         : m_status(QUEST_STATUS_NONE),m_rewarded(false),
         m_explored(false), m_timer(0), uState(QUEST_NEW)
     {
-        memset(m_itemcount,    0, QUEST_OBJECTIVES_COUNT * sizeof(uint32));
+        memset(m_itemcount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint32));
         memset(m_creatureOrGOcount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint32));
     }
 </diff>
      <filename>src/game/QuestDef.h</filename>
    </modified>
    <modified>
      <diff>@@ -553,7 +553,6 @@ enum SpellEffects
     SPELL_EFFECT_TRADE_SKILL               = 47,
     SPELL_EFFECT_STEALTH                   = 48,
     SPELL_EFFECT_DETECT                    = 49,
-    //    SPELL_EFFECT_SUMMON_OBJECT             = 50,
     SPELL_EFFECT_TRANS_DOOR                = 50,
     SPELL_EFFECT_FORCE_CRITICAL_HIT        = 51,
     SPELL_EFFECT_GUARANTEE_HIT             = 52,
@@ -766,7 +765,7 @@ enum SpellImmunity
     IMMUNITY_MECHANIC              = 5                      // enum Mechanics
 };
 
-#define MAX_SPELL_IMMUNITY         6
+#define MAX_SPELL_IMMUNITY           6
 
 enum Targets
 {
@@ -831,7 +830,7 @@ enum SpellMissInfo
     SPELL_MISS_IMMUNE2                 = 8,
     SPELL_MISS_DEFLECT                 = 9,
     SPELL_MISS_ABSORB                  = 10,
-    SPELL_MISS_REFLECT                 = 11,
+    SPELL_MISS_REFLECT                 = 11
 };
 
 enum SpellHitType
@@ -903,13 +902,13 @@ enum GameobjectTypes
 
 enum GameObjectFlags
 {
-    GO_FLAG_IN_USE          = 0x01,                         //disables interaction while animated
-    GO_FLAG_LOCKED          = 0x02,                         //require key, spell, event, etc to be opened. Makes &quot;Locked&quot; appear in tooltip
-    GO_FLAG_INTERACT_COND   = 0x04,                         //cannot interact (condition to interact)
-    GO_FLAG_TRANSPORT       = 0x08,                         //any kind of transport? Object can transport (elevator, boat, car)
-    GO_FLAG_UNK1            = 0x10,                         //
-    GO_FLAG_NODESPAWN       = 0x20,                         //never despawn, typically for doors, they just change state
-    GO_FLAG_TRIGGERED       = 0x40,                         //typically, summoned objects. Triggered by spell or other events
+    GO_FLAG_IN_USE          = 0x00000001,                   //disables interaction while animated
+    GO_FLAG_LOCKED          = 0x00000002,                   //require key, spell, event, etc to be opened. Makes &quot;Locked&quot; appear in tooltip
+    GO_FLAG_INTERACT_COND   = 0x00000004,                   //cannot interact (condition to interact)
+    GO_FLAG_TRANSPORT       = 0x00000008,                   //any kind of transport? Object can transport (elevator, boat, car)
+    GO_FLAG_UNK1            = 0x00000010,                   //
+    GO_FLAG_NODESPAWN       = 0x00000020,                   //never despawn, typically for doors, they just change state
+    GO_FLAG_TRIGGERED       = 0x00000040                    //typically, summoned objects. Triggered by spell or other events
 };
 
 enum TextEmotes
@@ -1503,7 +1502,7 @@ enum CreatureFamily
     CREATURE_FAMILY_SPIDER         = 3,
     CREATURE_FAMILY_BEAR           = 4,
     CREATURE_FAMILY_BOAR           = 5,
-    CREATURE_FAMILY_CROCILISK      = 6,
+    CREATURE_FAMILY_CROCOLISK      = 6,
     CREATURE_FAMILY_CARRION_BIRD   = 7,
     CREATURE_FAMILY_CRAB           = 8,
     CREATURE_FAMILY_GORILLA        = 9,
@@ -1533,9 +1532,9 @@ enum CreatureFamily
 
 enum CreatureTypeFlags
 {
-    CREATURE_TYPEFLAGS_TAMEBLE    = 0x0001,
+    CREATURE_TYPEFLAGS_TAMEABLE   = 0x0001,
     CREATURE_TYPEFLAGS_HERBLOOT   = 0x0100,
-    CREATURE_TYPEFLAGS_MININGLOOT = 0x0200,
+    CREATURE_TYPEFLAGS_MININGLOOT = 0x0200
 };
 
 enum CreatureEliteType</diff>
      <filename>src/game/SharedDefines.h</filename>
    </modified>
    <modified>
      <diff>@@ -270,6 +270,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
     m_triggeringContainer = triggeringContainer;
     m_referencedFromCurrentSpell = false;
     m_executedCurrently = false;
+    m_delayStart = 0;
     m_delayAtDamageCount = 0;
 
     m_applyMultiplierMask = 0;
@@ -2624,17 +2625,13 @@ void Spell::SendSpellStart()
     if(!IsNeedSendToClient())
         return;
 
-    sLog.outDebug(&quot;Sending SMSG_SPELL_START id=%u&quot;,m_spellInfo-&gt;Id);
+    sLog.outDebug(&quot;Sending SMSG_SPELL_START id=%u&quot;, m_spellInfo-&gt;Id);
 
-    uint16 castFlags = CAST_FLAG_UNKNOWN1;
+    uint32 castFlags = CAST_FLAG_UNKNOWN1;
     if(IsRangedSpell())
         castFlags |= CAST_FLAG_AMMO;
 
-    Unit * target;
-    if(!m_targets.getUnitTarget())
-        target = m_caster;
-    else
-        target = m_targets.getUnitTarget();
+    Unit *target = m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster;
 
     WorldPacket data(SMSG_SPELL_START, (8+8+4+4+2));
     if(m_CastItem)
@@ -2662,17 +2659,13 @@ void Spell::SendSpellGo()
     if(!IsNeedSendToClient())
         return;
 
-    sLog.outDebug(&quot;Sending SMSG_SPELL_GO id=%u&quot;,m_spellInfo-&gt;Id);
+    sLog.outDebug(&quot;Sending SMSG_SPELL_GO id=%u&quot;, m_spellInfo-&gt;Id);
 
-    Unit * target;
-    if(!m_targets.getUnitTarget())
-        target = m_caster;
-    else
-        target = m_targets.getUnitTarget();
+    Unit *target = m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster;
 
-    uint16 castFlags = CAST_FLAG_UNKNOWN3;
+    uint32 castFlags = CAST_FLAG_UNKNOWN3;
     if(IsRangedSpell())
-        castFlags |= CAST_FLAG_AMMO;
+        castFlags |= CAST_FLAG_AMMO;                        // arrows/bullets visual
 
     WorldPacket data(SMSG_SPELL_GO, 50);                    // guess size
     if(m_CastItem)
@@ -2773,7 +2766,7 @@ void Spell::SendLogExecute()
     data &lt;&lt; uint32(count1);                                 // count1 (effect count?)
     for(uint32 i = 0; i &lt; count1; ++i)
     {
-        data &lt;&lt; uint32(m_spellInfo-&gt;Effect[0]);             // spell effect?
+        data &lt;&lt; uint32(m_spellInfo-&gt;Effect[0]);             // spell effect
         uint32 count2 = 1;
         data &lt;&lt; uint32(count2);                             // count2 (target count?)
         for(uint32 j = 0; j &lt; count2; ++j)
@@ -2897,7 +2890,7 @@ void Spell::SendChannelUpdate(uint32 time)
 
     WorldPacket data( MSG_CHANNEL_UPDATE, 8+4 );
     data.append(m_caster-&gt;GetPackGUID());
-    data &lt;&lt; time;
+    data &lt;&lt; uint32(time);
 
     ((Player*)m_caster)-&gt;GetSession()-&gt;SendPacket( &amp;data );
 }
@@ -2934,8 +2927,8 @@ void Spell::SendChannelStart(uint32 duration)
     {
         WorldPacket data( MSG_CHANNEL_START, (8+4+4) );
         data.append(m_caster-&gt;GetPackGUID());
-        data &lt;&lt; m_spellInfo-&gt;Id;
-        data &lt;&lt; duration;
+        data &lt;&lt; uint32(m_spellInfo-&gt;Id);
+        data &lt;&lt; uint32(duration);
 
         ((Player*)m_caster)-&gt;GetSession()-&gt;SendPacket( &amp;data );
     }
@@ -2961,8 +2954,8 @@ void Spell::SendPlaySpellVisual(uint32 SpellID)
         return;
 
     WorldPacket data(SMSG_PLAY_SPELL_VISUAL, 12);
-    data &lt;&lt; m_caster-&gt;GetGUID();
-    data &lt;&lt; SpellID;
+    data &lt;&lt; uint64(m_caster-&gt;GetGUID());
+    data &lt;&lt; uint32(SpellID);                                // spell visual id?
     ((Player*)m_caster)-&gt;GetSession()-&gt;SendPacket(&amp;data);
 }
 
@@ -3963,7 +3956,9 @@ uint8 Spell::CanCast(bool strict)
 
                 if(int32(m_targets.getUnitTarget()-&gt;getLevel()) &gt; CalculateDamage(i,m_targets.getUnitTarget()))
                     return SPELL_FAILED_HIGHLEVEL;
-            };break;
+
+                break;
+            }
             case SPELL_AURA_MOUNTED:
             {
                 if (m_caster-&gt;IsInWater())
@@ -3996,7 +3991,9 @@ uint8 Spell::CanCast(bool strict)
                 // can be casted at non-friendly unit or own pet/charm
                 if(m_caster-&gt;IsFriendlyTo(m_targets.getUnitTarget()))
                     return SPELL_FAILED_TARGET_FRIENDLY;
-            };break;
+
+                break;
+            }
             case SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED:
             case SPELL_AURA_FLY:
             {
@@ -4007,7 +4004,9 @@ uint8 Spell::CanCast(bool strict)
                         GetVirtualMapForMapAndZone(m_caster-&gt;GetMapId(),m_caster-&gt;GetZoneId()) != 530)
                         return SPELL_FAILED_NOT_HERE;
                 }
-            };break;
+
+                break;
+            }
             case SPELL_AURA_PERIODIC_MANA_LEECH:
             {
                 if (!m_targets.getUnitTarget())
@@ -4018,9 +4017,11 @@ uint8 Spell::CanCast(bool strict)
 
                 if(m_targets.getUnitTarget()-&gt;getPowerType()!=POWER_MANA)
                     return SPELL_FAILED_BAD_TARGETS;
+
                 break;
             }
-            default:break;
+            default:
+                break;
         }
     }
 
@@ -4143,7 +4144,7 @@ uint8 Spell::CheckCasterAuras() const
     else if(m_caster-&gt;HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED) &amp;&amp; m_spellInfo-&gt;PreventionType==SPELL_PREVENTION_TYPE_PACIFY)
         prevented_reason = SPELL_FAILED_PACIFIED;
 
-    // Attr must make flag drop spell totally immuned from all effects
+    // Attr must make flag drop spell totally immune from all effects
     if(prevented_reason)
     {
         if(school_immune || mechanic_immune || dispel_immune)</diff>
      <filename>src/game/Spell.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -1975,7 +1975,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
             ( GetSpellProto()-&gt;EffectApplyAuraName[0]==1 || GetSpellProto()-&gt;EffectApplyAuraName[0]==128 ) ) )
         {
             // spells with SpellEffect=72 and aura=4: 6196, 6197, 21171, 21425
-            m_target-&gt;SetUInt64Value(PLAYER_FARSIGHT, 0);
+            ((Player*)m_target)-&gt;SetFarSight(NULL);
             WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0);
             ((Player*)m_target)-&gt;GetSession()-&gt;SendPacket(&amp;data);
             return;
@@ -2844,7 +2844,7 @@ void Aura::HandleBindSight(bool apply, bool Real)
     if(!caster || caster-&gt;GetTypeId() != TYPEID_PLAYER)
         return;
 
-    caster-&gt;SetUInt64Value(PLAYER_FARSIGHT,apply ? m_target-&gt;GetGUID() : 0);
+    ((Player*)caster)-&gt;SetFarSight(apply ? m_target-&gt;GetGUID() : NULL);
 }
 
 void Aura::HandleFarSight(bool apply, bool Real)
@@ -2853,7 +2853,7 @@ void Aura::HandleFarSight(bool apply, bool Real)
     if(!caster || caster-&gt;GetTypeId() != TYPEID_PLAYER)
         return;
 
-    caster-&gt;SetUInt64Value(PLAYER_FARSIGHT,apply ? m_modifier.m_miscvalue : 0);
+    ((Player*)caster)-&gt;SetFarSight(apply ? m_target-&gt;GetGUID() : NULL);
 }
 
 void Aura::HandleAuraTrackCreatures(bool apply, bool Real)
@@ -2959,7 +2959,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
         }
     }
     if(caster-&gt;GetTypeId() == TYPEID_PLAYER)
-        caster-&gt;SetUInt64Value(PLAYER_FARSIGHT,apply ? m_target-&gt;GetGUID() : 0);
+        ((Player*)caster)-&gt;SetFarSight(apply ? m_target-&gt;GetGUID() : NULL);
 }
 
 void Aura::HandleModPossessPet(bool apply, bool Real)
@@ -3661,7 +3661,7 @@ void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real)
             m_target-&gt;SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
     }
 
-    m_target-&gt;UpdateSpeed(MOVE_FLY, true);
+    m_target-&gt;UpdateSpeed(MOVE_FLIGHT, true);
 }
 
 void Aura::HandleAuraModIncreaseSwimSpeed(bool /*apply*/, bool Real)
@@ -3681,7 +3681,7 @@ void Aura::HandleAuraModDecreaseSpeed(bool /*apply*/, bool Real)
 
     m_target-&gt;UpdateSpeed(MOVE_RUN, true);
     m_target-&gt;UpdateSpeed(MOVE_SWIM, true);
-    m_target-&gt;UpdateSpeed(MOVE_FLY, true);
+    m_target-&gt;UpdateSpeed(MOVE_FLIGHT, true);
 }
 
 void Aura::HandleAuraModUseNormalSpeed(bool /*apply*/, bool Real)
@@ -3692,7 +3692,7 @@ void Aura::HandleAuraModUseNormalSpeed(bool /*apply*/, bool Real)
 
     m_target-&gt;UpdateSpeed(MOVE_RUN,  true);
     m_target-&gt;UpdateSpeed(MOVE_SWIM, true);
-    m_target-&gt;UpdateSpeed(MOVE_FLY,  true);
+    m_target-&gt;UpdateSpeed(MOVE_FLIGHT,  true);
 }
 
 /*********************************************************/
@@ -4681,21 +4681,24 @@ void Aura::HandleAuraModIncreaseEnergy(bool apply, bool Real)
     if(int32(powerType) != m_modifier.m_miscvalue)
         return;
 
-    m_target-&gt;HandleStatModifier(UnitMods(UNIT_MOD_POWER_START + powerType), TOTAL_VALUE, float(m_modifier.m_amount), apply);
+    UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
+
+    m_target-&gt;HandleStatModifier(unitMod, TOTAL_VALUE, float(m_modifier.m_amount), apply);
 }
 
-void Aura::HandleAuraModIncreaseEnergyPercent(bool apply, bool Real)
+void Aura::HandleAuraModIncreaseEnergyPercent(bool apply, bool /*Real*/)
 {
     Powers powerType = m_target-&gt;getPowerType();
     if(int32(powerType) != m_modifier.m_miscvalue)
         return;
 
-    m_target-&gt;HandleStatModifier(UnitMods(UNIT_MOD_POWER_START + powerType), TOTAL_PCT, float(m_modifier.m_amount), apply);
+    UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
+
+    m_target-&gt;HandleStatModifier(unitMod, TOTAL_PCT, float(m_modifier.m_amount), apply);
 }
 
-void Aura::HandleAuraModIncreaseHealthPercent(bool apply, bool Real)
+void Aura::HandleAuraModIncreaseHealthPercent(bool apply, bool /*Real*/)
 {
-    //m_target-&gt;ApplyMaxHealthPercentMod(m_modifier.m_amount,apply);
     m_target-&gt;HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(m_modifier.m_amount), apply);
 }
 </diff>
      <filename>src/game/SpellAuras.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -887,7 +887,7 @@ void Spell::EffectDummy(uint32 i)
                     if (!m_caster-&gt;HasAuraType(SPELL_AURA_MOUNTED))
                         return;
 
-                    float flyspeed = m_caster-&gt;GetSpeedRate(MOVE_FLY);
+                    float flyspeed = m_caster-&gt;GetSpeedRate(MOVE_FLIGHT);
                     float speed = m_caster-&gt;GetSpeedRate(MOVE_RUN);
 
                     m_caster-&gt;RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
@@ -3250,17 +3250,17 @@ void Spell::EffectSummon(uint32 i)
     if(duration &gt; 0)
         spawnCreature-&gt;SetDuration(duration);
 
-    spawnCreature-&gt;SetUInt64Value(UNIT_FIELD_SUMMONEDBY,m_caster-&gt;GetGUID());
-    spawnCreature-&gt;SetUInt32Value(UNIT_NPC_FLAGS , 0);
+    spawnCreature-&gt;SetOwnerGUID(m_caster-&gt;GetGUID());
+    spawnCreature-&gt;SetUInt32Value(UNIT_NPC_FLAGS, 0);
     spawnCreature-&gt;setPowerType(POWER_MANA);
-    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,m_caster-&gt;getFaction());
-    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_FLAGS,0);
-    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_BYTES_0,2048);
-    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_BYTES_1,0);
-    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP,0);
-    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_PETEXPERIENCE,0);
-    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP,1000);
-    spawnCreature-&gt;SetUInt64Value(UNIT_FIELD_CREATEDBY, m_caster-&gt;GetGUID());
+    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, m_caster-&gt;getFaction());
+    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_FLAGS, 0);
+    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
+    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
+    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
+    spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
+    spawnCreature-&gt;SetCreatorGUID(m_caster-&gt;GetGUID());
     spawnCreature-&gt;SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo-&gt;Id);
 
     spawnCreature-&gt;InitStatsForLevel(level);
@@ -3522,7 +3522,8 @@ void Spell::EffectAddFarsight(uint32 i)
     dynObj-&gt;SetUInt32Value(DYNAMICOBJECT_BYTES, 0x80000002);
     m_caster-&gt;AddDynObject(dynObj);
     dynObj-&gt;GetMap()-&gt;Add(dynObj);
-    m_caster-&gt;SetUInt64Value(PLAYER_FARSIGHT, dynObj-&gt;GetGUID());
+    if(m_caster-&gt;GetTypeId() == TYPEID_PLAYER)
+        ((Player*)m_caster)-&gt;SetFarSight(dynObj-&gt;GetGUID());
 }
 
 void Spell::EffectSummonWild(uint32 i)
@@ -3679,14 +3680,14 @@ void Spell::EffectSummonGuardian(uint32 i)
         if(duration &gt; 0)
             spawnCreature-&gt;SetDuration(duration);
 
-        spawnCreature-&gt;SetUInt64Value(UNIT_FIELD_SUMMONEDBY,m_caster-&gt;GetGUID());
+        spawnCreature-&gt;SetOwnerGUID(m_caster-&gt;GetGUID());
         spawnCreature-&gt;setPowerType(POWER_MANA);
         spawnCreature-&gt;SetUInt32Value(UNIT_NPC_FLAGS , 0);
         spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,m_caster-&gt;getFaction());
         spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_FLAGS,0);
         spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_BYTES_1,0);
         spawnCreature-&gt;SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP,0);
-        spawnCreature-&gt;SetUInt64Value(UNIT_FIELD_CREATEDBY, m_caster-&gt;GetGUID());
+        spawnCreature-&gt;SetCreatorGUID(m_caster-&gt;GetGUID());
         spawnCreature-&gt;SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo-&gt;Id);
 
         spawnCreature-&gt;InitStatsForLevel(level);
@@ -4088,15 +4089,15 @@ void Spell::EffectSummonPet(uint32 i)
             NewSummon-&gt;GetCharmInfo()-&gt;SetReactState(REACT_DEFENSIVE);
     }
 
-    NewSummon-&gt;SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_caster-&gt;GetGUID());
-    NewSummon-&gt;SetUInt64Value(UNIT_FIELD_CREATEDBY, m_caster-&gt;GetGUID());
-    NewSummon-&gt;SetUInt32Value(UNIT_NPC_FLAGS , 0);
+    NewSummon-&gt;SetOwnerGUID(m_caster-&gt;GetGUID());
+    NewSummon-&gt;SetCreatorGUID(m_caster-&gt;GetGUID());
+    NewSummon-&gt;SetUInt32Value(UNIT_NPC_FLAGS, 0);
     NewSummon-&gt;SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, faction);
-    NewSummon-&gt;SetUInt32Value(UNIT_FIELD_BYTES_0,2048);
-    NewSummon-&gt;SetUInt32Value(UNIT_FIELD_BYTES_1,0);
-    NewSummon-&gt;SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP,time(NULL));
-    NewSummon-&gt;SetUInt32Value(UNIT_FIELD_PETEXPERIENCE,0);
-    NewSummon-&gt;SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP,1000);
+    NewSummon-&gt;SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
+    NewSummon-&gt;SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+    NewSummon-&gt;SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
+    NewSummon-&gt;SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
+    NewSummon-&gt;SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
     NewSummon-&gt;SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo-&gt;Id);
 
     NewSummon-&gt;GetCharmInfo()-&gt;SetPetNumber(pet_number, true);
@@ -4105,7 +4106,7 @@ void Spell::EffectSummonPet(uint32 i)
     // this enables popup window (pet dismiss, cancel), hunter pet additional flags set later
     NewSummon-&gt;SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
 
-    NewSummon-&gt;InitStatsForLevel( petlevel);
+    NewSummon-&gt;InitStatsForLevel(petlevel);
     NewSummon-&gt;InitPetCreateSpells();
 
     if(NewSummon-&gt;getPetType()==SUMMON_PET)
@@ -5703,8 +5704,8 @@ void Spell::EffectSummonCritter(uint32 i)
         return;
     }
 
-    critter-&gt;SetUInt64Value(UNIT_FIELD_SUMMONEDBY,m_caster-&gt;GetGUID());
-    critter-&gt;SetUInt64Value(UNIT_FIELD_CREATEDBY,m_caster-&gt;GetGUID());
+    critter-&gt;SetOwnerGUID(m_caster-&gt;GetGUID());
+    critter-&gt;SetCreatorGUID(m_caster-&gt;GetGUID());
     critter-&gt;SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,m_caster-&gt;getFaction());
     critter-&gt;SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo-&gt;Id);
 </diff>
      <filename>src/game/SpellEffects.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -260,7 +260,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket&amp; recvPacket)
 
 void WorldSession::HandleGameObjectUseOpcode( WorldPacket &amp; recv_data )
 {
-    CHECK_PACKET_SIZE(recv_data,8);
+    CHECK_PACKET_SIZE(recv_data, 8);
 
     uint64 guid;
 </diff>
      <filename>src/game/SpellHandler.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -848,6 +848,7 @@ void Pet::UpdateMaxHealth()
 void Pet::UpdateMaxPower(Powers power)
 {
     UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);
+
     float addValue = (power == POWER_MANA) ? GetStat(STAT_INTELLECT) - GetCreateStat(STAT_INTELLECT) : 0.0f;
 
     float value  = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power);</diff>
      <filename>src/game/StatSystem.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -82,7 +82,7 @@ void WorldSession::HandleTaxiQueryAvailableNodesOpcode( WorldPacket &amp; recv_data
     Creature *unit = ObjectAccessor::GetNPCIfCanInteractWith(*_player, guid, UNIT_NPC_FLAG_FLIGHTMASTER);
     if (!unit)
     {
-        sLog.outDebug( &quot;WORLD: HandleTaxiQueryAvailableNodesOpcode - Unit (GUID: %u) not found or you can't interact with him.&quot;, uint32(GUID_LOPART(guid)) );
+        sLog.outDebug( &quot;WORLD: HandleTaxiQueryAvailableNodes - Unit (GUID: %u) not found or you can't interact with him.&quot;, uint32(GUID_LOPART(guid)) );
         return;
     }
 </diff>
      <filename>src/game/TaxiHandler.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -128,10 +128,9 @@ void Totem::UnSummon()
 
 void Totem::SetOwner(uint64 guid)
 {
-    SetUInt64Value(UNIT_FIELD_SUMMONEDBY, guid);
-    SetUInt64Value(UNIT_FIELD_CREATEDBY, guid);
-    Unit *owner = GetOwner();
-    if (owner)
+    SetCreatorGUID(guid);
+    SetOwnerGUID(guid);
+    if (Unit *owner = GetOwner())
     {
         setFaction(owner-&gt;getFaction());
         SetLevel(owner-&gt;getLevel());</diff>
      <filename>src/game/Totem.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -62,7 +62,7 @@ inline float Traveller&lt;Creature&gt;::Speed()
     if(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
         return i_traveller.GetSpeed(MOVE_WALK);
     else if(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_FLYING2))
-        return i_traveller.GetSpeed(MOVE_FLY);
+        return i_traveller.GetSpeed(MOVE_FLIGHT);
     else
         return i_traveller.GetSpeed(MOVE_RUN);
 }</diff>
      <filename>src/game/Traveller.h</filename>
    </modified>
    <modified>
      <diff>@@ -50,12 +50,12 @@ float baseMoveSpeed[MAX_MOVE_TYPE] =
 {
     2.5f,                                                   // MOVE_WALK
     7.0f,                                                   // MOVE_RUN
-    1.25f,                                                  // MOVE_WALKBACK
+    1.25f,                                                  // MOVE_RUN_BACK
     4.722222f,                                              // MOVE_SWIM
-    4.5f,                                                   // MOVE_SWIMBACK
-    3.141594f,                                              // MOVE_TURN
-    7.0f,                                                   // MOVE_FLY
-    4.5f,                                                   // MOVE_FLYBACK
+    4.5f,                                                   // MOVE_SWIM_BACK
+    3.141594f,                                              // MOVE_TURN_RATE
+    7.0f,                                                   // MOVE_FLIGHT
+    4.5f,                                                   // MOVE_FLIGHT_BACK
 };
 
 // auraTypes contains attacker auras capable of proc'ing cast auras
@@ -1462,9 +1462,8 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage
 void Unit::HandleEmoteCommand(uint32 anim_id)
 {
     WorldPacket data( SMSG_EMOTE, 12 );
-    data &lt;&lt; anim_id &lt;&lt; GetGUID();
-    WPAssert(data.size() == 12);
-
+    data &lt;&lt; uint32(anim_id);
+    data &lt;&lt; uint64(GetGUID());
     SendMessageToSet(&amp;data, true);
 }
 
@@ -2579,8 +2578,8 @@ float Unit::CalculateLevelPenalty(SpellEntry const* spellProto) const
 void Unit::SendAttackStart(Unit* pVictim)
 {
     WorldPacket data( SMSG_ATTACKSTART, 16 );
-    data &lt;&lt; GetGUID();
-    data &lt;&lt; pVictim-&gt;GetGUID();
+    data &lt;&lt; uint64(GetGUID());
+    data &lt;&lt; uint64(pVictim-&gt;GetGUID());
 
     SendMessageToSet(&amp;data, true);
     DEBUG_LOG( &quot;WORLD: Sent SMSG_ATTACKSTART&quot; );
@@ -6901,7 +6900,7 @@ bool Unit::Attack(Unit *victim, bool meleeAttack)
     if(GetTypeId()==TYPEID_UNIT)
     {
         WorldPacket data(SMSG_AI_REACTION, 12);
-        data &lt;&lt; GetGUID();
+        data &lt;&lt; uint64(GetGUID());
         data &lt;&lt; uint32(AI_REACTION_AGGRO);                  // Aggro sound
         ((WorldObject*)this)-&gt;SendMessageToSet(&amp;data, true);
 
@@ -7117,17 +7116,17 @@ Unit* Unit::GetCharm() const
 
 void Unit::SetPet(Pet* pet)
 {
-    SetUInt64Value(UNIT_FIELD_SUMMON,pet ? pet-&gt;GetGUID() : 0);
+    SetUInt64Value(UNIT_FIELD_SUMMON, pet ? pet-&gt;GetGUID() : 0);
 
     // FIXME: hack, speed must be set only at follow
     if(pet)
         for(int i = 0; i &lt; MAX_MOVE_TYPE; ++i)
-            pet-&gt;SetSpeed(UnitMoveType(i),m_speed_rate[i],true);
+            pet-&gt;SetSpeed(UnitMoveType(i), m_speed_rate[i], true);
 }
 
-void Unit::SetCharm(Unit* charmed)
+void Unit::SetCharm(Unit* pet)
 {
-    SetUInt64Value(UNIT_FIELD_CHARM,charmed ? charmed-&gt;GetGUID() : 0);
+    SetUInt64Value(UNIT_FIELD_CHARM, pet ? pet-&gt;GetGUID() : 0);
 }
 
 void Unit::UnsummonAllTotems()
@@ -7164,7 +7163,6 @@ void Unit::SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, Po
     data &lt;&lt; uint32(SpellID);
     data &lt;&lt; uint32(powertype);
     data &lt;&lt; uint32(Damage);
-    //data &lt;&lt; uint8(critical ? 1 : 0);                      // removed in 2.4.0
     SendMessageToSet(&amp;data, true);
 }
 
@@ -7621,7 +7619,7 @@ int32 Unit::SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit *pVic
 
 bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType)
 {
-    // not criting spell
+    // not critting spell
     if((spellProto-&gt;AttributesEx2 &amp; SPELL_ATTR_EX2_CANT_CRIT))
         return false;
 
@@ -8809,16 +8807,16 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
             }
             break;
         }
-        case MOVE_WALKBACK:
+        case MOVE_RUN_BACK:
             return;
         case MOVE_SWIM:
         {
             main_speed_mod  = GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_SWIM_SPEED);
             break;
         }
-        case MOVE_SWIMBACK:
+        case MOVE_SWIM_BACK:
             return;
-        case MOVE_FLY:
+        case MOVE_FLIGHT:
         {
             if (IsMounted()) // Use on mount auras
                 main_speed_mod  = GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED);
@@ -8828,7 +8826,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
             non_stack_bonus = (100.0 + GetMaxPositiveAuraModifier(SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK))/100.0f;
             break;
         }
-        case MOVE_FLYBACK:
+        case MOVE_FLIGHT_BACK:
             return;
         default:
             sLog.outError(&quot;Unit::UpdateSpeed: Unsupported move type (%d)&quot;, mtype);
@@ -8843,7 +8841,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
     {
         case MOVE_RUN:
         case MOVE_SWIM:
-        case MOVE_FLY:
+        case MOVE_FLIGHT:
         {
             // Normalize speed by 191 aura SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED if need
             // TODO: possible affect only on MOVE_RUN
@@ -8900,22 +8898,22 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
             case MOVE_RUN:
                 data.Initialize(MSG_MOVE_SET_RUN_SPEED, 8+4+1+4+4+4+4+4+4+4);
                 break;
-            case MOVE_WALKBACK:
+            case MOVE_RUN_BACK:
                 data.Initialize(MSG_MOVE_SET_RUN_BACK_SPEED, 8+4+1+4+4+4+4+4+4+4);
                 break;
             case MOVE_SWIM:
                 data.Initialize(MSG_MOVE_SET_SWIM_SPEED, 8+4+1+4+4+4+4+4+4+4);
                 break;
-            case MOVE_SWIMBACK:
+            case MOVE_SWIM_BACK:
                 data.Initialize(MSG_MOVE_SET_SWIM_BACK_SPEED, 8+4+1+4+4+4+4+4+4+4);
                 break;
-            case MOVE_TURN:
+            case MOVE_TURN_RATE:
                 data.Initialize(MSG_MOVE_SET_TURN_RATE, 8+4+1+4+4+4+4+4+4+4);
                 break;
-            case MOVE_FLY:
+            case MOVE_FLIGHT:
                 data.Initialize(MSG_MOVE_SET_FLIGHT_SPEED, 8+4+1+4+4+4+4+4+4+4);
                 break;
-            case MOVE_FLYBACK:
+            case MOVE_FLIGHT_BACK:
                 data.Initialize(MSG_MOVE_SET_FLIGHT_BACK_SPEED, 8+4+1+4+4+4+4+4+4+4);
                 break;
             default:
@@ -8948,22 +8946,22 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
             case MOVE_RUN:
                 data.Initialize(SMSG_FORCE_RUN_SPEED_CHANGE, 17);
                 break;
-            case MOVE_WALKBACK:
+            case MOVE_RUN_BACK:
                 data.Initialize(SMSG_FORCE_RUN_BACK_SPEED_CHANGE, 16);
                 break;
             case MOVE_SWIM:
                 data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, 16);
                 break;
-            case MOVE_SWIMBACK:
+            case MOVE_SWIM_BACK:
                 data.Initialize(SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, 16);
                 break;
-            case MOVE_TURN:
+            case MOVE_TURN_RATE:
                 data.Initialize(SMSG_FORCE_TURN_RATE_CHANGE, 16);
                 break;
-            case MOVE_FLY:
+            case MOVE_FLIGHT:
                 data.Initialize(SMSG_FORCE_FLIGHT_SPEED_CHANGE, 16);
                 break;
-            case MOVE_FLYBACK:
+            case MOVE_FLIGHT_BACK:
                 data.Initialize(SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE, 16);
                 break;
             default:
@@ -8971,7 +8969,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
                 return;
         }
         data.append(GetPackGUID());
-        data &lt;&lt; (uint32)0;
+        data &lt;&lt; (uint32)0;                                  // moveEvent, NUM_PMOVE_EVTS = 0x39
         if (mtype == MOVE_RUN)
             data &lt;&lt; uint8(0);                               // new 2.1.0
         data &lt;&lt; float(GetSpeed(mtype));
@@ -10753,9 +10751,9 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
         return NULL;
     }
 
-    pet-&gt;SetUInt64Value(UNIT_FIELD_SUMMONEDBY, GetGUID());
-    pet-&gt;SetUInt64Value(UNIT_FIELD_CREATEDBY, GetGUID());
-    pet-&gt;SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,getFaction());
+    pet-&gt;SetOwnerGUID(GetGUID());
+    pet-&gt;SetCreatorGUID(GetGUID());
+    pet-&gt;SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
     pet-&gt;SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id);
 
     if(!pet-&gt;InitStatsForLevel(creatureTarget-&gt;getLevel()))</diff>
      <filename>src/game/Unit.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -366,14 +366,14 @@ enum UnitState
 
 enum UnitMoveType
 {
-    MOVE_WALK       = 0,
-    MOVE_RUN        = 1,
-    MOVE_WALKBACK   = 2,
-    MOVE_SWIM       = 3,
-    MOVE_SWIMBACK   = 4,
-    MOVE_TURN       = 5,
-    MOVE_FLY        = 6,
-    MOVE_FLYBACK    = 7
+    MOVE_WALK           = 0,
+    MOVE_RUN            = 1,
+    MOVE_RUN_BACK       = 2,
+    MOVE_SWIM           = 3,
+    MOVE_SWIM_BACK      = 4,
+    MOVE_TURN_RATE      = 5,
+    MOVE_FLIGHT         = 6,
+    MOVE_FLIGHT_BACK    = 7,
 };
 
 #define MAX_MOVE_TYPE 8
@@ -948,11 +948,14 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
         DeathState getDeathState() { return m_deathState; };
         virtual void setDeathState(DeathState s);           // overwrited in Creature/Player/Pet
 
-        uint64 const&amp; GetOwnerGUID() const { return  GetUInt64Value(UNIT_FIELD_SUMMONEDBY); }
+        uint64 GetOwnerGUID() const { return  GetUInt64Value(UNIT_FIELD_SUMMONEDBY); }
+        void SetOwnerGUID(uint64 owner) { SetUInt64Value(UNIT_FIELD_SUMMONEDBY, owner); }
+        uint64 GetCreatorGUID() const { return GetUInt64Value(UNIT_FIELD_CREATEDBY); }
+        void SetCreatorGUID(uint64 creator) { SetUInt64Value(UNIT_FIELD_CREATEDBY, creator); }
         uint64 GetPetGUID() const { return  GetUInt64Value(UNIT_FIELD_SUMMON); }
         uint64 GetCharmerGUID() const { return GetUInt64Value(UNIT_FIELD_CHARMEDBY); }
-        uint64 GetCharmGUID() const { return  GetUInt64Value(UNIT_FIELD_CHARM); }
         void SetCharmerGUID(uint64 owner) { SetUInt64Value(UNIT_FIELD_CHARMEDBY, owner); }
+        uint64 GetCharmGUID() const { return  GetUInt64Value(UNIT_FIELD_CHARM); }
 
         uint64 GetCharmerOrOwnerGUID() const { return GetCharmerGUID() ? GetCharmerGUID() : GetOwnerGUID(); }
         uint64 GetCharmerOrOwnerOrOwnGUID() const
@@ -981,6 +984,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
 
         void SetPet(Pet* pet);
         void SetCharm(Unit* pet);
+
         bool isCharmed() const { return GetCharmerGUID() != 0; }
 
         CharmInfo* GetCharmInfo() { return m_charmInfo; }
@@ -1116,7 +1120,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
         AuraList const&amp; GetSingleCastAuras() const { return m_scAuras; }
         SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY];
 
-        // Threat related methodes
+        // Threat related methods
         bool CanHaveThreatList() const;
         void AddThreat(Unit* pVictim, float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellEntry const *threatSpell = NULL);
         float ApplyTotalThreatModifier(float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL);</diff>
      <filename>src/game/Unit.h</filename>
    </modified>
    <modified>
      <diff>@@ -42,8 +42,7 @@ alter table creature_movement add `wpguid` int(11) default '0';
 #include &lt;cassert&gt;
 
 //-----------------------------------------------//
-void
-WaypointMovementGenerator&lt;Creature&gt;::LoadPath(Creature &amp;c)
+void WaypointMovementGenerator&lt;Creature&gt;::LoadPath(Creature &amp;c)
 {
     sLog.outDetail(&quot;LoadPath: loading waypoint path for creature %d,%d&quot;, c.GetGUIDLow(), c.GetDBTableGUIDLow());
 
@@ -60,26 +59,23 @@ WaypointMovementGenerator&lt;Creature&gt;::LoadPath(Creature &amp;c)
     for(uint32 i = 0; i &lt; node_count-1; i++)
         i_hasDone[i] = false;
 
-    // to prevent a misbehaviour inside &quot;update&quot;
+    // to prevent a misbehavior inside &quot;update&quot;
     // update is always called with the next wp - but the wpSys needs the current
     // so when the routine is called the first time, wpSys gets the last waypoint
     // and this prevents the system from performing text/emote, etc
     i_hasDone[node_count - 1] = true;
 }
 
-void
-WaypointMovementGenerator&lt;Creature&gt;::ClearWaypoints()
+void WaypointMovementGenerator&lt;Creature&gt;::ClearWaypoints()
 {
     i_path = NULL;
 }
 
-void
-WaypointMovementGenerator&lt;Creature&gt;::Initialize()
+void WaypointMovementGenerator&lt;Creature&gt;::Initialize()
 {
 }
 
-bool
-WaypointMovementGenerator&lt;Creature&gt;::Update(Creature &amp;creature, const uint32 &amp;diff)
+bool WaypointMovementGenerator&lt;Creature&gt;::Update(Creature &amp;creature, const uint32 &amp;diff)
 {
     if(!&amp;creature)
         return true;
@@ -104,7 +100,7 @@ WaypointMovementGenerator&lt;Creature&gt;::Update(Creature &amp;creature, const uint32 &amp;di
     i_nextMoveTime.Update(diff);
     i_destinationHolder.UpdateTraveller(traveller, diff, false, true);
 
-    // creature has been stoped in middle of the waypoint segment
+    // creature has been stopped in middle of the waypoint segment
     if (!i_destinationHolder.HasArrived() &amp;&amp; creature.IsStopped())
     {
         if( i_nextMoveTime.Passed()) // Timer has elapsed, meaning this part controlled it
@@ -214,14 +210,12 @@ void WaypointMovementGenerator&lt;Creature&gt;::MovementInform(Creature &amp;unit)
 }
 
 //----------------------------------------------------//
-void
-FlightPathMovementGenerator::LoadPath(Player &amp;)
+void FlightPathMovementGenerator::LoadPath(Player &amp;)
 {
     objmgr.GetTaxiPathNodes(i_pathId, i_path,i_mapIds);
 }
 
-uint32
-FlightPathMovementGenerator::GetPathAtMapEnd() const
+uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const
 {
     if(i_currentNode &gt;= i_mapIds.size())
         return i_mapIds.size();
@@ -236,8 +230,7 @@ FlightPathMovementGenerator::GetPathAtMapEnd() const
     return i_mapIds.size();
 }
 
-void
-FlightPathMovementGenerator::Initialize(Player &amp;player)
+void FlightPathMovementGenerator::Initialize(Player &amp;player)
 {
     player.getHostilRefManager().setOnlineOfflineState(false);
     player.addUnitState(UNIT_STAT_IN_FLIGHT);
@@ -252,7 +245,6 @@ FlightPathMovementGenerator::Initialize(Player &amp;player)
 
 void FlightPathMovementGenerator::Finalize(Player &amp; player)
 {
-
     float x, y, z;
     i_destinationHolder.GetLocationNow(player.GetMapId(), x, y, z);
     player.SetPosition(x, y, z, player.GetOrientation());
@@ -272,8 +264,7 @@ void FlightPathMovementGenerator::Finalize(Player &amp; player)
     }
 }
 
-bool
-FlightPathMovementGenerator::Update(Player &amp;player, const uint32 &amp;diff)
+bool FlightPathMovementGenerator::Update(Player &amp;player, const uint32 &amp;diff)
 {
     if( MovementInProgress() )
     {
@@ -308,8 +299,7 @@ FlightPathMovementGenerator::Update(Player &amp;player, const uint32 &amp;diff)
     return false;
 }
 
-void
-FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()
+void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()
 {
     if(i_mapIds.empty())
         return;</diff>
      <filename>src/game/WaypointMovementGenerator.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -480,38 +480,38 @@ void WorldSession::Handle_NULL( WorldPacket&amp; recvPacket )
 
 void WorldSession::Handle_EarlyProccess( WorldPacket&amp; recvPacket )
 {
-    sLog.outError( &quot;SESSION: received opcode %s (0x%.4X) that must be proccessed in WorldSocket::OnRead&quot;,
+    sLog.outError( &quot;SESSION: received opcode %s (0x%.4X) that must be processed in WorldSocket::OnRead&quot;,
         LookupOpcodeName(recvPacket.GetOpcode()),
         recvPacket.GetOpcode());
 }
 
 void WorldSession::Handle_ServerSide( WorldPacket&amp; recvPacket )
 {
-    sLog.outError( &quot;SESSION: received sever-side opcode %s (0x%.4X)&quot;,
+    sLog.outError( &quot;SESSION: received server-side opcode %s (0x%.4X)&quot;,
         LookupOpcodeName(recvPacket.GetOpcode()),
         recvPacket.GetOpcode());
 }
 
-void WorldSession::Handle_Depricated( WorldPacket&amp; recvPacket )
+void WorldSession::Handle_Deprecated( WorldPacket&amp; recvPacket )
 {
-    sLog.outError( &quot;SESSION: received depricated opcode %s (0x%.4X)&quot;,
+    sLog.outError( &quot;SESSION: received deprecated opcode %s (0x%.4X)&quot;,
         LookupOpcodeName(recvPacket.GetOpcode()),
         recvPacket.GetOpcode());
 }
 
 void WorldSession::SendAuthWaitQue(uint32 position)
- {
-     if(position == 0)
-     {
-         WorldPacket packet( SMSG_AUTH_RESPONSE, 1 );
-         packet &lt;&lt; uint8( AUTH_OK );
-         SendPacket(&amp;packet);
-     }
-     else
-     {
-         WorldPacket packet( SMSG_AUTH_RESPONSE, 5 );
-         packet &lt;&lt; uint8( AUTH_WAIT_QUEUE );
-         packet &lt;&lt; uint32 (position);
-         SendPacket(&amp;packet);
-     }
- }
+{
+    if(position == 0)
+    {
+        WorldPacket packet( SMSG_AUTH_RESPONSE, 1 );
+        packet &lt;&lt; uint8( AUTH_OK );
+        SendPacket(&amp;packet);
+    }
+    else
+    {
+        WorldPacket packet( SMSG_AUTH_RESPONSE, 5 );
+        packet &lt;&lt; uint8( AUTH_WAIT_QUEUE );
+        packet &lt;&lt; uint32 (position);
+        SendPacket(&amp;packet);
+    }
+}</diff>
      <filename>src/game/WorldSession.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -209,7 +209,7 @@ class MANGOS_DLL_SPEC WorldSession
         void Handle_NULL(WorldPacket&amp; recvPacket);          // not used
         void Handle_EarlyProccess( WorldPacket&amp; recvPacket);// just mark packets processed in WorldSocket::OnRead
         void Handle_ServerSide(WorldPacket&amp; recvPacket);    // sever side only, can't be accepted from client
-        void Handle_Depricated(WorldPacket&amp; recvPacket);    // never used anymore by client
+        void Handle_Deprecated(WorldPacket&amp; recvPacket);    // never used anymore by client
 
         void HandleCharEnumOpcode(WorldPacket&amp; recvPacket);
         void HandleCharDeleteOpcode(WorldPacket&amp; recvPacket);</diff>
      <filename>src/game/WorldSession.h</filename>
    </modified>
    <modified>
      <diff>@@ -712,7 +712,7 @@ int WorldSocket::HandleAuthSession (WorldPacket&amp; recvPacket)
 
     Field* fields = result-&gt;Fetch ();
 
-    expansion = fields[8].GetUInt8 () &amp;&amp; sWorld.getConfig (CONFIG_EXPANSION) &gt; 0;
+    expansion = ((sWorld.getConfig(CONFIG_EXPANSION) &gt; fields[8].GetUInt8()) ? fields[8].GetUInt8() : sWorld.getConfig(CONFIG_EXPANSION));
 
     N.SetHexStr (&quot;894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7&quot;);
     g.SetDword (7);
@@ -734,8 +734,8 @@ int WorldSocket::HandleAuthSession (WorldPacket&amp; recvPacket)
     x.SetBinary (sha1.GetDigest (), sha1.GetLength ());
     v = g.ModExp (x, N);
 
-    const char* sStr = s.AsHexStr (); //Must be freed by OPENSSL_free()
-    const char* vStr = v.AsHexStr (); //Must be freed by OPENSSL_free()
+    const char* sStr = s.AsHexStr ();                       //Must be freed by OPENSSL_free()
+    const char* vStr = v.AsHexStr ();                       //Must be freed by OPENSSL_free()
     const char* vold = fields[6].GetString ();
 
     DEBUG_LOG (&quot;WorldSocket::HandleAuthSession: (s,v) check s: %s v_old: %s v_new: %s&quot;,
@@ -825,7 +825,7 @@ int WorldSocket::HandleAuthSession (WorldPacket&amp; recvPacket)
 
         SendPacket (packet);
 
-        sLog.outBasic (&quot;WorldSocket::HandleAuthSession: User tryes to login but his security level is not enough&quot;);
+        sLog.outBasic (&quot;WorldSocket::HandleAuthSession: User tries to login but his security level is not enough&quot;);
         return -1;
     }
 
@@ -940,7 +940,7 @@ int WorldSocket::HandlePing (WorldPacket&amp; recvPacket)
         ACE_GUARD_RETURN (LockType, Guard, m_SessionLock, -1);
 
         if (m_Session)
-        m_Session-&gt;SetLatency (latency);
+            m_Session-&gt;SetLatency (latency);
         else
         {
             sLog.outError (&quot;WorldSocket::HandlePing: peer sent CMSG_PING, &quot;</diff>
      <filename>src/game/WorldSocket.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -31,6 +31,7 @@
 #include &quot;Language.h&quot;
 #include &quot;MapManager.h&quot;
 #include &lt;fstream&gt;
+#include &quot;ObjectMgr.h&quot;
 
 bool ChatHandler::HandleDebugInArcCommand(const char* /*args*/)
 {
@@ -59,8 +60,8 @@ bool ChatHandler::HandleDebugSpellFailCommand(const char* args)
     uint8 failnum = (uint8)atoi(px);
 
     WorldPacket data(SMSG_CAST_FAILED, 5);
-    data &lt;&lt; (uint32)133;
-    data &lt;&lt; failnum;
+    data &lt;&lt; uint32(133);
+    data &lt;&lt; uint8(failnum);
     m_session-&gt;SendPacket(&amp;data);
 
     return true;
@@ -145,11 +146,14 @@ bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/)
         std::string type;
         ifs &gt;&gt; type;
 
+        if(type == &quot;&quot;)
+            break;
+
         if(type == &quot;uint8&quot;)
         {
-            uint8 val1;
+            uint16 val1;
             ifs &gt;&gt; val1;
-            data &lt;&lt; val1;
+            data &lt;&lt; uint8(val1);
         }
         else if(type == &quot;uint16&quot;)
         {
@@ -187,7 +191,8 @@ bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/)
         }
         else
         {
-            sLog.outDebug(&quot;Sending opcode: unknown type %s&quot;, type.c_str());
+            sLog.outDebug(&quot;Sending opcode: unknown type '%s'&quot;, type.c_str());
+            break;
         }
     }
     ifs.close();</diff>
      <filename>src/game/debugcmds.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -50,7 +50,7 @@ class RASocket: public TcpSocket
         bool bLog;
         bool bSecure;                                       //kick on wrong pass, non exist. user, user with no priv
         //will protect from DOS, bruteforce attacks
-        //some 'smart' protection must be added for more scurity
+        //some 'smart' protection must be added for more security
         uint8 iMinLevel;
         enum
         {</diff>
      <filename>src/mangosd/RASocket.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
 #ifndef __REVISION_NR_H__
 #define __REVISION_NR_H__
- #define REVISION_NR &quot;6888&quot;
+ #define REVISION_NR &quot;6889&quot;
 #endif // __REVISION_NR_H__</diff>
      <filename>src/shared/revision_nr.h</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>df19c916adaece7bede4e332e0fbdc131ae83a55</id>
    </parent>
  </parents>
  <author>
    <name>VladimirMangos</name>
    <email>vladimir@getmangos.com</email>
  </author>
  <url>http://github.com/mangos/mangos/commit/7fb911d368d0b8f24b613bac99755bfffaa35e7a</url>
  <id>7fb911d368d0b8f24b613bac99755bfffaa35e7a</id>
  <committed-date>2008-12-09T03:08:29-08:00</committed-date>
  <authored-date>2008-12-09T03:05:23-08:00</authored-date>
  <message>[6889] Backport some not client version specific changes and fixes from 303 branch.</message>
  <tree>d656aa8643bb95aa3dc89a98a6147221dc34d79e</tree>
  <committer>
    <name>VladimirMangos</name>
    <email>vladimir@getmangos.com</email>
  </committer>
</commit>
