Conflicts:
	dep/PackageList.txt
	src/server/bnetserver/Packets/WoWRealmPackets.cpp
	src/server/bnetserver/Server/Session.cpp
This commit is contained in:
Shauren
2014-10-18 17:03:30 +02:00
245 changed files with 10964 additions and 1308 deletions

View File

@@ -11,7 +11,7 @@ before_install:
- echo "yes" | sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- sudo apt-get -qq update
- sudo apt-get -qq install build-essential libtool gcc-4.8 g++-4.8 make cmake openssl
- sudo apt-get -qq install libssl-dev libmysqlclient15-dev libmysql++-dev libreadline6-dev zlib1g-dev libbz2-dev
- sudo apt-get -qq install libssl-dev libmysqlclient15-dev libmysql++-dev libreadline6-dev zlib1g-dev libbz2-dev libzmq3-dev
- sudo apt-get -qq install libboost1.55-dev libboost-thread1.55-dev libboost-system1.55-dev libboost-program-options1.55-dev
install:

View File

@@ -56,6 +56,7 @@ set(OPENSSL_EXPECTED_VERSION 1.0.0)
find_package(PCHSupport)
find_package(OpenSSL REQUIRED)
find_package(Threads REQUIRED)
find_package(ZMQ REQUIRED)
include(ConfigureBoost)
find_package(MySQL REQUIRED)

View File

@@ -1,6 +1,7 @@
# ![logo](http://www.trinitycore.org/f/public/style_images/1_trinitycore.png) TrinityCore
[![Coverity Scan Build Status](https://scan.coverity.com/projects/435/badge.svg)](https://scan.coverity.com/projects/435)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/435/badge.svg)](https://scan.coverity.com/projects/435)
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=1310)](https://www.bountysource.com/trackers/1310-trinity-core?utm_source=1310&utm_medium=shield&utm_campaign=TRACKER_BADGE)
`3.3.5`: [![3.3.5 Build Status](https://travis-ci.org/TrinityCore/TrinityCore.svg?branch=master)](https://travis-ci.org/TrinityCore/TrinityCore)
`4.3.4`: [![4.3.4 Build Status](https://travis-ci.org/TrinityCore/TrinityCore.svg?branch=4.3.4)](https://travis-ci.org/TrinityCore/TrinityCore)
@@ -21,7 +22,6 @@ make pull requests to our [Github repository](https://github.com/TrinityCore/Tri
For further information on the TrinityCore project, please visit our project
website at [TrinityCore.org](http://www.trinitycore.org).
## Requirements
+ Platform: Linux, Windows or Mac

View File

@@ -0,0 +1,76 @@
#
# Find the ZMQ includes and library
#
# This module defines
# ZMQ_INCLUDE_DIR, where to find zmq.h
# ZMQ_LIBRARY, the library needed to use ZMQ
# ZMQ_FOUND, if false, you cannot build anything that requires ZMQ.
set(ZMQ_FOUND 0)
if (PLATFORM EQUAL 64)
set(ZMQ_REGISTRY_PATH
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ZeroMQ (x64);DisplayIcon]"
)
else()
set(ZMQ_REGISTRY_PATH
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ZeroMQ;DisplayIcon]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ZeroMQ;DisplayIcon]"
)
endif()
find_path(ZMQ_ROOT_DIR
NAMES
include/zmq.h
HINTS
${ZMQ_REGISTRY_PATH}
PATHS
/usr
/usr/local
)
find_path(ZMQ_INCLUDE_DIR zmq.h ${ZMQ_ROOT_DIR}/include)
if (MSVC)
# Read registry key holding version
if (PLATFORM EQUAL 64)
get_filename_component(ZMQ_NAME "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ZeroMQ (x64);DisplayVersion]" NAME)
else()
get_filename_component(ZMQ_NAME "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ZeroMQ;DisplayVersion]" NAME)
if (${ZMQ_NAME} MATCHES "registry") # if key was not found, the string "registry" is returned
get_filename_component(ZMQ_NAME "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ZeroMQ;DisplayVersion]" NAME)
endif()
endif()
# Replace dots with underscores
string(REGEX REPLACE "\\." "_" ZMQ_NAME ${ZMQ_NAME})
# Get Visual studio version number
string(REGEX REPLACE "Visual Studio ([0-9]+).*" "\\1" ZMQ_VS_VERSION ${CMAKE_GENERATOR})
# Format ZMQ library file name
set(ZMQ_LIBRARY_NAME "libzmq-v${ZMQ_VS_VERSION}0-mt-${ZMQ_NAME}")
endif()
find_library(ZMQ_LIBRARY
NAMES
zmq
${ZMQ_LIBRARY_NAME}
PATHS
/lib
/usr/lib
/usr/local/lib
"${ZMQ_ROOT_DIR}/lib"
)
if (ZMQ_INCLUDE_DIR AND ZMQ_LIBRARY)
set(ZMQ_FOUND 1)
message(STATUS "Found ZMQ library: ${ZMQ_LIBRARY}")
message(STATUS "Found ZMQ headers: ${ZMQ_INCLUDE_DIR}")
else()
message(FATAL_ERROR "Could not find ZMQ libraries/headers! Please install ZMQ with libraries and headers")
endif()
# show the ZMQ_INCLUDE_DIR and ZMQ_LIBRARY variables only in the advanced view
mark_as_advanced(ZMQ_ROOT_DIR ZMQ_INCLUDE_DIR ZMQ_LIBRARY ZMQ_FOUND)

View File

@@ -36,6 +36,7 @@ endif()
if(SERVERS)
add_subdirectory(gsoap)
add_subdirectory(zmqpp)
endif()
if(TOOLS)

View File

@@ -39,3 +39,8 @@ recastnavigation (Recast is state of the art navigation mesh construction toolse
CascLib (An open-source implementation of library for reading CASC storage from Blizzard games since 2014)
https://github.com/ladislav-zezula/CascLib
Version: d3d17de30a1c5678375049f4cf3301a0a7962780
zmqpp (C++ binding for 0mq/zmq is a 'high-level' library that hides most of the c-style interface core 0mq provides.)
https://github.com/zeromq/zmqpp
Version: 3.2.0 17e9f6afa98f56ecac1e3f3eecbfc112357a6732

31
dep/zmqpp/CMakeLists.txt Normal file
View File

@@ -0,0 +1,31 @@
# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
file(GLOB_RECURSE sources_zmqpp zmqpp/*.cpp zmqpp/*.hpp zmqpp/*.h)
set(zmqpp_STAT_SRCS
${sources_zmqpp}
)
include_directories(${ZMQ_INCLUDE_DIR})
add_library(zmqpp STATIC
${zmqpp_STAT_SRCS}
)
if (WIN32)
add_definitions(-DBUILD_VERSION=\\"3.2.0\\")
else()
add_definitions(-DBUILD_VERSION='"3.2.0"')
endif()
add_definitions(-DBUILD_VERSION_MAJOR=3)
add_definitions(-DBUILD_VERSION_MINOR=2)
add_definitions(-DBUILD_VERSION_REVISION=0)

View File

@@ -0,0 +1,97 @@
/**
* \file
*
* \date 10 Sep 2011
* \author ron
* \author Ben Gray (\@benjamg)
*
* A fair number of C++0x (or more accurately C++11) features are used in this
* library and as this project is used where I work on older compilers this
* file was created to help.
*
* C++ features and their workaround where not supported:
* \li lambda functions - disabled, these are only used in the test anyway.
* \li typesafe enums - replaced with enum where comparisons needed.
* \li nullptr - defined to null.
*
* As of the port to version 3.1 (libzmqpp version 1.1.0) this file will also
* be used to maintain compatablity with multiple versions of 0mq
*/
#ifndef ZMQPP_COMPATIBILITY_HPP_
#define ZMQPP_COMPATIBILITY_HPP_
#include <zmq.h>
#include <cstdint>
// Currently we require at least 0mq version 2.2.x
#define ZMQPP_REQUIRED_ZMQ_MAJOR 2
#define ZMQPP_REQUIRED_ZMQ_MINOR 2
#if (ZMQ_VERSION_MAJOR < ZMQPP_REQUIRED_ZMQ_MAJOR) || ((ZMQ_VERSION_MAJOR == ZMQPP_REQUIRED_ZMQ_MAJOR) && (ZMQ_VERSION_MINOR < ZMQPP_REQUIRED_ZMQ_MINOR))
#error zmqpp requires a later version of 0mq
#endif
// Experimental feature support
#if (ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR == 0)
#define ZMQ_EXPERIMENTAL_LABELS
#endif
// Deal with older versions of gcc
#if defined(__GNUC__) && !defined(__clang__)
#if __GNUC__ == 4
// Deal with older gcc not supporting C++0x typesafe enum class name {} comparison
#if __GNUC_MINOR__ < 4
#define ZMQPP_COMPARABLE_ENUM enum
#endif
#if __GNUC_MINOR__ == 4
#if __GNUC_PATCHLEVEL__ < 1
#undef ZMQPP_COMPARABLE_ENUM
#define ZMQPP_COMPARABLE_ENUM enum
#endif // if __GNUC_PATCHLEVEL__ < 1
#endif // if __GNUC_MINOR__ == 4
// Deal with older gcc not supporting C++0x lambda function
#if __GNUC_MINOR__ < 5
#define ZMQPP_IGNORE_LAMBDA_FUNCTION_TESTS
#define ZMQPP_EXPLICITLY_DELETED
#endif // if __GNUC_MINOR__ < 5
// Deal with older gcc not supporting C++0x nullptr
#if __GNUC_MINOR__ < 6
#define nullptr NULL
#define NOEXCEPT
#endif // if __GNUC_MINOR__ < 6
#endif // if __GNUC_ == 4
#endif // if defined(__GNUC__) && !defined(__clang__)
#if defined(_MSC_VER)
#define NOEXCEPT throw()
#if _MSC_VER < 1800
#define ZMQPP_EXPLICITLY_DELETED
#endif // if _MSC_VER < 1800
#if _MSC_VER < 1600
#define nullptr NULL
#define ZMQPP_IGNORE_LAMBDA_FUNCTION_TESTS
#define ZMQPP_COMPARABLE_ENUM enum
#endif // if _MSC_VER < 1600
#endif // if defined(_MSC_VER)
// Generic state, assume a modern compiler
#ifndef ZMQPP_COMPARABLE_ENUM
#define ZMQPP_COMPARABLE_ENUM enum class
#endif
#ifndef ZMQPP_EXPLICITLY_DELETED
#define ZMQPP_EXPLICITLY_DELETED = delete
#endif
#ifndef NOEXCEPT
#define NOEXCEPT noexcept
#endif
#endif /* ZMQPP_COMPATIBILITY_HPP_ */

View File

@@ -0,0 +1,54 @@
/**
* \file
*
* \date 9 Aug 2011
* \author Ben Gray (\@benjamg)
*/
#include "context.hpp"
namespace zmqpp
{
void context::terminate()
{
int result;
do
{
#if (ZMQ_VERSION_MAJOR < 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR < 2))
result = zmq_term(_context);
#else
result = zmq_ctx_destroy(_context);
#endif
} while (result != 0 && zmq_errno() == EINTR);
if (result != 0) { throw zmq_internal_exception(); }
_context = nullptr;
}
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
void context::set(context_option const option, int const value)
{
if (nullptr == _context) { throw invalid_instance("context is invalid"); }
if (0 != zmq_ctx_set(_context, static_cast<int>(option), value))
{
throw zmq_internal_exception();
}
}
int context::get(context_option const option)
{
if (nullptr == _context) { throw invalid_instance("context is invalid"); }
int result = zmq_ctx_get(_context, static_cast<int>(option));
if (result < 0)
{
throw zmq_internal_exception();
}
return result;
}
#endif
}

184
dep/zmqpp/zmqpp/context.hpp Normal file
View File

@@ -0,0 +1,184 @@
/**
* \file
*
* \date 9 Aug 2011
* \author Ben Gray (\@benjamg)
*/
#ifndef ZMQPP_CONTEXT_HPP_
#define ZMQPP_CONTEXT_HPP_
#include <cassert>
#include <zmq.h>
#include "compatibility.hpp"
#include "exception.hpp"
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
#include "context_options.hpp"
#endif
namespace zmqpp
{
/*!
* The context class represents internal zmq context and io threads.
*
* By default the context class will create one thread, however this can be
* overridden in the constructor.
*
* The context class is the only object that can be considered thread safe.
*
* All sockets using endpoints other than inproc require the context to have
* at least one thread.
*
* This class is c++0x move supporting and cannot be copied.
*/
class context
{
public:
#if (ZMQ_VERSION_MAJOR < 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR < 2))
/*!
* Initialise the 0mq context.
*
* If only inproc is used then the context may be created with zero threads.
* Any inproc endpoint using sockets must be created using the same context.
*
* The context is thread safe an may be used anywhere in your application,
* however there is no requirement (other than inproc restrictions) for you
* to do this.
*
* \param threads an integer argument for the number of required threads. Defaults to 1.
*/
context(int const& threads = 1)
#else
/*!
* Initialise the 0mq context.
*
* The context is thread safe an may be used anywhere in your application,
* however there is no requirement (other than inproc restrictions) for you
* to do this.
*/
context()
#endif
: _context(nullptr)
{
#if (ZMQ_VERSION_MAJOR < 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR < 2))
_context = zmq_init(threads);
#else
_context = zmq_ctx_new();
#endif
if (nullptr == _context)
{
throw zmq_internal_exception();
}
}
/*!
* Closes the 0mq context.
*
* Any blocking calls other than a socket close will return with an error.
*
* If there are open sockets will block while zmq internal buffers are
* processed up to a limit specified by that sockets linger option.
*/
~context() NOEXCEPT
{
if (nullptr != _context)
{
terminate();
}
}
/*!
* Move supporting constructor.
*
* Allows zero-copy move semantics to be used with this class.
*
* \param source a rvalue instance of the object who's internals we wish to steal.
*/
context(context&& source) NOEXCEPT
: _context(source._context)
{
source._context = nullptr;
}
/*!
* Move supporting operator.
*
* Allows zero-copy move semantics to be used with this class.
*
* \param source an rvalue instance of the context who's internals we wish to steal.
*/
context& operator=(context&& source) NOEXCEPT
{
std::swap( _context, source._context );
return *this;
}
/*!
* Terminate the current context.
*
* Any blocking calls other than a socket close will return with an error.
*
* If there are open sockets will block while zmq internal buffers are
* processed up to a limit specified by that sockets linger option.
*/
void terminate();
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
/*!
* Set the value of an option in the underlaying zmq context.
*
* \param option a valid ::context_option
* \param value to set the option to
*/
void set(context_option const option, int const value);
/*!
* Get a context option from the underlaying zmq context.
*
* \param option a valid ::context_option
* \return context option value
*/
int get(context_option const option);
#endif
/*!
* Validity checking of the context
*
* Checks if the underlying 0mq context for this instance is valid.
*
* Contexts should always be valid unless people are doing 'fun' things with
* std::move.
*
* \return boolean true if the object is valid.
*/
operator bool() const NOEXCEPT
{
return nullptr != _context;
}
/*!
* Access to the raw 0mq context
*
* \return void pointer to the underlying 0mq context.
*/
operator void*() const NOEXCEPT
{
return _context;
}
private:
void* _context;
// No copy - private and not implemented
context(context const&) ZMQPP_EXPLICITLY_DELETED;
context& operator=(context const&) NOEXCEPT ZMQPP_EXPLICITLY_DELETED;
};
}
#endif /* ZMQPP_CONTEXT_HPP_ */

View File

@@ -0,0 +1,26 @@
/**
* \file
*
* \date 3 Jul 2013
* \author Ben Gray (\@benjamg)
*/
#ifndef ZMQPP_CONTEXT_OPTIONS_HPP_
#define ZMQPP_CONTEXT_OPTIONS_HPP_
namespace zmqpp
{
/** \todo Expand the information on the options to make it actually useful. */
/*!
* \brief possible Context options in zmq
*/
enum class context_option {
io_threads = ZMQ_IO_THREADS, /*!< I/O thread count */
max_sockets = ZMQ_MAX_SOCKETS, /*!< Maximum supported sockets */
};
}
#endif /* ZMQPP_CONTEXT_OPTIONS_HPP_ */

View File

@@ -0,0 +1,87 @@
/**
* \file
*
* \date 9 Aug 2011
* \author Ben Gray (\@benjamg)
*/
#ifndef ZMQPP_EXCEPTION_HPP_
#define ZMQPP_EXCEPTION_HPP_
#include <stdexcept>
#include <string>
#include <zmq.h>
namespace zmqpp
{
/** \todo Have a larger variety of exceptions with better state debug information */
/*!
* Represents the base zmqpp exception.
*
* All zmqpp runtime exceptions are children of this class.
* The class itself does not provide any special access fields but it only
* for convince when catching exceptions.
*
* The class extends std::runtime_error.
*
*/
class exception : public std::runtime_error
{
public:
/*!
* Standard exception constructor.
*
* \param message a string representing the error message.
*/
exception(std::string const& message)
: std::runtime_error(message)
{ }
};
/*!
* Represents an attempt to use an invalid object.
*
* Objects may be invalid initially or after a shutdown or close.
*/
class invalid_instance : public exception
{
public:
invalid_instance(std::string const& message)
: exception(message)
{ }
};
/*!
* Represents internal zmq errors.
*
* Any error response from the zmq bindings will be wrapped in this error.
*
* The class provides access to the zmq error number via zmq_error().
*/
class zmq_internal_exception : public exception
{
public:
/*!
* Uses the zmq functions to pull out error messages and numbers.
*/
zmq_internal_exception()
: exception(zmq_strerror(zmq_errno()))
, _error(zmq_errno())
{ }
/*!
* Retrieve the zmq error number associated with this exception.
* \return zmq error number
*/
int zmq_error() const { return _error; }
private:
int _error;
};
}
#endif /* ZMQPP_EXCEPTION_HPP_ */

95
dep/zmqpp/zmqpp/frame.cpp Normal file
View File

@@ -0,0 +1,95 @@
/**
* \file
*
* \date 8 Jan 2014
* \author Ben Gray (\@benjamg)
*/
#include <cassert>
#include <cstring>
#include "exception.hpp"
#include "frame.hpp"
namespace zmqpp {
frame::frame()
: _sent( false )
{
if( 0 != zmq_msg_init( &_msg ) )
{
throw zmq_internal_exception();
}
}
frame::frame(size_t const size)
: _sent( false )
{
if( 0 != zmq_msg_init_size( &_msg, size ) )
{
throw zmq_internal_exception();
}
}
frame::frame(void const* part, size_t const size)
: _sent( false )
{
if( 0 != zmq_msg_init_size( &_msg, size ) )
{
throw zmq_internal_exception();
}
void* msg_data = zmq_msg_data( &_msg );
memcpy( msg_data, part, size );
}
frame::frame(void* part, size_t const size, zmq_free_fn *ffn, void *hint)
: _sent( false )
{
if( 0 != zmq_msg_init_data( &_msg, part, size, ffn, hint ) )
{
throw zmq_internal_exception();
}
}
frame::~frame()
{
#ifndef NDEBUG // unused assert variable in release
int result = zmq_msg_close( &_msg );
assert(0 == result);
#else
zmq_msg_close( &_msg );
#endif // NDEBUG
}
frame::frame(frame&& other)
: _sent( other._sent )
{
zmq_msg_init( &_msg );
zmq_msg_move( &_msg, &other._msg );
other._sent = false;
}
frame& frame::operator=(frame&& other)
{
zmq_msg_init( &_msg );
zmq_msg_move( &_msg, &other._msg );
std::swap( _sent, other._sent );
return *this;
}
frame frame::copy() const
{
frame other( size() );
other._sent = _sent;
if( 0 != zmq_msg_copy( &other._msg, const_cast<zmq_msg_t*>(&_msg) ) )
{
throw zmq_internal_exception();
}
return other;
}
} // namespace zmqpp

58
dep/zmqpp/zmqpp/frame.hpp Normal file
View File

@@ -0,0 +1,58 @@
/**
* \file
*
* \date 8 Jan 2014
* \author Ben Gray (\@benjamg)
*/
#ifndef ZMQPP_MESSAGE_FRAME_HPP_
#define ZMQPP_MESSAGE_FRAME_HPP_
#include <zmq.h>
#include "compatibility.hpp"
namespace zmqpp {
/*!
* \brief an internal frame wrapper for a single zmq message
*
* This frame wrapper consists of a zmq message and meta data it is used
* by the zmqpp message class to keep track of parts in the internal
* queue. It is unlikely you need to use this class.
*/
class frame
{
public:
frame();
frame(size_t const size);
frame(void const* part, size_t const size);
frame(void* part, size_t const size, zmq_free_fn *ffn, void *hint);
~frame();
bool is_sent() const { return _sent; }
void const* data() const { return zmq_msg_data( const_cast<zmq_msg_t*>(&_msg) ); }
size_t size() const { return zmq_msg_size( const_cast<zmq_msg_t*>(&_msg) ); }
void mark_sent() { _sent = true; }
zmq_msg_t& msg() { return _msg; }
// Move operators
frame(frame&& other);
frame& operator=(frame&& other);
frame copy() const;
private:
bool _sent;
zmq_msg_t _msg;
// Disable implicit copy support, code must request a copy to clone
frame(frame const&) NOEXCEPT ZMQPP_EXPLICITLY_DELETED;
frame& operator=(frame const&) NOEXCEPT ZMQPP_EXPLICITLY_DELETED;
};
} // namespace zmqpp
#endif /* ZMQPP_MESSAGE_FRAME_HPP_ */

171
dep/zmqpp/zmqpp/inet.hpp Normal file
View File

@@ -0,0 +1,171 @@
/**
* \file
*
* \date 10 Aug 2011
* \author Ben Gray (\@benjamg)
*/
#ifndef ZMQPP_INET_HPP_
#define ZMQPP_INET_HPP_
/** \todo cross-platform version of including headers. */
// We get htons and htonl from here
#ifdef _WIN32
#include <WinSock2.h>
#else
#include <netinet/in.h>
#endif
#include "compatibility.hpp"
namespace zmqpp
{
/*!
* \brief Possible byte order types.
*
* An enumeration of all the known order types, all two of them.
* There is also an entry for unknown which is just used as a default.
*/
ZMQPP_COMPARABLE_ENUM order {
big_endian, /*!< byte order is big endian */
little_endian /*!< byte order is little endian */
};
/*!
* Common code for the 64bit versions of htons/htons and ntohs/ntohl
*
* As htons and ntohs (or htonl and ntohs) always just do the same thing, ie
* swap bytes if the host order differs from network order or otherwise don't
* do anything, it seemed silly to type the code twice.
*
* \note This code assumes network order is always big endian. Which it is.
* \note The host endian is only checked once and afterwards assumed to remain
* the same.
*
* \param value_to_check unsigned 64 bit integer to swap
* \return swapped (or not) unsigned 64 bit integer
*/
inline uint64_t swap_if_needed(uint64_t const value_to_check)
{
static order host_order = (htonl(42) == 42) ? order::big_endian : order::little_endian;
if (order::big_endian == host_order)
{
return value_to_check;
}
union {
uint64_t integer;
uint8_t bytes[8];
} value { value_to_check };
std::swap(value.bytes[0], value.bytes[7]);
std::swap(value.bytes[1], value.bytes[6]);
std::swap(value.bytes[2], value.bytes[5]);
std::swap(value.bytes[3], value.bytes[4]);
return value.integer;
}
/*!
* 64 bit version of the htons/htonl
*
* I've used the name htonll to try and keep with the htonl naming scheme.
*
* \param hostlonglong unsigned 64 bit host order integer
* \return unsigned 64 bit network order integer
*/
inline uint64_t htonll(uint64_t const hostlonglong)
{
return zmqpp::swap_if_needed(hostlonglong);
}
/*!
* 64 bit version of the ntohs/ntohl
*
* I've used the name htonll to try and keep with the htonl naming scheme.
*
* \param networklonglong unsigned 64 bit network order integer
* \return unsigned 64 bit host order integer
*/
inline uint64_t ntohll(uint64_t const networklonglong)
{
return zmqpp::swap_if_needed(networklonglong);
}
/*!
* floating point version of the htons/htonl
*
* \param value host order floating point
* \returns network order floating point
*/
inline float htonf(float value)
{
assert(sizeof(float) == sizeof(uint32_t));
uint32_t temp;
memcpy(&temp, &value, sizeof(uint32_t));
temp = htonl( temp );
memcpy(&value, &temp, sizeof(uint32_t));
return value;
}
/*!
* floating point version of the ntohs/ntohl
*
* \param value network order float
* \returns host order float
*/
inline float ntohf(float value)
{
assert(sizeof(float) == sizeof(uint32_t));
uint32_t temp;
memcpy(&temp, &value, sizeof(uint32_t));
temp = ntohl( temp );
memcpy(&value, &temp, sizeof(uint32_t));
return value;
}
/*!
* double precision floating point version of the htons/htonl
*
* \param value host order double precision floating point
* \returns network order double precision floating point
*/
inline double htond(double value)
{
assert(sizeof(double) == sizeof(uint64_t));
uint64_t temp;
memcpy(&temp, &value, sizeof(uint64_t));
temp = zmqpp::htonll(temp);
memcpy(&value, &temp, sizeof(uint64_t));
return value;
}
/*!
* double precision floating point version of the ntohs/ntohl
*
* \param value network order double precision floating point
* \returns host order double precision floating point
*/
inline double ntohd(double value)
{
assert(sizeof(double) == sizeof(uint64_t));
uint64_t temp;
memcpy(&temp, &value, sizeof(uint64_t));
temp = zmqpp::ntohll(temp);
memcpy(&value, &temp, sizeof(uint64_t));
return value;
}
}
#endif /* INET_HPP_ */

454
dep/zmqpp/zmqpp/message.cpp Normal file
View File

@@ -0,0 +1,454 @@
/*
* Created on: 9 Aug 2011
* Author: Ben Gray (@benjamg)
*/
#include <cassert>
#include <cstring>
#include "exception.hpp"
#include "inet.hpp"
#include "message.hpp"
namespace zmqpp
{
/*!
* \brief internal construct
* \internal handles bubbling callback from zmq c style to the c++ functor provided
*/
struct callback_releaser
{
message::release_function func;
};
message::message()
: _parts()
, _read_cursor(0)
{
}
message::~message()
{
_parts.clear();
}
size_t message::parts() const
{
return _parts.size();
}
/*
* The two const_casts in size and raw_data are a little bit hacky
* but neither of these methods called this way actually modify data
* so accurately represent the intent of these calls.
*/
size_t message::size(size_t const part /* = 0 */) const
{
if(part >= _parts.size())
{
throw exception("attempting to request a message part outside the valid range");
}
return _parts[part].size();
}
void const* message::raw_data(size_t const part /* = 0 */) const
{
if(part >= _parts.size())
{
throw exception("attempting to request a message part outside the valid range");
}
return _parts[part].data();
}
zmq_msg_t& message::raw_msg(size_t const part /* = 0 */)
{
if(part >= _parts.size())
{
throw exception("attempting to request a message part outside the valid range");
}
return _parts[part].msg();
}
zmq_msg_t& message::raw_new_msg()
{
_parts.push_back( frame() );
return _parts.back().msg();
}
zmq_msg_t& message::raw_new_msg(size_t const reserve_data_size)
{
_parts.push_back( frame(reserve_data_size) );
return _parts.back().msg();
}
std::string message::get(size_t const part /* = 0 */) const
{
return std::string(static_cast<char const*>(raw_data(part)), size(part));
}
// Move operators will take ownership of message parts without copying
void message::move(void* part, size_t const size, release_function const& release)
{
callback_releaser* hint = new callback_releaser();
hint->func = release;
_parts.push_back( frame( part, size, &message::release_callback, hint ) );
}
// Stream reader style
void message::reset_read_cursor()
{
_read_cursor = 0;
}
void message::get(int8_t& integer, size_t const part) const
{
assert(sizeof(int8_t) == size(part));
int8_t const* byte = static_cast<int8_t const*>(raw_data(part));
integer = *byte;
}
void message::get(int16_t& integer, size_t const part) const
{
assert(sizeof(int16_t) == size(part));
uint16_t const* network_order = static_cast<uint16_t const*>(raw_data(part));
integer = static_cast<int16_t>(ntohs(*network_order));
}
void message::get(int32_t& integer, size_t const part) const
{
assert(sizeof(int32_t) == size(part));
uint32_t const* network_order = static_cast<uint32_t const*>(raw_data(part));
integer = static_cast<int32_t>(htonl(*network_order));
}
void message::get(int64_t& integer, size_t const part) const
{
assert(sizeof(int64_t) == size(part));
uint64_t const* network_order = static_cast<uint64_t const*>(raw_data(part));
integer = static_cast<int64_t>(zmqpp::htonll(*network_order));
}
void message::get(uint8_t& unsigned_integer, size_t const part) const
{
assert(sizeof(uint8_t) == size(part));
uint8_t const* byte = static_cast<uint8_t const*>(raw_data(part));
unsigned_integer = *byte;
}
void message::get(uint16_t& unsigned_integer, size_t const part) const
{
assert(sizeof(uint16_t) == size(part));
uint16_t const* network_order = static_cast<uint16_t const*>(raw_data(part));
unsigned_integer = ntohs(*network_order);
}
void message::get(uint32_t& unsigned_integer, size_t const part) const
{
assert(sizeof(uint32_t) == size(part));
uint32_t const* network_order = static_cast<uint32_t const*>(raw_data(part));
unsigned_integer = ntohl(*network_order);
}
void message::get(uint64_t& unsigned_integer, size_t const part) const
{
assert(sizeof(uint64_t) == size(part));
uint64_t const* network_order = static_cast<uint64_t const*>(raw_data(part));
unsigned_integer = zmqpp::ntohll(*network_order);
}
void message::get(float& floating_point, size_t const part) const
{
assert(sizeof(float) == size(part));
float const* network_order = static_cast<float const*>(raw_data(part));
floating_point = zmqpp::ntohf(*network_order);
}
void message::get(double& double_precision, size_t const part) const
{
assert(sizeof(double) == size(part));
double const* network_order = static_cast<double const*>(raw_data(part));
double_precision = zmqpp::ntohd(*network_order);
}
void message::get(bool& boolean, size_t const part) const
{
assert(sizeof(uint8_t) == size(part));
uint8_t const* byte = static_cast<uint8_t const*>(raw_data(part));
boolean = (*byte != 0);
}
void message::get(std::string& string, size_t const part) const
{
string.assign( get(part) );
}
// Stream writer style - these all use copy styles
message& message::operator<<(int8_t const integer)
{
add(reinterpret_cast<void const*>(&integer), sizeof(int8_t));
return *this;
}
message& message::operator<<(int16_t const integer)
{
uint16_t network_order = htons(static_cast<uint16_t>(integer));
add(reinterpret_cast<void const*>(&network_order), sizeof(uint16_t));
return *this;
}
message& message::operator<<(int32_t const integer)
{
uint32_t network_order = htonl(static_cast<uint32_t>(integer));
add(reinterpret_cast<void const*>(&network_order), sizeof(uint32_t));
return *this;
}
message& message::operator<<(int64_t const integer)
{
uint64_t network_order = zmqpp::htonll(static_cast<uint64_t>(integer));
add(reinterpret_cast<void const*>(&network_order), sizeof(uint64_t));
return *this;
}
message& message::operator<<(uint8_t const unsigned_integer)
{
add(reinterpret_cast<void const*>(&unsigned_integer), sizeof(uint8_t));
return *this;
}
message& message::operator<<(uint16_t const unsigned_integer)
{
uint16_t network_order = htons(unsigned_integer);
add(reinterpret_cast<void const*>(&network_order), sizeof(uint16_t));
return *this;
}
message& message::operator<<(uint32_t const unsigned_integer)
{
uint32_t network_order = htonl(unsigned_integer);
add(reinterpret_cast<void const*>(&network_order), sizeof(uint32_t));
return *this;
}
message& message::operator<<(uint64_t const unsigned_integer)
{
uint64_t network_order = zmqpp::htonll(unsigned_integer);
add(reinterpret_cast<void const*>(&network_order), sizeof(uint64_t));
return *this;
}
message& message::operator<<(float const floating_point)
{
assert(sizeof(float) == 4);
float network_order = zmqpp::htonf(floating_point);
add(&network_order, sizeof(float));
return *this;
}
message& message::operator<<(double const double_precision)
{
assert(sizeof(double) == 8);
double network_order = zmqpp::htond(double_precision);
add(&network_order, sizeof(double));
return *this;
}
message& message::operator<<(bool const boolean)
{
uint8_t byte = (boolean) ? 1 : 0;
add(reinterpret_cast<void const*>(&byte), sizeof(uint8_t));
return *this;
}
message& message::operator<<(char const* c_string)
{
add(reinterpret_cast<void const*>(c_string), strlen(c_string));
return *this;
}
message& message::operator<<(std::string const& string)
{
add(reinterpret_cast<void const*>(string.data()), string.size());
return *this;
}
void message::push_front(void const* part, size_t const size)
{
_parts.emplace( _parts.begin(), part, size );
}
void message::push_front(int8_t const integer)
{
push_front(&integer, sizeof(int8_t));
}
void message::push_front(int16_t const integer)
{
uint16_t network_order = htons(static_cast<uint16_t>(integer));
push_front(&network_order, sizeof(uint16_t));
}
void message::push_front(int32_t const integer)
{
uint32_t network_order = htonl(static_cast<uint32_t>(integer));
push_front(&network_order, sizeof(uint32_t));
}
void message::push_front(int64_t const integer)
{
uint64_t network_order = zmqpp::htonll(static_cast<uint64_t>(integer));
push_front(&network_order, sizeof(uint64_t));
}
void message::push_front(uint8_t const unsigned_integer)
{
push_front(&unsigned_integer, sizeof(uint8_t));
}
void message::push_front(uint16_t const unsigned_integer)
{
uint16_t network_order = htons(unsigned_integer);
push_front(&network_order, sizeof(uint16_t));
}
void message::push_front(uint32_t const unsigned_integer)
{
uint32_t network_order = htonl(unsigned_integer);
push_front(&network_order, sizeof(uint32_t));
}
void message::push_front(uint64_t const unsigned_integer)
{
uint64_t network_order = zmqpp::htonll(unsigned_integer);
push_front(&network_order, sizeof(uint64_t));
}
void message::push_front(float const floating_point)
{
assert(sizeof(float) == 4);
float network_order = zmqpp::htonf(floating_point);
push_front(&network_order, sizeof(float));
}
void message::push_front(double const double_precision)
{
assert(sizeof(double) == 8);
double network_order = zmqpp::htond(double_precision);
push_front(&network_order, sizeof(double));
}
void message::push_front(bool const boolean)
{
uint8_t byte = (boolean) ? 1 : 0;
push_front(&byte, sizeof(uint8_t));
}
void message::push_front(char const* c_string)
{
push_front(c_string, strlen(c_string));
}
void message::push_front(std::string const& string)
{
push_front(string.data(), string.size());
}
void message::pop_front()
{
_parts.erase( _parts.begin() );
}
void message::pop_back()
{
_parts.pop_back();
}
message::message(message&& source) NOEXCEPT
: _parts()
, _read_cursor(0)
{
std::swap(_parts, source._parts);
}
message& message::operator=(message&& source) NOEXCEPT
{
std::swap(_parts, source._parts);
return *this;
}
message message::copy() const
{
message msg;
msg.copy(*this);
return msg;
}
void message::copy(message const& source)
{
_parts.resize( source._parts.size() );
for(size_t i = 0; i < source._parts.size(); ++i)
{
_parts[i] = source._parts[i].copy();
}
// we don't need a copy of the releasers as we did data copies of the internal data,
//_releasers = source._releasers;
//_strings = source._strings
}
// Used for internal tracking
void message::sent(size_t const part)
{
// sanity check
assert(!_parts[part].is_sent());
_parts[part].mark_sent();
}
// Note that these releasers are not thread safe, the only safety is provided by
// the socket class taking ownership so no updates can happen while zmq does it's thing
// If used in a custom class this has to be dealt with.
void message::release_callback(void* data, void* hint)
{
callback_releaser* releaser = static_cast<callback_releaser*>(hint);
releaser->func(data);
delete releaser;
}
}

254
dep/zmqpp/zmqpp/message.hpp Normal file
View File

@@ -0,0 +1,254 @@
/**
* \file
*
* \date 9 Aug 2011
* \author Ben Gray (\@benjamg)
*/
#ifndef ZMQPP_MESSAGE_HPP_
#define ZMQPP_MESSAGE_HPP_
#include <functional>
#include <string>
#include <unordered_map>
#include <vector>
#include <utility>
#include <cassert>
#include <zmq.h>
#include "compatibility.hpp"
#include "frame.hpp"
namespace zmqpp
{
/*!
* \brief a zmq message with optional multipart support
*
* A zmq message is made up of one or more parts which are sent together to
* the target endpoints. zmq guarantees either the whole message or none
* of the message will be delivered.
*/
class message
{
public:
/*!
* \brief callback to release user allocated data.
*
* The release function will be called on any void* moved part.
* It must be thread safe to the extent that the callback may occur on
* one of the context threads.
*
* The function called will be passed a single variable which is the
* pointer to the memory allocated.
*/
typedef std::function<void (void*)> release_function;
message();
~message();
template <typename T, typename ...Args>
message(T const &part, Args &&...args)
: message()
{
add(part, std::forward<Args>(args)...);
}
size_t parts() const;
size_t size(size_t const part) const;
std::string get(size_t const part) const;
void get(int8_t& integer, size_t const part) const;
void get(int16_t& integer, size_t const part) const;
void get(int32_t& integer, size_t const part) const;
void get(int64_t& integer, size_t const part) const;
void get(uint8_t& unsigned_integer, size_t const part) const;
void get(uint16_t& unsigned_integer, size_t const part) const;
void get(uint32_t& unsigned_integer, size_t const part) const;
void get(uint64_t& unsigned_integer, size_t const part) const;
void get(float& floating_point, size_t const part) const;
void get(double& double_precision, size_t const part) const;
void get(bool& boolean, size_t const part) const;
void get(std::string& string, size_t const part) const;
// Warn: If a pointer type is requested the message (well zmq) still 'owns'
// the data and will release it when the message object is freed.
template<typename Type>
Type get(size_t const part)
{
Type value;
get(value, part);
return value;
}
template<int part=0, typename T, typename ...Args>
void extract(T &nextpart, Args &...args)
{
assert(part < parts());
get(nextpart,part);
extract<part+1>(args...);
}
template<int part=0, typename T>
void extract(T &nextpart)
{
assert(part < parts());
get(nextpart,part);
}
// Raw get data operations, useful with data structures more than anything else
// Warn: The message (well zmq) still 'owns' the data and will release it
// when the message object is freed.
template<typename Type>
void get(Type*& value, size_t const part) const
{
value = static_cast<Type*>(raw_data(part));
}
// Warn: The message (well zmq) still 'owns' the data and will release it
// when the message object is freed.
template<typename Type>
void get(Type** value, size_t const part) const
{
*value = static_cast<Type*>(raw_data(part));
}
// Move operators will take ownership of message parts without copying
void move(void* part, size_t const size, release_function const& release);
// Raw move data operation, useful with data structures more than anything else
template<typename Object>
void move(Object *part)
{
move(part, sizeof(Object), &deleter_callback<Object>);
}
// Copy operators will take copies of any data
template<typename Type>
void add(Type *part, size_t const size)
{
_parts.push_back( frame( part, size ) );
}
template<typename Type, typename ...Args>
void add(Type const& part, Args &&...args)
{
*this << part;
add(std::forward<Args>(args)...);
}
template<typename Type>
void add(Type const part)
{
*this << part;
}
// Stream reader style
void reset_read_cursor();
template<typename Type>
message& operator>>(Type& value)
{
get(value, _read_cursor++);
return *this;
}
// Stream writer style - these all use copy styles
message& operator<<(int8_t const integer);
message& operator<<(int16_t const integer);
message& operator<<(int32_t const integer);
message& operator<<(int64_t const integer);
message& operator<<(uint8_t const unsigned_integer);
message& operator<<(uint16_t const unsigned_integer);
message& operator<<(uint32_t const unsigned_integer);
message& operator<<(uint64_t const unsigned_integer);
message& operator<<(float const floating_point);
message& operator<<(double const double_precision);
message& operator<<(bool const boolean);
message& operator<<(char const* c_string);
message& operator<<(std::string const& string);
// Queue manipulation
void push_front(void const* part, size_t const size);
// TODO: unify conversion of types with the stream operators
void push_front(int8_t const integer);
void push_front(int16_t const integer);
void push_front(int32_t const integer);
void push_front(int64_t const integer);
void push_front(uint8_t const unsigned_integer);
void push_front(uint16_t const unsigned_integer);
void push_front(uint32_t const unsigned_integer);
void push_front(uint64_t const unsigned_integer);
void push_front(float const floating_point);
void push_front(double const double_precision);
void push_front(bool const boolean);
void push_front(char const* c_string);
void push_front(std::string const& string);
void pop_front();
void push_back(void const* part, size_t const size)
{
add( part, size );
}
template<typename Type>
void push_back(Type const part)
{
*this << part;
}
void pop_back();
void remove(size_t const part);
// Move supporting
message(message&& source) NOEXCEPT;
message& operator=(message&& source) NOEXCEPT;
// Copy support
message copy() const;
void copy(message const& source);
// Used for internal tracking
void sent(size_t const part);
// Access to raw zmq details
void const* raw_data(size_t const part = 0) const;
zmq_msg_t& raw_msg(size_t const part = 0);
zmq_msg_t& raw_new_msg();
zmq_msg_t& raw_new_msg(size_t const reserve_data_size);
private:
typedef std::vector<frame> parts_type;
parts_type _parts;
size_t _read_cursor;
// Disable implicit copy support, code must request a copy to clone
message(message const&) NOEXCEPT ZMQPP_EXPLICITLY_DELETED;
message& operator=(message const&) NOEXCEPT ZMQPP_EXPLICITLY_DELETED;
static void release_callback(void* data, void* hint);
template<typename Object>
static void deleter_callback(void* data)
{
delete static_cast<Object*>(data);
}
};
}
#endif /* ZMQPP_MESSAGE_HPP_ */

182
dep/zmqpp/zmqpp/poller.cpp Normal file
View File

@@ -0,0 +1,182 @@
/*
* Created on: 16 Aug 2011
* Author: Ben Gray (@benjamg)
*/
#include "exception.hpp"
#include "socket.hpp"
#include "poller.hpp"
#include <zmq.h>
namespace zmqpp
{
const long poller::wait_forever = -1;
const short poller::poll_none = 0;
const short poller::poll_in = ZMQ_POLLIN;
const short poller::poll_out = ZMQ_POLLOUT;
const short poller::poll_error = ZMQ_POLLERR;
poller::poller()
: _items()
, _index()
, _fdindex()
{
}
poller::~poller()
{
_items.clear();
_index.clear();
_fdindex.clear();
}
void poller::add(socket& socket, short const event /* = POLL_IN */)
{
zmq_pollitem_t item { socket, 0, event, 0 };
size_t index = _items.size();
_items.push_back(item);
_index[socket] = index;
}
void poller::add(int const descriptor, short const event /* = POLL_IN */)
{
zmq_pollitem_t item { nullptr, descriptor, event, 0 };
size_t index = _items.size();
_items.push_back(item);
_fdindex[descriptor] = index;
}
bool poller::has(socket_t const& socket)
{
return _index.find(socket) != _index.end();
}
bool poller::has(int const descriptor)
{
return _fdindex.find(descriptor) != _fdindex.end();
}
void poller::reindex(size_t const index)
{
if ( nullptr != _items[index].socket )
{
auto found = _index.find( _items[index].socket );
if (_index.end() == found) { throw exception("unable to reindex socket in poller"); }
found->second = index;
}
else
{
auto found = _fdindex.find( _items[index].fd );
if (_fdindex.end() == found) { throw exception("unable to reindex file descriptor in poller"); }
found->second = index;
}
}
void poller::remove(socket_t const& socket)
{
auto found = _index.find(socket);
if (_index.end() == found) { return; }
if ( _items.size() - 1 == found->second )
{
_items.pop_back();
_index.erase(found);
return;
}
std::swap(_items[found->second], _items.back());
_items.pop_back();
auto index = found->second;
_index.erase(found);
reindex( index );
}
void poller::remove(int const descriptor)
{
auto found = _fdindex.find(descriptor);
if (_fdindex.end() == found) { return; }
if ( _items.size() - 1 == found->second )
{
_items.pop_back();
_fdindex.erase(found);
return;
}
std::swap(_items[found->second], _items.back());
_items.pop_back();
auto index = found->second;
_fdindex.erase(found);
reindex( index );
}
void poller::check_for(socket const& socket, short const event)
{
auto found = _index.find(socket);
if (_index.end() == found)
{
throw exception("this socket is not represented within this poller");
}
_items[found->second].events = event;
}
void poller::check_for(int const descriptor, short const event)
{
auto found = _fdindex.find(descriptor);
if (_fdindex.end() == found)
{
throw exception("this socket is not represented within this poller");
}
_items[found->second].events = event;
}
bool poller::poll(long timeout /* = WAIT_FOREVER */)
{
int result = zmq_poll(_items.data(), _items.size(), timeout);
if (result < 0)
{
if(EINTR == zmq_errno())
{
return false;
}
throw zmq_internal_exception();
}
return (result > 0);
}
short poller::events(socket const& socket) const
{
auto found = _index.find(socket);
if (_index.end() == found)
{
throw exception("this socket is not represented within this poller");
}
return _items[found->second].revents;
}
short poller::events(int const descriptor) const
{
auto found = _fdindex.find(descriptor);
if (_fdindex.end() == found)
{
throw exception("this file descriptor is not represented within this poller");
}
return _items[found->second].revents;
}
}

186
dep/zmqpp/zmqpp/poller.hpp Normal file
View File

@@ -0,0 +1,186 @@
/**
* \file
*
* \date 9 Aug 2011
* \author Ben Gray (\@benjamg)
*/
#ifndef ZMQPP_POLLER_HPP_
#define ZMQPP_POLLER_HPP_
#include <unordered_map>
#include <vector>
#include "compatibility.hpp"
namespace zmqpp
{
class socket;
typedef socket socket_t;
/*!
* Polling wrapper.
*
* Allows access to polling for any number of sockets or file descriptors.
*/
class poller
{
public:
static const long wait_forever; /*!< Block forever flag, default setting. */
static const short poll_none; /*!< No polling flags set. */
static const short poll_in; /*!< Monitor inbound flag. */
static const short poll_out; /*!< Monitor output flag. */
static const short poll_error; /*!< Monitor error flag.\n Only for file descriptors. */
/*!
* Construct an empty polling model.
*/
poller();
/*!
* Cleanup poller.
*
* Any sockets will need to be closed separately.
*/
~poller();
/*!
* Add a socket to the polling model and set which events to monitor.
*
* \param socket the socket to monitor.
* \param event the event flags to monitor on the socket.
*/
void add(socket_t& socket, short const event = poll_in);
/*!
* Add a file descriptor to the polling model and set which events to monitor.
*
* \param descriptor the file descriptor to monitor.
* \param event the event flags to monitor.
*/
void add(int const descriptor, short const event = poll_in | poll_error);
/*!
* Check if we are monitoring a given socket with this poller.
*
* \param socket the socket to check.
* \return true if it is there.
*/
bool has(socket_t const& socket);
/*!
* Check if we are monitoring a given file descriptor with this poller.
*
* \param descriptor the file descriptor to check.
* \return true if it is there.
*/
bool has(int const descriptor);
/*!
* Stop monitoring a socket.
*
* \param socket the socket to stop monitoring.
*/
void remove(socket_t const& socket);
/*!
* Stop monitoring a file descriptor.
*
* \param descriptor the file descriptor to stop monitoring.
*/
void remove(int const descriptor);
/*!
* Update the monitored event flags for a given socket.
*
* \param socket the socket to update event flags.
* \param event the event flags to monitor on the socket.
*/
void check_for(socket_t const& socket, short const event);
/*!
* Update the monitored event flags for a given file descriptor.
*
* \param descriptor the file descriptor to update event flags.
* \param event the event flags to monitor on the socket.
*/
void check_for(int const descriptor, short const event);
/*!
* Poll for monitored events.
*
* By default this method will block forever or until at least one of the monitored
* sockets or file descriptors has events.
*
* If a timeout is set and was reached then this function returns false.
*
* \param timeout milliseconds to timeout.
* \return true if there is an event..
*/
bool poll(long timeout = wait_forever);
/*!
* Get the event flags triggered for a socket.
*
* \param socket the socket to get triggered event flags for.
* \return the event flags.
*/
short events(socket_t const& socket) const;
/*!
* Get the event flags triggered for a file descriptor.
*
* \param descriptor the file descriptor to get triggered event flags for.
* \return the event flags.
*/
short events(int const descriptor) const;
/*!
* Check either a file descriptor or socket for input events.
*
* Templated helper method that calls through to event and checks for a given flag
*
* \param watchable either a file descriptor or socket known to the poller.
* \return true if there is input.
*/
template<typename Watched>
bool has_input(Watched const& watchable) const { return events(watchable) & poll_in; }
/*!
* Check either a file descriptor or socket for output events.
*
* Templated helper method that calls through to event and checks for a given flag
*
* \param watchable either a file descriptor or socket known to the poller.
* \return true if there is output.
*/
template<typename Watched>
bool has_output(Watched const& watchable) const { return events(watchable) & poll_out; }
/*!
* Check a file descriptor.
*
* Templated helper method that calls through to event and checks for a given flag
*
* Technically this template works for sockets as well but the error flag is never set for
* sockets so I have no idea why someone would call it.
*
* \param watchable a file descriptor know to the poller.
* \return true if there is an error.
*/
template<typename Watched>
bool has_error(Watched const& watchable) const { return events(watchable) & poll_error; }
private:
std::vector<zmq_pollitem_t> _items;
std::unordered_map<void *, size_t> _index;
std::unordered_map<int, size_t> _fdindex;
void reindex(size_t const index);
};
}
#endif /* ZMQPP_POLLER_HPP_ */

762
dep/zmqpp/zmqpp/socket.cpp Normal file
View File

@@ -0,0 +1,762 @@
/*
* Created on: 9 Aug 2011
* Author: Ben Gray (@benjamg)
*/
#include <array>
#include <cassert>
#include <cstring>
#include <functional>
#include "context.hpp"
#include "exception.hpp"
#include "message.hpp"
#include "socket.hpp"
namespace zmqpp
{
const int socket::normal = 0;
#if (ZMQ_VERSION_MAJOR == 2)
const int socket::dont_wait = ZMQ_NOBLOCK;
#else
const int socket::dont_wait = ZMQ_DONTWAIT;
#endif
const int socket::send_more = ZMQ_SNDMORE;
#ifdef ZMQ_EXPERIMENTAL_LABELS
const int socket::send_label = ZMQ_SNDLABEL;
#endif
const int max_socket_option_buffer_size = 256;
const int max_stream_buffer_size = 4096;
socket::socket(const context& context, socket_type const type)
: _socket(nullptr)
, _type(type)
, _recv_buffer()
{
_socket = zmq_socket(context, static_cast<int>(type));
if(nullptr == _socket)
{
throw zmq_internal_exception();
}
zmq_msg_init(&_recv_buffer);
}
socket::~socket()
{
zmq_msg_close(&_recv_buffer);
if (nullptr != _socket)
{
#ifndef NDEBUG // unused assert variable in release
int result = zmq_close(_socket);
assert(0 == result);
#else
zmq_close(_socket);
#endif // NDEBUG
_socket = nullptr;
}
}
void socket::bind(endpoint_t const& endpoint)
{
int result = zmq_bind(_socket, endpoint.c_str());
if (0 != result)
{
throw zmq_internal_exception();
}
}
void socket::unbind(endpoint_t const& endpoint)
{
#if (ZMQ_VERSION_MAJOR > 3 || (ZMQ_VERSION_MAJOR == 3 && ZMQ_VERSION_MINOR >= 2))
int result = zmq_unbind(_socket, endpoint.c_str());
if (0 != result)
{
throw zmq_internal_exception();
}
#endif
}
void socket::connect(endpoint_t const& endpoint)
{
int result = zmq_connect(_socket, endpoint.c_str());
if (0 != result)
{
throw zmq_internal_exception();
}
}
void socket::disconnect(endpoint_t const& endpoint)
{
#if (ZMQ_VERSION_MAJOR > 3 || (ZMQ_VERSION_MAJOR == 3 && ZMQ_VERSION_MINOR >= 2))
int result = zmq_disconnect(_socket, endpoint.c_str());
if (0 != result)
{
throw zmq_internal_exception();
}
#endif
}
void socket::close()
{
int result = zmq_close(_socket);
if (0 != result)
{
throw zmq_internal_exception();
}
_socket = nullptr;
}
bool socket::send(message& message, bool const dont_block /* = false */)
{
size_t parts = message.parts();
if (parts == 0)
{
throw std::invalid_argument("sending requires messages have at least one part");
}
bool dont_wait = dont_block;
for(size_t i = 0; i < parts; ++i)
{
int flag = socket::normal;
if(dont_wait) { flag |= socket::dont_wait; }
if(i < (parts - 1)) { flag |= socket::send_more; }
#if (ZMQ_VERSION_MAJOR == 2)
int result = zmq_send( _socket, &message.raw_msg(i), flag );
#elif (ZMQ_VERSION_MAJOR < 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR < 2))
int result = zmq_sendmsg( _socket, &message.raw_msg(i), flag );
#else
int result = zmq_msg_send( &message.raw_msg(i), _socket, flag );
#endif
if (result < 0)
{
// the zmq framework should not block if the first part is accepted
// so we should only ever get this error on the first part
if((0 == i) && (EAGAIN == zmq_errno()))
{
return false;
}
if(EINTR == zmq_errno())
{
if (0 == message.parts())
{
return false;
}
// If we have an interrupt but it's not on the first part then we
// know we can safely send out the rest of the message as we can
// enforce that it won't wait on a blocking action
dont_wait = true;
continue;
}
// sanity checking
assert(EAGAIN != zmq_errno());
throw zmq_internal_exception();
}
message.sent(i);
}
// Leave message reference in a stable state
zmqpp::message local;
std::swap(local, message);
return true;
}
bool socket::receive(message& message, bool const dont_block /* = false */)
{
if (message.parts() > 0)
{
// swap and discard old message
zmqpp::message local;
std::swap(local, message);
}
int flags = (dont_block) ? socket::dont_wait : socket::normal;
bool more = true;
while(more)
{
#if (ZMQ_VERSION_MAJOR == 2)
int result = zmq_recv( _socket, &_recv_buffer, flags );
#elif (ZMQ_VERSION_MAJOR < 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR < 2))
int result = zmq_recvmsg( _socket, &_recv_buffer, flags );
#else
int result = zmq_msg_recv( &_recv_buffer, _socket, flags );
#endif
if(result < 0)
{
if ((0 == message.parts()) && (EAGAIN == zmq_errno()))
{
return false;
}
if(EINTR == zmq_errno())
{
if (0 == message.parts())
{
return false;
}
// If we have an interrupt but it's not on the first part then we
// know we can safely pull out the rest of the message as it will
// not be blocking
continue;
}
assert(EAGAIN != zmq_errno());
throw zmq_internal_exception();
}
zmq_msg_t& dest = message.raw_new_msg();
zmq_msg_move(&dest, &_recv_buffer);
get(socket_option::receive_more, more);
}
return true;
}
bool socket::send(std::string const& string, int const flags /* = NORMAL */)
{
return send_raw(string.data(), string.size(), flags);
}
bool socket::receive(std::string& string, int const flags /* = NORMAL */)
{
#if (ZMQ_VERSION_MAJOR == 2)
int result = zmq_recv( _socket, &_recv_buffer, flags );
#elif (ZMQ_VERSION_MAJOR < 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR < 2))
int result = zmq_recvmsg( _socket, &_recv_buffer, flags );
#else
int result = zmq_msg_recv( &_recv_buffer, _socket, flags );
#endif
if(result >= 0)
{
string.reserve(zmq_msg_size(&_recv_buffer));
string.assign(static_cast<char*>(zmq_msg_data(&_recv_buffer)), zmq_msg_size(&_recv_buffer));
return true;
}
if (EAGAIN == zmq_errno() || EINTR == zmq_errno())
{
return false;
}
throw zmq_internal_exception();
}
bool socket::send_raw(char const* buffer, int const length, int const flags /* = NORMAL */)
{
#if (ZMQ_VERSION_MAJOR == 2)
zmq_msg_t msg;
int result = zmq_msg_init_size(&msg, length);
if (result != 0)
{
zmq_internal_exception();
}
memcpy(zmq_msg_data(&msg), buffer, length);
result = zmq_send(_socket, &msg, flags);
#else
int result = zmq_send(_socket, buffer, length, flags);
#endif
if(result >= 0)
{
return true;
}
#if (ZMQ_VERSION_MAJOR == 2)
// only actually need to close this on error
zmq_msg_close(&msg);
#endif
if (EAGAIN == zmq_errno() || EINTR == zmq_errno())
{
return false;
}
throw zmq_internal_exception();
}
bool socket::receive_raw(char* buffer, int& length, int const flags /* = NORMAL */)
{
#if (ZMQ_VERSION_MAJOR == 2)
int result = zmq_recv( _socket, &_recv_buffer, flags );
#elif (ZMQ_VERSION_MAJOR < 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR < 2))
int result = zmq_recvmsg( _socket, &_recv_buffer, flags );
#else
int result = zmq_msg_recv( &_recv_buffer, _socket, flags );
#endif
if(result >= 0)
{
length = zmq_msg_size(&_recv_buffer);
memcpy(buffer, zmq_msg_data(&_recv_buffer), length);
return true;
}
if (EAGAIN == zmq_errno() || EINTR == zmq_errno())
{
return false;
}
throw zmq_internal_exception();
}
// Helper
void socket::subscribe(std::string const& topic)
{
set(socket_option::subscribe, topic);
}
void socket::unsubscribe(std::string const& topic)
{
set(socket_option::unsubscribe, topic);
}
bool socket::has_more_parts() const
{
return get<bool>(socket_option::receive_more);
}
// Set socket options for different types of option
void socket::set(socket_option const option, int const value)
{
switch(option)
{
// unsigned 64bit Integers
#if (ZMQ_VERSION_MAJOR == 2)
case socket_option::high_water_mark:
case socket_option::send_buffer_size:
case socket_option::receive_buffer_size:
#endif
case socket_option::affinity:
if (value < 0) { throw exception("attempting to set an unsigned 64 bit integer option with a negative integer"); }
set(option, static_cast<uint64_t>(value));
break;
// 64bit Integers
#if (ZMQ_VERSION_MAJOR == 2)
case socket_option::rate:
case socket_option::recovery_interval:
case socket_option::recovery_interval_seconds:
case socket_option::swap_size:
#else
case socket_option::max_messsage_size:
#endif
set(option, static_cast<int64_t>(value));
break;
// Boolean
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 1))
case socket_option::ipv4_only:
#endif
#if (ZMQ_VERSION_MAJOR == 2)
case socket_option::multicast_loopback:
#endif
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
#if (ZMQ_VERSION_MINOR == 2)
case socket_option::delay_attach_on_connect:
#else
case socket_option::immediate:
#endif
case socket_option::router_mandatory:
case socket_option::xpub_verbose:
#endif
if (value == 0) { set(option, false); }
else if (value == 1) { set(option, true); }
else { throw exception("attempting to set a boolean option with a non 0 or 1 integer"); }
break;
// Default or Boolean
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
case socket_option::tcp_keepalive:
if (value < -1 || value > 1) { throw exception("attempting to set a default or boolean option with a non -1, 0 or 1 integer"); }
if (0 != zmq_setsockopt(_socket, static_cast<int>(option), &value, sizeof(value)))
{
throw zmq_internal_exception();
}
break;
#endif
// Integers that require +ve numbers
#if (ZMQ_VERSION_MAJOR == 2)
case socket_option::reconnect_interval_max:
#else
case socket_option::reconnect_interval_max:
case socket_option::send_buffer_size:
case socket_option::recovery_interval:
case socket_option::receive_buffer_size:
case socket_option::send_high_water_mark:
case socket_option::receive_high_water_mark:
case socket_option::multicast_hops:
case socket_option::rate:
#endif
case socket_option::backlog:
if (value < 0) { throw exception("attempting to set a positive only integer option with a negative integer"); }
// Integers
case socket_option::reconnect_interval:
case socket_option::linger:
case socket_option::receive_timeout:
case socket_option::send_timeout:
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
case socket_option::tcp_keepalive_idle:
case socket_option::tcp_keepalive_count:
case socket_option::tcp_keepalive_interval:
#endif
if (0 != zmq_setsockopt(_socket, static_cast<int>(option), &value, sizeof(value)))
{
throw zmq_internal_exception();
}
break;
default:
throw exception("attempting to set a non signed integer option with a signed integer value");
}
}
void socket::set(socket_option const option, bool const value)
{
switch(option)
{
#if (ZMQ_VERSION_MAJOR == 2)
case socket_option::multicast_loopback:
#endif
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 1))
case socket_option::ipv4_only:
#endif
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
#if (ZMQ_VERSION_MINOR == 2)
case socket_option::delay_attach_on_connect:
#else
case socket_option::immediate:
#endif
case socket_option::router_mandatory:
case socket_option::xpub_verbose:
#endif
{
int ivalue = value ? 1 : 0;
if (0 != zmq_setsockopt(_socket, static_cast<int>(option), &ivalue, sizeof(ivalue)))
{
throw zmq_internal_exception();
}
break;
}
default:
throw exception("attempting to set a non boolean option with a boolean value");
}
}
void socket::set(socket_option const option, uint64_t const value)
{
switch(option)
{
#if (ZMQ_VERSION_MAJOR == 2)
// unsigned 64bit Integers
case socket_option::high_water_mark:
case socket_option::send_buffer_size:
case socket_option::receive_buffer_size:
#endif
case socket_option::affinity:
if (0 != zmq_setsockopt(_socket, static_cast<int>(option), &value, sizeof(value)))
{
throw zmq_internal_exception();
}
break;
default:
throw exception("attempting to set a non unsigned 64 bit integer option with a unsigned 64 bit integer value");
}
}
void socket::set(socket_option const option, int64_t const value)
{
switch(option)
{
#if (ZMQ_VERSION_MAJOR == 2)
case socket_option::rate:
case socket_option::recovery_interval:
case socket_option::recovery_interval_seconds:
case socket_option::swap_size:
#else
case socket_option::max_messsage_size:
#endif
// zmq only allowed +ve int64_t options
if (value < 0) { throw exception("attempting to set a positive only 64 bit integer option with a negative 64bit integer"); }
if (0 != zmq_setsockopt(_socket, static_cast<int>(option), &value, sizeof(value)))
{
throw zmq_internal_exception();
}
break;
default:
throw exception("attempting to set a non 64 bit integer option with a 64 bit integer value");
}
}
void socket::set(socket_option const option, char const* value, size_t const length)
{
switch(option)
{
case socket_option::identity:
case socket_option::subscribe:
case socket_option::unsubscribe:
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
case socket_option::tcp_accept_filter:
#endif
if (0 != zmq_setsockopt(_socket, static_cast<int>(option), value, length))
{
throw zmq_internal_exception();
}
break;
default:
throw exception("attempting to set a non string option with a string value");
}
}
// Get socket options, multiple versions for easy of use
void socket::get(socket_option const option, int& value) const
{
size_t value_size = sizeof(int);
switch(option)
{
#if (ZMQ_VERSION_MAJOR == 2)
case socket_option::receive_more:
case socket_option::multicast_loopback:
value = static_cast<int>(get<int64_t>(option));
break;
#endif
case socket_option::type:
case socket_option::linger:
case socket_option::backlog:
case socket_option::reconnect_interval:
case socket_option::reconnect_interval_max:
case socket_option::receive_timeout:
case socket_option::send_timeout:
case socket_option::file_descriptor:
case socket_option::events:
#if (ZMQ_VERSION_MAJOR > 2)
case socket_option::receive_more:
case socket_option::send_buffer_size:
case socket_option::receive_buffer_size:
case socket_option::rate:
case socket_option::recovery_interval:
case socket_option::send_high_water_mark:
case socket_option::receive_high_water_mark:
case socket_option::multicast_hops:
#endif
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 1))
case socket_option::ipv4_only:
#endif
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
#if (ZMQ_VERSION_MINOR == 2)
case socket_option::delay_attach_on_connect:
#else
case socket_option::immediate:
#endif
case socket_option::tcp_keepalive:
case socket_option::tcp_keepalive_idle:
case socket_option::tcp_keepalive_count:
case socket_option::tcp_keepalive_interval:
#endif
#ifdef ZMQ_EXPERIMENTAL_LABELS
case socket_option::receive_label:
#endif
if (0 != zmq_getsockopt(_socket, static_cast<int>(option), &value, &value_size))
{
throw zmq_internal_exception();
}
// sanity check
assert(value_size <= sizeof(int));
break;
default:
throw exception("attempting to get a non integer option with an integer value");
}
}
void socket::get(socket_option const option, bool& value) const
{
#if (ZMQ_VERSION_MAJOR == 2)
int64_t int_value = 0;
size_t value_size = sizeof(int64_t);
#else
int int_value = 0;
size_t value_size = sizeof(int);
#endif
switch(option)
{
case socket_option::receive_more:
#if (ZMQ_VERSION_MAJOR == 2)
case socket_option::multicast_loopback:
#endif
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 1))
case socket_option::ipv4_only:
#endif
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
#if (ZMQ_VERSION_MINOR == 2)
case socket_option::delay_attach_on_connect:
#else
case socket_option::immediate:
#endif
#endif
#ifdef ZMQ_EXPERIMENTAL_LABELS
case socket_option::receive_label:
#endif
if (0 != zmq_getsockopt(_socket, static_cast<int>(option), &int_value, &value_size))
{
throw zmq_internal_exception();
}
value = (int_value == 1) ? true : false;
break;
default:
throw exception("attempting to get a non boolean option with a boolean value");
}
}
void socket::get(socket_option const option, uint64_t& value) const
{
size_t value_size = sizeof(uint64_t);
switch(option)
{
#if (ZMQ_VERSION_MAJOR == 2)
case socket_option::high_water_mark:
case socket_option::send_buffer_size:
case socket_option::receive_buffer_size:
#endif
case socket_option::affinity:
if(0 != zmq_getsockopt(_socket, static_cast<int>(option), &value, &value_size))
{
throw zmq_internal_exception();
}
break;
default:
throw exception("attempting to get a non unsigned 64 bit integer option with an unsigned 64 bit integer value");
}
}
void socket::get(socket_option const option, int64_t& value) const
{
size_t value_size = sizeof(int64_t);
switch(option)
{
#if (ZMQ_VERSION_MAJOR == 2)
case socket_option::rate:
case socket_option::recovery_interval:
case socket_option::recovery_interval_seconds:
case socket_option::swap_size:
case socket_option::receive_more:
case socket_option::multicast_loopback:
#else
case socket_option::max_messsage_size:
#endif
if(0 != zmq_getsockopt(_socket, static_cast<int>(option), &value, &value_size))
{
throw zmq_internal_exception();
}
break;
default:
throw exception("attempting to get a non 64 bit integer option with an 64 bit integer value");
}
}
void socket::get(socket_option const option, std::string& value) const
{
static std::array<char, max_socket_option_buffer_size> buffer;
size_t size = max_socket_option_buffer_size;
switch(option)
{
case socket_option::identity:
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
case socket_option::last_endpoint:
#endif
if(0 != zmq_getsockopt(_socket, static_cast<int>(option), buffer.data(), &size))
{
throw zmq_internal_exception();
}
value.assign(buffer.data(), size);
break;
default:
throw exception("attempting to get a non string option with a string value");
}
}
socket::socket(socket&& source) NOEXCEPT
: _socket(source._socket)
, _type(source._type)
, _recv_buffer()
{
// we steal the zmq_msg_t from the valid socket, we only init our own because it's cheap
// and zmq_msg_move does a valid check
zmq_msg_init(&_recv_buffer);
zmq_msg_move(&_recv_buffer, &source._recv_buffer);
// Clean up source a little, we will handle the deinit, it doesn't need to
source._socket = nullptr;
}
socket& socket::operator=(socket&& source) NOEXCEPT
{
std::swap(_socket, source._socket);
_type = source._type; // just clone?
// we steal the zmq_msg_t from the valid socket, we only init our own because it's cheap
// and zmq_msg_move does a valid check
zmq_msg_init(&_recv_buffer);
zmq_msg_move(&_recv_buffer, &source._recv_buffer);
return *this;
}
socket::operator bool() const
{
return nullptr != _socket;
}
socket::operator void*() const
{
return _socket;
}
void socket::track_message(message const& /* message */, uint32_t const parts, bool& should_delete)
{
if (parts == 0)
{
should_delete = true;
}
}
}

500
dep/zmqpp/zmqpp/socket.hpp Normal file
View File

@@ -0,0 +1,500 @@
/**
* \file
*
* \date 9 Aug 2011
* \author Ben Gray (\@benjamg)
*/
#ifndef ZMQPP_SOCKET_HPP_
#define ZMQPP_SOCKET_HPP_
#include <cstring>
#include <string>
#include <list>
#include <zmq.h>
#include "compatibility.hpp"
#include "socket_types.hpp"
#include "socket_options.hpp"
namespace zmqpp
{
class context;
class message;
typedef std::string endpoint_t;
typedef context context_t;
typedef message message_t;
/*!
* The socket class represents the zmq sockets.
*
* A socket can be bound and/or connected to as many endpoints as required
* with the sole exception of a ::pair socket.
*
* The routing is handled by zmq based on the type set.
*
* The bound side of an inproc connection must occur first and inproc can only
* connect to other inproc sockets of the same context.
*
* This class is c++0x move supporting and cannot be copied.
*/
class socket
{
public:
static const int normal; /*!< /brief default send type, no flags set */
#if (ZMQ_VERSION_MAJOR == 2)
static const int dont_wait; /*!< /brief don't block if sending is not currently possible */
#else
static const int dont_wait; /*!< /brief don't block if sending is not currently possible */
#endif
static const int send_more; /*!< /brief more parts will follow this one */
#ifdef ZMQ_EXPERIMENTAL_LABELS
static const int send_label; /*!< /brief this message part is an internal zmq label */
#endif
/*!
* Create a socket for a given type.
*
* \param context the zmq context under which the socket will live
* \param type a valid ::socket_type for the socket
*/
socket(context_t const& context, socket_type const type);
/*!
* This will close any socket still open before returning
*/
~socket();
/*!
* Get the type of the socket, this works on zmqpp types and not the zmq internal types.
* Use the socket::get method if you wish to intergoate the zmq internal ones.
*
* \return the type of the socket
*/
socket_type type() const { return _type; }
/*!
* Asynchronously binds to an endpoint.
*
* \param endpoint the zmq endpoint to bind to
*/
void bind(endpoint_t const& endpoint);
/*!
* Unbinds from a previously bound endpoint.
*
* \param endpoint the zmq endpoint to bind to
*/
void unbind(endpoint_t const& endpoint);
/*!
* Asynchronously connects to an endpoint.
* If the endpoint is not inproc then zmq will happily keep trying
* to connect until there is something there.
*
* Inproc sockets must have a valid target already bound before connection
* will work.
*
* \param endpoint the zmq endpoint to connect to
*/
void connect(endpoint_t const& endpoint);
/*!
* Asynchronously connects to multiple endpoints.
* If the endpoint is not inproc then zmq will happily keep trying
* to connect until there is something there.
*
* Inproc sockets must have a valid target already bound before connection
* will work.
*
* This is a helper function that wraps the single item connect in a loop
*
* \param connections_begin the starting iterator for zmq endpoints.
* \param connections_end the final iterator for zmq endpoints.
*/
template<typename InputIterator>
void connect(InputIterator const& connections_begin, InputIterator const& connections_end)
{
for(InputIterator it = connections_begin; it != connections_end; ++it)
{
connect(*it);
}
}
/*!
* Disconnects a previously connected endpoint.
*
* \param endpoint the zmq endpoint to disconnect from
*/
void disconnect(endpoint_t const& endpoint);
/*!
* Disconnects from multiple previously connected endpoints.
*
* This is a helper function that wraps the single item disconnect in a loop
*
* \param disconnections_begin the starting iterator for zmq endpoints.
* \param disconnections_end the final iterator for zmq endpoints.
*/
template<typename InputIterator>
void disconnect(InputIterator const& disconnections_begin, InputIterator const& disconnections_end)
{
for(InputIterator it = disconnections_begin; it != disconnections_end; ++it)
{
disconnect(*it);
}
}
/*!
* Closes the internal zmq socket and marks this instance
* as invalid.
*/
void close();
/*!
* Sends the message over the connection, this may be a multipart message.
*
* If dont_block is true and we are unable to add a new message then this
* function will return false.
*
* \param message message to send
* \param dont_block boolean to dictate if we wait while sending.
* \return true if message sent, false if it would have blocked
*/
bool send(message_t& message, bool const dont_block = false);
/*!
* Gets a message from the connection, this may be a multipart message.
*
* If dont_block is true and we are unable to get a message then this
* function will return false.
*
* \param message reference to fill with received data
* \param dont_block boolean to dictate if we wait for data.
* \return true if message sent, false if it would have blocked
*/
bool receive(message_t& message, bool const dont_block = false);
/*!
* Sends the byte data held by the string as the next message part.
*
* If the socket::DONT_WAIT flag and we are unable to add a new message to
* socket then this function will return false.
*
* \param string message part to send
* \param flags message send flags
* \return true if message part sent, false if it would have blocked
*/
bool send(std::string const& string, int const flags = normal);
/*!
* If there is a message ready then get the next part as a string
*
* If the socket::DONT_WAIT flag and there is no message ready to receive
* then this function will return false.
*
* \param string message part to receive into
* \param flags message receive flags
* \return true if message part received, false if it would have blocked
*/
bool receive(std::string& string, int const flags = normal);
/*!
* Sends the byte data pointed to by buffer as the next part of the message.
*
* If the socket::DONT_WAIT flag and we are unable to add a new message to
* socket then this function will return false.
*
* \param buffer byte buffer pointer to start writing from
* \param length max length of the buffer
* \param flags message send flags
* \return true if message part sent, false if it would have blocked
*/
bool send_raw(char const* buffer, int const length, int const flags = normal);
/*!
* \warning If the buffer is not large enough for the message part then the
* data will be truncated. The rest of the part is lost forever.
*
* If there is a message ready then get the next part of it as a raw
* byte buffer.
*
* If the socket::DONT_WAIT flag and there is no message ready to receive
* then this function will return false.
*
* \param buffer byte buffer pointer to start writing to
* \param length max length of the buffer
* \param flags message receive flags
* \return true if message part received, false if it would have blocked
*/
bool receive_raw(char* buffer, int& length, int const flags = normal);
/*!
*
* Subscribe to a topic
*
* Helper function that is equivalent of calling
* \code
* set(zmqpp::socket_option::subscribe, topic);
* \endcode
*
* This method is only useful for subscribe type sockets.
*
* \param topic the topic to subscribe to.
*/
void subscribe(std::string const& topic);
/*!
* Subscribe to a topic
*
* Helper function that is equivalent of a loop calling
* \code
* set(zmqpp::socket_option::subscribe, topic);
* \endcode
*
* This method is only useful for subscribe type sockets.
*
* Generally this will be used with stl collections using begin() and
* end() functions to get the iterators.
* For this reason the end loop runs until the end iterator, not inclusive
* of it.
*
* \param topics_begin the starting iterator for topics.
* \param topics_end the final iterator for topics.
*/
template<typename InputIterator>
void subscribe(InputIterator const& topics_begin, InputIterator const& topics_end)
{
for(InputIterator it = topics_begin; it != topics_end; ++it)
{
subscribe(*it);
}
}
/*!
* Unsubscribe from a topic
*
* Helper function that is equivalent of calling
* \code
* set(zmqpp::socket_option::unsubscribe, topic);
* \endcode
*
* This method is only useful for subscribe type sockets.
*
* \param topic the topic to unsubscribe from.
*/
void unsubscribe(std::string const& topic);
/*!
* Unsubscribe from a topic
*
* Helper function that is equivalent of a loop calling
* \code
* set(zmqpp::socket_option::unsubscribe, topic);
* \endcode
*
* This method is only useful for subscribe type sockets.
*
* Generally this will be used with stl collections using begin() and
* end() functions to get the iterators.
* For this reason the end loop runs until the end iterator, not inclusive
* of it.
*
* \param topics_begin the starting iterator for topics.
* \param topics_end the final iterator for topics.
*/
template<typename InputIterator>
void unsubscribe(InputIterator const& topics_begin, InputIterator const& topics_end)
{
for(InputIterator it = topics_begin; it != topics_end; ++it)
{
unsubscribe(*it);
}
}
/*!
* If the last receive part call to the socket resulted
* in a label or a non-terminating part of a multipart
* message this will return true.
*
* \return true if there are more parts
*/
bool has_more_parts() const;
/*!
* Set the value of an option in the underlaying zmq socket.
*
* \param option a valid ::socket_option
* \param value to set the option to
*/
void set(socket_option const option, int const value);
/*!
* Set the value of an option in the underlaying zmq socket.
*
* \since 2.0.0 (built against 0mq version 3.1.x or later)
*
* \param option a valid ::socket_option
* \param value to set the option to
*/
void set(socket_option const option, bool const value);
/*!
* Set the value of an option in the underlaying zmq socket.
*
* \param option a valid ::socket_option
* \param value to set the option to
*/
void set(socket_option const option, uint64_t const value);
/*!
* Set the value of an option in the underlaying zmq socket.
*
* \param option a valid ::socket_option
* \param value to set the option to
*/
void set(socket_option const option, int64_t const value);
/*!
* Set the value of an option in the underlaying zmq socket.
*
* \param option a valid ::socket_option
* \param pointer to raw byte value to set the option to
* \param length the size of the raw byte value
*/
void set(socket_option const option, char const* value, size_t const length);
/*!
* Set the value of an option in the underlaying zmq socket.
*
* \param option a valid ::socket_option
* \param pointer to null terminated cstring value to set the option to
*/
inline void set(socket_option const option, char const* value) { set(option, value, strlen(value)); }
/*!
* Set the value of an option in the underlaying zmq socket.
*
* \param option a valid ::socket_option
* \param value to set the option to
*/
inline void set(socket_option const option, std::string const value) { set(option, value.c_str(), value.length()); }
/*!
* Get a socket option from the underlaying zmq socket.
*
* \param option a valid ::socket_option
* \param value referenced int to return value in
*/
void get(socket_option const option, int& value) const;
/*!
* Get a socket option from the underlaying zmq socket.
*
* \param option a valid ::socket_option
* \param value referenced bool to return value in
*/
void get(socket_option const option, bool& value) const;
/*!
* Get a socket option from the underlaying zmq socket.
*
* \param option a valid ::socket_option
* \param value referenced uint64_t to return value in
*/
void get(socket_option const option, uint64_t& value) const;
/*!
* Get a socket option from the underlaying zmq socket.
*
* \param option a valid ::socket_option
* \param value referenced uint64_t to return value in
*/
void get(socket_option const option, int64_t& value) const;
/*!
* Get a socket option from the underlaying zmq socket.
*
* \param option a valid ::socket_option
* \param value referenced std::string to return value in
*/
void get(socket_option const option, std::string& value) const;
/*!
* For those that don't want to get into a referenced value this templated method
* will return the value instead.
*
* \param option a valid ::socket_option
* \return socket option value
*/
template<typename Type>
Type get(socket_option const option) const
{
Type value = Type();
get(option, value);
return value;
}
/*!
* Move constructor
*
* Moves the internals of source to this object, there is no guarantee
* that source will be left in a valid state.
*
* This constructor is noexcept and so will not throw exceptions
*
* \param source target socket to steal internals from
*/
socket(socket&& source) NOEXCEPT;
/*!
* Move operator
*
* Moves the internals of source to this object, there is no guarantee
* that source will be left in a valid state.
*
* This function is noexcept and so will not throw exceptions
*
* \param source target socket to steal internals from
* \return socket reference to this
*/
socket& operator=(socket&& source) NOEXCEPT;
/*!
* Check the socket is still valid
*
* This tests the internal state of the socket.
* If creation failed for some reason or if the move functions were used
* to move the socket internals to another instance this will return false.
*
* \return true if the socket is valid
*/
operator bool() const;
/*!
* Access to the raw 0mq context
*
* \return void pointer to the underlying 0mq socket
*/
operator void*() const;
private:
void* _socket;
socket_type _type;
zmq_msg_t _recv_buffer;
// No copy
socket(socket const&) NOEXCEPT ZMQPP_EXPLICITLY_DELETED;
socket& operator=(socket const&) NOEXCEPT ZMQPP_EXPLICITLY_DELETED;
void track_message(message_t const&, uint32_t const, bool&);
};
}
#endif /* ZMQPP_SOCKET_HPP_ */

View File

@@ -0,0 +1,80 @@
/**
* \file
*
* \date 23 Sep 2011
* \author Ben Gray (\@benjamg)
*/
#ifndef ZMQPP_SOCKET_OPTIONS_HPP_
#define ZMQPP_SOCKET_OPTIONS_HPP_
namespace zmqpp
{
/** \todo Expand the information on the options to make it actually useful. */
/*!
* \brief possible Socket options in zmq
*/
enum class socket_option {
affinity = ZMQ_AFFINITY, /*!< I/O thread affinity */
identity = ZMQ_IDENTITY, /*!< Socket identity */
subscribe = ZMQ_SUBSCRIBE, /*!< Add topic subscription - set only */
unsubscribe = ZMQ_UNSUBSCRIBE, /*!< Remove topic subscription - set only */
rate = ZMQ_RATE, /*!< Multicast data rate */
send_buffer_size = ZMQ_SNDBUF, /*!< Kernel transmission buffer size */
receive_buffer_size = ZMQ_RCVBUF, /*!< Kernel receive buffer size */
receive_more = ZMQ_RCVMORE, /*!< Can receive more parts - get only */
file_descriptor = ZMQ_FD, /*!< Socket file descriptor - get only */
events = ZMQ_EVENTS, /*!< Socket event flags - get only */
type = ZMQ_TYPE, /*!< Socket type - get only */
linger = ZMQ_LINGER, /*!< Socket linger timeout */
backlog = ZMQ_BACKLOG, /*!< Maximum length of outstanding connections - get only */
#if (ZMQ_VERSION_MAJOR == 2)
// Note that this is inverse of the zmq names for version 2.x
recovery_interval_seconds = ZMQ_RECOVERY_IVL, /*!< Multicast recovery interval in seconds */
recovery_interval = ZMQ_RECOVERY_IVL_MSEC, /*!< Multicast recovery interval in milliseconds */
#else
recovery_interval = ZMQ_RECOVERY_IVL, /*!< Multicast recovery interval in milliseconds */
#endif
reconnect_interval = ZMQ_RECONNECT_IVL, /*!< Reconnection interval */
reconnect_interval_max = ZMQ_RECONNECT_IVL_MAX, /*!< Maximum reconnection interval */
receive_timeout = ZMQ_RCVTIMEO, /*!< Maximum inbound block timeout */
send_timeout = ZMQ_SNDTIMEO, /*!< Maximum outbound block timeout */
#if (ZMQ_VERSION_MAJOR == 2)
high_water_mark = ZMQ_HWM, /*!< High-water mark for all messages */
swap_size = ZMQ_SWAP, /*!< Maximum socket swap size in bytes */
multicast_loopback = ZMQ_MCAST_LOOP, /*!< Allow multicast packet loopback */
#else
max_messsage_size = ZMQ_MAXMSGSIZE, /*!< Maximum inbound message size */
send_high_water_mark = ZMQ_SNDHWM, /*!< High-water mark for outbound messages */
receive_high_water_mark = ZMQ_RCVHWM, /*!< High-water mark for inbound messages */
multicast_hops = ZMQ_MULTICAST_HOPS, /*!< Maximum number of multicast hops */
#endif
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 1))
ipv4_only = ZMQ_IPV4ONLY,
#endif
#if (ZMQ_VERSION_MAJOR > 3) || ((ZMQ_VERSION_MAJOR == 3) && (ZMQ_VERSION_MINOR >= 2))
#if (ZMQ_VERSION_MINOR == 2)
delay_attach_on_connect = ZMQ_DELAY_ATTACH_ON_CONNECT, /*!< Delay buffer attachment until connect complete */
#else
// ZMQ_DELAY_ATTACH_ON_CONNECT is renamed in ZeroMQ starting 3.3.x
immediate = ZMQ_IMMEDIATE, /*!< Block message sending until connect complete */
#endif
last_endpoint = ZMQ_LAST_ENDPOINT, /*!< Last bound endpoint - get only */
router_mandatory = ZMQ_ROUTER_MANDATORY, /*!< Require routable messages - set only */
xpub_verbose = ZMQ_XPUB_VERBOSE, /*!< Pass on existing subscriptions - set only */
tcp_keepalive = ZMQ_TCP_KEEPALIVE, /*!< Enable TCP keepalives */
tcp_keepalive_idle = ZMQ_TCP_KEEPALIVE_IDLE, /*!< TCP keepalive idle count (generally retry count) */
tcp_keepalive_count = ZMQ_TCP_KEEPALIVE_CNT, /*!< TCP keepalive retry count */
tcp_keepalive_interval = ZMQ_TCP_KEEPALIVE_INTVL, /*!< TCP keepalive interval */
tcp_accept_filter = ZMQ_TCP_ACCEPT_FILTER, /*!< Filter inbound connections - set only */
#endif
#ifdef ZMQ_EXPERIMENTAL_LABELS
receive_label = ZMQ_RCVLABEL, /*!< Received label part - get only */
#endif
};
}
#endif /* ZMQPP_SOCKET_OPTIONS_HPP_ */

View File

@@ -0,0 +1,148 @@
/**
* \file
*
* \date 23 Sep 2011
* \author Ben Gray (\@benjamg)
*/
#ifndef ZMQPP_SOCKET_TYPES_HPP_
#define ZMQPP_SOCKET_TYPES_HPP_
namespace zmqpp
{
/*!
* \brief Socket types allowed by zmq
*
* The socket type choose at creation must be one of these types.
*
* Each is designed for a different use and has different limitations.
*/
enum class socket_type {
/*!
* One to one - two way connection.\n
* Connect to ::pair.\n
* A \c pair socket has to be connected only one other pair socket and allows
* two way communication between them.
*/
pair = ZMQ_PAIR,
/*!
* One to many - fan out.\n
* Connect to ::subscribe or ::xsubscribe.\n
* Socket is send only.\n
* Socket will drop messages and not block.\n
* \c publish sockets allow sending of the same message to many subscribers
* each subscriber can limit what is sent through the socket_option::subscribe
* settings.
*/
publish = ZMQ_PUB,
/*!
* \note It seems doxygen can't work out which data is for the socket type and
* which is for the socket option so both get listed for both.
*
* One to many - fair-queued.\n
* Connect to ::publish or ::xpublish.\n
* Socket is receive only.\n
* The \c subscribe socket can connection to any number of publishers and will
* fairly pull messages from each. The socket_option::subscribe settings can
* be use to limit which messages are received and by default none are.
*/
subscribe = ZMQ_SUB,
/*!
* One to many - fair-queued.\n
* Connect to ::push.\n
* Socket is receive only.\n
* The \c pull socket fairly pulls messages from all pushers it is connected
* to.
*/
pull = ZMQ_PULL,
/*!
* One to many - load-balanced.\n
* Connect to ::pull.\n
* Socket is send only.\n
* Socket will block if unable to send.\n
* The \c push socket fairly distributes messages between any connected
* puller sockets.
*/
push = ZMQ_PUSH,
/*!
* One to many - fair-queued outgoing, last peer incoming.\n
* Connect to ::reply or ::xreply.\n
* Socket flips between send and receive only.\n
* Socket will block if unable to send.\n
* The \c request socket will fairly balance requests sent out to a
* replier and then can only be used to receive until that replier
* sends a reply.
*/
request = ZMQ_REQ,
/*!
* One to many - load-balanced incoming, last peer outgoing.\n
* Connect to ::request or ::xrequest.\n
* Socket flips between send and receive only.\n
* Socket will drop messages and not block.\n
* The \c reply socket can only receive until it pulls a message from a
* requester at which point it can only send until the reply is sent.
*/
reply = ZMQ_REP,
/*!
* One to many - fan out.\n
* Connect to ::subscribe or ::xsubscribe.\n
* Socket is send only with the exception of special subscription messages.\n
* Socket will drop messages and not block.\n
* \c xpublish act the same as ::publish sockets however also allow special
* subscription messages to be received from subscribers.
*/
xpublish = ZMQ_XPUB,
/*!
* One to many - fair-queued.\n
* Connect to ::publish or ::xpublish.\n
* Socket is receive only with the exception of special subscription messages\n
* \c xsubscribe act the same as ::subscribe sockets however also allow special
* subscription messages to be send to connected publishers.
*/
xsubscribe = ZMQ_XSUB,
/*!
* One to many - fair-queued incoming, load-balanced outgoing.\n
* Connect to ::reply or ::xreply.\n
* Socket will block if unable to send.\n
* An \c xrequest socket balances requests between repliers and pulls replies
* back in a fair manner. Each request is expected to have exactly one reply.
*/
xrequest = ZMQ_XREQ,
/*!
* One to many - fair-queued incoming, targeted outgoing.\n
* Connect to ::request or ::xrequest.\n
* Socket will drop messages and not block.\n
* An \c xreply socket fairly pulls in requests from requesters and will
* label requests so it can return replies back to the correct target.
*/
xreply = ZMQ_XREP,
// To match for people who prefer the shorter versions
pub = ZMQ_PUB, /*!< version of ::publish to match zmq name convention */
sub = ZMQ_SUB, /*!< version of ::subscribe to match zmq name convention */
req = ZMQ_REQ, /*!< version of ::request to match zmq name convention */
rep = ZMQ_REP, /*!< version of ::reply to match zmq name convention */
xpub = ZMQ_XPUB, /*!< version of ::xpublish to match zmq name convention */
xsub = ZMQ_XSUB, /*!< version of ::xsubscribe to match zmq name convention */
xreq = ZMQ_XREQ, /*!< version of ::xrequest to match zmq name convention */
xrep = ZMQ_XREP, /*!< version of ::xreply to match zmq name convention */
// For completion
router = ZMQ_ROUTER, /*!< \deprecated Matches zmq 2.x xrep functionality. */
dealer = ZMQ_DEALER /*!< \deprecated Matches zmq 2.x xreq functionality. */
};
}
#endif /* ZMQPP_SOCKET_TYPES_HPP_ */

30
dep/zmqpp/zmqpp/zmqpp.cpp Normal file
View File

@@ -0,0 +1,30 @@
/*
* Created on: 18 Aug 2011
* Author: Ben Gray (@benjamg)
*/
#include "zmqpp.hpp"
namespace zmqpp
{
std::string version()
{
return BUILD_VERSION;
}
void version(uint8_t& major, uint8_t& minor, uint8_t& revision)
{
major = ZMQPP_VERSION_MAJOR;
minor = ZMQPP_VERSION_MINOR;
revision = ZMQPP_VERSION_REVISION;
}
void zmq_version(uint8_t& major, uint8_t& minor, uint8_t& patch)
{
major = ZMQ_VERSION_MAJOR;
minor = ZMQ_VERSION_MINOR;
patch = ZMQ_VERSION_PATCH;
}
}

111
dep/zmqpp/zmqpp/zmqpp.hpp Normal file
View File

@@ -0,0 +1,111 @@
/**
* \file
*
* \date 9 Aug 2011
* \author Ben Gray (\@benjamg)
*
* License: http://www.opensource.org/licenses/MIT
*
* Copyright (C) 2011 by Ben Gray
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef ZMQPP_ZMQPP_HPP_
#define ZMQPP_ZMQPP_HPP_
/**
* \def ZMQPP_VERSION_MAJOR
* zmqpp major version number, generated at compile time
*/
#define ZMQPP_VERSION_MAJOR BUILD_VERSION_MAJOR
/**
* \def ZMQPP_VERSION_MINOR
* zmqpp minor version number, generated at compile time
*/
#define ZMQPP_VERSION_MINOR BUILD_VERSION_MINOR
/**
* \def ZMQPP_VERSION_REVISION
* zmqpp version revision number, generated at compile time
*/
#define ZMQPP_VERSION_REVISION BUILD_VERSION_REVISION
#include <zmq.h>
#include "compatibility.hpp"
#include "context.hpp"
#include "exception.hpp"
#include "message.hpp"
#include "poller.hpp"
#include "socket.hpp"
/*!
* \brief C++ wrapper around zmq
*
* All zmq++ / zmqpp functions, constants and classes live within this namespace,
*/
namespace zmqpp
{
/*!
* Returns the current major.minor.revision version number as a string.
*
* \return string version number.
*/
std::string version();
/*!
* Retrieve the parts of the zmqpp version number.
*
* Set the three parameters to values representing the zmqpp version number.
* These values are generated at library compile time.
*
* \param major an unsigned 8 bit reference to set to the major version.
* \param minor an unsigned 8 bit reference to set to the minor version.
* \param revision an unsigned 8 bit reference to set the current revision.
*/
void version(uint8_t& major, uint8_t& minor, uint8_t& revision);
/*!
* Retrieve the parts of the 0mq version this library was built against.
*
* Because sections of the library are optionally compiled in or ignored
* depending on the version of 0mq it was compiled against this method is
* provided to allow sanity checking for usage.
*
* Set the three parameters to values representing the 0mq version number.
* These values are generated at library compile time.
*
* \param major an unsigned 8 bit reference to set to the major version.
* \param minor an unsigned 8 bit reference to set to the minor version.
* \param revision an unsigned 8 bit reference to set the current revision.
*/
void zmq_version(uint8_t& major, uint8_t& minor, uint8_t& patch);
typedef context context_t; /*!< \brief context type */
typedef std::string endpoint_t; /*!< \brief endpoint type */
typedef message message_t; /*!< \brief message type */
typedef poller poller_t; /*!< \brief poller type */
typedef socket socket_t; /*!< \brief socket type */
}
#endif /* ZMQPP_ZMQPP_HPP_ */

View File

@@ -237,7 +237,7 @@ CREATE TABLE `battlenet_modules` (
`Type` varchar(8) NOT NULL,
`System` varchar(8) NOT NULL,
`Data` text,
PRIMARY KEY (`Hash`),
PRIMARY KEY (`Name`,`System`),
UNIQUE KEY `uk_name_type_system` (`Name`,`Type`,`System`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -272,7 +272,26 @@ INSERT INTO `battlenet_modules` VALUES
('bfe4ceb47700aa872e815e007e27df955d4cd4bc1fe731039ee6498ce209f368','Resume','auth','Win',NULL),
('00ffd88a437afbb88d7d4b74be2e3b43601605ee229151aa9f4bebb29ef66280','Resume','auth','Mac',NULL),
('898166926805f897804bdbbf40662c9d768590a51a0b26c40dbcdf332ba11974','Resume','auth','Wn64',NULL),
('304627d437c38500c0b5ca0c6220eeade91390e52a2b005ff3f7754afa1f93cd','Resume','auth','Mc64',NULL);
('304627d437c38500c0b5ca0c6220eeade91390e52a2b005ff3f7754afa1f93cd','Resume','auth','Mc64',NULL),
('cc654428261322763f4cada5b7f4b3b67660e85639bea916986b3f366fe8adc2','ERRS','xml','enGB','AA6C50D3'),
('2753d31092f1978bdd78ebd4fae2d189364ad7108ceb22fbf1413be1f43bef04','PFTY','pfty','zhCN','DF6C50D3'),
('5813f318f7e40a07a7cdfeeec9827942e6fdc5ccee0d4171148443e429ad0ead','PFTY','pfty','ruRU','DF6C50D3'),
('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enSG','DF6C50D3'),
('870f53d10b4e1b09d6b622cd5671ba4ff1ad69512dfa2c676072c52e45c7f0f9','PFTY','pfty','esES','DF6C50D3'),
('305bbdab1953e65974a249e276867e13ad2c3cabca3668983cb5ed406251bb7b','PFTY','pfty','frFR','DF6C50D3'),
('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enGB','DF6C50D3'),
('a2ec4b41148214037a2e89a2e557af716d085241b81f5244494bdc77a891ca38','PFTY','pfty','csCZ','DF6C50D3'),
('a8c77051991b1a6c5dfe412e9f46d8f584349996fbde37c4f2a527c192163502','PFTY','pfty','plPL','DF6C50D3'),
('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enUS','DF6C50D3'),
('7466b2db3f03768aa2527535d4b3c6c9ef9e8fb07c6db88b1019f3d25a2942e8','PFTY','pfty','koKR','DF6C50D3'),
('a2ec4b41148214037a2e89a2e557af716d085241b81f5244494bdc77a891ca38','PFTY','pfty','jaJP','DF6C50D3'),
('3e381d4f83201f4e3c482eb74da12e5ff9dd924da2413d8fb33f5eea9a02c2c2','PFTY','pfty','zhTW','DF6C50D3'),
('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enTH','DF6C50D3'),
('b72e65b6b34d8f859e79b5f28952e26553a796d5e1d75c2b5930bc0daeaa728c','PFTY','pfty','itIT','DF6C50D3'),
('e8b82becbe0a0a1bbb5561df69320edbd770897a8deaab23caa6736255e0dc33','PFTY','pfty','esMX','DF6C50D3'),
('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enAU','DF6C50D3'),
('0a3f6f3f0535ea21dbe620085192afc796203047e270e0e1b76f15a739fe1797','PFTY','pfty','ptBR','DF6C50D3'),
('047329d08d433da2622e9fc2ee96c8dd8f35e7770699d07cf74855b9c8ea9125','PFTY','pfty','deDE','DF6C50D3');
/*!40000 ALTER TABLE `battlenet_modules` ENABLE KEYS */;
UNLOCK TABLES;

View File

@@ -0,0 +1,24 @@
ALTER TABLE `battlenet_modules`
DROP PRIMARY KEY,
ADD PRIMARY KEY (`Name`, `System`);
DELETE FROM `battlenet_modules` WHERE `Name` IN ('ERRS','PFTY');
INSERT INTO `battlenet_modules` (`Hash`,`Name`,`Type`,`System`,`Data`) VALUES
('cc654428261322763f4cada5b7f4b3b67660e85639bea916986b3f366fe8adc2', 'ERRS', 'xml', 'enGB', 'AA6C50D3'),
('2753d31092f1978bdd78ebd4fae2d189364ad7108ceb22fbf1413be1f43bef04', 'PFTY', 'pfty', 'zhCN', 'DF6C50D3'),
('5813f318f7e40a07a7cdfeeec9827942e6fdc5ccee0d4171148443e429ad0ead', 'PFTY', 'pfty', 'ruRU', 'DF6C50D3'),
('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03', 'PFTY', 'pfty', 'enSG', 'DF6C50D3'),
('870f53d10b4e1b09d6b622cd5671ba4ff1ad69512dfa2c676072c52e45c7f0f9', 'PFTY', 'pfty', 'esES', 'DF6C50D3'),
('305bbdab1953e65974a249e276867e13ad2c3cabca3668983cb5ed406251bb7b', 'PFTY', 'pfty', 'frFR', 'DF6C50D3'),
('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03', 'PFTY', 'pfty', 'enGB', 'DF6C50D3'),
('a2ec4b41148214037a2e89a2e557af716d085241b81f5244494bdc77a891ca38', 'PFTY', 'pfty', 'csCZ', 'DF6C50D3'),
('a8c77051991b1a6c5dfe412e9f46d8f584349996fbde37c4f2a527c192163502', 'PFTY', 'pfty', 'plPL', 'DF6C50D3'),
('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03', 'PFTY', 'pfty', 'enUS', 'DF6C50D3'),
('7466b2db3f03768aa2527535d4b3c6c9ef9e8fb07c6db88b1019f3d25a2942e8', 'PFTY', 'pfty', 'koKR', 'DF6C50D3'),
('a2ec4b41148214037a2e89a2e557af716d085241b81f5244494bdc77a891ca38', 'PFTY', 'pfty', 'jaJP', 'DF6C50D3'),
('3e381d4f83201f4e3c482eb74da12e5ff9dd924da2413d8fb33f5eea9a02c2c2', 'PFTY', 'pfty', 'zhTW', 'DF6C50D3'),
('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03', 'PFTY', 'pfty', 'enTH', 'DF6C50D3'),
('b72e65b6b34d8f859e79b5f28952e26553a796d5e1d75c2b5930bc0daeaa728c', 'PFTY', 'pfty', 'itIT', 'DF6C50D3'),
('e8b82becbe0a0a1bbb5561df69320edbd770897a8deaab23caa6736255e0dc33', 'PFTY', 'pfty', 'esMX', 'DF6C50D3'),
('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03', 'PFTY', 'pfty', 'enAU', 'DF6C50D3'),
('0a3f6f3f0535ea21dbe620085192afc796203047e270e0e1b76f15a739fe1797', 'PFTY', 'pfty', 'ptBR', 'DF6C50D3'),
('047329d08d433da2622e9fc2ee96c8dd8f35e7770699d07cf74855b9c8ea9125', 'PFTY', 'pfty', 'deDE', 'DF6C50D3');

View File

@@ -0,0 +1,6 @@
UPDATE `gameobject_template` SET `AIName`="SmartGameObjectAI" WHERE `entry` IN(164885,164886,164887,164888,171939,171942,173284,173324,173327,174594,174595,174596,174597,174598,174599,174600,174601,174602,174603,174604,174605,174606,174607,174608,174684,174686,174708,174709,174712,174713,191124);
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry` IN(29525,29863,24198,23698,21611,21503);
UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid` IN(8978,2706) AND `source_type`=0 AND `id`=0;
UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid` IN(4675,28156) AND `source_type`=0 AND `id`=1;
UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=21057 AND `source_type`=0 AND `id`=9;
UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=25806 AND `source_type`=0 AND `id`=2;

View File

@@ -0,0 +1,86 @@
--
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=11038 WHERE `menu_id`=21278 AND `id`=0;
-- BroadcastTextID0
UPDATE `npc_text` SET `BroadcastTextID0`=3989 WHERE `ID`=1643;
UPDATE `npc_text` SET `BroadcastTextID0`=3991 WHERE `ID`=1644;
UPDATE `npc_text` SET `BroadcastTextID0`=3992 WHERE `ID`=1647;
UPDATE `npc_text` SET `BroadcastTextID0`=3993 WHERE `ID`=1648;
UPDATE `npc_text` SET `BroadcastTextID0`=3994 WHERE `ID`=1649;
UPDATE `npc_text` SET `BroadcastTextID0`=3996 WHERE `ID`=1650;
UPDATE `npc_text` SET `BroadcastTextID0`=4002 WHERE `ID`=1651;
UPDATE `npc_text` SET `BroadcastTextID0`=4004 WHERE `ID`=1652;
UPDATE `npc_text` SET `BroadcastTextID0`=4009 WHERE `ID`=1655;
UPDATE `npc_text` SET `BroadcastTextID0`=4011 WHERE `ID`=1656;
UPDATE `npc_text` SET `BroadcastTextID0`=4012 WHERE `ID`=1657;
UPDATE `npc_text` SET `BroadcastTextID0`=4083 WHERE `ID`=1693;
UPDATE `npc_text` SET `BroadcastTextID0`=4170 WHERE `ID`=1753;
UPDATE `npc_text` SET `BroadcastTextID0`=4171 WHERE `ID`=1754;
UPDATE `npc_text` SET `BroadcastTextID0`=4172 WHERE `ID`=1755;
UPDATE `npc_text` SET `BroadcastTextID0`=4173 WHERE `ID`=1756;
UPDATE `npc_text` SET `BroadcastTextID0`=4182 WHERE `ID`=1758;
UPDATE `npc_text` SET `BroadcastTextID0`=4184 WHERE `ID`=1759;
-- BroadcastTextID1
UPDATE `npc_text` SET `BroadcastTextID1`=2880 WHERE `ID`=882;
UPDATE `npc_text` SET `BroadcastTextID1`=6319 WHERE `ID`=905;
UPDATE `npc_text` SET `BroadcastTextID1`=6312 WHERE `ID`=922;
UPDATE `npc_text` SET `BroadcastTextID1`=6313 WHERE `ID`=923;
UPDATE `npc_text` SET `BroadcastTextID1`=6324 WHERE `ID`=928;
UPDATE `npc_text` SET `BroadcastTextID1`=5085 WHERE `ID`=2762;
UPDATE `npc_text` SET `BroadcastTextID1`=6343 WHERE `ID`=2769;
UPDATE `npc_text` SET `BroadcastTextID1`=5107 WHERE `ID`=2774;
UPDATE `npc_text` SET `BroadcastTextID1`=6349 WHERE `ID`=2775;
UPDATE `npc_text` SET `BroadcastTextID1`=6350 WHERE `ID`=2776;
UPDATE `npc_text` SET `BroadcastTextID1`=5116 WHERE `ID`=2794;
UPDATE `npc_text` SET `BroadcastTextID1`=6335 WHERE `ID`=2795;
UPDATE `npc_text` SET `BroadcastTextID1`=5365 WHERE `ID`=2797;
UPDATE `npc_text` SET `BroadcastTextID1`=6337 WHERE `ID`=2798;
UPDATE `npc_text` SET `BroadcastTextID1`=5132 WHERE `ID`=2801;
UPDATE `npc_text` SET `BroadcastTextID1`=6344 WHERE `ID`=2804;
UPDATE `npc_text` SET `BroadcastTextID1`=6347 WHERE `ID`=2807;
UPDATE `npc_text` SET `BroadcastTextID1`=5346 WHERE `ID`=3025;
UPDATE `npc_text` SET `BroadcastTextID1`=5358 WHERE `ID`=3036;
UPDATE `npc_text` SET `BroadcastTextID1`=5373 WHERE `ID`=3040;
UPDATE `npc_text` SET `BroadcastTextID1`=6361 WHERE `ID`=3042;
UPDATE `npc_text` SET `BroadcastTextID1`=6334 WHERE `ID`=3814;
UPDATE `npc_text` SET `BroadcastTextID1`=7053 WHERE `ID`=4310;
UPDATE `npc_text` SET `BroadcastTextID1`=10134 WHERE `ID`=7387;
UPDATE `npc_text` SET `BroadcastTextID1`=10367 WHERE `ID`=7484;
UPDATE `npc_text` SET `BroadcastTextID1`=10413 WHERE `ID`=7498;
UPDATE `npc_text` SET `BroadcastTextID1`=10418 WHERE `ID`=7500;
UPDATE `npc_text` SET `BroadcastTextID1`=10420 WHERE `ID`=7501;
UPDATE `npc_text` SET `BroadcastTextID1`=10391 WHERE `ID`=7502;
UPDATE `npc_text` SET `BroadcastTextID1`=10396 WHERE `ID`=7505;
UPDATE `npc_text` SET `BroadcastTextID1`=10399 WHERE `ID`=7506;
UPDATE `npc_text` SET `BroadcastTextID1`=10405 WHERE `ID`=7508;
UPDATE `npc_text` SET `BroadcastTextID1`=10407 WHERE `ID`=7509;
UPDATE `npc_text` SET `BroadcastTextID1`=10766 WHERE `ID`=15296;
UPDATE `npc_text` SET `BroadcastTextID1`=18268 WHERE `ID`=20551;
UPDATE `npc_text` SET `BroadcastTextID1`=18269 WHERE `ID`=20564;
UPDATE `npc_text` SET `BroadcastTextID1`=22227 WHERE `ID`=11256;
UPDATE `npc_text` SET `BroadcastTextID1`=45371 WHERE `ID`=16783;
UPDATE `npc_text` SET `BroadcastTextID1`=6111 WHERE `ID`=3668;
UPDATE `npc_text` SET `BroadcastTextID1`=10386 WHERE `ID`=7496;
-- BroadcastTextID2
UPDATE `npc_text` SET `BroadcastTextID2`=22228 WHERE `ID`=11256;
UPDATE `npc_text` SET `BroadcastTextID2`=18282 WHERE `ID`=20551;
UPDATE `npc_text` SET `BroadcastTextID2`=2909 WHERE `ID`=900;
UPDATE `npc_text` SET `BroadcastTextID2`=13816 WHERE `ID`=8893;
-- BroadcastTextID3
UPDATE `npc_text` SET `BroadcastTextID3`=2878 WHERE `ID`=879;
-- BroadcastTextID4
UPDATE `npc_text` SET `BroadcastTextID5`=13345 WHERE `ID`=8760;
-- Misc
UPDATE `npc_text` SET `text7_0`='' WHERE `ID`=3297;
UPDATE `npc_text` SET `text7_0`='' WHERE `ID`=7530;
UPDATE `npc_text` SET `text7_0`='' WHERE `ID`=7635;
UPDATE `npc_text` SET `text7_0`='' WHERE `ID`=7669;
UPDATE `npc_text` SET `text7_0`='' WHERE `ID`=8061;
UPDATE `npc_text` SET `text7_0`='' WHERE `ID`=8480;
UPDATE `npc_text` SET `text7_0`='' WHERE `ID`=8484;
UPDATE `npc_text` SET `text7_0`='' WHERE `ID`=8934;

View File

@@ -0,0 +1,34 @@
--
SET @Linda :=32687;
SET @Alec :=32692;
UPDATE creature_template SET `AIName`='SmartAI' WHERE entry IN (@Linda, @Alec);
DELETE FROM `smart_scripts` WHERE `entryorguid` = @Linda AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @Linda*100 AND `source_type` = 9;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @Linda*100+1 AND `source_type` = 9;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(@Linda, 0, 0, 0, 10, 0, 100, 0, 1, 10, 300000, 300000, 87, @Linda*100, @Linda*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Linda - OOC_LOS - RANDOM_TIMED_ACTIONLIST'),
(@Linda*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Linda - RANDOM_TIMED_ACTIONLIST - talk'),
(@Linda*100+1,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,@Alec,5,0,0,0,0,0,'Linda - RANDOM_TIMED_ACTIONLIST - talk');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceGroup`=1 AND `SourceEntry`=@Linda;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`, `ErrorTextId`,`ScriptName`,`Comment`) VALUES
(22,1,@Linda,0,5,1090,128,0,0,'','event require Kirin Tor Exalted');
DELETE FROM creature_text WHERE entry IN (@Linda, @Alec);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
(@Linda, 0, 0, 'There goes the finest $c I have the honor of knowing.', 12, 0, 100, 0, 0, 0, 'Linda Ann Kastinglow', 32866),
(@Linda, 0, 1, '$n, you''re an inspiration.', 12, 0, 100, 0, 0, 0, 'Linda Ann Kastinglow', 32867),
(@Linda, 0, 2, 'A fine example of a $g man:woman;, that $n.', 12, 0, 100, 0, 0, 0, 'Linda Ann Kastinglow', 32868),
(@Linda, 0, 3, 'You couldn''t ask for a finer person than $n, I say.', 12, 0, 100, 0, 0, 0, 'Linda Ann Kastinglow', 32869),
(@Linda, 0, 4, '$n, wonderful to see you. Wonderful.', 12, 0, 100, 0, 0, 0, 'Linda Ann Kastinglow', 32870),
(@Linda, 0, 5, '$n! Ah, fantastic to see you out and about. Busy as always, hm?', 12, 0, 100, 0, 0, 0, 'Linda Ann Kastinglow', 32871),
(@Alec, 0, 0, 'There goes the finest $c I have the honor of knowing.', 12, 0, 100, 0, 0, 0, 'Arcanist Alec', 32866),
(@Alec, 0, 1, '$n, you''re an inspiration.', 12, 0, 100, 0, 0, 0, 'Arcanist Alec', 32867),
(@Alec, 0, 2, 'A fine example of a $g man:woman;, that $n.', 12, 0, 100, 0, 0, 0, 'Arcanist Alec', 32868),
(@Alec, 0, 3, 'You couldn''t ask for a finer person than $n, I say.', 12, 0, 100, 0, 0, 0, 'Arcanist Alec', 32869),
(@Alec, 0, 4, '$n, wonderful to see you. Wonderful.', 12, 0, 100, 0, 0, 0, 'Arcanist Alec', 32870),
(@Alec, 0, 5, '$n! Ah, fantastic to see you out and about. Busy as always, hm?', 12, 0, 100, 0, 0, 0, 'Arcanist Alec', 32871);

View File

@@ -0,0 +1,8 @@
--
SET @ENTRY := 29483;
SET @SPELL_ENERGY_SURGE := 54559;
UPDATE `creature` SET `spawndist`=0, `MovementType`=0 WHERE `id` =@ENTRY;
UPDATE `creature_template` SET `unit_flags`=`unit_flags`|4|33554432, `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(@ENTRY, 0, 0, 0, 9, 0, 100, 0, 1, 20, 1000, 1000, 11, @SPELL_ENERGY_SURGE, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'K3 Perimeter Turret - Within 1-20 Range - Cast ''Energy Surge''');

View File

@@ -0,0 +1,5 @@
ALTER TABLE `creature` ADD `zoneId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Zone Identifier' AFTER `map`;
ALTER TABLE `creature` ADD `areaId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Area Identifier' AFTER `zoneId`;
ALTER TABLE `gameobject` ADD `zoneId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Zone Identifier' AFTER `map`;
ALTER TABLE `gameobject` ADD `areaId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Area Identifier' AFTER `zoneId`;

View File

@@ -0,0 +1,71 @@
SET @CGUID :=74960;
SET @OGUID :=21104;
DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+12;
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
(@CGUID+0 , 24545, 530, 1, 1, -1882.759, 5575.42, -12.3448, 4.677482, 120, 0, 0), -- Thunderbrew "Apprentice" (Area: Shattrath City)
(@CGUID+1 , 24484, 530, 1, 1, -1872.835, 5560.321, -12.3448, 2.748216, 120, 0, 0), -- Brewfest Reveler (Area: Shattrath City) (Auras: 43910 - Brewfest Reveler - Gnome)
(@CGUID+2 , 24484, 530, 1, 1, -1878.838, 5562.812, -12.3448, 5.889809, 120, 0, 0), -- Brewfest Reveler (Area: Shattrath City) (Auras: 43909 - Brewfest Reveler - Dwarf)
(@CGUID+3 , 24484, 530, 1, 1, -1878.618, 5556.088, -12.3448, 3.259485, 120, 0, 0), -- Brewfest Reveler (Area: Shattrath City) (Auras: 43910 - Brewfest Reveler - Gnome)
(@CGUID+4 , 24484, 530, 1, 1, -1897.398, 5558.127, -12.3448, 1.710423, 120, 0, 0), -- Brewfest Reveler (Area: Shattrath City) (Auras: 44004 - Brewfest Reveler - Goblin - Female)
(@CGUID+5 , 24484, 530, 1, 1, -1899.819, 5560.333, -12.3448, 0.3665192, 120, 0, 0), -- Brewfest Reveler (Area: Shattrath City) (Auras: 44003 - Brewfest Reveler - Goblin - Male)
(@CGUID+6 , 24484, 530, 1, 1, -1921.889, 5554.328, -12.34481, 0.04066804, 120, 0, 0), -- Brewfest Reveler (Area: Shattrath City) (Auras: 43916 - Brewfest Reveler - Troll)
(@CGUID+7 , 24484, 530, 1, 1, -1916.578, 5551.592, -12.34481, 2.666002, 120, 0, 0), -- Brewfest Reveler (Area: Shattrath City) (Auras: 43917 - Brewfest Reveler - Undead)
(@CGUID+8 , 24484, 530, 1, 1, -1924.595, 5549.645, -12.3448, 1.046868, 120, 0, 0), -- Brewfest Reveler (Area: Shattrath City) (Auras: 43914 - Brewfest Reveler - Orc)
(@CGUID+9 , 24484, 530, 1, 1, -1897.494, 5562.316, -12.3448, 4.433136, 120, 0, 0), -- Brewfest Reveler (Area: Shattrath City) (Auras: 44003 - Brewfest Reveler - Goblin - Male)
(@CGUID+10, 24501, 530, 1, 1, -1926.787, 5562.968, -12.3448, 5.061455, 120, 0, 0), -- Drohn's Distillery Apprentice (Area: Shattrath City)
(@CGUID+11, 24484, 530, 1, 1, -1895.234, 5560.195, -12.34481, 2.80998, 120, 0, 0), -- Brewfest Reveler (Area: Shattrath City) (Auras: 44003 - Brewfest Reveler - Goblin - Male)
(@CGUID+12, 23511, 530, 1, 1, -1906.297, 5569.852, -12.3448, 4.974188, 120, 0, 0); -- Gordok Brew Apprentice (Area: Shattrath City)
DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+12;
INSERT INTO `creature_addon` (`guid`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
(@CGUID+1 , 0, 0x0, 0x101, '43910'), -- Brewfest Reveler - 43910 - Brewfest Reveler - Gnome
(@CGUID+2 , 0, 0x0, 0x101, '43909'), -- Brewfest Reveler - 43909 - Brewfest Reveler - Dwarf
(@CGUID+3 , 0, 0x0, 0x101, '43910'), -- Brewfest Reveler - 43910 - Brewfest Reveler - Gnome
(@CGUID+4 , 0, 0x0, 0x101, '44004'), -- Brewfest Reveler - 44004 - Brewfest Reveler - Goblin - Female
(@CGUID+5 , 0, 0x0, 0x101, '44003'), -- Brewfest Reveler - 44003 - Brewfest Reveler - Goblin - Male
(@CGUID+6 , 0, 0x0, 0x101, '43916'), -- Brewfest Reveler - 43916 - Brewfest Reveler - Troll
(@CGUID+7 , 0, 0x0, 0x101, '43917'), -- Brewfest Reveler - 43917 - Brewfest Reveler - Undead
(@CGUID+8 , 0, 0x0, 0x101, '43914'), -- Brewfest Reveler - 43914 - Brewfest Reveler - Orc
(@CGUID+9 , 0, 0x0, 0x101, '44003'), -- Brewfest Reveler - 44003 - Brewfest Reveler - Goblin - Male
(@CGUID+11, 0, 0x0, 0x101, '44003'); -- Brewfest Reveler - 44003 - Brewfest Reveler - Goblin - Male
DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+8;
INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
(@OGUID+0, 186259, 530, 1, 1, -1875.389, 5579.114, -12.42814, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- Thunderbrew Festive Wagon (Area: Shattrath City)
(@OGUID+1, 180037, 530, 1, 1, -1909.218, 5569.716, -12.42814, 4.97419, 0, 0, 0, 1, 120, 255, 1), -- Haybail 01 (Area: Shattrath City)
(@OGUID+2, 180037, 530, 1, 1, -1906.963, 5573.009, -12.42814, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- Haybail 01 (Area: Shattrath City)
(@OGUID+3, 178666, 530, 1, 1, -1882.575, 5582.089, -12.42814, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- Gypsy Wagon (Area: Shattrath City)
(@OGUID+4, 178666, 530, 1, 1, -1928.171, 5567.508, -12.42814, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- Gypsy Wagon (Area: Shattrath City)
(@OGUID+5, 186255, 530, 1, 1, -1920.9, 5568.442, -12.42814, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- Drohn's Distillery Festive Wagon (Area: Shattrath City)
(@OGUID+6, 186257, 530, 1, 1, -1900.552, 5575.883, -12.42814, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- Gordok Festive Wagon (Area: Shattrath City)
(@OGUID+7, 180037, 530, 1, 1, -1893.456, 5576.866, -12.42814, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- Haybail 01 (Area: Shattrath City)
(@OGUID+8, 180037, 530, 1, 1, -1904.326, 5571.048, -12.42814, 1.902409, 0, 0, 0, 1, 120, 255, 1); -- Haybail 01 (Area: Shattrath City)
DELETE FROM `game_event_creature` WHERE `eventEntry`=24 AND `guid` BETWEEN @CGUID+0 AND @CGUID+12;
INSERT INTO `game_event_creature` (`eventEntry`, `guid`) VALUES
(24, @CGUID+0),
(24, @CGUID+1),
(24, @CGUID+2),
(24, @CGUID+3),
(24, @CGUID+4),
(24, @CGUID+5),
(24, @CGUID+6),
(24, @CGUID+7),
(24, @CGUID+8),
(24, @CGUID+9),
(24, @CGUID+10),
(24, @CGUID+11),
(24, @CGUID+12);
DELETE FROM `game_event_gameobject` WHERE `eventEntry`=24 AND `guid` BETWEEN @OGUID+0 AND @OGUID+8;
INSERT INTO `game_event_gameobject` (`eventEntry`, `guid`) VALUES
(24, @OGUID+0),
(24, @OGUID+1),
(24, @OGUID+2),
(24, @OGUID+3),
(24, @OGUID+4),
(24, @OGUID+5),
(24, @OGUID+6),
(24, @OGUID+7),
(24, @OGUID+8);

View File

@@ -0,0 +1,38 @@
--
UPDATE `npc_text` SET `BroadcastTextID0`=5793 WHERE `ID`=3464;
UPDATE `npc_text` SET `BroadcastTextID0`=10046 WHERE `ID`=7339;
UPDATE `npc_text` SET `BroadcastTextID0`=10048 WHERE `ID`=7340;
UPDATE `npc_text` SET `BroadcastTextID0`=10053 WHERE `ID`=7341;
UPDATE `npc_text` SET `BroadcastTextID0`=10062 WHERE `ID`=7355;
UPDATE `npc_text` SET `BroadcastTextID0`=10065 WHERE `ID`=7356;
UPDATE `npc_text` SET `BroadcastTextID0`=10082 WHERE `ID`=7362;
UPDATE `npc_text` SET `BroadcastTextID0`=10086 WHERE `ID`=7363;
UPDATE `npc_text` SET `BroadcastTextID0`=10092 WHERE `ID`=7365;
UPDATE `npc_text` SET `BroadcastTextID0`=10210 WHERE `ID`=7437;
UPDATE `npc_text` SET `BroadcastTextID0`=10366 WHERE `ID`=7484;
UPDATE `npc_text` SET `BroadcastTextID0`=10412 WHERE `ID`=7498;
UPDATE `npc_text` SET `BroadcastTextID0`=10417 WHERE `ID`=7500;
UPDATE `npc_text` SET `BroadcastTextID0`=10419 WHERE `ID`=7501;
UPDATE `npc_text` SET `BroadcastTextID0`=10390 WHERE `ID`=7502;
UPDATE `npc_text` SET `BroadcastTextID0`=10395 WHERE `ID`=7505;
UPDATE `npc_text` SET `BroadcastTextID0`=10404 WHERE `ID`=7508;
UPDATE `npc_text` SET `BroadcastTextID0`=10406 WHERE `ID`=7509;
UPDATE `npc_text` SET `BroadcastTextID0`=10466 WHERE `ID`=7596;
UPDATE `npc_text` SET `BroadcastTextID0`=10468 WHERE `ID`=7597;
UPDATE `npc_text` SET `BroadcastTextID0`=10470 WHERE `ID`=7598;
UPDATE `npc_text` SET `BroadcastTextID0`=10475 WHERE `ID`=7614;
UPDATE `npc_text` SET `BroadcastTextID0`=10493 WHERE `ID`=7641;
UPDATE `npc_text` SET `BroadcastTextID0`=10543 WHERE `ID`=7674;
UPDATE `npc_text` SET `BroadcastTextID0`=10547 WHERE `ID`=7676;
UPDATE `npc_text` SET `BroadcastTextID0`=10548 WHERE `ID`=7677;
UPDATE `npc_text` SET `BroadcastTextID0`=10557 WHERE `ID`=7683;
UPDATE `npc_text` SET `BroadcastTextID0`=17814 WHERE `ID`=20201;
UPDATE `npc_text` SET `BroadcastTextID0`=27613 WHERE `ID`=13100;
UPDATE `npc_text` SET `BroadcastTextID0`=9499 WHERE `ID`=6938;
UPDATE `npc_text` SET `BroadcastTextID0`=6016 WHERE `ID`=447;
UPDATE `npc_text` SET `BroadcastTextID0`=20391 WHERE `ID`=10412;
UPDATE `npc_text` SET `BroadcastTextID0`=19868 WHERE `ID`=10616;
UPDATE `npc_text` SET `BroadcastTextID0`=14430 WHERE `ID`=9080;
UPDATE `npc_text` SET `BroadcastTextID0`=10567 WHERE `ID`=7692;
UPDATE `npc_text` SET `BroadcastTextID0`=6001 WHERE `ID`=3579;
UPDATE `npc_text` SET `BroadcastTextID0`=5035 WHERE `ID`=2725;

View File

@@ -0,0 +1,6 @@
--
UPDATE `creature` SET `map`=571 WHERE `guid`=101828 AND `id`=25434;
UPDATE `creature` SET `position_y`=-6381.79 WHERE `guid`=82822 AND `id`=16303;
UPDATE `creature` SET `position_y`=-6395.32 WHERE `guid`=82826 AND `id`=16303;
UPDATE `creature` SET `position_y`=-6343.51 WHERE `guid`=82827 AND `id`=16303;
UPDATE `creature` SET `map`=1 WHERE `guid`=40251 AND `id`=29346;

View File

@@ -0,0 +1,30 @@
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN(25285,31033);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(25285,31033) AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid` =2528500 AND `source_type`=9;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(25285, 0, 0, 0, 10, 0, 100, 0, 1, 50, 120000, 300000, 80, 2528500, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Harbinger Vurenn - OOC LOS - Run Script'),
(31033, 0, 0, 0, 10, 0, 100, 0, 1, 20, 600000, 900000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Crusader of Virtue - OOC LOS - Say Line'),
(2528500, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Harbinger Vurenn - Script - Say Line 0'),
(2528500, 9, 1, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 25301, 0, 0, 0, 0, 0, 0, 'Harbinger Vurenn - Script - Say Line 0 (Counselor Talbot)'),
(2528500, 9, 2, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, 25250, 0, 0, 0, 0, 0, 0, 'Harbinger Vurenn - Script - Say Line 2 (General Arlos)'),
(2528500, 9, 3, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Harbinger Vurenn - Script - Say Line 1');
DELETE FROM `creature_text` WHERE `entry` IN(25301,25285,31033);
DELETE FROM `creature_text` WHERE `entry` =25250 AND `groupid`=2;
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`,`BroadcastTextID`) VALUES
(25250, 2, 0, 'Your offer will be carefully considered, harbinger. In the meantime we will make use of your delegation in an advisory role.', 12, 7, 100, 1, 0, 0, 'General Arlos',24790),
(25301, 0, 0, 'Our troops, general, consist mostly of villagers and peasants. Good men, but not quite rid of the prejudices and superstitions of their upbringing. They''re not ready to fight alongside our more exotic allies.', 12, 7, 100, 1, 0, 0, 'Counselor Talbot',24789),
(25285, 0, 0, 'Give the word, general. I will have two regiments at your disposal in a month''s time.', 12, 7, 100, 0, 0, 0, 'Harbinger Vurenn',24787),
(25285, 1, 0, 'Very well, general. Should you change your mind, my people will be more than willing to provide military assistance.', 12, 7, 100, 0, 0, 0, 'Harbinger Vurenn',24788),
(31033, 0, 0, 'There goes the hero of the Vanguard!', 12, 0, 100, 66, 0, 0, 'Crusader of Virtue',31385),
(31033, 0, 1, '%s cheers at you.', 16, 1, 100, 71, 0, 0, 'Crusader of Virtue',25275),
(31033, 0, 2, 'We couldn''t have done it without you, $g sir:ma''am;.', 12, 0, 100, 66, 0, 0, 'Crusader of Virtue',31384),
(31033, 0, 3, 'You honor us with your presence, $n.', 12, 0, 100, 66, 0, 0, 'Crusader of Virtue',31386),
(31033, 0, 4, 'Thank you, $n. From the bottom of my heart. Thank you.', 12, 0, 100, 66, 0, 0, 'Crusader of Virtue',31388),
(31033, 0, 5, 'Call on me anytime, $n.', 12, 0, 100, 66, 0, 0, 'Crusader of Virtue',31389);
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=31033;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(22, 1, 31033, 0, 0, 8, 0, 13157, 0, 0, 0, 0, 0, '', 'Crusader of Virtue - Only run SAI if player is rewarded for quest 13157');

View File

@@ -0,0 +1,14 @@
--
UPDATE `creature_text` SET `BroadcastTextId`=9633 WHERE `entry`=14467 AND `groupid`=0 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=7798 WHERE `entry`=701 AND `groupid`=0 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=8355 WHERE `entry`=12923 AND `groupid`=0 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=8355 WHERE `entry`=12924 AND `groupid`=0 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=8355 WHERE `entry`=12925 AND `groupid`=0 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=10601 WHERE `entry`=11380 AND `groupid`=0 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=23175 WHERE `entry`=23863 AND `groupid`=2 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=23176 WHERE `entry`=23863 AND `groupid`=3 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=23178 WHERE `entry`=23863 AND `groupid`=5 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=23179 WHERE `entry`=23863 AND `groupid`=6 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=23181 WHERE `entry`=23863 AND `groupid`=8 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=23182 WHERE `entry`=23863 AND `groupid`=8 AND `id`=1;
UPDATE `creature_text` SET `BroadcastTextId`=23183 WHERE `entry`=23863 AND `groupid`=9 AND `id`=0;

View File

@@ -0,0 +1,38 @@
-- BroadcastTextID0
UPDATE `npc_text` SET `BroadcastTextID0`=3962 WHERE `ID`=1620;
UPDATE `npc_text` SET `BroadcastTextID0`=3963 WHERE `ID`=1621;
UPDATE `npc_text` SET `BroadcastTextID0`=8806 WHERE `ID`=6789;
UPDATE `npc_text` SET `BroadcastTextID0`=9168 WHERE `ID`=6789;
UPDATE `npc_text` SET `BroadcastTextID0`=9626 WHERE `ID`=7002;
UPDATE `npc_text` SET `BroadcastTextID0`=9628 WHERE `ID`=7003;
UPDATE `npc_text` SET `BroadcastTextID0`=9630 WHERE `ID`=7004;
UPDATE `npc_text` SET `BroadcastTextID0`=9632 WHERE `ID`=7005;
UPDATE `npc_text` SET `BroadcastTextID0`=11275 WHERE `ID`=8060;
UPDATE `npc_text` SET `BroadcastTextID0`=11892 WHERE `ID`=8326;
UPDATE `npc_text` SET `BroadcastTextID0`=11894 WHERE `ID`=8327;
UPDATE `npc_text` SET `BroadcastTextID0`=12100 WHERE `ID`=8426;
UPDATE `npc_text` SET `BroadcastTextID0`=12280 WHERE `ID`=8516;
UPDATE `npc_text` SET `BroadcastTextID0`=14071 WHERE `ID`=8975;
UPDATE `npc_text` SET `BroadcastTextID0`=14386 WHERE `ID`=9064;
UPDATE `npc_text` SET `BroadcastTextID0`=17555 WHERE `ID`=9949;
UPDATE `npc_text` SET `BroadcastTextID0`=19019 WHERE `ID`=10339;
UPDATE `npc_text` SET `BroadcastTextID0`=19431 WHERE `ID`=10454;
UPDATE `npc_text` SET `BroadcastTextID0`=20459 WHERE `ID`=10733;
UPDATE `npc_text` SET `BroadcastTextID0`=20643 WHERE `ID`=10798;
UPDATE `npc_text` SET `BroadcastTextID0`=20883 WHERE `ID`=10830;
UPDATE `npc_text` SET `BroadcastTextID0`=21404 WHERE `ID`=10926;
UPDATE `npc_text` SET `BroadcastTextID0`=21535 WHERE `ID`=10967;
UPDATE `npc_text` SET `BroadcastTextID0`=21542 WHERE `ID`=10976;
UPDATE `npc_text` SET `BroadcastTextID0`=21610 WHERE `ID`=11026;
UPDATE `npc_text` SET `BroadcastTextID0`=21618 WHERE `ID`=11029;
UPDATE `npc_text` SET `BroadcastTextID0`=21814 WHERE `ID`=11059;
-- npc_text
UPDATE `npc_text` SET `BroadcastTextID0`=10796 WHERE `ID`=7804;
UPDATE `npc_text` SET `BroadcastTextID0`=2545 WHERE `ID`=6491;
UPDATE `npc_text` SET `BroadcastTextID0`=6877 WHERE `ID`=4194;
-- creature_text
UPDATE `creature_text` SET `BroadcastTextId`=6198 WHERE `entry`=3977 AND `groupid`=1 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=35523 WHERE `entry`=35320 AND `groupid`=0 AND `id`=0;
UPDATE `creature_text` SET `BroadcastTextId`=35529 WHERE `entry`=35320 AND `groupid`=1 AND `id`=0;

View File

@@ -0,0 +1,3 @@
--
UPDATE `creature_template` SET `faction`=834 WHERE `entry`=14435;
UPDATE `creature_template` SET `faction`=90 WHERE `entry`=6268;

View File

@@ -0,0 +1,2 @@
--
UPDATE `creature_template` SET `AIName`='' WHERE `entry`=21611;

View File

@@ -0,0 +1,66 @@
DELETE FROM `waypoint_data` WHERE `id`=1131170;
UPDATE `creature_addon` SET `path_id`=0 WHERE `guid`=113117;
UPDATE `creature` SET `MovementType`=0 WHERE `guid`=113117;
DELETE FROM `waypoints` WHERE `entry`=23734;
INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
(23734, 1, 629.388, -5021.37, 3.04091, 'Anchorite Yazmina <First Aid Trainer>'),
(23734, 2, 630.836, -5011.95, 3.8314, 'Anchorite Yazmina <First Aid Trainer>'),
(23734, 3, 630.836, -5011.95, 3.8314, 'Anchorite Yazmina <First Aid Trainer>'),
(23734, 4, 624.458, -5003.92, 3.59241, 'Anchorite Yazmina <First Aid Trainer>'),
(23734, 5, 614.28, -5005.49, 3.06355, 'Anchorite Yazmina <First Aid Trainer>'),
(23734, 6, 607.946, -5014.89, 3.10032, 'Anchorite Yazmina <First Aid Trainer>'),
(23734, 7, 612.983, -5025.49, 2.03711, 'Anchorite Yazmina <First Aid Trainer>'),
(23734, 8, 625.177, -5026.14, 2.32847, 'Anchorite Yazmina <First Aid Trainer>');
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN(23734,23728);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(23734,23728) AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(2373400,2373401,2373402,2373403,237404,2372800) AND `source_type`=9;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(23734, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 53, 0, 23734, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - On Spawn - Start WP'),
(23734, 0, 1, 0, 40, 0, 5, 0, 0, 0, 0, 0, 87, 2373400,2373401,2373402,2373403,0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - On Reached WP - Run Random Script'),
(23728, 0, 0, 0, 10, 0, 100, 0, 1, 50, 120000, 300000, 80, 2372800, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Guard Captain Zorek - OOC LOS - Run Script'),
(2372800, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Guard Captain Zorek - Script - Say Line 0'),
(2372800, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Guard Captain Zorek - Script - Say Line 1'),
(2372800, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Guard Captain Zorek - Script - Say Line 2'),
(2372800, 9, 3, 0, 0, 0, 100, 0, 11000, 11000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Guard Captain Zorek - Script - Say Line 3'),
(2373400, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 54, 10000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 1 - Pause WP'),
(2373401, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 54, 15000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 2 - Pause WP'),
(2373401, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 23783, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 2 - Face Injured Defender'),
(2373401, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 2 - Say Line 1'),
(2373401, 9, 3, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 90, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 2 - Set Bytes 1'),
(2373401, 9, 4, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 17, 69, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 2 - Set Emote State 69'),
(2373401, 9, 5, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 2 - Set Emote State 0'),
(2373401, 9, 6, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 2 - Say Line 2'),
(2373401, 9, 7, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 91, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 2 - Remove Bytes 1'),
(2373402, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 54, 15000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 3 - Pause WP'),
(2373402, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 23783, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 3 - Face Injured Defender'),
(2373402, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 3 - Say Line 3'),
(2373402, 9, 3, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 90, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 3 - Set Bytes 1'),
(2373402, 9, 4, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 17, 69, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 3 - Set Emote State 69'),
(2373402, 9, 5, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 3 - Set Emote State 0'),
(2373402, 9, 6, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 3 - Say Line 0'),
(2373402, 9, 7, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 91, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 3 - Remove Bytes 1'),
(2373403, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 54, 15000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 4 - Pause WP'),
(2373403, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 23783, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 4 - Face Injured Defender'),
(2373403, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 4 - Say Line 4'),
(2373403, 9, 3, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 90, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 4 - Set Bytes 1'),
(2373403, 9, 4, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 17, 69, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 4 - Set Emote State 69'),
(2373403, 9, 5, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 4 - Set Emote State 0'),
(2373403, 9, 6, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 4 - Say Line 5'),
(2373403, 9, 7, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 91, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Yazmina <First Aid Trainer> - Script 4 - Remove Bytes 1');
DELETE FROM `creature_text` WHERE `entry` IN(23734,23728);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`,`BroadcastTextID`) VALUES
(23734, 0, 0, 'That should slow the infection down a little.', 12, 7, 100, 1, 0, 0, 'Anchorite Yazmina',22251),
(23734, 1, 0, 'I can only hope the treatment will work.', 12, 7, 100, 1, 0, 0, 'Anchorite Yazmina',22828),
(23734, 2, 0, 'I just don''t have the medical supplies I need to properly treat all of you.', 12, 7, 100, 1, 0, 5495, 'Anchorite Yazmina',22829),
(23734, 3, 0, 'Oh my, let me change those bandages!', 12, 7, 100, 5, 0, 0, 'Anchorite Yazmina',22250),
(23734, 4, 0, 'Don''t worry, soldier. Yazmina is going to take care of you.', 12, 7, 100, 1, 0, 0, 'Anchorite Yazmina',22830),
(23734, 5, 0, '%s shakes her head.', 16, 7, 100, 274, 0, 0, 'Anchorite Yazmina',22831),
(23728, 0, 0, '%s clears his throat.', 16, 7, 100, 0, 0, 0, 'Guard Captain Zorek',22737),
(23728, 1, 0, 'I look across this base and all I see is fear... Are you gonna be scared when the Lich King''s armies are sittin'' pretty in Stormwind? Ironforge? NO! You''re not. And do you know why? Because you''ll be dead, that''s why.', 12, 7, 100, 1, 0, 0, 'Guard Captain Zorek',22738),
(23728, 2, 0, 'So when you''re feeling that tinglin'' sensation at the base of your spine and you''re ''bout ready to wet your pants, embrace it. Let it enrage you. That fear is the only thing that''s gonna keep you breathin''.', 12, 7, 100, 25, 0, 0, 'Guard Captain Zorek',22739),
(23728, 3, 0, 'Am I clear? Do you understand what I''m sayin''? I don''t wanna have to send any more coffins or letters home.', 12, 7, 100, 6, 0, 0, 'Guard Captain Zorek',22740);

View File

@@ -0,0 +1,2 @@
--
UPDATE `smart_scripts` SET `entryorguid`='21661' WHERE `entryorguid`=21611;

View File

@@ -0,0 +1,30 @@
DELETE FROM `gameobject_template` WHERE `entry` IN (184718,184722);
INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `data0`, `data1`, `data2`, `data3`, `size`, `VerifiedBuild`) VALUES
(184718, 6, 327, 'Cauldron Summoner', 0, 0, 0, 36549, 1, -18019),
(184722, 6, 327, 'Cauldron Bug Summoner', 0, 0, 0, 36552, 1, -18019);
DELETE FROM `gameobject` WHERE `guid` IN(25566,25567) AND `id` IN(184721,184717,184722,184718);
INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES
(25566, 184718, 530, 1, 1, -970.813, 2172, 15.5428, -2.33874, 0, 0, 0.920505, -0.390731, 0, 100, 1, 0),
(25567, 184722, 530, 1, 1, -970.813, 2172, 15.5428, -2.33874, 0, 0, 0.920505, -0.390731, 0, 100, 1, 0);
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=36546;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 36546, 0, 0, 31, 0, 5, 184715, 0, 0, 0, 0, '', 'Boil Bleeding Hollow Blood - Cursed Cauldron'),
(13, 2, 36546, 0, 0, 31, 0, 5, 184722, 0, 0, 0, 0, '', 'Boil Bleeding Hollow Blood - Cauldron Bug Summoner');
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN(21308,21306);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(21308,21306) AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(21308, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 11, 36555, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cursed Scarab Summoner - On Spawn - Cast Summon Cursed Scarabs'),
(21306, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 89, 20, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cursed Scarab - On Spawn - Set Random Movement'),
(21306, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cursed Scarab - On Spawn - Set Run On'),
(21306, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 11, 36556, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cursed Scarab - On Spawn - Cast Cursed Scarab Periodic'),
(21306, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 11, 36559, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cursed Scarab - On Spawn - Cast Cursed Scarab Despawn Timer'),
(21306, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 31309, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cursed Scarab - On Spawn - Cast Spirit Particles (red, big)'),
(21306, 0, 5, 0, 8, 0, 100, 0, 36560, 0, 0, 0, 41, 40000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cursed Scarab - On Spellhit (Cursed Scarab Despawn Periodic Trigger) - Despawn'),
(21306, 0, 6, 7, 1, 0, 100, 1, 5000, 90000, 0, 0, 2, 14, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cursed Scarab - OOC - Set faction'),
(21306, 0, 7, 8, 61, 0, 100, 1, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cursed Scarab - OOC - Set Hostile'),
(21306, 0, 8, 0, 61, 0, 100, 1, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Cursed Scarab - OOC - Attack Sumoner');

View File

@@ -0,0 +1,21 @@
-- npc_text
UPDATE `npc_text` SET `BroadcastTextID0`=5195 WHERE `ID`=2838;
UPDATE `npc_text` SET `BroadcastTextID0`=11738 WHERE `ID`=8296;
UPDATE `npc_text` SET `BroadcastTextID0`=11790 WHERE `ID`=8282;
UPDATE `npc_text` SET `BroadcastTextID0`=11797 WHERE `ID`=8298;
UPDATE `npc_text` SET `BroadcastTextID0`=20625 WHERE `ID`=10787;
UPDATE `npc_text` SET `BroadcastTextID0`=37804 WHERE `ID`=15240;
UPDATE `npc_text` SET `BroadcastTextID0`=11736 WHERE `ID`=8244;
UPDATE `npc_text` SET `BroadcastTextID0`=11799 WHERE `ID`=8291;
UPDATE `npc_text` SET `BroadcastTextID0`=12770 WHERE `ID`=8663;
UPDATE `npc_text` SET `BroadcastTextID0`=14410 WHERE `ID`=9072;
UPDATE `npc_text` SET `BroadcastTextID0`=14546 WHERE `ID`=9110;
UPDATE `npc_text` SET `BroadcastTextID0`=17748 WHERE `ID`=9984;
UPDATE `npc_text` SET `BroadcastTextID0`=21971 WHERE `ID`=11093;
UPDATE `npc_text` SET `BroadcastTextID0`=27167 WHERE `ID`=12978;
UPDATE `npc_text` SET `BroadcastTextID0`=32577 WHERE `ID`=14089;
UPDATE `npc_text` SET `BroadcastTextID0`=37148 WHERE `ID`=15155;
UPDATE `npc_text` SET `BroadcastTextID0`=38655 WHERE `ID`=15412;
UPDATE `npc_text` SET `BroadcastTextID0`=40449 WHERE `ID`=15866;
UPDATE `npc_text` SET `BroadcastTextID0`=40471 WHERE `ID`=15873;
UPDATE `npc_text` SET `BroadcastTextID0`=40482 WHERE `ID`=15877;

View File

@@ -0,0 +1,61 @@
-- Fix Quest 11501 "News From the East"
SET @WALT := 24807;
SET @CONSTRUCT := 24852;
UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=@WALT;
UPDATE `creature_template` SET `speed_run`=4.285714, `VehicleId`=87, `InhabitType`=4 WHERE `entry`=@CONSTRUCT;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@WALT,@CONSTRUCT);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@WALT,@CONSTRUCT) AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@CONSTRUCT*100 AND `source_type`=9;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@WALT,0,0,1,62,0,100,0,9022,0,0,0,11,49975,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Walt <Explorers'' League> - On gossip option select - Spellcast Iron Rune Construct Taxi'),
(@WALT,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Walt <Explorers'' League> - On gossip option select - Close gossip'),
(@CONSTRUCT,0,0,0,54,0,100,0,0,0,0,0,80,@CONSTRUCT*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Iron Rune Construct - Just summoned - Run script'),
(@CONSTRUCT,0,1,2,40,0,100,1,18,@CONSTRUCT,0,0,1,1,2000,0,0,0,0,1,0,0,0,0,0,0,0, 'Iron Rune Construct - On WP 18 reached - Say line'),
(@CONSTRUCT,0,2,0,61,0,100,0,0,0,0,0,28,44687,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Iron Rune Construct - On WP 18 reached - Remove aura Rocket Jump'),
(@CONSTRUCT,0,3,0,52,0,100,0,1,@CONSTRUCT,0,0,11,44688,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Iron Rune Construct - On text over - Spellcast System Failure'),
(@CONSTRUCT*100,9,0,0,0,0,100,0,4000,4000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Iron Rune Construct script - Say line'),
(@CONSTRUCT*100,9,1,0,0,0,100,0,0,0,0,0,11,44687,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Iron Rune Construct script - Spellcast Rocket Jump'),
(@CONSTRUCT*100,9,2,0,0,0,100,0,2000,2000,0,0,53,1,@CONSTRUCT,0,0,0,0,1,0,0,0,0,0,0,0, 'Iron Rune Construct script - Start WP movement');
DELETE FROM `gossip_menu_option` WHERE `menu_id`=9022 AND `id`=0;
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES
(9022,0,0,'I''m ready to go, Walt.',23929,1,1,0,0,0,0,'');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9022;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,9022,0,0,28,11501,0,0,0,'','Walt <Explorers'' League> - Show gossip option only if player has completed but not rewarded quest News From the East');
DELETE FROM `creature_text` WHERE `entry`=@CONSTRUCT;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextID`) VALUES
(@CONSTRUCT,0,0,'Launching.',12,0,100,0,0,0,'Iron Rune Construct',23860),
(@CONSTRUCT,1,0,'System failure in 3... 2...',12,0,100,0,0,0,'Iron Rune Construct',23930);
DELETE FROM `waypoints` WHERE `entry`=@CONSTRUCT;
INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
(@CONSTRUCT,1,479.0616,-5941.539,316.96,'Iron Rune Construct'),
(@CONSTRUCT,2,479.2529,-5941.489,365.9878,'Iron Rune Construct'),
(@CONSTRUCT,3,517.0134,-5825.359,365.9878,'Iron Rune Construct'),
(@CONSTRUCT,4,527.9034,-5659.926,365.9878,'Iron Rune Construct'),
(@CONSTRUCT,5,715.0627,-5351.074,365.9878,'Iron Rune Construct'),
(@CONSTRUCT,6,768.4551,-5018.862,365.9878,'Iron Rune Construct'),
(@CONSTRUCT,7,840.6277,-4827.729,365.9878,'Iron Rune Construct'),
(@CONSTRUCT,8,864.8306,-4741.804,365.9878,'Iron Rune Construct'),
(@CONSTRUCT,9,966.0306,-4488.406,365.9878,'Iron Rune Construct'),
(@CONSTRUCT,10,1030.845,-4374.208,346.4599,'Iron Rune Construct'),
(@CONSTRUCT,11,1063.375,-4205.252,346.4599,'Iron Rune Construct'),
(@CONSTRUCT,12,1066.279,-4072.605,289.821,'Iron Rune Construct'),
(@CONSTRUCT,13,1066.46,-3833.815,282.9599,'Iron Rune Construct'),
(@CONSTRUCT,14,1236.65,-3685.513,282.9599,'Iron Rune Construct'),
(@CONSTRUCT,15,1357.56,-3430.121,217.8767,'Iron Rune Construct'),
(@CONSTRUCT,16,1382.808,-3290.728,217.8767,'Iron Rune Construct'),
(@CONSTRUCT,17,1388.928,-3261.844,203.7378,'Iron Rune Construct'),
(@CONSTRUCT,18,1390.475,-3262.215,161.9602,'Iron Rune Construct');
DELETE FROM `spell_scripts` WHERE `id`=44688 AND `command`=14;
INSERT INTO `spell_scripts` (`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
(44688,0,0,14,46598,0,0,0,0,0,0),
(44688,0,0,15,44741,1,0,0,0,0,0);

View File

@@ -0,0 +1,44 @@
--
SET @Hira :=31238;
UPDATE creature_template SET ScriptName='', `AIName`='SmartAI', InhabitType=4 WHERE entry=@Hira;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=10723;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`, `ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,10723,1,0,27,80,3,0,0,'','Show gossip menu if player''s level 80 or higher'),
(15,10723,1,0,25,54197,0,0,0,'','Show gossip menu if player has lerned 54197');
DELETE FROM `smart_scripts` WHERE `entryorguid` = @Hira AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @Hira*100 AND `source_type` = 9;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @Hira*100+1 AND `source_type` = 9;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(@Hira, 0, 0, 0, 1, 0, 100, 0, 600000, 600000, 600000, 600000, 80, @Hira*100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hira - OOC - actionlist'),
(@Hira*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hira - actionlist - talk (emote)'),
(@Hira*100, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hira - actionlist - talk'),
(@Hira*100, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 18, 33554432, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hira - actionlist - set UNIT_FLAG_NOT_SELECTABLE'),
(@Hira*100, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 53, 1, @Hira, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hira - actionlist - start wp'),
(@Hira,0 ,1 ,0 ,40 ,0 ,100 ,0, 11, 0, 0, 0 ,80, @Hira*100+1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ruul the Darkener - way point reached - Re action list'),
(@Hira*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 5815.272, 473.4902, 658.7961, 4.660029, 'Hira - actionlist - SET Orientation'),
(@Hira*100+1, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 19, 33554432, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hira - actionlist - remove UNIT_FLAG_NOT_SELECTABLE');
DELETE FROM `waypoints` WHERE `entry`=@Hira;
INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
(@Hira,1,5806.834, 475.4562, 661.3664, 'Hira Snowdawn WP'),
(@Hira,2,5792.614, 466.3004, 662.0329, 'Hira Snowdawn WP'),
(@Hira,3,5786.764, 450.582, 662.5331, 'Hira Snowdawn WP'),
(@Hira,4,5791.111, 434.2068, 665.3663, 'Hira Snowdawn WP'),
(@Hira,5,5804.108, 423.6482, 665.6719, 'Hira Snowdawn WP'),
(@Hira,6,5821.129, 422.7363, 665.1718, 'Hira Snowdawn WP'),
(@Hira,7,5835.191, 431.9838, 663.9774, 'Hira Snowdawn WP'),
(@Hira,8,5841.177, 447.7776, 662.783, 'Hira Snowdawn WP'),
(@Hira,9,5836.82, 464.0104, 661.894, 'Hira Snowdawn WP'),
(@Hira,10,5823.853, 474.5901, 661.3664, 'Hira Snowdawn WP'),
(@Hira,11,5815.272, 473.4902, 658.7961, 'Hira Snowdawn WP');
DELETE FROM `creature_text` WHERE `entry` IN (@Hira);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
(@Hira, 0, 0, 'Come, Cloudwing. Let''s do a lap.', 12, 0, 100, 0, 0, 0, 'Hira Snowdawn', 32247),
(@Hira, 0, 1, 'Feeling as restless as I am, Cloudwing? Then let us fly!', 12, 0, 100, 0, 0, 0, 'Hira Snowdawn', 32252),
(@Hira, 0, 2, 'I''m bored, Cloudwing. Go, go!', 12, 0, 100, 0, 0, 0, 'Hira Snowdawn', 32251),
(@Hira, 1, 0, '%s sighs softly and rolls her shoulders.', 16, 0, 100, 0, 0, 0, 'Hira Snowdawn', 32249),
(@Hira, 1, 1, '%s looks around Krasus'' Landing, bored.', 16, 0, 100, 0, 0, 0, 'Hira Snowdawn', 32244),
(@Hira, 1, 2, '%s yawns quietly into the palm of her hand.', 16, 0, 100, 0, 0, 0, 'Hira Snowdawn', 32245);

View File

@@ -0,0 +1,10 @@
--
UPDATE `creature_text` SET `BroadcastTextId`=0 WHERE `entry`=3977 AND `groupid`=1;
UPDATE `creature_text` SET `BroadcastTextId`=0 WHERE `entry`=11380 AND `groupid`=0;
UPDATE `creature_text` SET `BroadcastTextId`=0 WHERE `entry`=23863 AND `groupid`=2;
UPDATE `creature_text` SET `BroadcastTextId`=0 WHERE `entry`=23863 AND `groupid`=3;
UPDATE `creature_text` SET `BroadcastTextId`=0 WHERE `entry`=23863 AND `groupid`=4;
UPDATE `creature_text` SET `BroadcastTextId`=0 WHERE `entry`=23863 AND `groupid`=5;
UPDATE `creature_text` SET `BroadcastTextId`=0 WHERE `entry`=23863 AND `groupid`=6;
UPDATE `creature_text` SET `BroadcastTextId`=0 WHERE `entry`=23863 AND `groupid`=8;
UPDATE `creature_text` SET `BroadcastTextId`=0 WHERE `entry`=23863 AND `groupid`=9;

View File

@@ -0,0 +1,8 @@
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=48046;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(17, 0, 48046, 0, 0, 31, 1, 3, 26408, 0, 0, 0, 0, '', "Use Camera targets Iron Rune-Smith"),
(17, 0, 48046, 0, 0, 36, 1, 0, 0, 0, 1, 0, 0, '', "Target must be dead"),
(17, 0, 48046, 0, 1, 31, 1, 3, 26414, 0, 0, 0, 0, '', "Use Camera targets Runic Lightning Gunner"),
(17, 0, 48046, 0, 1, 36, 1, 0, 0, 0, 1, 0, 0, '', "Target must be dead"),
(17, 0, 48046, 0, 2, 31, 1, 3, 27177, 0, 0, 0, 0, '', "Use Camera targets Iron Rune Overseer"),
(17, 0, 48046, 0, 2, 36, 1, 0, 0, 0, 1, 0, 0, '', "Target must be dead");

View File

@@ -0,0 +1,5 @@
--
DELETE FROM `spell_target_position` WHERE `id` IN (28444,72613);
INSERT INTO `spell_target_position` (`id`, `effIndex`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`, `VerifiedBuild`) VALUES
(72613, 0, 533, 3005.509277, -3434.641113, 304.195, 5.81041, 0),
(28444, 0, 533, 3005.509277, -3434.641113, 304.195, 5.81041, 0);

View File

@@ -0,0 +1,7 @@
--
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=47435;
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
(47435, -47447, 0, 'remove debuff');
DELETE FROM `conditions` WHERE `sourcetypeorreferenceid`=17 AND `sourceentry`=47435;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(17,0,47435,0,0,1,0,47447,1,0,0,0,0,'','Cast ''Scrape Corrosive Spit'' only if player has ''Corrosive Spit''');

View File

@@ -0,0 +1,215 @@
SET @Guid := 74522;
SET @Entry := 19610;
DELETE FROM `creature_text` WHERE `entry` in(19610,19217);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`,`BroadcastTextID`) VALUES
(19610, 0, 0, 'A skunk! Eeeeeeeeeeeeeeeeeew! Don''t touch me!', 12, 0, 100, 0, 0, 0, 'Irradiated Worker',17857),
(19610, 1, 0, 'Get it away from me!', 12, 0, 100, 0, 0, 0, 'Irradiated Worker',17858),
(19610, 2, 0, 'Show us a trick, Ravandwyr!', 12, 0, 100, 0, 0, 0, 'Irradiated Worker',17852),
(19610, 3, 0, 'Let me outta here! Guys... guys?', 12, 0, 100, 0, 0, 0, 'Irradiated Worker',17874),
(19610, 4, 0, 'Oh man, he got you good!', 12, 0, 100, 0, 0, 0, 'Irradiated Worker',17875),
(19610, 5, 0, 'Remember how you''re always telling us to chill?', 12, 0, 100, 11, 0, 0, 'Irradiated Worker',17876),
(19610, 6, 0, 'That was the best trick ever! Ok, boys, let''s go get a drink.', 12, 0, 100, 4, 0, 0, 'Irradiated Worker',17853),
(19610, 7, 0, 'My eyebrows! You singed my eyebrows!', 12, 0, 100, 22, 0, 0, 'Irradiated Worker',20285),
(19610, 8, 0, 'Don''t worry. It''s an improvement!', 12, 0, 100, 11, 0, 0, 'Irradiated Worker',20286),
(19217, 0, 0, 'Oh, another show already? Very well then...', 12, 0, 100, 1, 0, 0, 'Ravandwyr',17848),
(19217, 1, 0, '%s sighs audibly and glances at Sagan.', 16, 0, 100, 0, 0, 0, 'Ravandwyr',17849),
(19217, 2, 0, 'I shall transform my familiar, Sagan, into something truly wondrous!', 12, 0, 100, 25, 0, 0, 'Ravandwyr',17855),
(19217, 3, 0, 'And, for my next trick...', 12, 0, 100, 1, 0, 0, 'Ravandwyr',17850),
(19217, 4, 0, 'A simple practical joke.', 12, 0, 100, 25, 0, 0, 'Ravandwyr',17877),
(19217, 5, 0, 'Thank you for watching, everyone! If you''d be so kind as to bring your non-irradiated currency to tomorrow''s performance, I''d appreciate it.', 12, 0, 100, 2, 0, 0, 'Ravandwyr',17856),
(19217, 6, 0, 'I shall breathe fire!', 12, 0, 100, 25, 0, 0, 'Ravandwyr',17854);
UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(19610,19217,19482);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(19610,19217,-@Guid-0,-@Guid-1,-@Guid-2,19482) AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(1921700,1921701,1921702) AND `source_type`=9;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(1921700, 9, 0, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Say Line 0'),
(1921700, 9, 1, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Say Line 1'),
(1921700, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Say Line 3'),
(1921700, 9, 3, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Say Line 4'),
(1921700, 9, 4, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 11, 34326, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Cast Frost Nova'),
(1921700, 9, 5, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 45, 3, 3, 0, 0, 0, 0, 10, @Guid+1, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Set Data Irradiated Worker'),
(1921700, 9, 6, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 10, @Guid+1, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Say Line 3 on Irradiated Worker'),
(1921700, 9, 7, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 5, 11, 0, 0, 0, 0, 0, 9, 19610, 0, 20, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Play Emote OneShotLaugh'),
(1921700, 9, 8, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 10, @Guid+2, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Say Line 4 on Irradiated Worker'),
(1921700, 9, 9, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 5, 11, 0, 0, 0, 0, 0, 9, 19610, 0, 20, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Play Emote OneShotLaugh'),
(1921700, 9, 10, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 10, @Guid+0, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Say Line 5 on Irradiated Worker'),
(1921700, 9, 11, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Say Line 5'),
(1921700, 9, 12, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 4, 0, 0, 0, 0, 0, 9, 19610, 0, 20, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Play Emote OneShotCheer'),
(1921700, 9, 13, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 10, @Guid+2, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Say Line 6'),
(1921700, 9, 14, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 9, 19610, 0, 100, 0, 0, 0, 0, 'Ravandwyr - Script 1 - Set Data on Irradiated Worker'),
(1921701, 9, 0, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Say Line 0'),
(1921701, 9, 1, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Say Line 1'),
(1921701, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Say Line 3'),
(1921701, 9, 3, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Say Line 2'),
(1921701, 9, 4, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 11, 34656, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Cast Arcane Explosion (Cosmetic)'),
(1921701, 9, 5, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 19482, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Set Data Sagan'),
(1921701, 9, 6, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10, @Guid+2, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Say Line 0 on Irradiated Worker'),
(1921701, 9, 7, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 10, @Guid+1, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Say Line 1 on Irradiated Worker'),
(1921701, 9, 8, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, 19482, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Set Data Sagan'),
(1921701, 9, 9, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Say Line 5'),
(1921701, 9, 10, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 4, 0, 0, 0, 0, 0, 9, 19610, 0, 20, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Play Emote OneShotCheer'),
(1921701, 9, 11, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 10, @Guid+2, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Say Line 6'),
(1921701, 9, 12, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 9, 19610, 0, 100, 0, 0, 0, 0, 'Ravandwyr - Script 2 - Set Data on Irradiated Worker'),
(1921702, 9, 0, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 3 - Say Line 0'),
(1921702, 9, 1, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 3 - Say Line 1'),
(1921702, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 3 - Say Line 3'),
(1921702, 9, 3, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 3 - Say Line 6'),
(1921702, 9, 4, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 11, 29389, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 3 - Cast Firebreathing'),
(1921702, 9, 5, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 7, 0, 0, 0, 0, 0, 10, @Guid+1, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - Script 3 - Say Line 7 on Irradiated Worker'),
(1921702, 9, 6, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 8, 0, 0, 0, 0, 0, 10, @Guid+2, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - Script 3 - Say Line 8 on Irradiated Worker'),
(1921702, 9, 7, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - Script 3 - Say Line 5'),
(1921702, 9, 8, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 4, 0, 0, 0, 0, 0, 9, 19610, 0, 20, 0, 0, 0, 0, 'Ravandwyr - Script 3 - Play Emote OneShotCheer'),
(1921702, 9, 9, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 10, @Guid+2, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - Script 3 - Say Line 6'),
(1921702, 9, 10, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 9, 19610, 0, 100, 0, 0, 0, 0, 'Ravandwyr - Script 3 - Set Data on Irradiated Worker'),
(19217, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 87, 1921700, 1921701, 1921702, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - On Data Set - Run Script'),
(19217, 0, 1, 2, 1, 0, 100, 0, 420000, 600000, 420000, 600000, 45, 1, 1, 0, 0, 0, 0, 10, @Guid+0, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - OOC - Set Data'),
(19217, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @Guid+1, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - OOC - Set Data'),
(19217, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @Guid+2, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - OOC - Set Data'),
(19217, 0, 4, 5, 38, 0, 100, 0, 2, 2, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @Guid+0, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - On Data Set - Set Data'),
(19217, 0, 5, 6, 61, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @Guid+1, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - On Data Set - Set Data'),
(19217, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @Guid+2, 19610, 0, 0, 0, 0, 0, 'Ravandwyr - On Data Set - Set Data'),
(19217, 0, 7, 8, 62, 0, 100, 0, 7981, 0, 0, 0, 85, 35378, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - On Gossip Option 0 Selected - Invoker Cast Summon Archmages Staff'),
(19217, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ravandwyr - On Gossip Option 0 Selected - Close Gossip'),
(19482, 0, 0, 1, 38, 0, 100, 0, 1, 1, 0, 0, 11, 34718, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sagan <Ravandwyrs Familiar> - On Data Set - Cast Transform Sagan (Skunk)'),
(19482, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 19482, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sagan <Ravandwyrs Familiar> - On Data Set - Start WP'),
(19482, 0, 2, 0, 38, 0, 100, 0, 2, 2, 0, 0, 28, 34718, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sagan <Ravandwyrs Familiar> - On Data Set - Remove Aura Transform Sagan (Skunk)'),
(-@Guid-0, 0, 0, 7, 38, 0, 100, 1, 1, 1, 0, 0, 53, 0, (@Entry*100)+0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Data Set Start WP'),
(-@Guid-1, 0, 0, 7, 38, 0, 100, 1, 1, 1, 0, 0, 53, 0, (@Entry*100)+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Data Set Start WP'),
(-@Guid-2, 0, 0, 7, 38, 0, 100, 1, 1, 1, 0, 0, 53, 0, (@Entry*100)+2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Data Set Start WP'),
(-@Guid-0, 0, 1, 0, 38, 0, 100, 1, 2, 2, 0, 0, 53, 0, (@Entry*100)+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Data Set Start WP'),
(-@Guid-1, 0, 1, 0, 38, 0, 100, 1, 2, 2, 0, 0, 53, 0, (@Entry*100)+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Data Set Start WP'),
(-@Guid-2, 0, 1, 0, 38, 0, 100, 1, 2, 2, 0, 0, 53, 0, (@Entry*100)+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Data Set Start WP'),
(-@Guid-0, 0, 2, 3, 40, 0, 100, 1, 15, (@Entry*100)+0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Reached WP15 - Say Line'),
(-@Guid-0, 0, 3, 8, 61, 0, 100, 1, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 19217, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Reached WP15 - Set Data Ravandwyr'),
(-@Guid-1, 0, 2, 0, 38, 0, 100, 1, 3, 3, 0, 0, 11, 34973, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Data Set - Cast Ravandwyrs Ice Block'),
(-@Guid-0, 0, 4, 0, 40, 0, 100, 1, 39, (@Entry*100)+3, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Reached WP52 - Despawn'),
(-@Guid-1, 0, 4, 0, 40, 0, 100, 1, 39, (@Entry*100)+3, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Reached WP52 - Despawn'),
(-@Guid-2, 0, 4, 0, 40, 0, 100, 1, 39, (@Entry*100)+3, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Reached WP52 - Despawn'),
(-@Guid-0, 0, 5, 6, 11, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Spawn - Set Invisible'),
(-@Guid-1, 0, 5, 6, 11, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Spawn - Set Invisible'),
(-@Guid-2, 0, 5, 6, 11, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Spawn - Set Invisible'),
(-@Guid-0, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Spawn - Set Emote State None'),
(-@Guid-1, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Spawn - Set Emote State None'),
(-@Guid-2, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Spawn - Set Emote State None'),
(-@Guid-0, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Data Set - Set Visible'),
(-@Guid-1, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Data Set - Set Visible'),
(-@Guid-2, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Data Set - Set Visible'),
(-@Guid-0, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 19217, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - Reached WP - Set Orientation'),
(-@Guid-1, 0, 8, 0, 40, 0, 100, 0, 15, (@Entry*100)+1, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 19217, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Reached WP - Set Orientation'),
(-@Guid-2, 0, 8, 0, 40, 0, 100, 0, 4, (@Entry*100)+2, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 19217, 0, 0, 0, 0, 0, 0, 'Irradiated Worker - On Reached WP - Set Orientation');
DELETE FROM `creature` WHERE `guid` In(@Guid,@Guid+1,@Guid+2);
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
-- GUID: Full: 0xF1304C9A00055BAB Type: Unit Entry: 19610 Low: 351147
(@Guid+0, 19610, 530, 1, 1, 0, 1, 2987.086, 3693.867, 142.8286, 1.888375, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0),
-- GUID: Full: 0xF1304C9A00055BAA Type: Unit Entry: 19610 Low: 351146
(@Guid+1, 19610, 530, 1, 1, 0, 1, 2985.687, 3696.518, 142.7822, 1.968468, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0),
-- GUID: Full: 0xF1304C9A00055BA9 Type: Unit Entry: 19610 Low: 351145
(@Guid+2, 19610, 530, 1, 1, 0, 1, 2984.306, 3699.182, 142.6974, 2.028504, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0);
DELETE FROM `waypoints` WHERE `entry` BETWEEN (@Entry*100)+0 AND (@Entry*100)+3;
DELETE FROM `waypoints` WHERE `entry` =19482;
INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
-- Entry: Full: 0xF1304C9A00055BAB Type: Unit Entry: 19610 Low: 351147
((@Entry*100)+0, 1, 2984.458, 3699.44, 142.6468, 'Irradiated Worker'),
((@Entry*100)+0, 2, 2982.822, 3701.982, 142.6412, 'Irradiated Worker'),
((@Entry*100)+0, 3, 2980.689, 3704.22, 142.5162, 'Irradiated Worker'),
((@Entry*100)+0, 4, 2979.411, 3706.947, 142.5162, 'Irradiated Worker'),
((@Entry*100)+0, 5, 2972.232, 3710.486, 142.5704, 'Irradiated Worker'),
((@Entry*100)+0, 6, 2975.728, 3712.639, 142.3912, 'Irradiated Worker'),
((@Entry*100)+0, 7, 2978.256, 3714.196, 142.3912, 'Irradiated Worker'),
((@Entry*100)+0, 8, 2980.499, 3716.544, 142.3912, 'Irradiated Worker'),
((@Entry*100)+0, 9, 2983.385, 3717.424, 142.46, 'Irradiated Worker'),
((@Entry*100)+0, 10, 2988.857, 3715.101, 143.0921, 'Irradiated Worker'),
((@Entry*100)+0, 11, 2990.199, 3717.815, 143.0774, 'Irradiated Worker'),
((@Entry*100)+0, 12, 2991.541, 3720.528, 143.1886, 'Irradiated Worker'),
((@Entry*100)+0, 13, 2992.891, 3723.256, 143.4944, 'Irradiated Worker'),
((@Entry*100)+0, 14, 2993.456, 3724.4, 143.6318, 'Irradiated Worker'),
((@Entry*100)+0, 15, 2997.077, 3726.937, 143.8528, 'Irradiated Worker'),
-- Entry: Full: 0xF1304C9A00055BAA Type: Unit Entry: 19610 Low: 351146
((@Entry*100)+1, 1, 2982.834, 3701.963, 142.6412, 'Irradiated Worker'),
((@Entry*100)+1, 2, 2981.199, 3704.505, 142.5162, 'Irradiated Worker'),
((@Entry*100)+1, 3, 2979.416, 3706.937, 142.5162, 'Irradiated Worker'),
((@Entry*100)+1, 4, 2978.139, 3709.664, 142.3633, 'Irradiated Worker'),
((@Entry*100)+1, 5, 2974.786, 3712.059, 142.2566, 'Irradiated Worker'),
((@Entry*100)+1, 6, 2978.282, 3714.212, 142.3912, 'Irradiated Worker'),
((@Entry*100)+1, 7, 2980.81, 3715.77, 142.3912, 'Irradiated Worker'),
((@Entry*100)+1, 8, 2983.369, 3717.418, 142.4579, 'Irradiated Worker'),
((@Entry*100)+1, 9, 2986.255, 3718.298, 142.6792, 'Irradiated Worker'),
((@Entry*100)+1, 10, 2990.187, 3717.79, 143.0789, 'Irradiated Worker'),
((@Entry*100)+1, 11, 2991.529, 3720.504, 143.1872, 'Irradiated Worker'),
((@Entry*100)+1, 12, 2992.871, 3723.217, 143.4897, 'Irradiated Worker'),
((@Entry*100)+1, 13, 2994.22, 3725.945, 143.6921, 'Irradiated Worker'),
((@Entry*100)+1, 14, 2994.786, 3727.09, 143.8295, 'Irradiated Worker'),
((@Entry*100)+1, 15, 2993.273, 3728.817, 144.0368, 'Irradiated Worker'),
-- Entry: Full: 0xF1304C9A00055BA9 Type: Unit Entry: 19610 Low: 351145
((@Entry*100)+2, 1, 2976.518, 3713.125, 142.3912, 'Irradiated Worker'),
((@Entry*100)+2, 2, 2976.683, 3713.479, 142.6767, 'Irradiated Worker'),
((@Entry*100)+2, 3, 2991.181, 3719.8, 143.1453, 'Irradiated Worker'),
((@Entry*100)+2, 4, 2996.115, 3729.779, 143.9875, 'Irradiated Worker'),
-- End WP
((@Entry*100)+3, 1, 2995.449, 3728.861, 144.042, 'Irradiated Worker'),
((@Entry*100)+3, 2, 2993.671, 3726.411, 143.748, 'Irradiated Worker'),
((@Entry*100)+3, 3, 2992.502, 3723.404, 143.5121, 'Irradiated Worker'),
((@Entry*100)+3, 4, 2990.972, 3722.039, 143.2026, 'Irradiated Worker'),
((@Entry*100)+3, 5, 2987.993, 3719.381, 142.7629, 'Irradiated Worker'),
((@Entry*100)+3, 6, 2983.944, 3718.579, 142.5269, 'Irradiated Worker'),
((@Entry*100)+3, 7, 2982.988, 3715.74, 142.4609, 'Irradiated Worker'),
((@Entry*100)+3, 8, 2980.014, 3713.131, 142.628, 'Irradiated Worker'),
((@Entry*100)+3, 9, 2980.164, 3711.079, 142.6879, 'Irradiated Worker'),
((@Entry*100)+3, 10, 2980.455, 3707.102, 142.523, 'Irradiated Worker'),
((@Entry*100)+3, 11, 2980.064, 3704.01, 142.2676, 'Irradiated Worker'),
((@Entry*100)+3, 12, 2980.808, 3701.123, 142.6412, 'Irradiated Worker'),
((@Entry*100)+3, 13, 2983.227, 3692.621, 143.0479, 'Irradiated Worker'),
((@Entry*100)+3, 14, 2986.019, 3691.538, 142.9493, 'Irradiated Worker'),
((@Entry*100)+3, 15, 2988.529, 3688.696, 142.8852, 'Irradiated Worker'),
((@Entry*100)+3, 16, 2994.542, 3689.015, 143.4549, 'Irradiated Worker'),
((@Entry*100)+3, 17, 2997.563, 3689.176, 143.6308, 'Irradiated Worker'),
((@Entry*100)+3, 18, 3000.586, 3689.337, 143.6308, 'Irradiated Worker'),
((@Entry*100)+3, 19, 3003.604, 3689.804, 143.6307, 'Irradiated Worker'),
((@Entry*100)+3, 20, 3006.637, 3689.782, 143.6307, 'Irradiated Worker'),
((@Entry*100)+3, 21, 3009.671, 3689.76, 143.6307, 'Irradiated Worker'),
((@Entry*100)+3, 22, 3012.702, 3689.738, 143.6307, 'Irradiated Worker'),
((@Entry*100)+3, 23, 3015.754, 3690.37, 143.6307, 'Irradiated Worker'),
((@Entry*100)+3, 24, 3018.766, 3690.016, 143.6306, 'Irradiated Worker'),
((@Entry*100)+3, 25, 3021.777, 3689.662, 143.6306, 'Irradiated Worker'),
((@Entry*100)+3, 26, 3024.792, 3689.307, 143.6306, 'Irradiated Worker'),
((@Entry*100)+3, 27, 3027.821, 3689.124, 143.6306, 'Irradiated Worker'),
((@Entry*100)+3, 28, 3030.809, 3688.724, 143.2758, 'Irradiated Worker'),
((@Entry*100)+3, 29, 3033.767, 3688.14, 143.0482, 'Irradiated Worker'),
((@Entry*100)+3, 30, 3036.724, 3687.555, 142.9637, 'Irradiated Worker'),
((@Entry*100)+3, 31, 3039.848, 3684.927, 142.7658, 'Irradiated Worker'),
((@Entry*100)+3, 32, 3042.658, 3686.022, 142.7131, 'Irradiated Worker'),
((@Entry*100)+3, 33, 3045.463, 3687.116, 142.6446, 'Irradiated Worker'),
((@Entry*100)+3, 34, 3048.52, 3687.687, 142.3446, 'Irradiated Worker'),
((@Entry*100)+3, 35, 3051.203, 3689.113, 142.5257, 'Irradiated Worker'),
((@Entry*100)+3, 36, 3053.872, 3690.532, 140.5028, 'Irradiated Worker'),
((@Entry*100)+3, 37, 3056.601, 3691.824, 142.8937, 'Irradiated Worker'),
((@Entry*100)+3, 38, 3058.226, 3692.761, 143.2548, 'Irradiated Worker'),
((@Entry*100)+3, 39, 3058.292, 3692.803, 143.258, 'Irradiated Worker'),
-- Sagan
(19482, 1, 2996.497, 3734.341, 144.3418, 'Sagan <Ravandwyrs Familiar>'),
(19482, 2, 2993.747, 3734.091, 144.0918, 'Sagan <Ravandwyrs Familiar>'),
(19482, 3, 2991.747, 3732.591, 144.0918, 'Sagan <Ravandwyrs Familiar>'),
(19482, 4, 2990.747, 3730.341, 144.0918, 'Sagan <Ravandwyrs Familiar>'),
(19482, 5, 2991.247, 3727.591, 144.0918, 'Sagan <Ravandwyrs Familiar>'),
(19482, 6, 2993.497, 3725.591, 144.0918, 'Sagan <Ravandwyrs Familiar>'),
(19482, 7, 2996.747, 3724.341, 144.0918, 'Sagan <Ravandwyrs Familiar>'),
(19482, 8, 2999.997, 3725.841, 144.0918, 'Sagan <Ravandwyrs Familiar>'),
(19482, 9, 3001.247, 3730.091, 144.0918, 'Sagan <Ravandwyrs Familiar>');
DELETE FROM `gossip_menu_option` WHERE `menu_id`=7981;
INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES
(7981, 0, 0, 'I''ve lost Archmage Vargoth''s Staff. Can you replace it?', 18546, 1, 1, 0, 0, 0, 0, '', 0);
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7981;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, 7981, 0, 0, 0, 2, 0, 28455, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Archmage Vargoths Staff'),
(15, 7981, 0, 0, 0, 8, 0, 10174, 0, 0, 0, 0, 0, '', 'Gossip Option requires Curse of the Violet Tower rewarded'),
(15, 7981, 0, 0, 0, 8, 0, 10209, 0, 0, 1, 0, 0, '', 'Gossip Option requires Player is not rewarded for Summoner Kanthins Prize');
UPDATE `creature_text` SET `probability`=20 WHERE `entry`=19541;

View File

@@ -0,0 +1,5 @@
UPDATE `creature_template` SET `unit_flags`=320, `flags_extra`=2 WHERE `entry` IN(36065,36066);
DELETE FROM `creature_template_addon` WHERE `entry` IN(36066, 36065);
INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
(36066, 0, 0x2000000, 0x1, ''),
(36065, 0, 0x2000000, 0x1, '');

View File

@@ -0,0 +1,4 @@
--
DELETE FROM `gameobject_template` WHERE `entry` = 180671;
INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `data0`, `data1`, `VerifiedBuild`) VALUES
(180671,3,644,'Xandivious\' Demon Bag',43,17516,-18019);

View File

@@ -0,0 +1,2 @@
--
UPDATE `creature_loot_template` SET `item`=49426 WHERE `entry`=38433 AND `item`=47241;

View File

@@ -0,0 +1,4 @@
--
DELETE FROM `gameobject_loot_template` WHERE `Entry` = 17516;
INSERT INTO `gameobject_loot_template` (`Entry`,`Item`,`Chance`,`QuestRequired`) VALUES
(17516,21145,100,1);

View File

@@ -0,0 +1,5 @@
--
DELETE FROM `gameobject_template` WHERE `entry` IN (202947,202948);
INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `data0`, `data1`, `VerifiedBuild`) VALUES
(202947,3,9467,'Cologne Neutralizer',93,28677,15211),
(202948,3,9468,'Perfume Neutralizer',93,28678,15211);

View File

@@ -0,0 +1,5 @@
--
DELETE FROM `gameobject_loot_template` WHERE `Entry` IN (28677,28678);
INSERT INTO `gameobject_loot_template` (`Entry`,`Item`,`Chance`,`QuestRequired`) VALUES
(28677,49352,100,1),
(28678,49351,100,1);

View File

@@ -0,0 +1,12 @@
UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=30945 AND `source_type`=0 AND `id`=3;
UPDATE `smart_scripts` SET `link`=28 WHERE `entryorguid`=28659 AND `source_type`=0 AND `id`=26;
UPDATE `smart_scripts` SET `link`=4 WHERE `entryorguid`=27788 AND `source_type`=0 AND `id`=3;
UPDATE `smart_scripts` SET `link`=1 WHERE `entryorguid`=26434 AND `source_type`=0 AND `id`=0;
UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=25979 AND `source_type`=0 AND `id`=1;
UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=23859 AND `source_type`=0 AND `id`=3;
UPDATE `smart_scripts` SET `link`=6 WHERE `entryorguid` IN (34965,19643) AND `source_type`=0 AND `id`=5;
UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid` BETWEEN -23715 AND -23712 AND `source_type`=0 AND `id`=0;
UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=12996 AND `source_type`=0 AND `id`=8;
UPDATE `smart_scripts` SET `link`=8 WHERE `entryorguid`=18171 AND `source_type`=0 AND `id`=7;
UPDATE `smart_scripts` SET `link`=5 WHERE `entryorguid`=19657 AND `source_type`=0 AND `id`=4;
UPDATE `smart_scripts` SET `id`=21, `link`=0, `comment`="The Leaper - In Combat - Cast Hunger For Blood" WHERE `entryorguid`=29840 AND `source_type`=0 AND `id`=7 AND `link`=21;

View File

@@ -0,0 +1,23 @@
-- Scourge Cage
UPDATE `gameobject_template` SET `data2`=120000, AIName='SmartGameObjectAI', ScriptName='', `VerifiedBuild`=-18019 WHERE `entry` IN (
187854,
187855,
187856,
187857,
187858,
187859,
187860,
187861,
187862,
187863,
187864,
187865,
187866,
187867,
187868,
187870,
187871,
187872,
187873,
187874
);

View File

@@ -0,0 +1,2 @@
--
UPDATE `creature` SET `position_x`=1875.67, `position_y`=1303.86, `position_z`=90.4382 WHERE `guid`=29809 and `id`=1506;

View File

@@ -0,0 +1,117 @@
-- On Ruby Wings (12498)
SET @QUEST := 12498;
SET @NPC_WYRMREST_VANQUISHER := 27996; -- Wyrmrest Vanquisher
SET @NPC_THIASSI_THE_LIGHNTNING_BRINGER := 28018; -- Thiassi the Lightning Bringer
SET @NPC_GRAND_NECROLORD_ANTIOK := 28006; -- Grand Necrolord Antiok
SET @NPC_WASTES_SCAVENGER := 28005; -- Wastes Scavenger
SET @SPELL_DEVOUR_GHOUL := 50430; -- Devour Ghoul
SET @SPELL_ENGULFING_FIREBALL := 55987; -- Engulfing Fireball
SET @SPELL_FLAME_FURY := 50348; -- Flame Fury
SET @SPELL_MOUNT := 50343; -- Controlling Wyrmrest Vanquisher
SET @ITEM_SCYTHE_OF_ANTIOK := 38305; -- Item Scythe of Antiok
UPDATE `creature_template` SET npcflag=16777216, `spell1`=@SPELL_FLAME_FURY, `spell2`=@SPELL_ENGULFING_FIREBALL, `spell3`=@SPELL_DEVOUR_GHOUL, `InhabitType`=4 WHERE `entry`=@NPC_WYRMREST_VANQUISHER;
DELETE FROM `npc_spellclick_spells` WHERE npc_entry IN (@NPC_WYRMREST_VANQUISHER);
INSERT INTO `npc_spellclick_spells` VALUES (@NPC_WYRMREST_VANQUISHER, @SPELL_MOUNT, 1, 0);
DELETE FROM `creature_template_addon` WHERE `entry` in (@NPC_WYRMREST_VANQUISHER, @NPC_GRAND_NECROLORD_ANTIOK);
INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(@NPC_WYRMREST_VANQUISHER,0,0,50331648,0,0,'50345'),
(@NPC_GRAND_NECROLORD_ANTIOK,0,0,0,0,0,'50494');
UPDATE vehicle_template_accessory set minion=0,`summontype`=1 where entry=@NPC_THIASSI_THE_LIGHNTNING_BRINGER;
Delete from creature_loot_template where entry =@NPC_GRAND_NECROLORD_ANTIOK and item=@ITEM_SCYTHE_OF_ANTIOK;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@SPELL_FLAME_FURY;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,@SPELL_FLAME_FURY,0,1,31,0,3,@NPC_WASTES_SCAVENGER,0,0,0,0,'','Flame Fury can only Hit Wastes Scavenger');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=55988;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 55988, 0, 2, 31, 0, 3, 26493, 0, 0, 0, 0, '', 'Engulfing Fireball targets Wastes Task Manager'),
(13, 1, 55988, 0, 1, 31, 0, 3, 26492, 0, 0, 0, 0, '', 'Engulfing Fireball targets Wastes Digger'),
(13, 1, 55988, 0, 0, 31, 0, 3, 28005, 0, 0, 0, 0, '', 'Engulfing Fireball targets Wastes Scavenger'),
(13, 2, 55988, 0, 0, 31, 0, 3, 27270, 0, 0, 0, 0, '', 'Engulfing Fireball targets Rotting Storm Giant'),
(13, 2, 55988, 0, 1, 31, 0, 3, 28018, 0, 0, 0, 0, '', 'Engulfing Fireball targets Thiassi');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (50430,50443);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,50430,0,0,31,0,3,28005,0,0,0,0,'','Devour Ghoul targets Wastes Scavenger'),
(13,3,50443,0,0,31,0,3,27996,0,0,0,0,'','Nourishment targets Wyrmrest Vanquisher');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`in (16,17) AND `SourceEntry` IN (27996,50426);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(16, 0, 27996, 0, 0, 23, 0, 4161, 0, 0, 0, 0, 0, '', 'Wyrmrest Vanquisher allowed in Wyrmrest Temple'),
(16, 0, 27996, 0, 4, 23, 0, 4184, 0, 0, 0, 0, 0, '', 'Wyrmrest Vanquisher allowed in Path of the Titans'),
(16, 0, 27996, 0, 3, 23, 0, 4174, 0, 0, 0, 0, 0, '', 'Wyrmrest Vanquisher allowed in The Wicked Coil'),
(16, 0, 27996, 0, 2, 23, 0, 4173, 0, 0, 0, 0, 0, '', 'Wyrmrest Vanquisher allowed in Galakronds Rest'),
(16, 0, 27996, 0, 1, 23, 0, 4254, 0, 0, 0, 0, 0, '', 'Wyrmrest Vanquisher allowed in The Dragon Wastes'),
(17, 0, 50426, 0, 3, 23, 0, 4174, 0, 0, 0, 0, 0, '', 'Wyrmrest Vanquisher can be summoned in The Wicked Coil'),
(17, 0, 50426, 0, 2, 23, 0, 4173, 0, 0, 0, 0, 0, '', 'Wyrmrest Vanquisher can be summoned in Galakronds Rest'),
(17, 0, 50426, 0, 1, 23, 0, 4254, 0, 0, 0, 0, 0, '', 'Wyrmrest Vanquisher can be summoned in The Dragon Wastes'),
(17, 0, 50426, 0, 0, 23, 0, 4161, 0, 0, 0, 0, 0, '', 'Wyrmrest Vanquisher can be summoned in Wyrmrest Temple');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceGroup`=5 and `SourceEntry`=@NPC_WYRMREST_VANQUISHER;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`, `ErrorTextId`,`ScriptName`,`Comment`) VALUES
(22,5,@NPC_WYRMREST_VANQUISHER,0,9,12498,0,0,0,'','event require quest taken to prevent despawn when the spell devour ghoul is casted'),
(22,5,@NPC_WYRMREST_VANQUISHER,1,28,12498,0,0,0,'','event require quest complete to prevent despawn when the spell devour ghoul is casted');
UPDATE creature_template SET AIName='SmartAI' WHERE entry IN (@NPC_GRAND_NECROLORD_ANTIOK, @NPC_THIASSI_THE_LIGHNTNING_BRINGER, @NPC_WYRMREST_VANQUISHER);
DELETE FROM smart_scripts WHERE entryorguid = @NPC_GRAND_NECROLORD_ANTIOK and source_type=0;
DELETE FROM smart_scripts WHERE entryorguid = @NPC_THIASSI_THE_LIGHNTNING_BRINGER and source_type=0;
DELETE FROM smart_scripts WHERE entryorguid = @NPC_WYRMREST_VANQUISHER and source_type=0;
DELETE FROM smart_scripts WHERE entryorguid = @NPC_WYRMREST_VANQUISHER*100 and source_type=9;
DELETE FROM `smart_scripts` WHERE `entryorguid` = 28005 and source_type=0 and id=14; -- (there is already a script for this npc id=0 to id=13)
DELETE FROM `smart_scripts` WHERE `entryorguid` = 28005*100 and source_type=9;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@NPC_GRAND_NECROLORD_ANTIOK, 0, 0, 0, 0, 0, 100, 0, 7000, 7000, 18000, 18000, 11, 32863, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Nekrolord Antiok - IC - Cast Demon Seed'),
(@NPC_GRAND_NECROLORD_ANTIOK, 0, 1, 0, 0, 0, 100, 0, 1100, 1100, 20000, 20000, 11, 50455, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Nekrolord Antiok - IC - Cast Shadow Bolt'),
(@NPC_GRAND_NECROLORD_ANTIOK, 0, 2, 0, 1, 0, 100, 0, 10000, 10000, 40000, 40000, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Nekrolord Antiok - OOC - Random Yell'),
(@NPC_GRAND_NECROLORD_ANTIOK, 0, 3, 0, 2, 0, 100, 1, 0, 25, 0, 0, 11, 50497, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Nekrolord Antiok - HP under 25% - Cast Scream of Chaos'),
(@NPC_GRAND_NECROLORD_ANTIOK, 0, 4, 0, 6, 0, 100, 0, 0, 0, 0, 0, 11, 50472, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Nekrolord Antiok - On Death - Cast Drop Scythe of Antiok'),
(@NPC_GRAND_NECROLORD_ANTIOK, 0, 5, 7, 4, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Nekrolord Antiok - On Aggro - Yell'),
(@NPC_GRAND_NECROLORD_ANTIOK, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 55984, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Nekrolord Antiok - On Aggro - Cast Shadow Bolt'),
(@NPC_GRAND_NECROLORD_ANTIOK, 0, 7, 8, 4, 0, 100, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 19, @NPC_WYRMREST_VANQUISHER, 20, 0, 0, 0, 0, 0, 'Nekrolord Antiok - On Aggro - kill WYRMREST'),
(@NPC_GRAND_NECROLORD_ANTIOK, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 28, 50494, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Nekrolord Antiok - On Aggro - remove aura'),
(@NPC_THIASSI_THE_LIGHNTNING_BRINGER, 0, 0, 0, 0, 0, 100, 0, 5000, 5000, 12000, 14000, 11, 50456, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Thiassi the Lightning Bringer - IC - Cast Thiassi''s Stormbolt'),
(@NPC_THIASSI_THE_LIGHNTNING_BRINGER, 0, 1, 0, 0, 0, 100, 0, 9000, 9000, 15000, 19000, 11, 15593, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Thiassi the Lightning Bringer - IC - Cast War Stomp'),
(@NPC_THIASSI_THE_LIGHNTNING_BRINGER, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 19, 2146959359, 0, 0, 0, 0, 0, 19, @NPC_GRAND_NECROLORD_ANTIOK, 10, 0, 0, 0, 0, 0, 'Thiassi the Lightning Bringer - On Death - remove unitflag from target'),
(@NPC_WYRMREST_VANQUISHER, 0, 0, 0, 1, 0, 100, 0, 9000, 9000, 30000, 30000, 1, 0, 0, 0, 0, 0, 0, 21, 10, 0, 0, 0, 0, 0, 0, 'WYRMREST VANQUISHER - OOC - Random talk'),
(@NPC_WYRMREST_VANQUISHER, 0, 1, 0, 2, 0, 100, 1, 0, 33, 0, 0, 1, 1, 0, 0, 0, 0, 0, 21, 10, 0, 0, 0, 0, 0, 0, 'WYRMREST VANQUISHER - HP under 33% - talk'),
(@NPC_WYRMREST_VANQUISHER, 0, 3, 0, 54, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'WYRMREST VANQUISHER - Just summoned - react passif'),
(@NPC_WYRMREST_VANQUISHER, 0, 4, 0, 28, 0, 100, 0, 0, 0, 0, 0, 80, @NPC_WYRMREST_VANQUISHER*100, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'WYRMREST VANQUISHER - PASSENGER_REMOVED - Actionlist'),
(@NPC_WYRMREST_VANQUISHER*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 21, 10, 0, 0, 0, 0, 0, 0, 'WYRMREST VANQUISHER - ActionList - talk'),
(@NPC_WYRMREST_VANQUISHER*100, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'WYRMREST VANQUISHER - ActionList - despawn'),
(28005, 0, 14, 0, 8, 0, 100, 0, 50430, 0, 0, 0, 80, 28005*100, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wastes Scavenger - On spellhit Devour Ghoul - Run script'),
(28005*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 50437, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Wastes Scavenger script - Spellcast Devour Ghoul'),
(28005*100, 9, 1, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 11, 50443, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Wastes Scavenger script - Spellcast Nourishment'),
(28005*100, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wastes Scavenger script - Despawn');
DELETE FROM creature_text WHERE entry in (@NPC_GRAND_NECROLORD_ANTIOK, @NPC_WYRMREST_VANQUISHER);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
(@NPC_GRAND_NECROLORD_ANTIOK,0,0,'You think you''ve won, mortal? Face the unbridled power of Antiok!',14,0,100,0,0,0,'Antiok Yell1',27415),
(@NPC_GRAND_NECROLORD_ANTIOK,0,1,'Behold! The Scythe of Antiok!',14,0,100,0,0,0,'Antiok Yell2', 27416),
(@NPC_GRAND_NECROLORD_ANTIOK,1,0,'Soon, the bones of Galakrond will rise from their eternal slumber and wreak havoc upon this world!',14,0,100,0,0,0,'Antiok Yell3', 27406),
(@NPC_GRAND_NECROLORD_ANTIOK,1,1,'The Lich King demands more frost wyrms be sent to Angrathar! Meet his demands or face my wrath!',14,0,100,0,0,0,'Antiok Yell4', 27408),
(@NPC_GRAND_NECROLORD_ANTIOK,1,2,'Faster, dogs! We mustn''t relent in our assault against the interlopers!',14,0,100,0,0,0,'Antiok Yell5', 27405),
(@NPC_GRAND_NECROLORD_ANTIOK,1,3,'Attackers are upon us! Let none through to this ancient grave!',14,0,100,0,0,0,'Antiok Yell6', 27409),
(@NPC_GRAND_NECROLORD_ANTIOK,1,4,'Hear me, minions! Hear your lord, Antiok! Double your efforts or pay the consequences of failure!',14,0,100,0,0,0,'Antiok Yell7', 27407),
(@NPC_WYRMREST_VANQUISHER,0,1,'Across this vast expanse rest the bones of my ancestors. Their spirits have ascended to the Chamber of the Aspects.',12,0,100,0,0,0,'WYRMREST VANQUISHER', 27394),
(@NPC_WYRMREST_VANQUISHER,0,2,'Galakrond was the progenitor of dragonkind. It was from Galakrond that the Titans shaped the five Aspects.',12,0,100,0,0,0,'WYRMREST VANQUISHER', 27396),
(@NPC_WYRMREST_VANQUISHER,0,3,'It truly is a shame that the blue dragonflight has chosen such a heartless, cold path. It pains me greatly to do battle with Malygos''s children.',12,0,100,0,0,0,'WYRMREST VANQUISHER', 27400),
(@NPC_WYRMREST_VANQUISHER,0,4,'The queen and her council have been speaking lately of a disaster at Ulduar. Something has happened in Storm Peaks!',12,0,100,0,0,0,'WYRMREST VANQUISHER', 27399),
(@NPC_WYRMREST_VANQUISHER,0,5,'Today is a good day, friend. Long has it been since I have left Wyrmrest Temple, free to fly across the great Dragonblight.',12,0,100,0,0,0,'WYRMREST VANQUISHER', 27398),
(@NPC_WYRMREST_VANQUISHER,0,6,'What the Scourge has done here will reverberate throughout our world. The aberrations must be stopped!',12,0,100,0,0,0,'WYRMREST VANQUISHER', 27395),
(@NPC_WYRMREST_VANQUISHER,1,0,'You must remember that I have yet to mature into an elder wyrm. I must eat to renew my strength!',12,0,100,0,0,0,'WYRMREST VANQUISHER', 27397),
(@NPC_WYRMREST_VANQUISHER,2,0,'I have been called back to Wyrmrest, ally. Farewell!',12,0,100,0,0,0,'WYRMREST VANQUISHER', 27404);
UPDATE `creature` SET `equipment_id`=0 WHERE `guid` IN(74522,74523,74524);

View File

@@ -0,0 +1,19 @@
DELETE FROM gameobject WHERE guid=99998;
INSERT INTO `gameobject` (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, spawntimesecs, State) VALUES
(99998, 180673, 1, 1, 1, 6723.67, -5271.68, 778, 180, 1);
set @Xandivious:=15623;
Delete from creature_loot_template where entry =@Xandivious and item=21145;
Update creature_template set `AIName`='SmartAI' where entry in (@Xandivious);
DELETE FROM `smart_scripts` WHERE `entryorguid` = @Xandivious AND `source_type` = 0;
Insert into `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) values
(@Xandivious, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 11, 25818, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ' Xandivious - On reset - cast Aura of Rot'),
(@Xandivious, 0, 1, 0, 0, 0, 100, 0, 3000, 3000, 15000, 15000, 11, 11980, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Xandivious - IC - cast Curse of Weakness'),
(@Xandivious, 0, 2, 0, 0, 0, 100, 0, 5000, 5000, 15000, 15000, 11, 11639, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Xandivious - IC - cast Shadow Word: Pain'),
(@Xandivious, 0, 3, 0, 0, 0, 100, 0, 7000, 7000, 10000, 10000, 11, 16046, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Xandivious - IC - cast Blast Wave'),
(@Xandivious, 0, 4, 0, 2, 0, 100, 1, 0, 50, 0, 0, 11, 8599, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Xandivious - HP under 50% - Enrage'),
(@Xandivious, 0, 5, 0, 6, 0, 100, 0, 0, 0, 0, 0, 85, 25791, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Xandivious - On Death - invoker_Cast Xandivious Demon Bag');

View File

@@ -0,0 +1,51 @@
-- Schematic: Field Repair Bot 74A
Update npc_text set BroadcastTextID0=9486 where `ID`=6931;
Delete from gossip_menu where `entry`=5749 and `text_id`=6931;
insert into gossip_menu (`entry`, `text_id`) values (5749, 6931);
Update npc_text set BroadcastTextID0=9484 where `ID`=6930;
Delete from gossip_menu where `entry`=5749 and `text_id`=6930;
insert into gossip_menu (`entry`, `text_id`) values (5749, 6930);
Update npc_text set BroadcastTextID0=9483 where `ID`=6929;
Delete from gossip_menu where `entry`=5749 and `text_id`=6929;
insert into gossip_menu (`entry`, `text_id`) values (5749, 6929);
Update npc_text set BroadcastTextID0=9487 where `ID`=6932;
Delete from gossip_menu where `entry`=5749 and `text_id`=6932;
insert into gossip_menu (`entry`, `text_id`) values (5749, 6932);
DELETE FROM `gossip_menu_option` WHERE `menu_id` = 5749;
INSERT INTO `gossip_menu_option` (`menu_id`, id, option_icon, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`)
VALUES (5749, 0, 0, '<Copy the schematic into your engineering notebook.>', 9485, 1, 3);
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` =15 AND `SourceGroup`=5749;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`, `NegativeCondition`, `ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,5749,0,0,7,202,300,0,0,0,'','Show gossip menu if player have 300 or more in Engineering'),
(15,5749,0,0,25,22704,0,0,1,0,'','Show gossip menu if player doesn''t learned the spell');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=5749 and `SourceEntry`= 6931;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`, `NegativeCondition`, `ErrorTextId`,`ScriptName`,`Comment`) VALUES
(14,5749,6931,0,7,202,300,0,1,0,'','Show gossip menu if player is an Engineer but have less than 300'),
(14,5749,6931,0,25,4036,0,0,0,0,'','Show gossip menu if player is an Engineer');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=5749 and `SourceEntry`= 6930;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`, `ErrorTextId`,`ScriptName`,`Comment`) VALUES
(14,5749,6930,0,7,202,300,0,0,'','Show gossip menu if player have 300 or more in Engineering');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=5749 and `SourceEntry`= 6929;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`, `NegativeCondition`, `ErrorTextId`,`ScriptName`,`Comment`) VALUES
(14,5749,6929,0,25,4036,0,0,1,0,'','Show gossip menu if player is not an Engineer');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=5749 and `SourceEntry`= 6932;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`, `ErrorTextId`,`ScriptName`,`Comment`) VALUES
(14,5749,6932,0,25,22704,0,0,0,'','Show gossip menu if player learned the spell');
UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI', ScriptName='' WHERE `entry`=179552;
DELETE FROM `smart_scripts` WHERE `entryorguid` = 179552 AND `source_type` = 1;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(179552, 1, 0, 0, 62, 0, 100, 0, 5749, 0, 0, 0, 85, 22864, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, '179552 - On Gossip Select - InvokerCast'),
(179552, 1, 1, 0, 62, 0, 100, 0, 5749, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, '179552 - On Gossip Select - CloseGossip');

View File

@@ -0,0 +1,7 @@
UPDATE `smart_scripts` SET `action_type`=86, `action_param2`=2, `action_param3`=18, `action_param4`=35, `target_type`=1, `target_param1`=0 WHERE `entryorguid`=23689 AND `source_type`=0 AND `id`=2;
UPDATE `smart_scripts` SET `action_type`=86, `action_param2`=2, `action_param3`=18, `action_param4`=35, `target_type`=1, `target_param1`=0 WHERE `entryorguid`=24170 AND `source_type`=0 AND `id`=1;
UPDATE `smart_scripts` SET `action_type`=86, `action_param2`=2, `action_param3`=21, `action_param4`=20, `target_type`=1, `target_param1`=0 WHERE `entryorguid`=24439 AND `source_type`=0 AND `id`=3;
UPDATE `smart_scripts` SET `action_type`=86, `action_param2`=2, `action_param3`=21, `action_param4`=10, `target_type`=1, `target_param1`=0 WHERE `entryorguid`=27409 AND `source_type`=0 AND `id`=5;
UPDATE `smart_scripts` SET `action_type`=86, `action_param2`=2, `action_param3`=23, `action_param4`=0, `target_type`=1, `target_param1`=0 WHERE `entryorguid`=31048 AND `source_type`=0 AND `id`=2;
UPDATE `smart_scripts` SET `action_type`=85, `action_param2`=2, `target_type`=1 WHERE `entryorguid`=24439 AND `source_type`=0 AND `id`=4;
UPDATE `smart_scripts` SET `action_type`=85, `action_param2`=2, `target_type`=1 WHERE `entryorguid`=27202 AND `source_type`=0 AND `id`=11;

View File

@@ -0,0 +1,3 @@
--
UPDATE `creature_template` SET `gossip_menu_id`=10949, `npcflag`=4225 WHERE `entry`=37904;
UPDATE `gossip_menu_option` SET `option_id`=3, `npc_option_npcflag`=128 WHERE `menu_id`=10949 AND `id`=0;

View File

@@ -0,0 +1,91 @@
UPDATE `creature` SET `MovementType`=0,`spawndist`=0 WHERE `guid` IN(121055,121049);
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN(58108,58118);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 58108, 0, 0, 31, 0, 3, 30995, 0, 0, 0, 0, '', 'Patches Chain targets Patches Chain Target'),
(13, 1, 58118, 0, 0, 31, 0, 3, 30992, 0, 0, 0, 0, '', 'Patches Revenge targets Doctor Sabnok');
UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI', `ScriptName`='' WHERE `entry`=193025;
UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN(30992,30993,30995);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(30992,30993,30995) and `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(3099200,3099300) and `source_type`=9;
DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=193025;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(193025, 1, 0 ,1, 70, 0, 100, 0, 2, 0, 0,0,45,1,1,0,0,0,0,19,30993,0,0,0, 0, 0, 0, 'Metal Stake - On State Changed - Set Data 1 1 on "Patches"'),
(193025, 1, 1 ,0, 61, 0, 100, 0, 0, 0, 0,0,104,1,0,0,0,0,0,1,0,0,0,0, 0, 0, 0, 'Metal Stake - On State Changed - Set Flag In Use"'),
(193025, 1, 2 ,0, 38, 0, 100, 0, 2, 2, 0,0,104,4,0,0,0,0,0,1,0,0,0,0, 0, 0, 0, 'Metal Stake - On Data Set - Remove Flag In Use"'),
(30992, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 3 , 3, 0, 0, 0, 0, 19, 30993, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - On Death - Set Data 3 3 on "Patches"'),
(30992, 0, 1, 0,54, 0, 100, 0, 0, 0, 0, 0, 53, 0 , 30992, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - On Just Summoned - Start WP'),
(30992, 0, 2, 0,40, 0, 100, 0, 10, 30992, 0, 0, 45, 2 , 2, 0, 0, 0, 0, 19, 30993, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Reached WP10 - Set Data 2 2 on "Patches"'),
(30992, 0, 3, 4,40, 0, 100, 0, 14, 30992, 0, 0, 101, 0 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Reached WP14 - Set Home Position'),
(30992, 0, 4, 5,61, 0, 100, 0, 0, 0, 0, 0, 8, 2 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Reached WP14 - Set Hostile'),
(30992, 0, 5, 7,61, 0, 100, 0, 0, 0, 0, 0, 80, 3099200 , 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Reached WP14 - Run Script'),
(30992, 0, 6, 0,11, 0, 100, 0, 0, 0, 0, 0, 18, 256 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - On Spawn - Set Unit Flags'),
(30992, 0, 7, 0,61, 0, 100, 0, 0, 0, 0, 0, 45, 5 , 5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - On Reached WP14 - Set Data 5 5 on "Patches"'),
(30993, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 22, 2 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '"Patches" - On Respawn - Set Phase 2'),
(30993, 0, 1, 0, 1, 2, 100, 0, 0, 0, 3000, 3000, 11, 58108 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '"Patches" - OOC (Phase 2) - Cast Patches Chain'),
(30993, 0, 2, 3, 38, 0, 100, 0, 1, 1, 300000, 300000, 22, 0 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '"Patches" - On Data Set 1 1 - Set Phase 1'),
(30993, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 28, 58108 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '"Patches" - On Data Set 1 1 - Remove Aura Patches Chain'),
(30993, 0, 4, 5,61, 0, 100, 0, 0, 0, 0, 0, 45, 1 , 1, 0, 0, 0, 0, 19, 30995, 0, 0, 0, 0, 0, 0, '"Patches" - On Data Set 1 1 - Set Data 1 1 on Patches chain target'),
(30993, 0, 5, 6, 61, 0, 100, 0, 0, 0, 0, 0, 12, 30992 , 2, 300000, 0, 0, 0, 8, 0, 0, 0, 6630.52, 3167.312, 659.3602, 2.740049, '"Patches" - On Data Set 1 1 - Summon Doctor Sabnok'),
(30993, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 1, 1 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '"Patches" - On Data Set 1 1 - Say Line 1'),
(30993, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 2036 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '"Patches" - On Data Set 1 1 - Set Faction'),
(30993, 0, 8, 9, 38, 0, 100, 0, 3, 3, 0, 0, 11, 59115 , 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Patches" - On Data Set 3 3 - Cast Patches Credit'),
(30993, 0, 9, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 5000 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Patches" - On Data Set 3 3 - Despawn'),
(30993, 0, 10, 15, 38, 0, 100, 0, 5, 5, 0, 0, 89, 0 , 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Patches" - On On Data Set 5 5 - Turn Random Move Off'),
(30993, 0, 11, 0, 38, 0, 100, 0, 4, 4, 0, 0, 80, 3099300 , 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Patches" - On Data Set 4 4 - Run Script'),
(30993, 0, 12, 13, 11, 0, 100, 0, 0, 0, 0, 0, 45, 1 , 1, 0, 0, 0, 0, 14, 62005, 193025, 0, 0, 0, 0, 0, 'Patches" - On Respawn - Set Data 1 1 on Metal Stake'),
(30993, 0, 13, 14, 61, 0, 100, 0, 0, 0, 0, 0, 89, 5 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Patches" - On Respawn - Set Random Movement'),
(30993, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 18, 768 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Patches" - On Respawn - Set Unit Flags'),
(30993, 0, 15, 0, 61, 0, 100, 0, 0, 0, 0, 0, 66, 0 , 0, 0, 0, 0, 0, 19, 30992, 0, 0, 0, 0, 0, 0, 'Patches" - On On Data Set 5 5 - Face Doctor Sabnok'),
(30995, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 28, 58108 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Patches Chain Target - On Data Set 1 1 - Remove Aura Patches Chain'),
(3099200, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0 , 0, 0, 0, 0, 0, 21, 50, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Script - Face Player'),
(3099200, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 5, 21 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Script - Play Emote OneShotApplaud'),
(3099200, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 1 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Script - Say Line 1'),
(3099200, 9, 3, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 2 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Script - Say Line 2'),
(3099200, 9, 4, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 3 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Script - Say Line 3'),
(3099200, 9, 5, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 5, 11 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Script - Play Emote OneShotLaugh'),
(3099200, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 4 , 4, 0, 0, 0, 0, 19, 30993, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Set Data 4 4 on "Patches"'),
(3099200, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 19, 256 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Doctor Sabnok - Set Unit Flags"'),
(3099300, 9, 0, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 8, 2 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '"Patches" - Script - Set Hostile'),
(3099300, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 19, 768 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '"Patches" - Script - Set Unit Flags'),
(3099300, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 49, 0 , 0, 0, 0, 0, 0, 19, 30992, 0, 0, 0, 0, 0, 0, '"Patches" - Script - Start Attack'),
(3099300, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 2 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '"Patches" - Script - Say Line 2'),
(3099300, 9, 4, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 11, 58118 , 0, 0, 0, 0, 0, 19, 30992, 0, 0, 0, 0, 0, 0, '"Patches" - Script - Cast Patches Revenge');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=30993;
DELETE FROM `creature_text` WHERE `entry` IN(30992,30993);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
(30992, 1, 0, 'Oh, bravo. Do you feel proud of yourself now that you''ve unleashed this terrible mistake?', 12, 0, 100, 21, 0, 0, 'Doctor Sabnok',31550),
(30992, 2, 0, 'I already had him scheduled for disposal, but I suppose we can speed up the process a bit.', 12, 0, 100, 1, 0, 0, 'Doctor Sabnok',31551),
(30992, 3, 0, 'It''s a pity so many fine, and reusable, parts will go to waste... ', 12, 0, 100, 11, 0, 0, 'Doctor Sabnok',31553),
(30993, 1, 0, 'Patches get revenge on Doctor Sabnok!', 12, 0, 100, 51, 0, 0, '\"Patches\"',31556),
(30993, 2, 0, 'Patches not going to be cut open or sewn up no more!', 12, 0, 100, 1, 0, 0, '\"Patches\"',31554);
DELETE FROM `creature` WHERE `id` =30992;
UPDATE `creature_template` SET `faction`=974, `speed_run`=1.142857, `unit_flags`=0 WHERE `entry`=30992;
UPDATE `creature_template` SET `unit_flags`=0 WHERE `entry` =30993;
DELETE FROM `waypoints` WHERE `entry` IN(30992,30993);
INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
(30992, 1, 6631.495, 3167.087, 659.3602, 'Doctor Sabnok'),
(30992, 2, 6630.52, 3167.312, 659.3602, 'Doctor Sabnok'),
(30992, 3, 6626.219, 3169.138, 658.8849, 'Doctor Sabnok'),
(30992, 4, 6625.229, 3169.558, 658.8132, 'Doctor Sabnok'),
(30992, 5, 6619.998, 3171.78, 656.6917, 'Doctor Sabnok'),
(30992, 6, 6618.303, 3172.5, 655.796, 'Doctor Sabnok'),
(30992, 7, 6618.303, 3172.5, 655.796, 'Doctor Sabnok'),
(30992, 8, 6618.216, 3172.712, 655.967, 'Doctor Sabnok'),
(30992, 9, 6614.216, 3176.462, 654.217, 'Doctor Sabnok'),
(30992, 10, 6613.862, 3176.668, 653.9982, 'Doctor Sabnok'),
(30992, 11, 6612.862, 3177.668, 653.7482, 'Doctor Sabnok'),
(30992, 12, 6606.399, 3184.294, 649.7903, 'Doctor Sabnok'),
(30992, 13, 6606.399, 3185.794, 649.2903, 'Doctor Sabnok'),
(30992, 14, 6606.149, 3189.544, 648.5403, 'Doctor Sabnok');
DELETE FROM `creature_template_addon` WHERE `entry` IN (30993);
INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
(30993, 0, 0x0, 0x1, '54262'); -- 30993 - 54262

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
-- Insert "Brazie's Black Book of Secrets" into Brazie Getz's vendor table
DELETE FROM `npc_vendor` WHERE `entry`=37904 AND `item`=49926;
INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`, `ExtendedCost`, `VerifiedBuild`) VALUES
(37904, 49926, 0, 0, 0, 0);
-- Add various Brazie's "guides" inside "Brazie's Black Book of Secrets"
DELETE FROM `item_loot_template` WHERE `Entry`=49926 AND `Item` IN (49918, 49922, 49923, 49924, 49925);
INSERT INTO `item_loot_template` (`Entry`, `Item`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES
(49926, 49918, 100, 0, 1, 0, 1, 1), -- Brazie's Guide to Getting Good with Gnomish Girls
(49926, 49922, 100, 0, 1, 0, 1, 1), -- Brazie's Dictionary of Devilish Draenei Damsels
(49926, 49923, 100, 0, 1, 0, 1, 1), -- Brazie's Document on Dwarven Dates in Dun Morogh
(49926, 49924, 100, 0, 1, 0, 1, 1), -- Brazie's Notes on Naughty Night Elves
(49926, 49925, 100, 0, 1, 0, 1, 1); -- Brazie's Handbook to Handling Human Hunnies

View File

@@ -0,0 +1,2 @@
--
DELETE FROM `spell_dbc` WHERE `Id` = 100001;

View File

@@ -0,0 +1,2 @@
--
UPDATE `spell_dbc` SET `AttributesEx3` = 0 WHERE `Id` = 65142;

View File

@@ -0,0 +1,3 @@
UPDATE `smart_scripts` SET `link`=12 WHERE `entryorguid`=11680 AND `source_type`=0 AND `id`=11;
UPDATE `smart_scripts` SET `link`=2 WHERE `entryorguid`=18855 AND `source_type`=0 AND `id`=1;
UPDATE `smart_scripts` SET `link`=18 WHERE `entryorguid`=26670 AND `source_type`=0 AND `id`=18;

View File

@@ -0,0 +1,2 @@
--
UPDATE `spell_dbc` SET `AttributesEx3` = 128 WHERE `Id` = 65142;

View File

@@ -0,0 +1,8 @@
DELETE FROM `creature_loot_template` WHERE `Entry`=15623;
INSERT INTO `creature_loot_template`(`Entry`,`Item`,`Chance`,`MinCount`,`MaxCount`) VALUES
(15623,14047,19,1,4),
(15623,14256,3,1,1),
(15623,8952,2,1,1),
(15623,13446,1.3,1,1),
(15623,13443,0.3,1,1),
(15623,14283,0.11,1,1);

View File

@@ -0,0 +1,2 @@
DELETE FROM `creature_loot_template` WHERE `Entry`=15623 AND `Item`=12002;
INSERT INTO `creature_loot_template`(`Entry`,`Item`,`Chance`,`MinCount`,`MaxCount`) VALUE (15623,12002,0.13,1,1);

View File

@@ -0,0 +1,2 @@
UPDATE `smart_scripts` SET `link`=18 WHERE `entryorguid`=26670 AND `source_type`=0 AND `id`=17;
UPDATE `smart_scripts` SET `link`=20 WHERE `entryorguid`=26670 AND `source_type`=0 AND `id`=19;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
UPDATE `creature_text` SET `language`=0 WHERE `entry`=23678 AND `groupid`=1;

View File

@@ -0,0 +1,21 @@
DELETE FROM `creature_text` WHERE `entry` IN(23439,25510,25511,25513,25512);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
(23439, 0, 0, '%s feeds on the freshly-killed warp chaser.', 16, 0, 100, 35, 0, 0, 'Hungry Nether Ray',21657),
(25510, 0, 0, 'The Serpent''s Maw is engulfed in tuskarr fire!', 41, 0, 100, 0, 0, 0, '1st Kvaldir Vessel (The Serpent''s Maw)',24722),
(25512, 0, 0, 'Bor''s Hammer is engulfed in tuskarr fire!', 41, 0, 100, 0, 0, 0, '3rd Kvaldir Vessel (Bor''s Hammer)',24724),
(25511, 0, 0, 'The Kur Drakkar is engulfed in tuskarr fire!', 41, 0, 100, 0, 0, 0, '2nd Kvaldir Vessel (The Kur Drakkar)',24723),
(25513, 0, 0, 'Bor''s Anvil is engulfed in tuskarr fire!', 41, 0, 100, 0, 0, 0, '4th Kvaldir Vessel (Bor''s Anvil)',24725);
UPDATE `smart_scripts` SET `link`=1 WHERE `entryorguid` IN(25510,25511,25512,25513) AND `source_type`=0 AND `id`=0 AND `link`=0;
UPDATE `smart_scripts` SET `link`=2 WHERE `entryorguid`=23439 AND `source_type`=0 AND `id`=1 AND `link`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(25510,25511,25512,25513) AND `source_type`=0 AND `id`=1;
DELETE FROM `smart_scripts` WHERE `entryorguid` =23439 AND `source_type`=0 AND `id`=2;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(25510, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '1st Kvaldir Vessel (The Serpent\'s Maw) - On Spellhit \'Use Tuskarr Torch\' - Say'),
(25511, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '2nd Kvaldir Vessel (The Kur Drakkar) - On Spellhit \'Use Tuskarr Torch\' - Say'),
(25512, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '3rd Kvaldir Vessel (Bor''s Hammer) - On Spellhit \'Use Tuskarr Torch\' - Say'),
(25513, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '4th Kvaldir Vessel (Bor''s Anvil) - On Spellhit \'Use Tuskarr Torch\' - Say'),
(23439, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hungry Nether Ray - On Data Set 1 1 - Cast \'Lucille Feed Credit Trigger\'');

View File

@@ -0,0 +1,117 @@
-- Skeletal Guardian SAI
SET @ENTRY := 10390;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,1,0,100,2,1000,1000,1800000,1800000,11,13787,1,0,0,0,0,1,0,0,0,0,0,0,0,"Skeletal Guardian - Out of Combat - Cast 'Demon Armor' (Normal Dungeon)"),
(@ENTRY,0,1,0,4,0,100,2,0,0,0,0,11,16799,0,0,0,0,0,2,0,0,0,0,0,0,0,"Skeletal Guardian - On Aggro - Cast 'Frostbolt' (Normal Dungeon)"),
(@ENTRY,0,2,0,0,0,100,2,2400,3800,2400,3800,11,9613,64,0,0,0,0,2,0,0,0,0,0,0,0,"Skeletal Guardian - In Combat CMC - Cast 'Shadow Bolt' (Normal Dungeon)"),
(@ENTRY,0,3,0,0,0,85,2,9000,12000,9000,12000,11,9672,0,0,0,0,0,2,0,0,0,0,0,0,0,"Skeletal Guardian - In Combat Range - Cast 'Frostbolt' (Normal Dungeon)"),
(@ENTRY,0,4,0,0,0,85,2,6000,7000,9000,12000,11,37361,0,0,0,0,0,2,0,0,0,0,0,0,0,"Skeletal Guardian - In Combat - Cast 'Arcane Bolt' (Normal Dungeon)"),
(@ENTRY,0,5,0,0,0,85,2,14000,18000,14000,18000,11,11975,1,0,0,0,0,1,0,0,0,0,0,0,0,"Skeletal Guardian - In Combat - Cast 'Arcane Explosion' (Normal Dungeon)");
-- Skul SAI
SET @ENTRY := 10393;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,1,0,100,2,1000,1000,1800000,1800000,11,12544,1,0,0,0,0,1,0,0,0,0,0,0,0,"Skul - Out of Combat - Cast 'Frost Armor' (Normal Dungeon)"),
(@ENTRY,0,1,0,0,0,100,2,0,0,2400,3800,11,16799,64,0,0,0,0,2,0,0,0,0,0,0,0,"Skul - In Combat - Cast 'Frostbolt' (Normal Dungeon)"),
(@ENTRY,0,2,0,0,0,50,2,6000,8000,16000,20000,11,15499,1,0,0,0,0,5,0,0,0,0,0,0,0,"Skul - In Combat - Cast 'Frost Shock' (Normal Dungeon)"),
(@ENTRY,0,3,0,0,0,40,2,9000,11000,9000,11000,11,15230,0,0,0,0,0,2,0,0,0,0,0,0,0,"Skul - In Combat - Cast 'Arcane Bolt' (Normal Dungeon)"),
(@ENTRY,0,4,0,2,0,100,3,0,15,0,0,25,1,0,0,0,0,0,0,0,0,0,0,0,0,0,"Skul - Between 0-15% Health - Flee For Assist (No Repeat) (Normal Dungeon)");
-- Thuzadin Shadowcaster SAI
SET @ENTRY := 10398;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,0,0,100,2,0,0,2400,3800,11,15232,64,0,0,0,0,2,0,0,0,0,0,0,0,"Thuzadin Shadowcaster - In Combat CMC - Cast 'Shadow Bolt' (Normal Dungeon)"),
(@ENTRY,0,1,0,0,0,100,2,4000,6000,20000,25000,11,11443,1,0,0,0,0,2,0,0,0,0,0,0,0,"Thuzadin Shadowcaster - In Combat - Cast 'Cripple' (Normal Dungeon)"),
(@ENTRY,0,2,0,0,0,100,2,7000,12000,15000,20000,11,16429,33,0,0,0,0,5,0,0,0,0,0,0,0,"Thuzadin Shadowcaster - In Combat - Cast 'Piercing Shadow' (Normal Dungeon)");
-- Crimson Conjuror SAI
SET @ENTRY := 10419;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,0,0,100,2,0,40,2400,3800,11,12675,64,0,0,0,0,2,0,0,0,0,0,0,0,"Crimson Conjuror - In Combat CMC - Cast 'Frostbolt' (Normal Dungeon)"),
(@ENTRY,0,1,0,0,0,85,2,7000,7000,10000,10000,11,17195,1,0,0,0,0,5,0,0,0,0,0,0,0,"Crimson Conjuror - In Combat - Cast 'Scorch' (Normal Dungeon)"),
(@ENTRY,0,2,0,0,0,100,2,10000,10000,15000,15000,11,12674,1,0,0,0,0,1,0,0,0,0,0,0,0,"Crimson Conjuror - In Combat - Cast 'Frost Nova' (Normal Dungeon)"),
(@ENTRY,0,3,0,0,0,100,2,5000,5000,35000,45000,11,17162,1,0,0,0,0,1,0,0,0,0,0,0,0,"Crimson Conjuror - In Combat - Cast 'Summon Water Elemental' (Normal Dungeon)");
-- Crimson Sorcerer SAI
SET @ENTRY := 10422;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,1,0,100,2,1000,1000,1800000,1800000,11,12544,1,0,0,0,0,1,0,0,0,0,0,0,0,"Crimson Sorcerer - Out of Combat - Cast 'Frost Armor' (Normal Dungeon)"),
(@ENTRY,0,1,0,1,0,100,2,3000,3000,1800000,1800000,11,17150,1,0,0,0,0,1,0,0,0,0,0,0,0,"Crimson Sorcerer - Out of Combat - Cast 'Arcane Might' (Normal Dungeon)"),
(@ENTRY,0,2,0,0,0,100,2,0,0,2400,3800,11,15230,64,0,0,0,0,2,0,0,0,0,0,0,0,"Crimson Sorcerer - In Combat CMC - Cast 'Arcane Bolt' (Normal Dungeon)"),
(@ENTRY,0,3,0,0,0,100,2,7000,14000,21000,26000,11,13323,1,0,0,0,0,6,0,0,0,0,0,0,0,"Crimson Sorcerer - In Combat - Cast 'Polymorph' (Normal Dungeon)"),
(@ENTRY,0,4,0,0,0,100,2,5000,6000,8500,10000,11,14145,0,0,0,0,0,2,0,0,0,0,0,0,0,"Crimson Sorcerer - In Combat - Cast 'Fire Blast' (Normal Dungeon)");
-- Chromatic Whelp SAI
SET @ENTRY := 10442;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,4,0,100,2,0,0,0,0,11,16249,0,0,0,0,0,2,0,0,0,0,0,0,0,"Chromatic Whelp - On Aggro - Cast 'Frostbolt' (Normal Dungeon)"),
(@ENTRY,0,1,0,0,0,100,2,2400,3800,2400,3800,11,12167,64,0,0,0,0,2,0,0,0,0,0,0,0,"Chromatic Whelp - In Combat CMC - Cast 'Lightning Bolt' (Normal Dungeon)"),
(@ENTRY,0,2,0,0,0,100,2,16200,26500,7000,27900,11,16249,0,0,0,0,0,2,0,0,0,0,0,0,0,"Chromatic Whelp - In Combat - Cast 'Frostbolt' (Normal Dungeon)"),
(@ENTRY,0,3,0,0,0,100,2,10800,19600,15700,20400,11,16250,1,0,0,0,0,2,0,0,0,0,0,0,0,"Chromatic Whelp - In Combat - Cast 'Fireball Volley' (Normal Dungeon)");
-- Scholomance Adept SAI
SET @ENTRY := 10469;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,0,0,100,2,0,0,3200,4800,11,15043,64,0,0,0,0,2,0,0,0,0,0,0,0,"Scholomance Adept - In Combat CMC - Cast 'Frostbolt' (Normal Dungeon)"),
(@ENTRY,0,1,0,0,0,100,2,7300,17300,9400,14300,11,15244,1,0,0,0,0,1,0,0,0,0,0,0,0,"Scholomance Adept - In Combat - Cast 'Cone of Cold' (Normal Dungeon)"),
(@ENTRY,0,2,0,0,0,100,2,7600,19700,12200,24700,11,15499,0,0,0,0,0,2,0,0,0,0,0,0,0,"Scholomance Adept - In Combat - Cast 'Frost Shock' (Normal Dungeon)"),
(@ENTRY,0,3,0,2,0,100,3,0,15,0,0,25,1,0,0,0,0,0,0,0,0,0,0,0,0,0,"Scholomance Adept - Between 0-15% Health - Flee For Assist (No Repeat) (Normal Dungeon)");
-- Scholomance Neophyte SAI
SET @ENTRY := 10470;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,0,0,100,2,0,0,3400,4800,11,12739,64,0,0,0,0,2,0,0,0,0,0,0,0,"Scholomance Neophyte - In Combat CMC - Cast 'Shadow Bolt'"),
(@ENTRY,0,1,0,0,0,100,2,8600,26300,18400,36000,11,17165,1,0,0,0,0,2,0,0,0,0,0,0,0,"Scholomance Neophyte - In Combat - Cast 'Mind Flay'");
-- Scholomance Necrolyte SAI
SET @ENTRY := 10476;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,0,0,100,2,0,0,2400,3800,11,12739,64,0,0,0,0,2,0,0,0,0,0,0,0,"Scholomance Necrolyte - In Combat CMC - Cast 'Shadow Bolt' (Normal Dungeon)"),
(@ENTRY,0,1,0,0,0,100,2,1400,6200,7400,22000,11,17234,1,0,0,0,0,2,0,0,0,0,0,0,0,"Scholomance Necrolyte - In Combat - Cast 'Shadow Shock' (Normal Dungeon)"),
(@ENTRY,0,2,0,0,0,100,2,1400,22000,22000,33200,11,17151,32,0,0,0,0,1,0,0,0,0,0,0,0,"Scholomance Necrolyte - In Combat - Cast 'Shadow Barrier' (Normal Dungeon)");
-- Hearthsinger Forresten SAI
SET @ENTRY := 10558;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,0,0,100,2,5,30,2300,3900,11,16100,64,0,0,0,0,2,0,0,0,0,0,0,0,"Hearthsinger Forresten - In Combat CMC - Cast 'Shoot' (Normal Dungeon)"),
(@ENTRY,0,1,0,0,0,100,2,3000,5000,12000,19000,11,16244,1,0,0,0,0,1,0,0,0,0,0,0,0,"Hearthsinger Forresten - In Combat - Cast 'Demoralizing Shout' (Normal Dungeon)"),
(@ENTRY,0,2,0,0,0,100,2,7000,9000,20000,25000,11,16798,1,0,0,0,0,6,0,0,0,0,0,0,0,"Hearthsinger Forresten - In Combat - Cast 'Enchanting Lullaby' (Normal Dungeon)"),
(@ENTRY,0,3,0,2,0,100,3,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hearthsinger Forresten - Between 0-15% Health - Flee For Assist (No Repeat) (Normal Dungeon)");
-- Lady Vespia SAI
SET @ENTRY := 10559;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,0,0,100,0,5400,7100,14300,19600,11,8398,0,0,0,0,0,2,0,0,0,0,0,0,0,"Lady Vespia - In Combat - Cast 'Frostbolt Volley' (Normal Dungeon)"),
(@ENTRY,0,1,0,0,0,100,0,15300,19100,9500,22100,11,13586,0,0,0,0,0,2,0,0,0,0,0,0,0,"Lady Vespia - In Combat - Cast 'Aqua Jet' (Normal Dungeon)"),
(@ENTRY,0,2,0,2,0,100,1,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lady Vespia - Between 0-15% Health - Flee For Assist (No Repeat) (Normal Dungeon)");
-- Urok Ogre Magus SAI
SET @ENTRY := 10602;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,0,0,100,2,0,0,2400,3800,11,15979,64,0,0,0,0,2,0,0,0,0,0,0,0,"Urok Ogre Magus - In Combat CMC - Cast 'Arcane Bolt' (Normal Dungeon)"),
(@ENTRY,0,1,0,0,0,100,2,8000,11000,17000,24000,11,13747,1,0,0,0,0,5,0,0,0,0,0,0,0,"Urok Ogre Magus - In Combat - Cast 'Slow' (Normal Dungeon)"),
(@ENTRY,0,2,0,2,0,100,3,0,30,30000,35000,11,6742,1,0,0,0,0,1,0,0,0,0,0,0,0,"Urok Ogre Magus - Between 0-30% Health - Cast 'Bloodlust' (No Repeat) (Normal Dungeon)");

View File

@@ -25,6 +25,8 @@ if( SERVERS )
add_subdirectory(game)
add_subdirectory(collision)
add_subdirectory(authserver)
add_subdirectory(ipc)
add_subdirectory(bnetserver)
add_subdirectory(scripts)
add_subdirectory(worldserver)
else()

View File

@@ -104,63 +104,6 @@ enum GameAccountFlags
GAMEACCOUNT_FLAG_DEATH_KNIGHT_OK = 0x20000000,
};
namespace Battlenet
{
enum AuthResult
{
AUTH_OK = 0,
AUTH_INTERNAL_ERROR = 100,
AUTH_CORRUPTED_MODULE = 101,
AUTH_NO_BATTLETAGS = 102,
AUTH_BAD_SERVER_PROOF = 103,
AUTH_UNKNOWN_ACCOUNT = 104,
AUTH_CLOSED = 105,
AUTH_LOGIN_TIMEOUT = 106,
AUTH_NO_GAME_ACCOUNTS = 107,
AUTH_INVALID_TOKEN = 108,
AUTH_INVALID_PROGRAM = 109,
AUTH_INVALID_OS = 110,
AUTH_UNSUPPORTED_LANGUAGE = 111,
AUTH_REGION_BAD_VERSION = 112,
AUTH_TEMP_OUTAGE = 113,
AUTH_CANT_DOWNLOAD_MODULE = 114,
AUTH_DUPLICATE_LOGON = 115,
AUTH_BAD_CREDENTIALS_2 = 116,
AUTH_VERSION_CHECK_SUCCEEDED = 117,
AUTH_BAD_VERSION_HASH = 118,
AUTH_CANT_RETRIEVE_PORTAL_LIST = 119,
AUTH_DARK_PORTAL_DOES_NOT_EXIST = 120,
AUTH_DARK_PORTAL_FILE_CORRUPTED = 121,
AUTH_BATTLENET_MAINTENANCE = 122,
AUTH_LOGON_TOO_FAST = 123,
AUTH_USE_GRUNT_LOGON = 124,
AUTH_NO_GAME_ACCOUNTS_IN_REGION = 140,
AUTH_ACCOUNT_LOCKED = 141,
LOGIN_SERVER_BUSY = 200,
LOGIN_NO_GAME_ACCOUNT = 201,
LOGIN_BANNED = 202,
LOGIN_SUSPENDED = 203,
LOGIN_GAME_ACCOUNT_LOCKED = 204,
LOGIN_ALREADY_ONLINE = 205,
LOGIN_NOTIME = 206,
LOGIN_EXPIRED = 207,
LOGIN_EXPIRED_2 = 208,
LOGIN_PARENTALCONTROL = 209,
LOGIN_TRIAL_EXPIRED = 210,
LOGIN_ANTI_INDULGENCE = 211,
LOGIN_INCORRECT_REGION = 212,
LOGIN_LOCKED_ENFORCED = 213,
LOGIN_CHARGEBACK = 214,
LOGIN_IGR_WITHOUT_BNET = 215,
LOGIN_UNLOCKABLE_LOCK = 216,
LOGIN_IGR_REQUIRED = 217,
LOGIN_PAYMENT_CHANGED = 218,
LOGIN_INVALID_PAYMENT = 219,
LOGIN_INVALID_ACCOUNT_STATE = 220
};
}
enum ExpansionFlags
{
POST_BC_EXP_FLAG = 0x2,

View File

@@ -58,7 +58,6 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/Authentication
${CMAKE_CURRENT_SOURCE_DIR}/Realms
${CMAKE_CURRENT_SOURCE_DIR}/Server
${CMAKE_CURRENT_SOURCE_DIR}/Server/BattlenetPackets
${MYSQL_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
${VALGRIND_INCLUDE_DIR}

View File

@@ -25,8 +25,6 @@
*/
#include "AuthSocketMgr.h"
#include "BattlenetManager.h"
#include "BattlenetSessionManager.h"
#include "Common.h"
#include "Config.h"
#include "DatabaseEnv.h"
@@ -117,18 +115,9 @@ int main(int argc, char** argv)
return 1;
}
int32 bnport = sConfigMgr->GetIntDefault("BattlenetPort", 1119);
if (bnport < 0 || bnport > 0xFFFF)
{
TC_LOG_ERROR("server.authserver", "Specified battle.net port (%d) out of allowed range (1-65535)", bnport);
StopDB();
return 1;
}
std::string bindIp = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
sAuthSocketMgr.StartNetwork(_ioService, bindIp, port);
sBattlenetSessionMgr.StartNetwork(_ioService, bindIp, bnport);
// Set signal handlers
boost::asio::signal_set signals(_ioService, SIGINT, SIGTERM);
@@ -145,8 +134,6 @@ int main(int argc, char** argv)
_dbPingTimer.expires_from_now(boost::posix_time::minutes(_dbPingInterval));
_dbPingTimer.async_wait(KeepDatabaseAliveHandler);
sBattlenetMgr->Load();
// Start the io service worker loop
_ioService.run();

View File

@@ -2,9 +2,6 @@
#include "Configuration/Config.h"
#include "Database/DatabaseEnv.h"
#include "Log.h"
#include "BattlenetManager.h"
#include "RealmList.h"
#include "ByteBuffer.h"
#include "BattlenetPackets.h"
#include "AuthSession.h"
#include "BattlenetSession.h"

View File

@@ -19,7 +19,6 @@
#include <boost/asio/ip/tcp.hpp>
#include "Common.h"
#include "RealmList.h"
#include "BattlenetManager.h"
#include "Database/DatabaseEnv.h"
#include "Util.h"
@@ -78,7 +77,7 @@ void RealmList::Initialize(boost::asio::io_service& ioService, uint32 updateInte
}
void RealmList::UpdateRealm(uint32 id, const std::string& name, ip::address const& address, ip::address const& localAddr,
ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population, uint32 build, uint8 region, uint8 battlegroup)
ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population, uint32 build)
{
// Create new if not exist or update existed
Realm& realm = m_realms[name];
@@ -91,15 +90,11 @@ void RealmList::UpdateRealm(uint32 id, const std::string& name, ip::address cons
realm.allowedSecurityLevel = allowedSecurityLevel;
realm.populationLevel = population;
// Append port to IP address.
realm.ExternalAddress = address;
realm.LocalAddress = localAddr;
realm.LocalSubnetMask = localSubmask;
realm.port = port;
realm.gamebuild = build;
realm.Region = region;
realm.Battlegroup = battlegroup;
}
void RealmList::UpdateIfNeed()
@@ -175,11 +170,9 @@ void RealmList::UpdateRealms(bool init)
uint8 allowedSecurityLevel = fields[9].GetUInt8();
float pop = fields[10].GetFloat();
uint32 build = fields[11].GetUInt32();
uint8 region = fields[12].GetUInt8();
uint8 battlegroup = fields[13].GetUInt8();
UpdateRealm(realmId, name, externalAddress, localAddress, localSubmask, port, icon, flag, timezone,
(allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build, region, battlegroup);
(allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build);
if (init)
TC_LOG_INFO("server.authserver", "Added realm \"%s\" at %s:%u.", name.c_str(), m_realms[name].ExternalAddress.to_string().c_str(), port);
@@ -193,16 +186,3 @@ void RealmList::UpdateRealms(bool init)
while (result->NextRow());
}
}
Realm const* RealmList::GetRealm(Battlenet::RealmId const& id) const
{
auto itr = std::find_if(m_realms.begin(), m_realms.end(), [id](RealmMap::value_type const& pair)
{
return pair.second.Region == id.Region && pair.second.Battlegroup == id.Battlegroup && pair.second.m_ID == id.Index;
});
if (itr != m_realms.end())
return &itr->second;
return NULL;
}

View File

@@ -54,17 +54,10 @@ struct Realm
AccountTypes allowedSecurityLevel;
float populationLevel;
uint32 gamebuild;
uint8 Region;
uint8 Battlegroup;
ip::tcp::endpoint GetAddressForClient(ip::address const& clientAddr) const;
};
namespace Battlenet
{
struct RealmId;
}
/// Storage object for the list of realms on the server
class RealmList
{
@@ -88,14 +81,13 @@ public:
RealmMap::const_iterator begin() const { return m_realms.begin(); }
RealmMap::const_iterator end() const { return m_realms.end(); }
uint32 size() const { return m_realms.size(); }
Realm const* GetRealm(Battlenet::RealmId const& id) const;
private:
RealmList();
void UpdateRealms(bool init = false);
void UpdateRealm(uint32 id, const std::string& name, ip::address const& address, ip::address const& localAddr,
ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population, uint32 build, uint8 region, uint8 battlegroup);
ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population, uint32 build);
RealmMap m_realms;
uint32 m_UpdateInterval;

View File

@@ -1,55 +0,0 @@
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.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, see <http://www.gnu.org/licenses/>.
*/
#ifndef ConnectionPackets_h__
#define ConnectionPackets_h__
#include "BattlenetPacketsBase.h"
namespace Battlenet
{
namespace Connection
{
enum Opcode
{
CMSG_PING = 0x0,
CMSG_ENABLE_ENCRYPTION = 0x5,
CMSG_LOGOUT_REQUEST = 0x6,
CMSG_DISCONNECT_REQUEST = 0x7, // Not implemented
CMSG_CONNECTION_CLOSING = 0x9, // Not implemented
SMSG_PONG = 0x0,
SMSG_BOOM = 0x1, // Not implemented
SMSG_REGULATOR_UPDATE = 0x2, // Not implemented
SMSG_SERVER_VERSION = 0x3, // Not implemented
SMSG_STUN_SERVERS = 0x4 // Not implemented
};
class Pong final : public ServerPacket
{
public:
Pong() : ServerPacket(PacketHeader(SMSG_PONG, CONNECTION))
{
}
void Write() override { }
std::string ToString() const override;
};
}
}
#endif // ConnectionPackets_h__

View File

@@ -53,13 +53,6 @@ MaxPingTime = 30
RealmServerPort = 3724
#
# BattlenetPort
# Description: TCP port to reach the auth server for battle.net connections.
# Default: 1119
BattlenetPort = 1119
#
#
# BindIP

View File

@@ -0,0 +1,55 @@
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.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, see <http://www.gnu.org/licenses/>.
*/
#include "AuthCodes.h"
#include <cstddef>
namespace AuthHelper
{
static RealmBuildInfo const PostBcAcceptedClientBuilds[] =
{
{15595, 4, 3, 4, ' '},
{14545, 4, 2, 2, ' '},
{13623, 4, 0, 6, 'a'},
{13930, 3, 3, 5, 'a'}, // 3.3.5a China Mainland build
{12340, 3, 3, 5, 'a'},
{11723, 3, 3, 3, 'a'},
{11403, 3, 3, 2, ' '},
{11159, 3, 3, 0, 'a'},
{10505, 3, 2, 2, 'a'},
{9947, 3, 1, 3, ' '},
{8606, 2, 4, 3, ' '},
{6141, 1, 12, 3, ' '},
{6005, 1, 12, 2, ' '},
{5875, 1, 12, 1, ' '},
{0, 0, 0, 0, ' '} // terminator
};
RealmBuildInfo const* GetBuildInfo(int build)
{
for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i)
if (PostBcAcceptedClientBuilds[i].Build == build)
return &PostBcAcceptedClientBuilds[i];
return nullptr;
}
bool IsBuildSupportingBattlenet(int build)
{
return build >= 15595;
}
}

View File

@@ -0,0 +1,128 @@
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef _AUTHCODES_H
#define _AUTHCODES_H
enum GameAccountFlags
{
GAMEACCOUNT_FLAG_GM = 0x00000001,
GAMEACCOUNT_FLAG_NOKICK = 0x00000002,
GAMEACCOUNT_FLAG_COLLECTOR = 0x00000004,
GAMEACCOUNT_FLAG_WOW_TRIAL = 0x00000008,
GAMEACCOUNT_FLAG_CANCELLED = 0x00000010,
GAMEACCOUNT_FLAG_IGR = 0x00000020,
GAMEACCOUNT_FLAG_WHOLESALER = 0x00000040,
GAMEACCOUNT_FLAG_PRIVILEGED = 0x00000080,
GAMEACCOUNT_FLAG_EU_FORBID_ELV = 0x00000100,
GAMEACCOUNT_FLAG_EU_FORBID_BILLING = 0x00000200,
GAMEACCOUNT_FLAG_WOW_RESTRICTED = 0x00000400,
GAMEACCOUNT_FLAG_REFERRAL = 0x00000800,
GAMEACCOUNT_FLAG_BLIZZARD = 0x00001000,
GAMEACCOUNT_FLAG_RECURRING_BILLING = 0x00002000,
GAMEACCOUNT_FLAG_NOELECTUP = 0x00004000,
GAMEACCOUNT_FLAG_KR_CERTIFICATE = 0x00008000,
GAMEACCOUNT_FLAG_EXPANSION_COLLECTOR = 0x00010000,
GAMEACCOUNT_FLAG_DISABLE_VOICE = 0x00020000,
GAMEACCOUNT_FLAG_DISABLE_VOICE_SPEAK = 0x00040000,
GAMEACCOUNT_FLAG_REFERRAL_RESURRECT = 0x00080000,
GAMEACCOUNT_FLAG_EU_FORBID_CC = 0x00100000,
GAMEACCOUNT_FLAG_OPENBETA_DELL = 0x00200000,
GAMEACCOUNT_FLAG_PROPASS = 0x00400000,
GAMEACCOUNT_FLAG_PROPASS_LOCK = 0x00800000,
GAMEACCOUNT_FLAG_PENDING_UPGRADE = 0x01000000,
GAMEACCOUNT_FLAG_RETAIL_FROM_TRIAL = 0x02000000,
GAMEACCOUNT_FLAG_EXPANSION2_COLLECTOR = 0x04000000,
GAMEACCOUNT_FLAG_OVERMIND_LINKED = 0x08000000,
GAMEACCOUNT_FLAG_DEMOS = 0x10000000,
GAMEACCOUNT_FLAG_DEATH_KNIGHT_OK = 0x20000000,
};
namespace Battlenet
{
enum AuthResult
{
AUTH_OK = 0,
AUTH_INTERNAL_ERROR = 100,
AUTH_CORRUPTED_MODULE = 101,
AUTH_NO_BATTLETAGS = 102,
AUTH_BAD_SERVER_PROOF = 103,
AUTH_UNKNOWN_ACCOUNT = 104,
AUTH_CLOSED = 105,
AUTH_LOGIN_TIMEOUT = 106,
AUTH_NO_GAME_ACCOUNTS = 107,
AUTH_INVALID_TOKEN = 108,
AUTH_INVALID_PROGRAM = 109,
AUTH_INVALID_OS = 110,
AUTH_UNSUPPORTED_LANGUAGE = 111,
AUTH_REGION_BAD_VERSION = 112,
AUTH_TEMP_OUTAGE = 113,
AUTH_CANT_DOWNLOAD_MODULE = 114,
AUTH_DUPLICATE_LOGON = 115,
AUTH_BAD_CREDENTIALS_2 = 116,
AUTH_VERSION_CHECK_SUCCEEDED = 117,
AUTH_BAD_VERSION_HASH = 118,
AUTH_CANT_RETRIEVE_PORTAL_LIST = 119,
AUTH_DARK_PORTAL_DOES_NOT_EXIST = 120,
AUTH_DARK_PORTAL_FILE_CORRUPTED = 121,
AUTH_BATTLENET_MAINTENANCE = 122,
AUTH_LOGON_TOO_FAST = 123,
AUTH_USE_GRUNT_LOGON = 124,
AUTH_NO_GAME_ACCOUNTS_IN_REGION = 140,
AUTH_ACCOUNT_LOCKED = 141,
LOGIN_SERVER_BUSY = 200,
LOGIN_NO_GAME_ACCOUNT = 201,
LOGIN_BANNED = 202,
LOGIN_SUSPENDED = 203,
LOGIN_GAME_ACCOUNT_LOCKED = 204,
LOGIN_ALREADY_ONLINE = 205,
LOGIN_NOTIME = 206,
LOGIN_EXPIRED = 207,
LOGIN_EXPIRED_2 = 208,
LOGIN_PARENTALCONTROL = 209,
LOGIN_TRIAL_EXPIRED = 210,
LOGIN_ANTI_INDULGENCE = 211,
LOGIN_INCORRECT_REGION = 212,
LOGIN_LOCKED_ENFORCED = 213,
LOGIN_CHARGEBACK = 214,
LOGIN_IGR_WITHOUT_BNET = 215,
LOGIN_UNLOCKABLE_LOCK = 216,
LOGIN_IGR_REQUIRED = 217,
LOGIN_PAYMENT_CHANGED = 218,
LOGIN_INVALID_PAYMENT = 219,
LOGIN_INVALID_ACCOUNT_STATE = 220
};
}
struct RealmBuildInfo
{
int Build;
int MajorVersion;
int MinorVersion;
int BugfixVersion;
int HotfixVersion;
};
namespace AuthHelper
{
RealmBuildInfo const* GetBuildInfo(int build);
bool IsBuildSupportingBattlenet(int build);
}
#endif

View File

@@ -15,8 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __BATTLENETPACKETCRYPT_H__
#define __BATTLENETPACKETCRYPT_H__
#ifndef BattlenetPacketCrypt_h__
#define BattlenetPacketCrypt_h__
#include "PacketCrypt.h"
@@ -32,5 +32,5 @@ namespace Battlenet
void Init(BigNumber* K) override;
};
}
#endif // BattlenetPacketCrypt_h__
#endif // __BATTLENETPACKETCRYPT_H__

View File

@@ -0,0 +1,121 @@
# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
########### bnetserver ###############
file(GLOB_RECURSE sources_authentication Authentication/*.cpp Authentication/*.h)
file(GLOB_RECURSE sources_realms Realms/*.cpp Realms/*.h)
file(GLOB_RECURSE sources_server Server/*.cpp Server/*.h)
file(GLOB_RECURSE sources_packets Packets/*.cpp Packets/*.h)
file(GLOB sources_localdir *.cpp *.h)
if (USE_COREPCH)
set(bnetserver_PCH_HDR PrecompiledHeaders/bnetPCH.h)
set(bnetserver_PCH_SRC PrecompiledHeaders/bnetPCH.cpp)
endif()
set(bnetserver_SRCS
${bnetserver_SRCS}
${sources_authentication}
${sources_realms}
${sources_server}
${sources_packets}
${sources_localdir}
)
if( WIN32 )
set(bnetserver_SRCS
${bnetserver_SRCS}
${sources_windows_Debugging}
)
if ( MSVC )
set(bnetserver_SRCS
${bnetserver_SRCS}
bnetserver.rc
)
endif ()
endif()
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/dep/zmqpp
${CMAKE_SOURCE_DIR}/src/server/shared
${CMAKE_SOURCE_DIR}/src/server/shared/Configuration
${CMAKE_SOURCE_DIR}/src/server/shared/Database
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
${CMAKE_SOURCE_DIR}/src/server/shared/Packets
${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography
${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography/Authentication
${CMAKE_SOURCE_DIR}/src/server/shared/Logging
${CMAKE_SOURCE_DIR}/src/server/shared/Networking
${CMAKE_SOURCE_DIR}/src/server/shared/Threading
${CMAKE_SOURCE_DIR}/src/server/shared/Utilities
${CMAKE_SOURCE_DIR}/src/server/ipc
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/Authentication
${CMAKE_CURRENT_SOURCE_DIR}/Realms
${CMAKE_CURRENT_SOURCE_DIR}/Server
${CMAKE_CURRENT_SOURCE_DIR}/Packets
${MYSQL_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
${VALGRIND_INCLUDE_DIR}
${ZMQ_INCLUDE_DIR}
)
add_executable(bnetserver
${bnetserver_SRCS}
${bnetserver_PCH_SRC}
)
add_dependencies(bnetserver revision.h)
if( NOT WIN32 )
set_target_properties(bnetserver PROPERTIES
COMPILE_DEFINITIONS _TRINITY_BNET_CONFIG="${CONF_DIR}/bnetserver.conf"
)
endif()
target_link_libraries(bnetserver
ipc
shared
zmqpp
${MYSQL_LIBRARY}
${OPENSSL_LIBRARIES}
${ZMQ_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${Boost_LIBRARIES}
)
if( WIN32 )
if ( MSVC )
add_custom_command(TARGET bnetserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bnetserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
)
elseif ( MINGW )
add_custom_command(TARGET bnetserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bnetserver.conf.dist ${CMAKE_BINARY_DIR}/bin/
)
endif()
endif()
if( UNIX )
install(TARGETS bnetserver DESTINATION bin)
install(FILES bnetserver.conf.dist DESTINATION ${CONF_DIR})
elseif( WIN32 )
install(TARGETS bnetserver DESTINATION "${CMAKE_INSTALL_PREFIX}")
install(FILES bnetserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif()
# Generate precompiled header
if (USE_COREPCH)
add_cxx_pch(bnetserver ${bnetserver_PCH_HDR} ${bnetserver_PCH_SRC})
endif()

View File

@@ -0,0 +1,244 @@
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* 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, see <http://www.gnu.org/licenses/>.
*/
/**
* @file main.cpp
* @brief Authentication Server main program
*
* This file contains the main program for the
* authentication server
*/
#include "ComponentManager.h"
#include "ModuleManager.h"
#include "SessionManager.h"
#include "Common.h"
#include "Config.h"
#include "DatabaseEnv.h"
#include "Log.h"
#include "ProcessPriority.h"
#include "RealmList.h"
#include "SystemConfig.h"
#include "Util.h"
#include "ZmqContext.h"
#include <cstdlib>
#include <iostream>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/program_options.hpp>
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
using boost::asio::ip::tcp;
using namespace boost::program_options;
#ifndef _TRINITY_BNET_CONFIG
# define _TRINITY_BNET_CONFIG "bnetserver.conf"
#endif
bool StartDB();
void StopDB();
void SignalHandler(const boost::system::error_code& error, int signalNumber);
void KeepDatabaseAliveHandler(const boost::system::error_code& error);
variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile);
boost::asio::io_service _ioService;
boost::asio::deadline_timer _dbPingTimer(_ioService);
uint32 _dbPingInterval;
LoginDatabaseWorkerPool LoginDatabase;
int main(int argc, char** argv)
{
std::string configFile = _TRINITY_BNET_CONFIG;
auto vm = GetConsoleArguments(argc, argv, configFile);
// exit if help is enabled
if (vm.count("help"))
return 0;
std::string configError;
if (!sConfigMgr->LoadInitial(configFile, configError))
{
printf("Error in config file: %s\n", configError.c_str());
return 1;
}
TC_LOG_INFO("server.bnetserver", "%s (bnetserver)", _FULLVERSION);
TC_LOG_INFO("server.bnetserver", "<Ctrl-C> to stop.\n");
TC_LOG_INFO("server.bnetserver", "Using configuration file %s.", configFile.c_str());
TC_LOG_INFO("server.bnetserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
TC_LOG_INFO("server.bnetserver", "Using Boost version: %i.%i.%i", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
// bnetserver PID file creation
std::string pidFile = sConfigMgr->GetStringDefault("PidFile", "");
if (!pidFile.empty())
{
if (uint32 pid = CreatePIDFile(pidFile))
TC_LOG_INFO("server.bnetserver", "Daemon PID: %u\n", pid);
else
{
TC_LOG_ERROR("server.bnetserver", "Cannot create PID file %s.\n", pidFile.c_str());
return 1;
}
}
int32 worldListenPort = sConfigMgr->GetIntDefault("WorldserverListenPort", 1118);
if (worldListenPort < 0 || worldListenPort > 0xFFFF)
{
TC_LOG_ERROR("server.bnetserver", "Specified worldserver listen port (%d) out of allowed range (1-65535)", worldListenPort);
return 1;
}
// Initialize the database connection
if (!StartDB())
return 1;
sIpcContext->Initialize();
// Get the list of realms for the server
sRealmList->Initialize(_ioService, sConfigMgr->GetIntDefault("RealmsStateUpdateDelay", 10), worldListenPort);
// Start the listening port (acceptor) for auth connections
int32 bnport = sConfigMgr->GetIntDefault("BattlenetPort", 1119);
if (bnport < 0 || bnport > 0xFFFF)
{
TC_LOG_ERROR("server.bnetserver", "Specified battle.net port (%d) out of allowed range (1-65535)", bnport);
StopDB();
return 1;
}
std::string bindIp = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
sSessionMgr.StartNetwork(_ioService, bindIp, bnport);
// Set signal handlers
boost::asio::signal_set signals(_ioService, SIGINT, SIGTERM);
#if PLATFORM == PLATFORM_WINDOWS
signals.add(SIGBREAK);
#endif
signals.async_wait(SignalHandler);
// Set process priority according to configuration settings
SetProcessPriority("server.bnetserver");
// Enabled a timed callback for handling the database keep alive ping
_dbPingInterval = sConfigMgr->GetIntDefault("MaxPingTime", 30);
_dbPingTimer.expires_from_now(boost::posix_time::minutes(_dbPingInterval));
_dbPingTimer.async_wait(KeepDatabaseAliveHandler);
sComponentMgr->Load();
sModuleMgr->Load();
// Start the io service worker loop
_ioService.run();
sIpcContext->Close();
sRealmList->Close();
// Close the Database Pool and library
StopDB();
TC_LOG_INFO("server.bnetserver", "Halting process...");
return 0;
}
/// Initialize connection to the database
bool StartDB()
{
MySQL::Library_Init();
std::string dbstring = sConfigMgr->GetStringDefault("LoginDatabaseInfo", "");
if (dbstring.empty())
{
TC_LOG_ERROR("server.bnetserver", "Database not specified");
return false;
}
int32 worker_threads = sConfigMgr->GetIntDefault("LoginDatabase.WorkerThreads", 1);
if (worker_threads < 1 || worker_threads > 32)
{
TC_LOG_ERROR("server.bnetserver", "Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1.");
worker_threads = 1;
}
int32 synch_threads = sConfigMgr->GetIntDefault("LoginDatabase.SynchThreads", 1);
if (synch_threads < 1 || synch_threads > 32)
{
TC_LOG_ERROR("server.bnetserver", "Improper value specified for LoginDatabase.SynchThreads, defaulting to 1.");
synch_threads = 1;
}
if (!LoginDatabase.Open(dbstring, uint8(worker_threads), uint8(synch_threads)))
{
TC_LOG_ERROR("server.bnetserver", "Cannot connect to database");
return false;
}
TC_LOG_INFO("server.bnetserver", "Started auth database connection pool.");
sLog->SetRealmId(0); // Enables DB appenders when realm is set.
return true;
}
/// Close the connection to the database
void StopDB()
{
LoginDatabase.Close();
MySQL::Library_End();
}
void SignalHandler(const boost::system::error_code& error, int /*signalNumber*/)
{
if (!error)
_ioService.stop();
}
void KeepDatabaseAliveHandler(const boost::system::error_code& error)
{
if (!error)
{
TC_LOG_INFO("server.bnetserver", "Ping MySQL to keep connection alive");
LoginDatabase.KeepAlive();
_dbPingTimer.expires_from_now(boost::posix_time::minutes(_dbPingInterval));
_dbPingTimer.async_wait(KeepDatabaseAliveHandler);
}
}
variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile)
{
options_description all("Allowed options");
all.add_options()
("help,h", "print usage message")
("config,c", value<std::string>(&configFile)->default_value(_TRINITY_BNET_CONFIG), "use <arg> as configuration file")
;
variables_map variablesMap;
try
{
store(command_line_parser(argc, argv).options(all).allow_unregistered().run(), variablesMap);
notify(variablesMap);
}
catch (std::exception& e) {
std::cerr << e.what() << "\n";
}
if (variablesMap.count("help")) {
std::cout << all << "\n";
}
return variablesMap;
}

View File

@@ -0,0 +1,42 @@
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.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, see <http://www.gnu.org/licenses/>.
*/
#ifndef AchievementPackets_h__
#define AchievementPackets_h__
#include "PacketsBase.h"
namespace Battlenet
{
namespace Achievement
{
enum Opcode
{
CMSG_LISTEN_REQUEST = 0x0, // Not implemented
CMSG_CRITERIA_FLUSH_REQUEST = 0x3, // Not implemented
CMSG_CHANGE_TROPHY_CASE_REQUEST = 0x5, // Not implemented
SMSG_DATA = 0x2, // Not implemented
SMSG_CRITERIA_FLUSH_RESPONSE = 0x3, // Not implemented
SMSG_ACHIEVEMENT_HANDLE_UPDATE = 0x4, // Not implemented
SMSG_CHANGE_TROPHY_CASE_RESULT = 0x6 // Not implemented
};
}
}
#endif // AchievementPackets_h__

View File

@@ -16,44 +16,9 @@
*/
#include "AuthenticationPackets.h"
#include "Session.h"
#include "Util.h"
void Battlenet::Authentication::LogonRequest3::Read()
{
Program = _stream.ReadFourCC();
Platform = _stream.ReadFourCC();
Locale = _stream.ReadFourCC();
Components.resize(_stream.Read<uint32>(6));
for (size_t i = 0; i < Components.size(); ++i)
{
Component& component = Components[i];
component.Program = _stream.ReadFourCC();
component.Platform = _stream.ReadFourCC();
component.Build = _stream.Read<uint32>(32);
}
if (_stream.Read<uint32>(1))
Login = _stream.ReadString(9, 3);
Compatibility = _stream.Read<uint64>(64);
}
std::string Battlenet::Authentication::LogonRequest3::ToString() const
{
std::ostringstream stream;
stream << "Battlenet::Authentication::LogonRequest3 Program: " << Program << ", Platform: " << Platform << ", Locale: " << Locale;
for (Component const& component : Components)
stream << std::endl << "Battlenet::Component Program: " << component.Program << ", Platform: " << component.Platform << ", Build: " << component.Build;
if (!Login.empty())
stream << std::endl << " Login: " << Login;
stream << " Compatibility: " << Compatibility;
return stream.str();
}
void Battlenet::Authentication::ResumeRequest::Read()
{
Program = _stream.ReadFourCC();
@@ -81,13 +46,18 @@ std::string Battlenet::Authentication::ResumeRequest::ToString() const
for (Component const& component : Components)
stream << std::endl << "Battlenet::Component Program: " << component.Program << ", Platform: " << component.Platform << ", Build: " << component.Build;
stream << std::endl << "Battlenet::Authentication::ResumeRequest Login: " << Login;
stream << std::endl << "Battlenet::Authentication::ResumeRequest Region: " << uint32(Region);
stream << std::endl << "Battlenet::Authentication::ResumeRequest GameAccountName: " << GameAccountName;
stream << std::endl << "Login: " << Login;
stream << std::endl << "Region: " << uint32(Region);
stream << std::endl << "GameAccountName: " << GameAccountName;
return stream.str();
}
void Battlenet::Authentication::ResumeRequest::CallHandler(Session* session)
{
session->HandleResumeRequest(*this);
}
Battlenet::Authentication::ProofRequest::~ProofRequest()
{
for (size_t i = 0; i < Modules.size(); ++i)
@@ -147,6 +117,52 @@ std::string Battlenet::Authentication::ProofResponse::ToString() const
return stream.str();
}
void Battlenet::Authentication::ProofResponse::CallHandler(Session* session)
{
session->HandleProofResponse(*this);
}
void Battlenet::Authentication::LogonRequest3::Read()
{
Program = _stream.ReadFourCC();
Platform = _stream.ReadFourCC();
Locale = _stream.ReadFourCC();
Components.resize(_stream.Read<uint32>(6));
for (size_t i = 0; i < Components.size(); ++i)
{
Component& component = Components[i];
component.Program = _stream.ReadFourCC();
component.Platform = _stream.ReadFourCC();
component.Build = _stream.Read<uint32>(32);
}
if (_stream.Read<uint32>(1))
Login = _stream.ReadString(9, 3);
Compatibility = _stream.Read<uint64>(64);
}
std::string Battlenet::Authentication::LogonRequest3::ToString() const
{
std::ostringstream stream;
stream << "Battlenet::Authentication::LogonRequest3 Program: " << Program << ", Platform: " << Platform << ", Locale: " << Locale;
for (Component const& component : Components)
stream << std::endl << "Battlenet::Component Program: " << component.Program << ", Platform: " << component.Platform << ", Build: " << component.Build;
if (!Login.empty())
stream << std::endl << " Login: " << Login;
stream << " Compatibility: " << Compatibility;
return stream.str();
}
void Battlenet::Authentication::LogonRequest3::CallHandler(Session* session)
{
session->HandleLogonRequest(*this);
}
Battlenet::Authentication::LogonResponse::~LogonResponse()
{
for (ModuleInfo* m : Modules)

View File

@@ -18,7 +18,9 @@
#ifndef AuthenticationPackets_h__
#define AuthenticationPackets_h__
#include "BattlenetPacketsBase.h"
#include "PacketsBase.h"
#include "ComponentManager.h"
#include "ModuleManager.h"
namespace Battlenet
{
@@ -41,25 +43,6 @@ namespace Battlenet
SMSG_GENERATE_SINGLE_SIGN_ON_TOKEN_REQUEST_2 = 0x8 // Not implemented
};
class LogonRequest3 final : public ClientPacket
{
public:
LogonRequest3(PacketHeader const& header, BitStream& stream) : ClientPacket(header, stream)
{
ASSERT(header == PacketHeader(CMSG_LOGON_REQUEST_3, AUTHENTICATION) && "Invalid packet header for LogonRequest3");
}
void Read() override;
std::string ToString() const override;
std::string Program;
std::string Platform;
std::string Locale;
std::vector<Component> Components;
std::string Login;
uint64 Compatibility;
};
class ResumeRequest final : public ClientPacket
{
public:
@@ -70,6 +53,7 @@ namespace Battlenet
void Read() override;
std::string ToString() const override;
void CallHandler(Session* session) override;
std::string Program;
std::string Platform;
@@ -92,20 +76,29 @@ namespace Battlenet
void Read() override;
std::string ToString() const override;
void CallHandler(Session* session) override;
std::vector<BitStream*> Modules;
};
class ProofRequest final : public ServerPacket
class LogonRequest3 final : public ClientPacket
{
public:
ProofRequest() : ServerPacket(PacketHeader(SMSG_PROOF_REQUEST, AUTHENTICATION)) { }
~ProofRequest();
LogonRequest3(PacketHeader const& header, BitStream& stream) : ClientPacket(header, stream)
{
ASSERT(header == PacketHeader(CMSG_LOGON_REQUEST_3, AUTHENTICATION) && "Invalid packet header for LogonRequest3");
}
void Write() override;
void Read() override;
std::string ToString() const override;
void CallHandler(Session* session) override;
std::vector<ModuleInfo*> Modules;
std::string Program;
std::string Platform;
std::string Locale;
std::vector<Component> Components;
std::string Login;
uint64 Compatibility;
};
class ResponseFailure
@@ -192,6 +185,18 @@ namespace Battlenet
int32 PingTimeout;
Regulator RegulatorRules;
};
class ProofRequest final : public ServerPacket
{
public:
ProofRequest() : ServerPacket(PacketHeader(SMSG_PROOF_REQUEST, AUTHENTICATION)) { }
~ProofRequest();
void Write() override;
std::string ToString() const override;
std::vector<ModuleInfo*> Modules;
};
}
}

View File

@@ -15,7 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "BattlenetBitStream.h"
#include "BitStream.h"
template<>
bool Battlenet::BitStream::Read<bool>(uint32 /*bitCount*/)

View File

@@ -15,8 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __BATTLENETBITSTREAM_H__
#define __BATTLENETBITSTREAM_H__
#ifndef BitStream_h__
#define BitStream_h__
#include "Common.h"
#include "ByteConverter.h"
@@ -212,14 +212,6 @@ namespace Battlenet
}
}
void SetReadPos(uint32 bits)
{
if (bits > _writePos)
throw BitStreamPositionException(true, bits, 0, _writePos);
_readPos = bits;
}
bool IsRead() const { return _readPos >= _writePos; }
uint8* GetBuffer() { return _buffer.data(); }
@@ -227,6 +219,10 @@ namespace Battlenet
size_t GetSize() const { return ((_writePos + 7) & ~7) / 8; }
// These methods are meant to only be used when their corresponding actions in the client ignore the value completely
void ReadSkip(uint32 bitCount) { _readPos += bitCount; }
void WriteSkip(uint32 bitCount) { Write(0, bitCount); }
private:
uint32 _writePos;
uint32 _readPos;
@@ -240,4 +236,4 @@ namespace Battlenet
void BitStream::Write<bool>(bool value, uint32 bitCount);
}
#endif // __BATTLENETBITSTREAM_H__
#endif // BitStream_h__

View File

@@ -0,0 +1,82 @@
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.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, see <http://www.gnu.org/licenses/>.
*/
#include "Session.h"
#include "Util.h"
#include "CachePackets.h"
void Battlenet::Cache::GetStreamItemsRequest::Read()
{
_stream.WriteSkip(31);
Index = _stream.Read<uint32>(32);
ReferenceTime = _stream.Read<int32>(32) - std::numeric_limits<int32>::min();
_stream.Read<bool>(1); // StreamDirection
_stream.Read<uint8>(6); // Module count, always 0
Locale = _stream.ReadFourCC();
if (_stream.Read<bool>(1))
{
ItemName = _stream.ReadFourCC();
Channel = _stream.ReadFourCC();
}
else
_stream.Read<uint16>(16);
}
std::string Battlenet::Cache::GetStreamItemsRequest::ToString() const
{
std::ostringstream stream;
stream << "Battlenet::Cache::GetStreamItemsRequest Channel: " << Channel << ", ItemName: " << ItemName
<< ", Locale: " << Locale << ", Index: " << Index;
return stream.str();
}
void Battlenet::Cache::GetStreamItemsRequest::CallHandler(Session* session)
{
session->HandleGetStreamItemsRequest(*this);
}
Battlenet::Cache::GetStreamItemsResponse::~GetStreamItemsResponse()
{
for (size_t i = 0; i < Modules.size(); ++i)
delete Modules[i];
}
void Battlenet::Cache::GetStreamItemsResponse::Write()
{
_stream.Write(0, 16);
_stream.Write(1, 16);
_stream.Write(Index, 32);
_stream.Write(Modules.size(), 6);
for (ModuleInfo const* info : Modules)
{
_stream.WriteBytes(info->Type.c_str(), 4);
_stream.WriteFourCC(info->Region);
_stream.WriteBytes(info->ModuleId, 32);
_stream.WriteSkip(27);
_stream.WriteBytes(info->Data, 4);
}
}
std::string Battlenet::Cache::GetStreamItemsResponse::ToString() const
{
std::ostringstream stream;
stream << "Battlenet::Cache::GetStreamItemsResponse modules " << Modules.size();
for (ModuleInfo const* module : Modules)
stream << std::endl << "Battlenet::ModuleInfo Locale " << module->Region.c_str() << ", ModuleId " << ByteArrayToHexStr(module->ModuleId, 32) << ", Data " << ByteArrayToHexStr(module->Data, module->DataSize);
return stream.str();
}

Some files were not shown because too many files have changed in this diff Show More