Index: trunk/src/trinityrealm/AuthSocket.h
===================================================================
--- trunk/src/trinityrealm/AuthSocket.h (revision 2)
+++ trunk/src/trinityrealm/AuthSocket.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/trinityrealm/RealmList.h
===================================================================
--- trunk/src/trinityrealm/RealmList.h (revision 2)
+++ trunk/src/trinityrealm/RealmList.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/trinityrealm/AuthCodes.h
===================================================================
--- trunk/src/trinityrealm/AuthCodes.h (revision 34)
+++ trunk/src/trinityrealm/AuthCodes.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -69,5 +71,5 @@
 // will only support WoW and WoW:TBC 2.4.3 client build 8606...
 
-//#define EXPECTED_MANGOS_CLIENT_BUILD        {8606, 0} // - commented as builds are set in config
+#define EXPECTED_TRINITY_CLIENT_BUILD        {8606, 0}
 
 #endif
Index: trunk/src/trinityrealm/Main.cpp
===================================================================
--- trunk/src/trinityrealm/Main.cpp (revision 2)
+++ trunk/src/trinityrealm/Main.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -45,5 +47,5 @@
 #include "ServiceWin32.h"
 char serviceName[] = "realmd";
-char serviceLongName[] = "MaNGOS realmd service";
+char serviceLongName[] = "Trinity realm service";
 char serviceDescription[] = "Massive Network Game Object Server";
 /*
@@ -198,5 +200,5 @@
     if ( authListenSocket.Bind(bind_ip.c_str(),rmport))
     {
-        sLog.outError( "MaNGOS realmd can not bind to %s:%d",bind_ip.c_str(), rmport );
+        sLog.outError( "Trinity realm can not bind to %s:%d",bind_ip.c_str(), rmport );
         return 1;
     }
Index: trunk/src/trinityrealm/Makefile.am
===================================================================
--- trunk/src/trinityrealm/Makefile.am (revision 23)
+++ trunk/src/trinityrealm/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
@@ -70,2 +70,3 @@
 EXTRA_DIST =  trinityrealm.conf.dist
 
+
Index: trunk/src/trinityrealm/trinityrealm.conf.dist
===================================================================
--- trunk/src/trinityrealm/trinityrealm.conf.dist (revision 34)
+++ trunk/src/trinityrealm/trinityrealm.conf.dist (revision 44)
@@ -115,18 +115,2 @@
 WrongPass.BanTime = 600
 WrongPass.BanType = 0
-
-###################################################################################################################
-# CLIENT BUILD OPTIONS
-#
-#	Client Builds:
-#
-#	MinBuild
-#		The minium client build allowed to connect
-#
-#	MaxBuild
-#		The maximum client build allowed to connect
-#
-###################################################################################################################
-
-MinBuild = 8606
-MaxBuild = 8606
Index: trunk/src/trinityrealm/AuthSocket.cpp
===================================================================
--- trunk/src/trinityrealm/AuthSocket.cpp (revision 35)
+++ trunk/src/trinityrealm/AuthSocket.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -370,12 +372,11 @@
     ///- Check if the client has one of the expected version numbers
     bool valid_version=false;
-	int MinBuild = sConfig.GetIntDefault("MinBuild", 8606);
-	int MaxBuild = sConfig.GetIntDefault("MaxBuild", 8606);
-
-	if(ch->build >= MinBuild && ch->build <= MaxBuild) {
+    int accepted_versions[]=EXPECTED_TRINITY_CLIENT_BUILD;
+    for(int i=0;accepted_versions[i];i++)
+        if(ch->build==accepted_versions[i])
+    {
         valid_version=true;
-    } else {
-	valid_version=false;
-    };
+        break;
+    }
 
     /// <ul><li> if this is a valid version
@@ -684,5 +685,5 @@
                     {
                         uint32 acc_id = fields[0].GetUInt32();
-                        dbRealmServer.PExecute("INSERT INTO account_banned VALUES ('%u',UNIX_TIMESTAMP(),UNIX_TIMESTAMP()+'%u','MaNGOS realmd','Failed login autoban',1)",
+                        dbRealmServer.PExecute("INSERT INTO account_banned VALUES ('%u',UNIX_TIMESTAMP(),UNIX_TIMESTAMP()+'%u','Trinity realm','Failed login autoban',1)",
                             acc_id, WrongPassBanTime);
                         sLog.outBasic("[AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times",
@@ -693,5 +694,5 @@
                         std::string current_ip = GetRemoteAddress();
                         dbRealmServer.escape_string(current_ip);
-                        dbRealmServer.PExecute("INSERT INTO ip_banned VALUES ('%s',UNIX_TIMESTAMP(),UNIX_TIMESTAMP()+'%u','MaNGOS realmd','Failed login autoban')",
+                        dbRealmServer.PExecute("INSERT INTO ip_banned VALUES ('%s',UNIX_TIMESTAMP(),UNIX_TIMESTAMP()+'%u','Trinity realm','Failed login autoban')",
                             current_ip.c_str(), WrongPassBanTime);
                         sLog.outBasic("[AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times",
Index: trunk/src/trinityrealm/RealmList.cpp
===================================================================
--- trunk/src/trinityrealm/RealmList.cpp (revision 2)
+++ trunk/src/trinityrealm/RealmList.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/ProgressBar.h
===================================================================
--- trunk/src/shared/ProgressBar.h (revision 2)
+++ trunk/src/shared/ProgressBar.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,18 +11,18 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
-#ifndef MANGOSSERVER_PROGRESSBAR_H
-#define MANGOSSERVER_PROGRESSBAR_H
+#ifndef TRINITYCORE_PROGRESSBAR_H
+#define TRINITYCORE_PROGRESSBAR_H
 
 #include <stdio.h>
 #include "Platform/Define.h"
 
-class MANGOS_DLL_SPEC barGoLink
+class TRINITY_DLL_SPEC barGoLink
 {
     static char const * const empty;
Index: trunk/src/shared/ByteBuffer.h
===================================================================
--- trunk/src/shared/ByteBuffer.h (revision 2)
+++ trunk/src/shared/ByteBuffer.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/PacketLog.cpp
===================================================================
--- trunk/src/shared/PacketLog.cpp (revision 2)
+++ trunk/src/shared/PacketLog.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Util.cpp
===================================================================
--- trunk/src/shared/Util.cpp (revision 2)
+++ trunk/src/shared/Util.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/PacketLog.h
===================================================================
--- trunk/src/shared/PacketLog.h (revision 2)
+++ trunk/src/shared/PacketLog.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_PACKETLOG_H
-#define MANGOSSERVER_PACKETLOG_H
+#ifndef TRINITYCORE_PACKETLOG_H
+#define TRINITYCORE_PACKETLOG_H
 
 #include "Common.h"
@@ -43,4 +45,4 @@
 };
 
-#define sPacketLog MaNGOS::Singleton<PacketLog>::Instance()
+#define sPacketLog Trinity::Singleton<PacketLog>::Instance()
 #endif
Index: trunk/src/shared/SystemConfig.h
===================================================================
--- trunk/src/shared/SystemConfig.h (revision 2)
+++ trunk/src/shared/SystemConfig.h (revision 44)
@@ -1,4 +1,7 @@
 /* 
- * Copyright (C) 2005,2006 MaNGOS <http://www.mangosproject.org/>
+/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ *
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,16 +12,16 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 // THIS FILE IS DEPRECATED
 
-#ifndef MANGOS_SYSTEMCONFIG_H
-#define MANGOS_SYSTEMCONFIG_H
+#ifndef TRINITY_SYSTEMCONFIG_H
+#define TRINITY_SYSTEMCONFIG_H
 
 #include "Platform/Define.h"
Index: trunk/src/shared/Auth/BigNumber.h
===================================================================
--- trunk/src/shared/Auth/BigNumber.h (revision 2)
+++ trunk/src/shared/Auth/BigNumber.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Auth/Sha1.h
===================================================================
--- trunk/src/shared/Auth/Sha1.h (revision 2)
+++ trunk/src/shared/Auth/Sha1.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Auth/AuthCrypt.cpp
===================================================================
--- trunk/src/shared/Auth/AuthCrypt.cpp (revision 2)
+++ trunk/src/shared/Auth/AuthCrypt.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Auth/AuthCrypt.h
===================================================================
--- trunk/src/shared/Auth/AuthCrypt.h (revision 2)
+++ trunk/src/shared/Auth/AuthCrypt.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Auth/Hmac.cpp
===================================================================
--- trunk/src/shared/Auth/Hmac.cpp (revision 2)
+++ trunk/src/shared/Auth/Hmac.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Auth/Makefile.am
===================================================================
--- trunk/src/shared/Auth/Makefile.am (revision 23)
+++ trunk/src/shared/Auth/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/src/shared/Auth/BigNumber.cpp
===================================================================
--- trunk/src/shared/Auth/BigNumber.cpp (revision 2)
+++ trunk/src/shared/Auth/BigNumber.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Auth/Sha1.cpp
===================================================================
--- trunk/src/shared/Auth/Sha1.cpp (revision 2)
+++ trunk/src/shared/Auth/Sha1.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Auth/Hmac.h
===================================================================
--- trunk/src/shared/Auth/Hmac.h (revision 2)
+++ trunk/src/shared/Auth/Hmac.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Errors.h
===================================================================
--- trunk/src/shared/Errors.h (revision 2)
+++ trunk/src/shared/Errors.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_ERRORS_H
-#define MANGOSSERVER_ERRORS_H
+#ifndef TRINITYCORE_ERRORS_H
+#define TRINITYCORE_ERRORS_H
 
 #define WPAssert( assertion ) { if( !(assertion) ) { fprintf( stderr, "\n%s:%i ASSERTION FAILED:\n  %s\n", __FILE__, __LINE__, #assertion ); assert( #assertion &&0 ); } }
Index: trunk/src/shared/Log.cpp
===================================================================
--- trunk/src/shared/Log.cpp (revision 2)
+++ trunk/src/shared/Log.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -703,5 +705,5 @@
     va_end(ap);
 
-    MaNGOS::Singleton<Log>::Instance().outString(buf);
+    Trinity::Singleton<Log>::Instance().outString(buf);
 }
 
@@ -717,5 +719,5 @@
     va_end(ap);
 
-    MaNGOS::Singleton<Log>::Instance().outDetail(buf);
+    Trinity::Singleton<Log>::Instance().outDetail(buf);
 }
 
@@ -731,5 +733,5 @@
     va_end(ap);
 
-    MaNGOS::Singleton<Log>::Instance().outDebug(buf);
+    Trinity::Singleton<Log>::Instance().outDebug(buf);
 }
 
@@ -745,5 +747,5 @@
     va_end(ap);
 
-    MaNGOS::Singleton<Log>::Instance().outError(buf);
+    Trinity::Singleton<Log>::Instance().outError(buf);
 }
 
@@ -759,4 +761,4 @@
     va_end(ap);
 
-    MaNGOS::Singleton<Log>::Instance().outErrorDb(buf);
-}
+    Trinity::Singleton<Log>::Instance().outErrorDb(buf);
+}
Index: trunk/src/shared/vmap/VMapManager.cpp
===================================================================
--- trunk/src/shared/vmap/VMapManager.cpp (revision 2)
+++ trunk/src/shared/vmap/VMapManager.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -65,5 +67,5 @@
     //=========================================================
 
-    Vector3 VMapManager::convertPositionToMangosRep(float x, float y, float z) const
+    Vector3 VMapManager::convertPositionToTrinityRep(float x, float y, float z) const
     {
         float pos[3];
@@ -432,5 +434,5 @@
                 MapTree* mapTree = iInstanceMapTrees.get(pMapId);
                 result = mapTree->getObjectHitPos(pos1, pos2, resultPos, pModifyDist);
-                resultPos = convertPositionToMangosRep(resultPos.x,resultPos.y,resultPos.z);
+                resultPos = convertPositionToTrinityRep(resultPos.x,resultPos.y,resultPos.z);
                 rx = resultPos.x;
                 ry = resultPos.y;
Index: trunk/src/shared/vmap/VMapFactory.h
===================================================================
--- trunk/src/shared/vmap/VMapFactory.h (revision 2)
+++ trunk/src/shared/vmap/VMapFactory.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/TileAssembler.h
===================================================================
--- trunk/src/shared/vmap/TileAssembler.h (revision 2)
+++ trunk/src/shared/vmap/TileAssembler.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/BaseModel.h
===================================================================
--- trunk/src/shared/vmap/BaseModel.h (revision 2)
+++ trunk/src/shared/vmap/BaseModel.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/VMapManager.h
===================================================================
--- trunk/src/shared/vmap/VMapManager.h (revision 2)
+++ trunk/src/shared/vmap/VMapManager.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -144,5 +146,5 @@
             // public for debug
             G3D::Vector3 convertPositionToInternalRep(float x, float y, float z) const;
-            G3D::Vector3 convertPositionToMangosRep(float x, float y, float z) const;
+            G3D::Vector3 convertPositionToTrinityRep(float x, float y, float z) const;
             std::string getDirFileName(unsigned int pMapId) const;
             std::string getDirFileName(unsigned int pMapId, int x, int y) const;
Index: trunk/src/shared/vmap/CoordModelMapping.cpp
===================================================================
--- trunk/src/shared/vmap/CoordModelMapping.cpp (revision 2)
+++ trunk/src/shared/vmap/CoordModelMapping.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/ModelContainer.cpp
===================================================================
--- trunk/src/shared/vmap/ModelContainer.cpp (revision 2)
+++ trunk/src/shared/vmap/ModelContainer.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/VMapDefinitions.h
===================================================================
--- trunk/src/shared/vmap/VMapDefinitions.h (revision 2)
+++ trunk/src/shared/vmap/VMapDefinitions.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/TreeNode.cpp
===================================================================
--- trunk/src/shared/vmap/TreeNode.cpp (revision 2)
+++ trunk/src/shared/vmap/TreeNode.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/CoordModelMapping.h
===================================================================
--- trunk/src/shared/vmap/CoordModelMapping.h (revision 2)
+++ trunk/src/shared/vmap/CoordModelMapping.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/ModelContainer.h
===================================================================
--- trunk/src/shared/vmap/ModelContainer.h (revision 2)
+++ trunk/src/shared/vmap/ModelContainer.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/NodeValueAccess.h
===================================================================
--- trunk/src/shared/vmap/NodeValueAccess.h (revision 2)
+++ trunk/src/shared/vmap/NodeValueAccess.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/TreeNode.h
===================================================================
--- trunk/src/shared/vmap/TreeNode.h (revision 2)
+++ trunk/src/shared/vmap/TreeNode.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
-* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+*
+* Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
 *
 * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
 
Index: trunk/src/shared/vmap/SubModel.cpp
===================================================================
--- trunk/src/shared/vmap/SubModel.cpp (revision 2)
+++ trunk/src/shared/vmap/SubModel.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/DebugCmdLogger.cpp
===================================================================
--- trunk/src/shared/vmap/DebugCmdLogger.cpp (revision 2)
+++ trunk/src/shared/vmap/DebugCmdLogger.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/IVMapManager.h
===================================================================
--- trunk/src/shared/vmap/IVMapManager.h (revision 2)
+++ trunk/src/shared/vmap/IVMapManager.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/ShortBox.h
===================================================================
--- trunk/src/shared/vmap/ShortBox.h (revision 2)
+++ trunk/src/shared/vmap/ShortBox.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/DebugCmdLogger.h
===================================================================
--- trunk/src/shared/vmap/DebugCmdLogger.h (revision 2)
+++ trunk/src/shared/vmap/DebugCmdLogger.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/SubModel.h
===================================================================
--- trunk/src/shared/vmap/SubModel.h (revision 2)
+++ trunk/src/shared/vmap/SubModel.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/ManagedModelContainer.cpp
===================================================================
--- trunk/src/shared/vmap/ManagedModelContainer.cpp (revision 2)
+++ trunk/src/shared/vmap/ManagedModelContainer.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/ManagedModelContainer.h
===================================================================
--- trunk/src/shared/vmap/ManagedModelContainer.h (revision 2)
+++ trunk/src/shared/vmap/ManagedModelContainer.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/ShortVector.h
===================================================================
--- trunk/src/shared/vmap/ShortVector.h (revision 2)
+++ trunk/src/shared/vmap/ShortVector.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/Makefile.am
===================================================================
--- trunk/src/shared/vmap/Makefile.am (revision 23)
+++ trunk/src/shared/vmap/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
@@ -56,2 +56,3 @@
 $(srcdir)/VMapTools.h
 
+
Index: trunk/src/shared/vmap/VMapTools.h
===================================================================
--- trunk/src/shared/vmap/VMapTools.h (revision 2)
+++ trunk/src/shared/vmap/VMapTools.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
-* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+*
+* Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
 *
 * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
 
Index: trunk/src/shared/vmap/BaseModel.cpp
===================================================================
--- trunk/src/shared/vmap/BaseModel.cpp (revision 2)
+++ trunk/src/shared/vmap/BaseModel.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/TileAssembler.cpp
===================================================================
--- trunk/src/shared/vmap/TileAssembler.cpp (revision 2)
+++ trunk/src/shared/vmap/TileAssembler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/vmap/VMapFactory.cpp
===================================================================
--- trunk/src/shared/vmap/VMapFactory.cpp (revision 2)
+++ trunk/src/shared/vmap/VMapFactory.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Util.h
===================================================================
--- trunk/src/shared/Util.h (revision 2)
+++ trunk/src/shared/Util.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -42,22 +44,22 @@
 
 /* Return a random number in the range min..max; (max-min) must be smaller than 32768. */
-MANGOS_DLL_SPEC int32 irand(int32 min, int32 max);
+TRINITY_DLL_SPEC int32 irand(int32 min, int32 max);
 
 /* Return a random number in the range min..max (inclusive). For reliable results, the difference
 * between max and min should be less than RAND32_MAX. */
-MANGOS_DLL_SPEC uint32 urand(uint32 min, uint32 max);
+TRINITY_DLL_SPEC uint32 urand(uint32 min, uint32 max);
 
 /* Return a random number in the range 0 .. RAND32_MAX. */
-MANGOS_DLL_SPEC int32 rand32();
+TRINITY_DLL_SPEC int32 rand32();
 
 /* Return a random double from 0.0 to 1.0 (exclusive). Floats support only 7 valid decimal digits.
  * A double supports up to 15 valid decimal digits and is used internally (RAND32_MAX has 10 digits).
  * With an FPU, there is usually no difference in performance between float and double. */
-MANGOS_DLL_SPEC double rand_norm(void);
+TRINITY_DLL_SPEC double rand_norm(void);
 
 /* Return a random double from 0.0 to 99.9999999999999. Floats support only 7 valid decimal digits.
  * A double supports up to 15 valid decimal digits and is used internaly (RAND32_MAX has 10 digits).
  * With an FPU, there is usually no difference in performance between float and double. */
-MANGOS_DLL_SPEC double rand_chance(void);
+TRINITY_DLL_SPEC double rand_chance(void);
 
 /* Return true if a random roll fits in the specified chance (range 0-100). */
Index: trunk/src/shared/Database/DBCfmt.cpp
===================================================================
--- trunk/src/shared/Database/DBCfmt.cpp (revision 39)
+++ trunk/src/shared/Database/DBCfmt.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/DatabaseMysql.h
===================================================================
--- trunk/src/shared/Database/DatabaseMysql.h (revision 2)
+++ trunk/src/shared/Database/DatabaseMysql.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -34,7 +36,7 @@
 #endif
 
-class MANGOS_DLL_SPEC DatabaseMysql : public Database
+class TRINITY_DLL_SPEC DatabaseMysql : public Database
 {
-    friend class MaNGOS::OperatorNew<DatabaseMysql>;
+    friend class Trinity::OperatorNew<DatabaseMysql>;
 
     public:
Index: trunk/src/shared/Database/SqlOperations.h
===================================================================
--- trunk/src/shared/Database/SqlOperations.h (revision 2)
+++ trunk/src/shared/Database/SqlOperations.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -71,5 +73,5 @@
 class SqlQueryHolderEx;                                     /// points to a holder, added to the delay thread
 
-class SqlResultQueue : public ZThread::LockedQueue<MaNGOS::IQueryCallback*, ZThread::FastMutex>
+class SqlResultQueue : public ZThread::LockedQueue<Trinity::IQueryCallback*, ZThread::FastMutex>
 {
     public:
@@ -82,8 +84,8 @@
     private:
         const char *m_sql;
-        MaNGOS::IQueryCallback * m_callback;
+        Trinity::IQueryCallback * m_callback;
         SqlResultQueue * m_queue;
     public:
-        SqlQuery(const char *sql, MaNGOS::IQueryCallback * callback, SqlResultQueue * queue)
+        SqlQuery(const char *sql, Trinity::IQueryCallback * callback, SqlResultQueue * queue)
             : m_sql(strdup(sql)), m_callback(callback), m_queue(queue) {}
         ~SqlQuery() { void* tofree = const_cast<char*>(m_sql); free(tofree); }
@@ -105,5 +107,5 @@
         QueryResult* GetResult(size_t index);
         void SetResult(size_t index, QueryResult *result);
-        void Execute(MaNGOS::IQueryCallback * callback, SqlDelayThread *thread, SqlResultQueue *queue);
+        void Execute(Trinity::IQueryCallback * callback, SqlDelayThread *thread, SqlResultQueue *queue);
 };
 
@@ -112,8 +114,8 @@
     private:
         SqlQueryHolder * m_holder;
-        MaNGOS::IQueryCallback * m_callback;
+        Trinity::IQueryCallback * m_callback;
         SqlResultQueue * m_queue;
     public:
-        SqlQueryHolderEx(SqlQueryHolder *holder, MaNGOS::IQueryCallback * callback, SqlResultQueue * queue)
+        SqlQueryHolderEx(SqlQueryHolder *holder, Trinity::IQueryCallback * callback, SqlResultQueue * queue)
             : m_holder(holder), m_callback(callback), m_queue(queue) {}
         void Execute(Database *db);
Index: trunk/src/shared/Database/DatabasePostgre.cpp
===================================================================
--- trunk/src/shared/Database/DatabasePostgre.cpp (revision 2)
+++ trunk/src/shared/Database/DatabasePostgre.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -123,5 +125,5 @@
     // guarded block for thread-safe request
     ZThread::Guard<ZThread::FastMutex> query_connection_guard(mMutex);
-    #ifdef MANGOS_DEBUG
+    #ifdef TRINITY_DEBUG
     uint32 _s = getMSTime();
     #endif
@@ -142,5 +144,5 @@
     else
     {
-        #ifdef MANGOS_DEBUG
+        #ifdef TRINITY_DEBUG
         sLog.outDebug("[%u ms] SQL: %s", getMSTime() - _s, sql );
         #endif
@@ -194,5 +196,5 @@
         // guarded block for thread-safe  request
         ZThread::Guard<ZThread::FastMutex> query_connection_guard(mMutex);
-        #ifdef MANGOS_DEBUG
+        #ifdef TRINITY_DEBUG
         uint32 _s = getMSTime();
         #endif
@@ -206,5 +208,5 @@
         else
         {
-            #ifdef MANGOS_DEBUG
+            #ifdef TRINITY_DEBUG
             sLog.outDebug("[%u ms] SQL: %s", getMSTime() - _s, sql );
             #endif
Index: trunk/src/shared/Database/Database.h
===================================================================
--- trunk/src/shared/Database/Database.h (revision 2)
+++ trunk/src/shared/Database/Database.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -34,5 +36,5 @@
 #define MAX_QUERY_LEN   1024
 
-class MANGOS_DLL_SPEC Database
+class TRINITY_DLL_SPEC Database
 {
     protected:
@@ -78,5 +80,5 @@
         bool DirectPExecute(const char *format,...) ATTR_PRINTF(2,3);
 
-        // Writes SQL commands to a LOG file (see mangosd.conf "LogSQL")
+        // Writes SQL commands to a LOG file (see Trinityd.conf "LogSQL")
         bool PExecuteLog(const char *format,...) ATTR_PRINTF(2,3);
 
Index: trunk/src/shared/Database/SqlDelayThread.h
===================================================================
--- trunk/src/shared/Database/SqlDelayThread.h (revision 2)
+++ trunk/src/shared/Database/SqlDelayThread.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/QueryResultPostgre.h
===================================================================
--- trunk/src/shared/Database/QueryResultPostgre.h (revision 2)
+++ trunk/src/shared/Database/QueryResultPostgre.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/DatabaseEnv.h
===================================================================
--- trunk/src/shared/Database/DatabaseEnv.h (revision 37)
+++ trunk/src/shared/Database/DatabaseEnv.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/QueryResultSqlite.cpp
===================================================================
--- trunk/src/shared/Database/QueryResultSqlite.cpp (revision 2)
+++ trunk/src/shared/Database/QueryResultSqlite.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/DBCStores.cpp
===================================================================
--- trunk/src/shared/Database/DBCStores.cpp (revision 2)
+++ trunk/src/shared/Database/DBCStores.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -274,5 +276,5 @@
         // DBC not support uint64 fields but SpellEntry have SpellFamilyFlags mapped at 2 uint32 fields
         // uint32 field already converted to bigendian if need, but must be swapped for correct uint64 bigendian view
-        #if MANGOS_ENDIAN == MANGOS_BIGENDIAN
+        #if TRINITY_ENDIAN == TRINITY_BIGENDIAN
         std::swap(*((uint32*)(&spell->SpellFamilyFlags)),*(((uint32*)(&spell->SpellFamilyFlags))+1));
         #endif
@@ -434,5 +436,5 @@
     if(bad_dbc_files.size() >= DBCFilesCount )
     {
-        sLog.outError("\nIncorrect DataDir value in mangosd.conf or ALL required *.dbc files (%d) not found by path: %sdbc",DBCFilesCount,dataPath.c_str());
+        sLog.outError("\nIncorrect DataDir value in Trinityd.conf or ALL required *.dbc files (%d) not found by path: %sdbc",DBCFilesCount,dataPath.c_str());
         exit(1);
     }
@@ -638,5 +640,5 @@
 
 // script support functions
-MANGOS_DLL_SPEC DBCStorage <SoundEntriesEntry>  const* GetSoundEntriesStore()   { return &sSoundEntriesStore;   }
-MANGOS_DLL_SPEC DBCStorage <SpellEntry>         const* GetSpellStore()          { return &sSpellStore;          }
-MANGOS_DLL_SPEC DBCStorage <SpellRangeEntry>    const* GetSpellRangeStore()     { return &sSpellRangeStore;     }
+TRINITY_DLL_SPEC DBCStorage <SoundEntriesEntry>  const* GetSoundEntriesStore()   { return &sSoundEntriesStore;   }
+TRINITY_DLL_SPEC DBCStorage <SpellEntry>         const* GetSpellStore()          { return &sSpellStore;          }
+TRINITY_DLL_SPEC DBCStorage <SpellRangeEntry>    const* GetSpellRangeStore()     { return &sSpellRangeStore;     }
Index: trunk/src/shared/Database/Field.h
===================================================================
--- trunk/src/shared/Database/Field.h (revision 2)
+++ trunk/src/shared/Database/Field.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/SQLStorage.h
===================================================================
--- trunk/src/shared/Database/SQLStorage.h (revision 2)
+++ trunk/src/shared/Database/SQLStorage.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/DatabaseMysql.cpp
===================================================================
--- trunk/src/shared/Database/DatabaseMysql.cpp (revision 2)
+++ trunk/src/shared/Database/DatabaseMysql.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -152,5 +154,5 @@
         // So better to turn this off
         // ---
-        // This is wrong since mangos use transactions,
+        // This is wrong since Trinity use transactions,
         // autocommit is turned of during it.
         // Setting it to on makes atomic updates work
@@ -189,5 +191,5 @@
         // guarded block for thread-safe mySQL request
         ZThread::Guard<ZThread::FastMutex> query_connection_guard(mMutex);
-        #ifdef MANGOS_DEBUG
+        #ifdef TRINITY_DEBUG
         uint32 _s = getMSTime();
         #endif
@@ -200,5 +202,5 @@
         else
         {
-            #ifdef MANGOS_DEBUG
+            #ifdef TRINITY_DEBUG
             sLog.outDebug("[%u ms] SQL: %s", getMSTimeDiff(_s,getMSTime()), sql );
             #endif
@@ -259,5 +261,5 @@
         // guarded block for thread-safe mySQL request
         ZThread::Guard<ZThread::FastMutex> query_connection_guard(mMutex);
-        #ifdef MANGOS_DEBUG
+        #ifdef TRINITY_DEBUG
         uint32 _s = getMSTime();
         #endif
@@ -270,5 +272,5 @@
         else
         {
-            #ifdef MANGOS_DEBUG
+            #ifdef TRINITY_DEBUG
             sLog.outDebug("[%u ms] SQL: %s", getMSTimeDiff(_s,getMSTime()), sql );
             #endif
Index: trunk/src/shared/Database/DatabaseSqlite.h
===================================================================
--- trunk/src/shared/Database/DatabaseSqlite.h (revision 2)
+++ trunk/src/shared/Database/DatabaseSqlite.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/dbcfile.h
===================================================================
--- trunk/src/shared/Database/dbcfile.h (revision 2)
+++ trunk/src/shared/Database/dbcfile.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/QueryResultMysql.h
===================================================================
--- trunk/src/shared/Database/QueryResultMysql.h (revision 2)
+++ trunk/src/shared/Database/QueryResultMysql.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/PGSQLDelayThread.h
===================================================================
--- trunk/src/shared/Database/PGSQLDelayThread.h (revision 2)
+++ trunk/src/shared/Database/PGSQLDelayThread.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/SqlOperations.cpp
===================================================================
--- trunk/src/shared/Database/SqlOperations.cpp (revision 2)
+++ trunk/src/shared/Database/SqlOperations.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -74,5 +76,5 @@
     while(!empty())
     {
-        MaNGOS::IQueryCallback * callback = next();
+        Trinity::IQueryCallback * callback = next();
         callback->Execute();
         delete callback;
@@ -80,5 +82,5 @@
 }
 
-void SqlQueryHolder::Execute(MaNGOS::IQueryCallback * callback, SqlDelayThread *thread, SqlResultQueue *queue)
+void SqlQueryHolder::Execute(Trinity::IQueryCallback * callback, SqlDelayThread *thread, SqlResultQueue *queue)
 {
     if(!callback || !thread || !queue)
Index: trunk/src/shared/Database/Database.cpp
===================================================================
--- trunk/src/shared/Database/Database.cpp (revision 2)
+++ trunk/src/shared/Database/Database.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/SqlDelayThread.cpp
===================================================================
--- trunk/src/shared/Database/SqlDelayThread.cpp (revision 2)
+++ trunk/src/shared/Database/SqlDelayThread.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/QueryResultPostgre.cpp
===================================================================
--- trunk/src/shared/Database/QueryResultPostgre.cpp (revision 2)
+++ trunk/src/shared/Database/QueryResultPostgre.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/QueryResult.h
===================================================================
--- trunk/src/shared/Database/QueryResult.h (revision 2)
+++ trunk/src/shared/Database/QueryResult.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -20,5 +22,5 @@
 #define QUERYRESULT_H
 
-class MANGOS_DLL_SPEC QueryResult
+class TRINITY_DLL_SPEC QueryResult
 {
     public:
Index: trunk/src/shared/Database/DatabasePostgre.h
===================================================================
--- trunk/src/shared/Database/DatabasePostgre.h (revision 2)
+++ trunk/src/shared/Database/DatabasePostgre.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -34,5 +36,5 @@
 class DatabasePostgre : public Database
 {
-    friend class MaNGOS::OperatorNew<DatabasePostgre>;
+    friend class Trinity::OperatorNew<DatabasePostgre>;
 
     public:
Index: trunk/src/shared/Database/DBCStructure.h
===================================================================
--- trunk/src/shared/Database/DBCStructure.h (revision 39)
+++ trunk/src/shared/Database/DBCStructure.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/MySQLDelayThread.h
===================================================================
--- trunk/src/shared/Database/MySQLDelayThread.h (revision 2)
+++ trunk/src/shared/Database/MySQLDelayThread.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/Field.cpp
===================================================================
--- trunk/src/shared/Database/Field.cpp (revision 2)
+++ trunk/src/shared/Database/Field.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/SQLStorage.cpp
===================================================================
--- trunk/src/shared/Database/SQLStorage.cpp (revision 2)
+++ trunk/src/shared/Database/SQLStorage.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/DatabaseSqlite.cpp
===================================================================
--- trunk/src/shared/Database/DatabaseSqlite.cpp (revision 2)
+++ trunk/src/shared/Database/DatabaseSqlite.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/dbcfile.cpp
===================================================================
--- trunk/src/shared/Database/dbcfile.cpp (revision 2)
+++ trunk/src/shared/Database/dbcfile.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/Makefile.am
===================================================================
--- trunk/src/shared/Database/Makefile.am (revision 23)
+++ trunk/src/shared/Database/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/src/shared/Database/QueryResultMysql.cpp
===================================================================
--- trunk/src/shared/Database/QueryResultMysql.cpp (revision 2)
+++ trunk/src/shared/Database/QueryResultMysql.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/QueryResultSqlite.h
===================================================================
--- trunk/src/shared/Database/QueryResultSqlite.h (revision 2)
+++ trunk/src/shared/Database/QueryResultSqlite.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Database/DatabaseImpl.h
===================================================================
--- trunk/src/shared/Database/DatabaseImpl.h (revision 2)
+++ trunk/src/shared/Database/DatabaseImpl.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -30,5 +32,5 @@
     QueryQueues::iterator itr = m_queryQueues.find(queryThread);
     if (itr == m_queryQueues.end()) return false;
-    m_threadBody->Delay(new SqlQuery(sql, new MaNGOS::QueryCallback<Class>(object, method), itr->second));
+    m_threadBody->Delay(new SqlQuery(sql, new Trinity::QueryCallback<Class>(object, method), itr->second));
     return true;
 }
@@ -42,5 +44,5 @@
     QueryQueues::iterator itr = m_queryQueues.find(queryThread);
     if (itr == m_queryQueues.end()) return false;
-    m_threadBody->Delay(new SqlQuery(sql, new MaNGOS::QueryCallback<Class, ParamType1>(object, method, (QueryResult*)NULL, param1), itr->second));
+    m_threadBody->Delay(new SqlQuery(sql, new Trinity::QueryCallback<Class, ParamType1>(object, method, (QueryResult*)NULL, param1), itr->second));
     return true;
 }
@@ -54,5 +56,5 @@
     QueryQueues::iterator itr = m_queryQueues.find(queryThread);
     if (itr == m_queryQueues.end()) return false;
-    m_threadBody->Delay(new SqlQuery(sql, new MaNGOS::SQueryCallback<ParamType1>(method, (QueryResult*)NULL, param1), itr->second));
+    m_threadBody->Delay(new SqlQuery(sql, new Trinity::SQueryCallback<ParamType1>(method, (QueryResult*)NULL, param1), itr->second));
     return true;
 }
@@ -130,5 +132,5 @@
     QueryQueues::iterator itr = m_queryQueues.find(queryThread);
     if (itr == m_queryQueues.end()) return false;
-    holder->Execute(new MaNGOS::QueryCallback<Class, SqlQueryHolder*>(object, method, (QueryResult*)NULL, holder), m_threadBody, itr->second);
+    holder->Execute(new Trinity::QueryCallback<Class, SqlQueryHolder*>(object, method, (QueryResult*)NULL, holder), m_threadBody, itr->second);
     return true;
 }
@@ -142,5 +144,5 @@
     QueryQueues::iterator itr = m_queryQueues.find(queryThread);
     if (itr == m_queryQueues.end()) return false;
-    holder->Execute(new MaNGOS::QueryCallback<Class, SqlQueryHolder*, ParamType1>(object, method, (QueryResult*)NULL, holder, param1), m_threadBody, itr->second);
+    holder->Execute(new Trinity::QueryCallback<Class, SqlQueryHolder*, ParamType1>(object, method, (QueryResult*)NULL, holder, param1), m_threadBody, itr->second);
     return true;
 }
Index: trunk/src/shared/Database/DBCStores.h
===================================================================
--- trunk/src/shared/Database/DBCStores.h (revision 2)
+++ trunk/src/shared/Database/DBCStores.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -197,6 +199,6 @@
 
 // script support functions
-MANGOS_DLL_SPEC DBCStorage <SoundEntriesEntry>  const* GetSoundEntriesStore();
-MANGOS_DLL_SPEC DBCStorage <SpellEntry>         const* GetSpellStore();
-MANGOS_DLL_SPEC DBCStorage <SpellRangeEntry>    const* GetSpellRangeStore();
+TRINITY_DLL_SPEC DBCStorage <SoundEntriesEntry>  const* GetSoundEntriesStore();
+TRINITY_DLL_SPEC DBCStorage <SpellEntry>         const* GetSpellStore();
+TRINITY_DLL_SPEC DBCStorage <SpellRangeEntry>    const* GetSpellRangeStore();
 #endif
Index: trunk/src/shared/ServiceWin32.cpp
===================================================================
--- trunk/src/shared/ServiceWin32.cpp (revision 2)
+++ trunk/src/shared/ServiceWin32.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or
@@ -9,5 +11,5 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
Index: trunk/src/shared/Mthread.cpp
===================================================================
--- trunk/src/shared/Mthread.cpp (revision 2)
+++ trunk/src/shared/Mthread.cpp (revision 44)
@@ -21,7 +21,7 @@
 
 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE_CC__)
-#  define MANGOS_PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE
+#  define TRINITY_PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE
 #else
-#  define MANGOS_PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
+#  define TRINITY_PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
 #endif
 
@@ -74,5 +74,5 @@
     {
         pthread_mutexattr_init (&attr);
-        pthread_mutexattr_settype (&attr, MANGOS_PTHREAD_MUTEX_RECURSIVE);
+        pthread_mutexattr_settype (&attr, TRINITY_PTHREAD_MUTEX_RECURSIVE);
     }
 
Index: trunk/src/shared/Config/ConfigEnv.h
===================================================================
--- trunk/src/shared/Config/ConfigEnv.h (revision 2)
+++ trunk/src/shared/Config/ConfigEnv.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Config/Config.cpp
===================================================================
--- trunk/src/shared/Config/Config.cpp (revision 2)
+++ trunk/src/shared/Config/Config.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Config/Makefile.am
===================================================================
--- trunk/src/shared/Config/Makefile.am (revision 23)
+++ trunk/src/shared/Config/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/src/shared/Config/Config.h
===================================================================
--- trunk/src/shared/Config/Config.h (revision 2)
+++ trunk/src/shared/Config/Config.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -25,5 +27,5 @@
 class DOTCONFDocument;
 
-class MANGOS_DLL_SPEC Config
+class TRINITY_DLL_SPEC Config
 {
     public:
@@ -54,5 +56,5 @@
 };
 
-#define sConfig MaNGOS::Singleton<Config>::Instance()
+#define sConfig Trinity::Singleton<Config>::Instance()
 
 #endif
Index: trunk/src/shared/Config/dotconfpp/dotconfpp.cpp
===================================================================
--- trunk/src/shared/Config/dotconfpp/dotconfpp.cpp (revision 2)
+++ trunk/src/shared/Config/dotconfpp/dotconfpp.cpp (revision 44)
@@ -103,5 +103,5 @@
 
         // Allowing \" in there causes problems with directory paths
-        // like "C:\MaNGOS\"
+        // like "C:\TrinIty\"
         //if(*line == '\\' && (*(line+1) == '"' || *(line+1) == '\'')){
         if(*line == '\\' && (*(line+1) == '\'')) {
Index: trunk/src/shared/WorldPacket.h
===================================================================
--- trunk/src/shared/WorldPacket.h (revision 2)
+++ trunk/src/shared/WorldPacket.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_WORLDPACKET_H
-#define MANGOSSERVER_WORLDPACKET_H
+#ifndef TRINITYCORE_WORLDPACKET_H
+#define TRINITYCORE_WORLDPACKET_H
 
 #include "Common.h"
Index: trunk/src/shared/Timer.h
===================================================================
--- trunk/src/shared/Timer.h (revision 6)
+++ trunk/src/shared/Timer.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_TIMER_H
-#define MANGOS_TIMER_H
+#ifndef TRINITY_TIMER_H
+#define TRINITY_TIMER_H
 
 #include "Platform/CompilerDefs.h"
Index: trunk/src/shared/Log.h
===================================================================
--- trunk/src/shared/Log.h (revision 2)
+++ trunk/src/shared/Log.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_LOG_H
-#define MANGOSSERVER_LOG_H
+#ifndef TRINITYCORE_LOG_H
+#define TRINITYCORE_LOG_H
 
 #include "Common.h"
@@ -54,7 +56,7 @@
 const int Color_count = int(WHITE)+1;
 
-class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ZThread::FastMutex> >
+class Log : public Trinity::Singleton<Log, Trinity::ClassLevelLockable<Log, ZThread::FastMutex> >
 {
-    friend class MaNGOS::OperatorNew<Log>;
+    friend class Trinity::OperatorNew<Log>;
     Log() : raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL), dberLogfile(NULL), m_colored(false) { Initialize(); }
     ~Log()
@@ -138,8 +140,8 @@
 };
 
-#define sLog MaNGOS::Singleton<Log>::Instance()
+#define sLog Trinity::Singleton<Log>::Instance()
 
-#ifdef MANGOS_DEBUG
-#define DEBUG_LOG MaNGOS::Singleton<Log>::Instance().outDebug
+#ifdef TRINITY_DEBUG
+#define DEBUG_LOG Trinity::Singleton<Log>::Instance().outDebug
 #else
 #define DEBUG_LOG
@@ -147,8 +149,8 @@
 
 // primary for script library
-void MANGOS_DLL_SPEC outstring_log(const char * str, ...) ATTR_PRINTF(1,2);
-void MANGOS_DLL_SPEC detail_log(const char * str, ...) ATTR_PRINTF(1,2);
-void MANGOS_DLL_SPEC debug_log(const char * str, ...) ATTR_PRINTF(1,2);
-void MANGOS_DLL_SPEC error_log(const char * str, ...) ATTR_PRINTF(1,2);
-void MANGOS_DLL_SPEC error_db_log(const char * str, ...) ATTR_PRINTF(1,2);
+void TRINITY_DLL_SPEC outstring_log(const char * str, ...) ATTR_PRINTF(1,2);
+void TRINITY_DLL_SPEC detail_log(const char * str, ...) ATTR_PRINTF(1,2);
+void TRINITY_DLL_SPEC debug_log(const char * str, ...) ATTR_PRINTF(1,2);
+void TRINITY_DLL_SPEC error_log(const char * str, ...) ATTR_PRINTF(1,2);
+void TRINITY_DLL_SPEC error_db_log(const char * str, ...) ATTR_PRINTF(1,2);
 #endif
Index: trunk/src/shared/Makefile.am
===================================================================
--- trunk/src/shared/Makefile.am (revision 39)
+++ trunk/src/shared/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
@@ -119,2 +119,3 @@
 	WheatyExceptionReport.h
 
+
Index: trunk/src/shared/Common.cpp
===================================================================
--- trunk/src/shared/Common.cpp (revision 2)
+++ trunk/src/shared/Common.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/ServiceWin32.h
===================================================================
--- trunk/src/shared/ServiceWin32.h (revision 2)
+++ trunk/src/shared/ServiceWin32.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or
@@ -9,5 +11,5 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
Index: trunk/src/shared/ProgressBar.cpp
===================================================================
--- trunk/src/shared/ProgressBar.cpp (revision 2)
+++ trunk/src/shared/ProgressBar.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/shared/Common.h
===================================================================
--- trunk/src/shared/Common.h (revision 6)
+++ trunk/src/shared/Common.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_COMMON_H
-#define MANGOSSERVER_COMMON_H
+#ifndef TRINITYCORE_COMMON_H
+#define TRINITYCORE_COMMON_H
 
 // config.h needs to be included 1st
Index: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am (revision 23)
+++ trunk/src/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/src/game/WorldLog.h
===================================================================
--- trunk/src/game/WorldLog.h (revision 2)
+++ trunk/src/game/WorldLog.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -21,6 +23,6 @@
 /// \file
 
-#ifndef MANGOS_WORLDLOG_H
-#define MANGOS_WORLDLOG_H
+#ifndef TRINITY_WORLDLOG_H
+#define TRINITY_WORLDLOG_H
 
 #include "Common.h"
@@ -31,11 +33,11 @@
 
 /// %Log packets to a file
-class MANGOS_DLL_DECL WorldLog : public MaNGOS::Singleton<WorldLog, MaNGOS::ClassLevelLockable<WorldLog, ZThread::FastMutex> >
+class TRINITY_DLL_DECL WorldLog : public Trinity::Singleton<WorldLog, Trinity::ClassLevelLockable<WorldLog, ZThread::FastMutex> >
 {
-    friend class MaNGOS::OperatorNew<WorldLog>;
+    friend class Trinity::OperatorNew<WorldLog>;
     WorldLog() : i_file(NULL) { Initialize(); }
     WorldLog(const WorldLog &);
     WorldLog& operator=(const WorldLog &);
-    typedef MaNGOS::ClassLevelLockable<WorldLog, ZThread::FastMutex>::Lock Guard;
+    typedef Trinity::ClassLevelLockable<WorldLog, ZThread::FastMutex>::Lock Guard;
 
     /// Close the file in destructor
Index: trunk/src/game/FleeingMovementGenerator.h
===================================================================
--- trunk/src/game/FleeingMovementGenerator.h (revision 2)
+++ trunk/src/game/FleeingMovementGenerator.h (revision 44)
@@ -1,4 +1,6 @@
 /*
-* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+*
+* Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
 *
 * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
 
-#ifndef MANGOS_FLEEINGMOVEMENTGENERATOR_H
-#define MANGOS_FLEEINGMOVEMENTGENERATOR_H
+#ifndef TRINITY_FLEEINGMOVEMENTGENERATOR_H
+#define TRINITY_FLEEINGMOVEMENTGENERATOR_H
 
 #include "MovementGenerator.h"
@@ -26,5 +28,5 @@
 
 template<class T>
-class MANGOS_DLL_SPEC FleeingMovementGenerator
+class TRINITY_DLL_SPEC FleeingMovementGenerator
 : public MovementGeneratorMedium< T, FleeingMovementGenerator<T> >
 {
Index: trunk/src/game/tools.cpp
===================================================================
--- trunk/src/game/tools.cpp (revision 2)
+++ trunk/src/game/tools.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/InstanceData.h
===================================================================
--- trunk/src/game/InstanceData.h (revision 2)
+++ trunk/src/game/InstanceData.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_INSTANCE_DATA_H
-#define MANGOS_INSTANCE_DATA_H
+#ifndef TRINITY_INSTANCE_DATA_H
+#define TRINITY_INSTANCE_DATA_H
 
 #include "Common.h"
@@ -28,5 +30,5 @@
 class Creature;
 
-class MANGOS_DLL_SPEC InstanceData
+class TRINITY_DLL_SPEC InstanceData
 {
     public:
Index: trunk/src/game/Guild.cpp
===================================================================
--- trunk/src/game/Guild.cpp (revision 37)
+++ trunk/src/game/Guild.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/WorldSocket.h
===================================================================
--- trunk/src/game/WorldSocket.h (revision 6)
+++ trunk/src/game/WorldSocket.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Object.cpp
===================================================================
--- trunk/src/game/Object.cpp (revision 42)
+++ trunk/src/game/Object.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -330,5 +332,5 @@
                 *data << (uint32)((Player*)this)->GetTransTime();
             }
-            //MaNGOS currently not have support for other than player on transport
+            //TrinIty currently not have support for other than player on transport
         }
 
@@ -541,4 +543,6 @@
                 updateMask->SetBit(GAMEOBJECT_DYN_FLAGS);
             }
+            if (GetUInt32Value(GAMEOBJECT_ARTKIT))
+                updateMask->SetBit(GAMEOBJECT_ARTKIT);
         }
     }
@@ -569,6 +573,7 @@
             {
                 // remove custom flag before send
+
                 if( index == UNIT_NPC_FLAGS )
-                    *data << uint32(m_uint32Values[ index ] & ~UNIT_NPC_FLAG_GUARD);
+                    *data << uint32(m_uint32Values[ index ] & ~(UNIT_NPC_FLAG_GUARD + UNIT_NPC_FLAG_OUTDOORPVP));
                 // FIXME: Some values at server stored in float format but must be sent to client in uint32 format
                 else if(index >= UNIT_FIELD_BASEATTACKTIME && index <= UNIT_FIELD_RANGEDATTACKTIME)
@@ -1117,6 +1122,6 @@
     rand_z = z;
 
-    MaNGOS::NormalizeMapCoord(rand_x);
-    MaNGOS::NormalizeMapCoord(rand_y);
+    Trinity::NormalizeMapCoord(rand_x);
+    Trinity::NormalizeMapCoord(rand_y);
     UpdateGroundPositionZ(rand_x,rand_y,rand_z);            // update to LOS height if available
 }
@@ -1131,5 +1136,5 @@
 bool WorldObject::IsPositionValid() const
 {
-    return MaNGOS::IsValidMapCoord(m_positionX,m_positionY,m_positionZ,m_orientation);
+    return Trinity::IsValidMapCoord(m_positionX,m_positionY,m_positionZ,m_orientation);
 }
 
@@ -1177,5 +1182,5 @@
 }
 
-namespace MaNGOS
+namespace Trinity
 {
     class MessageChatLocaleCacheDo
@@ -1210,5 +1215,5 @@
                         i_data_cache.resize(cache_idx+1);
 
-                    char const* text = objmgr.GetMangosString(i_textId,loc_idx);
+                    char const* text = objmgr.GetTrinityString(i_textId,loc_idx);
 
                     data = new WorldPacket(SMSG_MESSAGECHAT, 200);
@@ -1234,9 +1239,9 @@
             std::vector<WorldPacket*> i_data_cache;             // 0 = default, i => i-1 locale index
     };
-}                                                           // namespace MaNGOS
+}                                                           // namespace Trinity
 
 void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid)
 {
-    CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY());
 
     Cell cell(p);
@@ -1244,7 +1249,7 @@
     cell.SetNoCreate();
 
-    MaNGOS::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY));
-    MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo> say_worker(say_do);
-    TypeContainerVisitor<MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);
+    Trinity::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY));
+    Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do);
+    TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);
     CellLock<GridReadGuard> cell_lock(cell, p);
     cell_lock->Visit(cell_lock, message, *GetMap());
@@ -1253,5 +1258,5 @@
 void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
 {
-    CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY());
 
     Cell cell(p);
@@ -1259,7 +1264,7 @@
     cell.SetNoCreate();
 
-    MaNGOS::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL));
-    MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo> say_worker(say_do);
-    TypeContainerVisitor<MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);
+    Trinity::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL));
+    Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do);
+    TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);
     CellLock<GridReadGuard> cell_lock(cell, p);
     cell_lock->Visit(cell_lock, message, *GetMap());
@@ -1268,5 +1273,5 @@
 void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote)
 {
-    CellPair p = MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY());
 
     Cell cell(p);
@@ -1274,7 +1279,7 @@
     cell.SetNoCreate();
 
-    MaNGOS::MessageChatLocaleCacheDo say_do(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
-    MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo> say_worker(say_do);
-    TypeContainerVisitor<MaNGOS::PlayerWorker<MaNGOS::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);
+    Trinity::MessageChatLocaleCacheDo say_do(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
+    Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do);
+    TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);
     CellLock<GridReadGuard> cell_lock(cell, p);
     cell_lock->Visit(cell_lock, message, *GetMap());
@@ -1288,5 +1293,5 @@
 
     uint32 loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
-    char const* text = objmgr.GetMangosString(textId,loc_idx);
+    char const* text = objmgr.GetTrinityString(textId,loc_idx);
 
     WorldPacket data(SMSG_MESSAGECHAT, 200);
@@ -1436,6 +1441,6 @@
     y = GetPositionY() + (GetObjectSize() + distance2d) * sin(absAngle);
 
-    MaNGOS::NormalizeMapCoord(x);
-    MaNGOS::NormalizeMapCoord(y);
+    Trinity::NormalizeMapCoord(x);
+    Trinity::NormalizeMapCoord(y);
 }
 
Index: trunk/src/game/WorldSocketMgr.cpp
===================================================================
--- trunk/src/game/WorldSocketMgr.cpp (revision 6)
+++ trunk/src/game/WorldSocketMgr.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008,2007 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/GridStates.cpp
===================================================================
--- trunk/src/game/GridStates.cpp (revision 2)
+++ trunk/src/game/GridStates.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/BattleGroundNA.cpp
===================================================================
--- trunk/src/game/BattleGroundNA.cpp (revision 9)
+++ trunk/src/game/BattleGroundNA.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/ReactorAI.cpp
===================================================================
--- trunk/src/game/ReactorAI.cpp (revision 2)
+++ trunk/src/game/ReactorAI.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/HateMatrix.h
===================================================================
--- trunk/src/game/HateMatrix.h (revision 2)
+++ trunk/src/game/HateMatrix.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_HATEMATRIX_H
-#define MANGOS_HATEMATRIX_H
+#ifndef TRINITY_HATEMATRIX_H
+#define TRINITY_HATEMATRIX_H
 
 #include "Utilities/HashMap.h"
@@ -25,5 +27,5 @@
 class Unit;
 
-struct MANGOS_DLL_DECL HateMatrix
+struct TRINITY_DLL_DECL HateMatrix
 {
     typedef hash_map<Unit *, uint32> HateMatrixMapType;
Index: trunk/src/game/GroupReference.cpp
===================================================================
--- trunk/src/game/GroupReference.cpp (revision 2)
+++ trunk/src/game/GroupReference.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/MapInstanced.h
===================================================================
--- trunk/src/game/MapInstanced.h (revision 2)
+++ trunk/src/game/MapInstanced.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,19 +11,19 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_MAP_INSTANCED_H
-#define MANGOS_MAP_INSTANCED_H
+#ifndef TRINITY_MAP_INSTANCED_H
+#define TRINITY_MAP_INSTANCED_H
 
 #include "Map.h"
 #include "InstanceSaveMgr.h"
 
-class MANGOS_DLL_DECL MapInstanced : public Map
+class TRINITY_DLL_DECL MapInstanced : public Map
 {
     friend class MapManager;
Index: trunk/src/game/Transports.cpp
===================================================================
--- trunk/src/game/Transports.cpp (revision 2)
+++ trunk/src/game/Transports.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Creature.h
===================================================================
--- trunk/src/game/Creature.h (revision 37)
+++ trunk/src/game/Creature.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_CREATURE_H
-#define MANGOSSERVER_CREATURE_H
+#ifndef TRINITYCORE_CREATURE_H
+#define TRINITYCORE_CREATURE_H
 
 #include "Common.h"
@@ -54,5 +56,6 @@
     GOSSIP_OPTION_ARMORER           = 15,                   //UNIT_NPC_FLAG_ARMORER           = 16384,
     GOSSIP_OPTION_UNLEARNTALENTS    = 16,                   //UNIT_NPC_FLAG_TRAINER (bonus option for GOSSIP_OPTION_TRAINER)
-    GOSSIP_OPTION_UNLEARNPETSKILLS  = 17                    //UNIT_NPC_FLAG_TRAINER (bonus option for GOSSIP_OPTION_TRAINER)
+    GOSSIP_OPTION_UNLEARNPETSKILLS  = 17,                   //UNIT_NPC_FLAG_TRAINER (bonus option for GOSSIP_OPTION_TRAINER)
+    GOSSIP_OPTION_OUTDOORPVP        = 18                    //added by code (option for outdoor pvp creatures)
 };
 
@@ -122,4 +125,5 @@
     CREATURE_FLAG_EXTRA_NO_CRUSH        = 0x00000020,       // creature can't do crush attacks
     CREATURE_FLAG_EXTRA_NO_XP_AT_KILL   = 0x00000040,       // creature kill not provide XP
+    CREATURE_FLAG_EXTRA_WORLDEVENT      = 0x00004000,       // custom flag for world event creatures (left room for merging)
 };
 
@@ -362,5 +366,5 @@
 #define MAX_VENDOR_ITEMS 255                                // Limitation in item count field size in SMSG_LIST_INVENTORY
 
-class MANGOS_DLL_SPEC Creature : public Unit
+class TRINITY_DLL_SPEC Creature : public Unit
 {
     CreatureAI *i_AI;
@@ -475,4 +479,5 @@
         uint32 GetNpcTextId();
         void LoadGossipOptions();
+        void ResetGossipOptions();
         GossipOption const* GetGossipOption( uint32 id ) const;
         void addGossipOption(GossipOption const& gso) { m_goptions.push_back(gso); }
Index: trunk/src/game/SpellEffects.cpp
===================================================================
--- trunk/src/game/SpellEffects.cpp (revision 37)
+++ trunk/src/game/SpellEffects.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -49,4 +51,5 @@
 #include "BattleGroundEY.h"
 #include "BattleGroundWS.h"
+#include "OutdoorPvPMgr.h"
 #include "VMapFactory.h"
 #include "Language.h"
@@ -221,5 +224,5 @@
 void Spell::EffectUnused(uint32 /*i*/)
 {
-    // NOT USED BY ANY SPELL OR USELESS OR IMPLEMENTED IN DIFFERENT WAY IN MANGOS
+    // NOT USED BY ANY SPELL OR USELESS OR IMPLEMENTED IN DIFFERENT WAY IN TRINITY
 }
 
@@ -2862,4 +2865,8 @@
             }
         }
+        // handle outdoor pvp object opening, return true if go was registered for handling
+        // these objects must have been spawned by outdoorpvp!
+        else if(gameObjTarget->GetGOInfo()->type == GAMEOBJECT_TYPE_GOOBER && sOutdoorPvPMgr.HandleOpenGo(player, gameObjTarget->GetGUID()))
+            return;
         lockId = gameObjTarget->GetLockId();
         guid = gameObjTarget->GetGUID();
Index: trunk/src/game/PlayerDump.cpp
===================================================================
--- trunk/src/game/PlayerDump.cpp (revision 2)
+++ trunk/src/game/PlayerDump.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/OutdoorPvPSI.h
===================================================================
--- trunk/src/game/OutdoorPvPSI.h (revision 44)
+++ trunk/src/game/OutdoorPvPSI.h (revision 44)
@@ -0,0 +1,57 @@
+#ifndef OUTDOOR_PVP_SI_
+#define OUTDOOR_PVP_SI_
+
+#include "OutdoorPvP.h"
+
+const uint32 SI_SILITHYST_FLAG_GO_SPELL = 29518;
+
+const uint32 SI_SILITHYST_FLAG = 29519;
+
+const uint32 SI_TRACES_OF_SILITHYST = 29534;
+
+const uint32 SI_CENARION_FAVOR = 30754;
+
+const uint32 SI_MAX_RESOURCES = 200;
+
+const uint32 OutdoorPvPSIBuffZonesNum = 3;
+
+const uint32 OutdoorPvPSIBuffZones[OutdoorPvPSIBuffZonesNum] = { 1377, 3428, 3429 };
+
+const uint32 SI_AREATRIGGER_H = 4168;
+
+const uint32 SI_AREATRIGGER_A = 4162;
+
+const uint32 SI_TURNIN_QUEST_CM_A = 17090;
+
+const uint32 SI_TURNIN_QUEST_CM_H = 18199;
+
+const uint32 SI_SILITHYST_MOUND = 181597;
+
+enum SI_WorldStates{
+    SI_GATHERED_A = 2313,
+    SI_GATHERED_H = 2314,
+    SI_SILITHYST_MAX = 2317
+};
+
+class OutdoorPvPSI : public OutdoorPvP
+{
+public:
+    OutdoorPvPSI();
+    bool SetupOutdoorPvP();
+    void HandlePlayerEnterZone(Player *plr, uint32 zone);
+    void HandlePlayerLeaveZone(Player *plr, uint32 zone);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket &data);
+    void SendRemoveWorldStates(Player * plr);
+    bool HandleAreaTrigger(Player * plr, uint32 trigger);
+    bool HandleDropFlag(Player * plr, uint32 spellId);
+    bool HandleCustomSpell(Player * plr, uint32 spellId, GameObject *go);
+    void BuffTeam(uint32 team);
+    void UpdateWorldState();
+private:
+    uint32 m_Gathered_A;
+    uint32 m_Gathered_H;
+    uint32 m_LastController;
+};
+
+#endif
Index: trunk/src/game/NullCreatureAI.h
===================================================================
--- trunk/src/game/NullCreatureAI.h (revision 2)
+++ trunk/src/game/NullCreatureAI.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,18 +11,18 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_NULLCREATUREAI_H
-#define MANGOS_NULLCREATUREAI_H
+#ifndef TRINITY_NULLCREATUREAI_H
+#define TRINITY_NULLCREATUREAI_H
 
 #include "CreatureAI.h"
 
-class MANGOS_DLL_DECL NullCreatureAI : public CreatureAI
+class TRINITY_DLL_DECL NullCreatureAI : public CreatureAI
 {
     public:
Index: trunk/src/game/DestinationHolder.h
===================================================================
--- trunk/src/game/DestinationHolder.h (revision 2)
+++ trunk/src/game/DestinationHolder.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_DESTINATION_HOLDER_H
-#define MANGOS_DESTINATION_HOLDER_H
+#ifndef TRINITY_DESTINATION_HOLDER_H
+#define TRINITY_DESTINATION_HOLDER_H
 
 #include "Platform/Define.h"
@@ -28,5 +30,5 @@
 
 template<typename TRAVELLER>
-class MANGOS_DLL_DECL DestinationHolder
+class TRINITY_DLL_DECL DestinationHolder
 {
     TimeTrackerSmall i_tracker;
Index: trunk/src/game/Chat.h
===================================================================
--- trunk/src/game/Chat.h (revision 42)
+++ trunk/src/game/Chat.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_CHAT_H
-#define MANGOSSERVER_CHAT_H
+#ifndef TRINITYCORE_CHAT_H
+#define TRINITYCORE_CHAT_H
 
 #include "SharedDefines.h"
@@ -60,5 +62,5 @@
         static char* LineFromMessage(char*& pos) { char* start = strtok(pos,"\n"); pos = NULL; return start; }
 
-        const char *GetMangosString(int32 entry);
+        const char *GetTrinityString(int32 entry);
 
         void SendSysMessage(          const char *str);
@@ -110,6 +112,4 @@
         bool HandleDrunkCommand(const char* args);
 
-        bool HandleIRCpmCommand(const char* args);
-
         bool HandleEventActiveListCommand(const char* args);
         bool HandleEventStartCommand(const char* args);
@@ -171,5 +171,5 @@
         bool HandleReloadLootTemplatesQuestMailCommand(const char* args);
         bool HandleReloadLootTemplatesSkinningCommand(const char* args);
-        bool HandleReloadMangosStringCommand(const char* args);
+        bool HandleReloadTrinityStringCommand(const char* args);
         bool HandleReloadNpcGossipCommand(const char* args);
         bool HandleReloadNpcTrainerCommand(const char* args);
@@ -391,4 +391,6 @@
         bool HandleGetLootRecipient(const char * args);
         bool HandleDebugArenaCommand(const char * args);
+        bool HandleDebugThreatList(const char * args);
+        bool HandleDebugHostilRefList(const char * args);
 
         Player*   getSelectedPlayer();
Index: trunk/src/game/QuestDef.h
===================================================================
--- trunk/src/game/QuestDef.h (revision 37)
+++ trunk/src/game/QuestDef.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_QUEST_H
-#define MANGOSSERVER_QUEST_H
+#ifndef TRINITYCORE_QUEST_H
+#define TRINITYCORE_QUEST_H
 
 #include "Platform/Define.h"
@@ -128,14 +130,14 @@
     QUEST_FLAGS_DAILY          = 4096,                      // 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_DB_ALLOWED = 0xFFFF | QUEST_MANGOS_FLAGS_REPEATABLE | QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT,
-
-    // Mangos flags for internal use only
-    QUEST_MANGOS_FLAGS_DELIVER              = 0x040000,     // Internal flag computed only
-    QUEST_MANGOS_FLAGS_SPEAKTO              = 0x080000,     // Internal flag computed only
-    QUEST_MANGOS_FLAGS_KILL_OR_CAST         = 0x100000,     // Internal flag computed only
-    QUEST_MANGOS_FLAGS_TIMED                = 0x200000,     // Internal flag computed only
+    // Trinity flags for set SpecialFlags in DB if required but used only at server
+    QUEST_TRINITY_FLAGS_REPEATABLE           = 0x010000,     // Set by 1 in SpecialFlags from DB
+    QUEST_TRINITY_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_TRINITY_FLAGS_DB_ALLOWED = 0xFFFF | QUEST_TRINITY_FLAGS_REPEATABLE | QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT,
+
+    // Trinity flags for internal use only
+    QUEST_TRINITY_FLAGS_DELIVER              = 0x040000,     // Internal flag computed only
+    QUEST_TRINITY_FLAGS_SPEAKTO              = 0x080000,     // Internal flag computed only
+    QUEST_TRINITY_FLAGS_KILL_OR_CAST         = 0x100000,     // Internal flag computed only
+    QUEST_TRINITY_FLAGS_TIMED                = 0x200000,     // Internal flag computed only
 };
 
@@ -213,5 +215,5 @@
         uint32 GetQuestStartScript() const { return QuestStartScript; }
         uint32 GetQuestCompleteScript() const { return QuestCompleteScript; }
-        bool   IsRepeatable() const { return QuestFlags & QUEST_MANGOS_FLAGS_REPEATABLE; }
+        bool   IsRepeatable() const { return QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE; }
         bool   IsAutoComplete() const { return QuestMethod ? false : true; }
         uint32 GetFlags() const { return QuestFlags; }
Index: trunk/src/game/PetHandler.cpp
===================================================================
--- trunk/src/game/PetHandler.cpp (revision 37)
+++ trunk/src/game/PetHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/FollowerRefManager.h
===================================================================
--- trunk/src/game/FollowerRefManager.h (revision 2)
+++ trunk/src/game/FollowerRefManager.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/OutdoorPvPZM.cpp
===================================================================
--- trunk/src/game/OutdoorPvPZM.cpp (revision 44)
+++ trunk/src/game/OutdoorPvPZM.cpp (revision 44)
@@ -0,0 +1,476 @@
+#include "OutdoorPvPZM.h"
+#include "ObjectMgr.h"
+#include "OutdoorPvPMgr.h"
+#include "Player.h"
+#include "Creature.h"
+#include "ObjectAccessor.h"
+#include "WorldPacket.h"
+#include "GossipDef.h"
+#include "World.h"
+
+OutdoorPvPObjectiveZM_Beacon::OutdoorPvPObjectiveZM_Beacon(OutdoorPvP *pvp, ZM_BeaconType type)
+: OutdoorPvPObjective(pvp), m_TowerType(type), m_TowerState(ZM_TOWERSTATE_N)
+{
+    AddCapturePoint(ZMCapturePoints[type].entry,ZMCapturePoints[type].map,ZMCapturePoints[type].x,ZMCapturePoints[type].y,ZMCapturePoints[type].z,ZMCapturePoints[type].o,ZMCapturePoints[type].rot0,ZMCapturePoints[type].rot1,ZMCapturePoints[type].rot2,ZMCapturePoints[type].rot3);
+}
+
+void OutdoorPvPObjectiveZM_Beacon::FillInitialWorldStates(WorldPacket &data)
+{
+    data << uint32(ZMBeaconInfo[m_TowerType].ui_tower_n) << uint32(bool(m_TowerState & ZM_TOWERSTATE_N));
+    data << uint32(ZMBeaconInfo[m_TowerType].map_tower_n) << uint32(bool(m_TowerState & ZM_TOWERSTATE_N));
+    data << uint32(ZMBeaconInfo[m_TowerType].ui_tower_a) << uint32(bool(m_TowerState & ZM_TOWERSTATE_A));
+    data << uint32(ZMBeaconInfo[m_TowerType].map_tower_a) << uint32(bool(m_TowerState & ZM_TOWERSTATE_A));
+    data << uint32(ZMBeaconInfo[m_TowerType].ui_tower_h) << uint32(bool(m_TowerState & ZM_TOWERSTATE_H));
+    data << uint32(ZMBeaconInfo[m_TowerType].map_tower_h) << uint32(bool(m_TowerState & ZM_TOWERSTATE_H));
+}
+
+void OutdoorPvPObjectiveZM_Beacon::UpdateTowerState()
+{
+    m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].ui_tower_n),uint32(bool(m_TowerState & ZM_TOWERSTATE_N)));
+    m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].map_tower_n),uint32(bool(m_TowerState & ZM_TOWERSTATE_N)));
+    m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].ui_tower_a),uint32(bool(m_TowerState & ZM_TOWERSTATE_A)));
+    m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].map_tower_a),uint32(bool(m_TowerState & ZM_TOWERSTATE_A)));
+    m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].ui_tower_h),uint32(bool(m_TowerState & ZM_TOWERSTATE_H)));
+    m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].map_tower_h),uint32(bool(m_TowerState & ZM_TOWERSTATE_H)));
+}
+
+bool OutdoorPvPObjectiveZM_Beacon::HandlePlayerEnter(Player *plr)
+{
+    if(OutdoorPvPObjective::HandlePlayerEnter(plr))
+    {
+        plr->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_disp, 1);
+        uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+        plr->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_pos, phase);
+        plr->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_n, m_NeutralValue);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveZM_Beacon::HandlePlayerLeave(Player *plr)
+{
+    plr->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_disp, 0);
+    OutdoorPvPObjective::HandlePlayerLeave(plr);
+}
+
+bool OutdoorPvPObjectiveZM_Beacon::HandleCapturePointEvent(Player *plr, uint32 eventId)
+{
+    if(eventId == ZMBeaconInfo[m_TowerType].event_enter)
+    {
+        this->HandlePlayerEnter(plr);
+        return true;
+    }
+    else if (eventId == ZMBeaconInfo[m_TowerType].event_leave)
+    {
+        this->HandlePlayerLeave(plr);
+        return true;
+    }
+    return false;
+}
+
+bool OutdoorPvPObjectiveZM_Beacon::Update(uint32 diff)
+{
+    if(OutdoorPvPObjective::Update(diff))
+    {
+        if(m_OldState != m_State)
+        {
+            // if changing from controlling alliance to horde
+            if( m_OldState == OBJECTIVESTATE_ALLIANCE )
+            {
+                if(((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled)
+                    ((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled--;
+                sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(ZMBeaconLooseA[m_TowerType]));
+            }
+            // if changing from controlling horde to alliance
+            else if ( m_OldState == OBJECTIVESTATE_HORDE )
+            {
+                if(((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled)
+                    ((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled--;
+                sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(ZMBeaconLooseH[m_TowerType]));
+            }
+
+            switch(m_State)
+            {
+            case OBJECTIVESTATE_ALLIANCE:
+                m_TowerState = ZM_TOWERSTATE_A;
+                if(((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled<ZM_NUM_BEACONS)
+                    ((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled++;
+                sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(ZMBeaconCaptureA[m_TowerType]));
+                break;
+            case OBJECTIVESTATE_HORDE:
+                m_TowerState = ZM_TOWERSTATE_H;
+                if(((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled<ZM_NUM_BEACONS)
+                    ((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled++;
+                sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(ZMBeaconCaptureH[m_TowerType]));
+                break;
+            case OBJECTIVESTATE_NEUTRAL:
+            case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
+            case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
+            case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
+            case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
+                m_TowerState = ZM_TOWERSTATE_N;
+                break;
+            }
+
+            UpdateTowerState();
+        }
+
+        if(m_ShiftPhase != m_OldPhase)
+        {
+            // send this too, sometimes the slider disappears, dunno why :(
+            SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_disp, 1);
+            // send these updates to only the ones in this objective
+            uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+            SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_pos, phase);
+            SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_n, m_NeutralValue);
+        }
+        return true;
+    }
+    return false;
+}
+
+bool OutdoorPvPZM::Update(uint32 diff)
+{
+    bool changed = false;
+    if(changed = OutdoorPvP::Update(diff))
+    {
+        if(m_AllianceTowersControlled == ZM_NUM_BEACONS)
+            m_GraveYard->SetBeaconState(ALLIANCE);
+        else if(m_HordeTowersControlled == ZM_NUM_BEACONS)
+            m_GraveYard->SetBeaconState(HORDE);
+        else
+            m_GraveYard->SetBeaconState(0);
+    }
+    return changed;
+}
+
+void OutdoorPvPZM::HandlePlayerEnterZone(Player * plr, uint32 zone)
+{
+    if(plr->GetTeam() == ALLIANCE)
+    {
+        if(m_GraveYard->m_GraveYardState & ZM_GRAVEYARD_A)
+            plr->CastSpell(plr,ZM_CAPTURE_BUFF,true);
+    }
+    else
+    {
+        if(m_GraveYard->m_GraveYardState & ZM_GRAVEYARD_H)
+            plr->CastSpell(plr,ZM_CAPTURE_BUFF,true);
+    }
+    OutdoorPvP::HandlePlayerEnterZone(plr,zone);
+}
+
+void OutdoorPvPZM::HandlePlayerLeaveZone(Player * plr, uint32 zone)
+{
+    // remove buffs
+    plr->RemoveAurasDueToSpell(ZM_CAPTURE_BUFF);
+    // remove flag
+    plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
+    plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
+    OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
+}
+
+OutdoorPvPZM::OutdoorPvPZM()
+{
+    m_TypeId = OUTDOOR_PVP_ZM;
+    m_GraveYard = NULL;
+    m_AllianceTowersControlled = 0;
+    m_HordeTowersControlled = 0;
+
+}
+
+bool OutdoorPvPZM::SetupOutdoorPvP()
+{
+    m_AllianceTowersControlled = 0;
+    m_HordeTowersControlled = 0;
+
+    // add the zones affected by the pvp buff
+    for(int i = 0; i < OutdoorPvPZMBuffZonesNum; ++i)
+        sOutdoorPvPMgr.AddZone(OutdoorPvPZMBuffZones[i],this);
+
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveZM_Beacon(this,ZM_BEACON_WEST));
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveZM_Beacon(this,ZM_BEACON_EAST));
+    m_GraveYard = new OutdoorPvPObjectiveZM_GraveYard(this);
+    m_OutdoorPvPObjectives.insert(m_GraveYard); // though the update function isn't used, the handleusego is!
+
+    return true;
+}
+
+void OutdoorPvPZM::HandleKillImpl(Player *plr, Unit * killed)
+{
+    if(killed->GetTypeId() != TYPEID_PLAYER)
+        return;
+
+    if(plr->GetTeam() == ALLIANCE && ((Player*)killed)->GetTeam() != ALLIANCE)
+        plr->CastSpell(plr,ZM_AlliancePlayerKillReward,true);
+    else if(plr->GetTeam() == HORDE && ((Player*)killed)->GetTeam() != HORDE)
+        plr->CastSpell(plr,ZM_HordePlayerKillReward,true);
+}
+
+void OutdoorPvPZM::BuffTeam(uint32 team)
+{
+    if(team == ALLIANCE)
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->CastSpell(plr,ZM_CAPTURE_BUFF,true);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(ZM_CAPTURE_BUFF);
+        }
+    }
+    else if(team == HORDE)
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->CastSpell(plr,ZM_CAPTURE_BUFF,true);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(ZM_CAPTURE_BUFF);
+        }
+    }
+    else
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(ZM_CAPTURE_BUFF);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(ZM_CAPTURE_BUFF);
+        }
+    }
+}
+
+bool OutdoorPvPObjectiveZM_GraveYard::Update(uint32 diff)
+{
+    bool retval = m_State != m_OldState;
+    m_State = m_OldState;
+    return retval;
+}
+
+int32 OutdoorPvPObjectiveZM_GraveYard::HandleOpenGo(Player *plr, uint64 guid)
+{
+    uint32 retval = OutdoorPvPObjective::HandleOpenGo(plr, guid);
+    if(retval>=0)
+    {
+        if(plr->HasAura(ZM_BATTLE_STANDARD_A,0) && m_GraveYardState != ZM_GRAVEYARD_A)
+        {
+            if(m_GraveYardState == ZM_GRAVEYARD_H)
+                sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOOSE_GY_H));
+            m_GraveYardState = ZM_GRAVEYARD_A;
+            DelObject(0);   // only one gotype is used in the whole outdoor pvp, no need to call it a constant
+            AddObject(0,ZM_Banner_A.entry,ZM_Banner_A.map,ZM_Banner_A.x,ZM_Banner_A.y,ZM_Banner_A.z,ZM_Banner_A.o,ZM_Banner_A.rot0,ZM_Banner_A.rot1,ZM_Banner_A.rot2,ZM_Banner_A.rot3);
+            objmgr.RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE);          // rem gy
+            objmgr.AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE, false);   // add gy
+            ((OutdoorPvPZM*)m_PvP)->BuffTeam(ALLIANCE);
+            plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
+            sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A));
+        }
+        else if(plr->HasAura(ZM_BATTLE_STANDARD_H,0) && m_GraveYardState != ZM_GRAVEYARD_H)
+        {
+            if(m_GraveYardState == ZM_GRAVEYARD_A)
+                sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOOSE_GY_A));
+            m_GraveYardState = ZM_GRAVEYARD_H;
+            DelObject(0);   // only one gotype is used in the whole outdoor pvp, no need to call it a constant
+            AddObject(0,ZM_Banner_H.entry,ZM_Banner_H.map,ZM_Banner_H.x,ZM_Banner_H.y,ZM_Banner_H.z,ZM_Banner_H.o,ZM_Banner_H.rot0,ZM_Banner_H.rot1,ZM_Banner_H.rot2,ZM_Banner_H.rot3);
+            objmgr.RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE);          // rem gy
+            objmgr.AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE, false);   // add gy
+            ((OutdoorPvPZM*)m_PvP)->BuffTeam(HORDE);
+            plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
+            sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H));
+        }
+        UpdateTowerState();
+    }
+    return retval;
+}
+
+OutdoorPvPObjectiveZM_GraveYard::OutdoorPvPObjectiveZM_GraveYard(OutdoorPvP *pvp)
+: OutdoorPvPObjective(pvp)
+{
+    m_BothControllingFaction = 0;
+    m_GraveYardState = ZM_GRAVEYARD_N;
+    m_FlagCarrierGUID = 0;
+    // add field scouts here
+    AddCreature(ZM_ALLIANCE_FIELD_SCOUT,ZM_AllianceFieldScout.entry,ZM_AllianceFieldScout.teamval,ZM_AllianceFieldScout.map,ZM_AllianceFieldScout.x,ZM_AllianceFieldScout.y,ZM_AllianceFieldScout.z,ZM_AllianceFieldScout.o);
+    AddCreature(ZM_HORDE_FIELD_SCOUT,ZM_HordeFieldScout.entry,ZM_HordeFieldScout.teamval,ZM_HordeFieldScout.map,ZM_HordeFieldScout.x,ZM_HordeFieldScout.y,ZM_HordeFieldScout.z,ZM_HordeFieldScout.o);
+    // add neutral banner
+    AddObject(0,ZM_Banner_N.entry,ZM_Banner_N.map,ZM_Banner_N.x,ZM_Banner_N.y,ZM_Banner_N.z,ZM_Banner_N.o,ZM_Banner_N.rot0,ZM_Banner_N.rot1,ZM_Banner_N.rot2,ZM_Banner_N.rot3);
+}
+
+void OutdoorPvPObjectiveZM_GraveYard::UpdateTowerState()
+{
+    m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_N,uint32(bool(m_GraveYardState & ZM_GRAVEYARD_N)));
+    m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_H,uint32(bool(m_GraveYardState & ZM_GRAVEYARD_H)));
+    m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_A,uint32(bool(m_GraveYardState & ZM_GRAVEYARD_A)));
+
+    m_PvP->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_READY,uint32(m_BothControllingFaction == ALLIANCE));
+    m_PvP->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_NOT_READY,uint32(m_BothControllingFaction != ALLIANCE));
+    m_PvP->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_READY,uint32(m_BothControllingFaction == HORDE));
+    m_PvP->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_NOT_READY,uint32(m_BothControllingFaction != HORDE));
+}
+
+void OutdoorPvPObjectiveZM_GraveYard::FillInitialWorldStates(WorldPacket &data)
+{
+    data << ZM_MAP_GRAVEYARD_N  << uint32(bool(m_GraveYardState & ZM_GRAVEYARD_N));
+    data << ZM_MAP_GRAVEYARD_H  << uint32(bool(m_GraveYardState & ZM_GRAVEYARD_H));
+    data << ZM_MAP_GRAVEYARD_A  << uint32(bool(m_GraveYardState & ZM_GRAVEYARD_A));
+
+    data << ZM_MAP_ALLIANCE_FLAG_READY  << uint32(m_BothControllingFaction == ALLIANCE);
+    data << ZM_MAP_ALLIANCE_FLAG_NOT_READY  << uint32(m_BothControllingFaction != ALLIANCE);
+    data << ZM_MAP_HORDE_FLAG_READY  << uint32(m_BothControllingFaction == HORDE);
+    data << ZM_MAP_HORDE_FLAG_NOT_READY  << uint32(m_BothControllingFaction != HORDE);
+}
+
+void OutdoorPvPObjectiveZM_GraveYard::SetBeaconState(uint32 controlling_faction)
+{
+    // nothing to do here
+    if(m_BothControllingFaction == controlling_faction)
+        return;
+    m_BothControllingFaction = controlling_faction;
+
+    switch(controlling_faction)
+    {
+    case ALLIANCE:
+        // if ally already controls the gy and taken back both beacons, return, nothing to do for us
+        if(m_GraveYardState & ZM_GRAVEYARD_A)
+            return;
+        // ally doesn't control the gy, but controls the side beacons -> add gossip option, add neutral banner
+        break;
+    case HORDE:
+        // if horde already controls the gy and taken back both beacons, return, nothing to do for us
+        if(m_GraveYardState & ZM_GRAVEYARD_H)
+            return;
+        // horde doesn't control the gy, but controls the side beacons -> add gossip option, add neutral banner
+        break;
+    default:
+        // if the graveyard is not neutral, then leave it that way
+        // if the graveyard is neutral, then we have to dispel the buff from the flag carrier
+        if(m_GraveYardState & ZM_GRAVEYARD_N)
+        {
+            // gy was neutral, thus neutral banner was spawned, it is possible that someone was taking the flag to the gy
+            if(m_FlagCarrierGUID)
+            {
+                // remove flag from carrier, reset flag carrier guid
+                Player * p = objmgr.GetPlayer(m_FlagCarrierGUID);
+                if(p)
+                {
+                   p->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
+                   p->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
+                }
+                m_FlagCarrierGUID = 0;
+            }
+        }
+        break;
+    }
+    // send worldstateupdate
+    UpdateTowerState();
+}
+
+bool OutdoorPvPObjectiveZM_GraveYard::CanTalkTo(Player * plr, Creature * c, GossipOption & gso)
+{
+    uint64 guid = c->GetGUID();
+    std::map<uint64,uint32>::iterator itr = m_CreatureTypes.find(guid);
+    if(itr != m_CreatureTypes.end())
+    {
+        if(itr->second == ZM_ALLIANCE_FIELD_SCOUT && plr->GetTeam() == ALLIANCE && m_BothControllingFaction == ALLIANCE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_A)
+        {
+            gso.Option.assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_GOSSIP_ALLIANCE));
+            return true;
+        }
+        else if(itr->second == ZM_HORDE_FIELD_SCOUT && plr->GetTeam() == HORDE && m_BothControllingFaction == HORDE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_H)
+        {
+            gso.Option.assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_GOSSIP_HORDE));
+            return true;
+        }
+    }
+    return false;
+}
+
+bool OutdoorPvPObjectiveZM_GraveYard::HandleGossipOption(Player *plr, uint64 guid, uint32 gossipid)
+{
+    std::map<uint64,uint32>::iterator itr = m_CreatureTypes.find(guid);
+    if(itr != m_CreatureTypes.end())
+    {
+        Creature * cr = HashMapHolder<Creature>::Find(guid);
+        if(!cr)
+            return true;
+        // if the flag is already taken, then return
+        if(m_FlagCarrierGUID)
+            return true;
+        if(itr->second == ZM_ALLIANCE_FIELD_SCOUT)
+        {
+            cr->CastSpell(plr,ZM_BATTLE_STANDARD_A,true);
+            m_FlagCarrierGUID = plr->GetGUID();
+        }
+        else if(itr->second == ZM_HORDE_FIELD_SCOUT)
+        {
+            cr->CastSpell(plr,ZM_BATTLE_STANDARD_H,true);
+            m_FlagCarrierGUID = plr->GetGUID();
+        }
+        UpdateTowerState();
+        plr->PlayerTalkClass->CloseGossip();
+        return true;
+    }
+    return false;
+}
+
+bool OutdoorPvPObjectiveZM_GraveYard::HandleDropFlag(Player * plr, uint32 spellId)
+{
+    switch(spellId)
+    {
+    case ZM_BATTLE_STANDARD_A:
+        m_FlagCarrierGUID = 0;
+        return true;
+    case ZM_BATTLE_STANDARD_H:
+        m_FlagCarrierGUID = 0;
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPZM::FillInitialWorldStates(WorldPacket &data)
+{
+    data << ZM_WORLDSTATE_UNK_1 << uint32(1);
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+    {
+        (*itr)->FillInitialWorldStates(data);
+    }
+}
+
+void OutdoorPvPZM::SendRemoveWorldStates(Player *plr)
+{
+    plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_N_W,0);
+    plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_POS_W,0);
+    plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_DISPLAY_W,0);
+    plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_N_E,0);
+    plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_POS_E,0);
+    plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_DISPLAY_E,0);
+    plr->SendUpdateWorldState(ZM_WORLDSTATE_UNK_1,1);
+    plr->SendUpdateWorldState(ZM_UI_TOWER_EAST_N,0);
+    plr->SendUpdateWorldState(ZM_UI_TOWER_EAST_H,0);
+    plr->SendUpdateWorldState(ZM_UI_TOWER_EAST_A,0);
+    plr->SendUpdateWorldState(ZM_UI_TOWER_WEST_N,0);
+    plr->SendUpdateWorldState(ZM_UI_TOWER_WEST_H,0);
+    plr->SendUpdateWorldState(ZM_UI_TOWER_WEST_A,0);
+    plr->SendUpdateWorldState(ZM_MAP_TOWER_EAST_N,0);
+    plr->SendUpdateWorldState(ZM_MAP_TOWER_EAST_H,0);
+    plr->SendUpdateWorldState(ZM_MAP_TOWER_EAST_A,0);
+    plr->SendUpdateWorldState(ZM_MAP_GRAVEYARD_H,0);
+    plr->SendUpdateWorldState(ZM_MAP_GRAVEYARD_A,0);
+    plr->SendUpdateWorldState(ZM_MAP_GRAVEYARD_N,0);
+    plr->SendUpdateWorldState(ZM_MAP_TOWER_WEST_N,0);
+    plr->SendUpdateWorldState(ZM_MAP_TOWER_WEST_H,0);
+    plr->SendUpdateWorldState(ZM_MAP_TOWER_WEST_A,0);
+    plr->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_READY,0);
+    plr->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_NOT_READY,0);
+    plr->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_NOT_READY,0);
+    plr->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_READY,0);
+}
Index: trunk/src/game/MovementHandler.cpp
===================================================================
--- trunk/src/game/MovementHandler.cpp (revision 9)
+++ trunk/src/game/MovementHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -46,4 +48,13 @@
     {
         LogoutPlayer(false);
+        return;
+    }
+
+    if(!sWorld.IsAllowedMap(loc.mapid) && (GetSecurity() < SEC_GAMEMASTER))
+    {
+        if(sWorld.IsAllowedMap(GetPlayer()->m_homebindMapId))
+            GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
+        else
+            LogoutPlayer(false);
         return;
     }
@@ -250,5 +261,5 @@
     }
 
-    if (!MaNGOS::IsValidMapCoord(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o))
+    if (!Trinity::IsValidMapCoord(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o))
         return;
 
@@ -261,5 +272,5 @@
             return;
 
-        if( !MaNGOS::IsValidMapCoord(movementInfo.x+movementInfo.t_x, movementInfo.y+movementInfo.t_y,
+        if( !Trinity::IsValidMapCoord(movementInfo.x+movementInfo.t_x, movementInfo.y+movementInfo.t_y,
             movementInfo.z+movementInfo.t_z, movementInfo.o+movementInfo.t_o) )
             return;
Index: trunk/src/game/BattleGroundRL.cpp
===================================================================
--- trunk/src/game/BattleGroundRL.cpp (revision 9)
+++ trunk/src/game/BattleGroundRL.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Level1.cpp
===================================================================
--- trunk/src/game/Level1.cpp (revision 42)
+++ trunk/src/game/Level1.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -32,5 +34,4 @@
 #include "CellImpl.h"
 #include "InstanceSaveMgr.h"
-#include "IRCClient.h"
 #include "Util.h"
 #ifdef _DEBUG_VMAPS
@@ -124,5 +125,5 @@
         return false;
     //char str[1024];
-    //sprintf(str, GetMangosString(LANG_ANNOUNCE_COLOR), m_session->GetPlayer()->GetName(), args);
+    //sprintf(str, GetTrinityString(LANG_ANNOUNCE_COLOR), m_session->GetPlayer()->GetName(), args);
     sWorld.SendWorldText(LANG_ANNOUNCE_COLOR, m_session->GetPlayer()->GetName(), args);
     return true;
@@ -137,11 +138,4 @@
     sWorld.SendWorldText(LANG_SYSTEMMESSAGE,args);
 
-    if((sIRC.BOTMASK & 256) != 0)
-    {
-        std::string ircchan = "#";
-        ircchan += sIRC._irc_chan[sIRC.anchn].c_str();
-        sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 System Message \00304,08\037/!\\\037\017 %s", "%s", args), true);
-    }
-
     return true;
 }
@@ -153,5 +147,5 @@
         return false;
 
-    std::string str = GetMangosString(LANG_GLOBAL_NOTIFY);
+    std::string str = GetTrinityString(LANG_GLOBAL_NOTIFY);
     str += args;
 
@@ -159,11 +153,4 @@
     data << str;
     sWorld.SendGlobalMessage(&data);
-
-    if((sIRC.BOTMASK & 256) != 0)
-    {
-        std::string ircchan = "#";
-        ircchan += sIRC._irc_chan[sIRC.anchn].c_str();
-        sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 Global Notify \00304,08\037/!\\\037\017 %s", "%s", args), true);
-    }
 
     return true;
@@ -250,5 +237,5 @@
     if (!*args)
     {
-        PSendSysMessage(LANG_YOU_ARE, m_session->GetPlayer()->isGMVisible() ?  GetMangosString(LANG_VISIBLE) : GetMangosString(LANG_INVISIBLE));
+        PSendSysMessage(LANG_YOU_ARE, m_session->GetPlayer()->isGMVisible() ?  GetTrinityString(LANG_VISIBLE) : GetTrinityString(LANG_INVISIBLE));
         return true;
     }
@@ -302,5 +289,5 @@
         }
     }
-    CellPair cell_val = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
+    CellPair cell_val = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
     Cell cell(cell_val);
 
@@ -321,5 +308,5 @@
     float floor_z = map->GetHeight(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ());
 
-    GridPair p = MaNGOS::ComputeGridPair(obj->GetPositionX(), obj->GetPositionY());
+    GridPair p = Trinity::ComputeGridPair(obj->GetPositionX(), obj->GetPositionY());
 
     int gx=63-p.x_coord;
@@ -341,5 +328,5 @@
         (obj->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), obj->GetName(),
         (obj->GetTypeId() == TYPEID_PLAYER ? "GUID" : "Entry"), (obj->GetTypeId() == TYPEID_PLAYER ? obj->GetGUIDLow(): obj->GetEntry()) );
-    sLog.outDebug(GetMangosString(LANG_MAP_POSITION),
+    sLog.outDebug(GetTrinityString(LANG_MAP_POSITION),
         obj->GetMapId(), (mapEntry ? mapEntry->name[sWorld.GetDefaultDbcLocale()] : "<unknown>" ),
         zone_id, (zoneEntry ? zoneEntry->area_name[sWorld.GetDefaultDbcLocale()] : "<unknown>" ),
@@ -431,5 +418,5 @@
     else if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
     {
-        PSendSysMessage(LANG_SUMMONING, name.c_str(),GetMangosString(LANG_OFFLINE));
+        PSendSysMessage(LANG_SUMMONING, name.c_str(),GetTrinityString(LANG_OFFLINE));
 
         // in point where GM stay
@@ -803,5 +790,5 @@
     chr->SetPower(POWER_ENERGY, energy );
 
-    sLog.outDetail(GetMangosString(LANG_CURRENT_ENERGY),chr->GetMaxPower(POWER_ENERGY));
+    sLog.outDetail(GetTrinityString(LANG_CURRENT_ENERGY),chr->GetMaxPower(POWER_ENERGY));
 
     return true;
@@ -844,6 +831,5 @@
 
     PSendSysMessage(LANG_YOU_CHANGE_RAGE, chr->GetName(), rage/10, ragem/10);
-                                                            // Special case: I use GetMangosString here to get local of destination char ;)
-    ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_RAGE_CHANGED), m_session->GetPlayer()->GetName(), rage/10, ragem/10);
+    ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_RAGE_CHANGED), m_session->GetPlayer()->GetName(), rage/10, ragem/10);
 
     chr->SetMaxPower(POWER_RAGE,ragem );
@@ -1033,5 +1019,5 @@
         if(chr != m_session->GetPlayer())
             // to send localized data to target
-            ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_TAXIS_ADDED), m_session->GetPlayer()->GetName());
+            ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_TAXIS_ADDED), m_session->GetPlayer()->GetName());
         return true;
     }
@@ -1043,5 +1029,5 @@
 
         if(chr != m_session->GetPlayer())
-            ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_TAXIS_REMOVED), m_session->GetPlayer()->GetName());
+            ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_TAXIS_REMOVED), m_session->GetPlayer()->GetName());
 
         return true;
@@ -1086,5 +1072,5 @@
 
     if(chr != m_session->GetPlayer())
-        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_ASPEED_CHANGED), m_session->GetPlayer()->GetName(), ASpeed);
+        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_ASPEED_CHANGED), m_session->GetPlayer()->GetName(), ASpeed);
 
     chr->SetSpeed(MOVE_WALK,    ASpeed,true);
@@ -1129,5 +1115,5 @@
 
     if(chr != m_session->GetPlayer())
-        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_SPEED_CHANGED), m_session->GetPlayer()->GetName(), Speed);
+        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_SPEED_CHANGED), m_session->GetPlayer()->GetName(), Speed);
 
     chr->SetSpeed(MOVE_RUN,Speed,true);
@@ -1169,5 +1155,5 @@
 
     if(chr != m_session->GetPlayer())
-        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_SWIM_SPEED_CHANGED), m_session->GetPlayer()->GetName(), Swim);
+        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_SWIM_SPEED_CHANGED), m_session->GetPlayer()->GetName(), Swim);
 
     chr->SetSpeed(MOVE_SWIM,Swim,true);
@@ -1209,5 +1195,5 @@
 
     if(chr != m_session->GetPlayer())
-        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_BACK_SPEED_CHANGED), m_session->GetPlayer()->GetName(), BSpeed);
+        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_BACK_SPEED_CHANGED), m_session->GetPlayer()->GetName(), BSpeed);
 
     chr->SetSpeed(MOVE_WALKBACK,BSpeed,true);
@@ -1242,5 +1228,5 @@
 
     if(chr != m_session->GetPlayer())
-        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_FLY_SPEED_CHANGED), m_session->GetPlayer()->GetName(), FSpeed);
+        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_FLY_SPEED_CHANGED), m_session->GetPlayer()->GetName(), FSpeed);
 
     chr->SetSpeed(MOVE_FLY,FSpeed,true);
@@ -1274,5 +1260,5 @@
 
     if(chr != m_session->GetPlayer())
-        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_SIZE_CHANGED), m_session->GetPlayer()->GetName(), Scale);
+        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_SIZE_CHANGED), m_session->GetPlayer()->GetName(), Scale);
 
     chr->SetFloatValue(OBJECT_FIELD_SCALE_X, Scale);
@@ -1518,5 +1504,5 @@
 
     if(chr != m_session->GetPlayer())
-        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_MOUNT_GIVED), m_session->GetPlayer()->GetName());
+        ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_MOUNT_GIVED), m_session->GetPlayer()->GetName());
 
     chr->SetUInt32Value( UNIT_FIELD_FLAGS , 0x001000 );
@@ -1561,5 +1547,5 @@
         int32 newmoney = moneyuser + addmoney;
 
-        sLog.outDetail(GetMangosString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney);
+        sLog.outDetail(GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney);
         if(newmoney <= 0 )
         {
@@ -1567,5 +1553,5 @@
 
             if(chr != m_session->GetPlayer())
-                ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_ALL_MONEY_GONE), m_session->GetPlayer()->GetName());
+                ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_ALL_MONEY_GONE), m_session->GetPlayer()->GetName());
 
             chr->SetMoney(0);
@@ -1575,5 +1561,5 @@
             PSendSysMessage(LANG_YOU_TAKE_MONEY, abs(addmoney), chr->GetName());
             if(chr != m_session->GetPlayer())
-                ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_MONEY_TAKEN), m_session->GetPlayer()->GetName(), abs(addmoney));
+                ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_MONEY_TAKEN), m_session->GetPlayer()->GetName(), abs(addmoney));
             chr->SetMoney( newmoney );
         }
@@ -1583,9 +1569,9 @@
         PSendSysMessage(LANG_YOU_GIVE_MONEY, addmoney, chr->GetName());
         if(chr != m_session->GetPlayer())
-            ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetMangosString(LANG_YOURS_MONEY_GIVEN), m_session->GetPlayer()->GetName(), addmoney);
+            ChatHandler(chr).PSendSysMessage(ChatHandler(chr).GetTrinityString(LANG_YOURS_MONEY_GIVEN), m_session->GetPlayer()->GetName(), addmoney);
         chr->ModifyMoney( addmoney );
     }
 
-    sLog.outDetail(GetMangosString(LANG_NEW_MONEY), moneyuser, addmoney, chr->GetMoney() );
+    sLog.outDetail(GetTrinityString(LANG_NEW_MONEY), moneyuser, addmoney, chr->GetMoney() );
 
     return true;
@@ -1818,5 +1804,5 @@
     if(!*args)
     {
-        PSendSysMessage(LANG_COMMAND_WHISPERACCEPTING, m_session->GetPlayer()->isAcceptWhispers() ?  GetMangosString(LANG_ON) : GetMangosString(LANG_OFF));
+        PSendSysMessage(LANG_COMMAND_WHISPERACCEPTING, m_session->GetPlayer()->isAcceptWhispers() ?  GetTrinityString(LANG_ON) : GetTrinityString(LANG_OFF));
         return true;
     }
@@ -2104,5 +2090,5 @@
     else if (uint64 guid = objmgr.GetPlayerGUIDByName(name.c_str()))
     {
-        PSendSysMessage(LANG_TELEPORTING_TO, name.c_str(), GetMangosString(LANG_OFFLINE), tele->name.c_str());
+        PSendSysMessage(LANG_TELEPORTING_TO, name.c_str(), GetTrinityString(LANG_OFFLINE), tele->name.c_str());
         Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation,MapManager::Instance().GetZoneId(tele->mapId,tele->position_x,tele->position_y),guid);
     }
@@ -2376,23 +2362,4 @@
 }
 
-bool ChatHandler::HandleIRCpmCommand(const char* args)
-{
-    std::string Msg = args;
-    if (Msg.find(" ") == std::string::npos)
-        return false;
-    std::string To = Msg.substr(0, Msg.find(" "));
-    Msg = Msg.substr(Msg.find(" ") + 1);
-    std::size_t pos;
-    while((pos = To.find("||")) != std::string::npos)
-    {
-        std::size_t find1 = To.find("||", pos);
-        To.replace(pos, find1 - pos + 2, "|");
-    }	
-	sIRC.SendIRC("PRIVMSG "+To+" : <WoW>["+m_session->GetPlayerName()+"] : " + Msg);
-    //Msg = "|cffCC4ACCTo [" + To + "]: " + Msg + "|r";
-    sIRC.Send_WoW_Player(m_session->GetPlayer(), "|cffCC4ACCTo ["+To+"]: "+Msg);
-    return true;
-}
-
 //teleport at coordinates
 bool ChatHandler::HandleGoZoneXYCommand(const char* args)
Index: trunk/src/game/Bag.cpp
===================================================================
--- trunk/src/game/Bag.cpp (revision 2)
+++ trunk/src/game/Bag.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/InstanceSaveMgr.cpp
===================================================================
--- trunk/src/game/InstanceSaveMgr.cpp (revision 2)
+++ trunk/src/game/InstanceSaveMgr.cpp (revision 44)
@@ -1,4 +1,7 @@
 /*
- * Copyright (C) 2005,2006,2007 MaNGOS <http://www.mangosproject.org/>
+/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ *
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +12,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Level3.cpp
===================================================================
--- trunk/src/game/Level3.cpp (revision 42)
+++ trunk/src/game/Level3.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -74,5 +76,5 @@
     HandleReloadCommandCommand("");
     HandleReloadReservedNameCommand("");
-    HandleReloadMangosStringCommand("");
+    HandleReloadTrinityStringCommand("");
     HandleReloadGameTeleCommand("");
     return true;
@@ -325,9 +327,9 @@
 }
 
-bool ChatHandler::HandleReloadMangosStringCommand(const char*)
-{
-    sLog.outString( "Re-Loading mangos_string Table!" );
-    objmgr.LoadMangosStrings();
-    SendGlobalSysMessage("DB table `mangos_string` reloaded.");
+bool ChatHandler::HandleReloadTrinityStringCommand(const char*)
+{
+    sLog.outString( "Re-Loading trinity_string Table!" );
+    objmgr.LoadTrinityStrings();
+    SendGlobalSysMessage("DB table `trinity_string` reloaded.");
     return true;
 }
@@ -850,5 +852,5 @@
         if(!sSpellStore.LookupEntry(spell_id))
         {
-            PSendSysMessage(LANG_UNKNOWN_SPELL, target==m_session->GetPlayer() ? GetMangosString(LANG_YOU) : target->GetName());
+            PSendSysMessage(LANG_UNKNOWN_SPELL, target==m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : target->GetName());
             SetSentErrorMessage(true);
             return false;
@@ -860,5 +862,5 @@
         target->GetSession()->SendPacket(&data);
         target->RemoveSpellCooldown(spell_id);
-        PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target==m_session->GetPlayer() ? GetMangosString(LANG_YOU) : target->GetName());
+        PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target==m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : target->GetName());
     }
     return true;
@@ -1771,5 +1773,5 @@
         plTarget = pl;
 
-    sLog.outDetail(GetMangosString(LANG_ADDITEM), itemId, count);
+    sLog.outDetail(GetTrinityString(LANG_ADDITEM), itemId, count);
 
     ItemPrototype const *pProto = objmgr.GetItemPrototype(itemId);
@@ -1850,5 +1852,5 @@
         plTarget = pl;
 
-    sLog.outDetail(GetMangosString(LANG_ADDITEMSET), itemsetId);
+    sLog.outDetail(GetTrinityString(LANG_ADDITEMSET), itemsetId);
 
     QueryResult *result = WorldDatabase.PQuery("SELECT entry FROM item_template WHERE itemset = %u",itemsetId);
@@ -2448,5 +2450,5 @@
             {
                 // send skill in "id - [namedlink locale]" format
-                PSendSysMessage(LANG_SKILL_LIST,id,id,name.c_str(),localeNames[loc],(target->HasSkill(id) ? m_session->GetMangosString(LANG_KNOWN) : ""));
+                PSendSysMessage(LANG_SKILL_LIST,id,id,name.c_str(),localeNames[loc],(target->HasSkill(id) ? m_session->GetTrinityString(LANG_KNOWN) : ""));
 
                 ++counter;
@@ -2532,18 +2534,18 @@
                 // include rank in link name
                 if(rank)
-                    ss << GetMangosString(LANG_SPELL_RANK) << rank;
+                    ss << GetTrinityString(LANG_SPELL_RANK) << rank;
 
                 ss << " " << localeNames[loc] << "]|h|r";
 
                 if(talent)
-                    ss << GetMangosString(LANG_TALENT);
+                    ss << GetTrinityString(LANG_TALENT);
                 if(passive)
-                    ss << GetMangosString(LANG_PASSIVE);
+                    ss << GetTrinityString(LANG_PASSIVE);
                 if(learn)
-                    ss << GetMangosString(LANG_LEARN);
+                    ss << GetTrinityString(LANG_LEARN);
                 if(known)
-                    ss << GetMangosString(LANG_KNOWN);
+                    ss << GetTrinityString(LANG_KNOWN);
                 if(active)
-                    ss << GetMangosString(LANG_ACTIVE);
+                    ss << GetTrinityString(LANG_ACTIVE);
 
                 SendSysMessage(ss.str().c_str());
@@ -2605,12 +2607,12 @@
                         {
                             if(target->GetQuestRewardStatus(qinfo->GetQuestId()))
-                                statusStr = GetMangosString(LANG_COMMAND_QUEST_REWARDED);
+                                statusStr = GetTrinityString(LANG_COMMAND_QUEST_REWARDED);
                             else
-                                statusStr = GetMangosString(LANG_COMMAND_QUEST_COMPLETE);
+                                statusStr = GetTrinityString(LANG_COMMAND_QUEST_COMPLETE);
                         }
                         else if(status == QUEST_STATUS_INCOMPLETE)
-                            statusStr = GetMangosString(LANG_COMMAND_QUEST_ACTIVE);
-
-                        PSendSysMessage(LANG_QUEST_LIST,qinfo->GetQuestId(),qinfo->GetQuestId(),title.c_str(),(status == QUEST_STATUS_COMPLETE ? GetMangosString(LANG_COMPLETE) : (status == QUEST_STATUS_INCOMPLETE ? GetMangosString(LANG_ACTIVE) : "") ));
+                            statusStr = GetTrinityString(LANG_COMMAND_QUEST_ACTIVE);
+
+                        PSendSysMessage(LANG_QUEST_LIST,qinfo->GetQuestId(),qinfo->GetQuestId(),title.c_str(),(status == QUEST_STATUS_COMPLETE ? GetTrinityString(LANG_COMPLETE) : (status == QUEST_STATUS_INCOMPLETE ? GetTrinityString(LANG_ACTIVE) : "") ));
                         ++counter;
                         continue;
@@ -2632,12 +2634,12 @@
             {
                 if(target->GetQuestRewardStatus(qinfo->GetQuestId()))
-                    statusStr = GetMangosString(LANG_COMMAND_QUEST_REWARDED);
+                    statusStr = GetTrinityString(LANG_COMMAND_QUEST_REWARDED);
                 else
-                    statusStr = GetMangosString(LANG_COMMAND_QUEST_COMPLETE);
+                    statusStr = GetTrinityString(LANG_COMMAND_QUEST_COMPLETE);
             }
             else if(status == QUEST_STATUS_INCOMPLETE)
-                statusStr = GetMangosString(LANG_COMMAND_QUEST_ACTIVE);
-
-            PSendSysMessage(LANG_QUEST_LIST,qinfo->GetQuestId(),qinfo->GetQuestId(), title.c_str(),(status == QUEST_STATUS_COMPLETE ? GetMangosString(LANG_COMPLETE) : (status == QUEST_STATUS_INCOMPLETE ? GetMangosString(LANG_ACTIVE) : "") ));
+                statusStr = GetTrinityString(LANG_COMMAND_QUEST_ACTIVE);
+
+            PSendSysMessage(LANG_QUEST_LIST,qinfo->GetQuestId(),qinfo->GetQuestId(), title.c_str(),(status == QUEST_STATUS_COMPLETE ? GetTrinityString(LANG_COMPLETE) : (status == QUEST_STATUS_INCOMPLETE ? GetTrinityString(LANG_ACTIVE) : "") ));
             ++counter;
         }
@@ -3366,12 +3368,12 @@
         g_team = data->team;
 
-        std::string team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_NOTEAM);
+        std::string team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_NOTEAM);
 
         if(g_team == 0)
-            team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_ANY);
+            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
         else if(g_team == HORDE)
-            team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_HORDE);
+            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
         else if(g_team == ALLIANCE)
-            team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
+            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
 
         PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, g_id,team_name.c_str(),player->GetZoneId());
@@ -3382,9 +3384,9 @@
 
         if(g_team == 0)
-            team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_ANY);
+            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
         else if(g_team == HORDE)
-            team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_HORDE);
+            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
         else if(g_team == ALLIANCE)
-            team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
+            team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
 
         if(g_team == ~uint32(0))
@@ -3831,5 +3833,5 @@
     {
         iValue = (uint32)atoi(py);
-        sLog.outDebug(GetMangosString(LANG_SET_UINT), GUID_LOPART(guid), Opcode, iValue);
+        sLog.outDebug(GetTrinityString(LANG_SET_UINT), GUID_LOPART(guid), Opcode, iValue);
         target->SetUInt32Value( Opcode , iValue );
         PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), Opcode,iValue);
@@ -3838,5 +3840,5 @@
     {
         fValue = (float)atof(py);
-        sLog.outDebug(GetMangosString(LANG_SET_FLOAT), GUID_LOPART(guid), Opcode, fValue);
+        sLog.outDebug(GetTrinityString(LANG_SET_FLOAT), GUID_LOPART(guid), Opcode, fValue);
         target->SetFloatValue( Opcode , fValue );
         PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), Opcode,fValue);
@@ -3882,5 +3884,5 @@
     {
         iValue = target->GetUInt32Value( Opcode );
-        sLog.outDebug(GetMangosString(LANG_GET_UINT), GUID_LOPART(guid), Opcode, iValue);
+        sLog.outDebug(GetTrinityString(LANG_GET_UINT), GUID_LOPART(guid), Opcode, iValue);
         PSendSysMessage(LANG_GET_UINT_FIELD, GUID_LOPART(guid), Opcode,    iValue);
     }
@@ -3888,5 +3890,5 @@
     {
         fValue = target->GetFloatValue( Opcode );
-        sLog.outDebug(GetMangosString(LANG_GET_FLOAT), GUID_LOPART(guid), Opcode, fValue);
+        sLog.outDebug(GetTrinityString(LANG_GET_FLOAT), GUID_LOPART(guid), Opcode, fValue);
         PSendSysMessage(LANG_GET_FLOAT_FIELD, GUID_LOPART(guid), Opcode, fValue);
     }
@@ -3911,5 +3913,5 @@
         return false;
 
-    sLog.outDebug(GetMangosString(LANG_SET_32BIT), Opcode, Value);
+    sLog.outDebug(GetTrinityString(LANG_SET_32BIT), Opcode, Value);
 
     m_session->GetPlayer( )->SetUInt32Value( Opcode , 2^Value );
@@ -3939,5 +3941,5 @@
     }
 
-    sLog.outDebug(GetMangosString(LANG_CHANGE_32BIT), Opcode, Value);
+    sLog.outDebug(GetTrinityString(LANG_CHANGE_32BIT), Opcode, Value);
 
     int CurrentValue = (int)m_session->GetPlayer( )->GetUInt32Value( Opcode );
@@ -4019,6 +4021,6 @@
     }
 
-    char const* talentStr = GetMangosString(LANG_TALENT);
-    char const* passiveStr = GetMangosString(LANG_PASSIVE);
+    char const* talentStr = GetTrinityString(LANG_TALENT);
+    char const* passiveStr = GetTrinityString(LANG_PASSIVE);
 
     Unit::AuraMap const& uAuras = unit->GetAuras();
@@ -4790,7 +4792,7 @@
                 active = true;
             bool permanent = (fields[1].GetUInt64() == (uint64)0);
-            std::string bantime = permanent?GetMangosString(LANG_BANINFO_INFINITE):secsToTimeString(fields[1].GetUInt64(), true);
+            std::string bantime = permanent?GetTrinityString(LANG_BANINFO_INFINITE):secsToTimeString(fields[1].GetUInt64(), true);
             PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
-                fields[0].GetString(), bantime.c_str(), active ? GetMangosString(LANG_BANINFO_YES):GetMangosString(LANG_BANINFO_NO), fields[4].GetString(), fields[5].GetString());
+                fields[0].GetString(), bantime.c_str(), active ? GetTrinityString(LANG_BANINFO_YES):GetTrinityString(LANG_BANINFO_NO), fields[4].GetString(), fields[5].GetString());
         }while (result->NextRow());
 
@@ -4809,6 +4811,6 @@
         bool permanent = (fields[6].GetUInt64()==(uint64)0);
         PSendSysMessage(LANG_BANINFO_IPENTRY,
-            fields[0].GetString(), fields[1].GetString(), permanent ? GetMangosString(LANG_BANINFO_NEVER):fields[2].GetString(),
-            permanent ? GetMangosString(LANG_BANINFO_INFINITE):secsToTimeString(fields[3].GetUInt64(), true).c_str(), fields[4].GetString(), fields[5].GetString());
+            fields[0].GetString(), fields[1].GetString(), permanent ? GetTrinityString(LANG_BANINFO_NEVER):fields[2].GetString(),
+            permanent ? GetTrinityString(LANG_BANINFO_INFINITE):secsToTimeString(fields[3].GetUInt64(), true).c_str(), fields[4].GetString(), fields[5].GetString());
         delete result;
     }
@@ -4902,13 +4904,13 @@
     Player* pl = m_session->GetPlayer();
 
-    CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
+    CellPair p(Trinity::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
     Cell cell(p);
     cell.data.Part.reserved = ALL_DISTRICT;
     cell.SetNoCreate();
 
-    MaNGOS::RespawnDo u_do;
-    MaNGOS::WorldObjectWorker<MaNGOS::RespawnDo> worker(u_do);
-
-    TypeContainerVisitor<MaNGOS::WorldObjectWorker<MaNGOS::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
+    Trinity::RespawnDo u_do;
+    Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(u_do);
+
+    TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
     CellLock<GridReadGuard> cell_lock(cell, p);
     cell_lock->Visit(cell_lock, obj_worker, *MapManager::Instance().GetMap(pl->GetMapId(), pl));
Index: trunk/src/game/FleeingMovementGenerator.cpp
===================================================================
--- trunk/src/game/FleeingMovementGenerator.cpp (revision 37)
+++ trunk/src/game/FleeingMovementGenerator.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -141,6 +143,6 @@
         temp_x = x + distance * cos(angle);
         temp_y = y + distance * sin(angle);
-        MaNGOS::NormalizeMapCoord(temp_x);
-        MaNGOS::NormalizeMapCoord(temp_y);
+        Trinity::NormalizeMapCoord(temp_x);
+        Trinity::NormalizeMapCoord(temp_y);
         if( owner.IsWithinLOS(temp_x,temp_y,z))
         {
Index: trunk/src/game/ItemHandler.cpp
===================================================================
--- trunk/src/game/ItemHandler.cpp (revision 37)
+++ trunk/src/game/ItemHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -469,5 +471,5 @@
     recv_data >> vendorguid >> itemguid >> _count;
 
-    // prevent possible overflow, as mangos uses uint32 for item count
+    // prevent possible overflow, as Trinity uses uint32 for item count
     uint32 count = _count;
 
Index: trunk/src/game/OutdoorPvPMgr.h
===================================================================
--- trunk/src/game/OutdoorPvPMgr.h (revision 44)
+++ trunk/src/game/OutdoorPvPMgr.h (revision 44)
@@ -0,0 +1,59 @@
+#ifndef OUTDOOR_PVP_MGR_H_
+#define OUTDOOR_PVP_MGR_H_
+
+#include "OutdoorPvP.h"
+#include "Policies/Singleton.h"
+
+class Player;
+class GameObject;
+class Creature;
+struct GossipOption;
+
+// class to handle player enter / leave / areatrigger / GO use events
+class OutdoorPvPMgr
+{
+public:
+    // ctor
+    OutdoorPvPMgr();
+    // dtor
+    ~OutdoorPvPMgr();
+
+    // create outdoor pvp events
+    void InitOutdoorPvP();
+    // called when a player enters an outdoor pvp area
+    void HandlePlayerEnterZone(Player * plr, uint32 areaflag);
+    // called when player leaves an outdoor pvp area
+    void HandlePlayerLeaveZone(Player * plr, uint32 areaflag);
+    // return assigned outdoor pvp
+    OutdoorPvP * GetOutdoorPvPToZoneId(uint32 zoneid);
+    // handle custom (non-exist in dbc) spell if registered
+    bool HandleCustomSpell(Player * plr, uint32 spellId, GameObject* go);
+    // handle custom go if registered
+    bool HandleOpenGo(Player * plr, uint64 guid);
+
+    void AddZone(uint32 zoneid, OutdoorPvP * handle);
+
+    void Update(uint32 diff);
+
+    bool HandleCaptureCreaturePlayerMoveInLos(Player * plr, Creature * c);
+
+    void HandleGossipOption(Player * player, uint64 guid, uint32 gossipid);
+
+    bool CanTalkTo(Player * player, Creature * creature, GossipOption & gso);
+
+    void HandleDropFlag(Player * plr, uint32 spellId);
+
+    typedef std::set<OutdoorPvP*> OutdoorPvPSet;
+    typedef std::map<uint32 /* zoneid */, OutdoorPvP*> OutdoorPvPMap;
+private:
+    // contains all initiated outdoor pvp events
+    // used when initing / cleaning up
+    OutdoorPvPSet  m_OutdoorPvPSet;
+    // maps the zone ids to an outdoor pvp event
+    // used in player event handling
+    OutdoorPvPMap   m_OutdoorPvPMap;
+};
+
+#define sOutdoorPvPMgr Trinity::Singleton<OutdoorPvPMgr>::Instance()
+
+#endif /*OUTDOOR_PVP_MGR_H_*/
Index: trunk/src/game/WaypointMovementGenerator.cpp
===================================================================
--- trunk/src/game/WaypointMovementGenerator.cpp (revision 37)
+++ trunk/src/game/WaypointMovementGenerator.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Formulas.h
===================================================================
--- trunk/src/game/Formulas.h (revision 2)
+++ trunk/src/game/Formulas.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,18 +11,18 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_FORMULAS_H
-#define MANGOS_FORMULAS_H
+#ifndef TRINITY_FORMULAS_H
+#define TRINITY_FORMULAS_H
 
 #include "World.h"
 
-namespace MaNGOS
+namespace Trinity
 {
     namespace XP
Index: trunk/src/game/BattleGroundEY.h
===================================================================
--- trunk/src/game/BattleGroundEY.h (revision 2)
+++ trunk/src/game/BattleGroundEY.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/AuctionHouseObject.h
===================================================================
--- trunk/src/game/AuctionHouseObject.h (revision 2)
+++ trunk/src/game/AuctionHouseObject.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/TotemAI.cpp
===================================================================
--- trunk/src/game/TotemAI.cpp (revision 2)
+++ trunk/src/game/TotemAI.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -81,5 +83,5 @@
         i_totem.IsFriendlyTo(victim) || !victim->isVisibleForOrDetect(&i_totem,false) )
     {
-        CellPair p(MaNGOS::ComputeCellPair(i_totem.GetPositionX(),i_totem.GetPositionY()));
+        CellPair p(Trinity::ComputeCellPair(i_totem.GetPositionX(),i_totem.GetPositionY()));
         Cell cell(p);
         cell.data.Part.reserved = ALL_DISTRICT;
@@ -87,9 +89,9 @@
         victim = NULL;
 
-        MaNGOS::NearestAttackableUnitInObjectRangeCheck u_check(&i_totem, &i_totem, max_range);
-        MaNGOS::UnitLastSearcher<MaNGOS::NearestAttackableUnitInObjectRangeCheck> checker(victim, u_check);
+        Trinity::NearestAttackableUnitInObjectRangeCheck u_check(&i_totem, &i_totem, max_range);
+        Trinity::UnitLastSearcher<Trinity::NearestAttackableUnitInObjectRangeCheck> checker(victim, u_check);
 
-        TypeContainerVisitor<MaNGOS::UnitLastSearcher<MaNGOS::NearestAttackableUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
-        TypeContainerVisitor<MaNGOS::UnitLastSearcher<MaNGOS::NearestAttackableUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
+        TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestAttackableUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
+        TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestAttackableUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
 
         CellLock<GridReadGuard> cell_lock(cell, p);
Index: trunk/src/game/QueryHandler.cpp
===================================================================
--- trunk/src/game/QueryHandler.cpp (revision 2)
+++ trunk/src/game/QueryHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -93,5 +95,5 @@
     uint32 field     = 0;
     if(name == "")
-        name         = session->GetMangosString(LANG_NON_EXIST_CHARACTER);
+        name         = session->GetTrinityString(LANG_NON_EXIST_CHARACTER);
     else
         field        = fields[2].GetUInt32();
Index: trunk/src/game/VoiceChatHandler.cpp
===================================================================
--- trunk/src/game/VoiceChatHandler.cpp (revision 2)
+++ trunk/src/game/VoiceChatHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Weather.h
===================================================================
--- trunk/src/game/Weather.h (revision 2)
+++ trunk/src/game/Weather.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/GameObject.h
===================================================================
--- trunk/src/game/GameObject.h (revision 37)
+++ trunk/src/game/GameObject.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_GAMEOBJECT_H
-#define MANGOSSERVER_GAMEOBJECT_H
+#ifndef TRINITYCORE_GAMEOBJECT_H
+#define TRINITYCORE_GAMEOBJECT_H
 
 #include "Common.h"
@@ -382,4 +384,5 @@
     uint32 go_state;
     uint8 spawnMask;
+    uint32 ArtKit;
 };
 
@@ -408,5 +411,5 @@
 #define FISHING_BOBBER_READY_TIME 5
 
-class MANGOS_DLL_SPEC GameObject : public WorldObject
+class TRINITY_DLL_SPEC GameObject : public WorldObject
 {
     public:
@@ -417,5 +420,5 @@
         void RemoveFromWorld();
 
-        bool Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, uint32 go_state);
+        bool Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, uint32 go_state, uint32 ArtKit = 0);
         void Update(uint32 p_time);
         static GameObject* GetGameObject(WorldObject& object, uint64 guid);
@@ -503,5 +506,5 @@
         void SetGoState(uint32 state) { SetUInt32Value(GAMEOBJECT_STATE, state); }
         uint32 GetGoArtKit() const { return GetUInt32Value(GAMEOBJECT_ARTKIT); }
-        void SetGoArtKit(uint32 artkit) { SetUInt32Value(GAMEOBJECT_ARTKIT, artkit); }
+        void SetGoArtKit(uint32 artkit);
         uint32 GetGoAnimProgress() const { return GetUInt32Value(GAMEOBJECT_ANIMPROGRESS); }
         void SetGoAnimProgress(uint32 animprogress) { SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, animprogress); }
Index: trunk/src/game/OutdoorPvPNA.h
===================================================================
--- trunk/src/game/OutdoorPvPNA.h (revision 44)
+++ trunk/src/game/OutdoorPvPNA.h (revision 44)
@@ -0,0 +1,279 @@
+#ifndef OUTDOOR_PVP_NA_
+#define OUTDOOR_PVP_NA_
+
+// TODO: "sometimes" set to neutral
+
+#include "OutdoorPvP.h"
+
+// kill credit for pks
+const uint32 NA_CREDIT_MARKER = 24867;
+
+const uint32 NA_KILL_TOKEN_ALLIANCE = 33005;
+const uint32 NA_KILL_TOKEN_HORDE = 33004;
+
+const uint32 NA_CAPTURE_BUFF = 33795;  // strength of the halaani
+
+const uint32 NA_GUARDS_MAX = 15;
+
+const uint32 NA_BUFF_ZONE = 3518;
+
+const uint32 NA_HALAA_GRAVEYARD = 993;
+
+const uint32 NA_HALAA_GRAVEYARD_ZONE = 3518; // need to add zone id, not area id
+
+const uint32 NA_RESPAWN_TIME = 3600000; // one hour to capture after defeating all guards
+
+const uint32 NA_GUARD_CHECK_TIME = 500; // every half second
+
+enum OutdoorPvPNAWorldStates{
+    NA_UI_HORDE_GUARDS_SHOW = 2503,
+    NA_UI_ALLIANCE_GUARDS_SHOW = 2502,
+    NA_UI_GUARDS_MAX = 2493,
+    NA_UI_GUARDS_LEFT = 2491,
+
+    NA_UI_TOWER_SLIDER_DISPLAY = 2495,
+    NA_UI_TOWER_SLIDER_POS = 2494,
+    NA_UI_TOWER_SLIDER_N = 2497,
+
+    NA_MAP_WYVERN_NORTH_NEU_H = 2762,
+    NA_MAP_WYVERN_NORTH_NEU_A = 2662,
+    NA_MAP_WYVERN_NORTH_H = 2663,
+    NA_MAP_WYVERN_NORTH_A = 2664,
+
+    NA_MAP_WYVERN_SOUTH_NEU_H = 2760,
+    NA_MAP_WYVERN_SOUTH_NEU_A = 2670,
+    NA_MAP_WYVERN_SOUTH_H = 2668,
+    NA_MAP_WYVERN_SOUTH_A = 2669,
+
+    NA_MAP_WYVERN_WEST_NEU_H = 2761,
+    NA_MAP_WYVERN_WEST_NEU_A = 2667,
+    NA_MAP_WYVERN_WEST_H = 2665,
+    NA_MAP_WYVERN_WEST_A = 2666,
+
+    NA_MAP_WYVERN_EAST_NEU_H = 2763,
+    NA_MAP_WYVERN_EAST_NEU_A = 2659,
+    NA_MAP_WYVERN_EAST_H = 2660,
+    NA_MAP_WYVERN_EAST_A = 2661,
+
+    NA_MAP_HALAA_NEUTRAL = 2671,
+    NA_MAP_HALAA_NEU_A = 2676,
+    NA_MAP_HALAA_NEU_H = 2677,
+    NA_MAP_HALAA_HORDE = 2672,
+    NA_MAP_HALAA_ALLIANCE = 2673 
+};
+
+const uint32 FLIGHT_NODES_NUM = 4;
+
+// used to access the elements of Horde/AllyControlGOs
+enum ControlGOTypes{
+    NA_ROOST_S = 0,
+    NA_ROOST_W = 1,
+    NA_ROOST_N = 2,
+    NA_ROOST_E = 3,
+
+    NA_BOMB_WAGON_S = 4,
+    NA_BOMB_WAGON_W = 5,
+    NA_BOMB_WAGON_N = 6,
+    NA_BOMB_WAGON_E = 7,
+
+    NA_DESTROYED_ROOST_S = 8, 
+    NA_DESTROYED_ROOST_W = 9, 
+    NA_DESTROYED_ROOST_N = 10,
+    NA_DESTROYED_ROOST_E = 11,
+
+    NA_CONTROL_GO_NUM = 12
+};
+
+const uint32 FlightPathStartNodes[FLIGHT_NODES_NUM] = {103,105,107,109};
+const uint32 FlightPathEndNodes[FLIGHT_NODES_NUM] = {104,106,108,110};
+
+enum FlightSpellsNA{
+    NA_SPELL_FLY_SOUTH = 32059,
+    NA_SPELL_FLY_WEST = 32068,
+    NA_SPELL_FLY_NORTH = 32075,
+    NA_SPELL_FLY_EAST = 32081
+};
+
+// spawned when the alliance is attacking, horde is in control
+const go_type HordeControlGOs[NA_CONTROL_GO_NUM] = {
+    {182267,530,-1815.8,8036.51,-26.2354,-2.89725,0,0,0.992546,-0.121869}, //ALLY_ROOST_SOUTH
+    {182280,530,-1507.95,8132.1,-19.5585,-1.3439,0,0,0.622515,-0.782608}, //ALLY_ROOST_WEST
+    {182281,530,-1384.52,7779.33,-11.1663,-0.575959,0,0,0.284015,-0.95882}, //ALLY_ROOST_NORTH
+    {182282,530,-1650.11,7732.56,-15.4505,-2.80998,0,0,0.986286,-0.165048}, //ALLY_ROOST_EAST
+
+    {182222,530,-1825.4022,8039.2602,-26.08,-2.89725,0,0,0.992546,-0.121869}, //HORDE_BOMB_WAGON_SOUTH
+    {182272,530,-1515.37,8136.91,-20.42,-1.3439,0,0,0.622515,-0.782608}, //HORDE_BOMB_WAGON_WEST
+    {182273,530,-1377.95,7773.44,-10.31,-0.575959,0,0,0.284015,-0.95882}, //HORDE_BOMB_WAGON_NORTH
+    {182274,530,-1659.87,7733.15,-15.75,-2.80998,0,0,0.986286,-0.165048}, //HORDE_BOMB_WAGON_EAST
+
+    {182266,530,-1815.8,8036.51,-26.2354,-2.89725,0,0,0.992546,-0.121869}, //DESTROYED_ALLY_ROOST_SOUTH
+    {182275,530,-1507.95,8132.1,-19.5585,-1.3439,0,0,0.622515,-0.782608}, //DESTROYED_ALLY_ROOST_WEST
+    {182276,530,-1384.52,7779.33,-11.1663,-0.575959,0,0,0.284015,-0.95882}, //DESTROYED_ALLY_ROOST_NORTH
+    {182277,530,-1650.11,7732.56,-15.4505,-2.80998,0,0,0.986286,-0.165048}  //DESTROYED_ALLY_ROOST_EAST
+};
+
+// spawned when the horde is attacking, alliance is in control
+const go_type AllianceControlGOs[NA_CONTROL_GO_NUM] = {
+    {182301,530,-1815.8,8036.51,-26.2354,-2.89725,0,0,0.992546,-0.121869}, //HORDE_ROOST_SOUTH
+    {182302,530,-1507.95,8132.1,-19.5585,-1.3439,0,0,0.622515,-0.782608}, //HORDE_ROOST_WEST
+    {182303,530,-1384.52,7779.33,-11.1663,-0.575959,0,0,0.284015,-0.95882}, //HORDE_ROOST_NORTH
+    {182304,530,-1650.11,7732.56,-15.4505,-2.80998,0,0,0.986286,-0.165048}, //HORDE_ROOST_EAST
+
+    {182305,530,-1825.4022,8039.2602,-26.08,-2.89725,0,0,0.992546,-0.121869}, //ALLY_BOMB_WAGON_SOUTH
+    {182306,530,-1515.37,8136.91,-20.42,-1.3439,0,0,0.622515,-0.782608}, //ALLY_BOMB_WAGON_WEST
+    {182307,530,-1377.95,7773.44,-10.31,-0.575959,0,0,0.284015,-0.95882}, //ALLY_BOMB_WAGON_NORTH
+    {182308,530,-1659.87,7733.15,-15.75,-2.80998,0,0,0.986286,-0.165048}, //ALLY_BOMB_WAGON_EAST
+
+    {182297,530,-1815.8,8036.51,-26.2354,-2.89725,0,0,0.992546,-0.121869}, //DESTROYED_HORDE_ROOST_SOUTH
+    {182298,530,-1507.95,8132.1,-19.5585,-1.3439,0,0,0.622515,-0.782608}, //DESTROYED_HORDE_ROOST_WEST
+    {182299,530,-1384.52,7779.33,-11.1663,-0.575959,0,0,0.284015,-0.95882}, //DESTROYED_HORDE_ROOST_NORTH
+    {182300,530,-1650.11,7732.56,-15.4505,-2.80998,0,0,0.986286,-0.165048}  //DESTROYED_HORDE_ROOST_EAST
+};
+
+enum ControlNPCTypes{
+    NA_NPC_RESEARCHER = 0,
+    NA_NPC_QUARTERMASTER,
+    NA_NPC_BLADE_MERCHANT,
+    NA_NPC_FOOD_MERCHANT,
+    NA_NPC_AMMO,
+
+    NA_NPC_GUARD_01,
+    NA_NPC_GUARD_02,
+    NA_NPC_GUARD_03,
+    NA_NPC_GUARD_04,
+    NA_NPC_GUARD_05,
+    NA_NPC_GUARD_06,
+    NA_NPC_GUARD_07,
+    NA_NPC_GUARD_08,
+    NA_NPC_GUARD_09,
+    NA_NPC_GUARD_10,
+    NA_NPC_GUARD_11,
+    NA_NPC_GUARD_12,
+    NA_NPC_GUARD_13,
+    NA_NPC_GUARD_14,
+    NA_NPC_GUARD_15,
+
+    NA_CONTROL_NPC_NUM
+};
+
+const creature_type HordeControlNPCs[NA_CONTROL_NPC_NUM] = {
+    {18816,67,530,-1523.92,7951.76,-17.6942,3.51172},
+    {18821,67,530,-1527.75,7952.46,-17.6948,3.99317},
+    {21474,67,530,-1520.14,7927.11,-20.2527,3.39389},
+    {21484,67,530,-1524.84,7930.34,-20.182,3.6405},
+    {21483,67,530,-1570.01,7993.8,-22.4505,5.02655},
+    {18192,67,530,-1654.06,8000.46,-26.59,3.37},
+    {18192,67,530,-1487.18,7899.1,-19.53,0.954},
+    {18192,67,530,-1480.88,7908.79,-19.19,4.485},
+    {18192,67,530,-1540.56,7995.44,-20.45,0.947},
+    {18192,67,530,-1546.95,8000.85,-20.72,6.035},
+    {18192,67,530,-1595.31,7860.53,-21.51,3.747},
+    {18192,67,530,-1642.31,7995.59,-25.8,3.317},
+    {18192,67,530,-1545.46,7995.35,-20.63,1.094},
+    {18192,67,530,-1487.58,7907.99,-19.27,5.567},
+    {18192,67,530,-1651.54,7988.56,-26.5289,2.98451},
+    {18192,67,530,-1602.46,7866.43,-22.1177,4.74729},
+    {18192,67,530,-1591.22,7875.29,-22.3536,4.34587},
+    {18192,67,530,-1550.6,7944.45,-21.63,3.559},
+    {18192,67,530,-1545.57,7935.83,-21.13,3.448},
+    {18192,67,530,-1550.86,7937.56,-21.7,3.801}
+};
+
+const creature_type AllianceControlNPCs[NA_CONTROL_NPC_NUM] = {
+    {18817,469,530,-1591.18,8020.39,-22.2042,4.59022},
+    {18822,469,530,-1588.0,8019.0,-22.2042,4.06662},
+    {21485,469,530,-1521.93,7927.37,-20.2299,3.24631},
+    {21487,469,530,-1540.33,7971.95,-20.7186,3.07178},
+    {21488,469,530,-1570.01,7993.8,-22.4505,5.02655},
+    {18256,469,530,-1654.06,8000.46,-26.59,3.37},
+    {18256,469,530,-1487.18,7899.1,-19.53,0.954},
+    {18256,469,530,-1480.88,7908.79,-19.19,4.485},
+    {18256,469,530,-1540.56,7995.44,-20.45,0.947},
+    {18256,469,530,-1546.95,8000.85,-20.72,6.035},
+    {18256,469,530,-1595.31,7860.53,-21.51,3.747},
+    {18256,469,530,-1642.31,7995.59,-25.8,3.317},
+    {18256,469,530,-1545.46,7995.35,-20.63,1.094},
+    {18256,469,530,-1487.58,7907.99,-19.27,5.567},
+    {18256,469,530,-1651.54,7988.56,-26.5289,2.98451},
+    {18256,469,530,-1602.46,7866.43,-22.1177,4.74729},
+    {18256,469,530,-1591.22,7875.29,-22.3536,4.34587},
+    {18256,469,530,-1603.75,8000.36,-24.18,4.516},
+    {18256,469,530,-1585.73,7994.68,-23.29,4.439},
+    {18256,469,530,-1595.5,7991.27,-23.53,4.738}
+};
+
+enum WyvernStates{
+    WYVERN_NEU_HORDE = 1,
+    WYVERN_NEU_ALLIANCE = 2,
+    WYVERN_HORDE = 4,
+    WYVERN_ALLIANCE = 8
+};
+
+enum HalaaStates{
+    HALAA_N = 1,
+    HALAA_N_A = 2,
+    HALAA_A = 4,
+    HALAA_N_H = 8,
+    HALAA_H = 16
+};
+
+class Unit;
+class Creature;
+class OutdoorPvPNA;
+class OutdoorPvPObjectiveNA : public OutdoorPvPObjective
+{
+friend class OutdoorPvPNA;
+public:
+    OutdoorPvPObjectiveNA(OutdoorPvP * pvp);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket & data);
+    // used when player is activated/inactivated in the area
+    bool HandlePlayerEnter(Player * plr);
+    void HandlePlayerLeave(Player * plr);
+    bool HandleCustomSpell(Player *plr, uint32 spellId, GameObject * go);
+    int32 HandleOpenGo(Player *plr, uint64 guid);
+    uint32 GetAliveGuardsCount();
+protected:
+    // called when a faction takes control
+    void FactionTakeOver(uint32 team);
+
+    void DeSpawnNPCs();
+    void DeSpawnGOs();
+    void SpawnNPCsForTeam(uint32 team);
+    void SpawnGOsForTeam(uint32 team);
+
+    void UpdateWyvernRoostWorldState(uint32 roost);
+    void UpdateHalaaWorldState();
+
+    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
+private:
+    bool m_capturable;
+    uint32 m_GuardsAlive;
+    uint32 m_ControllingFaction;
+    uint32 m_WyvernStateNorth;
+    uint32 m_WyvernStateSouth;
+    uint32 m_WyvernStateEast;
+    uint32 m_WyvernStateWest;
+    uint32 m_HalaaState;
+    uint32 m_RespawnTimer;
+    uint32 m_GuardCheckTimer;
+};
+
+class OutdoorPvPNA : public OutdoorPvP
+{
+friend class OutdoorPvPObjectiveNA;
+public:
+    OutdoorPvPNA();
+    bool SetupOutdoorPvP();
+    void HandlePlayerEnterZone(Player *plr, uint32 zone);
+    void HandlePlayerLeaveZone(Player *plr, uint32 zone);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket &data);
+    void SendRemoveWorldStates(Player * plr);
+    void HandleKillImpl(Player * plr, Unit * killed);
+    void BuffTeam(uint32 team);
+private:
+    OutdoorPvPObjectiveNA * m_obj;
+};
+
+#endif
Index: trunk/src/game/Traveller.h
===================================================================
--- trunk/src/game/Traveller.h (revision 2)
+++ trunk/src/game/Traveller.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_TRAVELLER_H
-#define MANGOS_TRAVELLER_H
+#ifndef TRINITY_TRAVELLER_H
+#define TRINITY_TRAVELLER_H
 
 #include "MapManager.h"
@@ -31,5 +33,5 @@
 
 template<class T>
-struct MANGOS_DLL_DECL Traveller
+struct TRINITY_DLL_DECL Traveller
 {
     T &i_traveller;
Index: trunk/src/game/ChannelHandler.cpp
===================================================================
--- trunk/src/game/ChannelHandler.cpp (revision 2)
+++ trunk/src/game/ChannelHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/MovementGenerator.h
===================================================================
--- trunk/src/game/MovementGenerator.h (revision 2)
+++ trunk/src/game/MovementGenerator.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_MOVEMENTGENERATOR_H
-#define MANGOS_MOVEMENTGENERATOR_H
+#ifndef TRINITY_MOVEMENTGENERATOR_H
+#define TRINITY_MOVEMENTGENERATOR_H
 
 #include "Platform/Define.h"
@@ -29,5 +31,5 @@
 class Unit;
 
-class MANGOS_DLL_SPEC MovementGenerator
+class TRINITY_DLL_SPEC MovementGenerator
 {
     public:
@@ -49,5 +51,5 @@
 
 template<class T, class D>
-class MANGOS_DLL_SPEC MovementGeneratorMedium : public MovementGenerator
+class TRINITY_DLL_SPEC MovementGeneratorMedium : public MovementGenerator
 {
     public:
Index: trunk/src/game/SkillDiscovery.cpp
===================================================================
--- trunk/src/game/SkillDiscovery.cpp (revision 2)
+++ trunk/src/game/SkillDiscovery.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/ObjectDefines.h
===================================================================
--- trunk/src/game/ObjectDefines.h (revision 2)
+++ trunk/src/game/ObjectDefines.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_OBJECTDEFINES_H
-#define MANGOS_OBJECTDEFINES_H
+#ifndef TRINITY_OBJECTDEFINES_H
+#define TRINITY_OBJECTDEFINES_H
 
 #include "Platform/Define.h"
Index: trunk/src/game/UnitEvents.h
===================================================================
--- trunk/src/game/UnitEvents.h (revision 2)
+++ trunk/src/game/UnitEvents.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -68,5 +70,5 @@
 //==============================================================
 
-class MANGOS_DLL_SPEC UnitBaseEvent
+class TRINITY_DLL_SPEC UnitBaseEvent
 {
     private:
@@ -83,5 +85,5 @@
 //==============================================================
 
-class MANGOS_DLL_SPEC ThreatRefStatusChangeEvent : public UnitBaseEvent
+class TRINITY_DLL_SPEC ThreatRefStatusChangeEvent : public UnitBaseEvent
 {
     private:
@@ -120,5 +122,5 @@
 //==============================================================
 
-class MANGOS_DLL_SPEC ThreatManagerEvent : public ThreatRefStatusChangeEvent
+class TRINITY_DLL_SPEC ThreatManagerEvent : public ThreatRefStatusChangeEvent
 {
     private:
Index: trunk/src/game/CreatureAIImpl.h
===================================================================
--- trunk/src/game/CreatureAIImpl.h (revision 2)
+++ trunk/src/game/CreatureAIImpl.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 #ifndef CREATUREAIIMPL_H
Index: trunk/src/game/Object.h
===================================================================
--- trunk/src/game/Object.h (revision 12)
+++ trunk/src/game/Object.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -106,5 +108,5 @@
 };
 
-class MANGOS_DLL_SPEC Object
+class TRINITY_DLL_SPEC Object
 {
     public:
@@ -318,5 +320,5 @@
 };
 
-class MANGOS_DLL_SPEC WorldObject : public Object
+class TRINITY_DLL_SPEC WorldObject : public Object
 {
     public:
Index: trunk/src/game/WorldSocketMgr.h
===================================================================
--- trunk/src/game/WorldSocketMgr.h (revision 6)
+++ trunk/src/game/WorldSocketMgr.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008,2007 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/GuardAI.cpp
===================================================================
--- trunk/src/game/GuardAI.cpp (revision 37)
+++ trunk/src/game/GuardAI.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/PetitionsHandler.cpp
===================================================================
--- trunk/src/game/PetitionsHandler.cpp (revision 37)
+++ trunk/src/game/PetitionsHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -285,5 +287,5 @@
     data << petitionguid;                                   // petition guid
     data << _player->GetGUID();                             // owner guid
-    data << petitionguid_low;                               // guild guid (in mangos always same as GUID_LOPART(petitionguid)
+    data << petitionguid_low;                               // guild guid (in Trinity always same as GUID_LOPART(petitionguid)
     data << signs;                                          // sign's count
 
@@ -311,5 +313,5 @@
     uint32 guildguid;
     uint64 petitionguid;
-    recv_data >> guildguid;                                 // in mangos always same as GUID_LOPART(petitionguid)
+    recv_data >> guildguid;                                 // in Trinity always same as GUID_LOPART(petitionguid)
     recv_data >> petitionguid;                              // petition guid
     sLog.outDebug("CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid);
@@ -359,5 +361,5 @@
 
     WorldPacket data(SMSG_PETITION_QUERY_RESPONSE, (4+8+name.size()+1+1+4*13));
-    data << GUID_LOPART(petitionguid);                      // guild/team guid (in mangos always same as GUID_LOPART(petition guid)
+    data << GUID_LOPART(petitionguid);                      // guild/team guid (in Trinity always same as GUID_LOPART(petition guid)
     data << ownerguid;                                      // charter owner guid
     data << name;                                           // name (guild/arena team)
@@ -652,5 +654,5 @@
     data << petitionguid;                                   // petition guid
     data << _player->GetGUID();                             // owner guid
-    data << GUID_LOPART(petitionguid);                      // guild guid (in mangos always same as GUID_LOPART(petition guid)
+    data << GUID_LOPART(petitionguid);                      // guild guid (in Trinity always same as GUID_LOPART(petition guid)
     data << signs;                                          // sign's count
 
Index: trunk/src/game/MapManager.h
===================================================================
--- trunk/src/game/MapManager.h (revision 2)
+++ trunk/src/game/MapManager.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_MAPMANAGER_H
-#define MANGOS_MAPMANAGER_H
+#ifndef TRINITY_MAPMANAGER_H
+#define TRINITY_MAPMANAGER_H
 
 #include "Platform/Define.h"
@@ -28,8 +30,8 @@
 class Transport;
 
-class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::ClassLevelLockable<MapManager, ZThread::Mutex> >
+class TRINITY_DLL_DECL MapManager : public Trinity::Singleton<MapManager, Trinity::ClassLevelLockable<MapManager, ZThread::Mutex> >
 {
 
-    friend class MaNGOS::OperatorNew<MapManager>;
+    friend class Trinity::OperatorNew<MapManager>;
     typedef HM_NAMESPACE::hash_map<uint32, Map*> MapMapType;
     typedef std::pair<HM_NAMESPACE::hash_map<uint32, Map*>::iterator, bool>  MapMapPair;
@@ -81,15 +83,15 @@
         static bool IsValidMapCoord(uint32 mapid, float x,float y)
         {
-            return IsValidMAP(mapid) && MaNGOS::IsValidMapCoord(x,y);
+            return IsValidMAP(mapid) && Trinity::IsValidMapCoord(x,y);
         }
 
         static bool IsValidMapCoord(uint32 mapid, float x,float y,float z)
         {
-            return IsValidMAP(mapid) && MaNGOS::IsValidMapCoord(x,y,z);
+            return IsValidMAP(mapid) && Trinity::IsValidMapCoord(x,y,z);
         }
 
         static bool IsValidMapCoord(uint32 mapid, float x,float y,float z,float o)
         {
-            return IsValidMAP(mapid) && MaNGOS::IsValidMapCoord(x,y,z,o);
+            return IsValidMAP(mapid) && Trinity::IsValidMapCoord(x,y,z,o);
         }
 
@@ -132,5 +134,5 @@
         }
 
-        typedef MaNGOS::ClassLevelLockable<MapManager, ZThread::Mutex>::Lock Guard;
+        typedef Trinity::ClassLevelLockable<MapManager, ZThread::Mutex>::Lock Guard;
         uint32 i_gridCleanUpDelay;
         MapMapType i_maps;
Index: trunk/src/game/SpellHandler.cpp
===================================================================
--- trunk/src/game/SpellHandler.cpp (revision 2)
+++ trunk/src/game/SpellHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Chat.cpp
===================================================================
--- trunk/src/game/Chat.cpp (revision 42)
+++ trunk/src/game/Chat.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -109,4 +111,6 @@
         { "lootrecipient",  SEC_GAMEMASTER,     &ChatHandler::HandleGetLootRecipient,           "", NULL },
         { "arena",          SEC_ADMINISTRATOR,  &ChatHandler::HandleDebugArenaCommand,          "", NULL },
+        { "threatlist",     SEC_ADMINISTRATOR,  &ChatHandler::HandleDebugThreatList,            "", NULL },
+        { "hostilrefs",     SEC_ADMINISTRATOR,  &ChatHandler::HandleDebugHostilRefList,         "", NULL },
         { NULL,             0,                  NULL,                                           "", NULL }
     };
@@ -166,5 +170,5 @@
         { "item_enchantment_template",   SEC_ADMINISTRATOR, &ChatHandler::HandleReloadItemEnchantementsCommand,       "", NULL },
         { "item_loot_template",          SEC_ADMINISTRATOR, &ChatHandler::HandleReloadLootTemplatesItemCommand,       "", NULL },
-        { "mangos_string",               SEC_ADMINISTRATOR, &ChatHandler::HandleReloadMangosStringCommand,            "", NULL },
+        { "trinity_string",              SEC_ADMINISTRATOR, &ChatHandler::HandleReloadTrinityStringCommand,           "", NULL },
         { "npc_gossip",                  SEC_ADMINISTRATOR, &ChatHandler::HandleReloadNpcGossipCommand,               "", NULL },
         { "npc_trainer",                 SEC_ADMINISTRATOR, &ChatHandler::HandleReloadNpcTrainerCommand,              "", NULL },
@@ -468,5 +472,4 @@
         { "cometome",       SEC_ADMINISTRATOR,  &ChatHandler::HandleComeToMeCommand,            "", NULL },
         { "damage",         SEC_ADMINISTRATOR,  &ChatHandler::HandleDamageCommand,              "", NULL },
-        { "ircpm",          SEC_PLAYER,         &ChatHandler::HandleIRCpmCommand,               "", NULL },
         { "combatstop",     SEC_GAMEMASTER,     &ChatHandler::HandleCombatStopCommand,          "", NULL },
         { "flusharenapoints",    SEC_ADMINISTRATOR, &ChatHandler::HandleFlushArenaPointsCommand,         "",   NULL },
@@ -516,7 +519,7 @@
 }
 
-const char *ChatHandler::GetMangosString(int32 entry)
-{
-    return m_session->GetMangosString(entry);
+const char *ChatHandler::GetTrinityString(int32 entry)
+{
+    return m_session->GetTrinityString(entry);
 }
 
@@ -582,10 +585,10 @@
 void ChatHandler::SendSysMessage(int32 entry)
 {
-    SendSysMessage(GetMangosString(entry));
+    SendSysMessage(GetTrinityString(entry));
 }
 
 void ChatHandler::PSendSysMessage(int32 entry, ...)
 {
-    const char *format = GetMangosString(entry);
+    const char *format = GetTrinityString(entry);
     va_list ap;
     char str [1024];
@@ -1029,12 +1032,12 @@
     {
         // search near player then
-        CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
+        CellPair p(Trinity::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
         Cell cell(p);
         cell.data.Part.reserved = ALL_DISTRICT;
 
-        MaNGOS::GameObjectWithDbGUIDCheck go_check(*pl,lowguid);
-        MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(obj,go_check);
-
-        TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
+        Trinity::GameObjectWithDbGUIDCheck go_check(*pl,lowguid);
+        Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(obj,go_check);
+
+        TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
         CellLock<GridReadGuard> cell_lock(cell, p);
         cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(pl->GetMapId(), pl));
Index: trunk/src/game/DestinationHolder.cpp
===================================================================
--- trunk/src/game/DestinationHolder.cpp (revision 2)
+++ trunk/src/game/DestinationHolder.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/NullCreatureAI.cpp
===================================================================
--- trunk/src/game/NullCreatureAI.cpp (revision 2)
+++ trunk/src/game/NullCreatureAI.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/OutdoorPvP.cpp
===================================================================
--- trunk/src/game/OutdoorPvP.cpp (revision 44)
+++ trunk/src/game/OutdoorPvP.cpp (revision 44)
@@ -0,0 +1,747 @@
+#include "OutdoorPvP.h"
+#include "OutdoorPvPMgr.h"
+#include "ObjectAccessor.h"
+#include "ObjectMgr.h"
+#include "Map.h"
+#include "MapManager.h"
+#include "OutdoorPvPObjectiveAI.h"
+#include "Group.h"
+#include "WorldPacket.h"
+
+OutdoorPvPObjective::OutdoorPvPObjective(OutdoorPvP * pvp) 
+: m_PvP(pvp), m_AllianceActivePlayerCount(0), m_HordeActivePlayerCount(0),
+m_ShiftTimer(0), m_ShiftPhase(0), m_ShiftMaxPhase(0), m_OldPhase(0),
+m_State(0), m_OldState(0), m_CapturePoint(0), m_NeutralValue(0), m_ShiftMaxCaptureSpeed(0), m_CapturePointCreature(0)
+{
+}
+
+bool OutdoorPvPObjective::HandlePlayerEnter(Player * plr)
+{
+    // only called if really entered, so no use in the return value anymore
+    // player distance and activity state was checked already in the AI
+    std::set<uint64>::iterator pitr = m_ActivePlayerGuids.find(plr->GetGUID());
+    // if not already counted as active, add player
+    if(pitr == m_ActivePlayerGuids.end())
+    {
+        if(plr->GetTeam() == ALLIANCE)
+            ++m_AllianceActivePlayerCount;
+        else
+            ++m_HordeActivePlayerCount;
+        m_ActivePlayerGuids.insert(plr->GetGUID());
+        sLog.outDebug("player %u entered an outdoorpvpobjective", plr->GetGUIDLow());
+        return true;
+    }
+    return true;
+}
+
+void OutdoorPvPObjective::HandlePlayerLeave(Player * plr)
+{
+    // only decrease the count if the player is in the active list
+    if(m_ActivePlayerGuids.find(plr->GetGUID())!=m_ActivePlayerGuids.end())
+    {
+        if(plr->GetTeam() == ALLIANCE)
+            --m_AllianceActivePlayerCount;
+        else
+            --m_HordeActivePlayerCount;
+        m_ActivePlayerGuids.erase(plr->GetGUID());
+    }
+}
+
+void OutdoorPvPObjective::HandlePlayerActivityChanged(Player * plr)
+{
+    if(m_CapturePointCreature)
+        if(Creature * c = HashMapHolder<Creature>::Find(m_CapturePointCreature))
+            if(c->AI())
+                c->AI()->MoveInLineOfSight(plr);
+}
+
+bool OutdoorPvPObjective::AddObject(uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3)
+{
+    GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(entry);
+    if (!goinfo)
+        return false;
+
+    uint32 guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
+
+    GameObjectData& data = objmgr.NewGOData(guid);
+
+    data.id             = entry;
+    data.mapid          = map;
+    data.posX           = x;
+    data.posY           = y;
+    data.posZ           = z;
+    data.orientation    = o;
+    data.rotation0      = rotation0;
+    data.rotation1      = rotation1;
+    data.rotation2      = rotation2;
+    data.rotation3      = rotation3;
+    data.spawntimesecs  = 0;
+    data.animprogress   = 100;
+    data.spawnMask      = 1;
+    data.go_state       = 1;
+
+    objmgr.AddGameobjectToGrid(guid, &data);
+
+    // 2 way registering
+    m_Objects[type] = MAKE_NEW_GUID(guid, entry, HIGHGUID_GAMEOBJECT);
+    m_ObjectTypes[m_Objects[type]]=type;
+
+    Map * pMap = MapManager::Instance().FindMap(map);
+    if(!pMap)
+        return true;
+    GameObject * go = new GameObject;
+    if(!go->Create(guid,entry, pMap,x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,1))
+    {
+        sLog.outError("Gameobject template %u not found in database.", entry);
+        delete go;
+        return true;
+    }
+
+    go->SetRespawnTime(0);
+    objmgr.SaveGORespawnTime(go->GetDBTableGUIDLow(),0,0);
+    pMap->Add(go);
+
+    return true;
+}
+
+bool OutdoorPvPObjective::AddCreature(uint32 type, uint32 entry, uint32 teamval, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay)
+{
+    CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(entry);
+    if(!cinfo)
+    {
+        return false;
+    }
+
+    uint32 displayId = objmgr.ChooseDisplayId(teamval, cinfo, NULL);
+    CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(displayId);
+    if (!minfo)
+    {
+        return false;
+    }
+    else
+        displayId = minfo->modelid;                        // it can be different (for another gender)
+
+    uint32 guid = objmgr.GenerateLowGuid(HIGHGUID_UNIT);
+
+    CreatureData& data = objmgr.NewOrExistCreatureData(guid);
+
+    data.id = entry;
+    data.mapid = map;
+    data.displayid = displayId;
+    data.equipmentId = cinfo->equipmentId;
+    data.posX = x;
+    data.posY = y;
+    data.posZ = z;
+    data.orientation = o;
+    data.spawntimesecs = spawntimedelay;
+    data.spawndist = 0;
+    data.currentwaypoint = 0;
+    data.curhealth = cinfo->maxhealth;
+    data.curmana = cinfo->maxmana;
+    data.is_dead = false;
+    data.movementType = cinfo->MovementType;
+    data.spawnMask = 1;
+
+    objmgr.AddCreatureToGrid(guid, &data);
+
+    m_Creatures[type] = MAKE_NEW_GUID(guid, entry, HIGHGUID_UNIT);
+    m_CreatureTypes[m_Creatures[type]] = type;
+
+    Map * pMap = MapManager::Instance().FindMap(map);
+    if(!pMap)
+        return true;
+    Creature* pCreature = new Creature;
+    if (!pCreature->Create(guid, pMap, entry, teamval))
+    {
+        sLog.outError("Can't create creature entry: %u",entry);
+        delete pCreature;
+        return true;
+    }
+
+    pCreature->AIM_Initialize();
+
+    pCreature->Relocate(x, y, z, o);
+
+    if(!pCreature->IsPositionValid())
+    {
+        sLog.outError("ERROR: Creature (guidlow %d, entry %d) not added to opvp. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
+        return false;
+    }
+
+    if(spawntimedelay)
+        pCreature->SetRespawnDelay(spawntimedelay);
+
+    pMap->Add(pCreature);
+
+    return true;
+}
+
+bool OutdoorPvPObjective::AddCapturePoint(uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3)
+{
+    sLog.outDebug("creating capture point %u and capture point creature",entry);
+
+    // check info existence
+    GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(entry);
+    if (!goinfo)
+        return false;
+
+    CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(OPVP_TRIGGER_CREATURE_ENTRY);
+    if(!cinfo)
+        return false;
+
+    // create capture point creature
+    uint32 displayId = objmgr.ChooseDisplayId(0, cinfo, NULL);
+
+    uint32 creature_guid = objmgr.GenerateLowGuid(HIGHGUID_UNIT);
+
+    CreatureData& cdata = objmgr.NewOrExistCreatureData(creature_guid);
+
+    cdata.id = OPVP_TRIGGER_CREATURE_ENTRY;
+    cdata.mapid = map;
+    cdata.displayid = displayId;
+    cdata.equipmentId = cinfo->equipmentId;
+    cdata.posX = x;
+    cdata.posY = y;
+    cdata.posZ = z;
+    cdata.orientation = o;
+    cdata.spawntimesecs = 1;
+    cdata.spawndist = 0;
+    cdata.currentwaypoint = 0;
+    cdata.curhealth = cinfo->maxhealth;
+    cdata.curmana = cinfo->maxmana;
+    cdata.is_dead = false;
+    cdata.movementType = cinfo->MovementType;
+    cdata.spawnMask = 1;
+
+    objmgr.AddCreatureToGrid(creature_guid, &cdata);
+    m_CapturePointCreature = MAKE_NEW_GUID(creature_guid, OPVP_TRIGGER_CREATURE_ENTRY, HIGHGUID_UNIT);
+
+    // create capture point go
+    uint32 guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
+
+    GameObjectData& data = objmgr.NewGOData(guid);
+
+    data.id             = entry;
+    data.mapid          = map;
+    data.posX           = x;
+    data.posY           = y;
+    data.posZ           = z;
+    data.orientation    = o;
+    data.rotation0      = rotation0;
+    data.rotation1      = rotation1;
+    data.rotation2      = rotation2;
+    data.rotation3      = rotation3;
+    data.spawntimesecs  = 1;
+    data.animprogress   = 100;
+    data.spawnMask      = 1;
+    data.go_state       = 1;
+
+    objmgr.AddGameobjectToGrid(guid, &data);
+
+    m_CapturePoint = MAKE_NEW_GUID(guid, entry, HIGHGUID_GAMEOBJECT);
+
+    // get the needed values from goinfo
+    m_ShiftMaxPhase = goinfo->raw.data[17];
+    m_ShiftMaxCaptureSpeed = m_ShiftMaxPhase / float(goinfo->raw.data[16]);
+    m_NeutralValue = goinfo->raw.data[12];
+
+    // add to map if map is already loaded
+    Map * pMap = MapManager::Instance().FindMap(map);
+    if(!pMap)
+        return true;
+    // add GO...
+    GameObject * go = new GameObject;
+    if(!go->Create(guid,entry, pMap,x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,1))
+    {
+        sLog.outError("Gameobject template %u not found in database.", entry);
+        delete go;
+    }
+    else
+    {
+        go->SetRespawnTime(0);
+        objmgr.SaveGORespawnTime(go->GetDBTableGUIDLow(), 0, 0);
+        pMap->Add(go);
+    }
+    // add creature...
+    Creature* pCreature = new Creature;
+    if (!pCreature->Create(creature_guid, pMap, OPVP_TRIGGER_CREATURE_ENTRY, 0))
+    {
+        sLog.outError("Can't create creature entry: %u",entry);
+        delete pCreature;
+    }
+    else
+    {
+        pCreature->AIM_Initialize();
+
+        pCreature->Relocate(x, y, z, o);
+
+        if(!pCreature->IsPositionValid())
+        {
+            sLog.outError("ERROR: Creature (guidlow %d, entry %d) not added to opvp. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
+            return false;
+        }
+
+        pMap->Add(pCreature);
+    }
+    return true;
+}
+
+bool OutdoorPvPObjective::DelCreature(uint32 type)
+{
+    if(!m_Creatures[type])
+    {
+        sLog.outDebug("opvp creature type %u was already deleted",type);
+        return false;
+    }
+
+    Creature *cr = HashMapHolder<Creature>::Find(m_Creatures[type]);
+    if(!cr)
+    {
+        // can happen when closing the core
+        m_Creatures[type] = 0;
+        return false;
+    }
+    sLog.outDebug("deleting opvp creature type %u",type);
+    uint32 guid = cr->GetDBTableGUIDLow();
+    // dont save respawn time
+    cr->SetRespawnTime(0);
+    cr->RemoveCorpse();
+    cr->CleanupsBeforeDelete();
+    // explicit removal from map
+    // beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted
+    // so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed
+    if(Map * map = MapManager::Instance().FindMap(cr->GetMapId()))
+        map->Remove(cr,false);
+    // delete respawn time for this creature
+    WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid);
+    cr->AddObjectToRemoveList();
+    objmgr.DeleteCreatureData(guid);
+    m_CreatureTypes[m_Creatures[type]] = 0;
+    m_Creatures[type] = 0;
+    return true;
+}
+
+bool OutdoorPvPObjective::DelObject(uint32 type)
+{
+    if(!m_Objects[type])
+        return false;
+
+    GameObject *obj = HashMapHolder<GameObject>::Find(m_Objects[type]);
+    if(!obj)
+    {
+        m_Objects[type] = 0;
+        return false;
+    }
+    uint32 guid = obj->GetDBTableGUIDLow();
+    obj->SetRespawnTime(0);                                 // not save respawn time
+    obj->Delete();
+    objmgr.DeleteGOData(guid);
+    m_ObjectTypes[m_Objects[type]] = 0;
+    m_Objects[type] = 0;
+    return true;
+}
+
+bool OutdoorPvPObjective::DelCapturePoint()
+{
+    if(m_CapturePoint)
+    {
+        GameObject *obj = HashMapHolder<GameObject>::Find(m_CapturePoint);
+        if(obj)
+        {
+            uint32 guid = obj->GetDBTableGUIDLow();
+            obj->SetRespawnTime(0);                                 // not save respawn time
+            obj->Delete();
+            objmgr.DeleteGOData(guid);
+        }
+        m_CapturePoint = 0;
+    }
+    if(m_CapturePointCreature)
+    {
+        Creature *cr = HashMapHolder<Creature>::Find(m_CapturePointCreature);
+        if(cr)
+        {
+            uint32 guid = cr->GetDBTableGUIDLow();
+            // dont save respawn time
+            cr->SetRespawnTime(0);
+            cr->RemoveCorpse();
+            cr->CleanupsBeforeDelete();
+            // explicit removal from map
+            // beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted
+            // so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed
+            if(Map * map = MapManager::Instance().FindMap(cr->GetMapId()))
+                map->Remove(cr,false);
+            // delete respawn time for this creature
+            WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid);
+            cr->AddObjectToRemoveList();
+            objmgr.DeleteCreatureData(guid);
+        }
+        m_CapturePointCreature = 0;
+    }
+    return true;
+}
+
+void OutdoorPvPObjective::DeleteSpawns()
+{
+    for(std::map<uint32,uint64>::iterator i = m_Objects.begin(); i != m_Objects.end(); ++i)
+        DelObject(i->first);
+    for(std::map<uint32,uint64>::iterator i = m_Creatures.begin(); i != m_Creatures.end(); ++i)
+        DelCreature(i->first);
+    DelCapturePoint();
+}
+
+void OutdoorPvP::DeleteSpawns()
+{
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+        (*itr)->DeleteSpawns();
+}
+
+OutdoorPvP::OutdoorPvP()
+{
+}
+
+OutdoorPvP::~OutdoorPvP()
+{
+    DeleteSpawns();
+}
+
+void OutdoorPvP::HandlePlayerEnterZone(Player * plr, uint32 zone)
+{
+    if(plr->GetTeam()==ALLIANCE)
+        m_PlayerGuids[0].insert(plr->GetGUID());
+    else
+        m_PlayerGuids[1].insert(plr->GetGUID());
+}
+
+void OutdoorPvP::HandlePlayerLeaveZone(Player * plr, uint32 zone)
+{
+    // inform the objectives of the leaving
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+        (*itr)->HandlePlayerLeave(plr);
+    // remove the world state information from the player (we can't keep everyone up to date, so leave out those who are not in the concerning zones)
+    if(zone != plr->GetZoneId())
+        SendRemoveWorldStates(plr);
+    if(plr->GetTeam()==ALLIANCE)
+        m_PlayerGuids[0].erase(plr->GetGUID());
+    else
+        m_PlayerGuids[1].erase(plr->GetGUID());
+    sLog.outDebug("player left an outdoorpvp zone");
+}
+
+bool OutdoorPvP::Update(uint32 diff)
+{
+    bool objective_changed = false;
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+        objective_changed |= (*itr)->Update(diff);
+    return objective_changed;
+}
+
+bool OutdoorPvPObjective::Update(uint32 diff)
+{
+    uint32 Challenger = 0;
+    if(m_ShiftTimer<diff)
+    {
+        m_ShiftTimer = OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL;
+
+        // get the difference of numbers
+        float fact_diff = (m_AllianceActivePlayerCount - m_HordeActivePlayerCount);
+
+        if(fact_diff<0)
+        {
+            if(fact_diff < - m_ShiftMaxCaptureSpeed)
+                fact_diff = - m_ShiftMaxCaptureSpeed;
+            Challenger = HORDE;
+            // horde is in majority, but it's already horde-controlled -> no change
+            if(m_State == OBJECTIVESTATE_HORDE && m_ShiftPhase == - m_ShiftMaxPhase)
+                return false;
+        }
+        else if(fact_diff>0)
+        {
+            if(fact_diff > m_ShiftMaxCaptureSpeed)
+                fact_diff = m_ShiftMaxCaptureSpeed;
+            Challenger = ALLIANCE;
+            // ally is in majority, but it's already ally-controlled -> no change
+            if(m_State == OBJECTIVESTATE_ALLIANCE && m_ShiftPhase == m_ShiftMaxPhase)
+                return false;
+        }
+        else /*if(fact_diff==0)*/ // no change
+            return false;
+
+        m_OldPhase = m_ShiftPhase;
+
+        m_OldState = m_State;
+
+        m_ShiftPhase += fact_diff;
+
+        // check limits, these are over the grey part
+        if(m_ShiftPhase <= - m_ShiftMaxPhase * (float)(m_NeutralValue) / 100.0f)
+        {
+            if(m_ShiftPhase <= - m_ShiftMaxPhase)
+                m_ShiftPhase = - m_ShiftMaxPhase;
+            m_State = OBJECTIVESTATE_HORDE;
+            return true;
+        }
+        else if(m_ShiftPhase >= m_ShiftMaxPhase * (float)(m_NeutralValue) / 100.0f)
+        {
+            if(m_ShiftPhase >= m_ShiftMaxPhase)
+                m_ShiftPhase = m_ShiftMaxPhase;
+            m_State = OBJECTIVESTATE_ALLIANCE;
+            return true;
+        }
+
+        if(m_OldPhase*m_ShiftPhase <=0)
+        {
+            // gone through neutral
+            // if challenger is ally, then n->a challenge
+            if(Challenger == ALLIANCE)
+                m_State = OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE;
+            // if challenger is horde, then n->h challenge
+            else if(Challenger == HORDE)
+                m_State = OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE;
+        }
+        else
+        {
+            // old phase and current are on the same side, so one team challenges the other
+            if(Challenger == ALLIANCE && (m_OldState == OBJECTIVESTATE_HORDE || m_OldState == OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE))
+                m_State = OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE;
+            else if(Challenger == HORDE && (m_OldState == OBJECTIVESTATE_ALLIANCE || m_OldState == OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE))
+                m_State = OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE;
+        }
+
+        return true;
+    } else m_ShiftTimer-=diff;
+
+    return false;
+}
+
+bool OutdoorPvPObjective::HandleCaptureCreaturePlayerMoveInLos(Player * p, Creature * c)
+{
+    // check if guid matches
+    if(c->GetGUID() != m_CapturePointCreature)
+        return false;
+
+    // check if capture point go is spawned
+    GameObject * cp = HashMapHolder<GameObject>::Find(m_CapturePoint);
+    if(!cp)
+        return false;
+
+    // check range and activity
+    if(cp->IsWithinDistInMap(p,cp->GetGOInfo()->raw.data[0]) && p->IsOutdoorPvPActive())
+    {
+        // data[8] will be used for player enter
+        return HandleCapturePointEvent(p, cp->GetGOInfo()->raw.data[8]); //i_objective->HandlePlayerEnter((Player*)u);
+    }
+    else
+    {
+        // data[9] will be used for player leave
+        return HandleCapturePointEvent(p, cp->GetGOInfo()->raw.data[9]); //i_objective->HandlePlayerLeave((Player*)u);
+    }
+}
+
+void OutdoorPvP::SendUpdateWorldState(uint32 field, uint32 value)
+{
+    // send to both factions
+    for(int i = 0; i < 2; ++i)
+    {
+        // send to all players present in the area
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[i].begin(); itr != m_PlayerGuids[i].end(); ++itr)
+        {
+            Player * plr = objmgr.GetPlayer(*itr);
+            if(plr)
+            {
+                plr->SendUpdateWorldState(field,value);
+            }
+        }
+    }
+}
+
+void OutdoorPvPObjective::SendUpdateWorldState(uint32 field, uint32 value)
+{
+    // send to all players present in the area
+    for(std::set<uint64>::iterator itr = m_ActivePlayerGuids.begin(); itr != m_ActivePlayerGuids.end(); ++itr)
+    {
+        Player * plr = objmgr.GetPlayer(*itr);
+        if(plr)
+        {
+            plr->SendUpdateWorldState(field,value);
+        }
+    }
+}
+
+void OutdoorPvPObjective::SendObjectiveComplete(uint32 id,uint64 guid)
+{
+    uint32 controlling_faction;
+    switch(m_State)
+    {
+    case OBJECTIVESTATE_ALLIANCE:
+        controlling_faction = ALLIANCE;
+        break;
+    case OBJECTIVESTATE_HORDE:
+        controlling_faction = HORDE;
+        break;
+    default:
+        return;
+        break;
+    }
+
+    // send to all players present in the area
+    for(std::set<uint64>::iterator itr = m_ActivePlayerGuids.begin(); itr != m_ActivePlayerGuids.end(); ++itr)
+    {
+        Player * plr = objmgr.GetPlayer(*itr);
+        if(plr && plr->GetTeam() == controlling_faction)
+        {
+            plr->KilledMonster(id,guid);
+        }
+    }
+}
+
+void OutdoorPvP::HandlePlayerActivityChanged(Player * plr)
+{
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+        (*itr)->HandlePlayerActivityChanged(plr);
+}
+
+void OutdoorPvP::HandleKill(Player *killer, Unit * killed)
+{
+    if(Group * pGroup = killer->GetGroup())
+    {
+        for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+        {
+            Player *pGroupGuy = itr->getSource();
+
+            if(!pGroupGuy)
+                continue;
+
+            // skip if too far away
+            if(!pGroupGuy->IsAtGroupRewardDistance(killed))
+                continue;
+
+            // creature kills must be notified, even if not inside objective / not outdoor pvp active
+            // player kills only count if active and inside objective
+            if(( pGroupGuy->IsOutdoorPvPActive() && IsInsideObjective(pGroupGuy) ) || killed->GetTypeId() == TYPEID_UNIT)
+            {
+                HandleKillImpl(pGroupGuy, killed);
+            }
+        }
+    }
+    else
+    {
+        // creature kills must be notified, even if not inside objective / not outdoor pvp active
+        if(killer && (( killer->IsOutdoorPvPActive() && IsInsideObjective(killer) ) || killed->GetTypeId() == TYPEID_UNIT))
+        {
+            HandleKillImpl(killer, killed);
+        }
+    }
+}
+
+bool OutdoorPvP::IsInsideObjective(Player *plr)
+{
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+    {
+        if((*itr)->IsInsideObjective(plr))
+            return true;
+    }
+    return false;
+}
+
+bool OutdoorPvPObjective::IsInsideObjective(Player *plr)
+{
+    std::set<uint64>::iterator itr = m_ActivePlayerGuids.find(plr->GetGUID());
+    return itr != m_ActivePlayerGuids.end();
+}
+
+bool OutdoorPvP::HandleCustomSpell(Player *plr, uint32 spellId, GameObject * go)
+{
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+    {
+        if((*itr)->HandleCustomSpell(plr,spellId,go))
+            return true;
+    }
+    return false;
+}
+
+bool OutdoorPvPObjective::HandleCustomSpell(Player *plr, uint32 spellId, GameObject * go)
+{
+    if(!plr->IsOutdoorPvPActive())
+        return false;
+    return false;
+}
+
+bool OutdoorPvP::HandleOpenGo(Player *plr, uint64 guid)
+{
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+    {
+        if((*itr)->HandleOpenGo(plr,guid) >= 0)
+            return true;
+    }
+    return false;
+}
+
+bool OutdoorPvP::HandleCaptureCreaturePlayerMoveInLos(Player * p, Creature * c)
+{
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+    {
+        if((*itr)->HandleCaptureCreaturePlayerMoveInLos(p, c))
+            return true;
+    }
+    return false;
+}
+
+bool OutdoorPvP::HandleGossipOption(Player * plr, uint64 guid, uint32 id)
+{
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+    {
+        if((*itr)->HandleGossipOption(plr, guid, id))
+            return true;
+    }
+    return false;
+}
+
+bool OutdoorPvP::CanTalkTo(Player * plr, Creature * c, GossipOption &gso)
+{
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+    {
+        if((*itr)->CanTalkTo(plr, c, gso))
+            return true;
+    }
+    return false;
+}
+
+bool OutdoorPvP::HandleDropFlag(Player * plr, uint32 id)
+{
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+    {
+        if((*itr)->HandleDropFlag(plr, id))
+            return true;
+    }
+    return false;
+}
+
+bool OutdoorPvPObjective::HandleGossipOption(Player * plr, uint64 guid, uint32 id)
+{
+    return false;
+}
+
+bool OutdoorPvPObjective::CanTalkTo(Player * plr, Creature * c, GossipOption &gso)
+{
+    return false;
+}
+
+bool OutdoorPvPObjective::HandleDropFlag(Player * plr, uint32 id)
+{
+    return false;
+}
+
+int32 OutdoorPvPObjective::HandleOpenGo(Player *plr, uint64 guid)
+{
+    std::map<uint64,uint32>::iterator itr = m_ObjectTypes.find(guid);
+    if(itr != m_ObjectTypes.end())
+    {
+        return itr->second;   
+    }
+    return -1;
+}
+
+bool OutdoorPvP::HandleAreaTrigger(Player *plr, uint32 trigger)
+{
+    return false;
+}
Index: trunk/src/game/TemporarySummon.cpp
===================================================================
--- trunk/src/game/TemporarySummon.cpp (revision 2)
+++ trunk/src/game/TemporarySummon.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/SkillExtraItems.cpp
===================================================================
--- trunk/src/game/SkillExtraItems.cpp (revision 2)
+++ trunk/src/game/SkillExtraItems.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/SocialMgr.h
===================================================================
--- trunk/src/game/SocialMgr.h (revision 2)
+++ trunk/src/game/SocialMgr.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef __MANGOS_SOCIALMGR_H
-#define __MANGOS_SOCIALMGR_H
+#ifndef __TRINITY_SOCIALMGR_H
+#define __TRINITY_SOCIALMGR_H
 
 #include "Policies/Singleton.h"
@@ -150,4 +152,4 @@
 };
 
-#define sSocialMgr MaNGOS::Singleton<SocialMgr>::Instance()
+#define sSocialMgr Trinity::Singleton<SocialMgr>::Instance()
 #endif
Index: trunk/src/game/PlayerDump.h
===================================================================
--- trunk/src/game/PlayerDump.h (revision 2)
+++ trunk/src/game/PlayerDump.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/OutdoorPvPMgr.cpp
===================================================================
--- trunk/src/game/OutdoorPvPMgr.cpp (revision 44)
+++ trunk/src/game/OutdoorPvPMgr.cpp (revision 44)
@@ -0,0 +1,219 @@
+#include "OutdoorPvPMgr.h"
+#include "OutdoorPvPHP.h"
+#include "OutdoorPvPNA.h"
+#include "OutdoorPvPTF.h"
+#include "OutdoorPvPZM.h"
+#include "OutdoorPvPSI.h"
+#include "OutdoorPvPEP.h"
+#include "Player.h"
+#include "Policies/SingletonImp.h"
+
+INSTANTIATE_SINGLETON_1( OutdoorPvPMgr );
+
+OutdoorPvPMgr::OutdoorPvPMgr()
+{
+    //sLog.outDebug("Instantiating OutdoorPvPMgr");
+}
+
+OutdoorPvPMgr::~OutdoorPvPMgr()
+{
+    //sLog.outDebug("Deleting OutdoorPvPMgr");
+    for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
+    {
+        (*itr)->DeleteSpawns();
+    }
+}
+
+void OutdoorPvPMgr::InitOutdoorPvP()
+{
+    // create new opvp
+    OutdoorPvP * pOP = new OutdoorPvPHP;
+    // respawn, init variables
+    if(!pOP->SetupOutdoorPvP())
+    {
+        sLog.outDebug("OutdoorPvP : HP init failed.");
+        delete pOP;
+    }
+    else
+    {
+        m_OutdoorPvPSet.insert(pOP);
+        sLog.outDebug("OutdoorPvP : HP successfully initiated.");
+    }
+
+
+    pOP = new OutdoorPvPNA;
+    // respawn, init variables
+    if(!pOP->SetupOutdoorPvP())
+    {
+        sLog.outDebug("OutdoorPvP : NA init failed.");
+        delete pOP;
+    }
+    else
+    {
+        m_OutdoorPvPSet.insert(pOP);
+        sLog.outDebug("OutdoorPvP : NA successfully initiated.");
+    }
+
+
+    pOP = new OutdoorPvPTF;
+    // respawn, init variables
+    if(!pOP->SetupOutdoorPvP())
+    {
+        sLog.outDebug("OutdoorPvP : TF init failed.");
+        delete pOP;
+    }
+    else
+    {
+        m_OutdoorPvPSet.insert(pOP);
+        sLog.outDebug("OutdoorPvP : TF successfully initiated.");
+    }
+
+    pOP = new OutdoorPvPZM;
+    // respawn, init variables
+    if(!pOP->SetupOutdoorPvP())
+    {
+        sLog.outDebug("OutdoorPvP : ZM init failed.");
+        delete pOP;
+    }
+    else
+    {
+        m_OutdoorPvPSet.insert(pOP);
+        sLog.outDebug("OutdoorPvP : ZM successfully initiated.");
+    }
+
+    pOP = new OutdoorPvPSI;
+    // respawn, init variables
+    if(!pOP->SetupOutdoorPvP())
+    {
+        sLog.outDebug("OutdoorPvP : SI init failed.");
+        delete pOP;
+    }
+    else
+    {
+        m_OutdoorPvPSet.insert(pOP);
+        sLog.outDebug("OutdoorPvP : SI successfully initiated.");
+    }
+
+    pOP = new OutdoorPvPEP;
+    // respawn, init variables
+    if(!pOP->SetupOutdoorPvP())
+    {
+        sLog.outDebug("OutdoorPvP : EP init failed.");
+        delete pOP;
+    }
+    else
+    {
+        m_OutdoorPvPSet.insert(pOP);
+        sLog.outDebug("OutdoorPvP : EP successfully initiated.");
+    }
+}
+
+void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP *handle)
+{
+    m_OutdoorPvPMap[zoneid] = handle;
+}
+
+
+void OutdoorPvPMgr::HandlePlayerEnterZone(Player *plr, uint32 zoneid)
+{
+    OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find(zoneid);
+    if(itr == m_OutdoorPvPMap.end())
+    {
+        // no handle for this zone, return
+        return;
+    }
+    // add possibly beneficial buffs to plr for zone
+    itr->second->HandlePlayerEnterZone(plr, zoneid);
+    plr->SendInitWorldStates();
+    sLog.outDebug("Player %u entered outdoorpvp id %u",plr->GetGUIDLow(), itr->second->GetTypeId());
+}
+
+void OutdoorPvPMgr::HandlePlayerLeaveZone(Player *plr, uint32 zoneid)
+{
+    OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find(zoneid);
+    if(itr == m_OutdoorPvPMap.end())
+    {
+        // no handle for this zone, return
+        return;
+    }
+    // inform the OutdoorPvP class of the leaving, it should remove the player from all objectives
+    itr->second->HandlePlayerLeaveZone(plr, zoneid);
+    sLog.outDebug("Player %u left outdoorpvp id %u",plr->GetGUIDLow(), itr->second->GetTypeId());
+}
+
+OutdoorPvP * OutdoorPvPMgr::GetOutdoorPvPToZoneId(uint32 zoneid)
+{
+    OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find(zoneid);
+    if(itr == m_OutdoorPvPMap.end())
+    {
+        // no handle for this zone, return
+        return NULL;
+    }
+    return itr->second;
+}
+
+void OutdoorPvPMgr::Update(uint32 diff)
+{
+    for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
+    {
+        (*itr)->Update(diff);
+    }
+}
+
+bool OutdoorPvPMgr::HandleCustomSpell(Player *plr, uint32 spellId, GameObject * go)
+{
+    for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
+    {
+        if((*itr)->HandleCustomSpell(plr,spellId,go))
+            return true;
+    }
+    return false;
+}
+
+bool OutdoorPvPMgr::HandleOpenGo(Player *plr, uint64 guid)
+{
+    for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
+    {
+        if((*itr)->HandleOpenGo(plr,guid))
+            return true;
+    }
+    return false;
+}
+
+bool OutdoorPvPMgr::HandleCaptureCreaturePlayerMoveInLos(Player * plr, Creature * c)
+{
+    for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
+    {
+        if((*itr)->HandleCaptureCreaturePlayerMoveInLos(plr,c))
+            return true;
+    }
+    return false;
+}
+
+void OutdoorPvPMgr::HandleGossipOption(Player *plr, uint64 guid, uint32 gossipid)
+{
+    for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
+    {
+        if((*itr)->HandleGossipOption(plr,guid,gossipid))
+            return;
+    }
+}
+
+bool OutdoorPvPMgr::CanTalkTo(Player * plr, Creature * c, GossipOption & gso)
+{
+    for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
+    {
+        if((*itr)->CanTalkTo(plr,c,gso))
+            return true;
+    }
+    return false;
+}
+
+void OutdoorPvPMgr::HandleDropFlag(Player *plr, uint32 spellId)
+{
+    for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
+    {
+        if((*itr)->HandleDropFlag(plr,spellId))
+            return;
+    }
+}
Index: trunk/src/game/Totem.cpp
===================================================================
--- trunk/src/game/Totem.cpp (revision 2)
+++ trunk/src/game/Totem.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/ConfusedMovementGenerator.cpp
===================================================================
--- trunk/src/game/ConfusedMovementGenerator.cpp (revision 37)
+++ trunk/src/game/ConfusedMovementGenerator.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -50,6 +52,6 @@
 
         // prevent invalid coordinates generation
-        MaNGOS::NormalizeMapCoord(i_waypoints[idx][0]);
-        MaNGOS::NormalizeMapCoord(i_waypoints[idx][1]);
+        Trinity::NormalizeMapCoord(i_waypoints[idx][0]);
+        Trinity::NormalizeMapCoord(i_waypoints[idx][1]);
 
         bool is_water = map->IsInWater(i_waypoints[idx][0],i_waypoints[idx][1],z);
Index: trunk/src/game/GossipDef.h
===================================================================
--- trunk/src/game/GossipDef.h (revision 37)
+++ trunk/src/game/GossipDef.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_GOSSIP_H
-#define MANGOSSERVER_GOSSIP_H
+#ifndef TRINITYCORE_GOSSIP_H
+#define TRINITYCORE_GOSSIP_H
 
 #include "Common.h"
@@ -96,5 +98,5 @@
 typedef std::vector<QuestMenuItem> QuestMenuItemList;
 
-class MANGOS_DLL_SPEC GossipMenu
+class TRINITY_DLL_SPEC GossipMenu
 {
     public:
@@ -164,5 +166,5 @@
 };
 
-class MANGOS_DLL_SPEC PlayerMenu
+class TRINITY_DLL_SPEC PlayerMenu
 {
     private:
Index: trunk/src/game/ItemEnchantmentMgr.cpp
===================================================================
--- trunk/src/game/ItemEnchantmentMgr.cpp (revision 2)
+++ trunk/src/game/ItemEnchantmentMgr.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/ArenaTeamHandler.cpp
===================================================================
--- trunk/src/game/ArenaTeamHandler.cpp (revision 37)
+++ trunk/src/game/ArenaTeamHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Weather.cpp
===================================================================
--- trunk/src/game/Weather.cpp (revision 2)
+++ trunk/src/game/Weather.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Corpse.h
===================================================================
--- trunk/src/game/Corpse.h (revision 2)
+++ trunk/src/game/Corpse.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_CORPSE_H
-#define MANGOSSERVER_CORPSE_H
+#ifndef TRINITYCORE_CORPSE_H
+#define TRINITYCORE_CORPSE_H
 
 #include "Object.h"
Index: trunk/src/game/Player.h
===================================================================
--- trunk/src/game/Player.h (revision 37)
+++ trunk/src/game/Player.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -46,4 +48,5 @@
 class UpdateMask;
 class PlayerSocial;
+class OutdoorPvP;
 
 typedef std::deque<Mail*> PlayerMails;
@@ -833,5 +836,5 @@
 };
 
-class MANGOS_DLL_SPEC PlayerTaxi
+class TRINITY_DLL_SPEC PlayerTaxi
 {
     public:
@@ -884,5 +887,5 @@
 };
 
-class MANGOS_DLL_SPEC Player : public Unit
+class TRINITY_DLL_SPEC Player : public Unit
 {
     friend class WorldSession;
@@ -1777,5 +1780,5 @@
         void CastItemCombatSpell(Item *item,Unit* Target, WeaponAttackType attType);
 
-        void SendInitWorldStates();
+        void SendInitWorldStates(bool force = false, uint32 forceZoneId = 0);
         void SendUpdateWorldState(uint32 Field, uint32 Value);
         void SendDirectMessage(WorldPacket *data);
@@ -1804,11 +1807,11 @@
         uint32 GetBattleGroundQueueIdFromLevel() const;
 
-        bool InBattleGroundQueue() const 	 
-	    { 	 
-	        for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++) 	 
-                if (m_bgBattleGroundQueueID[i].bgQueueType != 0) 	 
-	                return true; 	 
-	        return false; 	 
-	    }
+        bool InBattleGroundQueue() const
+        {
+            for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
+                if (m_bgBattleGroundQueueID[i].bgQueueType != 0)
+                    return true;
+            return false;
+        }
 
         uint32 GetBattleGroundQueueId(uint32 index) const { return m_bgBattleGroundQueueID[index].bgQueueType; }
@@ -1903,4 +1906,12 @@
         bool GetBGAccessByLevel(uint32 bgTypeId) const;
         bool isAllowUseBattleGroundObject();
+
+        /*********************************************************/
+        /***               OUTDOOR PVP SYSTEM                  ***/
+        /*********************************************************/
+
+        OutdoorPvP * GetOutdoorPvP() const;
+        // returns true if the player is in active state for outdoor pvp objective capturing, false otherwise
+        bool IsOutdoorPvPActive();
 
         /*********************************************************/
Index: trunk/src/game/Group.h
===================================================================
--- trunk/src/game/Group.h (revision 9)
+++ trunk/src/game/Group.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_GROUP_H
-#define MANGOSSERVER_GROUP_H
+#ifndef TRINITYCORE_GROUP_H
+#define TRINITYCORE_GROUP_H
 
 #include "GroupReference.h"
@@ -128,5 +130,5 @@
 /** request member stats checken **/
 /** todo: uninvite people that not accepted invite **/
-class MANGOS_DLL_SPEC Group
+class TRINITY_DLL_SPEC Group
 {
     public:
Index: trunk/src/game/TotemAI.h
===================================================================
--- trunk/src/game/TotemAI.h (revision 2)
+++ trunk/src/game/TotemAI.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_TOTEMAI_H
-#define MANGOS_TOTEMAI_H
+#ifndef TRINITY_TOTEMAI_H
+#define TRINITY_TOTEMAI_H
 
 #include "CreatureAI.h"
@@ -26,5 +28,5 @@
 class Totem;
 
-class MANGOS_DLL_DECL TotemAI : public CreatureAI
+class TRINITY_DLL_DECL TotemAI : public CreatureAI
 {
     public:
Index: trunk/src/game/OutdoorPvPHP.cpp
===================================================================
--- trunk/src/game/OutdoorPvPHP.cpp (revision 44)
+++ trunk/src/game/OutdoorPvPHP.cpp (revision 44)
@@ -0,0 +1,380 @@
+#include "OutdoorPvPHP.h"
+#include "OutdoorPvP.h"
+#include "OutdoorPvPMgr.h"
+#include "Player.h"
+#include "WorldPacket.h"
+#include "World.h"
+#include "ObjectMgr.h"
+#include "Language.h"
+
+const uint32 HP_LANG_LOOSE_A[HP_TOWER_NUM] = {LANG_OPVP_HP_LOOSE_BROKENHILL_A,LANG_OPVP_HP_LOOSE_OVERLOOK_A,LANG_OPVP_HP_LOOSE_STADIUM_A};
+
+const uint32 HP_LANG_LOOSE_H[HP_TOWER_NUM] = {LANG_OPVP_HP_LOOSE_BROKENHILL_H,LANG_OPVP_HP_LOOSE_OVERLOOK_H,LANG_OPVP_HP_LOOSE_STADIUM_H};
+
+const uint32 HP_LANG_CAPTURE_A[HP_TOWER_NUM] = {LANG_OPVP_HP_CAPTURE_BROKENHILL_A,LANG_OPVP_HP_CAPTURE_OVERLOOK_A,LANG_OPVP_HP_CAPTURE_STADIUM_A};
+
+const uint32 HP_LANG_CAPTURE_H[HP_TOWER_NUM] = {LANG_OPVP_HP_CAPTURE_BROKENHILL_H,LANG_OPVP_HP_CAPTURE_OVERLOOK_H,LANG_OPVP_HP_CAPTURE_STADIUM_H};
+
+OutdoorPvPObjectiveHP::OutdoorPvPObjectiveHP(OutdoorPvP *pvp,OutdoorPvPHPTowerType type)
+: OutdoorPvPObjective(pvp), m_TowerType(type)
+{
+    AddCapturePoint(HPCapturePoints[type].entry,
+        HPCapturePoints[type].map,
+        HPCapturePoints[type].x,
+        HPCapturePoints[type].y,
+        HPCapturePoints[type].z,
+        HPCapturePoints[type].o,
+        HPCapturePoints[type].rot0,
+        HPCapturePoints[type].rot1,
+        HPCapturePoints[type].rot2,
+        HPCapturePoints[type].rot3);
+    AddObject(type,
+        HPTowerFlags[type].entry,
+        HPTowerFlags[type].map,
+        HPTowerFlags[type].x,
+        HPTowerFlags[type].y,
+        HPTowerFlags[type].z,
+        HPTowerFlags[type].o,
+        HPTowerFlags[type].rot0,
+        HPTowerFlags[type].rot1,
+        HPTowerFlags[type].rot2,
+        HPTowerFlags[type].rot3);
+}
+
+OutdoorPvPHP::OutdoorPvPHP()
+{
+    m_TypeId = OUTDOOR_PVP_HP;
+}
+
+bool OutdoorPvPHP::SetupOutdoorPvP()
+{
+    m_AllianceTowersControlled = 0;
+    m_HordeTowersControlled = 0;
+    // add the zones affected by the pvp buff
+    for(int i = 0; i < OutdoorPvPHPBuffZonesNum; ++i)
+        sOutdoorPvPMgr.AddZone(OutdoorPvPHPBuffZones[i],this);
+
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveHP(this,HP_TOWER_BROKEN_HILL));
+
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveHP(this,HP_TOWER_OVERLOOK));
+
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveHP(this,HP_TOWER_STADIUM));
+
+    return true;
+}
+
+void OutdoorPvPHP::HandlePlayerEnterZone(Player * plr, uint32 zone)
+{
+    // add buffs
+    if(plr->GetTeam() == ALLIANCE)
+    {
+        if(m_AllianceTowersControlled >=3)
+            plr->CastSpell(plr,AllianceBuff,true);
+    }
+    else
+    {
+        if(m_HordeTowersControlled >=3)
+            plr->CastSpell(plr,HordeBuff,true);
+    }
+    OutdoorPvP::HandlePlayerEnterZone(plr,zone);
+}
+
+void OutdoorPvPHP::HandlePlayerLeaveZone(Player * plr, uint32 zone)
+{
+    // remove buffs
+    if(plr->GetTeam() == ALLIANCE)
+    {
+        plr->RemoveAurasDueToSpell(AllianceBuff);
+    }
+    else
+    {
+        plr->RemoveAurasDueToSpell(HordeBuff);
+    }
+    OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
+}
+
+bool OutdoorPvPHP::Update(uint32 diff)
+{
+    bool changed = false;
+    if(changed = OutdoorPvP::Update(diff))
+    {
+        if(m_AllianceTowersControlled == 3)
+            BuffTeam(ALLIANCE);
+        else if(m_HordeTowersControlled == 3)
+            BuffTeam(HORDE);
+        else
+            BuffTeam(NULL);
+        SendUpdateWorldState(HP_UI_TOWER_COUNT_A, m_AllianceTowersControlled);
+        SendUpdateWorldState(HP_UI_TOWER_COUNT_H, m_HordeTowersControlled);
+    }
+    return changed;
+}
+
+void OutdoorPvPHP::SendRemoveWorldStates(Player *plr)
+{
+    plr->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_A,0);
+    plr->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_H,0);
+    plr->SendUpdateWorldState(HP_UI_TOWER_COUNT_H,0);
+    plr->SendUpdateWorldState(HP_UI_TOWER_COUNT_A,0);
+    plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_N,0);
+    plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS,0);
+    plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY,0);
+    for(int i = 0; i < HP_TOWER_NUM; ++i)
+    {
+        plr->SendUpdateWorldState(HP_MAP_N[i],0);
+        plr->SendUpdateWorldState(HP_MAP_A[i],0);
+        plr->SendUpdateWorldState(HP_MAP_H[i],0);
+    }
+}
+
+void OutdoorPvPHP::FillInitialWorldStates(WorldPacket &data)
+{
+    data << uint32(HP_UI_TOWER_DISPLAY_A) << uint32(1);
+    data << uint32(HP_UI_TOWER_DISPLAY_H) << uint32(1);
+    data << uint32(HP_UI_TOWER_COUNT_A) << uint32(m_AllianceTowersControlled);
+    data << uint32(HP_UI_TOWER_COUNT_H) << uint32(m_HordeTowersControlled);
+    data << uint32(HP_UI_TOWER_SLIDER_DISPLAY) << uint32(0);
+    data << uint32(HP_UI_TOWER_SLIDER_POS) << uint32(50);
+    data << uint32(HP_UI_TOWER_SLIDER_N) << uint32(100);
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+    {
+        (*itr)->FillInitialWorldStates(data);
+    }
+}
+
+bool OutdoorPvPObjectiveHP::Update(uint32 diff)
+{
+    // if status changed:
+    if(OutdoorPvPObjective::Update(diff))
+    {
+        if(m_OldState != m_State)
+        {
+            uint32 field = 0;
+            switch(m_OldState)
+            {
+            case OBJECTIVESTATE_NEUTRAL:
+                field = HP_MAP_N[m_TowerType];
+                break;
+            case OBJECTIVESTATE_ALLIANCE:
+                field = HP_MAP_A[m_TowerType];
+                if(((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled)
+                    ((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled--;
+                sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],objmgr.GetTrinityStringForDBCLocale(HP_LANG_LOOSE_A[m_TowerType]));
+                break;
+            case OBJECTIVESTATE_HORDE:
+                field = HP_MAP_H[m_TowerType];
+                if(((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled)
+                    ((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled--;
+                sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],objmgr.GetTrinityStringForDBCLocale(HP_LANG_LOOSE_H[m_TowerType]));
+                break;
+            case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
+                field = HP_MAP_N[m_TowerType];
+                break;
+            case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
+                field = HP_MAP_N[m_TowerType];
+                break;
+            case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
+                field = HP_MAP_A[m_TowerType];
+                break;
+            case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
+                field = HP_MAP_H[m_TowerType];
+                break;
+            }
+
+            // send world state update
+            if(field)
+            {
+                m_PvP->SendUpdateWorldState(field, 0);
+                field = 0;
+            }
+            uint32 artkit = 21;
+            uint32 artkit2 = HP_TowerArtKit_N[m_TowerType];
+            switch(m_State)
+            {
+            case OBJECTIVESTATE_NEUTRAL:
+                field = HP_MAP_N[m_TowerType];
+                break;
+            case OBJECTIVESTATE_ALLIANCE:
+                field = HP_MAP_A[m_TowerType];
+                artkit = 2;
+                artkit2 = HP_TowerArtKit_A[m_TowerType];
+                if(((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled<3)
+                    ((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled++;
+                sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],objmgr.GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_A[m_TowerType]));
+                break;
+            case OBJECTIVESTATE_HORDE:
+                field = HP_MAP_H[m_TowerType];
+                artkit = 1;
+                artkit2 = HP_TowerArtKit_H[m_TowerType];
+                if(((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled<3)
+                    ((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled++;
+                sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],objmgr.GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_H[m_TowerType]));
+                break;
+            case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
+                field = HP_MAP_N[m_TowerType];
+                break;
+            case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
+                field = HP_MAP_N[m_TowerType];
+                break;
+            case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
+                field = HP_MAP_A[m_TowerType];
+                artkit = 2;
+                artkit2 = HP_TowerArtKit_A[m_TowerType];
+                break;
+            case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
+                field = HP_MAP_H[m_TowerType];
+                artkit = 1;
+                artkit2 = HP_TowerArtKit_H[m_TowerType];
+                break;
+            }
+
+            GameObject* flag = HashMapHolder<GameObject>::Find(m_CapturePoint);
+            GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[m_TowerType]);
+            if(flag)
+            {
+                flag->SetGoArtKit(artkit);
+                flag->SendUpdateObjectToAllExcept(NULL);
+            }
+            if(flag2)
+            {
+                flag2->SetGoArtKit(artkit2);
+                flag2->SendUpdateObjectToAllExcept(NULL);
+            }
+
+            // send world state update
+            if(field)
+                m_PvP->SendUpdateWorldState(field, 1);
+
+            // complete quest objective
+            if(m_State == OBJECTIVESTATE_ALLIANCE || m_State == OBJECTIVESTATE_HORDE)
+                SendObjectiveComplete(HP_CREDITMARKER[m_TowerType], 0);
+        }
+
+        if(m_ShiftPhase != m_OldPhase)
+        {
+            SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, m_NeutralValue);
+            // send these updates to only the ones in this objective
+            uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+            SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, phase);
+            // send this too, sometimes the slider disappears, dunno why :(
+            SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 1);
+        }
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveHP::FillInitialWorldStates(WorldPacket &data)
+{
+    switch(m_State)
+    {
+        case OBJECTIVESTATE_ALLIANCE:
+        case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
+            data << uint32(HP_MAP_N[m_TowerType]) << uint32(0);
+            data << uint32(HP_MAP_A[m_TowerType]) << uint32(1);
+            data << uint32(HP_MAP_H[m_TowerType]) << uint32(0);
+            break;
+        case OBJECTIVESTATE_HORDE:
+        case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
+            data << uint32(HP_MAP_N[m_TowerType]) << uint32(0);
+            data << uint32(HP_MAP_A[m_TowerType]) << uint32(0);
+            data << uint32(HP_MAP_H[m_TowerType]) << uint32(1);
+            break;
+        case OBJECTIVESTATE_NEUTRAL:
+        case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
+        case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
+        default:
+            data << uint32(HP_MAP_N[m_TowerType]) << uint32(1);
+            data << uint32(HP_MAP_A[m_TowerType]) << uint32(0);
+            data << uint32(HP_MAP_H[m_TowerType]) << uint32(0);
+            break;
+    }
+}
+
+bool OutdoorPvPObjectiveHP::HandlePlayerEnter(Player *plr)
+{
+    if(OutdoorPvPObjective::HandlePlayerEnter(plr))
+    {
+        plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 1);
+        uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+        plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, phase);
+        plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, m_NeutralValue);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveHP::HandlePlayerLeave(Player *plr)
+{
+    plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 0);
+    OutdoorPvPObjective::HandlePlayerLeave(plr);
+}
+
+void OutdoorPvPHP::BuffTeam(uint32 team)
+{
+    if(team == ALLIANCE)
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->CastSpell(plr,AllianceBuff,true);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(HordeBuff);
+        }
+    }
+    else if(team == HORDE)
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->CastSpell(plr,HordeBuff,true);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(AllianceBuff);
+        }
+    }
+    else
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(AllianceBuff);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(HordeBuff);
+        }
+    }
+}
+
+void OutdoorPvPHP::HandleKillImpl(Player *plr, Unit * killed)
+{
+    if(killed->GetTypeId() != TYPEID_PLAYER)
+        return;
+
+    if(plr->GetTeam() == ALLIANCE && ((Player*)killed)->GetTeam() != ALLIANCE)
+        plr->CastSpell(plr,AlliancePlayerKillReward,true);
+    else if(plr->GetTeam() == HORDE && ((Player*)killed)->GetTeam() != HORDE)
+        plr->CastSpell(plr,HordePlayerKillReward,true);
+}
+
+bool OutdoorPvPObjectiveHP::HandleCapturePointEvent(Player *plr, uint32 eventId)
+{
+    if(eventId == HP_CapturePointEvent_Enter[m_TowerType])
+    {
+        this->HandlePlayerEnter(plr);
+        return true;
+    }
+    else if(eventId == HP_CapturePointEvent_Leave[m_TowerType])
+    {
+        this->HandlePlayerLeave(plr);
+        return true;
+    }
+    return false;
+}
Index: trunk/src/game/HomeMovementGenerator.cpp
===================================================================
--- trunk/src/game/HomeMovementGenerator.cpp (revision 37)
+++ trunk/src/game/HomeMovementGenerator.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/SkillDiscovery.h
===================================================================
--- trunk/src/game/SkillDiscovery.h (revision 2)
+++ trunk/src/game/SkillDiscovery.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_SKILLDISCOVERY_H
-#define MANGOS_SKILLDISCOVERY_H
+#ifndef TRINITY_SKILLDISCOVERY_H
+#define TRINITY_SKILLDISCOVERY_H
 
 #include "Common.h"
Index: trunk/src/game/DynamicObject.h
===================================================================
--- trunk/src/game/DynamicObject.h (revision 2)
+++ trunk/src/game/DynamicObject.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_DYNAMICOBJECT_H
-#define MANGOSSERVER_DYNAMICOBJECT_H
+#ifndef TRINITYCORE_DYNAMICOBJECT_H
+#define TRINITYCORE_DYNAMICOBJECT_H
 
 #include "Object.h"
Index: trunk/src/game/GameEvent.h
===================================================================
--- trunk/src/game/GameEvent.h (revision 2)
+++ trunk/src/game/GameEvent.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_GAMEEVENT_H
-#define MANGOS_GAMEEVENT_H
+#ifndef TRINITY_GAMEEVENT_H
+#define TRINITY_GAMEEVENT_H
 
 #include "Platform/Define.h"
@@ -26,14 +28,42 @@
 #define max_ge_check_delay 86400                            // 1 day in seconds
 
+enum GameEventState
+{
+    GAMEEVENT_NORMAL = 0,   // standard game events
+    GAMEEVENT_WORLD_INACTIVE,   // not yet started
+    GAMEEVENT_WORLD_CONDITIONS,  // condition matching phase
+    GAMEEVENT_WORLD_NEXTPHASE,   // conditions are met, now 'lenght' timer to start next event
+    GAMEEVENT_WORLD_FINISHED    // next events are started, unapply this one
+};
+
+struct GameEventFinishCondition
+{
+    float reqNum;  // required number // use float, since some events use percent
+    float done;    // done number
+    uint32 max_world_state;  // max resource count world state update id
+    uint32 done_world_state; // done resource count world state update id
+};
+
+struct GameEventQuestToEventConditionNum
+{
+    uint16 event_id;
+    uint32 condition;
+    float num;
+};
+
 struct GameEventData
 {
-    GameEventData() : start(1),end(0),occurence(0),length(0) {}
-    time_t start;
-    time_t end;
-    uint32 occurence;
-    uint32 length;
+    GameEventData() : start(1),end(0),nextstart(0),occurence(0),length(0),state(GAMEEVENT_NORMAL) {}
+    time_t start;   // occurs after this time
+    time_t end;     // occurs before this time
+    time_t nextstart; // after this time the follow-up events count this phase completed
+    uint32 occurence;   // time between end and start
+    uint32 length;  // length of the event (minutes) after finishing all conditions
+    GameEventState state;   // state of the game event, these are saved into the game_event table on change!
+    std::map<uint32 /*condition id*/, GameEventFinishCondition> conditions;  // conditions to finish
+    std::set<uint16 /*gameevent id*/> prerequisite_events;  // events that must be completed before starting this event
     std::string description;
 
-    bool isValid() const { return length > 0; }
+    bool isValid() const { return ((length > 0) || (state > GAMEEVENT_NORMAL)); }
 };
 
@@ -46,4 +76,14 @@
 };
 
+struct NPCVendorEntry
+{
+    uint32 entry;                                           // creature entry
+    uint32 item;                                            // item id
+    uint32 maxcount;                                        // 0 for infinite
+    uint32 incrtime;                                        // time for restore items amount if maxcount != 0
+    uint32 ExtendedCost;
+};
+
+class Player;
 class GameEvent
 {
@@ -61,7 +101,12 @@
         bool IsActiveEvent(uint16 event_id) { return ( m_ActiveEvents.find(event_id)!=m_ActiveEvents.end()); }
         uint32 Initialize();
-        void StartEvent(uint16 event_id, bool overwrite = false);
+        bool StartEvent(uint16 event_id, bool overwrite = false);
         void StopEvent(uint16 event_id, bool overwrite = false);
+        void HandleQuestComplete(uint32 quest_id);  // called on world event type quest completions
+        void HandleWorldEventGossip(Player * plr, Creature * c);
+        uint32 GetNPCFlag(Creature * cr);
+        uint32 GetNpcTextId(uint32 guid);
     private:
+        void SendWorldStateUpdate(Player * plr, uint16 event_id);
         void AddActiveEvent(uint16 event_id) { m_ActiveEvents.insert(event_id); }
         void RemoveActiveEvent(uint16 event_id) { m_ActiveEvents.erase(event_id); }
@@ -72,4 +117,12 @@
         void ChangeEquipOrModel(int16 event_id, bool activate);
         void UpdateEventQuests(uint16 event_id, bool Activate);
+        void UpdateEventNPCFlags(uint16 event_id);
+        void UpdateEventNPCVendor(uint16 event_id, bool activate);
+        bool CheckOneGameEventConditions(uint16 event_id);
+        void SaveWorldEventStateToDB(uint16 event_id);
+        bool hasCreatureQuestActiveEventExcept(uint32 quest_id, uint16 event_id);
+        bool hasGameObjectQuestActiveEventExcept(uint32 quest_id, uint16 event_id);
+        bool hasCreatureActiveEventExcept(uint32 creature_guid, uint16 event_id);
+        bool hasGameObjectActiveEventExcept(uint32 go_guid, uint16 event_id);
     protected:
         typedef std::list<uint32> GuidList;
@@ -81,13 +134,26 @@
         typedef std::list<QuestRelation> QuestRelList;
         typedef std::vector<QuestRelList> GameEventQuestMap;
-        GameEventQuestMap mGameEventQuests;
+        typedef std::list<NPCVendorEntry> NPCVendorList;
+        typedef std::vector<NPCVendorList> GameEventNPCVendorMap;
+        typedef std::map<uint32 /*quest id*/, GameEventQuestToEventConditionNum> QuestIdToEventConditionMap;
+        typedef std::pair<uint32 /*guid*/, uint32 /*npcflag*/> GuidNPCFlagPair;
+        typedef std::list<GuidNPCFlagPair> NPCFlagList;
+        typedef std::vector<NPCFlagList> GameEventNPCFlagMap;
+        typedef std::pair<uint16 /*event id*/, uint32 /*gossip id*/> EventNPCGossipIdPair;
+        typedef std::map<uint32 /*guid*/, EventNPCGossipIdPair> GuidEventNpcGossipIdMap;
+        GameEventQuestMap mGameEventCreatureQuests;
+        GameEventQuestMap mGameEventGameObjectQuests;
+        GameEventNPCVendorMap mGameEventVendors;
         GameEventModelEquipMap mGameEventModelEquip;
         GameEventGuidMap  mGameEventCreatureGuids;
         GameEventGuidMap  mGameEventGameobjectGuids;
         GameEventDataMap  mGameEvent;
+        QuestIdToEventConditionMap mQuestToEventConditions;
+        GameEventNPCFlagMap mGameEventNPCFlags;
+        GuidEventNpcGossipIdMap mNPCGossipIds;
         ActiveEvents m_ActiveEvents;
         bool isSystemInit;
 };
 
-#define gameeventmgr MaNGOS::Singleton<GameEvent>::Instance()
+#define gameeventmgr Trinity::Singleton<GameEvent>::Instance()
 #endif
Index: trunk/src/game/CreatureAIRegistry.h
===================================================================
--- trunk/src/game/CreatureAIRegistry.h (revision 2)
+++ trunk/src/game/CreatureAIRegistry.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_CREATUREAIREGISTRY_H
-#define MANGOS_CREATUREAIREGISTRY_H
+#ifndef TRINITY_CREATUREAIREGISTRY_H
+#define TRINITY_CREATUREAIREGISTRY_H
 
 namespace AIRegistry
Index: trunk/src/game/Map.h
===================================================================
--- trunk/src/game/Map.h (revision 2)
+++ trunk/src/game/Map.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_MAP_H
-#define MANGOS_MAP_H
+#ifndef TRINITY_MAP_H
+#define TRINITY_MAP_H
 
 #include "Platform/Define.h"
@@ -54,5 +56,5 @@
 {
     RGuard(MUTEX &l) : i_lock(l.getReadLock()) {}
-    MaNGOS::GeneralLock<LOCK_TYPE> i_lock;
+    Trinity::GeneralLock<LOCK_TYPE> i_lock;
 };
 
@@ -61,10 +63,10 @@
 {
     WGuard(MUTEX &l) : i_lock(l.getWriteLock()) {}
-    MaNGOS::GeneralLock<LOCK_TYPE> i_lock;
+    Trinity::GeneralLock<LOCK_TYPE> i_lock;
 };
 
 typedef RGuard<GridRWLock, ZThread::Lockable> GridReadGuard;
 typedef WGuard<GridRWLock, ZThread::Lockable> GridWriteGuard;
-typedef MaNGOS::SingleThreaded<GridRWLock>::Lock NullGuard;
+typedef Trinity::SingleThreaded<GridRWLock>::Lock NullGuard;
 
 typedef struct
@@ -123,5 +125,5 @@
 #define MIN_UNLOAD_DELAY      1                             // immediate unload
 
-class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::ObjectLevelLockable<Map, ZThread::Mutex>
+class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::ObjectLevelLockable<Map, ZThread::Mutex>
 {
     public:
@@ -151,5 +153,5 @@
         inline bool IsRemovalGrid(float x, float y) const
         {
-            GridPair p = MaNGOS::ComputeGridPair(x, y);
+            GridPair p = Trinity::ComputeGridPair(x, y);
             return( !getNGrid(p.x_coord, p.y_coord) || getNGrid(p.x_coord, p.y_coord)->GetGridState() == GRID_STATE_REMOVAL );
         }
@@ -273,5 +275,5 @@
 
     protected:
-        typedef MaNGOS::ObjectLevelLockable<Map, ZThread::Mutex>::Lock Guard;
+        typedef Trinity::ObjectLevelLockable<Map, ZThread::Mutex>::Lock Guard;
 
         MapEntry const* i_mapEntry;
@@ -317,5 +319,5 @@
 };
 
-class MANGOS_DLL_SPEC InstanceMap : public Map
+class TRINITY_DLL_SPEC InstanceMap : public Map
 {
     public:
@@ -351,5 +353,5 @@
 };
 
-class MANGOS_DLL_SPEC BattleGroundMap : public Map
+class TRINITY_DLL_SPEC BattleGroundMap : public Map
 {
     public:
Index: trunk/src/game/GossipDef.cpp
===================================================================
--- trunk/src/game/GossipDef.cpp (revision 37)
+++ trunk/src/game/GossipDef.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/CreatureAI.cpp
===================================================================
--- trunk/src/game/CreatureAI.cpp (revision 2)
+++ trunk/src/game/CreatureAI.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/SpellMgr.h
===================================================================
--- trunk/src/game/SpellMgr.h (revision 2)
+++ trunk/src/game/SpellMgr.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/HostilRefManager.cpp
===================================================================
--- trunk/src/game/HostilRefManager.cpp (revision 2)
+++ trunk/src/game/HostilRefManager.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Corpse.cpp
===================================================================
--- trunk/src/game/Corpse.cpp (revision 2)
+++ trunk/src/game/Corpse.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -91,5 +93,5 @@
     SetUInt64Value( CORPSE_FIELD_OWNER, owner->GetGUID() );
 
-    m_grid = MaNGOS::ComputeGridPair(GetPositionX(), GetPositionY());
+    m_grid = Trinity::ComputeGridPair(GetPositionX(), GetPositionY());
 
     return true;
@@ -201,5 +203,5 @@
     }
 
-    m_grid = MaNGOS::ComputeGridPair(GetPositionX(), GetPositionY());
+    m_grid = Trinity::ComputeGridPair(GetPositionX(), GetPositionY());
 
     return true;
Index: trunk/src/game/TradeHandler.cpp
===================================================================
--- trunk/src/game/TradeHandler.cpp (revision 37)
+++ trunk/src/game/TradeHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Pet.h
===================================================================
--- trunk/src/game/Pet.h (revision 2)
+++ trunk/src/game/Pet.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_PET_H
-#define MANGOSSERVER_PET_H
+#ifndef TRINITYCORE_PET_H
+#define TRINITYCORE_PET_H
 
 #include "ObjectDefines.h"
Index: trunk/src/game/BattleGroundAB.cpp
===================================================================
--- trunk/src/game/BattleGroundAB.cpp (revision 34)
+++ trunk/src/game/BattleGroundAB.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -83,5 +85,5 @@
         {
             m_Events |= 0x04;
-            SendMessageToAll(GetMangosString(LANG_BG_AB_ONEMINTOSTART));
+            SendMessageToAll(GetTrinityString(LANG_BG_AB_ONEMINTOSTART));
         }
         // After 1,5 minute, warning is signalled
@@ -89,5 +91,5 @@
         {
             m_Events |= 0x08;
-            SendMessageToAll(GetMangosString(LANG_BG_AB_HALFMINTOSTART));
+            SendMessageToAll(GetTrinityString(LANG_BG_AB_HALFMINTOSTART));
         }
         // After 2 minutes, gates OPEN ! x)
@@ -95,5 +97,5 @@
         {
             m_Events |= 0x10;
-            SendMessageToAll(GetMangosString(LANG_BG_AB_STARTED));
+            SendMessageToAll(GetTrinityString(LANG_BG_AB_STARTED));
 
             // spawn neutral banners
@@ -109,11 +111,7 @@
             DoorOpen(BG_AB_OBJECT_GATE_H);
 
+            PlaySoundToAll(SOUND_BG_START);
             if(sWorld.getConfig(CONFIG_BG_START_MUSIC))
-			{
-				PlaySoundToAll(SOUND_BG_START);
-				PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC
-			}
-			else
-				PlaySoundToAll(SOUND_BG_START);
+                PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC
             SetStatus(STATUS_IN_PROGRESS);
 
@@ -163,5 +161,5 @@
                     char buf[256];
                     uint8 type = (teamIndex == 0) ? CHAT_MSG_BG_SYSTEM_ALLIANCE : CHAT_MSG_BG_SYSTEM_HORDE;
-                    sprintf(buf, GetMangosString(LANG_BG_AB_NODE_TAKEN), (teamIndex == 0) ? GetMangosString(LANG_BG_AB_ALLY) : GetMangosString(LANG_BG_AB_HORDE), _GetNodeName(node));
+                    sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_TAKEN), (teamIndex == 0) ? GetTrinityString(LANG_BG_AB_ALLY) : GetTrinityString(LANG_BG_AB_HORDE), _GetNodeName(node));
                     WorldPacket data;
                     ChatHandler::FillMessageData(&data, NULL, type, LANG_UNIVERSAL, NULL, 0, buf, NULL);
@@ -202,7 +200,7 @@
                 {
                     if( team == BG_TEAM_ALLIANCE )
-                        SendMessageToAll(GetMangosString(LANG_BG_AB_A_NEAR_VICTORY));
+                        SendMessageToAll(GetTrinityString(LANG_BG_AB_A_NEAR_VICTORY));
                     else
-                        SendMessageToAll(GetMangosString(LANG_BG_AB_H_NEAR_VICTORY));
+                        SendMessageToAll(GetTrinityString(LANG_BG_AB_H_NEAR_VICTORY));
                     PlaySoundToAll(SOUND_NEAR_VICTORY);
                     m_IsInformedNearVictory = true;
@@ -315,13 +313,13 @@
     {
         case BG_AB_NODE_STABLES:
-            return GetMangosString(LANG_BG_AB_NODE_STABLES);
+            return GetTrinityString(LANG_BG_AB_NODE_STABLES);
         case BG_AB_NODE_BLACKSMITH:
-            return GetMangosString(LANG_BG_AB_NODE_BLACKSMITH);
+            return GetTrinityString(LANG_BG_AB_NODE_BLACKSMITH);
         case BG_AB_NODE_FARM:
-            return GetMangosString(LANG_BG_AB_NODE_FARM);
+            return GetTrinityString(LANG_BG_AB_NODE_FARM);
         case BG_AB_NODE_LUMBER_MILL:
-            return GetMangosString(LANG_BG_AB_NODE_LUMBER_MILL);
+            return GetTrinityString(LANG_BG_AB_NODE_LUMBER_MILL);
         case BG_AB_NODE_GOLD_MINE:
-            return GetMangosString(LANG_BG_AB_NODE_GOLD_MINE);
+            return GetTrinityString(LANG_BG_AB_NODE_GOLD_MINE);
         default:
             ASSERT(0);
@@ -478,5 +476,5 @@
         _SendNodeUpdate(node);
         m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
-        sprintf(buf, GetMangosString(LANG_BG_AB_NODE_CLAIMED), _GetNodeName(node), (teamIndex == 0) ? GetMangosString(LANG_BG_AB_ALLY) : GetMangosString(LANG_BG_AB_HORDE));
+        sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_CLAIMED), _GetNodeName(node), (teamIndex == 0) ? GetTrinityString(LANG_BG_AB_ALLY) : GetTrinityString(LANG_BG_AB_HORDE));
         sound = SOUND_NODE_CLAIMED;
     }
@@ -496,5 +494,5 @@
             _SendNodeUpdate(node);
             m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
-            sprintf(buf, GetMangosString(LANG_BG_AB_NODE_ASSAULTED), _GetNodeName(node));
+            sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_ASSAULTED), _GetNodeName(node));
         }
         // If contested, change back to occupied
@@ -511,5 +509,5 @@
             m_NodeTimers[node] = 0;
             _NodeOccupied(node,(teamIndex == 0) ? ALLIANCE:HORDE);
-            sprintf(buf, GetMangosString(LANG_BG_AB_NODE_DEFENDED), _GetNodeName(node));
+            sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_DEFENDED), _GetNodeName(node));
         }
         sound = (teamIndex == 0) ? SOUND_NODE_ASSAULTED_ALLIANCE : SOUND_NODE_ASSAULTED_HORDE;
@@ -528,5 +526,5 @@
         _NodeDeOccupied(node);
         m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
-        sprintf(buf, GetMangosString(LANG_BG_AB_NODE_ASSAULTED), _GetNodeName(node));
+        sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_ASSAULTED), _GetNodeName(node));
         sound = (teamIndex == 0) ? SOUND_NODE_ASSAULTED_ALLIANCE : SOUND_NODE_ASSAULTED_HORDE;
     }
@@ -537,5 +535,5 @@
     if( m_Nodes[node] >= BG_AB_NODE_TYPE_OCCUPIED )
     {
-        sprintf(buf, GetMangosString(LANG_BG_AB_NODE_TAKEN), (teamIndex == 0) ? GetMangosString(LANG_BG_AB_ALLY) : GetMangosString(LANG_BG_AB_HORDE), _GetNodeName(node));
+        sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_TAKEN), (teamIndex == 0) ? GetTrinityString(LANG_BG_AB_ALLY) : GetTrinityString(LANG_BG_AB_HORDE), _GetNodeName(node));
         ChatHandler::FillMessageData(&data, NULL, type, LANG_UNIVERSAL, NULL, 0, buf, NULL);
         SendPacketToAll(&data);
Index: trunk/src/game/ObjectAccessor.h
===================================================================
--- trunk/src/game/ObjectAccessor.h (revision 2)
+++ trunk/src/game/ObjectAccessor.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_OBJECTACCESSOR_H
-#define MANGOS_OBJECTACCESSOR_H
+#ifndef TRINITY_OBJECTACCESSOR_H
+#define TRINITY_OBJECTACCESSOR_H
 
 #include "Platform/Define.h"
@@ -50,5 +52,5 @@
         typedef HM_NAMESPACE::hash_map< uint64, T* >   MapType;
         typedef ZThread::FastMutex LockType;
-        typedef MaNGOS::GeneralLock<LockType > Guard;
+        typedef Trinity::GeneralLock<LockType > Guard;
 
         static void Insert(T* o) { m_objectMap[o->GetGUID()] = o; }
@@ -80,8 +82,8 @@
 };
 
-class MANGOS_DLL_DECL ObjectAccessor : public MaNGOS::Singleton<ObjectAccessor, MaNGOS::ClassLevelLockable<ObjectAccessor, ZThread::FastMutex> >
+class TRINITY_DLL_DECL ObjectAccessor : public Trinity::Singleton<ObjectAccessor, Trinity::ClassLevelLockable<ObjectAccessor, ZThread::FastMutex> >
 {
 
-    friend class MaNGOS::OperatorNew<ObjectAccessor>;
+    friend class Trinity::OperatorNew<ObjectAccessor>;
     ObjectAccessor();
     ~ObjectAccessor();
@@ -117,5 +119,5 @@
             if(!obj || obj->GetMapId() != mapid) return NULL;
 
-            CellPair p = MaNGOS::ComputeCellPair(x,y);
+            CellPair p = Trinity::ComputeCellPair(x,y);
             if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
             {
@@ -124,5 +126,5 @@
             }
 
-            CellPair q = MaNGOS::ComputeCellPair(obj->GetPositionX(),obj->GetPositionY());
+            CellPair q = Trinity::ComputeCellPair(obj->GetPositionX(),obj->GetPositionY());
             if(q.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || q.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
             {
@@ -213,5 +215,5 @@
 
         typedef ZThread::FastMutex LockType;
-        typedef MaNGOS::GeneralLock<LockType > Guard;
+        typedef Trinity::GeneralLock<LockType > Guard;
 
         static void _buildChangeObjectForPlayer(WorldObject *, UpdateDataMapType &);
Index: trunk/src/game/WorldSocket.cpp
===================================================================
--- trunk/src/game/WorldSocket.cpp (revision 16)
+++ trunk/src/game/WorldSocket.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Opcodes.h
===================================================================
--- trunk/src/game/Opcodes.h (revision 2)
+++ trunk/src/game/Opcodes.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/UpdateMask.h
===================================================================
--- trunk/src/game/UpdateMask.h (revision 2)
+++ trunk/src/game/UpdateMask.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/CombatHandler.cpp
===================================================================
--- trunk/src/game/CombatHandler.cpp (revision 2)
+++ trunk/src/game/CombatHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/WaypointManager.cpp
===================================================================
--- trunk/src/game/WaypointManager.cpp (revision 2)
+++ trunk/src/game/WaypointManager.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -87,5 +89,5 @@
 
             // prevent using invalid coordinates
-            if(!MaNGOS::IsValidMapCoord(node.x, node.y, node.z, node.orientation))
+            if(!Trinity::IsValidMapCoord(node.x, node.y, node.z, node.orientation))
             {
                 QueryResult *result1 = WorldDatabase.PQuery("SELECT id, map FROM creature WHERE guid = '%u'", id);
@@ -93,6 +95,6 @@
                 else sLog.outErrorDb("ERROR: Waypoint path %d, have invalid coordinates in his waypoint %d (X: %d, Y: %d).", id, point, node.x, node.y);
 
-                MaNGOS::NormalizeMapCoord(node.x);
-                MaNGOS::NormalizeMapCoord(node.y);
+                Trinity::NormalizeMapCoord(node.x);
+                Trinity::NormalizeMapCoord(node.y);
                 if(result1)
                 {
Index: trunk/src/game/OutdoorPvPEP.cpp
===================================================================
--- trunk/src/game/OutdoorPvPEP.cpp (revision 44)
+++ trunk/src/game/OutdoorPvPEP.cpp (revision 44)
@@ -0,0 +1,912 @@
+#include "OutdoorPvPEP.h"
+#include "WorldPacket.h"
+#include "Player.h"
+#include "GameObject.h"
+#include "ObjectMgr.h"
+#include "ObjectAccessor.h"
+#include "OutdoorPvPMgr.h"
+#include "Creature.h"
+#include "Language.h"
+#include "World.h"
+#include "GossipDef.h"
+
+OutdoorPvPObjectiveEP_EWT::OutdoorPvPObjectiveEP_EWT(OutdoorPvP *pvp)
+: OutdoorPvPObjective(pvp), m_TowerState(EP_TS_N), m_UnitsSummonedSide(0)
+{
+    AddCapturePoint(EPCapturePoints[EP_EWT].entry,EPCapturePoints[EP_EWT].map,EPCapturePoints[EP_EWT].x,EPCapturePoints[EP_EWT].y,EPCapturePoints[EP_EWT].z,EPCapturePoints[EP_EWT].o,EPCapturePoints[EP_EWT].rot0,EPCapturePoints[EP_EWT].rot1,EPCapturePoints[EP_EWT].rot2,EPCapturePoints[EP_EWT].rot3);
+    AddObject(EP_EWT_FLAGS,EPTowerFlags[EP_EWT].entry,EPTowerFlags[EP_EWT].map,EPTowerFlags[EP_EWT].x,EPTowerFlags[EP_EWT].y,EPTowerFlags[EP_EWT].z,EPTowerFlags[EP_EWT].o,EPTowerFlags[EP_EWT].rot0,EPTowerFlags[EP_EWT].rot1,EPTowerFlags[EP_EWT].rot2,EPTowerFlags[EP_EWT].rot3);
+}
+
+bool OutdoorPvPObjectiveEP_EWT::Update(uint32 diff)
+{
+    if(OutdoorPvPObjective::Update(diff))
+    {
+        if(m_OldState != m_State || fabs(m_ShiftPhase) == m_ShiftMaxPhase)  // state won't change, only phase when maxed out!
+        {
+            // if changing from controlling alliance to horde or vice versa
+            if( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
+            {
+                sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOOSE_EWT_A));
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = 0;
+            }
+            else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
+            {
+                sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOOSE_EWT_H));
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = 0;
+            }
+
+            uint32 artkit = 21;
+
+            switch(m_State)
+            {
+            case OBJECTIVESTATE_ALLIANCE:
+                if(m_ShiftPhase == m_ShiftMaxPhase)
+                    m_TowerState = EP_TS_A;
+                else
+                    m_TowerState = EP_TS_A_P;
+                artkit = 2;
+                SummonSupportUnitAtNorthpassTower(ALLIANCE);
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = ALLIANCE;
+                if(m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_A));
+                break;
+            case OBJECTIVESTATE_HORDE:
+                if(m_ShiftPhase == -m_ShiftMaxPhase)
+                    m_TowerState = EP_TS_H;
+                else
+                    m_TowerState = EP_TS_H_P;
+                artkit = 1;
+                SummonSupportUnitAtNorthpassTower(HORDE);
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = HORDE;
+                if(m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_H));
+                break;
+            case OBJECTIVESTATE_NEUTRAL:
+                m_TowerState = EP_TS_N;
+                break;
+            case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
+            case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
+                m_TowerState = EP_TS_N_A;
+                break;
+            case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
+            case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
+                m_TowerState = EP_TS_N_H;
+                break;
+            }
+
+            GameObject* flag = HashMapHolder<GameObject>::Find(m_CapturePoint);
+            GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_EWT_FLAGS]);
+            if(flag)
+            {
+                flag->SetGoArtKit(artkit);
+                flag->SendUpdateObjectToAllExcept(NULL);
+            }
+            if(flag2)
+            {
+                flag2->SetGoArtKit(artkit);
+                flag2->SendUpdateObjectToAllExcept(NULL);
+            }
+
+
+            UpdateTowerState();
+
+            // complete quest objective
+            if(m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
+                SendObjectiveComplete(EP_EWT_CM, 0);
+        }
+
+        if(m_ShiftPhase != m_OldPhase)
+        {
+            // send this too, sometimes the slider disappears, dunno why :(
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
+            // send these updates to only the ones in this objective
+            uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
+            // send this too, sometimes it resets :S
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_NeutralValue);
+        }
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_EWT::FillInitialWorldStates(WorldPacket &data)
+{
+    data << EP_EWT_A << uint32(bool(m_TowerState & EP_TS_A));
+    data << EP_EWT_H << uint32(bool(m_TowerState & EP_TS_H));
+    data << EP_EWT_A_P << uint32(bool(m_TowerState & EP_TS_A_P));
+    data << EP_EWT_H_P << uint32(bool(m_TowerState & EP_TS_H_P));
+    data << EP_EWT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
+    data << EP_EWT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
+    data << EP_EWT_N << uint32(bool(m_TowerState & EP_TS_N));
+}
+
+void OutdoorPvPObjectiveEP_EWT::UpdateTowerState()
+{
+    m_PvP->SendUpdateWorldState(EP_EWT_A , bool(m_TowerState & EP_TS_A));
+    m_PvP->SendUpdateWorldState(EP_EWT_H , bool(m_TowerState & EP_TS_H));
+    m_PvP->SendUpdateWorldState(EP_EWT_A_P , bool(m_TowerState & EP_TS_A_P));
+    m_PvP->SendUpdateWorldState(EP_EWT_H_P , bool(m_TowerState & EP_TS_H_P));
+    m_PvP->SendUpdateWorldState(EP_EWT_N_A , bool(m_TowerState & EP_TS_N_A));
+    m_PvP->SendUpdateWorldState(EP_EWT_N_H , bool(m_TowerState & EP_TS_N_H));
+    m_PvP->SendUpdateWorldState(EP_EWT_N , bool(m_TowerState & EP_TS_N));
+}
+
+bool OutdoorPvPObjectiveEP_EWT::HandlePlayerEnter(Player *plr)
+{
+    if(OutdoorPvPObjective::HandlePlayerEnter(plr))
+    {
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
+        uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_NeutralValue);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_EWT::HandlePlayerLeave(Player *plr)
+{
+    plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
+    OutdoorPvPObjective::HandlePlayerLeave(plr);
+}
+
+bool OutdoorPvPObjectiveEP_EWT::HandleCapturePointEvent(Player *plr, uint32 eventId)
+{
+    if(eventId == EPTowerPlayerEnterEvents[EP_EWT])
+    {
+        this->HandlePlayerEnter(plr);
+        return true;
+    }
+    else if (eventId == EPTowerPlayerLeaveEvents[EP_EWT])
+    {
+        this->HandlePlayerLeave(plr);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_EWT::SummonSupportUnitAtNorthpassTower(uint32 team)
+{
+    if(m_UnitsSummonedSide != team)
+    {
+        m_UnitsSummonedSide = team;
+        const creature_type * ct = NULL;
+        if(team == ALLIANCE)
+            ct=EP_EWT_Summons_A;
+        else
+            ct=EP_EWT_Summons_H;
+
+        for(int i = 0; i < EP_EWT_NUM_CREATURES; ++i)
+        {
+            DelCreature(i);
+            AddCreature(i,ct[i].entry,ct[i].teamval,ct[i].map,ct[i].x,ct[i].y,ct[i].z,ct[i].o,1000000);
+        }
+    }
+}
+
+// NPT
+OutdoorPvPObjectiveEP_NPT::OutdoorPvPObjectiveEP_NPT(OutdoorPvP *pvp)
+: OutdoorPvPObjective(pvp), m_TowerState(EP_TS_N), m_SummonedGOSide(0)
+{
+    AddCapturePoint(EPCapturePoints[EP_NPT].entry,EPCapturePoints[EP_NPT].map,EPCapturePoints[EP_NPT].x,EPCapturePoints[EP_NPT].y,EPCapturePoints[EP_NPT].z,EPCapturePoints[EP_NPT].o,EPCapturePoints[EP_NPT].rot0,EPCapturePoints[EP_NPT].rot1,EPCapturePoints[EP_NPT].rot2,EPCapturePoints[EP_NPT].rot3);
+    AddObject(EP_NPT_FLAGS,EPTowerFlags[EP_NPT].entry,EPTowerFlags[EP_NPT].map,EPTowerFlags[EP_NPT].x,EPTowerFlags[EP_NPT].y,EPTowerFlags[EP_NPT].z,EPTowerFlags[EP_NPT].o,EPTowerFlags[EP_NPT].rot0,EPTowerFlags[EP_NPT].rot1,EPTowerFlags[EP_NPT].rot2,EPTowerFlags[EP_NPT].rot3);
+}
+
+bool OutdoorPvPObjectiveEP_NPT::Update(uint32 diff)
+{
+    if(OutdoorPvPObjective::Update(diff))
+    {
+        if(m_OldState != m_State || fabs(m_ShiftPhase) == m_ShiftMaxPhase)  // state won't change, only phase when maxed out!
+        {
+            // if changing from controlling alliance to horde or vice versa
+            if( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
+            {
+                sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOOSE_NPT_A));
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = 0;
+            }
+            else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
+            {
+                sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOOSE_NPT_H));
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = 0;
+            }
+
+            uint32 artkit = 21;
+
+            switch(m_State)
+            {
+            case OBJECTIVESTATE_ALLIANCE:
+                if(m_ShiftPhase == m_ShiftMaxPhase)
+                    m_TowerState = EP_TS_A;
+                else
+                    m_TowerState = EP_TS_A_P;
+                artkit = 2;
+                SummonGO(ALLIANCE);
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = ALLIANCE;
+                if(m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_A));
+                break;
+            case OBJECTIVESTATE_HORDE:
+                if(m_ShiftPhase == -m_ShiftMaxPhase)
+                    m_TowerState = EP_TS_H;
+                else
+                    m_TowerState = EP_TS_H_P;
+                artkit = 1;
+                SummonGO(HORDE);
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = HORDE;
+                if(m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_H));
+                break;
+            case OBJECTIVESTATE_NEUTRAL:
+                m_TowerState = EP_TS_N;
+                m_SummonedGOSide = 0;
+                DelObject(EP_NPT_BUFF);
+                break;
+            case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
+            case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
+                m_TowerState = EP_TS_N_A;
+                break;
+            case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
+            case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
+                m_TowerState = EP_TS_N_H;
+                break;
+            }
+
+            GameObject* flag = HashMapHolder<GameObject>::Find(m_CapturePoint);
+            GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_NPT_FLAGS]);
+            if(flag)
+            {
+                flag->SetGoArtKit(artkit);
+                flag->SendUpdateObjectToAllExcept(NULL);
+            }
+            if(flag2)
+            {
+                flag2->SetGoArtKit(artkit);
+                flag2->SendUpdateObjectToAllExcept(NULL);
+            }
+
+            UpdateTowerState();
+
+            // complete quest objective
+            if(m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
+                SendObjectiveComplete(EP_NPT_CM, 0);
+        }
+
+        if(m_ShiftPhase != m_OldPhase)
+        {
+            // send this too, sometimes the slider disappears, dunno why :(
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
+            // send these updates to only the ones in this objective
+            uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
+            // send this too, sometimes it resets :S
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_NeutralValue);
+        }
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_NPT::FillInitialWorldStates(WorldPacket &data)
+{
+    data << EP_NPT_A << uint32(bool(m_TowerState & EP_TS_A));
+    data << EP_NPT_H << uint32(bool(m_TowerState & EP_TS_H));
+    data << EP_NPT_A_P << uint32(bool(m_TowerState & EP_TS_A_P));
+    data << EP_NPT_H_P << uint32(bool(m_TowerState & EP_TS_H_P));
+    data << EP_NPT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
+    data << EP_NPT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
+    data << EP_NPT_N << uint32(bool(m_TowerState & EP_TS_N));
+}
+
+void OutdoorPvPObjectiveEP_NPT::UpdateTowerState()
+{
+    m_PvP->SendUpdateWorldState(EP_NPT_A , bool(m_TowerState & EP_TS_A));
+    m_PvP->SendUpdateWorldState(EP_NPT_H , bool(m_TowerState & EP_TS_H));
+    m_PvP->SendUpdateWorldState(EP_NPT_A_P , bool(m_TowerState & EP_TS_A_P));
+    m_PvP->SendUpdateWorldState(EP_NPT_H_P , bool(m_TowerState & EP_TS_H_P));
+    m_PvP->SendUpdateWorldState(EP_NPT_N_A , bool(m_TowerState & EP_TS_N_A));
+    m_PvP->SendUpdateWorldState(EP_NPT_N_H , bool(m_TowerState & EP_TS_N_H));
+    m_PvP->SendUpdateWorldState(EP_NPT_N , bool(m_TowerState & EP_TS_N));
+}
+
+bool OutdoorPvPObjectiveEP_NPT::HandlePlayerEnter(Player *plr)
+{
+    if(OutdoorPvPObjective::HandlePlayerEnter(plr))
+    {
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
+        uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_NeutralValue);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_NPT::HandlePlayerLeave(Player *plr)
+{
+    plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
+    OutdoorPvPObjective::HandlePlayerLeave(plr);
+}
+
+bool OutdoorPvPObjectiveEP_NPT::HandleCapturePointEvent(Player *plr, uint32 eventId)
+{
+    if(eventId == EPTowerPlayerEnterEvents[EP_NPT])
+    {
+        this->HandlePlayerEnter(plr);
+        return true;
+    }
+    else if (eventId == EPTowerPlayerLeaveEvents[EP_NPT])
+    {
+        this->HandlePlayerLeave(plr);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_NPT::SummonGO(uint32 team)
+{
+    if(m_SummonedGOSide != team)
+    {
+        m_SummonedGOSide = team;
+        DelObject(EP_NPT_BUFF);
+        AddObject(EP_NPT_BUFF,EP_NPT_LordaeronShrine.entry,EP_NPT_LordaeronShrine.map,EP_NPT_LordaeronShrine.x,EP_NPT_LordaeronShrine.y,EP_NPT_LordaeronShrine.z,EP_NPT_LordaeronShrine.o,EP_NPT_LordaeronShrine.rot0,EP_NPT_LordaeronShrine.rot1,EP_NPT_LordaeronShrine.rot2,EP_NPT_LordaeronShrine.rot3);
+        GameObject * go = HashMapHolder<GameObject>::Find(m_Objects[EP_NPT_BUFF]);
+        if(go)
+            go->SetUInt32Value(GAMEOBJECT_FACTION,(team == ALLIANCE ? 84 : 83));
+    }
+}
+
+// CGT
+OutdoorPvPObjectiveEP_CGT::OutdoorPvPObjectiveEP_CGT(OutdoorPvP *pvp)
+: OutdoorPvPObjective(pvp), m_TowerState(EP_TS_N), m_GraveyardSide(0)
+{
+    AddCapturePoint(EPCapturePoints[EP_CGT].entry,EPCapturePoints[EP_CGT].map,EPCapturePoints[EP_CGT].x,EPCapturePoints[EP_CGT].y,EPCapturePoints[EP_CGT].z,EPCapturePoints[EP_CGT].o,EPCapturePoints[EP_CGT].rot0,EPCapturePoints[EP_CGT].rot1,EPCapturePoints[EP_CGT].rot2,EPCapturePoints[EP_CGT].rot3);
+    AddObject(EP_CGT_FLAGS,EPTowerFlags[EP_CGT].entry,EPTowerFlags[EP_CGT].map,EPTowerFlags[EP_CGT].x,EPTowerFlags[EP_CGT].y,EPTowerFlags[EP_CGT].z,EPTowerFlags[EP_CGT].o,EPTowerFlags[EP_CGT].rot0,EPTowerFlags[EP_CGT].rot1,EPTowerFlags[EP_CGT].rot2,EPTowerFlags[EP_CGT].rot3);
+}
+
+bool OutdoorPvPObjectiveEP_CGT::Update(uint32 diff)
+{
+    if(OutdoorPvPObjective::Update(diff))
+    {
+        if(m_OldState != m_State || fabs(m_ShiftPhase) == m_ShiftMaxPhase)  // state won't change, only phase when maxed out!
+        {
+            // if changing from controlling alliance to horde or vice versa
+            if( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
+            {
+                sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOOSE_CGT_A));
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = 0;
+            }
+            else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
+            {
+                sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOOSE_CGT_H));
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = 0;
+            }
+
+            uint32 artkit = 21;
+
+            switch(m_State)
+            {
+            case OBJECTIVESTATE_ALLIANCE:
+                if(m_ShiftPhase == m_ShiftMaxPhase)
+                    m_TowerState = EP_TS_A;
+                else
+                    m_TowerState = EP_TS_A_P;
+                artkit = 2;
+                LinkGraveYard(ALLIANCE);
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = ALLIANCE;
+                if(m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A));
+                break;
+            case OBJECTIVESTATE_HORDE:
+                if(m_ShiftPhase == -m_ShiftMaxPhase)
+                    m_TowerState = EP_TS_H;
+                else
+                    m_TowerState = EP_TS_H_P;
+                artkit = 1;
+                LinkGraveYard(HORDE);
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = HORDE;
+                if(m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H));
+                break;
+            case OBJECTIVESTATE_NEUTRAL:
+                m_TowerState = EP_TS_N;
+                break;
+            case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
+            case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
+                m_TowerState = EP_TS_N_A;
+                break;
+            case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
+            case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
+                m_TowerState = EP_TS_N_H;
+                break;
+            }
+
+            GameObject* flag = HashMapHolder<GameObject>::Find(m_CapturePoint);
+            GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_CGT_FLAGS]);
+            if(flag)
+            {
+                flag->SetGoArtKit(artkit);
+                flag->SendUpdateObjectToAllExcept(NULL);
+            }
+            if(flag2)
+            {
+                flag2->SetGoArtKit(artkit);
+                flag2->SendUpdateObjectToAllExcept(NULL);
+            }
+
+            UpdateTowerState();
+
+            // complete quest objective
+            if(m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
+                SendObjectiveComplete(EP_CGT_CM, 0);
+        }
+
+        if(m_ShiftPhase != m_OldPhase)
+        {
+            // send this too, sometimes the slider disappears, dunno why :(
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
+            // send these updates to only the ones in this objective
+            uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
+            // send this too, sometimes it resets :S
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_NeutralValue);
+        }
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_CGT::FillInitialWorldStates(WorldPacket &data)
+{
+    data << EP_CGT_A << uint32(bool(m_TowerState & EP_TS_A));
+    data << EP_CGT_H << uint32(bool(m_TowerState & EP_TS_H));
+    data << EP_CGT_A_P << uint32(bool(m_TowerState & EP_TS_A_P));
+    data << EP_CGT_H_P << uint32(bool(m_TowerState & EP_TS_H_P));
+    data << EP_CGT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
+    data << EP_CGT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
+    data << EP_CGT_N << uint32(bool(m_TowerState & EP_TS_N));
+}
+
+void OutdoorPvPObjectiveEP_CGT::UpdateTowerState()
+{
+    m_PvP->SendUpdateWorldState(EP_CGT_A , bool(m_TowerState & EP_TS_A));
+    m_PvP->SendUpdateWorldState(EP_CGT_H , bool(m_TowerState & EP_TS_H));
+    m_PvP->SendUpdateWorldState(EP_CGT_A_P , bool(m_TowerState & EP_TS_A_P));
+    m_PvP->SendUpdateWorldState(EP_CGT_H_P , bool(m_TowerState & EP_TS_H_P));
+    m_PvP->SendUpdateWorldState(EP_CGT_N_A , bool(m_TowerState & EP_TS_N_A));
+    m_PvP->SendUpdateWorldState(EP_CGT_N_H , bool(m_TowerState & EP_TS_N_H));
+    m_PvP->SendUpdateWorldState(EP_CGT_N , bool(m_TowerState & EP_TS_N));
+}
+
+bool OutdoorPvPObjectiveEP_CGT::HandlePlayerEnter(Player *plr)
+{
+    if(OutdoorPvPObjective::HandlePlayerEnter(plr))
+    {
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
+        uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_NeutralValue);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_CGT::HandlePlayerLeave(Player *plr)
+{
+    plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
+    OutdoorPvPObjective::HandlePlayerLeave(plr);
+}
+
+bool OutdoorPvPObjectiveEP_CGT::HandleCapturePointEvent(Player *plr, uint32 eventId)
+{
+    if(eventId == EPTowerPlayerEnterEvents[EP_CGT])
+    {
+        this->HandlePlayerEnter(plr);
+        return true;
+    }
+    else if (eventId == EPTowerPlayerLeaveEvents[EP_CGT])
+    {
+        this->HandlePlayerLeave(plr);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_CGT::LinkGraveYard(uint32 team)
+{
+    if(m_GraveyardSide != team)
+    {
+        m_GraveyardSide = team;
+        objmgr.RemoveGraveYardLink(EP_GraveYardId,EP_GraveYardZone,team,false);
+        objmgr.AddGraveYardLink(EP_GraveYardId,EP_GraveYardZone,team,false);
+    }
+}
+
+// PWT
+OutdoorPvPObjectiveEP_PWT::OutdoorPvPObjectiveEP_PWT(OutdoorPvP *pvp)
+: OutdoorPvPObjective(pvp), m_TowerState(EP_TS_N), m_FlightMasterSpawned(0)
+{
+    AddCapturePoint(EPCapturePoints[EP_PWT].entry,EPCapturePoints[EP_PWT].map,EPCapturePoints[EP_PWT].x,EPCapturePoints[EP_PWT].y,EPCapturePoints[EP_PWT].z,EPCapturePoints[EP_PWT].o,EPCapturePoints[EP_PWT].rot0,EPCapturePoints[EP_PWT].rot1,EPCapturePoints[EP_PWT].rot2,EPCapturePoints[EP_PWT].rot3);
+    AddObject(EP_PWT_FLAGS,EPTowerFlags[EP_PWT].entry,EPTowerFlags[EP_PWT].map,EPTowerFlags[EP_PWT].x,EPTowerFlags[EP_PWT].y,EPTowerFlags[EP_PWT].z,EPTowerFlags[EP_PWT].o,EPTowerFlags[EP_PWT].rot0,EPTowerFlags[EP_PWT].rot1,EPTowerFlags[EP_PWT].rot2,EPTowerFlags[EP_PWT].rot3);
+}
+
+bool OutdoorPvPObjectiveEP_PWT::Update(uint32 diff)
+{
+    if(OutdoorPvPObjective::Update(diff))
+    {
+        if(m_OldState != m_State || fabs(m_ShiftPhase) == m_ShiftMaxPhase)  // state won't change, only phase when maxed out!
+        {
+            // if changing from controlling alliance to horde or vice versa
+            if( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
+            {
+                sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOOSE_PWT_A));
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = 0;
+            }
+            else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
+            {
+                sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOOSE_PWT_H));
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = 0;
+            }
+
+            uint32 artkit = 21;
+
+            switch(m_State)
+            {
+            case OBJECTIVESTATE_ALLIANCE:
+                if(m_ShiftPhase == m_ShiftMaxPhase)
+                    m_TowerState = EP_TS_A;
+                else
+                    m_TowerState = EP_TS_A_P;
+                SummonFlightMaster(ALLIANCE);
+                artkit = 2;
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = ALLIANCE;
+                if(m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_A));
+                break;
+            case OBJECTIVESTATE_HORDE:
+                if(m_ShiftPhase == -m_ShiftMaxPhase)
+                    m_TowerState = EP_TS_H;
+                else
+                    m_TowerState = EP_TS_H_P;
+                SummonFlightMaster(HORDE);
+                artkit = 1;
+                ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = HORDE;
+                if(m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_H));
+                break;
+            case OBJECTIVESTATE_NEUTRAL:
+                m_TowerState = EP_TS_N;
+                DelCreature(EP_PWT_FLIGHTMASTER);
+                m_FlightMasterSpawned = 0;
+                break;
+            case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
+            case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
+                m_TowerState = EP_TS_N_A;
+                break;
+            case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
+            case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
+                m_TowerState = EP_TS_N_H;
+                break;
+            }
+
+            GameObject* flag = HashMapHolder<GameObject>::Find(m_CapturePoint);
+            GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_PWT_FLAGS]);
+            if(flag)
+            {
+                flag->SetGoArtKit(artkit);
+                flag->SendUpdateObjectToAllExcept(NULL);
+            }
+            if(flag2)
+            {
+                flag2->SetGoArtKit(artkit);
+                flag2->SendUpdateObjectToAllExcept(NULL);
+            }
+
+            UpdateTowerState();
+
+            // complete quest objective
+            if(m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
+                SendObjectiveComplete(EP_PWT_CM, 0);
+        }
+
+        if(m_ShiftPhase != m_OldPhase)
+        {
+            // send this too, sometimes the slider disappears, dunno why :(
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
+            // send these updates to only the ones in this objective
+            uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
+            // send this too, sometimes it resets :S
+            SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_NeutralValue);
+        }
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_PWT::FillInitialWorldStates(WorldPacket &data)
+{
+    data << EP_PWT_A << uint32(bool(m_TowerState & EP_TS_A));
+    data << EP_PWT_H << uint32(bool(m_TowerState & EP_TS_H));
+    data << EP_PWT_A_P << uint32(bool(m_TowerState & EP_TS_A_P));
+    data << EP_PWT_H_P << uint32(bool(m_TowerState & EP_TS_H_P));
+    data << EP_PWT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
+    data << EP_PWT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
+    data << EP_PWT_N << uint32(bool(m_TowerState & EP_TS_N));
+}
+
+void OutdoorPvPObjectiveEP_PWT::UpdateTowerState()
+{
+    m_PvP->SendUpdateWorldState(EP_PWT_A , bool(m_TowerState & EP_TS_A));
+    m_PvP->SendUpdateWorldState(EP_PWT_H , bool(m_TowerState & EP_TS_H));
+    m_PvP->SendUpdateWorldState(EP_PWT_A_P , bool(m_TowerState & EP_TS_A_P));
+    m_PvP->SendUpdateWorldState(EP_PWT_H_P , bool(m_TowerState & EP_TS_H_P));
+    m_PvP->SendUpdateWorldState(EP_PWT_N_A , bool(m_TowerState & EP_TS_N_A));
+    m_PvP->SendUpdateWorldState(EP_PWT_N_H , bool(m_TowerState & EP_TS_N_H));
+    m_PvP->SendUpdateWorldState(EP_PWT_N , bool(m_TowerState & EP_TS_N));
+}
+
+bool OutdoorPvPObjectiveEP_PWT::HandlePlayerEnter(Player *plr)
+{
+    if(OutdoorPvPObjective::HandlePlayerEnter(plr))
+    {
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
+        uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
+        plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_NeutralValue);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_PWT::HandlePlayerLeave(Player *plr)
+{
+    plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
+    OutdoorPvPObjective::HandlePlayerLeave(plr);
+}
+
+bool OutdoorPvPObjectiveEP_PWT::HandleCapturePointEvent(Player *plr, uint32 eventId)
+{
+    if(eventId == EPTowerPlayerEnterEvents[EP_PWT])
+    {
+        this->HandlePlayerEnter(plr);
+        return true;
+    }
+    else if (eventId == EPTowerPlayerLeaveEvents[EP_PWT])
+    {
+        this->HandlePlayerLeave(plr);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveEP_PWT::SummonFlightMaster(uint32 team)
+{
+    if(m_FlightMasterSpawned != team)
+    {
+        m_FlightMasterSpawned = team;
+        DelCreature(EP_PWT_FLIGHTMASTER);
+        AddCreature(EP_PWT_FLIGHTMASTER,EP_PWT_FlightMaster.entry,team,EP_PWT_FlightMaster.map,EP_PWT_FlightMaster.x,EP_PWT_FlightMaster.y,EP_PWT_FlightMaster.z,EP_PWT_FlightMaster.o);
+        Creature * c = HashMapHolder<Creature>::Find(m_Creatures[EP_PWT_FLIGHTMASTER]);
+        if(c)
+        {
+            GossipOption gso;
+            gso.Action = GOSSIP_OPTION_OUTDOORPVP;
+            gso.GossipId = 0;
+            gso.Option.assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_NPT));
+            gso.Id = 50;
+            gso.Icon = 0;
+            gso.NpcFlag = 0;
+            c->addGossipOption(gso);
+
+            gso.Action = GOSSIP_OPTION_OUTDOORPVP;
+            gso.GossipId = 0;
+            gso.Option.assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_EWT));
+            gso.Id = 50;
+            gso.Icon = 0;
+            gso.NpcFlag = 0;
+            c->addGossipOption(gso);
+
+            gso.Action = GOSSIP_OPTION_OUTDOORPVP;
+            gso.GossipId = 0;
+            gso.Option.assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_CGT));
+            gso.Id = 50;
+            gso.Icon = 0;
+            gso.NpcFlag = 0;
+            c->addGossipOption(gso);
+        }
+    }
+}
+
+bool OutdoorPvPObjectiveEP_PWT::CanTalkTo(Player * p, Creature * c, GossipOption &gso)
+{
+    if( p->GetTeam() == m_FlightMasterSpawned &&
+        c->GetGUID() == m_Creatures[EP_PWT_FLIGHTMASTER] &&
+        gso.Id == 50 )
+        return true;
+    return false;
+}
+
+bool OutdoorPvPObjectiveEP_PWT::HandleGossipOption(Player *plr, uint64 guid, uint32 gossipid)
+{
+    std::map<uint64,uint32>::iterator itr = m_CreatureTypes.find(guid);
+    if(itr != m_CreatureTypes.end())
+    {
+        Creature * cr = HashMapHolder<Creature>::Find(guid);
+        if(!cr)
+            return true;
+        if(itr->second == EP_PWT_FLIGHTMASTER)
+        {
+            uint32 src = EP_PWT_Taxi;
+            uint32 dst = 0;
+            switch(gossipid)
+            {
+            case 0:
+                dst = EP_NPT_Taxi;
+                break;
+            case 1:
+                dst = EP_EWT_Taxi;
+                break;
+            default:
+                dst = EP_CGT_Taxi;
+                break;
+            }
+
+            std::vector<uint32> nodes;
+            nodes.resize(2);
+            nodes[0] = src;
+            nodes[1] = dst;
+
+            plr->PlayerTalkClass->CloseGossip();
+            plr->ActivateTaxiPathTo(nodes, 0, cr);
+            // leave the opvp, seems like moveinlineofsight isn't called when entering a taxi
+            HandlePlayerLeave(plr);
+        }
+        return true;
+    }
+    return false;
+}
+
+// ep
+OutdoorPvPEP::OutdoorPvPEP()
+{
+    m_TypeId = OUTDOOR_PVP_EP;
+    memset(EP_Controls,0,sizeof(EP_Controls));
+    m_AllianceTowersControlled = 0;
+    m_HordeTowersControlled = 0;
+}
+
+bool OutdoorPvPEP::SetupOutdoorPvP()
+{
+    for(int i = 0; i < EPBuffZonesNum; ++i)
+        sOutdoorPvPMgr.AddZone(EPBuffZones[i],this);
+
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveEP_EWT(this));
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveEP_PWT(this));
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveEP_CGT(this));
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveEP_NPT(this));
+    return true;
+}
+
+bool OutdoorPvPEP::Update(uint32 diff)
+{
+    if(OutdoorPvP::Update(diff))
+    {
+        m_AllianceTowersControlled = 0;
+        m_HordeTowersControlled = 0;
+        for(int i = 0; i < EP_TOWER_NUM; ++i)
+        {
+            if(EP_Controls[i] == ALLIANCE)
+                ++m_AllianceTowersControlled;
+            else if(EP_Controls[i] == HORDE)
+                ++m_HordeTowersControlled;
+            SendUpdateWorldState(EP_UI_TOWER_COUNT_A,m_AllianceTowersControlled);
+            SendUpdateWorldState(EP_UI_TOWER_COUNT_H,m_HordeTowersControlled);
+            BuffTeams();
+        }
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPEP::HandlePlayerEnterZone(Player * plr, uint32 zone)
+{
+    // add buffs
+    if(plr->GetTeam() == ALLIANCE)
+    {
+        if(m_AllianceTowersControlled && m_AllianceTowersControlled < 5)
+            plr->CastSpell(plr,EP_AllianceBuffs[m_AllianceTowersControlled-1],true);
+    }
+    else
+    {
+        if(m_HordeTowersControlled && m_HordeTowersControlled < 5)
+            plr->CastSpell(plr,EP_HordeBuffs[m_HordeTowersControlled-1],true);
+    }
+    OutdoorPvP::HandlePlayerEnterZone(plr,zone);
+}
+
+void OutdoorPvPEP::HandlePlayerLeaveZone(Player * plr, uint32 zone)
+{
+    // remove buffs
+    if(plr->GetTeam() == ALLIANCE)
+    {
+        for(int i = 0; i < 4; ++i)
+            plr->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
+    }
+    else
+    {
+        for(int i = 0; i < 4; ++i)
+            plr->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
+    }
+    OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
+}
+
+void OutdoorPvPEP::BuffTeams()
+{
+    for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+    {
+        if(Player * plr = objmgr.GetPlayer(*itr))
+        {
+            for(int i = 0; i < 4; ++i)
+                plr->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
+            if(m_AllianceTowersControlled && m_AllianceTowersControlled < 5)
+                plr->CastSpell(plr,EP_AllianceBuffs[m_AllianceTowersControlled-1],true);
+        }
+    }
+    for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+    {
+        if(Player * plr = objmgr.GetPlayer(*itr))
+        {
+            for(int i = 0; i < 4; ++i)
+                plr->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
+            if(m_HordeTowersControlled && m_HordeTowersControlled < 5)
+                plr->CastSpell(plr,EP_HordeBuffs[m_HordeTowersControlled-1],true);
+        }
+    }
+}
+
+void OutdoorPvPEP::FillInitialWorldStates(WorldPacket & data)
+{
+    data << EP_UI_TOWER_COUNT_A << m_AllianceTowersControlled;
+    data << EP_UI_TOWER_COUNT_H << m_HordeTowersControlled;
+    data << EP_UI_TOWER_SLIDER_DISPLAY << uint32(0);
+    data << EP_UI_TOWER_SLIDER_POS << uint32(50);
+    data << EP_UI_TOWER_SLIDER_N << uint32(100);
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+    {
+        (*itr)->FillInitialWorldStates(data);
+    }
+}
+
+void OutdoorPvPEP::SendRemoveWorldStates(Player *plr)
+{
+    plr->SendUpdateWorldState(EP_UI_TOWER_COUNT_A,0);
+    plr->SendUpdateWorldState(EP_UI_TOWER_COUNT_H,0);
+    plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY,0);
+    plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS,0);
+    plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N,0);
+
+    plr->SendUpdateWorldState(EP_EWT_A,0);
+    plr->SendUpdateWorldState(EP_EWT_H,0);
+    plr->SendUpdateWorldState(EP_EWT_N,0);
+    plr->SendUpdateWorldState(EP_EWT_A_P,0);
+    plr->SendUpdateWorldState(EP_EWT_H_P,0);
+    plr->SendUpdateWorldState(EP_EWT_N_A,0);
+    plr->SendUpdateWorldState(EP_EWT_N_H,0);
+
+    plr->SendUpdateWorldState(EP_PWT_A,0);
+    plr->SendUpdateWorldState(EP_PWT_H,0);
+    plr->SendUpdateWorldState(EP_PWT_N,0);
+    plr->SendUpdateWorldState(EP_PWT_A_P,0);
+    plr->SendUpdateWorldState(EP_PWT_H_P,0);
+    plr->SendUpdateWorldState(EP_PWT_N_A,0);
+    plr->SendUpdateWorldState(EP_PWT_N_H,0);
+
+    plr->SendUpdateWorldState(EP_NPT_A,0);
+    plr->SendUpdateWorldState(EP_NPT_H,0);
+    plr->SendUpdateWorldState(EP_NPT_N,0);
+    plr->SendUpdateWorldState(EP_NPT_A_P,0);
+    plr->SendUpdateWorldState(EP_NPT_H_P,0);
+    plr->SendUpdateWorldState(EP_NPT_N_A,0);
+    plr->SendUpdateWorldState(EP_NPT_N_H,0);
+
+    plr->SendUpdateWorldState(EP_CGT_A,0);
+    plr->SendUpdateWorldState(EP_CGT_H,0);
+    plr->SendUpdateWorldState(EP_CGT_N,0);
+    plr->SendUpdateWorldState(EP_CGT_A_P,0);
+    plr->SendUpdateWorldState(EP_CGT_H_P,0);
+    plr->SendUpdateWorldState(EP_CGT_N_A,0);
+    plr->SendUpdateWorldState(EP_CGT_N_H,0);
+}
Index: trunk/src/game/CellImpl.h
===================================================================
--- trunk/src/game/CellImpl.h (revision 2)
+++ trunk/src/game/CellImpl.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_CELLIMPL_H
-#define MANGOS_CELLIMPL_H
+#ifndef TRINITY_CELLIMPL_H
+#define TRINITY_CELLIMPL_H
 
 #include "Cell.h"
Index: trunk/src/game/AggressorAI.cpp
===================================================================
--- trunk/src/game/AggressorAI.cpp (revision 37)
+++ trunk/src/game/AggressorAI.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/BattleGroundWS.h
===================================================================
--- trunk/src/game/BattleGroundWS.h (revision 2)
+++ trunk/src/game/BattleGroundWS.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/DynamicObject.cpp
===================================================================
--- trunk/src/game/DynamicObject.cpp (revision 2)
+++ trunk/src/game/DynamicObject.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -112,13 +114,13 @@
 
     // TODO: make a timer and update this in larger intervals
-    CellPair p(MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()));
+    CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
     Cell cell(p);
     cell.data.Part.reserved = ALL_DISTRICT;
     cell.SetNoCreate();
 
-    MaNGOS::DynamicObjectUpdater notifier(*this,caster);
+    Trinity::DynamicObjectUpdater notifier(*this,caster);
 
-    TypeContainerVisitor<MaNGOS::DynamicObjectUpdater, WorldTypeMapContainer > world_object_notifier(notifier);
-    TypeContainerVisitor<MaNGOS::DynamicObjectUpdater, GridTypeMapContainer > grid_object_notifier(notifier);
+    TypeContainerVisitor<Trinity::DynamicObjectUpdater, WorldTypeMapContainer > world_object_notifier(notifier);
+    TypeContainerVisitor<Trinity::DynamicObjectUpdater, GridTypeMapContainer > grid_object_notifier(notifier);
 
     CellLock<GridReadGuard> cell_lock(cell, p);
Index: trunk/src/game/GameEvent.cpp
===================================================================
--- trunk/src/game/GameEvent.cpp (revision 39)
+++ trunk/src/game/GameEvent.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -25,5 +27,6 @@
 #include "MapManager.h"
 #include "Policies/SingletonImp.h"
-#include "IRCClient.h"
+#include "GossipDef.h"
+#include "Player.h"
 
 INSTANTIATE_SINGLETON_1(GameEvent);
@@ -31,6 +34,25 @@
 bool GameEvent::CheckOneGameEvent(uint16 entry) const
 {
+    time_t currenttime = time(NULL);
+    // if the state is conditions or nextphase, then the event should be active
+    if (mGameEvent[entry].state == GAMEEVENT_WORLD_CONDITIONS || mGameEvent[entry].state == GAMEEVENT_WORLD_NEXTPHASE)
+        return true;
+    // finished world events are inactive
+    else if (mGameEvent[entry].state == GAMEEVENT_WORLD_FINISHED)
+        return false;
+    // if inactive world event, check the prerequisite events
+    else if (mGameEvent[entry].state == GAMEEVENT_WORLD_INACTIVE)
+    {
+        for(std::set<uint16>::const_iterator itr = mGameEvent[entry].prerequisite_events.begin(); itr != mGameEvent[entry].prerequisite_events.end(); ++itr)
+        {
+            if( (mGameEvent[*itr].state != GAMEEVENT_WORLD_NEXTPHASE && mGameEvent[*itr].state != GAMEEVENT_WORLD_FINISHED) ||   // if prereq not in nextphase or finished state, then can't start this one
+                mGameEvent[*itr].nextstart > currenttime)               // if not in nextphase state for long enough, can't start this one
+                return false;
+        }
+        // all prerequisite events are met
+        // but if there are no prerequisites, this can be only activated through gm command
+        return !(mGameEvent[entry].prerequisite_events.empty());
+    }
     // Get the event information
-    time_t currenttime = time(NULL);
     if( mGameEvent[entry].start < currenttime && currenttime < mGameEvent[entry].end &&
         ((currenttime - mGameEvent[entry].start) % (mGameEvent[entry].occurence * MINUTE)) < (mGameEvent[entry].length * MINUTE) )
@@ -43,4 +65,12 @@
 {
     time_t currenttime = time(NULL);
+
+    // for NEXTPHASE state world events, return the delay to start the next event, so the followup event will be checked correctly
+    if ((mGameEvent[entry].state == GAMEEVENT_WORLD_NEXTPHASE || mGameEvent[entry].state == GAMEEVENT_WORLD_FINISHED) && mGameEvent[entry].nextstart >= currenttime)
+        return (mGameEvent[entry].nextstart - currenttime);
+
+    // for CONDITIONS state world events, return the length of the wait period, so if the conditions are met, this check will be called again to set the timer as NEXTPHASE event
+    if (mGameEvent[entry].state == GAMEEVENT_WORLD_CONDITIONS)
+        return mGameEvent[entry].length ? mGameEvent[entry].length * 60 : max_ge_check_delay;
 
     // outdated event: we return max
@@ -66,13 +96,40 @@
 }
 
-void GameEvent::StartEvent( uint16 event_id, bool overwrite )
-{
-    AddActiveEvent(event_id);
-    ApplyNewEvent(event_id);
-    if(overwrite)
-    {
-        mGameEvent[event_id].start = time(NULL);
-        if(mGameEvent[event_id].end <= mGameEvent[event_id].start)
-            mGameEvent[event_id].end = mGameEvent[event_id].start+mGameEvent[event_id].length;
+bool GameEvent::StartEvent( uint16 event_id, bool overwrite )
+{
+    if(mGameEvent[event_id].state == GAMEEVENT_NORMAL)
+    {
+        AddActiveEvent(event_id);
+        ApplyNewEvent(event_id);
+        if(overwrite)
+        {
+            mGameEvent[event_id].start = time(NULL);
+            if(mGameEvent[event_id].end <= mGameEvent[event_id].start)
+                mGameEvent[event_id].end = mGameEvent[event_id].start+mGameEvent[event_id].length;
+        }
+        return false;
+    }
+    else
+    {
+        if( mGameEvent[event_id].state == GAMEEVENT_WORLD_INACTIVE )
+            // set to conditions phase
+            mGameEvent[event_id].state = GAMEEVENT_WORLD_CONDITIONS;
+
+        // add to active events
+        AddActiveEvent(event_id);
+        // add spawns
+        ApplyNewEvent(event_id);
+
+        // check if can go to next state
+        bool conditions_met = CheckOneGameEventConditions(event_id);
+        // save to db
+        SaveWorldEventStateToDB(event_id);
+        // force game event update to set the update timer if conditions were met from a command
+        // this update is needed to possibly start events dependent on the started one
+        // or to scedule another update where the next event will be started
+        if(overwrite && conditions_met)
+            sWorld.ForceGameEventUpdate();
+
+        return conditions_met;
     }
 }
@@ -80,7 +137,10 @@
 void GameEvent::StopEvent( uint16 event_id, bool overwrite )
 {
+    bool serverwide_evt = mGameEvent[event_id].state != GAMEEVENT_NORMAL;
+
     RemoveActiveEvent(event_id);
     UnApplyEvent(event_id);
-    if(overwrite)
+
+    if(overwrite && !serverwide_evt)
     {
         mGameEvent[event_id].start = time(NULL) - mGameEvent[event_id].length * MINUTE;
@@ -88,4 +148,21 @@
             mGameEvent[event_id].end = mGameEvent[event_id].start+mGameEvent[event_id].length;
     }
+    else if(serverwide_evt)
+    {
+        // if finished world event, then only gm command can stop it
+        if(overwrite || mGameEvent[event_id].state != GAMEEVENT_WORLD_FINISHED)
+        {
+            // reset conditions
+            mGameEvent[event_id].nextstart = 0;
+            mGameEvent[event_id].state = GAMEEVENT_WORLD_INACTIVE;
+            std::map<uint32 /*condition id*/, GameEventFinishCondition>::iterator itr;
+            for(itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr)
+                itr->second.done = 0;
+            CharacterDatabase.BeginTransaction();
+            CharacterDatabase.PExecute("DELETE FROM game_event_save WHERE event_id = '%u'",event_id);
+            CharacterDatabase.PExecute("DELETE FROM game_event_condition_save WHERE event_id = '%u'",event_id);
+            CharacterDatabase.CommitTransaction();
+        }
+    }
 }
 
@@ -109,5 +186,5 @@
     }
 
-    QueryResult *result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,description FROM game_event");
+    QueryResult *result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,description,world_event FROM game_event");
     if( !result )
     {
@@ -142,12 +219,13 @@
         pGameEvent.occurence    = fields[3].GetUInt32();
         pGameEvent.length       = fields[4].GetUInt32();
-
-        if(pGameEvent.length==0)                            // length>0 is validity check
-        {
-            sLog.outErrorDb("`game_event` game event id (%i) have length 0 and can't be used.",event_id);
+        pGameEvent.description  = fields[5].GetCppString();
+        pGameEvent.state        = (GameEventState)(fields[6].GetUInt8());
+        pGameEvent.nextstart    = 0;
+
+        if(pGameEvent.length==0 && pGameEvent.state == GAMEEVENT_NORMAL)                            // length>0 is validity check
+        {
+            sLog.outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.",event_id);
             continue;
         }
-
-        pGameEvent.description  = fields[5].GetCppString();
 
     } while( result->NextRow() );
@@ -156,4 +234,107 @@
     sLog.outString( ">> Loaded %u game events", count );
     delete result;
+
+    // load game event saves
+    //                                       0         1      2 
+    result = CharacterDatabase.Query("SELECT event_id, state, UNIX_TIMESTAMP(next_start) FROM game_event_save");
+
+    count = 0;
+    if( !result )
+    {
+        barGoLink bar2(1);
+        bar2.step();
+
+        sLog.outString();
+        sLog.outString(">> Loaded %u game event saves in game events", count );
+    }
+    else
+    {
+
+        barGoLink bar2( result->GetRowCount() );
+        do
+        {
+            Field *fields = result->Fetch();
+
+            bar2.step();
+
+            uint16 event_id = fields[0].GetUInt16();
+
+            if(event_id >= mGameEvent.size())
+            {
+                sLog.outErrorDb("`game_event_save` game event id (%i) is out of range compared to max event id in `game_event`",event_id);
+                continue;
+            }
+
+            if(mGameEvent[event_id].state != GAMEEVENT_NORMAL)
+            {
+                mGameEvent[event_id].state = (GameEventState)(fields[1].GetUInt8());
+                mGameEvent[event_id].nextstart    = time_t(fields[2].GetUInt64());
+            }
+            else
+            {
+                sLog.outErrorDb("game_event_save includes event save for non-worldevent id %u",event_id);
+                continue;
+            }
+
+            ++count;
+
+        } while( result->NextRow() );
+        sLog.outString();
+        sLog.outString( ">> Loaded %u game event saves in game events", count );
+        delete result;
+    }
+
+    // load game event links (prerequisites)
+    result = WorldDatabase.Query("SELECT event_id, prerequisite_event FROM game_event_prerequisite");
+    if( !result )
+    {
+        barGoLink bar2(1);
+        bar2.step();
+
+        sLog.outString();
+        sLog.outString(">> Loaded %u game event prerequisites in game events", count );
+    }
+    else
+    {
+
+        barGoLink bar2( result->GetRowCount() );
+        do
+        {
+            Field *fields = result->Fetch();
+
+            bar2.step();
+
+            uint16 event_id = fields[0].GetUInt16();
+
+            if(event_id >= mGameEvent.size())
+            {
+                sLog.outErrorDb("`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`",event_id);
+                continue;
+            }
+
+
+            if(mGameEvent[event_id].state != GAMEEVENT_NORMAL)
+            {
+                uint16 prerequisite_event = fields[1].GetUInt16();
+                if(prerequisite_event >= mGameEvent.size())
+                {
+                    sLog.outErrorDb("`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`",prerequisite_event);
+                    continue;
+                }
+                mGameEvent[event_id].prerequisite_events.insert(prerequisite_event);
+            }
+            else
+            {
+                sLog.outErrorDb("game_event_prerequisiste includes event entry for non-worldevent id %u",event_id);
+                continue;
+            }
+
+            ++count;
+
+        } while( result->NextRow() );
+        sLog.outString();
+        sLog.outString( ">> Loaded %u game event prerequisites in game events", count );
+        delete result;
+    }
 
     mGameEventCreatureGuids.resize(mGameEvent.size()*2-1);
@@ -308,5 +489,5 @@
     }
 
-    mGameEventQuests.resize(mGameEvent.size());
+    mGameEventCreatureQuests.resize(mGameEvent.size());
     //                                   0   1      2
     result = WorldDatabase.Query("SELECT id, quest, event FROM game_event_creature_quest");
@@ -334,5 +515,5 @@
             uint16 event_id = fields[2].GetUInt16();
 
-            if(event_id >= mGameEventQuests.size())
+            if(event_id >= mGameEventCreatureQuests.size())
             {
                 sLog.outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
@@ -341,5 +522,5 @@
 
             ++count;
-            QuestRelList& questlist = mGameEventQuests[event_id];
+            QuestRelList& questlist = mGameEventCreatureQuests[event_id];
             questlist.push_back(QuestRelation(id, quest));
 
@@ -350,4 +531,368 @@
         delete result;
     }
+
+    mGameEventGameObjectQuests.resize(mGameEvent.size());
+    //                                   0   1      2
+    result = WorldDatabase.Query("SELECT id, quest, event FROM game_event_gameobject_quest");
+
+    count = 0;
+    if( !result )
+    {
+        barGoLink bar3(1);
+        bar3.step();
+
+        sLog.outString();
+        sLog.outString(">> Loaded %u go quests additions in game events", count );
+    }
+    else
+    {
+
+        barGoLink bar3( result->GetRowCount() );
+        do
+        {
+            Field *fields = result->Fetch();
+
+            bar3.step();
+            uint32 id       = fields[0].GetUInt32();
+            uint32 quest    = fields[1].GetUInt32();
+            uint16 event_id = fields[2].GetUInt16();
+
+            if(event_id >= mGameEventGameObjectQuests.size())
+            {
+                sLog.outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
+                continue;
+            }
+
+            ++count;
+            QuestRelList& questlist = mGameEventGameObjectQuests[event_id];
+            questlist.push_back(QuestRelation(id, quest));
+
+        } while( result->NextRow() );
+        sLog.outString();
+        sLog.outString( ">> Loaded %u quests additions in game events", count );
+
+        delete result;
+    }
+
+    // Load quest to (event,condition) mapping
+    //                                   0      1         2             3
+    result = WorldDatabase.Query("SELECT quest, event_id, condition_id, num FROM game_event_quest_condition");
+
+    count = 0;
+    if( !result )
+    {
+        barGoLink bar3(1);
+        bar3.step();
+
+        sLog.outString();
+        sLog.outString(">> Loaded %u quest event conditions in game events", count );
+    }
+    else
+    {
+
+        barGoLink bar3( result->GetRowCount() );
+        do
+        {
+            Field *fields = result->Fetch();
+
+            bar3.step();
+            uint32 quest     = fields[0].GetUInt32();
+            uint16 event_id  = fields[1].GetUInt16();
+            uint32 condition = fields[2].GetUInt32();
+            float num       = fields[3].GetFloat();
+
+            if(event_id >= mGameEvent.size())
+            {
+                sLog.outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
+                continue;
+            }
+
+            ++count;
+            mQuestToEventConditions[quest].event_id = event_id;
+            mQuestToEventConditions[quest].condition = condition;
+            mQuestToEventConditions[quest].num = num;
+
+        } while( result->NextRow() );
+        sLog.outString();
+        sLog.outString( ">> Loaded %u quest event conditions in game events", count );
+
+        delete result;
+    }
+
+    // load conditions of the events
+    //                                   0         1             2        3                      4         
+    result = WorldDatabase.Query("SELECT event_id, condition_id, req_num, max_world_state_field, done_world_state_field FROM game_event_condition");
+
+    count = 0;
+    if( !result )
+    {
+        barGoLink bar3(1);
+        bar3.step();
+
+        sLog.outString();
+        sLog.outString(">> Loaded %u conditions in game events", count );
+    }
+    else
+    {
+
+        barGoLink bar3( result->GetRowCount() );
+        do
+        {
+            Field *fields = result->Fetch();
+
+            bar3.step();
+            uint16 event_id  = fields[0].GetUInt16();
+            uint32 condition = fields[1].GetUInt32();
+
+            if(event_id >= mGameEvent.size())
+            {
+                sLog.outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
+                continue;
+            }
+
+            mGameEvent[event_id].conditions[condition].reqNum = fields[2].GetFloat();
+            mGameEvent[event_id].conditions[condition].done = 0;
+            mGameEvent[event_id].conditions[condition].max_world_state = fields[3].GetUInt32();
+            mGameEvent[event_id].conditions[condition].done_world_state = fields[4].GetUInt32();
+
+            ++count;
+
+        } while( result->NextRow() );
+        sLog.outString();
+        sLog.outString( ">> Loaded %u conditions in game events", count );
+
+        delete result;
+    }
+
+    // load condition saves
+    //                                       0         1             2         
+    result = CharacterDatabase.Query("SELECT event_id, condition_id, done FROM game_event_condition_save");
+
+    count = 0;
+    if( !result )
+    {
+        barGoLink bar3(1);
+        bar3.step();
+
+        sLog.outString();
+        sLog.outString(">> Loaded %u condition saves in game events", count );
+    }
+    else
+    {
+
+        barGoLink bar3( result->GetRowCount() );
+        do
+        {
+            Field *fields = result->Fetch();
+
+            bar3.step();
+            uint16 event_id  = fields[0].GetUInt16();
+            uint32 condition = fields[1].GetUInt32();
+
+            if(event_id >= mGameEvent.size())
+            {
+                sLog.outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
+                continue;
+            }
+
+            std::map<uint32, GameEventFinishCondition>::iterator itr = mGameEvent[event_id].conditions.find(condition);
+            if(itr != mGameEvent[event_id].conditions.end())
+            {
+                itr->second.done = fields[2].GetFloat();
+            }
+            else
+            {
+                sLog.outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u",event_id, condition);
+                continue;
+            }
+
+            ++count;
+
+        } while( result->NextRow() );
+        sLog.outString();
+        sLog.outString( ">> Loaded %u condition saves in game events", count );
+
+        delete result;
+    }
+
+    mGameEventNPCFlags.resize(mGameEvent.size());
+    // load game event npcflag
+    //                                   0         1        2
+    result = WorldDatabase.Query("SELECT guid, event_id, npcflag FROM game_event_npcflag");
+
+    count = 0;
+    if( !result )
+    {
+        barGoLink bar3(1);
+        bar3.step();
+
+        sLog.outString();
+        sLog.outString(">> Loaded %u npcflags in game events", count );
+    }
+    else
+    {
+
+        barGoLink bar3( result->GetRowCount() );
+        do
+        {
+            Field *fields = result->Fetch();
+
+            bar3.step();
+            uint32 guid     = fields[0].GetUInt32();
+            uint16 event_id = fields[1].GetUInt16();
+            uint32 npcflag  = fields[2].GetUInt32();
+
+            if(event_id >= mGameEvent.size())
+            {
+                sLog.outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
+                continue;
+            }
+
+            mGameEventNPCFlags[event_id].push_back(GuidNPCFlagPair(guid,npcflag));
+
+            ++count;
+
+        } while( result->NextRow() );
+        sLog.outString();
+        sLog.outString( ">> Loaded %u npcflags in game events", count );
+
+        delete result;
+    }
+
+    mGameEventVendors.resize(mGameEvent.size());
+    //                                   0      1      2     3         4         5
+    result = WorldDatabase.Query("SELECT event, guid, item, maxcount, incrtime, ExtendedCost FROM game_event_npc_vendor");
+
+    count = 0;
+    if( !result )
+    {
+        barGoLink bar3(1);
+        bar3.step();
+
+        sLog.outString();
+        sLog.outString(">> Loaded %u vendor additions in game events", count );
+    }
+    else
+    {
+
+        barGoLink bar3( result->GetRowCount() );
+        do
+        {
+            Field *fields = result->Fetch();
+
+            bar3.step();
+            uint16 event_id  = fields[0].GetUInt16();
+
+            if(event_id >= mGameEventVendors.size())
+            {
+                sLog.outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
+                continue;
+            }
+
+            NPCVendorList& vendors = mGameEventVendors[event_id];
+            NPCVendorEntry newEntry;
+            uint32 guid = fields[1].GetUInt32();
+            newEntry.item = fields[2].GetUInt32();
+            newEntry.maxcount = fields[3].GetUInt32();
+            newEntry.incrtime = fields[4].GetUInt32();
+            newEntry.ExtendedCost = fields[5].GetUInt32();
+            // get the event npc flag for checking if the npc will be vendor during the event or not
+            uint32 event_npc_flag = 0;
+            NPCFlagList& flist = mGameEventNPCFlags[event_id];
+            for(NPCFlagList::const_iterator itr = flist.begin(); itr != flist.end(); ++itr)
+            {
+                if(itr->first == guid)
+                {
+                    event_npc_flag = itr->second;
+                    break;
+                }
+            }
+            // get creature entry
+            newEntry.entry = 0;
+
+            if( CreatureData const* data = objmgr.GetCreatureData(guid) )
+                newEntry.entry = data->id;
+
+            // check validity with event's npcflag
+            if(!objmgr.IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, NULL, NULL, event_npc_flag))
+                continue;
+            ++count;
+            vendors.push_back(newEntry);
+
+        } while( result->NextRow() );
+        sLog.outString();
+        sLog.outString( ">> Loaded %u vendor additions in game events", count );
+
+        delete result;
+    }
+
+    // load game event npc gossip ids
+    //                                   0         1        2
+    result = WorldDatabase.Query("SELECT guid, event_id, textid FROM game_event_npc_gossip");
+
+    count = 0;
+    if( !result )
+    {
+        barGoLink bar3(1);
+        bar3.step();
+
+        sLog.outString();
+        sLog.outString(">> Loaded %u npc gossip textids in game events", count );
+    }
+    else
+    {
+
+        barGoLink bar3( result->GetRowCount() );
+        do
+        {
+            Field *fields = result->Fetch();
+
+            bar3.step();
+            uint32 guid     = fields[0].GetUInt32();
+            uint16 event_id = fields[1].GetUInt16();
+            uint32 textid  = fields[2].GetUInt32();
+
+            if(event_id >= mGameEvent.size())
+            {
+                sLog.outErrorDb("`game_event_npc_gossip` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
+                continue;
+            }
+
+            mNPCGossipIds[guid]=EventNPCGossipIdPair(event_id, textid);
+
+            ++count;
+
+        } while( result->NextRow() );
+        sLog.outString();
+        sLog.outString( ">> Loaded %u npc gossip textids in game events", count );
+
+        delete result;
+    }
+}
+
+uint32 GameEvent::GetNPCFlag(Creature * cr)
+{
+    uint32 mask = 0;
+    uint32 guid = cr->GetDBTableGUIDLow();
+
+    for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
+    {
+        for(NPCFlagList::iterator itr = mGameEventNPCFlags[*e_itr].begin();
+            itr != mGameEventNPCFlags[*e_itr].end();
+            ++ itr)
+            if(itr->first == guid)
+                mask |= itr->second;
+    }
+
+    return mask;
+}
+
+uint32 GameEvent::GetNpcTextId(uint32 guid)
+{
+    GuidEventNpcGossipIdMap::iterator itr = mNPCGossipIds.find(guid);
+    if(itr != mNPCGossipIds.end())
+        if(IsActiveEvent(itr->second.first))
+            return itr->second.second;
+    return 0;
 }
 
@@ -363,14 +908,37 @@
 uint32 GameEvent::Update()                                  // return the next event delay in ms
 {
+    time_t currenttime = time(NULL);
     uint32 nextEventDelay = max_ge_check_delay;             // 1 day
     uint32 calcDelay;
+    std::set<uint16> activate, deactivate;
     for (uint16 itr = 1; itr < mGameEvent.size(); itr++)
     {
+        // must do the activating first, and after that the deactivating
+        // so first queue it
         //sLog.outErrorDb("Checking event %u",itr);
         if (CheckOneGameEvent(itr))
         {
+            // if the world event is in NEXTPHASE state, and the time has passed to finish this event, then do so
+            if (mGameEvent[itr].state == GAMEEVENT_WORLD_NEXTPHASE && mGameEvent[itr].nextstart <= currenttime)
+            {
+                // set this event to finished, null the nextstart time
+                mGameEvent[itr].state = GAMEEVENT_WORLD_FINISHED;
+                mGameEvent[itr].nextstart = 0;
+                // save the state of this gameevent
+                SaveWorldEventStateToDB(itr);
+                // queue for deactivation
+                if(IsActiveEvent(itr))
+                    deactivate.insert(itr);
+                // go to next event, this no longer needs an event update timer
+                continue;
+            }
+            else if (mGameEvent[itr].state == GAMEEVENT_WORLD_CONDITIONS && CheckOneGameEventConditions(itr))
+                // changed, save to DB the gameevent state, will be updated in next update cycle
+                SaveWorldEventStateToDB(itr);
+
             //sLog.outDebug("GameEvent %u is active",itr->first);
+            // queue for activation
             if (!IsActiveEvent(itr))
-                StartEvent(itr);
+                activate.insert(itr);
         }
         else
@@ -378,5 +946,5 @@
             //sLog.outDebug("GameEvent %u is not active",itr->first);
             if (IsActiveEvent(itr))
-                StopEvent(itr);
+                deactivate.insert(itr);
             else
             {
@@ -393,4 +961,15 @@
             nextEventDelay = calcDelay;
     }
+    // now activate the queue
+    // a now activated event can contain a spawn of a to-be-deactivated one
+    // following the activate - deactivate order, deactivating the first event later will leave the spawn in (wont disappear then reappear clientside)
+    for(std::set<uint16>::iterator itr = activate.begin(); itr != activate.end(); ++itr)
+        // start the event
+        // returns true the started event completed
+        // in that case, initiate next update in 1 second
+        if(StartEvent(*itr))
+            nextEventDelay = 0;
+    for(std::set<uint16>::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr)
+        StopEvent(*itr);
     sLog.outBasic("Next game event check in %u seconds.", nextEventDelay + 1);
     return (nextEventDelay + 1) * 1000;                     // Add 1 second to be sure event has started/stopped at next call
@@ -409,4 +988,8 @@
     // Remove quests that are events only to non event npc
     UpdateEventQuests(event_id, false);
+    // update npcflags in this event
+    UpdateEventNPCFlags(event_id);
+    // remove vendor items
+    UpdateEventNPCVendor(event_id, false);
 }
 
@@ -423,11 +1006,4 @@
 
     sLog.outString("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str());
-
-    if((sIRC.BOTMASK & 256) != 0)
-    {
-        std::string ircchan = "#";
-        ircchan += sIRC._irc_chan[sIRC.anchn].c_str();
-        sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 Game Event \00304,08\037/!\\\037\017 %s", "%s", mGameEvent[event_id].description.c_str()), true);
-    }
 
     // spawn positive event tagget objects
@@ -440,4 +1016,45 @@
     // Add quests that are events only to non event npc
     UpdateEventQuests(event_id, true);
+    // update npcflags in this event
+    UpdateEventNPCFlags(event_id);
+    // add vendor items
+    UpdateEventNPCVendor(event_id, true);
+}
+
+void GameEvent::UpdateEventNPCFlags(uint16 event_id)
+{
+    // go through the creatures whose npcflags are changed in the event
+    for(NPCFlagList::iterator itr = mGameEventNPCFlags[event_id].begin(); itr != mGameEventNPCFlags[event_id].end(); ++itr)
+    {
+        // get the creature data from the low guid to get the entry, to be able to find out the whole guid
+        if( CreatureData const* data = objmgr.GetCreatureData(itr->first) )
+        {
+            Creature * cr = HashMapHolder<Creature>::Find(MAKE_NEW_GUID(itr->first,data->id,HIGHGUID_UNIT));
+            // if we found the creature, modify its npcflag
+            if(cr)
+            {
+                uint32 npcflag = GetNPCFlag(cr);
+                if(const CreatureInfo * ci = cr->GetCreatureInfo())
+                    npcflag |= ci->npcflag;
+                cr->SetUInt32Value(UNIT_NPC_FLAGS,npcflag);
+                // reset gossip options, since the flag change might have added / removed some
+                cr->ResetGossipOptions();
+                // update to world
+                cr->SendUpdateObjectToAllExcept(NULL);
+            }
+            // if we didn't find it, then the npcflag will be updated when the creature is loaded
+        }
+    }
+}
+
+void GameEvent::UpdateEventNPCVendor(uint16 event_id, bool activate)
+{
+    for(NPCVendorList::iterator itr = mGameEventVendors[event_id].begin(); itr != mGameEventVendors[event_id].end(); ++itr)
+    {
+        if(activate)
+            objmgr.AddVendorItem(itr->entry, itr->item, itr->maxcount, itr->incrtime, itr->ExtendedCost, false);
+        else
+            objmgr.RemoveVendorItem(itr->entry, itr->item, false);
+    }
 }
 
@@ -526,4 +1143,7 @@
     for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();itr != mGameEventCreatureGuids[internal_event_id].end();++itr)
     {
+        // check if it's needed by another event, if so, don't remove
+        if( event_id > 0 && hasCreatureActiveEventExcept(*itr,event_id) )
+            continue;
         // Remove the creature from grid
         if( CreatureData const* data = objmgr.GetCreatureData(*itr) )
@@ -547,4 +1167,7 @@
     for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();itr != mGameEventGameobjectGuids[internal_event_id].end();++itr)
     {
+        // check if it's needed by another event, if so, don't remove
+        if( event_id >0 && hasGameObjectActiveEventExcept(*itr,event_id) )
+            continue;
         // Remove the gameobject from grid
         if(GameObjectData const* data = objmgr.GetGOData(*itr))
@@ -637,8 +1260,68 @@
 }
 
+bool GameEvent::hasCreatureQuestActiveEventExcept(uint32 quest_id, uint16 event_id)
+{
+    for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
+    {
+        if((*e_itr) != event_id)
+            for(QuestRelList::iterator itr = mGameEventCreatureQuests[*e_itr].begin();
+                itr != mGameEventCreatureQuests[*e_itr].end();
+                ++ itr)
+                if(itr->second == quest_id)
+                    return true;
+    }
+    return false;
+}
+
+bool GameEvent::hasGameObjectQuestActiveEventExcept(uint32 quest_id, uint16 event_id)
+{
+    for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
+    {
+        if((*e_itr) != event_id)
+            for(QuestRelList::iterator itr = mGameEventGameObjectQuests[*e_itr].begin();
+                itr != mGameEventGameObjectQuests[*e_itr].end();
+                ++ itr)
+                if(itr->second == quest_id)
+                    return true;
+    }
+    return false;
+}
+bool GameEvent::hasCreatureActiveEventExcept(uint32 creature_id, uint16 event_id)
+{
+    for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
+    {
+        if((*e_itr) != event_id)
+        {
+            int32 internal_event_id = mGameEvent.size() + (*e_itr) - 1;
+            for(GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();
+                itr != mGameEventCreatureGuids[internal_event_id].end();
+                ++ itr)
+                if(*itr == creature_id)
+                    return true;
+        }
+    }
+    return false;
+}
+bool GameEvent::hasGameObjectActiveEventExcept(uint32 go_id, uint16 event_id)
+{
+    for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
+    {
+        if((*e_itr) != event_id)
+        {
+            int32 internal_event_id = mGameEvent.size() + (*e_itr) - 1;
+            for(GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();
+                itr != mGameEventGameobjectGuids[internal_event_id].end();
+                ++ itr)
+                if(*itr == go_id)
+                    return true;
+        }
+    }
+    return false;
+}
+
 void GameEvent::UpdateEventQuests(uint16 event_id, bool Activate)
 {
     QuestRelList::iterator itr;
-    for (itr = mGameEventQuests[event_id].begin();itr != mGameEventQuests[event_id].end();++itr)
+    for (itr = mGameEventCreatureQuests[event_id].begin();itr != mGameEventCreatureQuests[event_id].end();++itr)
     {
         QuestRelations &CreatureQuestMap = objmgr.mCreatureQuestRelations;
@@ -646,20 +1329,48 @@
             CreatureQuestMap.insert(QuestRelations::value_type(itr->first, itr->second));
         else
-        {                                                   // Remove the pair(id,quest) from the multimap
-            QuestRelations::iterator qitr = CreatureQuestMap.find(itr->first);
-            if (qitr == CreatureQuestMap.end())
-                continue;
-            QuestRelations::iterator lastElement = CreatureQuestMap.upper_bound(itr->first);
-            for ( ;qitr != lastElement;++qitr)
-            {
-                if (qitr->second == itr->second)
+        {   
+            if(!hasCreatureQuestActiveEventExcept(itr->second,event_id))
+            {
+                // Remove the pair(id,quest) from the multimap
+                QuestRelations::iterator qitr = CreatureQuestMap.find(itr->first);
+                if (qitr == CreatureQuestMap.end())
+                    continue;
+                QuestRelations::iterator lastElement = CreatureQuestMap.upper_bound(itr->first);
+                for ( ;qitr != lastElement;++qitr)
                 {
-                    CreatureQuestMap.erase(qitr);           // iterator is now no more valid
-                    break;                                  // but we can exit loop since the element is found
+                    if (qitr->second == itr->second)
+                    {
+                        CreatureQuestMap.erase(qitr);           // iterator is now no more valid
+                        break;                                  // but we can exit loop since the element is found
+                    }
                 }
             }
         }
     }
-}
+    for (itr = mGameEventGameObjectQuests[event_id].begin();itr != mGameEventGameObjectQuests[event_id].end();++itr)
+    {
+        QuestRelations &GameObjectQuestMap = objmgr.mGOQuestRelations;
+        if (Activate)                                       // Add the pair(id,quest) to the multimap
+            GameObjectQuestMap.insert(QuestRelations::value_type(itr->first, itr->second));
+        else
+        {   
+            if(!hasGameObjectQuestActiveEventExcept(itr->second,event_id))
+            {
+                // Remove the pair(id,quest) from the multimap
+                QuestRelations::iterator qitr = GameObjectQuestMap.find(itr->first);
+                if (qitr == GameObjectQuestMap.end())
+                    continue;
+                QuestRelations::iterator lastElement = GameObjectQuestMap.upper_bound(itr->first);
+                for ( ;qitr != lastElement;++qitr)
+                {
+                    if (qitr->second == itr->second)
+                    {
+                        GameObjectQuestMap.erase(qitr);           // iterator is now no more valid
+                        break;                                  // but we can exit loop since the element is found
+                    }
+                }
+            }
+        }
+    }}
 
 GameEvent::GameEvent()
@@ -667,2 +1378,100 @@
     isSystemInit = false;
 }
+
+void GameEvent::HandleQuestComplete(uint32 quest_id)
+{
+    // translate the quest to event and condition
+    QuestIdToEventConditionMap::iterator itr = mQuestToEventConditions.find(quest_id);
+    // quest is registered
+    if(itr != mQuestToEventConditions.end())
+    {
+        uint16 event_id = itr->second.event_id;
+        uint32 condition = itr->second.condition;
+        float num = itr->second.num;
+
+        // the event is not active, so return, don't increase condition finishes
+        if(!IsActiveEvent(event_id))
+            return;
+        // not in correct phase, return
+        if(mGameEvent[event_id].state != GAMEEVENT_WORLD_CONDITIONS)
+            return;
+        std::map<uint32,GameEventFinishCondition>::iterator citr = mGameEvent[event_id].conditions.find(condition);
+        // condition is registered
+        if(citr != mGameEvent[event_id].conditions.end())
+        {
+            // increase the done count, only if less then the req
+            if(citr->second.done < citr->second.reqNum)
+            {
+                citr->second.done += num;
+                // check max limit
+                if(citr->second.done > citr->second.reqNum)
+                    citr->second.done = citr->second.reqNum;
+                // save the change to db
+                CharacterDatabase.BeginTransaction();
+                CharacterDatabase.PExecute("DELETE FROM game_event_condition_save WHERE event_id = '%u' AND condition_id = '%u'",event_id,condition);
+                CharacterDatabase.PExecute("INSERT INTO game_event_condition_save (event_id, condition_id, done) VALUES (%u,%u,%f)",event_id,condition,citr->second.done);
+                CharacterDatabase.CommitTransaction();
+                // check if all conditions are met, if so, update the event state
+                if(CheckOneGameEventConditions(event_id))
+                {
+                    // changed, save to DB the gameevent state
+                    SaveWorldEventStateToDB(event_id);
+                    // force update events to set timer
+                    sWorld.ForceGameEventUpdate();
+                }
+            }
+        }
+    }
+}
+
+bool GameEvent::CheckOneGameEventConditions(uint16 event_id)
+{
+    for(std::map<uint32,GameEventFinishCondition>::iterator itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr)
+        if(itr->second.done < itr->second.reqNum)
+            // return false if a condition doesn't match
+            return false;
+    // set the phase
+    mGameEvent[event_id].state = GAMEEVENT_WORLD_NEXTPHASE;
+    // set the followup events' start time
+    if(!mGameEvent[event_id].nextstart)
+    {
+        time_t currenttime = time(NULL);
+        mGameEvent[event_id].nextstart = currenttime + mGameEvent[event_id].length * 60;
+    }
+    return true;
+}
+
+void GameEvent::SaveWorldEventStateToDB(uint16 event_id)
+{
+    CharacterDatabase.BeginTransaction();
+    CharacterDatabase.PExecute("DELETE FROM game_event_save WHERE event_id = '%u'",event_id);
+    if(mGameEvent[event_id].nextstart)
+        CharacterDatabase.PExecute("INSERT INTO game_event_save (event_id, state, next_start) VALUES ('%u','%u',FROM_UNIXTIME('"I64FMTD"'))",event_id,mGameEvent[event_id].state,mGameEvent[event_id].nextstart);
+    else
+        CharacterDatabase.PExecute("INSERT INTO game_event_save (event_id, state, next_start) VALUES ('%u','%u','0000-00-00 00:00:00')",event_id,mGameEvent[event_id].state);
+    CharacterDatabase.CommitTransaction();
+}
+
+void GameEvent::HandleWorldEventGossip(Player *plr, Creature *c)
+{
+    // this function is used to send world state update before sending gossip menu
+    // find the npc's gossip id (if set) in an active game event
+    // if present, send the event's world states
+    GuidEventNpcGossipIdMap::iterator itr = mNPCGossipIds.find(c->GetDBTableGUIDLow());
+    if(itr != mNPCGossipIds.end())
+        if(IsActiveEvent(itr->second.first))
+            // send world state updates to the player about the progress
+            SendWorldStateUpdate(plr, itr->second.first);
+}
+
+void GameEvent::SendWorldStateUpdate(Player * plr, uint16 event_id)
+{
+    std::map<uint32,GameEventFinishCondition>::iterator itr;
+    for(itr = mGameEvent[event_id].conditions.begin(); itr !=mGameEvent[event_id].conditions.end(); ++itr)
+    {
+        if(itr->second.done_world_state)
+            plr->SendUpdateWorldState(itr->second.done_world_state, itr->second.done);
+        if(itr->second.max_world_state)
+            plr->SendUpdateWorldState(itr->second.max_world_state, itr->second.reqNum);
+    }
+}
Index: trunk/src/game/Channel.h
===================================================================
--- trunk/src/game/Channel.h (revision 2)
+++ trunk/src/game/Channel.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/FollowerReference.h
===================================================================
--- trunk/src/game/FollowerReference.h (revision 2)
+++ trunk/src/game/FollowerReference.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -25,5 +27,5 @@
 class Unit;
 
-class MANGOS_DLL_SPEC FollowerReference : public Reference<Unit, TargetedMovementGeneratorBase>
+class TRINITY_DLL_SPEC FollowerReference : public Reference<Unit, TargetedMovementGeneratorBase>
 {
     protected:
Index: trunk/src/game/GridNotifiers.h
===================================================================
--- trunk/src/game/GridNotifiers.h (revision 37)
+++ trunk/src/game/GridNotifiers.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_GRIDNOTIFIERS_H
-#define MANGOS_GRIDNOTIFIERS_H
+#ifndef TRINITY_GRIDNOTIFIERS_H
+#define TRINITY_GRIDNOTIFIERS_H
 
 #include "ObjectGridLoader.h"
@@ -35,8 +37,8 @@
 //class Map;
 
-namespace MaNGOS
+namespace Trinity
 {
 
-    struct MANGOS_DLL_DECL PlayerNotifier
+    struct TRINITY_DLL_DECL PlayerNotifier
     {
         explicit PlayerNotifier(Player &pl) : i_player(pl) {}
@@ -46,5 +48,5 @@
     };
 
-    struct MANGOS_DLL_DECL VisibleNotifier
+    struct TRINITY_DLL_DECL VisibleNotifier
     {
         Player &i_player;
@@ -60,5 +62,5 @@
     };
 
-    struct MANGOS_DLL_DECL VisibleChangesNotifier
+    struct TRINITY_DLL_DECL VisibleChangesNotifier
     {
         WorldObject &i_object;
@@ -69,5 +71,5 @@
     };
 
-    struct MANGOS_DLL_DECL GridUpdater
+    struct TRINITY_DLL_DECL GridUpdater
     {
         GridType &i_grid;
@@ -88,5 +90,5 @@
     };
 
-    struct MANGOS_DLL_DECL MessageDeliverer
+    struct TRINITY_DLL_DECL MessageDeliverer
     {
         Player &i_player;
@@ -98,5 +100,5 @@
     };
 
-    struct MANGOS_DLL_DECL ObjectMessageDeliverer
+    struct TRINITY_DLL_DECL ObjectMessageDeliverer
     {
         WorldPacket *i_message;
@@ -106,5 +108,5 @@
     };
 
-    struct MANGOS_DLL_DECL MessageDistDeliverer
+    struct TRINITY_DLL_DECL MessageDistDeliverer
     {
         Player &i_player;
@@ -118,5 +120,5 @@
     };
 
-    struct MANGOS_DLL_DECL ObjectMessageDistDeliverer
+    struct TRINITY_DLL_DECL ObjectMessageDistDeliverer
     {
         WorldObject &i_object;
@@ -128,5 +130,5 @@
     };
 
-    struct MANGOS_DLL_DECL ObjectUpdater
+    struct TRINITY_DLL_DECL ObjectUpdater
     {
         uint32 i_timeDiff;
@@ -139,5 +141,5 @@
 
     template<class T>
-        struct MANGOS_DLL_DECL ObjectAccessorNotifier
+        struct TRINITY_DLL_DECL ObjectAccessorNotifier
     {
         T *& i_object;
@@ -165,5 +167,5 @@
     };
 
-    struct MANGOS_DLL_DECL PlayerRelocationNotifier
+    struct TRINITY_DLL_DECL PlayerRelocationNotifier
     {
         Player &i_player;
@@ -174,5 +176,5 @@
     };
 
-    struct MANGOS_DLL_DECL CreatureRelocationNotifier
+    struct TRINITY_DLL_DECL CreatureRelocationNotifier
     {
         Creature &i_creature;
@@ -184,5 +186,5 @@
     };
 
-    struct MANGOS_DLL_DECL DynamicObjectUpdater
+    struct TRINITY_DLL_DECL DynamicObjectUpdater
     {
         DynamicObject &i_dynobject;
@@ -210,5 +212,5 @@
 
     template<class Check>
-        struct MANGOS_DLL_DECL WorldObjectSearcher
+        struct TRINITY_DLL_DECL WorldObjectSearcher
     {
         WorldObject* &i_object;
@@ -227,5 +229,5 @@
 
     template<class Check>
-        struct MANGOS_DLL_DECL WorldObjectListSearcher
+        struct TRINITY_DLL_DECL WorldObjectListSearcher
     {
         std::list<WorldObject*> &i_objects;
@@ -244,5 +246,5 @@
 
     template<class Do>
-        struct MANGOS_DLL_DECL WorldObjectWorker
+        struct TRINITY_DLL_DECL WorldObjectWorker
     {
         Do const& i_do;
@@ -285,5 +287,5 @@
 
     template<class Check>
-        struct MANGOS_DLL_DECL GameObjectSearcher
+        struct TRINITY_DLL_DECL GameObjectSearcher
     {
         GameObject* &i_object;
@@ -299,5 +301,5 @@
     // Last accepted by Check GO if any (Check can change requirements at each call)
     template<class Check>
-        struct MANGOS_DLL_DECL GameObjectLastSearcher
+        struct TRINITY_DLL_DECL GameObjectLastSearcher
     {
         GameObject* &i_object;
@@ -312,5 +314,5 @@
 
     template<class Check>
-        struct MANGOS_DLL_DECL GameObjectListSearcher
+        struct TRINITY_DLL_DECL GameObjectListSearcher
     {
         std::list<GameObject*> &i_objects;
@@ -328,5 +330,5 @@
     // First accepted by Check Unit if any
     template<class Check>
-        struct MANGOS_DLL_DECL UnitSearcher
+        struct TRINITY_DLL_DECL UnitSearcher
     {
         Unit* &i_object;
@@ -343,5 +345,5 @@
     // Last accepted by Check Unit if any (Check can change requirements at each call)
     template<class Check>
-        struct MANGOS_DLL_DECL UnitLastSearcher
+        struct TRINITY_DLL_DECL UnitLastSearcher
     {
         Unit* &i_object;
@@ -358,5 +360,5 @@
     // All accepted by Check units if any
     template<class Check>
-        struct MANGOS_DLL_DECL UnitListSearcher
+        struct TRINITY_DLL_DECL UnitListSearcher
     {
         std::list<Unit*> &i_objects;
@@ -374,5 +376,5 @@
 
     template<class Check>
-        struct MANGOS_DLL_DECL CreatureSearcher
+        struct TRINITY_DLL_DECL CreatureSearcher
     {
         Creature* &i_object;
@@ -388,5 +390,5 @@
     // Last accepted by Check Creature if any (Check can change requirements at each call)
     template<class Check>
-        struct MANGOS_DLL_DECL CreatureLastSearcher
+        struct TRINITY_DLL_DECL CreatureLastSearcher
     {
         Creature* &i_object;
@@ -401,5 +403,5 @@
 
     template<class Check>
-        struct MANGOS_DLL_DECL CreatureListSearcher
+        struct TRINITY_DLL_DECL CreatureListSearcher
     {
         std::list<Creature*> &i_objects;
@@ -416,5 +418,5 @@
 
     template<class Check>
-    struct MANGOS_DLL_DECL PlayerSearcher
+    struct TRINITY_DLL_DECL PlayerSearcher
     {
         Player* &i_object;
@@ -429,5 +431,5 @@
 
     template<class Do>
-    struct MANGOS_DLL_DECL PlayerWorker
+    struct TRINITY_DLL_DECL PlayerWorker
     {
         Do& i_do;
Index: trunk/src/game/ReactorAI.h
===================================================================
--- trunk/src/game/ReactorAI.h (revision 2)
+++ trunk/src/game/ReactorAI.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_REACTORAI_H
-#define MANGOS_REACTORAI_H
+#ifndef TRINITY_REACTORAI_H
+#define TRINITY_REACTORAI_H
 
 #include "CreatureAI.h"
@@ -24,5 +26,5 @@
 class Unit;
 
-class MANGOS_DLL_DECL ReactorAI : public CreatureAI
+class TRINITY_DLL_DECL ReactorAI : public CreatureAI
 {
     public:
Index: trunk/src/game/BattleGroundNA.h
===================================================================
--- trunk/src/game/BattleGroundNA.h (revision 9)
+++ trunk/src/game/BattleGroundNA.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 #ifndef __BATTLEGROUNDNA_H
Index: trunk/src/game/GridStates.h
===================================================================
--- trunk/src/game/GridStates.h (revision 2)
+++ trunk/src/game/GridStates.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,21 +11,21 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_GRIDSTATES_H
-#define MANGOS_GRIDSTATES_H
+#ifndef TRINITY_GRIDSTATES_H
+#define TRINITY_GRIDSTATES_H
 
 #include "Map.h"
 
-class MANGOS_DLL_DECL GridState
+class TRINITY_DLL_DECL GridState
 {
     public:
-#ifdef MANGOS_DEBUG
+#ifdef TRINITY_DEBUG
 #define MAGIC_TESTVAL 0xFBE823BA
         GridState() { i_Magic = MAGIC_TESTVAL; }
@@ -43,5 +45,5 @@
 };
 
-class MANGOS_DLL_DECL InvalidState : public GridState
+class TRINITY_DLL_DECL InvalidState : public GridState
 {
     public:
@@ -50,5 +52,5 @@
 };
 
-class MANGOS_DLL_DECL ActiveState : public GridState
+class TRINITY_DLL_DECL ActiveState : public GridState
 {
     public:
@@ -57,5 +59,5 @@
 };
 
-class MANGOS_DLL_DECL IdleState : public GridState
+class TRINITY_DLL_DECL IdleState : public GridState
 {
     public:
@@ -64,5 +66,5 @@
 };
 
-class MANGOS_DLL_DECL RemovalState : public GridState
+class TRINITY_DLL_DECL RemovalState : public GridState
 {
     public:
Index: trunk/src/game/HomeMovementGenerator.h
===================================================================
--- trunk/src/game/HomeMovementGenerator.h (revision 2)
+++ trunk/src/game/HomeMovementGenerator.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_HOMEMOVEMENTGENERATOR_H
-#define MANGOS_HOMEMOVEMENTGENERATOR_H
+#ifndef TRINITY_HOMEMOVEMENTGENERATOR_H
+#define TRINITY_HOMEMOVEMENTGENERATOR_H
 
 #include "MovementGenerator.h"
@@ -27,8 +29,8 @@
 
 template < class T >
-class MANGOS_DLL_SPEC HomeMovementGenerator;
+class TRINITY_DLL_SPEC HomeMovementGenerator;
 
 template <>
-class MANGOS_DLL_SPEC HomeMovementGenerator<Creature>
+class TRINITY_DLL_SPEC HomeMovementGenerator<Creature>
 : public MovementGeneratorMedium< Creature, HomeMovementGenerator<Creature> >
 {
Index: trunk/src/game/StatSystem.cpp
===================================================================
--- trunk/src/game/StatSystem.cpp (revision 37)
+++ trunk/src/game/StatSystem.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/QuestDef.cpp
===================================================================
--- trunk/src/game/QuestDef.cpp (revision 37)
+++ trunk/src/game/QuestDef.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/TargetedMovementGenerator.cpp
===================================================================
--- trunk/src/game/TargetedMovementGenerator.cpp (revision 37)
+++ trunk/src/game/TargetedMovementGenerator.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/MotionMaster.cpp
===================================================================
--- trunk/src/game/MotionMaster.cpp (revision 37)
+++ trunk/src/game/MotionMaster.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/BattleGroundAV.cpp
===================================================================
--- trunk/src/game/BattleGroundAV.cpp (revision 2)
+++ trunk/src/game/BattleGroundAV.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Unit.h
===================================================================
--- trunk/src/game/Unit.h (revision 37)
+++ trunk/src/game/Unit.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -512,4 +514,5 @@
     UNIT_NPC_FLAG_UNK3                  = 0x01000000,       // cause client to send 1015 opcode
     UNIT_NPC_FLAG_GUARD                 = 0x10000000,       // custom flag for guards
+    UNIT_NPC_FLAG_OUTDOORPVP            = 0x20000000,       // custom flag for outdoor pvp creatures
 };
 
@@ -684,5 +687,5 @@
 #define ATTACK_DISPLAY_DELAY 200
 
-class MANGOS_DLL_SPEC Unit : public WorldObject
+class TRINITY_DLL_SPEC Unit : public WorldObject
 {
     public:
Index: trunk/src/game/CreatureAISelector.cpp
===================================================================
--- trunk/src/game/CreatureAISelector.cpp (revision 37)
+++ trunk/src/game/CreatureAISelector.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/BattleGroundEY.cpp
===================================================================
--- trunk/src/game/BattleGroundEY.cpp (revision 34)
+++ trunk/src/game/BattleGroundEY.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -75,5 +77,5 @@
         {
             m_Events |= 0x04;
-            SendMessageToAll(GetMangosString(LANG_BG_EY_ONE_MINUTE));
+            SendMessageToAll(GetTrinityString(LANG_BG_EY_ONE_MINUTE));
         }
         // After 1,5 minute, warning is signalled
@@ -81,5 +83,5 @@
         {
             m_Events |= 0x08;
-            SendMessageToAll(GetMangosString(LANG_BG_EY_HALF_MINUTE));
+            SendMessageToAll(GetTrinityString(LANG_BG_EY_HALF_MINUTE));
         }
         // After 2 minutes, gates OPEN ! x)
@@ -99,13 +101,9 @@
             }
 
-            SendMessageToAll(GetMangosString(LANG_BG_EY_BEGIN));
-
+            SendMessageToAll(GetTrinityString(LANG_BG_EY_BEGIN));
+
+            PlaySoundToAll(SOUND_BG_START);
             if(sWorld.getConfig(CONFIG_BG_START_MUSIC))
-            {
-                PlaySoundToAll(SOUND_BG_START);
                 PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC
-            }
-            else
-                PlaySoundToAll(SOUND_BG_START);
             SetStatus(STATUS_IN_PROGRESS);
 
@@ -556,5 +554,5 @@
     if(send_message)
     {
-        SendMessageToAll(GetMangosString(LANG_BG_EY_RESETED_FLAG));
+        SendMessageToAll(GetTrinityString(LANG_BG_EY_RESETED_FLAG));
         PlaySoundToAll(BG_EY_SOUND_FLAG_RESET);             // flags respawned sound...
     }
@@ -616,10 +614,10 @@
     if(Source->GetTeam() == ALLIANCE)
     {
-        message = GetMangosString(LANG_BG_EY_DROPPED_FLAG);
+        message = GetTrinityString(LANG_BG_EY_DROPPED_FLAG);
         type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
     }
     else
     {
-        message = GetMangosString(LANG_BG_EY_DROPPED_FLAG);
+        message = GetTrinityString(LANG_BG_EY_DROPPED_FLAG);
         type = CHAT_MSG_BG_SYSTEM_HORDE;
     }
@@ -640,5 +638,5 @@
     const char *message;
     uint8 type = 0;
-    message = GetMangosString(LANG_BG_EY_HAS_TAKEN_FLAG);
+    message = GetTrinityString(LANG_BG_EY_HAS_TAKEN_FLAG);
 
     if(Source->GetTeam() == ALLIANCE)
@@ -687,5 +685,5 @@
         m_TeamPointsCount[BG_TEAM_ALLIANCE]--;
         message_type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
-        message = GetMangosString(m_LoosingPointTypes[Point].MessageIdAlliance);
+        message = GetTrinityString(m_LoosingPointTypes[Point].MessageIdAlliance);
         SpawnBGObject(m_LoosingPointTypes[Point].DespawnObjectTypeAlliance, RESPAWN_ONE_DAY);
         SpawnBGObject(m_LoosingPointTypes[Point].DespawnObjectTypeAlliance + 1, RESPAWN_ONE_DAY);
@@ -696,5 +694,5 @@
         m_TeamPointsCount[BG_TEAM_HORDE]--;
         message_type = CHAT_MSG_BG_SYSTEM_HORDE;
-        message = GetMangosString(m_LoosingPointTypes[Point].MessageIdHorde);
+        message = GetTrinityString(m_LoosingPointTypes[Point].MessageIdHorde);
         SpawnBGObject(m_LoosingPointTypes[Point].DespawnObjectTypeHorde, RESPAWN_ONE_DAY);
         SpawnBGObject(m_LoosingPointTypes[Point].DespawnObjectTypeHorde + 1, RESPAWN_ONE_DAY);
@@ -736,5 +734,5 @@
         m_TeamPointsCount[BG_TEAM_ALLIANCE]++;
         type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
-        message = GetMangosString(m_CapturingPointTypes[Point].MessageIdAlliance);
+        message = GetTrinityString(m_CapturingPointTypes[Point].MessageIdAlliance);
         SpawnBGObject(m_CapturingPointTypes[Point].SpawnObjectTypeAlliance, RESPAWN_IMMEDIATELY);
         SpawnBGObject(m_CapturingPointTypes[Point].SpawnObjectTypeAlliance + 1, RESPAWN_IMMEDIATELY);
@@ -745,5 +743,5 @@
         m_TeamPointsCount[BG_TEAM_HORDE]++;
         type = CHAT_MSG_BG_SYSTEM_HORDE;
-        message = GetMangosString(m_CapturingPointTypes[Point].MessageIdHorde);
+        message = GetTrinityString(m_CapturingPointTypes[Point].MessageIdHorde);
         SpawnBGObject(m_CapturingPointTypes[Point].SpawnObjectTypeHorde, RESPAWN_IMMEDIATELY);
         SpawnBGObject(m_CapturingPointTypes[Point].SpawnObjectTypeHorde + 1, RESPAWN_IMMEDIATELY);
@@ -790,5 +788,5 @@
         PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE);
         team_id = BG_TEAM_ALLIANCE;
-        message = GetMangosString(LANG_BG_EY_CAPTURED_FLAG_A);
+        message = GetTrinityString(LANG_BG_EY_CAPTURED_FLAG_A);
         type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
     }
@@ -797,5 +795,5 @@
         PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_HORDE);
         team_id = BG_TEAM_HORDE;
-        message = GetMangosString(LANG_BG_EY_CAPTURED_FLAG_H);
+        message = GetTrinityString(LANG_BG_EY_CAPTURED_FLAG_H);
         type = CHAT_MSG_BG_SYSTEM_HORDE;
     }
Index: trunk/src/game/Makefile.am
===================================================================
--- trunk/src/game/Makefile.am (revision 39)
+++ trunk/src/game/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
@@ -142,19 +142,4 @@
 $(srcdir)/InstanceSaveMgr.cpp \
 $(srcdir)/InstanceSaveMgr.h \
-$(srcdir)/IRCClient.cpp \
-$(srcdir)/IRCClient.h \
-$(srcdir)/IRCCmd.cpp \
-$(srcdir)/IRCCmd.h \
-$(srcdir)/IRCCmde.cpp \
-$(srcdir)/IRCConf.cpp \
-$(srcdir)/IRCConf.h \
-$(srcdir)/IRCConf.h \
-$(srcdir)/IRCFunc.h \
-$(srcdir)/IRCIO.cpp \
-$(srcdir)/IRCLog.cpp \
-$(srcdir)/IRCLog.h \
-$(srcdir)/IRCSock.cpp \
-$(srcdir)/MCS_OnlinePlayers.cpp \
-$(srcdir)/MCS_OnlinePlayers.h \
 $(srcdir)/Item.cpp \
 $(srcdir)/Item.h \
@@ -202,4 +187,22 @@
 $(srcdir)/Opcodes.cpp \
 $(srcdir)/Opcodes.h \
+$(srcdir)/OutdoorPvP.cpp \
+$(srcdir)/OutdoorPvP.h \
+$(srcdir)/OutdoorPvPEP.cpp \
+$(srcdir)/OutdoorPvPEP.h \
+$(srcdir)/OutdoorPvPHP.cpp \
+$(srcdir)/OutdoorPvPHP.h \
+$(srcdir)/OutdoorPvPMgr.cpp \
+$(srcdir)/OutdoorPvPMgr.h \
+$(srcdir)/OutdoorPvPNA.cpp \
+$(srcdir)/OutdoorPvPNA.h \
+$(srcdir)/OutdoorPvPObjectiveAI.cpp \
+$(srcdir)/OutdoorPvPObjectiveAI.h \
+$(srcdir)/OutdoorPvPSI.cpp \
+$(srcdir)/OutdoorPvPSI.h \
+$(srcdir)/OutdoorPvPTF.cpp \
+$(srcdir)/OutdoorPvPTF.h \
+$(srcdir)/OutdoorPvPZM.cpp \
+$(srcdir)/OutdoorPvPZM.h \
 $(srcdir)/Path.h \
 $(srcdir)/PetAI.cpp \
Index: trunk/src/game/MiscHandler.cpp
===================================================================
--- trunk/src/game/MiscHandler.cpp (revision 39)
+++ trunk/src/game/MiscHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -38,4 +40,5 @@
 #include "Object.h"
 #include "BattleGround.h"
+#include "OutdoorPvP.h"
 #include "SpellAuras.h"
 #include "Pet.h"
@@ -143,5 +146,5 @@
     wstrToLower(wguild_name);
 
-    // client send in case not set max level value 100 but mangos support 255 max level,
+    // client send in case not set max level value 100 but Trinity support 255 max level,
     // update it to show GMs with characters after 100 level
     if(level_max >= 100)
@@ -297,5 +300,5 @@
     }
 
-    //instant logout in taverns/cities or on taxi or if its enabled in mangosd.conf
+    //instant logout in taverns/cities or on taxi or if its enabled in Trinityd.conf
     if(GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() || sWorld.getConfig(CONFIG_INSTANT_LOGOUT))
     {
@@ -563,4 +566,9 @@
             GetPlayer()->pvpInfo.endTimer = time(NULL);     // start toggle-off
     }
+
+    if(OutdoorPvP * pvp = _player->GetOutdoorPvP())
+    {
+        pvp->HandlePlayerActivityChanged(_player);
+    }
 }
 
@@ -574,15 +582,7 @@
     sLog.outDetail("WORLD: Recvd ZONE_UPDATE: %u", newZone);
 
-    if(newZone != _player->GetZoneId())
-        GetPlayer()->SendInitWorldStates();                 // only if really enters to new zone, not just area change, works strange...
-
-	// AntiCheat.GMIsland
-	if(sWorld.getConfig(CONFIG_KICK_FROM_GMISLAND))
-	{
-		if(newZone == 876 && GetPlayer()->GetSession()->GetSecurity() == SEC_PLAYER)
-			_player->TeleportTo(13,0,0,0,0);
-	}
-
     GetPlayer()->UpdateZone(newZone);
+
+    GetPlayer()->SendInitWorldStates(true,newZone);
 }
 
@@ -649,5 +649,5 @@
     sLog.outDebug( "WORLD: Received CMSG_ADD_FRIEND" );
 
-    std::string friendName  = GetMangosString(LANG_FRIEND_IGNORE_UNKNOWN);
+    std::string friendName  = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN);
     std::string friendNote;
     FriendsResult friendResult = FRIEND_NOT_FOUND;
@@ -741,5 +741,5 @@
     sLog.outDebug( "WORLD: Received CMSG_ADD_IGNORE" );
 
-    std::string IgnoreName = GetMangosString(LANG_FRIEND_IGNORE_UNKNOWN);
+    std::string IgnoreName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN);
     FriendsResult ignoreResult = FRIEND_IGNORE_NOT_FOUND;
     uint64 IgnoreGuid = 0;
@@ -1021,4 +1021,10 @@
     }
 
+    if(OutdoorPvP * pvp = GetPlayer()->GetOutdoorPvP())
+    {
+        if(pvp->HandleAreaTrigger(_player, Trigger_ID))
+            return;
+    }
+
     // NULL if all values default (non teleport trigger)
     AreaTrigger const* at = objmgr.GetAreaTrigger(Trigger_ID);
@@ -1064,5 +1070,5 @@
             // TODO: all this is probably wrong
             if(missingItem)
-                SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, objmgr.GetItemPrototype(missingItem)->Name1);
+                SendAreaTriggerMessage(GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, objmgr.GetItemPrototype(missingItem)->Name1);
             else if(missingKey)
                 GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY2);
@@ -1070,5 +1076,5 @@
                 SendAreaTriggerMessage(at->requiredFailedText.c_str());
             else if(missingLevel)
-                SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED), missingLevel);
+                SendAreaTriggerMessage(GetTrinityString(LANG_LEVEL_MINREQUIRED), missingLevel);
             return;
         }
@@ -1151,5 +1157,5 @@
 
         /// TODO
-        must be need use in mangos
+        must be need use in Trinity
         We substract server Lags to move time ( AntiLags )
         for exmaple
Index: trunk/src/game/BattleGround.cpp
===================================================================
--- trunk/src/game/BattleGround.cpp (revision 9)
+++ trunk/src/game/BattleGround.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -433,7 +435,7 @@
     {
         if(isBattleGround())
-            winmsg = GetMangosString(LANG_BG_A_WINS);
+            winmsg = GetTrinityString(LANG_BG_A_WINS);
         else
-            winmsg = GetMangosString(LANG_ARENA_GOLD_WINS);
+            winmsg = GetTrinityString(LANG_ARENA_GOLD_WINS);
 
         PlaySoundToAll(SOUND_ALLIANCE_WINS);                // alliance wins sound
@@ -444,7 +446,7 @@
     {
         if(isBattleGround())
-            winmsg = GetMangosString(LANG_BG_H_WINS);
+            winmsg = GetTrinityString(LANG_BG_H_WINS);
         else
-            winmsg = GetMangosString(LANG_ARENA_GREEN_WINS);
+            winmsg = GetTrinityString(LANG_ARENA_GREEN_WINS);
 
         PlaySoundToAll(SOUND_HORDE_WINS);                   // horde wins sound
@@ -679,5 +681,5 @@
 
         // text
-        std::string textFormat = plr->GetSession()->GetMangosString(LANG_BG_MARK_BY_MAIL);
+        std::string textFormat = plr->GetSession()->GetTrinityString(LANG_BG_MARK_BY_MAIL);
         char textBuf[300];
         snprintf(textBuf,300,textFormat.c_str(),GetName(),GetName());
@@ -1350,5 +1352,5 @@
 void BattleGround::SendMessageToAll(int32 entry)
 {
-    char const* text = GetMangosString(entry);
+    char const* text = GetTrinityString(entry);
     WorldPacket data;
     ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, text, NULL);
@@ -1366,8 +1368,8 @@
 
 // Battleground messages are localized using the dbc lang, they are not client language dependent
-const char *BattleGround::GetMangosString(int32 entry)
+const char *BattleGround::GetTrinityString(int32 entry)
 {
     // FIXME: now we have different DBC locales and need localized message for each target client
-    return objmgr.GetMangosStringForDBCLocale(entry);
+    return objmgr.GetTrinityStringForDBCLocale(entry);
 }
 
Index: trunk/src/game/GroupHandler.cpp
===================================================================
--- trunk/src/game/GroupHandler.cpp (revision 2)
+++ trunk/src/game/GroupHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/World.h
===================================================================
--- trunk/src/game/World.h (revision 39)
+++ trunk/src/game/World.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -61,6 +63,4 @@
     WUPDATE_EVENTS      = 6,
     WUPDATE_COUNT       = 7,
-
-    WUPDATE_AUTOANC = 7
 
 };
@@ -159,24 +159,22 @@
     CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE,
 
-	CONFIG_PLAYER_START_HONOR,
-	CONFIG_PLAYER_START_ARENAPTS,
-	CONFIG_GM_START_LEVEL,
-	CONFIG_INSTANT_LOGOUT,
-	CONFIG_BG_START_MUSIC,
-	CONFIG_START_ALL_SPELLS,
-	CONFIG_QUEUE_FOR_GM,
-	CONFIG_HONOR_AFTER_DUEL,
-	CONFIG_KICK_FROM_GMISLAND,
-	CONFIG_START_ALL_EXPLORED,
-	CONFIG_DISABLE_BREATHING,
-	CONFIG_DISABLE_RES_SICKNESS,
-	CONFIG_START_ALL_REP,
-	CONFIG_ALWAYS_MAXSKILL,
-	CONFIG_START_ALL_TAXI,
-	CONFIG_PVP_TOKEN_ENABLE,
-	CONFIG_PVP_TOKEN_MAP_TYPE,
-	CONFIG_PVP_TOKEN_ID,
-	CONFIG_PVP_TOKEN_COUNT,
-	CONFIG_NO_RESET_TALENT_COST,
+    CONFIG_PLAYER_START_GOLD,
+    CONFIG_PLAYER_START_HONOR,
+    CONFIG_PLAYER_START_ARENAPTS,
+    CONFIG_GM_START_LEVEL,
+    CONFIG_INSTANT_LOGOUT,
+    CONFIG_BG_START_MUSIC,
+    CONFIG_START_ALL_SPELLS,
+    CONFIG_HONOR_AFTER_DUEL,
+    CONFIG_START_ALL_EXPLORED,
+    CONFIG_DISABLE_BREATHING,
+    CONFIG_START_ALL_REP,
+    CONFIG_ALWAYS_MAXSKILL,
+    CONFIG_START_ALL_TAXI,
+    CONFIG_PVP_TOKEN_ENABLE,
+    CONFIG_PVP_TOKEN_MAP_TYPE,
+    CONFIG_PVP_TOKEN_ID,
+    CONFIG_PVP_TOKEN_COUNT,
+    CONFIG_NO_RESET_TALENT_COST,
 
     CONFIG_THREAT_RADIUS,
@@ -371,6 +369,4 @@
         void AddSession(WorldSession *s);
 
-        void SendRNDBroadcast();
-
         bool RemoveSession(uint32 id);
         /// Get the number of current active sessions
@@ -487,5 +483,5 @@
         bool IsScriptScheduled() const { return !m_scriptSchedule.empty(); }
 
-	static float PlayerStartGold() { return m_PlayerStartGold; }
+        bool IsAllowedMap(uint32 mapid) { return m_forbiddenMapIds.count(mapid) == 0 ;}
 
         // for max speed access
@@ -502,4 +498,6 @@
         void UpdateResultQueue();
         void InitResultQueue();
+
+        void ForceGameEventUpdate();
 
         void UpdateRealmCharCount(uint32 accid);
@@ -540,9 +538,8 @@
         std::string m_motd;
         std::string m_dataPath;
+        std::set<uint32> m_forbiddenMapIds;
 
         uint32 m_ShutdownTimer;
         uint32 m_ShutdownMask;
-
-	static float m_PlayerStartGold;
 
         // for max speed access
@@ -571,5 +568,5 @@
 extern uint32 realmID;
 
-#define sWorld MaNGOS::Singleton<World>::Instance()
+#define sWorld Trinity::Singleton<World>::Instance()
 #endif
 /// @}
Index: trunk/src/game/debugcmds.cpp
===================================================================
--- trunk/src/game/debugcmds.cpp (revision 12)
+++ trunk/src/game/debugcmds.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -520,2 +522,45 @@
     return true;
 }
+
+bool ChatHandler::HandleDebugThreatList(const char * /*args*/)
+{
+    Creature* target = getSelectedCreature();
+    if(!target || target->isTotem() || target->isPet())
+        return false;
+
+    std::list<HostilReference*>& tlist = target->getThreatManager().getThreatList();
+    std::list<HostilReference*>::iterator itr;
+    uint32 cnt = 0;
+    PSendSysMessage("Threat list of %s (guid %u)",target->GetName(), target->GetGUIDLow());
+    for(itr = tlist.begin(); itr != tlist.end(); ++itr)
+    {
+        Unit* unit = (*itr)->getTarget();
+        if(!unit)
+            continue;
+        ++cnt;
+        PSendSysMessage("   %u.   %s   (guid %u)  - threat %f",cnt,unit->GetName(), unit->GetGUIDLow(), (*itr)->getThreat());
+    }
+    SendSysMessage("End of threat list.");
+    return true;
+}
+
+bool ChatHandler::HandleDebugHostilRefList(const char * /*args*/)
+{
+    Unit* target = getSelectedUnit();
+    if(!target)
+        target = m_session->GetPlayer();
+    HostilReference* ref = target->getHostilRefManager().getFirst();
+    uint32 cnt = 0;
+    PSendSysMessage("Hostil reference list of %s (guid %u)",target->GetName(), target->GetGUIDLow());
+    while(ref)
+    {
+        if(Unit * unit = ref->getSource()->getOwner())
+        {
+            ++cnt;
+            PSendSysMessage("   %u.   %s   (guid %u)  - threat %f",cnt,unit->GetName(), unit->GetGUIDLow(), ref->getThreat());
+        }
+        ref = ref->next();
+    }
+    SendSysMessage("End of hostil reference list.");
+    return true;
+}
Index: trunk/src/game/ArenaTeam.cpp
===================================================================
--- trunk/src/game/ArenaTeam.cpp (revision 9)
+++ trunk/src/game/ArenaTeam.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/InstanceSaveMgr.h
===================================================================
--- trunk/src/game/InstanceSaveMgr.h (revision 2)
+++ trunk/src/game/InstanceSaveMgr.h (revision 44)
@@ -1,4 +1,7 @@
 /*
- * Copyright (C) 2005,2006,2007 MaNGOS <http://www.mangosproject.org/>
+/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ *
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +12,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -111,5 +114,5 @@
 };
 
-class MANGOS_DLL_DECL InstanceSaveManager : public MaNGOS::Singleton<InstanceSaveManager, MaNGOS::ClassLevelLockable<InstanceSaveManager, ZThread::Mutex> >
+class TRINITY_DLL_DECL InstanceSaveManager : public Trinity::Singleton<InstanceSaveManager, Trinity::ClassLevelLockable<InstanceSaveManager, ZThread::Mutex> >
 {
     friend class InstanceSave;
@@ -169,4 +172,4 @@
 };
 
-#define sInstanceSaveManager MaNGOS::Singleton<InstanceSaveManager>::Instance()
+#define sInstanceSaveManager Trinity::Singleton<InstanceSaveManager>::Instance()
 #endif
Index: trunk/src/game/Item.cpp
===================================================================
--- trunk/src/game/Item.cpp (revision 2)
+++ trunk/src/game/Item.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Bag.h
===================================================================
--- trunk/src/game/Bag.h (revision 2)
+++ trunk/src/game/Bag.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_BAG_H
-#define MANGOS_BAG_H
+#ifndef TRINITY_BAG_H
+#define TRINITY_BAG_H
 
 // Maximum 36 Slots ( (CONTAINER_END - CONTAINER_FIELD_SLOT_1)/2
Index: trunk/src/game/HostilRefManager.h
===================================================================
--- trunk/src/game/HostilRefManager.h (revision 2)
+++ trunk/src/game/HostilRefManager.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/GameObject.cpp
===================================================================
--- trunk/src/game/GameObject.cpp (revision 37)
+++ trunk/src/game/GameObject.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -36,4 +38,5 @@
 #include "InstanceData.h"
 #include "BattleGround.h"
+#include "OutdoorPvPMgr.h"
 #include "Util.h"
 
@@ -90,5 +93,5 @@
 }
 
-bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, uint32 go_state)
+bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, uint32 go_state, uint32 ArtKit)
 {
     Relocate(x,y,z,ang);
@@ -142,4 +145,6 @@
 
     SetGoAnimProgress(animprogress);
+
+    SetUInt32Value (GAMEOBJECT_ARTKIT, ArtKit);
 
     // Spell charges for GAMEOBJECT_TYPE_SPELLCASTER (22)
@@ -296,5 +301,5 @@
                 bool NeedDespawn = (goInfo->trap.charges != 0);
 
-                CellPair p(MaNGOS::ComputeCellPair(GetPositionX(),GetPositionY()));
+                CellPair p(Trinity::ComputeCellPair(GetPositionX(),GetPositionY()));
                 Cell cell(p);
                 cell.data.Part.reserved = ALL_DISTRICT;
@@ -304,10 +309,10 @@
                 if(owner && NeedDespawn)                    // hunter trap
                 {
-                    MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, owner, radius);
-                    MaNGOS::UnitSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck> checker(ok, u_check);
+                    Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, owner, radius);
+                    Trinity::UnitSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> checker(ok, u_check);
 
                     CellLock<GridReadGuard> cell_lock(cell, p);
 
-                    TypeContainerVisitor<MaNGOS::UnitSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
+                    TypeContainerVisitor<Trinity::UnitSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
                     cell_lock->Visit(cell_lock, grid_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
 
@@ -315,5 +320,5 @@
                     if(!ok)
                     {
-                        TypeContainerVisitor<MaNGOS::UnitSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
+                        TypeContainerVisitor<Trinity::UnitSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
                         cell_lock->Visit(cell_lock, world_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
                     }
@@ -325,10 +330,10 @@
                     // affect only players
                     Player* p_ok = NULL;
-                    MaNGOS::AnyPlayerInObjectRangeCheck p_check(this, radius);
-                    MaNGOS::PlayerSearcher<MaNGOS::AnyPlayerInObjectRangeCheck>  checker(p_ok, p_check);
+                    Trinity::AnyPlayerInObjectRangeCheck p_check(this, radius);
+                    Trinity::PlayerSearcher<Trinity::AnyPlayerInObjectRangeCheck>  checker(p_ok, p_check);
 
                     CellLock<GridReadGuard> cell_lock(cell, p);
 
-                    TypeContainerVisitor<MaNGOS::PlayerSearcher<MaNGOS::AnyPlayerInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
+                    TypeContainerVisitor<Trinity::PlayerSearcher<Trinity::AnyPlayerInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
                     cell_lock->Visit(cell_lock, world_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
                     ok = p_ok;
@@ -519,4 +524,5 @@
     data.go_state = GetGoState();
     data.spawnMask = spawnMask;
+    data.ArtKit = GetUInt32Value (GAMEOBJECT_ARTKIT);
 
     // updated in DB
@@ -569,9 +575,10 @@
     uint32 animprogress = data->animprogress;
     uint32 go_state = data->go_state;
+    uint32 ArtKit = data->ArtKit;
 
     m_DBTableGuid = guid;
     if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
 
-    if (!Create(guid,entry, map, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state) )
+    if (!Create(guid,entry, map, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, ArtKit) )
         return false;
 
@@ -779,12 +786,12 @@
     {
         // using original GO distance
-        CellPair p(MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()));
+        CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
         Cell cell(p);
         cell.data.Part.reserved = ALL_DISTRICT;
 
-        MaNGOS::NearestGameObjectEntryInObjectRangeCheck go_check(*target,trapEntry,range);
-        MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck> checker(trapGO,go_check);
-
-        TypeContainerVisitor<MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
+        Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*target,trapEntry,range);
+        Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(trapGO,go_check);
+
+        TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
         CellLock<GridReadGuard> cell_lock(cell, p);
         cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
@@ -801,13 +808,13 @@
     GameObject* ok = NULL;
 
-    CellPair p(MaNGOS::ComputeCellPair(GetPositionX(),GetPositionY()));
+    CellPair p(Trinity::ComputeCellPair(GetPositionX(),GetPositionY()));
     Cell cell(p);
     cell.data.Part.reserved = ALL_DISTRICT;
-    MaNGOS::NearestGameObjectFishingHole u_check(*this, range);
-    MaNGOS::GameObjectSearcher<MaNGOS::NearestGameObjectFishingHole> checker(ok, u_check);
+    Trinity::NearestGameObjectFishingHole u_check(*this, range);
+    Trinity::GameObjectSearcher<Trinity::NearestGameObjectFishingHole> checker(ok, u_check);
 
     CellLock<GridReadGuard> cell_lock(cell, p);
 
-    TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
+    TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
     cell_lock->Visit(cell_lock, grid_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
 
@@ -828,4 +835,12 @@
     m_cooldownTime = time(NULL) + time_to_restore;
 
+}
+
+void GameObject::SetGoArtKit(uint32 kit)
+{
+    SetUInt32Value(GAMEOBJECT_ARTKIT, kit);
+    GameObjectData *data = const_cast<GameObjectData*>(objmgr.GetGOData(m_DBTableGuid));
+    if(data)
+        data->ArtKit = kit;
 }
 
@@ -1234,5 +1249,8 @@
     if(!spellInfo)
     {
-        sLog.outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u )", spellId,GetEntry(),GetGoType());
+        if(user->GetTypeId()!=TYPEID_PLAYER || !sOutdoorPvPMgr.HandleCustomSpell((Player*)user,spellId,this))
+            sLog.outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u )", spellId,GetEntry(),GetGoType());
+        else
+            sLog.outDebug("WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId);
         return;
     }
Index: trunk/src/game/OutdoorPvPNA.cpp
===================================================================
--- trunk/src/game/OutdoorPvPNA.cpp (revision 44)
+++ trunk/src/game/OutdoorPvPNA.cpp (revision 44)
@@ -0,0 +1,706 @@
+#include "OutdoorPvPNA.h"
+#include "Player.h"
+#include "ObjectMgr.h"
+#include "OutdoorPvPMgr.h"
+#include "WorldPacket.h"
+#include "Language.h"
+#include "World.h"
+
+OutdoorPvPNA::OutdoorPvPNA()
+{
+    m_TypeId = OUTDOOR_PVP_NA;
+}
+
+void OutdoorPvPNA::HandleKillImpl(Player *plr, Unit * killed)
+{
+    if(killed->GetTypeId() == TYPEID_PLAYER && plr->GetTeam() != ((Player*)killed)->GetTeam())
+    {
+        plr->KilledMonster(NA_CREDIT_MARKER,0); // 0 guid, btw it isn't even used in killedmonster function :S
+        if(plr->GetTeam() == ALLIANCE)
+            plr->CastSpell(plr,NA_KILL_TOKEN_ALLIANCE,true);
+        else
+            plr->CastSpell(plr,NA_KILL_TOKEN_HORDE,true);
+    }
+}
+
+uint32 OutdoorPvPObjectiveNA::GetAliveGuardsCount()
+{
+    uint32 cnt = 0;
+    for(std::map<uint32, uint64>::iterator itr = m_Creatures.begin(); itr != m_Creatures.end(); ++itr)
+    {
+        switch(itr->first)
+        {
+        case NA_NPC_GUARD_01:
+        case NA_NPC_GUARD_02:
+        case NA_NPC_GUARD_03:
+        case NA_NPC_GUARD_04:
+        case NA_NPC_GUARD_05:
+        case NA_NPC_GUARD_06:
+        case NA_NPC_GUARD_07:
+        case NA_NPC_GUARD_08:
+        case NA_NPC_GUARD_09:
+        case NA_NPC_GUARD_10:
+        case NA_NPC_GUARD_11:
+        case NA_NPC_GUARD_12:
+        case NA_NPC_GUARD_13:
+        case NA_NPC_GUARD_14:
+        case NA_NPC_GUARD_15:
+            {
+                if(Creature * cr = HashMapHolder<Creature>::Find(itr->second))
+                {
+                    if(cr->isAlive())
+                        ++cnt;
+                }
+                else if (CreatureData const * cd = objmgr.GetCreatureData(GUID_LOPART(itr->second)))
+                {
+                    if(!cd->is_dead)
+                        ++cnt;
+                }
+            }
+            break;
+        default:
+            break;
+        }
+    }
+    return cnt;
+}
+
+void OutdoorPvPNA::BuffTeam(uint32 team)
+{
+    if(team == ALLIANCE)
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->CastSpell(plr,NA_CAPTURE_BUFF,true);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(NA_CAPTURE_BUFF);
+        }
+    }
+    else if(team == HORDE)
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->CastSpell(plr,NA_CAPTURE_BUFF,true);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(NA_CAPTURE_BUFF);
+        }
+    }
+    else
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(NA_CAPTURE_BUFF);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(NA_CAPTURE_BUFF);
+        }
+    }
+}
+
+void OutdoorPvPObjectiveNA::SpawnNPCsForTeam(uint32 team)
+{
+    const creature_type * creatures = NULL;
+    if(team == ALLIANCE)
+        creatures=AllianceControlNPCs;
+    else if(team == HORDE)
+        creatures=HordeControlNPCs;
+    else
+        return;
+    for(int i = 0; i < NA_CONTROL_NPC_NUM; ++i)
+        AddCreature(i,creatures[i].entry,creatures[i].teamval,creatures[i].map,creatures[i].x,creatures[i].y,creatures[i].z,creatures[i].o,1000000);
+}
+
+void OutdoorPvPObjectiveNA::DeSpawnNPCs()
+{
+    for(int i = 0; i < NA_CONTROL_NPC_NUM; ++i)
+        DelCreature(i);
+}
+
+void OutdoorPvPObjectiveNA::SpawnGOsForTeam(uint32 team)
+{
+    const go_type * gos = NULL;
+    if(team == ALLIANCE)
+        gos=AllianceControlGOs;
+    else if(team == HORDE)
+        gos=HordeControlGOs;
+    else
+        return;
+    for(int i = 0; i < NA_CONTROL_GO_NUM; ++i)
+    {
+        if( i == NA_ROOST_S ||
+            i == NA_ROOST_W ||
+            i == NA_ROOST_N ||
+            i == NA_ROOST_E ||
+            i == NA_BOMB_WAGON_S || 
+            i == NA_BOMB_WAGON_W || 
+            i == NA_BOMB_WAGON_N || 
+            i == NA_BOMB_WAGON_E )
+            continue;   // roosts and bomb wagons are spawned when someone uses the matching destroyed roost
+        AddObject(i,gos[i].entry,gos[i].map,gos[i].x,gos[i].y,gos[i].z,gos[i].o,gos[i].rot0,gos[i].rot1,gos[i].rot2,gos[i].rot3);
+    }
+}
+
+void OutdoorPvPObjectiveNA::DeSpawnGOs()
+{
+    for(int i = 0; i < NA_CONTROL_GO_NUM; ++i)
+    {
+        DelObject(i);
+    }
+}
+
+void OutdoorPvPObjectiveNA::FactionTakeOver(uint32 team)
+{
+    if(m_ControllingFaction)
+        objmgr.RemoveGraveYardLink(NA_HALAA_GRAVEYARD,NA_HALAA_GRAVEYARD_ZONE,m_ControllingFaction,false);
+    if(m_ControllingFaction == ALLIANCE)
+        sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOOSE_A));
+    else if(m_ControllingFaction == HORDE)
+        sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOOSE_H));
+
+    m_ControllingFaction = team;
+    if(m_ControllingFaction)
+        objmgr.AddGraveYardLink(NA_HALAA_GRAVEYARD,NA_HALAA_GRAVEYARD_ZONE,m_ControllingFaction,false);
+    DeSpawnGOs();
+    DeSpawnNPCs();
+    SpawnGOsForTeam(team);
+    SpawnNPCsForTeam(team);
+    m_GuardsAlive = NA_GUARDS_MAX;
+    m_capturable = false;
+    this->UpdateHalaaWorldState();
+    if(team == ALLIANCE)
+    {
+        m_WyvernStateSouth = WYVERN_NEU_HORDE;
+        m_WyvernStateNorth = WYVERN_NEU_HORDE;
+        m_WyvernStateEast = WYVERN_NEU_HORDE;
+        m_WyvernStateWest = WYVERN_NEU_HORDE;
+        m_PvP->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 0);
+        m_PvP->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 1);
+        m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive);
+        sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_A));
+    }
+    else
+    {
+        m_WyvernStateSouth = WYVERN_NEU_ALLIANCE;
+        m_WyvernStateNorth = WYVERN_NEU_ALLIANCE;
+        m_WyvernStateEast = WYVERN_NEU_ALLIANCE;
+        m_WyvernStateWest = WYVERN_NEU_ALLIANCE;
+        m_PvP->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 1);
+        m_PvP->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 0);
+        m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive);
+        sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_H));
+    }
+    this->UpdateWyvernRoostWorldState(NA_ROOST_S);
+    this->UpdateWyvernRoostWorldState(NA_ROOST_N);
+    this->UpdateWyvernRoostWorldState(NA_ROOST_W);
+    this->UpdateWyvernRoostWorldState(NA_ROOST_E);
+    ((OutdoorPvPNA*)m_PvP)->BuffTeam(team);
+}
+
+bool OutdoorPvPObjectiveNA::HandlePlayerEnter(Player *plr)
+{
+    if(OutdoorPvPObjective::HandlePlayerEnter(plr))
+    {
+        plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 1);
+        uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+        plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, phase);
+        plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, m_NeutralValue);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveNA::HandlePlayerLeave(Player *plr)
+{
+    plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 0);
+    OutdoorPvPObjective::HandlePlayerLeave(plr);
+}
+
+OutdoorPvPObjectiveNA::OutdoorPvPObjectiveNA(OutdoorPvP *pvp) : 
+OutdoorPvPObjective(pvp), m_capturable(true), m_GuardsAlive(0), m_ControllingFaction(0),
+m_HalaaState(HALAA_N), m_WyvernStateSouth(0), m_WyvernStateNorth(0), m_WyvernStateWest(0),
+m_WyvernStateEast(0), m_RespawnTimer(NA_RESPAWN_TIME), m_GuardCheckTimer(NA_GUARD_CHECK_TIME)
+{
+    AddCapturePoint(182210,530,-1572.57,7945.3,-22.475,2.05949,0,0,0.857167,0.515038);
+}
+
+bool OutdoorPvPNA::SetupOutdoorPvP()
+{
+//    m_TypeId = OUTDOOR_PVP_NA; _MUST_ be set in ctor, because of spawns cleanup
+    // add the zones affected by the pvp buff
+    sOutdoorPvPMgr.AddZone(NA_BUFF_ZONE,this);
+
+    // halaa
+    m_obj = new OutdoorPvPObjectiveNA(this);
+    if(!m_obj)
+        return false;
+    m_OutdoorPvPObjectives.insert(m_obj);
+
+    return true;
+}
+
+void OutdoorPvPNA::HandlePlayerEnterZone(Player * plr, uint32 zone)
+{
+    // add buffs
+    if(plr->GetTeam() == m_obj->m_ControllingFaction)
+        plr->CastSpell(plr,NA_CAPTURE_BUFF,true);
+    OutdoorPvP::HandlePlayerEnterZone(plr,zone);
+}
+
+void OutdoorPvPNA::HandlePlayerLeaveZone(Player * plr, uint32 zone)
+{
+    // remove buffs
+    plr->RemoveAurasDueToSpell(NA_CAPTURE_BUFF);
+    OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
+}
+
+void OutdoorPvPNA::FillInitialWorldStates(WorldPacket &data)
+{
+    m_obj->FillInitialWorldStates(data);
+}
+
+void OutdoorPvPObjectiveNA::FillInitialWorldStates(WorldPacket &data)
+{
+    if(m_ControllingFaction == ALLIANCE)
+    {
+        data << NA_UI_HORDE_GUARDS_SHOW << uint32(0);
+        data << NA_UI_ALLIANCE_GUARDS_SHOW << uint32(1);
+    }
+    else if(m_ControllingFaction == HORDE)
+    {
+        data << NA_UI_HORDE_GUARDS_SHOW << uint32(1);
+        data << NA_UI_ALLIANCE_GUARDS_SHOW << uint32(0);
+    }
+    else
+    {
+        data << NA_UI_HORDE_GUARDS_SHOW << uint32(0);
+        data << NA_UI_ALLIANCE_GUARDS_SHOW << uint32(0);
+    }
+
+    data << NA_UI_GUARDS_MAX << NA_GUARDS_MAX;
+    data << NA_UI_GUARDS_LEFT << uint32(m_GuardsAlive);
+
+    data << NA_UI_TOWER_SLIDER_DISPLAY << uint32(0);
+    data << NA_UI_TOWER_SLIDER_POS << uint32(50);
+    data << NA_UI_TOWER_SLIDER_N << uint32(100);
+
+    data << NA_MAP_WYVERN_NORTH_NEU_H << uint32(bool(m_WyvernStateNorth & WYVERN_NEU_HORDE));
+    data << NA_MAP_WYVERN_NORTH_NEU_A << uint32(bool(m_WyvernStateNorth & WYVERN_NEU_ALLIANCE));
+    data << NA_MAP_WYVERN_NORTH_H << uint32(bool(m_WyvernStateNorth & WYVERN_HORDE));
+    data << NA_MAP_WYVERN_NORTH_A << uint32(bool(m_WyvernStateNorth & WYVERN_ALLIANCE));
+
+    data << NA_MAP_WYVERN_SOUTH_NEU_H << uint32(bool(m_WyvernStateSouth & WYVERN_NEU_HORDE));
+    data << NA_MAP_WYVERN_SOUTH_NEU_A << uint32(bool(m_WyvernStateSouth & WYVERN_NEU_ALLIANCE));
+    data << NA_MAP_WYVERN_SOUTH_H << uint32(bool(m_WyvernStateSouth & WYVERN_HORDE));
+    data << NA_MAP_WYVERN_SOUTH_A << uint32(bool(m_WyvernStateSouth & WYVERN_ALLIANCE));
+
+    data << NA_MAP_WYVERN_WEST_NEU_H << uint32(bool(m_WyvernStateWest & WYVERN_NEU_HORDE));
+    data << NA_MAP_WYVERN_WEST_NEU_A << uint32(bool(m_WyvernStateWest & WYVERN_NEU_ALLIANCE));
+    data << NA_MAP_WYVERN_WEST_H << uint32(bool(m_WyvernStateWest & WYVERN_HORDE));
+    data << NA_MAP_WYVERN_WEST_A << uint32(bool(m_WyvernStateWest & WYVERN_ALLIANCE));
+
+    data << NA_MAP_WYVERN_EAST_NEU_H << uint32(bool(m_WyvernStateEast & WYVERN_NEU_HORDE));
+    data << NA_MAP_WYVERN_EAST_NEU_A << uint32(bool(m_WyvernStateEast & WYVERN_NEU_ALLIANCE));
+    data << NA_MAP_WYVERN_EAST_H << uint32(bool(m_WyvernStateEast & WYVERN_HORDE));
+    data << NA_MAP_WYVERN_EAST_A << uint32(bool(m_WyvernStateEast & WYVERN_ALLIANCE));
+
+    data << NA_MAP_HALAA_NEUTRAL << uint32(bool(m_HalaaState & HALAA_N));
+    data << NA_MAP_HALAA_NEU_A << uint32(bool(m_HalaaState & HALAA_N_A));
+    data << NA_MAP_HALAA_NEU_H << uint32(bool(m_HalaaState & HALAA_N_H));
+    data << NA_MAP_HALAA_HORDE << uint32(bool(m_HalaaState & HALAA_H));
+    data << NA_MAP_HALAA_ALLIANCE << uint32(bool(m_HalaaState & HALAA_A)); 
+}
+
+void OutdoorPvPNA::SendRemoveWorldStates(Player *plr)
+{
+    plr->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW,0);
+    plr->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW,0);
+    plr->SendUpdateWorldState(NA_UI_GUARDS_MAX,0);
+    plr->SendUpdateWorldState(NA_UI_GUARDS_LEFT,0);
+    plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY,0);
+    plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS,0);
+    plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_N,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_H,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_A,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_H,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_A,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_H,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_A,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_H,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_A,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_H,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_A,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_WEST_H,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_WEST_A,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_H,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_A,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_EAST_H,0);
+    plr->SendUpdateWorldState(NA_MAP_WYVERN_EAST_A,0);
+    plr->SendUpdateWorldState(NA_MAP_HALAA_NEUTRAL,0);
+    plr->SendUpdateWorldState(NA_MAP_HALAA_NEU_A,0);
+    plr->SendUpdateWorldState(NA_MAP_HALAA_NEU_H,0);
+    plr->SendUpdateWorldState(NA_MAP_HALAA_HORDE,0);
+    plr->SendUpdateWorldState(NA_MAP_HALAA_ALLIANCE,0); 
+}
+
+bool OutdoorPvPNA::Update(uint32 diff)
+{
+    return m_obj->Update(diff);
+}
+
+bool OutdoorPvPObjectiveNA::HandleCustomSpell(Player * plr, uint32 spellId, GameObject * go)
+{
+    std::vector<uint32> nodes;
+    nodes.resize(2);
+    bool retval = false;
+    switch(spellId)
+    {
+    case NA_SPELL_FLY_NORTH:
+        nodes[0] = FlightPathStartNodes[NA_ROOST_N];
+        nodes[1] = FlightPathEndNodes[NA_ROOST_N];
+        plr->ActivateTaxiPathTo(nodes);
+        plr->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
+        plr->UpdatePvP(true,true);
+        retval = true;
+        break;
+    case NA_SPELL_FLY_SOUTH:
+        nodes[0] = FlightPathStartNodes[NA_ROOST_S];
+        nodes[1] = FlightPathEndNodes[NA_ROOST_S];
+        plr->ActivateTaxiPathTo(nodes);
+        plr->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
+        plr->UpdatePvP(true,true);
+        retval = true;
+        break;
+    case NA_SPELL_FLY_WEST:
+        nodes[0] = FlightPathStartNodes[NA_ROOST_W];
+        nodes[1] = FlightPathEndNodes[NA_ROOST_W];
+        plr->ActivateTaxiPathTo(nodes);
+        plr->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
+        plr->UpdatePvP(true,true);
+        retval = true;
+        break;
+    case NA_SPELL_FLY_EAST:
+        nodes[0] = FlightPathStartNodes[NA_ROOST_E];
+        nodes[1] = FlightPathEndNodes[NA_ROOST_E];
+        plr->ActivateTaxiPathTo(nodes);
+        plr->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
+        plr->UpdatePvP(true,true);
+        retval = true;
+        break;
+    default:
+        break;
+    }
+
+    if(retval)
+    {
+        //Adding items
+        uint32 noSpaceForCount = 0;
+
+        // check space and find places
+        ItemPosCountVec dest;                           
+
+        int32 count = 10;
+        uint32 itemid = 24538;
+                                                                // bomb id count
+        uint8 msg = plr->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemid, count, &noSpaceForCount );
+        if( msg != EQUIP_ERR_OK )                               // convert to possible store amount
+            count -= noSpaceForCount;
+
+        if( count == 0 || dest.empty())                         // can't add any
+        {
+            return true;
+        }
+
+        Item* item = plr->StoreNewItem( dest, itemid, true);
+
+        if(count > 0 && item)
+        {
+            plr->SendNewItem(item,count,true,false);
+        }
+
+        return true;
+    }
+    return false;
+}
+
+int32 OutdoorPvPObjectiveNA::HandleOpenGo(Player *plr, uint64 guid)
+{
+    uint32 retval = OutdoorPvPObjective::HandleOpenGo(plr, guid);
+    if(retval>=0)
+    {
+        const go_type * gos = NULL;
+        if(m_ControllingFaction == ALLIANCE)
+            gos=AllianceControlGOs;
+        else if(m_ControllingFaction == HORDE)
+            gos=HordeControlGOs;
+        else
+            return -1;
+
+        int32 del = -1;
+        int32 del2 = -1;
+        int32 add = -1;
+        int32 add2 = -1;
+
+        switch(retval)
+        {
+        case NA_DESTROYED_ROOST_S:
+            del = NA_DESTROYED_ROOST_S;
+            add = NA_ROOST_S;
+            add2 = NA_BOMB_WAGON_S;
+            if(m_ControllingFaction == HORDE)
+                m_WyvernStateSouth = WYVERN_ALLIANCE;
+            else
+                m_WyvernStateSouth = WYVERN_HORDE;
+            UpdateWyvernRoostWorldState(NA_ROOST_S);
+            break;
+        case NA_DESTROYED_ROOST_N:
+            del = NA_DESTROYED_ROOST_N;
+            add = NA_ROOST_N;
+            add2 = NA_BOMB_WAGON_N;
+            if(m_ControllingFaction == HORDE)
+                m_WyvernStateNorth = WYVERN_ALLIANCE;
+            else
+                m_WyvernStateNorth = WYVERN_HORDE;
+            UpdateWyvernRoostWorldState(NA_ROOST_N);
+            break;
+        case NA_DESTROYED_ROOST_W:
+            del = NA_DESTROYED_ROOST_W;
+            add = NA_ROOST_W;
+            add2 = NA_BOMB_WAGON_W;
+            if(m_ControllingFaction == HORDE)
+                m_WyvernStateWest = WYVERN_ALLIANCE;
+            else
+                m_WyvernStateWest = WYVERN_HORDE;
+            UpdateWyvernRoostWorldState(NA_ROOST_W);
+            break;
+        case NA_DESTROYED_ROOST_E:
+            del = NA_DESTROYED_ROOST_E;
+            add = NA_ROOST_E;
+            add2 = NA_BOMB_WAGON_E;
+            if(m_ControllingFaction == HORDE)
+                m_WyvernStateEast = WYVERN_ALLIANCE;
+            else
+                m_WyvernStateEast = WYVERN_HORDE;
+            UpdateWyvernRoostWorldState(NA_ROOST_E);
+            break;
+        case NA_BOMB_WAGON_S:
+            del = NA_BOMB_WAGON_S;
+            del2 = NA_ROOST_S;
+            add = NA_DESTROYED_ROOST_S;
+            if(m_ControllingFaction == HORDE)
+                m_WyvernStateSouth = WYVERN_NEU_ALLIANCE;
+            else
+                m_WyvernStateSouth = WYVERN_NEU_HORDE;
+            UpdateWyvernRoostWorldState(NA_ROOST_S);
+            break;
+        case NA_BOMB_WAGON_N:
+            del = NA_BOMB_WAGON_N;
+            del2 = NA_ROOST_N;
+            add = NA_DESTROYED_ROOST_N;
+            if(m_ControllingFaction == HORDE)
+                m_WyvernStateNorth = WYVERN_NEU_ALLIANCE;
+            else
+                m_WyvernStateNorth = WYVERN_NEU_HORDE;
+            UpdateWyvernRoostWorldState(NA_ROOST_N);
+            break;
+        case NA_BOMB_WAGON_W:
+            del = NA_BOMB_WAGON_W;
+            del2 = NA_ROOST_W;
+            add = NA_DESTROYED_ROOST_W;
+            if(m_ControllingFaction == HORDE)
+                m_WyvernStateWest = WYVERN_NEU_ALLIANCE;
+            else
+                m_WyvernStateWest = WYVERN_NEU_HORDE;
+            UpdateWyvernRoostWorldState(NA_ROOST_W);
+            break;
+        case NA_BOMB_WAGON_E:
+            del = NA_BOMB_WAGON_E;
+            del2 = NA_ROOST_E;
+            add = NA_DESTROYED_ROOST_E;
+            if(m_ControllingFaction == HORDE)
+                m_WyvernStateEast = WYVERN_NEU_ALLIANCE;
+            else
+                m_WyvernStateEast = WYVERN_NEU_HORDE;
+            UpdateWyvernRoostWorldState(NA_ROOST_E);
+            break;
+        default:
+            return -1;
+            break;
+        }
+
+        if(del>-1)
+            DelObject(del);
+
+        if(del2>-1)
+            DelObject(del2);
+
+        if(add>-1)
+            AddObject(add,gos[add].entry,gos[add].map,gos[add].x,gos[add].y,gos[add].z,gos[add].o,gos[add].rot0,gos[add].rot1,gos[add].rot2,gos[add].rot3);
+
+        if(add2>-1)
+            AddObject(add2,gos[add2].entry,gos[add2].map,gos[add2].x,gos[add2].y,gos[add2].z,gos[add2].o,gos[add2].rot0,gos[add2].rot1,gos[add2].rot2,gos[add2].rot3);
+
+        return retval;
+    }
+    return -1;
+}
+
+bool OutdoorPvPObjectiveNA::Update(uint32 diff)
+{
+    // let the controlling faction advance in phase
+    bool capturable = false;
+    if(m_ControllingFaction == ALLIANCE && m_AllianceActivePlayerCount > m_HordeActivePlayerCount)
+        capturable = true;
+    else if(m_ControllingFaction == HORDE && m_AllianceActivePlayerCount < m_HordeActivePlayerCount)
+        capturable = true;
+
+    if(m_GuardCheckTimer < diff)
+    {
+        m_GuardCheckTimer = NA_GUARD_CHECK_TIME;
+        uint32 cnt = GetAliveGuardsCount();
+        if(cnt != m_GuardsAlive)
+        {
+            m_GuardsAlive = cnt;
+            if(m_GuardsAlive == 0)
+                m_capturable = true;
+            // update the guard count for the players in zone
+            m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT,m_GuardsAlive);
+        }
+    } else m_GuardCheckTimer -= diff;
+
+    if((m_capturable || capturable) && OutdoorPvPObjective::Update(diff))
+    {
+        if(m_RespawnTimer < diff)
+        {
+            // if the guards have been killed, then the challenger has one hour to take over halaa.
+            // in case they fail to do it, the guards are respawned, and they have to start again.
+            if(m_ControllingFaction)
+                FactionTakeOver(m_ControllingFaction);
+            m_RespawnTimer = NA_RESPAWN_TIME;
+        } else m_RespawnTimer -= diff;
+
+        if(m_OldState != m_State)
+        {
+            uint32 artkit = 21;
+            switch(m_State)
+            {
+            case OBJECTIVESTATE_NEUTRAL:
+                m_HalaaState = HALAA_N;
+                break;
+            case OBJECTIVESTATE_ALLIANCE:
+                m_HalaaState = HALAA_A;
+                FactionTakeOver(ALLIANCE);
+                artkit = 2;
+                break;
+            case OBJECTIVESTATE_HORDE:
+                m_HalaaState = HALAA_H;
+                FactionTakeOver(HORDE);
+                artkit = 1;
+                break;
+            case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
+                m_HalaaState = HALAA_N_A;
+                break;
+            case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
+                m_HalaaState = HALAA_N_H;
+                break;
+            case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
+                m_HalaaState = HALAA_N_A;
+                artkit = 2;
+                break;
+            case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
+                m_HalaaState = HALAA_N_H;
+                artkit = 1;
+                break;
+            }
+
+            GameObject* flag = HashMapHolder<GameObject>::Find(m_CapturePoint);
+            if(flag)
+            {
+                flag->SetGoArtKit(artkit);
+                flag->SendUpdateObjectToAllExcept(NULL);
+            }
+
+            UpdateHalaaWorldState();
+        }
+
+        if(m_ShiftPhase != m_OldPhase)
+        {
+            // send this too, sometimes the slider disappears, dunno why :(
+            SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 1);
+            // send these updates to only the ones in this objective
+            uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+            SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, phase);
+            SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, m_NeutralValue);
+        }
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveNA::UpdateHalaaWorldState()
+{
+    m_PvP->SendUpdateWorldState( NA_MAP_HALAA_NEUTRAL ,uint32(bool(m_HalaaState & HALAA_N)));
+    m_PvP->SendUpdateWorldState( NA_MAP_HALAA_NEU_A ,uint32(bool(m_HalaaState & HALAA_N_A)));
+    m_PvP->SendUpdateWorldState( NA_MAP_HALAA_NEU_H ,uint32(bool(m_HalaaState & HALAA_N_H)));
+    m_PvP->SendUpdateWorldState( NA_MAP_HALAA_HORDE ,uint32(bool(m_HalaaState & HALAA_H)));
+    m_PvP->SendUpdateWorldState( NA_MAP_HALAA_ALLIANCE ,uint32(bool(m_HalaaState & HALAA_A)));
+}
+
+void OutdoorPvPObjectiveNA::UpdateWyvernRoostWorldState(uint32 roost)
+{
+    switch(roost)
+    {
+    case NA_ROOST_S:
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_H,uint32(bool(m_WyvernStateSouth & WYVERN_NEU_HORDE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_A,uint32(bool(m_WyvernStateSouth & WYVERN_NEU_ALLIANCE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_H,uint32(bool(m_WyvernStateSouth & WYVERN_HORDE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_A,uint32(bool(m_WyvernStateSouth & WYVERN_ALLIANCE)));
+        break;
+    case NA_ROOST_N:
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_H,uint32(bool(m_WyvernStateNorth & WYVERN_NEU_HORDE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_A,uint32(bool(m_WyvernStateNorth & WYVERN_NEU_ALLIANCE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_H,uint32(bool(m_WyvernStateNorth & WYVERN_HORDE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_A,uint32(bool(m_WyvernStateNorth & WYVERN_ALLIANCE)));
+        break;
+    case NA_ROOST_W:
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_H,uint32(bool(m_WyvernStateWest & WYVERN_NEU_HORDE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_A,uint32(bool(m_WyvernStateWest & WYVERN_NEU_ALLIANCE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_WEST_H,uint32(bool(m_WyvernStateWest & WYVERN_HORDE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_WEST_A,uint32(bool(m_WyvernStateWest & WYVERN_ALLIANCE)));
+        break;
+    case NA_ROOST_E:
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_H,uint32(bool(m_WyvernStateEast & WYVERN_NEU_HORDE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_A,uint32(bool(m_WyvernStateEast & WYVERN_NEU_ALLIANCE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_EAST_H,uint32(bool(m_WyvernStateEast & WYVERN_HORDE)));
+        m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_EAST_A,uint32(bool(m_WyvernStateEast & WYVERN_ALLIANCE)));
+        break;
+    }
+}
+
+bool OutdoorPvPObjectiveNA::HandleCapturePointEvent(Player *plr, uint32 eventId)
+{
+    switch(eventId)
+    {
+    case 11821:
+        this->HandlePlayerEnter(plr);
+        return true;
+        break;
+    case 11822:
+        this->HandlePlayerLeave(plr);
+        return true;
+        break;
+    default:
+        break;
+    }
+    return false;
+}
Index: trunk/src/game/WorldSession.h
===================================================================
--- trunk/src/game/WorldSession.h (revision 37)
+++ trunk/src/game/WorldSession.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -66,5 +68,5 @@
 
 /// Player session in the World
-class MANGOS_DLL_SPEC WorldSession
+class TRINITY_DLL_SPEC WorldSession
 {
     friend class CharacterHandler;
@@ -194,5 +196,5 @@
         LocaleConstant GetSessionDbcLocale() { return m_sessionDbcLocale; }
         int GetSessionDbLocaleIndex() { return m_sessionDbLocaleIndex; }
-        const char *GetMangosString(int32 entry);
+        const char *GetTrinityString(int32 entry);
 
         uint32 GetLatency() const { return m_latency; }
Index: trunk/src/game/BattleGroundBE.cpp
===================================================================
--- trunk/src/game/BattleGroundBE.cpp (revision 9)
+++ trunk/src/game/BattleGroundBE.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/BattleGroundAA.h
===================================================================
--- trunk/src/game/BattleGroundAA.h (revision 2)
+++ trunk/src/game/BattleGroundAA.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 #ifndef __BATTLEGROUNDAA_H
Index: trunk/src/game/TaxiHandler.cpp
===================================================================
--- trunk/src/game/TaxiHandler.cpp (revision 2)
+++ trunk/src/game/TaxiHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/BattleGroundMgr.h
===================================================================
--- trunk/src/game/BattleGroundMgr.h (revision 9)
+++ trunk/src/game/BattleGroundMgr.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -247,4 +249,4 @@
 };
 
-#define sBattleGroundMgr MaNGOS::Singleton<BattleGroundMgr>::Instance()
+#define sBattleGroundMgr Trinity::Singleton<BattleGroundMgr>::Instance()
 #endif
Index: trunk/src/game/Tools.h
===================================================================
--- trunk/src/game/Tools.h (revision 2)
+++ trunk/src/game/Tools.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,13 +11,13 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
-#ifndef MANGOS_TOOLS_H
-#define MANGOS_TOOLS_H
+#ifndef TRINITY_TOOLS_H
+#define TRINITY_TOOLS_H
 
 #include "Common.h"
Index: trunk/src/game/MapManager.cpp
===================================================================
--- trunk/src/game/MapManager.cpp (revision 9)
+++ trunk/src/game/MapManager.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -32,5 +34,5 @@
 #include "ObjectMgr.h"
 
-#define CLASS_LOCK MaNGOS::ClassLevelLockable<MapManager, ZThread::Mutex>
+#define CLASS_LOCK Trinity::ClassLevelLockable<MapManager, ZThread::Mutex>
 INSTANTIATE_SINGLETON_2(MapManager, CLASS_LOCK);
 INSTANTIATE_CLASS_MUTEX(MapManager, ZThread::Mutex);
@@ -83,5 +85,5 @@
             si_GridStates[i] = i_GridStates[i];
         }
-        #ifdef MANGOS_DEBUG
+        #ifdef TRINITY_DEBUG
         // inner class checking only when compiled with debug
         if(!si_GridStates[i]->checkMagic())
@@ -266,5 +268,5 @@
 bool MapManager::ExistMapAndVMap(uint32 mapid, float x,float y)
 {
-    GridPair p = MaNGOS::ComputeGridPair(x,y);
+    GridPair p = Trinity::ComputeGridPair(x,y);
 
     int gx=63-p.x_coord;
@@ -282,5 +284,5 @@
 void MapManager::LoadGrid(int mapid, float x, float y, const WorldObject* obj, bool no_unload)
 {
-    CellPair p = MaNGOS::ComputeCellPair(x,y);
+    CellPair p = Trinity::ComputeCellPair(x,y);
     Cell cell(p);
     GetMap(mapid, obj)->LoadGrid(cell,no_unload);
Index: trunk/src/game/AggressorAI.h
===================================================================
--- trunk/src/game/AggressorAI.h (revision 2)
+++ trunk/src/game/AggressorAI.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_AGGRESSORAI_H
-#define MANGOS_AGGRESSORAI_H
+#ifndef TRINITY_AGGRESSORAI_H
+#define TRINITY_AGGRESSORAI_H
 
 #include "CreatureAI.h"
@@ -25,5 +27,5 @@
 class Creature;
 
-class MANGOS_DLL_DECL AggressorAI : public CreatureAI
+class TRINITY_DLL_DECL AggressorAI : public CreatureAI
 {
     enum AggressorState
Index: trunk/src/game/OutdoorPvPEP.h
===================================================================
--- trunk/src/game/OutdoorPvPEP.h (revision 44)
+++ trunk/src/game/OutdoorPvPEP.h (revision 44)
@@ -0,0 +1,263 @@
+#ifndef OUTDOOR_PVP_EP_
+#define OUTDOOR_PVP_EP_
+
+#include "OutdoorPvP.h"
+
+#include "Database/DBCStructure.h"
+
+const uint32 EP_AllianceBuffs[4] = {11413, 11414, 11415, 1386};
+
+const uint32 EP_HordeBuffs[4] = {30880, 30683, 30682, 29520};
+
+const uint32 EP_GraveYardZone = 139;
+
+const uint32 EP_GraveYardId = 927;
+
+const uint32 EPBuffZonesNum = 3;
+
+const uint32 EP_EWT_CM = 17690;
+const uint32 EP_CGT_CM = 17689;
+const uint32 EP_NPT_CM = 17696;
+const uint32 EP_PWT_CM = 17698;
+
+const uint32 EPBuffZones[EPBuffZonesNum] = {139, 2017, 2057};
+
+enum EP_TaxiNodes {
+    EP_CGT_Taxi = 87,
+    EP_EWT_Taxi = 86,
+    EP_NPT_Taxi = 85,
+    EP_PWT_Taxi = 84
+};
+
+enum EP_EastwallTowerWorldStates {
+    EP_EWT_A = 2354,
+    EP_EWT_H = 2356,
+    EP_EWT_A_P = 2357, // ally progressing
+    EP_EWT_H_P = 2358,
+    EP_EWT_N_A = 2359, // ally conquested
+    EP_EWT_N_H = 2360,
+    EP_EWT_N = 2361
+};
+
+enum EP_NorthpassTowerWorldStates {
+    EP_NPT_N = 2352,
+    EP_NPT_N_A = 2362,
+    EP_NPT_N_H = 2363,
+    EP_NPT_A_P = 2364,
+    EP_NPT_H_P = 2365,
+    EP_NPT_A = 2372,
+    EP_NPT_H = 2373
+};
+
+enum EP_PlagewoodTowerWorldStates {
+    EP_PWT_N_A = 2366,
+    EP_PWT_N_H = 2353, //2367 not present! use neutral!
+    EP_PWT_A_P = 2368,
+    EP_PWT_H_P = 2369,
+    EP_PWT_A = 2370,
+    EP_PWT_H = 2371,
+    EP_PWT_N = 2353
+};
+
+enum EP_CrownGuardTowerWorldStates {
+    EP_CGT_N_A = 2374,
+    EP_CGT_N_H = 2375,
+    EP_CGT_A_P = 2376,
+    EP_CGT_H_P = 2377,
+    EP_CGT_A = 2378,
+    EP_CGT_H = 2379,
+    EP_CGT_N = 2355
+};
+
+enum EP_WorldStates {
+    EP_UI_TOWER_SLIDER_DISPLAY = 2426,
+    EP_UI_TOWER_SLIDER_POS = 2427,
+    EP_UI_TOWER_SLIDER_N = 2428,
+
+    EP_UI_TOWER_COUNT_A = 2327,
+    EP_UI_TOWER_COUNT_H = 2328
+};
+
+enum EP_Summons {
+    EP_EWT_COMMANDER = 0,
+    EP_EWT_SOLDIER1,
+    EP_EWT_SOLDIER2,
+    EP_EWT_SOLDIER3,
+    EP_EWT_SOLDIER4,
+    EP_PWT_FLIGHTMASTER,
+};
+
+enum EP_GoSummons {
+    EP_NPT_BUFF = 0,
+    EP_NPT_FLAGS,
+    EP_EWT_FLAGS,
+    EP_CGT_FLAGS,
+    EP_PWT_FLAGS
+};
+
+enum EP_Towers {
+    EP_EWT = 0, // plaguelands 03
+    EP_NPT,// plaguelands 01
+    EP_PWT,// plaguelands 04
+    EP_CGT,// plaguelands 02
+    EP_TOWER_NUM
+};
+
+const go_type EPCapturePoints[EP_TOWER_NUM] = {
+    {182097,0,2574.51,-4794.89,144.704,-1.45003,-0.097056,0.095578,-0.656229,0.742165},
+    {181899,0,3181.08,-4379.36,174.123,-2.03472,-0.065392,0.119494,-0.842275,0.521553},
+    {182098,0,2962.71,-3042.31,154.789,2.08426,-0.074807,-0.113837,0.855928,0.49883},
+    {182096,0,1860.85,-3731.23,196.716,-2.53214,0.033967,-0.131914,0.944741,-0.298177}
+};
+
+const go_type EPTowerFlags[EP_TOWER_NUM] = {
+    {182106,0,2569.60,-4772.93,115.399,2.72271,0,0,0.978148,0.207912},
+    {182106,0,3148.17,-4365.51,145.029,1.53589,0,0,0.694658,0.71934},
+    {182106,0,2992.63,-3022.95,125.593,3.03687,0,0,0.99863,0.052336},
+    {182106,0,1838.42,-3703.56,167.713,0.890118,0,0,0.430511,0.902585}
+};
+
+const uint32 EPTowerPlayerEnterEvents[EP_TOWER_NUM] = {10691,10699,10701,10705};
+
+const uint32 EPTowerPlayerLeaveEvents[EP_TOWER_NUM] = {10692,10698,10700,10704};
+
+const uint32 EP_NUM_CREATURES = 6;
+const uint32 EP_EWT_NUM_CREATURES = 5;
+
+// one lordaeron commander, 4 soldiers
+// should be spawned at EWT and follow a path, but trans-grid pathing isn't safe, so summon them directly at NPT
+const creature_type EP_EWT_Summons_A[EP_EWT_NUM_CREATURES] = {
+    {17635,469,0, 3167.61,-4352.09,138.20,4.5811},
+    {17647,469,0, 3172.74,-4352.99,139.14,4.9873},
+    {17647,469,0, 3165.89,-4354.46,138.67,3.7244},
+    {17647,469,0, 3164.65,-4350.26,138.22,2.4794},
+    {17647,469,0, 3169.91,-4349.68,138.37,0.7444}
+};
+
+const creature_type EP_EWT_Summons_H[EP_EWT_NUM_CREATURES] = {
+    {17995,67,0, 3167.61,-4352.09,138.20,4.5811},
+    {17996,67,0, 3172.74,-4352.99,139.14,4.9873},
+    {17996,67,0, 3165.89,-4354.46,138.67,3.7244},
+    {17996,67,0, 3164.65,-4350.26,138.22,2.4794},
+    {17996,67,0, 3169.91,-4349.68,138.37,0.7444}
+};
+
+enum EP_TowerStates {
+    EP_TS_N = 1,
+    EP_TS_N_A = 2,
+    EP_TS_N_H = 4,
+    EP_TS_A_P = 8,
+    EP_TS_H_P = 16,
+    EP_TS_A = 32,
+    EP_TS_H = 64
+};
+
+// when spawning, pay attention at setting the faction manually!
+const creature_type EP_PWT_FlightMaster = {17209,0,0,2987.5,-3049.11,120.126,5.75959};
+
+// after spawning, modify the faction so that only the controller will be able to use it with SetUInt32Value(GAMEOBJECT_FACTION, faction_id);
+const go_type EP_NPT_LordaeronShrine = {181682,0,3167.72,-4355.91,138.785,1.69297,0,0,0.748956,0.66262};
+
+class OutdoorPvPEP;
+
+class OutdoorPvPObjectiveEP_EWT : public OutdoorPvPObjective
+{
+friend class OutdoorPvPEP;
+public:
+    OutdoorPvPObjectiveEP_EWT(OutdoorPvP * pvp);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket & data);
+    // used when player is activated/inactivated in the area
+    bool HandlePlayerEnter(Player * plr);
+    void HandlePlayerLeave(Player * plr);
+protected:
+    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
+    void SummonSupportUnitAtNorthpassTower(uint32 team);
+    void UpdateTowerState();
+protected:
+    uint32 m_TowerState;
+    uint32 m_UnitsSummonedSide;
+};
+
+class OutdoorPvPObjectiveEP_NPT : public OutdoorPvPObjective
+{
+friend class OutdoorPvPEP;
+public:
+    OutdoorPvPObjectiveEP_NPT(OutdoorPvP * pvp);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket & data);
+    // used when player is activated/inactivated in the area
+    bool HandlePlayerEnter(Player * plr);
+    void HandlePlayerLeave(Player * plr);
+protected:
+    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
+    void SummonGO(uint32 team);
+    void UpdateTowerState();
+protected:
+    uint32 m_TowerState;
+    uint32 m_SummonedGOSide;
+};
+
+class OutdoorPvPObjectiveEP_CGT : public OutdoorPvPObjective
+{
+friend class OutdoorPvPEP;
+public:
+    OutdoorPvPObjectiveEP_CGT(OutdoorPvP * pvp);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket & data);
+    // used when player is activated/inactivated in the area
+    bool HandlePlayerEnter(Player * plr);
+    void HandlePlayerLeave(Player * plr);
+protected:
+    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
+    void LinkGraveYard(uint32 team);
+    void UpdateTowerState();
+protected:
+    uint32 m_TowerState;
+    uint32 m_GraveyardSide;
+};
+
+class OutdoorPvPObjectiveEP_PWT : public OutdoorPvPObjective
+{
+friend class OutdoorPvPEP;
+public:
+    OutdoorPvPObjectiveEP_PWT(OutdoorPvP * pvp);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket & data);
+    // used when player is activated/inactivated in the area
+    bool HandlePlayerEnter(Player * plr);
+    void HandlePlayerLeave(Player * plr);
+    bool HandleGossipOption(Player *plr, uint64 guid, uint32 gossipid);
+    bool CanTalkTo(Player * plr, Creature * c, GossipOption &gso);
+protected:
+    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
+    void SummonFlightMaster(uint32 team);
+    void UpdateTowerState();
+protected:
+    uint32 m_FlightMasterSpawned;
+    uint32 m_TowerState;
+};
+
+class OutdoorPvPEP : public OutdoorPvP
+{
+friend class OutdoorPvPObjectiveEP_EWT;
+friend class OutdoorPvPObjectiveEP_NPT;
+friend class OutdoorPvPObjectiveEP_PWT;
+friend class OutdoorPvPObjectiveEP_CGT;
+public:
+    OutdoorPvPEP();
+    bool SetupOutdoorPvP();
+    void HandlePlayerEnterZone(Player *plr, uint32 zone);
+    void HandlePlayerLeaveZone(Player *plr, uint32 zone);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket &data);
+    void SendRemoveWorldStates(Player * plr);
+    void BuffTeams();
+private:
+    // how many towers are controlled
+    uint32 EP_Controls[EP_TOWER_NUM];
+    uint32 m_AllianceTowersControlled;
+    uint32 m_HordeTowersControlled;
+};
+
+#endif
Index: trunk/src/game/Unit.cpp
===================================================================
--- trunk/src/game/Unit.cpp (revision 37)
+++ trunk/src/game/Unit.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -40,4 +42,5 @@
 #include "Totem.h"
 #include "BattleGround.h"
+#include "OutdoorPvP.h"
 #include "InstanceSaveMgr.h"
 #include "GridNotifiersImpl.h"
@@ -634,4 +637,22 @@
         if(!spiritOfRedemtionTalentReady)
             pVictim->setDeathState(JUST_DIED);
+
+        // outdoor pvp things, do these after setting the death state, else the player activity notify won't work... doh...
+        // handle player kill only if not suicide (spirit of redemption for example)
+        if(GetTypeId() == TYPEID_PLAYER && this != pVictim)
+        {
+            if(OutdoorPvP * pvp = ((Player*)this)->GetOutdoorPvP())
+            {
+                pvp->HandleKill((Player*)this,pVictim);
+            }
+        }
+
+        if(pVictim->GetTypeId() == TYPEID_PLAYER)
+        {
+            if(OutdoorPvP * pvp = ((Player*)pVictim)->GetOutdoorPvP())
+            {
+                pvp->HandlePlayerActivityChanged((Player*)pVictim);
+            }
+        }
 
         DEBUG_LOG("DealDamageHealth1");
@@ -10568,5 +10589,5 @@
 Unit* Unit::SelectNearbyTarget() const
 {
-    CellPair p(MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()));
+    CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
     Cell cell(p);
     cell.data.Part.reserved = ALL_DISTRICT;
@@ -10576,9 +10597,9 @@
 
     {
-        MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, ATTACK_DISTANCE);
-        MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
-
-        TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
-        TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);
+        Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, ATTACK_DISTANCE);
+        Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
+
+        TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
+        TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);
 
         CellLock<GridReadGuard> cell_lock(cell, p);
Index: trunk/src/game/PointMovementGenerator.h
===================================================================
--- trunk/src/game/PointMovementGenerator.h (revision 2)
+++ trunk/src/game/PointMovementGenerator.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_POINTMOVEMENTGENERATOR_H
-#define MANGOS_POINTMOVEMENTGENERATOR_H
+#ifndef TRINITY_POINTMOVEMENTGENERATOR_H
+#define TRINITY_POINTMOVEMENTGENERATOR_H
 
 #include "MovementGenerator.h"
@@ -26,5 +28,5 @@
 
 template<class T>
-class MANGOS_DLL_SPEC PointMovementGenerator
+class TRINITY_DLL_SPEC PointMovementGenerator
 : public MovementGeneratorMedium< T, PointMovementGenerator<T> >
 {
Index: trunk/src/game/SocialMgr.cpp
===================================================================
--- trunk/src/game/SocialMgr.cpp (revision 37)
+++ trunk/src/game/SocialMgr.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/SpellAuras.h
===================================================================
--- trunk/src/game/SpellAuras.h (revision 15)
+++ trunk/src/game/SpellAuras.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,13 +11,13 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
-#ifndef MANGOS_SPELLAURAS_H
-#define MANGOS_SPELLAURAS_H
+#ifndef TRINITY_SPELLAURAS_H
+#define TRINITY_SPELLAURAS_H
 
 #include "SpellAuraDefines.h"
@@ -56,9 +58,9 @@
 // Second rule: Code must be guarded by if(Real) check if it modifies object state (start/stop attack, send packets to client, etc)
 //
-// Other case choice: each code line moved under if(Real) check is mangos speedup,
-//      each setting object update field code line moved under if(Real) check is significant mangos speedup, and less server->client data sends
-//      each packet sending code moved under if(Real) check is _large_ mangos speedup, and lot less server->client data sends
-
-class MANGOS_DLL_SPEC Aura
+// Other case choice: each code line moved under if(Real) check is Trinity speedup,
+//      each setting object update field code line moved under if(Real) check is significant Trinity speedup, and less server->client data sends
+//      each packet sending code moved under if(Real) check is _large_ Trinity speedup, and lot less server->client data sends
+
+class TRINITY_DLL_SPEC Aura
 {
     friend Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem);
@@ -341,5 +343,5 @@
 };
 
-class MANGOS_DLL_SPEC AreaAura : public Aura
+class TRINITY_DLL_SPEC AreaAura : public Aura
 {
     public:
@@ -352,5 +354,5 @@
 };
 
-class MANGOS_DLL_SPEC PersistentAreaAura : public Aura
+class TRINITY_DLL_SPEC PersistentAreaAura : public Aura
 {
     public:
@@ -360,5 +362,5 @@
 };
 
-class MANGOS_DLL_SPEC SingleEnemyTargetAura : public Aura
+class TRINITY_DLL_SPEC SingleEnemyTargetAura : public Aura
 {
     friend Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem);
Index: trunk/src/game/ObjectMgr.h
===================================================================
--- trunk/src/game/ObjectMgr.h (revision 37)
+++ trunk/src/game/ObjectMgr.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -126,5 +128,5 @@
 typedef HM_NAMESPACE::hash_map<uint64/*(instance,guid) pair*/,time_t> RespawnTimes;
 
-struct MangosStringLocale
+struct TrinityStringLocale
 {
     std::vector<std::string> Content;                       // 0 -> default, i -> i-1 locale index
@@ -139,5 +141,5 @@
 typedef HM_NAMESPACE::hash_map<uint32,NpcTextLocale> NpcTextLocaleMap;
 typedef HM_NAMESPACE::hash_map<uint32,PageTextLocale> PageTextLocaleMap;
-typedef HM_NAMESPACE::hash_map<uint32,MangosStringLocale> MangosStringLocaleMap;
+typedef HM_NAMESPACE::hash_map<uint32,TrinityStringLocale> TrinityStringLocaleMap;
 
 typedef std::multimap<uint32,uint32> QuestRelations;
@@ -249,5 +251,5 @@
 bool normalizePlayerName(std::string& name);
 
-struct MANGOS_DLL_SPEC LanguageDesc
+struct TRINITY_DLL_SPEC LanguageDesc
 {
     Language lang_id;
@@ -257,5 +259,5 @@
 
 extern LanguageDesc lang_description[LANGUAGES_COUNT];
-MANGOS_DLL_SPEC LanguageDesc const* GetLanguageDescByID(uint32 lang);
+TRINITY_DLL_SPEC LanguageDesc const* GetLanguageDescByID(uint32 lang);
 
 class PlayerDumpReader;
@@ -442,4 +444,5 @@
         WorldSafeLocsEntry const *GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team);
         bool AddGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = true);
+        void RemoveGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = false);
         void LoadGraveyardZones();
         GraveYardData const* FindGraveYardData(uint32 id, uint32 zone);
@@ -500,6 +503,6 @@
         void LoadSpellScripts();
 
-        bool LoadMangosStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value);
-        bool LoadMangosStrings() { return LoadMangosStrings(WorldDatabase,"mangos_string",1,std::numeric_limits<int32>::max()); }
+        bool LoadTrinityStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value);
+        bool LoadTrinityStrings() { return LoadTrinityStrings(WorldDatabase,"trinity_string",1,std::numeric_limits<int32>::max()); }
         void LoadPetCreateSpells();
         void LoadCreatureLocales();
@@ -651,12 +654,12 @@
         void DeleteGOData(uint32 guid);
 
-        MangosStringLocale const* GetMangosStringLocale(int32 entry) const
-        {
-            MangosStringLocaleMap::const_iterator itr = mMangosStringLocaleMap.find(entry);
-            if(itr==mMangosStringLocaleMap.end()) return NULL;
-            return &itr->second;
-        }
-        const char *GetMangosString(int32 entry, int locale_idx) const;
-        const char *GetMangosStringForDBCLocale(int32 entry) const { return GetMangosString(entry,DBCLocaleIndex); }
+        TrinityStringLocale const* GetTrinityStringLocale(int32 entry) const
+        {
+            TrinityStringLocaleMap::const_iterator itr = mTrinityStringLocaleMap.find(entry);
+            if(itr==mTrinityStringLocaleMap.end()) return NULL;
+            return &itr->second;
+        }
+        const char *GetTrinityString(int32 entry, int locale_idx) const;
+        const char *GetTrinityStringForDBCLocale(int32 entry) const { return GetTrinityString(entry,DBCLocaleIndex); }
         void SetDBCLocaleIndex(uint32 lang) { DBCLocaleIndex = GetIndexForLocale(LocaleConstant(lang)); }
 
@@ -741,7 +744,7 @@
             return &iter->second;
         }
-        void AddVendorItem(uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost);
-        bool RemoveVendorItem(uint32 entry,uint32 item);
-        bool IsVendorItemValid( uint32 vendor_entry, uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set<uint32>* skip_vendors = NULL ) const;
+        void AddVendorItem(uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true);
+        bool RemoveVendorItem(uint32 entry,uint32 item, bool savetodb = true);
+        bool IsVendorItemValid( uint32 vendor_entry, uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0) const;
     protected:
         uint32 m_auctionid;
@@ -841,5 +844,5 @@
         NpcTextLocaleMap mNpcTextLocaleMap;
         PageTextLocaleMap mPageTextLocaleMap;
-        MangosStringLocaleMap mMangosStringLocaleMap;
+        TrinityStringLocaleMap mTrinityStringLocaleMap;
         RespawnTimes mCreatureRespawnTimes;
         RespawnTimes mGORespawnTimes;
@@ -857,9 +860,9 @@
 };
 
-#define objmgr MaNGOS::Singleton<ObjectMgr>::Instance()
+#define objmgr Trinity::Singleton<ObjectMgr>::Instance()
 
 // scripting access functions
-bool MANGOS_DLL_SPEC LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value = -1, int32 end_value = std::numeric_limits<int32>::min());
-MANGOS_DLL_SPEC const char* GetAreaTriggerScriptNameById(uint32 id);
+bool TRINITY_DLL_SPEC LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value = -1, int32 end_value = std::numeric_limits<int32>::min());
+TRINITY_DLL_SPEC const char* GetAreaTriggerScriptNameById(uint32 id);
 
 #endif
Index: trunk/src/game/UpdateData.h
===================================================================
--- trunk/src/game/UpdateData.h (revision 2)
+++ trunk/src/game/UpdateData.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/ChannelMgr.h
===================================================================
--- trunk/src/game/ChannelMgr.h (revision 2)
+++ trunk/src/game/ChannelMgr.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,13 +11,13 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
-#ifndef MANGOSSERVER_CHANNELMGR_H
-#define MANGOSSERVER_CHANNELMGR_H
+#ifndef TRINITYCORE_CHANNELMGR_H
+#define TRINITYCORE_CHANNELMGR_H
 
 #include "Channel.h"
@@ -91,10 +93,10 @@
     if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
                                                             //For Test,No Seprate Faction
-        return &MaNGOS::Singleton<AllianceChannelMgr>::Instance();
+        return &Trinity::Singleton<AllianceChannelMgr>::Instance();
 
     if(team==ALLIANCE)
-        return &MaNGOS::Singleton<AllianceChannelMgr>::Instance();
+        return &Trinity::Singleton<AllianceChannelMgr>::Instance();
     if(team==HORDE)
-        return &MaNGOS::Singleton<HordeChannelMgr>::Instance();
+        return &Trinity::Singleton<HordeChannelMgr>::Instance();
     return NULL;
 }
Index: trunk/src/game/Spell.h
===================================================================
--- trunk/src/game/Spell.h (revision 37)
+++ trunk/src/game/Spell.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -79,5 +81,5 @@
 bool IsQuestTameSpell(uint32 spellId);
 
-namespace MaNGOS
+namespace Trinity
 {
     struct SpellNotifierPlayer;
@@ -185,6 +187,6 @@
 class Spell
 {
-    friend struct MaNGOS::SpellNotifierPlayer;
-    friend struct MaNGOS::SpellNotifierCreatureAndPlayer;
+    friend struct Trinity::SpellNotifierPlayer;
+    friend struct Trinity::SpellNotifierCreatureAndPlayer;
     public:
 
@@ -534,7 +536,7 @@
 };
 
-namespace MaNGOS
-{
-    struct MANGOS_DLL_DECL SpellNotifierPlayer
+namespace Trinity
+{
+    struct TRINITY_DLL_DECL SpellNotifierPlayer
     {
         std::list<Unit*> &i_data;
@@ -571,5 +573,5 @@
     };
 
-    struct MANGOS_DLL_DECL SpellNotifierCreatureAndPlayer
+    struct TRINITY_DLL_DECL SpellNotifierCreatureAndPlayer
     {
         std::list<Unit*> *i_data;
Index: trunk/src/game/GlobalEvents.cpp
===================================================================
--- trunk/src/game/GlobalEvents.cpp (revision 2)
+++ trunk/src/game/GlobalEvents.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/OutdoorPvP.h
===================================================================
--- trunk/src/game/OutdoorPvP.h (revision 44)
+++ trunk/src/game/OutdoorPvP.h (revision 44)
@@ -0,0 +1,211 @@
+#ifndef OUTDOOR_PVP_H_
+#define OUTDOOR_PVP_H_
+
+#include "Util.h"
+
+#include <map>
+#include <set>
+
+#define OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL 1000
+
+#define OPVP_TRIGGER_CREATURE_ENTRY 12999
+
+enum ObjectiveStates{
+    OBJECTIVESTATE_NEUTRAL = 0,
+    OBJECTIVESTATE_ALLIANCE = 1,
+    OBJECTIVESTATE_HORDE = 2,
+    OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE = 3,
+    OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE = 4,
+    OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE = 5,
+    OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE = 6
+};
+
+enum OutdoorPvPTypes{
+    OUTDOOR_PVP_HP = 1,
+    OUTDOOR_PVP_NA = 2,
+    OUTDOOR_PVP_TF = 3,
+    OUTDOOR_PVP_ZM = 4,
+    OUTDOOR_PVP_SI = 5,
+    OUTDOOR_PVP_EP = 6
+};
+
+// struct for go spawning
+struct go_type{
+    uint32 entry;
+    uint32 map;
+    float x;
+    float y;
+    float z;
+    float o;
+    float rot0;
+    float rot1;
+    float rot2;
+    float rot3;
+};
+
+// struct for creature spawning
+struct creature_type{
+    uint32 entry;
+    uint32 teamval;
+    uint32 map;
+    float x;
+    float y;
+    float z;
+    float o;
+};
+
+// some class predefs
+class Player;
+class GameObject;
+class WorldPacket;
+class Creature;
+class Unit;
+struct GossipOption;
+
+class OutdoorPvP;
+class OutdoorPvPObjective
+{
+public:
+    OutdoorPvPObjective(OutdoorPvP * pvp);
+
+    virtual void FillInitialWorldStates(WorldPacket & data) {}
+
+    // send world state update to all players present
+    virtual void SendUpdateWorldState(uint32 field, uint32 value);
+    // send kill notify to players in the controlling faction
+    virtual void SendObjectiveComplete(uint32 id, uint64 guid);
+
+    // used when player is activated/inactivated in the area
+    virtual bool HandlePlayerEnter(Player * plr);
+    virtual void HandlePlayerLeave(Player * plr);
+    virtual void HandlePlayerActivityChanged(Player * plr);
+
+    // checks if player is in range of a capture credit marker
+    virtual bool IsInsideObjective(Player * plr);
+
+    virtual bool HandleCustomSpell(Player *plr, uint32 spellId, GameObject * go);
+    virtual int32 HandleOpenGo(Player *plr, uint64 guid);
+
+    // returns true if the state of the objective has changed, in this case, the OutdoorPvP must send a world state ui update.
+    virtual bool Update(uint32 diff);
+
+    virtual bool HandleCapturePointEvent(Player * plr, uint32 eventId) { return false; }
+
+    virtual bool HandleCaptureCreaturePlayerMoveInLos(Player * p, Creature * c);
+
+    virtual bool HandleGossipOption(Player *plr, uint64 guid, uint32 gossipid);
+
+    virtual bool CanTalkTo(Player * plr, Creature * c, GossipOption &gso);
+
+    virtual bool HandleDropFlag(Player * plr, uint32 spellId);
+
+    virtual void DeleteSpawns();
+protected:
+
+    virtual bool AddCapturePoint(uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3);
+    virtual bool AddObject(uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3);
+    virtual bool AddCreature(uint32 type, uint32 entry, uint32 teamval, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0);
+
+    virtual bool DelCreature(uint32 type);
+    virtual bool DelObject(uint32 type);
+    virtual bool DelCapturePoint();
+
+protected:
+    // active players in the area of the objective
+    std::set<uint64> m_ActivePlayerGuids;
+    int32 m_AllianceActivePlayerCount;
+    int32 m_HordeActivePlayerCount;
+    // time left to capture the objective
+    uint32 m_ShiftTimer;
+    // total shift needed to capture the objective
+    float m_ShiftMaxPhase;
+    // maximum speed of capture
+    float m_ShiftMaxCaptureSpeed;
+    // the status of the objective
+    float m_ShiftPhase;
+    // phase before update, used to check which faction is in conquer / control
+    float m_OldPhase;
+    // objective states
+    uint32 m_OldState;
+    uint32 m_State;
+    // neutral value on capture bar
+    uint32 m_NeutralValue;
+
+    // pointer to the OutdoorPvP this objective belongs to
+    OutdoorPvP* m_PvP;
+
+    // map to store the various gameobjects and creatures spawned by the objective
+    //        type , guid
+    std::map<uint32,uint64> m_Objects;
+    std::map<uint32,uint64> m_Creatures;
+    std::map<uint64,uint32> m_ObjectTypes;
+    std::map<uint64,uint32> m_CreatureTypes;
+    uint64 m_CapturePoint;
+    uint64 m_CapturePointCreature;
+};
+
+// base class for specific outdoor pvp handlers
+class OutdoorPvP
+{
+public:
+    // ctor
+    OutdoorPvP();
+    // dtor
+    ~OutdoorPvP();
+    // deletes all gos/creatures spawned by the pvp
+    void DeleteSpawns();
+
+    typedef std::set<OutdoorPvPObjective *> OutdoorPvPObjectiveSet;
+
+    // called from Player::UpdateZone to add / remove buffs given by outdoor pvp events
+    virtual void HandlePlayerEnterZone(Player * plr, uint32 zone);
+    virtual void HandlePlayerLeaveZone(Player * plr, uint32 zone);
+    virtual void HandlePlayerActivityChanged(Player * plr);
+    // called when a player triggers an areatrigger
+    virtual bool HandleAreaTrigger(Player * plr, uint32 trigger);
+    // called on custom spell
+    virtual bool HandleCustomSpell(Player *plr, uint32 spellId, GameObject * go);
+    // called on go use
+    virtual bool HandleOpenGo(Player *plr, uint64 guid);
+    // called from moveinlineofsight
+    virtual bool HandleCaptureCreaturePlayerMoveInLos(Player * p, Creature * c);
+
+    // setup stuff
+    virtual bool SetupOutdoorPvP() {return true;}
+
+    // world state stuff
+    virtual void SendRemoveWorldStates(Player * plr) {}
+    virtual void FillInitialWorldStates(WorldPacket & data) {}
+
+    // send world state update to all players present
+    virtual void SendUpdateWorldState(uint32 field, uint32 value);
+
+    // called by OutdoorPvPMgr, updates the objectives and if needed, sends new worldstateui information
+    virtual bool Update(uint32 diff);
+
+    // handle npc/player kill
+    virtual void HandleKill(Player * killer, Unit * killed);
+    virtual void HandleKillImpl(Player * killer, Unit * killed) {}
+
+    // checks if player is in range of a capture credit marker
+    virtual bool IsInsideObjective(Player * plr);
+
+    // awards rewards for player kill
+    virtual void AwardKillBonus(Player * plr) {}
+
+    uint32 GetTypeId() {return m_TypeId;}
+
+    virtual bool HandleDropFlag(Player * plr, uint32 spellId);
+
+    virtual bool HandleGossipOption(Player *plr, uint64 guid, uint32 gossipid);
+
+    virtual bool CanTalkTo(Player * plr, Creature * c, GossipOption &gso);
+protected:
+    // the map of the objectives belonging to this outdoorpvp
+    OutdoorPvPObjectiveSet m_OutdoorPvPObjectives;
+    // players in the zones of this outdoorpvp, 0 - alliance, 1 - horde
+    std::set<uint64> m_PlayerGuids[2];
+    uint32 m_TypeId;
+};
+
+#endif /*OUTDOOR_PVP_H_*/
Index: trunk/src/game/TemporarySummon.h
===================================================================
--- trunk/src/game/TemporarySummon.h (revision 2)
+++ trunk/src/game/TemporarySummon.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_TEMPSUMMON_H
-#define MANGOSSERVER_TEMPSUMMON_H
+#ifndef TRINITYCORE_TEMPSUMMON_H
+#define TRINITYCORE_TEMPSUMMON_H
 
 #include "Creature.h"
Index: trunk/src/game/Level0.cpp
===================================================================
--- trunk/src/game/Level0.cpp (revision 2)
+++ trunk/src/game/Level0.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/DuelHandler.cpp
===================================================================
--- trunk/src/game/DuelHandler.cpp (revision 2)
+++ trunk/src/game/DuelHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/World.cpp
===================================================================
--- trunk/src/game/World.cpp (revision 42)
+++ trunk/src/game/World.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -46,4 +48,5 @@
 #include "Policies/SingletonImp.h"
 #include "BattleGroundMgr.h"
+#include "OutdoorPvPMgr.h"
 #include "TemporarySummon.h"
 #include "WaypointMovementGenerator.h"
@@ -57,5 +60,4 @@
 #include "WaypointManager.h"
 #include "Util.h"
-#include "IRCClient.h"
 #include "Language.h"
 
@@ -65,5 +67,4 @@
 volatile uint32 World::m_worldLoopCounter = 0;
 
-float World::m_PlayerStartGold = 0; // starting gold
 float World::m_MaxVisibleDistanceForCreature  = DEFAULT_VISIBILITY_DISTANCE;
 float World::m_MaxVisibleDistanceForPlayer    = DEFAULT_VISIBILITY_DISTANCE;
@@ -524,5 +525,5 @@
         uint32 val = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT);
         if(val!=m_configs[CONFIG_PORT_WORLD])
-            sLog.outError("WorldServerPort option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_PORT_WORLD]);
+            sLog.outError("WorldServerPort option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_PORT_WORLD]);
     }
     else
@@ -533,5 +534,5 @@
         uint32 val = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME);
         if(val!=m_configs[CONFIG_SOCKET_SELECTTIME])
-            sLog.outError("SocketSelectTime option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[DEFAULT_SOCKET_SELECT_TIME]);
+            sLog.outError("SocketSelectTime option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[DEFAULT_SOCKET_SELECT_TIME]);
     }
     else
@@ -541,5 +542,5 @@
     m_configs[CONFIG_TCP_NO_DELAY] = sConfig.GetBoolDefault("TcpNoDelay", false);
     m_configs[CONFIG_GROUP_XP_DISTANCE] = sConfig.GetIntDefault("MaxGroupXPDistance", 74);
-    /// \todo Add MonsterSight and GuarderSight (with meaning) in mangosd.conf or put them as define
+    /// \todo Add MonsterSight and GuarderSight (with meaning) in Trinityd.conf or put them as define
     m_configs[CONFIG_SIGHT_MONSTER] = sConfig.GetIntDefault("MonsterSight", 50);
     m_configs[CONFIG_SIGHT_GUARDER] = sConfig.GetIntDefault("GuarderSight", 50);
@@ -549,5 +550,5 @@
         uint32 val = sConfig.GetIntDefault("GameType", 0);
         if(val!=m_configs[CONFIG_GAME_TYPE])
-            sLog.outError("GameType option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_GAME_TYPE]);
+            sLog.outError("GameType option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_GAME_TYPE]);
     }
     else
@@ -558,5 +559,5 @@
         uint32 val = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT);
         if(val!=m_configs[CONFIG_REALM_ZONE])
-            sLog.outError("RealmZone option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_REALM_ZONE]);
+            sLog.outError("RealmZone option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_REALM_ZONE]);
     }
     else
@@ -725,5 +726,5 @@
         uint32 val = sConfig.GetIntDefault("Expansion",1);
         if(val!=m_configs[CONFIG_EXPANSION])
-            sLog.outError("Expansion option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]);
+            sLog.outError("Expansion option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]);
     }
     else
@@ -774,45 +775,41 @@
     m_configs[CONFIG_LISTEN_RANGE_YELL]      = sConfig.GetIntDefault("ListenRange.Yell", 300);
 
-	m_PlayerStartGold = sConfig.GetFloatDefault("PlayerStart.Gold", 0);
-	if(m_PlayerStartGold < 0)
-		m_PlayerStartGold = 0;
-
-	if(m_PlayerStartGold > MAX_MONEY_AMOUNT)
-		m_PlayerStartGold = MAX_MONEY_AMOUNT;
-
-	m_configs[CONFIG_PLAYER_START_HONOR] = sConfig.GetIntDefault("PlayerStart.HonorPoints", 0);
-	if(m_configs[CONFIG_PLAYER_START_HONOR] < 0)
-		m_configs[CONFIG_PLAYER_START_HONOR] = 0;
-
-	m_configs[CONFIG_PLAYER_START_ARENAPTS] = sConfig.GetIntDefault("PlayerStart.ArenaPoints", 0);
-	if(m_configs[CONFIG_PLAYER_START_ARENAPTS] < 0)
-		m_configs[CONFIG_PLAYER_START_ARENAPTS] = 0;
-
-	m_configs[CONFIG_GM_START_LEVEL] = sConfig.GetIntDefault("GamemasterStartLevel", 70);
-	if(m_configs[CONFIG_GM_START_LEVEL] < 1)
-		m_configs[CONFIG_GM_START_LEVEL] = 1;
-
-	m_configs[CONFIG_INSTANT_LOGOUT] = sConfig.GetBoolDefault("PlayerInstantLogout", false);
-	m_configs[CONFIG_BG_START_MUSIC] = sConfig.GetBoolDefault("MusicInBattleground", false);
-	m_configs[CONFIG_START_ALL_SPELLS] = sConfig.GetBoolDefault("PlayerStart.AllSpells", false);
-	// Leaving GM queue option out for now, it's not 100% functional with the ACE patch
-	//m_configs[CONFIG_QUEUE_FOR_GM] = sConfig.GetBoolDefault("EnableQueueForGMs", false);
-	m_configs[CONFIG_HONOR_AFTER_DUEL] = sConfig.GetIntDefault("HonorPointsAfterDuel", 0);
-	if(m_configs[CONFIG_HONOR_AFTER_DUEL] < 0)
-		m_configs[CONFIG_HONOR_AFTER_DUEL]= 0;
-	m_configs[CONFIG_KICK_FROM_GMISLAND] = sConfig.GetBoolDefault("AntiCheat.GMIsland", false);
-	m_configs[CONFIG_START_ALL_EXPLORED] = sConfig.GetBoolDefault("PlayerStart.MapsExplored", false);
-	m_configs[CONFIG_DISABLE_BREATHING] = sConfig.GetBoolDefault("DisableWaterBreath", false);
-	m_configs[CONFIG_DISABLE_RES_SICKNESS] = sConfig.GetBoolDefault("DisableResurrectSickness", false);
-	m_configs[CONFIG_START_ALL_REP] = sConfig.GetBoolDefault("PlayerStart.AllReputation", false);
-	m_configs[CONFIG_ALWAYS_MAXSKILL] = sConfig.GetBoolDefault("AlwaysMaxWeaponSkill", false);
-	m_configs[CONFIG_START_ALL_TAXI] = sConfig.GetBoolDefault("PlayerStart.AllFlightPaths", false);
-	m_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfig.GetBoolDefault("PvPToken.Enable", false);
-	m_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfig.GetIntDefault("PvPToken.MapAllowType", 4);
-	m_configs[CONFIG_PVP_TOKEN_ID] = sConfig.GetIntDefault("PvPToken.ItemID", 29434);
-	m_configs[CONFIG_PVP_TOKEN_COUNT] = sConfig.GetIntDefault("PvPToken.ItemCount", 1);
-	if(m_configs[CONFIG_PVP_TOKEN_COUNT] < 1)
-		m_configs[CONFIG_PVP_TOKEN_COUNT] = 1;
-	m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false);
+    m_configs[CONFIG_PLAYER_START_GOLD] = sConfig.GetFloatDefault("PlayerStart.Gold", 0);
+    if(m_configs[CONFIG_PLAYER_START_GOLD] < 0)
+        m_configs[CONFIG_PLAYER_START_GOLD] = 0;
+
+    if(m_configs[CONFIG_PLAYER_START_GOLD] > MAX_MONEY_AMOUNT)
+        m_configs[CONFIG_PLAYER_START_GOLD] = MAX_MONEY_AMOUNT;
+
+    m_configs[CONFIG_PLAYER_START_HONOR] = sConfig.GetIntDefault("PlayerStart.HonorPoints", 0);
+    if(m_configs[CONFIG_PLAYER_START_HONOR] < 0)
+        m_configs[CONFIG_PLAYER_START_HONOR] = 0;
+
+    m_configs[CONFIG_PLAYER_START_ARENAPTS] = sConfig.GetIntDefault("PlayerStart.ArenaPoints", 0);
+    if(m_configs[CONFIG_PLAYER_START_ARENAPTS] < 0)
+        m_configs[CONFIG_PLAYER_START_ARENAPTS] = 0;
+
+    m_configs[CONFIG_GM_START_LEVEL] = sConfig.GetIntDefault("GamemasterStartLevel", 70);
+    if(m_configs[CONFIG_GM_START_LEVEL] < 1)
+        m_configs[CONFIG_GM_START_LEVEL] = 1;
+
+    m_configs[CONFIG_INSTANT_LOGOUT] = sConfig.GetBoolDefault("PlayerInstantLogout", false);
+    m_configs[CONFIG_BG_START_MUSIC] = sConfig.GetBoolDefault("MusicInBattleground", false);
+    m_configs[CONFIG_START_ALL_SPELLS] = sConfig.GetBoolDefault("PlayerStart.AllSpells", false);
+    m_configs[CONFIG_HONOR_AFTER_DUEL] = sConfig.GetIntDefault("HonorPointsAfterDuel", 0);
+    if(m_configs[CONFIG_HONOR_AFTER_DUEL] < 0)
+        m_configs[CONFIG_HONOR_AFTER_DUEL]= 0;
+    m_configs[CONFIG_START_ALL_EXPLORED] = sConfig.GetBoolDefault("PlayerStart.MapsExplored", false);
+    m_configs[CONFIG_DISABLE_BREATHING] = sConfig.GetBoolDefault("DisableWaterBreath", false);
+    m_configs[CONFIG_START_ALL_REP] = sConfig.GetBoolDefault("PlayerStart.AllReputation", false);
+    m_configs[CONFIG_ALWAYS_MAXSKILL] = sConfig.GetBoolDefault("AlwaysMaxWeaponSkill", false);
+    m_configs[CONFIG_START_ALL_TAXI] = sConfig.GetBoolDefault("PlayerStart.AllFlightPaths", false);
+    m_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfig.GetBoolDefault("PvPToken.Enable", false);
+    m_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfig.GetIntDefault("PvPToken.MapAllowType", 4);
+    m_configs[CONFIG_PVP_TOKEN_ID] = sConfig.GetIntDefault("PvPToken.ItemID", 29434);
+    m_configs[CONFIG_PVP_TOKEN_COUNT] = sConfig.GetIntDefault("PvPToken.ItemCount", 1);
+    if(m_configs[CONFIG_PVP_TOKEN_COUNT] < 1)
+        m_configs[CONFIG_PVP_TOKEN_COUNT] = 1;
+    m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false);
 
     m_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig.GetIntDefault("Arena.MaxRatingDifference", 0);
@@ -884,5 +881,5 @@
     {
         if(dataPath!=m_dataPath)
-            sLog.outError("DataDir option can't be changed at mangosd.conf reload, using current value (%s).",m_dataPath.c_str());
+            sLog.outError("DataDir option can't be changed at Trinityd.conf reload, using current value (%s).",m_dataPath.c_str());
     }
     else
@@ -891,4 +888,18 @@
         sLog.outString("Using DataDir %s",m_dataPath.c_str());
     }
+
+    std::string forbiddenmaps = sConfig.GetStringDefault("ForbiddenMaps", "");
+    char * forbiddenMaps = new char[forbiddenmaps.length() + 1];
+    forbiddenMaps[forbiddenmaps.length()] = 0;
+    strncpy(forbiddenMaps, forbiddenmaps.c_str(), forbiddenmaps.length());
+    const char * delim = ",";
+    char * token = strtok(forbiddenMaps, delim);
+    while(token != NULL)
+    {
+        int32 mapid = strtol(token, NULL, 10);
+        m_forbiddenMapIds.insert(mapid);
+        token = strtok(NULL,delim);
+    }
+    delete[] forbiddenMaps;
 
     bool enableLOS = sConfig.GetBoolDefault("vmap.enableLOS", false);
@@ -928,5 +939,5 @@
         !MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f) ) )
     {
-        sLog.outError("Correct *.map files not found in path '%smaps' or *.vmap/*vmdir files in '%svmaps'. Please place *.map/*.vmap/*.vmdir files in appropriate directories or correct the DataDir value in the mangosd.conf file.",m_dataPath.c_str(),m_dataPath.c_str());
+        sLog.outError("Correct *.map files not found in path '%smaps' or *.vmap/*vmdir files in '%svmaps'. Please place *.map/*.vmap/*.vmdir files in appropriate directories or correct the DataDir value in the Trinityd.conf file.",m_dataPath.c_str(),m_dataPath.c_str());
         exit(1);
     }
@@ -934,6 +945,6 @@
     ///- Loading strings. Getting no records means core load has to be canceled because no error message can be output.
     sLog.outString( "" );
-    sLog.outString( "Loading MaNGOS strings..." );
-    if (!objmgr.LoadMangosStrings())
+    sLog.outString( "Loading Trinity strings..." );
+    if (!objmgr.LoadTrinityStrings())
         exit(1);                                            // Error message displayed in function already
 
@@ -1181,7 +1192,4 @@
     WorldDatabase.PExecute("INSERT INTO uptime (startstring, starttime, uptime) VALUES('%s', %ld, 0)", isoDate, m_startTime );
 
-    static uint32 autoanc = 1;
-    autoanc = sIRC.autoanc;
-
     m_timers[WUPDATE_OBJECTS].SetInterval(0);
     m_timers[WUPDATE_SESSIONS].SetInterval(0);
@@ -1192,6 +1200,4 @@
     m_timers[WUPDATE_CORPSES].SetInterval(20*MINUTE*1000);  //erase corpses every 20 minutes
 
-    m_timers[WUPDATE_AUTOANC].SetInterval(autoanc*MINUTE*1000);
-
     //to set mailtimer to return mails every day between 4 and 5 am
     //mailtimer is increased when updating auctions
@@ -1215,4 +1221,8 @@
     sBattleGroundMgr.CreateInitialBattleGrounds();
     sBattleGroundMgr.InitAutomaticArenaPointDistribution();
+
+    ///- Initialize outdoor pvp
+    sLog.outString( "Starting Outdoor PvP System" );
+    sOutdoorPvPMgr.InitOutdoorPvP();
 
     //Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager
@@ -1408,4 +1418,6 @@
 
         sBattleGroundMgr.Update(diff);
+
+        sOutdoorPvPMgr.Update(diff);
     }
 
@@ -1430,9 +1442,4 @@
     }
 
-    if (m_timers[WUPDATE_AUTOANC].Passed())
-    {
-        m_timers[WUPDATE_AUTOANC].Reset(); /// </ul>
-        SendRNDBroadcast();
-    }
     MapManager::Instance().DoDelayedMovesAndRemoves(); ///- Move all creatures with "delayed move" and remove and delete all objects with "delayed remove"
 
@@ -1442,4 +1449,12 @@
     // And last, but not least handle the issued cli commands
     ProcessCliCommands();
+}
+
+void World::ForceGameEventUpdate()
+{
+    m_timers[WUPDATE_EVENTS].Reset();                   // to give time for Update() to be processed
+    uint32 nextGameEvent = gameeventmgr.Update();
+    m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
+    m_timers[WUPDATE_EVENTS].Reset();
 }
 
@@ -1783,12 +1798,12 @@
                 int32 time_to_despawn = step.script->datalong2<5 ? 5 : (int32)step.script->datalong2;
 
-                CellPair p(MaNGOS::ComputeCellPair(summoner->GetPositionX(), summoner->GetPositionY()));
+                CellPair p(Trinity::ComputeCellPair(summoner->GetPositionX(), summoner->GetPositionY()));
                 Cell cell(p);
                 cell.data.Part.reserved = ALL_DISTRICT;
 
-                MaNGOS::GameObjectWithDbGUIDCheck go_check(*summoner,step.script->datalong);
-                MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(go,go_check);
-
-                TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
+                Trinity::GameObjectWithDbGUIDCheck go_check(*summoner,step.script->datalong);
+                Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(go,go_check);
+
+                TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
                 CellLock<GridReadGuard> cell_lock(cell, p);
                 cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(summoner->GetMapId(), summoner));
@@ -1844,12 +1859,12 @@
                 int32 time_to_close = step.script->datalong2 < 15 ? 15 : (int32)step.script->datalong2;
 
-                CellPair p(MaNGOS::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY()));
+                CellPair p(Trinity::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY()));
                 Cell cell(p);
                 cell.data.Part.reserved = ALL_DISTRICT;
 
-                MaNGOS::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong);
-                MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(door,go_check);
-
-                TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
+                Trinity::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong);
+                Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(door,go_check);
+
+                TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
                 CellLock<GridReadGuard> cell_lock(cell, p);
                 cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(caster->GetMapId(), (Unit*)source));
@@ -1900,12 +1915,12 @@
                 int32 time_to_open = step.script->datalong2 < 15 ? 15 : (int32)step.script->datalong2;
 
-                CellPair p(MaNGOS::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY()));
+                CellPair p(Trinity::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY()));
                 Cell cell(p);
                 cell.data.Part.reserved = ALL_DISTRICT;
 
-                MaNGOS::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong);
-                MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(door,go_check);
-
-                TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
+                Trinity::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong);
+                Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(door,go_check);
+
+                TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
                 CellLock<GridReadGuard> cell_lock(cell, p);
                 cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(caster->GetMapId(), (Unit*)source));
@@ -2131,5 +2146,5 @@
             data_list = &data_cache[cache_idx];
 
-            char const* text = objmgr.GetMangosString(string_id,loc_idx);
+            char const* text = objmgr.GetTrinityString(string_id,loc_idx);
 
             char buf[1000];
@@ -2510,20 +2525,4 @@
 }
 
-void World::SendRNDBroadcast()
-{
-    std::string msg;
-    QueryResult *result = WorldDatabase.PQuery("SELECT `message` FROM `IRC_AutoAnnounce` ORDER BY RAND() LIMIT 1");
-    if(!result)
-        return;
-    msg = result->Fetch()[0].GetString();
-    delete result;
-    std::string str = "|cffff0000[Automatic]:|r";
-    str += msg;
-    sWorld.SendWorldText(LANG_AUTO_ANN);
-    std::string ircchan = "#";
-    ircchan += sIRC._irc_chan[sIRC.anchn].c_str();
-    sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 Automatic System Message \00304,08\037/!\\\037\017 %s", "%s", msg.c_str()), true);
-}
-
 void World::InitResultQueue()
 {
Index: trunk/src/game/LootMgr.h
===================================================================
--- trunk/src/game/LootMgr.h (revision 2)
+++ trunk/src/game/LootMgr.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_LOOTMGR_H
-#define MANGOS_LOOTMGR_H
+#ifndef TRINITY_LOOTMGR_H
+#define TRINITY_LOOTMGR_H
 
 #include "ItemEnchantmentMgr.h"
Index: trunk/src/game/BattleGroundHandler.cpp
===================================================================
--- trunk/src/game/BattleGroundHandler.cpp (revision 37)
+++ trunk/src/game/BattleGroundHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -151,5 +153,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_TOO_LARGE), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_TOO_LARGE), NULL);
             SendPacket(&data);
             }
@@ -159,5 +161,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_OFFLINE_MEMBER), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_OFFLINE_MEMBER), NULL);
             SendPacket(&data);
             }
@@ -167,5 +169,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_MIXED_FACTION), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_MIXED_FACTION), NULL);
             SendPacket(&data);
             }
@@ -175,5 +177,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_MIXED_LEVELS), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_MIXED_LEVELS), NULL);
             SendPacket(&data);
             }
@@ -183,5 +185,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE), NULL);
             SendPacket(&data);
             }
@@ -191,5 +193,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_MEMBER_DESERTER), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_MEMBER_DESERTER), NULL);
             SendPacket(&data);
             }
@@ -199,5 +201,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS), NULL);
             SendPacket(&data);
             }
@@ -775,5 +777,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_ARENA_GROUP_TOO_LARGE), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_ARENA_GROUP_TOO_LARGE), NULL);
             SendPacket(&data);
             }
@@ -783,5 +785,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_ARENA_NOT_ENOUGH_PLAYERS), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_ARENA_NOT_ENOUGH_PLAYERS), NULL);
             SendPacket(&data);
             }
@@ -791,5 +793,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_ARENA_YOUR_TEAM_ONLY), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_ARENA_YOUR_TEAM_ONLY), NULL);
             SendPacket(&data);
             }
@@ -799,5 +801,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_OFFLINE_MEMBER), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_OFFLINE_MEMBER), NULL);
             SendPacket(&data);
             }
@@ -807,5 +809,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_MIXED_FACTION), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_MIXED_FACTION), NULL);
             SendPacket(&data);
             }
@@ -815,5 +817,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_MIXED_LEVELS), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_MIXED_LEVELS), NULL);
             SendPacket(&data);
             }
@@ -823,5 +825,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE), NULL);
             SendPacket(&data);
             }
@@ -831,5 +833,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_MEMBER_DESERTER), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_MEMBER_DESERTER), NULL);
             SendPacket(&data);
             }
@@ -839,5 +841,5 @@
             {
             WorldPacket data;
-            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetMangosString(LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS), NULL);
+            ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetTrinityString(LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS), NULL);
             SendPacket(&data);
             }
Index: trunk/src/game/ScriptCalls.h
===================================================================
--- trunk/src/game/ScriptCalls.h (revision 2)
+++ trunk/src/game/ScriptCalls.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -36,26 +38,26 @@
 void UnloadScriptingModule();
 
-typedef void(MANGOS_IMPORT * scriptCallScriptsInit) ();
-typedef void(MANGOS_IMPORT * scriptCallScriptsFree) ();
+typedef void(TRINITY_IMPORT * scriptCallScriptsInit) ();
+typedef void(TRINITY_IMPORT * scriptCallScriptsFree) ();
 
-typedef bool(MANGOS_IMPORT * scriptCallGossipHello) (Player *player, Creature *_Creature );
-typedef bool(MANGOS_IMPORT * scriptCallQuestAccept) (Player *player, Creature *_Creature, Quest const *);
-typedef bool(MANGOS_IMPORT * scriptCallGossipSelect)(Player *player, Creature *_Creature, uint32 sender, uint32 action);
-typedef bool(MANGOS_IMPORT * scriptCallGossipSelectWithCode)( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode );
-typedef bool(MANGOS_IMPORT * scriptCallQuestSelect)( Player *player, Creature *_Creature, Quest const* );
-typedef bool(MANGOS_IMPORT * scriptCallQuestComplete)(Player *player, Creature *_Creature, Quest const*);
-typedef uint32(MANGOS_IMPORT * scriptCallNPCDialogStatus)( Player *player, Creature *_Creature);
-typedef uint32(MANGOS_IMPORT * scriptCallGODialogStatus)( Player *player, GameObject * _GO);
-typedef bool(MANGOS_IMPORT * scriptCallChooseReward)( Player *player, Creature *_Creature, Quest const*, uint32 opt );
-typedef bool(MANGOS_IMPORT * scriptCallItemHello)( Player *player, Item *, Quest const*);
-typedef bool(MANGOS_IMPORT * scriptCallGOHello)( Player *player, GameObject * );
-typedef bool(MANGOS_IMPORT * scriptCallAreaTrigger)( Player *player, AreaTriggerEntry const* );
-typedef bool(MANGOS_IMPORT * scriptCallItemQuestAccept)(Player *player, Item *, Quest const*);
-typedef bool(MANGOS_IMPORT * scriptCallGOQuestAccept)(Player *player, GameObject *, Quest const*);
-typedef bool(MANGOS_IMPORT * scriptCallGOChooseReward)(Player *player, GameObject *, Quest const*, uint32 opt );
-typedef bool(MANGOS_IMPORT * scriptCallReceiveEmote) ( Player *player, Creature *_Creature, uint32 emote );
-typedef bool(MANGOS_IMPORT * scriptCallItemUse) (Player *player, Item *_Item, SpellCastTargets const& targets);
-typedef CreatureAI* (MANGOS_IMPORT * scriptCallGetAI) ( Creature *_Creature );
-typedef InstanceData* (MANGOS_IMPORT * scriptCallCreateInstanceData) (Map *map);
+typedef bool(TRINITY_IMPORT * scriptCallGossipHello) (Player *player, Creature *_Creature );
+typedef bool(TRINITY_IMPORT * scriptCallQuestAccept) (Player *player, Creature *_Creature, Quest const *);
+typedef bool(TRINITY_IMPORT * scriptCallGossipSelect)(Player *player, Creature *_Creature, uint32 sender, uint32 action);
+typedef bool(TRINITY_IMPORT * scriptCallGossipSelectWithCode)( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode );
+typedef bool(TRINITY_IMPORT * scriptCallQuestSelect)( Player *player, Creature *_Creature, Quest const* );
+typedef bool(TRINITY_IMPORT * scriptCallQuestComplete)(Player *player, Creature *_Creature, Quest const*);
+typedef uint32(TRINITY_IMPORT * scriptCallNPCDialogStatus)( Player *player, Creature *_Creature);
+typedef uint32(TRINITY_IMPORT * scriptCallGODialogStatus)( Player *player, GameObject * _GO);
+typedef bool(TRINITY_IMPORT * scriptCallChooseReward)( Player *player, Creature *_Creature, Quest const*, uint32 opt );
+typedef bool(TRINITY_IMPORT * scriptCallItemHello)( Player *player, Item *, Quest const*);
+typedef bool(TRINITY_IMPORT * scriptCallGOHello)( Player *player, GameObject * );
+typedef bool(TRINITY_IMPORT * scriptCallAreaTrigger)( Player *player, AreaTriggerEntry const* );
+typedef bool(TRINITY_IMPORT * scriptCallItemQuestAccept)(Player *player, Item *, Quest const*);
+typedef bool(TRINITY_IMPORT * scriptCallGOQuestAccept)(Player *player, GameObject *, Quest const*);
+typedef bool(TRINITY_IMPORT * scriptCallGOChooseReward)(Player *player, GameObject *, Quest const*, uint32 opt );
+typedef bool(TRINITY_IMPORT * scriptCallReceiveEmote) ( Player *player, Creature *_Creature, uint32 emote );
+typedef bool(TRINITY_IMPORT * scriptCallItemUse) (Player *player, Item *_Item, SpellCastTargets const& targets);
+typedef CreatureAI* (TRINITY_IMPORT * scriptCallGetAI) ( Creature *_Creature );
+typedef InstanceData* (TRINITY_IMPORT * scriptCallCreateInstanceData) (Map *map);
 
 typedef struct
@@ -84,5 +86,5 @@
     scriptCallCreateInstanceData CreateInstanceData;
 
-    MANGOS_LIBRARY_HANDLE hScriptsLib;
+    TRINITY_LIBRARY_HANDLE hScriptsLib;
 }_ScriptSet,*ScriptsSet;
 
Index: trunk/src/game/Level2.cpp
===================================================================
--- trunk/src/game/Level2.cpp (revision 37)
+++ trunk/src/game/Level2.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -617,23 +619,23 @@
                 {
                     ReputationRank rank = target->GetReputationRank(factionEntry);
-                    std::string rankName = GetMangosString(ReputationRankStrIndex[rank]);
+                    std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]);
 
                     ss << " " << rankName << "|h|r (" << target->GetReputation(factionEntry) << ")";
 
                     if(repItr->second.Flags & FACTION_FLAG_VISIBLE)
-                        ss << GetMangosString(LANG_FACTION_VISIBLE);
+                        ss << GetTrinityString(LANG_FACTION_VISIBLE);
                     if(repItr->second.Flags & FACTION_FLAG_AT_WAR)
-                        ss << GetMangosString(LANG_FACTION_ATWAR);
+                        ss << GetTrinityString(LANG_FACTION_ATWAR);
                     if(repItr->second.Flags & FACTION_FLAG_PEACE_FORCED)
-                        ss << GetMangosString(LANG_FACTION_PEACE_FORCED);
+                        ss << GetTrinityString(LANG_FACTION_PEACE_FORCED);
                     if(repItr->second.Flags & FACTION_FLAG_HIDDEN)
-                        ss << GetMangosString(LANG_FACTION_HIDDEN);
+                        ss << GetTrinityString(LANG_FACTION_HIDDEN);
                     if(repItr->second.Flags & FACTION_FLAG_INVISIBLE_FORCED)
-                        ss << GetMangosString(LANG_FACTION_INVISIBLE_FORCED);
+                        ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
                     if(repItr->second.Flags & FACTION_FLAG_INACTIVE)
-                        ss << GetMangosString(LANG_FACTION_INACTIVE);
+                        ss << GetTrinityString(LANG_FACTION_INACTIVE);
                 }
                 else
-                    ss << GetMangosString(LANG_FACTION_NOREPUTATION);
+                    ss << GetTrinityString(LANG_FACTION_NOREPUTATION);
 
                 SendSysMessage(ss.str().c_str());
@@ -686,5 +688,5 @@
         for (; r < MAX_REPUTATION_RANK; ++r)
         {
-            std::string rank = GetMangosString(ReputationRankStrIndex[r]);
+            std::string rank = GetTrinityString(ReputationRankStrIndex[r]);
             if(rank.empty())
                 continue;
@@ -1797,8 +1799,8 @@
     }
 
-    std::string username = GetMangosString(LANG_ERROR);
-    std::string last_ip = GetMangosString(LANG_ERROR);
+    std::string username = GetTrinityString(LANG_ERROR);
+    std::string last_ip = GetTrinityString(LANG_ERROR);
     uint32 security = 0;
-    std::string last_login = GetMangosString(LANG_ERROR);
+    std::string last_login = GetTrinityString(LANG_ERROR);
 
     QueryResult* result = loginDatabase.PQuery("SELECT username,gmlevel,last_ip,last_login FROM account WHERE id = '%u'",accId);
@@ -1822,5 +1824,5 @@
     }
 
-    PSendSysMessage(LANG_PINFO_ACCOUNT, (target?"":GetMangosString(LANG_OFFLINE)), name.c_str(), GUID_LOPART(targetGUID), username.c_str(), accId, security, last_ip.c_str(), last_login.c_str(), latency);
+    PSendSysMessage(LANG_PINFO_ACCOUNT, (target?"":GetTrinityString(LANG_OFFLINE)), name.c_str(), GUID_LOPART(targetGUID), username.c_str(), accId, security, last_ip.c_str(), last_login.c_str(), latency);
 
     std::string timeStr = secsToTimeString(total_player_time,true,true);
@@ -1849,20 +1851,20 @@
                 FactionName = "#Not found#";
             ReputationRank rank = target->GetReputationRank(factionEntry);
-            std::string rankName = GetMangosString(ReputationRankStrIndex[rank]);
+            std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]);
             std::ostringstream ss;
             ss << itr->second.ID << ": |cffffffff|Hfaction:" << itr->second.ID << "|h[" << FactionName << "]|h|r " << rankName << "|h|r (" << target->GetReputation(factionEntry) << ")";
 
             if(itr->second.Flags & FACTION_FLAG_VISIBLE)
-                ss << GetMangosString(LANG_FACTION_VISIBLE);
+                ss << GetTrinityString(LANG_FACTION_VISIBLE);
             if(itr->second.Flags & FACTION_FLAG_AT_WAR)
-                ss << GetMangosString(LANG_FACTION_ATWAR);
+                ss << GetTrinityString(LANG_FACTION_ATWAR);
             if(itr->second.Flags & FACTION_FLAG_PEACE_FORCED)
-                ss << GetMangosString(LANG_FACTION_PEACE_FORCED);
+                ss << GetTrinityString(LANG_FACTION_PEACE_FORCED);
             if(itr->second.Flags & FACTION_FLAG_HIDDEN)
-                ss << GetMangosString(LANG_FACTION_HIDDEN);
+                ss << GetTrinityString(LANG_FACTION_HIDDEN);
             if(itr->second.Flags & FACTION_FLAG_INVISIBLE_FORCED)
-                ss << GetMangosString(LANG_FACTION_INVISIBLE_FORCED);
+                ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
             if(itr->second.Flags & FACTION_FLAG_INACTIVE)
-                ss << GetMangosString(LANG_FACTION_INACTIVE);
+                ss << GetTrinityString(LANG_FACTION_INACTIVE);
 
             SendSysMessage(ss.str().c_str());
@@ -1877,5 +1879,5 @@
     std::string name;
     if(!objmgr.GetPlayerNameByGUID(guid,name))
-        name = GetMangosString(LANG_UNKNOWN);
+        name = GetTrinityString(LANG_UNKNOWN);
 
     PSendSysMessage(LANG_COMMAND_TICKETVIEW, name.c_str(),time,text);
@@ -1900,5 +1902,5 @@
             count = 0;
 
-        PSendSysMessage(LANG_COMMAND_TICKETCOUNT, count, m_session->GetPlayer()->isAcceptTickets() ?  GetMangosString(LANG_ON) : GetMangosString(LANG_OFF));
+        PSendSysMessage(LANG_COMMAND_TICKETCOUNT, count, m_session->GetPlayer()->isAcceptTickets() ?  GetTrinityString(LANG_ON) : GetTrinityString(LANG_OFF));
         return true;
     }
@@ -3479,5 +3481,5 @@
     }
 
-    sLog.outDebug(GetMangosString(LANG_GAMEOBJECT_CURRENT), goI->name, db_lowGUID, x, y, z, o);
+    sLog.outDebug(GetTrinityString(LANG_GAMEOBJECT_CURRENT), goI->name, db_lowGUID, x, y, z, o);
 
     map->Add(pGameObj);
@@ -3588,5 +3590,5 @@
         if (Utf8FitTo(descr, wnamepart))
         {
-            char const* active = activeEvents.find(id) != activeEvents.end() ? GetMangosString(LANG_ACTIVE) : "";
+            char const* active = activeEvents.find(id) != activeEvents.end() ? GetTrinityString(LANG_ACTIVE) : "";
             PSendSysMessage(LANG_EVENT_ENTRY_LIST,id,id,descr.c_str(),active );
             ++counter;
@@ -3607,5 +3609,5 @@
     GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
 
-    char const* active = GetMangosString(LANG_ACTIVE);
+    char const* active = GetTrinityString(LANG_ACTIVE);
 
     for(GameEvent::ActiveEvents::const_iterator itr = activeEvents.begin(); itr != activeEvents.end(); ++itr )
@@ -3655,5 +3657,5 @@
     GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
     bool active = activeEvents.find(event_id) != activeEvents.end();
-    char const* activeStr = active ? GetMangosString(LANG_ACTIVE) : "";
+    char const* activeStr = active ? GetTrinityString(LANG_ACTIVE) : "";
 
     std::string startTimeStr = TimeToTimestampStr(eventData.start);
Index: trunk/src/game/ItemPrototype.h
===================================================================
--- trunk/src/game/ItemPrototype.h (revision 2)
+++ trunk/src/game/ItemPrototype.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/WorldLog.cpp
===================================================================
--- trunk/src/game/WorldLog.cpp (revision 2)
+++ trunk/src/game/WorldLog.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -25,5 +27,5 @@
 #include "Config/ConfigEnv.h"
 
-#define CLASS_LOCK MaNGOS::ClassLevelLockable<WorldLog, ZThread::FastMutex>
+#define CLASS_LOCK Trinity::ClassLevelLockable<WorldLog, ZThread::FastMutex>
 INSTANTIATE_SINGLETON_2(WorldLog, CLASS_LOCK);
 INSTANTIATE_CLASS_MUTEX(WorldLog, ZThread::FastMutex);
Index: trunk/src/game/CharacterHandler.cpp
===================================================================
--- trunk/src/game/CharacterHandler.cpp (revision 37)
+++ trunk/src/game/CharacterHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -733,60 +735,6 @@
         sWorld.ShutdownMsg(true,pCurrChar);
 
-	if(sWorld.getConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when logging in
-		pCurrChar->UpdateSkillsToMaxSkillsForLevel();
-
-	//ImpConfig - Check if player has logged in before
-	QueryResult *result = CharacterDatabase.PQuery("SELECT guid FROM has_logged_in_before WHERE guid = %u",pCurrChar->GetGUIDLow());
-	if(!result)
-	{
-	sLog.outBasic("Character '%s' logging in for first time, applying skills and stuff",pCurrChar->GetName());
-	CharacterDatabase.PExecute("INSERT INTO has_logged_in_before VALUES (%u)",pCurrChar->GetGUIDLow());
-
-	//Reputations if "StartAllReputation" is enabled, -- TODO: Fix this in a better way
-	if(sWorld.getConfig(CONFIG_START_ALL_REP))
-	{
-		pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(942),42999);
-		pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(935),42999);
-		pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(936),42999);
-		pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(1011),42999);
-		pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(970),42999);
-		pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(967),42999);
-		pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(989),42999);
-		pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(932),42999);
-		pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(934),42999);
-		pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(1038),42999);
-		pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(1077),42999);
-
-		// Factions depending on team, like cities and some more stuff
-		switch(pCurrChar->GetTeam())
-		{
-		case ALLIANCE:
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(72),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(47),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(69),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(930),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(730),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(978),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(54),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(946),42999);
-			break;
-		case HORDE:
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(76),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(68),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(81),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(911),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(729),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(941),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(530),42999);
-			pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(947),42999);
-			break;
-		}
-	}
-	}
-	else
-		sLog.outBasic("Character '%s' has logged in before",pCurrChar->GetName());
-
-	if(sWorld.getConfig(CONFIG_START_ALL_TAXI))
-		pCurrChar->SetTaxiCheater(true);
+    if(sWorld.getConfig(CONFIG_START_ALL_TAXI))
+        pCurrChar->SetTaxiCheater(true);
 
 
Index: trunk/src/game/DestinationHolderImp.h
===================================================================
--- trunk/src/game/DestinationHolderImp.h (revision 2)
+++ trunk/src/game/DestinationHolderImp.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_DESTINATIONHOLDERIMP_H
-#define MANGOS_DESTINATIONHOLDERIMP_H
+#ifndef TRINITY_DESTINATIONHOLDERIMP_H
+#define TRINITY_DESTINATIONHOLDERIMP_H
 
 #include "Creature.h"
Index: trunk/src/game/WorldSession.cpp
===================================================================
--- trunk/src/game/WorldSession.cpp (revision 37)
+++ trunk/src/game/WorldSession.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -37,4 +39,5 @@
 #include "ObjectAccessor.h"
 #include "BattleGroundMgr.h"
+#include "OutdoorPvPMgr.h"
 #include "Language.h"                                       // for CMSG_CANCEL_MOUNT_AURA handler
 #include "Chat.h"
@@ -97,5 +100,5 @@
     if (!m_Socket)
         return;
-    #ifdef MANGOS_DEBUG
+    #ifdef TRINITY_DEBUG
     // Code for network use statistic
     static uint64 sendPacketCount = 0;
@@ -129,5 +132,5 @@
         sendLastPacketBytes = packet->wpos();               // wpos is real written size
     }
-#endif                                                  // !MANGOS_DEBUG
+#endif                                                  // !TRINITY_DEBUG
 
   if (m_Socket->SendPacket (*packet) == -1)
@@ -302,4 +305,6 @@
             _player->LeaveBattleground();
 
+        sOutdoorPvPMgr.HandlePlayerLeaveZone(_player,_player->GetZoneId());
+
         for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
         {
@@ -443,5 +448,5 @@
 void WorldSession::SendNotification(int32 string_id,...)
 {
-    char const* format = GetMangosString(string_id);
+    char const* format = GetTrinityString(string_id);
     if(format)
     {
@@ -459,7 +464,7 @@
 }
 
-const char * WorldSession::GetMangosString( int32 entry )
-{
-    return objmgr.GetMangosString(entry,GetSessionDbLocaleIndex());
+const char * WorldSession::GetTrinityString( int32 entry )
+{
+    return objmgr.GetTrinityString(entry,GetSessionDbLocaleIndex());
 }
 
@@ -510,2 +515,4 @@
  
 
+
+
Index: trunk/src/game/Group.cpp
===================================================================
--- trunk/src/game/Group.cpp (revision 37)
+++ trunk/src/game/Group.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Player.cpp
===================================================================
--- trunk/src/game/Player.cpp (revision 39)
+++ trunk/src/game/Player.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -54,4 +56,6 @@
 #include "BattleGround.h"
 #include "BattleGroundMgr.h"
+#include "OutdoorPvP.h"
+#include "OutdoorPvPMgr.h"
 #include "ArenaTeam.h"
 #include "Chat.h"
@@ -59,5 +63,5 @@
 #include "Spell.h"
 #include "SocialMgr.h"
-#include "IRCClient.h"
+#include "GameEvent.h"
 
 #include <cmath>
@@ -580,23 +584,66 @@
 
     // set starting level
-	if(GetSession()->GetSecurity() >= SEC_MODERATOR)
-		SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_GM_START_LEVEL) ); //ImpConfig
-	else
-		SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) );
-	// set starting gold
-	SetUInt32Value( PLAYER_FIELD_COINAGE, sWorld.PlayerStartGold()*10000 );
-
-	// set starting honor
-	SetUInt32Value( PLAYER_FIELD_HONOR_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_HONOR) );
-
-	// set starting arena pts
-	SetUInt32Value( PLAYER_FIELD_ARENA_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_ARENAPTS) );
-
-	// start with every map explored
-	if(sWorld.getConfig(CONFIG_START_ALL_EXPLORED))
-	{
-		for (uint8 i=0; i<64; i++)
-			SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF);
-	}
+    if(GetSession()->GetSecurity() >= SEC_MODERATOR)
+        SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_GM_START_LEVEL) );
+    else
+        SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) );
+    // set starting gold
+    SetUInt32Value( PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_PLAYER_START_GOLD)*10000 );
+
+    // set starting honor
+    SetUInt32Value( PLAYER_FIELD_HONOR_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_HONOR) );
+
+    // set starting arena pts
+    SetUInt32Value( PLAYER_FIELD_ARENA_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_ARENAPTS) );
+
+    // start with every map explored
+    if(sWorld.getConfig(CONFIG_START_ALL_EXPLORED))
+    {
+        for (uint8 i=0; i<64; i++)
+            SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF);
+    }
+
+    //Reputations if "StartAllReputation" is enabled, -- TODO: Fix this in a better way
+    if(sWorld.getConfig(CONFIG_START_ALL_REP))
+    {
+        SetFactionReputation(sFactionStore.LookupEntry(942),42999);
+        SetFactionReputation(sFactionStore.LookupEntry(935),42999);
+        SetFactionReputation(sFactionStore.LookupEntry(936),42999);
+        SetFactionReputation(sFactionStore.LookupEntry(1011),42999);
+        SetFactionReputation(sFactionStore.LookupEntry(970),42999);
+        SetFactionReputation(sFactionStore.LookupEntry(967),42999);
+        SetFactionReputation(sFactionStore.LookupEntry(989),42999);
+        SetFactionReputation(sFactionStore.LookupEntry(932),42999);
+        SetFactionReputation(sFactionStore.LookupEntry(934),42999);
+        SetFactionReputation(sFactionStore.LookupEntry(1038),42999);
+        SetFactionReputation(sFactionStore.LookupEntry(1077),42999);
+
+        // Factions depending on team, like cities and some more stuff
+        switch(GetTeam())
+        {
+        case ALLIANCE:
+            SetFactionReputation(sFactionStore.LookupEntry(72),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(47),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(69),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(930),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(730),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(978),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(54),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(946),42999);
+            break;
+        case HORDE:
+            SetFactionReputation(sFactionStore.LookupEntry(76),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(68),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(81),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(911),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(729),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(941),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(530),42999);
+            SetFactionReputation(sFactionStore.LookupEntry(947),42999);
+            break;
+        default:
+            break;
+        }
+    }
 
     // Played time
@@ -1453,4 +1500,10 @@
     }
 
+    if((GetSession()->GetSecurity() < SEC_GAMEMASTER) && !sWorld.IsAllowedMap(mapid))
+    {
+        sLog.outError("Player %s tried to enter a forbidden map", GetName());
+        return false;
+    }
+
     // preparing unsummon pet if lost (we must get pet before teleportation or will not find it later)
     Pet* pet = GetPet();
@@ -1718,6 +1771,4 @@
             m_items[i]->AddToWorld();
     }
-    if(sIRC.ajoin == 1)
-        sIRC.AutoJoinChannel(this);
 }
 
@@ -1810,5 +1861,5 @@
             if (recentCast)
             {
-                // Mangos Updates Mana in intervals of 2s, which is correct
+                // Trinity Updates Mana in intervals of 2s, which is correct
                 addvalue = GetFloatValue(PLAYER_FIELD_MOD_MANA_REGEN_INTERRUPT) *  ManaIncreaseRate * 2.00f;
             }
@@ -2130,5 +2181,5 @@
     GetSession()->SendPacket(&data);
 
-    SetUInt32Value(PLAYER_NEXT_LEVEL_XP, MaNGOS::XP::xp_to_level(level));
+    SetUInt32Value(PLAYER_NEXT_LEVEL_XP, Trinity::XP::xp_to_level(level));
 
     //update level, max level of skills
@@ -2150,17 +2201,6 @@
     UpdateAllStats();
 
-    if((sIRC.BOTMASK & 64) != 0)
-    {
-        char temp [5];
-        sprintf(temp, "%u", level);
-        std::string plevel = temp;
-        std::string pname = GetName();
-        std::string ircchan = "#";
-        ircchan += sIRC._irc_chan[sIRC.Status].c_str();
-        sIRC.Send_IRC_Channel(ircchan, "\00311["+pname+"] : Has Reached Level: "+plevel, true);
-    }
-
     if(sWorld.getConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up
-    UpdateSkillsToMaxSkillsForLevel();
+        UpdateSkillsToMaxSkillsForLevel();
 
     // set current level health and mana/energy to maximum after applying all mods.
@@ -2221,5 +2261,5 @@
 
     SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) );
-    SetUInt32Value(PLAYER_NEXT_LEVEL_XP, MaNGOS::XP::xp_to_level(getLevel()));
+    SetUInt32Value(PLAYER_NEXT_LEVEL_XP, Trinity::XP::xp_to_level(getLevel()));
 
     UpdateMaxSkills ();
@@ -3122,5 +3162,5 @@
     uint32 cost = 0;
 
-    if(!no_cost)
+    if(!no_cost && !sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST))
     {
         cost = resetTalentsCost();
@@ -3637,5 +3677,4 @@
     CharacterDatabase.PExecute("DELETE FROM character_pet WHERE owner = '%u'",guid);
     CharacterDatabase.PExecute("DELETE FROM character_pet_declinedname WHERE owner = '%u'",guid);
-    CharacterDatabase.PExecute("DELETE FROM has_logged_in_before WHERE guid = %u",guid);
     CharacterDatabase.CommitTransaction();
 
@@ -3762,5 +3801,5 @@
     DestroyZoneLimitedItem( true, GetZoneId());
 
-    if(sWorld.getConfig(CONFIG_DISABLE_RES_SICKNESS) || !applySickness || getLevel() <= 10)
+    if(!applySickness || getLevel() <= 10)
         return;
 
@@ -4835,5 +4874,5 @@
 
     uint32 plevel = getLevel();                             // if defense than pVictim == attacker
-    uint32 greylevel = MaNGOS::XP::GetGrayLevel(plevel);
+    uint32 greylevel = Trinity::XP::GetGrayLevel(plevel);
     uint32 moblevel = pVictim->getLevelForTarget(this);
     if(moblevel < greylevel)
@@ -5216,5 +5255,5 @@
 {
     // prevent crash when a bad coord is sent by the client
-    if(!MaNGOS::IsValidMapCoord(x,y,z,orientation))
+    if(!Trinity::IsValidMapCoord(x,y,z,orientation))
     {
         sLog.outDebug("Player::SetPosition(%f, %f, %f, %f, %d) .. bad coordinates for player %d!",x,y,z,orientation,teleport,GetGUIDLow());
@@ -5816,5 +5855,5 @@
 {
     // for grey creature kill received 20%, in other case 100.
-    int32 percent = (!for_quest && (creatureOrQuestLevel <= MaNGOS::XP::GetGrayLevel(getLevel()))) ? 20 : 100;
+    int32 percent = (!for_quest && (creatureOrQuestLevel <= Trinity::XP::GetGrayLevel(getLevel()))) ? 20 : 100;
 
     int32 repMod = GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN);
@@ -6054,38 +6093,40 @@
     ApplyModUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, uint32(honor), true);
 
-	if( sWorld.getConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken )
-	{
-		if(!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT))
-			return true;
-
-		if(uVictim->GetTypeId() == TYPEID_PLAYER)
-		{
-			// Check if allowed to receive it in current map
-			uint8 MapType = sWorld.getConfig(CONFIG_PVP_TOKEN_MAP_TYPE);
-			if(MapType == 1 && !InBattleGround() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP) || MapType == 2 && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP) || MapType == 3 && !InBattleGround())
-				return true;
-
-			uint32 noSpaceForCount = 0;
-			uint32 itemId = sWorld.getConfig(CONFIG_PVP_TOKEN_ID);
-			int32 count = sWorld.getConfig(CONFIG_PVP_TOKEN_COUNT);
-
-			// check space and find places
-			ItemPosCountVec dest;
-			uint8 msg = CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount );
-			if( msg != EQUIP_ERR_OK )   // convert to possible store amount
-				count = noSpaceForCount;
-
-			if( count == 0 || dest.empty()) // can't add any
-			{
-				// -- TODO: Send to mailbox if no space
-				ChatHandler(this).PSendSysMessage("You don't have any space in your bags for a token.");
-				return true;
-			}
-
-			Item* item = StoreNewItem( dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
-			SendNewItem(item,count,true,false);
-			ChatHandler(this).PSendSysMessage("You have been awarded a token for slaying another player.");
-		}
-	}
+    if( sWorld.getConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken )
+    {
+        if(!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT))
+            return true;
+
+        if(uVictim->GetTypeId() == TYPEID_PLAYER)
+        {
+            // Check if allowed to receive it in current map
+            uint8 MapType = sWorld.getConfig(CONFIG_PVP_TOKEN_MAP_TYPE);
+            if( (MapType == 1 && !InBattleGround() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP)) 
+                || (MapType == 2 && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP))
+                || (MapType == 3 && !InBattleGround()) )
+                return true;
+
+            uint32 noSpaceForCount = 0;
+            uint32 itemId = sWorld.getConfig(CONFIG_PVP_TOKEN_ID);
+            int32 count = sWorld.getConfig(CONFIG_PVP_TOKEN_COUNT);
+
+            // check space and find places
+            ItemPosCountVec dest;
+            uint8 msg = CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount );
+            if( msg != EQUIP_ERR_OK )   // convert to possible store amount
+                count = noSpaceForCount;
+
+            if( count == 0 || dest.empty()) // can't add any
+            {
+                // -- TODO: Send to mailbox if no space
+                ChatHandler(this).PSendSysMessage("You don't have any space in your bags for a token.");
+                return true;
+            }
+
+            Item* item = StoreNewItem( dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
+            SendNewItem(item,count,true,false);
+            ChatHandler(this).PSendSysMessage("You have been awarded a token for slaying another player.");
+        }
+    }
 
     return true;
@@ -6240,4 +6281,5 @@
 void Player::UpdateZone(uint32 newZone)
 {
+    uint32 oldZoneId  = m_zoneUpdateId;
     m_zoneUpdateId    = newZone;
     m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL;
@@ -6249,4 +6291,11 @@
     if(!zone)
         return;
+
+    // inform outdoor pvp
+    if(oldZoneId != m_zoneUpdateId)
+    {
+        sOutdoorPvPMgr.HandlePlayerLeaveZone(this, oldZoneId);
+        sOutdoorPvPMgr.HandlePlayerEnterZone(this, m_zoneUpdateId);
+    }
 
     if (sWorld.getConfig(CONFIG_WEATHER))
@@ -6381,4 +6430,9 @@
         }
     }
+}
+
+bool Player::IsOutdoorPvPActive()
+{
+    return (isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP) || sWorld.IsPvPRealm())  && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING2) && !isInFlight());
 }
 
@@ -6457,10 +6511,7 @@
         duel->opponent->ClearComboPoints();
 
-	// Honor points after duel (the winner) - ImpConfig
-	if(sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL > 0))
-	{
-		uint32 amount = sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL);
-		duel->opponent->RewardHonor(NULL,1,amount);
-	}
+    // Honor points after duel (the winner) - ImpConfig
+    if(uint32 amount = sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL))
+        duel->opponent->RewardHonor(NULL,1,amount);
 
     //cleanups
@@ -7484,5 +7535,5 @@
 }
 
-void Player::SendInitWorldStates()
+void Player::SendInitWorldStates(bool forceZone, uint32 forceZoneId)
 {
     // data depends on zoneid/mapid...
@@ -7490,5 +7541,10 @@
     uint16 NumberOfFields = 0;
     uint32 mapid = GetMapId();
-    uint32 zoneid = GetZoneId();
+    uint32 zoneid;
+    if(forceZone)
+        zoneid = forceZoneId;
+    else
+        zoneid = GetZoneId();
+    OutdoorPvP * pvp = sOutdoorPvPMgr.GetOutdoorPvPToZoneId(zoneid);
     uint32 areaid = GetAreaId();
     sLog.outDebug("Sending SMSG_INIT_WORLD_STATES to Map:%u, Zone: %u", mapid, zoneid);
@@ -7515,4 +7571,10 @@
             NumberOfFields = 6;
             break;
+        case 139:
+            NumberOfFields = 39;
+            break;
+        case 1377:
+            NumberOfFields = 13;
+            break;
         case 2597:
             NumberOfFields = 81;
@@ -7526,5 +7588,8 @@
             break;
         case 3483:
-            NumberOfFields = 22;
+            NumberOfFields = 25;
+            break;
+        case 3518:
+            NumberOfFields = 37;
             break;
         case 3519:
@@ -7575,4 +7640,64 @@
         case 1537:
         case 2257:
+            break;
+        case 139: // EPL
+            {
+                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_EP)
+                    pvp->FillInitialWorldStates(data);
+                else
+                {
+                    data << uint32(0x97a) << uint32(0x0); // 10 2426
+                    data << uint32(0x917) << uint32(0x0); // 11 2327
+                    data << uint32(0x918) << uint32(0x0); // 12 2328
+                    data << uint32(0x97b) << uint32(0x32); // 13 2427
+                    data << uint32(0x97c) << uint32(0x32); // 14 2428
+                    data << uint32(0x933) << uint32(0x1); // 15 2355
+                    data << uint32(0x946) << uint32(0x0); // 16 2374
+                    data << uint32(0x947) << uint32(0x0); // 17 2375
+                    data << uint32(0x948) << uint32(0x0); // 18 2376
+                    data << uint32(0x949) << uint32(0x0); // 19 2377
+                    data << uint32(0x94a) << uint32(0x0); // 20 2378
+                    data << uint32(0x94b) << uint32(0x0); // 21 2379
+                    data << uint32(0x932) << uint32(0x0); // 22 2354
+                    data << uint32(0x934) << uint32(0x0); // 23 2356
+                    data << uint32(0x935) << uint32(0x0); // 24 2357
+                    data << uint32(0x936) << uint32(0x0); // 25 2358
+                    data << uint32(0x937) << uint32(0x0); // 26 2359
+                    data << uint32(0x938) << uint32(0x0); // 27 2360
+                    data << uint32(0x939) << uint32(0x1); // 28 2361
+                    data << uint32(0x930) << uint32(0x1); // 29 2352
+                    data << uint32(0x93a) << uint32(0x0); // 30 2362
+                    data << uint32(0x93b) << uint32(0x0); // 31 2363
+                    data << uint32(0x93c) << uint32(0x0); // 32 2364
+                    data << uint32(0x93d) << uint32(0x0); // 33 2365
+                    data << uint32(0x944) << uint32(0x0); // 34 2372
+                    data << uint32(0x945) << uint32(0x0); // 35 2373
+                    data << uint32(0x931) << uint32(0x1); // 36 2353
+                    data << uint32(0x93e) << uint32(0x0); // 37 2366
+                    data << uint32(0x931) << uint32(0x1); // 38 2367 ??  grey horde not in dbc! send for consistency's sake, and to match field count
+                    data << uint32(0x940) << uint32(0x0); // 39 2368
+                    data << uint32(0x941) << uint32(0x0); // 7 2369
+                    data << uint32(0x942) << uint32(0x0); // 8 2370
+                    data << uint32(0x943) << uint32(0x0); // 9 2371
+                }
+            }
+            break;
+        case 1377: // Silithus
+            {
+                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_SI)
+                    pvp->FillInitialWorldStates(data);
+                else
+                {
+                    // states are always shown
+                    data << uint32(2313) << uint32(0x0); // 7 ally silityst gathered
+                    data << uint32(2314) << uint32(0x0); // 8 horde silityst gathered
+                    data << uint32(2317) << uint32(0x0); // 9 max silithyst
+                }
+                // dunno about these... aq opening event maybe?
+                data << uint32(2322) << uint32(0x0); // 10 sandworm N
+                data << uint32(2323) << uint32(0x0); // 11 sandworm S
+                data << uint32(2324) << uint32(0x0); // 12 sandworm SW
+                data << uint32(2325) << uint32(0x0); // 13 sandworm E
+            }
             break;
         case 2597:                                          // AV
@@ -7747,75 +7872,144 @@
             }
             break;
+        // any of these needs change! the client remembers the prev setting!
+        // ON EVERY ZONE LEAVE, RESET THE OLD ZONE'S WORLD STATE, BUT AT LEAST THE UI STUFF!
         case 3483:                                          // Hellfire Peninsula
-            data << uint32(0x9ba) << uint32(0x1);           // 10
-            data << uint32(0x9b9) << uint32(0x1);           // 11
-            data << uint32(0x9b5) << uint32(0x0);           // 12
-            data << uint32(0x9b4) << uint32(0x1);           // 13
-            data << uint32(0x9b3) << uint32(0x0);           // 14
-            data << uint32(0x9b2) << uint32(0x0);           // 15
-            data << uint32(0x9b1) << uint32(0x1);           // 16
-            data << uint32(0x9b0) << uint32(0x0);           // 17
-            data << uint32(0x9ae) << uint32(0x0);           // 18 horde pvp objectives captured
-            data << uint32(0x9ac) << uint32(0x0);           // 19
-            data << uint32(0x9a8) << uint32(0x0);           // 20
-            data << uint32(0x9a7) << uint32(0x0);           // 21
-            data << uint32(0x9a6) << uint32(0x1);           // 22
+            {
+                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_HP)
+                    pvp->FillInitialWorldStates(data);
+                else
+                {
+                    data << uint32(0x9ba) << uint32(0x1);           // 10 // add ally tower main gui icon       // maybe should be sent only on login?
+                    data << uint32(0x9b9) << uint32(0x1);           // 11 // add horde tower main gui icon      // maybe should be sent only on login?
+                    data << uint32(0x9b5) << uint32(0x0);           // 12 // show neutral broken hill icon      // 2485
+                    data << uint32(0x9b4) << uint32(0x1);           // 13 // show icon above broken hill        // 2484
+                    data << uint32(0x9b3) << uint32(0x0);           // 14 // show ally broken hill icon         // 2483
+                    data << uint32(0x9b2) << uint32(0x0);           // 15 // show neutral overlook icon         // 2482
+                    data << uint32(0x9b1) << uint32(0x1);           // 16 // show the overlook arrow            // 2481
+                    data << uint32(0x9b0) << uint32(0x0);           // 17 // show ally overlook icon            // 2480
+                    data << uint32(0x9ae) << uint32(0x0);           // 18 // horde pvp objectives captured      // 2478
+                    data << uint32(0x9ac) << uint32(0x0);           // 19 // ally pvp objectives captured       // 2476
+                    data << uint32(2475)  << uint32(100); //: ally / horde slider grey area                              // show only in direct vicinity!
+                    data << uint32(2474)  << uint32(50);  //: ally / horde slider percentage, 100 for ally, 0 for horde  // show only in direct vicinity!
+                    data << uint32(2473)  << uint32(0);   //: ally / horde slider display                                // show only in direct vicinity!
+                    data << uint32(0x9a8) << uint32(0x0);           // 20 // show the neutral stadium icon      // 2472
+                    data << uint32(0x9a7) << uint32(0x0);           // 21 // show the ally stadium icon         // 2471 
+                    data << uint32(0x9a6) << uint32(0x1);           // 22 // show the horde stadium icon        // 2470
+                }
+            }
+            break;
+        case 3518:
+            {
+                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_NA)
+                    pvp->FillInitialWorldStates(data);
+                else
+                {
+                    data << uint32(2503) << uint32(0x0);    // 10
+                    data << uint32(2502) << uint32(0x0);    // 11
+                    data << uint32(2493) << uint32(0x0);    // 12
+                    data << uint32(2491) << uint32(0x0);    // 13
+
+                    data << uint32(2495) << uint32(0x0);    // 14
+                    data << uint32(2494) << uint32(0x0);    // 15
+                    data << uint32(2497) << uint32(0x0);    // 16
+
+                    data << uint32(2762) << uint32(0x0);    // 17
+                    data << uint32(2662) << uint32(0x0);    // 18
+                    data << uint32(2663) << uint32(0x0);    // 19
+                    data << uint32(2664) << uint32(0x0);    // 20
+
+                    data << uint32(2760) << uint32(0x0);    // 21
+                    data << uint32(2670) << uint32(0x0);    // 22
+                    data << uint32(2668) << uint32(0x0);    // 23
+                    data << uint32(2669) << uint32(0x0);    // 24
+
+                    data << uint32(2761) << uint32(0x0);    // 25
+                    data << uint32(2667) << uint32(0x0);    // 26
+                    data << uint32(2665) << uint32(0x0);    // 27
+                    data << uint32(2666) << uint32(0x0);    // 28
+
+                    data << uint32(2763) << uint32(0x0);    // 29
+                    data << uint32(2659) << uint32(0x0);    // 30
+                    data << uint32(2660) << uint32(0x0);    // 31
+                    data << uint32(2661) << uint32(0x0);    // 32
+
+                    data << uint32(2671) << uint32(0x0);    // 33
+                    data << uint32(2676) << uint32(0x0);    // 34
+                    data << uint32(2677) << uint32(0x0);    // 35
+                    data << uint32(2672) << uint32(0x0);    // 36
+                    data << uint32(2673) << uint32(0x0);    // 37
+                }
+            }
             break;
         case 3519:                                          // Terokkar Forest
-            data << uint32(0xa41) << uint32(0x0);           // 10
-            data << uint32(0xa40) << uint32(0x14);          // 11
-            data << uint32(0xa3f) << uint32(0x0);           // 12
-            data << uint32(0xa3e) << uint32(0x0);           // 13
-            data << uint32(0xa3d) << uint32(0x5);           // 14
-            data << uint32(0xa3c) << uint32(0x0);           // 15
-            data << uint32(0xa87) << uint32(0x0);           // 16
-            data << uint32(0xa86) << uint32(0x0);           // 17
-            data << uint32(0xa85) << uint32(0x0);           // 18
-            data << uint32(0xa84) << uint32(0x0);           // 19
-            data << uint32(0xa83) << uint32(0x0);           // 20
-            data << uint32(0xa82) << uint32(0x0);           // 21
-            data << uint32(0xa81) << uint32(0x0);           // 22
-            data << uint32(0xa80) << uint32(0x0);           // 23
-            data << uint32(0xa7e) << uint32(0x0);           // 24
-            data << uint32(0xa7d) << uint32(0x0);           // 25
-            data << uint32(0xa7c) << uint32(0x0);           // 26
-            data << uint32(0xa7b) << uint32(0x0);           // 27
-            data << uint32(0xa7a) << uint32(0x0);           // 28
-            data << uint32(0xa79) << uint32(0x0);           // 29
-            data << uint32(0x9d0) << uint32(0x5);           // 30
-            data << uint32(0x9ce) << uint32(0x0);           // 31
-            data << uint32(0x9cd) << uint32(0x0);           // 32
-            data << uint32(0x9cc) << uint32(0x0);           // 33
-            data << uint32(0xa88) << uint32(0x0);           // 34
-            data << uint32(0xad0) << uint32(0x0);           // 35
-            data << uint32(0xacf) << uint32(0x1);           // 36
+            {
+                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_TF)
+                    pvp->FillInitialWorldStates(data);
+                else
+                {
+                    data << uint32(0xa41) << uint32(0x0);           // 10 // 2625 capture bar pos
+                    data << uint32(0xa40) << uint32(0x14);          // 11 // 2624 capture bar neutral
+                    data << uint32(0xa3f) << uint32(0x0);           // 12 // 2623 show capture bar
+                    data << uint32(0xa3e) << uint32(0x0);           // 13 // 2622 horde towers controlled
+                    data << uint32(0xa3d) << uint32(0x5);           // 14 // 2621 ally towers controlled
+                    data << uint32(0xa3c) << uint32(0x0);           // 15 // 2620 show towers controlled
+                    data << uint32(0xa88) << uint32(0x0);           // 16 // 2696 SE Neu
+                    data << uint32(0xa87) << uint32(0x0);           // 17 // SE Horde
+                    data << uint32(0xa86) << uint32(0x0);           // 18 // SE Ally
+                    data << uint32(0xa85) << uint32(0x0);           // 19 //S Neu
+                    data << uint32(0xa84) << uint32(0x0);           // 20 S Horde
+                    data << uint32(0xa83) << uint32(0x0);           // 21 S Ally
+                    data << uint32(0xa82) << uint32(0x0);           // 22 NE Neu
+                    data << uint32(0xa81) << uint32(0x0);           // 23 NE Horde
+                    data << uint32(0xa80) << uint32(0x0);           // 24 NE Ally
+                    data << uint32(0xa7e) << uint32(0x0);           // 25 // 2686 N Neu
+                    data << uint32(0xa7d) << uint32(0x0);           // 26 N Horde
+                    data << uint32(0xa7c) << uint32(0x0);           // 27 N Ally
+                    data << uint32(0xa7b) << uint32(0x0);           // 28 NW Ally
+                    data << uint32(0xa7a) << uint32(0x0);           // 29 NW Horde
+                    data << uint32(0xa79) << uint32(0x0);           // 30 NW Neutral
+                    data << uint32(0x9d0) << uint32(0x5);           // 31 // 2512 locked time remaining seconds first digit
+                    data << uint32(0x9ce) << uint32(0x0);           // 32 // 2510 locked time remaining seconds second digit
+                    data << uint32(0x9cd) << uint32(0x0);           // 33 // 2509 locked time remaining minutes
+                    data << uint32(0x9cc) << uint32(0x0);           // 34 // 2508 neutral locked time show
+                    data << uint32(0xad0) << uint32(0x0);           // 35 // 2768 horde locked time show
+                    data << uint32(0xacf) << uint32(0x1);           // 36 // 2767 ally locked time show
+                }
+            }
             break;
         case 3521:                                          // Zangarmarsh
-            data << uint32(0x9e1) << uint32(0x0);           // 10
-            data << uint32(0x9e0) << uint32(0x0);           // 11
-            data << uint32(0x9df) << uint32(0x0);           // 12
-            data << uint32(0xa5d) << uint32(0x1);           // 13
-            data << uint32(0xa5c) << uint32(0x0);           // 14
-            data << uint32(0xa5b) << uint32(0x1);           // 15
-            data << uint32(0xa5a) << uint32(0x0);           // 16
-            data << uint32(0xa59) << uint32(0x1);           // 17
-            data << uint32(0xa58) << uint32(0x0);           // 18
-            data << uint32(0xa57) << uint32(0x0);           // 19
-            data << uint32(0xa56) << uint32(0x0);           // 20
-            data << uint32(0xa55) << uint32(0x1);           // 21
-            data << uint32(0xa54) << uint32(0x0);           // 22
-            data << uint32(0x9e7) << uint32(0x0);           // 23
-            data << uint32(0x9e6) << uint32(0x0);           // 24
-            data << uint32(0x9e5) << uint32(0x0);           // 25
-            data << uint32(0xa00) << uint32(0x0);           // 26
-            data << uint32(0x9ff) << uint32(0x1);           // 27
-            data << uint32(0x9fe) << uint32(0x0);           // 28
-            data << uint32(0x9fd) << uint32(0x0);           // 29
-            data << uint32(0x9fc) << uint32(0x1);           // 30
-            data << uint32(0x9fb) << uint32(0x0);           // 31
-            data << uint32(0xa62) << uint32(0x0);           // 32
-            data << uint32(0xa61) << uint32(0x1);           // 33
-            data << uint32(0xa60) << uint32(0x1);           // 34
-            data << uint32(0xa5f) << uint32(0x0);           // 35
+            {
+                if(pvp && pvp->GetTypeId() == OUTDOOR_PVP_ZM)
+                    pvp->FillInitialWorldStates(data);
+                else
+                {
+                    data << uint32(0x9e1) << uint32(0x0);           // 10 //2529
+                    data << uint32(0x9e0) << uint32(0x0);           // 11
+                    data << uint32(0x9df) << uint32(0x0);           // 12
+                    data << uint32(0xa5d) << uint32(0x1);           // 13 //2653 
+                    data << uint32(0xa5c) << uint32(0x0);           // 14 //2652 east beacon neutral
+                    data << uint32(0xa5b) << uint32(0x1);           // 15 horde
+                    data << uint32(0xa5a) << uint32(0x0);           // 16 ally
+                    data << uint32(0xa59) << uint32(0x1);           // 17 // 2649 Twin spire graveyard horde  12???
+                    data << uint32(0xa58) << uint32(0x0);           // 18 ally     14 ???
+                    data << uint32(0xa57) << uint32(0x0);           // 19 neutral  7???
+                    data << uint32(0xa56) << uint32(0x0);           // 20 // 2646 west beacon neutral
+                    data << uint32(0xa55) << uint32(0x1);           // 21 horde
+                    data << uint32(0xa54) << uint32(0x0);           // 22 ally
+                    data << uint32(0x9e7) << uint32(0x0);           // 23 // 2535
+                    data << uint32(0x9e6) << uint32(0x0);           // 24
+                    data << uint32(0x9e5) << uint32(0x0);           // 25
+                    data << uint32(0xa00) << uint32(0x0);           // 26 // 2560
+                    data << uint32(0x9ff) << uint32(0x1);           // 27
+                    data << uint32(0x9fe) << uint32(0x0);           // 28
+                    data << uint32(0x9fd) << uint32(0x0);           // 29 
+                    data << uint32(0x9fc) << uint32(0x1);           // 30
+                    data << uint32(0x9fb) << uint32(0x0);           // 31
+                    data << uint32(0xa62) << uint32(0x0);           // 32 // 2658
+                    data << uint32(0xa61) << uint32(0x1);           // 33
+                    data << uint32(0xa60) << uint32(0x1);           // 34
+                    data << uint32(0xa5f) << uint32(0x0);           // 35
+                }
+            }
             break;
         case 3698:                                          // Nagrand Arena
@@ -7885,9 +8079,7 @@
     WorldPacket data(MSG_TALENT_WIPE_CONFIRM, (8+4));
     data << uint64(guid);
-    data << uint32(resetTalentsCost());
-	if(sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST))
-		data << uint32(0);
-	else
-		data << uint32(resetTalentsCost());
+    uint32 cost = sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : resetTalentsCost();
+    data << cost;
+    data << cost;
     GetSession()->SendPacket( &data );
 }
@@ -11908,5 +12100,5 @@
         {
 
-            if ( qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) )
+            if ( qInfo->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
             {
                 for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
@@ -11917,5 +12109,5 @@
             }
 
-            if ( qInfo->HasFlag(QUEST_MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO) )
+            if ( qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO) )
             {
                 for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
@@ -11929,8 +12121,8 @@
             }
 
-            if ( qInfo->HasFlag( QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT ) && !q_status.m_explored )
+            if ( qInfo->HasFlag( QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT ) && !q_status.m_explored )
                 return false;
 
-            if ( qInfo->HasFlag( QUEST_MANGOS_FLAGS_TIMED ) && q_status.m_timer == 0 )
+            if ( qInfo->HasFlag( QUEST_TRINITY_FLAGS_TIMED ) && q_status.m_timer == 0 )
                 return false;
 
@@ -11959,5 +12151,5 @@
         return false;
 
-    if (pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER) )
+    if (pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER) )
         for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
             if( pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i],pQuest->ReqItemCount[i]) )
@@ -11985,5 +12177,5 @@
 
     // prevent receive reward with quest items in bank
-    if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) )
+    if ( pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
     {
         for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
@@ -12062,5 +12254,5 @@
     questStatusData.m_explored = false;
 
-    if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) )
+    if ( pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
     {
         for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
@@ -12068,5 +12260,5 @@
     }
 
-    if ( pQuest->HasFlag(QUEST_MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO) )
+    if ( pQuest->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO) )
     {
         for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
@@ -12081,5 +12273,5 @@
 
     uint32 qtime = 0;
-    if( pQuest->HasFlag( QUEST_MANGOS_FLAGS_TIMED ) )
+    if( pQuest->HasFlag( QUEST_TRINITY_FLAGS_TIMED ) )
     {
         uint32 limittime = pQuest->GetLimitTime();
@@ -12545,5 +12737,5 @@
 bool Player::SatisfyQuestTimed( Quest const* qInfo, bool msg )
 {
-    if ( (find(m_timedquests.begin(), m_timedquests.end(), qInfo->GetQuestId()) != m_timedquests.end()) && qInfo->HasFlag(QUEST_MANGOS_FLAGS_TIMED) )
+    if ( (find(m_timedquests.begin(), m_timedquests.end(), qInfo->GetQuestId()) != m_timedquests.end()) && qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED) )
     {
         if( msg )
@@ -12770,5 +12962,5 @@
         if( status == QUEST_STATUS_NONE || status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE )
         {
-            if( qInfo->HasFlag( QUEST_MANGOS_FLAGS_TIMED ) )
+            if( qInfo->HasFlag( QUEST_TRINITY_FLAGS_TIMED ) )
                 m_timedquests.erase(qInfo->GetQuestId());
         }
@@ -12783,5 +12975,5 @@
 }
 
-// not used in MaNGOS, but used in scripting code
+// not used in TrinIty, but used in scripting code
 uint32 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry)
 {
@@ -12799,5 +12991,5 @@
 void Player::AdjustQuestReqItemCount( Quest const* pQuest )
 {
-    if ( pQuest->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) )
+    if ( pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
     {
         for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
@@ -12847,5 +13039,5 @@
 }
 
-//not used in mangosd, function for external script library
+//not used in Trinityd, function for external script library
 void Player::GroupEventHappens( uint32 questId, WorldObject const* pEventObject )
 {
@@ -12879,5 +13071,5 @@
 
         Quest const* qInfo = objmgr.GetQuestTemplate(questid);
-        if( !qInfo || !qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) )
+        if( !qInfo || !qInfo->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
             continue;
 
@@ -12916,5 +13108,5 @@
         if ( !qInfo )
             continue;
-        if( !qInfo->HasFlag( QUEST_MANGOS_FLAGS_DELIVER ) )
+        if( !qInfo->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
             continue;
 
@@ -12963,5 +13155,5 @@
         if( q_status.m_status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->GetType() == QUEST_TYPE_RAID))
         {
-            if( qInfo->HasFlag( QUEST_MANGOS_FLAGS_KILL_OR_CAST) )
+            if( qInfo->HasFlag( QUEST_TRINITY_FLAGS_KILL_OR_CAST) )
             {
                 for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++)
@@ -13019,5 +13211,5 @@
         if ( q_status.m_status == QUEST_STATUS_INCOMPLETE )
         {
-            if( qInfo->HasFlag( QUEST_MANGOS_FLAGS_KILL_OR_CAST ) )
+            if( qInfo->HasFlag( QUEST_TRINITY_FLAGS_KILL_OR_CAST ) )
             {
                 for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++)
@@ -13086,5 +13278,5 @@
         if ( q_status.m_status == QUEST_STATUS_INCOMPLETE )
         {
-            if( qInfo->HasFlag( QUEST_MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO ) )
+            if( qInfo->HasFlag( QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO ) )
             {
                 for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++)
@@ -13226,4 +13418,5 @@
     uint32 questid = pQuest->GetQuestId();
     sLog.outDebug( "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid );
+    gameeventmgr.HandleQuestComplete(questid);
     WorldPacket data( SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4+4+pQuest->GetRewItemsCount()*8) );
     data << questid;
@@ -13609,5 +13802,5 @@
         m_movementInfo.t_o = fields[23].GetFloat();
 
-        if( !MaNGOS::IsValidMapCoord(
+        if( !Trinity::IsValidMapCoord(
             GetPositionX()+m_movementInfo.t_x,GetPositionY()+m_movementInfo.t_y,
             GetPositionZ()+m_movementInfo.t_z,GetOrientation()+m_movementInfo.t_o) ||
@@ -14223,5 +14416,5 @@
             }
 
-            std::string subject = GetSession()->GetMangosString(LANG_NOT_EQUIPPED_ITEM);
+            std::string subject = GetSession()->GetTrinityString(LANG_NOT_EQUIPPED_ITEM);
 
             WorldSession::SendMailTo(this, MAIL_NORMAL, MAIL_STATIONERY_GM, GetGUIDLow(), GetGUIDLow(), subject, 0, &mi, 0, 0, MAIL_CHECK_MASK_NONE);
@@ -14388,5 +14581,5 @@
                 time_t quest_time = time_t(fields[4].GetUInt64());
 
-                if( pQuest->HasFlag( QUEST_MANGOS_FLAGS_TIMED ) && !GetQuestRewardStatus(quest_id) &&  questStatusData.m_status != QUEST_STATUS_NONE )
+                if( pQuest->HasFlag( QUEST_TRINITY_FLAGS_TIMED ) && !GetQuestRewardStatus(quest_id) &&  questStatusData.m_status != QUEST_STATUS_NONE )
                 {
                     AddTimedQuest( quest_id );
@@ -16213,14 +16406,14 @@
     std::list<Unit*> stealthedUnits;
 
-    CellPair p(MaNGOS::ComputeCellPair(GetPositionX(),GetPositionY()));
+    CellPair p(Trinity::ComputeCellPair(GetPositionX(),GetPositionY()));
     Cell cell(p);
     cell.data.Part.reserved = ALL_DISTRICT;
     cell.SetNoCreate();
 
-    MaNGOS::AnyStealthedCheck u_check;
-    MaNGOS::UnitListSearcher<MaNGOS::AnyStealthedCheck > searcher(stealthedUnits, u_check);
-
-    TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyStealthedCheck >, WorldTypeMapContainer > world_unit_searcher(searcher);
-    TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyStealthedCheck >, GridTypeMapContainer >  grid_unit_searcher(searcher);
+    Trinity::AnyStealthedCheck u_check;
+    Trinity::UnitListSearcher<Trinity::AnyStealthedCheck > searcher(stealthedUnits, u_check);
+
+    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyStealthedCheck >, WorldTypeMapContainer > world_unit_searcher(searcher);
+    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyStealthedCheck >, GridTypeMapContainer >  grid_unit_searcher(searcher);
 
     CellLock<GridReadGuard> cell_lock(cell, p);
@@ -16242,5 +16435,5 @@
             m_clientGUIDs.insert((*i)->GetGUID());
 
-            #ifdef MANGOS_DEBUG
+            #ifdef TRINITY_DEBUG
             if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
                 sLog.outDebug("Object %u (Type: %u) is detected in stealth by player %u. Distance = %f",(*i)->GetGUIDLow(),(*i)->GetTypeId(),GetGUIDLow(),GetDistance(*i));
@@ -17105,5 +17298,5 @@
             m_clientGUIDs.erase(target->GetGUID());
 
-            #ifdef MANGOS_DEBUG
+            #ifdef TRINITY_DEBUG
             if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
                 sLog.outDebug("Object %u (Type: %u) out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target));
@@ -17119,5 +17312,5 @@
                 m_clientGUIDs.insert(target->GetGUID());
 
-            #ifdef MANGOS_DEBUG
+            #ifdef TRINITY_DEBUG
             if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
                 sLog.outDebug("Object %u (Type: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target));
@@ -17158,5 +17351,5 @@
             m_clientGUIDs.erase(target->GetGUID());
 
-            #ifdef MANGOS_DEBUG
+            #ifdef TRINITY_DEBUG
             if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
                 sLog.outDebug("Object %u (Type: %u, Entry: %u) is out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target));
@@ -17173,5 +17366,5 @@
             UpdateVisibilityOf_helper(m_clientGUIDs,target);
 
-            #ifdef MANGOS_DEBUG
+            #ifdef TRINITY_DEBUG
             if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
                 sLog.outDebug("Object %u (Type: %u, Entry: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target));
@@ -17822,4 +18015,9 @@
 }
 
+OutdoorPvP * Player::GetOutdoorPvP() const
+{
+    return sOutdoorPvPMgr.GetOutdoorPvPToZoneId(GetZoneId());
+}
+
 bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item const* ignoreItem)
 {
@@ -17962,10 +18160,10 @@
         if(member_with_max_level)
         {
-            xp = PvP ? 0 : MaNGOS::XP::Gain(member_with_max_level, pVictim);
+            xp = PvP ? 0 : Trinity::XP::Gain(member_with_max_level, pVictim);
 
             // skip in check PvP case (for speed, not used)
             bool is_raid = PvP ? false : sMapStore.LookupEntry(GetMapId())->IsRaid() && pGroup->isRaidGroup();
             bool is_dungeon = PvP ? false : sMapStore.LookupEntry(GetMapId())->IsDungeon();
-            float group_rate = MaNGOS::XP::xp_in_group_rate(count,is_raid);
+            float group_rate = Trinity::XP::xp_in_group_rate(count,is_raid);
 
             for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
@@ -18014,5 +18212,5 @@
     else                                                    // if (!pGroup)
     {
-        xp = PvP ? 0 : MaNGOS::XP::Gain(this, pVictim);
+        xp = PvP ? 0 : Trinity::XP::Gain(this, pVictim);
 
         // honor can be in PvP and !PvP (racial leader) cases
Index: trunk/src/game/ItemEnchantmentMgr.h
===================================================================
--- trunk/src/game/ItemEnchantmentMgr.h (revision 2)
+++ trunk/src/game/ItemEnchantmentMgr.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/GridNotifiersImpl.h
===================================================================
--- trunk/src/game/GridNotifiersImpl.h (revision 2)
+++ trunk/src/game/GridNotifiersImpl.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_GRIDNOTIFIERSIMPL_H
-#define MANGOS_GRIDNOTIFIERSIMPL_H
+#ifndef TRINITY_GRIDNOTIFIERSIMPL_H
+#define TRINITY_GRIDNOTIFIERSIMPL_H
 
 #include "GridNotifiers.h"
@@ -30,5 +32,5 @@
 template<class T>
 inline void
-MaNGOS::VisibleNotifier::Visit(GridRefManager<T> &m)
+Trinity::VisibleNotifier::Visit(GridRefManager<T> &m)
 {
     for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
@@ -40,5 +42,5 @@
 
 inline void
-MaNGOS::ObjectUpdater::Visit(CreatureMapType &m)
+Trinity::ObjectUpdater::Visit(CreatureMapType &m)
 {
     for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
@@ -48,5 +50,5 @@
 
 inline void
-MaNGOS::PlayerRelocationNotifier::Visit(PlayerMapType &m)
+Trinity::PlayerRelocationNotifier::Visit(PlayerMapType &m)
 {
     for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
@@ -94,5 +96,5 @@
 
 inline void
-MaNGOS::PlayerRelocationNotifier::Visit(CreatureMapType &m)
+Trinity::PlayerRelocationNotifier::Visit(CreatureMapType &m)
 {
     if(!i_player.isAlive() || i_player.isInFlight())
@@ -106,5 +108,5 @@
 template<>
 inline void
-MaNGOS::CreatureRelocationNotifier::Visit(PlayerMapType &m)
+Trinity::CreatureRelocationNotifier::Visit(PlayerMapType &m)
 {
     if(!i_creature.isAlive())
@@ -118,5 +120,5 @@
 template<>
 inline void
-MaNGOS::CreatureRelocationNotifier::Visit(CreatureMapType &m)
+Trinity::CreatureRelocationNotifier::Visit(CreatureMapType &m)
 {
     if(!i_creature.isAlive())
@@ -131,5 +133,5 @@
 }
 
-inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
+inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target)
 {
     if(!target->isAlive() || target->isInFlight() )
@@ -181,5 +183,5 @@
 template<>
 inline void
-MaNGOS::DynamicObjectUpdater::Visit(CreatureMapType  &m)
+Trinity::DynamicObjectUpdater::Visit(CreatureMapType  &m)
 {
     for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
@@ -189,5 +191,5 @@
 template<>
 inline void
-MaNGOS::DynamicObjectUpdater::Visit(PlayerMapType  &m)
+Trinity::DynamicObjectUpdater::Visit(PlayerMapType  &m)
 {
     for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
@@ -200,5 +202,5 @@
 
 template<class Check>
-void MaNGOS::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m)
+void Trinity::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m)
 {
     // already found
@@ -217,39 +219,39 @@
 
 template<class Check>
-void MaNGOS::WorldObjectSearcher<Check>::Visit(PlayerMapType &m)
-{
-    // already found
-    if(i_object)
-        return;
-
-    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-    {
-        if(i_check(itr->getSource()))
-        {
-            i_object = itr->getSource();
-            return;
-        }
-    }
-}
-
-template<class Check>
-void MaNGOS::WorldObjectSearcher<Check>::Visit(CreatureMapType &m)
-{
-    // already found
-    if(i_object)
-        return;
-
-    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-    {
-        if(i_check(itr->getSource()))
-        {
-            i_object = itr->getSource();
-            return;
-        }
-    }
-}
-
-template<class Check>
-void MaNGOS::WorldObjectSearcher<Check>::Visit(CorpseMapType &m)
+void Trinity::WorldObjectSearcher<Check>::Visit(PlayerMapType &m)
+{
+    // already found
+    if(i_object)
+        return;
+
+    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+    {
+        if(i_check(itr->getSource()))
+        {
+            i_object = itr->getSource();
+            return;
+        }
+    }
+}
+
+template<class Check>
+void Trinity::WorldObjectSearcher<Check>::Visit(CreatureMapType &m)
+{
+    // already found
+    if(i_object)
+        return;
+
+    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+    {
+        if(i_check(itr->getSource()))
+        {
+            i_object = itr->getSource();
+            return;
+        }
+    }
+}
+
+template<class Check>
+void Trinity::WorldObjectSearcher<Check>::Visit(CorpseMapType &m)
 {
     // already found
@@ -268,5 +270,5 @@
 
 template<class Check>
-void MaNGOS::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m)
+void Trinity::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m)
 {
     // already found
@@ -285,21 +287,21 @@
 
 template<class Check>
-void MaNGOS::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m)
-{
-    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-        if(i_check(itr->getSource()))
-            i_objects.push_back(itr->getSource());
-}
-
-template<class Check>
-void MaNGOS::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m)
-{
-    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-        if(i_check(itr->getSource()))
-            i_objects.push_back(itr->getSource());
-}
-
-template<class Check>
-void MaNGOS::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m)
+void Trinity::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m)
+{
+    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+        if(i_check(itr->getSource()))
+            i_objects.push_back(itr->getSource());
+}
+
+template<class Check>
+void Trinity::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m)
+{
+    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+        if(i_check(itr->getSource()))
+            i_objects.push_back(itr->getSource());
+}
+
+template<class Check>
+void Trinity::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m)
 {
     for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
@@ -309,5 +311,5 @@
 
 template<class Check>
-void MaNGOS::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m)
+void Trinity::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m)
 {
     for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
@@ -317,5 +319,5 @@
 
 template<class Check>
-void MaNGOS::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m)
+void Trinity::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m)
 {
     for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
@@ -327,5 +329,5 @@
 
 template<class Check>
-void MaNGOS::GameObjectSearcher<Check>::Visit(GameObjectMapType &m)
+void Trinity::GameObjectSearcher<Check>::Visit(GameObjectMapType &m)
 {
     // already found
@@ -344,5 +346,5 @@
 
 template<class Check>
-void MaNGOS::GameObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
+void Trinity::GameObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
 {
     for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
@@ -354,5 +356,5 @@
 
 template<class Check>
-void MaNGOS::GameObjectListSearcher<Check>::Visit(GameObjectMapType &m)
+void Trinity::GameObjectListSearcher<Check>::Visit(GameObjectMapType &m)
 {
     for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
@@ -364,67 +366,67 @@
 
 template<class Check>
-void MaNGOS::UnitSearcher<Check>::Visit(CreatureMapType &m)
-{
-    // already found
-    if(i_object)
-        return;
-
-    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-    {
-        if(i_check(itr->getSource()))
-        {
-            i_object = itr->getSource();
-            return;
-        }
-    }
-}
-
-template<class Check>
-void MaNGOS::UnitSearcher<Check>::Visit(PlayerMapType &m)
-{
-    // already found
-    if(i_object)
-        return;
-
-    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-    {
-        if(i_check(itr->getSource()))
-        {
-            i_object = itr->getSource();
-            return;
-        }
-    }
-}
-
-template<class Check>
-void MaNGOS::UnitLastSearcher<Check>::Visit(CreatureMapType &m)
-{
-    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-    {
-        if(i_check(itr->getSource()))
-            i_object = itr->getSource();
-    }
-}
-
-template<class Check>
-void MaNGOS::UnitLastSearcher<Check>::Visit(PlayerMapType &m)
-{
-    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-    {
-        if(i_check(itr->getSource()))
-            i_object = itr->getSource();
-    }
-}
-
-template<class Check>
-void MaNGOS::UnitListSearcher<Check>::Visit(PlayerMapType &m)
-{
-    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-        if(i_check(itr->getSource()))
-            i_objects.push_back(itr->getSource());
-}
-
-template<class Check>
-void MaNGOS::UnitListSearcher<Check>::Visit(CreatureMapType &m)
+void Trinity::UnitSearcher<Check>::Visit(CreatureMapType &m)
+{
+    // already found
+    if(i_object)
+        return;
+
+    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+    {
+        if(i_check(itr->getSource()))
+        {
+            i_object = itr->getSource();
+            return;
+        }
+    }
+}
+
+template<class Check>
+void Trinity::UnitSearcher<Check>::Visit(PlayerMapType &m)
+{
+    // already found
+    if(i_object)
+        return;
+
+    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+    {
+        if(i_check(itr->getSource()))
+        {
+            i_object = itr->getSource();
+            return;
+        }
+    }
+}
+
+template<class Check>
+void Trinity::UnitLastSearcher<Check>::Visit(CreatureMapType &m)
+{
+    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+    {
+        if(i_check(itr->getSource()))
+            i_object = itr->getSource();
+    }
+}
+
+template<class Check>
+void Trinity::UnitLastSearcher<Check>::Visit(PlayerMapType &m)
+{
+    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+    {
+        if(i_check(itr->getSource()))
+            i_object = itr->getSource();
+    }
+}
+
+template<class Check>
+void Trinity::UnitListSearcher<Check>::Visit(PlayerMapType &m)
+{
+    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+        if(i_check(itr->getSource()))
+            i_objects.push_back(itr->getSource());
+}
+
+template<class Check>
+void Trinity::UnitListSearcher<Check>::Visit(CreatureMapType &m)
 {
     for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
@@ -436,54 +438,54 @@
 
 template<class Check>
-void MaNGOS::CreatureSearcher<Check>::Visit(CreatureMapType &m)
-{
-    // already found
-    if(i_object)
-        return;
-
-    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-    {
-        if(i_check(itr->getSource()))
-        {
-            i_object = itr->getSource();
-            return;
-        }
-    }
-}
-
-template<class Check>
-void MaNGOS::CreatureLastSearcher<Check>::Visit(CreatureMapType &m)
-{
-    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-    {
-        if(i_check(itr->getSource()))
-            i_object = itr->getSource();
-    }
-}
-
-template<class Check>
-void MaNGOS::CreatureListSearcher<Check>::Visit(CreatureMapType &m)
-{
-    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-        if(i_check(itr->getSource()))
-            i_objects.push_back(itr->getSource());
-}
-
-template<class Check>
-void MaNGOS::PlayerSearcher<Check>::Visit(PlayerMapType &m)
-{
-    // already found
-    if(i_object)
-        return;
-
-    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
-    {
-        if(i_check(itr->getSource()))
-        {
-            i_object = itr->getSource();
-            return;
-        }
-    }
-}
-
-#endif                                                      // MANGOS_GRIDNOTIFIERSIMPL_H
+void Trinity::CreatureSearcher<Check>::Visit(CreatureMapType &m)
+{
+    // already found
+    if(i_object)
+        return;
+
+    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+    {
+        if(i_check(itr->getSource()))
+        {
+            i_object = itr->getSource();
+            return;
+        }
+    }
+}
+
+template<class Check>
+void Trinity::CreatureLastSearcher<Check>::Visit(CreatureMapType &m)
+{
+    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+    {
+        if(i_check(itr->getSource()))
+            i_object = itr->getSource();
+    }
+}
+
+template<class Check>
+void Trinity::CreatureListSearcher<Check>::Visit(CreatureMapType &m)
+{
+    for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+        if(i_check(itr->getSource()))
+            i_objects.push_back(itr->getSource());
+}
+
+template<class Check>
+void Trinity::PlayerSearcher<Check>::Visit(PlayerMapType &m)
+{
+    // already found
+    if(i_object)
+        return;
+
+    for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+    {
+        if(i_check(itr->getSource()))
+        {
+            i_object = itr->getSource();
+            return;
+        }
+    }
+}
+
+#endif                                                      // TRINITY_GRIDNOTIFIERSIMPL_H
Index: trunk/src/game/BattleGround.h
===================================================================
--- trunk/src/game/BattleGround.h (revision 34)
+++ trunk/src/game/BattleGround.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -447,5 +449,5 @@
         void DoorOpen(uint32 type);
         void DoorClose(uint32 type);
-        const char *GetMangosString(int32 entry);
+        const char *GetTrinityString(int32 entry);
 
         virtual bool HandlePlayerUnderMap(Player * plr) {return false;}
Index: trunk/src/game/AccountMgr.cpp
===================================================================
--- trunk/src/game/AccountMgr.cpp (revision 22)
+++ trunk/src/game/AccountMgr.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/PetAI.cpp
===================================================================
--- trunk/src/game/PetAI.cpp (revision 2)
+++ trunk/src/game/PetAI.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/RandomMovementGenerator.cpp
===================================================================
--- trunk/src/game/RandomMovementGenerator.cpp (revision 37)
+++ trunk/src/game/RandomMovementGenerator.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -52,6 +54,6 @@
 
     // prevent invalid coordinates generation 
-    MaNGOS::NormalizeMapCoord(nx);
-    MaNGOS::NormalizeMapCoord(ny);
+    Trinity::NormalizeMapCoord(nx);
+    Trinity::NormalizeMapCoord(ny);
 
     dist = (nx - X)*(nx - X) + (ny - Y)*(ny - Y);
Index: trunk/src/game/Item.h
===================================================================
--- trunk/src/game/Item.h (revision 2)
+++ trunk/src/game/Item.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_ITEM_H
-#define MANGOSSERVER_ITEM_H
+#ifndef TRINITYCORE_ITEM_H
+#define TRINITYCORE_ITEM_H
 
 #include "Common.h"
@@ -192,5 +194,5 @@
 bool ItemCanGoIntoBag(ItemPrototype const *proto, ItemPrototype const *pBagProto);
 
-class MANGOS_DLL_SPEC Item : public Object
+class TRINITY_DLL_SPEC Item : public Object
 {
     public:
Index: trunk/src/game/Guild.h
===================================================================
--- trunk/src/game/Guild.h (revision 37)
+++ trunk/src/game/Guild.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_GUILD_H
-#define MANGOSSERVER_GUILD_H
+#ifndef TRINITYCORE_GUILD_H
+#define TRINITYCORE_GUILD_H
 
 #define WITHDRAW_MONEY_UNLIMITED    0xFFFFFFFF
Index: trunk/src/game/PointMovementGenerator.cpp
===================================================================
--- trunk/src/game/PointMovementGenerator.cpp (revision 37)
+++ trunk/src/game/PointMovementGenerator.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/SpellAuras.cpp
===================================================================
--- trunk/src/game/SpellAuras.cpp (revision 37)
+++ trunk/src/game/SpellAuras.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -41,4 +43,6 @@
 #include "Formulas.h"
 #include "BattleGround.h"
+#include "OutdoorPvP.h"
+#include "OutdoorPvPMgr.h"
 #include "CreatureAI.h"
 #include "Util.h"
@@ -663,13 +667,13 @@
                 case AREA_AURA_FRIEND:
                 {
-                    CellPair p(MaNGOS::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY()));
+                    CellPair p(Trinity::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY()));
                     Cell cell(p);
                     cell.data.Part.reserved = ALL_DISTRICT;
                     cell.SetNoCreate();
 
-                    MaNGOS::AnyFriendlyUnitInObjectRangeCheck u_check(caster, owner, m_radius);
-                    MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
-                    TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
-                    TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);
+                    Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(caster, owner, m_radius);
+                    Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
+                    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
+                    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);
                     CellLock<GridReadGuard> cell_lock(cell, p);
                     cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster));
@@ -679,13 +683,13 @@
                 case AREA_AURA_ENEMY:
                 {
-                    CellPair p(MaNGOS::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY()));
+                    CellPair p(Trinity::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY()));
                     Cell cell(p);
                     cell.data.Part.reserved = ALL_DISTRICT;
                     cell.SetNoCreate();
 
-                    MaNGOS::AnyAoETargetUnitInObjectRangeCheck u_check(caster, owner, m_radius); // No GetCharmer in searcher
-                    MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(targets, u_check);
-                    TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
-                    TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);
+                    Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(caster, owner, m_radius); // No GetCharmer in searcher
+                    Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(targets, u_check);
+                    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
+                    TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);
                     CellLock<GridReadGuard> cell_lock(cell, p);
                     cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster));
@@ -2812,5 +2816,5 @@
         // Soul Shard only from non-grey units
         if( spellInfo->EffectItemType[m_effIndex] == 6265 &&
-            (victim->getLevel() <= MaNGOS::XP::GetGrayLevel(caster->getLevel()) ||
+            (victim->getLevel() <= Trinity::XP::GetGrayLevel(caster->getLevel()) ||
              victim->GetTypeId()==TYPEID_UNIT && !((Player*)caster)->isAllowedToLoot((Creature*)victim)) )
             return;
@@ -3263,8 +3267,16 @@
     if(apply)
     {
-        // drop flag at stealth in bg
-        if(Real && m_target->GetTypeId()==TYPEID_PLAYER && ((Player*)m_target)->InBattleGround())
-            if(BattleGround *bg = ((Player*)m_target)->GetBattleGround())
-                bg->EventPlayerDroppedFlag((Player*)m_target);
+        if(Real && m_target->GetTypeId()==TYPEID_PLAYER)
+        {
+            // drop flag at stealth in bg
+            if(((Player*)m_target)->InBattleGround())
+            {
+                if(BattleGround *bg = ((Player*)m_target)->GetBattleGround())
+                    bg->EventPlayerDroppedFlag((Player*)m_target);
+            }
+            // remove player from the objective's active player count at stealth
+            if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP())
+                pvp->HandlePlayerActivityChanged((Player*)m_target);
+        }
 
         // only at real aura add
@@ -3310,5 +3322,10 @@
                 }
                 else
+                {
                     m_target->SetVisibility(VISIBILITY_ON);
+                    if(m_target->GetTypeId() == TYPEID_PLAYER)
+                        if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP())
+                            pvp->HandlePlayerActivityChanged((Player*)m_target);
+                }
             }
         }
@@ -3343,4 +3360,7 @@
             // apply glow vision
             m_target->SetFlag(PLAYER_FIELD_BYTES2,PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
+            // remove player from the objective's active player count at invisibility
+            if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP())
+                pvp->HandlePlayerActivityChanged((Player*)m_target);
 
             // drop flag at invisible in bg
@@ -3378,5 +3398,10 @@
                 // if have stealth aura then already have stealth visibility
                 if(!m_target->HasAuraType(SPELL_AURA_MOD_STEALTH))
+                {
                     m_target->SetVisibility(VISIBILITY_ON);
+                    if(m_target->GetTypeId() == TYPEID_PLAYER)
+                        if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP())
+                            pvp->HandlePlayerActivityChanged((Player*)m_target);
+                }
             }
         }
@@ -3820,4 +3845,6 @@
                 }
             }
+            else
+                sOutdoorPvPMgr.HandleDropFlag((Player*)m_target,GetSpellProto()->Id);
         }
     }
Index: trunk/src/game/ChatHandler.cpp
===================================================================
--- trunk/src/game/ChatHandler.cpp (revision 39)
+++ trunk/src/game/ChatHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -35,5 +37,4 @@
 #include "SpellAuras.h"
 #include "Language.h"
-#include "IRCClient.h"
 #include "Util.h"
 
@@ -130,5 +131,5 @@
         {
             std::string timeStr = secsToTimeString(m_muteTime - time(NULL));
-            SendNotification(GetMangosString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str());
+            SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str());
             return;
         }
@@ -429,6 +430,4 @@
                 break;
 
-            sIRC.Send_WoW_IRC(_player, channel, msg);
-
             if(ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
             {
@@ -448,5 +447,5 @@
                 {
                     if(msg.empty())
-                        msg  = GetMangosString(LANG_PLAYER_AFK_DEFAULT);
+                        msg  = GetTrinityString(LANG_PLAYER_AFK_DEFAULT);
                     _player->afkMsg = msg;
                 }
@@ -467,5 +466,5 @@
                 {
                     if(msg.empty())
-                        msg  = GetMangosString(LANG_PLAYER_DND_DEFAULT);
+                        msg  = GetTrinityString(LANG_PLAYER_DND_DEFAULT);
                     _player->dndMsg = msg;
                 }
@@ -501,5 +500,5 @@
     {
         std::string timeStr = secsToTimeString(m_muteTime - time(NULL));
-        SendNotification(GetMangosString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str());
+        SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str());
         return;
     }
Index: trunk/src/game/OutdoorPvPSI.cpp
===================================================================
--- trunk/src/game/OutdoorPvPSI.cpp (revision 44)
+++ trunk/src/game/OutdoorPvPSI.cpp (revision 44)
@@ -0,0 +1,244 @@
+#include "OutdoorPvPSI.h"
+#include "WorldPacket.h"
+#include "Player.h"
+#include "GameObject.h"
+#include "MapManager.h"
+#include "ObjectMgr.h"
+#include "OutdoorPvPMgr.h"
+#include "Language.h"
+#include "World.h"
+
+OutdoorPvPSI::OutdoorPvPSI()
+{
+    m_TypeId = OUTDOOR_PVP_SI;
+    m_Gathered_A = 0;
+    m_Gathered_H = 0;
+    m_LastController = 0;
+}
+
+void OutdoorPvPSI::FillInitialWorldStates(WorldPacket &data)
+{
+    data << SI_GATHERED_A << m_Gathered_A;
+    data << SI_GATHERED_H << m_Gathered_H;
+    data << SI_SILITHYST_MAX << SI_MAX_RESOURCES;
+}
+
+void OutdoorPvPSI::SendRemoveWorldStates(Player *plr)
+{
+    plr->SendUpdateWorldState(SI_GATHERED_A,0);
+    plr->SendUpdateWorldState(SI_GATHERED_H,0);
+    plr->SendUpdateWorldState(SI_SILITHYST_MAX,0);
+}
+
+void OutdoorPvPSI::UpdateWorldState()
+{
+    SendUpdateWorldState(SI_GATHERED_A,m_Gathered_A);
+    SendUpdateWorldState(SI_GATHERED_H,m_Gathered_H);
+    SendUpdateWorldState(SI_SILITHYST_MAX,SI_MAX_RESOURCES);
+}
+
+bool OutdoorPvPSI::SetupOutdoorPvP()
+{
+    for(int i = 0; i < OutdoorPvPSIBuffZonesNum; ++i)
+        sOutdoorPvPMgr.AddZone(OutdoorPvPSIBuffZones[i],this);
+    return true;
+}
+
+bool OutdoorPvPSI::Update(uint32 diff)
+{
+    return false;
+}
+
+void OutdoorPvPSI::HandlePlayerEnterZone(Player * plr, uint32 zone)
+{
+    if(plr->GetTeam() == m_LastController)
+        plr->CastSpell(plr,SI_CENARION_FAVOR,true);
+    OutdoorPvP::HandlePlayerEnterZone(plr,zone);
+}
+
+void OutdoorPvPSI::HandlePlayerLeaveZone(Player * plr, uint32 zone)
+{
+    // remove buffs
+    plr->RemoveAurasDueToSpell(SI_CENARION_FAVOR);
+    OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
+}
+
+void OutdoorPvPSI::BuffTeam(uint32 team)
+{
+    if(team == ALLIANCE)
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->CastSpell(plr,SI_CENARION_FAVOR,true);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(SI_CENARION_FAVOR);
+        }
+    }
+    else if(team == HORDE)
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->CastSpell(plr,SI_CENARION_FAVOR,true);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(SI_CENARION_FAVOR);
+        }
+    }
+    else
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(SI_CENARION_FAVOR);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(SI_CENARION_FAVOR);
+        }
+    }
+}
+
+bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger)
+{
+    switch(trigger)
+    {
+    case SI_AREATRIGGER_A:
+        if(plr->GetTeam() == ALLIANCE && plr->HasAura(SI_SILITHYST_FLAG,0))
+        {
+            // remove aura
+            plr->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
+            ++ m_Gathered_A;
+            if(m_Gathered_A >= SI_MAX_RESOURCES)
+            {
+                BuffTeam(ALLIANCE);
+                sWorld.SendZoneText(OutdoorPvPSIBuffZones[0],objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_A));
+                m_LastController = ALLIANCE;
+                m_Gathered_A = 0;
+                m_Gathered_H = 0;
+            }
+            UpdateWorldState();
+            // reward player
+            plr->CastSpell(plr,SI_TRACES_OF_SILITHYST,true);
+            // add 19 honor
+            plr->RewardHonor(NULL,1,19);
+            // add 20 cenarion circle repu
+            plr->ModifyFactionReputation(609,20);
+            // complete quest
+            plr->KilledMonster(SI_TURNIN_QUEST_CM_A,0);
+        }
+        return true;
+    case SI_AREATRIGGER_H:
+        if(plr->GetTeam() == HORDE && plr->HasAura(SI_SILITHYST_FLAG,0))
+        {
+            // remove aura
+            plr->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
+            ++ m_Gathered_H;
+            if(m_Gathered_H >= SI_MAX_RESOURCES)
+            {
+                BuffTeam(HORDE);
+                sWorld.SendZoneText(OutdoorPvPSIBuffZones[0],objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_H));
+                m_LastController = HORDE;
+                m_Gathered_A = 0;
+                m_Gathered_H = 0;
+            }
+            UpdateWorldState();
+            // reward player
+            plr->CastSpell(plr,SI_TRACES_OF_SILITHYST,true);
+            // add 19 honor
+            plr->RewardHonor(NULL,1,19);
+            // add 20 cenarion circle repu
+            plr->ModifyFactionReputation(609,20);
+            // complete quest
+            plr->KilledMonster(SI_TURNIN_QUEST_CM_H,0);
+        }
+        return true;
+    }
+    return false;
+}
+
+bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId)
+{
+    if(spellId == SI_SILITHYST_FLAG)
+    {
+        // if it was dropped away from the player's turn-in point, then create a silithyst mound, if it was dropped near the areatrigger, then it was dispelled by the outdoorpvp, so do nothing
+        switch(plr->GetTeam())
+        {
+        case ALLIANCE:
+            {
+                AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(SI_AREATRIGGER_A);
+                if(atEntry)
+                {
+                    // 5.0f is safe-distance
+                    if(plr->GetDistance(atEntry->x,atEntry->y,atEntry->z) > 5.0f + atEntry->radius)
+                    {
+                        // he dropped it further, summon mound
+                        GameObject * go = new GameObject;
+                        Map * map = MapManager::Instance().GetMap(plr->GetMapId(), plr);
+                        if(!map)
+                            return true;
+                        if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1))
+                        {
+                            delete go;                
+                        }
+                        else
+                        {
+                            go->SetRespawnTime(0);
+                            map->Add(go);
+                        }
+                    }
+                }
+            }
+            break;
+        case HORDE:
+            {
+                AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(SI_AREATRIGGER_H);
+                if(atEntry)
+                {
+                    // 5.0f is safe-distance
+                    if(plr->GetDistance(atEntry->x,atEntry->y,atEntry->z) > 5.0f + atEntry->radius)
+                    {
+                        // he dropped it further, summon mound
+                        GameObject * go = new GameObject;
+                        Map * map = MapManager::Instance().GetMap(plr->GetMapId(), plr);
+                        if(!map)
+                            return true;
+                        if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map ,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1))
+                        {
+                            delete go;                
+                        }
+                        else
+                        {
+                            go->SetRespawnTime(0);
+                            map->Add(go);
+                        }
+                    }
+                }
+            }
+            break;
+        }
+        return true;
+    }
+    return false;
+}
+
+bool OutdoorPvPSI::HandleCustomSpell(Player *plr, uint32 spellId, GameObject *go)
+{
+    if(!go || spellId != SI_SILITHYST_FLAG_GO_SPELL)
+        return false;
+    plr->CastSpell(plr,SI_SILITHYST_FLAG,true);
+    if(go->GetGOInfo()->id == SI_SILITHYST_MOUND)
+    {
+        // despawn go
+        go->SetRespawnTime(0);
+        go->Delete();
+    }
+    return true;
+}
Index: trunk/src/game/NPCHandler.cpp
===================================================================
--- trunk/src/game/NPCHandler.cpp (revision 37)
+++ trunk/src/game/NPCHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -111,5 +113,5 @@
 void WorldSession::SendTrainerList( uint64 guid )
 {
-    std::string str = GetMangosString(LANG_NPC_TAINER_HELLO);
+    std::string str = GetTrinityString(LANG_NPC_TAINER_HELLO);
     SendTrainerList( guid, str );
 }
Index: trunk/src/game/OutdoorPvPHP.h
===================================================================
--- trunk/src/game/OutdoorPvPHP.h (revision 44)
+++ trunk/src/game/OutdoorPvPHP.h (revision 44)
@@ -0,0 +1,100 @@
+#ifndef OUTDOOR_PVP_HP_
+#define OUTDOOR_PVP_HP_
+
+#include "OutdoorPvP.h"
+
+#define OutdoorPvPHPBuffZonesNum 6
+                                                         //  HP, citadel, ramparts, blood furnace, shattered halls, mag's lair
+const uint32 OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum] = { 3483, 3563, 3562, 3713, 3714, 3836 };
+
+const uint32 AllianceBuff = 32071;
+
+const uint32 HordeBuff = 32049;
+
+const uint32 AlliancePlayerKillReward = 32155;
+
+const uint32 HordePlayerKillReward = 32158;
+
+enum OutdoorPvPHPTowerType{
+    HP_TOWER_BROKEN_HILL = 0,
+    HP_TOWER_OVERLOOK = 1,
+    HP_TOWER_STADIUM = 2,
+    HP_TOWER_NUM = 3
+};
+
+const uint32 HP_CREDITMARKER[HP_TOWER_NUM] = {19032,19028,19029};
+
+const uint32 HP_CapturePointEvent_Enter[HP_TOWER_NUM] = {11404,11396,11388};
+
+const uint32 HP_CapturePointEvent_Leave[HP_TOWER_NUM] = {11403,11395,11387};
+
+enum OutdoorPvPHPWorldStates{
+    HP_UI_TOWER_DISPLAY_A = 0x9ba,
+    HP_UI_TOWER_DISPLAY_H = 0x9b9,
+
+    HP_UI_TOWER_COUNT_H = 0x9ae,
+    HP_UI_TOWER_COUNT_A = 0x9ac,
+
+    HP_UI_TOWER_SLIDER_N = 2475,
+    HP_UI_TOWER_SLIDER_POS = 2474,
+    HP_UI_TOWER_SLIDER_DISPLAY = 2473
+};
+
+const uint32 HP_MAP_N[HP_TOWER_NUM] = {0x9b5,0x9b2,0x9a8};
+
+const uint32 HP_MAP_A[HP_TOWER_NUM] = {0x9b3,0x9b0,0x9a7};
+
+const uint32 HP_MAP_H[HP_TOWER_NUM] = {0x9b4,0x9b1,0x9a6};
+
+const uint32 HP_TowerArtKit_A[HP_TOWER_NUM] = {65,62,67};
+
+const uint32 HP_TowerArtKit_H[HP_TOWER_NUM] = {64,61,68};
+
+const uint32 HP_TowerArtKit_N[HP_TOWER_NUM] = {66,63,69};
+
+const go_type HPCapturePoints[HP_TOWER_NUM] = {
+    {182175,530,-471.462,3451.09,34.6432,0.174533,0,0,0.087156,0.996195},      // 0 - Broken Hill
+    {182174,530,-184.889,3476.93,38.205,-0.017453,0,0,0.008727,-0.999962},     // 1 - Overlook
+    {182173,530,-290.016,3702.42,56.6729,0.034907,0,0,0.017452,0.999848}     // 2 - Stadium
+};
+
+const go_type HPTowerFlags[HP_TOWER_NUM] = {
+    {183514,530,-467.078,3528.17,64.7121,3.14159,0,0,1,0},  // 0 broken hill
+    {182525,530,-187.887,3459.38,60.0403,-3.12414,0,0,0.999962,-0.008727}, // 1 overlook
+    {183515,530,-289.610,3696.83,75.9447,3.12414,0,0,0.999962,0.008727} // 2 stadium
+};
+
+class OutdoorPvPObjectiveHP : public OutdoorPvPObjective
+{
+public:
+    OutdoorPvPObjectiveHP(OutdoorPvP * pvp, OutdoorPvPHPTowerType type);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket & data);
+    // used when player is activated/inactivated in the area
+    bool HandlePlayerEnter(Player * plr);
+    void HandlePlayerLeave(Player * plr);
+    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
+private:
+    OutdoorPvPHPTowerType m_TowerType;
+};
+
+class OutdoorPvPHP : public OutdoorPvP
+{
+friend class OutdoorPvPObjectiveHP;
+public:
+    OutdoorPvPHP();
+    bool SetupOutdoorPvP();
+    void HandlePlayerEnterZone(Player *plr, uint32 zone);
+    void HandlePlayerLeaveZone(Player *plr, uint32 zone);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket &data);
+    void SendRemoveWorldStates(Player * plr);
+    void HandleKillImpl(Player * plr, Unit * killed);
+    void BuffTeam(uint32 team);
+private:
+    // how many towers are controlled
+    uint32 m_AllianceTowersControlled;
+    uint32 m_HordeTowersControlled;
+};
+
+#endif
Index: trunk/src/game/Spell.cpp
===================================================================
--- trunk/src/game/Spell.cpp (revision 37)
+++ trunk/src/game/Spell.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -184,5 +186,5 @@
 
         *data >> m_srcX >> m_srcY >> m_srcZ;
-        if(!MaNGOS::IsValidMapCoord(m_srcX, m_srcY, m_srcZ))
+        if(!Trinity::IsValidMapCoord(m_srcX, m_srcY, m_srcZ))
             return false;
     }
@@ -194,5 +196,5 @@
 
         *data >> m_destX >> m_destY >> m_destZ;
-        if(!MaNGOS::IsValidMapCoord(m_destX, m_destY, m_destZ))
+        if(!Trinity::IsValidMapCoord(m_destX, m_destY, m_destZ))
             return false;
     }
@@ -464,5 +466,5 @@
                             float max_range = GetSpellMaxRange(srange);
 
-                            CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+                            CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
                             Cell cell(p);
                             cell.data.Part.reserved = ALL_DISTRICT;
@@ -471,8 +473,8 @@
                             WorldObject* result = NULL;
 
-                            MaNGOS::CannibalizeObjectCheck u_check(m_caster, max_range);
-                            MaNGOS::WorldObjectSearcher<MaNGOS::CannibalizeObjectCheck > searcher(result, u_check);
-
-                            TypeContainerVisitor<MaNGOS::WorldObjectSearcher<MaNGOS::CannibalizeObjectCheck >, GridTypeMapContainer > grid_searcher(searcher);
+                            Trinity::CannibalizeObjectCheck u_check(m_caster, max_range);
+                            Trinity::WorldObjectSearcher<Trinity::CannibalizeObjectCheck > searcher(result, u_check);
+
+                            TypeContainerVisitor<Trinity::WorldObjectSearcher<Trinity::CannibalizeObjectCheck >, GridTypeMapContainer > grid_searcher(searcher);
                             CellLock<GridReadGuard> cell_lock(cell, p);
                             cell_lock->Visit(cell_lock, grid_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
@@ -480,5 +482,5 @@
                             if(!result)
                             {
-                                TypeContainerVisitor<MaNGOS::WorldObjectSearcher<MaNGOS::CannibalizeObjectCheck >, WorldTypeMapContainer > world_searcher(searcher);
+                                TypeContainerVisitor<Trinity::WorldObjectSearcher<Trinity::CannibalizeObjectCheck >, WorldTypeMapContainer > world_searcher(searcher);
                                 cell_lock->Visit(cell_lock, world_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
                             }
@@ -1202,5 +1204,5 @@
             float max_range = radius + unMaxTargets * CHAIN_SPELL_JUMP_RADIUS;
 
-            CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+            CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
             Cell cell(p);
             cell.data.Part.reserved = ALL_DISTRICT;
@@ -1210,9 +1212,9 @@
 
             {
-                MaNGOS::AnyAoETargetUnitInObjectRangeCheck u_check(m_caster, m_caster, max_range);
-                MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(tempUnitMap, u_check);
-
-                TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
-                TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);
+                Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_caster, m_caster, max_range);
+                Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(tempUnitMap, u_check);
+
+                TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
+                TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);
 
                 CellLock<GridReadGuard> cell_lock(cell, p);
@@ -1298,5 +1300,5 @@
                     max_range = radius + unMaxTargets * CHAIN_SPELL_JUMP_RADIUS;
 
-                CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+                CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
                 Cell cell(p);
                 cell.data.Part.reserved = ALL_DISTRICT;
@@ -1309,9 +1311,9 @@
 
                     {
-                        MaNGOS::AnyAoETargetUnitInObjectRangeCheck u_check(pUnitTarget, originalCaster, max_range);
-                        MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(tempUnitMap, u_check);
-
-                        TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
-                        TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);
+                        Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(pUnitTarget, originalCaster, max_range);
+                        Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(tempUnitMap, u_check);
+
+                        TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
+                        TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);
 
                         CellLock<GridReadGuard> cell_lock(cell, p);
@@ -1363,13 +1365,13 @@
             if (m_spellInfo->Effect[i]!=SPELL_EFFECT_PERSISTENT_AREA_AURA)
             {
-                CellPair p(MaNGOS::ComputeCellPair(m_targets.m_destX, m_targets.m_destY));
+                CellPair p(Trinity::ComputeCellPair(m_targets.m_destX, m_targets.m_destY));
                 Cell cell(p);
                 cell.data.Part.reserved = ALL_DISTRICT;
                 cell.SetNoCreate();
 
-                MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, PUSH_DEST_CENTER,SPELL_TARGETS_AOE_DAMAGE);
-
-                TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
-                TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
+                Trinity::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, PUSH_DEST_CENTER,SPELL_TARGETS_AOE_DAMAGE);
+
+                TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
+                TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
 
                 CellLock<GridReadGuard> cell_lock(cell, p);
@@ -1446,13 +1448,13 @@
         case TARGET_ALL_AROUND_CASTER:
         {
-            CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+            CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
             Cell cell(p);
             cell.data.Part.reserved = ALL_DISTRICT;
             cell.SetNoCreate();
 
-            MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, PUSH_SELF_CENTER,SPELL_TARGETS_AOE_DAMAGE);
-
-            TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
-            TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
+            Trinity::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, PUSH_SELF_CENTER,SPELL_TARGETS_AOE_DAMAGE);
+
+            TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
+            TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
 
             CellLock<GridReadGuard> cell_lock(cell, p);
@@ -1462,13 +1464,13 @@
         case TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER:
         {
-            CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+            CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
             Cell cell(p);
             cell.data.Part.reserved = ALL_DISTRICT;
             cell.SetNoCreate();
 
-            MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, PUSH_SELF_CENTER,SPELL_TARGETS_FRIENDLY);
-
-            TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
-            TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
+            Trinity::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, PUSH_SELF_CENTER,SPELL_TARGETS_FRIENDLY);
+
+            TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
+            TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
 
             CellLock<GridReadGuard> cell_lock(cell, p);
@@ -1478,13 +1480,13 @@
         case TARGET_ALL_FRIENDLY_UNITS_IN_AREA:
         {
-            CellPair p(MaNGOS::ComputeCellPair(m_targets.m_destX, m_targets.m_destY));
+            CellPair p(Trinity::ComputeCellPair(m_targets.m_destX, m_targets.m_destY));
             Cell cell(p);
             cell.data.Part.reserved = ALL_DISTRICT;
             cell.SetNoCreate();
 
-            MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, PUSH_DEST_CENTER,SPELL_TARGETS_FRIENDLY);
-
-            TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
-            TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
+            Trinity::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, PUSH_DEST_CENTER,SPELL_TARGETS_FRIENDLY);
+
+            TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
+            TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
 
             CellLock<GridReadGuard> cell_lock(cell, p);
@@ -1554,5 +1556,5 @@
         case TARGET_IN_FRONT_OF_CASTER:
         {
-            CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+            CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
             Cell cell(p);
             cell.data.Part.reserved = ALL_DISTRICT;
@@ -1560,8 +1562,8 @@
 
             bool inFront = m_spellInfo->SpellVisual != 3879;
-            MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, inFront ? PUSH_IN_FRONT : PUSH_IN_BACK,SPELL_TARGETS_AOE_DAMAGE);
-
-            TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
-            TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
+            Trinity::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, inFront ? PUSH_IN_FRONT : PUSH_IN_BACK,SPELL_TARGETS_AOE_DAMAGE);
+
+            TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
+            TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
 
             CellLock<GridReadGuard> cell_lock(cell, p);
@@ -1605,13 +1607,13 @@
             if (m_spellInfo->Effect[i]!=SPELL_EFFECT_PERSISTENT_AREA_AURA)
             {
-                CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+                CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
                 Cell cell(p);
                 cell.data.Part.reserved = ALL_DISTRICT;
                 cell.SetNoCreate();
 
-                MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, PUSH_DEST_CENTER,SPELL_TARGETS_AOE_DAMAGE);
-
-                TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
-                TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
+                Trinity::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, PUSH_DEST_CENTER,SPELL_TARGETS_AOE_DAMAGE);
+
+                TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
+                TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
 
                 CellLock<GridReadGuard> cell_lock(cell, p);
@@ -1724,13 +1726,13 @@
 
                 {
-                    CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+                    CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
                     Cell cell(p);
                     cell.data.Part.reserved = ALL_DISTRICT;
                     cell.SetNoCreate();
 
-                    MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, tempUnitMap, max_range, PUSH_SELF_CENTER, SPELL_TARGETS_FRIENDLY);
-
-                    TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
-                    TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
+                    Trinity::SpellNotifierCreatureAndPlayer notifier(*this, tempUnitMap, max_range, PUSH_SELF_CENTER, SPELL_TARGETS_FRIENDLY);
+
+                    TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
+                    TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);
 
                     CellLock<GridReadGuard> cell_lock(cell, p);
@@ -1792,11 +1794,11 @@
                 if(m_spellInfo->EffectImplicitTargetB[i]==TARGET_ALL_ENEMY_IN_AREA_INSTANT)
                 {
-                    CellPair p(MaNGOS::ComputeCellPair(currentTarget->GetPositionX(), currentTarget->GetPositionY()));
+                    CellPair p(Trinity::ComputeCellPair(currentTarget->GetPositionX(), currentTarget->GetPositionY()));
                     Cell cell(p);
                     cell.data.Part.reserved = ALL_DISTRICT;
                     cell.SetNoCreate();
-                    MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius,PUSH_TARGET_CENTER, SPELL_TARGETS_AOE_DAMAGE);
-                    TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_notifier(notifier);
-                    TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_notifier(notifier);
+                    Trinity::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius,PUSH_TARGET_CENTER, SPELL_TARGETS_AOE_DAMAGE);
+                    TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_notifier(notifier);
+                    TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_notifier(notifier);
                     CellLock<GridReadGuard> cell_lock(cell, p);
                     cell_lock->Visit(cell_lock, world_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
@@ -1841,5 +1843,5 @@
                 if (m_spellInfo->EffectImplicitTargetB[i] && m_spellInfo->EffectImplicitTargetB[i]!=TARGET_TABLE_X_Y_Z_COORDINATES)
                 {
-                    CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+                    CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
                     Cell cell(p);
                     cell.data.Part.reserved = ALL_DISTRICT;
@@ -1851,8 +1853,8 @@
                         targetB = SPELL_TARGETS_FRIENDLY;
 
-                    MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius,PUSH_DEST_CENTER, targetB);
-
-                    TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_notifier(notifier);
-                    TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_notifier(notifier);
+                    Trinity::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius,PUSH_DEST_CENTER, targetB);
+
+                    TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_notifier(notifier);
+                    TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_notifier(notifier);
 
                     CellLock<GridReadGuard> cell_lock(cell, p);
@@ -3365,12 +3367,12 @@
                             if(i_spellST->second.targetEntry)
                             {
-                                CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+                                CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
                                 Cell cell(p);
                                 cell.data.Part.reserved = ALL_DISTRICT;
 
-                                MaNGOS::NearestGameObjectEntryInObjectRangeCheck go_check(*m_caster,i_spellST->second.targetEntry,range);
-                                MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck> checker(p_GameObject,go_check);
-
-                                TypeContainerVisitor<MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
+                                Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*m_caster,i_spellST->second.targetEntry,range);
+                                Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(p_GameObject,go_check);
+
+                                TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
                                 CellLock<GridReadGuard> cell_lock(cell, p);
                                 cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
@@ -3402,13 +3404,13 @@
                             Creature *p_Creature = NULL;
 
-                            CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+                            CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
                             Cell cell(p);
                             cell.data.Part.reserved = ALL_DISTRICT;
                             cell.SetNoCreate();             // Really don't know what is that???
 
-                            MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster,i_spellST->second.targetEntry,i_spellST->second.type!=SPELL_TARGET_TYPE_DEAD,range);
-                            MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(p_Creature, u_check);
-
-                            TypeContainerVisitor<MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer >  grid_creature_searcher(searcher);
+                            Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster,i_spellST->second.targetEntry,i_spellST->second.type!=SPELL_TARGET_TYPE_DEAD,range);
+                            Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(p_Creature, u_check);
+
+                            TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer >  grid_creature_searcher(searcher);
 
                             CellLock<GridReadGuard> cell_lock(cell, p);
@@ -4440,13 +4442,13 @@
     if(m_spellInfo->RequiresSpellFocus)
     {
-        CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+        CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
         Cell cell(p);
         cell.data.Part.reserved = ALL_DISTRICT;
 
         GameObject* ok = NULL;
-        MaNGOS::GameObjectFocusCheck go_check(m_caster,m_spellInfo->RequiresSpellFocus);
-        MaNGOS::GameObjectSearcher<MaNGOS::GameObjectFocusCheck> checker(ok,go_check);
-
-        TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectFocusCheck>, GridTypeMapContainer > object_checker(checker);
+        Trinity::GameObjectFocusCheck go_check(m_caster,m_spellInfo->RequiresSpellFocus);
+        Trinity::GameObjectSearcher<Trinity::GameObjectFocusCheck> checker(ok,go_check);
+
+        TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectFocusCheck>, GridTypeMapContainer > object_checker(checker);
         CellLock<GridReadGuard> cell_lock(cell, p);
         cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
Index: trunk/src/game/OutdoorPvPTF.h
===================================================================
--- trunk/src/game/OutdoorPvPTF.h (revision 44)
+++ trunk/src/game/OutdoorPvPTF.h (revision 44)
@@ -0,0 +1,117 @@
+#ifndef OUTDOOR_PVP_TF_
+#define OUTDOOR_PVP_TF_
+
+#include "OutdoorPvP.h"
+
+const uint32 OutdoorPvPTFBuffZonesNum = 5;
+
+const uint32 OutdoorPvPTFBuffZones[OutdoorPvPTFBuffZonesNum] = { 3519 /*Terokkar Forest*/, 3791 /*Sethekk Halls*/, 3789 /*Shadow Labyrinth*/, 3792 /*Mana-Tombs*/, 3790 /*Auchenai Crypts*/ };
+
+// locked for 6 hours after capture
+const uint32 TF_LOCK_TIME = 3600 * 6 * 1000;
+// update lock timer every 1/4 minute (overkill, but this way it's sure the timer won't "jump" 2 minutes at once.)
+const uint32 TF_LOCK_TIME_UPDATE = 15000;
+
+// blessing of auchindoun
+const uint32 TF_CAPTURE_BUFF = 33377;
+
+const uint32 TF_ALLY_QUEST = 11505;
+const uint32 TF_HORDE_QUEST = 11506;
+
+enum OutdoorPvPTF_TowerType{
+    TF_TOWER_NW = 0,
+    TF_TOWER_N,
+    TF_TOWER_NE,
+    TF_TOWER_SE,
+    TF_TOWER_S,
+    TF_TOWER_NUM
+};
+
+const go_type TFCapturePoints[TF_TOWER_NUM] = {
+    {183104,530,-3081.65,5335.03,17.1853,-2.14675,0,0,0.878817,-0.477159},
+    {183411,530,-2939.9,4788.73,18.987,2.77507,0,0,0.983255,0.182236},
+    {183412,530,-3174.94,4440.97,16.2281,1.86750,0,0.803857,0.594823},
+    {183413,530,-3603.31,4529.15,20.9077,0.994838,0,0,0.477159,0.878817},
+    {183414,530,-3812.37,4899.3,17.7249,0.087266,0,0,0.043619,0.999048}
+};
+
+struct tf_tower_world_state{
+    uint32 n;
+    uint32 h;
+    uint32 a;
+};
+
+const tf_tower_world_state TFTowerWorldStates[TF_TOWER_NUM] = {
+    {0xa79,0xa7a,0xa7b},
+    {0xa7e,0xa7d,0xa7c},
+    {0xa82,0xa81,0xa80},
+    {0xa88,0xa87,0xa86},
+    {0xa85,0xa84,0xa83}
+};
+
+const uint32 TFTowerPlayerEnterEvents[TF_TOWER_NUM] = {12226, 12497, 12486, 12499, 12501};
+
+const uint32 TFTowerPlayerLeaveEvents[TF_TOWER_NUM] = {12225, 12496, 12487, 12498, 12500};
+
+enum TFWorldStates{
+    TF_UI_TOWER_SLIDER_POS = 0xa41,
+    TF_UI_TOWER_SLIDER_N = 0xa40,
+    TF_UI_TOWER_SLIDER_DISPLAY = 0xa3f,
+
+    TF_UI_TOWER_COUNT_H = 0xa3e,
+    TF_UI_TOWER_COUNT_A = 0xa3d,
+    TF_UI_TOWERS_CONTROLLED_DISPLAY = 0xa3c,
+
+    TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT = 0x9d0,
+    TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT = 0x9ce,
+    TF_UI_LOCKED_TIME_HOURS = 0x9cd,
+    TF_UI_LOCKED_DISPLAY_NEUTRAL = 0x9cc,
+    TF_UI_LOCKED_DISPLAY_HORDE = 0xad0,
+    TF_UI_LOCKED_DISPLAY_ALLIANCE = 0xacf
+};
+
+enum TFTowerStates {
+    TF_TOWERSTATE_N = 1,
+    TF_TOWERSTATE_H = 2,
+    TF_TOWERSTATE_A = 4
+};
+
+class OutdoorPvPObjectiveTF : public OutdoorPvPObjective
+{
+public:
+    OutdoorPvPObjectiveTF(OutdoorPvP * pvp, OutdoorPvPTF_TowerType type);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket & data);
+    // used when player is activated/inactivated in the area
+    bool HandlePlayerEnter(Player * plr);
+    void HandlePlayerLeave(Player * plr);
+    void UpdateTowerState();
+protected:
+    virtual bool HandleCapturePointEvent(Player * plr, uint32 eventId);
+protected:
+    OutdoorPvPTF_TowerType m_TowerType;
+    uint32 m_TowerState;
+};
+
+class OutdoorPvPTF : public OutdoorPvP
+{
+friend class OutdoorPvPObjectiveTF;
+public:
+    OutdoorPvPTF();
+    bool SetupOutdoorPvP();
+    void HandlePlayerEnterZone(Player *plr, uint32 zone);
+    void HandlePlayerLeaveZone(Player *plr, uint32 zone);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket &data);
+    void SendRemoveWorldStates(Player * plr);
+    void BuffTeam(uint32 team);
+private:
+    bool m_IsLocked;
+    uint32 m_LockTimer;
+    uint32 m_LockTimerUpdate;
+    uint32 m_AllianceTowersControlled;
+    uint32 m_HordeTowersControlled;
+    uint32 hours_left, second_digit, first_digit;
+};
+
+#endif
Index: trunk/src/game/Mail.cpp
===================================================================
--- trunk/src/game/Mail.cpp (revision 2)
+++ trunk/src/game/Mail.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -451,5 +453,5 @@
 
                     if(!objmgr.GetPlayerNameByGUID(sender_guid,sender_name))
-                        sender_name = objmgr.GetMangosStringForDBCLocale(LANG_UNKNOWN);
+                        sender_name = objmgr.GetTrinityStringForDBCLocale(LANG_UNKNOWN);
                 }
                 sLog.outCommand("GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)",
Index: trunk/src/game/LootMgr.cpp
===================================================================
--- trunk/src/game/LootMgr.cpp (revision 2)
+++ trunk/src/game/LootMgr.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/ScriptCalls.cpp
===================================================================
--- trunk/src/game/ScriptCalls.cpp (revision 2)
+++ trunk/src/game/ScriptCalls.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -32,5 +34,5 @@
         //todo: some check if some func from script library is called right now
         Script->ScriptsFree();
-        MANGOS_CLOSE_LIBRARY(Script->hScriptsLib);
+        TRINITY_CLOSE_LIBRARY(Script->hScriptsLib);
         delete Script;
         Script = NULL;
@@ -42,8 +44,8 @@
     ScriptsSet testScript=new _ScriptSet;
 
-    std::string name = strlen(libName) ? libName : MANGOS_SCRIPT_NAME;
-    name += MANGOS_SCRIPT_EXT;
+    std::string name = strlen(libName) ? libName : TRINITY_SCRIPT_NAME;
+    name += TRINITY_SCRIPT_EXT;
 
-    testScript->hScriptsLib=MANGOS_LOAD_LIBRARY(name.c_str());
+    testScript->hScriptsLib=TRINITY_LOAD_LIBRARY(name.c_str());
 
     if(!testScript->hScriptsLib )
@@ -54,29 +56,29 @@
     }
 
-    if(   !(testScript->ScriptsInit         =(scriptCallScriptsInit         )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ScriptsInit"         ))
-        ||!(testScript->ScriptsFree         =(scriptCallScriptsFree         )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ScriptsFree"         ))
-        ||!(testScript->GossipHello         =(scriptCallGossipHello         )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GossipHello"         ))
-        ||!(testScript->GOChooseReward      =(scriptCallGOChooseReward      )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GOChooseReward"      ))
-        ||!(testScript->QuestAccept         =(scriptCallQuestAccept         )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"QuestAccept"         ))
-        ||!(testScript->GossipSelect        =(scriptCallGossipSelect        )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GossipSelect"        ))
-        ||!(testScript->GossipSelectWithCode=(scriptCallGossipSelectWithCode)MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GossipSelectWithCode"))
-        ||!(testScript->QuestSelect         =(scriptCallQuestSelect         )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"QuestSelect"         ))
-        ||!(testScript->QuestComplete       =(scriptCallQuestComplete       )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"QuestComplete"       ))
-        ||!(testScript->NPCDialogStatus     =(scriptCallNPCDialogStatus     )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"NPCDialogStatus"     ))
-        ||!(testScript->GODialogStatus      =(scriptCallGODialogStatus      )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GODialogStatus"     ))
-        ||!(testScript->ChooseReward        =(scriptCallChooseReward        )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ChooseReward"        ))
-        ||!(testScript->ItemHello           =(scriptCallItemHello           )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ItemHello"           ))
-        ||!(testScript->GOHello             =(scriptCallGOHello             )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GOHello"             ))
-        ||!(testScript->scriptAreaTrigger   =(scriptCallAreaTrigger         )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"AreaTrigger"         ))
-        ||!(testScript->ItemQuestAccept     =(scriptCallItemQuestAccept     )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ItemQuestAccept"     ))
-        ||!(testScript->GOQuestAccept       =(scriptCallGOQuestAccept       )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GOQuestAccept"       ))
-        ||!(testScript->ReceiveEmote        =(scriptCallReceiveEmote        )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ReceiveEmote"        ))
-        ||!(testScript->ItemUse             =(scriptCallItemUse             )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"ItemUse"             ))
-        ||!(testScript->GetAI               =(scriptCallGetAI               )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"GetAI"               ))
-        ||!(testScript->CreateInstanceData  =(scriptCallCreateInstanceData  )MANGOS_GET_PROC_ADDR(testScript->hScriptsLib,"CreateInstanceData"  ))
+    if(   !(testScript->ScriptsInit         =(scriptCallScriptsInit         )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ScriptsInit"         ))
+        ||!(testScript->ScriptsFree         =(scriptCallScriptsFree         )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ScriptsFree"         ))
+        ||!(testScript->GossipHello         =(scriptCallGossipHello         )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GossipHello"         ))
+        ||!(testScript->GOChooseReward      =(scriptCallGOChooseReward      )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GOChooseReward"      ))
+        ||!(testScript->QuestAccept         =(scriptCallQuestAccept         )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"QuestAccept"         ))
+        ||!(testScript->GossipSelect        =(scriptCallGossipSelect        )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GossipSelect"        ))
+        ||!(testScript->GossipSelectWithCode=(scriptCallGossipSelectWithCode)TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GossipSelectWithCode"))
+        ||!(testScript->QuestSelect         =(scriptCallQuestSelect         )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"QuestSelect"         ))
+        ||!(testScript->QuestComplete       =(scriptCallQuestComplete       )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"QuestComplete"       ))
+        ||!(testScript->NPCDialogStatus     =(scriptCallNPCDialogStatus     )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"NPCDialogStatus"     ))
+        ||!(testScript->GODialogStatus      =(scriptCallGODialogStatus      )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GODialogStatus"     ))
+        ||!(testScript->ChooseReward        =(scriptCallChooseReward        )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ChooseReward"        ))
+        ||!(testScript->ItemHello           =(scriptCallItemHello           )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ItemHello"           ))
+        ||!(testScript->GOHello             =(scriptCallGOHello             )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GOHello"             ))
+        ||!(testScript->scriptAreaTrigger   =(scriptCallAreaTrigger         )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"AreaTrigger"         ))
+        ||!(testScript->ItemQuestAccept     =(scriptCallItemQuestAccept     )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ItemQuestAccept"     ))
+        ||!(testScript->GOQuestAccept       =(scriptCallGOQuestAccept       )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GOQuestAccept"       ))
+        ||!(testScript->ReceiveEmote        =(scriptCallReceiveEmote        )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ReceiveEmote"        ))
+        ||!(testScript->ItemUse             =(scriptCallItemUse             )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ItemUse"             ))
+        ||!(testScript->GetAI               =(scriptCallGetAI               )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GetAI"               ))
+        ||!(testScript->CreateInstanceData  =(scriptCallCreateInstanceData  )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"CreateInstanceData"  ))
         )
     {
         printf("Error loading Scripts Library %s !\n Library missing required functions.",name.c_str());
-        MANGOS_CLOSE_LIBRARY(testScript->hScriptsLib);
+        TRINITY_CLOSE_LIBRARY(testScript->hScriptsLib);
         delete testScript;
         return false;
Index: trunk/src/game/Cell.h
===================================================================
--- trunk/src/game/Cell.h (revision 2)
+++ trunk/src/game/Cell.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_CELL_H
-#define MANGOS_CELL_H
+#ifndef TRINITY_CELL_H
+#define TRINITY_CELL_H
 
 #include "GameSystem/TypeContainer.h"
@@ -43,5 +45,5 @@
 template<class T> struct CellLock;
 
-struct MANGOS_DLL_DECL Cell
+struct TRINITY_DLL_DECL Cell
 {
     Cell() { data.All = 0; }
@@ -144,5 +146,5 @@
 
 template<class T>
-struct MANGOS_DLL_DECL CellLock
+struct TRINITY_DLL_DECL CellLock
 {
     const Cell& i_cell;
Index: trunk/src/game/GridDefines.h
===================================================================
--- trunk/src/game/GridDefines.h (revision 2)
+++ trunk/src/game/GridDefines.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_GRIDDEFINES_H
-#define MANGOS_GRIDDEFINES_H
+#ifndef TRINITY_GRIDDEFINES_H
+#define TRINITY_GRIDDEFINES_H
 
 #include "Common.h"
@@ -72,5 +74,5 @@
 
 template<const unsigned int LIMIT>
-struct MANGOS_DLL_DECL CoordPair
+struct TRINITY_DLL_DECL CoordPair
 {
     CoordPair(uint32 x=0, uint32 y=0) : x_coord(x), y_coord(y) {}
@@ -116,5 +118,5 @@
 typedef CoordPair<TOTAL_NUMBER_OF_CELLS_PER_MAP> CellPair;
 
-namespace MaNGOS
+namespace Trinity
 {
     template<class RET_TYPE, int CENTER_VAL>
Index: trunk/src/game/Pet.cpp
===================================================================
--- trunk/src/game/Pet.cpp (revision 37)
+++ trunk/src/game/Pet.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -888,5 +890,5 @@
 
         SetLevel( level + 1 );
-        SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((MaNGOS::XP::xp_to_level(level+1))/4));
+        SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((Trinity::XP::xp_to_level(level+1))/4));
 
         level = getLevel();
@@ -955,5 +957,5 @@
     SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP,0);
     SetUInt32Value(UNIT_FIELD_PETEXPERIENCE,0);
-    SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((MaNGOS::XP::xp_to_level(creature->getLevel()))/4));
+    SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((Trinity::XP::xp_to_level(creature->getLevel()))/4));
     SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
     SetUInt32Value(UNIT_NPC_FLAGS , 0);
@@ -1103,5 +1105,5 @@
         case HUNTER_PET:
         {
-            SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((MaNGOS::XP::xp_to_level(petlevel))/4));
+            SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((Trinity::XP::xp_to_level(petlevel))/4));
 
             //these formula may not be correct; however, it is designed to be close to what it should be
Index: trunk/src/game/AnimalRandomMovementGenerator.h
===================================================================
--- trunk/src/game/AnimalRandomMovementGenerator.h (revision 2)
+++ trunk/src/game/AnimalRandomMovementGenerator.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_ANIMAL_RANDOMMOVEMENTGENERATOR_H
-#define MANGOS_ANIMAL_RANDOMMOVEMENTGENERATOR_H
+#ifndef TRINITY_ANIMAL_RANDOMMOVEMENTGENERATOR_H
+#define TRINITY_ANIMAL_RANDOMMOVEMENTGENERATOR_H
 
 /** AnimalRandomMovementGenerator follows the research on
Index: trunk/src/game/Opcodes.cpp
===================================================================
--- trunk/src/game/Opcodes.cpp (revision 2)
+++ trunk/src/game/Opcodes.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/BattleGroundRL.h
===================================================================
--- trunk/src/game/BattleGroundRL.h (revision 9)
+++ trunk/src/game/BattleGroundRL.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 #ifndef __BATTLEGROUNDRL_H
Index: trunk/src/game/OutdoorPvPZM.h
===================================================================
--- trunk/src/game/OutdoorPvPZM.h (revision 44)
+++ trunk/src/game/OutdoorPvPZM.h (revision 44)
@@ -0,0 +1,197 @@
+#ifndef OUTDOOR_PVP_ZM_
+#define OUTDOOR_PVP_ZM_
+
+#include "OutdoorPvP.h"
+#include "Language.h"
+
+const uint32 OutdoorPvPZMBuffZonesNum = 5;
+// the buff is cast in these zones
+const uint32 OutdoorPvPZMBuffZones[OutdoorPvPZMBuffZonesNum] = {3521,3607,3717,3715,3716};
+// cast on the players of the controlling faction
+const uint32 ZM_CAPTURE_BUFF = 33779;  // twin spire blessing
+// spell that the field scout casts on the player to carry the flag
+const uint32 ZM_BATTLE_STANDARD_A = 32430;
+// spell that the field scout casts on the player to carry the flag
+const uint32 ZM_BATTLE_STANDARD_H = 32431;
+// linked when the central tower is controlled
+const uint32 ZM_GRAVEYARD_ZONE = 3521;
+// linked when the central tower is controlled
+const uint32 ZM_GRAVEYARD_ID = 969;
+// token create spell
+const uint32 ZM_AlliancePlayerKillReward = 32155;
+// token create spell
+const uint32 ZM_HordePlayerKillReward = 32158;
+
+// banners 182527, 182528, 182529, gotta check them ingame
+const go_type ZM_Banner_A = { 182527,530,253.54,7083.81,36.7728,-0.017453,0,0,0.008727,-0.999962 };
+const go_type ZM_Banner_H = { 182528,530,253.54,7083.81,36.7728,-0.017453,0,0,0.008727,-0.999962 };
+const go_type ZM_Banner_N = { 182529,530,253.54,7083.81,36.7728,-0.017453,0,0,0.008727,-0.999962 };
+
+// horde field scout spawn data
+const creature_type ZM_HordeFieldScout = {18564,67,530,296.625,7818.4,42.6294,5.18363};
+// alliance field scout spawn data
+const creature_type ZM_AllianceFieldScout = {18581,469,530,374.395,6230.08,22.8351,0.593412};
+
+enum ZMCreatureTypes{
+    ZM_ALLIANCE_FIELD_SCOUT = 0,
+    ZM_HORDE_FIELD_SCOUT,
+    ZM_CREATURE_NUM
+};
+
+struct zm_beacon {
+    uint32 slider_disp;
+    uint32 slider_n;
+    uint32 slider_pos;
+    uint32 ui_tower_n;
+    uint32 ui_tower_h;
+    uint32 ui_tower_a;
+    uint32 map_tower_n;
+    uint32 map_tower_h;
+    uint32 map_tower_a;
+    uint32 event_enter;
+    uint32 event_leave;
+};
+
+enum ZM_BeaconType{
+    ZM_BEACON_EAST = 0,
+    ZM_BEACON_WEST,
+    ZM_NUM_BEACONS
+};
+
+const zm_beacon ZMBeaconInfo[ZM_NUM_BEACONS] = {
+    {2533,2535,2534,2560,2559,2558,2652,2651,2650,11807,11806},
+    {2527,2529,2528,2557,2556,2555,2646,2645,2644,11805,11804}
+};
+
+const uint32 ZMBeaconCaptureA[ZM_NUM_BEACONS] = {
+    LANG_OPVP_ZM_CAPTURE_EAST_A,
+    LANG_OPVP_ZM_CAPTURE_WEST_A
+};
+
+const uint32 ZMBeaconCaptureH[ZM_NUM_BEACONS] = {
+    LANG_OPVP_ZM_CAPTURE_EAST_H,
+    LANG_OPVP_ZM_CAPTURE_WEST_H
+};
+
+const uint32 ZMBeaconLooseA[ZM_NUM_BEACONS] = {
+    LANG_OPVP_ZM_LOOSE_EAST_A,
+    LANG_OPVP_ZM_LOOSE_WEST_A
+};
+
+const uint32 ZMBeaconLooseH[ZM_NUM_BEACONS] = {
+    LANG_OPVP_ZM_LOOSE_EAST_H,
+    LANG_OPVP_ZM_LOOSE_WEST_H
+};
+
+const go_type ZMCapturePoints[ZM_NUM_BEACONS] = {
+    {182523,530,303.243,6841.36,40.1245,-1.58825,0,0,0.71325,-0.700909},
+    {182522,530,336.466,7340.26,41.4984,-1.58825,0,0,0.71325,-0.700909}
+};
+
+enum OutdoorPvPZMWorldStates
+{
+    ZM_UI_TOWER_SLIDER_N_W = 2529,
+    ZM_UI_TOWER_SLIDER_POS_W = 2528,
+    ZM_UI_TOWER_SLIDER_DISPLAY_W = 2527,
+
+    ZM_UI_TOWER_SLIDER_N_E = 2535,
+    ZM_UI_TOWER_SLIDER_POS_E = 2534,
+    ZM_UI_TOWER_SLIDER_DISPLAY_E = 2533,
+
+    ZM_WORLDSTATE_UNK_1 = 2653,
+
+    ZM_UI_TOWER_EAST_N = 2560,
+    ZM_UI_TOWER_EAST_H = 2559,
+    ZM_UI_TOWER_EAST_A = 2558,
+    ZM_UI_TOWER_WEST_N = 2557,
+    ZM_UI_TOWER_WEST_H = 2556,
+    ZM_UI_TOWER_WEST_A = 2555,
+
+    ZM_MAP_TOWER_EAST_N = 2652,
+    ZM_MAP_TOWER_EAST_H = 2651,
+    ZM_MAP_TOWER_EAST_A = 2650,
+    ZM_MAP_GRAVEYARD_H = 2649,
+    ZM_MAP_GRAVEYARD_A = 2648,
+    ZM_MAP_GRAVEYARD_N = 2647,
+    ZM_MAP_TOWER_WEST_N = 2646,
+    ZM_MAP_TOWER_WEST_H = 2645,
+    ZM_MAP_TOWER_WEST_A = 2644,
+
+    ZM_MAP_HORDE_FLAG_READY = 2658,
+    ZM_MAP_HORDE_FLAG_NOT_READY = 2657,
+    ZM_MAP_ALLIANCE_FLAG_NOT_READY = 2656,
+    ZM_MAP_ALLIANCE_FLAG_READY = 2655
+};
+
+enum ZM_TowerStateMask{
+    ZM_TOWERSTATE_N = 1,
+    ZM_TOWERSTATE_A = 2,
+    ZM_TOWERSTATE_H = 4
+};
+
+class OutdoorPvPZM;
+class OutdoorPvPObjectiveZM_Beacon : public OutdoorPvPObjective
+{
+friend class OutdoorPvPZM;
+public:
+    OutdoorPvPObjectiveZM_Beacon(OutdoorPvP * pvp, ZM_BeaconType type);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket & data);
+    // used when player is activated/inactivated in the area
+    bool HandlePlayerEnter(Player * plr);
+    void HandlePlayerLeave(Player * plr);
+    void UpdateTowerState();
+protected:
+    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
+protected:
+    ZM_BeaconType m_TowerType;
+    uint32 m_TowerState;
+};
+
+enum ZM_GraveYardState{
+    ZM_GRAVEYARD_N = 1,
+    ZM_GRAVEYARD_A = 2,
+    ZM_GRAVEYARD_H = 4
+};
+
+class OutdoorPvPObjectiveZM_GraveYard : public OutdoorPvPObjective
+{
+friend class OutdoorPvPZM;
+public:
+    OutdoorPvPObjectiveZM_GraveYard(OutdoorPvP * pvp);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket & data);
+    void UpdateTowerState();
+    int32 HandleOpenGo(Player *plr, uint64 guid);
+    void SetBeaconState(uint32 controlling_team); // not good atm
+    bool HandleGossipOption(Player * plr, uint64 guid, uint32 gossipid);
+    bool HandleDropFlag(Player * plr, uint32 spellId);
+    bool CanTalkTo(Player * plr, Creature * c, GossipOption &gso);
+private:
+    uint32 m_GraveYardState;
+protected:
+    uint32 m_BothControllingFaction;
+    uint64 m_FlagCarrierGUID;
+};
+
+class OutdoorPvPZM : public OutdoorPvP
+{
+friend class OutdoorPvPObjectiveZM_Beacon;
+public:
+    OutdoorPvPZM();
+    bool SetupOutdoorPvP();
+    void HandlePlayerEnterZone(Player *plr, uint32 zone);
+    void HandlePlayerLeaveZone(Player *plr, uint32 zone);
+    bool Update(uint32 diff);
+    void FillInitialWorldStates(WorldPacket &data);
+    void SendRemoveWorldStates(Player * plr);
+    void HandleKillImpl(Player * plr, Unit * killed);
+    void BuffTeam(uint32 team);
+private:
+    OutdoorPvPObjectiveZM_GraveYard * m_GraveYard;
+    uint32 m_AllianceTowersControlled;
+    uint32 m_HordeTowersControlled;
+};
+
+// todo: flag carrier death/leave/mount/activitychange should give back the gossip options
+#endif
Index: trunk/src/game/QuestHandler.cpp
===================================================================
--- trunk/src/game/QuestHandler.cpp (revision 2)
+++ trunk/src/game/QuestHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/MovementGenerator.cpp
===================================================================
--- trunk/src/game/MovementGenerator.cpp (revision 2)
+++ trunk/src/game/MovementGenerator.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/WaypointMovementGenerator.h
===================================================================
--- trunk/src/game/WaypointMovementGenerator.h (revision 2)
+++ trunk/src/game/WaypointMovementGenerator.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_WAYPOINTMOVEMENTGENERATOR_H
-#define MANGOS_WAYPOINTMOVEMENTGENERATOR_H
+#ifndef TRINITY_WAYPOINTMOVEMENTGENERATOR_H
+#define TRINITY_WAYPOINTMOVEMENTGENERATOR_H
 
 /** @page PathMovementGenerator is used to generate movements
@@ -41,5 +43,5 @@
 
 template<class T, class P = Path>
-class MANGOS_DLL_SPEC PathMovementBase
+class TRINITY_DLL_SPEC PathMovementBase
 {
     public:
@@ -67,8 +69,8 @@
 
 template<class T>
-class MANGOS_DLL_SPEC WaypointMovementGenerator;
+class TRINITY_DLL_SPEC WaypointMovementGenerator;
 
 template<>
-class MANGOS_DLL_SPEC WaypointMovementGenerator<Creature>
+class TRINITY_DLL_SPEC WaypointMovementGenerator<Creature>
 : public MovementGeneratorMedium< Creature, WaypointMovementGenerator<Creature> >,
 public PathMovementBase<Creature, WaypointPath*>
@@ -111,5 +113,5 @@
  * and hence generates ground and activities for the player.
  */
-class MANGOS_DLL_SPEC FlightPathMovementGenerator
+class TRINITY_DLL_SPEC FlightPathMovementGenerator
 : public MovementGeneratorMedium< Player, FlightPathMovementGenerator >,
 public PathMovementBase<Player>
Index: trunk/src/game/BattleGroundAB.h
===================================================================
--- trunk/src/game/BattleGroundAB.h (revision 2)
+++ trunk/src/game/BattleGroundAB.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 #ifndef __BATTLEGROUNDAB_H
Index: trunk/src/game/IdleMovementGenerator.h
===================================================================
--- trunk/src/game/IdleMovementGenerator.h (revision 2)
+++ trunk/src/game/IdleMovementGenerator.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,18 +11,18 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_IDLEMOVEMENTGENERATOR_H
-#define MANGOS_IDLEMOVEMENTGENERATOR_H
+#ifndef TRINITY_IDLEMOVEMENTGENERATOR_H
+#define TRINITY_IDLEMOVEMENTGENERATOR_H
 
 #include "MovementGenerator.h"
 
-class MANGOS_DLL_SPEC IdleMovementGenerator : public MovementGenerator
+class TRINITY_DLL_SPEC IdleMovementGenerator : public MovementGenerator
 {
     public:
@@ -35,5 +37,5 @@
 extern IdleMovementGenerator si_idleMovement;
 
-class MANGOS_DLL_SPEC DistractMovementGenerator : public MovementGenerator
+class TRINITY_DLL_SPEC DistractMovementGenerator : public MovementGenerator
 {
     public:
Index: trunk/src/game/BattleGroundWS.cpp
===================================================================
--- trunk/src/game/BattleGroundWS.cpp (revision 34)
+++ trunk/src/game/BattleGroundWS.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -72,5 +74,5 @@
         {
             m_Events |= 0x04;
-            SendMessageToAll(GetMangosString(LANG_BG_WS_ONE_MINUTE));
+            SendMessageToAll(GetTrinityString(LANG_BG_WS_ONE_MINUTE));
         }
         // After 1,5 minute, warning is signalled
@@ -78,5 +80,5 @@
         {
             m_Events |= 0x08;
-            SendMessageToAll(GetMangosString(LANG_BG_WS_HALF_MINUTE));
+            SendMessageToAll(GetTrinityString(LANG_BG_WS_HALF_MINUTE));
         }
         // After 2 minutes, gates OPEN ! x)
@@ -97,13 +99,9 @@
                 SpawnBGObject(i, RESPAWN_IMMEDIATELY);
 
-            SendMessageToAll(GetMangosString(LANG_BG_WS_BEGIN));
-
+            SendMessageToAll(GetTrinityString(LANG_BG_WS_BEGIN));
+
+            PlaySoundToAll(SOUND_BG_START);
             if(sWorld.getConfig(CONFIG_BG_START_MUSIC))
-            {
-                PlaySoundToAll(SOUND_BG_START);
                 PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC - Custom config
-            }
-            else
-                PlaySoundToAll(SOUND_BG_START);
             SetStatus(STATUS_IN_PROGRESS);
 
@@ -185,5 +183,5 @@
         SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_IMMEDIATELY);
         SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY);
-        SendMessageToAll(GetMangosString(LANG_BG_WS_F_PLACED));
+        SendMessageToAll(GetTrinityString(LANG_BG_WS_F_PLACED));
         PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED);        // flag respawned sound...
     }
@@ -199,10 +197,10 @@
     {
         SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY);
-        SendMessageToAll(GetMangosString(LANG_BG_WS_ALLIANCE_FLAG_RESPAWNED));
+        SendMessageToAll(GetTrinityString(LANG_BG_WS_ALLIANCE_FLAG_RESPAWNED));
     }
     else
     {
         SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_IMMEDIATELY);
-        SendMessageToAll(GetMangosString(LANG_BG_WS_HORDE_FLAG_RESPAWNED));
+        SendMessageToAll(GetTrinityString(LANG_BG_WS_HORDE_FLAG_RESPAWNED));
     }
 
@@ -239,5 +237,5 @@
                                                             // Drop Horde Flag from Player
         Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
-        message = GetMangosString(LANG_BG_WS_CAPTURED_HF);
+        message = GetTrinityString(LANG_BG_WS_CAPTURED_HF);
         type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
         if(GetTeamScore(ALLIANCE) < BG_WS_MAX_TEAM_SCORE)
@@ -256,5 +254,5 @@
                                                             // Drop Alliance Flag from Player
         Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
-        message = GetMangosString(LANG_BG_WS_CAPTURED_AF);
+        message = GetTrinityString(LANG_BG_WS_CAPTURED_AF);
         type = CHAT_MSG_BG_SYSTEM_HORDE;
         if(GetTeamScore(HORDE) < BG_WS_MAX_TEAM_SCORE)
@@ -340,5 +338,5 @@
             Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
             m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_GROUND;
-            message = GetMangosString(LANG_BG_WS_DROPPED_HF);
+            message = GetTrinityString(LANG_BG_WS_DROPPED_HF);
             type = CHAT_MSG_BG_SYSTEM_HORDE;
             Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true);
@@ -355,5 +353,5 @@
             Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
             m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_GROUND;
-            message = GetMangosString(LANG_BG_WS_DROPPED_AF);
+            message = GetTrinityString(LANG_BG_WS_DROPPED_AF);
             type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
             Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true);
@@ -392,5 +390,5 @@
         && this->m_BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID())
     {
-        message = GetMangosString(LANG_BG_WS_PICKEDUP_AF);
+        message = GetTrinityString(LANG_BG_WS_PICKEDUP_AF);
         type = CHAT_MSG_BG_SYSTEM_HORDE;
         PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP);
@@ -408,5 +406,5 @@
         && this->m_BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID())
     {
-        message = GetMangosString(LANG_BG_WS_PICKEDUP_HF);
+        message = GetTrinityString(LANG_BG_WS_PICKEDUP_HF);
         type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
         PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP);
@@ -425,5 +423,5 @@
         if(Source->GetTeam() == ALLIANCE)
         {
-            message = GetMangosString(LANG_BG_WS_RETURNED_AF);
+            message = GetTrinityString(LANG_BG_WS_RETURNED_AF);
             type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
             UpdateFlagState(HORDE, BG_WS_FLAG_STATE_WAIT_RESPAWN);
@@ -435,5 +433,5 @@
         else
         {
-            message = GetMangosString(LANG_BG_WS_PICKEDUP_AF);
+            message = GetTrinityString(LANG_BG_WS_PICKEDUP_AF);
             type = CHAT_MSG_BG_SYSTEM_HORDE;
             PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP);
@@ -454,5 +452,5 @@
         if(Source->GetTeam() == HORDE)
         {
-            message = GetMangosString(LANG_BG_WS_RETURNED_HF);
+            message = GetTrinityString(LANG_BG_WS_RETURNED_HF);
             type = CHAT_MSG_BG_SYSTEM_HORDE;
             UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_WAIT_RESPAWN);
@@ -464,5 +462,5 @@
         else
         {
-            message = GetMangosString(LANG_BG_WS_PICKEDUP_HF);
+            message = GetTrinityString(LANG_BG_WS_PICKEDUP_HF);
             type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
             PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP);
Index: trunk/src/game/AccountMgr.h
===================================================================
--- trunk/src/game/AccountMgr.h (revision 2)
+++ trunk/src/game/AccountMgr.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -53,4 +55,4 @@
 };
 
-#define accmgr MaNGOS::Singleton<AccountMgr>::Instance()
+#define accmgr Trinity::Singleton<AccountMgr>::Instance()
 #endif
Index: trunk/src/game/PetAI.h
===================================================================
--- trunk/src/game/PetAI.h (revision 2)
+++ trunk/src/game/PetAI.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_PETAI_H
-#define MANGOS_PETAI_H
+#ifndef TRINITY_PETAI_H
+#define TRINITY_PETAI_H
 
 #include "CreatureAI.h"
@@ -25,5 +27,5 @@
 class Creature;
 
-class MANGOS_DLL_DECL PetAI : public CreatureAI
+class TRINITY_DLL_DECL PetAI : public CreatureAI
 {
     public:
Index: trunk/src/game/RandomMovementGenerator.h
===================================================================
--- trunk/src/game/RandomMovementGenerator.h (revision 2)
+++ trunk/src/game/RandomMovementGenerator.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_RANDOMMOTIONGENERATOR_H
-#define MANGOS_RANDOMMOTIONGENERATOR_H
+#ifndef TRINITY_RANDOMMOTIONGENERATOR_H
+#define TRINITY_RANDOMMOTIONGENERATOR_H
 
 #include "MovementGenerator.h"
@@ -26,5 +28,5 @@
 
 template<class T>
-class MANGOS_DLL_SPEC RandomMovementGenerator
+class TRINITY_DLL_SPEC RandomMovementGenerator
 : public MovementGeneratorMedium< T, RandomMovementGenerator<T> >
 {
Index: trunk/src/game/GridNotifiers.cpp
===================================================================
--- trunk/src/game/GridNotifiers.cpp (revision 2)
+++ trunk/src/game/GridNotifiers.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -27,8 +29,8 @@
 #include "ObjectAccessor.h"
 
-using namespace MaNGOS;
-
-void
-MaNGOS::PlayerNotifier::Visit(PlayerMapType &m)
+using namespace Trinity;
+
+void
+Trinity::PlayerNotifier::Visit(PlayerMapType &m)
 {
     for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
@@ -92,5 +94,5 @@
         i_player.m_clientGUIDs.erase(*itr);
 
-        #ifdef MANGOS_DEBUG
+        #ifdef TRINITY_DEBUG
         if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
             sLog.outDebug("Object %u (Type: %u) is out of range (no in active cells set) now for player %u",GUID_LOPART(*itr),GuidHigh2TypeId(GUID_HIPART(*itr)),i_player.GetGUIDLow());
Index: trunk/src/game/FollowerReference.cpp
===================================================================
--- trunk/src/game/FollowerReference.cpp (revision 2)
+++ trunk/src/game/FollowerReference.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Channel.cpp
===================================================================
--- trunk/src/game/Channel.cpp (revision 39)
+++ trunk/src/game/Channel.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -21,5 +23,4 @@
 #include "World.h"
 #include "SocialMgr.h"
-#include "IRCClient.h"
 
 Channel::Channel(std::string name, uint32 channel_id)
@@ -113,6 +114,4 @@
     MakeYouJoined(&data);
     SendToOne(&data, p);
-
-    sIRC.Handle_WoW_Channel(m_name, objmgr.GetPlayer(p), CHANNEL_JOIN);
 
     JoinNotify(p);
@@ -155,6 +154,4 @@
 
         LeaveNotify(p);
-
-        sIRC.Handle_WoW_Channel(m_name, objmgr.GetPlayer(p), CHANNEL_LEAVE);
 
         if(changeowner)
Index: trunk/src/game/ObjectGridLoader.h
===================================================================
--- trunk/src/game/ObjectGridLoader.h (revision 2)
+++ trunk/src/game/ObjectGridLoader.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_OBJECTGRIDLOADER_H
-#define MANGOS_OBJECTGRIDLOADER_H
+#ifndef TRINITY_OBJECTGRIDLOADER_H
+#define TRINITY_OBJECTGRIDLOADER_H
 
 #include "Utilities/TypeList.h"
@@ -28,5 +30,5 @@
 class ObjectWorldLoader;
 
-class MANGOS_DLL_DECL ObjectGridLoader
+class TRINITY_DLL_DECL ObjectGridLoader
 {
     friend class ObjectWorldLoader;
@@ -55,5 +57,5 @@
 };
 
-class MANGOS_DLL_DECL ObjectGridUnloader
+class TRINITY_DLL_DECL ObjectGridUnloader
 {
     public:
@@ -79,5 +81,5 @@
 };
 
-class MANGOS_DLL_DECL ObjectGridStoper
+class TRINITY_DLL_DECL ObjectGridStoper
 {
     public:
Index: trunk/src/game/SharedDefines.h
===================================================================
--- trunk/src/game/SharedDefines.h (revision 6)
+++ trunk/src/game/SharedDefines.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_SHAREDDEFINES_H
-#define MANGOS_SHAREDDEFINES_H
+#ifndef TRINITY_SHAREDDEFINES_H
+#define TRINITY_SHAREDDEFINES_H
 
 #include "Platform/Define.h"
Index: trunk/src/game/WaypointManager.h
===================================================================
--- trunk/src/game/WaypointManager.h (revision 2)
+++ trunk/src/game/WaypointManager.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_WAYPOINTMANAGER_H
-#define MANGOS_WAYPOINTMANAGER_H
+#ifndef TRINITY_WAYPOINTMANAGER_H
+#define TRINITY_WAYPOINTMANAGER_H
 
 #include <vector>
@@ -85,5 +87,5 @@
 };
 
-#define WaypointMgr MaNGOS::Singleton<WaypointManager>::Instance()
+#define WaypointMgr Trinity::Singleton<WaypointManager>::Instance()
 
 #endif
Index: trunk/src/game/OutdoorPvPTF.cpp
===================================================================
--- trunk/src/game/OutdoorPvPTF.cpp (revision 44)
+++ trunk/src/game/OutdoorPvPTF.cpp (revision 44)
@@ -0,0 +1,348 @@
+#include "OutdoorPvPTF.h"
+#include "OutdoorPvPMgr.h"
+#include "WorldPacket.h"
+#include "Player.h"
+#include "ObjectMgr.h"
+#include "Language.h"
+#include "World.h"
+
+OutdoorPvPTF::OutdoorPvPTF()
+{
+    m_TypeId = OUTDOOR_PVP_TF;
+}
+
+OutdoorPvPObjectiveTF::OutdoorPvPObjectiveTF(OutdoorPvP *pvp, OutdoorPvPTF_TowerType type)
+: OutdoorPvPObjective(pvp), m_TowerType(type), m_TowerState(TF_TOWERSTATE_N)
+{
+    AddCapturePoint(TFCapturePoints[type].entry,TFCapturePoints[type].map,TFCapturePoints[type].x,TFCapturePoints[type].y,TFCapturePoints[type].z,TFCapturePoints[type].o,TFCapturePoints[type].rot0,TFCapturePoints[type].rot1,TFCapturePoints[type].rot2,TFCapturePoints[type].rot3);
+}
+
+void OutdoorPvPObjectiveTF::FillInitialWorldStates(WorldPacket &data)
+{
+    data << uint32(TFTowerWorldStates[m_TowerType].n) << uint32(bool(m_TowerState & TF_TOWERSTATE_N));
+    data << uint32(TFTowerWorldStates[m_TowerType].h) << uint32(bool(m_TowerState & TF_TOWERSTATE_H));
+    data << uint32(TFTowerWorldStates[m_TowerType].a) << uint32(bool(m_TowerState & TF_TOWERSTATE_A));
+}
+
+void OutdoorPvPTF::FillInitialWorldStates(WorldPacket &data)
+{
+    data << TF_UI_TOWER_SLIDER_POS << uint32(50);
+    data << TF_UI_TOWER_SLIDER_N << uint32(100);
+    data << TF_UI_TOWER_SLIDER_DISPLAY << uint32(0);
+
+    data << TF_UI_TOWER_COUNT_H << m_HordeTowersControlled;
+    data << TF_UI_TOWER_COUNT_A << m_AllianceTowersControlled;
+    data << TF_UI_TOWERS_CONTROLLED_DISPLAY << uint32(!m_IsLocked);
+
+    data << TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT << first_digit;
+    data << TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT << second_digit;
+    data << TF_UI_LOCKED_TIME_HOURS << hours_left;
+
+    data << TF_UI_LOCKED_DISPLAY_NEUTRAL << uint32(m_IsLocked && !m_HordeTowersControlled && !m_AllianceTowersControlled);
+    data << TF_UI_LOCKED_DISPLAY_HORDE << uint32(m_IsLocked && (m_HordeTowersControlled > m_AllianceTowersControlled));
+    data << TF_UI_LOCKED_DISPLAY_ALLIANCE << uint32(m_IsLocked && (m_HordeTowersControlled < m_AllianceTowersControlled));
+
+    for(OutdoorPvPObjectiveSet::iterator itr = m_OutdoorPvPObjectives.begin(); itr != m_OutdoorPvPObjectives.end(); ++itr)
+    {
+        (*itr)->FillInitialWorldStates(data);
+    }
+}
+
+void OutdoorPvPTF::SendRemoveWorldStates(Player * plr)
+{
+    plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS,uint32(0));
+    plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_N,uint32(0));
+    plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY,uint32(0));
+
+    plr->SendUpdateWorldState(TF_UI_TOWER_COUNT_H,uint32(0));
+    plr->SendUpdateWorldState(TF_UI_TOWER_COUNT_A,uint32(0));
+    plr->SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY,uint32(0));
+
+    plr->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT,uint32(0));
+    plr->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT,uint32(0));
+    plr->SendUpdateWorldState(TF_UI_LOCKED_TIME_HOURS,uint32(0));
+
+    plr->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL,uint32(0));
+    plr->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE,uint32(0));
+    plr->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE,uint32(0));
+
+    for(int i = 0; i < TF_TOWER_NUM; ++i)
+    {
+        plr->SendUpdateWorldState(uint32(TFTowerWorldStates[i].n),uint32(0));
+        plr->SendUpdateWorldState(uint32(TFTowerWorldStates[i].h),uint32(0));
+        plr->SendUpdateWorldState(uint32(TFTowerWorldStates[i].a),uint32(0));
+    }
+}
+
+void OutdoorPvPObjectiveTF::UpdateTowerState()
+{
+    m_PvP->SendUpdateWorldState(uint32(TFTowerWorldStates[m_TowerType].n),uint32(bool(m_TowerState & TF_TOWERSTATE_N)));
+    m_PvP->SendUpdateWorldState(uint32(TFTowerWorldStates[m_TowerType].h),uint32(bool(m_TowerState & TF_TOWERSTATE_H)));
+    m_PvP->SendUpdateWorldState(uint32(TFTowerWorldStates[m_TowerType].a),uint32(bool(m_TowerState & TF_TOWERSTATE_A)));
+}
+
+bool OutdoorPvPObjectiveTF::HandlePlayerEnter(Player *plr)
+{
+    if(OutdoorPvPObjective::HandlePlayerEnter(plr))
+    {
+        plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 1);
+        uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+        plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, phase);
+        plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, m_NeutralValue);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPObjectiveTF::HandlePlayerLeave(Player *plr)
+{
+    plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 0);
+    OutdoorPvPObjective::HandlePlayerLeave(plr);
+}
+
+bool OutdoorPvPObjectiveTF::HandleCapturePointEvent(Player *plr, uint32 eventId)
+{
+    if(eventId == TFTowerPlayerEnterEvents[m_TowerType])
+    {
+        this->HandlePlayerEnter(plr);
+        return true;
+    }
+    else if (eventId == TFTowerPlayerLeaveEvents[m_TowerType])
+    {
+        this->HandlePlayerLeave(plr);
+        return true;
+    }
+    return false;
+}
+
+void OutdoorPvPTF::BuffTeam(uint32 team)
+{
+    if(team == ALLIANCE)
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->CastSpell(plr,TF_CAPTURE_BUFF,true);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(TF_CAPTURE_BUFF);
+        }
+    }
+    else if(team == HORDE)
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->CastSpell(plr,TF_CAPTURE_BUFF,true);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(TF_CAPTURE_BUFF);
+        }
+    }
+    else
+    {
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[0].begin(); itr != m_PlayerGuids[0].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(TF_CAPTURE_BUFF);
+        }
+        for(std::set<uint64>::iterator itr = m_PlayerGuids[1].begin(); itr != m_PlayerGuids[1].end(); ++itr)
+        {
+            if(Player * plr = objmgr.GetPlayer(*itr))
+                plr->RemoveAurasDueToSpell(TF_CAPTURE_BUFF);
+        }
+    }
+}
+
+bool OutdoorPvPTF::Update(uint32 diff)
+{
+    bool changed = false;
+
+    if(changed = OutdoorPvP::Update(diff))
+    {
+        if(m_AllianceTowersControlled == TF_TOWER_NUM)
+        {
+            BuffTeam(ALLIANCE);
+            m_IsLocked = true;
+            SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL,uint32(0));
+            SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE,uint32(0));
+            SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE,uint32(1));
+            SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0));
+        }
+        else if(m_HordeTowersControlled == TF_TOWER_NUM)
+        {
+            BuffTeam(HORDE);
+            m_IsLocked = true;
+            SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL,uint32(0));
+            SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE,uint32(1));
+            SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE,uint32(0));
+            SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0));
+        }
+        else
+            BuffTeam(NULL);
+        SendUpdateWorldState(TF_UI_TOWER_COUNT_A, m_AllianceTowersControlled);
+        SendUpdateWorldState(TF_UI_TOWER_COUNT_H, m_HordeTowersControlled);
+    }
+    if(m_IsLocked)
+    {
+        // lock timer is down, release lock
+        if(m_LockTimer < diff)
+        {
+            m_LockTimer = TF_LOCK_TIME;
+            m_LockTimerUpdate = 0;
+            m_IsLocked = false;
+            SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(1));
+            SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL,uint32(0));
+            SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE,uint32(0));
+            SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE,uint32(0));
+        }
+        else
+        {
+            // worldstateui update timer is down, update ui with new time data
+            if(m_LockTimerUpdate < diff)
+            {
+                m_LockTimerUpdate = TF_LOCK_TIME_UPDATE;
+                uint32 minutes_left = m_LockTimer / 60000;
+                hours_left = minutes_left / 60;
+                minutes_left -= hours_left * 60;
+                second_digit = minutes_left % 10;
+                first_digit = minutes_left / 10;
+
+                SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT,first_digit);
+                SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT,second_digit);
+                SendUpdateWorldState(TF_UI_LOCKED_TIME_HOURS,hours_left);
+            } else m_LockTimerUpdate -= diff;
+            m_LockTimer -= diff;
+        }
+    }
+    return changed;
+}
+
+void OutdoorPvPTF::HandlePlayerEnterZone(Player * plr, uint32 zone)
+{
+    if(plr->GetTeam() == ALLIANCE)
+    {
+        if(m_AllianceTowersControlled >= TF_TOWER_NUM)
+            plr->CastSpell(plr,TF_CAPTURE_BUFF,true);
+    }
+    else
+    {
+        if(m_HordeTowersControlled >= TF_TOWER_NUM)
+            plr->CastSpell(plr,TF_CAPTURE_BUFF,true);
+    }
+    OutdoorPvP::HandlePlayerEnterZone(plr,zone);
+}
+
+void OutdoorPvPTF::HandlePlayerLeaveZone(Player * plr, uint32 zone)
+{
+    // remove buffs
+    plr->RemoveAurasDueToSpell(TF_CAPTURE_BUFF);
+    OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
+}
+
+bool OutdoorPvPTF::SetupOutdoorPvP()
+{
+    m_AllianceTowersControlled = 0;
+    m_HordeTowersControlled = 0;
+
+    m_IsLocked = false;
+    m_LockTimer = TF_LOCK_TIME;
+    m_LockTimerUpdate = 0; 
+    hours_left = 6;
+    second_digit = 0;
+    first_digit = 0;
+
+    // add the zones affected by the pvp buff
+    for(int i = 0; i < OutdoorPvPTFBuffZonesNum; ++i)
+        sOutdoorPvPMgr.AddZone(OutdoorPvPTFBuffZones[i],this);
+
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveTF(this,TF_TOWER_NW));
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveTF(this,TF_TOWER_N));
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveTF(this,TF_TOWER_NE));
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveTF(this,TF_TOWER_SE));
+    m_OutdoorPvPObjectives.insert(new OutdoorPvPObjectiveTF(this,TF_TOWER_S));
+
+    return true;
+}
+
+bool OutdoorPvPObjectiveTF::Update(uint32 diff)
+{
+    // can update even in locked state if gathers the controlling faction
+    bool canupdate = ((((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled > 0) && this->m_AllianceActivePlayerCount > this->m_HordeActivePlayerCount) ||
+            ((((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled > 0) && this->m_AllianceActivePlayerCount < this->m_HordeActivePlayerCount);
+    // if gathers the other faction, then only update if the pvp is unlocked
+    canupdate = canupdate || !((OutdoorPvPTF*)m_PvP)->m_IsLocked;
+    if(canupdate && OutdoorPvPObjective::Update(diff))
+    {
+        if(m_OldState != m_State)
+        {
+            // if changing from controlling alliance to horde
+            if( m_OldState == OBJECTIVESTATE_ALLIANCE )
+            {
+                if(((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled)
+                    ((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled--;
+                sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOOSE_A));
+            }
+            // if changing from controlling horde to alliance
+            else if ( m_OldState == OBJECTIVESTATE_HORDE )
+            {
+                if(((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled)
+                    ((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled--;
+                sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOOSE_H));
+            }
+
+            uint32 artkit = 21;
+
+            switch(m_State)
+            {
+            case OBJECTIVESTATE_ALLIANCE:
+                m_TowerState = TF_TOWERSTATE_A;
+                artkit = 2;
+                if(((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled<TF_TOWER_NUM)
+                    ((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled++;
+                sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_A));
+                break;
+            case OBJECTIVESTATE_HORDE:
+                m_TowerState = TF_TOWERSTATE_H;
+                artkit = 1;
+                if(((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled<TF_TOWER_NUM)
+                    ((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled++;
+                sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_H));
+                break;
+            case OBJECTIVESTATE_NEUTRAL:
+            case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
+            case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
+            case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
+            case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
+                m_TowerState = TF_TOWERSTATE_N;
+                break;
+            }
+
+            GameObject* flag = HashMapHolder<GameObject>::Find(m_CapturePoint);
+            if(flag)
+            {
+                flag->SetGoArtKit(artkit);
+                flag->SendUpdateObjectToAllExcept(NULL);
+            }
+
+            UpdateTowerState();
+        }
+
+        if(m_ShiftPhase != m_OldPhase)
+        {
+            // send this too, sometimes the slider disappears, dunno why :(
+            SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 1);
+            // send these updates to only the ones in this objective
+            uint32 phase = (uint32)ceil(( m_ShiftPhase + m_ShiftMaxPhase) / ( 2 * m_ShiftMaxPhase ) * 100.0f);
+            SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, phase);
+            // send this too, sometimes it resets :S
+            SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, m_NeutralValue);
+        }
+        return true;
+    }
+    return false;
+}
Index: trunk/src/game/UpdateFields.h
===================================================================
--- trunk/src/game/UpdateFields.h (revision 2)
+++ trunk/src/game/UpdateFields.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/GuardAI.h
===================================================================
--- trunk/src/game/GuardAI.h (revision 2)
+++ trunk/src/game/GuardAI.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_GUARDAI_H
-#define MANGOS_GUARDAI_H
+#ifndef TRINITY_GUARDAI_H
+#define TRINITY_GUARDAI_H
 
 #include "CreatureAI.h"
@@ -25,5 +27,5 @@
 class Creature;
 
-class MANGOS_DLL_DECL GuardAI : public CreatureAI
+class TRINITY_DLL_DECL GuardAI : public CreatureAI
 {
     enum GuardState
Index: trunk/src/game/ThreatManager.cpp
===================================================================
--- trunk/src/game/ThreatManager.cpp (revision 2)
+++ trunk/src/game/ThreatManager.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/NPCHandler.h
===================================================================
--- trunk/src/game/NPCHandler.h (revision 2)
+++ trunk/src/game/NPCHandler.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/BattleGroundAV.h
===================================================================
--- trunk/src/game/BattleGroundAV.h (revision 2)
+++ trunk/src/game/BattleGroundAV.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/MotionMaster.h
===================================================================
--- trunk/src/game/MotionMaster.h (revision 2)
+++ trunk/src/game/MotionMaster.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_MOTIONMASTER_H
-#define MANGOS_MOTIONMASTER_H
+#ifndef TRINITY_MOTIONMASTER_H
+#define TRINITY_MOTIONMASTER_H
 
 #include "Common.h"
@@ -46,5 +48,5 @@
 };
 
-class MANGOS_DLL_SPEC MotionMaster : private std::stack<MovementGenerator *>
+class TRINITY_DLL_SPEC MotionMaster : private std::stack<MovementGenerator *>
 {
     private:
Index: trunk/src/game/OutdoorPvPObjectiveAI.cpp
===================================================================
--- trunk/src/game/OutdoorPvPObjectiveAI.cpp (revision 44)
+++ trunk/src/game/OutdoorPvPObjectiveAI.cpp (revision 44)
@@ -0,0 +1,66 @@
+/* 
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "OutdoorPvPObjectiveAI.h"
+#include "Creature.h"
+#include "Player.h"
+#include "Unit.h"
+#include "OutdoorPvPMgr.h"
+#include "World.h"
+
+#define MAX_OUTDOOR_PVP_DISTANCE 200 // the max value in capture point type go data0 is 100 currently, so use twice that much to handle leaving as well
+
+OutdoorPvPObjectiveAI::OutdoorPvPObjectiveAI(Creature &c) : i_creature(c)
+{
+    sLog.outDebug("OutdoorPvP objective AI assigned to creature guid %u", c.GetGUIDLow());
+}
+
+void OutdoorPvPObjectiveAI::MoveInLineOfSight(Unit *u)
+{
+    // IsVisible only passes for players in range, so no need to check again
+    // leaving/entering distance will be checked based on go range data
+    sOutdoorPvPMgr.HandleCaptureCreaturePlayerMoveInLos(((Player*)u),&i_creature);
+}
+
+int OutdoorPvPObjectiveAI::Permissible(const Creature * c)
+{
+    // only assigned through AI name, never by permissibility check
+    return PERMIT_BASE_NO;
+}
+
+bool OutdoorPvPObjectiveAI::IsVisible(Unit *pl) const
+{
+    return (pl->GetTypeId() == TYPEID_PLAYER) && (i_creature.GetDistance(pl) < MAX_OUTDOOR_PVP_DISTANCE);
+}
+
+void OutdoorPvPObjectiveAI::AttackStart(Unit *)
+{
+    EnterEvadeMode();
+}
+
+void OutdoorPvPObjectiveAI::EnterEvadeMode()
+{
+    i_creature.DeleteThreatList();
+    i_creature.CombatStop();
+}
+
+void OutdoorPvPObjectiveAI::UpdateAI(const uint32 diff)
+{
+}
Index: trunk/src/game/TargetedMovementGenerator.h
===================================================================
--- trunk/src/game/TargetedMovementGenerator.h (revision 2)
+++ trunk/src/game/TargetedMovementGenerator.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_TARGETEDMOVEMENTGENERATOR_H
-#define MANGOS_TARGETEDMOVEMENTGENERATOR_H
+#ifndef TRINITY_TARGETEDMOVEMENTGENERATOR_H
+#define TRINITY_TARGETEDMOVEMENTGENERATOR_H
 
 #include "MovementGenerator.h"
@@ -25,5 +27,5 @@
 #include "FollowerReference.h"
 
-class MANGOS_DLL_SPEC TargetedMovementGeneratorBase
+class TRINITY_DLL_SPEC TargetedMovementGeneratorBase
 {
     public:
@@ -35,5 +37,5 @@
 
 template<class T>
-class MANGOS_DLL_SPEC TargetedMovementGenerator
+class TRINITY_DLL_SPEC TargetedMovementGenerator
 : public MovementGeneratorMedium< T, TargetedMovementGenerator<T> >, public TargetedMovementGeneratorBase
 {
Index: trunk/src/game/Mail.h
===================================================================
--- trunk/src/game/Mail.h (revision 2)
+++ trunk/src/game/Mail.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,13 +11,13 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
-#ifndef MANGOS_MAIL_H
-#define MANGOS_MAIL_H
+#ifndef TRINITY_MAIL_H
+#define TRINITY_MAIL_H
 
 #include "Common.h"
Index: trunk/src/game/AddonHandler.h
===================================================================
--- trunk/src/game/AddonHandler.h (revision 2)
+++ trunk/src/game/AddonHandler.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -34,4 +36,4 @@
         bool BuildAddonPacket(WorldPacket* Source, WorldPacket* Target);
 };
-#define sAddOnHandler MaNGOS::Singleton<AddonHandler>::Instance()
+#define sAddOnHandler Trinity::Singleton<AddonHandler>::Instance()
 #endif
Index: trunk/src/game/MovementGeneratorImpl.h
===================================================================
--- trunk/src/game/MovementGeneratorImpl.h (revision 2)
+++ trunk/src/game/MovementGeneratorImpl.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_MOVEMENTGENERATOR_IMPL_H
-#define MANGOS_MOVEMENTGENERATOR_IMPL_H
+#ifndef TRINITY_MOVEMENTGENERATOR_IMPL_H
+#define TRINITY_MOVEMENTGENERATOR_IMPL_H
 
 #include "MovementGenerator.h"
Index: trunk/src/game/SkillExtraItems.h
===================================================================
--- trunk/src/game/SkillExtraItems.h (revision 2)
+++ trunk/src/game/SkillExtraItems.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_SKILL_EXTRA_ITEMS_H
-#define MANGOS_SKILL_EXTRA_ITEMS_H
+#ifndef TRINITY_SKILL_EXTRA_ITEMS_H
+#define TRINITY_SKILL_EXTRA_ITEMS_H
 
 #include "Common.h"
Index: trunk/src/game/CreatureAISelector.h
===================================================================
--- trunk/src/game/CreatureAISelector.h (revision 2)
+++ trunk/src/game/CreatureAISelector.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_CREATUREAISELECTOR_H
-#define MANGOS_CREATUREAISELECTOR_H
+#ifndef TRINITY_CREATUREAISELECTOR_H
+#define TRINITY_CREATUREAISELECTOR_H
 
 class CreatureAI;
Index: trunk/src/game/BattleGroundAA.cpp
===================================================================
--- trunk/src/game/BattleGroundAA.cpp (revision 2)
+++ trunk/src/game/BattleGroundAA.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/ConfusedMovementGenerator.h
===================================================================
--- trunk/src/game/ConfusedMovementGenerator.h (revision 2)
+++ trunk/src/game/ConfusedMovementGenerator.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_RANDOMMOTIONGENERATOR_H
-#define MANGOS_RANDOMMOTIONGENERATOR_H
+#ifndef TRINITY_RANDOMMOTIONGENERATOR_H
+#define TRINITY_RANDOMMOTIONGENERATOR_H
 
 #include "MovementGenerator.h"
@@ -27,5 +29,5 @@
 
 template<class T>
-class MANGOS_DLL_SPEC ConfusedMovementGenerator
+class TRINITY_DLL_SPEC ConfusedMovementGenerator
 : public MovementGeneratorMedium< T, ConfusedMovementGenerator<T> >
 {
Index: trunk/src/game/Totem.h
===================================================================
--- trunk/src/game/Totem.h (revision 2)
+++ trunk/src/game/Totem.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_TOTEM_H
-#define MANGOSSERVER_TOTEM_H
+#ifndef TRINITYCORE_TOTEM_H
+#define TRINITYCORE_TOTEM_H
 
 #include "Creature.h"
Index: trunk/src/game/InstanceData.cpp
===================================================================
--- trunk/src/game/InstanceData.cpp (revision 2)
+++ trunk/src/game/InstanceData.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/IdleMovementGenerator.cpp
===================================================================
--- trunk/src/game/IdleMovementGenerator.cpp (revision 2)
+++ trunk/src/game/IdleMovementGenerator.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/BattleGroundMgr.cpp
===================================================================
--- trunk/src/game/BattleGroundMgr.cpp (revision 9)
+++ trunk/src/game/BattleGroundMgr.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Path.h
===================================================================
--- trunk/src/game/Path.h (revision 2)
+++ trunk/src/game/Path.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_PATH_H
-#define MANGOSSERVER_PATH_H
+#ifndef TRINITYCORE_PATH_H
+#define TRINITYCORE_PATH_H
 
 #include "Common.h"
Index: trunk/src/game/GuildHandler.cpp
===================================================================
--- trunk/src/game/GuildHandler.cpp (revision 2)
+++ trunk/src/game/GuildHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/ArenaTeam.h
===================================================================
--- trunk/src/game/ArenaTeam.h (revision 9)
+++ trunk/src/game/ArenaTeam.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOSSERVER_ARENATEAM_H
-#define MANGOSSERVER_ARENATEAM_H
+#ifndef TRINITYCORE_ARENATEAM_H
+#define TRINITYCORE_ARENATEAM_H
 
 enum ArenaTeamCommandTypes
Index: trunk/src/game/ObjectGridLoader.cpp
===================================================================
--- trunk/src/game/ObjectGridLoader.cpp (revision 2)
+++ trunk/src/game/ObjectGridLoader.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -28,5 +30,5 @@
 #include "CellImpl.h"
 
-class MANGOS_DLL_DECL ObjectGridRespawnMover
+class TRINITY_DLL_DECL ObjectGridRespawnMover
 {
     public:
@@ -64,5 +66,5 @@
         float resp_x, resp_y, resp_z;
         c->GetRespawnCoord(resp_x, resp_y, resp_z);
-        CellPair resp_val = MaNGOS::ComputeCellPair(resp_x, resp_y);
+        CellPair resp_val = Trinity::ComputeCellPair(resp_x, resp_y);
         Cell resp_cell(resp_val);
 
Index: trunk/src/game/MapInstanced.cpp
===================================================================
--- trunk/src/game/MapInstanced.cpp (revision 9)
+++ trunk/src/game/MapInstanced.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/LFGHandler.cpp
===================================================================
--- trunk/src/game/LFGHandler.cpp (revision 2)
+++ trunk/src/game/LFGHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/BattleGroundBE.h
===================================================================
--- trunk/src/game/BattleGroundBE.h (revision 9)
+++ trunk/src/game/BattleGroundBE.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 #ifndef __BATTLEGROUNDBE_H
Index: trunk/src/game/AuctionHouse.cpp
===================================================================
--- trunk/src/game/AuctionHouse.cpp (revision 39)
+++ trunk/src/game/AuctionHouse.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -27,5 +29,4 @@
 #include "AuctionHouseObject.h"
 #include "Util.h"
-#include "IRCClient.h"
 
 //please DO NOT use iterator++, because it is slower than ++iterator!!!
@@ -314,7 +315,4 @@
     pl->SaveInventoryAndGoldToDB();
     CharacterDatabase.CommitTransaction();
-
-    if((sIRC.BOTMASK & 1024) != 0) 
-        sIRC.AHFunc(it->GetEntry(), it->GetProto()->Name1, pl->GetName(), location);
 
     SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, AUCTION_OK);
Index: trunk/src/game/Creature.cpp
===================================================================
--- trunk/src/game/Creature.cpp (revision 37)
+++ trunk/src/game/Creature.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -43,5 +45,6 @@
 #include "GridNotifiersImpl.h"
 #include "CellImpl.h"
-
+#include "OutdoorPvPMgr.h"
+#include "GameEvent.h"
 // apply implementation of the singletons
 #include "Policies/SingletonImp.h"
@@ -253,5 +256,8 @@
         SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, GetCreatureInfo()->faction_A);
 
-    SetUInt32Value(UNIT_NPC_FLAGS,GetCreatureInfo()->npcflag);
+    if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_WORLDEVENT)
+        SetUInt32Value(UNIT_NPC_FLAGS,GetCreatureInfo()->npcflag | gameeventmgr.GetNPCFlag(this));
+    else
+        SetUInt32Value(UNIT_NPC_FLAGS,GetCreatureInfo()->npcflag);
 
     SetAttackTime(BASE_ATTACK,  GetCreatureInfo()->baseattacktime);
@@ -742,4 +748,8 @@
                     case GOSSIP_OPTION_AUCTIONEER:
                         break;                              // no checks
+                    case GOSSIP_OPTION_OUTDOORPVP:
+                        if ( !sOutdoorPvPMgr.CanTalkTo(pPlayer,this,(*gso)) )
+                            cantalking = false;
+                        break;
                     default:
                         sLog.outErrorDb("Creature %u (entry: %u) have unknown gossip option %u",GetGUIDLow(),GetEntry(),gso->Action);
@@ -776,4 +786,7 @@
 
     GossipMenu& gossipmenu = player->PlayerTalkClass->GetGossipMenu();
+
+    if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_WORLDEVENT) // if world event npc then
+        gameeventmgr.HandleWorldEventGossip(player, this);      // update world state with progress
 
     // in case empty gossip menu open quest menu if any
@@ -817,4 +830,7 @@
             player->PlayerTalkClass->CloseGossip();
             player->PlayerTalkClass->SendTalking( textid );
+            break;
+        case GOSSIP_OPTION_OUTDOORPVP:
+            sOutdoorPvPMgr.HandleGossipOption(player, GetGUID(), option);
             break;
         case GOSSIP_OPTION_SPIRITHEALER:
@@ -965,4 +981,9 @@
 uint32 Creature::GetNpcTextId()
 {
+    // don't cache / use cache in case it's a world event announcer
+    if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_WORLDEVENT)
+        if(uint32 textid = gameeventmgr.GetNpcTextId(m_DBTableGuid))
+            return textid;
+
     if (!m_DBTableGuid)
         return DEFAULT_GOSSIP_MESSAGE;
@@ -982,4 +1003,10 @@
     }
     return NULL;
+}
+
+void Creature::ResetGossipOptions()
+{
+    m_gossipOptionLoaded = false;
+    m_goptions.clear();
 }
 
@@ -1672,13 +1699,13 @@
     Creature* pCreature = NULL;
 
-    CellPair p(MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()));
+    CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
     Cell cell(p);
     cell.data.Part.reserved = ALL_DISTRICT;
     cell.SetNoCreate();
 
-    MaNGOS::NearestAssistCreatureInCreatureRangeCheck u_check(this,getVictim(),radius);
-    MaNGOS::CreatureLastSearcher<MaNGOS::NearestAssistCreatureInCreatureRangeCheck> searcher(pCreature, u_check);
-
-    TypeContainerVisitor<MaNGOS::CreatureLastSearcher<MaNGOS::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer >  grid_creature_searcher(searcher);
+    Trinity::NearestAssistCreatureInCreatureRangeCheck u_check(this,getVictim(),radius);
+    Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck> searcher(pCreature, u_check);
+
+    TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer >  grid_creature_searcher(searcher);
 
     CellLock<GridReadGuard> cell_lock(cell, p);
@@ -1711,13 +1738,13 @@
 
             {
-                CellPair p(MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()));
+                CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
                 Cell cell(p);
                 cell.data.Part.reserved = ALL_DISTRICT;
                 cell.SetNoCreate();
 
-                MaNGOS::AnyAssistCreatureInRangeCheck u_check(this, getVictim(), radius);
-                MaNGOS::CreatureListSearcher<MaNGOS::AnyAssistCreatureInRangeCheck> searcher(assistList, u_check);
-
-                TypeContainerVisitor<MaNGOS::CreatureListSearcher<MaNGOS::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer >  grid_creature_searcher(searcher);
+                Trinity::AnyAssistCreatureInRangeCheck u_check(this, getVictim(), radius);
+                Trinity::CreatureListSearcher<Trinity::AnyAssistCreatureInRangeCheck> searcher(assistList, u_check);
+
+                TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer >  grid_creature_searcher(searcher);
 
                 CellLock<GridReadGuard> cell_lock(cell, p);
Index: trunk/src/game/LootHandler.cpp
===================================================================
--- trunk/src/game/LootHandler.cpp (revision 2)
+++ trunk/src/game/LootHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/ObjectMgr.cpp
===================================================================
--- trunk/src/game/ObjectMgr.cpp (revision 37)
+++ trunk/src/game/ObjectMgr.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -323,5 +325,5 @@
             {
                 if(!GetPlayerNameByGUID(bidder_guid,bidder_name))
-                    bidder_name = GetMangosStringForDBCLocale(LANG_UNKNOWN);
+                    bidder_name = GetTrinityStringForDBCLocale(LANG_UNKNOWN);
             }
         }
@@ -331,5 +333,5 @@
             std::string owner_name;
             if(!GetPlayerNameByGUID(auction->owner,owner_name))
-                owner_name = GetMangosStringForDBCLocale(LANG_UNKNOWN);
+                owner_name = GetTrinityStringForDBCLocale(LANG_UNKNOWN);
 
             uint32 owner_accid = GetPlayerAccountIdByGUID(auction->owner);
@@ -1020,5 +1022,5 @@
         if(mask & 1)
         {
-            CellPair cell_pair = MaNGOS::ComputeCellPair(data->posX, data->posY);
+            CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY);
             uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
 
@@ -1036,5 +1038,5 @@
         if(mask & 1)
         {
-            CellPair cell_pair = MaNGOS::ComputeCellPair(data->posX, data->posY);
+            CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY);
             uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
 
@@ -1090,4 +1092,5 @@
         data.animprogress   = fields[12].GetUInt32();
         data.go_state       = fields[13].GetUInt32();
+        data.ArtKit         = 0;
         data.spawnMask      = fields[14].GetUInt8();
         int16 gameEvent     = fields[15].GetInt16();
@@ -1119,5 +1122,5 @@
         if(mask & 1)
         {
-            CellPair cell_pair = MaNGOS::ComputeCellPair(data->posX, data->posY);
+            CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY);
             uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
 
@@ -1135,5 +1138,5 @@
         if(mask & 1)
         {
-            CellPair cell_pair = MaNGOS::ComputeCellPair(data->posX, data->posY);
+            CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY);
             uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
 
@@ -1842,5 +1845,5 @@
                     sLog.outErrorDb("Wrong (> 255) level %u in `pet_levelstats` table, ignoring.",current_level);
                 else
-                    sLog.outDetail("Unused (> MaxPlayerLevel in mangosd.conf) level %u in `pet_levelstats` table, ignoring.",current_level);
+                    sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `pet_levelstats` table, ignoring.",current_level);
                 continue;
             }
@@ -2080,9 +2083,9 @@
     {
 
-	QueryResult *result = NULL;
-	if(sWorld.getConfig(CONFIG_START_ALL_SPELLS))
-		result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell_custom");
-	else
-		result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell");
+        QueryResult *result = NULL;
+        if(sWorld.getConfig(CONFIG_START_ALL_SPELLS))
+            result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell_custom");
+        else
+            result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell");
 
         uint32 count = 0;
@@ -2224,5 +2227,5 @@
                     sLog.outErrorDb("Wrong (> 255) level %u in `player_classlevelstats` table, ignoring.",current_level);
                 else
-                    sLog.outDetail("Unused (> MaxPlayerLevel in mangosd.conf) level %u in `player_classlevelstats` table, ignoring.",current_level);
+                    sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `player_classlevelstats` table, ignoring.",current_level);
                 continue;
             }
@@ -2319,5 +2322,5 @@
                     sLog.outErrorDb("Wrong (> 255) level %u in `player_levelstats` table, ignoring.",current_level);
                 else
-                    sLog.outDetail("Unused (> MaxPlayerLevel in mangosd.conf) level %u in `player_levelstats` table, ignoring.",current_level);
+                    sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `player_levelstats` table, ignoring.",current_level);
                 continue;
             }
@@ -2804,17 +2807,17 @@
         }
 
-        if (qinfo->QuestFlags & ~QUEST_MANGOS_FLAGS_DB_ALLOWED)
+        if (qinfo->QuestFlags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED)
         {
             sLog.outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
-                qinfo->GetQuestId(),qinfo->QuestFlags,QUEST_MANGOS_FLAGS_DB_ALLOWED >> 16);
-            qinfo->QuestFlags &= QUEST_MANGOS_FLAGS_DB_ALLOWED;
+                qinfo->GetQuestId(),qinfo->QuestFlags,QUEST_TRINITY_FLAGS_DB_ALLOWED >> 16);
+            qinfo->QuestFlags &= QUEST_TRINITY_FLAGS_DB_ALLOWED;
         }
 
         if(qinfo->QuestFlags & QUEST_FLAGS_DAILY)
         {
-            if(!(qinfo->QuestFlags & QUEST_MANGOS_FLAGS_REPEATABLE))
+            if(!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE))
             {
                 sLog.outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId());
-                qinfo->QuestFlags |= QUEST_MANGOS_FLAGS_REPEATABLE;
+                qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE;
             }
         }
@@ -3029,5 +3032,5 @@
                 }
 
-                qinfo->SetFlag(QUEST_MANGOS_FLAGS_DELIVER);
+                qinfo->SetFlag(QUEST_TRINITY_FLAGS_DELIVER);
 
                 if(!sItemStorage.LookupEntry<ItemPrototype>(id))
@@ -3146,10 +3149,10 @@
                     if(found)
                     {
-                        if(!qinfo->HasFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
+                        if(!qinfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
                         {
-                            sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.",spellInfo->Id,qinfo->QuestId,j+1,j+1);
+                            sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.",spellInfo->Id,qinfo->QuestId,j+1,j+1);
 
                             // this will prevent quest completing without objective
-                            const_cast<Quest*>(qinfo)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT);
+                            const_cast<Quest*>(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
                         }
                     }
@@ -3185,5 +3188,5 @@
                 // In fact SpeakTo and Kill are quite same: either you can speak to mob:SpeakTo or you can't:Kill/Cast
 
-                qinfo->SetFlag(QUEST_MANGOS_FLAGS_KILL_OR_CAST | QUEST_MANGOS_FLAGS_SPEAKTO);
+                qinfo->SetFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO);
 
                 if(!qinfo->ReqCreatureOrGOCount[j])
@@ -3374,8 +3377,8 @@
             mExclusiveQuestGroups.insert(std::pair<int32, uint32>(qinfo->ExclusiveGroup, qinfo->GetQuestId()));
         if(qinfo->LimitTime)
-            qinfo->SetFlag(QUEST_MANGOS_FLAGS_TIMED);
-    }
-
-    // check QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE
+            qinfo->SetFlag(QUEST_TRINITY_FLAGS_TIMED);
+    }
+
+    // check QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE
     for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i)
     {
@@ -3397,10 +3400,10 @@
                 continue;
 
-            if(!quest->HasFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
-            {
-                sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u , but quest not have flag QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.",spellInfo->Id,quest_id);
+            if(!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
+            {
+                sLog.outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u , but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.",spellInfo->Id,quest_id);
 
                 // this will prevent quest completing without objective
-                const_cast<Quest*>(quest)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT);
+                const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
             }
         }
@@ -3659,5 +3662,5 @@
                 }
 
-                if(!MaNGOS::IsValidMapCoord(tmp.x,tmp.y,tmp.z,tmp.o))
+                if(!Trinity::IsValidMapCoord(tmp.x,tmp.y,tmp.z,tmp.o))
                 {
                     sLog.outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",tablename,tmp.x,tmp.y,tmp.id);
@@ -3669,5 +3672,5 @@
             case SCRIPT_COMMAND_TEMP_SUMMON_CREATURE:
             {
-                if(!MaNGOS::IsValidMapCoord(tmp.x,tmp.y,tmp.z,tmp.o))
+                if(!Trinity::IsValidMapCoord(tmp.x,tmp.y,tmp.z,tmp.o))
                 {
                     sLog.outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",tablename,tmp.x,tmp.y,tmp.id);
@@ -3744,10 +3747,10 @@
                 }
 
-                if(!quest->HasFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
-                {
-                    sLog.outErrorDb("Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.",tablename,tmp.datalong,tmp.id);
+                if(!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
+                {
+                    sLog.outErrorDb("Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.",tablename,tmp.datalong,tmp.id);
 
                     // this will prevent quest completing without objective
-                    const_cast<Quest*>(quest)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT);
+                    const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
 
                     // continue; - quest objective requiremet set and command can be allowed
@@ -4378,10 +4381,10 @@
         }
 
-        if(!quest->HasFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT))
-        {
-            sLog.outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.",trigger_ID,quest_ID);
+        if(!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
+        {
+            sLog.outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.",trigger_ID,quest_ID);
 
             // this will prevent quest completing without objective
-            const_cast<Quest*>(quest)->SetFlag(QUEST_MANGOS_FLAGS_EXPLORATION_OR_EVENT);
+            const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
 
             // continue; - quest modified to required obkective and trigger can be allowed.
@@ -4801,4 +4804,52 @@
     return true;
 }
+
+void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool inDB)
+{
+    GraveYardMap::iterator graveLow  = mGraveYardMap.lower_bound(zoneId);
+    GraveYardMap::iterator graveUp   = mGraveYardMap.upper_bound(zoneId);
+    if(graveLow==graveUp)
+    {
+        //sLog.outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.",zoneId,team);
+        return;
+    }
+
+    bool found = false;
+
+    GraveYardMap::iterator itr;
+
+    for(itr = graveLow; itr != graveUp; ++itr)
+    {
+        GraveYardData & data = itr->second;
+
+        // skip not matching safezone id
+        if(data.safeLocId != id)
+            continue;
+
+        // skip enemy faction graveyard at same map (normal area, city, or battleground)
+        // team == 0 case can be at call from .neargrave
+        if(data.team != 0 && team != 0 && data.team != team)
+            continue;
+
+        found = true;
+        break;
+    }
+
+    // no match, return
+    if(!found)
+        return;
+
+    // remove from links
+    mGraveYardMap.erase(itr);
+
+    // remove link from DB
+    if(inDB)
+    {
+        WorldDatabase.PExecute("DELETE FROM game_graveyard_zone WHERE id = '%u' AND ghost_zone = '%u' AND faction = '%u'",id,zoneId,team);
+    }
+
+    return;
+}
+
 
 void ObjectMgr::LoadAreaTriggerTeleports()
@@ -6147,14 +6198,14 @@
 }
 
-bool ObjectMgr::LoadMangosStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value)
+bool ObjectMgr::LoadTrinityStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value)
 {
     // cleanup affected map part for reloading case
-    for(MangosStringLocaleMap::iterator itr = mMangosStringLocaleMap.begin(); itr != mMangosStringLocaleMap.end();)
+    for(TrinityStringLocaleMap::iterator itr = mTrinityStringLocaleMap.begin(); itr != mTrinityStringLocaleMap.end();)
     {
         if(itr->first >= min_value && itr->first <= max_value)
         {
-            MangosStringLocaleMap::iterator itr2 = itr;
+            TrinityStringLocaleMap::iterator itr2 = itr;
             ++itr;
-            mMangosStringLocaleMap.erase(itr2);
+            mTrinityStringLocaleMap.erase(itr2);
         }
         else
@@ -6172,5 +6223,5 @@
         sLog.outString("");
         if(min_value > 0)                                   // error only in case internal strings
-            sLog.outErrorDb(">> Loaded 0 mangos strings. DB table `%s` is empty. Cannot continue.",table);
+            sLog.outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.",table);
         else
             sLog.outString(">> Loaded 0 string templates. DB table `%s` is empty.",table);
@@ -6202,5 +6253,5 @@
         }
 
-        MangosStringLocale& data = mMangosStringLocaleMap[entry];
+        TrinityStringLocale& data = mTrinityStringLocaleMap[entry];
 
         if(data.Content.size() > 0)
@@ -6237,6 +6288,6 @@
 
     sLog.outString();
-    if(min_value > 0)                                       // internal mangos strings
-        sLog.outString( ">> Loaded %u MaNGOS strings from table %s", count,table);
+    if(min_value > 0)                                       // internal Trinity strings
+        sLog.outString( ">> Loaded %u Trinity strings from table %s", count,table);
     else
         sLog.outString( ">> Loaded %u string templates from %s", count,table);
@@ -6245,9 +6296,9 @@
 }
 
-const char *ObjectMgr::GetMangosString(int32 entry, int locale_idx) const
+const char *ObjectMgr::GetTrinityString(int32 entry, int locale_idx) const
 {
     // locale_idx==-1 -> default, locale_idx >= 0 in to idx+1
-    // Content[0] always exist if exist MangosStringLocale
-    if(MangosStringLocale const *msl = GetMangosStringLocale(entry))
+    // Content[0] always exist if exist TrinityStringLocale
+    if(TrinityStringLocale const *msl = GetTrinityStringLocale(entry))
     {
         if(msl->Content.size() > locale_idx+1 && !msl->Content[locale_idx+1].empty())
@@ -6258,7 +6309,7 @@
 
     if(entry > 0)
-        sLog.outErrorDb("Entry %i not found in `mangos_string` table.",entry);
+        sLog.outErrorDb("Entry %i not found in `trinity_string` table.",entry);
     else
-        sLog.outErrorDb("Mangos string entry %i not found in DB.",entry);
+        sLog.outErrorDb("Trinity string entry %i not found in DB.",entry);
     return "<error>";
 }
@@ -6869,13 +6920,13 @@
 }
 
-void ObjectMgr::AddVendorItem( uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 extendedcost )
+void ObjectMgr::AddVendorItem( uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb)
 {
     VendorItemData& vList = m_mCacheVendorItemMap[entry];
     vList.AddItem(item,maxcount,incrtime,extendedcost);
 
-    WorldDatabase.PExecuteLog("INSERT INTO npc_vendor (entry,item,maxcount,incrtime,extendedcost) VALUES('%u','%u','%u','%u','%u')",entry, item, maxcount,incrtime,extendedcost);
-}
-
-bool ObjectMgr::RemoveVendorItem( uint32 entry,uint32 item )
+    if(savetodb) WorldDatabase.PExecuteLog("INSERT INTO npc_vendor (entry,item,maxcount,incrtime,extendedcost) VALUES('%u','%u','%u','%u','%u')",entry, item, maxcount,incrtime,extendedcost);
+}
+
+bool ObjectMgr::RemoveVendorItem( uint32 entry,uint32 item, bool savetodb)
 {
     CacheVendorItemMap::iterator  iter = m_mCacheVendorItemMap.find(entry);
@@ -6887,9 +6938,9 @@
 
     iter->second.RemoveItem(item);
-    WorldDatabase.PExecuteLog("DELETE FROM npc_vendor WHERE entry='%u' AND item='%u'",entry, item);
+    if(savetodb) WorldDatabase.PExecuteLog("DELETE FROM npc_vendor WHERE entry='%u' AND item='%u'",entry, item);
     return true;
 }
 
-bool ObjectMgr::IsVendorItemValid( uint32 vendor_entry, uint32 item_id, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* pl, std::set<uint32>* skip_vendors ) const
+bool ObjectMgr::IsVendorItemValid( uint32 vendor_entry, uint32 item_id, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* pl, std::set<uint32>* skip_vendors, uint32 ORnpcflag ) const
 {
     CreatureInfo const* cInfo = GetCreatureTemplate(vendor_entry);
@@ -6899,9 +6950,9 @@
             ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION);
         else
-            sLog.outErrorDb("Table `npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry);
+            sLog.outErrorDb("Table `(game_event_)npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry);
         return false;
     }
 
-    if(!(cInfo->npcflag & UNIT_NPC_FLAG_VENDOR))
+    if(!((cInfo->npcflag | ORnpcflag) & UNIT_NPC_FLAG_VENDOR))
     {
         if(!skip_vendors || skip_vendors->count(vendor_entry)==0)
@@ -6910,5 +6961,5 @@
                 ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION);
             else
-                sLog.outErrorDb("Table `npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry);
+                sLog.outErrorDb("Table `(game_event_)npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry);
 
             if(skip_vendors)
@@ -6923,5 +6974,5 @@
             ChatHandler(pl).PSendSysMessage(LANG_ITEM_NOT_FOUND, item_id);
         else
-            sLog.outErrorDb("Table `npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore",vendor_entry,item_id);
+            sLog.outErrorDb("Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore",vendor_entry,item_id);
         return false;
     }
@@ -6932,5 +6983,5 @@
             ChatHandler(pl).PSendSysMessage(LANG_EXTENDED_COST_NOT_EXIST,ExtendedCost);
         else
-            sLog.outErrorDb("Table `npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore",item_id,ExtendedCost,vendor_entry);
+            sLog.outErrorDb("Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore",item_id,ExtendedCost,vendor_entry);
         return false;
     }
@@ -6941,5 +6992,5 @@
             ChatHandler(pl).PSendSysMessage("MaxCount!=0 (%u) but IncrTime==0", maxcount);
         else
-            sLog.outErrorDb( "Table `npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry);
+            sLog.outErrorDb( "Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry);
         return false;
     }
@@ -6949,5 +7000,5 @@
             ChatHandler(pl).PSendSysMessage("MaxCount==0 but IncrTime<>=0");
         else
-            sLog.outErrorDb( "Table `npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry);
+            sLog.outErrorDb( "Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry);
         return false;
     }
@@ -6962,5 +7013,5 @@
             ChatHandler(pl).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST,item_id);
         else
-            sLog.outErrorDb( "Table `npc_vendor` has duplicate items %u for vendor (Entry: %u), ignore", item_id, vendor_entry);
+            sLog.outErrorDb( "Table `(game_event_)npc_vendor` has duplicate items %u for vendor (Entry: %u), ignore", item_id, vendor_entry);
         return false;
     }
@@ -6984,5 +7035,5 @@
 }
 
-bool LoadMangosStrings(DatabaseType& db, char const* table,int32 start_value, int32 end_value)
+bool LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value, int32 end_value)
 {
     if(start_value >= 0 || start_value <= end_value)        // start/end reversed for negative values
@@ -6994,4 +7045,4 @@
 
     // for scripting localized strings allowed use _only_ negative entries
-    return objmgr.LoadMangosStrings(db,table,end_value,start_value);
-}
+    return objmgr.LoadTrinityStrings(db,table,end_value,start_value);
+}
Index: trunk/src/game/SkillHandler.cpp
===================================================================
--- trunk/src/game/SkillHandler.cpp (revision 2)
+++ trunk/src/game/SkillHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/UpdateData.cpp
===================================================================
--- trunk/src/game/UpdateData.cpp (revision 2)
+++ trunk/src/game/UpdateData.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Map.cpp
===================================================================
--- trunk/src/game/Map.cpp (revision 2)
+++ trunk/src/game/Map.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -422,5 +424,5 @@
 
     // update player state for other player and visa-versa
-    CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
     Cell cell(p);
     EnsureGridLoadedForPlayer(cell, player, true);
@@ -441,5 +443,5 @@
 Map::Add(T *obj)
 {
-    CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
 
     assert(obj);
@@ -468,5 +470,5 @@
 void Map::MessageBroadcast(Player *player, WorldPacket *msg, bool to_self)
 {
-    CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
 
     if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
@@ -482,6 +484,6 @@
         return;
 
-    MaNGOS::MessageDeliverer post_man(*player, msg, to_self);
-    TypeContainerVisitor<MaNGOS::MessageDeliverer, WorldTypeMapContainer > message(post_man);
+    Trinity::MessageDeliverer post_man(*player, msg, to_self);
+    TypeContainerVisitor<Trinity::MessageDeliverer, WorldTypeMapContainer > message(post_man);
     CellLock<ReadGuard> cell_lock(cell, p);
     cell_lock->Visit(cell_lock, message, *this);
@@ -490,5 +492,5 @@
 void Map::MessageBroadcast(WorldObject *obj, WorldPacket *msg)
 {
-    CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
 
     if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
@@ -505,6 +507,6 @@
         return;
 
-    MaNGOS::ObjectMessageDeliverer post_man(msg);
-    TypeContainerVisitor<MaNGOS::ObjectMessageDeliverer, WorldTypeMapContainer > message(post_man);
+    Trinity::ObjectMessageDeliverer post_man(msg);
+    TypeContainerVisitor<Trinity::ObjectMessageDeliverer, WorldTypeMapContainer > message(post_man);
     CellLock<ReadGuard> cell_lock(cell, p);
     cell_lock->Visit(cell_lock, message, *this);
@@ -513,5 +515,5 @@
 void Map::MessageDistBroadcast(Player *player, WorldPacket *msg, float dist, bool to_self, bool own_team_only)
 {
-    CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
 
     if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
@@ -527,6 +529,6 @@
         return;
 
-    MaNGOS::MessageDistDeliverer post_man(*player, msg, dist, to_self, own_team_only);
-    TypeContainerVisitor<MaNGOS::MessageDistDeliverer , WorldTypeMapContainer > message(post_man);
+    Trinity::MessageDistDeliverer post_man(*player, msg, dist, to_self, own_team_only);
+    TypeContainerVisitor<Trinity::MessageDistDeliverer , WorldTypeMapContainer > message(post_man);
     CellLock<ReadGuard> cell_lock(cell, p);
     cell_lock->Visit(cell_lock, message, *this);
@@ -535,5 +537,5 @@
 void Map::MessageDistBroadcast(WorldObject *obj, WorldPacket *msg, float dist)
 {
-    CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
 
     if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
@@ -550,6 +552,6 @@
         return;
 
-    MaNGOS::ObjectMessageDistDeliverer post_man(*obj, msg,dist);
-    TypeContainerVisitor<MaNGOS::ObjectMessageDistDeliverer, WorldTypeMapContainer > message(post_man);
+    Trinity::ObjectMessageDistDeliverer post_man(*obj, msg,dist);
+    TypeContainerVisitor<Trinity::ObjectMessageDistDeliverer, WorldTypeMapContainer > message(post_man);
     CellLock<ReadGuard> cell_lock(cell, p);
     cell_lock->Visit(cell_lock, message, *this);
@@ -589,5 +591,5 @@
 void Map::Remove(Player *player, bool remove)
 {
-    CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
     if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP)
     {
@@ -641,5 +643,5 @@
 Map::Remove(T *obj, bool remove)
 {
-    CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
     if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
     {
@@ -675,6 +677,6 @@
     assert(player);
 
-    CellPair old_val = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
-    CellPair new_val = MaNGOS::ComputeCellPair(x, y);
+    CellPair old_val = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
+    CellPair new_val = Trinity::ComputeCellPair(x, y);
 
     Cell old_cell(old_val);
@@ -721,5 +723,5 @@
     Cell old_cell = creature->GetCurrentCell();
 
-    CellPair new_val = MaNGOS::ComputeCellPair(x, y);
+    CellPair new_val = Trinity::ComputeCellPair(x, y);
     Cell new_cell(new_val);
 
@@ -727,5 +729,5 @@
     if( old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell) )
     {
-        #ifdef MANGOS_DEBUG
+        #ifdef TRINITY_DEBUG
         if((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
             sLog.outDebug("Creature (GUID: %u Entry: %u) added to moving list from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", creature->GetGUIDLow(), creature->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
@@ -761,5 +763,5 @@
 
         // calculate cells
-        CellPair new_val = MaNGOS::ComputeCellPair(cm.x, cm.y);
+        CellPair new_val = Trinity::ComputeCellPair(cm.x, cm.y);
         Cell new_cell(new_val);
 
@@ -778,5 +780,5 @@
             {
                 // ... or unload (if respawn grid also not loaded)
-                #ifdef MANGOS_DEBUG
+                #ifdef TRINITY_DEBUG
                 if((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
                     sLog.outDebug("Creature (GUID: %u Entry: %u ) can't be move to unloaded respawn grid.",c->GetGUIDLow(),c->GetEntry());
@@ -797,5 +799,5 @@
         if(old_cell.DiffCell(new_cell))
         {
-            #ifdef MANGOS_DEBUG
+            #ifdef TRINITY_DEBUG
             if((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
                 sLog.outDebug("Creature (GUID: %u Entry: %u) moved in grid[%u,%u] from cell[%u,%u] to cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY());
@@ -811,5 +813,5 @@
         else
         {
-            #ifdef MANGOS_DEBUG
+            #ifdef TRINITY_DEBUG
             if((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
                 sLog.outDebug("Creature (GUID: %u Entry: %u) move in same grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY());
@@ -820,5 +822,5 @@
     if(loaded(GridPair(new_cell.GridX(), new_cell.GridY())))
     {
-        #ifdef MANGOS_DEBUG
+        #ifdef TRINITY_DEBUG
         if((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
             sLog.outDebug("Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
@@ -833,5 +835,5 @@
     else
     {
-        #ifdef MANGOS_DEBUG
+        #ifdef TRINITY_DEBUG
         if((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
             sLog.outDebug("Creature (GUID: %u Entry: %u) attempt move from grid[%u,%u]cell[%u,%u] to unloaded grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
@@ -848,5 +850,5 @@
     c->GetRespawnCoord(resp_x, resp_y, resp_z, &resp_o);
 
-    CellPair resp_val = MaNGOS::ComputeCellPair(resp_x, resp_y);
+    CellPair resp_val = Trinity::ComputeCellPair(resp_x, resp_y);
     Cell resp_cell(resp_val);
 
@@ -854,5 +856,5 @@
     c->GetMotionMaster()->Clear();
 
-    #ifdef MANGOS_DEBUG
+    #ifdef TRINITY_DEBUG
     if((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
         sLog.outDebug("Creature (GUID: %u Entry: %u) will moved from grid[%u,%u]cell[%u,%u] to respawn grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY());
@@ -932,5 +934,5 @@
 float Map::GetHeight(float x, float y, float z, bool pUseVmaps) const
 {
-    GridPair p = MaNGOS::ComputeGridPair(x, y);
+    GridPair p = Trinity::ComputeGridPair(x, y);
 
     // half opt method
@@ -1029,5 +1031,5 @@
     float lx,ly;
     int gx,gy;
-    GridPair p = MaNGOS::ComputeGridPair(x, y);
+    GridPair p = Trinity::ComputeGridPair(x, y);
 
     // half opt method
@@ -1140,5 +1142,5 @@
     Cell const& cur_cell = c->GetCurrentCell();
 
-    CellPair xy_val = MaNGOS::ComputeCellPair(c->GetPositionX(), c->GetPositionY());
+    CellPair xy_val = Trinity::ComputeCellPair(c->GetPositionX(), c->GetPositionY());
     Cell xy_cell(xy_val);
     if(xy_cell != cur_cell)
@@ -1164,6 +1166,6 @@
     cell.data.Part.reserved = ALL_DISTRICT;
     cell.SetNoCreate();
-    MaNGOS::VisibleChangesNotifier notifier(*obj);
-    TypeContainerVisitor<MaNGOS::VisibleChangesNotifier, WorldTypeMapContainer > player_notifier(notifier);
+    Trinity::VisibleChangesNotifier notifier(*obj);
+    TypeContainerVisitor<Trinity::VisibleChangesNotifier, WorldTypeMapContainer > player_notifier(notifier);
     CellLock<GridReadGuard> cell_lock(cell, cellpair);
     cell_lock->Visit(cell_lock, player_notifier, *this);
@@ -1174,6 +1176,6 @@
     cell.data.Part.reserved = ALL_DISTRICT;
 
-    MaNGOS::PlayerNotifier pl_notifier(*player);
-    TypeContainerVisitor<MaNGOS::PlayerNotifier, WorldTypeMapContainer > player_notifier(pl_notifier);
+    Trinity::PlayerNotifier pl_notifier(*player);
+    TypeContainerVisitor<Trinity::PlayerNotifier, WorldTypeMapContainer > player_notifier(pl_notifier);
 
     CellLock<ReadGuard> cell_lock(cell, cellpair);
@@ -1183,10 +1185,10 @@
 void Map::UpdateObjectsVisibilityFor( Player* player, Cell cell, CellPair cellpair )
 {
-    MaNGOS::VisibleNotifier notifier(*player);
+    Trinity::VisibleNotifier notifier(*player);
 
     cell.data.Part.reserved = ALL_DISTRICT;
     cell.SetNoCreate();
-    TypeContainerVisitor<MaNGOS::VisibleNotifier, WorldTypeMapContainer > world_notifier(notifier);
-    TypeContainerVisitor<MaNGOS::VisibleNotifier, GridTypeMapContainer  > grid_notifier(notifier);
+    TypeContainerVisitor<Trinity::VisibleNotifier, WorldTypeMapContainer > world_notifier(notifier);
+    TypeContainerVisitor<Trinity::VisibleNotifier, GridTypeMapContainer  > grid_notifier(notifier);
     CellLock<GridReadGuard> cell_lock(cell, cellpair);
     cell_lock->Visit(cell_lock, world_notifier, *this);
@@ -1200,9 +1202,9 @@
 {
     CellLock<ReadGuard> cell_lock(cell, cellpair);
-    MaNGOS::PlayerRelocationNotifier relocationNotifier(*player);
+    Trinity::PlayerRelocationNotifier relocationNotifier(*player);
     cell.data.Part.reserved = ALL_DISTRICT;
 
-    TypeContainerVisitor<MaNGOS::PlayerRelocationNotifier, GridTypeMapContainer >  p2grid_relocation(relocationNotifier);
-    TypeContainerVisitor<MaNGOS::PlayerRelocationNotifier, WorldTypeMapContainer > p2world_relocation(relocationNotifier);
+    TypeContainerVisitor<Trinity::PlayerRelocationNotifier, GridTypeMapContainer >  p2grid_relocation(relocationNotifier);
+    TypeContainerVisitor<Trinity::PlayerRelocationNotifier, WorldTypeMapContainer > p2world_relocation(relocationNotifier);
 
     cell_lock->Visit(cell_lock, p2grid_relocation, *this);
@@ -1213,10 +1215,10 @@
 {
     CellLock<ReadGuard> cell_lock(cell, cellpair);
-    MaNGOS::CreatureRelocationNotifier relocationNotifier(*creature);
+    Trinity::CreatureRelocationNotifier relocationNotifier(*creature);
     cell.data.Part.reserved = ALL_DISTRICT;
     cell.SetNoCreate();                                     // not trigger load unloaded grids at notifier call
 
-    TypeContainerVisitor<MaNGOS::CreatureRelocationNotifier, WorldTypeMapContainer > c2world_relocation(relocationNotifier);
-    TypeContainerVisitor<MaNGOS::CreatureRelocationNotifier, GridTypeMapContainer >  c2grid_relocation(relocationNotifier);
+    TypeContainerVisitor<Trinity::CreatureRelocationNotifier, WorldTypeMapContainer > c2world_relocation(relocationNotifier);
+    TypeContainerVisitor<Trinity::CreatureRelocationNotifier, GridTypeMapContainer >  c2grid_relocation(relocationNotifier);
 
     cell_lock->Visit(cell_lock, c2world_relocation, *this);
Index: trunk/src/game/CreatureAIRegistry.cpp
===================================================================
--- trunk/src/game/CreatureAIRegistry.cpp (revision 2)
+++ trunk/src/game/CreatureAIRegistry.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -24,4 +26,5 @@
 #include "PetAI.h"
 #include "TotemAI.h"
+#include "OutdoorPvPObjectiveAI.h"
 #include "RandomMovementGenerator.h"
 #include "CreatureAIImpl.h"
@@ -41,4 +44,5 @@
         (new CreatureAIFactory<PetAI>("PetAI"))->RegisterSelf();
         (new CreatureAIFactory<TotemAI>("TotemAI"))->RegisterSelf();
+        (new CreatureAIFactory<OutdoorPvPObjectiveAI>("OutdoorPvPObjectiveAI"))->RegisterSelf();
 
         (new MovementGeneratorFactory<RandomMovementGenerator<Creature> >(RANDOM_MOTION_TYPE))->RegisterSelf();
Index: trunk/src/game/GroupReference.h
===================================================================
--- trunk/src/game/GroupReference.h (revision 2)
+++ trunk/src/game/GroupReference.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -25,5 +27,5 @@
 class Player;
 
-class MANGOS_DLL_SPEC GroupReference : public Reference<Group, Player>
+class TRINITY_DLL_SPEC GroupReference : public Reference<Group, Player>
 {
     protected:
Index: trunk/src/game/AddonHandler.cpp
===================================================================
--- trunk/src/game/AddonHandler.cpp (revision 2)
+++ trunk/src/game/AddonHandler.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/Transports.h
===================================================================
--- trunk/src/game/Transports.h (revision 2)
+++ trunk/src/game/Transports.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/SpellMgr.cpp
===================================================================
--- trunk/src/game/SpellMgr.cpp (revision 2)
+++ trunk/src/game/SpellMgr.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/ThreatManager.h
===================================================================
--- trunk/src/game/ThreatManager.h (revision 2)
+++ trunk/src/game/ThreatManager.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -45,5 +47,5 @@
 //==============================================================
 
-class MANGOS_DLL_SPEC HostilReference : public Reference<Unit, ThreatManager>
+class TRINITY_DLL_SPEC HostilReference : public Reference<Unit, ThreatManager>
 {
     private:
@@ -129,5 +131,5 @@
 class ThreatManager;
 
-class MANGOS_DLL_SPEC ThreatContainer
+class TRINITY_DLL_SPEC ThreatContainer
 {
     private:
@@ -167,5 +169,5 @@
 //=================================================
 
-class MANGOS_DLL_SPEC ThreatManager
+class TRINITY_DLL_SPEC ThreatManager
 {
     private:
Index: trunk/src/game/Language.h
===================================================================
--- trunk/src/game/Language.h (revision 40)
+++ trunk/src/game/Language.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,16 +11,16 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef __MANGOS_LANGUAGE_H
-#define __MANGOS_LANGUAGE_H
-
-enum MangosStrings
+#ifndef __TRINITY_LANGUAGE_H
+#define __TRINITY_LANGUAGE_H
+
+enum TrinityStrings
 {
     // for chat commands
@@ -660,4 +662,67 @@
 
     // Use for not-in-svn patches         10000-10999
+    // opvp hp
+    LANG_OPVP_HP_CAPTURE_OVERLOOK_H     = 10001,
+    LANG_OPVP_HP_CAPTURE_OVERLOOK_A     = 10002,
+    LANG_OPVP_HP_CAPTURE_STADIUM_H      = 10003,
+    LANG_OPVP_HP_CAPTURE_STADIUM_A      = 10004,
+    LANG_OPVP_HP_CAPTURE_BROKENHILL_H   = 10005,
+    LANG_OPVP_HP_CAPTURE_BROKENHILL_A   = 10006,
+    LANG_OPVP_HP_LOOSE_OVERLOOK_H       = 10007,
+    LANG_OPVP_HP_LOOSE_OVERLOOK_A       = 10008,
+    LANG_OPVP_HP_LOOSE_STADIUM_H        = 10009,
+    LANG_OPVP_HP_LOOSE_STADIUM_A        = 10010,
+    LANG_OPVP_HP_LOOSE_BROKENHILL_H     = 10011,
+    LANG_OPVP_HP_LOOSE_BROKENHILL_A     = 10012,
+    // opvp zm
+    LANG_OPVP_ZM_CAPTURE_WEST_H         = 10013,
+    LANG_OPVP_ZM_CAPTURE_WEST_A         = 10014,
+    LANG_OPVP_ZM_CAPTURE_EAST_H         = 10015,
+    LANG_OPVP_ZM_CAPTURE_EAST_A         = 10016,
+    LANG_OPVP_ZM_CAPTURE_GY_H           = 10017,
+    LANG_OPVP_ZM_CAPTURE_GY_A           = 10018,
+    LANG_OPVP_ZM_LOOSE_WEST_H           = 10019,
+    LANG_OPVP_ZM_LOOSE_WEST_A           = 10020,
+    LANG_OPVP_ZM_LOOSE_EAST_H           = 10021,
+    LANG_OPVP_ZM_LOOSE_EAST_A           = 10022,
+    LANG_OPVP_ZM_LOOSE_GY_H             = 10023,
+    LANG_OPVP_ZM_LOOSE_GY_A             = 10024,
+    // opvp na
+    LANG_OPVP_NA_CAPTURE_H              = 10025,
+    LANG_OPVP_NA_CAPTURE_A              = 10026,
+    LANG_OPVP_NA_LOOSE_H                = 10027,
+    LANG_OPVP_NA_LOOSE_A                = 10028,
+    // opvp tf
+    LANG_OPVP_TF_CAPTURE_H              = 10029,
+    LANG_OPVP_TF_CAPTURE_A              = 10030,
+    LANG_OPVP_TF_LOOSE_H                = 10031,
+    LANG_OPVP_TF_LOOSE_A                = 10032,
+    // opvp ep
+    LANG_OPVP_EP_CAPTURE_NPT_H          = 10033,
+    LANG_OPVP_EP_CAPTURE_NPT_A          = 10034,
+    LANG_OPVP_EP_CAPTURE_EWT_H          = 10035,
+    LANG_OPVP_EP_CAPTURE_EWT_A          = 10036,
+    LANG_OPVP_EP_CAPTURE_CGT_H          = 10037,
+    LANG_OPVP_EP_CAPTURE_CGT_A          = 10038,
+    LANG_OPVP_EP_CAPTURE_PWT_H          = 10039,
+    LANG_OPVP_EP_CAPTURE_PWT_A          = 10040,
+    LANG_OPVP_EP_LOOSE_NPT_H            = 10041,
+    LANG_OPVP_EP_LOOSE_NPT_A            = 10042,
+    LANG_OPVP_EP_LOOSE_EWT_H            = 10043,
+    LANG_OPVP_EP_LOOSE_EWT_A            = 10044,
+    LANG_OPVP_EP_LOOSE_CGT_H            = 10045,
+    LANG_OPVP_EP_LOOSE_CGT_A            = 10046,
+    LANG_OPVP_EP_LOOSE_PWT_H            = 10047,
+    LANG_OPVP_EP_LOOSE_PWT_A            = 10048,
+    // opvp si
+    LANG_OPVP_SI_CAPTURE_H              = 10049,
+    LANG_OPVP_SI_CAPTURE_A              = 10050,
+    // opvp gossips
+    LANG_OPVP_EP_FLIGHT_NPT             = 10051,
+    LANG_OPVP_EP_FLIGHT_EWT             = 10052,
+    LANG_OPVP_EP_FLIGHT_CGT             = 10053,
+    LANG_OPVP_ZM_GOSSIP_ALLIANCE        = 10054,
+    LANG_OPVP_ZM_GOSSIP_HORDE           = 10055,
+
     // Use for custom patches             11000-11999
 
Index: trunk/src/game/GroupRefManager.h
===================================================================
--- trunk/src/game/GroupRefManager.h (revision 2)
+++ trunk/src/game/GroupRefManager.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/CreatureAI.h
===================================================================
--- trunk/src/game/CreatureAI.h (revision 13)
+++ trunk/src/game/CreatureAI.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_CREATUREAI_H
-#define MANGOS_CREATUREAI_H
+#ifndef TRINITY_CREATUREAI_H
+#define TRINITY_CREATUREAI_H
 
 #include "Common.h"
@@ -66,5 +68,5 @@
 };
 
-class MANGOS_DLL_SPEC CreatureAI
+class TRINITY_DLL_SPEC CreatureAI
 {
     public:
Index: trunk/src/game/ObjectAccessor.cpp
===================================================================
--- trunk/src/game/ObjectAccessor.cpp (revision 2)
+++ trunk/src/game/ObjectAccessor.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -40,12 +42,12 @@
 #include <cmath>
 
-#define CLASS_LOCK MaNGOS::ClassLevelLockable<ObjectAccessor, ZThread::FastMutex>
+#define CLASS_LOCK Trinity::ClassLevelLockable<ObjectAccessor, ZThread::FastMutex>
 INSTANTIATE_SINGLETON_2(ObjectAccessor, CLASS_LOCK);
 INSTANTIATE_CLASS_MUTEX(ObjectAccessor, ZThread::FastMutex);
 
-namespace MaNGOS
-{
-
-    struct MANGOS_DLL_DECL BuildUpdateForPlayer
+namespace Trinity
+{
+
+    struct TRINITY_DLL_DECL BuildUpdateForPlayer
     {
         Player &i_player;
@@ -353,5 +355,5 @@
 ObjectAccessor::_buildChangeObjectForPlayer(WorldObject *obj, UpdateDataMapType &update_players)
 {
-    CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
     Cell cell(p);
     cell.data.Part.reserved = ALL_DISTRICT;
@@ -393,5 +395,5 @@
 
     // build mapid*cellid -> guid_set map
-    CellPair cell_pair = MaNGOS::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
+    CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
     uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
 
@@ -412,5 +414,5 @@
 
     // build mapid*cellid -> guid_set map
-    CellPair cell_pair = MaNGOS::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
+    CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY());
     uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;
 
@@ -522,9 +524,9 @@
         Map *map;
 
-        MaNGOS::ObjectUpdater updater(diff);
+        Trinity::ObjectUpdater updater(diff);
         // for creature
-        TypeContainerVisitor<MaNGOS::ObjectUpdater, GridTypeMapContainer  > grid_object_update(updater);
+        TypeContainerVisitor<Trinity::ObjectUpdater, GridTypeMapContainer  > grid_object_update(updater);
         // for pets
-        TypeContainerVisitor<MaNGOS::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater);
+        TypeContainerVisitor<Trinity::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater);
 
         for(CreatureLocationHolderType::iterator iter=creature_locations.begin(); iter != creature_locations.end(); ++iter)
@@ -538,5 +540,5 @@
             map = MapManager::Instance().GetMap((*iter).first, player);
 
-            CellPair standing_cell(MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY()));
+            CellPair standing_cell(Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY()));
 
             // Check for correctness of standing_cell, it also avoids problems with update_cell
@@ -591,5 +593,5 @@
             continue;
 
-        CellPair p = MaNGOS::ComputeCellPair(iter->second->GetPositionX(), iter->second->GetPositionY());
+        CellPair p = Trinity::ComputeCellPair(iter->second->GetPositionX(), iter->second->GetPositionY());
         if( (cell_min.x_coord <= p.x_coord && p.x_coord <= cell_max.x_coord) &&
             (cell_min.y_coord <= p.y_coord && p.y_coord <= cell_max.y_coord) )
@@ -611,5 +613,5 @@
 ObjectAccessor::UpdateObjectVisibility(WorldObject *obj)
 {
-    CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
     Cell cell(p);
 
@@ -619,5 +621,5 @@
 void ObjectAccessor::UpdateVisibilityForPlayer( Player* player )
 {
-    CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
+    CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
     Cell cell(p);
     Map* m = MapManager::Instance().GetMap(player->GetMapId(),player);
Index: trunk/src/game/GlobalEvents.h
===================================================================
--- trunk/src/game/GlobalEvents.h (revision 2)
+++ trunk/src/game/GlobalEvents.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/game/OutdoorPvPObjectiveAI.h
===================================================================
--- trunk/src/game/OutdoorPvPObjectiveAI.h (revision 44)
+++ trunk/src/game/OutdoorPvPObjectiveAI.h (revision 44)
@@ -0,0 +1,45 @@
+/* 
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TRINITY_OUTDOORPVPOBJECTIVEAI_H
+#define TRINITY_OUTDOORPVPOBJECTIVEAI_H
+
+#include "CreatureAI.h"
+
+class Creature;
+
+class TRINITY_DLL_DECL OutdoorPvPObjectiveAI : public CreatureAI
+{
+    public:
+
+        OutdoorPvPObjectiveAI(Creature &c);
+
+        void MoveInLineOfSight(Unit *);
+        bool IsVisible(Unit *) const;
+        void AttackStart(Unit *);
+        void EnterEvadeMode();
+        void UpdateAI(const uint32 diff);
+
+        static int Permissible(const Creature *);
+
+    private:
+        Creature &i_creature;
+};
+#endif
Index: trunk/src/game/SpellAuraDefines.h
===================================================================
--- trunk/src/game/SpellAuraDefines.h (revision 2)
+++ trunk/src/game/SpellAuraDefines.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,13 +11,13 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
-#ifndef MANGOS_SPELLAURADEFINES_H
-#define MANGOS_SPELLAURADEFINES_H
+#ifndef TRINITY_SPELLAURADEFINES_H
+#define TRINITY_SPELLAURADEFINES_H
 
 #define MAX_AURAS 56
Index: trunk/src/game/IRCFunc.h
===================================================================
--- trunk/src/game/IRCFunc.h (revision 39)
+++  (revision )
@@ -1,251 +1,0 @@
-#ifndef _IRC_CLIENT_FUNC
-#define _IRC_CLIENT_FUNC
-
-std::string GetUser(std::string szU)
-{
-    int pos = szU.find("!");
-    return szU.substr(0, pos);
-}
-// Delink will remove anything considered "non chat" from a string
-// Linked items (items that players can click on to see a description)
-// contain extra characters wich the client filter out, this function
-// makes sure people on irc do not see those characters.
-std::string Delink(std::string msg)
-{
-    std::size_t pos;
-    while((pos = msg.find("|Hitem")) != std::string::npos)
-    {
-        std::size_t find1 = msg.find("|h", pos);
-		std::size_t find2 = msg.find("|h", find1 + 2);
-        msg.replace(pos, find1 - pos + 2, "\x2");
-        msg.replace(msg.find("|h", pos), 2, "\x2");
-    }
-    while((pos = msg.find("|Henchant")) != std::string::npos)
-    {
-        std::size_t find1 = msg.find("|h", pos);
-        std::size_t find2 = msg.find("|h", find1 + 2);
-        msg.replace(pos, find1 - pos + 2, "\x2");
-        msg.replace(msg.find("|h", pos), 2, "\x2");
-		//msg.replace(find2, 2, "\x2");
-    }
-    return msg;
-}
-
-// This function converts the characters used by the client to identify colour to IRC format.
-std::string WoWcol2IRC(std::string msg)
-{
-    std::size_t pos;
-    char IRCCol[9][4] = { "\xF", "\xF", "\x3\x31\x34", "\x3\x30\x33", "\x3\x31\x32", "\x3\x30\x36", "\x3\x30\x37", "\x3\x30\x34", "\x3\x30\x37"};
-    char WoWCol[9][12] = { "|r", "|cffffffff", "|cff9d9d9d", "|cff1eff00", "|cff0070dd", "|cffa335ee", "|cffff8000", "|cffe6cc80", "|cffffd000"};
-    for (int i=0; i<=8; i++)
-    {
-        while ((pos = msg.find(WoWCol[i])) != std::string::npos)
-        {
-            if (i == 0)
-                msg.replace(pos, 2, IRCCol[i]);
-            else
-                msg.replace(pos, 10, IRCCol[i]);
-        }
-    }
-    return msg;
-}
-
-// This function converts the characters used by IRC to identify colour to a format the client can understand.
-std::string IRCcol2WoW(std::string msg)
-{
-    std::size_t pos;
-    char IRCCol[16][4] = { "\x3\x30", "\x3\x31", "\x3\x32", "\x3\x33", "\x3\x34", "\x3\x35", "\x3\x36", "\x3\x37", "\x3\x38", "\x3\x39", "\x3\x31\x30", "\x3\x31\x31", "\x3\x31\x32", "\x3\x31\x33", "\x3\x31\x34", "\x3\x31\x35"};
-    char IRCCol2[10][4] = { "\x3\x30\x30", "\x3\x30\x31", "\x3\x30\x32", "\x3\x30\x33", "\x3\x30\x34", "\x3\x30\x35", "\x3\x30\x36", "\x3\x30\x37", "\x3\x30\x38", "\x3\x30\x39"};
-    char WoWcol[16][12] = { "|cffffffff", "|cff000000", "|cff00007f", "|cff009300", "|cffff0000", "|cff7f0000", "|cff9c009c", "|cfffc9300", "|cffffff00", "|cff00fc00", "|cff009393", "|cff00ffff", "|cff0000fc", "|cffff00ff", "|cff7f7f7f", "|cffd2d2d2"};
-    for (int i=15; i>=0; i--)
-    {
-        if (i<10)
-        {
-            while ((pos = msg.find(IRCCol2[i])) != std::string::npos)
-            {
-                msg.replace(pos, 3, WoWcol[i]);
-            }
-            while ((pos = msg.find(IRCCol[i])) != std::string::npos)
-            {
-                msg.replace(pos, 2, WoWcol[i]);
-            }
-
-        }
-        else
-        {
-            while ((pos = msg.find(IRCCol[i])) != std::string::npos)
-            {
-                msg.replace(pos, 3, WoWcol[i]);
-            }
-        }
-
-        // Remove Bold, Reverse, Underline from IRC
-        char Checker[3][3] = {"\x2","\x16","\x1F"}; // This is the Hex part not Dec. In Decimal its (2,22,31)
-        for(int I=0; I < 3; I++)
-        {
-            while ((pos = msg.find(Checker[I])) != std::string::npos)
-            {	
-                msg.replace(pos, 1, "");
-            }
-        }
-        // Finished Removing !
-
-    }
-
-    while ((pos = msg.find("\x3")) != std::string::npos)
-    {
-        msg.replace(pos, 1, "|r");
-    }
-    while ((pos = msg.find("\xF")) != std::string::npos)
-    {
-        msg.replace(pos, 1, "|r");
-    }
-
-    return msg;
-}
-
-// This function compares 2 strings
-int nocase_cmp(const string & s1, const string& s2)
-{
-    string::const_iterator it1=s1.begin();
-    string::const_iterator it2=s2.begin();
-
-    //stop when either string's end has been reached
-    while ( (it1!=s1.end()) && (it2!=s2.end()) )
-    {
-        if(::toupper(*it1) != ::toupper(*it2))              //letters differ?
-            // return -1 to indicate smaller than, 1 otherwise
-            return (::toupper(*it1)  < ::toupper(*it2)) ? -1 : 1;
-        //proceed to the next character in each string
-        ++it1;
-        ++it2;
-    }
-    size_t size1=s1.size(), size2=s2.size();                // cache lengths
-    //return -1,0 or 1 according to strings' lengths
-    if (size1==size2)
-        return 0;
-    return (size1<size2) ? -1 : 1;
-}
-
-std::string MakeMsgA(const char *sLine, ... )
-{
-    va_list ap;
-    char tmpoutp[1024];
-    va_start(ap, sLine);
-    vsnprintf(tmpoutp, 1024, sLine, ap );
-    va_end(ap);
-    std::string outp = tmpoutp;
-    return outp;
-}
-
-std::string MakeMsgP(int CLINE, std::string Msg, Player *plr)
-{
-    //	std::string ChatTag = "";
-    //	switch (plr->GetTeam())
-    //	{
-    //		case 67:ChatTag.append("4");break; //horde
-    //		case 469:ChatTag.append("12");break; //alliance
-    //	}
-    std::string sMsg = sIRC.MakeMsg(sIRC.GetChatLine(CLINE), "$Msg", Msg);
-    //	sMsg = ChatTag + MakeMsg(sMsg, "$Name", plr->GetName());
-    if (plr->GetTeam() == 67)
-        sMsg = sIRC.MakeMsg(sMsg, "$Name", MakeMsgA("\0034%s\003", plr->GetName()));
-    else if (plr->GetTeam() == 469)
-        sMsg = sIRC.MakeMsg(sMsg, "$Name", MakeMsgA("\00312%s\003", plr->GetName()));
-    if(plr->isAFK())
-        sMsg = sIRC.MakeMsg(sMsg, "$Tag", "<AFK>");
-    else if(plr->isDND())
-        sMsg = sIRC.MakeMsg(sMsg, "$Tag", "<DND>");
-    else
-        sMsg = sIRC.MakeMsg(sMsg, "$Tag", "");
-    sMsg = sIRC.MakeMsg(sMsg, "$Level", MakeMsgA("%d", plr->getLevel()));
-    sMsg = Delink(sMsg);
-    sMsg = WoWcol2IRC(sMsg);
-    return sMsg;
-}
-
-/*
-std::string MakeMsg(std::string msg, std::string var, int val)
-{
-    std::ostringstream ss;
-    ss << val;
-
-    std::string nval = ss.str();
-    std::size_t start = msg.find(var);
-    if (start != std::string::npos)
-        msg.replace(start, var.length(), val);
-    return msg;
-}
-*/
-/*
-std::string MakeMsg(const char *sLine, ... )
-{
-    va_list ap;
-    char tmpoutp[1024];
-    va_start(ap, sLine);
-    vsnprintf(tmpoutp, 1024, sLine, ap );
-    va_end(ap);
-    std::string outp = tmpoutp;
-    return outp;
-}
-*/
-
-// This function checks if a channel exists in out configuration
-// Mangchat supports as many channels as you like
-// However the default has been set to 10
-// if you wish to increase this you must edit the:
-// MAX_CONF_CHANNELS variable in IRCClient.h
-bool Channel_Valid(std::string Channel)
-{
-    for(int i=1;i < sIRC._chan_count + 1;i++)
-    {
-        if(nocase_cmp(sIRC._wow_chan[i], Channel)==0)
-            return true;
-    }
-    return false;
-}
-
-std::string GetWoWChannel(std::string Channel)
-{
-    for(int i=1;i < sIRC._chan_count + 1;i++)
-    {
-        if("#" + sIRC._irc_chan[i] == Channel)
-            return sIRC._wow_chan[i];
-    }
-    return "";
-}
-
-std::string GetIRCChannel(std::string Channel)
-{
-    for(int i=1;i < sIRC._chan_count + 1;i++)
-    {
-        if(sIRC._wow_chan[i] == Channel)
-            return sIRC._irc_chan[i];
-    }
-    return "";
-}
-
-std::string* getArray(std::string PARAMS, int nCount, std::string )
-{
-    std::string *array = new std::string[nCount];
-    if(PARAMS.size() > 0)
-    {
-        int pcnt = 0;
-        size_t ps = 0;
-        size_t pc = -1;
-        for(int i = 0;i < nCount;i++)
-        {
-            pc = PARAMS.find(" ", pc + 1);
-            if(i + 1 == nCount && nCount != 1)
-            {
-                if(ps > 0 && pc > 0)
-                    array[i] = PARAMS.substr(ps, PARAMS.size() - ps);
-            }
-            else
-                array[i] = PARAMS.substr(ps, pc - ps);
-            ps = pc + 1;
-        }
-    }
-    return array;
-}
-#endif
Index: trunk/src/game/IRCIO.cpp
===================================================================
--- trunk/src/game/IRCIO.cpp (revision 39)
+++  (revision )
@@ -1,436 +1,0 @@
-#include "IRCClient.h"
-#include "IRCCmd.h"
-#include "IRCFunc.h"
-#include "ObjectAccessor.h"
-#include "ObjectMgr.h"
-#include "WorldPacket.h"
-#include "ChannelMgr.h"
-#include "Config/ConfigEnv.h"
-#include "Channel.h"
-#include "World.h"
-
-IRCCmd Command;
-void IRCClient::Handle_IRC(std::string sData)
-{
-    sLog.outDebug(sData.c_str());
-    // If first 5 chars are ERROR then something is wrong
-    // either link is being closed, nickserv ghost command, etc...
-    if(sData.substr(0, 5) == "ERROR")
-    {
-        Disconnect();
-        return;
-    }
-    if(sData.substr(0, 4) == "PING")
-    {
-        // if the first 4 characters contain PING
-        // the server is checking if we are still alive
-        // sen back PONG back plus whatever the server send with it
-        SendIRC("PONG " + sData.substr(4, sData.size() - 4));
-    }
-    else
-    {
-        // if the first line contains : its an irc message
-        // such as private messages channel join etc.
-        if(sData.substr(0, 1) == ":")
-        {
-            // find the spaces in the receieved line
-            size_t p1 = sData.find(" ");
-            size_t p2 = sData.find(" ", p1 + 1);
-            // because the irc protocol uses simple spaces
-            // to seperate data we can easy pick them out
-            // since we know the position of the spaces
-            std::string USR = sData.substr(1, p1 - 1);
-            std::string CMD = sData.substr(p1 + 1, p2 - p1 - 1);
-            // trasform the commands to lowercase to make sure they always match
-            std::transform(CMD.begin(), CMD.end(), CMD.begin(), towlower);
-            // Extract the username from the first part
-            std::string szUser = GetUser(USR);
-            // if we receieved the internet connect code
-            // we know for sure that were in and we can
-            // authenticate ourself.
-            if(CMD == sIRC._ICC)
-            {
-                // _Auth is defined in mangosd.conf (irc.auth)
-                // 0 do not authenticate
-                // 1 use nickserv
-                // 2 use quakenet
-                // aditionally you can provide you own authentication method here
-                switch(sIRC._Auth)
-                {
-                    case 1:
-                        SendIRC("PRIVMSG nickserv :IDENTIFY " + sIRC._Pass);
-                        break;
-                    case 2:
-                        SendIRC("PRIVMSG nickserv :IDENTIFY " + sIRC._Auth_Nick + " " + sIRC._Pass);
-                        break;
-                    case 3:
-                        SendIRC("PRIVMSG Q@CServe.quakenet.org :AUTH " + sIRC._Nick + " " + sIRC._Pass);
-                        break;
-					case 4:
-                        SendIRC("PRIVMSG Q@CServe.quakenet.org :AUTH " + sIRC._Auth_Nick + " " + sIRC._Pass);
-                        break;
-				}
-                // if we join a default channel leave this now.
-                if(sIRC._ldefc==1)
-                    SendIRC("PART #" + sIRC._defchan);
-                // Loop thru the channel array and send a command to join them on IRC.
-                for(int i=1;i < sIRC._chan_count + 1;i++)
-                {
-                    SendIRC("JOIN #" + sIRC._irc_chan[i]);
-                }
-            }
-            // someone joined the channel this could be the bot or another user
-            if(CMD == "join")
-            {
-                size_t p = sData.find(":", p1);
-                std::string CHAN = sData.substr(p + 1, sData.size() - p - 2);
-                // if the user is us it means we join the channel
-                if ((szUser == sIRC._Nick) )
-                {
-                    // its us that joined the channel
-                    Send_IRC_Channel(CHAN, MakeMsg(MakeMsg(sIRC.JoinMsg, "$Ver", sIRC._Mver.c_str()), "$Trigger", sIRC._cmd_prefx.c_str()), true);
-                }
-                else
-                {
-                    // if the user is not us its someone else that joins
-                    // so we construct a message and send this to the clients.
-                    // MangChat now uses Send_WoW_Channel to send to the client
-                    // this makes MangChat handle the packets instead of previously the world.
-                    if((sIRC.BOTMASK & 2) != 0)
-                        Send_WoW_Channel(GetWoWChannel(CHAN).c_str(), IRCcol2WoW(MakeMsg(MakeMsg(GetChatLine(JOIN_IRC), "$Name", szUser), "$Channel", GetWoWChannel(CHAN))));
-                }
-            }
-            // someone on irc left or quit the channel
-            if(CMD == "part" || CMD == "quit")
-            {
-                size_t p3 = sData.find(" ", p2 + 1);
-                std::string CHAN = sData.substr(p2 + 1, p3 - p2 - 1);
-                // Logout IRC Nick From MangChat If User Leaves Or Quits IRC.
-                if(Command.IsLoggedIn(szUser))
-                {
-                    _CDATA CDATA;
-                    CDATA.USER      = szUser;
-                    Command.Handle_Logout(&CDATA);
-                }
-                // Construct a message and inform the clients on the same channel.
-				if((sIRC.BOTMASK & 2) != 0)
-                    Send_WoW_Channel(GetWoWChannel(CHAN).c_str(), IRCcol2WoW(MakeMsg(MakeMsg(GetChatLine(LEAVE_IRC), "$Name", szUser), "$Channel", GetWoWChannel(CHAN))));     
-            }
-            // someone changed their nick
-			if (CMD == "nick" && (sIRC.BOTMASK & 128) != 0)
-            {
-                MakeMsg(MakeMsg(GetChatLine(CHANGE_NICK), "$Name", szUser), "$NewName", sData.substr(sData.find(":", p2) + 1));
-				// If the user is logged in and changes their nick 
-				// then we want to either log them out or update 
-				// their nick in the bot. I chose to update the bots user list.
-				if(Command.IsLoggedIn(szUser))
-				{
-                    std::string NewNick = sData.substr(sData.find(":", p2) + 1);
-					// On freenode I noticed the server sends an extra character
-					// at the end of the string, so we need to erase the last
-					// character of the string. if you have a problem with getting
-					// the last letter of your nick erased, then remove the - 1.
-					NewNick.erase(NewNick.length() - 1, 1);
-
-					for(std::list<_client*>::iterator i=Command._CLIENTS.begin(); i!=Command._CLIENTS.end();i++)
-                    {
-                        if((*i)->Name == szUser)
-                        {
-					        (*i)->Name     = NewNick;
-					        sIRC.Send_IRC_Channel(NewNick.c_str(), "I Noticed You Changed Your Nick, I Have Updated My Internal Database Accordingly.", true, "NOTICE");
-					        
-							// Figure why not output to the logfile, makes tracing problems easier.
-							sIRC.iLog.WriteLog(" %s : %s Changed Nick To: %s", sIRC.iLog.GetLogDateTimeStr().c_str(), szUser.c_str(), NewNick.c_str());
-                        }
-                    }
-				}
-
-            }
-            // someone was kicked from irc
-            if (CMD == "kick")
-            {
-                // extract the details
-                size_t p3 = sData.find(" ", p2 + 1);
-                size_t p4 = sData.find(" ", p3 + 1);
-                size_t p5 = sData.find(":", p4);
-                std::string CHAN = sData.substr(p2 + 1, p3 - p2 - 1);
-                std::string WHO = sData.substr(p3 + 1, p4 - p3 - 1);
-                std::string BY = sData.substr(p4 + 1, sData.size() - p4 - 1);
-                // if the one kicked was us
-                if(WHO == sIRC._Nick)
-                {
-                    // and autojoin is enabled
-                    // return to the channel
-                    if(sIRC._autojoinkick == 1)
-                    {
-                        SendIRC("JOIN " + CHAN);
-                        Send_IRC_Channel(CHAN, sIRC.kikmsg, true);
-                    }
-                }
-                else
-                {
-                    // if it is not us who was kicked we need to inform the clients someone
-                    // was removed from the channel
-                    // construct a message and send it to the players.
-                    Send_WoW_Channel(GetWoWChannel(CHAN).c_str(), "<IRC>[" + WHO + "]: Was Kicked From " + CHAN + " By: " + szUser);
-                }
-            }
-            // a private chat message was receieved.
-            if(CMD == "privmsg" || CMD == "notice")
-            {
-                // extract the values
-                size_t p = sData.find(" ", p2 + 1);
-                std::string FROM = sData.substr(p2 + 1, p - p2 - 1);
-                std::string CHAT = sData.substr(p + 2, sData.size() - p - 3);
-                // if this is our username it means we recieved a PM
-                if(FROM == sIRC._Nick)
-                {
-                    if(CHAT.find("\001VERSION\001") < CHAT.size())
-                    {
-                        Send_IRC_Channel(szUser, MakeMsg("\001VERSION MangChat %s ©2008 |Death|\001", "%s" , sIRC._Mver.c_str()), true, "PRIVMSG");
-                    }
-                    // a pm is required for certain commands
-                    // such as login. to validate the command
-                    // we send it to the command class wich handles
-                    // evrything else.
-                    Command.IsValid(szUser, FROM, CHAT, CMD);
-                }
-                else
-                {
-                    // if our name is not in it, it means we receieved chat on one of the channels
-                    // magchat is in. the first thing we do is check if it is a command or not
-                    if(!Command.IsValid(szUser, FROM, CHAT, CMD))
-					{
-						Send_WoW_Channel(GetWoWChannel(FROM).c_str(), IRCcol2WoW(MakeMsg(MakeMsg(GetChatLine(IRC_WOW), "$Name", szUser), "$Msg", CHAT)));
-					}
-                    // if we indeed receieved a command we do not want to display this to the players
-                    // so only incanse the isvalid command returns false it will be sent to all player.
-                    // the isvalid function will automaitcly process the command on true.
-                }
-            }
-            if(CMD == "mode")
-            {
-                // extract the mode details
-                size_t p3 = sData.find(" ", p2 + 1);
-                size_t p4 = sData.find(" ", p3 + 1);
-                size_t p5 = sData.find(" ", p4 + 1);
-                std::string CHAN = sData.substr(p2 + 1, p3 - p2 - 1);
-                std::string MODE = sData.substr(p3 + 1, p4 - p3 - 1);
-                std::string NICK = sData.substr(p4 + 1, p5 - p4 - 1);			    
-				bool _AmiOp;
-				_AmiOp = false;
-				//A mode was changed on us
-				if(NICK.c_str() == sIRC._Nick)
-					_AmiOp = true;
-
-			}
-        }
-    }
-}
-
-// This function is called in Channel.h
-// based on nAction it will inform the people on
-// irc when someone leaves one of the game channels.
-// nAction is based on the struct CACTION
-void IRCClient::Handle_WoW_Channel(std::string Channel, Player *plr, int nAction)
-{
-    // make sure that we are connected
-    if(sIRC.Connected && (sIRC.BOTMASK & 1)!= 0)
-    {
-        if(Channel_Valid(Channel))
-        {
-            std::string GMRank = "";
-            std::string pname = plr->GetName();
-            bool DoGMAnnounce = false;
-            if (plr->GetSession()->GetSecurity() > 0 && (sIRC.BOTMASK & 8)!= 0)
-                DoGMAnnounce = true;
-            if (plr->isGameMaster() && (sIRC.BOTMASK & 16)!= 0)
-                DoGMAnnounce = true;
-            if(DoGMAnnounce)
-            {
-                switch(plr->GetSession()->GetSecurity())    //switch case to determine what rank the "gm" is
-                {
-                    case 0: GMRank = "";break;
-                    case 1: GMRank = "\0037"+sIRC.ojGM1;break;
-                    case 2: GMRank = "\0037"+sIRC.ojGM2;break;
-                    case 3: GMRank = "\0037"+sIRC.ojGM3;break;
-                    case 4: GMRank = "\0037"+sIRC.ojGM4;break;
-                    case 5: GMRank = "\0037"+sIRC.ojGM5;break;
-                }
-            }
-            std::string ChatTag = "";
-            switch (plr->GetTeam())
-            {
-                case 67:ChatTag.append("\0034");break;      //horde
-                case 469:ChatTag.append("\00312");break;    //alliance
-            }
-            std::string query = "INSERT INTO `IRC_Inchan` VALUES (%d,'"+pname+"','"+Channel+"')";
-            std::string lchan = "DELETE FROM `IRC_Inchan` WHERE `guid` = %d AND `channel` = '"+Channel+"'";
-            switch(nAction)
-            {
-                case CHANNEL_JOIN:
-                    Send_IRC_Channel(GetIRCChannel(Channel), MakeMsg(MakeMsg(MakeMsg(GetChatLine(JOIN_WOW), "$Name", ChatTag + plr->GetName()), "$Channel", Channel), "$GM", GMRank));
-                    WorldDatabase.PExecute(lchan.c_str(), plr->GetGUID());
-                    WorldDatabase.PExecute(query.c_str(), plr->GetGUID());
-                    break;
-                case CHANNEL_LEAVE:
-                    Send_IRC_Channel(GetIRCChannel(Channel), MakeMsg(MakeMsg(MakeMsg(GetChatLine(LEAVE_WOW), "$Name", ChatTag + plr->GetName()), "$Channel", Channel), "$GM", GMRank));
-                    WorldDatabase.PExecute(lchan.c_str(), plr->GetGUID());
-                    break;
-            }
-        }
-    }
-}
-
-// This function sends chat to a irc channel or user
-// to prevent the # beeing appended to send a msg to a user
-// set the NoPrefix to true
-void IRCClient::Send_IRC_Channel(std::string sChannel, std::string sMsg, bool NoPrefix, std::string nType)
-{
-    std::string mType = "PRIVMSG";	
-	if(Command.MakeUpper(nType.c_str()) == "NOTICE")
-		mType = "NOTICE";
-    if(Command.MakeUpper(nType.c_str()) == "ERROR" && (sIRC.BOTMASK & 32)!= 0)
-		mType = "NOTICE";
-    if(sIRC.Connected)
-    {
-        if(NoPrefix)
-            SendIRC(mType + " " + sChannel + " :" + sMsg);
-        else
-            SendIRC(mType + " #" + sChannel + " :" + sMsg);
-    }
-}
-
-// This function sends a message to all irc channels
-// that mangchat has in its configuration
-void IRCClient::Send_IRC_Channels(std::string sMsg)
-{
-    for(int i=1;i < sIRC._chan_count + 1;i++)
-        Send_IRC_Channel(sIRC._irc_chan[i], sMsg);
-}
-
-// This function is called in ChatHandler.cpp, any channel chat from wow will come
-// to this function, validates the channel and constructs a message that is send to IRC
-void IRCClient::Send_WoW_IRC(Player *plr, std::string Channel, std::string Msg)
-{
-    // Check if the channel exist in our configuration
-    if(Channel_Valid(Channel) && Msg.substr(0, 1) != ".")
-        Send_IRC_Channel(GetIRCChannel(Channel), MakeMsgP(WOW_IRC, Msg, plr));
-}
-
-void IRCClient::Send_WoW_Player(std::string sPlayer, std::string sMsg)
-{
-    normalizePlayerName(sPlayer);
-    if (Player* plr = ObjectAccessor::Instance().FindPlayerByName(sPlayer.c_str()))
-        Send_WoW_Player(plr, sMsg);
-}
-
-void IRCClient::Send_WoW_Player(Player *plr, string sMsg)
-{
-    WorldPacket data(SMSG_MESSAGECHAT, 200);
-    data << (uint8)CHAT_MSG_SYSTEM;
-    data << (uint32)LANG_UNIVERSAL;
-    data << (uint64)plr->GetGUID();
-    data << (uint32)0;
-    data << (uint64)plr->GetGUID();
-    data << (uint32)(sMsg.length()+1);
-    data << sMsg;
-    data << (uint8)0;
-    plr->GetSession()->SendPacket(&data);
-}
-
-// This function will construct and send a packet to all players
-// on the given channel ingame. (previuosly found in world.cpp)
-// it loops thru all sessions and checks if they are on the channel
-// if so construct a packet and send it.
-void IRCClient::Send_WoW_Channel(const char *channel, std::string chat)
-{
-    if(!(strlen(channel) > 0))
-        return;
-
-    #ifdef USE_UTF8
-        std::string chat2 = chat;
-        if(ConvertUTF8(chat2.c_str(), chat2))
-            chat = chat2;
-    #endif
-
-    HashMapHolder<Player>::MapType& m = ObjectAccessor::Instance().GetPlayers();
-    for(HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
-    {
-        if (itr->second && itr->second->GetSession()->GetPlayer() && itr->second->GetSession()->GetPlayer()->IsInWorld())
-        {
-            if(ChannelMgr* cMgr = channelMgr(itr->second->GetSession()->GetPlayer()->GetTeam()))
-            {
-                if(Channel *chn = cMgr->GetChannel(channel, itr->second->GetSession()->GetPlayer()))
-                {
-                    WorldPacket data;
-                    data.Initialize(SMSG_MESSAGECHAT);
-                    data << (uint8)CHAT_MSG_CHANNEL;
-                    data << (uint32)LANG_UNIVERSAL;
-                    data << (uint64)0;
-                    data << (uint32)0;
-                    data << channel;
-                    data << (uint64)0;
-                    data << (uint32) (strlen(chat.c_str()) + 1);
-                    data << IRCcol2WoW(chat.c_str());
-                    data << (uint8)0;
-                    itr->second->GetSession()->SendPacket(&data);
-                }
-            }
-        }
-    }
-}
-
-void IRCClient::Send_WoW_System(std::string Message)
-{
-    HashMapHolder<Player>::MapType& m = ObjectAccessor::Instance().GetPlayers();
-    for(HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
-    {
-        if (itr->second && itr->second->GetSession()->GetPlayer() && itr->second->GetSession()->GetPlayer()->IsInWorld())
-        {
-            WorldPacket data;
-            data.Initialize(CHAT_MSG_SYSTEM);
-            data << (uint8)CHAT_MSG_SYSTEM;
-            data << (uint32)LANG_UNIVERSAL;
-            data << (uint64)0;
-            data << (uint32)0;
-            data << (uint64)0;
-            data << (uint32) (strlen(Message.c_str()) + 1);
-            data << Message.c_str();
-            data << (uint8)0;
-            itr->second->GetSession()->SendPacket(&data);
-        }
-    }
-}
-void IRCClient::ResetIRC()
-{
-    SendData("QUIT");
-    Disconnect();
-}
-
-#define CHAT_INVITE_NOTICE 0x18
-
-// this function should be called on player login Player::AddToWorld
-void IRCClient::AutoJoinChannel(Player *plr)
-{
-    //this will work if at least 1 player is logged in regrdless if he is on the channel or not
-    // the first person that login empty server is the one with bad luck and wont be invited, 
-    // if at least 1 player is online the player will be inited to the chanel
-
-    std::string m_name = sIRC.ajchan;
-    WorldPacket data;
-    data.Initialize(SMSG_CHANNEL_NOTIFY, 1+m_name.size()+1);
-    data << uint8(CHAT_INVITE_NOTICE);
-    data << m_name.c_str();
-
-    HashMapHolder<Player>::MapType& m = ObjectAccessor::Instance().GetPlayers();
-    for(HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
-    {
-        if (itr->second && itr->second->GetSession()->GetPlayer() && itr->second->GetSession()->GetPlayer()->IsInWorld())
-        {
-            data << uint64(itr->second->GetGUID());
-            break;
-        }
-    }
-    plr->GetSession()->SendPacket(&data);
-}
Index: trunk/src/game/IRCLog.cpp
===================================================================
--- trunk/src/game/IRCLog.cpp (revision 39)
+++  (revision )
@@ -1,60 +1,0 @@
-#include "IRCLog.h"
-#include "Config/ConfigEnv.h"
-#include "IRCClient.h"
-#include <stdarg.h>
-
-IRCLog::IRCLog()
-{
-    std::string logsDir = sConfig.GetStringDefault("LogsDir","");
-    std::string ircLogName = logsDir + "/IRC_";
-    std::string ircLogTimestamp = GetLogDateStr();
-        ircLogName += ircLogTimestamp +".log";
-    ircLogfile.open (ircLogName.c_str(), std::ios::app);
-}
-
-IRCLog::~IRCLog()
-{
-    ircLogfile.close();
-}
-// Was added because using the time for logs is very annoying... one log per day.. much cleaner looking..
-std::string IRCLog::GetLogDateStr() const
-{
-    time_t t = time(NULL);
-    tm* aTm = localtime(&t);
-    //       YYYY   year
-    //       MM     month (2 digits 01-12)
-    //       DD     day (2 digits 01-31)
-    //       HH     hour (2 digits 00-23)
-    //       MM     minutes (2 digits 00-59)
-    //       SS     seconds (2 digits 00-59)
-    char buf[20];
-    snprintf(buf,20,"%04d-%02d-%02d",aTm->tm_year+1900,aTm->tm_mon+1,aTm->tm_mday);
-    return std::string(buf);
-}
-
-std::string IRCLog::GetLogDateTimeStr() const
-{
-    time_t t = time(NULL);
-    tm* aTm = localtime(&t);
-    //       YYYY   year
-    //       MM     month (2 digits 01-12)
-    //       DD     day (2 digits 01-31)
-    //       HH     hour (2 digits 00-23)
-    //       MM     minutes (2 digits 00-59)
-    //       SS     seconds (2 digits 00-59)
-    char buf[30];
-	snprintf(buf,30,"[ %04d-%02d-%02d ] [ %02d:%02d:%02d ]",aTm->tm_year+1900,aTm->tm_mon+1,aTm->tm_mday,aTm->tm_hour,aTm->tm_min,aTm->tm_sec);
-    return std::string(buf);
-}
-
-void IRCLog::WriteLog(const char *what, ...)
-{
-    va_list ap;
-    char tmpoutp[1024];
-    va_start(ap, what);
-    vsnprintf(tmpoutp, 1024, what, ap );
-    va_end(ap);
-    ircLogfile << tmpoutp;
-    ircLogfile << "\n";
-    ircLogfile.flush();
-}
Index: trunk/src/game/IRCClient.h
===================================================================
--- trunk/src/game/IRCClient.h (revision 39)
+++  (revision )
@@ -1,230 +1,0 @@
-#ifndef _IRC_CLIENT_H
-#define _IRC_CLIENT_H
-
-#include "Policies/Singleton.h"
-#include "Player.h"
-#include "IRCLog.h"
-#include "IRCCmd.h"
-
-using namespace std;
-// The maximum ammount of channels used
-// in the channel array you can have as much channels as you
-// want, but it is important to always have at least equal or more
-// channels then you specify in your mangosd.conf
-#define MAX_CONF_CHANNELS 10
-#define MAX_CHAT_LINES 10
-// time we need to wait before we try another connecton attempt
-// Default is 30 seconds
-#define MAX_SCRIPT_INST 10
-// CLINES is used for the default chatlines
-// By using the GetChatLine function its easier and faster
-// to receieve the line you need.
-enum CLINES
-{
-    IRC_WOW = 0,
-    WOW_IRC = 1,
-    JOIN_WOW = 2,
-    JOIN_IRC = 3,
-    LEAVE_WOW = 4,
-    LEAVE_IRC = 5,
-    CHANGE_NICK = 6
-};                                                          // Chatlines
-// CACTION is used by the Handle_WoW_Channel function
-// this function is called in channel.h when a player
-// joins or leave a channel inside the client.
-enum CACTION
-{
-    CHANNEL_JOIN,
-    CHANNEL_LEAVE,
-};
-
-enum script_Names
-{
-    MCS_Players_Online  = 0,
-};
-
-// IRCClient main class
-class IRCClient : public ZThread::Runnable
-{
-    public:
-        // IRCClient Constructor
-        IRCClient();
-        // IRCClient Destructor
-        ~IRCClient();
-        // ZThread Entry
-        void run();
-    public:
-        // AH Function
-        void AHFunc(uint64 itmid, std::string itmnme, std::string plname, uint32 faction);
-        // IRCClient active
-        bool    Active;
-        // Connected to IRC
-        bool    Connected;
-        // Socket indentifier
-        int     SOCKET;
-        fd_set  sfdset;
-        // Send data to IRC, in addition the endline is added \n
-        bool    SendIRC(std::string data);
-        // This function is called in ChatHandler.cpp and processes the chat from game to IRC
-        void    Send_WoW_IRC(Player *plr, std::string Channel, std::string Msg);
-        // Sends a message to all players on the specified channel
-        void    Send_WoW_Channel(const char *channel, std::string chat);
-        // Send a system message to all players
-        void    Send_WoW_System(std::string Message);
-        // Send a message to the specified IRC channel
-        void    Send_IRC_Channel(std::string sChannel, std::string sMsg, bool NoPrefix = false, std::string nType = "PRIVMSG");
-        // Sends a message to all IRC Channels
-        void    Send_IRC_Channels(std::string sMsg);
-        std::string MakeMsg(std::string msg, std::string var, std::string val)
-        {
-            std::size_t start = msg.find(var);
-            if (start != std::string::npos)
-                msg.replace(start, var.length(), val);
-            return msg;
-        }
-        void    Send_WoW_Player(string sPlayer, string sMsg);
-        void    Send_WoW_Player(Player *plr, string sMsg);
-
-        // This function is called in Channel.cpp and processes Join/leave messages
-        void    Handle_WoW_Channel(std::string Channel, Player *plr, int nAction);
-        void ResetIRC();
-    public:
-        void AutoJoinChannel(Player *plr);
-
-    public:
-        bool Script_Lock[5];
-        bool _AmiOp;
-
-    public:
-        string _Mver;
-        // IRC Server host
-        string  _Host;
-        // IRC Server Port
-        int _Port;
-        // IRC Username
-        string  _User;
-        // IRC Password
-        string  _Pass;
-        // IRC Nickname
-        string  _Nick;
-        // Authentication type
-        int _Auth;
-        string _Auth_Nick;
-        // IRC Connect code
-        string  _ICC;
-        // IRC Default channel
-        string  _defchan;
-        // IRC Leave Default channel
-        int _ldefc;
-        // Wait Connect Time
-        int _wct;
-        // BotMask Options
-        int Botmask;
-        // Status Channel
-        int Status;
-        // Announce Channel
-        int anchn;
-        int autoanc;
-        // IRC Channel count
-        int _chan_count;
-        // IRC Channel list
-        // Array to store our IRC channels
-        // each element will corrospond
-        // with _wow_chan array below.
-        std::string _irc_chan[MAX_CONF_CHANNELS];
-        // Game Channel list
-        std::string _wow_chan[MAX_CONF_CHANNELS];
-        // AutoJoin Options
-        int ajoin;
-        string ajchan;
-        // Online Command Max Results
-        int onlrslt;
-        // Channel OnJoin/Restart/Kick Messages
-        string  JoinMsg;
-        string  RstMsg;
-        string  kikmsg;
-        // Misc Options
-        string  ojGM1;
-        string  ojGM2;
-        string  ojGM3;
-        string  ojGM4;
-        string  ojGM5;
-        string  logfile;
-        int     games;
-        int     gmlog;
-        // IRC Commands Security Level
-        int     CACCT;
-        int     CBAN;
-        int     CCHAN;
-        int     CCHAR;
-        int     CFUN;
-        int     CHELP;
-        int     CINCHAN;
-        int     CINFO;
-        int     CITEM;
-        int     CJAIL;
-        int     CKICK;
-        int     _KILL;
-        int     CLEVEL;
-        int     CLOOKUP;
-        int     CMONEY;
-        int     CMUTE;
-        int     CONLINE;
-        int     CPM;
-        int     CRESTART;
-        int     CREVIVE;
-        int     CSAVEALL;
-        int     CSHUTDOWN;
-        int     CSPELL;
-        int     CSYSMSG;
-        int     CTELE;
-        int     CTOP;
-        int     CWHO;
-        // BotMask
-        int     BOTMASK;
-        // Max connect attempt
-        int     _MCA;
-        // Auto rejoin when kicked from irc
-        int     _autojoinkick;
-        // IRC Command prefix
-        string  _cmd_prefx;
-        int _op_gm;
-        int _op_gm_lev;
-        // Array that contains our chatlines from the conf file
-        // To increase this value change the MAX_CHAT_LINE define above
-        // Make sure the number of elements must match your items
-        // (remeber this starts at 0 so 0..9 is 10 items)
-        // and that you load the line in the LoadConfig function.
-        string  ILINES[MAX_CHAT_LINES];
-        string  GetChatLine(int nItem);
-
-        int _Max_Script_Inst;
-        // MAX_SCRIPT_INST
-
-        IRCLog iLog;
-
-public:
-        // Load MangChat configuration file
-        bool    LoadConfig(char const* cfgfile);
-        void    SetCfg(char const* cfgfile);
-        char const* CfgFile;
-
-private:
-        // Returns default chatline based on enum CLINES
-        // Initialize socket library
-        bool    InitSock();
-        // Connect to IRC Server
-        bool    Connect(const char *cHost, int nPort);
-        // Login to IRC Server
-        bool    Login(std::string sNick, std::string sUser, std::string sPass);
-        // Send raw data to IRC
-        bool    SendData(const char *data);
-        // Disconnect from IRC and cleanup socket
-        void    Disconnect();
-        // Processes the data receieved from IRC
-        void    Handle_IRC(std::string sData);
-        // Receieves data from the socket.
-        void    SockRecv();
-};
-#endif
-#define sIRC MaNGOS::Singleton<IRCClient>::Instance()
Index: trunk/src/game/IRCConf.h.in
===================================================================
--- trunk/src/game/IRCConf.h.in (revision 39)
+++  (revision )
@@ -1,16 +1,0 @@
-#ifndef MC_CONFIG_H
-#define MC_CONFIG_H
-
-#include "../framework/Platform/CompilerDefs.h"
-
-// Format is YYYYMMDDRR where RR is the change in the conf file
-// for that day.
-#define MANGCHAT_CONF_VERSION    2008011901
-
-#if PLATFORM == PLATFORM_WINDOWS
-  #define _MANGCHAT_CONFIG  "trinitycore.conf"
-#else
-  #define _MANGCHAT_CONFIG  "@sysconfdir@/trinitycore.conf"
-#endif
-
-#endif
Index: trunk/src/game/IRCClient.cpp
===================================================================
--- trunk/src/game/IRCClient.cpp (revision 39)
+++  (revision )
@@ -1,91 +1,0 @@
-/*
- * MangChat By |Death| And Cybrax
- *
- * This Program Is Free Software; You Can Redistribute It And/Or Modify It Under The Terms 
- * Of The GNU General Public License
- * Written and Developed by Cybrax. cybraxvd@gmail.com
- * |Death| <death@hell360.net>, Lice <lice@yeuxverts.net>, Dj_baby & Sanaell, Tase
- * With Help And Support From The MaNGOS Project Community.
- * PLEASE RETAIN THE COPYRIGHT OF THE AUTHORS.
- */
-#include "IRCClient.h"
-#include "World.h"
-#include "ObjectMgr.h"
-#include "MapManager.h"
-
-#include "Policies/SingletonImp.h"
-INSTANTIATE_SINGLETON_1( IRCClient );
-
-#ifdef WIN32
-    #define Delay(x) Sleep(x)
-#else
-    #define Delay(x) sleep(x / 1000)
-#endif
-// IRCClient Constructor
-IRCClient::IRCClient()
-{
-    for(int i = 0;i > 5;i++)
-        sIRC.Script_Lock[i] = false;
-}
-// IRCClient Destructor
-IRCClient::~IRCClient(){}
-
-// ZThread Entry This function is called when the thread is created in Master.cpp (mangosd)
-void IRCClient::run()
-{
-    sIRC.iLog.WriteLog(" %s : IRC bot started.", sIRC.iLog.GetLogDateTimeStr().c_str());
-
-    // before we begin we wait a few 
-    // mangos is still starting up.
-    ZThread::Thread::sleep(500);
-    int cCount = 0;
-    // Clean Up MySQL Tables
-    sLog.outString("Cleaning up IRC_Inchan table...");
-    WorldDatabase.PExecute("DELETE FROM `IRC_Inchan`");
-    sIRC._Max_Script_Inst = 0;
-    // Create a loop to keep the thread running untill active is set to false
-    while(sIRC.Active && !World::m_stopEvent)
-    {
-        // Initialize socket library
-        if(this->InitSock())
-        {
-            // Connect To The IRC Server
-            sLog.outString("IRC: Connecting to %s Try # %d ******", sIRC._Host.c_str(), cCount);
-            if(this->Connect(sIRC._Host.c_str(), sIRC._Port))
-            {
-                // On connection success reset the connection counter
-                cCount = 0;
-                sLog.outString("IRC connected and logging in");
-                // Login to the IRC server
-                if(this->Login(sIRC._Nick, sIRC._User, sIRC._Pass))
-                {
-                    sLog.outString("IRC logged in and running");
-                    // While we are connected to the irc server keep listening for data on the socket
-                    while(sIRC.Connected && !World::m_stopEvent){ sIRC.SockRecv(); }
-                }
-                sLog.outString("Connection to IRC server lost!");
-            }
-            // When an error occures or connection lost cleanup
-            Disconnect();
-            // Increase the connection counter
-            cCount++;
-            // if MAX_CONNECT_ATTEMPT is reached stop trying
-            if(sIRC._MCA != 0 && cCount == sIRC._MCA)
-                sIRC.Active = false;
-            // If we need to reattempt a connection wait WAIT_CONNECT_TIME milli seconds before we try again
-            if(sIRC.Active)
-                ZThread::Thread::sleep(sIRC._wct);
-        }
-        else
-        {
-            // Socket could not initialize cancel
-            sIRC.Active = false;
-            sLog.outError("IRC: Could not initialize socket");
-        }
-    }
-    // we need to keep the thread alive or mangos will crash
-    // when sending chat or join/leave channels.
-    // even when we are not connected the functions must still
-    // be availlable where chat is sent to so we keep it running
-    while(!World::m_stopEvent){};
-}
Index: trunk/src/game/IRCCmd.cpp
===================================================================
--- trunk/src/game/IRCCmd.cpp (revision 39)
+++  (revision )
@@ -1,827 +1,0 @@
-/*
- * MangChat By |Death| And Cybrax
- *
- * This Program Is Free Software; You Can Redistribute It And/Or Modify It Under The Terms 
- * Of The GNU General Public License
- * Written and Developed by Cybrax. cybraxvd@gmail.com
- * |Death| <death@hell360.net>, Lice <lice@yeuxverts.net>, Dj_baby & Sanaell, Tase
- * With Help And Support From The MaNGOS Project Community.
- * PLEASE RETAIN THE COPYRIGHT OF THE AUTHORS.
- */
-#include "IRCCmd.h"
-#include "IRCClient.h"
-#include "Database/DatabaseEnv.h"
-#include "ObjectMgr.h"
-#include "MapManager.h"
-// Constructor
-IRCCmd::IRCCmd(){}
-// Destructor
-IRCCmd::~IRCCmd(){}
-
-std::string IRCCmd::MakeUpper(std::string Channel)
-{
-    std::string tmpchan = Channel;
-    std::transform(tmpchan.begin(), tmpchan.end(), tmpchan.begin(), towupper);
-    return tmpchan;
-}
-bool IRCCmd::ParamsValid(_CDATA *CD, int pCnt)
-{
-    CD->PCOUNT = pCnt;
-    if(CD->PARAMS.size() == 0)
-        return false;
-    return ValidParams(CD->PARAMS, pCnt);
-}
-
-int IRCCmd::ParamsValid(_CDATA *CD, int pCnt, int rLev)
-{
-    //CD->PCOUNT = pCnt;
-    if(!CanUse(CD->USER, rLev))
-        return E_AUTH;
-    else if(pCnt == 0)
-        return E_OK;
-    else if(CD->PARAMS.size() == 0)
-        return E_SIZE;
-    else if(!ValidParams(CD->PARAMS, pCnt))
-        return E_SIZE;
-    return E_OK;
-}
-
-// This function checks if chat from irc is a command or not
-// return true on yes and false on no
-bool IRCCmd::IsValid(std::string USER, std::string FROM, std::string CHAT, std::string TYPE)
-{
-    // If the first line of our chat is the command prefix we have a command
-    if(CHAT.substr(0, 1) == sIRC._cmd_prefx && CHAT.size() > 1 )
-    {
-        _CDATA CDATA;
-        bool cValid    = false;
-        bool AuthValid = true;
-        bool dontlog   = true;
-        std::string* _PARAMS = getArray(CHAT, 2);
-        CDATA.USER      = USER;
-        CDATA.FROM      = FROM;
-        CDATA.TYPE      = TYPE;
-        CDATA.PCOUNT    = 0;
-        CDATA.CMD       = MakeUpper(_PARAMS[0].substr(1, _PARAMS[0].size() - 1));
-        CDATA.PARAMS    = _PARAMS[1];   
-        if(CDATA.CMD == "LOGIN")
-        {
-            if(FROM == sIRC._Nick)
-            {             
-                if(ParamsValid(&CDATA, 2))  
-                    Handle_Login(&CDATA);
-                else
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"login <Player> <Password> )", true, "ERROR");
-            }
-            else
-                sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Please Send A PM To Login!", true, "ERROR");
-            if(GetLevel(USER) >= sIRC.gmlog)
-                dontlog = false;
-            cValid = true;
-        }
-        else if(CDATA.CMD == "LOGOUT")
-        {
-            if(FROM == sIRC._Nick)
-            {
-                Handle_Logout(&CDATA);
-            }
-            else
-                sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Please Send A PM To Logout!", true, "ERROR");
-            cValid = true;
-        }
-        else if(CDATA.CMD == "ACCT")
-        {
-            switch(ParamsValid(&CDATA, 2, sIRC.CACCT))
-            {
-                case E_OK:
-                    Account_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"acct <Player> <(un)lock/mail/pass/rename> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "BAN")
-        {
-            switch(ParamsValid(&CDATA, 2, sIRC.CBAN))
-            {
-                case E_OK:
-                    Ban_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"ban <Player> <acct/ip> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "CHAN")
-        {
-            switch(ParamsValid(&CDATA, 1, sIRC.CCHAN))
-            {
-                case E_OK:
-                    Chan_Control(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"chan <op> <IRC User> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "CHAR")
-        {
-            switch(ParamsValid(&CDATA, 2, sIRC.CCHAR))
-            {
-                case E_OK:
-                    Char_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"char <Player> <mailcheat/taxicheat/maxskill/setskill> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "FUN")
-        {
-            switch(ParamsValid(&CDATA, 2, sIRC.CFUN))
-            {
-                case E_OK:
-                    Fun_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"fun <Player> <Sound/Say> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "HELP")
-        {
-            switch(ParamsValid(&CDATA, 0, sIRC.CHELP))
-            {
-                case E_OK:
-                    Help_IRC(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"help <Command> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "INCHAN")
-        {
-            switch(ParamsValid(&CDATA, 1, sIRC.CINCHAN))
-            {
-                case E_OK:
-                    Inchan_Server(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"inchan <Channel> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "INFO")
-        {
-            switch(ParamsValid(&CDATA, 0, sIRC.CINFO))
-            {
-                case E_OK:
-                    Info_Server(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"info )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "ITEM")
-        {
-            CDATA.PCOUNT = 3;
-            switch(ParamsValid(&CDATA, 2, sIRC.CITEM))
-            {
-                case E_OK:
-                    Item_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"item <Player> <add> <ItemID/[ItemName]> <Amount> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "JAIL")
-        {
-            CDATA.PCOUNT = 3;
-            switch(ParamsValid(&CDATA, 1, sIRC.CJAIL))
-            {
-                case E_OK:
-                    Jail_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"jail <Player> <release/Reason>)", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "KICK")
-        {
-            CDATA.PCOUNT = 2;
-            switch(ParamsValid(&CDATA, 1, sIRC.CKICK))
-            {
-                case E_OK:
-                    Kick_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"kick <Player> <Reason> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "KILL")
-        {
-            CDATA.PCOUNT = 2;
-            switch(ParamsValid(&CDATA, 1, sIRC._KILL))
-            {
-                case E_OK:
-                    Kill_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"kill <Player> <Reason> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "LEVEL")
-        {
-            CDATA.PCOUNT = 2;
-            switch(ParamsValid(&CDATA, 2, sIRC.CLEVEL))
-            {
-                case E_OK:
-                    Level_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"level <Player> <NewLevel> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "LOOKUP")
-        {
-            CDATA.PCOUNT = 2;
-            switch(ParamsValid(&CDATA, 2, sIRC.CLOOKUP))
-            {
-                case E_OK:
-                    Lookup_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"lookup <acct/char/creature/faction/go/item/quest/skill/spell/tele> <ID/Name> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "MONEY")
-        {
-            CDATA.PCOUNT = 2;
-            switch(ParamsValid(&CDATA, 2, sIRC.CMONEY))
-            {
-                case E_OK:
-                    Money_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"money <Player> <(-)Money> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "MUTE")
-        {
-            switch(ParamsValid(&CDATA, 2, sIRC.CMUTE))
-            {
-                case E_OK:
-                    Mute_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"mute <Player> <release/TimeInMins> <Reason> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "ONLINE")
-        {
-            switch(ParamsValid(&CDATA, 0, sIRC.CONLINE))
-            {
-                case E_OK:
-                    Online_Players(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"online )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "PM")
-        {
-            switch(ParamsValid(&CDATA, 2, sIRC.CPM))
-            {
-                case E_OK:
-                    PM_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"pm <Player> <Message> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "RELOAD")
-        {
-            switch(ParamsValid(&CDATA, 0, sIRC.CRESTART))
-            {
-                case E_OK:
-                    sIRC.Send_IRC_Channels("Reloading MangChat Config Options. (Command Disabled)");
-                    //sIRC.LoadConfig();
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "RESTART")
-        {
-            switch(ParamsValid(&CDATA, 0, sIRC.CRESTART))
-            {
-                case E_OK:
-                    sIRC.Send_IRC_Channels(sIRC.RstMsg);
-                    sIRC.ResetIRC();
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "REVIVE")
-        {
-            CDATA.PCOUNT = 2;
-            switch(ParamsValid(&CDATA, 1, sIRC.CREVIVE))
-            {
-                case E_OK:
-                    Revive_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"revive <Player> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "SAVEALL")
-        {
-            switch(ParamsValid(&CDATA, 0, sIRC.CSAVEALL))
-            {
-                case E_OK:
-                    Saveall_Player(&CDATA);
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "SHUTDOWN")
-        {
-            switch(ParamsValid(&CDATA, 1, sIRC.CSHUTDOWN))
-            {
-                case E_OK:
-                    Shutdown_Mangos(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"shutdown <TimeInSeconds> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "SPELL")
-        {
-            switch(ParamsValid(&CDATA, 2, sIRC.CSPELL))
-            {
-                case E_OK:
-                    Spell_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"spell <Player> <Cast/Learn/UnLearn> <SpellID> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "SYSMSG")
-        {
-            CDATA.PCOUNT = 2;
-            switch(ParamsValid(&CDATA, 2, sIRC.CSYSMSG))
-            {
-                case E_OK:
-                    Sysmsg_Server(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"sysmsg <a/e/n/add/del/list> <Message> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "TELE")
-        {
-            switch(ParamsValid(&CDATA, 2, sIRC.CTELE))
-            {
-                case E_OK:
-                    Tele_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"tele <Player> <l/c/r/to> <Loc.Name/MAPID X Y Z/Recall/Player> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "TOP")
-        {
-            CDATA.PCOUNT = 1;
-            switch(ParamsValid(&CDATA, 1, sIRC.CTOP))
-            {
-                case E_OK:
-                    Top_Player(&CDATA);
-                    break;
-                case E_SIZE:
-                    sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"top <accttime/chartime/money> <limit> )", true, "ERROR");
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        else if(CDATA.CMD == "WHO")
-        {
-            switch(ParamsValid(&CDATA, 0, sIRC.CWHO))
-            {
-                case E_OK:
-                    Who_Logged(&CDATA);
-                    break;
-                case E_AUTH:
-                    AuthValid = false;
-                    break;
-            }
-            cValid = true;
-        }
-        if(!AuthValid && IsLoggedIn(USER))
-            sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Access Denied! Your Security Level Is Too Low To Use This Command!", true, "ERROR");
-        if(cValid == false && (sIRC.BOTMASK & 4) != 0)
-            sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : Unknown Command!", true, "ERROR");
-        if(cValid && dontlog)
-        {
-            sIRC.iLog.WriteLog(" %s : [ %s(%d) ] Used Command: [ %s ] With Parameters: [ %s ]", sIRC.iLog.GetLogDateTimeStr().c_str(), CDATA.USER.c_str(), GetLevel(USER), CDATA.CMD.c_str(), CDATA.PARAMS.c_str());
-        }
-        return cValid;
-    }
-    return false;
-}
-
-bool IRCCmd::CanUse(std::string USER, int nLevel)
-{
-    if(IsLoggedIn(USER))
-    {
-        if(GetLevel(USER) >= nLevel)
-            return true;
-        else
-            return false;
-    }
-    else if(nLevel == 0)
-    {
-        return true;
-    }
-    else
-        sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : You Are Not Logged In!", true, "ERROR");
-    return false;
-}
-
-std::string IRCCmd::ChanOrPM(_CDATA *CD)
-{
-    if(CD->FROM == sIRC._Nick)
-        return CD->USER;
-    else
-        return CD->FROM;
-}
-
-Player *IRCCmd::GetPlayer(std::string WHO)
-{
-    normalizePlayerName(WHO);
-    return ObjectAccessor::Instance().FindPlayerByName(WHO.c_str());
-}
-
-_client *IRCCmd::GetClient(std::string cname)
-{
-    for(std::list<_client*>::iterator i=_CLIENTS.begin(); i!=_CLIENTS.end();i++)
-    {
-        if((*i)->Name == cname)
-            return (*i);
-    }
-    return (NULL);
-}
-
-bool IRCCmd::IsLoggedIn(std::string USER)
-{
-    for(std::list<_client*>::iterator i=_CLIENTS.begin(); i!=_CLIENTS.end();i++)
-    {
-        if((*i)->Name == USER)
-            return true;
-    }
-    return false;
-}
-
-bool IRCCmd::AcctIsLoggedIn(std::string USER)
-{
-    for(std::list<_client*>::iterator i=_CLIENTS.begin(); i!=_CLIENTS.end();i++)
-    {
-        if(MakeUpper((*i)->UName) == MakeUpper(USER))
-            return true;
-    }
-    return false;
-}
-
-std::string IRCCmd::AcctIsBanned(std::string ACCT)
-{
-    uint32 acctid = objmgr.GetAccountByAccountName(ACCT);
-    std::string banned = "NOTBANNED";
-    QueryResult *result = loginDatabase.PQuery("SELECT banreason FROM ip_banned WHERE ip=(SELECT last_ip FROM account WHERE id = '%i')", acctid);
-    if(result)
-    {
-        banned = (*result)[0].GetCppString();
-        delete result;  
-        return "IP Banned. Reason:" + banned;   
-    }
-    QueryResult *result2 = loginDatabase.PQuery("SELECT banreason FROM account_banned WHERE id='%i'", acctid);  
-    if(result2)
-    {
-        banned = (*result2)[0].GetCppString();
-        delete result2; 
-        return "Account Banned. Reason:" + banned;
-    }
-    return banned;
-}
-
-int IRCCmd::GetLevel(std::string sName)
-{
-    for(std::list<_client*>::iterator i=_CLIENTS.begin(); i!=_CLIENTS.end();i++)
-    {
-        if((*i)->Name == sName)
-            return (*i)->GMLevel;
-    }
-    return 0;
-}
-
-int IRCCmd::AcctLevel(std::string plnme)
-{
-    uint64 guid = objmgr.GetPlayerGUIDByName(plnme);
-    uint32 account_id = 0;
-    uint32 security = 0;
-    account_id = objmgr.GetPlayerAccountIdByGUID(guid);
-    security = objmgr.GetSecurityByAccount(account_id);
-    return security;
-}
-
-std::string IRCCmd::GetAccName(std::string sName)
-{
-    for(std::list<_client*>::iterator i=_CLIENTS.begin(); i!=_CLIENTS.end();i++)
-    {
-        if((*i)->Name == sName)
-            return (*i)->UName;
-    }
-    return "";
-}
-
-std::string IRCCmd::GetNameFromAcct(std::string sName)
-{
-    for(std::list<_client*>::iterator i=_CLIENTS.begin(); i!=_CLIENTS.end();i++)
-    {
-        if((*i)->UName == sName)
-            return (*i)->Name;
-    }
-    return "";
-}
-
-int IRCCmd::GetAcctIDFromName(std::string sName)
-{
-    for(std::list<_client*>::iterator i=_CLIENTS.begin(); i!=_CLIENTS.end();i++)
-    {
-        if((*i)->Name == sName)
-        {
-            uint32 acct_id = 0;
-            acct_id = objmgr.GetAccountByAccountName((*i)->UName.c_str());
-            return acct_id;
-        }
-    }
-    return 0;
-}
-
-std::string IRCCmd::GetAcctNameFromID(uint32 acctid)
-{
-    QueryResult *result = loginDatabase.PQuery("SELECT username FROM account WHERE id = '%d'", acctid);
-    if(result)
-    {
-        std::string name = (*result)[0].GetCppString();
-        delete result;
-        return name;
-    }
-
-    return "";
-}
-
-std::string IRCCmd::GetIPFromPlayer(std::string player)
-{
-    QueryResult *result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name = '%s'", player.c_str());
-    if(result)
-    {
-        std::string acctid = (*result)[0].GetCppString();
-        delete result;
-        QueryResult *result2 = loginDatabase.PQuery("SELECT last_ip FROM account WHERE id = '%s'", acctid.c_str());
-        if(result2)
-        {
-            std::string ip = (*result2)[0].GetCppString();
-            delete result2;
-            return ip;
-        }       
-    }
-
-    return "";
-}
-
-std::string IRCCmd::SecToDay(std::string secons)
-{
-    unsigned int seconds = atoi(secons.c_str());
-    unsigned int days = seconds / 86400;
-    unsigned int hours = seconds / 3600 % 24;
-    unsigned int mins = seconds / 60 % 60;
-    char tottime[1000];
-    sprintf(tottime, "%iDays:%iHours:%iMinutes", days, hours, mins);
-
-    return tottime;
-}
-
-bool IRCCmd::ValidParams(std::string PARAMS, int nCount)
-{
-    if(nCount == 1 && PARAMS.size() == 0)
-        return false;
-    int pcount = 0;
-    size_t p = -1;
-    for(int i = 0;i < nCount;i++)
-    {
-        p = PARAMS.find(" ", p + 1);
-        if(p == -1)
-            break;
-        else
-            pcount++;
-    }
-    nCount--;
-    if(pcount >= nCount)
-        return true;
-    else
-        return false;
-}
-
-std::string* IRCCmd::getArray(std::string PARAMS, int nCount)
-{
-    std::string *array = new std::string[nCount];
-    if(PARAMS.size() > 0)
-    {
-        int pcnt = 0;
-        size_t ps = 0;
-        size_t pc = -1;
-        for(int i = 0;i < nCount;i++)
-        {
-            pc = PARAMS.find(" ", pc + 1);
-            if(i + 1 == nCount && nCount != 1)
-            {
-                if(ps > 0 && pc > 0)
-                    array[i] = PARAMS.substr(ps, PARAMS.size() - ps);
-            }
-            else
-                array[i] = PARAMS.substr(ps, pc - ps);
-            ps = pc + 1;
-        }
-    }
-    return array;
-}
-
-std::string IRCCmd::MakeMsg(const char *sLine, ... )
-{
-    va_list ap;
-    char tmpoutp[1024];
-    va_start(ap, sLine);
-    vsnprintf(tmpoutp, 1024, sLine, ap );
-    va_end(ap);
-    std::string outp = tmpoutp;
-    return outp;
-}
-
-void IRCClient::AHFunc(uint64 itmid, std::string itmnme, std::string plname, uint32 faction)
-{
-    IRCCmd Command;
-    Player* plr = Command.GetPlayer(plname);
-    if(plr)
-    {
-        std::string itemname = itmnme;
-
-        char  temp [7];
-        sprintf(temp, "%u", itmid);
-        std::string itemid = temp;
-
-        std::string wowname = "";
-        std::string ircname = "";
-        switch (plr->GetTeam())
-        {
-            case 67:wowname="|cffff0000"+plname+"|r";ircname="\0034"+plname;break;      //horde
-            case 469:wowname="|cff1589FF"+plname+"|r";ircname="\00312"+plname;break;    //alliance
-        }
-        
-        std::string wowfact = "|cffFF8040[Auction House]:|r";
-        std::string ircfact = "\00304,08\037/!\\\037\017\00307 Auction House \00304,08\037/!\\\037\017";
-        switch(faction)
-        {
-            //neutral
-            case 7:wowfact="|cffff8040[Neutral Auction House]:|r";ircfact="\00304,08\037/!\\\037\017\00307 Neutral Auction House \00304,08\037/!\\\037\017";break;
-            //horde
-            case 6:wowfact="|cffff0000[Horde Auction House]:|r";ircfact="\00304,08\037/!\\\037\017\00304 Horde Auction House \00304,08\037/!\\\037\017";break;
-            //alliance
-            case 2:wowfact="|cff1589FF[Alliance Auction House]:|r";ircfact="\00304,08\037/!\\\037\017\00312 Alliance Auction House \00304,08\037/!\\\037\017";break;    
-        }
-        std::string wowstr = Command.MakeMsg("%s A New Item Has Been Added |cffffffff|Hitem:%s:0:0:0:0:0:0:0|h[%s]|h|r. By: %s",wowfact.c_str(), itemid.c_str(), itemname.c_str(), wowname.c_str());
-        std::string ircstr = Command.MakeMsg("%s A New Item Has Been Added [%s]. By: %s", ircfact.c_str(), itemname.c_str(), ircname.c_str());
-        
-        sIRC.Send_WoW_Channel(sIRC._wow_chan[sIRC.Status].c_str(), wowstr.c_str());
-        sIRC.Send_IRC_Channel(sIRC._irc_chan[sIRC.Status].c_str(), ircstr.c_str());
-    }
-}
Index: trunk/src/game/IRCSock.cpp
===================================================================
--- trunk/src/game/IRCSock.cpp (revision 39)
+++  (revision )
@@ -1,146 +1,0 @@
-#include "IRCClient.h"
-#define MAXDATASIZE 512
-#include <fcntl.h>
-
-#include <stdio.h>
-#include <sys/types.h>
-
-
-#define _UNICODE
-
-#ifdef _MBCS
-#undef _MBCS
-#endif
-
-bool IRCClient::InitSock()
-{
-    #ifdef _WIN32
-    WSADATA wsaData;                                        //WSAData
-    if(WSAStartup(MAKEWORD(2,0),&wsaData) != 0)
-    {
-        sLog.outError("IRC Error: Winsock Initialization Error");
-        return false;
-    }
-    #endif
-    if ((sIRC.SOCKET = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
-    {
-        sLog.outError("IRC Error: Socket Error");
-        return false;
-    }
-    int on = 1;
-    if ( setsockopt ( sIRC.SOCKET, SOL_SOCKET, SO_REUSEADDR, ( const char* ) &on, sizeof ( on ) ) == -1 )
-    {
-        sLog.outError("IRC Error: Invalid Socket");
-        return false;
-    }
-    #ifdef _WIN32
-    u_long iMode = 0;
-    ioctlsocket(sIRC.SOCKET, FIONBIO, &iMode);
-    #else
-    fcntl(sIRC.SOCKET, F_SETFL, O_NONBLOCK);                // set to non-blocking
-    fcntl(sIRC.SOCKET, F_SETFL, O_ASYNC);                   // set to asynchronous I/O
-    #endif
-    return true;
-}
-
-bool IRCClient::Connect(const char *cHost, int nPort)
-{
-    sIRC.Connected = false;
-    struct hostent *he;
-    if ((he=gethostbyname(cHost)) == NULL)
-    {
-        sLog.outError("IRCLIENT: Could not resolve host: %s", cHost);
-        return false;
-    }
-    struct sockaddr_in their_addr;
-    their_addr.sin_family = AF_INET;
-    their_addr.sin_port = htons(nPort);
-    their_addr.sin_addr = *((struct in_addr *)he->h_addr);
-    memset(&(their_addr.sin_zero), '\0', 8);
-    if (::connect(sIRC.SOCKET, (struct sockaddr *)&their_addr, sizeof(struct sockaddr)) == -1)
-    {
-        sLog.outError("IRCLIENT: Cannot connect to %s", cHost);
-        return false;
-    }
-    //FD_ZERO(&sIRC.sfdset);
-    //FD_SET(sIRC.SOCKET,&sIRC.sfdset);
-    sIRC.Connected = true;
-    return true;
-}
-
-bool IRCClient::Login(std::string sNick, std::string sUser, std::string sPass)
-{
-    char hostname[128];
-    gethostname(hostname, sizeof(hostname));
-    if(SendIRC("HELLO"))
-        if(SendIRC("PASS " + sPass))
-            if(SendIRC("NICK " + sNick))
-                if(SendIRC("USER " + sUser + " " + (std::string)hostname + " MangChat :MangChat "+sIRC._Mver.c_str()))
-                    return true;
-    return false;
-}
-
-bool IRCClient::SendData(const char *data)
-{
-    if(sIRC.Connected)
-    {
-        if (send(sIRC.SOCKET, data, strlen(data), 0) == -1)
-        {
-            sLog.outError("IRC Error: Socket Receieve ** \n");
-            //Disconnect();
-            return false;
-        }
-    }
-    return true;
-}
-
-bool IRCClient::SendIRC(std::string data)
-{
-    std::string RealData = data + "\n";
-    return SendData(RealData.c_str());
-}
-
-void IRCClient::Disconnect()
-{
-    if(sIRC.SOCKET)
-    {
-        #ifdef _WIN32
-        closesocket(sIRC.SOCKET);
-        //WSACleanup();
-        #else
-        close(sIRC.SOCKET);
-        #endif
-    }
-}
-
-void IRCClient::SockRecv()
-{
-//    wchar_t bufferdata;
-
-    char szBuffer[MAXDATASIZE];
-
-    memset(szBuffer, 0, MAXDATASIZE );
-    
-    int nBytesRecv = ::recv(sIRC.SOCKET, szBuffer, MAXDATASIZE - 1, 0 );
-    if ( nBytesRecv == -1 )
-    {
-        sLog.outError("Connection lost.");
-        sIRC.Connected = false;
-    }
-    else
-    {
-        if (-1 == nBytesRecv)
-        {
-            sLog.outError("Error occurred while receiving from socket.");
-        }
-        else
-        {
-            std::string reply;
-            std::istringstream iss(szBuffer);
-            while(getline(iss, reply))
-            {
-                Handle_IRC(reply);
-            }
-        }
-    }
-}
Index: trunk/src/game/IRCCmde.cpp
===================================================================
--- trunk/src/game/IRCCmde.cpp (revision 39)
+++  (revision )
@@ -1,1884 +1,0 @@
-/*
- * MangChat By |Death| And Cybrax
- *
- * This Program Is Free Software; You Can Redistribute It And/Or Modify It Under The Terms 
- * Of The GNU General Public License
- * Written and Developed by Cybrax. cybraxvd@gmail.com
- * |Death| <death@hell360.net>, Lice <lice@yeuxverts.net>, Dj_baby & Sanaell, Tase
- * With Help And Support From The MaNGOS Project Community.
- * PLEASE RETAIN THE COPYRIGHT OF THE AUTHORS.
- */
-#include "IRCCmd.h"
-#include "IRCClient.h"
-#include "MCS_OnlinePlayers.h"
-#include "WorldPacket.h"
-#include "Database/DatabaseEnv.h"
-#include "Chat.h"
-#include "MapManager.h"
-#include "World.h"
-#include "Guild.h"
-#include "ObjectMgr.h"
-#include "Language.h"
-#include "SpellAuras.h"
-#include "SystemConfig.h"
-#include "Config/ConfigEnv.h"
-
-#define Send_Player(p, m)           sIRC.Send_WoW_Player(p, m)
-#define Send_IRCA(c, m, b, t)       sIRC.Send_IRC_Channel(c, m, b, t)
-
-#ifdef WIN32
-#define Delay(x) Sleep(x)
-#else
-#define Delay(x) sleep(x / 1000)
-#endif
-
-void IRCCmd::Handle_Login(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 2);
-    std::string isbanned = AcctIsBanned(_PARAMS[0]);
-    if(isbanned == "NOTBANNED")
-    {
-        if(!IsLoggedIn(CD->USER))
-        {
-            if(!AcctIsLoggedIn(_PARAMS[0].c_str()))
-            {
-                QueryResult *result = loginDatabase.PQuery("SELECT `gmlevel` FROM `account` WHERE `username`='%s' AND `sha_pass_hash`=SHA1(CONCAT(UPPER(`username`),':',UPPER('%s')));", _PARAMS[0].c_str(), _PARAMS[1].c_str());
-                if (result)
-                {
-                    Field *fields = result->Fetch();
-                    int GMLevel = fields[0].GetInt16();
-                    if(GMLevel >= 0)
-                    {
-                        _client *NewClient = new _client();
-                         NewClient->Name     = CD->USER;
-                        NewClient->UName    = MakeUpper(_PARAMS[0]);
-                        NewClient->GMLevel  = fields[0].GetInt16();
-                        _CLIENTS.push_back(NewClient);
-                        Send_IRCA(CD->USER, MakeMsg("You Are Now Logged In As %s, Welcome To MangChat Admin Mode.", _PARAMS[0].c_str()), true, CD->TYPE);
-
-                        if(sIRC._op_gm == 1 && GMLevel >= sIRC._op_gm_lev)
-                        {
-                            for(int i=1;i < sIRC._chan_count + 1;i++)
-                            sIRC.SendIRC("MODE #"+sIRC._irc_chan[i]+" +o "+CD->USER );
-                        }
-                    }
-                }else
-                    Send_IRCA(CD->USER, "\0034[ERROR] : Sorry, Your Username Or Password Is Incorrect. Please Try Again. ", true, "ERROR");
-            }else
-                Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : %s Is Already Logged In With This Username. ", GetNameFromAcct(MakeUpper(_PARAMS[0])).c_str()), true, "ERROR");
-        }else
-            Send_IRCA(CD->USER, "\0034[ERROR] : You Are Already Logged In As "+ _PARAMS[0] +"!", true, "ERROR");
-    }else
-         Send_IRCA(CD->USER, "\0034[ERROR] : Sorry You Are "+isbanned+". You Cannot Log In To MangChat "+CD->USER.c_str()+"!", true, "ERROR");
-}
-
-void IRCCmd::Handle_Logout(_CDATA *CD)
-{
-    for(std::list<_client*>::iterator i=_CLIENTS.begin(); i!=_CLIENTS.end();i++)
-    {
-        if((*i)->Name == CD->USER)
-        {
-            _CLIENTS.erase(i);
-            delete (*i);
-            Send_IRCA(CD->USER, "You Are Now Logged Out!", true, CD->TYPE);
-            return;
-        }
-    }
-    Send_IRCA(CD->USER, "\0034[ERROR] : You Are Not Logged In!", true, "ERROR");
-}
-
-void IRCCmd::Account_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 3);
-    if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-        return;
-    }
-    normalizePlayerName(_PARAMS[0]);
-    uint64 guid = objmgr.GetPlayerGUIDByName(_PARAMS[0]);
-    uint32 account_id = 0;
-    account_id = objmgr.GetPlayerAccountIdByGUID(guid);
-    if(account_id)
-    {
-        if(account_id == GetAcctIDFromName(CD->USER) || GetLevel(CD->USER) >= sIRC._op_gm_lev)
-        {
-            Player* plr = objmgr.GetPlayer(guid);
-            if(_PARAMS[1] == "lock")
-            {
-                loginDatabase.PExecute( "UPDATE `account` SET `locked` = '1' WHERE `id` = '%d'",account_id);
-                if(plr) Send_Player(plr, MakeMsg("Your Account Has Been Locked To Your Current IP By: %s", CD->USER.c_str()));
-                Send_IRCA(ChanOrPM(CD), "\00313["+GetAcctNameFromID(account_id)+"] : Account Has Been Locked To Their Current IP Address.", true, CD->TYPE);
-            }
-            else if(_PARAMS[1] == "unlock")
-            {
-                loginDatabase.PExecute( "UPDATE `account` SET `locked` = '0' WHERE `id` = '%d'",account_id);
-                if(plr) Send_Player(plr, MakeMsg("Your Account Has Been UnLocked From The Associated IP By: %s", CD->USER.c_str()));
-                Send_IRCA(ChanOrPM(CD), "\00313["+GetAcctNameFromID(account_id)+"] : Account Has Been UnLocked From The Associated IP Address.", true, CD->TYPE);
-            }
-            else if(_PARAMS[1] == "mail")
-            {
-                loginDatabase.PExecute( "UPDATE `account` SET `email` = '%s' WHERE `id` = '%d'",_PARAMS[2].c_str() ,account_id);
-                if (plr) Send_Player(plr, MakeMsg("%s Has Changed Your EMail Adress To: %s", CD->USER.c_str(), _PARAMS[2].c_str()));
-                Send_IRCA(ChanOrPM(CD), "\00313["+GetAcctNameFromID(account_id)+"] : EMail Address Successfully Changed To: "+_PARAMS[2], true, CD->TYPE);
-            }
-            else if(_PARAMS[1] == "pass")
-            {
-                loginDatabase.PExecute( "UPDATE `account` SET `sha_pass_hash` = SHA1(CONCAT(UPPER(`username`),':',UPPER('%s'))) WHERE `id` = '%d'",_PARAMS[2].c_str() ,account_id);
-                if (plr) Send_Player(plr, MakeMsg("%s Has Changed Your Password To: %s", CD->USER.c_str(), _PARAMS[2].c_str()));
-                Send_IRCA(ChanOrPM(CD), "\00313["+GetAcctNameFromID(account_id)+"] : Password Successfully Changed To: "+_PARAMS[2], true, CD->TYPE);
-            }
-            else if(_PARAMS[1] == "rename")
-            {
-                if(plr)
-                {
-                    plr->SetAtLoginFlag(AT_LOGIN_RENAME);
-                    Send_Player(plr, MakeMsg("%s Has Requested You Change This Characters Name, Rename Will Be Forced On Next Login!", CD->USER.c_str()));
-                }
-                CharacterDatabase.PExecute("UPDATE `characters` SET `at_login` = `at_login` | '1' WHERE `guid` = '%u'", guid);
-                Send_IRCA(ChanOrPM(CD), "\00313["+GetAcctNameFromID(account_id)+"] : Has Been Forced To Change Their Characters Name, Rename Will Be Forced On Next Login!", true, CD->TYPE);
-            }
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : You Are Not A GM, You May Only Change Settings In Your Own Account.", true, "ERROR");
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : No Such Player Exists, So Account Cannot Be Looked Up.", true, "ERROR");
-}
-
-void IRCCmd::Ban_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 3);
-    if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-        return;
-    }
-    if(_PARAMS[1] == "ip")
-    {
-        std::string ip = GetIPFromPlayer(_PARAMS[0]);
-        if(_PARAMS[2] == "")
-            _PARAMS[2] = "No Reason";
-        if(ip != "")
-        {
-            loginDatabase.PExecute( "INSERT IGNORE INTO `ip_banned` VALUES ('%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '%s', '%s')", ip.c_str(), CD->USER.c_str(), _PARAMS[2].c_str());
-            if (Player* plr = GetPlayer(_PARAMS[0]))
-                plr->GetSession()->KickPlayer();
-            Send_IRCA(ChanOrPM(CD), MakeMsg("\00313[%s] : Has Had Their IP Address Banned. [%s] Reason: %s",_PARAMS[0].c_str() ,ip.c_str() , _PARAMS[2].c_str()), true, CD->TYPE);
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : I Cannot Locate An IP Address For The Character Name Given.", true, "ERROR");
-    }
-    if(_PARAMS[1] == "acct")
-    {
-        uint64 guid = objmgr.GetPlayerGUIDByName(_PARAMS[0].c_str());
-        uint32 acctid = objmgr.GetPlayerAccountIdByGUID(guid);
-        if(_PARAMS[2] == "")
-            _PARAMS[2] = "No Reason";
-        if(acctid)
-        {
-            loginDatabase.PExecute( "INSERT INTO `account_banned` VALUES ('%u', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '%s', '%s', 1)", acctid, CD->USER.c_str(), _PARAMS[2].c_str());
-            if (Player* plr = GetPlayer(_PARAMS[0]))
-                plr->GetSession()->KickPlayer();
-            Send_IRCA(ChanOrPM(CD), MakeMsg("\00313[%s] : Has Had Their Account Banned. Reason: %s",_PARAMS[0].c_str(), _PARAMS[2].c_str()), true, CD->TYPE);
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : I Cannot Locate An Account For The Character Name Given.", true, "ERROR");
-    }
-    if(_PARAMS[1] == "unban")
-    {
-        std::string unbani = _PARAMS[0];
-        if(atoi(unbani.c_str()) > 0)
-        {
-            loginDatabase.PExecute( "DELETE FROM ip_banned WHERE ip = '%s'", _PARAMS[0].c_str());
-            Send_IRCA(ChanOrPM(CD), MakeMsg("\00313[%s] : Has Been Removed From The IP Ban List.", _PARAMS[0].c_str()), true, CD->TYPE);
-        }
-        else
-        {
-            QueryResult *result = loginDatabase.PQuery("SELECT id FROM `account` WHERE username = '%s'", _PARAMS[0].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-                std::string id = fields[0].GetCppString();
-
-                loginDatabase.PExecute( "DELETE FROM account_banned WHERE id = %s", id.c_str());
-                delete result;
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\00313[%s] : Has Been Removed From The Account Ban List.", _PARAMS[0].c_str()), true, CD->TYPE);
-
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : I Cannot Locate An Account Or IP Address For The Paramaters Given.", true, "ERROR");
-        }
-    }
-}
-
-void IRCCmd::Chan_Control(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 2);
-    if(CD->FROM == sIRC._Nick)
-    {
-        Send_IRCA(CD->USER, "\0034[ERROR] : You Cannot Use This Command Through A PM Yet.", true, "ERROR");
-        return;
-    }
-    if(_PARAMS[0] == "op")
-    {
-        if(_PARAMS[1].length() > 1)
-            sIRC.SendIRC("MODE "+CD->FROM+" +o "+_PARAMS[1] );
-        else
-            sIRC.SendIRC("MODE "+CD->FROM+" +o "+CD->USER );
-    }
-    if(_PARAMS[0] == "deop")
-    {
-        if(_PARAMS[1].length() > 1)
-            sIRC.SendIRC("MODE "+CD->FROM+" -o "+_PARAMS[1] );
-        else
-            sIRC.SendIRC("MODE "+CD->FROM+" -o "+CD->USER );
-    }
-    if(_PARAMS[0] == "voice")
-    {
-        if(_PARAMS[1].length() > 1)
-            sIRC.SendIRC("MODE "+CD->FROM+" +v "+_PARAMS[1] );
-        else
-            sIRC.SendIRC("MODE "+CD->FROM+" +v "+CD->USER );
-    }
-    if(_PARAMS[0] == "devoice")
-    {
-        if(_PARAMS[1].length() > 1)
-            sIRC.SendIRC("MODE "+CD->FROM+" -v "+_PARAMS[1] );
-        else
-            sIRC.SendIRC("MODE "+CD->FROM+" -v "+CD->USER );
-    }
-}
-
-void IRCCmd::Char_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 5);
-    if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-        return;
-    }
-    normalizePlayerName(_PARAMS[0]);
-    uint64 guid = objmgr.GetPlayerGUIDByName(_PARAMS[0]);
-    Player* plr = objmgr.GetPlayer(guid);
-    if(plr)
-    {
-        if(_PARAMS[1] == "mapcheat")
-        {
-            bool explore = false;
-            if (_PARAMS[2] != "0")
-                explore = true;
-            for (uint8 i=0; i<64; i++)
-            {
-                if (_PARAMS[2] != "0")
-                    plr->SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF);
-                else
-                    plr->SetFlag(PLAYER_EXPLORED_ZONES_1+i,0);
-            }
-            if(explore)
-            {
-                Send_Player(plr, MakeMsg("All Your Zones Have Been Set To Explored By: %s", CD->USER.c_str()));
-                Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Has Now Explored All Zones.", true, CD->TYPE);
-            }
-            else
-            {
-                Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Has Now Had All Zones Set To Un-Explored.", true, CD->TYPE);
-                Send_Player(plr, MakeMsg("All Your Zones Have Been Set To Un-Explored By: %s", CD->USER.c_str()));
-            }
-        }
-        if(_PARAMS[1] == "taxicheat")
-        {
-            if (_PARAMS[2] != "0")
-            {
-                plr->SetTaxiCheater(true);
-                Send_Player(plr, MakeMsg("Taxi Node Cheat Has Been Enabled By: %s", CD->USER.c_str()));
-                Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Taxi Node Cheat Has Been Enabled.", true, CD->TYPE);
-            }
-            else
-            {
-                plr->SetTaxiCheater(false);
-                Send_Player(plr, MakeMsg("Taxi Node Cheat Has Been Disabled By: %s", CD->USER.c_str()));
-                Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Taxi Node Cheat Has Been Disabled.", true, CD->TYPE);
-            }
-        }
-        if(_PARAMS[1] == "maxskill")
-        {
-            plr->UpdateSkillsToMaxSkillsForLevel();
-            Send_Player(plr, MakeMsg("Your Skills Have Been Maxed Out By: %s", CD->USER.c_str()));
-            Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Skills Have Been Maxed Out.", true, CD->TYPE);
-        }
-        if(_PARAMS[1] == "setskill")
-        {
-            std::string* _PARAMSA = getArray(_PARAMS[2], 4);
-            uint32 skill = atoi(_PARAMS[2].c_str());
-            uint32 level = atol(_PARAMS[3].c_str());
-            int32 max   = _PARAMS[4].c_str() ? atol (_PARAMS[4].c_str()) : plr->GetPureMaxSkillValue(skill);
-            SkillLineEntry const* skilllookup = sSkillLineStore.LookupEntry(skill);
-            //if skillid entered is not a number and greater then 0 then the command is being used wrong
-            if(skill >= 0)
-            {
-                //does the skill even exist
-                if(skilllookup)
-                {
-                    //does player have the skill yet
-                    if(plr->GetSkillValue(skill))
-                    {
-                        plr->SetSkill(skill,level,max);
-                        Send_Player(plr, MakeMsg("Skill: %s Has Been Set To Level: %i Max: %i By: %s",skilllookup->name[0], level, max, CD->USER.c_str()));
-                        Send_IRCA(ChanOrPM(CD), MakeMsg("\00313[%s] : Has Had Skill: %s Set To Level: %d Max: %d",_PARAMS[0].c_str() , skilllookup->name[0], level, max), true, CD->TYPE);
-                    }
-                    else
-                        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Player Does Not Have The %s Skill Yet.", skilllookup->name[0]), true, "ERROR");
-                }
-                else
-                    Send_IRCA(CD->USER, "\0034[ERROR] : That Skill ID Does Not Exist.", true, "ERROR");
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : The Skill ID Entered Is Invalid.", true, "ERROR");
-        }
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : No Character With That Name Exists.", true, "ERROR");
-}
-
-void IRCCmd::Fun_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 3);
-    if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-        return;
-    }
-    if (Player* plr = GetPlayer(_PARAMS[0]))
-    {
-        if(_PARAMS[1] == "say")
-        {
-            plr->Say(_PARAMS[2], LANG_UNIVERSAL);
-            Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Was Forced To Say: "+_PARAMS[2]+".", true, CD->TYPE);
-        }
-        if(_PARAMS[1] == "sound")
-        {
-            uint32 sndid = atoi(_PARAMS[2].c_str());
-            plr->SendPlaySound(sndid ,true);
-            Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Has Just Heard Sound ID: "+_PARAMS[2]+".", true, CD->TYPE);
-        }
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : Player Not Online!", true, "ERROR");
-}
-
-void IRCCmd::Help_IRC(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 1);
-    QueryResult *result = WorldDatabase.PQuery("SELECT `Command`, `Description`, `gmlevel` FROM `IRC_Commands`");
-    if(result)
-    {
-        if(IsLoggedIn(CD->USER))
-        {
-            if(_PARAMS[0] == "")
-            {
-                QueryResult *result = WorldDatabase.PQuery("SELECT * FROM `IRC_Commands` WHERE `gmlevel` <= %u ORDER BY `Command`", GetLevel(CD->USER));
-                if(result)
-                {
-                    std::string output = "\002MangChat IRC Commands:\017 ";
-                    for (uint64 i=0; i < result->GetRowCount(); i++)
-                    {
-                        Field *fields = result->Fetch();
-                        output += fields[0].GetCppString() + ", ";
-                        result->NextRow();
-                    }
-                    delete result;
-                    Send_IRCA(CD->USER, output, true, CD->TYPE.c_str());
-                }
-            }
-            else
-            {
-                QueryResult *result = WorldDatabase.PQuery("SELECT `Description`, `gmlevel` FROM `IRC_Commands` WHERE `Command` = '%s'", _PARAMS[0].c_str());
-                if(result)
-                {
-                    Field *fields = result->Fetch();
-                    if(fields[1].GetUInt32() > GetLevel(CD->USER))
-                    {
-                        Send_IRCA(CD->USER, "You Do Not Have Access To That Command, So No Help Is Available.", true, CD->TYPE.c_str());
-                        return;
-                    }
-                    if(result)
-                    {
-                        std::string cmdhlp = fields[0].GetCppString();
-                        delete result;
-                        Send_IRCA(CD->USER, cmdhlp, true, CD->TYPE.c_str());
-                    }
-                }
-                else
-                    Send_IRCA(CD->USER, "\0034[ERROR] : No Such Command Exists, Please Check The Spelling And Try Again.", true, "ERROR");
-            }
-        }
-        else if(!IsLoggedIn(CD->USER))
-        {
-            if(_PARAMS[0] == "")
-            {
-                QueryResult *result = WorldDatabase.PQuery("SELECT * FROM `IRC_Commands` WHERE `gmlevel` = 0 ORDER BY `Command`");
-                if(result)
-                {
-                    std::string output = "\002MangChat IRC Commands:\017 ";
-                    for (uint64 i=0; i < result->GetRowCount(); i++)
-                    {
-                        Field *fields = result->Fetch();
-                        output += fields[0].GetCppString() + ", ";
-                        result->NextRow();
-                    }
-                    delete result;
-                    Send_IRCA(CD->USER, output, true, CD->TYPE.c_str());
-                    Send_IRCA(CD->USER, "You Are Currently Not Logged In, Please Login To See A Complete List Of Commands Available To You.", true, CD->TYPE.c_str());
-                }
-            }
-            else
-            {
-                QueryResult *result = WorldDatabase.PQuery("SELECT `Description`, `gmlevel` FROM `IRC_Commands` WHERE `Command` = '%s'", _PARAMS[0].c_str());
-                if(result)
-                {
-                    Field *fields = result->Fetch();
-                    if(fields[1].GetUInt32() > 0)
-                    {
-                        Send_IRCA(CD->USER, "You Do Not Have Access To That Command, So No Help Is Available.", true, CD->TYPE.c_str());
-                        return;
-                    }
-                    std::string cmdhlp = fields[0].GetCppString();
-                    delete result;
-                    Send_IRCA(CD->USER, cmdhlp, true, CD->TYPE.c_str());
-                }
-                else
-                    Send_IRCA(CD->USER, "\0034[ERROR] : No Such Command Exists, Please Check The Spelling And Try Again.", true, "ERROR");
-            }
-        }
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : Database Error! Please Make Sure You Used IRC_Commands.sql, You Must Have A Table In Your World Database (IRC_Commands)!", true, "ERROR");
-}
-
-void IRCCmd::Inchan_Server(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 1);
-    if(_PARAMS[0] == "")
-    {
-        Send_IRCA(CD->USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"inchan <ChannelName> )", true, "ERROR");
-        return;
-    }
-    QueryResult *result = WorldDatabase.PQuery("SELECT * FROM `IRC_Inchan` WHERE `channel` = '%s' ORDER BY `name`", _PARAMS[0].c_str());
-    if(result)
-    {
-        Field *fields = result->Fetch();
-        std::string output = "\002Players In The [ "+fields[2].GetCppString()+" ] Channel:\017 ";
-        for (uint64 i=0; i < result->GetRowCount(); i++)
-        {
-            output += fields[1].GetCppString() + ", ";
-            result->NextRow();
-        }
-        delete result;
-        Send_IRCA(ChanOrPM(CD), output, true, CD->TYPE);
-    }
-    else
-        Send_IRCA(ChanOrPM(CD), "No Players Are Currently In [ "+_PARAMS[0]+" ] Channel!", true, CD->TYPE.c_str());
-}
-
-void IRCCmd::Info_Server(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 1);
-    char clientsNum [50];
-    sprintf(clientsNum, "%u", sWorld.GetActiveSessionCount());
-    char maxClientsNum [50];
-    sprintf(maxClientsNum, "%u", sWorld.GetMaxActiveSessionCount());
-    std::string str = secsToTimeString(sWorld.GetUptime());
-    std::string svnrev = _FULLVERSION;
-    Send_IRCA(ChanOrPM(CD), "\x2 Number of players online:\x3\x31\x30 " + (std::string)clientsNum + "\xF |\x2 Max since last restart:\x3\x31\x30 "+(std::string)maxClientsNum+"\xF |\x2 Uptime:\x3\x31\x30 "+str, true, CD->TYPE);
-    Send_IRCA(ChanOrPM(CD), "\x2 Trinity Core SVN revision:\x3\x31\x30 "+svnrev, true, CD->TYPE);
-}
-
-void IRCCmd::Item_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 3);
-
-    normalizePlayerName(_PARAMS[0]);
-    Player *chr = GetPlayer(_PARAMS[0].c_str());
-    if(_PARAMS[1] == "add")
-    {
-        std::string s_param  = _PARAMS[2];
-
-        char *args = (char*)s_param.c_str();
-        uint32 itemId = 0;
-        if(args[0]=='[')
-        {
-            char* citemName = citemName = strtok((char*)args, "]");
-            if(citemName && citemName[0])
-            {
-                std::string itemName = citemName+1;
-                WorldDatabase.escape_string(itemName);
-                QueryResult *result = WorldDatabase.PQuery("SELECT entry FROM item_template WHERE name = '%s'", itemName.c_str());
-                if (!result)
-                {
-                    Send_IRCA(CD->USER, "\0034[ERROR] : Item Not Found!", true, "ERROR");
-                    return;
-                }
-                itemId = result->Fetch()->GetUInt16();
-                delete result;
-            }
-            else
-            {
-                Send_IRCA(CD->USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"item <Player> <add> [Exact Item Name] <Amount> )", true, "ERROR");
-                return;
-            }
-        }
-        else
-        {
-            std::string itemName = s_param;
-            WorldDatabase.escape_string(itemName);
-            QueryResult *result = WorldDatabase.PQuery("SELECT entry FROM item_template WHERE name = '%s'", itemName.c_str());
-            if (result)
-            {
-                itemId = result->Fetch()->GetUInt16();
-            }
-            delete result;
-
-            char* cId = strtok(args, " ");
-            if(!cId)
-            {
-                Send_IRCA(CD->USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"item <Player> <add> <ItemID> <Amount> )", true, "ERROR");
-                return;
-            }
-            itemId = atol(cId);
-        }
-            char* ccount = strtok(NULL, " ");
-            int32 count = 1;
-            if (ccount) { count = atol(ccount); }
-            Player* plTarget = chr;
-        if(!plTarget)
-        {
-            Send_IRCA(CD->USER, "\0034[ERROR] : "+_PARAMS[0]+" Is Not Online!", true, "ERROR");
-            return;
-        }
-        ItemPrototype const *pProto = objmgr.GetItemPrototype(itemId);
-        //Subtract
-        if (count < 0)
-        {
-            plTarget->DestroyItemCount(itemId, -count, true, false);
-            char itemid2[255];
-            sprintf(itemid2,"%d",itemId);
-            std::string itake = " \00313["+ _PARAMS[0] +"] : Has Had Item " +itemid2+ " Taken From Them!";
-            Send_IRCA(ChanOrPM(CD), itake, true, CD->TYPE);
-            return;
-        }
-        //Adding items
-        uint32 noSpaceForCount = 0;
-
-        // check space and find places
-        ItemPosCountVec dest;
-        uint8 msg = plTarget->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount );
-        if( msg == EQUIP_ERR_INVENTORY_FULL )                   // convert to possibel store amount
-            count -= noSpaceForCount;
-        else if( msg != EQUIP_ERR_OK )                          // other error, can't add
-        {
-            char s_countForStore[255];
-            sprintf(s_countForStore,"%d",count);
-            std::string ierror = " \00313["+ _PARAMS[0] +"] : Could Not Create All Items! " +s_countForStore+ " Item(s) Were Not Created!";
-            Send_IRCA(ChanOrPM(CD), ierror, true, CD->TYPE);
-            return;
-        }
-        Item* item = plTarget->StoreNewItem( dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
-        if(count > 0 && item)
-        {
-                plTarget->SendNewItem(item,count,true,false);
-                QueryResult *result = WorldDatabase.PQuery("SELECT name FROM item_template WHERE entry = %d", itemId);
-                char* dbitemname = NULL;
-                if (result)
-                {
-                    dbitemname = (char*)result->Fetch()->GetString();
-                }
-                std::string iinfo = " \00313[" + _PARAMS[0] + "] : Has Been Given Item "+dbitemname+". From: "+CD->USER.c_str()+".";
-                Send_IRCA(ChanOrPM(CD), iinfo, true, CD->TYPE);
-                delete result;
-        }
-        if(noSpaceForCount > 0)
-        {
-            char s_countForStore[255];
-            sprintf(s_countForStore,"%d",noSpaceForCount);
-            std::string ierror = " \00313["+ _PARAMS[0] +"] : Could Not Create All Items! " +s_countForStore+ " Item(s) Were Not Created!";
-            Send_IRCA(ChanOrPM(CD), ierror, true, CD->TYPE);
-            return;
-        }
-    }
-    else
-    {
-        Send_IRCA(CD->USER, "\0034[ERROR] : Syntax Error! ( "+sIRC._cmd_prefx+"item <Player> <add> <ItemID> <Amount> )", true, "ERROR");
-        return;
-    }
-}
-
-void IRCCmd::Jail_Player(_CDATA *CD)
-{
-    if(ValidParams(CD->PARAMS, 1))
-    {
-        std::string* _PARAMS = getArray(CD->PARAMS, 2);
-        if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-        {
-            Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-            return;
-        }
-        if (Player *plr = GetPlayer(_PARAMS[0]))
-        {
-            std::string sReason = "";
-            if(_PARAMS[1] == "release")
-            {
-                float rposx, rposy, rposz, rposo = 0;
-                uint32 rmapid = 0;
-                CharacterDatabase.escape_string(_PARAMS[0]);
-                QueryResult *result = CharacterDatabase.PQuery( "SELECT `map`, `position_x`, `position_y`, `position_z` FROM `character_homebind` WHERE `guid` = '" I64FMTD "'", plr->GetGUID() );
-                if(result)
-                {
-                    Field *fields = result->Fetch();
-                    rmapid = fields[0].GetUInt16();
-                    rposx = fields[1].GetFloat();
-                    rposy = fields[2].GetFloat();
-                    rposz = fields[3].GetFloat();
-                    delete result;
-                    plr->SetMovement(MOVE_UNROOT);
-                    plr->TeleportTo(rmapid, rposx, rposy, rposz, rposo);
-                    plr->RemoveAurasDueToSpell(42201);
-                    plr->RemoveAurasDueToSpell(23775);
-                    plr->RemoveAurasDueToSpell(9454);
-                    Send_Player(plr, MakeMsg("You Have Been Released By: %s.", CD->USER.c_str()));
-                    sReason = " \00313["+_PARAMS[0]+"] : Has Been Released By: "+CD->USER+".";
-                    Send_IRCA(ChanOrPM(CD), sReason, true, CD->TYPE);
-                }
-            }
-            else
-            {
-                if(_PARAMS[1] == "")
-                    _PARAMS[1] = "No Reason Given.";
-                plr->TeleportTo(13, 0, 0, 0, 0);
-                plr->SetMovement(MOVE_ROOT);
-                plr->CastSpell(plr, 42201, true);
-                plr->CastSpell(plr, 23775, true);
-                plr->CastSpell(plr, 9454, true);
-                Send_Player(plr, MakeMsg("You Have Been Jailed By: %s. Reason: %s.", CD->USER.c_str(), _PARAMS[1].c_str()));
-                sReason = " \00313["+_PARAMS[0]+"] : Has Been Jailed By: "+CD->USER+". Reason: "+_PARAMS[1]+".";
-                Send_IRCA(ChanOrPM(CD), sReason, true, CD->TYPE);
-            }
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : "+_PARAMS[0]+" Is Not Online!", true, "ERROR");
-    }
-}
-
-void IRCCmd::Kick_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, CD->PCOUNT);
-    if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-        return;
-    }
-    if(_PARAMS[1] == "")
-        _PARAMS[1] = "No Reason Given.";
-    if (Player* plr = GetPlayer(_PARAMS[0]))
-    {
-        plr->GetSession()->KickPlayer();
-        Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Has Been Kicked By: "+CD->USER+". Reason: "+_PARAMS[1]+".", true, CD->TYPE);
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : "+_PARAMS[0]+" Is Not Online!", true, "ERROR");
-}
-
-void IRCCmd::Kill_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, CD->PCOUNT);
-    if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-        return;
-    }
-    if (Player* plr = GetPlayer(_PARAMS[0]))
-    {
-        if(plr->isAlive())
-        {
-            plr->DealDamage(plr, plr->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
-            plr->SaveToDB();
-            if(_PARAMS[1] == "")
-                _PARAMS[1] = "No Reason Given.";
-            Send_IRCA(ChanOrPM(CD), MakeMsg("\00313[%s] : Has Been Killed By: %s.", _PARAMS[0].c_str(), CD->USER.c_str()) +  +  + " Reason: "+_PARAMS[1]+".", true, CD->TYPE);
-            Send_Player(plr, MakeMsg("You Have Been Killed By: %s. Reason: %s.", CD->USER.c_str(), _PARAMS[1].c_str()));
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : "+_PARAMS[0]+" Is Already Dead!", true, "ERROR");
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : "+_PARAMS[0]+" Is Not Online!", true, "ERROR");
-}
-
-void IRCCmd::Lookup_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, CD->PCOUNT);
-    if(_PARAMS[0] == "acct")
-    {
-        uint32 acctid = atoi(_PARAMS[1].c_str());
-        if(objmgr.GetAccountByAccountName(_PARAMS[1]))
-            acctid = objmgr.GetAccountByAccountName(_PARAMS[1]);
-        if(acctid > 0)
-        {       
-            std::string DateTime = "%a, %b %d, %Y - %h:%i%p";
-            QueryResult *result = loginDatabase.PQuery("SELECT id, username, gmlevel, last_ip, (SELECT banreason FROM account_banned WHERE id = %d LIMIT 1) as banned, (SELECT banreason FROM ip_banned WHERE ip = last_ip) as bannedip, DATE_FORMAT(last_login, '%s') FROM `account` WHERE id = %d", acctid, DateTime.c_str(), acctid, acctid);
-            if(result)
-            {
-                Field *fields = result->Fetch();
-
-                uint32 id = fields[0].GetUInt32();
-                std::string usrname = fields[1].GetCppString();
-                uint32 gm = fields[2].GetUInt32();
-                std::string lastip = fields[3].GetCppString();
-                std::string banreason = fields[4].GetCppString();
-                std::string banreasonip = fields[5].GetCppString();
-                std::string lastlogin = fields[6].GetCppString();
-                delete result;
-
-                QueryResult *chars = CharacterDatabase.PQuery("SELECT guid, name, (SELECT SUM(totaltime) FROM characters WHERE account = %d) AS tottime FROM characters WHERE account = %u", id, id);
-                std::string characters = "None";
-                std::string totaccttime = "Never Logged In";
-                if(chars)
-                {
-                    characters = "";
-                    Field *fields = chars->Fetch();
-                    totaccttime = SecToDay(fields[2].GetCppString());
-                    for (uint64 i=0; i < chars->GetRowCount(); i++)
-                    {   
-                        std::string guid = fields[0].GetCppString();
-                        std::string charname = fields[1].GetCppString();
-                        characters.append(charname+"("+guid+"), ");
-                        chars->NextRow();
-                    }
-                    delete chars;
-                }
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2Username:\x3\x31\x30 %s \xF|\x2 AccountID:\x3\x31\x30 %d \xF|\x2 GM Level:\x3\x31\x30 %d \xF|\x2 Last IP:\x3\x31\x30 %s \xF|\x2 Last Login:\x3\x31\x30 %s", usrname.c_str(), id, gm, lastip.c_str(), lastlogin.c_str()), true, CD->TYPE);
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2Total Play Time:\x3\x31\x30 %s \xF|\x2 Characters:\x3\x31\x30 %s ", totaccttime.c_str(), characters.c_str()), true, CD->TYPE);
-                if(banreason.length() > 1)
-                    Send_IRCA(ChanOrPM(CD), MakeMsg("\0034This User Has An Account Ban. Ban Reason: %s", banreason.c_str()), true, CD->TYPE);
-                if(banreasonip.length() > 1)
-                    Send_IRCA(ChanOrPM(CD), MakeMsg("\0034This User Has An IP Ban. Ban Reason: %s", banreasonip.c_str()), true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Account ID." ,true, "ERROR");
-        }
-        else
-        {
-            QueryResult *result = loginDatabase.PQuery("SELECT id, username FROM `account` WHERE username LIKE '%%%s%%' LIMIT 10", _PARAMS[1].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-                std::string accts = "\002Account Search Results:\x3\x31\x30 ";
-                for (uint64 i=0; i < result->GetRowCount(); i++)
-                {   
-                    std::string acctid = fields[0].GetCppString();
-                    std::string acctname = fields[1].GetCppString();
-                    accts.append(acctname+"("+acctid+")\xF | \x3\x31\x30\x2");
-                    result->NextRow();
-                }
-                delete result;
-                Send_IRCA(ChanOrPM(CD), accts, true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Username. I Cant Find Any Users With Those Search Terms." ,true, "ERROR");
-        }
-    }   
-    if(_PARAMS[0] == "char")
-    {
-        uint32 plguid = atoi(_PARAMS[1].c_str());
-        if(objmgr.GetPlayerGUIDByName(_PARAMS[1].c_str()))
-            plguid = objmgr.GetPlayerGUIDByName(_PARAMS[1].c_str());
-        if(plguid > 0)
-        {       
-            QueryResult *result = CharacterDatabase.PQuery("SELECT guid, account, name, race, class, online, SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ' , 35), ' ' , -1) AS level, SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ' , 238), ' ' , -1) AS guildid, SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ' , 239), ' ' , -1) AS guildrank, SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ' , 927), ' ' , -1) AS xp, SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ' , 928), ' ' , -1) AS maxxp, SUBSTRING_INDEX(SUBSTRING_INDEX(data, ' ' , 1462), ' ' , -1) AS gold, SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ' , 1454), ' ' , -1) AS hk, SEC_TO_TIME(totaltime) AS tottime FROM characters WHERE guid =%i", plguid);
-            uint32 latency = 0;
-            Player *chr = objmgr.GetPlayer(plguid);
-            if(chr) 
-            {
-                latency = chr->GetSession()->GetLatency();
-            }
-            char templatency [100];
-            sprintf(templatency, "%ums", latency);
-            if(result)
-            {
-                Field *fields = result->Fetch();
-                std::string pguid = fields[0].GetCppString();
-                std::string pacct = fields[1].GetCppString();
-                std::string pname = fields[2].GetCppString();
-                uint32 praceid = fields[3].GetUInt32();
-                uint32 pclassid = fields[4].GetUInt32();
-                std::string ponline = (fields[5].GetInt32() == 1 ? "\x3\x30\x33Online" : "\x3\x30\x34Offline\xF");
-                std::string plevel = fields[6].GetCppString();
-                uint32 pguildid = fields[7].GetUInt32();
-                uint32 pguildrank = fields[8].GetUInt32();
-                std::string pxp = fields[9].GetCppString();
-                std::string pmaxxp = fields[10].GetCppString();
-                unsigned int money = fields[11].GetInt32();
-                std::string hk = fields[12].GetCppString();
-                std::string totaltim = SecToDay(fields[13].GetCppString());
-                delete result;
-                std::string sqlquery = "SELECT `gmlevel` FROM `account` WHERE `id` = '" + pacct + "';";
-                QueryResult *result = loginDatabase.Query(sqlquery.c_str());
-                Field *fields2 = result->Fetch();
-                std::string pgmlvl = fields2[0].GetCppString();
-                delete result;
-                std::string guildinfo = "";
-                if (pguildid != 0)
-                {
-                    Guild* guild = objmgr.GetGuildById(pguildid);
-                    if (guild)
-                    {
-                        guildinfo = " " + guild->GetRankName(pguildrank) + " Of " + guild->GetName();
-                    }
-                }
-                else guildinfo = " None";
-                ChrRacesEntry const* prace = sChrRacesStore.LookupEntry(praceid);
-                ChrClassesEntry const* pclass = sChrClassesStore.LookupEntry(pclassid);
-
-                if (atoi(plevel.c_str()) < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
-                    plevel += " (" + pxp + "/" + pmaxxp + ")";
-                unsigned int gold = money / 10000;
-                unsigned int silv = (money % 10000) / 100;
-                unsigned int cop = (money % 10000) % 100;
-                char tempgold [100];
-                sprintf(tempgold, "\x2\x3\x30\x37%ug \x3\x31\x34%us \x3\x30\x35%uc\xF", gold, silv, cop);
-                if (ponline == "\x3\x30\x33Online")
-                {
-                    Player * plr = ObjectAccessor::Instance().FindPlayerByName(pname.c_str());
-                    if (plr)
-                    {
-                        AreaTableEntry const* area = GetAreaEntryByAreaID(plr->GetAreaId());
-                        ponline += " in " + (std::string) area->area_name[sWorld.GetDefaultDbcLocale()];
-                        if (area->zone != 0)
-                        {
-                            AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone);
-                            ponline += " (" + (std::string)zone->area_name[sWorld.GetDefaultDbcLocale()] + ")";
-                        }
-                    }
-                }
-                std::string pinfo  = "\x2 About Player:\x3\x31\x30 " +pname+ "\xF |\x2 GM Level:\x3\x31\x30 " +pgmlvl+ "\xF |\x2 AcctID:\x3\x31\x30 " +pacct+ "\xF |\x2 CharID:\x3\x31\x30 " +pguid+ " \xF |\x2 Played Time:\x2\x3\x31\x30 " +totaltim+" \xF |\x2 Latency:\x2\x3\x31\x30 "+templatency;
-                std::string pinfo2 = "\x2 Race:\x2\x3\x31\x30 " + (std::string)prace->name[sWorld.GetDefaultDbcLocale()] + "\xF |\x2 Class:\x2\x3\x31\x30 " + (std::string)pclass->name[sWorld.GetDefaultDbcLocale()] + "\xF |\x2 Level:\x2\x3\x31\x30 " + plevel + "\xF |\x2 Money:\x2 " + tempgold + "\xF |\x2 Guild Info:\x2\x3\x31\x30 "+guildinfo+"\xF |\x2 Status:\x2 " + ponline;
-                //        pinfo3 = " :" + " \x2Honor Kills:\x2\x3\x31\x30 " + hk;
-                Send_IRCA(ChanOrPM(CD),pinfo , true, CD->TYPE);
-                Send_IRCA(ChanOrPM(CD),pinfo2 , true, CD->TYPE);
-                //        Send_IRCA(ChanOrPM(CD),pinfo3 , true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Character ID. (GUID)" ,true, "ERROR");
-        }
-        else
-        {
-            QueryResult *result = CharacterDatabase.PQuery("SELECT guid, account, name FROM characters WHERE name LIKE '%%%s%%' LIMIT 10", _PARAMS[1].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-                std::string items = "\x2 Character Search Results:\x3\x31\x30 ";
-                for (uint64 i=0; i < result->GetRowCount(); i++)
-                {   
-                    std::string guid = fields[0].GetCppString();
-                    std::string account = fields[1].GetCppString();
-                    std::string name = fields[2].GetCppString();
-                    MakeUpper(name);
-                    items.append(name+"(Account:"+account+" - GUID:"+guid+")\xF | \x3\x31\x30\x2");
-                    result->NextRow();
-                }
-                delete result;
-                Send_IRCA(ChanOrPM(CD), items, true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Character. I Cant Find Any Characters With Those Search Terms." ,true, "ERROR");
-        }
-    }   
-    if(_PARAMS[0] == "creature")
-    {
-        std::string creature = _PARAMS[1];
-        if(atoi(creature.c_str()) > 0)
-        {
-            WorldDatabase.escape_string(_PARAMS[1]);
-            QueryResult *result = WorldDatabase.PQuery("SELECT entry, modelid_A, name, (minlevel*maxlevel/2) as level, faction_A, armor,  (SELECT count(*) FROM creature WHERE id = '%s') as spawns FROM creature_template WHERE entry = '%s';", _PARAMS[1].c_str(), _PARAMS[1].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-
-                uint32 entry = fields[0].GetUInt32();
-                uint32 modelid = fields[1].GetUInt32();
-                std::string name = fields[2].GetCppString();
-                uint32 level = fields[3].GetUInt32();
-                uint32 faction = fields[4].GetUInt32();
-                uint32 armor = fields[5].GetUInt32();
-                uint32 spawns = fields[6].GetUInt32();
-                delete result;
-
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2Name:\x3\x31\x30 %s \xF|\x2 CreatureID:\x3\x31\x30 %d \xF|\x2 DisplayID:\x3\x31\x30 %d \xF|\x2 Spawns:\x3\x31\x30 %d", name.c_str(), entry, modelid, spawns), true, CD->TYPE);
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2Level:\x3\x31\x30 %d \xF|\x2 Faction:\x3\x31\x30 %d \xF|\x2 Armor:\x3\x31\x30 %d", level, faction, armor), true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Creature ID." ,true, "ERROR");
-        }
-        else
-        {
-            QueryResult *result = WorldDatabase.PQuery("SELECT entry, name FROM creature_template WHERE name LIKE '%%%s%%' LIMIT 10", _PARAMS[1].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-                std::string items = "\002Creature Search Results:\x3\x31\x30 ";
-                //Send_IRCA(ChanOrPM(CD), "", true, CD->TYPE);
-                for (uint64 i=0; i < result->GetRowCount(); i++)
-                {   
-                    std::string CreatureID = fields[0].GetCppString();
-                    std::string Name = fields[1].GetCppString();
-                    items.append(Name+"("+CreatureID+")\xF | \x3\x31\x30\x2");
-                    result->NextRow();
-                }
-                delete result;
-                Send_IRCA(ChanOrPM(CD), items, true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Creature. I Cant Find Any Creatures With Those Search Terms." ,true, "ERROR");
-        }
-    }
-    if(_PARAMS[0] == "faction")
-    {
-        std::string faction = _PARAMS[1];
-        if(atoi(faction.c_str()) > 0)
-        {       
-            FactionEntry const *factionEntry = sFactionStore.LookupEntry(atoi(faction.c_str()));
-            if(factionEntry)
-            {
-                std::string name = factionEntry->name[sWorld.GetDefaultDbcLocale()];
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2 Faction:\x3\x31\x30 %s \xF|\x2 FactionID:\x3\x31\x30 %s",name.c_str(), faction.c_str()), true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown FactionID." ,true, "ERROR");
-
-        }
-        else
-        {
-            uint32 counter = 0;
-            std::string factions = "\002Faction Search Results:\x3\x31\x30 ";
-            for (uint32 id = 0; id < sFactionStore.GetNumRows(); id++)
-            {
-                FactionEntry const *factionEntry = sFactionStore.LookupEntry(id);
-                if(factionEntry)
-                {
-                    MakeLower( _PARAMS[1] );
-                    std::string name = factionEntry->name[sWorld.GetDefaultDbcLocale()];
-                    MakeLower( name );
-                    if (name.find(_PARAMS[1]) != std::string::npos && counter < 10)
-                    {
-                        char factionid[100];
-                        sprintf(factionid, "%d", id);
-                        factions.append(name+"("+factionid+")\xF | \x3\x31\x30\x2");            
-                        ++counter;                      
-                    }
-                }
-            }
-            if(counter == 0)
-                factions.append("No Factions Found.");
-            Send_IRCA(ChanOrPM(CD), factions, true, CD->TYPE);
-        }
-    }
-    if(_PARAMS[0] == "go")
-    {
-        std::string gobject = _PARAMS[1];
-        if(atoi(gobject.c_str()) > 0)
-        {       
-            WorldDatabase.escape_string(_PARAMS[1]);
-            QueryResult *result = WorldDatabase.PQuery("SELECT entry, type, displayId, name, faction, (SELECT count(*) FROM gameobject WHERE id = '%s') as spawns FROM gameobject_template WHERE entry = '%s';", _PARAMS[1].c_str(), _PARAMS[1].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-
-                uint32 entry = fields[0].GetUInt32();
-                uint32 type = fields[1].GetUInt32();
-                uint32 modelid = fields[2].GetUInt32();
-                std::string name = fields[3].GetCppString();
-                uint32 faction = fields[4].GetUInt32();
-                uint32 spawns = fields[5].GetUInt32();
-                delete result;
-
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2GO Name:\x3\x31\x30 %s \xF|\x2 GameobjectID:\x3\x31\x30 %d \xF|\x2 DisplayID:\x3\x31\x30 %d \xF|\x2 Spawns:\x3\x31\x30 %d", name.c_str(), entry, modelid, spawns), true, CD->TYPE);
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2Type:\x3\x31\x30 %d \xF|\x2 Faction:\x3\x31\x30 %d", type, faction), true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Creature ID." ,true, "ERROR");
-        }
-        else
-        {
-            QueryResult *result = WorldDatabase.PQuery("SELECT entry, name FROM gameobject_template WHERE name LIKE '%%%s%%' LIMIT 10", _PARAMS[1].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-                std::string gos = "\002Gameobject Search Results:\x3\x31\x30 ";
-                for (uint64 i=0; i < result->GetRowCount(); i++)
-                {   
-                    std::string GOID = fields[0].GetCppString();
-                    std::string GoName = fields[1].GetCppString();
-                    gos.append(GoName+"("+GOID+")\xF | \x3\x31\x30\x2");
-                    result->NextRow();
-                }
-                delete result;
-                Send_IRCA(ChanOrPM(CD), gos, true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Game Object. I Cant Find Any Game Object's With Those Search Terms." ,true, "ERROR");
-        }
-    }
-    if(_PARAMS[0] == "item")
-    {
-        std::string item = _PARAMS[1];
-        if(atoi(item.c_str()) > 0)
-        {       
-            QueryResult *result = WorldDatabase.PQuery("SELECT entry, name, displayid, (SELECT count(*) FROM creature_loot_template WHERE item = '%s') as loot FROM `item_template` WHERE entry = %s", _PARAMS[1].c_str(), _PARAMS[1].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-                QueryResult *result2 = CharacterDatabase.PQuery("SELECT count(*) FROM `character_inventory` WHERE item_template = %s", _PARAMS[1].c_str());
-                Field *fields2 = result2->Fetch();
-                uint32 charcnt = fields2[0].GetUInt32();
-                delete result2;
-
-                uint32 ItemID = fields[0].GetUInt32();
-                std::string ItmName = fields[1].GetCppString();
-                uint32 DisplayID = fields[2].GetUInt32();
-                uint32 loots = 0;
-                loots = fields[3].GetUInt32();
-                delete result;
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2Item:\x3\x31\x30 %s \xF|\x2 ItemID:\x3\x31\x30 %d \xF|\x2 DisplayID:\x3\x31\x30 %d \xF|\x2 Owned By:\x3\x31\x30 %d players \xF|\x2 Dropped By:\x3\x31\x30 %d creatures", ItmName.c_str(), ItemID, DisplayID, charcnt, loots), true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown ItemID." ,true, "ERROR");
-        }
-        else
-        {
-            QueryResult *result = WorldDatabase.PQuery("SELECT entry, name FROM `item_template` WHERE name LIKE '%%%s%%' LIMIT 10", _PARAMS[1].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-                std::string items = "\002Item Search Results:\x3\x31\x30 ";
-                for (uint64 i=0; i < result->GetRowCount(); i++)
-                {   
-                    std::string ItemID = fields[0].GetCppString();
-                    std::string ItemName = fields[1].GetCppString();
-                    items.append(ItemName+"("+ItemID+")\xF | \x3\x31\x30\x2");
-                    result->NextRow();
-                }
-                delete result;
-                Send_IRCA(ChanOrPM(CD), items, true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Item. I Cant Find Any Items With Those Search Terms." ,true, "ERROR");
-        }
-    }
-    if(_PARAMS[0] == "quest")
-    {
-        std::string quest = _PARAMS[1];
-        if(atoi(quest.c_str()) > 0)
-        {       
-            WorldDatabase.escape_string(_PARAMS[1]);
-            QueryResult *result = WorldDatabase.PQuery("SELECT entry, Title FROM quest_template WHERE entry = '%s';", _PARAMS[1].c_str(), _PARAMS[1].c_str());
-            if(result)
-            {
-                QueryResult *result2 = CharacterDatabase.PQuery("SELECT count(*) FROM character_queststatus WHERE quest = '%s' AND status = '1';", _PARAMS[1].c_str());
-                Field *fields2 = result2->Fetch();
-                uint32 status = fields2[0].GetUInt32();
-                delete result2;
-
-                Field *fields = result->Fetch();
-                uint32 entry = fields[0].GetUInt32();
-                std::string name = fields[1].GetCppString();
-                delete result;
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2Quest Name:\x3\x31\x30 %s \xF|\x2 QuestID:\x3\x31\x30 %d \xF|\x2 Completed:\x3\x31\x30 %d times", name.c_str(), entry, status), true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Quest ID." ,true, "ERROR");
-        }
-        else
-        {
-            QueryResult *result = WorldDatabase.PQuery("SELECT entry, Title FROM quest_template WHERE Title LIKE '%%%s%%' LIMIT 10", _PARAMS[1].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-                std::string quests = "\002Quest Search Results:\x3\x31\x30 ";
-                //Send_IRCA(ChanOrPM(CD), "", true, CD->TYPE);
-                for (uint64 i=0; i < result->GetRowCount(); i++)
-                {   
-                    std::string QuestID = fields[0].GetCppString();
-                    std::string QuestName = fields[1].GetCppString();
-                    quests.append(QuestName+"("+QuestID+")\xF | \x3\x31\x30\x2");
-                    result->NextRow();
-                }
-                delete result;
-                Send_IRCA(ChanOrPM(CD), quests, true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Quest. I Cant Find Any Quest's With Those Search Terms." ,true, "ERROR");
-        }
-    }
-    if(_PARAMS[0] == "skill")
-    {
-        std::string skill = _PARAMS[1];
-        if(atoi(skill.c_str()) > 0)
-        {
-            SkillLineEntry const *skillInfo = sSkillLineStore.LookupEntry(atoi(skill.c_str()));
-            if(skillInfo)
-            {
-                std::string name = skillInfo->name[sWorld.GetDefaultDbcLocale()];
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2Skill:\x3\x31\x30 %s \xF|\x2 SkillID:\x3\x31\x30 %s",name.c_str(), skill.c_str()), true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown SkillID." ,true, "ERROR");
-
-        }
-        else
-        {
-            uint32 counter = 0;
-            std::string skills = "\002Skill Search Results:\x3\x31\x30 ";
-            for (uint32 id = 0; id < sSkillLineStore.GetNumRows(); id++)
-            {
-                SkillLineEntry const *skillInfo = sSkillLineStore.LookupEntry(id);
-                if(skillInfo)
-                {
-                    MakeLower( _PARAMS[1] );
-                    std::string name = skillInfo->name[sWorld.GetDefaultDbcLocale()];
-                    MakeLower( name );
-                    if (name.find(_PARAMS[1]) != std::string::npos && counter < 10)
-                    {
-                        char skillid[100];
-                        sprintf(skillid, "%d", id);
-                        skills.append(name+"("+skillid+")\xF | \x3\x31\x30\x2");
-                        ++counter;
-                    }
-                }
-            }
-            if(counter == 0)
-                skills.append("No Skills Found.");
-            Send_IRCA(ChanOrPM(CD), skills, true, CD->TYPE);
-        }
-    }
-    if(_PARAMS[0] == "spell")
-    {
-        std::string spell = _PARAMS[1];
-        if(atoi(spell.c_str()) > 0)
-        {
-            SpellEntry const *spellInfo = sSpellStore.LookupEntry(atoi(spell.c_str()));
-            if(spellInfo)
-            {
-                std::string name = spellInfo->SpellName[sWorld.GetDefaultDbcLocale()];
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2Spell:\x3\x31\x30 %s \xF|\x2 SpellID:\x3\x31\x30 %s",name.c_str(), spell.c_str()), true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown SpellID." ,true, "ERROR");
-
-        }
-        else
-        {
-            uint32 counter = 0;
-            std::string spells = "\002Spell Search Results:\x3\x31\x30 ";
-            for (uint32 id = 0; id < sSpellStore.GetNumRows(); id++)
-            {
-                SpellEntry const *spellInfo = sSpellStore.LookupEntry(id);
-                if(spellInfo)
-                {
-                    MakeLower( _PARAMS[1] );
-                    std::string name = spellInfo->SpellName[sWorld.GetDefaultDbcLocale()];
-                    MakeLower( name );
-                    if (name.find(_PARAMS[1]) != std::string::npos && counter < 10)
-                    {
-                        char itemid[100];
-                        sprintf(itemid, "%d", id);
-                        spells.append(name+"("+itemid+")\xF | \x3\x31\x30\x2");
-                        ++counter;
-                    }
-                }
-            }
-            if(counter == 0)
-                spells.append("No Spells Found.");
-            Send_IRCA(ChanOrPM(CD), spells, true, CD->TYPE);
-        }
-    }
-    if(_PARAMS[0] == "tele")
-    {
-        std::string tele = _PARAMS[1];
-        if(atoi(tele.c_str()) > 0)
-        {
-            QueryResult *result = WorldDatabase.PQuery("SELECT * FROM `game_tele` WHERE id = %s", _PARAMS[1].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-
-                uint32 teleid = fields[0].GetUInt32();
-                uint32 pos_x = fields[1].GetUInt32();
-                uint32 pos_y = fields[2].GetUInt32();
-                uint32 pos_z = fields[3].GetUInt32();
-                uint32 oriet = fields[4].GetUInt32();
-                uint32 map = fields[5].GetUInt32();
-                std::string telname = fields[6].GetCppString();
-                delete result;
-
-                Send_IRCA(ChanOrPM(CD), MakeMsg("\x2Tele Name:\x3\x31\x30 %s \xF|\x2 TeleID:\x3\x31\x30 %d \xF|\x2 Coordinates:\x3\x31\x30 [X: %d, Y: %d, Z: %d, MAP: %d, Orientation: %d]", telname.c_str(), teleid, pos_x, pos_y, pos_z, map, oriet), true, CD->TYPE);
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Teleport Location ID." ,true, "ERROR");
-        }
-        else
-        {
-            QueryResult *result = WorldDatabase.PQuery("SELECT id, name FROM `game_tele` WHERE name LIKE '%%%s%%' LIMIT 10", _PARAMS[1].c_str());
-            if(result)
-            {
-                Field *fields = result->Fetch();
-                std::string teles = "\002Tele Location Search Results:\x3\x31\x30 ";
-                for (uint64 i=0; i < result->GetRowCount(); i++)
-                {
-                    std::string TeleID = fields[0].GetCppString();
-                    std::string TeleName = fields[1].GetCppString();
-                    teles.append(TeleName+"("+TeleID+")\xF | \x3\x31\x30\x2");
-                    result->NextRow();
-                }
-                Send_IRCA(ChanOrPM(CD), teles, true, CD->TYPE);
-                delete result;
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Unknown Item. I Cant Find Any Items With Those Search Terms." ,true, "ERROR");
-        }
-    }
-}
-
-void IRCCmd::Level_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, CD->PCOUNT);
-    if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-        return;
-    }
-    std::string player  = _PARAMS[0];
-    normalizePlayerName(player);
-    uint64 guid = objmgr.GetPlayerGUIDByName(player.c_str());
-    std::string s_newlevel  = _PARAMS[1];
-    uint8 i_newlvl = atoi(s_newlevel.c_str());
-    if(!guid)
-    {
-        Send_IRCA(CD->USER, "\0034[ERROR] : Player Not Found!", true, "ERROR");
-        return;
-    } else if ( i_newlvl < 1 || i_newlvl > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) )
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Level Must Be Between 1 And %i!",sConfig.GetIntDefault("MaxPlayerLevel", 70)), true, "ERROR");
-        return;
-    } else
-    {
-        Player *chr = objmgr.GetPlayer(guid);
-        int32 i_oldlvl = chr ? chr->getLevel() : Player::GetUInt32ValueFromDB(UNIT_FIELD_LEVEL,guid);
-        if(chr)
-        {
-            chr->GiveLevel(i_newlvl);
-            chr->InitTalentForLevel();
-            chr->SetUInt32Value(PLAYER_XP,0);
-            WorldPacket data;
-            ChatHandler CH(chr->GetSession());
-            if(i_oldlvl == i_newlvl)
-                CH.FillSystemMessageData(&data, "Your level progress has been reset.");
-            else
-            if(i_oldlvl < i_newlvl)
-                CH.FillSystemMessageData(&data, fmtstring("You have been leveled up (%i)",i_newlvl-i_oldlvl));
-            else
-            if(i_oldlvl > i_newlvl)
-                CH.FillSystemMessageData(&data, fmtstring("You have been leveled down (%i)",i_newlvl-i_oldlvl));
-            chr->GetSession()->SendPacket( &data );
-        }
-        else
-        {
-            Tokens values;
-            Player::LoadValuesArrayFromDB(values,guid);
-            Player::SetUInt32ValueInArray(values,UNIT_FIELD_LEVEL,i_newlvl);
-            Player::SetUInt32ValueInArray(values,PLAYER_XP,0);
-            Player::SaveValuesArrayInDB(values,guid);
-        }
-    }
-    Send_IRCA(ChanOrPM(CD), "\00313[" + _PARAMS[0]+ "] : Has Been Leveled To " + _PARAMS[1] + ". By: "+CD->USER+".", true, CD->TYPE);
-}
-
-void IRCCmd::Money_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 2);
-    if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-        return;
-    }
-    std::string player  = _PARAMS[0];
-    normalizePlayerName(player);
-    uint64 guid = objmgr.GetPlayerGUIDByName(player.c_str());
-    Player *chr = objmgr.GetPlayer(guid);
-
-    std::string s_money  = _PARAMS[1];
-    int32 money = atoi(s_money.c_str());
-    unsigned int gold = money / 10000;
-    unsigned int silv = (money % 10000) / 100;
-    unsigned int cop = (money % 10000) % 100;
-    char tempgold [100];
-    sprintf(tempgold, "\x2\x3\x30\x37%ug \x3\x31\x34%us \x3\x30\x35%uc\xF", gold, silv, cop);
-    if(!guid)
-    {
-        Send_IRCA(CD->USER, "\0034[ERROR] : Player Not Found!", true, "ERROR");
-        return;
-    }
-    else
-    {
-        Player *chr = objmgr.GetPlayer(guid);
-        uint32 moneyuser = 0;
-        if(chr)
-            moneyuser = chr->GetMoney();
-        else {
-        CharacterDatabase.escape_string(player);
-        std::string sqlquery = "SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(data, ' ' , 1462), ' ' , -1) AS `gold` FROM `characters` WHERE `name` = '"+player+"';";
-        QueryResult *result = CharacterDatabase.Query(sqlquery.c_str());
-            Field *fields = result->Fetch();
-            moneyuser = fields[0].GetInt32();
-            delete result;
-        }
-            int32 addmoney = money;
-            int32 newmoney = moneyuser + addmoney;
-            char s_newmoney[255];
-            sprintf(s_newmoney,"%d",newmoney);
-            if(addmoney < 0)
-            {
-                sLog.outDetail("USER1: %i, ADD: %i, DIF: %i\\n", moneyuser, addmoney, newmoney);
-                if(newmoney <= 0 )
-                {
-                    Send_IRCA(ChanOrPM(CD), "\00313["+player+"] : Has Had All Money Taken By: "+CD->USER.c_str()+".", true, CD->TYPE);
-                    if(chr)
-                    {
-                        chr->SetMoney(0);
-                        Send_Player(chr, MakeMsg("You Have Been Liquidated By: %s. Total Money Is Now 0.", CD->USER.c_str()));
-                    }
-                    else
-                        CharacterDatabase.PExecute("UPDATE `characters` SET data=concat(substring_index(data,' ',1462-1),' ','%u',' ', right(data,length(data)-length(substring_index(data,' ',1462))-1) ) where guid='%u'",newmoney, guid );
-                }
-                else
-                {
-                    Send_IRCA(ChanOrPM(CD), "\00313["+player+"] : Has Had ("+s_money+"\00313) Taken From Them By: "+CD->USER.c_str()+".", true, CD->TYPE);
-                    if(chr)
-                    {
-                        chr->SetMoney( newmoney );
-                        Send_Player(chr, MakeMsg("You Have Had %s Copper Taken From You By: %s.", _PARAMS[1].c_str(), CD->USER.c_str()));
-                    }
-                    else
-                        CharacterDatabase.PExecute("UPDATE `characters` SET data=concat(substring_index(data,' ',1462-1),' ','%u',' ', right(data,length(data)-length(substring_index(data,' ',1462))-1) ) where guid='%u'",newmoney, guid );
-                }
-            }
-            else
-            {
-                Send_IRCA(ChanOrPM(CD), "\00313["+player+"] : Has Been Given ("+tempgold+"\00313) From: "+CD->USER.c_str()+".", true, CD->TYPE);
-                if(chr)
-                {
-                    chr->ModifyMoney( addmoney );
-                    Send_Player(chr, MakeMsg("You Have Been Given %s Copper. From: %s.", _PARAMS[1].c_str(), CD->USER.c_str()));
-                }
-                else
-                    CharacterDatabase.PExecute("UPDATE `characters` SET data=concat(substring_index(data,' ',1462-1),' ','%u',' ', right(data,length(data)-length(substring_index(data,' ',1462))-1) ) where guid='%u'",newmoney, guid );
-            }
-    }
-}
-
-void IRCCmd::Mute_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 3);
-    if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-        return;
-    }
-    normalizePlayerName(_PARAMS[0]);
-    uint64 guid = objmgr.GetPlayerGUIDByName(_PARAMS[0]);
-    if(guid)
-    {
-        if(_PARAMS[1] == "release")
-        {
-            Player* plr = objmgr.GetPlayer(guid);
-            uint32 account_id = 0;
-            account_id = objmgr.GetPlayerAccountIdByGUID(guid);
-            loginDatabase.PExecute("UPDATE `account` SET `mutetime` = '0' WHERE `id` = '%u'", account_id );
-            Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Has Been UnMuted By: "+CD->USER+"." , true, CD->TYPE);
-            if(plr)
-            {
-                plr->GetSession()->m_muteTime = 0;
-                Send_Player(plr, MakeMsg("You Have Been UnMuted By: %s.", CD->USER.c_str()));
-            }
-        }
-        else
-        {
-            if(_PARAMS[2] == "")
-                _PARAMS[2] = "No Reason Given";
-            Player* plr = objmgr.GetPlayer(guid);
-            time_t mutetime = time(NULL) + atoi(_PARAMS[1].c_str())*60;
-            uint32 account_id = 0;
-            account_id = objmgr.GetPlayerAccountIdByGUID(guid);
-            if(plr) plr->GetSession()->m_muteTime = mutetime;
-            loginDatabase.PExecute("UPDATE `account` SET `mutetime` = " I64FMTD " WHERE `id` = '%u'",uint64(mutetime), account_id );
-            Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Has Been Muted By: "+CD->USER+". For: "+_PARAMS[1]+" Minutes. Reason: "+_PARAMS[2] , true, CD->TYPE);
-            if(plr) Send_Player(plr, MakeMsg("You Have Been Muted By: %s. For: %s Minutes. Reason: %s", CD->USER.c_str(), _PARAMS[1].c_str(), _PARAMS[2].c_str()));
-        }
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : Player Does Not Exist!", true, "ERROR");
-}
-
-void IRCCmd::Online_Players(_CDATA *CD)
-{
-        sIRC.Script_Lock[MCS_Players_Online] = true;
-        ZThread::Thread script(new mcs_OnlinePlayers(CD));
-}
-
-void IRCCmd::PM_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 2);
-    if (Player* plr = GetPlayer(_PARAMS[0]))
-    {
-        if(plr->isAcceptWhispers())
-        {
-            std::string sMsg = MakeMsg("|cffFE87FD[<IRC>%s] Whispers: %s|r", CD->USER.c_str(), _PARAMS[1].c_str());
-            WorldPacket data(SMSG_MESSAGECHAT, 200);
-            data << (uint8)CHAT_MSG_SYSTEM;
-            data << (uint32)LANG_UNIVERSAL;
-            data << (uint64)plr->GetGUID();
-            data << (uint32)0;
-            data << (uint64)plr->GetGUID();
-            data << (uint32)(sMsg.length()+1);
-            data << sMsg;
-            data << (uint8)0;
-            plr->GetSession()->SendPacket(&data);
-            plr->SendPlaySound(3081, true);
-            Send_IRCA(ChanOrPM(CD), "\00313To ["+_PARAMS[0]+"] : "+_PARAMS[1]+".", true, CD->TYPE);
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : Is Not Accepting Private Messages!", true, "ERROR");
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : Player not online!", true, "ERROR");
-}
-
-void IRCCmd::Revive_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, CD->PCOUNT);
-    if (Player* plr = GetPlayer(_PARAMS[0]))
-    {
-        if(plr->isDead())
-        {
-            plr->ResurrectPlayer(0.5f);
-            plr->SpawnCorpseBones();
-            plr->SaveToDB();
-            sIRC.Send_IRC_Channel(ChanOrPM(CD), " \00313["+_PARAMS[0]+"] : Has Been Revived By: " + CD->USER, true, CD->TYPE);
-            Send_Player(plr, MakeMsg("You Have Been Revived By: %s.", CD->USER.c_str()));
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : "+_PARAMS[0]+" Is Not Dead!", true, "ERROR");
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : "+_PARAMS[0]+" Is Not Online!", true, "ERROR");
-}
-
-void IRCCmd::Saveall_Player(_CDATA *CD)
-{
-    ObjectAccessor::Instance().SaveAllPlayers();
-    Send_IRCA(ChanOrPM(CD), "\00313["+CD->USER+"] : Has Saved All Players!", true, CD->TYPE);
-}
-
-void IRCCmd::Shutdown_Mangos(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 1);
-    if(_PARAMS[0] == "cancel")
-    {
-        sWorld.ShutdownCancel();
-        Send_IRCA(ChanOrPM(CD), "\0034Server Shutdown Has Been Cancelled.", true, CD->TYPE);
-    }
-
-    int32 i_time = atoi(_PARAMS[0].c_str());
-    if (i_time <= 0 && _PARAMS[0]!="0")
-    {
-        Send_IRCA(ChanOrPM(CD), "\00313["+CD->USER+"] : Please Enter A Number! And No Negative Numbers! "+_PARAMS[0]+" Seconds!?", true, CD->TYPE);
-        return;
-    }
-    if (i_time > 1) Send_IRCA(ChanOrPM(CD), "\00313["+CD->USER+"] : Has Requested Server To Be Shut Down In "+_PARAMS[0]+" Seconds!", true, CD->TYPE);
-    sWorld.ShutdownServ(i_time);
-    Delay(i_time*1000);
-    Send_IRCA(ChanOrPM(CD), "\0034Server Will Now Shut Down.. Good Bye!", true, CD->TYPE);
-    sIRC.Active = false;
-    sIRC.ResetIRC();
-}
-
-void IRCCmd::Spell_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 3);
-    if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-        return;
-    }
-    uint32 spell         = atoi(_PARAMS[2].c_str());
-    SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell);
-    if (Player* plr = GetPlayer(_PARAMS[0]))
-    {
-        if(spellInfo)
-        {
-            std::string name = spellInfo->SpellName[sWorld.GetDefaultDbcLocale()];
-            if(_PARAMS[1] == "cast")
-            {
-                plr->CastSpell(plr, spell, true);
-                Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Has Had Spell "+name+" Casted On Them.", true, CD->TYPE);
-            }
-            if(_PARAMS[1] == "learn")
-            {
-                plr->learnSpell(spell);
-                Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Has Learned Spell "+name+".", true, CD->TYPE);
-            }
-            if(_PARAMS[1] == "unlearn")
-            {
-                plr->removeSpell(spell);
-                Send_IRCA(ChanOrPM(CD), "\00313["+_PARAMS[0]+"] : Has Unlearned Spell "+name+".", true, CD->TYPE);
-            }
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : Incorrect Spell ID!", true, "ERROR");
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : Player Not Online!", true, "ERROR");
-}
-
-void IRCCmd::Sysmsg_Server(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, CD->PCOUNT);
-	std::string ircchan = "#";
-	ircchan += sIRC._irc_chan[sIRC.anchn].c_str();
-	if(_PARAMS[0] == "a")
-    {
-        //std::string str = "|cffff0000[System Message]:|r" + _PARAMS[1];
-        std::string ancmsg = MakeMsg("\00304,08\037/!\\\037\017\00304 System Message \00304,08\037/!\\\037\017 %s",_PARAMS[1].c_str());
-        sWorld.SendWorldText(LANG_SYSTEMMESSAGE, _PARAMS[1].c_str());
-		sIRC.Send_IRC_Channel(ircchan, ancmsg, true);
-    }
-    else if (_PARAMS[0] == "e")
-    {
-        std::string str = "|cffff0000[Server Event]:|r " + _PARAMS[1];
-        std::string notstr = "[Server Event]: " + _PARAMS[1];
-        std::string notmsg = MakeMsg("\00304,08\037/!\\\037\017\00304 Server Event \00304,08\037/!\\\037\017 %s",_PARAMS[1].c_str());
-        WorldPacket data(SMSG_NOTIFICATION, (notstr.size()+1));
-        data << notstr;
-        WorldPacket data2(SMSG_PLAY_SOUND,32);
-        data2 << (uint32)1400;
-        sWorld.SendGlobalMessage(&data2);
-        sWorld.SendGlobalMessage(&data);
-        sWorld.SendWorldText(LANG_EVENTMESSAGE, _PARAMS[1].c_str());
-		sIRC.Send_IRC_Channel(ircchan, notmsg, true);
-    }
-    else if (_PARAMS[0] == "n")
-    {
-        std::string str = "Global notify: " + _PARAMS[1];
-        std::string notmsg = MakeMsg("\00304,08\037/!\\\037\017\00304 Global Notify \00304,08\037/!\\\037\017 %s",_PARAMS[1].c_str());
-        WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
-        data << str;
-        sWorld.SendGlobalMessage(&data);
-		sIRC.Send_IRC_Channel(ircchan, notmsg, true);
-    }
-    else if (_PARAMS[0] == "add")
-    {
-        sIRC.Send_IRC_Channel(ircchan, "This command is currently borken.", true);
-	// Commented for now -- timer broken
-        //WorldDatabase.PExecute( "INSERT INTO IRC_AutoAnnounce (message, addedby) VALUES ('%s', '%s')", _PARAMS[1].c_str(), CD->USER.c_str());
-        //std::string str = "|cffff0000[Automatic]:|r" + _PARAMS[1];
-        //std::string ancmsg = MakeMsg("\00304,08\037/!\\\037\017\00304 Automatic System Message \00304,08\037/!\\\037\017 %s",_PARAMS[1].c_str());
-        //sWorld.SendWorldText(LANG_AUTO_ANN, _PARAMS[1].c_str());
-        //sIRC.Send_IRC_Channel(ircchan, ancmsg, true);
-    }
-    else if (_PARAMS[0] == "del")
-    {
-        WorldDatabase.PExecute( "DELETE FROM IRC_AutoAnnounce WHERE id = %s", _PARAMS[1].c_str());
-        Send_IRCA(ChanOrPM(CD), MakeMsg("Deleted Automatic Announcement Message ID: %s", _PARAMS[1].c_str()), true, CD->TYPE);
-    }
-    else if (_PARAMS[0] == "list")
-    {
-        QueryResult *result = WorldDatabase.PQuery("SELECT * FROM IRC_AutoAnnounce LIMIT 5;", _PARAMS[1].c_str());
-        if(result)
-        {
-            Field *fields = result->Fetch();
-            for (uint64 i=0; i < result->GetRowCount(); i++)
-            {
-                std::string id = fields[0].GetCppString();
-                std::string message = fields[1].GetCppString();
-                std::string addedby = fields[2].GetCppString();
-                Send_IRCA(ChanOrPM(CD), MakeMsg("ID: %s - Added By: %s - Message: %s", id.c_str(), addedby.c_str(), message.c_str()), true, CD->TYPE);
-                result->NextRow();
-            }
-            delete result;
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : No Auto Announce Messages Are In The Database.", true, "ERROR");
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : Please Use (a-Announce)(n-Notify)(e-Event) As Second Parameter!", true, "ERROR");
-}
-
-void IRCCmd::Tele_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 4);
-    if(AcctLevel(_PARAMS[0]) > GetLevel(CD->USER) && (sIRC.BOTMASK & 512)!= 0)
-    {
-        Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : Nice Try, This Player Has A Higher GM Level Than You! [ %i ]", AcctLevel(_PARAMS[0])), true, "ERROR");
-        return;
-    }
-    bool DoTeleport = false;
-    float pX, pY, pZ, pO = 0;
-    uint32 mapid = 0;
-    std::string rMsg = " \0034[ERROR] : Teleport Failed!";
-    std::string wMsg = "Invalid Tele Location";
-    Player* plr = GetPlayer(_PARAMS[0]);
-    if(plr)
-    {
-        if(plr->isInFlight() || plr->isInCombat())
-        {
-            Send_IRCA(CD->USER, MakeMsg("\0034[ERROR] : %s Is Busy And Cannot Be Teleported! They Could Be In Combat, Or Flying.",_PARAMS[0].c_str()), true, "ERROR");
-            return;
-        }
-    }
-    if(_PARAMS[1] == "l" || _PARAMS[1].size() > 2)
-    {
-        if(_PARAMS[1].size() > 1)
-            _PARAMS[2] = _PARAMS[1];
-        WorldDatabase.escape_string(_PARAMS[2]);
-        QueryResult *result = WorldDatabase.PQuery("SELECT position_x, position_y, position_z, orientation, map FROM game_tele WHERE name='%s';", _PARAMS[2].c_str());
-        if (result)
-        {
-            Field *fields = result->Fetch();
-            pX = fields[0].GetFloat();
-            pY = fields[1].GetFloat();
-            pZ = fields[2].GetFloat();
-            pO = fields[3].GetFloat();
-            mapid = fields[4].GetUInt16();
-            delete result;
-            rMsg = MakeMsg(" \00313[%s] : Teleported To %s! By: %s.",
-                _PARAMS[0].c_str(),
-                _PARAMS[2].c_str(),
-                CD->USER.c_str());
-            wMsg = MakeMsg("You Have Been Teleported To %s By: %s.",
-                _PARAMS[2].c_str(),
-                CD->USER.c_str());
-            DoTeleport = true;
-        }
-        else
-        {
-            WorldDatabase.escape_string(_PARAMS[2]);
-            QueryResult *result = WorldDatabase.PQuery("SELECT name FROM game_tele WHERE name LIKE '%%%s%%' LIMIT 7;", _PARAMS[2].c_str());
-            if (result)
-            {
-                std::string telename = "<> ";
-                for (uint64 i=0; i < result->GetRowCount(); i++)
-                {
-                    Field *fields = result->Fetch();
-                    telename.append(fields[0].GetCppString());
-                    result->NextRow();
-                    telename.append(" <> ");
-                }
-                delete result;
-                Send_IRCA(CD->USER, "I Cannot Find Location: "+_PARAMS[2]+" . Perhaps One Of These Will Work For You.", true, "ERROR");
-                Send_IRCA(CD->USER, telename, true, "ERROR");
-                return;
-            }
-            else
-                Send_IRCA(CD->USER, "\0034[ERROR] : Location Not Found! Nothing Even Close Found!", true, "ERROR");
-                return;
-        }
-    }
-    else if(_PARAMS[1] == "c")
-    {
-        std::string* _PARAMSA = getArray(_PARAMS[2], 4);
-        pX = atof(_PARAMSA[1].c_str());
-        pY = atof(_PARAMSA[2].c_str());
-        pZ = atof(_PARAMSA[3].c_str());
-        mapid = atoi(_PARAMSA[0].c_str());
-        rMsg = MakeMsg(" \00313[%s] : Teleported To Map: %s. Position: X(%s) Y(%s) Z(%s)! By: %s.",
-            _PARAMS[0].c_str(),
-            _PARAMSA[0].c_str(),
-            _PARAMSA[1].c_str(),
-            _PARAMSA[2].c_str(),
-            _PARAMSA[3].c_str(),
-            CD->USER.c_str());
-        wMsg = MakeMsg("You Have Been Teleported To Map: %s. Position: X(%s) Y(%s) Z(%s)! By: %s.",
-            _PARAMSA[0].c_str(),
-            _PARAMSA[1].c_str(),
-            _PARAMSA[2].c_str(),
-            _PARAMSA[3].c_str(),
-            CD->USER.c_str());
-        DoTeleport = true;
-    }
-    else if(_PARAMS[1] == "r")
-    {
-        if(plr)
-        {
-            pX = plr->m_recallX;
-            pY = plr->m_recallY;
-            pZ = plr->m_recallZ;
-            pO = plr->m_recallO;
-            mapid = plr->m_recallMap;
-            rMsg = MakeMsg(" \00313[%s] : Has Been Recalled To Their Previous Location.",
-                _PARAMS[0].c_str());
-            wMsg = MakeMsg("You Have Been Recalled To Your Previous Location. By: %s",
-                CD->USER.c_str());
-            DoTeleport = true;
-        }
-        else
-        {
-            Send_IRCA(CD->USER, MakeMsg("\00313[%s] : Cannot Be Recalled, They Are Not Online.", _PARAMS[0].c_str()), true, "ERROR");
-            return;
-        }
-
-    }
-    else if(_PARAMS[1] == "to")
-    {
-        Player* plr2 = GetPlayer(_PARAMS[2]);
-        if(plr2)
-        {
-            plr2->GetContactPoint(plr, pX, pY, pZ);
-            mapid = plr2->GetMapId();
-        }
-        else
-        {
-            if(uint64 guid = objmgr.GetPlayerGUIDByName(_PARAMS[2].c_str()))
-            {
-                bool in_flight;
-                Player::LoadPositionFromDB(mapid, pX, pY, pZ, pO, in_flight, guid);
-            }
-            else
-            {
-                Send_IRCA(CD->USER, "\0034[ERROR] : Second Player Not Found!", true, "ERROR");
-                return;
-            }
-        }
-        rMsg = MakeMsg(" \00313[%s] : Teleported To Player: [%s] By: %s.",
-            _PARAMS[0].c_str(),
-            _PARAMS[2].c_str(),
-            CD->USER.c_str());
-        wMsg = MakeMsg("You Are Being Teleported To: %s. By: %s.",
-            _PARAMS[2].c_str(),
-            CD->USER.c_str());
-        DoTeleport = true;
-    }
-    if(DoTeleport)
-    {
-        if(MapManager::IsValidMapCoord(mapid, pX ,pY))
-        {
-            //if player is online teleport them in real time, if not set the DB to our coordinates.
-            if(plr)
-            {
-                plr->SaveRecallPosition();
-                plr->TeleportTo(mapid, pX, pY, pZ, pO);
-                sIRC.Send_IRC_Channel(ChanOrPM(CD), rMsg, true, CD->TYPE);
-                Send_Player(plr, wMsg);
-            }
-            else
-            {
-                uint64 guid = objmgr.GetPlayerGUIDByName(_PARAMS[0]);
-                Player::SavePositionInDB(mapid,pX,pY,pZ,pO,MapManager::Instance().GetZoneId(mapid,pX,pY),guid);
-                sIRC.Send_IRC_Channel(ChanOrPM(CD), rMsg + " \0034*Offline Tele.* ", true, CD->TYPE);
-            }
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : Invalid Location!", true, "ERROR");
-    }
-    else
-        Send_IRCA(CD->USER, "\0034[ERROR] : Invalid Paramaters, Please Try Again [ "+sIRC._cmd_prefx+"help tele ] For More Information. ", true, "ERROR");
-}
-
-void IRCCmd::Top_Player(_CDATA *CD)
-{
-    std::string* _PARAMS = getArray(CD->PARAMS, 2);
-    uint32 limitr = 10;
-    if(atoi(_PARAMS[1].c_str()) > 0 && GetLevel(CD->USER) >= sIRC._op_gm_lev)
-        limitr = atoi(_PARAMS[1].c_str());
-    if(_PARAMS[0] == "accttime")
-    {
-        QueryResult *result = CharacterDatabase.PQuery("SELECT account, name, (SUM(totaltime)) AS combinetime FROM characters GROUP BY account ORDER BY combinetime DESC LIMIT 0, %d ", limitr);
-        if(result)
-        {
-            Field *fields = result->Fetch();
-            std::string tptime = MakeMsg("\x2 Top%d Accounts By Played Time:\x3\x31\x30 ", limitr);
-            for (uint64 i=0; i < result->GetRowCount(); i++)
-            {
-                uint32 account = fields[0].GetUInt32();
-                std::string PlName = GetAcctNameFromID(account);
-                std::string Time = SecToDay(fields[2].GetCppString());
-                uint32 rank = i+1;
-                tptime.append(MakeMsg("[%u]%s %s \xF| \x3\x31\x30\x2", rank, PlName.c_str(), Time.c_str()));
-                result->NextRow();
-            }
-            delete result;
-            Send_IRCA(ChanOrPM(CD), tptime, true, CD->TYPE);
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : No Accounts Returned." ,true, "ERROR");
-    }
-    if(_PARAMS[0] == "chartime")
-    {
-        QueryResult *result = CharacterDatabase.PQuery("SELECT name, totaltime FROM characters ORDER BY totaltime DESC LIMIT 0, %d ", limitr);
-        if(result)
-        {
-            Field *fields = result->Fetch();
-            std::string tptime = MakeMsg("\x2 Top%d Characters By Played Time:\x3\x31\x30 ", limitr);
-            for (uint64 i=0; i < result->GetRowCount(); i++)
-            {
-                std::string Name = fields[0].GetCppString();
-                std::string Time = SecToDay(fields[1].GetCppString());
-                uint32 rank = i+1;
-                tptime.append(MakeMsg("[%u]%s %s \xF| \x3\x31\x30\x2", rank, Name.c_str(), Time.c_str()));
-                result->NextRow();
-            }
-            delete result;
-            Send_IRCA(ChanOrPM(CD), tptime, true, CD->TYPE);
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : No Characters Returned." ,true, "ERROR");
-    }
-    if(_PARAMS[0] == "money")
-    {
-        QueryResult *result = CharacterDatabase.PQuery("SELECT name, CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(data, ' ', 1462), ' ', -1) AS UNSIGNED) AS money FROM characters ORDER BY money DESC LIMIT 0, %d ", limitr);
-        if(result)
-        {
-            Field *fields = result->Fetch();
-            std::string tptime = MakeMsg("\x2 Top%d Characters By Money:\x3\x31\x30 ", limitr);
-            for (uint64 i=0; i < result->GetRowCount(); i++)
-            {
-                std::string Name = fields[0].GetCppString();
-                unsigned int money = fields[1].GetInt32();
-
-                uint32 rank = i+1;
-
-                unsigned int gold = money / 10000;
-                unsigned int silv = (money % 10000) / 100;
-                unsigned int cop = (money % 10000) % 100;
-                char tempgold [100];
-                sprintf(tempgold, "\x2\x3\x30\x37%ug \x3\x31\x34%us \x3\x30\x35%uc\xF", gold, silv, cop);
-
-                tptime.append(MakeMsg("[%u]%s %s \xF| \x3\x31\x30\x2", rank, Name.c_str(), tempgold));
-                result->NextRow();
-            }
-            delete result;
-            Send_IRCA(ChanOrPM(CD), tptime, true, CD->TYPE);
-        }
-        else
-            Send_IRCA(CD->USER, "\0034[ERROR] : No Characters Returned." ,true, "ERROR");
-    }
-
-}
-
-void IRCCmd::Who_Logged(_CDATA *CD)
-{
-    std::string OPS = "";
-    for(std::list<_client*>::iterator i=_CLIENTS.begin(); i!=_CLIENTS.end();i++)
-    {
-        OPS.append(MakeMsg(" \002[GM:%d IRC: %s - WoW: %s]\002 ", (*i)->GMLevel, (*i)->Name.c_str(), (*i)->UName.c_str()));
-    }
-    Send_IRCA(ChanOrPM(CD), OPS, true, CD->TYPE);
-}
Index: trunk/src/game/MCS_OnlinePlayers.cpp
===================================================================
--- trunk/src/game/MCS_OnlinePlayers.cpp (revision 39)
+++  (revision )
@@ -1,84 +1,0 @@
-/*
- * MangChat By |Death| And Cybrax
- *
- * This Program Is Free Software; You Can Redistribute It And/Or Modify It Under The Terms 
- * Of The GNU General Public License
- * Written and Developed by Cybrax. cybraxvd@gmail.com
- * |Death| <death@hell360.net>, Lice <lice@yeuxverts.net>, Dj_baby & Sanaell, Tase
- * With Help And Support From The MaNGOS Project Community.
- * PLEASE RETAIN THE COPYRIGHT OF THE AUTHORS.
- */
-#include "MCS_OnlinePlayers.h"
-
-#include "MapManager.h"
-#include "ObjectMgr.h"
-#include "Config/ConfigEnv.h"
-
-mcs_OnlinePlayers::mcs_OnlinePlayers() { CD = NULL; }
-
-mcs_OnlinePlayers::mcs_OnlinePlayers(_CDATA *_CD)
-{
-    //create a new instance of data struct and copy its data
-    CD = new _CDATA();
-    CD->CMD = _CD->CMD;
-    CD->FROM = _CD->FROM;
-    CD->PARAMS = _CD->PARAMS;
-    CD->PCOUNT = _CD->PCOUNT;
-    CD->USER = _CD->USER;
-	CD->TYPE = _CD->TYPE;
-}
-
-mcs_OnlinePlayers::~mcs_OnlinePlayers()
-{
-    if(CD)
-        delete CD;
-}
-
-void mcs_OnlinePlayers::run()
-{
-    int OnlineCount = 0;
-    std::string IRCOut = "";
-    HashMapHolder<Player>::MapType& m = ObjectAccessor::Instance().GetPlayers();
-    for(HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
-    {
-        if (itr->second && itr->second->GetSession()->GetPlayer() && itr->second->GetSession()->GetPlayer()->IsInWorld())
-        {
-            OnlineCount++;
-            Player *plr = itr->second->GetSession()->GetPlayer();
-            std::string ChatTag = " ";
-            switch(plr->GetSession()->GetSecurity())
-            {
-                  case 0: ChatTag.append("");break;
-                  case 1: ChatTag.append("\0037"+sIRC.ojGM1);break;
-                  case 2: ChatTag.append("\0037"+sIRC.ojGM2);break;
-                  case 3: ChatTag.append("\0037"+sIRC.ojGM3);break;
-                  case 4: ChatTag.append("\0037"+sIRC.ojGM4);break;
-                  case 5: ChatTag.append("\0037"+sIRC.ojGM5);break;
-            }
-            if(plr->isAFK())
-                ChatTag.append("\002\0037<AFK>\003\002");
-            else if(plr->isDND())
-                ChatTag.append("\002\0037<DND>\003\002");
-            switch (plr->GetTeam())
-            {
-                case 67:ChatTag.append("\0034");break;      //horde
-                case 469:ChatTag.append("\00312");break;    //alliance
-            }
-
-            IRCOut.append(IRCCmd::MakeMsg("%s\002%s\003\017\002(%d)\002\017", ChatTag.c_str(), plr->GetName(), plr->getLevel()));
-
-            // after XX players have been added to the string
-            // output to irc and reset for the next XX
-            if(OnlineCount % sIRC.onlrslt == 0)
-            {
-                sIRC.Send_IRC_Channel(IRCCmd::ChanOrPM(CD), IRCCmd::MakeMsg("\002 %s", IRCOut.c_str()), true, CD->TYPE.c_str());
-                IRCOut = "";
-                ZThread::Thread::sleep(1000);
-            }
-        }
-    }
-    // Remainder in IRCOUT && Total plyersonline
-    sIRC.Send_IRC_Channel(IRCCmd::ChanOrPM(CD), IRCCmd::MakeMsg("\002Players Online(%d):\017 %s", OnlineCount, IRCOut.c_str()), true, CD->TYPE);
-
-    sIRC.Script_Lock[MCS_Players_Online] = false;
-}
Index: trunk/src/game/IRCConf.h
===================================================================
--- trunk/src/game/IRCConf.h (revision 39)
+++  (revision )
@@ -1,16 +1,0 @@
-#ifndef MC_CONFIG_H
-#define MC_CONFIG_H
-
-#include "../framework/Platform/CompilerDefs.h"
-
-// Format is YYYYMMDDRR where RR is the change in the conf file
-// for that day.
-#define MANGCHAT_CONF_VERSION    2008011901
-
-#if PLATFORM == PLATFORM_WINDOWS
-  #define _MANGCHAT_CONFIG  "trinitycore.conf"
-#else
-  #define _MANGCHAT_CONFIG  "@sysconfdir@/trinitycore.conf"
-#endif
-
-#endif
Index: trunk/src/game/IRCCmd.h
===================================================================
--- trunk/src/game/IRCCmd.h (revision 39)
+++  (revision )
@@ -1,117 +1,0 @@
-#ifndef _IRC_CMD_H
-#define _IRC_CMD_H
-
-#define MAX_CLIENTS 50
-#include "Common.h"
-#include "Player.h"
-#include "ObjectAccessor.h"
-
-struct ChannelUser
-{
-    int UserType;
-    std::string Name;
-    std::string UName;
-    int UserLevel;
-};
-
-struct _client
-{
-    bool        LoggedIn;
-    std::string Name;
-    std::string UName;
-    int         GMLevel;
-};
-struct _CDATA
-{
-    std::string CMD;
-    std::string USER;
-    std::string FROM;
-    std::string PARAMS;
-    std::string TYPE;
-    int PCOUNT;
-};
-enum APVERR
-{
-    E_OK,
-    E_SIZE,
-    E_AUTH,
-    E_IVALID,
-};
-enum ESOUNDS
-{
-    S_ENTERWORLD    = 602,
-    S_QUESTFAILED   = 847,
-    S_INVITE        = 880,
-    S_LEVELUP       = 888,
-    S_COINSOUND     = 895,
-    S_WHISPER       = 3081,
-    S_STEALTH       = 3325,
-};
-class IRCCmd
-{
-    public:
-        IRCCmd();
-        ~IRCCmd();
-        
-        void    Handle_Logout(_CDATA *CD);
-        bool    IsLoggedIn(std::string USER);
-        bool    IsValid(std::string USER, std::string FROM, std::string CHAT, std::string TYPE);
-        bool    AcctIsLoggedIn(std::string USER);
-        _client *GetClient(std::string cname);
-
-    public:
-        static std::string MakeMsg(const char *sLine, ... );
-        static std::string ChanOrPM(_CDATA *CD);
-        int AcctLevel(std::string plnme);
-        int GetLevel(std::string sName);
-        std::string MakeUpper(std::string Channel);
-        std::string  AcctIsBanned(std::string ACCT);
-        std::list<_client*> _CLIENTS;
-        Player* GetPlayer(std::string WHO);
-
-    private:
-        // MangChat Commands
-        void    Handle_Login(_CDATA *CD);
-        void    Account_Player(_CDATA *CD);
-        void    Ban_Player(_CDATA *CD);
-        void    Chan_Control(_CDATA *CD);
-        void    Char_Player(_CDATA *CD);
-        void    Fun_Player(_CDATA *CD);
-        void    Help_IRC(_CDATA *CD);
-        void    Item_Player(_CDATA *CD);
-        void    Inchan_Server(_CDATA *CD);
-        void    Info_Server(_CDATA *CD);
-        void    Jail_Player(_CDATA *CD);
-        void    Kick_Player(_CDATA *CD);
-        void    Kill_Player(_CDATA *CD);
-        void    Level_Player(_CDATA *CD);
-        void    Lookup_Player(_CDATA *CD);
-        void    Money_Player(_CDATA *CD);
-        void    Mute_Player(_CDATA *CD);
-        void    Online_Players(_CDATA *CD);
-        void    PM_Player(_CDATA *CD);
-        void    Revive_Player(_CDATA *CD);
-        void    Saveall_Player(_CDATA *CD);
-        void    Shutdown_Mangos(_CDATA *CD);
-        void    Spell_Player(_CDATA *CD);
-        void    Sysmsg_Server(_CDATA *CD);
-        void    Tele_Player(_CDATA *CD);
-        void    Top_Player(_CDATA *CD);
-        void    Who_Logged(_CDATA *CD);
-        bool    CanUse(std::string USER, int nLevel);
-        bool    ValidParams(std::string PARAMS, int nCount = 1);
-        bool    ParamsValid(_CDATA *CD, int pCnt);
-        int     ParamsValid(_CDATA *CD, int pCnt, int rLev);
-        std::string GetAccName(std::string sName);
-        std::string GetNameFromAcct(std::string sName);
-        std::string GetAcctNameFromID(uint32 acctid);
-        std::string GetIPFromPlayer(std::string player);
-        std::string SecToDay(std::string secons);
-        int GetAcctIDFromName(std::string sName);
-        std::string* getArray(std::string PARAMS, int nCount = 1);
-};
-inline void MakeLower(std::string& str)
-{
-    std::transform( str.begin(), str.end(), str.begin(), ::tolower );
-}
-#endif
Index: trunk/src/game/IRCConf.cpp
===================================================================
--- trunk/src/game/IRCConf.cpp (revision 41)
+++  (revision )
@@ -1,172 +1,0 @@
-/*
- * MangChat By |Death| And Cybrax
- *
- * This Program Is Free Software; You Can Redistribute It And/Or Modify It Under The Terms 
- * Of The GNU General Public License
- * Written and Developed by Cybrax. cybraxvd@gmail.com
- * |Death| <death@hell360.net>, Lice <lice@yeuxverts.net>, Dj_baby & Sanaell, Tase
- * With Help And Support From The MaNGOS Project Community.
- * PLEASE RETAIN THE COPYRIGHT OF THE AUTHORS.
- */
-#include "IRCClient.h"
-#include "IRCCmd.h"
-#include "../shared/Config/Config.h"
-#include "IRCConf.h"
-Config MCConfig;
-void IRCClient::SetCfg(char const* cfgfile)
-{
-    sIRC.CfgFile = cfgfile;
-}
-bool IRCClient::LoadConfig(char const* cfgfile)
-{
-    if (!MCConfig.SetSource(cfgfile))
-        sLog.outString("*** MangChat: Unable to open configuration file, All default options are being used.");
-	else sLog.outString("*** MangChat: Found the configuration file, %s", cfgfile);
-
-	int ConfCnt = 0;
-    sIRC._chan_count = 0;
-    if(MCConfig.GetIntDefault("irc.active", 0) == 1)
-        sIRC.Active = true;
-    else
-        sIRC.Active = false;
-    sIRC._Host = MCConfig.GetStringDefault("irc.host", "irc.rizon.net");
-    if(sIRC._Host.size() > 0)
-        ConfCnt++;
-    sIRC._Mver = MCConfig.GetStringDefault("irc.mver", "Version 1.6.5");
-	sIRC._Port = MCConfig.GetIntDefault("irc.port", 6667);
-    sIRC._User = MCConfig.GetStringDefault("irc.user", "TC");
-    sIRC._Pass = MCConfig.GetStringDefault("irc.pass", "");
-    sIRC._Nick = MCConfig.GetStringDefault("irc.nick", "TrinityCoreBot");
-    sIRC._Auth = MCConfig.GetIntDefault("irc.auth", 0);
-	sIRC._Auth_Nick = MCConfig.GetStringDefault("irc.auth.nick", "TrinityCoreBot");
-    sIRC._ICC = MCConfig.GetStringDefault("irc.icc", "001");
-    sIRC._defchan = MCConfig.GetStringDefault("irc.defchan", "lobby");
-    sIRC._ldefc = MCConfig.GetIntDefault("irc.ldef", 0);
-    sIRC._wct = MCConfig.GetIntDefault("irc.wct", 30000);
-   	sIRC.ajoin = MCConfig.GetIntDefault("irc.ajoin", 1);
-    sIRC.ajchan = MCConfig.GetStringDefault("irc.ajchan", "World");
-    sIRC.onlrslt = MCConfig.GetIntDefault("irc.online.result", 10);
-    sIRC.BOTMASK = MCConfig.GetIntDefault("Botmask", 0);
-    sIRC.logfile = MCConfig.GetStringDefault("irc.logfile.prefix", "irc_");
-	for(int i = 1; i < MAX_CONF_CHANNELS;i++)
-    {
-        std::ostringstream ss;
-        ss << i;
-        std::string ci = "irc.chan_" + ss.str();
-        std::string t_chan = MCConfig.GetStringDefault(ci.c_str(), "");
-        if(t_chan.size() > 0)
-        {
-            sIRC._chan_count++;
-            sIRC._irc_chan[sIRC._chan_count] = t_chan;
-            ci = "wow.chan_" + ss.str();
-            sIRC._wow_chan[sIRC._chan_count] = MCConfig.GetStringDefault(ci.c_str(), t_chan.c_str());
-        }
-    }
-    sIRC.JoinMsg = MCConfig.GetStringDefault("irc.joinmsg", "Trinity Core running. Command trigger is $Trigger.");
-    sIRC.RstMsg  = MCConfig.GetStringDefault("irc.rstmsg", "Trinity Core is restarting...");
-    sIRC.kikmsg = MCConfig.GetStringDefault("irc.kickmsg", "Do not kick me.");
-    // IRC LINES
-    sIRC.ILINES[WOW_IRC] = MCConfig.GetStringDefault("chat.wow_irc", "\003<WoW>[\002$Name($Level)\002\003] $Msg");
-    sIRC.ILINES[IRC_WOW] = MCConfig.GetStringDefault("chat.irc_wow", "\003<IRC>[$Name]: $Msg");
-    sIRC.ILINES[JOIN_WOW] = MCConfig.GetStringDefault("chat.join_wow", "\00312>>\00304 $Name \003Joined The Channel!");
-    sIRC.ILINES[JOIN_IRC] = MCConfig.GetStringDefault("chat.join_irc", "\003[$Name]: Has Joined IRC!");
-    sIRC.ILINES[LEAVE_WOW] = MCConfig.GetStringDefault("chat.leave_wow", "\00312<<\00304 $Name \003Left The Channel!");
-    sIRC.ILINES[LEAVE_IRC] = MCConfig.GetStringDefault("chat.leave_irc", "\003[$Name]: Has Left IRC!");
-    sIRC.ILINES[CHANGE_NICK] = MCConfig.GetStringDefault("chat.change_nick", "\003<> $Name Is Now Known As $NewName!");
-    // MangChat Options
-    sIRC._MCA = MCConfig.GetIntDefault("irc.maxattempt", 10);
-    sIRC._autojoinkick = MCConfig.GetIntDefault("irc.autojoin_kick", 1);
-    sIRC._cmd_prefx = MCConfig.GetStringDefault("irc.command_prefix", "-");
-	
-	sIRC._op_gm = MCConfig.GetIntDefault("irc.op_gm_login", 0);
-	sIRC._op_gm_lev = MCConfig.GetIntDefault("irc.op_gm_level", 3);
-
-    // Misc Options
-    sIRC.games = MCConfig.GetIntDefault("irc.fun.games", 0);
-	sIRC.gmlog = MCConfig.GetIntDefault("irc.gmlog", 1);
-	sIRC.BOTMASK = MCConfig.GetIntDefault("BotMask", 0);
-    sIRC.Status = MCConfig.GetIntDefault("irc.StatusChannel", 1);
-	sIRC.anchn = MCConfig.GetIntDefault("irc.AnnounceChannel", 1);
-	sIRC.autoanc = MCConfig.GetIntDefault("irc.auto.announce", 30);
-	sIRC.ojGM1 = MCConfig.GetStringDefault("irc.gm1", "[Moderator]");
-    sIRC.ojGM2 = MCConfig.GetStringDefault("irc.gm2", "[Game Master]");
-    sIRC.ojGM3 = MCConfig.GetStringDefault("irc.gm3", "[BugTracker]");
-    sIRC.ojGM4 = MCConfig.GetStringDefault("irc.gm4", "[DevTeam Admin]");
-    sIRC.ojGM5 = MCConfig.GetStringDefault("irc.gm5", "[Root Admin]");
-    // REQUIRED GM LEVEL
-    QueryResult *result = WorldDatabase.PQuery("SELECT `Command`, `gmlevel` FROM `IRC_Commands` ORDER BY `Command`");
-    if(result)
-    {
-        Field *fields = result->Fetch();
-        for (uint64 i=0; i < result->GetRowCount(); i++)
-        {
-            std::string command = fields[0].GetCppString();
-            uint32 gmlvl = fields[1].GetUInt32();
-            if(command == "acct") sIRC.CACCT = gmlvl;
-			if(command == "ban") sIRC.CBAN = gmlvl;
-			if(command == "char") sIRC.CCHAN = gmlvl;
-			if(command == "char") sIRC.CCHAR = gmlvl;
-            if(command == "fun") sIRC.CFUN = gmlvl;
-			if(command == "help") sIRC.CHELP = gmlvl;
-			if(command == "inchan") sIRC.CINCHAN = gmlvl;
-			if(command == "info") sIRC.CINFO = gmlvl;
-            if(command == "item") sIRC.CITEM = gmlvl;
-            if(command == "jail") sIRC.CJAIL = gmlvl;
-            if(command == "kick") sIRC.CKICK = gmlvl;
-            if(command == "kill") sIRC._KILL = gmlvl;
-            if(command == "level") sIRC.CLEVEL = gmlvl;
-			if(command == "lookup") sIRC.CLOOKUP = gmlvl;
-            if(command == "money") sIRC.CMONEY = gmlvl;
-            if(command == "mute") sIRC.CMUTE = gmlvl;
-			if(command == "online") sIRC.CONLINE = gmlvl;
-            if(command == "pm") sIRC.CPM = gmlvl;
-            if(command == "restart") sIRC.CRESTART = gmlvl;
-            if(command == "revive") sIRC.CREVIVE = gmlvl;
-            if(command == "saveall") sIRC.CSAVEALL = gmlvl;
-            if(command == "shutdown") sIRC.CSHUTDOWN = gmlvl;
-            if(command == "spell") sIRC.CSPELL = gmlvl;
-            if(command == "sysmsg") sIRC.CSYSMSG = gmlvl;
-            if(command == "tele") sIRC.CTELE = gmlvl;
-			if(command == "top") sIRC.CTOP = gmlvl;
-            if(command == "who") sIRC.CWHO = gmlvl;
-            result->NextRow();
-        }
-        delete result;
-    }
-    else
-    {
-        sIRC.CACCT     = 3;
-        sIRC.CBAN      = 3;
-        sIRC.CCHAN     = 3;
-        sIRC.CCHAR     = 3;
-        sIRC.CFUN      = 3;
-        sIRC.CHELP     = 3;
-        sIRC.CINCHAN   = 3;
-        sIRC.CINFO     = 3;
-        sIRC.CITEM     = 3;
-        sIRC.CJAIL     = 3;
-        sIRC.CKICK     = 3;
-        sIRC._KILL     = 3;
-        sIRC.CLEVEL    = 3;
-        sIRC.CLOOKUP   = 3;
-        sIRC.CMONEY    = 3;
-        sIRC.CMUTE     = 3;
-        sIRC.CONLINE   = 3;
-        sIRC.CPM       = 3;
-        sIRC.CRESTART  = 3;
-        sIRC.CREVIVE   = 3;
-        sIRC.CSAVEALL  = 3;
-        sIRC.CSHUTDOWN = 3;
-        sIRC.CSPELL    = 3;
-        sIRC.CSYSMSG   = 3;
-        sIRC.CTELE     = 3;
-        sIRC.CTOP      = 3;
-        sIRC.CWHO      = 3;
-    }
-    return true;
-}
-
-std::string IRCClient::GetChatLine(int nItem)
-{
-    return sIRC.ILINES[nItem];
-}
Index: trunk/src/game/IRCLog.h
===================================================================
--- trunk/src/game/IRCLog.h (revision 39)
+++  (revision )
@@ -1,22 +1,0 @@
-#ifndef _IRC_LOG_H
-#define _IRC_LOG_H
-
-#include "Common.h"
-#include <fstream>
-
-class IRCLog
-{
-    public:
-        IRCLog();
-        ~IRCLog();
-
-    public:
-        void WriteLog(const char *what, ...);
-		std::string GetLogDateStr() const;
-		std::string GetLogDateTimeStr() const;
-    private:
-        std::ofstream ircLogfile;
-};
-
-
-#endif
Index: trunk/src/game/MCS_OnlinePlayers.h
===================================================================
--- trunk/src/game/MCS_OnlinePlayers.h (revision 39)
+++  (revision )
@@ -1,27 +1,0 @@
-#ifndef _IRC_CLIENT_ONLINE
-#define _IRC_CLIENT_ONLINE
-
-#include "IRCClient.h"
-#include "IRCCmd.h"
-
-// the reason to run this command multithreaded
-// is to be able to "spread" the output over irc
-// for servers with high player count
-// in order not to freeze the mangchat core with sleep
-// a new thread is spawned it will output the player data
-// evry "10 players" and pauzes to not spam irc
-// in addition the command is locked so i cannot be used
-// while active.
-
-class mcs_OnlinePlayers : public ZThread::Runnable
-{
-    public:
-        mcs_OnlinePlayers();
-        mcs_OnlinePlayers(_CDATA *_CD);
-        ~mcs_OnlinePlayers();
-        void run();
-    public:
-        _CDATA *CD;
-};
-
-#endif
Index: trunk/src/trinitycore/CliRunnable.cpp
===================================================================
--- trunk/src/trinitycore/CliRunnable.cpp (revision 41)
+++ trunk/src/trinitycore/CliRunnable.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,13 +11,13 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-/// \addtogroup mangosd
+/// \addtogroup Trinityd
 /// @{
 /// \file
@@ -37,5 +39,4 @@
 #include "PlayerDump.h"
 #include "Player.h"
-#include "IRCClient.h"
 
 //CliCommand and CliCommandHolder are defined in World.h to avoid cyclic deps
@@ -315,12 +316,4 @@
     sWorld.SendWorldText(LANG_SYSTEMMESSAGE,textUtf8.c_str());
     zprintf("Broadcasting to the world: %s\r\n",textUtf8.c_str());
-
-    if((sIRC.BOTMASK & 256) != 0)
-    {
-        std::string ircchan = "#";
-        ircchan += sIRC._irc_chan[sIRC.anchn].c_str();
-        sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 System Message \00304,08\037/!\\\037\017 %s", "%s", text), true);
-    }
-
 }
 
@@ -641,5 +634,5 @@
 }
 
-/// Display %MaNGOS version
+/// Display %TrinIty version
 void CliVersion(char*,pPrintf zprintf)
 {
@@ -948,5 +941,5 @@
     if (!result)
     {
-        zprintf(objmgr.GetMangosStringForDBCLocale(LANG_COMMAND_TELE_NOTFOUND),"\r\n");
+        zprintf(objmgr.GetTrinityStringForDBCLocale(LANG_COMMAND_TELE_NOTFOUND),"\r\n");
         return;
     }
@@ -962,5 +955,5 @@
     if(!MapManager::IsValidMapCoord(mapid,x,y,z,ort))
     {
-        zprintf(objmgr.GetMangosStringForDBCLocale(LANG_INVALID_TARGET_COORD),"\r\n",x,y,mapid);
+        zprintf(objmgr.GetTrinityStringForDBCLocale(LANG_INVALID_TARGET_COORD),"\r\n",x,y,mapid);
         return;
     }
@@ -972,5 +965,5 @@
         if(chr->IsBeingTeleported()==true)
         {
-            zprintf(objmgr.GetMangosStringForDBCLocale(LANG_IS_TELEPORTED),"\r\n",chr->GetName());
+            zprintf(objmgr.GetTrinityStringForDBCLocale(LANG_IS_TELEPORTED),"\r\n",chr->GetName());
             return;
         }
@@ -978,9 +971,9 @@
         if(chr->isInFlight())
         {
-            zprintf(objmgr.GetMangosStringForDBCLocale(LANG_CHAR_IN_FLIGHT),"\r\n",chr->GetName());
+            zprintf(objmgr.GetTrinityStringForDBCLocale(LANG_CHAR_IN_FLIGHT),"\r\n",chr->GetName());
             return;
         }
 
-        zprintf(objmgr.GetMangosStringForDBCLocale(LANG_TELEPORTING_TO),"\r\n",chr->GetName(),"", location.c_str());
+        zprintf(objmgr.GetTrinityStringForDBCLocale(LANG_TELEPORTING_TO),"\r\n",chr->GetName(),"", location.c_str());
 
         chr->SaveRecallPosition();
@@ -990,9 +983,9 @@
     else if (uint64 guid = objmgr.GetPlayerGUIDByName(name.c_str()))
     {
-        zprintf(objmgr.GetMangosStringForDBCLocale(LANG_TELEPORTING_TO),"\r\n",name.c_str(), objmgr.GetMangosStringForDBCLocale(LANG_OFFLINE), location.c_str());
+        zprintf(objmgr.GetTrinityStringForDBCLocale(LANG_TELEPORTING_TO),"\r\n",name.c_str(), objmgr.GetTrinityStringForDBCLocale(LANG_OFFLINE), location.c_str());
         Player::SavePositionInDB(mapid,x,y,z,ort,MapManager::Instance().GetZoneId(mapid,x,y),guid);
     }
     else
-        zprintf(objmgr.GetMangosStringForDBCLocale(LANG_NO_PLAYER),"\r\n",name.c_str());
+        zprintf(objmgr.GetTrinityStringForDBCLocale(LANG_NO_PLAYER),"\r\n",name.c_str());
 }
 
@@ -1098,5 +1091,5 @@
     ///- Save players
     ObjectAccessor::Instance().SaveAllPlayers();
-    zprintf( objmgr.GetMangosStringForDBCLocale(LANG_PLAYERS_SAVED) );
+    zprintf( objmgr.GetTrinityStringForDBCLocale(LANG_PLAYERS_SAVED) );
 
     ///- Send a message
Index: trunk/src/trinitycore/Master.h
===================================================================
--- trunk/src/trinitycore/Master.h (revision 2)
+++ trunk/src/trinitycore/Master.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,13 +11,13 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-/// \addtogroup mangosd
+/// \addtogroup Trinityd
 /// @{
 /// \file
@@ -46,5 +48,5 @@
 };
 
-#define sMaster MaNGOS::Singleton<Master>::Instance()
+#define sMaster Trinity::Singleton<Master>::Instance()
 #endif
 /// @}
Index: trunk/src/trinitycore/CliRunnable.h
===================================================================
--- trunk/src/trinitycore/CliRunnable.h (revision 2)
+++ trunk/src/trinitycore/CliRunnable.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,13 +11,13 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-/// \addtogroup mangosd
+/// \addtogroup Trinityd
 /// @{
 /// \file
Index: trunk/src/trinitycore/RASocket.cpp
===================================================================
--- trunk/src/trinitycore/RASocket.cpp (revision 41)
+++ trunk/src/trinitycore/RASocket.cpp (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 /** \file
-    \ingroup mangosd
+    \ingroup Trinityd
 */
 
Index: trunk/src/trinitycore/WorldRunnable.cpp
===================================================================
--- trunk/src/trinitycore/WorldRunnable.cpp (revision 6)
+++ trunk/src/trinitycore/WorldRunnable.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 /** \file
-    \ingroup mangosd
+    \ingroup Trinityd
 */
 
Index: trunk/src/trinitycore/RASocket.h
===================================================================
--- trunk/src/trinitycore/RASocket.h (revision 2)
+++ trunk/src/trinitycore/RASocket.h (revision 44)
@@ -1,4 +1,6 @@
 /*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,13 +11,13 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-/// \addtogroup mangosd
+/// \addtogroup Trinityd
 /// @{
 /// \file
Index: trunk/src/trinitycore/trinitycore.conf.dist
===================================================================
--- trunk/src/trinitycore/trinitycore.conf.dist (revision 41)
+++ trunk/src/trinitycore/trinitycore.conf.dist (revision 44)
@@ -300,5 +300,5 @@
 LogSQL = 1
 PidFile = ""
-LogLevel = 3
+LogLevel = 1
 LogTime = 0
 LogFile = "server.log"
@@ -808,5 +808,5 @@
 #        Visibility grey distance for creatures/players (fast changing objects)
 #        addition to appropriate object type Visibility.Distance.* use in case visibility removing to
-#        object (except corpse around distences) If ï¿œ is distance and G is grey distance then object
+#        object (except corpse around distences) If ? is distance and G is grey distance then object
 #        make visible if distance to it <= D but make non visible if distance > D+G
 #        Default: 1 (yard)
@@ -1134,8 +1134,4 @@
 #		Players will start with all flight paths (Note: ALL flight paths, not only player's team)
 #
-#	AntiCheat.GMIsland
-#		If a player enters GM island, he will get teleported away. This will prevent cheaters from buying GM stuff
-#		on servers with a GM mall. GM's will not get teleported away.
-#
 #	GamemasterStartLevel
 #		GM starting level
@@ -1150,10 +1146,4 @@
 #		If enabled, "L70ETC - Power of the horde" will be played when BG starts ;)
 #
-#	EnableQueueForGMs
-#      NOTE: This option currently does not work due to ACE patch
-#		GMs will also be added to the login queue (not gmlvl 3+) if enabled. Useful for GM servers.
-#		Default: 0 - off
-#				 1 - on
-#
 #	HonorPointsAfterDuel
 #		The amount of honor points the duel winner will get after a duel.
@@ -1162,7 +1152,4 @@
 #	DisableWaterBreath
 #		Disable/enable waterbreathing for players
-#
-#	DisableResurrectSickness
-#		Players wont get any resurrect sickness when speaking with a spirit healer if this is enabled+
 #
 #	AlwaysMaxWeaponSkill
@@ -1188,4 +1175,10 @@
 #	NoResetTalentsCost
 #		Enable or disable no cost when reseting talents
+#
+#   ForbiddenMaps
+#       map ids that users below SEC_GAMEMASTER cannot enter, with delimiter ','
+#       Default: ""
+#       example: "538,90"
+#       Note that it's HIGHLY DISCOURAGED to forbid starting maps (0, 1, 530)!
 #
 ###################################################################################################################
@@ -1198,12 +1191,9 @@
 PlayerStart.MapsExplored = 0
 PlayerStart.AllFlightPaths = 0
-AntiCheat.GMIsland = 0
 GamemasterStartLevel = 70
 PlayerInstantLogout = 0
 MusicInBattleground = 0
-EnableQueueForGMs = 0
 HonorPointsAfterDuel = 0
 DisableWaterBreath = 0
-DisableResurrectSickness = 0
 AlwaysMaxWeaponSkill = 0
 PvPToken.Enable = 0
@@ -1213,189 +1203,2 @@
 NoResetTalentsCost = 0
 
-###################################################################################################################
-# IRC SYSTEM CONFIG
-#
-# irc.active
-#     Enable IRC bot/system
-#     Default: 0 - Disable
-#              0 - Enable
-# irc.icc
-#     IRC connect code
-#     Default: 001 - Welcome To Network msg
-#              375 - Beginning Of MOTD
-#              376 - End Of MOTD
-#
-# irc.host
-#     IRC server to connect to
-#
-# irc.port
-#     IRC server port to use
-#     Default: "6667" - Semi-standard IRC port
-#
-# irc.user
-#     The username/ident to use when connecting to the IRC server
-#
-# irc.nick
-#     IRC nickname to be used by the bot
-#
-# irc.pass
-#     The password to be used to identify to NickServ
-#
-# irc.auth
-#     IRC Authentication Method
-#     Default: 0 - Disable
-#              1 - NickServ - Normal Method - PRIVMSG NickServ :IDENTIFY Password
-#              2 - NickServ - Alternate Method To Identify To A Different Nick - PRIVMSG NickServ :IDENTIFY irc.auth.nick Password
-#              3 - QuakeNet - Normal Method - PRIVMSG Q@CServe.quakenet.org :AUTH irc.nick Password
-#              4 - QuakeNet - Alternate Method To Identify To A Different Nick - PRIVMSG Q@CServe.quakenet.org :AUTH irc.auth.nick Password
-#
-# irc.auth.nick
-#     IRC Nickname to use if Auth method 2 or 4 is used
-#
-# irc.ldef
-#     Leave a defined IRC channel on server connect
-#     Default: 0 - Disable
-#              1 - Enable
-# irc.defchan
-#     IRC channel to leave on server connect if irc.ldef is on
-#
-# irc.wct
-#     Time to wait before (re)attemptimg connection to IRC server
-#     Default: 30000 - (30 Seconds)
-#
-# irc.maxattempt
-#     Maximum attempts to try IRC server
-#     Default: 20
-#
-# irc.auto.announce
-#     Time to wait in Minutes to announce random messages from database.
-#     Default: 30 - (30 Minutes)
-#
-# irc.autojoin_kick
-#     Autojoin IRC channel if kicked
-#     Default: 1 - Enable
-#              0 - Disable
-#
-# irc.command_prefix
-#     IRC command prefix
-#     Example: (.)online all
-#
-# irc.joinmsg
-# irc.rstmsg
-# irc.kickmsg
-#     Bot join/restart/kick messages
-#
-# irc.chan_#
-# wow.chan_#
-#     IRC and WOW channels to link. Leave # out of IRC channel. Both channels _ARE_ case sensitive
-#     Example: irc.chan_1 = "Trinity"
-#              irc.chan_2 = "trinity2"
-#              wow.chan_1 = "world"
-#              wow.chan_2 = "LookingForGroup"
-#
-# irc.StatusChannel
-#     Channel Number To Display Status Messages In (AuctionHouse, Levels, Deaths, Etc)
-#     Default: 1 - Channel ID 1
-#
-# irc.AnnounceChannel
-#     Channel Number To Display Announcements In (Announces, Notifies, Event)
-#     Default: 1 - Channel ID 1
-#
-# irc.op_gm_login
-#     Op The GM In All Channels The Bot Is On When They Log In
-#     Default: 0 - Disable
-#              1 - Enable
-#
-# irc.op_gm_level
-#     The Minimum GM Level Required To Have The Bot Op The User
-#     Default: 5 - GM Level 5
-#
-# irc.ajoin (Experimental/Under Development)
-#     Force players to autojoin an in game channel
-#     Atleast one player must be in the channel on server start, and atleast one person online for invite to work
-#     Default: 0 - Disable
-#              1 - Enable
-# irc.ajchan
-#     Channel to join if above is Enabled.
-#
-# irc.online.result
-#     Maximum number of results per line for the online command
-#
-# chat.*** (Defineable Strings)
-#     wow_* - String is displayed in IRC channel
-#     irc_* - String is displayed in WOW channel
-#     Options: $Name, $Level, $Msg, $GM (not all options work in every string)
-#
-# Botmask
-#     This defines what the bot announces, if its 0 everything is disabled
-#     simply add the values of the elements you want to create this mask.
-#     Example: WoW join/leaves are 1 and IRC join/leaves are 2, if you want both of these active then the BotMask is 3.
-#       (1)Display WoW Chan Join/Leaves In IRC
-#       (2)Display IRC Chan Join/Leaves/NickChanges In WoW
-#       (4)Display Unknown Command Message When Trigger Is Used And No Command Exists
-#       (8)Announce Security Level > 0 As GM At Login
-#       (16)Announce GM In GM ON State AS GM At Login
-#       (32)Return Errors To Notice. (If disabled then default is Private Message)
-#       (64)Display WoW Status Messages (Levels/Deaths)
-#       (128)Display Nick Changes From IRC In WOW
-#       (256)Display WoW Announces/Notifies In IRC
-#       (512)Do Not Let Players Use Commands On Higher GM Level Players
-#       (1024)Enable AuctionHouse Announcements
-#
-# irc.gmlog
-#     Minimum GM level to not show login/pass info in IRC logs
-#
-# irc.logfile.prefix
-#     The prefix of the IRC logfile. Directories can be added here.
-#     Example: "IRC/IRC_" outputs IRC_YYYY-MM-DD.log to the IRC subdirectory in your logs dir
-#
-# irc.fun.games (Experimental/Under Development)
-#     Enable IRC games
-#     Default: 0 - Disable
-#              1 - Enable
-# irc.gm#
-#     GM tag to append to (GM onjoin / online command) IRC color codes are acceptable
-#
-###################################################################################################################
-
-irc.active = 0
-irc.icc = 001
-irc.host = ""
-irc.port = "6667"
-irc.user = "TC"
-irc.nick = "TrinityCoreBot"
-irc.pass = ""
-irc.auth = 0
-irc.auth.nick = "TrinityCoreBot"
-irc.ldef = 0
-irc.defchan = "lobby"
-irc.wct = 30000
-irc.maxattempt = 20
-irc.auto.announce = 30
-irc.autojoin_kick = 1
-irc.command_prefix = "-"
-irc.joinmsg = "Trinity Core running. Command trigger is $Trigger."
-irc.rstmsg  = "Trinity Core is restarting..."
-irc.kickmsg = "Do not kick me."
-irc.chan_1 = "mangos"
-wow.chan_1 = "world"
-irc.StatusChannel = 1
-irc.AnnounceChannel = 1
-irc.op_gm_login = 0
-irc.op_gm_level = 3
-irc.ajoin = 1
-irc.ajchan = "World"
-irc.online.result = 30
-chat.wow_irc = "-WoW-$Name [$Level]: $Msg"
-chat.irc_wow = "-IRC-$Name: $Msg"
-chat.join_wow = "[$GM] $Name has joined IRC."
-chat.leave_wow = "[$GM] $Name has left IRC."
-Botmask = 1023
-irc.gmlog = 1
-irc.logfile.prefix = "irc_"
-irc.fun.games = 0
-irc.gm1 = "[Moderator]"
-irc.gm2 = "[Game Master]"
-irc.gm3 = "[BugTracker]"
-irc.gm4 = "[DevTeam Admin]"
-irc.gm5 = "[SysOP]"
Index: trunk/src/trinitycore/WorldRunnable.h
===================================================================
--- trunk/src/trinitycore/WorldRunnable.h (revision 2)
+++ trunk/src/trinitycore/WorldRunnable.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,13 +11,13 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-/// \addtogroup mangosd
+/// \addtogroup Trinityd
 /// @{
 /// \file
Index: trunk/src/trinitycore/Main.cpp
===================================================================
--- trunk/src/trinitycore/Main.cpp (revision 39)
+++ trunk/src/trinitycore/Main.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,13 +11,13 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-/// \addtogroup mangosd Mangos Daemon
+/// \addtogroup Trinityd Trinity Daemon
 /// @{
 /// \file
@@ -26,6 +28,4 @@
 #include "Log.h"
 #include "Master.h"
-#include "../game/IRCConf.h"
-#include "../game/IRCClient.h"
 
 #ifndef _TRINITY_CORE_CONFIG
@@ -41,6 +41,6 @@
 #ifdef WIN32
 #include "ServiceWin32.h"
-char serviceName[] = "mangosd";
-char serviceLongName[] = "MaNGOS world service";
+char serviceName[] = "Trinityd";
+char serviceLongName[] = "Trinity core service";
 char serviceDescription[] = "Massive Network Game Object Server";
 /*
@@ -73,10 +73,9 @@
 }
 
-/// Launch the mangos server
+/// Launch the Trinity server
 extern int main(int argc, char **argv)
 {
     ///- Command line parsing to get the configuration file name
     char const* cfg_file = _TRINITY_CORE_CONFIG;
-    char const* mc_cfg_file = _TRINITY_CORE_CONFIG;
     int c=1;
     while( c < argc )
@@ -140,5 +139,4 @@
     }
 
-    sIRC.SetCfg(mc_cfg_file);
     sLog.outString("Using configuration file %s.", cfg_file);
     
@@ -163,5 +161,5 @@
     // 0 - normal shutdown
     // 1 - shutdown at error
-    // 2 - restart command used, this code can be used by restarter for restart mangosd
+    // 2 - restart command used, this code can be used by restarter for restart Trinityd
 }
 
Index: trunk/src/trinitycore/Makefile.am
===================================================================
--- trunk/src/trinitycore/Makefile.am (revision 23)
+++ trunk/src/trinitycore/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
@@ -83,2 +83,3 @@
 	done
 
+
Index: trunk/src/trinitycore/Master.cpp
===================================================================
--- trunk/src/trinitycore/Master.cpp (revision 39)
+++ trunk/src/trinitycore/Master.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 /** \file
-    \ingroup mangosd
+    \ingroup Trinityd
 */
 
@@ -39,5 +41,4 @@
 #include "ScriptCalls.h"
 #include "Util.h"
-#include "IRCClient.h"
 
 #include "sockets/TcpSocket.h"
@@ -156,7 +157,7 @@
         ipaddr_t raip;
         if (!Utility::u2ip (stringip, raip))
-          sLog.outError ("MaNGOS RA can not bind to ip %s", stringip.c_str ());
+          sLog.outError ("Trinity RA can not bind to ip %s", stringip.c_str ());
         else if (RAListenSocket.Bind (raip, raport))
-          sLog.outError ("MaNGOS RA can not bind to port %d on %s", raport, stringip.c_str ());
+          sLog.outError ("Trinity RA can not bind to port %d on %s", raport, stringip.c_str ());
         else
           {
@@ -228,7 +229,4 @@
         return 1;
 
-    ///- Load IRC Config (need DB for gm levels, AutoBroadcast uses world timers)
-    sIRC.LoadConfig(sIRC.CfgFile);
-
     ///- Initialize the World
     sWorld.SetInitialWorldSettings();
@@ -243,9 +241,4 @@
     // set server online
     loginDatabase.PExecute("UPDATE realmlist SET color = 0, population = 0 WHERE id = '%d'",realmID);
-
-	// Create table: has_logged_in_before - used for certain custom options
-	sLog.outBasic("ImpConfig: Creating/Checking table 'has_logged_in_before'...");
-	CharacterDatabase.PExecute("CREATE TABLE IF NOT EXISTS `has_logged_in_before` (`guid` int(11) unsigned NOT NULL default '0', PRIMARY KEY (`guid`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='ImpConfig check';");
-	sLog.outBasic("ImpConfig: Done...");
 
 #ifdef WIN32
@@ -278,5 +271,5 @@
                 if(!curAff )
                 {
-                    sLog.outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for mangosd. Accessible processors bitmask (hex): %x",Aff,appAff);
+                    sLog.outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for Trinityd. Accessible processors bitmask (hex): %x",Aff,appAff);
                 }
                 else
@@ -299,5 +292,5 @@
                 sLog.outString("TrinityCore process priority class set to HIGH");
             else
-                sLog.outError("ERROR: Can't set mangosd process priority class.");
+                sLog.outError("ERROR: Can't set Trinityd process priority class.");
             sLog.outString();
         }
@@ -313,10 +306,4 @@
     uint32 numLoops = (sConfig.GetIntDefault( "MaxPingTime", 30 ) * (MINUTE * 1000000 / socketSelecttime));
     uint32 loopCounter = 0;
-
-    // Start up IRC bot
-    ZThread::Thread irc(new IRCClient);
-    irc.setPriority ((ZThread::Priority )2);
-
-
 
     ///- Start up freeze catcher thread
Index: trunk/src/bindings/interface/ScriptMgr.h
===================================================================
--- trunk/src/bindings/interface/ScriptMgr.h (revision 2)
+++ trunk/src/bindings/interface/ScriptMgr.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -87,5 +89,5 @@
 #define VISIBLE_RANGE (50.0f)
 
-struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI
+struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
 {
     ScriptedAI(Creature* creature) : m_creature(creature) {}
Index: trunk/src/bindings/interface/system.cpp
===================================================================
--- trunk/src/bindings/interface/system.cpp (revision 2)
+++ trunk/src/bindings/interface/system.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/bindings/interface/Scripts/sc_defines.cpp
===================================================================
--- trunk/src/bindings/interface/Scripts/sc_defines.cpp (revision 2)
+++ trunk/src/bindings/interface/Scripts/sc_defines.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/bindings/interface/Scripts/sc_defines.h
===================================================================
--- trunk/src/bindings/interface/Scripts/sc_defines.h (revision 2)
+++ trunk/src/bindings/interface/Scripts/sc_defines.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/bindings/interface/Scripts/sc_default.cpp
===================================================================
--- trunk/src/bindings/interface/Scripts/sc_default.cpp (revision 2)
+++ trunk/src/bindings/interface/Scripts/sc_default.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/bindings/interface/Makefile.am
===================================================================
--- trunk/src/bindings/interface/Makefile.am (revision 23)
+++ trunk/src/bindings/interface/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
@@ -53,2 +53,3 @@
         Readme.txt
 
+
Index: trunk/src/bindings/interface/ScriptMgr.cpp
===================================================================
--- trunk/src/bindings/interface/ScriptMgr.cpp (revision 2)
+++ trunk/src/bindings/interface/ScriptMgr.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -35,5 +37,5 @@
 // -------------------
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 void ScriptsFree()
 {                                                           // Free resources before library unload
@@ -48,5 +50,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 void ScriptsInit()
 {
@@ -77,5 +79,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GossipHello ( Player * player, Creature *_Creature )
 {
@@ -87,5 +89,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GossipSelect( Player *player, Creature *_Creature,uint32 sender, uint32 action )
 {
@@ -99,5 +101,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GossipSelectWithCode( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode )
 {
@@ -111,5 +113,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool QuestAccept( Player *player, Creature *_Creature, Quest *_Quest )
 {
@@ -121,5 +123,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool QuestSelect( Player *player, Creature *_Creature, Quest *_Quest )
 {
@@ -131,5 +133,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool QuestComplete( Player *player, Creature *_Creature, Quest *_Quest )
 {
@@ -141,5 +143,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool ChooseReward( Player *player, Creature *_Creature, Quest *_Quest, uint32 opt )
 {
@@ -151,5 +153,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 uint32 NPCDialogStatus( Player *player, Creature *_Creature )
 {
@@ -161,5 +163,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 uint32 GODialogStatus( Player *player, GameObject *_GO )
 {
@@ -173,5 +175,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool ItemHello( Player *player, Item *_Item, Quest *_Quest )
 {
@@ -185,5 +187,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool ItemQuestAccept( Player *player, Item *_Item, Quest *_Quest )
 {
@@ -197,5 +199,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GOHello( Player *player, GameObject *_GO )
 {
@@ -209,5 +211,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GOQuestAccept( Player *player, GameObject *_GO, Quest *_Quest )
 {
@@ -221,5 +223,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GOChooseReward( Player *player, GameObject *_GO, Quest *_Quest, uint32 opt )
 {
@@ -233,5 +235,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool AreaTrigger      ( Player *player, AreaTriggerEntry* atEntry )
 {
@@ -244,5 +246,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool ReceiveEmote ( Player *player, Creature *_Creature, uint32 emote )
 {
@@ -253,5 +255,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool ItemUse( Player *player, Item* _Item, SpellCastTargets const& targets)
 {
@@ -264,5 +266,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 CreatureAI* GetAI(Creature *_Creature )
 {
@@ -273,5 +275,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 InstanceData* CreateInstanceData(Map *map)
 {
Index: trunk/src/bindings/interface/config.h
===================================================================
--- trunk/src/bindings/interface/config.h (revision 2)
+++ trunk/src/bindings/interface/config.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -24,8 +26,8 @@
 #ifdef WIN32
 //#include <windows.h>
-#define MANGOS_DLL_EXPORT extern "C" __declspec(dllexport)
+#define TRINITY_DLL_EXPORT extern "C" __declspec(dllexport)
 #elif defined( __GNUC__ )
-#define MANGOS_DLL_EXPORT extern "C"
+#define TRINITY_DLL_EXPORT extern "C"
 #else
-#define MANGOS_DLL_EXPORT extern "C" export
+#define TRINITY_DLL_EXPORT extern "C" export
 #endif
Index: trunk/src/bindings/scripts/sql/Makefile.in
===================================================================
--- trunk/src/bindings/scripts/sql/Makefile.in (revision 24)
+++ trunk/src/bindings/scripts/sql/Makefile.in (revision 44)
@@ -21,5 +21,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/src/bindings/scripts/sql/Makefile.am
===================================================================
--- trunk/src/bindings/scripts/sql/Makefile.am (revision 23)
+++ trunk/src/bindings/scripts/sql/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/src/bindings/scripts/ScriptMgr.h
===================================================================
--- trunk/src/bindings/scripts/ScriptMgr.h (revision 37)
+++ trunk/src/bindings/scripts/ScriptMgr.h (revision 44)
@@ -1,3 +1,6 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ *
  * This program is free software licensed under GPL version 2
  * Please see the included DOCS/LICENSE.TXT for more information */
@@ -79,9 +82,9 @@
 
 #ifdef WIN32
-  #define MANGOS_DLL_EXPORT extern "C" __declspec(dllexport)
+  #define TRINITY_DLL_EXPORT extern "C" __declspec(dllexport)
 #elif defined( __GNUC__ )
-  #define MANGOS_DLL_EXPORT extern "C"
+  #define TRINITY_DLL_EXPORT extern "C"
 #else
-  #define MANGOS_DLL_EXPORT extern "C" export
+  #define TRINITY_DLL_EXPORT extern "C" export
 #endif
 
Index: trunk/src/bindings/scripts/include/sc_gossip.h
===================================================================
--- trunk/src/bindings/scripts/include/sc_gossip.h (revision 37)
+++ trunk/src/bindings/scripts/include/sc_gossip.h (revision 44)
@@ -1,3 +1,6 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ *
  * This program is free software licensed under GPL version 2
  * Please see the included DOCS/LICENSE.TXT for more information */
Index: trunk/src/bindings/scripts/include/sc_instance.h
===================================================================
--- trunk/src/bindings/scripts/include/sc_instance.h (revision 2)
+++ trunk/src/bindings/scripts/include/sc_instance.h (revision 44)
@@ -23,5 +23,5 @@
 #define OUT_LOAD_INST_DATA_FAIL        error_log("SD2: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).",instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
 
-class MANGOS_DLL_DECL ScriptedInstance : public InstanceData
+class TRINITY_DLL_DECL ScriptedInstance : public InstanceData
 {
     public:
Index: trunk/src/bindings/scripts/include/sc_creature.cpp
===================================================================
--- trunk/src/bindings/scripts/include/sc_creature.cpp (revision 37)
+++ trunk/src/bindings/scripts/include/sc_creature.cpp (revision 44)
@@ -1,3 +1,6 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ *
  * This program is free software licensed under GPL version 2
  * Please see the included DOCS/LICENSE.TXT for more information */
@@ -507,5 +510,5 @@
 Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
 {
-    CellPair p(MaNGOS::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+    CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
     Cell cell(p);
     cell.data.Part.reserved = ALL_DISTRICT;
@@ -514,6 +517,6 @@
     Unit* pUnit = NULL;
 
-    MaNGOS::MostHPMissingInRange u_check(m_creature, range, MinHPDiff);
-    MaNGOS::UnitLastSearcher<MaNGOS::MostHPMissingInRange> searcher(pUnit, u_check);
+    Trinity::MostHPMissingInRange u_check(m_creature, range, MinHPDiff);
+    Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(pUnit, u_check);
 
     /*
@@ -521,5 +524,5 @@
     This means that if we only search grid then we cannot possibly return pets or players so this is safe
     */
-    TypeContainerVisitor<MaNGOS::UnitLastSearcher<MaNGOS::MostHPMissingInRange>, GridTypeMapContainer >  grid_unit_searcher(searcher);
+    TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange>, GridTypeMapContainer >  grid_unit_searcher(searcher);
 
     CellLock<GridReadGuard> cell_lock(cell, p);
@@ -530,5 +533,5 @@
 std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range)
 {
-    CellPair p(MaNGOS::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+    CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
     Cell cell(p);
     cell.data.Part.reserved = ALL_DISTRICT;
@@ -537,8 +540,8 @@
     std::list<Creature*> pList;
 
-    MaNGOS::FriendlyCCedInRange u_check(m_creature, range);
-    MaNGOS::CreatureListSearcher<MaNGOS::FriendlyCCedInRange> searcher(pList, u_check);
-
-    TypeContainerVisitor<MaNGOS::CreatureListSearcher<MaNGOS::FriendlyCCedInRange>, GridTypeMapContainer >  grid_creature_searcher(searcher);
+    Trinity::FriendlyCCedInRange u_check(m_creature, range);
+    Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(pList, u_check);
+
+    TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange>, GridTypeMapContainer >  grid_creature_searcher(searcher);
 
     CellLock<GridReadGuard> cell_lock(cell, p);
@@ -550,5 +553,5 @@
 std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 spellid)
 {
-    CellPair p(MaNGOS::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+    CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
     Cell cell(p);
     cell.data.Part.reserved = ALL_DISTRICT;
@@ -557,8 +560,8 @@
     std::list<Creature*> pList;
 
-    MaNGOS::FriendlyMissingBuffInRange u_check(m_creature, range, spellid);
-    MaNGOS::CreatureListSearcher<MaNGOS::FriendlyMissingBuffInRange> searcher(pList, u_check);
-
-    TypeContainerVisitor<MaNGOS::CreatureListSearcher<MaNGOS::FriendlyMissingBuffInRange>, GridTypeMapContainer >  grid_creature_searcher(searcher);
+    Trinity::FriendlyMissingBuffInRange u_check(m_creature, range, spellid);
+    Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(pList, u_check);
+
+    TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange>, GridTypeMapContainer >  grid_creature_searcher(searcher);
 
     CellLock<GridReadGuard> cell_lock(cell, p);
Index: trunk/src/bindings/scripts/include/sc_creature.h
===================================================================
--- trunk/src/bindings/scripts/include/sc_creature.h (revision 14)
+++ trunk/src/bindings/scripts/include/sc_creature.h (revision 44)
@@ -1,3 +1,6 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ *
  * This program is free software licensed under GPL version 2
  * Please see the included DOCS/LICENSE.TXT for more information */
@@ -9,5 +12,5 @@
 #include "Creature.h"
 
-struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI
+struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
 {
     ScriptedAI(Creature* creature) : m_creature(creature), InCombat(false) {}
@@ -27,5 +30,5 @@
     void EnterEvadeMode();
 
-    //Called at any heal cast/item used (call non implemented in mangos)
+    //Called at any heal cast/item used (call non implemented in Trinity)
     void HealBy(Unit *healer, uint32 amount_healed) {}
 
@@ -154,5 +157,5 @@
 };
 
-struct MANGOS_DLL_DECL Scripted_NoMovementAI : public ScriptedAI
+struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI
 {
     Scripted_NoMovementAI(Creature* creature) : ScriptedAI(creature) {}
Index: trunk/src/bindings/scripts/system.cpp
===================================================================
--- trunk/src/bindings/scripts/system.cpp (revision 2)
+++ trunk/src/bindings/scripts/system.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/bindings/scripts/Makefile.am
===================================================================
--- trunk/src/bindings/scripts/Makefile.am (revision 43)
+++ trunk/src/bindings/scripts/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
@@ -416,2 +416,3 @@
 
 
+
Index: trunk/src/bindings/scripts/ScriptMgr.cpp
===================================================================
--- trunk/src/bindings/scripts/ScriptMgr.cpp (revision 41)
+++ trunk/src/bindings/scripts/ScriptMgr.cpp (revision 44)
@@ -634,5 +634,5 @@
     // Load Script Text 
     outstring_log("TSCR: Loading Script Texts...");
-    LoadMangosStrings(TScriptDB,"script_texts",TEXT_SOURCE_RANGE,(TEXT_SOURCE_RANGE*2)+1);
+    LoadTrinityStrings(TScriptDB,"script_texts",TEXT_SOURCE_RANGE,(TEXT_SOURCE_RANGE*2)+1);
 
     // Gather Additional data from Script Texts
@@ -698,5 +698,5 @@
     // Load Custom Text 
     outstring_log("TSCR: Loading Custom Texts...");
-    LoadMangosStrings(TScriptDB,"custom_texts",TEXT_SOURCE_RANGE*2,(TEXT_SOURCE_RANGE*3)+1);
+    LoadTrinityStrings(TScriptDB,"custom_texts",TEXT_SOURCE_RANGE*2,(TEXT_SOURCE_RANGE*3)+1);
 
     // Gather Additional data from Custom Texts
@@ -1175,5 +1175,5 @@
 }extern *SpellSummary;
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 void ScriptsFree()
 {   
@@ -1188,5 +1188,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 void ScriptsInit()
 {
@@ -1932,5 +1932,5 @@
 //*** Functions to be Exported ***
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GossipHello ( Player * player, Creature *_Creature )
 {
@@ -1942,5 +1942,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GossipSelect( Player *player, Creature *_Creature, uint32 sender, uint32 action )
 {
@@ -1954,5 +1954,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GossipSelectWithCode( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode )
 {
@@ -1966,5 +1966,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool QuestAccept( Player *player, Creature *_Creature, Quest const *_Quest )
 {
@@ -1976,5 +1976,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool QuestSelect( Player *player, Creature *_Creature, Quest const *_Quest )
 {
@@ -1986,5 +1986,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool QuestComplete( Player *player, Creature *_Creature, Quest const *_Quest )
 {
@@ -1996,5 +1996,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool ChooseReward( Player *player, Creature *_Creature, Quest const *_Quest, uint32 opt )
 {
@@ -2006,5 +2006,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 uint32 NPCDialogStatus( Player *player, Creature *_Creature )
 {
@@ -2016,5 +2016,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 uint32 GODialogStatus( Player *player, GameObject *_GO )
 {
@@ -2026,5 +2026,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool ItemHello( Player *player, Item *_Item, Quest const *_Quest )
 {
@@ -2036,5 +2036,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool ItemQuestAccept( Player *player, Item *_Item, Quest const *_Quest )
 {
@@ -2046,5 +2046,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GOHello( Player *player, GameObject *_GO )
 {
@@ -2056,5 +2056,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GOQuestAccept( Player *player, GameObject *_GO, Quest const *_Quest )
 {
@@ -2066,5 +2066,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool GOChooseReward( Player *player, GameObject *_GO, Quest const *_Quest, uint32 opt )
 {
@@ -2076,5 +2076,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool AreaTrigger( Player *player, AreaTriggerEntry * atEntry)
 {
@@ -2087,5 +2087,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 CreatureAI* GetAI(Creature *_Creature)
 {
@@ -2096,5 +2096,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool ItemUse( Player *player, Item* _Item, SpellCastTargets const& targets)
 {
@@ -2105,5 +2105,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 bool ReceiveEmote( Player *player, Creature *_Creature, uint32 emote )
 {
@@ -2114,5 +2114,5 @@
 }
 
-MANGOS_DLL_EXPORT
+TRINITY_DLL_EXPORT
 InstanceData* CreateInstanceData(Map *map)
 {
Index: trunk/src/bindings/Makefile.am
===================================================================
--- trunk/src/bindings/Makefile.am (revision 23)
+++ trunk/src/bindings/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/src/framework/Dynamic/ObjectRegistry.h
===================================================================
--- trunk/src/framework/Dynamic/ObjectRegistry.h (revision 2)
+++ trunk/src/framework/Dynamic/ObjectRegistry.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_OBJECTREGISTRY_H
-#define MANGOS_OBJECTREGISTRY_H
+#ifndef TRINITY_OBJECTREGISTRY_H
+#define TRINITY_OBJECTREGISTRY_H
 
 #include "Platform/Define.h"
@@ -30,5 +32,5 @@
  */
 template<class T, class Key = std::string>
-class MANGOS_DLL_DECL ObjectRegistry
+class TRINITY_DLL_DECL ObjectRegistry
 {
     public:
@@ -94,5 +96,5 @@
     private:
         RegistryMapType i_registeredObjects;
-        friend class MaNGOS::OperatorNew<ObjectRegistry<T, Key> >;
+        friend class Trinity::OperatorNew<ObjectRegistry<T, Key> >;
 
         // protected for friend use since it should be a singleton
Index: trunk/src/framework/Dynamic/FactoryHolder.h
===================================================================
--- trunk/src/framework/Dynamic/FactoryHolder.h (revision 2)
+++ trunk/src/framework/Dynamic/FactoryHolder.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_FACTORY_HOLDER
-#define MANGOS_FACTORY_HOLDER
+#ifndef TRINITY_FACTORY_HOLDER
+#define TRINITY_FACTORY_HOLDER
 
 #include "Platform/Define.h"
@@ -28,9 +30,9 @@
  */
 template<class T, class Key = std::string>
-class MANGOS_DLL_DECL FactoryHolder
+class TRINITY_DLL_DECL FactoryHolder
 {
     public:
         typedef ObjectRegistry<FactoryHolder<T, Key >, Key > FactoryHolderRegistry;
-        typedef MaNGOS::Singleton<FactoryHolderRegistry > FactoryHolderRepository;
+        typedef Trinity::Singleton<FactoryHolderRegistry > FactoryHolderRepository;
 
         FactoryHolder(Key k) : i_key(k) {}
Index: trunk/src/framework/Platform/Define.h
===================================================================
--- trunk/src/framework/Platform/Define.h (revision 2)
+++ trunk/src/framework/Platform/Define.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_DEFINE_H
-#define MANGOS_DEFINE_H
+#ifndef TRINITY_DEFINE_H
+#define TRINITY_DEFINE_H
 
 #include "Platform/CompilerDefs.h"
@@ -88,21 +90,21 @@
 */
 
-#define MANGOS_LITTLEENDIAN 0
-#define MANGOS_BIGENDIAN    1
-
-#if !defined(MANGOS_ENDIAN)
+#define TRINITY_LITTLEENDIAN 0
+#define TRINITY_BIGENDIAN    1
+
+#if !defined(TRINITY_ENDIAN)
 #  if defined(LITTLE_ENDIAN) || defined(BIG_ENDIAN)
 #    if defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)
 #      if defined(BYTE_ORDER)
 #        if   (BYTE_ORDER == LITTLE_ENDIAN)
-#          define MANGOS_ENDIAN MANGOS_LITTLEENDIAN
+#          define TRINITY_ENDIAN TRINITY_LITTLEENDIAN
 #        elif (BYTE_ORDER == BIG_ENDIAN)
-#          define MANGOS_ENDIAN MANGOS_BIGENDIAN
+#          define TRINITY_ENDIAN TRINITY_BIGENDIAN
 #        endif
 #      endif
 #    elif defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) 
-#      define MANGOS_ENDIAN MANGOS_LITTLEENDIAN
+#      define TRINITY_ENDIAN TRINITY_LITTLEENDIAN
 #    elif !defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)
-#      define MANGOS_ENDIAN MANGOS_BIGENDIAN
+#      define TRINITY_ENDIAN TRINITY_BIGENDIAN
 #    endif
 #  elif defined(_LITTLE_ENDIAN) || defined(_BIG_ENDIAN)
@@ -110,24 +112,24 @@
 #      if defined(_BYTE_ORDER)
 #        if   (_BYTE_ORDER == _LITTLE_ENDIAN)
-#          define MANGOS_ENDIAN MANGOS_LITTLEENDIAN
+#          define TRINITY_ENDIAN TRINITY_LITTLEENDIAN
 #        elif (_BYTE_ORDER == _BIG_ENDIAN)
-#          define MANGOS_ENDIAN MANGOS_BIGENDIAN
+#          define TRINITY_ENDIAN TRINITY_BIGENDIAN
 #        endif
 #      endif
 #    elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) 
-#      define MANGOS_ENDIAN MANGOS_LITTLE_ENDIAN
+#      define TRINITY_ENDIAN TRINITY_LITTLE_ENDIAN
 #    elif !defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN)
-#      define MANGOS_ENDIAN MANGOS_BIGENDIAN
+#      define TRINITY_ENDIAN TRINITY_BIGENDIAN
 #    endif
 #  elif 0     /* **** EDIT HERE IF NECESSARY **** */
-#    define MANGOS_ENDIAN MANGOS_LITTLEENDIAN
+#    define TRINITY_ENDIAN TRINITY_LITTLEENDIAN
 #  elif 0     /* **** EDIT HERE IF NECESSARY **** */
-#    define MANGOS_ENDIAN MANGOS_BIGENDIAN
+#    define TRINITY_ENDIAN TRINITY_BIGENDIAN
 #  elif (('1234' >> 24) == '1')
-#    define MANGOS_ENDIAN MANGOS_LITTLEENDIAN
+#    define TRINITY_ENDIAN TRINITY_LITTLEENDIAN
 #  elif (('4321' >> 24) == '1')
-#    define MANGOS_ENDIAN MANGOS_BIGENDIAN
-#  else
-#    define MANGOS_ENDIAN MANGOS_LITTLEENDIAN
+#    define TRINITY_ENDIAN TRINITY_BIGENDIAN
+#  else
+#    define TRINITY_ENDIAN TRINITY_LITTLEENDIAN
 #  endif
 #endif
@@ -136,52 +138,52 @@
 
 #if PLATFORM == PLATFORM_WINDOWS
-#define MANGOS_EXPORT __declspec(dllexport)
-#define MANGOS_LIBRARY_HANDLE HMODULE
-#define MANGOS_LOAD_LIBRARY(a) LoadLibrary(a)
-#define MANGOS_CLOSE_LIBRARY FreeLibrary
-#define MANGOS_GET_PROC_ADDR GetProcAddress
-#define MANGOS_IMPORT __cdecl
-#define MANGOS_SCRIPT_EXT ".dll"
-#define MANGOS_SCRIPT_NAME "TrinityScript"
-#else
-#define MANGOS_LIBRARY_HANDLE void*
-#define MANGOS_EXPORT export
-#define MANGOS_LOAD_LIBRARY(a) dlopen(a,RTLD_NOW)
-#define MANGOS_CLOSE_LIBRARY dlclose
-#define MANGOS_GET_PROC_ADDR dlsym
+#define TRINITY_EXPORT __declspec(dllexport)
+#define TRINITY_LIBRARY_HANDLE HMODULE
+#define TRINITY_LOAD_LIBRARY(a) LoadLibrary(a)
+#define TRINITY_CLOSE_LIBRARY FreeLibrary
+#define TRINITY_GET_PROC_ADDR GetProcAddress
+#define TRINITY_IMPORT __cdecl
+#define TRINITY_SCRIPT_EXT ".dll"
+#define TRINITY_SCRIPT_NAME "TrinityScript"
+#else
+#define TRINITY_LIBRARY_HANDLE void*
+#define TRINITY_EXPORT export
+#define TRINITY_LOAD_LIBRARY(a) dlopen(a,RTLD_NOW)
+#define TRINITY_CLOSE_LIBRARY dlclose
+#define TRINITY_GET_PROC_ADDR dlsym
 
 #if defined(__APPLE_CC__) && defined(BIG_ENDIAN)
-#define MANGOS_IMPORT __attribute__ ((longcall))
-#else
-#define MANGOS_IMPORT __attribute__ ((cdecl))
-#endif
-
-#define MANGOS_SCRIPT_EXT ".so"
-#define MANGOS_SCRIPT_NAME "libtrinityscript"
+#define TRINITY_IMPORT __attribute__ ((longcall))
+#else
+#define TRINITY_IMPORT __attribute__ ((cdecl))
+#endif
+
+#define TRINITY_SCRIPT_EXT ".so"
+#define TRINITY_SCRIPT_NAME "libtrinityscript"
 #endif
 
 #ifdef WIN32
-#ifdef MANGOS_WIN32_DLL_IMPORT
-
-#define MANGOS_DLL_DECL __declspec(dllimport)
-#else
-#ifdef MANGOS_WIND_DLL_EXPORT
-#define MANGOS_DLL_DECL __declspec(dllexport)
-#else
-#define MANGOS_DLL_DECL
-#endif
-#endif
-
-#else
-#define MANGOS_DLL_DECL
+#ifdef TRINITY_WIN32_DLL_IMPORT
+
+#define TRINITY_DLL_DECL __declspec(dllimport)
+#else
+#ifdef TRINITY_WIND_DLL_EXPORT
+#define TRINITY_DLL_DECL __declspec(dllexport)
+#else
+#define TRINITY_DLL_DECL
+#endif
+#endif
+
+#else
+#define TRINITY_DLL_DECL
 #endif
 
 #ifndef DEBUG
-#define MANGOS_INLINE inline
-#else
-#ifndef MANGOS_DEBUG
-#define MANGOS_DEBUG
-#endif
-#define MANGOS_INLINE
+#define TRINITY_INLINE inline
+#else
+#ifndef TRINITY_DEBUG
+#define TRINITY_DEBUG
+#endif
+#define TRINITY_INLINE
 #endif
 
@@ -210,10 +212,10 @@
 
 #if PLATFORM == PLATFORM_WINDOWS
-#  define MANGOS_DLL_SPEC __declspec(dllexport)
+#  define TRINITY_DLL_SPEC __declspec(dllexport)
 #  ifndef DECLSPEC_NORETURN
 #    define DECLSPEC_NORETURN __declspec(noreturn)
 #  endif
 #else
-#  define MANGOS_DLL_SPEC
+#  define TRINITY_DLL_SPEC
 #  define DECLSPEC_NORETURN
 #endif
Index: trunk/src/framework/Platform/CompilerDefs.h
===================================================================
--- trunk/src/framework/Platform/CompilerDefs.h (revision 2)
+++ trunk/src/framework/Platform/CompilerDefs.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_COMPILERDEFS_H
-#define MANGOS_COMPILERDEFS_H
+#ifndef TRINITY_COMPILERDEFS_H
+#define TRINITY_COMPILERDEFS_H
 
 #define PLATFORM_WINDOWS 0
Index: trunk/src/framework/Policies/ObjectLifeTime.cpp
===================================================================
--- trunk/src/framework/Policies/ObjectLifeTime.cpp (revision 2)
+++ trunk/src/framework/Policies/ObjectLifeTime.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -20,5 +22,5 @@
 #include "ObjectLifeTime.h"
 
-namespace MaNGOS
+namespace Trinity
 {
     extern "C" void external_wrapper(void *p)
@@ -27,5 +29,5 @@
     }
 
-    void MANGOS_DLL_SPEC at_exit( void (*func)() )
+    void TRINITY_DLL_SPEC at_exit( void (*func)() )
     {
         external_wrapper((void*)func);
Index: trunk/src/framework/Policies/Singleton.h
===================================================================
--- trunk/src/framework/Policies/Singleton.h (revision 2)
+++ trunk/src/framework/Policies/Singleton.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_SINGLETON_H
-#define MANGOS_SINGLETON_H
+#ifndef TRINITY_SINGLETON_H
+#define TRINITY_SINGLETON_H
 
 /**
@@ -28,14 +30,14 @@
 #include "ObjectLifeTime.h"
 
-namespace MaNGOS
+namespace Trinity
 {
     template
         <
         typename T,
-        class ThreadingModel = MaNGOS::SingleThreaded<T>,
-        class CreatePolicy = MaNGOS::OperatorNew<T>,
-        class LifeTimePolicy = MaNGOS::ObjectLifeTime<T>
+        class ThreadingModel = Trinity::SingleThreaded<T>,
+        class CreatePolicy = Trinity::OperatorNew<T>,
+        class LifeTimePolicy = Trinity::ObjectLifeTime<T>
         >
-        class MANGOS_DLL_DECL Singleton
+        class TRINITY_DLL_DECL Singleton
     {
         public:
Index: trunk/src/framework/Policies/CreationPolicy.h
===================================================================
--- trunk/src/framework/Policies/CreationPolicy.h (revision 2)
+++ trunk/src/framework/Policies/CreationPolicy.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,19 +11,19 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_CREATIONPOLICY_H
-#define MANGOS_CREATIONPOLICY_H
+#ifndef TRINITY_CREATIONPOLICY_H
+#define TRINITY_CREATIONPOLICY_H
 
 #include <stdlib.h>
 #include "Platform/Define.h"
 
-namespace MaNGOS
+namespace Trinity
 {
     /**
@@ -29,5 +31,5 @@
      */
     template <class T>
-        class MANGOS_DLL_DECL OperatorNew
+        class TRINITY_DLL_DECL OperatorNew
     {
         public:
@@ -41,5 +43,5 @@
      */
     template <class T>
-        class MANGOS_DLL_DECL LocalStaticCreation
+        class TRINITY_DLL_DECL LocalStaticCreation
     {
         union MaxAlign
@@ -70,5 +72,5 @@
      */
     template<class T>
-        class MANGOS_DLL_DECL CreateUsingMalloc
+        class TRINITY_DLL_DECL CreateUsingMalloc
     {
         public:
@@ -91,5 +93,5 @@
      */
     template<class T, class CALL_BACK>
-        class MANGOS_DLL_DECL CreateOnCallBack
+        class TRINITY_DLL_DECL CreateOnCallBack
     {
         public:
Index: trunk/src/framework/Policies/ObjectLifeTime.h
===================================================================
--- trunk/src/framework/Policies/ObjectLifeTime.h (revision 2)
+++ trunk/src/framework/Policies/ObjectLifeTime.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_OBJECTLIFETIME_H
-#define MANGOS_OBJECTLIFETIME_H
+#ifndef TRINITY_OBJECTLIFETIME_H
+#define TRINITY_OBJECTLIFETIME_H
 
 #include <stdexcept>
@@ -25,10 +27,10 @@
 typedef void (* Destroyer)(void);
 
-namespace MaNGOS
+namespace Trinity
 {
-    void MANGOS_DLL_SPEC at_exit( void (*func)() );
+    void TRINITY_DLL_SPEC at_exit( void (*func)() );
 
     template <class T>
-        class MANGOS_DLL_DECL ObjectLifeTime
+        class TRINITY_DLL_DECL ObjectLifeTime
     {
         public:
Index: trunk/src/framework/Policies/ThreadingModel.h
===================================================================
--- trunk/src/framework/Policies/ThreadingModel.h (revision 2)
+++ trunk/src/framework/Policies/ThreadingModel.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_THREADINGMODEL_H
-#define MANGOS_THREADINGMODEL_H
+#ifndef TRINITY_THREADINGMODEL_H
+#define TRINITY_THREADINGMODEL_H
 
 /**
@@ -27,9 +29,9 @@
 #include "Platform/Define.h"
 
-namespace MaNGOS
+namespace Trinity
 {
     inline void Guard(void *) {}
 
-    template<typename MUTEX> class MANGOS_DLL_DECL GeneralLock
+    template<typename MUTEX> class TRINITY_DLL_DECL GeneralLock
     {
         public:
@@ -50,5 +52,5 @@
 
     template <class T>
-        class MANGOS_DLL_DECL SingleThreaded
+        class TRINITY_DLL_DECL SingleThreaded
     {
         public:
@@ -68,5 +70,5 @@
     // object level lockable
     template<class T, class MUTEX>
-        class MANGOS_DLL_DECL ObjectLevelLockable
+        class TRINITY_DLL_DECL ObjectLevelLockable
     {
         public:
@@ -97,5 +99,5 @@
 
     template<class T, class MUTEX>
-        class MANGOS_DLL_DECL ClassLevelLockable
+        class TRINITY_DLL_DECL ClassLevelLockable
     {
         public:
@@ -121,7 +123,7 @@
 }
 
-template<class T, class MUTEX> MUTEX MaNGOS::ClassLevelLockable<T, MUTEX>::si_mtx;
+template<class T, class MUTEX> MUTEX Trinity::ClassLevelLockable<T, MUTEX>::si_mtx;
 
 #define INSTANTIATE_CLASS_MUTEX(CTYPE,MUTEX) \
-    template class MANGOS_DLL_DECL MaNGOS::ClassLevelLockable<CTYPE, MUTEX >
+    template class TRINITY_DLL_DECL Trinity::ClassLevelLockable<CTYPE, MUTEX >
 #endif
Index: trunk/src/framework/Policies/SingletonImp.h
===================================================================
--- trunk/src/framework/Policies/SingletonImp.h (revision 2)
+++ trunk/src/framework/Policies/SingletonImp.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_SINGLETONIMPL_H
-#define MANGOS_SINGLETONIMPL_H
+#ifndef TRINITY_SINGLETONIMPL_H
+#define TRINITY_SINGLETONIMPL_H
 
 #include "Singleton.h"
@@ -33,5 +35,5 @@
 >
 T&
-MaNGOS::Singleton<T, ThreadingModel, CreatePolicy, LifeTimePolicy >::Instance()
+Trinity::Singleton<T, ThreadingModel, CreatePolicy, LifeTimePolicy >::Instance()
 {
     if( !si_instance )
@@ -62,5 +64,5 @@
 >
 void
-MaNGOS::Singleton<T, ThreadingModel, CreatePolicy, LifeTimePolicy>::DestroySingleton()
+Trinity::Singleton<T, ThreadingModel, CreatePolicy, LifeTimePolicy>::DestroySingleton()
 {
     CreatePolicy::Destroy(si_instance);
@@ -70,21 +72,21 @@
 
 #define INSTANTIATE_SINGLETON_1(TYPE) \
-    template class MANGOS_DLL_DECL MaNGOS::Singleton<TYPE, MaNGOS::SingleThreaded<TYPE>, MaNGOS::OperatorNew<TYPE>, MaNGOS::ObjectLifeTime<TYPE> >; \
-    template<> TYPE* MaNGOS::Singleton<TYPE, MaNGOS::SingleThreaded<TYPE>, MaNGOS::OperatorNew<TYPE>, MaNGOS::ObjectLifeTime<TYPE> >::si_instance = 0; \
-    template<> bool MaNGOS::Singleton<TYPE, MaNGOS::SingleThreaded<TYPE>, MaNGOS::OperatorNew<TYPE>, MaNGOS::ObjectLifeTime<TYPE> >::si_destroyed = false
+    template class TRINITY_DLL_DECL Trinity::Singleton<TYPE, Trinity::SingleThreaded<TYPE>, Trinity::OperatorNew<TYPE>, Trinity::ObjectLifeTime<TYPE> >; \
+    template<> TYPE* Trinity::Singleton<TYPE, Trinity::SingleThreaded<TYPE>, Trinity::OperatorNew<TYPE>, Trinity::ObjectLifeTime<TYPE> >::si_instance = 0; \
+    template<> bool Trinity::Singleton<TYPE, Trinity::SingleThreaded<TYPE>, Trinity::OperatorNew<TYPE>, Trinity::ObjectLifeTime<TYPE> >::si_destroyed = false
 
 #define INSTANTIATE_SINGLETON_2(TYPE, THREADINGMODEL) \
-    template class MANGOS_DLL_DECL MaNGOS::Singleton<TYPE, THREADINGMODEL, MaNGOS::OperatorNew<TYPE>, MaNGOS::ObjectLifeTime<TYPE> >; \
-    template<> TYPE* MaNGOS::Singleton<TYPE, THREADINGMODEL, MaNGOS::OperatorNew<TYPE>, MaNGOS::ObjectLifeTime<TYPE> >::si_instance = 0; \
-    template<> bool MaNGOS::Singleton<TYPE, THREADINGMODEL, MaNGOS::OperatorNew<TYPE>, MaNGOS::ObjectLifeTime<TYPE> >::si_destroyed = false
+    template class TRINITY_DLL_DECL Trinity::Singleton<TYPE, THREADINGMODEL, Trinity::OperatorNew<TYPE>, Trinity::ObjectLifeTime<TYPE> >; \
+    template<> TYPE* Trinity::Singleton<TYPE, THREADINGMODEL, Trinity::OperatorNew<TYPE>, Trinity::ObjectLifeTime<TYPE> >::si_instance = 0; \
+    template<> bool Trinity::Singleton<TYPE, THREADINGMODEL, Trinity::OperatorNew<TYPE>, Trinity::ObjectLifeTime<TYPE> >::si_destroyed = false
 
 #define INSTANTIATE_SINGLETON_3(TYPE, THREADINGMODEL, CREATIONPOLICY ) \
-    template class MANGOS_DLL_DECL MaNGOS::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, MaNGOS::ObjectLifeTime<TYPE> >; \
-    template<> TYPE* MaNGOS::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, MaNGOS::ObjectLifeTime<TYPE> >::si_instance = 0; \
-    template<> bool MaNGOS::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, MaNGOS::ObjectLifeType<TYPE> >::si_destroyed = false
+    template class TRINITY_DLL_DECL Trinity::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, Trinity::ObjectLifeTime<TYPE> >; \
+    template<> TYPE* Trinity::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, Trinity::ObjectLifeTime<TYPE> >::si_instance = 0; \
+    template<> bool Trinity::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, Trinity::ObjectLifeType<TYPE> >::si_destroyed = false
 
 #define INSTANTIATE_SINGLETON_4(TYPE, THREADINGMODEL, CREATIONPOLICY, OBJECTLIFETIME) \
-    template class MANGOS_DLL_DECL MaNGOS::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, OBJECTLIFETIME >; \
-    template<> TYPE* MaNGOS::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, OBJECTLIFETIME >::si_instance = 0; \
-    template<> bool MaNGOS::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, OBJECTLIFETIME >::si_destroyed = false
+    template class TRINITY_DLL_DECL Trinity::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, OBJECTLIFETIME >; \
+    template<> TYPE* Trinity::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, OBJECTLIFETIME >::si_instance = 0; \
+    template<> bool Trinity::Singleton<TYPE, THREADINGMODEL, CREATIONPOLICY, OBJECTLIFETIME >::si_destroyed = false
 #endif
Index: trunk/src/framework/Makefile.am
===================================================================
--- trunk/src/framework/Makefile.am (revision 23)
+++ trunk/src/framework/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
@@ -65,2 +65,3 @@
 	Utilities/TypeList.h
 
+
Index: trunk/src/framework/Network/SocketDefines.h
===================================================================
--- trunk/src/framework/Network/SocketDefines.h (revision 2)
+++ trunk/src/framework/Network/SocketDefines.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_SOCKETDEFINES_H
-#define MANGOS_SOCKETDEFINES_H
+#ifndef TRINITY_SOCKETDEFINES_H
+#define TRINITY_SOCKETDEFINES_H
 
 #ifdef WIN32
Index: trunk/src/framework/Utilities/CountedReference/ReferenceHolder.h
===================================================================
--- trunk/src/framework/Utilities/CountedReference/ReferenceHolder.h (revision 2)
+++ trunk/src/framework/Utilities/CountedReference/ReferenceHolder.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_REFERENCEHOLDER_H
-#define MANGOS_REFERENCEHOLDER_H
+#ifndef TRINITY_REFERENCEHOLDER_H
+#define TRINITY_REFERENCEHOLDER_H
 
 /** ReferenceHolder holds the actualy referenced obejct as well the refence
Index: trunk/src/framework/Utilities/CountedReference/Reference.h
===================================================================
--- trunk/src/framework/Utilities/CountedReference/Reference.h (revision 2)
+++ trunk/src/framework/Utilities/CountedReference/Reference.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef  MANGOS_REFERENCE_H
-#define  MANGOS_REFERENCE_H
+#ifndef  TRINITY_REFERENCE_H
+#define  TRINITY_REFERENCE_H
 
 /**
@@ -39,7 +41,7 @@
 <
 typename T,
-class THREADING_MODEL = MaNGOS::SingleThreaded<T>
+class THREADING_MODEL = Trinity::SingleThreaded<T>
 >
-class MANGOS_DLL_DECL Referencer
+class TRINITY_DLL_DECL Referencer
 {
     typedef typename THREADING_MODEL::Lock Lock;
Index: trunk/src/framework/Utilities/CountedReference/ReferenceImpl.h
===================================================================
--- trunk/src/framework/Utilities/CountedReference/ReferenceImpl.h (revision 2)
+++ trunk/src/framework/Utilities/CountedReference/ReferenceImpl.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_REFERENCEIMPL_H
-#define MANGOS_REFERENCEIMPL_H
+#ifndef TRINITY_REFERENCEIMPL_H
+#define TRINITY_REFERENCEIMPL_H
 
 #include "Reference.h"
Index: trunk/src/framework/Utilities/ByteConverter.h
===================================================================
--- trunk/src/framework/Utilities/ByteConverter.h (revision 2)
+++ trunk/src/framework/Utilities/ByteConverter.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_BYTECONVERTER_H
-#define MANGOS_BYTECONVERTER_H
+#ifndef TRINITY_BYTECONVERTER_H
+#define TRINITY_BYTECONVERTER_H
 
 /** ByteConverter reverse your byte order.  This is use
@@ -45,5 +47,5 @@
 }
 
-#if MANGOS_ENDIAN == MANGOS_BIGENDIAN
+#if TRINITY_ENDIAN == TRINITY_BIGENDIAN
 template<typename T> inline void EndianConvert(T& val) { ByteConverter::apply<T>(&val); }
 #else
Index: trunk/src/framework/Utilities/Callback.h
===================================================================
--- trunk/src/framework/Utilities/Callback.h (revision 2)
+++ trunk/src/framework/Utilities/Callback.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,18 +11,18 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_CALLBACK_H
-#define MANGOS_CALLBACK_H
+#ifndef TRINITY_CALLBACK_H
+#define TRINITY_CALLBACK_H
 
 /// ------------ BASE CLASSES ------------
 
-namespace MaNGOS
+namespace Trinity
 {
     template < class Class, typename ParamType1 = void, typename ParamType2 = void, typename ParamType3 = void, typename ParamType4 = void >
@@ -194,5 +196,5 @@
 /// --------- GENERIC CALLBACKS ----------
 
-namespace MaNGOS
+namespace Trinity
 {
     class ICallback
@@ -270,5 +272,5 @@
 class QueryResult;
 
-namespace MaNGOS
+namespace Trinity
 {
     class IQueryCallback
Index: trunk/src/framework/Utilities/EventProcessor.cpp
===================================================================
--- trunk/src/framework/Utilities/EventProcessor.cpp (revision 2)
+++ trunk/src/framework/Utilities/EventProcessor.cpp (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/framework/Utilities/TypeList.h
===================================================================
--- trunk/src/framework/Utilities/TypeList.h (revision 2)
+++ trunk/src/framework/Utilities/TypeList.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_TYPELIST_H
-#define MANGOS_TYPELIST_H
+#ifndef TRINITY_TYPELIST_H
+#define TRINITY_TYPELIST_H
 
 /*
Index: trunk/src/framework/Utilities/LinkedReference/Reference.h
===================================================================
--- trunk/src/framework/Utilities/LinkedReference/Reference.h (revision 2)
+++ trunk/src/framework/Utilities/LinkedReference/Reference.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/framework/Utilities/LinkedReference/RefManager.h
===================================================================
--- trunk/src/framework/Utilities/LinkedReference/RefManager.h (revision 2)
+++ trunk/src/framework/Utilities/LinkedReference/RefManager.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/framework/Utilities/EventProcessor.h
===================================================================
--- trunk/src/framework/Utilities/EventProcessor.h (revision 2)
+++ trunk/src/framework/Utilities/EventProcessor.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/framework/Utilities/HashMap.h
===================================================================
--- trunk/src/framework/Utilities/HashMap.h (revision 2)
+++ trunk/src/framework/Utilities/HashMap.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_HASHMAP_H
-#define MANGOS_HASHMAP_H
+#ifndef TRINITY_HASHMAP_H
+#define TRINITY_HASHMAP_H
 
 #include "Platform/CompilerDefs.h"
Index: trunk/src/framework/Utilities/LinkedList.h
===================================================================
--- trunk/src/framework/Utilities/LinkedList.h (revision 2)
+++ trunk/src/framework/Utilities/LinkedList.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/framework/GameSystem/GridLoader.h
===================================================================
--- trunk/src/framework/GameSystem/GridLoader.h (revision 2)
+++ trunk/src/framework/GameSystem/GridLoader.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_GRIDLOADER_H
-#define MANGOS_GRIDLOADER_H
+#ifndef TRINITY_GRIDLOADER_H
+#define TRINITY_GRIDLOADER_H
 
 /**
@@ -41,5 +43,5 @@
 class GRID_OBJECT_TYPES
 >
-class MANGOS_DLL_DECL GridLoader
+class TRINITY_DLL_DECL GridLoader
 {
     public:
Index: trunk/src/framework/GameSystem/GridRefManager.h
===================================================================
--- trunk/src/framework/GameSystem/GridRefManager.h (revision 2)
+++ trunk/src/framework/GameSystem/GridRefManager.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
Index: trunk/src/framework/GameSystem/TypeContainerFunctions.h
===================================================================
--- trunk/src/framework/GameSystem/TypeContainerFunctions.h (revision 2)
+++ trunk/src/framework/GameSystem/TypeContainerFunctions.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -30,5 +32,5 @@
 #include <map>
 
-namespace MaNGOS
+namespace Trinity
 {
     /* ContainerMapList Helpers */
Index: trunk/src/framework/GameSystem/NGrid.h
===================================================================
--- trunk/src/framework/GameSystem/NGrid.h (revision 2)
+++ trunk/src/framework/GameSystem/NGrid.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_NGRID_H
-#define MANGOS_NGRID_H
+#ifndef TRINITY_NGRID_H
+#define TRINITY_NGRID_H
 
 /** NGrid is nothing more than a wrapper of the Grid with an NxN cells
@@ -59,7 +61,7 @@
 class WORLD_OBJECT_TYPES,
 class GRID_OBJECT_TYPES,
-class ThreadModel = MaNGOS::SingleThreaded<ACTIVE_OBJECT>
+class ThreadModel = Trinity::SingleThreaded<ACTIVE_OBJECT>
 >
-class MANGOS_DLL_DECL NGrid
+class TRINITY_DLL_DECL NGrid
 {
     public:
Index: trunk/src/framework/GameSystem/TypeContainerFunctionsPtr.h
===================================================================
--- trunk/src/framework/GameSystem/TypeContainerFunctionsPtr.h (revision 2)
+++ trunk/src/framework/GameSystem/TypeContainerFunctionsPtr.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -30,5 +32,5 @@
 #include <map>
 
-namespace MaNGOS
+namespace Trinity
 {
     /* ContainerMapList Helpers */
Index: trunk/src/framework/GameSystem/GridReference.h
===================================================================
--- trunk/src/framework/GameSystem/GridReference.h (revision 2)
+++ trunk/src/framework/GameSystem/GridReference.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,10 +11,10 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
@@ -26,5 +28,5 @@
 
 template<class OBJECT>
-class MANGOS_DLL_SPEC GridReference : public Reference<GridRefManager<OBJECT>, OBJECT>
+class TRINITY_DLL_SPEC GridReference : public Reference<GridRefManager<OBJECT>, OBJECT>
 {
     protected:
Index: trunk/src/framework/GameSystem/TypeContainer.h
===================================================================
--- trunk/src/framework/GameSystem/TypeContainer.h (revision 2)
+++ trunk/src/framework/GameSystem/TypeContainer.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_TYPECONTAINER_H
-#define MANGOS_TYPECONTAINER_H
+#ifndef TRINITY_TYPECONTAINER_H
+#define TRINITY_TYPECONTAINER_H
 
 /*
@@ -96,18 +98,18 @@
 
 template<class OBJECT_TYPES>
-class MANGOS_DLL_DECL TypeMapContainer
+class TRINITY_DLL_DECL TypeMapContainer
 {
     public:
-        template<class SPECIFIC_TYPE> size_t Count() const { return MaNGOS::Count(i_elements, (SPECIFIC_TYPE*)NULL); }
+        template<class SPECIFIC_TYPE> size_t Count() const { return Trinity::Count(i_elements, (SPECIFIC_TYPE*)NULL); }
 
-        template<class SPECIFIC_TYPE> SPECIFIC_TYPE* find(OBJECT_HANDLE hdl, SPECIFIC_TYPE *fake) { return MaNGOS::Find(i_elements, hdl,fake); }
+        template<class SPECIFIC_TYPE> SPECIFIC_TYPE* find(OBJECT_HANDLE hdl, SPECIFIC_TYPE *fake) { return Trinity::Find(i_elements, hdl,fake); }
 
         /// find a specific type of object in the container
-        template<class SPECIFIC_TYPE> const SPECIFIC_TYPE* find(OBJECT_HANDLE hdl, SPECIFIC_TYPE *fake) const { return MaNGOS::Find(i_elements, hdl,fake); }
+        template<class SPECIFIC_TYPE> const SPECIFIC_TYPE* find(OBJECT_HANDLE hdl, SPECIFIC_TYPE *fake) const { return Trinity::Find(i_elements, hdl,fake); }
 
         /// inserts a specific object into the container
         template<class SPECIFIC_TYPE> bool insert(OBJECT_HANDLE hdl, SPECIFIC_TYPE *obj)
         {
-            SPECIFIC_TYPE* t = MaNGOS::Insert(i_elements, obj, hdl);
+            SPECIFIC_TYPE* t = Trinity::Insert(i_elements, obj, hdl);
             return (t != NULL);
         }
@@ -116,5 +118,5 @@
         template<class SPECIFIC_TYPE> bool remove(SPECIFIC_TYPE* obj, OBJECT_HANDLE hdl)
         {
-            SPECIFIC_TYPE* t = MaNGOS::Remove(i_elements, obj, hdl);
+            SPECIFIC_TYPE* t = Trinity::Remove(i_elements, obj, hdl);
             return (t != NULL);
         }
Index: trunk/src/framework/GameSystem/TypeContainerVisitor.h
===================================================================
--- trunk/src/framework/GameSystem/TypeContainerVisitor.h (revision 2)
+++ trunk/src/framework/GameSystem/TypeContainerVisitor.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,14 +11,14 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_TYPECONTAINERVISITOR_H
-#define MANGOS_TYPECONTAINERVISITOR_H
+#ifndef TRINITY_TYPECONTAINERVISITOR_H
+#define TRINITY_TYPECONTAINERVISITOR_H
 
 /*
@@ -96,5 +98,5 @@
 
 template<class VISITOR, class TYPE_CONTAINER>
-class MANGOS_DLL_DECL TypeContainerVisitor
+class TRINITY_DLL_DECL TypeContainerVisitor
 {
     public:
Index: trunk/src/framework/GameSystem/Grid.h
===================================================================
--- trunk/src/framework/GameSystem/Grid.h (revision 2)
+++ trunk/src/framework/GameSystem/Grid.h (revision 44)
@@ -1,4 +1,6 @@
 /* 
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ *
+ * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -9,18 +11,18 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#ifndef MANGOS_GRID_H
-#define MANGOS_GRID_H
+#ifndef TRINITY_GRID_H
+#define TRINITY_GRID_H
 
 /*
   @class Grid
-  Grid is a logical segment of the game world represented inside MaNGOS.
+  Grid is a logical segment of the game world represented inside TrinIty.
   Grid is bind at compile time to a particular type of object which
   we call it the object of interested.  There are many types of loader,
@@ -44,7 +46,7 @@
 class WORLD_OBJECT_TYPES,
 class GRID_OBJECT_TYPES,
-class ThreadModel = MaNGOS::SingleThreaded<ACTIVE_OBJECT>
+class ThreadModel = Trinity::SingleThreaded<ACTIVE_OBJECT>
 >
-class MANGOS_DLL_DECL Grid
+class TRINITY_DLL_DECL Grid
 {
     // allows the GridLoader to access its internals
Index: trunk/win/VC71/game.vcproj
===================================================================
--- trunk/win/VC71/game.vcproj (revision 39)
+++ trunk/win/VC71/game.vcproj (revision 44)
@@ -353,4 +353,68 @@
 			</File>
 			<File
+				RelativePath="..\..\src\game\OutdoorPvP.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvP.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPEP.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPEP.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPHP.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPHP.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPMgr.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPMgr.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPNA.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPNA.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPSI.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPSI.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPTF.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPTF.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPZM.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPZM.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\game\Path.h">
 			</File>
@@ -636,4 +700,12 @@
 			<File
 				RelativePath="..\..\src\game\ObjectMgr.h">
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.h"
+				>
 			</File>
 			<File
@@ -847,60 +919,4 @@
 			<File
 				RelativePath="..\..\src\game\ThreatManager.h">
-			</File>
-		</Filter>
-		<Filter
-			Name="IRC"
-			>
-			<File
-				RelativePath="..\..\src\game\IRCClient.cpp"
-				>
-			</File>	
-			<File
-				RelativePath="..\..\src\game\IRCClient.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCCmd.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCCmd.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCCmde.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCConf.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCFunc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCIO.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCLog.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCLog.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCSock.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\MCS_OnlinePlayers.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\MCS_OnlinePlayers.h"
-				>
 			</File>
 		</Filter>
Index: trunk/win/VC80/game.vcproj
===================================================================
--- trunk/win/VC80/game.vcproj (revision 39)
+++ trunk/win/VC80/game.vcproj (revision 44)
@@ -648,4 +648,68 @@
 			</File>
 			<File
+				RelativePath="..\..\src\game\OutdoorPvP.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvP.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPEP.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPEP.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPHP.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPHP.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPMgr.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPMgr.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPNA.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPNA.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPSI.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPSI.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPTF.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPTF.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPZM.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPZM.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\game\Path.h"
 				>
@@ -1028,4 +1092,12 @@
 			</File>
 			<File
+				RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\game\Pet.cpp"
 				>
@@ -1305,60 +1377,4 @@
 			<File
 				RelativePath="..\..\src\game\ThreatManager.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="IRC"
-			>
-			<File
-				RelativePath="..\..\src\game\IRCClient.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCClient.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCCmd.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCCmd.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCCmde.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCConf.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCFunc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCIO.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCLog.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCLog.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCSock.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\MCS_OnlinePlayers.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\MCS_OnlinePlayers.h"
 				>
 			</File>
Index: trunk/win/VC90/game.vcproj
===================================================================
--- trunk/win/VC90/game.vcproj (revision 39)
+++ trunk/win/VC90/game.vcproj (revision 44)
@@ -653,4 +653,68 @@
 			</File>
 			<File
+				RelativePath="..\..\src\game\OutdoorPvP.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvP.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPEP.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPEP.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPHP.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPHP.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPMgr.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPMgr.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPNA.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPNA.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPSI.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPSI.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPTF.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPTF.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPZM.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPZM.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\game\Path.h"
 				>
@@ -1033,4 +1097,12 @@
 			</File>
 			<File
+				RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\game\Pet.cpp"
 				>
@@ -1310,60 +1382,4 @@
 			<File
 				RelativePath="..\..\src\game\ThreatManager.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="IRC"
-			>
-			<File
-				RelativePath="..\..\src\game\IRCClient.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCClient.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCCmd.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCCmd.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCCmde.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCConf.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCFunc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCIO.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCLog.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCLog.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\IRCSock.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\MCS_OnlinePlayers.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\game\MCS_OnlinePlayers.h"
 				>
 			</File>
Index: trunk/win/TrinityCore&Script VC80.sln
===================================================================
--- trunk/win/TrinityCore&Script VC80.sln (revision 37)
+++ trunk/win/TrinityCore&Script VC80.sln (revision 44)
@@ -39,10 +39,10 @@
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScriptsFull", "..\src\bindings\scripts\VC80\80ScriptDev2.vcproj", "{4295C8A9-79B7-4354-8064-F05FB9CA0C96}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TrinityScript", "..\src\bindings\scripts\VC80\80ScriptDev2.vcproj", "{4295C8A9-79B7-4354-8064-F05FB9CA0C96}"
 	ProjectSection(ProjectDependencies) = postProject
 		{A3A04E47-43A2-4C08-90B3-029CEF558594} = {A3A04E47-43A2-4C08-90B3-029CEF558594}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ACEWraper", "VC80\ACE_vc8.vcproj", "{AD537C9A-FECA-1BAD-6757-8A6348EA12C8}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ACEWrappers", "VC80\ACE_vc8.vcproj", "{AD537C9A-FECA-1BAD-6757-8A6348EA12C8}"
 EndProject
 Global
Index: trunk/sql/tools/Makefile.am
===================================================================
--- trunk/sql/tools/Makefile.am (revision 23)
+++ trunk/sql/tools/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/sql/updates/mangos_string_to_trinity_string.sql
===================================================================
--- trunk/sql/updates/mangos_string_to_trinity_string.sql (revision 44)
+++ trunk/sql/updates/mangos_string_to_trinity_string.sql (revision 44)
@@ -0,0 +1,1 @@
+ALTER TABLE `mangos_string` RENAME TO `trinity_string`;
Index: trunk/sql/updates/10_world.sql
===================================================================
--- trunk/sql/updates/10_world.sql (revision 37)
+++ trunk/sql/updates/10_world.sql (revision 44)
@@ -16,7 +16,7 @@
 
 
-DELETE FROM mangos_string WHERE entry IN (711,712);
-DELETE FROM mangos_string WHERE entry BETWEEN 730 AND 745;
-INSERT INTO mangos_string (entry, content_default) VALUES
+DELETE FROM trinity_string WHERE entry IN (711,712);
+DELETE FROM trinity_string WHERE entry BETWEEN 730 AND 745;
+INSERT INTO trinity_string (entry, content_default) VALUES
     (711,'Your group is too large for this battleground. Please regroup to join.'),
     (712,'Your group is too large for this arena. Please regroup to join.'),
Index: trunk/sql/updates/45_characters.sql
===================================================================
--- trunk/sql/updates/45_characters.sql (revision 44)
+++ trunk/sql/updates/45_characters.sql (revision 44)
@@ -0,0 +1,13 @@
+CREATE TABLE `game_event_save` (
+ `event_id` mediumint(8) unsigned NOT NULL,
+ `state` tinyint(3) unsigned NOT NULL default '1',
+ `next_start` timestamp NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY  (`event_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `game_event_condition_save` (                    
+ `event_id` mediumint(8) unsigned NOT NULL,
+ `condition_id` mediumint(8) unsigned NOT NULL default '0',
+ `done` float default '0',
+ PRIMARY KEY  (`event_id`,`condition_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Index: trunk/sql/updates/40_world.sql
===================================================================
--- trunk/sql/updates/40_world.sql (revision 39)
+++ trunk/sql/updates/40_world.sql (revision 44)
@@ -70,6 +70,8 @@
 
 -- Add ircpm command.
+delete from `command` WHERE `name`='ircpm';
 insert into `command` (`name`, `security`, `help`) values ('ircpm', 0, 'Syntax: .ircpm <user> <text>\n\nSends a PM with <text> to <user> on IRC.');
 
 -- Add auto announce string.
-insert into `mangos_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) values('746','|cffff0000[Automatic]:|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+DELETE FROM `trinity_string` WHERE `entry`=746;
+insert into `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) values('746','|cffff0000[Automatic]:|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
Index: trunk/sql/updates/45_world.sql
===================================================================
--- trunk/sql/updates/45_world.sql (revision 44)
+++ trunk/sql/updates/45_world.sql (revision 44)
@@ -0,0 +1,68 @@
+ALTER TABLE game_event ADD COLUMN world_event tinyint(3) unsigned not null default 0 comment '0 if normal event, 1 if world event';
+
+CREATE TABLE `game_event_quest_condition` (                   
+ `quest` mediumint(8) unsigned NOT NULL default '0',         
+ `event_id` mediumint(8) unsigned NOT NULL default '0',      
+ `condition_id` mediumint(8) unsigned NOT NULL default '0',  
+ `num` float default '0',                                    
+ PRIMARY KEY  (`quest`)                                      
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+            
+CREATE TABLE `game_event_condition` (                                  
+ `event_id` mediumint(8) unsigned NOT NULL default '0',               
+ `condition_id` mediumint(8) unsigned NOT NULL default '0',           
+ `req_num` float default '0',                                         
+ `max_world_state_field` smallint(5) unsigned NOT NULL default '0',   
+ `done_world_state_field` smallint(5) unsigned NOT NULL default '0',  
+ `description` varchar(25) NOT NULL default '',                                  
+ PRIMARY KEY  (`event_id`,`condition_id`)                             
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+                      
+CREATE TABLE `game_event_npcflag` (                       
+ `guid` mediumint(8) unsigned NOT NULL default '0',      
+ `event_id` mediumint(8) unsigned NOT NULL default '0',  
+ `npcflag` int(10) unsigned NOT NULL default '0',        
+ PRIMARY KEY  (`guid`,`event_id`)                        
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+                    
+CREATE TABLE `game_event_prerequisite` (                
+ `event_id` mediumint(8) unsigned NOT NULL,            
+ `prerequisite_event` mediumint(8) unsigned NOT NULL,  
+ PRIMARY KEY  (`event_id`,`prerequisite_event`)        
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+                         
+CREATE TABLE `game_event_npc_gossip` (                    
+ `guid` int(10) unsigned NOT NULL,                       
+ `event_id` mediumint(8) unsigned NOT NULL default '0',  
+ `textid` mediumint(8) unsigned NOT NULL default '0',    
+ PRIMARY KEY  (`guid`)                                   
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+                       
+CREATE TABLE `game_event_gameobject_quest` (           
+ `id` mediumint(8) unsigned NOT NULL default '0',     
+ `quest` mediumint(8) unsigned NOT NULL default '0',  
+ `event` smallint(5) unsigned NOT NULL default '0',   
+ PRIMARY KEY  (`quest`,`event`,`id`)                  
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `game_event_npc_vendor` (                                  
+ `event` mediumint(8) unsigned NOT NULL default '0',               
+ `guid` mediumint(8) unsigned NOT NULL default '0',           
+ `item` mediumint(8) unsigned NOT NULL default '0',               
+ `maxcount` mediumint(8) unsigned NOT NULL default '0',           
+ `incrtime` mediumint(8) unsigned NOT NULL default '0',           
+ `ExtendedCost` mediumint(8) unsigned NOT NULL default '0',           
+ PRIMARY KEY  (`guid`,`item`)                             
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+ALTER TABLE game_event_creature_quest DROP PRIMARY KEY, ADD PRIMARY KEY (quest, event, id);
+
+ALTER TABLE game_event_creature DROP PRIMARY KEY, ADD PRIMARY KEY (guid, event);
+
+ALTER TABLE game_event_gameobject DROP PRIMARY KEY, ADD PRIMARY KEY (guid, event);
+
+DELETE FROM `command` WHERE `name` LIKE 'debug threatlist';
+DELETE FROM `command` WHERE `name` LIKE 'debug hostilrefs';
+INSERT INTO `command` VALUES
+('debug threatlist', 3, 'Syntax: .debug threatlist\n\n Prints out the current threatlist of the targetted creature.'),
+('debug hostilrefs', 3, 'Syntax: .debug hostilrefs\n\n Prints out the hostil refs of the targetted unit.');
Index: trunk/sql/world.sql
===================================================================
--- trunk/sql/world.sql (revision 42)
+++ trunk/sql/world.sql (revision 44)
@@ -160,5 +160,5 @@
 /*Data for the table `command` */
 
-insert  into `command`(`name`,`security`,`help`) values ('acct',0,'Syntax: .acct\r\n\r\nDisplay the access level of your account.'),('additem',3,'Syntax: .additem #itemid/[#itemname]/#shift-click-item-link #itemcount\r\n\r\nAdds the specified number of items of id #itemid (or exact (!) name $itemname in brackets, or link created by shift-click at item in inventory or recipe) to your or selected character inventory. If #itemcount is omitted, only one item will be added.\r\n.'),('additemset',3,'Syntax: .additemset #itemsetid\r\n\r\nAdd items from itemset of id #itemsetid to your or selected character inventory. Will add by one example each item from itemset.'),('addmove',2,'Syntax: .addmove #creature_guid [#waittime]\r\n\r\nAdd your current location as a waypoint for creature with guid #creature_guid. And optional add wait time.'),('announce',1,'Syntax: .announce $MessageToBroadcast\r\n\r\nSend a global message to all players online in chat log.'),('aura',3,'Syntax: .aura #spellid\r\n\r\nAdd the aura from spell #spellid to the selected Unit.'),('ban',3,'Syntax is: ban <account|ip|character> $NameOrIp $bantime $reason\r\nBan account or IP and kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'),('baninfo',3,'Syntax is: baninfo <account|ip|character>\r\nWatch full information about a specific ban.'),('bank',3,'Syntax: .bank\r\n\r\nShow your bank inventory.'),('banlist',3,'Syntax is: banlist <account|ip|character> $NameOrIp\r\nsearches the banlist for a pattern.'),('cast',3,'Syntax: .cast #spellid [triggered]\r\n  Cast #spellid to selected target. If no target selected cast to self. If \'trigered\' or part provided then spell casted with triggered flag.'),('cast back',3,'Syntax: .cast back #spellid [triggered]\r\n  Selected target will cast #spellid to your character. If \'trigered\' or part provided then spell casted with triggered flag.'),('cast dist',3,'Syntax: .cast dist #spellid [#dist [triggered]]\r\n  You will cast spell to pint at distance #dist. If \'trigered\' or part provided then spell casted with triggered flag. Not all spells can be casted as area spells.'),('cast self',3,'Syntax: .cast self #spellid [triggered]\r\nCast #spellid by target at target itself. If \'trigered\' or part provided then spell casted with triggered flag.'),('cast target',3,'Syntax: .cast target #spellid [triggered]\r\n  Selected target will cast #spellid to his victim. If \'trigered\' or part provided then spell casted with triggered flag.'),('combatstop',2,'Syntax: .combatstop [$playername]\r\nStop combat for selected character. If selected non-player then command applied to self. If $playername provided then attempt applied to online player $playername.'),('commands',0,'Syntax: .commands\r\n\r\nDisplay a list of available commands for your account level.'),('cooldown',3,'Syntax: .cooldown [#spell_id]\r\n\r\nRemove all (if spell_id not provided) or #spel_id spell cooldown from selected character or you (if no selection).'),('damage',3,'Syntax: .damage $damage_amount [$school [$spellid]]\r\n\r\nApply $damage to target. If not $school and $spellid provided then this flat clean melee damage without any modifiers. If $school provided then damage modified by armor reduction (if school physical), and target absorbing modifiers and result applied as melee damage to target. If spell provided then damage modified and applied as spell damage. $spellid can be shift-link.'),('debug anim',2,'Syntax: .debug anim #emoteid\r\n\r\nPlay emote #emoteid for your character.'),('debug getvalue',3,'Syntax: .debug getvalue #field #isInt\r\n\r\nGet the field #field of the selected creature. If no creature is selected, get the content of your field.\r\n\r\nUse a #isInt of value 1 if the expected field content is an integer.'),('debug playsound',1,'Syntax: .debug playsound #soundid\r\n\r\nPlay sound with #soundid.\r\nSound will be play only for you. Other players do not hear this.\r\nWarning: client may have more 5000 sounds...'),('debug setvalue',3,'Syntax: .debug setvalue #field #value #isInt\r\n\r\nSet the field #field of the selected creature with value #value. If no creature is selected, set the content of your field.\r\n\r\nUse a #isInt of value 1 if #value is an integer.'),('debug standstate',2,'Syntax: .debug standstate #emoteid\r\n\r\nChange the emote of your character while standing to #emoteid.'),('debug update',3,'Syntax: .debug update #field #value\r\n\r\nUpdate the field #field of the selected character or creature with value #value.\r\n\r\nIf no #value is provided, display the content of field #field.'),('flusharenapoints',3,'Syntax: .flusharenapoints\r\n\r\nUse it to distribute arena points based on arena team ratings, and start a new week.'),('delticket',2,'Syntax: .delticket all\r\n        .delticket #num\r\n        .delticket $character_name\r\n\rall to dalete all tickets at server, $character_name to delete ticket of this character, #num to delete ticket #num.'),('demorph',2,'Syntax: .demorph\r\n\r\nDemorph the selected player.'),('die',3,'Syntax: .die\r\n\r\nKill the selected player. If no player is selected, it will kill you.'),('dismount',0,'Syntax: .dismount\r\n\r\nDismount you, if you are mounted.'),('distance',3,'Syntax: .distance\r\n\r\nDisplay the distance from your character to the selected creature.'),('event',2,'Syntax: .event #event_id\r\nShow details about event with #event_id.'),('event activelist',2,'Syntax: .event activelist\r\nShow list of currently active events.'),('event start',2,'Syntax: .event start #event_id\r\nStart event #event_id. Set start time for event to current moment (change not saved in DB).'),('event stop',2,'Syntax: .event stop #event_id\r\nStop event #event_id. Set start time for event to time in past that make current moment is event stop time (change not saved in DB).'),('explorecheat',3,'Syntax: .explorecheat #flag\r\n\r\nReveal  or hide all maps for the selected player. If no player is selected, hide or reveal maps to you.\r\n\r\nUse a #flag of value 1 to reveal, use a #flag value of 0 to hide all maps.'),('debug arena',3,'Syntax: .debug arena\r\n\r\n Toggles arena 1v1 or normal mode.'),('gm',1,'Syntax: .gm [on/off]\r\n\r\nEnable or Disable in game GM MODE or show current state of on/off not provided.'),('gm chat',1,'Syntax: .gm chat [on/off]\r\n\r\nEnable or disable chat GM MODE (show gm badge in messages) or show current state of on/off not provided.'),('gm fly',3,'Syntax: .gm fly on/off\r\nEnable/disable gm fly mode.'),('gm list',0,'Syntax: .gm list\r\n\r\nDisplay a list of available Game Masters.'),('gm visible',1,'Syntax: .gm visible on/off\r\n\r\nOutput current visibility state or make GM visible(on) and invisible(off) for other players.'),('go creature',2,'Syntax: .go creature #creature_guid\r\nTeleport your character to creature with guid #creature_guid.\r\n.gocreature #creature_name\r\nTeleport your character to creature with this name.\r\n.gocreature id #creature_id\r\nTeleport your character to a creature that was spawned from the template with this entry.\r\n*If* more than one creature is found, then you are teleported to the first that is found inside the database.'),('go graveyard',2,'Syntax: .go graveyard #graveyardId\r\n Teleport to graveyard with the graveyardId specified.'),('go grid',1,'Syntax: .go grid #gridX #gridY [#mapId]\r\n\r\nTeleport the gm to center of grid with provided indexes at map #mapId (or current map if it not provided).'),('go object',1,'Syntax: .go object #object_guid\r\nTeleport your character to gameobject with guid #object_guid'),('go trigger',2,'Syntax: .go trigger #trigger_id\r\n\r\nTeleport your character to areatrigger with id #trigger_id. Character will be teleported to trigger target if selected areatrigger is telporting trigger.'),('go xy',1,'Syntax: .go xy #x #y [#mapid]\r\n\r\nTeleport player to point with (#x,#y) coordinates at ground(water) level at map #mapid or same map if #mapid not provided.'),('go xyz',1,'Syntax: .go xyz #x #y #z [#mapid]\r\n\r\nTeleport player to point with (#x,#y,#z) coordinates at ground(water) level at map #mapid or same map if #mapid not provided.'),('go zonexy',1,'Syntax: .go zonexy #x #y [#zone]\r\n\r\nTeleport player to point with (#x,#y) client coordinates at ground(water) level in zone #zoneid or current zone if #zoneid not provided. You can look up zone using .lookup area $namepart'),('gobject add',2,'Syntax: .gobject add #id <spawntimeSecs>\r\n\r\nAdd a game object from game object templates to the world at your current location using the #id.\r\nspawntimesecs sets the spawntime, it is optional.\r\n\r\nNote: this is a copy of .gameobject.'),('gobject delete',2,'Syntax: .gobject delete #go_guid\r\nDelete gameobject with guid #go_guid.'),('gobject move',2,'Syntax: .gobject move #goguid [#x #y #z]\r\n\r\nMove gameobject #goguid to character coordinates (or to (#x,#y,#z) coordinates if its provide).'),('gobject near ',3,'Syntax: .gobject near  [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'),('gobject turn',2,'Syntax: .gobject turn #goguid \r\n\r\nSet for gameobject #goguid orientation same as current character orientation.'),('gobject target',2,'Syntax: .gobject target [#go_id|#go_name_part]\r\n\r\nLocate and show position nearest gameobject. If #go_id or #go_name_part provide then locate and show position of nearest gameobject with gameobject template id #go_id or name included #go_name_part as part.'),('goname',1,'Syntax: .goname $charactername\r\n\r\nTeleport to the given character. Either specify the character name or click on the character\'s portrait, e.g. when you are in a group.'),('gps',1,'Syntax: .gps\r\n\r\nDisplay the position information for a selected character or creature. Position information includes X, Y, Z, and orientation, map Id and zone Id'),('groupgo',1,'Syntax: .groupgo $charactername\r\n\r\nTeleport the given character and his group to you.'),('guid',2,'Syntax: .guid\r\n\r\nDisplay the GUID for the selected character.'),('guild create',2,'Syntax: .guild create $GuildLeaderName $GuildName\r\n\r\nCreate a guild named $GuildName with the player $GuildLeaderName as leader.'),('guild delete',2,'Syntax: .guild delete $GuildName\r\n\r\nDelete guild $GuildName.'),('guild invite',2,'Syntax: .guild invite $CharacterName $GuildName\r\n\r\nAdd $CharacterName into a guild $GuildName.'),('guild rank',2,'Syntax: .guild rank $CharacterName #Rank\r\n\r\nSet for $CharacterName rank #Rank in a guild.'),('guild uninvite',2,'Syntax: .guild uninvite $CharacterName\r\n\r\nRemove $CharacterName from a guild.'),('help',0,'Syntax: .help $command\r\n\r\nDisplay usage instructions for the given $command.'),('hidearea',3,'Syntax: .hidearea #areaid\r\n\r\nHide the area of #areaid to the selected character. If no character is selected, hide this area to you.'),('honor add',2,'Syntax: .honor add $amount\r\n\r\nAdd a certain amount of honor (gained today) to the selected player.'),('honor addkill',2,'Syntax: .honor addkikll\r\n\r\nAdd the targeted unit as one of your pvp kills today (you only get honor if it\'s a racial leader or a player)'),('honor update',2,'Syntax: .honor update\r\n\r\nForce the yesterday\'s honor fields to be updated with today\'s data, which will get reset for the selected player.'),('hover',3,'Syntax: .hover #flag\r\n\r\nEnable or disable hover mode for your character.\r\n\r\nUse a #flag of value 1 to enable, use a #flag value of 0 to disable hover.'),('instance unbind',3,'Syntax: .instance unbind all\r\n  All of the selected player\'s binds will be cleared.'),('instance listbinds',3,'Syntax: .instance listbinds\r\n  Lists the binds of the selected player.'),('instance stats',3,'Syntax: .instance stats\r\n  Shows statistics about instances.'),('instance savedata',3,'Syntax: .instance savedata\r\n  Save the InstanceData for the current player\'s map to the DB.'),('itemmove',2,'Syntax: .itemmove #sourceslotid #destinationslotid\r\n\r\nMove an item from slots #sourceslotid to #destinationslotid in your inventory\r\n\r\nNot yet implemented'),('kick',2,'Syntax: .kick [$charactername]\r\n\r\nKick the given character name from the world. If no character name is provided then the selected player (except for yourself) will be kicked.'),('learn',3,'Syntax: .learn #parameter\r\n\r\nSelected character learn a spell of id #parameter.'),('learn all',3,'Syntax: .learn all\r\n\r\nLearn all big set different spell maybe useful for Administaror.'),('learn all_crafts',2,'Syntax: .learn crafts\r\n\r\nLearn all professions and recipes.'),('learn all_default',1,'Syntax: .learn all_default [$playername]\r\n\r\nLearn for selected/$playername player all default spells for his race/class and spells rewarded by completed quests.'),('learn all_gm',2,'Syntax: .learn all_gm\r\n\r\nLearn all default spells for Game Masters.'),('learn all_lang',1,'Syntax: .learn all_lang\r\n\r\nLearn all languages'),('learn all_myclass',3,'Syntax: .learn all_myclass\r\n\r\nLearn all spells and talents available for his class.'),('learn all_myspells',3,'Syntax: .learn all_myspells\r\n\r\nLearn all spells (except talents and spells with first rank learned as talent) available for his class.'),('learn all_mytalents',3,'Syntax: .learn all_mytalents\r\n\r\nLearn all talents (and spells with first rank learned as talent) available for his class.'),('learn all_recipes',2,'Syntax: .learn all_recipes [$profession]\r\rLearns all recipes of specified profession and sets skill level to max.\rExample: .learn all_recipes enchanting'),('levelup',3,'Syntax: .levelup [$playername] [#numberoflevels]\r\n\r\nIncrease/decrease the level of character with $playername (or the selected if not name provided) by #numberoflevels Or +1 if no #numberoflevels provided). If #numberoflevels is omitted, the level will be increase by 1. If #numberoflevels is 0, the same level will be restarted. If no character is selected and name not provided, increase your level. Command can be used for offline character. All stats and dependent VALUESrecalculated. At level decrease talents can be reset if need. Also at level decrease equipped items with greater level requirement can be lost.'),('linkgrave',3,'Syntax: .linkgrave #graveyard_id [alliance|horde]\r\n\r\nLink current zone to graveyard for any (or alliance/horde faction ghosts). This let character ghost from zone teleport to graveyard after die if graveyard is nearest from linked to zone and accept ghost of this faction. Add only single graveyard at another map and only if no graveyards linked (or planned linked at same map).'),('list creature',3,'Syntax: .list creature #creature_id [#max_count]\r\n\r\nOutput creatures with creature id #creature_id found in world. Output creature guids and coordinates sorted by distance from character. Will be output maximum #max_count creatures. If #max_count not provided use 10 as default value.'),('list item',3,'Syntax: .list item #item_id [#max_count]\r\n\r\nOutput items with item id #item_id found in all character inventories, mails and auctions. Output item guids, item owner guid, owner account and owner name. Will be output maximum #max_count items. If #max_count not provided use 10 as default value.'),('list object',3,'Syntax: .list object #gameobject_id [#max_count]\r\n\r\nOutput gameobjects with gameobject id #gameobject_id found in world. Output gameobject guids and coordinates sorted by distance from character. Will be output maximum #max_count gameobject. If #max_count not provided use 10 as default value.'),('loadscripts',3,'Syntax: .loadscripts $scriptlibraryname\r\n\r\nUnload current and load the script library $scriptlibraryname or reload current if $scriptlibraryname omitted, in case you changed it while the server was running.'),('lockaccount',0,'Syntax: .lockaccount [on|off]\r\n\r\nAllow login from account only from current used IP or remove this requirement.'),('lookup area',1,'Syntax: .lookup area $namepart\r\n\r\nLooks up an area by $namepart, and returns all matches with their area ID\'s.'),('lookup creature',3,'Syntax: .lookup creature $namepart\r\n\r\nLooks up a creature by $namepart, and returns all matches with their creature ID\'s.'),('lookup event',2,'Syntax: .lookup event $name\r\nAttempts to find the ID of the event with the provided $name.'),('lookup faction',3,'Syntax: .lookup faction $name\r\nAttempts to find the ID of the faction with the provided $name.'),('lookup item',3,'Syntax: .lookup item $itemname\r\n\r\nLooks up an item by $itemname, and returns all matches with their Item ID\'s.'),('lookup itemset',3,'Syntax: .lookup itemset $itemname\r\n\r\nLooks up an item set by $itemname, and returns all matches with their Item set ID\'s.'),('lookup object',3,'Syntax: .lookup object $objname\r\n\r\nLooks up an gameobject by $objname, and returns all matches with their Gameobject ID\'s.'),('lookup player account',2,'Syntax : .lookup player account $account ($limit) \r\n\r\n Searchs players, which account username is $account with optional parametr $limit of results.'),('lookup player ip',2,'Syntax : .lookup player ip $ip ($limit) \r\n\r\n Searchs players, which account ast_ip is $ip with optional parametr $limit of results.'),('lookup player email',2,'Syntax : .lookup player email $email ($limit) \r\n\r\n Searchs players, which account email is $email with optional parametr $limit of results.'),('lookup quest',3,'Syntax: .lookup quest $namepart\r\n\r\nLooks up a quest by $namepart, and returns all matches with their quest ID\'s.'),('lookup skill',3,'Syntax: .lookup skill $$namepart\r\n\r\nLooks up a skill by $namepart, and returns all matches with their skill ID\'s.'),('lookup spell',3,'Syntax: .lookup spell $namepart\r\n\r\nLooks up a spell by $namepart, and returns all matches with their spell ID\'s.'),('lookup tele',1,'Syntax: .lookup tele $substring\r\n\r\nSearch and output all .tele command locations with provide $substring in name.'),('maxskill',3,'Syntax: .maxskill\r\nSets all skills of the targeted player to their maximum VALUESfor its current level.'),('Mod32Value',3,'Syntax: .Mod32Value #field #value\r\n\r\nAdd #value to field #field of your character.'),('modify arena',3,'Syntax: .modify arena #value\r\nAdd $amount arena points to the selected player.'),('modify aspeed',1,'Syntax: .modify aspeed #rate\r\n\r\nModify all speeds -run,swim,run back,swim back- of the selected player to \"normalbase speed for this move type\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),('modify bit',1,'Syntax: .modify bit #field #bit\r\n\r\nToggle the #bit bit of the #field field for the selected player. If no player is selected, modify your character.'),('modify bwalk',1,'Syntax: .modify bwalk #rate\r\n\r\nModify the speed of the selected player while running backwards to \"normal walk back speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),('modify drunk',1,'Syntax: .modify drunk #value\r\n Set drunk level to #value (0..100). Value 0 remove drunk state, 100 is max drunked state.'),('modify energy',1,'Syntax: .modify energy #energy\r\n\r\nModify the energy of the selected player. If no player is selected, modify your energy.'),('modify faction',1,'Syntax: .modify faction #factionid #flagid #npcflagid #dynamicflagid\r\n\r\nModify the faction and flags of the selected creature. Without arguments, display the faction and flags of the selected creature.'),('modify honor',1,'Syntax: .modify honor $amount\r\n\r\nAdd $amount honor points to the selected player.'),('modify hp',1,'Syntax: .modify hp #newhp\r\n\r\nModify the hp of the selected player. If no player is selected, modify your hp.'),('modify mana',1,'Syntax: .modify mana #newmana\r\n\r\nModify the mana of the selected player. If no player is selected, modify your mana.'),('modify money',1,'Syntax:\r\n.modify money #money\r\n.money #money\r\n\r\nAdd or remove money to the selected player. If no player is selected, modify your money.\r\n\r\n #gold can be negative to remove money.'),('modify morph',2,'Syntax: .modify morph #displayid\r\n\r\nChange your current model id to #displayid.'),('modify mount',1,'Syntax:\r\n.modify mount #id #speed\r\nDisplay selected player as mounted at #id creature and set speed to #speed value.'),('modify rage',1,'Syntax: .modify rage #newrage\r\n\r\nModify the rage of the selected player. If no player is selected, modify your rage.'),('modify rep',2,'Syntax: .modify rep #repId (#repvalue | $rankname [#delta])\r\nSets the selected players reputation with faction #repId to #repvalue or to $reprank.\r\nIf the reputation rank name is provided, the resulting reputation will be the lowest reputation for that rank plus the delta amount, if specified.\r\nYou can use \'.pinfo rep\' to list all known reputation ids, or use \'.lookup faction $name\' to locate a specific faction id.'),('modify scale',1,''),('modify speed',1,'Syntax:\r\n.modify speed #rate\r\n.speed #rate\r\n\r\nModify the running speed of the selected player to \"normal base run speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),('modify spell',1,''),('modify swim',1,'Syntax: .modify swim #rate\r\n\r\nModify the swim speed of the selected player to \"normal swim speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),('modify titles',1,'Syntax:\r\n.modify titles #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'),('movegens',3,'Syntax: .movegens\r\n  Show movement generators stack for selected creature or player.'),('mute',1,'Syntax: .mute $playerName $timeInMinutes\r\n\r\nDisible chat messaging for any character from account of character $playerName at $timeInMinutes minutes.'),('namego',1,'Syntax: .namego $charactername\r\n\r\nTeleport the given character to you.'),('neargrave',3,'Syntax: .neargrave [alliance|horde]\r\n\r\nFind nearest graveyard linked to zone (or only nearest from accepts alliance or horde faction ghosts).'),('notify',1,'Syntax: .notify $MessageToBroadcast\r\n\r\nSend a global message to all players online in screen.'),('npc add',2,'Syntax: .npc add #creatureid\r\n\r\nSpawn a creature by the given template id of #creatureid.'),('npc additem',2,'Syntax: .npc additem #itemId <#maxcount><#incrtime><#extendedcost>r\r\n\r\nAdd item #itemid to item list of selected vendor. Also optionally set max count item in vendor item list and time to item count restoring and items ExtendedCost.'),('npc addweapon',3,'Not yet implemented.'),('npc allowmove',3,'Syntax: .npc allowmove\r\n\r\nEnable or disable movement for the selected creature.'),('npc changelevel',2,'Syntax: .npc changelevel #level\r\n\r\nChange the level of the selected creature to #level.\r\n\r\n#level may range from 1 to 63.'),('npc delete',2,'Syntax: .npc delete [#guid]\r\n\r\nDelete creature with guid #guid (or the selected if no guid is provided)'),('npc delitem',2,'Syntax: .npc delitem #itemId\r\n\r\nRemove item #itemid from item list of selected vendor.'),('npc factionid',2,'Syntax: .npc factionid #factionid\r\n\r\nSet the faction of the selected creature to #factionid.'),('npc flag',2,'Syntax: .npc flag #npcflag\r\n\r\nSet the NPC flags of creature template of the selected creature and selected creature to #npcflag. NPC flags will applied to all creatures of selected creature template after server restart or grid unload/load.'),('npc info',3,'Syntax: .npc info\r\n\r\nDisplay a list of details for the selected creature.\r\n\r\nThe list includes:\r\n- GUID, Faction, NPC flags, Entry ID, Model ID,\r\n- Level,\r\n- Health (current/maximum),\r\n\r\n- Field flags, dynamic flags, faction template, \r\n- Position information,\r\n- and the creature type, e.g. if the creature is a vendor.'),('npc move',2,'Syntax: .npc move [#creature_guid]\r\n\r\nMove the targeted creature spawn point to your coordinates.'),('npc name',2,'Syntax: .npc name $name\r\n\r\nChange the name of the selected creature or character to $name.\r\n\r\nCommand disabled.'),('npc playemote',3,'Syntax: .npc playemote #emoteid\r\n\r\nMake the selected creature emote with an emote of id #emoteid.'),('npc setmodel',2,'Syntax: .npc setmodel #displayid\r\n\r\nChange the model id of the selected creature to #displayid.'),('npc setmovetype',2,'Syntax: .npc setmovetype [#creature_guid] stay/random/way [NODEL]\r\n\r\nSet for creature pointed by #creature_guid (or selected if #creature_guid not provided) movement type and move it to respawn position (if creature alive). Any existing waypoints for creature will be removed from the database if you do not use NODEL. If the creature is dead then movement type will applied at creature respawn.\r\nMake sure you use NODEL, if you want to keep the waypoints.'),('npc spawndist',2,'Syntax: .npc spawndist #dist\r\n\r\nAdjust spawndistance of selected creature to dist.'),('npc spawntime',2,'Syntax: .npc spawntime #time \r\n\r\nAdjust spawntime of selected creature to time.'),('npc subname',2,'Syntax: .npc subname $Name\r\n\r\nChange the subname of the selected creature or player to $Name.\r\n\r\nCommand disabled.'),('npc textemote',3,'Syntax: .npc textemote #emoteid\r\n\r\nMake the selected creature to do textemote with an emote of id #emoteid.'),('npc whisper',1,'Syntax: .npc whisper #playerguid #text\r\nMake the selected npc whisper #text to  #playerguid.'),('password',0,'Syntax: .password $old_password $new_password $new_password\r\n\r\nChange your account password.'),('pinfo',2,'Syntax: .pinfo [$player_name] [rep]\r\n\r\nOutput account information for selected player or player find by $player_name. If \"rep\" parameter provided show reputation information for player.'),('plimit',3,'Syntax: .plimit [#num|-1|-2|-3|reset|player|moderator|gamemaster|administrator]\r\n\r\nWithout arg show current player amount and security level limitations for login to server, with arg set player linit ($num > 0) or securiti limitation ($num < 0 or security leme name. With `reset` sets player limit to the one in the config file'),('quest add',3,'Syntax: .quest add #quest_id\r\n\r\nAdd to character quest log quest #quest_id. Quest started from item can\'t be added by this command but correct .additem call provided in command output.'),('quest complete',3,'Syntax: .quest complete #questid\r\nMark all quest objectives as completed for target character active quest. After this target character can go and get quest reward.'),('quest remove',3,'Syntax: .quest remove #quest_id\r\n\r\nSet quest #quest_id state to not completed and not active (and remove from active quest list) for selected player.'),('recall',1,'Syntax: .recall [$playername]\r\n\r\nTeleport $playername or selected player to the place where he has been before last use of a teleportation command. If no $playername is entered and no player is selected, it will teleport you.'),('reload',3,'Syntax: .reload table_name\r\n\r\nReload table `table_name` if reload support added for this table and this table can be _safe_ reloaded.'),('reload all',3,'Syntax: .reload all\r\n\r\nReload all tables with reload support added and that can be _safe_ reloaded.'),('reload all_area',3,'Syntax: .reload all_area\r\n\r\nReload all `areatrigger_*` tables if reload support added for this table and this table can be _safe_ reloaded.'),('reload all_loot',3,'Syntax: .reload all_loot\r\n\r\nReload all `*_loot_template` tables. This can be slow operation with lags for server run.'),('reload all_quest',3,'Syntax: .reload all_quest\r\n\r\nReload all quest related tables if reload support added for this table and this table can be _safe_ reloaded.'),('reload all_spell',3,'Syntax: .reload all\r\n\r\nReload all `spell_*` tables with reload support added and that can be _safe_ reloaded.'),('reload config',3,'Syntax: .reload config\r\n\r\nReload config settings (by default stored in mangosd.conf). Not all settings can be change at reload: some new setting values will be ignored until restart, some values will applied with delay or only to new objects/maps, some values will explicitly rejected to change at reload.'),('reset all',3,'Syntax: .reset all spells\r\n\r\nSyntax: .reset all talents\r\n\r\nRequest reset spells or talents at next login each existed character.'),('reset honor',3,'Syntax:\r\n.reset honor [Playername]\r\n  Reset all honor data for targeted character.'),('reset level',3,'Syntax:\r\n.reset level [Playername]\r\n  Reset level to 1 including reset stats and talents.  Equipped items with greater level requirement can be lost.'),('reset spells',3,'Syntax:\r\n.reset spells [Playername]\r\n  Removes all non-original spells from spellbook.\r\n. Playername can be name of offline character.'),('reset stats',3,'Syntax:\r\n.reset stats [Playername]\r\n  Resets(recalculate) all stats of the targeted player to their original VALUESat current level.'),('reset talents',3,'Syntax:\r\n.reset talents [Playername]\r\n  Removes all talents of the targeted player. Playername can be name of offline character.'),('respawn',3,'Syntax: .respawn\n\nRespawn all creatures nearby, or single selected creature.'),('revive',3,'Syntax: .revive\r\n\r\nRevive the selected player. If no player is selected, it will revive you.'),('save',0,'Syntax: .save\r\n\r\nSaves your character.'),('saveall',1,'Syntax: .saveall\r\n\r\nSave all characters in game.'),('security',3,'Syntax: .security $name #level\r\n\r\nSet the security level of player $name to a level of #level.\r\n\r\n#level may range from 0 to 5.'),('sendmail',1,'Syntax: .sendmail #playername \"#subject\" \"#text\" itemid1[:count1] itemid2[:count2] ... itemidN[:countN]\r\n\r\nSend a mail to a player. Subject and mail text must be in \"\". If for itemid not provided related count values then expected 1, if count > max items in stack then items will be send in required amount stacks. All stacks amount in mail limited to 12.'),('server info',0,'Syntax: .server info\r\n\r\nDisplay server version and the number of connected players.'),('server idleshutdown',3,'Syntax: .server idleshutdown #delay|cancel\r\n\r\nShut the server down after #delay seconds if no active connections are present (no players) or cancel the restart/shutdown if cancel value is used.'),('server idlerestart',3,'Syntax: .server idlerestart #delay|cancel\r\n\r\nRestart the server after #delay seconds if no active connections are present (no players) or cancel the restart/shutdown if cancel value is used.'),('server restart',3,'Syntax: .server restart seconds\r\n\r\nRestart the server after given seconds and show \"Restart server in X\" or cancel the restart/shutdown if cancel value is used.'),('server shutdown',3,'Syntax: .server shutdown seconds\r\n\r\nShut the server down after given seconds and show \"Off server in X\" or cancel the restart/shutdown if cancel value is used.'),('setskill',3,'Syntax: .setskill #skill #level [#max]\r\n\r\nSet a skill of id #skill with a current skill value of #level and a maximum value of #max (or equal current maximum if not provide) for the selected character. If no character is selected, you learn the skill.'),('showarea',3,'Syntax: .showarea #areaid\r\n\r\nReveal the area of #areaid to the selected character. If no character is selected, reveal this area to you.'),('start',0,'Syntax: .start\r\n\r\nTeleport you to the starting area of your character.'),('taxicheat',1,'Syntax: .taxicheat on/off\r\n\r\nTemporary grant access or remove to all taxi routes for the selected character. If no character is selected, hide or reveal all routes to you.\r\n\r\nVisited taxi nodes sill accessible after removing access.'),('tele',1,'Syntax: .tele #location\r\n\r\nTeleport player to a given location.'),('tele add',3,'Syntax: .tele add $name\r\n\r\nAdd current your position to .tele command target locations list with name $name.'),('tele del',3,'Syntax: .tele del $name\r\n\r\nRemove location with name $name for .tele command locations list.'),('tele group',1,'Syntax: .tele group#location\r\n\r\nTeleport a selected player and his group members to a given location.'),('tele name',1,'Syntax: .tele name #playername #location\r\n\r\nTeleport a player to a given location.'),('ticket',2,'Syntax: .ticket on\r\n        .ticket off\r\n        .ticket #num\r\n        .ticket $character_name\r\n\r\non/off for GMs to show or not a new ticket directly, $character_name to show ticket of this character, #num to show ticket #num.'),('transport',3,'Not yet implemented.'),('unaura',3,'Syntax: .unaura #spellid\r\n\r\nRemove aura due to spell #spellid from the selected Unit.'),('unban',3,'Syntax is: unban <account|ip|character> $NameOrIp\r\nUnban account or IP.'),('unlearn',3,'Syntax: .unlearn #startspell #endspell\r\n\r\nUnlearn for selected player the range of spells between id #startspell and #endspell. If no #endspell is provided, just unlearn spell of id #startspell.'),('unmute',1,'Syntax: .unmute $playerName\r\n\r\nRestore chat messaging for any character from account of character $playerName.'),('wchange',3,'Syntax: .wchange #weathertype #status\r\n\r\nSet current weather to #weathertype with an intensity of #status.\r\n\r\n#weathertype can be 1 for rain, 2 for snow, and 3 for sand. #status can be 0 for disabled, and 1 for enabled.'),('whispers',1,'Syntax: .whispers on|off\r\nEnable/disable accepting whispers by GM from players. By default use mangosd.conf setting.'),('wp',2,'Using WP Command:\r\nEach Waypoint Command has it\'s own description!'),('wp add',2,'Syntax: .wp add [#creature_guid or Select a Creature]'),('wp export',3,'Syntax: .wp export [#creature_guid or Select a Creature] $filename'),('wp import',3,'Syntax: .wp import $filename'),('wp modify',2,'Syntax: .wp modify [#creature_guid or Select a Creature]\r\nadd - Add a waypoint after the selected visual\r\nwaittime $time\r\nemote ID\r\nspell ID\r\ntext1| text2| text3| text4| text5 <text>\r\nmodel1 ID\r\nmodel2 ID\r\nmove(moves wp to player pos)\r\ndel (deletes the wp)\r\n\r\nOnly one parameter per time!'),('wp show',2,'Syntax: .wp show [#creature_guid or Select a Creature]\r\non\r\nfirst\r\nlast\r\noff\r\ninfo\r\n\r\nFor using info you have to do first show on and than select a Visual-Waypoint and do the show info!'),('ircpm',0,'Syntax: .ircpm <user> <text>\n\nSends a PM with <text> to <user> on IRC.'), ('group leader', 3, 'Syntax: .group leader [name]\n\nSets the leader of the group to [name] or targetted player or yourself (depending on which is specified).'), ('group remove', 3, 'Syntax: .group remove <name>\n\nRemoves <name> from the group. If name is not specified, removes targetted player from group. If no name is specified and no specified target, you will be removed'),('group disband', 3, 'Syntax: .group disband [name]\n\n Disbands the group of specified name (or targetted player if no valid name is specified) or yourself if no target/name is specified.'), ('object state', 3, 'Syntax: .gobject state <guid> <state>\n\n Sets the state of GameObect <guid> (can be shift-clicked into chat) to <state>. If <state> is negative, sends Object Despawn Animation.');
+insert  into `command`(`name`,`security`,`help`) values ('acct',0,'Syntax: .acct\r\n\r\nDisplay the access level of your account.'),('additem',3,'Syntax: .additem #itemid/[#itemname]/#shift-click-item-link #itemcount\r\n\r\nAdds the specified number of items of id #itemid (or exact (!) name $itemname in brackets, or link created by shift-click at item in inventory or recipe) to your or selected character inventory. If #itemcount is omitted, only one item will be added.\r\n.'),('additemset',3,'Syntax: .additemset #itemsetid\r\n\r\nAdd items from itemset of id #itemsetid to your or selected character inventory. Will add by one example each item from itemset.'),('addmove',2,'Syntax: .addmove #creature_guid [#waittime]\r\n\r\nAdd your current location as a waypoint for creature with guid #creature_guid. And optional add wait time.'),('announce',1,'Syntax: .announce $MessageToBroadcast\r\n\r\nSend a global message to all players online in chat log.'),('aura',3,'Syntax: .aura #spellid\r\n\r\nAdd the aura from spell #spellid to the selected Unit.'),('ban',3,'Syntax is: ban <account|ip|character> $NameOrIp $bantime $reason\r\nBan account or IP and kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'),('baninfo',3,'Syntax is: baninfo <account|ip|character>\r\nWatch full information about a specific ban.'),('bank',3,'Syntax: .bank\r\n\r\nShow your bank inventory.'),('banlist',3,'Syntax is: banlist <account|ip|character> $NameOrIp\r\nsearches the banlist for a pattern.'),('cast',3,'Syntax: .cast #spellid [triggered]\r\n  Cast #spellid to selected target. If no target selected cast to self. If \'trigered\' or part provided then spell casted with triggered flag.'),('cast back',3,'Syntax: .cast back #spellid [triggered]\r\n  Selected target will cast #spellid to your character. If \'trigered\' or part provided then spell casted with triggered flag.'),('cast dist',3,'Syntax: .cast dist #spellid [#dist [triggered]]\r\n  You will cast spell to pint at distance #dist. If \'trigered\' or part provided then spell casted with triggered flag. Not all spells can be casted as area spells.'),('cast self',3,'Syntax: .cast self #spellid [triggered]\r\nCast #spellid by target at target itself. If \'trigered\' or part provided then spell casted with triggered flag.'),('cast target',3,'Syntax: .cast target #spellid [triggered]\r\n  Selected target will cast #spellid to his victim. If \'trigered\' or part provided then spell casted with triggered flag.'),('combatstop',2,'Syntax: .combatstop [$playername]\r\nStop combat for selected character. If selected non-player then command applied to self. If $playername provided then attempt applied to online player $playername.'),('commands',0,'Syntax: .commands\r\n\r\nDisplay a list of available commands for your account level.'),('cooldown',3,'Syntax: .cooldown [#spell_id]\r\n\r\nRemove all (if spell_id not provided) or #spel_id spell cooldown from selected character or you (if no selection).'),('damage',3,'Syntax: .damage $damage_amount [$school [$spellid]]\r\n\r\nApply $damage to target. If not $school and $spellid provided then this flat clean melee damage without any modifiers. If $school provided then damage modified by armor reduction (if school physical), and target absorbing modifiers and result applied as melee damage to target. If spell provided then damage modified and applied as spell damage. $spellid can be shift-link.'),('debug anim',2,'Syntax: .debug anim #emoteid\r\n\r\nPlay emote #emoteid for your character.'),('debug getvalue',3,'Syntax: .debug getvalue #field #isInt\r\n\r\nGet the field #field of the selected creature. If no creature is selected, get the content of your field.\r\n\r\nUse a #isInt of value 1 if the expected field content is an integer.'),('debug playsound',1,'Syntax: .debug playsound #soundid\r\n\r\nPlay sound with #soundid.\r\nSound will be play only for you. Other players do not hear this.\r\nWarning: client may have more 5000 sounds...'),('debug setvalue',3,'Syntax: .debug setvalue #field #value #isInt\r\n\r\nSet the field #field of the selected creature with value #value. If no creature is selected, set the content of your field.\r\n\r\nUse a #isInt of value 1 if #value is an integer.'),('debug standstate',2,'Syntax: .debug standstate #emoteid\r\n\r\nChange the emote of your character while standing to #emoteid.'),('debug update',3,'Syntax: .debug update #field #value\r\n\r\nUpdate the field #field of the selected character or creature with value #value.\r\n\r\nIf no #value is provided, display the content of field #field.'),('flusharenapoints',3,'Syntax: .flusharenapoints\r\n\r\nUse it to distribute arena points based on arena team ratings, and start a new week.'),('delticket',2,'Syntax: .delticket all\r\n        .delticket #num\r\n        .delticket $character_name\r\n\rall to dalete all tickets at server, $character_name to delete ticket of this character, #num to delete ticket #num.'),('demorph',2,'Syntax: .demorph\r\n\r\nDemorph the selected player.'),('die',3,'Syntax: .die\r\n\r\nKill the selected player. If no player is selected, it will kill you.'),('dismount',0,'Syntax: .dismount\r\n\r\nDismount you, if you are mounted.'),('distance',3,'Syntax: .distance\r\n\r\nDisplay the distance from your character to the selected creature.'),('event',2,'Syntax: .event #event_id\r\nShow details about event with #event_id.'),('event activelist',2,'Syntax: .event activelist\r\nShow list of currently active events.'),('event start',2,'Syntax: .event start #event_id\r\nStart event #event_id. Set start time for event to current moment (change not saved in DB).'),('event stop',2,'Syntax: .event stop #event_id\r\nStop event #event_id. Set start time for event to time in past that make current moment is event stop time (change not saved in DB).'),('explorecheat',3,'Syntax: .explorecheat #flag\r\n\r\nReveal  or hide all maps for the selected player. If no player is selected, hide or reveal maps to you.\r\n\r\nUse a #flag of value 1 to reveal, use a #flag value of 0 to hide all maps.'),('debug arena',3,'Syntax: .debug arena\r\n\r\n Toggles arena 1v1 or normal mode.'),('gm',1,'Syntax: .gm [on/off]\r\n\r\nEnable or Disable in game GM MODE or show current state of on/off not provided.'),('gm chat',1,'Syntax: .gm chat [on/off]\r\n\r\nEnable or disable chat GM MODE (show gm badge in messages) or show current state of on/off not provided.'),('gm fly',3,'Syntax: .gm fly on/off\r\nEnable/disable gm fly mode.'),('gm list',0,'Syntax: .gm list\r\n\r\nDisplay a list of available Game Masters.'),('gm visible',1,'Syntax: .gm visible on/off\r\n\r\nOutput current visibility state or make GM visible(on) and invisible(off) for other players.'),('go creature',2,'Syntax: .go creature #creature_guid\r\nTeleport your character to creature with guid #creature_guid.\r\n.gocreature #creature_name\r\nTeleport your character to creature with this name.\r\n.gocreature id #creature_id\r\nTeleport your character to a creature that was spawned from the template with this entry.\r\n*If* more than one creature is found, then you are teleported to the first that is found inside the database.'),('go graveyard',2,'Syntax: .go graveyard #graveyardId\r\n Teleport to graveyard with the graveyardId specified.'),('go grid',1,'Syntax: .go grid #gridX #gridY [#mapId]\r\n\r\nTeleport the gm to center of grid with provided indexes at map #mapId (or current map if it not provided).'),('go object',1,'Syntax: .go object #object_guid\r\nTeleport your character to gameobject with guid #object_guid'),('go trigger',2,'Syntax: .go trigger #trigger_id\r\n\r\nTeleport your character to areatrigger with id #trigger_id. Character will be teleported to trigger target if selected areatrigger is telporting trigger.'),('go xy',1,'Syntax: .go xy #x #y [#mapid]\r\n\r\nTeleport player to point with (#x,#y) coordinates at ground(water) level at map #mapid or same map if #mapid not provided.'),('go xyz',1,'Syntax: .go xyz #x #y #z [#mapid]\r\n\r\nTeleport player to point with (#x,#y,#z) coordinates at ground(water) level at map #mapid or same map if #mapid not provided.'),('go zonexy',1,'Syntax: .go zonexy #x #y [#zone]\r\n\r\nTeleport player to point with (#x,#y) client coordinates at ground(water) level in zone #zoneid or current zone if #zoneid not provided. You can look up zone using .lookup area $namepart'),('gobject add',2,'Syntax: .gobject add #id <spawntimeSecs>\r\n\r\nAdd a game object from game object templates to the world at your current location using the #id.\r\nspawntimesecs sets the spawntime, it is optional.\r\n\r\nNote: this is a copy of .gameobject.'),('gobject delete',2,'Syntax: .gobject delete #go_guid\r\nDelete gameobject with guid #go_guid.'),('gobject move',2,'Syntax: .gobject move #goguid [#x #y #z]\r\n\r\nMove gameobject #goguid to character coordinates (or to (#x,#y,#z) coordinates if its provide).'),('gobject near ',3,'Syntax: .gobject near  [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'),('gobject turn',2,'Syntax: .gobject turn #goguid \r\n\r\nSet for gameobject #goguid orientation same as current character orientation.'),('gobject target',2,'Syntax: .gobject target [#go_id|#go_name_part]\r\n\r\nLocate and show position nearest gameobject. If #go_id or #go_name_part provide then locate and show position of nearest gameobject with gameobject template id #go_id or name included #go_name_part as part.'),('goname',1,'Syntax: .goname $charactername\r\n\r\nTeleport to the given character. Either specify the character name or click on the character\'s portrait, e.g. when you are in a group.'),('gps',1,'Syntax: .gps\r\n\r\nDisplay the position information for a selected character or creature. Position information includes X, Y, Z, and orientation, map Id and zone Id'),('groupgo',1,'Syntax: .groupgo $charactername\r\n\r\nTeleport the given character and his group to you.'),('guid',2,'Syntax: .guid\r\n\r\nDisplay the GUID for the selected character.'),('guild create',2,'Syntax: .guild create $GuildLeaderName $GuildName\r\n\r\nCreate a guild named $GuildName with the player $GuildLeaderName as leader.'),('guild delete',2,'Syntax: .guild delete $GuildName\r\n\r\nDelete guild $GuildName.'),('guild invite',2,'Syntax: .guild invite $CharacterName $GuildName\r\n\r\nAdd $CharacterName into a guild $GuildName.'),('guild rank',2,'Syntax: .guild rank $CharacterName #Rank\r\n\r\nSet for $CharacterName rank #Rank in a guild.'),('guild uninvite',2,'Syntax: .guild uninvite $CharacterName\r\n\r\nRemove $CharacterName from a guild.'),('help',0,'Syntax: .help $command\r\n\r\nDisplay usage instructions for the given $command.'),('hidearea',3,'Syntax: .hidearea #areaid\r\n\r\nHide the area of #areaid to the selected character. If no character is selected, hide this area to you.'),('honor add',2,'Syntax: .honor add $amount\r\n\r\nAdd a certain amount of honor (gained today) to the selected player.'),('honor addkill',2,'Syntax: .honor addkikll\r\n\r\nAdd the targeted unit as one of your pvp kills today (you only get honor if it\'s a racial leader or a player)'),('honor update',2,'Syntax: .honor update\r\n\r\nForce the yesterday\'s honor fields to be updated with today\'s data, which will get reset for the selected player.'),('hover',3,'Syntax: .hover #flag\r\n\r\nEnable or disable hover mode for your character.\r\n\r\nUse a #flag of value 1 to enable, use a #flag value of 0 to disable hover.'),('instance unbind',3,'Syntax: .instance unbind all\r\n  All of the selected player\'s binds will be cleared.'),('instance listbinds',3,'Syntax: .instance listbinds\r\n  Lists the binds of the selected player.'),('instance stats',3,'Syntax: .instance stats\r\n  Shows statistics about instances.'),('instance savedata',3,'Syntax: .instance savedata\r\n  Save the InstanceData for the current player\'s map to the DB.'),('itemmove',2,'Syntax: .itemmove #sourceslotid #destinationslotid\r\n\r\nMove an item from slots #sourceslotid to #destinationslotid in your inventory\r\n\r\nNot yet implemented'),('kick',2,'Syntax: .kick [$charactername]\r\n\r\nKick the given character name from the world. If no character name is provided then the selected player (except for yourself) will be kicked.'),('learn',3,'Syntax: .learn #parameter\r\n\r\nSelected character learn a spell of id #parameter.'),('learn all',3,'Syntax: .learn all\r\n\r\nLearn all big set different spell maybe useful for Administaror.'),('learn all_crafts',2,'Syntax: .learn crafts\r\n\r\nLearn all professions and recipes.'),('learn all_default',1,'Syntax: .learn all_default [$playername]\r\n\r\nLearn for selected/$playername player all default spells for his race/class and spells rewarded by completed quests.'),('learn all_gm',2,'Syntax: .learn all_gm\r\n\r\nLearn all default spells for Game Masters.'),('learn all_lang',1,'Syntax: .learn all_lang\r\n\r\nLearn all languages'),('learn all_myclass',3,'Syntax: .learn all_myclass\r\n\r\nLearn all spells and talents available for his class.'),('learn all_myspells',3,'Syntax: .learn all_myspells\r\n\r\nLearn all spells (except talents and spells with first rank learned as talent) available for his class.'),('learn all_mytalents',3,'Syntax: .learn all_mytalents\r\n\r\nLearn all talents (and spells with first rank learned as talent) available for his class.'),('learn all_recipes',2,'Syntax: .learn all_recipes [$profession]\r\rLearns all recipes of specified profession and sets skill level to max.\rExample: .learn all_recipes enchanting'),('levelup',3,'Syntax: .levelup [$playername] [#numberoflevels]\r\n\r\nIncrease/decrease the level of character with $playername (or the selected if not name provided) by #numberoflevels Or +1 if no #numberoflevels provided). If #numberoflevels is omitted, the level will be increase by 1. If #numberoflevels is 0, the same level will be restarted. If no character is selected and name not provided, increase your level. Command can be used for offline character. All stats and dependent VALUESrecalculated. At level decrease talents can be reset if need. Also at level decrease equipped items with greater level requirement can be lost.'),('linkgrave',3,'Syntax: .linkgrave #graveyard_id [alliance|horde]\r\n\r\nLink current zone to graveyard for any (or alliance/horde faction ghosts). This let character ghost from zone teleport to graveyard after die if graveyard is nearest from linked to zone and accept ghost of this faction. Add only single graveyard at another map and only if no graveyards linked (or planned linked at same map).'),('list creature',3,'Syntax: .list creature #creature_id [#max_count]\r\n\r\nOutput creatures with creature id #creature_id found in world. Output creature guids and coordinates sorted by distance from character. Will be output maximum #max_count creatures. If #max_count not provided use 10 as default value.'),('list item',3,'Syntax: .list item #item_id [#max_count]\r\n\r\nOutput items with item id #item_id found in all character inventories, mails and auctions. Output item guids, item owner guid, owner account and owner name. Will be output maximum #max_count items. If #max_count not provided use 10 as default value.'),('list object',3,'Syntax: .list object #gameobject_id [#max_count]\r\n\r\nOutput gameobjects with gameobject id #gameobject_id found in world. Output gameobject guids and coordinates sorted by distance from character. Will be output maximum #max_count gameobject. If #max_count not provided use 10 as default value.'),('loadscripts',3,'Syntax: .loadscripts $scriptlibraryname\r\n\r\nUnload current and load the script library $scriptlibraryname or reload current if $scriptlibraryname omitted, in case you changed it while the server was running.'),('lockaccount',0,'Syntax: .lockaccount [on|off]\r\n\r\nAllow login from account only from current used IP or remove this requirement.'),('lookup area',1,'Syntax: .lookup area $namepart\r\n\r\nLooks up an area by $namepart, and returns all matches with their area ID\'s.'),('lookup creature',3,'Syntax: .lookup creature $namepart\r\n\r\nLooks up a creature by $namepart, and returns all matches with their creature ID\'s.'),('lookup event',2,'Syntax: .lookup event $name\r\nAttempts to find the ID of the event with the provided $name.'),('lookup faction',3,'Syntax: .lookup faction $name\r\nAttempts to find the ID of the faction with the provided $name.'),('lookup item',3,'Syntax: .lookup item $itemname\r\n\r\nLooks up an item by $itemname, and returns all matches with their Item ID\'s.'),('lookup itemset',3,'Syntax: .lookup itemset $itemname\r\n\r\nLooks up an item set by $itemname, and returns all matches with their Item set ID\'s.'),('lookup object',3,'Syntax: .lookup object $objname\r\n\r\nLooks up an gameobject by $objname, and returns all matches with their Gameobject ID\'s.'),('lookup player account',2,'Syntax : .lookup player account $account ($limit) \r\n\r\n Searchs players, which account username is $account with optional parametr $limit of results.'),('lookup player ip',2,'Syntax : .lookup player ip $ip ($limit) \r\n\r\n Searchs players, which account ast_ip is $ip with optional parametr $limit of results.'),('lookup player email',2,'Syntax : .lookup player email $email ($limit) \r\n\r\n Searchs players, which account email is $email with optional parametr $limit of results.'),('lookup quest',3,'Syntax: .lookup quest $namepart\r\n\r\nLooks up a quest by $namepart, and returns all matches with their quest ID\'s.'),('lookup skill',3,'Syntax: .lookup skill $$namepart\r\n\r\nLooks up a skill by $namepart, and returns all matches with their skill ID\'s.'),('lookup spell',3,'Syntax: .lookup spell $namepart\r\n\r\nLooks up a spell by $namepart, and returns all matches with their spell ID\'s.'),('lookup tele',1,'Syntax: .lookup tele $substring\r\n\r\nSearch and output all .tele command locations with provide $substring in name.'),('maxskill',3,'Syntax: .maxskill\r\nSets all skills of the targeted player to their maximum VALUESfor its current level.'),('Mod32Value',3,'Syntax: .Mod32Value #field #value\r\n\r\nAdd #value to field #field of your character.'),('modify arena',3,'Syntax: .modify arena #value\r\nAdd $amount arena points to the selected player.'),('modify aspeed',1,'Syntax: .modify aspeed #rate\r\n\r\nModify all speeds -run,swim,run back,swim back- of the selected player to \"normalbase speed for this move type\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),('modify bit',1,'Syntax: .modify bit #field #bit\r\n\r\nToggle the #bit bit of the #field field for the selected player. If no player is selected, modify your character.'),('modify bwalk',1,'Syntax: .modify bwalk #rate\r\n\r\nModify the speed of the selected player while running backwards to \"normal walk back speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),('modify drunk',1,'Syntax: .modify drunk #value\r\n Set drunk level to #value (0..100). Value 0 remove drunk state, 100 is max drunked state.'),('modify energy',1,'Syntax: .modify energy #energy\r\n\r\nModify the energy of the selected player. If no player is selected, modify your energy.'),('modify faction',1,'Syntax: .modify faction #factionid #flagid #npcflagid #dynamicflagid\r\n\r\nModify the faction and flags of the selected creature. Without arguments, display the faction and flags of the selected creature.'),('modify honor',1,'Syntax: .modify honor $amount\r\n\r\nAdd $amount honor points to the selected player.'),('modify hp',1,'Syntax: .modify hp #newhp\r\n\r\nModify the hp of the selected player. If no player is selected, modify your hp.'),('modify mana',1,'Syntax: .modify mana #newmana\r\n\r\nModify the mana of the selected player. If no player is selected, modify your mana.'),('modify money',1,'Syntax:\r\n.modify money #money\r\n.money #money\r\n\r\nAdd or remove money to the selected player. If no player is selected, modify your money.\r\n\r\n #gold can be negative to remove money.'),('modify morph',2,'Syntax: .modify morph #displayid\r\n\r\nChange your current model id to #displayid.'),('modify mount',1,'Syntax:\r\n.modify mount #id #speed\r\nDisplay selected player as mounted at #id creature and set speed to #speed value.'),('modify rage',1,'Syntax: .modify rage #newrage\r\n\r\nModify the rage of the selected player. If no player is selected, modify your rage.'),('modify rep',2,'Syntax: .modify rep #repId (#repvalue | $rankname [#delta])\r\nSets the selected players reputation with faction #repId to #repvalue or to $reprank.\r\nIf the reputation rank name is provided, the resulting reputation will be the lowest reputation for that rank plus the delta amount, if specified.\r\nYou can use \'.pinfo rep\' to list all known reputation ids, or use \'.lookup faction $name\' to locate a specific faction id.'),('modify scale',1,''),('modify speed',1,'Syntax:\r\n.modify speed #rate\r\n.speed #rate\r\n\r\nModify the running speed of the selected player to \"normal base run speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),('modify spell',1,''),('modify swim',1,'Syntax: .modify swim #rate\r\n\r\nModify the swim speed of the selected player to \"normal swim speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),('modify titles',1,'Syntax:\r\n.modify titles #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'),('movegens',3,'Syntax: .movegens\r\n  Show movement generators stack for selected creature or player.'),('mute',1,'Syntax: .mute $playerName $timeInMinutes\r\n\r\nDisible chat messaging for any character from account of character $playerName at $timeInMinutes minutes.'),('namego',1,'Syntax: .namego $charactername\r\n\r\nTeleport the given character to you.'),('neargrave',3,'Syntax: .neargrave [alliance|horde]\r\n\r\nFind nearest graveyard linked to zone (or only nearest from accepts alliance or horde faction ghosts).'),('notify',1,'Syntax: .notify $MessageToBroadcast\r\n\r\nSend a global message to all players online in screen.'),('npc add',2,'Syntax: .npc add #creatureid\r\n\r\nSpawn a creature by the given template id of #creatureid.'),('npc additem',2,'Syntax: .npc additem #itemId <#maxcount><#incrtime><#extendedcost>r\r\n\r\nAdd item #itemid to item list of selected vendor. Also optionally set max count item in vendor item list and time to item count restoring and items ExtendedCost.'),('npc addweapon',3,'Not yet implemented.'),('npc allowmove',3,'Syntax: .npc allowmove\r\n\r\nEnable or disable movement for the selected creature.'),('npc changelevel',2,'Syntax: .npc changelevel #level\r\n\r\nChange the level of the selected creature to #level.\r\n\r\n#level may range from 1 to 63.'),('npc delete',2,'Syntax: .npc delete [#guid]\r\n\r\nDelete creature with guid #guid (or the selected if no guid is provided)'),('npc delitem',2,'Syntax: .npc delitem #itemId\r\n\r\nRemove item #itemid from item list of selected vendor.'),('npc factionid',2,'Syntax: .npc factionid #factionid\r\n\r\nSet the faction of the selected creature to #factionid.'),('npc flag',2,'Syntax: .npc flag #npcflag\r\n\r\nSet the NPC flags of creature template of the selected creature and selected creature to #npcflag. NPC flags will applied to all creatures of selected creature template after server restart or grid unload/load.'),('npc info',3,'Syntax: .npc info\r\n\r\nDisplay a list of details for the selected creature.\r\n\r\nThe list includes:\r\n- GUID, Faction, NPC flags, Entry ID, Model ID,\r\n- Level,\r\n- Health (current/maximum),\r\n\r\n- Field flags, dynamic flags, faction template, \r\n- Position information,\r\n- and the creature type, e.g. if the creature is a vendor.'),('npc move',2,'Syntax: .npc move [#creature_guid]\r\n\r\nMove the targeted creature spawn point to your coordinates.'),('npc name',2,'Syntax: .npc name $name\r\n\r\nChange the name of the selected creature or character to $name.\r\n\r\nCommand disabled.'),('npc playemote',3,'Syntax: .npc playemote #emoteid\r\n\r\nMake the selected creature emote with an emote of id #emoteid.'),('npc setmodel',2,'Syntax: .npc setmodel #displayid\r\n\r\nChange the model id of the selected creature to #displayid.'),('npc setmovetype',2,'Syntax: .npc setmovetype [#creature_guid] stay/random/way [NODEL]\r\n\r\nSet for creature pointed by #creature_guid (or selected if #creature_guid not provided) movement type and move it to respawn position (if creature alive). Any existing waypoints for creature will be removed from the database if you do not use NODEL. If the creature is dead then movement type will applied at creature respawn.\r\nMake sure you use NODEL, if you want to keep the waypoints.'),('npc spawndist',2,'Syntax: .npc spawndist #dist\r\n\r\nAdjust spawndistance of selected creature to dist.'),('npc spawntime',2,'Syntax: .npc spawntime #time \r\n\r\nAdjust spawntime of selected creature to time.'),('npc subname',2,'Syntax: .npc subname $Name\r\n\r\nChange the subname of the selected creature or player to $Name.\r\n\r\nCommand disabled.'),('npc textemote',3,'Syntax: .npc textemote #emoteid\r\n\r\nMake the selected creature to do textemote with an emote of id #emoteid.'),('npc whisper',1,'Syntax: .npc whisper #playerguid #text\r\nMake the selected npc whisper #text to  #playerguid.'),('password',0,'Syntax: .password $old_password $new_password $new_password\r\n\r\nChange your account password.'),('pinfo',2,'Syntax: .pinfo [$player_name] [rep]\r\n\r\nOutput account information for selected player or player find by $player_name. If \"rep\" parameter provided show reputation information for player.'),('plimit',3,'Syntax: .plimit [#num|-1|-2|-3|reset|player|moderator|gamemaster|administrator]\r\n\r\nWithout arg show current player amount and security level limitations for login to server, with arg set player linit ($num > 0) or securiti limitation ($num < 0 or security leme name. With `reset` sets player limit to the one in the config file'),('quest add',3,'Syntax: .quest add #quest_id\r\n\r\nAdd to character quest log quest #quest_id. Quest started from item can\'t be added by this command but correct .additem call provided in command output.'),('quest complete',3,'Syntax: .quest complete #questid\r\nMark all quest objectives as completed for target character active quest. After this target character can go and get quest reward.'),('quest remove',3,'Syntax: .quest remove #quest_id\r\n\r\nSet quest #quest_id state to not completed and not active (and remove from active quest list) for selected player.'),('recall',1,'Syntax: .recall [$playername]\r\n\r\nTeleport $playername or selected player to the place where he has been before last use of a teleportation command. If no $playername is entered and no player is selected, it will teleport you.'),('reload',3,'Syntax: .reload table_name\r\n\r\nReload table `table_name` if reload support added for this table and this table can be _safe_ reloaded.'),('reload all',3,'Syntax: .reload all\r\n\r\nReload all tables with reload support added and that can be _safe_ reloaded.'),('reload all_area',3,'Syntax: .reload all_area\r\n\r\nReload all `areatrigger_*` tables if reload support added for this table and this table can be _safe_ reloaded.'),('reload all_loot',3,'Syntax: .reload all_loot\r\n\r\nReload all `*_loot_template` tables. This can be slow operation with lags for server run.'),('reload all_quest',3,'Syntax: .reload all_quest\r\n\r\nReload all quest related tables if reload support added for this table and this table can be _safe_ reloaded.'),('reload all_spell',3,'Syntax: .reload all\r\n\r\nReload all `spell_*` tables with reload support added and that can be _safe_ reloaded.'),('reload config',3,'Syntax: .reload config\r\n\r\nReload config settings (by default stored in mangosd.conf). Not all settings can be change at reload: some new setting values will be ignored until restart, some values will applied with delay or only to new objects/maps, some values will explicitly rejected to change at reload.'),('reset all',3,'Syntax: .reset all spells\r\n\r\nSyntax: .reset all talents\r\n\r\nRequest reset spells or talents at next login each existed character.'),('reset honor',3,'Syntax:\r\n.reset honor [Playername]\r\n  Reset all honor data for targeted character.'),('reset level',3,'Syntax:\r\n.reset level [Playername]\r\n  Reset level to 1 including reset stats and talents.  Equipped items with greater level requirement can be lost.'),('reset spells',3,'Syntax:\r\n.reset spells [Playername]\r\n  Removes all non-original spells from spellbook.\r\n. Playername can be name of offline character.'),('reset stats',3,'Syntax:\r\n.reset stats [Playername]\r\n  Resets(recalculate) all stats of the targeted player to their original VALUESat current level.'),('reset talents',3,'Syntax:\r\n.reset talents [Playername]\r\n  Removes all talents of the targeted player. Playername can be name of offline character.'),('respawn',3,'Syntax: .respawn\n\nRespawn all creatures nearby, or single selected creature.'),('revive',3,'Syntax: .revive\r\n\r\nRevive the selected player. If no player is selected, it will revive you.'),('save',0,'Syntax: .save\r\n\r\nSaves your character.'),('saveall',1,'Syntax: .saveall\r\n\r\nSave all characters in game.'),('security',3,'Syntax: .security $name #level\r\n\r\nSet the security level of player $name to a level of #level.\r\n\r\n#level may range from 0 to 5.'),('sendmail',1,'Syntax: .sendmail #playername \"#subject\" \"#text\" itemid1[:count1] itemid2[:count2] ... itemidN[:countN]\r\n\r\nSend a mail to a player. Subject and mail text must be in \"\". If for itemid not provided related count values then expected 1, if count > max items in stack then items will be send in required amount stacks. All stacks amount in mail limited to 12.'),('server info',0,'Syntax: .server info\r\n\r\nDisplay server version and the number of connected players.'),('server idleshutdown',3,'Syntax: .server idleshutdown #delay|cancel\r\n\r\nShut the server down after #delay seconds if no active connections are present (no players) or cancel the restart/shutdown if cancel value is used.'),('server idlerestart',3,'Syntax: .server idlerestart #delay|cancel\r\n\r\nRestart the server after #delay seconds if no active connections are present (no players) or cancel the restart/shutdown if cancel value is used.'),('server restart',3,'Syntax: .server restart seconds\r\n\r\nRestart the server after given seconds and show \"Restart server in X\" or cancel the restart/shutdown if cancel value is used.'),('server shutdown',3,'Syntax: .server shutdown seconds\r\n\r\nShut the server down after given seconds and show \"Off server in X\" or cancel the restart/shutdown if cancel value is used.'),('setskill',3,'Syntax: .setskill #skill #level [#max]\r\n\r\nSet a skill of id #skill with a current skill value of #level and a maximum value of #max (or equal current maximum if not provide) for the selected character. If no character is selected, you learn the skill.'),('showarea',3,'Syntax: .showarea #areaid\r\n\r\nReveal the area of #areaid to the selected character. If no character is selected, reveal this area to you.'),('start',0,'Syntax: .start\r\n\r\nTeleport you to the starting area of your character.'),('taxicheat',1,'Syntax: .taxicheat on/off\r\n\r\nTemporary grant access or remove to all taxi routes for the selected character. If no character is selected, hide or reveal all routes to you.\r\n\r\nVisited taxi nodes sill accessible after removing access.'),('tele',1,'Syntax: .tele #location\r\n\r\nTeleport player to a given location.'),('tele add',3,'Syntax: .tele add $name\r\n\r\nAdd current your position to .tele command target locations list with name $name.'),('tele del',3,'Syntax: .tele del $name\r\n\r\nRemove location with name $name for .tele command locations list.'),('tele group',1,'Syntax: .tele group#location\r\n\r\nTeleport a selected player and his group members to a given location.'),('tele name',1,'Syntax: .tele name #playername #location\r\n\r\nTeleport a player to a given location.'),('ticket',2,'Syntax: .ticket on\r\n        .ticket off\r\n        .ticket #num\r\n        .ticket $character_name\r\n\r\non/off for GMs to show or not a new ticket directly, $character_name to show ticket of this character, #num to show ticket #num.'),('transport',3,'Not yet implemented.'),('unaura',3,'Syntax: .unaura #spellid\r\n\r\nRemove aura due to spell #spellid from the selected Unit.'),('unban',3,'Syntax is: unban <account|ip|character> $NameOrIp\r\nUnban account or IP.'),('unlearn',3,'Syntax: .unlearn #startspell #endspell\r\n\r\nUnlearn for selected player the range of spells between id #startspell and #endspell. If no #endspell is provided, just unlearn spell of id #startspell.'),('unmute',1,'Syntax: .unmute $playerName\r\n\r\nRestore chat messaging for any character from account of character $playerName.'),('wchange',3,'Syntax: .wchange #weathertype #status\r\n\r\nSet current weather to #weathertype with an intensity of #status.\r\n\r\n#weathertype can be 1 for rain, 2 for snow, and 3 for sand. #status can be 0 for disabled, and 1 for enabled.'),('whispers',1,'Syntax: .whispers on|off\r\nEnable/disable accepting whispers by GM from players. By default use mangosd.conf setting.'),('wp',2,'Using WP Command:\r\nEach Waypoint Command has it\'s own description!'),('wp add',2,'Syntax: .wp add [#creature_guid or Select a Creature]'),('wp export',3,'Syntax: .wp export [#creature_guid or Select a Creature] $filename'),('wp import',3,'Syntax: .wp import $filename'),('wp modify',2,'Syntax: .wp modify [#creature_guid or Select a Creature]\r\nadd - Add a waypoint after the selected visual\r\nwaittime $time\r\nemote ID\r\nspell ID\r\ntext1| text2| text3| text4| text5 <text>\r\nmodel1 ID\r\nmodel2 ID\r\nmove(moves wp to player pos)\r\ndel (deletes the wp)\r\n\r\nOnly one parameter per time!'),('wp show',2,'Syntax: .wp show [#creature_guid or Select a Creature]\r\non\r\nfirst\r\nlast\r\noff\r\ninfo\r\n\r\nFor using info you have to do first show on and than select a Visual-Waypoint and do the show info!'),('ircpm',0,'Syntax: .ircpm <user> <text>\n\nSends a PM with <text> to <user> on IRC.'), ('group leader', 3, 'Syntax: .group leader [name]\n\nSets the leader of the group to [name] or targetted player or yourself (depending on which is specified).'), ('group remove', 3, 'Syntax: .group remove <name>\n\nRemoves <name> from the group. If name is not specified, removes targetted player from group. If no name is specified and no specified target, you will be removed'),('group disband', 3, 'Syntax: .group disband [name]\n\n Disbands the group of specified name (or targetted player if no valid name is specified) or yourself if no target/name is specified.'), ('object state', 3, 'Syntax: .gobject state <guid> <state>\n\n Sets the state of GameObect <guid> (can be shift-clicked into chat) to <state>. If <state> is negative, sends Object Despawn Animation.'), ('debug threatlist', 3, 'Syntax: .debug threatlist\n\n Prints out the current threatlist of the targetted creature.'),('debug hostilrefs', 3, 'Syntax: .debug hostilrefs\n\n Prints out the hostil refs of the targetted unit.');
 
 /*Table structure for table `creature` */
@@ -537,4 +537,5 @@
   `length` bigint(20) unsigned NOT NULL default '43200' COMMENT 'Length in hours of the event',
   `description` varchar(255) default NULL COMMENT 'Description of the event displayed in console',
+  `world_event` tinyint(3) unsigned not null default '0' COMMENT '0 if normal event, 1 if world event';
   PRIMARY KEY  (`entry`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -549,5 +550,5 @@
   `guid` int(10) unsigned NOT NULL,
   `event` smallint(6) NOT NULL default '0' COMMENT 'Put negatives values to remove during event',
-  PRIMARY KEY  (`guid`)
+  PRIMARY KEY  (`guid`,`event`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
@@ -562,8 +563,63 @@
   `quest` mediumint(8) unsigned NOT NULL default '0',
   `event` smallint(5) unsigned NOT NULL default '0',
-  PRIMARY KEY  (`id`,`quest`)
+  PRIMARY KEY  (`quest`,`event`,`id`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
 /*Data for the table `game_event_creature_quest` */
+
+CREATE TABLE `game_event_quest_condition` (                   
+ `quest` mediumint(8) unsigned NOT NULL default '0',         
+ `event_id` mediumint(8) unsigned NOT NULL default '0',      
+ `condition_id` mediumint(8) unsigned NOT NULL default '0',  
+ `num` float default '0',                                    
+ PRIMARY KEY  (`quest`)                                      
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+            
+CREATE TABLE `game_event_condition` (                                  
+ `event_id` mediumint(8) unsigned NOT NULL default '0',               
+ `condition_id` mediumint(8) unsigned NOT NULL default '0',           
+ `req_num` float default '0',                                         
+ `max_world_state_field` smallint(5) unsigned NOT NULL default '0',   
+ `done_world_state_field` smallint(5) unsigned NOT NULL default '0',  
+ `description` varchar(25) NOT NULL default '',                                  
+ PRIMARY KEY  (`event_id`,`condition_id`)                             
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+                      
+CREATE TABLE `game_event_npcflag` (                       
+ `guid` mediumint(8) unsigned NOT NULL default '0',      
+ `event_id` mediumint(8) unsigned NOT NULL default '0',  
+ `npcflag` int(10) unsigned NOT NULL default '0',        
+ PRIMARY KEY  (`guid`,`event_id`)                        
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+                    
+CREATE TABLE `game_event_prerequisite` (                
+ `event_id` mediumint(8) unsigned NOT NULL,            
+ `prerequisite_event` mediumint(8) unsigned NOT NULL,  
+ PRIMARY KEY  (`event_id`,`prerequisite_event`)        
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+                         
+CREATE TABLE `game_event_npc_gossip` (                    
+ `guid` int(10) unsigned NOT NULL,                       
+ `event_id` mediumint(8) unsigned NOT NULL default '0',  
+ `textid` mediumint(8) unsigned NOT NULL default '0',    
+ PRIMARY KEY  (`guid`)                                   
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+                       
+CREATE TABLE `game_event_gameobject_quest` (           
+ `id` mediumint(8) unsigned NOT NULL default '0',     
+ `quest` mediumint(8) unsigned NOT NULL default '0',  
+ `event` smallint(5) unsigned NOT NULL default '0',   
+ PRIMARY KEY  (`quest`,`event`,`id`)                  
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `game_event_npc_vendor` (                                  
+ `event` mediumint(8) unsigned NOT NULL default '0',               
+ `guid` mediumint(8) unsigned NOT NULL default '0',           
+ `item` mediumint(8) unsigned NOT NULL default '0',               
+ `maxcount` mediumint(8) unsigned NOT NULL default '0',           
+ `incrtime` mediumint(8) unsigned NOT NULL default '0',           
+ `ExtendedCost` mediumint(8) unsigned NOT NULL default '0',           
+ PRIMARY KEY  (`guid`,`item`)                             
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
 /*Table structure for table `game_event_gameobject` */
@@ -574,5 +630,5 @@
   `guid` int(10) unsigned NOT NULL,
   `event` smallint(6) NOT NULL default '0' COMMENT 'Put negatives values to remove during event',
-  PRIMARY KEY  (`guid`)
+  PRIMARY KEY  (`guid`,`event`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
@@ -1328,9 +1384,9 @@
 /*Data for the table `locales_quest` */
 
-/*Table structure for table `mangos_string` */
-
-DROP TABLE IF EXISTS `mangos_string`;
-
-CREATE TABLE `mangos_string` (
+/*Table structure for table `trinity_string` */
+
+DROP TABLE IF EXISTS `trinity_string`;
+
+CREATE TABLE `trinity_string` (
   `entry` mediumint(8) unsigned NOT NULL default '0',
   `content_default` text NOT NULL,
@@ -1346,7 +1402,7 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
-/*Data for the table `mangos_string` */
-
-insert  into `mangos_string`(`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`) values (1,'You should select a character or a creature.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'You should select a creature.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'|cffff0000[System Message]: %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,'|cffff0000[Event Message]: %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'There is no help for that command',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,'There is no such command',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(7,'There is no such subcommand',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(8,'Command %s have subcommands:%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(9,'Commands available to you:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(10,'Incorrect syntax.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(11,'Your account level is: %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(12,'Online players: %u (max: %u) Queued players: %u (max: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(13,'Server uptime: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(14,'Player saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(15,'All players saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(16,'There are the following active GMs on this server:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(17,'There are no GMs currently logged in on this server.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(18,'Cannot do that while flying.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(19,'Cannot do that in Battlegrounds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(20,'Target is flying you can\'t do that.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(21,'%s is flying command failed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(22,'You are not mounted so you can\'t dismount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(23,'Cannot do that while fighting.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(24,'You used it recently.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(25,'Your password can\'t be longer than 16 characters (client limit), password not changed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(26,'The password was changed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(27,'The new passwords do not match or the old password is wrong',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(28,'Your account is now locked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(29,'Your account is now unlocked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(30,', rank ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(31,' [known]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(32,' [learn]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(33,' [passive]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(34,' [talent]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(35,' [active]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(36,' [complete]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(37,' (offline)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(38,'on',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(39,'off',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(40,'You are: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(41,'visible',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(42,'invisible',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(43,'done',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(44,'You',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(45,' <unknown> ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(46,'<error>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(47,'<non-existing character>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(48,'UNKNOWN',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(49,'You must be at least level %u to enter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(50,'You must be at least level %u and have item %s to enter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(51,'Hello! Ready for some training?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(52,'Invaid item count (%u) for item %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(53,'Mail can\'t have more %u item stacks',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(100,'Global notify: ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(101,'Map: %u (%s) Zone: %u (%s) Area: %u (%s)\nX: %f Y: %f Z: %f Orientation: %f\ngrid[%u,%u]cell[%u,%u] InstanceID: %u\n ZoneX: %f ZoneY: %f\nGroundZ: %f FloorZ: %f Have height data (Map: %u VMap: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(102,'%s is already being teleported.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(103,'You can summon a player to your instance only if he is in your party with you as leader.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(104,'You cannot go to the player\'s instance because you are in a party now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(105,'You can go to the player\'s instance while not being in his party only if your GM mode is on.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(106,'You can not go to player %s from instance to instance.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(107,'You can not summon player %s from instance to instance.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(108,'You are summoning %s%s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(109,'You are being summoned by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(110,'You are teleporting %s%s to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(111,'You are being teleported by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(112,'Player (%s) does not exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(113,'Appearing at %s\'s location.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(114,'%s is appearing to your location.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(115,'Incorrect values.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(116,'No character selected.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(117,'%s is not in a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(118,'You changed HP of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(119,'%s changed your HP to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(120,'You changed MANA of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(121,'%s changed your MANA to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(122,'You changed ENERGY of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(123,'%s changed your ENERGY to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(124,'Current energy: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(125,'You changed rage of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(126,'%s changed your rage to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(127,'You changed level of %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(128,'GUID %i, faction is %i, flags is %i, npcflag is %i, DY flag is %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(129,'Wrong faction: %u (not found in factiontemplate.dbc).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(130,'You changed GUID=%i \'s Faction to %i, flags to %i, npcflag to %i, dyflag to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(131,'You changed the spellflatid=%i, val= %i, mark =%i to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(132,'%s changed your spellflatid=%i, val= %i, mark =%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(133,'%s has access to all taxi nodes now (until logout).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(134,'%s has no more access to all taxi nodes now (only visited accessible).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,'%s has given you access to all taxi nodes (until logout).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(136,'%s has removed access to all taxi nodes (only visited still accessible).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(137,'You set all speeds to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(138,'%s set all your speeds to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(139,'You set the speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(140,'%s set your speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(141,'You set the swim speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(142,'%s set your swim speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(143,'You set the backwards run speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(144,'%s set your backwards run speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(145,'You set the fly speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(146,'%s set your fly speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(147,'You set the size %2.2f of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(148,'%s set your size to %2.2f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(149,'There is no such mount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(150,'You give a mount to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(151,'%s gave you a mount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(152,'USER1: %i, ADD: %i, DIF: %i\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(153,'You take all copper of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(154,'%s took you all of your copper.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(155,'You take %i copper from %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(156,'%s took %i copper from you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(157,'You give %i copper to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(158,'%s gave you %i copper.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(159,'You hear sound %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(160,'USER2: %i, ADD: %i, RESULT: %i\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(161,'Removed bit %i in field %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(162,'Set bit %i in field %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(163,'Teleport location table is empty!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(164,'Teleport location not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(165,'Requires search parameter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(166,'There are no teleport locations matching your request.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(168,'Locations found are:\n %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(169,'Mail sent to %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(170,'You try to hear sound %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(200,'No selection.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Object GUID is: lowpart %u highpart %X',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(202,'The name was too long by %i characters.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(203,'Error, name can only contain characters A-Z and a-z.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(204,'The subname was too long by %i characters.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(205,'Not yet implemented',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(206,'Item \'%i\' \'%s\' added to list with maxcount \'%i\' and incrtime \'%i\' and extendedcost \'%i\'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(207,'Item \'%i\' not found in database.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(208,'Item \'%i\' \'%s\' deleted from vendor list',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(209,'Item \'%i\' not found in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(210,'Item \'%i\' already in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(211,'Spells of %s reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(212,'Spells of %s will reset at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(213,'Talents of %s reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(214,'Talents of %s will reset at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(215,'Your spells have been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(216,'Your talents have been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(217,'Unknown case \'%s\' for .resetall command. Type full correct case name.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(218,'Spells will reset for all players at login. Strongly recommend re-login!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(219,'Talents will reset for all players at login. Strongly recommend re-login!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(220,'Creature (GUID: %u) No waypoint found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(221,'Creature (GUID: %u) Last waypoint not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(222,'Creature (GUID: %u) No waypoint found - used \'wpguid\'. Now trying to find it by its position...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(223,'Creature (GUID: %u) No waypoints found - This is a MaNGOS db problem (single float).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(224,'Selected creature is ignored - provided GUID is used',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(225,'Creature (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(226,'You must select a visual waypoint.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(227,'No visual waypoints found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(228,'Could not create visual waypoint with creatureID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(229,'All visual waypoints removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(230,'Could not create waypoint-creature with ID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(231,'No GUID provided.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(232,'No waypoint number provided.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(233,'Argument required for \'%s\'.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(234,'Waypoint %i added to GUID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(235,'Waypoint %d added.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(236,'Waypoint changed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(237,'Waypoint %s modified.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(238,'WP export successfull.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(239,'No waypoints found inside the database.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(240,'File imported.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(241,'Waypoint removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(242,'Warning: Could not delete WP from the world with ID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(243,'This happens if the waypoint is too far away from your char.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(244,'The WP is deleted from the database, but not from the world here.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(245,'They will disappear after a server restart.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(246,'Waypoint %d: Info for creature: %s, GUID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(247,'Waittime: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(248,'Model %d: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(249,'Emote: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(250,'Spell: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(251,'Text %d: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(252,'AIScript: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(253,'Forced rename for player %s will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(254,'Forced rename for player %s (GUID #%u) will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(255,'Waypoint-Creature (GUID: %u) Not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(256,'Could not find NPC...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Creature movement type set to \'%s\', waypoints removed (if any).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(258,'Creature movement type set to \'%s\', waypoints were not removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(259,'Incorrect value, use on or off',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(260,'Value saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(261,'Value saved, you may need to rejoin or clean your client cache.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(262,'Areatrigger ID %u not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(263,'Target map or coordinates is invalid (X: %f Y: %f MapId: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(264,'Zone coordinates is invalid (X: %f Y: %f AreaId: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(265,'Zone %u (%s) is part of instanceable map %u (%s)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(266,'Nothing found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(267,'Object not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(268,'Creature not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(269,'Warning: Mob found more than once - you will be teleported to the first one found in DB.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(270,'Creature Removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Creature moved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(272,'Creature (GUID:%u) must be on the same map as player!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Game Object (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(274,'Game Object (GUID: %u) has references in not found creature %u GO list, can\'t be deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(275,'Game Object (GUID: %u) removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(276,'Game Object (GUID: %u) turned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(277,'Game Object (GUID: %u) moved',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(278,'You must select a vendor',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(279,'You must send id for item',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(280,'Vendor has too many items (max 128)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(281,'You can\'t kick self, logout instead',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(282,'Player %s kicked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(283,'Player %s not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(284,'Accepting Whisper: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(285,'Accepting Whisper: ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(286,'Accepting Whisper: OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(287,'Creature (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(288,'Tickets count: %i show new tickets: %s\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(289,'New ticket from %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(290,'Ticket of %s (Last updated: %s):\n%s ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(291,'New ticket show: ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(292,'New ticket show: OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(293,'Ticket %i doesn\'t exist',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(294,'All tickets deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(295,'Character %s ticket deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(296,'Ticket deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(297,'Spawn distance changed to: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(298,'Spawn time changed to: %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(299,'The honor of %s was set to %u!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(300,'Your chat has been disabled for %u minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(301,'You have disabled %s\'s chat for %u minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(302,'Player\'s chat is already enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(303,'Your chat has been enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(304,'You have enabled %s\'s chat.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(305,'Faction %s (%u) reputation of %s was set to %5d!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(306,'The arena points of %s was set to %u!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(307,'No faction found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(308,'Faction %i unknown!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(309,'Invalid parameter %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(310,'delta must be between 0 and %d (inclusive)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(311,'%d - |cffffffff|Hfaction:%d|h[%s]|h|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(312,' [visible]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(313,' [at war]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(314,' [peace forced]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(315,' [hidden]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(316,' [invisible forced]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(317,' [inactive]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(318,'Hated',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(319,'Hostile',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(320,'Unfriendly',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(321,'Neutral',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(322,'Friendly',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(323,'Honored',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(324,'Revered',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(325,'Exalted',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(326,'Faction %s (%u) can\'not have reputation.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(327,' [no reputation]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(328,'Characters at account %s (Id: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(329,'  %s (GUID %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(330,'No players found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(331,'Extended item cost %u not exist',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(332,'GM mode is ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(333,'GM mode is OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(334,'GM Chat Badge is ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(335,'GM Chat Badge is OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(400,'|cffff0000[System Message]:|rScripts reloaded',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(401,'You change security level of %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(402,'%s changed your security level to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(403,'You have low security level for this.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(404,'Creature movement disabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(405,'Creature movement enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(406,'Weather can\'t be changed for this zone.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(407,'Weather system disabled at server.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(408,'%s is banned for %s. Reason: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(409,'%s is banned permanently for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(410,'%s %s not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(411,'%s unbanned.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(412,'There was an error removing the ban on %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(413,'There is no such account.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(414,'There is no such character.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(415,'There is no such IP in banlist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(416,'Account %s has never been banned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(417,'Ban history for account %s:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(418,'Ban Date: %s Bantime: %s Still active: %s  Reason: %s Set by: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(419,'Inf.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(420,'Never',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(421,'Yes',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(422,'No',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(423,'IP: %s\nBan Date: %s\nUnban Date: %s\nRemaining: %s\nReason: %s\nSet by: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(424,'There is no matching IPban.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(425,'There is no matching account.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(426,'There is no banned account owning a character matching this part.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(427,'The following IPs match your pattern:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(428,'The following accounts match your query:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(429,'You learned many spells/skills.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(430,'You learned all spells for class.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(431,'You learned all talents for class.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(432,'You learned all languages.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(433,'You learned all craft skills and recipes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(434,'Could not find \'%s\'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(435,'Invalid item id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(436,'No items found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(437,'Invalid gameobject id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(438,'Found items %u: %u ( inventory %u mail %u auction %u )',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(439,'Found gameobjects %u: %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(440,'Invalid creature id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(441,'Found creatures %u: %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(442,'No area found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(443,'No item sets found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(444,'No skills found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(445,'No spells found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(446,'No quests found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(447,'No creatures found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(448,'No gameobjects found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(449,'Graveyard #%u doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(450,'Graveyard #%u already linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(451,'Graveyard #%u linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(452,'Graveyard #%u can\'t be linked to subzone or not existed zone #%u (internal error).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(453,'Graveyard can be linked to zone at another map only for all factions (no faction value).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(454,'No faction in Graveyard with id= #%u , fix your DB',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(455,'invalid team, please fix database',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(456,'any',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(457,'alliance',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(458,'horde',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(459,'Graveyard #%u (faction: %s) is nearest from linked to zone #%u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(460,'Zone #%u doesn\'t have linked graveyards.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(461,'Zone #%u doesn\'t have linked graveyards for faction: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(462,'Teleport location already exists!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(463,'Teleport location added.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(464,'Teleport location NOT added: database error.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(465,'Teleport location deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(467,'Target unit has %d auras:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(468,'id: %d eff: %d type: %d duration: %d maxduration: %d name: %s%s%s caster: %s %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(469,'Target unit has %d auras of type %d:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(470,'id: %d eff: %d name: %s%s%s caster: %s %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(471,'Quest %u not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(472,'Quest %u started from item. For correct work, please, add item to inventory and start quest in normal way: .additem %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(473,'Quest removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(474,' [rewarded]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(475,' [complete]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(476,' [active]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(477,'%s\'s Fly Mode %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(478,'Opcode %u sent to %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(479,'Character loaded successfully!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(480,'Failed to load the character!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(481,'Character dumped successfully!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(482,'Character dump failed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(483,'Spell %u broken and not allowed to cast or learn!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(484,'Skill %u (%s) for player %s set to %u and current maximum set to %u (without permanent (talent) bonuses).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(485,'Player %s must have skill %u (%s) before using this command.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(486,'Invalid skill id (%u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(487,'You learned default GM spells/skills.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(488,'You already know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(489,'Target(%s) already know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(490,'%s doesn\'t know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(491,'You already forgot that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(492,'All spell cooldowns removed for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(493,'Spell %u cooldown removed for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(494,'Command : Additem, itemId = %i, amount = %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(495,'Command : Additemset, itemsetId = %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(496,'Removed itemID = %i, amount = %i from %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(497,'Cannot create item \'%i\' (amount: %i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(498,'You need to provide a guild name!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(499,'Player not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(500,'Player already has a guild!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(501,'Guild not created! (already exists?)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(502,'No items from itemset \'%u\' found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(503,'The distance is: (3D) %f (2D) %f yards.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(504,'Item \'%i\' \'%s\' Item Slot %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(505,'Item \'%i\' doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(506,'Item \'%i\' \'%s\' Added to Slot %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(507,'Item save failed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(508,'%d - owner: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(509,'%d - sender: %s (guid: %u account: %u ) receiver: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(510,'%d - owner: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(511,'Wrong link type!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(512,'%d - |cffffffff|Hitem:%d:0:0:0:0:0:0:0|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(513,'%d - |cffffffff|Hquest:%d|h[%s]|h|r %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(514,'%d - |cffffffff|Hcreature_entry:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(515,'%d - |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(516,'%d - |cffffffff|Hgameobject_entry:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(517,'%d - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(518,'%d - |cffffffff|Hitemset:%d|h[%s %s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(519,'|cffffffff|Htele:%s|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(520,'%d - |cffffffff|Hspell:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(521,'%d - |cffffffff|Hskill:%d|h[%s %s]|h|r %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(522,'Game Object (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(523,'>> Game Object %s (GUID: %u) at %f %f %f. Orientation %f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(524,'Selected object:\n|cffffffff|Hitemset:%d|h[%s]|h|r\nGUID: %u ID: %u\nX: %f Y: %f Z: %f MapId: %u\nOrientation: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(525,'>> Add Game Object \'%i\' (%s) (GUID: %i) added at \'%f %f %f\'.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(526,'%s (lowguid: %u) movement generators stack:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(527,'   Idle',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(528,'   Random',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(529,'   Waypoint',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(530,'   Animal random',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(531,'   Confused',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(532,'   Targeted to player %s (lowguid %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(533,'   Targeted to creature %s (lowguid %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(534,'   Targeted to <NULL>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(535,'   Home movement to (X:%f Y:%f Z:%f)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(536,'   Home movement used for player?!?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(537,'   Taxi flight',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(538,'   Unknown movement generator (%u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(539,'Player selected NPC\nGUID: %u.\nFaction: %u.\nnpcFlags: %u.\nEntry: %u.\nDisplayID: %u (Native: %u).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(540,'Level: %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(541,'Health (base): %u. (max): %u. (current): %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(542,'Field Flags: %u.\nDynamic Flags: %u.\nFaction Template: %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(543,'Loot: %u Pickpocket: %u Skinning: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(544,'Position: %f %f %f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(545,'*** Is a vendor!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(546,'*** Is a trainer!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(547,'InstanceID: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(548,'Player%s %s (guid: %u) Account: %s (id: %u) GMLevel: %u Last IP: %s Last login: %s Latency: %ums',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(549,'Played time: %s Level: %u Money: %ug%us%uc',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(550,'Command .pinfo doesn\'t support \'rep\' option for offline players.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(551,'%s has explored all zones now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(552,'%s has no more explored zones.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(553,'%s has explored all zones for you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(554,'%s has hidden all zones from you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(555,'Hover enabled',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(556,'Hover disabled',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(557,'You have been leveled up (%i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(558,'You have been leveled down (%i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(559,'Your level progress has been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(560,'The area has been set as explored.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(561,'The area has been set as not explored.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(562,'GUID=%i \'s updateIndex: %i, value:  %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(563,'You change GUID=%i \'s UpdateIndex: %i value to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(564,'The value index %u is too big to %u(count: %u).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(565,'Set %u uint32 Value:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(566,'You Set %u Field:%u to uint32 Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(567,'Set %u float Value:[OPCODE]:%u [VALUE]:%f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(568,'You Set %u Field:%i to float Value: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(569,'Get %u uint32 Value:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(570,'The uint32 value of %u in %u is: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(571,'Get %u float Value:[OPCODE]:%u [VALUE]:%f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(572,'The float of %u value in %u is: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(573,'.Set32Bit:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(574,'You set Bit of Field:%u to Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(575,'.Mod32Value:[OPCODE]:%u [VALUE]:%i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(576,'You modified the value of Field:%u to Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(577,'You are now invisible.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(578,'You are now visible.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(579,'Selected player or creature not have victim.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(580,'You learned all default spells for race/class and completed quests rewarded spells.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(581,'Found near gameobjects (distance %f): %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(582,'SpawnTime: Full:%s Remain:%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(583,'%d - |cffffffff|Hgameevent:%d|h[%s]|h|r%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(584,'No event found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(585,'Event not exist!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(586,'Event %u: %s%s\nStart: %s End: %s Occurence: %s Length: %s\nNext state change: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(587,'Event %u already active!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(588,'Event %u not active!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(589,'   Point movement to (X:%f Y:%f Z:%f)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(590,'   Fear movement',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(591,'   Distract movement',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(592,'You have learned all spells in craft: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(600,'The Alliance wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(601,'The Horde wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(602,'The battle for Warsong Gulch begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(603,'The battle for Warsong Gulch begins in 30 seconds. Prepare yourselves!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(604,'Let the battle for Warsong Gulch begin!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(605,'$n captured the Horde flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(606,'$n captured the Alliance flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(607,'The Horde flag was dropped by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(608,'The Alliance Flag was dropped by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(609,'The Alliance Flag was returned to its base by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(610,'The Horde flag was returned to its base by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(611,'The Horde flag was picked up by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(612,'The Alliance Flag was picked up by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(613,'The flags are now placed at their bases.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(636,'The Battle for Eye of the Storm begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(637,'The Battle for Eye of the Storm begins in 30 seconds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(638,'The Battle for Eye of the Storm has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(650,'Alliance',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(651,'Horde',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(652,'stables',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(653,'blacksmith',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(654,'farm',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(655,'lumber mill',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(656,'mine',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(657,'The %s has taken the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(658,'$n has defended the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(659,'$n has assaulted the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(660,'$n claims the %s! If left unchallenged, the %s will control it in 1 minute!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(661,'The Battle for Arathi Basin begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(662,'The Battle for Arathi Basin begins in 30 seconds. Prepare yourselves!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(663,'The Battle for Arathi Basin has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(664,'The Alliance has gathered $1776W resources, and is near victory!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(665,'The Horde has gathered $1777W resources, and is near victory!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(666,'After your recent battle in %s our best attempts to award you a Mark of Honor failed. Enclosed you will find the Mark of Honor we were not able to deliver to you at the time. Thanks for fighting in %s!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(700,'You must be level %u to form an arena team',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(701,'One minute until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(702,'Thirty seconds until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(703,'Fifteen seconds until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(704,'The Arena battle has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(705,'You must wait %s before speaking again.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(706,'This item(s) have problems with equipping/storing in inventory.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(707,'%s wishes to not be disturbed and cannot receive whisper messages: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(708,'%s is Away from Keyboard: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(709,'Do not Disturb',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(710,'Away from Keyboard',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(740,'Someone in your party is already in three battleground queues. You cannot join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(713,'You must be level %u to join an arena team!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(714,'%s is not high enough level to join your team',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(715,'You don\'t meet Battleground level requirements',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(716,'Your arena team is full, %s cannot join it.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(739,'Someone in your party is Deserter. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(738,'Someone in your party is already in this battleground queue. (S)he must leave it before joining as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(737,'Your group has players from different battleground brakets. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(736,'Your group has players from the opposing faction. You can\'t join the battleground as a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(735,'Your group has an offline member. Please remove him before joining.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(733,'The Green Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(734,'There aren\'t enough players in this battleground. It will end soon unless some more players join to balance the fight.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(732,'The Gold Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(731,'Your group does not have enough players to join this match.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(730,'Your group has members not in your arena team. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(712,'Your group is too large for this arena. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(711,'Your group is too large for this battleground. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(800,'Invalid name',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(801,'You do not have enough gold',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(802,'You do not have enough free slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(803,'Your partner does not have enough free bag slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(804,'You do not have permission to perform that function',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(805,'Unknown language',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(806,'You don\'t know that language',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(807,'Please provide character name',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(808,'Player %s not found or offline',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(809,'Account for character %s not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(741,'You cannot teleport to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(742,'You cannot summon players to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(743,'You must be in GM mode to teleport to a player in a battleground.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(744,'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(745,'Arena testing turned %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(746,'|cffff0000[Automatic]:|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(747,'|cffffff00[|c1f40af20Announce by|r |cffff0000%s|cffffff00]:|r %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+/*Data for the table `trinity_string` */
+
+insert  into `trinity_string`(`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`) values (1,'You should select a character or a creature.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'You should select a creature.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'|cffff0000[System Message]: %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,'|cffff0000[Event Message]: %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'There is no help for that command',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,'There is no such command',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(7,'There is no such subcommand',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(8,'Command %s have subcommands:%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(9,'Commands available to you:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(10,'Incorrect syntax.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(11,'Your account level is: %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(12,'Online players: %u (max: %u) Queued players: %u (max: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(13,'Server uptime: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(14,'Player saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(15,'All players saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(16,'There are the following active GMs on this server:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(17,'There are no GMs currently logged in on this server.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(18,'Cannot do that while flying.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(19,'Cannot do that in Battlegrounds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(20,'Target is flying you can\'t do that.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(21,'%s is flying command failed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(22,'You are not mounted so you can\'t dismount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(23,'Cannot do that while fighting.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(24,'You used it recently.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(25,'Your password can\'t be longer than 16 characters (client limit), password not changed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(26,'The password was changed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(27,'The new passwords do not match or the old password is wrong',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(28,'Your account is now locked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(29,'Your account is now unlocked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(30,', rank ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(31,' [known]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(32,' [learn]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(33,' [passive]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(34,' [talent]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(35,' [active]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(36,' [complete]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(37,' (offline)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(38,'on',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(39,'off',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(40,'You are: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(41,'visible',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(42,'invisible',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(43,'done',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(44,'You',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(45,' <unknown> ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(46,'<error>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(47,'<non-existing character>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(48,'UNKNOWN',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(49,'You must be at least level %u to enter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(50,'You must be at least level %u and have item %s to enter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(51,'Hello! Ready for some training?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(52,'Invaid item count (%u) for item %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(53,'Mail can\'t have more %u item stacks',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(100,'Global notify: ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(101,'Map: %u (%s) Zone: %u (%s) Area: %u (%s)\nX: %f Y: %f Z: %f Orientation: %f\ngrid[%u,%u]cell[%u,%u] InstanceID: %u\n ZoneX: %f ZoneY: %f\nGroundZ: %f FloorZ: %f Have height data (Map: %u VMap: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(102,'%s is already being teleported.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(103,'You can summon a player to your instance only if he is in your party with you as leader.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(104,'You cannot go to the player\'s instance because you are in a party now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(105,'You can go to the player\'s instance while not being in his party only if your GM mode is on.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(106,'You can not go to player %s from instance to instance.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(107,'You can not summon player %s from instance to instance.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(108,'You are summoning %s%s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(109,'You are being summoned by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(110,'You are teleporting %s%s to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(111,'You are being teleported by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(112,'Player (%s) does not exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(113,'Appearing at %s\'s location.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(114,'%s is appearing to your location.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(115,'Incorrect values.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(116,'No character selected.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(117,'%s is not in a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(118,'You changed HP of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(119,'%s changed your HP to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(120,'You changed MANA of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(121,'%s changed your MANA to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(122,'You changed ENERGY of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(123,'%s changed your ENERGY to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(124,'Current energy: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(125,'You changed rage of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(126,'%s changed your rage to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(127,'You changed level of %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(128,'GUID %i, faction is %i, flags is %i, npcflag is %i, DY flag is %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(129,'Wrong faction: %u (not found in factiontemplate.dbc).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(130,'You changed GUID=%i \'s Faction to %i, flags to %i, npcflag to %i, dyflag to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(131,'You changed the spellflatid=%i, val= %i, mark =%i to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(132,'%s changed your spellflatid=%i, val= %i, mark =%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(133,'%s has access to all taxi nodes now (until logout).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(134,'%s has no more access to all taxi nodes now (only visited accessible).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,'%s has given you access to all taxi nodes (until logout).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(136,'%s has removed access to all taxi nodes (only visited still accessible).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(137,'You set all speeds to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(138,'%s set all your speeds to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(139,'You set the speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(140,'%s set your speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(141,'You set the swim speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(142,'%s set your swim speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(143,'You set the backwards run speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(144,'%s set your backwards run speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(145,'You set the fly speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(146,'%s set your fly speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(147,'You set the size %2.2f of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(148,'%s set your size to %2.2f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(149,'There is no such mount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(150,'You give a mount to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(151,'%s gave you a mount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(152,'USER1: %i, ADD: %i, DIF: %i\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(153,'You take all copper of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(154,'%s took you all of your copper.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(155,'You take %i copper from %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(156,'%s took %i copper from you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(157,'You give %i copper to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(158,'%s gave you %i copper.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(159,'You hear sound %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(160,'USER2: %i, ADD: %i, RESULT: %i\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(161,'Removed bit %i in field %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(162,'Set bit %i in field %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(163,'Teleport location table is empty!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(164,'Teleport location not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(165,'Requires search parameter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(166,'There are no teleport locations matching your request.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(168,'Locations found are:\n %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(169,'Mail sent to %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(170,'You try to hear sound %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(200,'No selection.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(201,'Object GUID is: lowpart %u highpart %X',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(202,'The name was too long by %i characters.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(203,'Error, name can only contain characters A-Z and a-z.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(204,'The subname was too long by %i characters.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(205,'Not yet implemented',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(206,'Item \'%i\' \'%s\' added to list with maxcount \'%i\' and incrtime \'%i\' and extendedcost \'%i\'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(207,'Item \'%i\' not found in database.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(208,'Item \'%i\' \'%s\' deleted from vendor list',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(209,'Item \'%i\' not found in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(210,'Item \'%i\' already in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(211,'Spells of %s reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(212,'Spells of %s will reset at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(213,'Talents of %s reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(214,'Talents of %s will reset at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(215,'Your spells have been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(216,'Your talents have been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(217,'Unknown case \'%s\' for .resetall command. Type full correct case name.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(218,'Spells will reset for all players at login. Strongly recommend re-login!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(219,'Talents will reset for all players at login. Strongly recommend re-login!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(220,'Creature (GUID: %u) No waypoint found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(221,'Creature (GUID: %u) Last waypoint not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(222,'Creature (GUID: %u) No waypoint found - used \'wpguid\'. Now trying to find it by its position...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(223,'Creature (GUID: %u) No waypoints found - This is a MaNGOS db problem (single float).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(224,'Selected creature is ignored - provided GUID is used',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(225,'Creature (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(226,'You must select a visual waypoint.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(227,'No visual waypoints found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(228,'Could not create visual waypoint with creatureID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(229,'All visual waypoints removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(230,'Could not create waypoint-creature with ID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(231,'No GUID provided.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(232,'No waypoint number provided.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(233,'Argument required for \'%s\'.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(234,'Waypoint %i added to GUID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(235,'Waypoint %d added.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(236,'Waypoint changed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(237,'Waypoint %s modified.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(238,'WP export successfull.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(239,'No waypoints found inside the database.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(240,'File imported.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(241,'Waypoint removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(242,'Warning: Could not delete WP from the world with ID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(243,'This happens if the waypoint is too far away from your char.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(244,'The WP is deleted from the database, but not from the world here.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(245,'They will disappear after a server restart.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(246,'Waypoint %d: Info for creature: %s, GUID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(247,'Waittime: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(248,'Model %d: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(249,'Emote: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(250,'Spell: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(251,'Text %d: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(252,'AIScript: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(253,'Forced rename for player %s will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(254,'Forced rename for player %s (GUID #%u) will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(255,'Waypoint-Creature (GUID: %u) Not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(256,'Could not find NPC...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,'Creature movement type set to \'%s\', waypoints removed (if any).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(258,'Creature movement type set to \'%s\', waypoints were not removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(259,'Incorrect value, use on or off',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(260,'Value saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(261,'Value saved, you may need to rejoin or clean your client cache.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(262,'Areatrigger ID %u not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(263,'Target map or coordinates is invalid (X: %f Y: %f MapId: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(264,'Zone coordinates is invalid (X: %f Y: %f AreaId: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(265,'Zone %u (%s) is part of instanceable map %u (%s)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(266,'Nothing found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(267,'Object not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(268,'Creature not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(269,'Warning: Mob found more than once - you will be teleported to the first one found in DB.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(270,'Creature Removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(271,'Creature moved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(272,'Creature (GUID:%u) must be on the same map as player!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(273,'Game Object (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(274,'Game Object (GUID: %u) has references in not found creature %u GO list, can\'t be deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(275,'Game Object (GUID: %u) removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(276,'Game Object (GUID: %u) turned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(277,'Game Object (GUID: %u) moved',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(278,'You must select a vendor',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(279,'You must send id for item',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(280,'Vendor has too many items (max 128)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(281,'You can\'t kick self, logout instead',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(282,'Player %s kicked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(283,'Player %s not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(284,'Accepting Whisper: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(285,'Accepting Whisper: ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(286,'Accepting Whisper: OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(287,'Creature (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(288,'Tickets count: %i show new tickets: %s\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(289,'New ticket from %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(290,'Ticket of %s (Last updated: %s):\n%s ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(291,'New ticket show: ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(292,'New ticket show: OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(293,'Ticket %i doesn\'t exist',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(294,'All tickets deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(295,'Character %s ticket deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(296,'Ticket deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(297,'Spawn distance changed to: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(298,'Spawn time changed to: %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(299,'The honor of %s was set to %u!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(300,'Your chat has been disabled for %u minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(301,'You have disabled %s\'s chat for %u minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(302,'Player\'s chat is already enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(303,'Your chat has been enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(304,'You have enabled %s\'s chat.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(305,'Faction %s (%u) reputation of %s was set to %5d!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(306,'The arena points of %s was set to %u!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(307,'No faction found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(308,'Faction %i unknown!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(309,'Invalid parameter %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(310,'delta must be between 0 and %d (inclusive)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(311,'%d - |cffffffff|Hfaction:%d|h[%s]|h|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(312,' [visible]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(313,' [at war]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(314,' [peace forced]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(315,' [hidden]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(316,' [invisible forced]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(317,' [inactive]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(318,'Hated',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(319,'Hostile',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(320,'Unfriendly',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(321,'Neutral',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(322,'Friendly',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(323,'Honored',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(324,'Revered',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(325,'Exalted',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(326,'Faction %s (%u) can\'not have reputation.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(327,' [no reputation]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(328,'Characters at account %s (Id: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(329,'  %s (GUID %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(330,'No players found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(331,'Extended item cost %u not exist',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(332,'GM mode is ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(333,'GM mode is OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(334,'GM Chat Badge is ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(335,'GM Chat Badge is OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(400,'|cffff0000[System Message]:|rScripts reloaded',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(401,'You change security level of %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(402,'%s changed your security level to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(403,'You have low security level for this.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(404,'Creature movement disabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(405,'Creature movement enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(406,'Weather can\'t be changed for this zone.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(407,'Weather system disabled at server.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(408,'%s is banned for %s. Reason: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(409,'%s is banned permanently for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(410,'%s %s not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(411,'%s unbanned.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(412,'There was an error removing the ban on %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(413,'There is no such account.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(414,'There is no such character.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(415,'There is no such IP in banlist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(416,'Account %s has never been banned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(417,'Ban history for account %s:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(418,'Ban Date: %s Bantime: %s Still active: %s  Reason: %s Set by: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(419,'Inf.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(420,'Never',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(421,'Yes',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(422,'No',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(423,'IP: %s\nBan Date: %s\nUnban Date: %s\nRemaining: %s\nReason: %s\nSet by: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(424,'There is no matching IPban.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(425,'There is no matching account.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(426,'There is no banned account owning a character matching this part.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(427,'The following IPs match your pattern:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(428,'The following accounts match your query:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(429,'You learned many spells/skills.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(430,'You learned all spells for class.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(431,'You learned all talents for class.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(432,'You learned all languages.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(433,'You learned all craft skills and recipes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(434,'Could not find \'%s\'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(435,'Invalid item id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(436,'No items found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(437,'Invalid gameobject id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(438,'Found items %u: %u ( inventory %u mail %u auction %u )',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(439,'Found gameobjects %u: %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(440,'Invalid creature id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(441,'Found creatures %u: %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(442,'No area found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(443,'No item sets found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(444,'No skills found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(445,'No spells found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(446,'No quests found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(447,'No creatures found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(448,'No gameobjects found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(449,'Graveyard #%u doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(450,'Graveyard #%u already linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(451,'Graveyard #%u linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(452,'Graveyard #%u can\'t be linked to subzone or not existed zone #%u (internal error).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(453,'Graveyard can be linked to zone at another map only for all factions (no faction value).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(454,'No faction in Graveyard with id= #%u , fix your DB',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(455,'invalid team, please fix database',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(456,'any',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(457,'alliance',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(458,'horde',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(459,'Graveyard #%u (faction: %s) is nearest from linked to zone #%u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(460,'Zone #%u doesn\'t have linked graveyards.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(461,'Zone #%u doesn\'t have linked graveyards for faction: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(462,'Teleport location already exists!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(463,'Teleport location added.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(464,'Teleport location NOT added: database error.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(465,'Teleport location deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(467,'Target unit has %d auras:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(468,'id: %d eff: %d type: %d duration: %d maxduration: %d name: %s%s%s caster: %s %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(469,'Target unit has %d auras of type %d:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(470,'id: %d eff: %d name: %s%s%s caster: %s %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(471,'Quest %u not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(472,'Quest %u started from item. For correct work, please, add item to inventory and start quest in normal way: .additem %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(473,'Quest removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(474,' [rewarded]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(475,' [complete]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(476,' [active]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(477,'%s\'s Fly Mode %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(478,'Opcode %u sent to %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(479,'Character loaded successfully!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(480,'Failed to load the character!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(481,'Character dumped successfully!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(482,'Character dump failed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(483,'Spell %u broken and not allowed to cast or learn!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(484,'Skill %u (%s) for player %s set to %u and current maximum set to %u (without permanent (talent) bonuses).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(485,'Player %s must have skill %u (%s) before using this command.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(486,'Invalid skill id (%u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(487,'You learned default GM spells/skills.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(488,'You already know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(489,'Target(%s) already know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(490,'%s doesn\'t know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(491,'You already forgot that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(492,'All spell cooldowns removed for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(493,'Spell %u cooldown removed for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(494,'Command : Additem, itemId = %i, amount = %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(495,'Command : Additemset, itemsetId = %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(496,'Removed itemID = %i, amount = %i from %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(497,'Cannot create item \'%i\' (amount: %i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(498,'You need to provide a guild name!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(499,'Player not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(500,'Player already has a guild!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(501,'Guild not created! (already exists?)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(502,'No items from itemset \'%u\' found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(503,'The distance is: (3D) %f (2D) %f yards.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(504,'Item \'%i\' \'%s\' Item Slot %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(505,'Item \'%i\' doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(506,'Item \'%i\' \'%s\' Added to Slot %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(507,'Item save failed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(508,'%d - owner: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(509,'%d - sender: %s (guid: %u account: %u ) receiver: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(510,'%d - owner: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(511,'Wrong link type!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(512,'%d - |cffffffff|Hitem:%d:0:0:0:0:0:0:0|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(513,'%d - |cffffffff|Hquest:%d|h[%s]|h|r %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(514,'%d - |cffffffff|Hcreature_entry:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(515,'%d - |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(516,'%d - |cffffffff|Hgameobject_entry:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(517,'%d - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(518,'%d - |cffffffff|Hitemset:%d|h[%s %s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(519,'|cffffffff|Htele:%s|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(520,'%d - |cffffffff|Hspell:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(521,'%d - |cffffffff|Hskill:%d|h[%s %s]|h|r %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(522,'Game Object (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(523,'>> Game Object %s (GUID: %u) at %f %f %f. Orientation %f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(524,'Selected object:\n|cffffffff|Hitemset:%d|h[%s]|h|r\nGUID: %u ID: %u\nX: %f Y: %f Z: %f MapId: %u\nOrientation: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(525,'>> Add Game Object \'%i\' (%s) (GUID: %i) added at \'%f %f %f\'.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(526,'%s (lowguid: %u) movement generators stack:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(527,'   Idle',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(528,'   Random',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(529,'   Waypoint',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(530,'   Animal random',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(531,'   Confused',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(532,'   Targeted to player %s (lowguid %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(533,'   Targeted to creature %s (lowguid %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(534,'   Targeted to <NULL>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(535,'   Home movement to (X:%f Y:%f Z:%f)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(536,'   Home movement used for player?!?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(537,'   Taxi flight',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(538,'   Unknown movement generator (%u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(539,'Player selected NPC\nGUID: %u.\nFaction: %u.\nnpcFlags: %u.\nEntry: %u.\nDisplayID: %u (Native: %u).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(540,'Level: %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(541,'Health (base): %u. (max): %u. (current): %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(542,'Field Flags: %u.\nDynamic Flags: %u.\nFaction Template: %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(543,'Loot: %u Pickpocket: %u Skinning: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(544,'Position: %f %f %f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(545,'*** Is a vendor!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(546,'*** Is a trainer!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(547,'InstanceID: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(548,'Player%s %s (guid: %u) Account: %s (id: %u) GMLevel: %u Last IP: %s Last login: %s Latency: %ums',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(549,'Played time: %s Level: %u Money: %ug%us%uc',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(550,'Command .pinfo doesn\'t support \'rep\' option for offline players.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(551,'%s has explored all zones now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(552,'%s has no more explored zones.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(553,'%s has explored all zones for you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(554,'%s has hidden all zones from you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(555,'Hover enabled',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(556,'Hover disabled',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(557,'You have been leveled up (%i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(558,'You have been leveled down (%i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(559,'Your level progress has been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(560,'The area has been set as explored.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(561,'The area has been set as not explored.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(562,'GUID=%i \'s updateIndex: %i, value:  %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(563,'You change GUID=%i \'s UpdateIndex: %i value to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(564,'The value index %u is too big to %u(count: %u).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(565,'Set %u uint32 Value:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(566,'You Set %u Field:%u to uint32 Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(567,'Set %u float Value:[OPCODE]:%u [VALUE]:%f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(568,'You Set %u Field:%i to float Value: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(569,'Get %u uint32 Value:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(570,'The uint32 value of %u in %u is: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(571,'Get %u float Value:[OPCODE]:%u [VALUE]:%f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(572,'The float of %u value in %u is: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(573,'.Set32Bit:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(574,'You set Bit of Field:%u to Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(575,'.Mod32Value:[OPCODE]:%u [VALUE]:%i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(576,'You modified the value of Field:%u to Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(577,'You are now invisible.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(578,'You are now visible.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(579,'Selected player or creature not have victim.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(580,'You learned all default spells for race/class and completed quests rewarded spells.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(581,'Found near gameobjects (distance %f): %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(582,'SpawnTime: Full:%s Remain:%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(583,'%d - |cffffffff|Hgameevent:%d|h[%s]|h|r%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(584,'No event found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(585,'Event not exist!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(586,'Event %u: %s%s\nStart: %s End: %s Occurence: %s Length: %s\nNext state change: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(587,'Event %u already active!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(588,'Event %u not active!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(589,'   Point movement to (X:%f Y:%f Z:%f)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(590,'   Fear movement',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(591,'   Distract movement',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(592,'You have learned all spells in craft: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(600,'The Alliance wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(601,'The Horde wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(602,'The battle for Warsong Gulch begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(603,'The battle for Warsong Gulch begins in 30 seconds. Prepare yourselves!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(604,'Let the battle for Warsong Gulch begin!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(605,'$n captured the Horde flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(606,'$n captured the Alliance flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(607,'The Horde flag was dropped by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(608,'The Alliance Flag was dropped by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(609,'The Alliance Flag was returned to its base by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(610,'The Horde flag was returned to its base by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(611,'The Horde flag was picked up by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(612,'The Alliance Flag was picked up by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(613,'The flags are now placed at their bases.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(636,'The Battle for Eye of the Storm begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(637,'The Battle for Eye of the Storm begins in 30 seconds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(638,'The Battle for Eye of the Storm has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(650,'Alliance',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(651,'Horde',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(652,'stables',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(653,'blacksmith',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(654,'farm',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(655,'lumber mill',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(656,'mine',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(657,'The %s has taken the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(658,'$n has defended the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(659,'$n has assaulted the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(660,'$n claims the %s! If left unchallenged, the %s will control it in 1 minute!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(661,'The Battle for Arathi Basin begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(662,'The Battle for Arathi Basin begins in 30 seconds. Prepare yourselves!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(663,'The Battle for Arathi Basin has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(664,'The Alliance has gathered $1776W resources, and is near victory!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(665,'The Horde has gathered $1777W resources, and is near victory!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(666,'After your recent battle in %s our best attempts to award you a Mark of Honor failed. Enclosed you will find the Mark of Honor we were not able to deliver to you at the time. Thanks for fighting in %s!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(700,'You must be level %u to form an arena team',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(701,'One minute until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(702,'Thirty seconds until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(703,'Fifteen seconds until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(704,'The Arena battle has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(705,'You must wait %s before speaking again.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(706,'This item(s) have problems with equipping/storing in inventory.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(707,'%s wishes to not be disturbed and cannot receive whisper messages: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(708,'%s is Away from Keyboard: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(709,'Do not Disturb',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(710,'Away from Keyboard',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(740,'Someone in your party is already in three battleground queues. You cannot join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(713,'You must be level %u to join an arena team!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(714,'%s is not high enough level to join your team',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(715,'You don\'t meet Battleground level requirements',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(716,'Your arena team is full, %s cannot join it.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(739,'Someone in your party is Deserter. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(738,'Someone in your party is already in this battleground queue. (S)he must leave it before joining as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(737,'Your group has players from different battleground brakets. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(736,'Your group has players from the opposing faction. You can\'t join the battleground as a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(735,'Your group has an offline member. Please remove him before joining.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(733,'The Green Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(734,'There aren\'t enough players in this battleground. It will end soon unless some more players join to balance the fight.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(732,'The Gold Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(731,'Your group does not have enough players to join this match.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(730,'Your group has members not in your arena team. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(712,'Your group is too large for this arena. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(711,'Your group is too large for this battleground. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(800,'Invalid name',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(801,'You do not have enough gold',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(802,'You do not have enough free slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(803,'Your partner does not have enough free bag slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(804,'You do not have permission to perform that function',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(805,'Unknown language',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(806,'You don\'t know that language',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(807,'Please provide character name',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(808,'Player %s not found or offline',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(809,'Account for character %s not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(741,'You cannot teleport to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(742,'You cannot summon players to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(743,'You must be in GM mode to teleport to a player in a battleground.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(744,'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(745,'Arena testing turned %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(746,'|cffff0000[Automatic]:|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(747,'|cffffff00[|c1f40af20Announce by|r |cffff0000%s|cffffff00]:|r %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 
 /*Table structure for table `npc_gossip` */
Index: trunk/sql/Makefile.am
===================================================================
--- trunk/sql/Makefile.am (revision 33)
+++ trunk/sql/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/sql/characters.sql
===================================================================
--- trunk/sql/characters.sql (revision 37)
+++ trunk/sql/characters.sql (revision 44)
@@ -663,4 +663,26 @@
 
 --
+-- Table structure for table `game_event_condition_save`
+--
+
+CREATE TABLE `game_event_condition_save` (                    
+ `event_id` mediumint(8) unsigned NOT NULL,
+ `condition_id` mediumint(8) unsigned NOT NULL default '0',
+ `done` float default '0',
+ PRIMARY KEY  (`event_id`,`condition_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `game_event_save`
+--
+
+CREATE TABLE `game_event_save` (
+ `event_id` mediumint(8) unsigned NOT NULL,
+ `state` tinyint(3) unsigned NOT NULL default '1',
+ `next_start` timestamp NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY  (`event_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
 -- Table structure for table `groups`
 --
Index: trunk/contrib/vmap_debugger/ModelContainerView.cpp
===================================================================
--- trunk/contrib/vmap_debugger/ModelContainerView.cpp (revision 2)
+++ trunk/contrib/vmap_debugger/ModelContainerView.cpp (revision 44)
@@ -452,5 +452,5 @@
     //====================================================================
 
-    Vector3 ModelContainerView::convertPositionToMangosRep(float x, float y, float z) const {
+    Vector3 ModelContainerView::convertPositionToTrinityRep(float x, float y, float z) const {
         float pos[3];
         pos[0] = z;
@@ -491,5 +491,5 @@
             i_App->defaultController.getPosition();
             Vector3 pos = i_App->defaultController.getPosition();
-            Vector3 pos2 = convertPositionToMangosRep(pos.x, pos.y, pos.z);
+            Vector3 pos2 = convertPositionToTrinityRep(pos.x, pos.y, pos.z);
             //Vector3 pos3 = iVMapManager->convertPositionToInternalRep(pos2.x, pos2.y, pos2.z);
             //pos3 = iVMapManager->convertPositionToInternalRep(pos2.x, pos2.y, pos2.z);
Index: trunk/contrib/vmap_debugger/ModelContainerView.h
===================================================================
--- trunk/contrib/vmap_debugger/ModelContainerView.h (revision 2)
+++ trunk/contrib/vmap_debugger/ModelContainerView.h (revision 44)
@@ -52,5 +52,5 @@
         Array<Command> iPrevLoadCommands;
 	private:
-		Vector3 convertPositionToMangosRep(float x, float y, float z) const;
+		Vector3 convertPositionToTrinityRep(float x, float y, float z) const;
 
 	public:
Index: trunk/contrib/Makefile.am
===================================================================
--- trunk/contrib/Makefile.am (revision 23)
+++ trunk/contrib/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/contrib/extractor/Makefile
===================================================================
--- trunk/contrib/extractor/Makefile (revision 24)
+++ trunk/contrib/extractor/Makefile (revision 44)
@@ -17,5 +17,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac (revision 39)
+++ trunk/configure.ac (revision 44)
@@ -1,3 +1,5 @@
-# Copyright (C) 2005-2008 MaNGOS project <http://www.mangosproject.org/>
+# Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+#
+# Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
 #
 # This file is free software; as a special exception the author gives
@@ -160,5 +162,5 @@
 #  Include debug info in library?
 AC_MSG_CHECKING(whether to include debug info in library)
-MANGOSD_DEBUG_INFO=no
+TRINITYD_DEBUG_INFO=no
 AC_ARG_WITH(debug-info,
 [
@@ -168,17 +170,17 @@
 [
     if test "$withval" = "yes" ; then
-	CFLAGS="-g -DMANGOS_DEBUG $CFLAGS"
-	CXXFLAGS="-g -DMANGOS_DEBUG $CXXFLAGS"
-	MANGOSD_DEBUG_INFO=yes
+	CFLAGS="-g -DTRINITY_DEBUG $CFLAGS"
+	CXXFLAGS="-g -DTRINITY_DEBUG $CXXFLAGS"
+	TRINITYD_DEBUG_INFO=yes
     elif test "$withval" != "no" ; then
 	AC_MSG_ERROR(Please choose yes or no)
     fi
 ])
-AC_MSG_RESULT($MANGOSD_DEBUG_INFO)
+AC_MSG_RESULT($TRINITYD_DEBUG_INFO)
 
 
 # Enable CLI console?
 AC_MSG_CHECKING(whether cli console is enabled)
-MANGOSD_ENABLE_CLI=no
+TRINITYD_ENABLE_CLI=no
 AC_ARG_ENABLE(cli,
 [  --enable-cli Turn on command console system],
@@ -187,14 +189,14 @@
 	CFLAGS="-DENABLE_CLI $CFLAGS"
 	CXXFLAGS="-DENABLE_CLI $CXXFLAGS"
-	MANGOSD_ENABLE_CLI=yes
+	TRINITYD_ENABLE_CLI=yes
     elif test "$withval" != "no" ; then
 	AC_MSG_ERROR(Please choose yes or no)
     fi
 ])
-AC_MSG_RESULT($MANGOSD_ENABLE_CLI)
+AC_MSG_RESULT($TRINITYD_ENABLE_CLI)
 
 # Enable remote console?
 AC_MSG_CHECKING(whether remote console is enabled)
-MANGOSD_ENABLE_RA=no
+TRINITYD_ENABLE_RA=no
 AC_ARG_ENABLE(ra,
 [  --enable-ra Turn on remote console system],
@@ -203,10 +205,10 @@
 	CFLAGS="-DENABLE_RA $CFLAGS"
 	CXXFLAGS="-DENABLE_RA $CXXFLAGS"
-	MANGOSD_ENABLE_RA=yes
+	TRINITYD_ENABLE_RA=yes
     elif test "$withval" != "no" ; then
 	AC_MSG_ERROR(Please choose yes or no)
     fi
 ])
-AC_MSG_RESULT($MANGOSD_ENABLE_RA)
+AC_MSG_RESULT($TRINITYD_ENABLE_RA)
 
 ## Check for required header files.
@@ -288,7 +290,7 @@
 AC_SUBST(POSTGRE_LIBS)
 AC_SUBST(DOXYGEN)
-AC_SUBST(MANGOSD_DEBUG_INFO)
-AC_SUBST(MANGOSD_ENABLE_CLI)
-AC_SUBST(MANGOSD_ENABLE_RA)
+AC_SUBST(TRINITYD_DEBUG_INFO)
+AC_SUBST(TRINITYD_ENABLE_CLI)
+AC_SUBST(TRINITYD_ENABLE_RA)
 AC_SUBST(TRINI_INCLUDES)
 AC_SUBST(TRINI_LIBS)
@@ -315,5 +317,4 @@
    src/trinityrealm/Makefile
    src/trinitycore/Makefile
-   src/game/IRCConf.h
    src/bindings/Makefile
    src/bindings/interface/Makefile
Index: trunk/doc/Makefile.am
===================================================================
--- trunk/doc/Makefile.am (revision 23)
+++ trunk/doc/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/dep/include/Makefile.am
===================================================================
--- trunk/dep/include/Makefile.am (revision 23)
+++ trunk/dep/include/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/dep/include/utf8cpp/utf8/core.h
===================================================================
--- trunk/dep/include/utf8cpp/utf8/core.h (revision 2)
+++ trunk/dep/include/utf8cpp/utf8/core.h (revision 44)
@@ -31,5 +31,5 @@
 #include <iterator>
 
-// use MaNGOS core types
+// use Trinity core types
 #include "Platform/Define.h"
 
@@ -40,5 +40,5 @@
     // These typedefs have the same names as ones from cstdint, or boost/cstdint
 
-    /* use MaNGOS alternatives
+    /* use Trinity alternatives
     typedef unsigned char   uint8_t;
     typedef unsigned short  uint16_t;
Index: trunk/dep/include/g3dlite/G3D/platform.h
===================================================================
--- trunk/dep/include/g3dlite/G3D/platform.h (revision 2)
+++ trunk/dep/include/g3dlite/G3D/platform.h (revision 44)
@@ -193,5 +193,5 @@
     //
 
-#if 0 //ignore that for mangos
+#if 0 //ignore that for Trinity
     // DLL runtime
     #ifndef _DLL
Index: trunk/dep/include/mersennetwister/MersenneTwister.h
===================================================================
--- trunk/dep/include/mersennetwister/MersenneTwister.h (revision 2)
+++ trunk/dep/include/mersennetwister/MersenneTwister.h (revision 44)
@@ -119,5 +119,5 @@
 	void save( uint32* saveArray ) const;  // to array of size SAVE
 	void load( uint32 *const loadArray );  // from such array
-    /* Mangos not use streams for random values output
+    /* Trinity not use streams for random values output
 	friend std::ostream& operator<<( std::ostream& os, const MTRand& mtrand );
 	friend std::istream& operator>>( std::istream& is, MTRand& mtrand );
@@ -351,5 +351,5 @@
 }
 
-/* Mangos not use streams for random values output
+/* Trinity not use streams for random values output
 inline std::ostream& operator<<( std::ostream& os, const MTRand& mtrand )
 {
Index: trunk/dep/lib/Makefile.am
===================================================================
--- trunk/dep/lib/Makefile.am (revision 23)
+++ trunk/dep/lib/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
@@ -52,2 +52,3 @@
 	x64_release/libmysql.lib
 
+
Index: trunk/dep/src/Makefile.am
===================================================================
--- trunk/dep/src/Makefile.am (revision 23)
+++ trunk/dep/src/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/dep/src/sockets/Makefile.am
===================================================================
--- trunk/dep/src/sockets/Makefile.am (revision 23)
+++ trunk/dep/src/sockets/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/dep/Makefile.am
===================================================================
--- trunk/dep/Makefile.am (revision 23)
+++ trunk/dep/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
Index: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am (revision 23)
+++ trunk/Makefile.am (revision 44)
@@ -5,5 +5,5 @@
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
@@ -29,2 +29,3 @@
 
 
+
