Merge branch 'bfa'
This commit is contained in:
@@ -20,7 +20,8 @@ BnetServiceGenerator::BnetServiceGenerator(pb::ServiceDescriptor const* descript
|
||||
else
|
||||
vars_["dllexport"] = options.dllexport_decl + " ";
|
||||
|
||||
vars_["original_hash"] = " typedef std::integral_constant<uint32, 0x" + pb::ToUpper(pb::ToHex(HashServiceName(descriptor_->options().GetExtension(Battlenet::original_fully_qualified_descriptor_name)))) + "u> OriginalHash;\n";
|
||||
if (descriptor_->options().HasExtension(Battlenet::service_options))
|
||||
vars_["original_hash"] = " typedef std::integral_constant<uint32, 0x" + pb::ToUpper(pb::ToHex(HashServiceName(descriptor_->options().GetExtension(Battlenet::service_options).descriptor_name()))) + "u> OriginalHash;\n";
|
||||
vars_["name_hash"] = " typedef std::integral_constant<uint32, 0x" + pb::ToUpper(pb::ToHex(HashServiceName(descriptor_->full_name()))) + "u> NameHash;\n";
|
||||
}
|
||||
|
||||
@@ -85,13 +86,13 @@ void BnetServiceGenerator::GenerateClientMethodSignatures(pb::io::Printer* print
|
||||
for (int i = 0; i < descriptor_->method_count(); i++)
|
||||
{
|
||||
pb::MethodDescriptor const* method = descriptor_->method(i);
|
||||
if (!method->options().HasExtension(Battlenet::method_id))
|
||||
if (!method->options().HasExtension(Battlenet::method_options))
|
||||
continue;
|
||||
|
||||
std::map<std::string, std::string> sub_vars;
|
||||
sub_vars["name"] = method->name();
|
||||
sub_vars["full_name"] = descriptor_->name() + "." + method->name();
|
||||
sub_vars["method_id"] = pb::SimpleItoa(method->options().GetExtension(Battlenet::method_id));
|
||||
sub_vars["method_id"] = pb::SimpleItoa(method->options().GetExtension(Battlenet::method_options).id());
|
||||
sub_vars["input_type"] = pbcpp::ClassName(method->input_type(), true);
|
||||
sub_vars["output_type"] = pbcpp::ClassName(method->output_type(), true);
|
||||
sub_vars["input_type_name"] = method->input_type()->full_name();
|
||||
@@ -108,7 +109,7 @@ void BnetServiceGenerator::GenerateServerMethodSignatures(pb::io::Printer* print
|
||||
for (int i = 0; i < descriptor_->method_count(); i++)
|
||||
{
|
||||
pb::MethodDescriptor const* method = descriptor_->method(i);
|
||||
if (!method->options().HasExtension(Battlenet::method_id))
|
||||
if (!method->options().HasExtension(Battlenet::method_options))
|
||||
continue;
|
||||
|
||||
std::map<std::string, std::string> sub_vars;
|
||||
@@ -161,14 +162,14 @@ void BnetServiceGenerator::GenerateClientMethodImplementations(pb::io::Printer*
|
||||
for (int i = 0; i < descriptor_->method_count(); i++)
|
||||
{
|
||||
pb::MethodDescriptor const* method = descriptor_->method(i);
|
||||
if (!method->options().HasExtension(Battlenet::method_id))
|
||||
if (!method->options().HasExtension(Battlenet::method_options))
|
||||
continue;
|
||||
|
||||
std::map<std::string, std::string> sub_vars;
|
||||
sub_vars["classname"] = vars_["classname"];
|
||||
sub_vars["name"] = method->name();
|
||||
sub_vars["full_name"] = descriptor_->name() + "." + method->name();
|
||||
sub_vars["method_id"] = pb::SimpleItoa(method->options().GetExtension(Battlenet::method_id));
|
||||
sub_vars["method_id"] = pb::SimpleItoa(method->options().GetExtension(Battlenet::method_options).id());
|
||||
sub_vars["input_type"] = pbcpp::ClassName(method->input_type(), true);
|
||||
sub_vars["output_type"] = pbcpp::ClassName(method->output_type(), true);
|
||||
sub_vars["input_type_name"] = method->input_type()->full_name();
|
||||
@@ -210,14 +211,14 @@ void BnetServiceGenerator::GenerateServerCallMethod(pb::io::Printer* printer)
|
||||
for (int i = 0; i < descriptor_->method_count(); i++)
|
||||
{
|
||||
pb::MethodDescriptor const* method = descriptor_->method(i);
|
||||
if (!method->options().HasExtension(Battlenet::method_id))
|
||||
if (!method->options().HasExtension(Battlenet::method_options))
|
||||
continue;
|
||||
|
||||
std::map<std::string, std::string> sub_vars;
|
||||
sub_vars["classname"] = vars_["classname"];
|
||||
sub_vars["name"] = method->name();
|
||||
sub_vars["full_name"] = descriptor_->name() + "." + method->name();
|
||||
sub_vars["method_id"] = pb::SimpleItoa(method->options().GetExtension(Battlenet::method_id));
|
||||
sub_vars["method_id"] = pb::SimpleItoa(method->options().GetExtension(Battlenet::method_options).id());
|
||||
sub_vars["input_type"] = pbcpp::ClassName(method->input_type(), true);
|
||||
sub_vars["output_type"] = pbcpp::ClassName(method->output_type(), true);
|
||||
sub_vars["input_type_name"] = method->input_type()->full_name();
|
||||
@@ -285,7 +286,7 @@ void BnetServiceGenerator::GenerateServerImplementations(pb::io::Printer* printe
|
||||
for (int i = 0; i < descriptor_->method_count(); i++)
|
||||
{
|
||||
pb::MethodDescriptor const* method = descriptor_->method(i);
|
||||
if (!method->options().HasExtension(Battlenet::method_id))
|
||||
if (!method->options().HasExtension(Battlenet::method_options))
|
||||
continue;
|
||||
|
||||
std::map<std::string, std::string> sub_vars;
|
||||
|
||||
@@ -20,6 +20,9 @@ namespace Battlenet {
|
||||
|
||||
namespace {
|
||||
|
||||
const ::google::protobuf::Descriptor* BGSMethodOptions_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
BGSMethodOptions_reflection_ = NULL;
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -30,6 +33,21 @@ void protobuf_AssignDesc_method_5foptions_2eproto() {
|
||||
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
|
||||
"method_options.proto");
|
||||
GOOGLE_CHECK(file != NULL);
|
||||
BGSMethodOptions_descriptor_ = file->message_type(0);
|
||||
static const int BGSMethodOptions_offsets_[1] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BGSMethodOptions, id_),
|
||||
};
|
||||
BGSMethodOptions_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
BGSMethodOptions_descriptor_,
|
||||
BGSMethodOptions::default_instance_,
|
||||
BGSMethodOptions_offsets_,
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BGSMethodOptions, _has_bits_[0]),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BGSMethodOptions, _unknown_fields_),
|
||||
-1,
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(BGSMethodOptions));
|
||||
}
|
||||
|
||||
namespace {
|
||||
@@ -42,11 +60,15 @@ inline void protobuf_AssignDescriptorsOnce() {
|
||||
|
||||
void protobuf_RegisterTypes(const ::std::string&) {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
BGSMethodOptions_descriptor_, &BGSMethodOptions::default_instance());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void protobuf_ShutdownFile_method_5foptions_2eproto() {
|
||||
delete BGSMethodOptions::default_instance_;
|
||||
delete BGSMethodOptions_reflection_;
|
||||
}
|
||||
|
||||
void protobuf_AddDesc_method_5foptions_2eproto() {
|
||||
@@ -58,14 +80,19 @@ void protobuf_AddDesc_method_5foptions_2eproto() {
|
||||
::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto();
|
||||
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
|
||||
"\n\024method_options.proto\022\tBattlenet\032 googl"
|
||||
"e/protobuf/descriptor.proto:3\n\tmethod_id"
|
||||
"\022\036.google.protobuf.MethodOptions\030\320\206\003 \001(\r"
|
||||
"B\002H\002", 124);
|
||||
"e/protobuf/descriptor.proto\"\036\n\020BGSMethod"
|
||||
"Options\022\n\n\002id\030\001 \001(\r:U\n\016method_options\022\036."
|
||||
"google.protobuf.MethodOptions\030\220\277\005 \001(\0132\033."
|
||||
"Battlenet.BGSMethodOptionsB%\n\rbnet.proto"
|
||||
"colB\022MethodOptionsProtoH\002", 225);
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
|
||||
"method_options.proto", &protobuf_RegisterTypes);
|
||||
::google::protobuf::internal::ExtensionSet::RegisterExtension(
|
||||
BGSMethodOptions::default_instance_ = new BGSMethodOptions();
|
||||
::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
|
||||
&::google::protobuf::MethodOptions::default_instance(),
|
||||
50000, 13, false, false);
|
||||
90000, 11, false, false,
|
||||
&::Battlenet::BGSMethodOptions::default_instance());
|
||||
BGSMethodOptions::default_instance_->InitAsDefaultInstance();
|
||||
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_method_5foptions_2eproto);
|
||||
}
|
||||
|
||||
@@ -75,9 +102,82 @@ struct StaticDescriptorInitializer_method_5foptions_2eproto {
|
||||
protobuf_AddDesc_method_5foptions_2eproto();
|
||||
}
|
||||
} static_descriptor_initializer_method_5foptions_2eproto_;
|
||||
|
||||
// ===================================================================
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const int BGSMethodOptions::kIdFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
BGSMethodOptions::BGSMethodOptions()
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
// @@protoc_insertion_point(constructor:Battlenet.BGSMethodOptions)
|
||||
}
|
||||
|
||||
void BGSMethodOptions::InitAsDefaultInstance() {
|
||||
}
|
||||
|
||||
BGSMethodOptions::BGSMethodOptions(const BGSMethodOptions& from)
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
MergeFrom(from);
|
||||
// @@protoc_insertion_point(copy_constructor:Battlenet.BGSMethodOptions)
|
||||
}
|
||||
|
||||
void BGSMethodOptions::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
id_ = 0u;
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
BGSMethodOptions::~BGSMethodOptions() {
|
||||
// @@protoc_insertion_point(destructor:Battlenet.BGSMethodOptions)
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
void BGSMethodOptions::SharedDtor() {
|
||||
if (this != default_instance_) {
|
||||
}
|
||||
}
|
||||
|
||||
void BGSMethodOptions::SetCachedSize(int size) const {
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
}
|
||||
const ::google::protobuf::Descriptor* BGSMethodOptions::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return BGSMethodOptions_descriptor_;
|
||||
}
|
||||
|
||||
const BGSMethodOptions& BGSMethodOptions::default_instance() {
|
||||
if (default_instance_ == NULL) protobuf_AddDesc_method_5foptions_2eproto();
|
||||
return *default_instance_;
|
||||
}
|
||||
|
||||
BGSMethodOptions* BGSMethodOptions::default_instance_ = NULL;
|
||||
|
||||
BGSMethodOptions* BGSMethodOptions::New() const {
|
||||
return new BGSMethodOptions;
|
||||
}
|
||||
|
||||
void BGSMethodOptions::Swap(BGSMethodOptions* other) {
|
||||
if (other != this) {
|
||||
GetReflection()->Swap(this, other);}
|
||||
}
|
||||
|
||||
::google::protobuf::Metadata BGSMethodOptions::GetMetadata() const {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::Metadata metadata;
|
||||
metadata.descriptor = BGSMethodOptions_descriptor_;
|
||||
metadata.reflection = BGSMethodOptions_reflection_;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MethodOptions,
|
||||
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 13, false >
|
||||
method_id(kMethodIdFieldNumber, 0u);
|
||||
::google::protobuf::internal::MessageTypeTraits< ::Battlenet::BGSMethodOptions >, 11, false >
|
||||
method_options(kMethodOptionsFieldNumber, ::Battlenet::BGSMethodOptions::default_instance());
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
|
||||
@@ -20,8 +20,10 @@
|
||||
#endif
|
||||
|
||||
#include <google/protobuf/generated_message_util.h>
|
||||
#include <google/protobuf/message.h>
|
||||
#include <google/protobuf/repeated_field.h>
|
||||
#include <google/protobuf/extension_set.h>
|
||||
#include <google/protobuf/unknown_field_set.h>
|
||||
#include "google/protobuf/descriptor.pb.h"
|
||||
// @@protoc_insertion_point(includes)
|
||||
|
||||
@@ -32,19 +34,109 @@ void protobuf_AddDesc_method_5foptions_2eproto();
|
||||
void protobuf_AssignDesc_method_5foptions_2eproto();
|
||||
void protobuf_ShutdownFile_method_5foptions_2eproto();
|
||||
|
||||
class BGSMethodOptions;
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class BGSMethodOptions : public ::google::protobuf::Message {
|
||||
public:
|
||||
BGSMethodOptions();
|
||||
virtual ~BGSMethodOptions();
|
||||
|
||||
BGSMethodOptions(const BGSMethodOptions& from);
|
||||
|
||||
inline BGSMethodOptions& operator=(const BGSMethodOptions& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const BGSMethodOptions& default_instance();
|
||||
|
||||
void Swap(BGSMethodOptions* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
BGSMethodOptions* New() const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// optional uint32 id = 1;
|
||||
inline bool has_id() const;
|
||||
inline void clear_id();
|
||||
static const int kIdFieldNumber = 1;
|
||||
inline ::google::protobuf::uint32 id() const;
|
||||
inline void set_id(::google::protobuf::uint32 value);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:Battlenet.BGSMethodOptions)
|
||||
private:
|
||||
inline void set_has_id();
|
||||
inline void clear_has_id();
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::google::protobuf::uint32 _has_bits_[1];
|
||||
mutable int _cached_size_;
|
||||
::google::protobuf::uint32 id_;
|
||||
friend void protobuf_AddDesc_method_5foptions_2eproto();
|
||||
friend void protobuf_AssignDesc_method_5foptions_2eproto();
|
||||
friend void protobuf_ShutdownFile_method_5foptions_2eproto();
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static BGSMethodOptions* default_instance_;
|
||||
};
|
||||
// ===================================================================
|
||||
|
||||
static const int kMethodIdFieldNumber = 50000;
|
||||
static const int kMethodOptionsFieldNumber = 90000;
|
||||
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MethodOptions,
|
||||
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 13, false >
|
||||
method_id;
|
||||
::google::protobuf::internal::MessageTypeTraits< ::Battlenet::BGSMethodOptions >, 11, false >
|
||||
method_options;
|
||||
|
||||
// ===================================================================
|
||||
|
||||
// BGSMethodOptions
|
||||
|
||||
// optional uint32 id = 1;
|
||||
inline bool BGSMethodOptions::has_id() const {
|
||||
return (_has_bits_[0] & 0x00000001u) != 0;
|
||||
}
|
||||
inline void BGSMethodOptions::set_has_id() {
|
||||
_has_bits_[0] |= 0x00000001u;
|
||||
}
|
||||
inline void BGSMethodOptions::clear_has_id() {
|
||||
_has_bits_[0] &= ~0x00000001u;
|
||||
}
|
||||
inline void BGSMethodOptions::clear_id() {
|
||||
id_ = 0u;
|
||||
clear_has_id();
|
||||
}
|
||||
inline ::google::protobuf::uint32 BGSMethodOptions::id() const {
|
||||
// @@protoc_insertion_point(field_get:Battlenet.BGSMethodOptions.id)
|
||||
return id_;
|
||||
}
|
||||
inline void BGSMethodOptions::set_id(::google::protobuf::uint32 value) {
|
||||
set_has_id();
|
||||
id_ = value;
|
||||
// @@protoc_insertion_point(field_set:Battlenet.BGSMethodOptions.id)
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
|
||||
@@ -20,6 +20,12 @@ namespace Battlenet {
|
||||
|
||||
namespace {
|
||||
|
||||
const ::google::protobuf::Descriptor* BGSServiceOptions_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
BGSServiceOptions_reflection_ = NULL;
|
||||
const ::google::protobuf::Descriptor* SDKServiceOptions_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
SDKServiceOptions_reflection_ = NULL;
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -30,6 +36,40 @@ void protobuf_AssignDesc_service_5foptions_2eproto() {
|
||||
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
|
||||
"service_options.proto");
|
||||
GOOGLE_CHECK(file != NULL);
|
||||
BGSServiceOptions_descriptor_ = file->message_type(0);
|
||||
static const int BGSServiceOptions_offsets_[3] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BGSServiceOptions, descriptor_name_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BGSServiceOptions, version_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BGSServiceOptions, shard_name_),
|
||||
};
|
||||
BGSServiceOptions_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
BGSServiceOptions_descriptor_,
|
||||
BGSServiceOptions::default_instance_,
|
||||
BGSServiceOptions_offsets_,
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BGSServiceOptions, _has_bits_[0]),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BGSServiceOptions, _unknown_fields_),
|
||||
-1,
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(BGSServiceOptions));
|
||||
SDKServiceOptions_descriptor_ = file->message_type(1);
|
||||
static const int SDKServiceOptions_offsets_[3] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDKServiceOptions, inbound_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDKServiceOptions, outbound_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDKServiceOptions, use_client_id_),
|
||||
};
|
||||
SDKServiceOptions_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
SDKServiceOptions_descriptor_,
|
||||
SDKServiceOptions::default_instance_,
|
||||
SDKServiceOptions_offsets_,
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDKServiceOptions, _has_bits_[0]),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDKServiceOptions, _unknown_fields_),
|
||||
-1,
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(SDKServiceOptions));
|
||||
}
|
||||
|
||||
namespace {
|
||||
@@ -42,11 +82,19 @@ inline void protobuf_AssignDescriptorsOnce() {
|
||||
|
||||
void protobuf_RegisterTypes(const ::std::string&) {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
BGSServiceOptions_descriptor_, &BGSServiceOptions::default_instance());
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
SDKServiceOptions_descriptor_, &SDKServiceOptions::default_instance());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void protobuf_ShutdownFile_service_5foptions_2eproto() {
|
||||
delete BGSServiceOptions::default_instance_;
|
||||
delete BGSServiceOptions_reflection_;
|
||||
delete SDKServiceOptions::default_instance_;
|
||||
delete SDKServiceOptions_reflection_;
|
||||
}
|
||||
|
||||
void protobuf_AddDesc_service_5foptions_2eproto() {
|
||||
@@ -58,19 +106,31 @@ void protobuf_AddDesc_service_5foptions_2eproto() {
|
||||
::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto();
|
||||
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
|
||||
"\n\025service_options.proto\022\tBattlenet\032 goog"
|
||||
"le/protobuf/descriptor.proto:R\n(original"
|
||||
"_fully_qualified_descriptor_name\022\037.googl"
|
||||
"e.protobuf.ServiceOptions\030\351\007 \001(\t:5\n\nserv"
|
||||
"ice_id\022\037.google.protobuf.ServiceOptions\030"
|
||||
"\320\206\003 \001(\rB\002H\002", 211);
|
||||
"le/protobuf/descriptor.proto\"Q\n\021BGSServi"
|
||||
"ceOptions\022\027\n\017descriptor_name\030\001 \001(\t\022\017\n\007ve"
|
||||
"rsion\030\004 \001(\r\022\022\n\nshard_name\030\005 \001(\t\"M\n\021SDKSe"
|
||||
"rviceOptions\022\017\n\007inbound\030\001 \001(\010\022\020\n\010outboun"
|
||||
"d\030\002 \001(\010\022\025\n\ruse_client_id\030\003 \001(\010:X\n\017servic"
|
||||
"e_options\022\037.google.protobuf.ServiceOptio"
|
||||
"ns\030\220\277\005 \001(\0132\034.Battlenet.BGSServiceOptions"
|
||||
":\\\n\023sdk_service_options\022\037.google.protobu"
|
||||
"f.ServiceOptions\030\221\277\005 \001(\0132\034.Battlenet.SDK"
|
||||
"ServiceOptionsB&\n\rbnet.protocolB\023Service"
|
||||
"OptionsProtoH\002", 454);
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
|
||||
"service_options.proto", &protobuf_RegisterTypes);
|
||||
::google::protobuf::internal::ExtensionSet::RegisterExtension(
|
||||
BGSServiceOptions::default_instance_ = new BGSServiceOptions();
|
||||
SDKServiceOptions::default_instance_ = new SDKServiceOptions();
|
||||
::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
|
||||
&::google::protobuf::ServiceOptions::default_instance(),
|
||||
1001, 9, false, false);
|
||||
::google::protobuf::internal::ExtensionSet::RegisterExtension(
|
||||
90000, 11, false, false,
|
||||
&::Battlenet::BGSServiceOptions::default_instance());
|
||||
::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
|
||||
&::google::protobuf::ServiceOptions::default_instance(),
|
||||
50000, 13, false, false);
|
||||
90001, 11, false, false,
|
||||
&::Battlenet::SDKServiceOptions::default_instance());
|
||||
BGSServiceOptions::default_instance_->InitAsDefaultInstance();
|
||||
SDKServiceOptions::default_instance_->InitAsDefaultInstance();
|
||||
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_service_5foptions_2eproto);
|
||||
}
|
||||
|
||||
@@ -80,13 +140,173 @@ struct StaticDescriptorInitializer_service_5foptions_2eproto {
|
||||
protobuf_AddDesc_service_5foptions_2eproto();
|
||||
}
|
||||
} static_descriptor_initializer_service_5foptions_2eproto_;
|
||||
const ::std::string original_fully_qualified_descriptor_name_default("");
|
||||
|
||||
// ===================================================================
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const int BGSServiceOptions::kDescriptorNameFieldNumber;
|
||||
const int BGSServiceOptions::kVersionFieldNumber;
|
||||
const int BGSServiceOptions::kShardNameFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
BGSServiceOptions::BGSServiceOptions()
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
// @@protoc_insertion_point(constructor:Battlenet.BGSServiceOptions)
|
||||
}
|
||||
|
||||
void BGSServiceOptions::InitAsDefaultInstance() {
|
||||
}
|
||||
|
||||
BGSServiceOptions::BGSServiceOptions(const BGSServiceOptions& from)
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
MergeFrom(from);
|
||||
// @@protoc_insertion_point(copy_constructor:Battlenet.BGSServiceOptions)
|
||||
}
|
||||
|
||||
void BGSServiceOptions::SharedCtor() {
|
||||
::google::protobuf::internal::GetEmptyString();
|
||||
_cached_size_ = 0;
|
||||
descriptor_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
||||
version_ = 0u;
|
||||
shard_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
BGSServiceOptions::~BGSServiceOptions() {
|
||||
// @@protoc_insertion_point(destructor:Battlenet.BGSServiceOptions)
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
void BGSServiceOptions::SharedDtor() {
|
||||
if (descriptor_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
delete descriptor_name_;
|
||||
}
|
||||
if (shard_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
delete shard_name_;
|
||||
}
|
||||
if (this != default_instance_) {
|
||||
}
|
||||
}
|
||||
|
||||
void BGSServiceOptions::SetCachedSize(int size) const {
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
}
|
||||
const ::google::protobuf::Descriptor* BGSServiceOptions::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return BGSServiceOptions_descriptor_;
|
||||
}
|
||||
|
||||
const BGSServiceOptions& BGSServiceOptions::default_instance() {
|
||||
if (default_instance_ == NULL) protobuf_AddDesc_service_5foptions_2eproto();
|
||||
return *default_instance_;
|
||||
}
|
||||
|
||||
BGSServiceOptions* BGSServiceOptions::default_instance_ = NULL;
|
||||
|
||||
BGSServiceOptions* BGSServiceOptions::New() const {
|
||||
return new BGSServiceOptions;
|
||||
}
|
||||
|
||||
void BGSServiceOptions::Swap(BGSServiceOptions* other) {
|
||||
if (other != this) {
|
||||
GetReflection()->Swap(this, other);}
|
||||
}
|
||||
|
||||
::google::protobuf::Metadata BGSServiceOptions::GetMetadata() const {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::Metadata metadata;
|
||||
metadata.descriptor = BGSServiceOptions_descriptor_;
|
||||
metadata.reflection = BGSServiceOptions_reflection_;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
|
||||
// ===================================================================
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const int SDKServiceOptions::kInboundFieldNumber;
|
||||
const int SDKServiceOptions::kOutboundFieldNumber;
|
||||
const int SDKServiceOptions::kUseClientIdFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
SDKServiceOptions::SDKServiceOptions()
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
// @@protoc_insertion_point(constructor:Battlenet.SDKServiceOptions)
|
||||
}
|
||||
|
||||
void SDKServiceOptions::InitAsDefaultInstance() {
|
||||
}
|
||||
|
||||
SDKServiceOptions::SDKServiceOptions(const SDKServiceOptions& from)
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
MergeFrom(from);
|
||||
// @@protoc_insertion_point(copy_constructor:Battlenet.SDKServiceOptions)
|
||||
}
|
||||
|
||||
void SDKServiceOptions::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
inbound_ = false;
|
||||
outbound_ = false;
|
||||
use_client_id_ = false;
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
SDKServiceOptions::~SDKServiceOptions() {
|
||||
// @@protoc_insertion_point(destructor:Battlenet.SDKServiceOptions)
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
void SDKServiceOptions::SharedDtor() {
|
||||
if (this != default_instance_) {
|
||||
}
|
||||
}
|
||||
|
||||
void SDKServiceOptions::SetCachedSize(int size) const {
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
}
|
||||
const ::google::protobuf::Descriptor* SDKServiceOptions::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return SDKServiceOptions_descriptor_;
|
||||
}
|
||||
|
||||
const SDKServiceOptions& SDKServiceOptions::default_instance() {
|
||||
if (default_instance_ == NULL) protobuf_AddDesc_service_5foptions_2eproto();
|
||||
return *default_instance_;
|
||||
}
|
||||
|
||||
SDKServiceOptions* SDKServiceOptions::default_instance_ = NULL;
|
||||
|
||||
SDKServiceOptions* SDKServiceOptions::New() const {
|
||||
return new SDKServiceOptions;
|
||||
}
|
||||
|
||||
void SDKServiceOptions::Swap(SDKServiceOptions* other) {
|
||||
if (other != this) {
|
||||
GetReflection()->Swap(this, other);}
|
||||
}
|
||||
|
||||
::google::protobuf::Metadata SDKServiceOptions::GetMetadata() const {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::Metadata metadata;
|
||||
metadata.descriptor = SDKServiceOptions_descriptor_;
|
||||
metadata.reflection = SDKServiceOptions_reflection_;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::ServiceOptions,
|
||||
::google::protobuf::internal::StringTypeTraits, 9, false >
|
||||
original_fully_qualified_descriptor_name(kOriginalFullyQualifiedDescriptorNameFieldNumber, original_fully_qualified_descriptor_name_default);
|
||||
::google::protobuf::internal::MessageTypeTraits< ::Battlenet::BGSServiceOptions >, 11, false >
|
||||
service_options(kServiceOptionsFieldNumber, ::Battlenet::BGSServiceOptions::default_instance());
|
||||
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::ServiceOptions,
|
||||
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 13, false >
|
||||
service_id(kServiceIdFieldNumber, 0u);
|
||||
::google::protobuf::internal::MessageTypeTraits< ::Battlenet::SDKServiceOptions >, 11, false >
|
||||
sdk_service_options(kSdkServiceOptionsFieldNumber, ::Battlenet::SDKServiceOptions::default_instance());
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
|
||||
@@ -20,8 +20,10 @@
|
||||
#endif
|
||||
|
||||
#include <google/protobuf/generated_message_util.h>
|
||||
#include <google/protobuf/message.h>
|
||||
#include <google/protobuf/repeated_field.h>
|
||||
#include <google/protobuf/extension_set.h>
|
||||
#include <google/protobuf/unknown_field_set.h>
|
||||
#include "google/protobuf/descriptor.pb.h"
|
||||
// @@protoc_insertion_point(includes)
|
||||
|
||||
@@ -32,23 +34,458 @@ void protobuf_AddDesc_service_5foptions_2eproto();
|
||||
void protobuf_AssignDesc_service_5foptions_2eproto();
|
||||
void protobuf_ShutdownFile_service_5foptions_2eproto();
|
||||
|
||||
class BGSServiceOptions;
|
||||
class SDKServiceOptions;
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class BGSServiceOptions : public ::google::protobuf::Message {
|
||||
public:
|
||||
BGSServiceOptions();
|
||||
virtual ~BGSServiceOptions();
|
||||
|
||||
BGSServiceOptions(const BGSServiceOptions& from);
|
||||
|
||||
inline BGSServiceOptions& operator=(const BGSServiceOptions& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const BGSServiceOptions& default_instance();
|
||||
|
||||
void Swap(BGSServiceOptions* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
BGSServiceOptions* New() const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// optional string descriptor_name = 1;
|
||||
inline bool has_descriptor_name() const;
|
||||
inline void clear_descriptor_name();
|
||||
static const int kDescriptorNameFieldNumber = 1;
|
||||
inline const ::std::string& descriptor_name() const;
|
||||
inline void set_descriptor_name(const ::std::string& value);
|
||||
inline void set_descriptor_name(const char* value);
|
||||
inline void set_descriptor_name(const char* value, size_t size);
|
||||
inline ::std::string* mutable_descriptor_name();
|
||||
inline ::std::string* release_descriptor_name();
|
||||
inline void set_allocated_descriptor_name(::std::string* descriptor_name);
|
||||
|
||||
// optional uint32 version = 4;
|
||||
inline bool has_version() const;
|
||||
inline void clear_version();
|
||||
static const int kVersionFieldNumber = 4;
|
||||
inline ::google::protobuf::uint32 version() const;
|
||||
inline void set_version(::google::protobuf::uint32 value);
|
||||
|
||||
// optional string shard_name = 5;
|
||||
inline bool has_shard_name() const;
|
||||
inline void clear_shard_name();
|
||||
static const int kShardNameFieldNumber = 5;
|
||||
inline const ::std::string& shard_name() const;
|
||||
inline void set_shard_name(const ::std::string& value);
|
||||
inline void set_shard_name(const char* value);
|
||||
inline void set_shard_name(const char* value, size_t size);
|
||||
inline ::std::string* mutable_shard_name();
|
||||
inline ::std::string* release_shard_name();
|
||||
inline void set_allocated_shard_name(::std::string* shard_name);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:Battlenet.BGSServiceOptions)
|
||||
private:
|
||||
inline void set_has_descriptor_name();
|
||||
inline void clear_has_descriptor_name();
|
||||
inline void set_has_version();
|
||||
inline void clear_has_version();
|
||||
inline void set_has_shard_name();
|
||||
inline void clear_has_shard_name();
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::google::protobuf::uint32 _has_bits_[1];
|
||||
mutable int _cached_size_;
|
||||
::std::string* descriptor_name_;
|
||||
::std::string* shard_name_;
|
||||
::google::protobuf::uint32 version_;
|
||||
friend void protobuf_AddDesc_service_5foptions_2eproto();
|
||||
friend void protobuf_AssignDesc_service_5foptions_2eproto();
|
||||
friend void protobuf_ShutdownFile_service_5foptions_2eproto();
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static BGSServiceOptions* default_instance_;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class SDKServiceOptions : public ::google::protobuf::Message {
|
||||
public:
|
||||
SDKServiceOptions();
|
||||
virtual ~SDKServiceOptions();
|
||||
|
||||
SDKServiceOptions(const SDKServiceOptions& from);
|
||||
|
||||
inline SDKServiceOptions& operator=(const SDKServiceOptions& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const SDKServiceOptions& default_instance();
|
||||
|
||||
void Swap(SDKServiceOptions* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
SDKServiceOptions* New() const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// optional bool inbound = 1;
|
||||
inline bool has_inbound() const;
|
||||
inline void clear_inbound();
|
||||
static const int kInboundFieldNumber = 1;
|
||||
inline bool inbound() const;
|
||||
inline void set_inbound(bool value);
|
||||
|
||||
// optional bool outbound = 2;
|
||||
inline bool has_outbound() const;
|
||||
inline void clear_outbound();
|
||||
static const int kOutboundFieldNumber = 2;
|
||||
inline bool outbound() const;
|
||||
inline void set_outbound(bool value);
|
||||
|
||||
// optional bool use_client_id = 3;
|
||||
inline bool has_use_client_id() const;
|
||||
inline void clear_use_client_id();
|
||||
static const int kUseClientIdFieldNumber = 3;
|
||||
inline bool use_client_id() const;
|
||||
inline void set_use_client_id(bool value);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:Battlenet.SDKServiceOptions)
|
||||
private:
|
||||
inline void set_has_inbound();
|
||||
inline void clear_has_inbound();
|
||||
inline void set_has_outbound();
|
||||
inline void clear_has_outbound();
|
||||
inline void set_has_use_client_id();
|
||||
inline void clear_has_use_client_id();
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::google::protobuf::uint32 _has_bits_[1];
|
||||
mutable int _cached_size_;
|
||||
bool inbound_;
|
||||
bool outbound_;
|
||||
bool use_client_id_;
|
||||
friend void protobuf_AddDesc_service_5foptions_2eproto();
|
||||
friend void protobuf_AssignDesc_service_5foptions_2eproto();
|
||||
friend void protobuf_ShutdownFile_service_5foptions_2eproto();
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static SDKServiceOptions* default_instance_;
|
||||
};
|
||||
// ===================================================================
|
||||
|
||||
static const int kOriginalFullyQualifiedDescriptorNameFieldNumber = 1001;
|
||||
static const int kServiceOptionsFieldNumber = 90000;
|
||||
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::ServiceOptions,
|
||||
::google::protobuf::internal::StringTypeTraits, 9, false >
|
||||
original_fully_qualified_descriptor_name;
|
||||
static const int kServiceIdFieldNumber = 50000;
|
||||
::google::protobuf::internal::MessageTypeTraits< ::Battlenet::BGSServiceOptions >, 11, false >
|
||||
service_options;
|
||||
static const int kSdkServiceOptionsFieldNumber = 90001;
|
||||
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::ServiceOptions,
|
||||
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 13, false >
|
||||
service_id;
|
||||
::google::protobuf::internal::MessageTypeTraits< ::Battlenet::SDKServiceOptions >, 11, false >
|
||||
sdk_service_options;
|
||||
|
||||
// ===================================================================
|
||||
|
||||
// BGSServiceOptions
|
||||
|
||||
// optional string descriptor_name = 1;
|
||||
inline bool BGSServiceOptions::has_descriptor_name() const {
|
||||
return (_has_bits_[0] & 0x00000001u) != 0;
|
||||
}
|
||||
inline void BGSServiceOptions::set_has_descriptor_name() {
|
||||
_has_bits_[0] |= 0x00000001u;
|
||||
}
|
||||
inline void BGSServiceOptions::clear_has_descriptor_name() {
|
||||
_has_bits_[0] &= ~0x00000001u;
|
||||
}
|
||||
inline void BGSServiceOptions::clear_descriptor_name() {
|
||||
if (descriptor_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
descriptor_name_->clear();
|
||||
}
|
||||
clear_has_descriptor_name();
|
||||
}
|
||||
inline const ::std::string& BGSServiceOptions::descriptor_name() const {
|
||||
// @@protoc_insertion_point(field_get:Battlenet.BGSServiceOptions.descriptor_name)
|
||||
return *descriptor_name_;
|
||||
}
|
||||
inline void BGSServiceOptions::set_descriptor_name(const ::std::string& value) {
|
||||
set_has_descriptor_name();
|
||||
if (descriptor_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
descriptor_name_ = new ::std::string;
|
||||
}
|
||||
descriptor_name_->assign(value);
|
||||
// @@protoc_insertion_point(field_set:Battlenet.BGSServiceOptions.descriptor_name)
|
||||
}
|
||||
inline void BGSServiceOptions::set_descriptor_name(const char* value) {
|
||||
set_has_descriptor_name();
|
||||
if (descriptor_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
descriptor_name_ = new ::std::string;
|
||||
}
|
||||
descriptor_name_->assign(value);
|
||||
// @@protoc_insertion_point(field_set_char:Battlenet.BGSServiceOptions.descriptor_name)
|
||||
}
|
||||
inline void BGSServiceOptions::set_descriptor_name(const char* value, size_t size) {
|
||||
set_has_descriptor_name();
|
||||
if (descriptor_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
descriptor_name_ = new ::std::string;
|
||||
}
|
||||
descriptor_name_->assign(reinterpret_cast<const char*>(value), size);
|
||||
// @@protoc_insertion_point(field_set_pointer:Battlenet.BGSServiceOptions.descriptor_name)
|
||||
}
|
||||
inline ::std::string* BGSServiceOptions::mutable_descriptor_name() {
|
||||
set_has_descriptor_name();
|
||||
if (descriptor_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
descriptor_name_ = new ::std::string;
|
||||
}
|
||||
// @@protoc_insertion_point(field_mutable:Battlenet.BGSServiceOptions.descriptor_name)
|
||||
return descriptor_name_;
|
||||
}
|
||||
inline ::std::string* BGSServiceOptions::release_descriptor_name() {
|
||||
clear_has_descriptor_name();
|
||||
if (descriptor_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
return NULL;
|
||||
} else {
|
||||
::std::string* temp = descriptor_name_;
|
||||
descriptor_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
inline void BGSServiceOptions::set_allocated_descriptor_name(::std::string* descriptor_name) {
|
||||
if (descriptor_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
delete descriptor_name_;
|
||||
}
|
||||
if (descriptor_name) {
|
||||
set_has_descriptor_name();
|
||||
descriptor_name_ = descriptor_name;
|
||||
} else {
|
||||
clear_has_descriptor_name();
|
||||
descriptor_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
// @@protoc_insertion_point(field_set_allocated:Battlenet.BGSServiceOptions.descriptor_name)
|
||||
}
|
||||
|
||||
// optional uint32 version = 4;
|
||||
inline bool BGSServiceOptions::has_version() const {
|
||||
return (_has_bits_[0] & 0x00000002u) != 0;
|
||||
}
|
||||
inline void BGSServiceOptions::set_has_version() {
|
||||
_has_bits_[0] |= 0x00000002u;
|
||||
}
|
||||
inline void BGSServiceOptions::clear_has_version() {
|
||||
_has_bits_[0] &= ~0x00000002u;
|
||||
}
|
||||
inline void BGSServiceOptions::clear_version() {
|
||||
version_ = 0u;
|
||||
clear_has_version();
|
||||
}
|
||||
inline ::google::protobuf::uint32 BGSServiceOptions::version() const {
|
||||
// @@protoc_insertion_point(field_get:Battlenet.BGSServiceOptions.version)
|
||||
return version_;
|
||||
}
|
||||
inline void BGSServiceOptions::set_version(::google::protobuf::uint32 value) {
|
||||
set_has_version();
|
||||
version_ = value;
|
||||
// @@protoc_insertion_point(field_set:Battlenet.BGSServiceOptions.version)
|
||||
}
|
||||
|
||||
// optional string shard_name = 5;
|
||||
inline bool BGSServiceOptions::has_shard_name() const {
|
||||
return (_has_bits_[0] & 0x00000004u) != 0;
|
||||
}
|
||||
inline void BGSServiceOptions::set_has_shard_name() {
|
||||
_has_bits_[0] |= 0x00000004u;
|
||||
}
|
||||
inline void BGSServiceOptions::clear_has_shard_name() {
|
||||
_has_bits_[0] &= ~0x00000004u;
|
||||
}
|
||||
inline void BGSServiceOptions::clear_shard_name() {
|
||||
if (shard_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
shard_name_->clear();
|
||||
}
|
||||
clear_has_shard_name();
|
||||
}
|
||||
inline const ::std::string& BGSServiceOptions::shard_name() const {
|
||||
// @@protoc_insertion_point(field_get:Battlenet.BGSServiceOptions.shard_name)
|
||||
return *shard_name_;
|
||||
}
|
||||
inline void BGSServiceOptions::set_shard_name(const ::std::string& value) {
|
||||
set_has_shard_name();
|
||||
if (shard_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
shard_name_ = new ::std::string;
|
||||
}
|
||||
shard_name_->assign(value);
|
||||
// @@protoc_insertion_point(field_set:Battlenet.BGSServiceOptions.shard_name)
|
||||
}
|
||||
inline void BGSServiceOptions::set_shard_name(const char* value) {
|
||||
set_has_shard_name();
|
||||
if (shard_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
shard_name_ = new ::std::string;
|
||||
}
|
||||
shard_name_->assign(value);
|
||||
// @@protoc_insertion_point(field_set_char:Battlenet.BGSServiceOptions.shard_name)
|
||||
}
|
||||
inline void BGSServiceOptions::set_shard_name(const char* value, size_t size) {
|
||||
set_has_shard_name();
|
||||
if (shard_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
shard_name_ = new ::std::string;
|
||||
}
|
||||
shard_name_->assign(reinterpret_cast<const char*>(value), size);
|
||||
// @@protoc_insertion_point(field_set_pointer:Battlenet.BGSServiceOptions.shard_name)
|
||||
}
|
||||
inline ::std::string* BGSServiceOptions::mutable_shard_name() {
|
||||
set_has_shard_name();
|
||||
if (shard_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
shard_name_ = new ::std::string;
|
||||
}
|
||||
// @@protoc_insertion_point(field_mutable:Battlenet.BGSServiceOptions.shard_name)
|
||||
return shard_name_;
|
||||
}
|
||||
inline ::std::string* BGSServiceOptions::release_shard_name() {
|
||||
clear_has_shard_name();
|
||||
if (shard_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
return NULL;
|
||||
} else {
|
||||
::std::string* temp = shard_name_;
|
||||
shard_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
inline void BGSServiceOptions::set_allocated_shard_name(::std::string* shard_name) {
|
||||
if (shard_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
|
||||
delete shard_name_;
|
||||
}
|
||||
if (shard_name) {
|
||||
set_has_shard_name();
|
||||
shard_name_ = shard_name;
|
||||
} else {
|
||||
clear_has_shard_name();
|
||||
shard_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
||||
}
|
||||
// @@protoc_insertion_point(field_set_allocated:Battlenet.BGSServiceOptions.shard_name)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// SDKServiceOptions
|
||||
|
||||
// optional bool inbound = 1;
|
||||
inline bool SDKServiceOptions::has_inbound() const {
|
||||
return (_has_bits_[0] & 0x00000001u) != 0;
|
||||
}
|
||||
inline void SDKServiceOptions::set_has_inbound() {
|
||||
_has_bits_[0] |= 0x00000001u;
|
||||
}
|
||||
inline void SDKServiceOptions::clear_has_inbound() {
|
||||
_has_bits_[0] &= ~0x00000001u;
|
||||
}
|
||||
inline void SDKServiceOptions::clear_inbound() {
|
||||
inbound_ = false;
|
||||
clear_has_inbound();
|
||||
}
|
||||
inline bool SDKServiceOptions::inbound() const {
|
||||
// @@protoc_insertion_point(field_get:Battlenet.SDKServiceOptions.inbound)
|
||||
return inbound_;
|
||||
}
|
||||
inline void SDKServiceOptions::set_inbound(bool value) {
|
||||
set_has_inbound();
|
||||
inbound_ = value;
|
||||
// @@protoc_insertion_point(field_set:Battlenet.SDKServiceOptions.inbound)
|
||||
}
|
||||
|
||||
// optional bool outbound = 2;
|
||||
inline bool SDKServiceOptions::has_outbound() const {
|
||||
return (_has_bits_[0] & 0x00000002u) != 0;
|
||||
}
|
||||
inline void SDKServiceOptions::set_has_outbound() {
|
||||
_has_bits_[0] |= 0x00000002u;
|
||||
}
|
||||
inline void SDKServiceOptions::clear_has_outbound() {
|
||||
_has_bits_[0] &= ~0x00000002u;
|
||||
}
|
||||
inline void SDKServiceOptions::clear_outbound() {
|
||||
outbound_ = false;
|
||||
clear_has_outbound();
|
||||
}
|
||||
inline bool SDKServiceOptions::outbound() const {
|
||||
// @@protoc_insertion_point(field_get:Battlenet.SDKServiceOptions.outbound)
|
||||
return outbound_;
|
||||
}
|
||||
inline void SDKServiceOptions::set_outbound(bool value) {
|
||||
set_has_outbound();
|
||||
outbound_ = value;
|
||||
// @@protoc_insertion_point(field_set:Battlenet.SDKServiceOptions.outbound)
|
||||
}
|
||||
|
||||
// optional bool use_client_id = 3;
|
||||
inline bool SDKServiceOptions::has_use_client_id() const {
|
||||
return (_has_bits_[0] & 0x00000004u) != 0;
|
||||
}
|
||||
inline void SDKServiceOptions::set_has_use_client_id() {
|
||||
_has_bits_[0] |= 0x00000004u;
|
||||
}
|
||||
inline void SDKServiceOptions::clear_has_use_client_id() {
|
||||
_has_bits_[0] &= ~0x00000004u;
|
||||
}
|
||||
inline void SDKServiceOptions::clear_use_client_id() {
|
||||
use_client_id_ = false;
|
||||
clear_has_use_client_id();
|
||||
}
|
||||
inline bool SDKServiceOptions::use_client_id() const {
|
||||
// @@protoc_insertion_point(field_get:Battlenet.SDKServiceOptions.use_client_id)
|
||||
return use_client_id_;
|
||||
}
|
||||
inline void SDKServiceOptions::set_use_client_id(bool value) {
|
||||
set_has_use_client_id();
|
||||
use_client_id_ = value;
|
||||
// @@protoc_insertion_point(field_set:Battlenet.SDKServiceOptions.use_client_id)
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
|
||||
@@ -1095,9 +1095,12 @@ DROP TABLE IF EXISTS `character_pvp_talent`;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_pvp_talent` (
|
||||
`guid` bigint(20) unsigned NOT NULL,
|
||||
`talentId` mediumint(8) unsigned NOT NULL,
|
||||
`talentId0` int(10) unsigned NOT NULL,
|
||||
`talentId1` int(10) unsigned NOT NULL,
|
||||
`talentId2` int(10) unsigned NOT NULL,
|
||||
`talentId3` int(10) unsigned NOT NULL,
|
||||
`talentGroup` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`guid`,`talentId`,`talentGroup`)
|
||||
PRIMARY KEY (`guid`,`talentGroup`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
@@ -1731,7 +1734,6 @@ CREATE TABLE `characters` (
|
||||
`deleteDate` int(10) unsigned DEFAULT NULL,
|
||||
`honor` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`honorLevel` int(10) unsigned NOT NULL DEFAULT '1',
|
||||
`prestigeLevel` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`honorRestState` tinyint(3) unsigned NOT NULL DEFAULT '2',
|
||||
`honorRestBonus` float NOT NULL DEFAULT '0',
|
||||
`lastLoginBuild` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
@@ -3566,7 +3568,10 @@ INSERT INTO `updates` VALUES
|
||||
('2018_03_04_00_characters.sql','2A4CD2EE2547E718490706FADC78BF36F0DED8D6','RELEASED','2018-03-04 18:15:24',0),
|
||||
('2018_04_28_00_characters.sql','CBD0FDC0F32DE3F456F7CE3D9CAD6933CD6A50F5','RELEASED','2018-04-28 12:44:09',0),
|
||||
('2018_07_28_00_characters.sql','31F66AE7831251A8915625EC7F10FA138AB8B654','RELEASED','2018-07-28 18:30:19',0),
|
||||
('2018_07_31_00_characters.sql','7DA8D4A4534520B23E6F5BBD5B8EE205B799C798','RELEASED','2018-07-31 20:54:39',0);
|
||||
('2018_07_31_00_characters.sql','7DA8D4A4534520B23E6F5BBD5B8EE205B799C798','RELEASED','2018-07-31 20:54:39',0),
|
||||
('2018_12_09_00_characters.sql','7FE9641C93ED762597C08F1E9B6649C9EC2F0E47','RELEASED','2018-09-18 23:34:29',0),
|
||||
('2018_12_09_01_characters.sql','C80B936AAD94C58A0F33382CED08CFB4E0B6AC34','RELEASED','2018-10-10 22:05:28',0),
|
||||
('2018_12_09_02_characters.sql','DBBA0C06985CE8AC4E6E7E94BD6B2673E9ADFAE2','RELEASED','2018-12-02 17:32:31',0);
|
||||
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
TRUNCATE `character_pvp_talent`;
|
||||
ALTER TABLE `character_pvp_talent`
|
||||
DROP PRIMARY KEY,
|
||||
CHANGE `talentId` `talentId0` int(10) unsigned NOT NULL AFTER `guid`,
|
||||
ADD `talentId1` int(10) unsigned NOT NULL AFTER `talentId0`,
|
||||
ADD `talentId2` int(10) unsigned NOT NULL AFTER `talentId1`,
|
||||
ADD `talentId3` int(10) unsigned NOT NULL AFTER `talentId2`,
|
||||
ADD PRIMARY KEY(`guid`,`talentGroup`);
|
||||
@@ -0,0 +1,32 @@
|
||||
DROP TABLE IF EXISTS `total_honor_at_honor_level`;
|
||||
CREATE TABLE `total_honor_at_honor_level` (
|
||||
`HonorLevel` int(10) UNSIGNED NOT NULL,
|
||||
`Prestige0` int(10) UNSIGNED NOT NULL,
|
||||
`Prestige1` int(10) UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (`HonorLevel`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `total_honor_at_honor_level` VALUES
|
||||
(0,0,0),(1,350,800),(2,700,1600),(3,1050,2400),(4,1400,3200),
|
||||
(5,1750,4000),(6,2100,4800),(7,2450,5600),(8,2800,6400),(9,3150,7200),
|
||||
(10,3500,8000),(11,3900,8850),(12,4300,9700),(13,4700,10550),(14,5100,11400),
|
||||
(15,5500,12250),(16,5900,13100),(17,6300,13950),(18,6700,14800),(19,7100,15650),
|
||||
(20,7500,16500),(21,7950,17400),(22,8400,18300),(23,8850,19200),(24,9300,20100),
|
||||
(25,9750,21000),(26,10200,21900),(27,10650,22800),(28,11100,23700),(29,11550,24600),
|
||||
(30,12000,25500),(31,12500,26450),(32,13000,27400),(33,13500,28350),(34,14000,29300),
|
||||
(35,14500,30250),(36,15000,31200),(37,15500,32150),(38,16000,33100),(39,16500,34050),
|
||||
(40,17000,35000),(41,17550,36000),(42,18100,37000),(43,18650,38000),(44,19200,39000),
|
||||
(45,19750,40000),(46,20300,41000),(47,20850,42000),(48,21400,43000),(49,21950,44000);
|
||||
|
||||
-- first compensate for prestige levels above first
|
||||
UPDATE `characters` SET `honor`=`honor`+44000*(`prestigeLevel`-1) WHERE `prestigeLevel`>0;
|
||||
-- compensate for honor levels in prestige for characters above first prestige
|
||||
UPDATE `characters` SET `honor`=`honor`+(SELECT th.`Prestige1` FROM `total_honor_at_honor_level` th WHERE th.`HonorLevel`=(`characters`.`honorLevel`-1)) WHERE `prestigeLevel`>0;
|
||||
-- compensate for honor levels in first prestige level
|
||||
UPDATE `characters` SET `honor`=`honor`+(SELECT th.`Prestige0` FROM `total_honor_at_honor_level` th WHERE th.`HonorLevel`=(`characters`.`honorLevel`-1)) WHERE `prestigeLevel`=0;
|
||||
|
||||
-- reset honor levels, will be recalculated from refunded honor at first login (and grant achievements)
|
||||
UPDATE `characters` SET `honorLevel`=1;
|
||||
|
||||
ALTER TABLE `characters` DROP `prestigeLevel`;
|
||||
DROP TABLE IF EXISTS `total_honor_at_honor_level`;
|
||||
@@ -0,0 +1,135 @@
|
||||
--
|
||||
-- Table structure for table `profession_skill_migration_data`
|
||||
--
|
||||
DROP TABLE IF EXISTS `profession_skill_migration_data`;
|
||||
CREATE TABLE `profession_skill_migration_data` (
|
||||
`SkillID` int(10) unsigned,
|
||||
`ParentSkillLineID` int(10) unsigned,
|
||||
`MaxValue` int(10) unsigned,
|
||||
`NewMaxValue` int(10) unsigned,
|
||||
`SpellID_A` int(10) unsigned,
|
||||
`SpellID_H` int(10) unsigned,
|
||||
PRIMARY KEY (`SkillID`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
--
|
||||
-- Dumping data for table `profession_skill_migration_data`
|
||||
--
|
||||
INSERT INTO `profession_skill_migration_data` VALUES
|
||||
(2437,164,900,150,264448,265803),
|
||||
(2454,164,800,100,264446,264446),
|
||||
(2472,164,700,100,264444,264444),
|
||||
(2473,164,600,75,264442,264442),
|
||||
(2474,164,525,75,264440,264440),
|
||||
(2475,164,450,75,264438,264438),
|
||||
(2476,164,375,75,264436,264436),
|
||||
(2477,164,300,300,264434,264434),
|
||||
(2478,171,900,150,264255,265787),
|
||||
(2479,171,800,100,264250,264250),
|
||||
(2480,171,700,100,264247,264247),
|
||||
(2481,171,600,75,264245,264245),
|
||||
(2482,171,525,75,264243,264243),
|
||||
(2483,171,450,75,264220,264220),
|
||||
(2484,171,375,75,264213,264213),
|
||||
(2485,171,300,300,264211,264211),
|
||||
(2486,333,900,150,264473,265805),
|
||||
(2487,333,800,100,264471,264471),
|
||||
(2488,333,700,100,264469,264469),
|
||||
(2489,333,600,75,264467,264467),
|
||||
(2491,333,525,75,264464,264464),
|
||||
(2492,333,450,75,264462,264462),
|
||||
(2493,333,375,75,264460,264460),
|
||||
(2494,333,300,300,264455,264455),
|
||||
(2499,202,900,150,264492,265807),
|
||||
(2500,202,800,100,264490,264490),
|
||||
(2501,202,700,100,264487,264487),
|
||||
(2502,202,600,75,264485,264485),
|
||||
(2503,202,525,75,264483,264483),
|
||||
(2504,202,450,75,264481,264481),
|
||||
(2505,202,375,75,264479,264479),
|
||||
(2506,202,300,300,264475,264475),
|
||||
(2507,773,900,150,264508,265809),
|
||||
(2508,773,800,100,264506,264506),
|
||||
(2509,773,700,100,264504,264504),
|
||||
(2510,773,600,75,264502,264502),
|
||||
(2511,773,525,75,264500,264500),
|
||||
(2512,773,450,75,264498,264498),
|
||||
(2513,773,375,75,264496,264496),
|
||||
(2514,773,300,300,264494,264494),
|
||||
(2517,755,900,150,264548,265811),
|
||||
(2518,755,800,100,264546,264546),
|
||||
(2519,755,700,100,264544,264544),
|
||||
(2520,755,600,75,264542,264542),
|
||||
(2521,755,525,75,264539,264539),
|
||||
(2522,755,450,75,264537,264537),
|
||||
(2523,755,375,75,264534,264534),
|
||||
(2524,755,300,300,264532,264532),
|
||||
(2525,165,900,150,264592,265813),
|
||||
(2526,165,800,100,264590,264590),
|
||||
(2527,165,700,100,264588,264588),
|
||||
(2528,165,600,75,264585,264585),
|
||||
(2529,165,525,75,264583,264583),
|
||||
(2530,165,450,75,264581,264581),
|
||||
(2531,165,375,75,264579,264579),
|
||||
(2532,165,300,300,264577,264577),
|
||||
(2533,197,900,150,264630,265815),
|
||||
(2534,197,800,100,264628,264628),
|
||||
(2535,197,700,100,264626,264626),
|
||||
(2536,197,600,75,264624,264624),
|
||||
(2537,197,525,75,264622,264622),
|
||||
(2538,197,450,75,264620,264620),
|
||||
(2539,197,375,75,264618,264618),
|
||||
(2540,197,300,300,264616,264616),
|
||||
(2541,185,825,150,264646,265817),
|
||||
(2542,185,750,100,264644,264644),
|
||||
(2543,185,700,100,264642,264642),
|
||||
(2544,185,600,75,264640,264640),
|
||||
(2545,185,525,75,264638,264638),
|
||||
(2546,185,450,75,264636,264636),
|
||||
(2547,185,375,75,264634,264634),
|
||||
(2548,185,300,300,264632,264632),
|
||||
(2549,182,900,150,265831,265835),
|
||||
(2550,182,800,100,265834,265834),
|
||||
(2551,182,700,100,265829,265829),
|
||||
(2552,182,600,75,265827,265827),
|
||||
(2553,182,525,75,265825,265825),
|
||||
(2554,182,450,75,265823,265823),
|
||||
(2555,182,375,75,265821,265821),
|
||||
(2556,182,300,300,265819,265819),
|
||||
(2557,393,900,150,265869,265871),
|
||||
(2558,393,800,100,265867,265867),
|
||||
(2559,393,700,100,265865,265865),
|
||||
(2560,393,600,75,265863,265863),
|
||||
(2561,393,525,75,265861,265861),
|
||||
(2562,393,450,75,265859,265859),
|
||||
(2563,393,375,75,265857,265857),
|
||||
(2564,393,300,300,265855,265855),
|
||||
(2565,186,900,150,265851,265853),
|
||||
(2566,186,800,100,265849,265849),
|
||||
(2567,186,700,100,265847,265847),
|
||||
(2568,186,600,75,265845,265845),
|
||||
(2569,186,525,75,265843,265843),
|
||||
(2570,186,450,75,265841,265841),
|
||||
(2571,186,375,75,265839,265839),
|
||||
(2572,186,300,300,265837,265837),
|
||||
(2585,356,825,150,271675,271677),
|
||||
(2586,356,750,100,271672,271672),
|
||||
(2587,356,700,100,271664,271664),
|
||||
(2588,356,600,75,271662,271662),
|
||||
(2589,356,525,75,271660,271660),
|
||||
(2590,356,450,75,271658,271658),
|
||||
(2591,356,375,75,271656,271656),
|
||||
(2592,356,300,300,271616,271616);
|
||||
|
||||
INSERT IGNORE INTO `character_spell`
|
||||
SELECT cs.`guid`, IF(c.`race` IN (1,3,4,7,11,22,25,29,30,34), psmd.`SpellID_A`, psmd.`SpellID_H`), 1, 0
|
||||
FROM `profession_skill_migration_data` psmd
|
||||
INNER JOIN `character_skills` cs ON psmd.`ParentSkillLineID` = cs.`skill` AND psmd.`MaxValue` <= cs.`max`
|
||||
INNER JOIN `characters` c ON cs.`guid` = c.`guid`;
|
||||
|
||||
INSERT IGNORE INTO `character_skills`
|
||||
SELECT cs.`guid`, psmd.`SkillID`, CASE WHEN psmd.`MaxValue` < cs.`value` THEN psmd.`NewMaxValue` WHEN psmd.`MaxValue` - cs.`value` < psmd.`NewMaxValue` THEN psmd.`NewMaxValue` + cs.`value` - psmd.`MaxValue` ELSE 1 END, psmd.`NewMaxValue`
|
||||
FROM `profession_skill_migration_data` psmd
|
||||
INNER JOIN `character_skills` cs ON psmd.`ParentSkillLineID` = cs.`skill` AND psmd.`MaxValue` <= cs.`max`;
|
||||
|
||||
DROP TABLE IF EXISTS `profession_skill_migration_data`;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
--
|
||||
-- Table structure for table `animation_data`
|
||||
--
|
||||
DROP TABLE IF EXISTS `animation_data`;
|
||||
CREATE TABLE `animation_data` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`Fallback` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`BehaviorTier` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`BehaviorID` int(11) NOT NULL DEFAULT '0',
|
||||
`Flags1` int(11) NOT NULL DEFAULT '0',
|
||||
`Flags2` int(11) NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `num_talents_at_level`
|
||||
--
|
||||
DROP TABLE IF EXISTS `num_talents_at_level`;
|
||||
CREATE TABLE `num_talents_at_level` (
|
||||
`ID` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`NumTalents` int(11) NOT NULL DEFAULT '0',
|
||||
`NumTalentsDeathKnight` int(11) NOT NULL DEFAULT '0',
|
||||
`NumTalentsDemonHunter` int(11) NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(6) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
@@ -0,0 +1,10 @@
|
||||
--
|
||||
-- Table structure for table `hotfix_blob`
|
||||
--
|
||||
DROP TABLE IF EXISTS `hotfix_blob`;
|
||||
CREATE TABLE `hotfix_blob` (
|
||||
`TableHash` INT(10) UNSIGNED NOT NULL,
|
||||
`RecordId` INT(11) NOT NULL,
|
||||
`Blob` BLOB,
|
||||
PRIMARY KEY (`TableHash`,`RecordId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
@@ -0,0 +1,13 @@
|
||||
ALTER TABLE `terrain_worldmap`
|
||||
DROP PRIMARY KEY,
|
||||
ADD `UiMapPhaseId` int(10) unsigned NOT NULL AFTER `TerrainSwapMap`;
|
||||
|
||||
DELETE FROM `terrain_worldmap` WHERE `TerrainSwapMap`=638;
|
||||
UPDATE `terrain_worldmap` SET `UiMapPhaseId`=52 WHERE `TerrainSwapMap`=655;
|
||||
UPDATE `terrain_worldmap` SET `UiMapPhaseId`=54 WHERE `TerrainSwapMap`=656;
|
||||
UPDATE `terrain_worldmap` SET `UiMapPhaseId`=165 WHERE `TerrainSwapMap`=719;
|
||||
UPDATE `terrain_worldmap` SET `UiMapPhaseId`=2801 WHERE `TerrainSwapMap`=545;
|
||||
|
||||
ALTER TABLE `terrain_worldmap`
|
||||
ADD PRIMARY KEY(`TerrainSwapMap`,`UiMapPhaseId`),
|
||||
DROP `WorldMapArea`;
|
||||
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE `mail_level_reward` CHANGE `raceMask` `raceMask` bigint(20) unsigned NOT NULL;
|
||||
ALTER TABLE `playercreateinfo_spell_custom` CHANGE `racemask` `racemask` bigint(20) unsigned NOT NULL;
|
||||
ALTER TABLE `playercreateinfo_cast_spell` CHANGE `raceMask` `raceMask` bigint(20) unsigned NOT NULL;
|
||||
ALTER TABLE `spell_area` CHANGE `racemask` `racemask` bigint(20) unsigned NOT NULL;
|
||||
@@ -0,0 +1,104 @@
|
||||
ALTER TABLE `conversation_template` ADD `TextureKitId` int(10) unsigned NOT NULL DEFAULT '0' AFTER `LastLineEndTime`;
|
||||
ALTER TABLE `gameobject_template` ADD `Data33` int(11) NOT NULL DEFAULT '0' AFTER `Data32`;
|
||||
ALTER TABLE `playerchoice` ADD `KeepOpenAfterChoice` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `HideWarboardHeader`;
|
||||
ALTER TABLE `playerchoice_response`
|
||||
ADD `Flags` int(11) NOT NULL DEFAULT '0' AFTER `ChoiceArtFileId`,
|
||||
ADD `WidgetSetID` int(10) unsigned NOT NULL DEFAULT '0' AFTER `Flags`,
|
||||
ADD `GroupID` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `WidgetSetID`;
|
||||
|
||||
ALTER TABLE `quest_poi`
|
||||
ADD `UiMapID` int(11) DEFAULT NULL AFTER `MapID`,
|
||||
CHANGE `WoDUnk1` `SpawnTrackingID` int(11) NOT NULL DEFAULT '0' AFTER `PlayerConditionID`;
|
||||
|
||||
ALTER TABLE `quest_template`
|
||||
ADD `ScalingFactionGroup` int(11) NOT NULL DEFAULT '0' AFTER `QuestLevel`,
|
||||
ADD `FlagsEx2` int(10) unsigned NOT NULL DEFAULT '0' AFTER `FlagsEx`,
|
||||
ADD `PortraitGiverMount` int(11) NOT NULL DEFAULT '0' AFTER `PortraitGiver`,
|
||||
CHANGE `QuestRewardID` `TreasurePickerID` int(11) NOT NULL DEFAULT '0' AFTER `AllowableRaces`;
|
||||
|
||||
ALTER TABLE `scenario_poi` ADD `UiMapID` int(11) DEFAULT NULL AFTER `MapID`;
|
||||
|
||||
DROP TABLE IF EXISTS `world_map_area_to_ui_map`;
|
||||
CREATE TABLE `world_map_area_to_ui_map` (
|
||||
`WorldMapAreaID` int(11) NOT NULL,
|
||||
`Floor` int(11) NOT NULL,
|
||||
`UiMapID` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`WorldMapAreaID`,`Floor`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
INSERT INTO `world_map_area_to_ui_map` VALUES
|
||||
(4,0,1),(4,8,2),(4,10,3),(4,11,4),(4,12,5),(4,19,6),(9,0,7),(9,6,8),(9,7,9),(11,0,10),(11,20,11),(13,0,12),(14,0,13),(16,0,14),(17,0,15),(17,18,16),(19,0,17),(20,0,18),(20,13,19),(20,25,20),
|
||||
(21,0,21),(22,0,22),(23,0,23),(23,20,24),(24,0,25),(26,0,26),(27,0,27),(27,6,28),(27,7,29),(27,10,30),(27,11,31),(28,0,32),(28,14,33),(28,15,34),(28,16,35),(29,0,36),(30,0,37),(30,1,38),(30,2,39),(30,19,40),
|
||||
(30,21,41),(32,0,42),(32,22,43),(32,23,44),(32,24,45),(32,27,46),(34,0,47),(35,0,48),(36,0,49),(37,0,50),(38,0,51),(39,0,52),(39,4,53),(39,5,54),(39,17,55),(40,0,56),(41,0,57),(41,2,58),(41,3,59),(41,4,60),
|
||||
(41,5,61),(42,0,62),(43,0,63),(61,0,64),(81,0,65),(101,0,66),(101,21,67),(101,22,68),(121,0,69),(141,0,70),(161,0,71),(161,15,72),(161,16,73),(161,17,74),(161,18,75),(181,0,76),(182,0,77),(201,0,78),(201,14,79),(241,0,80),
|
||||
(261,0,81),(261,13,82),(281,0,83),(301,0,84),(321,0,85),(321,1,86),(341,0,87),(362,0,88),(381,0,89),(382,0,90),(401,0,91),(443,0,92),(461,0,93),(462,0,94),(463,0,95),(463,1,96),(464,0,97),(464,2,98),(464,3,99),(465,0,100),
|
||||
(466,0,101),(467,0,102),(471,0,103),(473,0,104),(475,0,105),(476,0,106),(477,0,107),(478,0,108),(479,0,109),(480,0,110),(481,0,111),(482,0,112),(485,0,113),(486,0,114),(488,0,115),(490,0,116),(491,0,117),(492,0,118),(493,0,119),(495,0,120),
|
||||
(496,0,121),(499,0,122),(501,0,123),(502,0,124),(504,1,125),(504,2,126),(510,0,127),(512,0,128),(520,1,129),(521,0,130),(521,1,131),(522,1,132),(523,1,133),(523,2,134),(523,3,135),(524,1,136),(524,2,137),(525,1,138),(525,2,139),(526,1,140),
|
||||
(527,1,141),(528,0,142),(528,1,143),(528,2,144),(528,3,145),(528,4,146),(529,0,147),(529,1,148),(529,2,149),(529,3,150),(529,4,151),(529,5,152),(530,0,153),(530,1,154),(531,0,155),(532,1,156),(533,1,157),(533,2,158),(533,3,159),(534,1,160),
|
||||
(534,2,161),(535,1,162),(535,2,163),(535,3,164),(535,4,165),(535,5,166),(535,6,167),(536,1,168),(540,0,169),(541,0,170),(542,1,171),(543,1,172),(543,2,173),(544,0,174),(544,1,175),(544,2,176),(544,3,177),(544,4,178),(545,0,179),(545,1,180),
|
||||
(545,2,181),(545,3,182),(601,1,183),(602,0,184),(603,1,185),(604,1,186),(604,2,187),(604,3,188),(604,4,189),(604,5,190),(604,6,191),(604,7,192),(604,8,193),(605,0,194),(605,5,195),(605,6,196),(605,7,197),(606,0,198),(607,0,199),(609,0,200),
|
||||
(610,0,201),(611,0,202),(613,0,203),(614,0,204),(615,0,205),(626,0,206),(640,0,207),(640,1,208),(640,2,209),(673,0,210),(680,1,213),(684,0,217),(685,0,218),(686,0,219),(687,1,220),(688,1,221),(688,2,222),(688,3,223),(689,0,224),(690,1,225),
|
||||
(691,1,226),(691,2,227),(691,3,228),(691,4,229),(692,1,230),(692,2,231),(696,1,232),(697,0,233),(699,0,234),(699,1,235),(699,2,236),(699,3,237),(699,4,238),(699,5,239),(699,6,240),(700,0,241),(704,1,242),(704,2,243),(708,0,244),(709,0,245),
|
||||
(710,1,246),(717,0,247),(718,1,248),(720,0,249),(721,1,250),(721,2,251),(721,3,252),(721,4,253),(721,5,254),(721,6,255),(722,1,256),(722,2,257),(723,1,258),(723,2,259),(724,1,260),(725,1,261),(726,1,262),(727,1,263),(727,2,264),(728,1,265),
|
||||
(729,1,266),(730,1,267),(730,2,268),(731,1,269),(731,2,270),(731,3,271),(732,1,272),(733,0,273),(734,0,274),(736,0,275),(737,0,276),(747,0,277),(749,1,279),(750,1,280),(750,2,281),(752,1,282),(753,1,283),(753,2,284),(754,1,285),(754,2,286),
|
||||
(755,1,287),(755,2,288),(755,3,289),(755,4,290),(756,1,291),(756,2,292),(757,1,293),(758,1,294),(758,2,295),(758,3,296),(759,1,297),(759,2,298),(759,3,299),(760,1,300),(761,1,301),(762,1,302),(762,2,303),(762,3,304),(762,4,305),(763,1,306),
|
||||
(763,2,307),(763,3,308),(763,4,309),(764,1,310),(764,2,311),(764,3,312),(764,4,313),(764,5,314),(764,6,315),(764,7,316),(765,1,317),(765,2,318),(766,1,319),(766,2,320),(766,3,321),(767,1,322),(767,2,323),(768,1,324),(769,1,325),(772,0,327),
|
||||
(773,1,328),(775,0,329),(776,1,330),(779,1,331),(780,1,332),(781,0,333),(782,1,334),(789,0,335),(789,1,336),(793,0,337),(795,0,338),(796,0,339),(796,1,340),(796,2,341),(796,3,342),(796,4,343),(796,5,344),(796,6,345),(796,7,346),(797,1,347),
|
||||
(798,1,348),(798,2,349),(799,1,350),(799,2,351),(799,3,352),(799,4,353),(799,5,354),(799,6,355),(799,7,356),(799,8,357),(799,9,358),(799,10,359),(799,11,360),(799,12,361),(799,13,362),(799,14,363),(799,15,364),(799,16,365),(799,17,366),(800,0,367),
|
||||
(800,1,368),(800,2,369),(803,1,370),(806,0,371),(806,6,372),(806,7,373),(806,15,374),(806,16,375),(807,0,376),(807,14,377),(808,0,378),(809,0,379),(809,8,380),(809,9,381),(809,10,382),(809,11,383),(809,12,384),(809,17,385),(809,20,386),(809,21,387),
|
||||
(810,0,388),(810,13,389),(811,0,390),(811,1,391),(811,2,392),(811,3,393),(811,4,394),(811,18,395),(811,19,396),(813,0,397),(816,0,398),(819,0,399),(819,1,400),(820,0,401),(820,1,402),(820,2,403),(820,3,404),(820,4,405),(820,5,406),(823,0,407),
|
||||
(823,1,408),(824,0,409),(824,1,410),(824,2,411),(824,3,412),(824,4,413),(824,5,414),(824,6,415),(851,0,416),(856,0,417),(857,0,418),(857,1,419),(857,2,420),(857,3,421),(858,0,422),(860,1,423),(862,0,424),(864,0,425),(864,3,426),(866,0,427),
|
||||
(866,9,428),(867,1,429),(867,2,430),(871,1,431),(871,2,432),(873,0,433),(873,5,434),(874,1,435),(874,2,436),(875,1,437),(875,2,438),(876,1,439),(876,2,440),(876,3,441),(876,4,442),(877,0,443),(877,1,444),(877,2,445),(877,3,446),(878,0,447),
|
||||
(880,0,448),(881,0,449),(882,0,450),(883,0,451),(884,0,452),(885,1,453),(885,2,454),(885,3,455),(886,0,456),(887,0,457),(887,1,458),(887,2,459),(888,0,460),(889,0,461),(890,0,462),(891,0,463),(891,9,464),(892,0,465),(892,12,466),(893,0,467),
|
||||
(894,0,468),(895,0,469),(895,8,470),(896,1,471),(896,2,472),(896,3,473),(897,1,474),(897,2,475),(898,1,476),(898,2,477),(898,3,478),(898,4,479),(899,1,480),(900,1,481),(900,2,482),(906,0,483),(911,0,486),(912,0,487),(914,0,488),(914,1,489),
|
||||
(919,0,490),(919,1,491),(919,2,492),(919,3,493),(919,4,494),(919,5,495),(919,6,496),(919,7,497),(920,0,498),(922,1,499),(922,2,500),(924,1,501),(924,2,502),(925,1,503),(928,0,504),(928,1,505),(928,2,506),(929,0,507),(930,1,508),(930,2,509),
|
||||
(930,3,510),(930,4,511),(930,5,512),(930,6,513),(930,7,514),(930,8,515),(933,0,516),(933,1,517),(934,1,518),(935,0,519),(937,0,520),(937,1,521),(938,1,522),(939,0,523),(940,0,524),(941,0,525),(941,1,526),(941,2,527),(941,3,528),(941,4,529),
|
||||
(941,6,530),(941,7,531),(941,8,532),(941,9,533),(945,0,534),(946,0,535),(946,13,536),(946,14,537),(946,30,538),(947,0,539),(947,15,540),(947,22,541),(948,0,542),(949,0,543),(949,16,544),(949,17,545),(949,18,546),(949,19,547),(949,20,548),(949,21,549),
|
||||
(950,0,550),(950,10,551),(950,11,552),(950,12,553),(951,0,554),(951,22,555),(953,0,556),(953,1,557),(953,2,558),(953,3,559),(953,4,560),(953,5,561),(953,6,562),(953,7,563),(953,8,564),(953,9,565),(953,10,566),(953,11,567),(953,12,568),(953,13,569),
|
||||
(953,14,570),(955,0,571),(962,0,572),(964,1,573),(969,1,574),(969,2,575),(969,3,576),(970,0,577),(970,1,578),(971,23,579),(971,24,580),(971,25,581),(973,0,582),(976,26,585),(976,27,586),(976,28,587),(978,0,588),(978,29,589),(980,0,590),(983,0,592),
|
||||
(984,1,593),(986,0,594),(987,1,595),(988,1,596),(988,2,597),(988,3,598),(988,4,599),(988,5,600),(989,1,601),(989,2,602),(993,1,606),(993,2,607),(993,3,608),(993,4,609),(994,0,610),(994,1,611),(994,2,612),(994,3,613),(994,4,614),(994,5,615),
|
||||
(995,1,616),(995,2,617),(995,3,618),(1007,0,619),(1008,0,620),(1008,1,621),(1009,0,622),(1010,0,623),(1011,0,624),(1014,0,625),(1014,4,626),(1014,10,627),(1014,11,628),(1014,12,629),(1015,0,630),(1015,17,631),(1015,18,632),(1015,19,633),(1017,0,634),(1017,1,635),
|
||||
(1017,9,636),(1017,25,637),(1017,26,638),(1017,27,639),(1017,28,640),(1018,0,641),(1018,13,642),(1018,14,643),(1018,15,644),(1020,0,645),(1021,0,646),(1021,1,647),(1021,2,648),(1022,0,649),(1024,0,650),
|
||||
(1024,5,651),(1024,6,652),(1024,8,653),(1024,16,654),(1024,20,655),(1024,21,656),(1024,29,657),(1024,30,658),(1024,31,659),(1024,40,660),(1026,0,661),(1026,1,662),(1026,2,663),(1026,3,664),(1026,4,665),
|
||||
(1026,5,666),(1026,6,667),(1026,7,668),(1026,8,669),(1026,9,670),(1027,0,671),(1028,0,672),(1028,1,673),(1028,2,674),(1028,3,675),(1031,0,676),(1032,1,677),(1032,2,678),(1032,3,679),(1033,0,680),
|
||||
(1033,22,681),(1033,23,682),(1033,24,683),(1033,32,684),(1033,33,685),(1033,34,686),(1033,35,687),(1033,36,688),(1033,37,689),(1033,38,690),(1033,39,691),(1033,41,692),(1033,42,693),(1034,0,694),
|
||||
(1035,1,695),(1037,0,696),(1038,0,697),(1039,1,698),(1039,2,699),(1039,3,700),(1039,4,701),(1040,1,702),(1041,0,703),(1041,1,704),(1041,2,705),(1042,0,706),(1042,1,707),(1042,2,708),(1044,0,709),
|
||||
(1045,1,710),(1045,2,711),(1045,3,712),(1046,0,713),(1047,0,714),(1048,0,715),(1049,1,716),(1050,0,717),(1051,0,718),(1052,0,719),(1052,1,720),(1052,2,721),(1054,1,723),(1056,0,725),(1057,0,726),
|
||||
(1059,0,728),(1060,1,729),(1065,0,731),(1066,1,732),(1067,0,733),(1068,1,734),(1068,2,735),(1069,1,736),(1070,1,737),(1071,0,738),(1072,0,739),(1073,1,740),(1073,2,741),(1075,1,742),(1075,2,743),
|
||||
(1076,1,744),(1076,2,745),(1076,3,746),(1077,0,747),(1078,0,748),(1079,1,749),(1080,0,750),(1081,1,751),(1081,2,752),(1081,3,753),(1081,4,754),(1081,5,755),(1081,6,756),(1082,0,757),(1084,0,758),
|
||||
(1085,1,759),(1086,0,760),(1087,0,761),(1087,1,762),(1087,2,763),(1088,1,764),(1088,2,765),(1088,3,766),(1088,4,767),(1088,5,768),(1088,6,769),(1088,7,770),(1088,8,771),(1088,9,772),(1090,0,773),
|
||||
(1090,1,774),(1091,0,775),(1092,0,776),(1094,1,777),(1094,2,778),(1094,3,779),(1094,4,780),(1094,5,781),(1094,6,782),(1094,7,783),(1094,8,784),(1094,9,785),(1094,10,786),(1094,11,787),(1094,12,788),
|
||||
(1094,13,789),(1096,0,790),(1097,1,791),(1097,2,792),(1099,0,793),(1100,1,794),(1100,2,795),(1100,3,796),(1100,4,797),(1102,1,798),(1104,0,799),(1104,1,800),(1104,2,801),(1104,3,802),(1104,4,803),
|
||||
(1105,1,804),(1105,2,805),(1114,0,806),(1114,1,807),(1114,2,808),(1115,1,809),(1115,2,810),(1115,3,811),(1115,4,812),(1115,5,813),(1115,6,814),(1115,7,815),(1115,8,816),(1115,9,817),(1115,10,818),
|
||||
(1115,11,819),(1115,12,820),(1115,13,821),(1115,14,822),(1116,0,823),(1126,0,824),(1127,1,825),(1129,1,826),(1130,1,827),(1131,1,828),(1132,1,829),(1135,0,830),(1135,1,831),(1135,2,832),(1135,7,833),
|
||||
(1136,0,834),(1137,1,835),(1137,2,836),(1139,0,837),(1140,0,838),(1142,1,839),(1143,1,840),(1143,2,841),(1143,3,842),(1144,0,843),(1145,0,844),(1146,1,845),(1146,2,846),(1146,3,847),(1146,4,848),
|
||||
(1146,5,849),(1147,1,850),(1147,2,851),(1147,3,852),(1147,4,853),(1147,5,854),(1147,6,855),(1147,7,856),(1148,1,857),(1149,0,858),(1150,0,859),(1151,0,860),(1152,0,861),(1153,0,862),(1154,0,863),
|
||||
(1155,0,864),(1156,1,865),(1156,2,866),(1157,1,867),(1158,1,868),(1159,1,869),(1159,2,870),(1160,0,871),(1161,0,872),(1161,1,873),(1161,2,874),(1162,0,875),(1163,0,876),(1164,0,877),(1165,0,878),
|
||||
(1165,1,879),(1165,2,880),(1166,1,881),(1170,0,882),(1170,3,883),(1170,4,884),(1171,0,885),(1171,5,886),(1171,6,887),(1172,1,888),(1173,1,889),(1173,2,890),(1174,0,891),(1174,1,892),(1174,2,893),
|
||||
(1174,3,894),(1175,0,895),(1176,0,896),(1177,0,897),(1177,1,898),(1177,2,899),(1177,3,900),(1177,4,901),(1177,5,902),(1178,0,903),(1183,0,904),(1184,0,905),(1185,0,906),(1186,0,907),(1187,0,908),
|
||||
(1188,0,909),(1188,1,910),(1188,2,911),(1188,3,912),(1188,4,913),(1188,5,914),(1188,6,915),(1188,7,916),(1188,8,917),(1188,9,918),(1188,10,919),(1188,11,920),(1190,0,921),(1191,0,922),(1192,0,923),
|
||||
(1193,0,924),(1194,0,925),(1195,0,926),(1196,0,927),(1197,0,928),(1198,0,929),(1199,0,930),(1200,0,931),(1201,0,932),(1202,0,933),(1204,1,934),(1204,2,935),(1205,0,936),(1210,0,938),(1211,0,939),
|
||||
(1212,1,940),(1212,2,941),(1213,0,942),(1214,0,943),(1215,0,971),(1216,0,972),(1217,1,973),(1219,0,974),(1219,1,975),(1219,2,976),(1219,3,977),(1219,4,978),(1219,5,979),(1219,6,980),(1220,0,981),
|
||||
(32,21,42),(974,0,582),(1121,0,646),(992,0,17),(981,0,590),(991,0,582),(990,0,590),(975,0,582),(910,0,418),(910,1,419),(910,2,420),(910,3,421),(907,0,70),(905,4,394),(321,2,85),(510,1,127),(522,0,132);
|
||||
|
||||
UPDATE `quest_poi` SET `UiMapID`=(SELECT wma.`UiMapID` FROM `world_map_area_to_ui_map` wma WHERE wma.`WorldMapAreaID`=`quest_poi`.`WorldMapAreaID` AND wma.`Floor`=`quest_poi`.`Floor`);
|
||||
UPDATE `scenario_poi` SET `UiMapID`=(SELECT wma.`UiMapID` FROM `world_map_area_to_ui_map` wma WHERE wma.`WorldMapAreaID`=`scenario_poi`.`WorldMapAreaID` AND wma.`Floor`=`scenario_poi`.`Floor`);
|
||||
|
||||
DROP TABLE IF EXISTS `world_map_area_to_ui_map`;
|
||||
|
||||
DELETE FROM `quest_poi` WHERE `UiMapID` IS NULL;
|
||||
DELETE FROM `scenario_poi` WHERE `UiMapID` IS NULL;
|
||||
|
||||
ALTER TABLE `quest_poi`
|
||||
CHANGE `UiMapID` `UiMapID` int(11) NOT NULL DEFAULT '0' AFTER `MapID`,
|
||||
DROP `WorldMapAreaID`,
|
||||
DROP `Floor`;
|
||||
|
||||
ALTER TABLE `scenario_poi`
|
||||
CHANGE `UiMapID` `UiMapID` int(11) NOT NULL DEFAULT '0' AFTER `MapID`,
|
||||
DROP `WorldMapAreaID`,
|
||||
DROP `Floor`;
|
||||
|
||||
ALTER TABLE `spell_areatrigger`
|
||||
ADD `AnimId` int(11) NOT NULL DEFAULT '0' AFTER `FacingCurveId`,
|
||||
ADD `AnimKitId` int(11) NOT NULL DEFAULT '0' AFTER `AnimId`;
|
||||
@@ -0,0 +1,23 @@
|
||||
DROP TABLE IF EXISTS `creature_template_model`;
|
||||
CREATE TABLE `creature_template_model`(
|
||||
`CreatureID` int(10) unsigned NOT NULL,
|
||||
`Idx` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`CreatureDisplayID` int(10) unsigned NOT NULL,
|
||||
`DisplayScale` float NOT NULL DEFAULT '1',
|
||||
`Probability` float NOT NULL DEFAULT '0',
|
||||
`VerifiedBuild` smallint(5) unsigned NOT NULL,
|
||||
PRIMARY KEY (`CreatureID`,`CreatureDisplayID`)
|
||||
) ENGINE=MYISAM CHARSET=utf8mb4;
|
||||
|
||||
INSERT IGNORE INTO `creature_template_model` (`CreatureID`,`Idx`,`CreatureDisplayID`,`DisplayScale`,`Probability`,`VerifiedBuild`) SELECT `entry`,0,`modelid1`,`scale`,1,`VerifiedBuild` FROM `creature_template` WHERE `modelid1`!=0;
|
||||
INSERT IGNORE INTO `creature_template_model` (`CreatureID`,`Idx`,`CreatureDisplayID`,`DisplayScale`,`Probability`,`VerifiedBuild`) SELECT `entry`,1,`modelid2`,`scale`,1,`VerifiedBuild` FROM `creature_template` WHERE `modelid2`!=0;
|
||||
INSERT IGNORE INTO `creature_template_model` (`CreatureID`,`Idx`,`CreatureDisplayID`,`DisplayScale`,`Probability`,`VerifiedBuild`) SELECT `entry`,2,`modelid3`,`scale`,1,`VerifiedBuild` FROM `creature_template` WHERE `modelid3`!=0;
|
||||
INSERT IGNORE INTO `creature_template_model` (`CreatureID`,`Idx`,`CreatureDisplayID`,`DisplayScale`,`Probability`,`VerifiedBuild`) SELECT `entry`,3,`modelid4`,`scale`,1,`VerifiedBuild` FROM `creature_template` WHERE `modelid4`!=0;
|
||||
|
||||
UPDATE `creature_template` SET `scale`=1;
|
||||
|
||||
ALTER TABLE `creature_template`
|
||||
DROP `modelid1`,
|
||||
DROP `modelid2`,
|
||||
DROP `modelid3`,
|
||||
DROP `modelid4`;
|
||||
@@ -0,0 +1,7 @@
|
||||
ALTER TABLE `creature_classlevelstats`
|
||||
DROP `damage_base`,
|
||||
DROP `damage_exp1`,
|
||||
DROP `damage_exp2`,
|
||||
DROP `damage_exp3`,
|
||||
DROP `damage_exp4`,
|
||||
DROP `damage_exp5`;
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE `trinity_string` SET `content_default`='%u - |cffffffff|Hquest:%u:%d:%d:%d:%d|h[%s]|h|r %s' WHERE `entry`=513;
|
||||
@@ -0,0 +1,8 @@
|
||||
DELETE FROM `skill_tiers` WHERE `ID` IN (333,335,336,338);
|
||||
INSERT INTO `skill_tiers` (`ID`,`Value1`,`Value2`,`Value3`,`Value4`,`Value5`,`Value6`,`Value7`,`Value8`,`Value9`,`Value10`,`Value11`,`Value12`,`Value13`,`Value14`,`Value15`,`Value16`) VALUES
|
||||
(333,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
|
||||
(335,75,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
|
||||
(336,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
|
||||
(338,150,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
||||
|
||||
UPDATE `skill_tiers` SET `Value10`=800,`Value11`=950 WHERE `ID`=224;
|
||||
@@ -135,7 +135,12 @@ bool ConfigMgr::GetBoolDefault(std::string const& name, bool def) const
|
||||
return StringToBool(val);
|
||||
}
|
||||
|
||||
int ConfigMgr::GetIntDefault(std::string const& name, int def) const
|
||||
int32 ConfigMgr::GetIntDefault(std::string const& name, int32 def) const
|
||||
{
|
||||
return GetValueDefault(name, def);
|
||||
}
|
||||
|
||||
int64 ConfigMgr::GetInt64Default(std::string const& name, int64 def) const
|
||||
{
|
||||
return GetValueDefault(name, def);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,8 @@ public:
|
||||
|
||||
std::string GetStringDefault(std::string const& name, const std::string& def) const;
|
||||
bool GetBoolDefault(std::string const& name, bool def) const;
|
||||
int GetIntDefault(std::string const& name, int def) const;
|
||||
int32 GetIntDefault(std::string const& name, int32 def) const;
|
||||
int64 GetInt64Default(std::string const& name, int64 def) const;
|
||||
float GetFloatDefault(std::string const& name, float def) const;
|
||||
|
||||
std::string const& GetFilename();
|
||||
|
||||
@@ -29,11 +29,24 @@ enum class DB2ColumnCompression : uint32
|
||||
Immediate,
|
||||
CommonData,
|
||||
Pallet,
|
||||
PalletArray
|
||||
PalletArray,
|
||||
SignedImmediate
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
struct DB2SectionHeader
|
||||
{
|
||||
uint64 TactKeyId;
|
||||
uint32 FileOffset;
|
||||
uint32 RecordCount;
|
||||
uint32 StringTableSize;
|
||||
uint32 CopyTableSize;
|
||||
uint32 CatalogDataOffset;
|
||||
uint32 IdTableSize;
|
||||
uint32 ParentLookupDataSize;
|
||||
};
|
||||
|
||||
struct DB2FieldEntry
|
||||
{
|
||||
int16 UnusedBits;
|
||||
@@ -107,6 +120,11 @@ struct DB2IndexData
|
||||
std::unique_ptr<DB2IndexEntry[]> Entries;
|
||||
};
|
||||
|
||||
DB2FieldMeta::DB2FieldMeta(bool isSigned, DBCFormer type, char const* name)
|
||||
: IsSigned(isSigned), Type(type), Name(name)
|
||||
{
|
||||
}
|
||||
|
||||
DB2FileLoadInfo::DB2FileLoadInfo() : Fields(nullptr), FieldCount(0), Meta(nullptr)
|
||||
{
|
||||
}
|
||||
@@ -134,7 +152,7 @@ std::pair<int32, int32> DB2FileLoadInfo::GetFieldIndexByName(char const* fieldNa
|
||||
std::size_t ourIndex = Meta->HasIndexFieldInData() ? 0 : 1;
|
||||
for (uint32 i = 0; i < Meta->FieldCount; ++i)
|
||||
{
|
||||
for (uint8 arr = 0; arr < Meta->ArraySizes[i]; ++arr)
|
||||
for (uint8 arr = 0; arr < Meta->Fields[i].ArraySize; ++arr)
|
||||
{
|
||||
if (!strcmp(Fields[ourIndex].Name, fieldName))
|
||||
return std::make_pair(int32(i), int32(arr));
|
||||
@@ -154,12 +172,12 @@ class DB2FileLoaderImpl
|
||||
{
|
||||
public:
|
||||
virtual ~DB2FileLoaderImpl() { }
|
||||
virtual bool LoadTableData(DB2FileSource* source) = 0;
|
||||
virtual bool LoadCatalogData(DB2FileSource* source) = 0;
|
||||
virtual void SetAdditionalData(std::unique_ptr<DB2FieldEntry[]> fields, std::unique_ptr<uint32[]> idTable, std::unique_ptr<DB2RecordCopy[]> copyTable,
|
||||
std::unique_ptr<DB2ColumnMeta[]> columnMeta, std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletValues,
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletArrayValues, std::unique_ptr<std::unordered_map<uint32, uint32>[]> commonValues,
|
||||
std::unique_ptr<DB2IndexData[]> parentIndexes) = 0;
|
||||
virtual void LoadColumnData(std::unique_ptr<DB2SectionHeader[]> sections, std::unique_ptr<DB2FieldEntry[]> fields, std::unique_ptr<DB2ColumnMeta[]> columnMeta,
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletValues, std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletArrayValues,
|
||||
std::unique_ptr<std::unordered_map<uint32, uint32>[]> commonValues) = 0;
|
||||
virtual bool LoadTableData(DB2FileSource* source, uint32 section) = 0;
|
||||
virtual bool LoadCatalogData(DB2FileSource* source, uint32 section) = 0;
|
||||
virtual void SetAdditionalData(std::vector<uint32> idTable, std::vector<DB2RecordCopy> copyTable, std::vector<DB2IndexData> parentIndexes) = 0;
|
||||
virtual char* AutoProduceData(uint32& count, char**& indexTable, std::vector<char*>& stringPool) = 0;
|
||||
virtual char* AutoProduceStrings(char** indexTable, uint32 indexTableSize, uint32 locale) = 0;
|
||||
virtual void AutoProduceRecordCopies(uint32 records, char** indexTable, char* dataTable) = 0;
|
||||
@@ -169,6 +187,8 @@ public:
|
||||
virtual uint32 GetRecordCopyCount() const = 0;
|
||||
virtual uint32 GetMaxId() const = 0;
|
||||
virtual DB2FileLoadInfo const* GetLoadInfo() const = 0;
|
||||
virtual DB2SectionHeader const& GetSection(uint32 section) const = 0;
|
||||
virtual bool IsSignedField(uint32 field) const = 0;
|
||||
|
||||
private:
|
||||
friend class DB2Record;
|
||||
@@ -191,12 +211,12 @@ public:
|
||||
DB2FileLoaderRegularImpl(char const* fileName, DB2FileLoadInfo const* loadInfo, DB2Header const* header);
|
||||
~DB2FileLoaderRegularImpl();
|
||||
|
||||
bool LoadTableData(DB2FileSource* source) override;
|
||||
bool LoadCatalogData(DB2FileSource* /*source*/) override { return true; }
|
||||
void SetAdditionalData(std::unique_ptr<DB2FieldEntry[]> fields, std::unique_ptr<uint32[]> idTable, std::unique_ptr<DB2RecordCopy[]> copyTable,
|
||||
std::unique_ptr<DB2ColumnMeta[]> columnMeta, std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletValues,
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletArrayValues, std::unique_ptr<std::unordered_map<uint32, uint32>[]> commonValues,
|
||||
std::unique_ptr<DB2IndexData[]> parentIndexes) override;
|
||||
void LoadColumnData(std::unique_ptr<DB2SectionHeader[]> sections, std::unique_ptr<DB2FieldEntry[]> fields, std::unique_ptr<DB2ColumnMeta[]> columnMeta,
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletValues, std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletArrayValues,
|
||||
std::unique_ptr<std::unordered_map<uint32, uint32>[]> commonValues) override;
|
||||
bool LoadTableData(DB2FileSource* source, uint32 section) override;
|
||||
bool LoadCatalogData(DB2FileSource* /*source*/, uint32 /*section*/) override { return true; }
|
||||
void SetAdditionalData(std::vector<uint32> idTable, std::vector<DB2RecordCopy> copyTable, std::vector<DB2IndexData> parentIndexes) override;
|
||||
char* AutoProduceData(uint32& count, char**& indexTable, std::vector<char*>& stringPool) override;
|
||||
char* AutoProduceStrings(char** indexTable, uint32 indexTableSize, uint32 locale) override;
|
||||
void AutoProduceRecordCopies(uint32 records, char** indexTable, char* dataTable) override;
|
||||
@@ -206,6 +226,8 @@ public:
|
||||
uint32 GetRecordCopyCount() const override;
|
||||
uint32 GetMaxId() const override;
|
||||
DB2FileLoadInfo const* GetLoadInfo() const override;
|
||||
DB2SectionHeader const& GetSection(uint32 section) const override;
|
||||
bool IsSignedField(uint32 field) const override;
|
||||
|
||||
private:
|
||||
void FillParentLookup(char* dataTable);
|
||||
@@ -230,13 +252,14 @@ private:
|
||||
DB2Header const* _header;
|
||||
std::unique_ptr<uint8[]> _data;
|
||||
uint8* _stringTable;
|
||||
std::unique_ptr<uint32[]> _idTable;
|
||||
std::unique_ptr<DB2RecordCopy[]> _copyTable;
|
||||
std::unique_ptr<DB2SectionHeader[]> _sections;
|
||||
std::unique_ptr<DB2ColumnMeta[]> _columnMeta;
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> _palletValues;
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> _palletArrayValues;
|
||||
std::unique_ptr<std::unordered_map<uint32, uint32>[]> _commonValues;
|
||||
std::unique_ptr<DB2IndexData[]> _parentIndexes;
|
||||
std::vector<uint32> _idTable;
|
||||
std::vector<DB2RecordCopy> _copyTable;
|
||||
std::vector<DB2IndexData> _parentIndexes;
|
||||
};
|
||||
|
||||
class DB2FileLoaderSparseImpl final : public DB2FileLoaderImpl
|
||||
@@ -245,12 +268,12 @@ public:
|
||||
DB2FileLoaderSparseImpl(char const* fileName, DB2FileLoadInfo const* loadInfo, DB2Header const* header);
|
||||
~DB2FileLoaderSparseImpl();
|
||||
|
||||
bool LoadTableData(DB2FileSource* source) override;
|
||||
bool LoadCatalogData(DB2FileSource* source) override;
|
||||
void SetAdditionalData(std::unique_ptr<DB2FieldEntry[]> fields, std::unique_ptr<uint32[]> idTable, std::unique_ptr<DB2RecordCopy[]> copyTable,
|
||||
std::unique_ptr<DB2ColumnMeta[]> columnMeta, std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletValues,
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletArrayValues, std::unique_ptr<std::unordered_map<uint32, uint32>[]> commonValues,
|
||||
std::unique_ptr<DB2IndexData[]> parentIndexes) override;
|
||||
void LoadColumnData(std::unique_ptr<DB2SectionHeader[]> sections, std::unique_ptr<DB2FieldEntry[]> fields, std::unique_ptr<DB2ColumnMeta[]> columnMeta,
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletValues, std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletArrayValues,
|
||||
std::unique_ptr<std::unordered_map<uint32, uint32>[]> commonValues) override;
|
||||
bool LoadTableData(DB2FileSource* source, uint32 section) override;
|
||||
bool LoadCatalogData(DB2FileSource* source, uint32 section) override;
|
||||
void SetAdditionalData(std::vector<uint32> /*idTable*/, std::vector<DB2RecordCopy> /*copyTable*/, std::vector<DB2IndexData> /*parentIndexes*/) override { }
|
||||
char* AutoProduceData(uint32& records, char**& indexTable, std::vector<char*>& stringPool) override;
|
||||
char* AutoProduceStrings(char** indexTable, uint32 indexTableSize, uint32 locale) override;
|
||||
void AutoProduceRecordCopies(uint32 /*records*/, char** /*indexTable*/, char* /*dataTable*/) override { }
|
||||
@@ -260,6 +283,8 @@ public:
|
||||
uint32 GetRecordCopyCount() const override;
|
||||
uint32 GetMaxId() const override;
|
||||
DB2FileLoadInfo const* GetLoadInfo() const override;
|
||||
DB2SectionHeader const& GetSection(uint32 section) const override;
|
||||
bool IsSignedField(uint32 field) const override;
|
||||
|
||||
private:
|
||||
uint8 const* GetRawRecordData(uint32 recordNumber) const override;
|
||||
@@ -286,6 +311,7 @@ private:
|
||||
DB2Header const* _header;
|
||||
std::size_t _dataStart;
|
||||
std::unique_ptr<uint8[]> _data;
|
||||
std::unique_ptr<DB2SectionHeader[]> _sections;
|
||||
std::unique_ptr<DB2FieldEntry[]> _fields;
|
||||
std::unique_ptr<std::size_t[]> _fieldAndArrayOffsets;
|
||||
std::unique_ptr<DB2CatalogEntry[]> _catalog;
|
||||
@@ -299,24 +325,46 @@ DB2FileLoaderRegularImpl::DB2FileLoaderRegularImpl(char const* fileName, DB2File
|
||||
{
|
||||
}
|
||||
|
||||
bool DB2FileLoaderRegularImpl::LoadTableData(DB2FileSource* source)
|
||||
void DB2FileLoaderRegularImpl::LoadColumnData(std::unique_ptr<DB2SectionHeader[]> sections, std::unique_ptr<DB2FieldEntry[]> /*fields*/, std::unique_ptr<DB2ColumnMeta[]> columnMeta,
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletValues, std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletArrayValues,
|
||||
std::unique_ptr<std::unordered_map<uint32, uint32>[]> commonValues)
|
||||
{
|
||||
_data = Trinity::make_unique<uint8[]>(_header->RecordSize * _header->RecordCount + _header->StringTableSize);
|
||||
_stringTable = &_data[_header->RecordSize * _header->RecordCount];
|
||||
return source->Read(_data.get(), _header->RecordSize * _header->RecordCount + _header->StringTableSize);
|
||||
}
|
||||
|
||||
void DB2FileLoaderRegularImpl::SetAdditionalData(std::unique_ptr<DB2FieldEntry[]> /*fields*/, std::unique_ptr<uint32[]> idTable, std::unique_ptr<DB2RecordCopy[]> copyTable,
|
||||
std::unique_ptr<DB2ColumnMeta[]> columnMeta, std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletValues,
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletArrayValues, std::unique_ptr<std::unordered_map<uint32, uint32>[]> commonValues,
|
||||
std::unique_ptr<DB2IndexData[]> parentIndexes)
|
||||
{
|
||||
_idTable = std::move(idTable);
|
||||
_copyTable = std::move(copyTable);
|
||||
_sections = std::move(sections);
|
||||
_columnMeta = std::move(columnMeta);
|
||||
_palletValues = std::move(palletValues);
|
||||
_palletArrayValues = std::move(palletArrayValues);
|
||||
_commonValues = std::move(commonValues);
|
||||
}
|
||||
|
||||
bool DB2FileLoaderRegularImpl::LoadTableData(DB2FileSource* source, uint32 section)
|
||||
{
|
||||
if (!_data)
|
||||
{
|
||||
_data = Trinity::make_unique<uint8[]>(_header->RecordSize * _header->RecordCount + _header->StringTableSize + 8);
|
||||
_stringTable = &_data[_header->RecordSize * _header->RecordCount];
|
||||
}
|
||||
|
||||
uint32 sectionDataStart = 0;
|
||||
uint32 sectionStringTableStart = 0;
|
||||
for (uint32 i = 0; i < section; ++i)
|
||||
{
|
||||
sectionDataStart += _header->RecordSize * _sections[i].RecordCount;
|
||||
sectionStringTableStart += _sections[i].StringTableSize;
|
||||
}
|
||||
|
||||
if (_sections[section].RecordCount && !source->Read(&_data[sectionDataStart], _header->RecordSize * _sections[section].RecordCount))
|
||||
return false;
|
||||
|
||||
if (_sections[section].StringTableSize && !source->Read(&_stringTable[sectionStringTableStart], _sections[section].StringTableSize))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DB2FileLoaderRegularImpl::SetAdditionalData(std::vector<uint32> idTable, std::vector<DB2RecordCopy> copyTable, std::vector<DB2IndexData> parentIndexes)
|
||||
{
|
||||
_idTable = std::move(idTable);
|
||||
_copyTable = std::move(copyTable);
|
||||
_parentIndexes = std::move(parentIndexes);
|
||||
}
|
||||
|
||||
@@ -339,7 +387,7 @@ char* DB2FileLoaderRegularImpl::AutoProduceData(uint32& records, char**& indexTa
|
||||
indexTable = new index_entry_t[maxi];
|
||||
memset(indexTable, 0, maxi * sizeof(index_entry_t));
|
||||
|
||||
char* dataTable = new char[(_header->RecordCount + (_header->CopyTableSize / 8)) * recordsize];
|
||||
char* dataTable = new char[(_header->RecordCount + _copyTable.size()) * recordsize];
|
||||
|
||||
// we store flat holders pool as single memory block
|
||||
std::size_t stringFields = _loadInfo->GetStringFieldCount(false);
|
||||
@@ -384,7 +432,7 @@ char* DB2FileLoaderRegularImpl::AutoProduceData(uint32& records, char**& indexTa
|
||||
|
||||
for (uint32 x = 0; x < _header->FieldCount; ++x)
|
||||
{
|
||||
for (uint32 z = 0; z < _loadInfo->Meta->ArraySizes[x]; ++z)
|
||||
for (uint32 z = 0; z < _loadInfo->Meta->Fields[x].ArraySize; ++z)
|
||||
{
|
||||
switch (_loadInfo->TypesString[fieldIndex])
|
||||
{
|
||||
@@ -423,7 +471,8 @@ char* DB2FileLoaderRegularImpl::AutoProduceData(uint32& records, char**& indexTa
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta", _loadInfo->TypesString[x], _fileName);
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta for field %s",
|
||||
_loadInfo->TypesString[fieldIndex], _fileName, _loadInfo->Fields[fieldIndex].Name);
|
||||
break;
|
||||
}
|
||||
++fieldIndex;
|
||||
@@ -432,7 +481,7 @@ char* DB2FileLoaderRegularImpl::AutoProduceData(uint32& records, char**& indexTa
|
||||
|
||||
for (uint32 x = _header->FieldCount; x < _loadInfo->Meta->FieldCount; ++x)
|
||||
{
|
||||
for (uint32 z = 0; z < _loadInfo->Meta->ArraySizes[x]; ++z)
|
||||
for (uint32 z = 0; z < _loadInfo->Meta->Fields[x].ArraySize; ++z)
|
||||
{
|
||||
switch (_loadInfo->TypesString[fieldIndex])
|
||||
{
|
||||
@@ -471,7 +520,8 @@ char* DB2FileLoaderRegularImpl::AutoProduceData(uint32& records, char**& indexTa
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta", _loadInfo->TypesString[x], _fileName);
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta for field %s",
|
||||
_loadInfo->TypesString[fieldIndex], _fileName, _loadInfo->Fields[fieldIndex].Name);
|
||||
break;
|
||||
}
|
||||
++fieldIndex;
|
||||
@@ -479,7 +529,7 @@ char* DB2FileLoaderRegularImpl::AutoProduceData(uint32& records, char**& indexTa
|
||||
}
|
||||
}
|
||||
|
||||
if (_parentIndexes)
|
||||
if (!_parentIndexes.empty())
|
||||
FillParentLookup(dataTable);
|
||||
|
||||
return dataTable;
|
||||
@@ -529,7 +579,7 @@ char* DB2FileLoaderRegularImpl::AutoProduceStrings(char** indexTable, uint32 ind
|
||||
|
||||
for (uint32 x = 0; x < _loadInfo->Meta->FieldCount; ++x)
|
||||
{
|
||||
for (uint32 z = 0; z < _loadInfo->Meta->ArraySizes[x]; ++z)
|
||||
for (uint32 z = 0; z < _loadInfo->Meta->Fields[x].ArraySize; ++z)
|
||||
{
|
||||
switch (_loadInfo->TypesString[fieldIndex])
|
||||
{
|
||||
@@ -568,7 +618,8 @@ char* DB2FileLoaderRegularImpl::AutoProduceStrings(char** indexTable, uint32 ind
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta", _loadInfo->TypesString[x], _fileName);
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta for field %s",
|
||||
_loadInfo->TypesString[fieldIndex], _fileName, _loadInfo->Fields[fieldIndex].Name);
|
||||
break;
|
||||
}
|
||||
++fieldIndex;
|
||||
@@ -606,7 +657,7 @@ void DB2FileLoaderRegularImpl::FillParentLookup(char* dataTable)
|
||||
uint32 parentId = _parentIndexes[0].Entries[i].ParentId;
|
||||
char* recordData = &dataTable[_parentIndexes[0].Entries[i].RecordIndex * recordSize];
|
||||
|
||||
switch (_loadInfo->Meta->Types[_loadInfo->Meta->ParentIndexField])
|
||||
switch (_loadInfo->Meta->Fields[_loadInfo->Meta->ParentIndexField].Type)
|
||||
{
|
||||
case FT_SHORT:
|
||||
*reinterpret_cast<uint16*>(&recordData[parentIdOffset]) = uint16(parentId);
|
||||
@@ -618,7 +669,7 @@ void DB2FileLoaderRegularImpl::FillParentLookup(char* dataTable)
|
||||
*reinterpret_cast<uint32*>(&recordData[parentIdOffset]) = parentId;
|
||||
break;
|
||||
default:
|
||||
ASSERT(false, "Unhandled parent id type '%c' found in %s", _loadInfo->Meta->Types[_loadInfo->Meta->ParentIndexField], _fileName);
|
||||
ASSERT(false, "Unhandled parent id type '%c' found in %s", _loadInfo->Meta->Fields[_loadInfo->Meta->ParentIndexField].Type, _fileName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -644,7 +695,7 @@ uint32 DB2FileLoaderRegularImpl::GetRecordCount() const
|
||||
|
||||
uint32 DB2FileLoaderRegularImpl::GetRecordCopyCount() const
|
||||
{
|
||||
return _header->CopyTableSize / sizeof(DB2RecordCopy);
|
||||
return _copyTable.size();
|
||||
}
|
||||
|
||||
uint8 const* DB2FileLoaderRegularImpl::GetRawRecordData(uint32 recordNumber) const
|
||||
@@ -695,16 +746,18 @@ float DB2FileLoaderRegularImpl::RecordGetFloat(uint8 const* record, uint32 field
|
||||
|
||||
char const* DB2FileLoaderRegularImpl::RecordGetString(uint8 const* record, uint32 field, uint32 arrayIndex) const
|
||||
{
|
||||
uint32 fieldOffset = GetFieldOffset(field) + sizeof(uint32) * arrayIndex;
|
||||
uint32 stringOffset = RecordGetVarInt<uint32>(record, field, arrayIndex);
|
||||
ASSERT(stringOffset < _header->StringTableSize);
|
||||
return reinterpret_cast<char*>(_stringTable + stringOffset);
|
||||
ASSERT(stringOffset < _header->RecordSize * _header->RecordCount + _header->StringTableSize);
|
||||
return reinterpret_cast<char const*>(record + fieldOffset + stringOffset);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T DB2FileLoaderRegularImpl::RecordGetVarInt(uint8 const* record, uint32 field, uint32 arrayIndex) const
|
||||
{
|
||||
ASSERT(field < _header->FieldCount);
|
||||
switch (_columnMeta[field].CompressionType)
|
||||
DB2ColumnCompression compressionType = _columnMeta ? _columnMeta[field].CompressionType : DB2ColumnCompression::None;
|
||||
switch (compressionType)
|
||||
{
|
||||
case DB2ColumnCompression::None:
|
||||
{
|
||||
@@ -718,11 +771,6 @@ T DB2FileLoaderRegularImpl::RecordGetVarInt(uint8 const* record, uint32 field, u
|
||||
uint64 immediateValue = RecordGetPackedValue(record + GetFieldOffset(field),
|
||||
_columnMeta[field].CompressionData.immediate.BitWidth, _columnMeta[field].CompressionData.immediate.BitOffset);
|
||||
EndianConvert(immediateValue);
|
||||
if (_columnMeta[field].CompressionData.immediate.Signed)
|
||||
{
|
||||
uint64 mask = UI64LIT(1) << (_columnMeta[field].CompressionData.immediate.BitWidth - 1);
|
||||
immediateValue = (immediateValue ^ mask) - mask;
|
||||
}
|
||||
T value;
|
||||
memcpy(&value, &immediateValue, std::min(sizeof(T), sizeof(immediateValue)));
|
||||
return value;
|
||||
@@ -761,6 +809,18 @@ T DB2FileLoaderRegularImpl::RecordGetVarInt(uint8 const* record, uint32 field, u
|
||||
memcpy(&value, &palletValue, std::min(sizeof(T), sizeof(palletValue)));
|
||||
return value;
|
||||
}
|
||||
case DB2ColumnCompression::SignedImmediate:
|
||||
{
|
||||
ASSERT(arrayIndex == 0);
|
||||
uint64 immediateValue = RecordGetPackedValue(record + GetFieldOffset(field),
|
||||
_columnMeta[field].CompressionData.immediate.BitWidth, _columnMeta[field].CompressionData.immediate.BitOffset);
|
||||
EndianConvert(immediateValue);
|
||||
uint64 mask = UI64LIT(1) << (_columnMeta[field].CompressionData.immediate.BitWidth - 1);
|
||||
immediateValue = (immediateValue ^ mask) - mask;
|
||||
T value;
|
||||
memcpy(&value, &immediateValue, std::min(sizeof(T), sizeof(immediateValue)));
|
||||
return value;
|
||||
}
|
||||
default:
|
||||
ASSERT(false, "Unhandled compression type %u in %s", uint32(_columnMeta[field].CompressionType), _fileName);
|
||||
break;
|
||||
@@ -778,11 +838,13 @@ uint64 DB2FileLoaderRegularImpl::RecordGetPackedValue(uint8 const* packedRecordD
|
||||
uint16 DB2FileLoaderRegularImpl::GetFieldOffset(uint32 field) const
|
||||
{
|
||||
ASSERT(field < _header->FieldCount);
|
||||
switch (_columnMeta[field].CompressionType)
|
||||
DB2ColumnCompression compressionType = _columnMeta ? _columnMeta[field].CompressionType : DB2ColumnCompression::None;
|
||||
switch (compressionType)
|
||||
{
|
||||
case DB2ColumnCompression::None:
|
||||
return _columnMeta[field].BitOffset / 8;
|
||||
case DB2ColumnCompression::Immediate:
|
||||
case DB2ColumnCompression::SignedImmediate:
|
||||
return _columnMeta[field].CompressionData.immediate.BitOffset / 8 + _header->PackedDataOffset;
|
||||
case DB2ColumnCompression::CommonData:
|
||||
return 0xFFFF;
|
||||
@@ -831,6 +893,40 @@ DB2FileLoadInfo const* DB2FileLoaderRegularImpl::GetLoadInfo() const
|
||||
return _loadInfo;
|
||||
}
|
||||
|
||||
DB2SectionHeader const& DB2FileLoaderRegularImpl::GetSection(uint32 section) const
|
||||
{
|
||||
return _sections[section];
|
||||
}
|
||||
|
||||
bool DB2FileLoaderRegularImpl::IsSignedField(uint32 field) const
|
||||
{
|
||||
if (field >= _header->TotalFieldCount)
|
||||
{
|
||||
ASSERT(field == _header->TotalFieldCount);
|
||||
ASSERT(int32(field) == _loadInfo->Meta->ParentIndexField);
|
||||
return _loadInfo->Meta->IsSignedField(field);
|
||||
}
|
||||
|
||||
DB2ColumnCompression compressionType = _columnMeta ? _columnMeta[field].CompressionType : DB2ColumnCompression::None;
|
||||
switch (compressionType)
|
||||
{
|
||||
case DB2ColumnCompression::None:
|
||||
case DB2ColumnCompression::CommonData:
|
||||
case DB2ColumnCompression::Pallet:
|
||||
case DB2ColumnCompression::PalletArray:
|
||||
return _loadInfo->Meta->IsSignedField(field);
|
||||
case DB2ColumnCompression::SignedImmediate:
|
||||
return field != uint32(_loadInfo->Meta->IndexField);
|
||||
case DB2ColumnCompression::Immediate:
|
||||
return false;
|
||||
default:
|
||||
ASSERT(false, "Unhandled compression type %u in %s", uint32(_columnMeta[field].CompressionType), _fileName);
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
DB2FileLoaderSparseImpl::DB2FileLoaderSparseImpl(char const* fileName, DB2FileLoadInfo const* loadInfo, DB2Header const* header) :
|
||||
_fileName(fileName),
|
||||
_loadInfo(loadInfo),
|
||||
@@ -844,27 +940,33 @@ DB2FileLoaderSparseImpl::~DB2FileLoaderSparseImpl()
|
||||
{
|
||||
}
|
||||
|
||||
bool DB2FileLoaderSparseImpl::LoadTableData(DB2FileSource* source)
|
||||
void DB2FileLoaderSparseImpl::LoadColumnData(std::unique_ptr<DB2SectionHeader[]> sections, std::unique_ptr<DB2FieldEntry[]> fields, std::unique_ptr<DB2ColumnMeta[]> /*columnMeta*/,
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> /*palletValues*/, std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> /*palletArrayValues*/,
|
||||
std::unique_ptr<std::unordered_map<uint32, uint32>[]> /*commonValues*/)
|
||||
{
|
||||
_dataStart = source->GetPosition();
|
||||
_data = Trinity::make_unique<uint8[]>(_header->CatalogDataOffset - _dataStart);
|
||||
return source->Read(_data.get(), _header->CatalogDataOffset - _dataStart);
|
||||
_sections = std::move(sections);
|
||||
_fields = std::move(fields);
|
||||
}
|
||||
|
||||
bool DB2FileLoaderSparseImpl::LoadCatalogData(DB2FileSource* source)
|
||||
bool DB2FileLoaderSparseImpl::LoadTableData(DB2FileSource* source, uint32 section)
|
||||
{
|
||||
if (section != 0)
|
||||
return false;
|
||||
|
||||
_dataStart = source->GetPosition();
|
||||
_data = Trinity::make_unique<uint8[]>(_sections[0].CatalogDataOffset - _dataStart);
|
||||
return source->Read(_data.get(), _sections[0].CatalogDataOffset - _dataStart);
|
||||
}
|
||||
|
||||
bool DB2FileLoaderSparseImpl::LoadCatalogData(DB2FileSource* source, uint32 section)
|
||||
{
|
||||
if (section != 0)
|
||||
return false;
|
||||
|
||||
_catalog = Trinity::make_unique<DB2CatalogEntry[]>(_header->MaxId - _header->MinId + 1);
|
||||
return source->Read(_catalog.get(), sizeof(DB2CatalogEntry) * (_header->MaxId - _header->MinId + 1));
|
||||
}
|
||||
|
||||
void DB2FileLoaderSparseImpl::SetAdditionalData(std::unique_ptr<DB2FieldEntry[]> fields, std::unique_ptr<uint32[]> /*idTable*/, std::unique_ptr<DB2RecordCopy[]> /*copyTable*/,
|
||||
std::unique_ptr<DB2ColumnMeta[]> /*columnMeta*/, std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> /*palletValues*/,
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> /*palletArrayValues*/, std::unique_ptr<std::unordered_map<uint32, uint32>[]> /*commonValues*/,
|
||||
std::unique_ptr<DB2IndexData[]> /*parentIndexes*/)
|
||||
{
|
||||
_fields = std::move(fields);
|
||||
}
|
||||
|
||||
char* DB2FileLoaderSparseImpl::AutoProduceData(uint32& maxId, char**& indexTable, std::vector<char*>& stringPool)
|
||||
{
|
||||
if (_loadInfo->Meta->FieldCount != _header->FieldCount)
|
||||
@@ -935,7 +1037,7 @@ char* DB2FileLoaderSparseImpl::AutoProduceData(uint32& maxId, char**& indexTable
|
||||
uint32 stringFieldOffset = 0;
|
||||
for (uint32 x = 0; x < _header->FieldCount; ++x)
|
||||
{
|
||||
for (uint32 z = 0; z < _loadInfo->Meta->ArraySizes[x]; ++z)
|
||||
for (uint32 z = 0; z < _loadInfo->Meta->Fields[x].ArraySize; ++z)
|
||||
{
|
||||
switch (_loadInfo->TypesString[fieldIndex])
|
||||
{
|
||||
@@ -984,7 +1086,8 @@ char* DB2FileLoaderSparseImpl::AutoProduceData(uint32& maxId, char**& indexTable
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta", _loadInfo->TypesString[x], _fileName);
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta for field %s",
|
||||
_loadInfo->TypesString[fieldIndex], _fileName, _loadInfo->Fields[fieldIndex].Name);
|
||||
break;
|
||||
}
|
||||
++fieldIndex;
|
||||
@@ -1027,8 +1130,8 @@ char* DB2FileLoaderSparseImpl::AutoProduceStrings(char** indexTable, uint32 inde
|
||||
|
||||
uint32 recordsize = _loadInfo->Meta->GetRecordSize();
|
||||
std::size_t stringFields = _loadInfo->GetStringFieldCount(true);
|
||||
char* stringTable = new char[_header->CatalogDataOffset - _dataStart - records * ((recordsize - (!_loadInfo->Meta->HasIndexFieldInData() ? 4 : 0)) - stringFields * sizeof(char*))];
|
||||
memset(stringTable, 0, _header->CatalogDataOffset - _dataStart - records * ((recordsize - (!_loadInfo->Meta->HasIndexFieldInData() ? 4 : 0)) - stringFields * sizeof(char*)));
|
||||
char* stringTable = new char[_sections[0].CatalogDataOffset - _dataStart - records * ((recordsize - (!_loadInfo->Meta->HasIndexFieldInData() ? 4 : 0)) - stringFields * sizeof(char*))];
|
||||
memset(stringTable, 0, _sections[0].CatalogDataOffset - _dataStart - records * ((recordsize - (!_loadInfo->Meta->HasIndexFieldInData() ? 4 : 0)) - stringFields * sizeof(char*)));
|
||||
char* stringPtr = stringTable;
|
||||
|
||||
for (uint32 y = 0; y < offsetCount; y++)
|
||||
@@ -1053,7 +1156,7 @@ char* DB2FileLoaderSparseImpl::AutoProduceStrings(char** indexTable, uint32 inde
|
||||
|
||||
for (uint32 x = 0; x < _header->FieldCount; ++x)
|
||||
{
|
||||
for (uint32 z = 0; z < _loadInfo->Meta->ArraySizes[x]; ++z)
|
||||
for (uint32 z = 0; z < _loadInfo->Meta->Fields[x].ArraySize; ++z)
|
||||
{
|
||||
switch (_loadInfo->TypesString[fieldIndex])
|
||||
{
|
||||
@@ -1085,7 +1188,8 @@ char* DB2FileLoaderSparseImpl::AutoProduceStrings(char** indexTable, uint32 inde
|
||||
offset += sizeof(char*);
|
||||
break;
|
||||
default:
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta", _loadInfo->TypesString[x], _fileName);
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta for field %s",
|
||||
_loadInfo->TypesString[fieldIndex], _fileName, _loadInfo->Fields[fieldIndex].Name);
|
||||
break;
|
||||
}
|
||||
++fieldIndex;
|
||||
@@ -1230,10 +1334,10 @@ void DB2FileLoaderSparseImpl::CalculateAndStoreFieldOffsets(uint8 const* rawReco
|
||||
for (uint32 field = 0; field < _loadInfo->Meta->FieldCount; ++field)
|
||||
{
|
||||
_fieldAndArrayOffsets[field] = combinedField;
|
||||
for (uint32 arr = 0; arr < _loadInfo->Meta->ArraySizes[field]; ++arr)
|
||||
for (uint32 arr = 0; arr < _loadInfo->Meta->Fields[field].ArraySize; ++arr)
|
||||
{
|
||||
_fieldAndArrayOffsets[combinedField] = offset;
|
||||
switch (_loadInfo->Meta->Types[field])
|
||||
switch (_loadInfo->Meta->Fields[field].Type)
|
||||
{
|
||||
case FT_BYTE:
|
||||
case FT_SHORT:
|
||||
@@ -1245,10 +1349,11 @@ void DB2FileLoaderSparseImpl::CalculateAndStoreFieldOffsets(uint8 const* rawReco
|
||||
offset += sizeof(float);
|
||||
break;
|
||||
case FT_STRING:
|
||||
case FT_STRING_NOT_LOCALIZED:
|
||||
offset += strlen(reinterpret_cast<char const*>(rawRecord) + offset) + 1;
|
||||
break;
|
||||
default:
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta", _loadInfo->Meta->Types[field], _fileName);
|
||||
ASSERT(false, "Unknown format character '%c' found in %s meta", _loadInfo->Meta->Fields[field].Type, _fileName);
|
||||
break;
|
||||
}
|
||||
++combinedField;
|
||||
@@ -1266,6 +1371,17 @@ DB2FileLoadInfo const* DB2FileLoaderSparseImpl::GetLoadInfo() const
|
||||
return _loadInfo;
|
||||
}
|
||||
|
||||
DB2SectionHeader const& DB2FileLoaderSparseImpl::GetSection(uint32 section) const
|
||||
{
|
||||
return _sections[section];
|
||||
}
|
||||
|
||||
bool DB2FileLoaderSparseImpl::IsSignedField(uint32 field) const
|
||||
{
|
||||
ASSERT(field < _header->FieldCount);
|
||||
return _loadInfo->Meta->IsSignedField(field);
|
||||
}
|
||||
|
||||
DB2Record::DB2Record(DB2FileLoaderImpl const& db2, uint32 recordIndex, std::size_t* fieldOffsets)
|
||||
: _db2(db2), _recordIndex(recordIndex), _recordData(db2.GetRawRecordData(recordIndex)), _fieldOffsets(fieldOffsets)
|
||||
{
|
||||
@@ -1402,43 +1518,22 @@ bool DB2FileLoader::Load(DB2FileSource* source, DB2FileLoadInfo const* loadInfo)
|
||||
EndianConvert(_header.MinId);
|
||||
EndianConvert(_header.MaxId);
|
||||
EndianConvert(_header.Locale);
|
||||
EndianConvert(_header.CopyTableSize);
|
||||
EndianConvert(_header.Flags);
|
||||
EndianConvert(_header.IndexField);
|
||||
EndianConvert(_header.TotalFieldCount);
|
||||
EndianConvert(_header.PackedDataOffset);
|
||||
EndianConvert(_header.ParentLookupCount);
|
||||
EndianConvert(_header.CatalogDataOffset);
|
||||
EndianConvert(_header.IdTableSize);
|
||||
EndianConvert(_header.ColumnMetaSize);
|
||||
EndianConvert(_header.CommonDataSize);
|
||||
EndianConvert(_header.PalletDataSize);
|
||||
EndianConvert(_header.ParentLookupDataSize);
|
||||
EndianConvert(_header.SectionCount);
|
||||
|
||||
if (_header.Signature != 0x31434457) //'WDC1'
|
||||
if (_header.Signature != 0x32434457) //'WDC2'
|
||||
return false;
|
||||
|
||||
if (_header.LayoutHash != loadInfo->Meta->LayoutHash)
|
||||
return false;
|
||||
|
||||
if (!(_header.Flags & 0x1))
|
||||
{
|
||||
std::size_t expectedFileSize =
|
||||
sizeof(DB2Header) +
|
||||
sizeof(DB2FieldEntry) * _header.FieldCount +
|
||||
_header.RecordCount * _header.RecordSize +
|
||||
_header.StringTableSize +
|
||||
_header.IdTableSize +
|
||||
_header.CopyTableSize +
|
||||
_header.ColumnMetaSize +
|
||||
_header.PalletDataSize +
|
||||
_header.CommonDataSize +
|
||||
_header.ParentLookupDataSize;
|
||||
|
||||
if (source->GetFileSize() != expectedFileSize)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_header.ParentLookupCount > 1)
|
||||
return false;
|
||||
|
||||
@@ -1448,40 +1543,41 @@ bool DB2FileLoader::Load(DB2FileSource* source, DB2FileLoadInfo const* loadInfo)
|
||||
if (_header.ParentLookupCount && loadInfo->Meta->ParentIndexField == -1)
|
||||
return false;
|
||||
|
||||
std::unique_ptr<DB2SectionHeader[]> sections = Trinity::make_unique<DB2SectionHeader[]>(_header.SectionCount);
|
||||
if (_header.SectionCount && !source->Read(sections.get(), sizeof(DB2SectionHeader) * _header.SectionCount))
|
||||
return false;
|
||||
|
||||
uint32 totalCopyTableSize = 0;
|
||||
uint32 totalParentLookupDataSize = 0;
|
||||
for (uint32 i = 0; i < _header.SectionCount; ++i)
|
||||
{
|
||||
totalCopyTableSize += sections[i].CopyTableSize;
|
||||
totalParentLookupDataSize += sections[i].ParentLookupDataSize;
|
||||
}
|
||||
|
||||
if (!(_header.Flags & 0x1))
|
||||
_impl = new DB2FileLoaderRegularImpl(source->GetFileName(), loadInfo, &_header);
|
||||
else
|
||||
_impl = new DB2FileLoaderSparseImpl(source->GetFileName(), loadInfo, &_header);
|
||||
{
|
||||
std::size_t expectedFileSize =
|
||||
sizeof(DB2Header) +
|
||||
sizeof(DB2SectionHeader) * _header.SectionCount +
|
||||
sizeof(DB2FieldEntry) * _header.FieldCount +
|
||||
_header.RecordCount * _header.RecordSize +
|
||||
_header.StringTableSize +
|
||||
(loadInfo->Meta->IndexField == -1 ? _header.RecordCount * sizeof(uint32) : 0) +
|
||||
totalCopyTableSize +
|
||||
_header.ColumnMetaSize +
|
||||
_header.PalletDataSize +
|
||||
_header.CommonDataSize +
|
||||
totalParentLookupDataSize;
|
||||
|
||||
if (source->GetFileSize() != expectedFileSize)
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_ptr<DB2FieldEntry[]> fieldData = Trinity::make_unique<DB2FieldEntry[]>(_header.FieldCount);
|
||||
if (!source->Read(fieldData.get(), sizeof(DB2FieldEntry) * _header.FieldCount))
|
||||
return false;
|
||||
|
||||
if (!_impl->LoadTableData(source))
|
||||
return false;
|
||||
|
||||
if (!_impl->LoadCatalogData(source))
|
||||
return false;
|
||||
|
||||
ASSERT(!loadInfo->Meta->HasIndexFieldInData() || _header.IdTableSize == 0);
|
||||
ASSERT(loadInfo->Meta->HasIndexFieldInData() || _header.IdTableSize == 4 * _header.RecordCount);
|
||||
|
||||
std::unique_ptr<uint32[]> idTable;
|
||||
if (!loadInfo->Meta->HasIndexFieldInData() && _header.IdTableSize)
|
||||
{
|
||||
idTable = Trinity::make_unique<uint32[]>(_header.RecordCount);
|
||||
if (!source->Read(idTable.get(), _header.IdTableSize))
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_ptr<DB2RecordCopy[]> copyTable;
|
||||
if (_header.CopyTableSize)
|
||||
{
|
||||
copyTable = Trinity::make_unique<DB2RecordCopy[]>(_header.CopyTableSize / sizeof(DB2RecordCopy));
|
||||
if (!source->Read(copyTable.get(), _header.CopyTableSize))
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_ptr<DB2ColumnMeta[]> columnMeta;
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletValues;
|
||||
std::unique_ptr<std::unique_ptr<DB2PalletValue[]>[]> palletArrayValues;
|
||||
@@ -1494,7 +1590,8 @@ bool DB2FileLoader::Load(DB2FileSource* source, DB2FileLoadInfo const* loadInfo)
|
||||
|
||||
ASSERT(!loadInfo->Meta->HasIndexFieldInData() ||
|
||||
columnMeta[loadInfo->Meta->IndexField].CompressionType == DB2ColumnCompression::None ||
|
||||
columnMeta[loadInfo->Meta->IndexField].CompressionType == DB2ColumnCompression::Immediate);
|
||||
columnMeta[loadInfo->Meta->IndexField].CompressionType == DB2ColumnCompression::Immediate ||
|
||||
columnMeta[loadInfo->Meta->IndexField].CompressionType == DB2ColumnCompression::SignedImmediate);
|
||||
|
||||
palletValues = Trinity::make_unique<std::unique_ptr<DB2PalletValue[]>[]>(_header.TotalFieldCount);
|
||||
for (uint32 i = 0; i < _header.TotalFieldCount; ++i)
|
||||
@@ -1543,26 +1640,82 @@ bool DB2FileLoader::Load(DB2FileSource* source, DB2FileLoadInfo const* loadInfo)
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<DB2IndexData[]> parentIndexes;
|
||||
if (_header.ParentLookupCount)
|
||||
if (!(_header.Flags & 0x1))
|
||||
_impl = new DB2FileLoaderRegularImpl(source->GetFileName(), loadInfo, &_header);
|
||||
else
|
||||
_impl = new DB2FileLoaderSparseImpl(source->GetFileName(), loadInfo, &_header);
|
||||
|
||||
_impl->LoadColumnData(std::move(sections), std::move(fieldData), std::move(columnMeta), std::move(palletValues), std::move(palletArrayValues), std::move(commonValues));
|
||||
|
||||
std::vector<uint32> idTable;
|
||||
std::vector<DB2RecordCopy> copyTable;
|
||||
std::vector<DB2IndexData> parentIndexes;
|
||||
if (!loadInfo->Meta->HasIndexFieldInData() && _header.RecordCount)
|
||||
idTable.reserve(_header.RecordCount);
|
||||
|
||||
for (uint32 i = 0; i < _header.SectionCount; ++i)
|
||||
{
|
||||
parentIndexes = Trinity::make_unique<DB2IndexData[]>(_header.ParentLookupCount);
|
||||
for (uint32 i = 0; i < _header.ParentLookupCount; ++i)
|
||||
DB2SectionHeader const& section = _impl->GetSection(i);
|
||||
|
||||
if (!source->SetPosition(section.FileOffset))
|
||||
return false;
|
||||
|
||||
if (!_impl->LoadTableData(source, i))
|
||||
return false;
|
||||
|
||||
if (!_impl->LoadCatalogData(source, i))
|
||||
return false;
|
||||
|
||||
ASSERT(!loadInfo->Meta->HasIndexFieldInData() || section.IdTableSize == 0);
|
||||
ASSERT(loadInfo->Meta->HasIndexFieldInData() || section.IdTableSize == 4 * section.RecordCount);
|
||||
|
||||
if (!loadInfo->Meta->HasIndexFieldInData() && section.IdTableSize)
|
||||
{
|
||||
if (!source->Read(&parentIndexes[i].Info, sizeof(DB2IndexDataInfo)))
|
||||
std::size_t idTableSize = idTable.size();
|
||||
idTable.resize(idTableSize + section.IdTableSize);
|
||||
if (!source->Read(&idTable[idTableSize], section.IdTableSize))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!parentIndexes[i].Info.NumEntries)
|
||||
continue;
|
||||
|
||||
parentIndexes[i].Entries = Trinity::make_unique<DB2IndexEntry[]>(parentIndexes[i].Info.NumEntries);
|
||||
if (!source->Read(parentIndexes[i].Entries.get(), sizeof(DB2IndexEntry) * parentIndexes[i].Info.NumEntries))
|
||||
if (section.CopyTableSize)
|
||||
{
|
||||
std::size_t copyTableSize = copyTable.size();
|
||||
copyTable.resize(copyTableSize + section.CopyTableSize / sizeof(DB2RecordCopy));
|
||||
if (!source->Read(©Table[copyTableSize], section.CopyTableSize))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_header.ParentLookupCount)
|
||||
{
|
||||
parentIndexes.resize(_header.ParentLookupCount);
|
||||
for (uint32 i = 0; i < _header.ParentLookupCount; ++i)
|
||||
{
|
||||
if (!source->Read(&parentIndexes[i].Info, sizeof(DB2IndexDataInfo)))
|
||||
return false;
|
||||
|
||||
if (!parentIndexes[i].Info.NumEntries)
|
||||
continue;
|
||||
|
||||
parentIndexes[i].Entries = Trinity::make_unique<DB2IndexEntry[]>(parentIndexes[i].Info.NumEntries);
|
||||
if (!source->Read(parentIndexes[i].Entries.get(), sizeof(DB2IndexEntry) * parentIndexes[i].Info.NumEntries))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_impl->SetAdditionalData(std::move(fieldData), std::move(idTable), std::move(copyTable), std::move(columnMeta),
|
||||
std::move(palletValues), std::move(palletArrayValues), std::move(commonValues), std::move(parentIndexes));
|
||||
_impl->SetAdditionalData(std::move(idTable), std::move(copyTable), std::move(parentIndexes));
|
||||
|
||||
uint32 fieldIndex = 0;
|
||||
if (!loadInfo->Meta->HasIndexFieldInData())
|
||||
{
|
||||
ASSERT(!loadInfo->Fields[0].IsSigned, "ID must be unsigned");
|
||||
++fieldIndex;
|
||||
}
|
||||
for (uint32 f = 0; f < loadInfo->Meta->FieldCount; ++f)
|
||||
{
|
||||
ASSERT(loadInfo->Fields[fieldIndex].IsSigned == _impl->IsSignedField(f), "Mismatched field signedness for field %u (%s)", f, loadInfo->Fields[fieldIndex].Name);
|
||||
fieldIndex += loadInfo->Meta->Fields[f].ArraySize;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,21 +39,27 @@ struct DB2Header
|
||||
uint32 MinId;
|
||||
uint32 MaxId;
|
||||
uint32 Locale;
|
||||
uint32 CopyTableSize;
|
||||
uint16 Flags;
|
||||
int16 IndexField;
|
||||
uint32 TotalFieldCount;
|
||||
uint32 PackedDataOffset;
|
||||
uint32 ParentLookupCount;
|
||||
uint32 CatalogDataOffset;
|
||||
uint32 IdTableSize;
|
||||
uint32 ColumnMetaSize;
|
||||
uint32 CommonDataSize;
|
||||
uint32 PalletDataSize;
|
||||
uint32 ParentLookupDataSize;
|
||||
uint32 SectionCount;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
struct TC_COMMON_API DB2FieldMeta
|
||||
{
|
||||
DB2FieldMeta(bool isSigned, DBCFormer type, char const* name);
|
||||
|
||||
bool IsSigned;
|
||||
DBCFormer Type;
|
||||
char const* Name;
|
||||
};
|
||||
|
||||
struct TC_COMMON_API DB2FileLoadInfo
|
||||
{
|
||||
DB2FileLoadInfo();
|
||||
@@ -82,6 +88,8 @@ struct TC_COMMON_API DB2FileSource
|
||||
// Returns current read position in file
|
||||
virtual std::size_t GetPosition() const = 0;
|
||||
|
||||
virtual bool SetPosition(std::size_t position) = 0;
|
||||
|
||||
virtual std::size_t GetFileSize() const = 0;
|
||||
|
||||
virtual char const* GetFileName() const = 0;
|
||||
|
||||
@@ -45,6 +45,11 @@ std::size_t DB2FileSystemSource::GetPosition() const
|
||||
return ftell(_file);
|
||||
}
|
||||
|
||||
bool DB2FileSystemSource::SetPosition(std::size_t position)
|
||||
{
|
||||
return fseek(_file, position, SEEK_SET) == 0;
|
||||
}
|
||||
|
||||
std::size_t DB2FileSystemSource::GetFileSize() const
|
||||
{
|
||||
boost::system::error_code error;
|
||||
|
||||
@@ -28,6 +28,7 @@ struct TC_COMMON_API DB2FileSystemSource : public DB2FileSource
|
||||
bool IsOpen() const override;
|
||||
bool Read(void* buffer, std::size_t numBytes) override;
|
||||
std::size_t GetPosition() const override;
|
||||
bool SetPosition(std::size_t position) override;
|
||||
std::size_t GetFileSize() const override;
|
||||
char const* GetFileName() const override;
|
||||
|
||||
|
||||
@@ -18,8 +18,12 @@
|
||||
#include "DB2Meta.h"
|
||||
#include "Errors.h"
|
||||
|
||||
DB2Meta::DB2Meta(int32 indexField, uint32 fieldCount, uint32 layoutHash, char const* types, uint8 const* arraySizes, int32 parentIndexField)
|
||||
: IndexField(indexField), ParentIndexField(parentIndexField), FieldCount(fieldCount), LayoutHash(layoutHash), Types(types), ArraySizes(arraySizes)
|
||||
DB2MetaField::DB2MetaField(DBCFormer type, uint8 arraySize, bool isSigned) : Type(type), ArraySize(arraySize), IsSigned(isSigned)
|
||||
{
|
||||
}
|
||||
|
||||
DB2Meta::DB2Meta(int32 indexField, uint32 fieldCount, uint32 layoutHash, DB2MetaField const* fields, int32 parentIndexField)
|
||||
: IndexField(indexField), ParentIndexField(parentIndexField), FieldCount(fieldCount), LayoutHash(layoutHash), Fields(fields)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -38,9 +42,9 @@ uint32 DB2Meta::GetRecordSize() const
|
||||
uint32 size = 0;
|
||||
for (uint32 i = 0; i < FieldCount; ++i)
|
||||
{
|
||||
for (uint8 j = 0; j < ArraySizes[i]; ++j)
|
||||
for (uint8 j = 0; j < Fields[i].ArraySize; ++j)
|
||||
{
|
||||
switch (Types[i])
|
||||
switch (Fields[i].Type)
|
||||
{
|
||||
case FT_BYTE:
|
||||
size += 1;
|
||||
@@ -56,10 +60,11 @@ uint32 DB2Meta::GetRecordSize() const
|
||||
size += 8;
|
||||
break;
|
||||
case FT_STRING:
|
||||
case FT_STRING_NOT_LOCALIZED:
|
||||
size += sizeof(char*);
|
||||
break;
|
||||
default:
|
||||
ASSERT(false, "Unsupported column type specified %c", Types[i]);
|
||||
ASSERT(false, "Unsupported column type specified %c", Fields[i].Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -82,9 +87,9 @@ int32 DB2Meta::GetParentIndexFieldOffset() const
|
||||
|
||||
for (int32 i = 0; i < ParentIndexField; ++i)
|
||||
{
|
||||
for (uint8 j = 0; j < ArraySizes[i]; ++j)
|
||||
for (uint8 j = 0; j < Fields[i].ArraySize; ++j)
|
||||
{
|
||||
switch (Types[i])
|
||||
switch (Fields[i].Type)
|
||||
{
|
||||
case FT_BYTE:
|
||||
offset += 1;
|
||||
@@ -100,10 +105,11 @@ int32 DB2Meta::GetParentIndexFieldOffset() const
|
||||
offset += 8;
|
||||
break;
|
||||
case FT_STRING:
|
||||
case FT_STRING_NOT_LOCALIZED:
|
||||
offset += sizeof(char*);
|
||||
break;
|
||||
default:
|
||||
ASSERT(false, "Unsupported column type specified %c", Types[i]);
|
||||
ASSERT(false, "Unsupported column type specified %c", Fields[i].Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -119,7 +125,7 @@ uint32 DB2Meta::GetDbIndexField() const
|
||||
|
||||
uint32 index = 0;
|
||||
for (uint32 i = 0; i < FieldCount && i < uint32(IndexField); ++i)
|
||||
index += ArraySizes[i];
|
||||
index += Fields[i].ArraySize;
|
||||
|
||||
return index;
|
||||
}
|
||||
@@ -128,7 +134,7 @@ uint32 DB2Meta::GetDbFieldCount() const
|
||||
{
|
||||
uint32 fields = 0;
|
||||
for (uint32 i = 0; i < FieldCount; ++i)
|
||||
fields += ArraySizes[i];
|
||||
fields += Fields[i].ArraySize;
|
||||
|
||||
if (!HasIndexFieldInData())
|
||||
++fields;
|
||||
@@ -136,7 +142,23 @@ uint32 DB2Meta::GetDbFieldCount() const
|
||||
return fields;
|
||||
}
|
||||
|
||||
DB2FieldMeta::DB2FieldMeta(bool isSigned, DBCFormer type, char const* name)
|
||||
: IsSigned(isSigned), Type(type), Name(name)
|
||||
bool DB2Meta::IsSignedField(uint32 field) const
|
||||
{
|
||||
switch (Fields[field].Type)
|
||||
{
|
||||
case FT_STRING:
|
||||
case FT_STRING_NOT_LOCALIZED:
|
||||
case FT_FLOAT:
|
||||
return false;
|
||||
case FT_INT:
|
||||
case FT_BYTE:
|
||||
case FT_SHORT:
|
||||
case FT_LONG:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (field == uint32(IndexField))
|
||||
return false;
|
||||
|
||||
return Fields[field].IsSigned;
|
||||
}
|
||||
|
||||
@@ -20,9 +20,18 @@
|
||||
|
||||
#include "Define.h"
|
||||
|
||||
struct TC_COMMON_API DB2MetaField
|
||||
{
|
||||
DB2MetaField(DBCFormer type, uint8 arraySize, bool isSigned);
|
||||
|
||||
DBCFormer Type;
|
||||
uint8 ArraySize;
|
||||
bool IsSigned;
|
||||
};
|
||||
|
||||
struct TC_COMMON_API DB2Meta
|
||||
{
|
||||
DB2Meta(int32 indexField, uint32 fieldCount, uint32 layoutHash, char const* types, uint8 const* arraySizes, int32 parentIndexField);
|
||||
DB2Meta(int32 indexField, uint32 fieldCount, uint32 layoutHash, DB2MetaField const* fields, int32 parentIndexField);
|
||||
|
||||
bool HasIndexFieldInData() const;
|
||||
|
||||
@@ -37,21 +46,13 @@ struct TC_COMMON_API DB2Meta
|
||||
uint32 GetDbIndexField() const;
|
||||
uint32 GetDbFieldCount() const;
|
||||
|
||||
bool IsSignedField(uint32 field) const;
|
||||
|
||||
int32 IndexField;
|
||||
int32 ParentIndexField;
|
||||
uint32 FieldCount;
|
||||
uint32 LayoutHash;
|
||||
char const* Types;
|
||||
uint8 const* ArraySizes;
|
||||
};
|
||||
|
||||
struct TC_COMMON_API DB2FieldMeta
|
||||
{
|
||||
DB2FieldMeta(bool isSigned, DBCFormer type, char const* name);
|
||||
|
||||
bool IsSigned;
|
||||
DBCFormer Type;
|
||||
char const* Name;
|
||||
DB2MetaField const* Fields;
|
||||
};
|
||||
|
||||
#endif // DB2Meta_h__
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Trinity
|
||||
* Note: container cannot be empty
|
||||
*/
|
||||
template<class C>
|
||||
inline auto SelectRandomWeightedContainerElement(C const& container, std::vector<double> weights) -> decltype(std::begin(container))
|
||||
inline auto SelectRandomWeightedContainerElement(C const& container, std::vector<double> const& weights) -> decltype(std::begin(container))
|
||||
{
|
||||
auto it = std::begin(container);
|
||||
std::advance(it, urandweighted(weights.size(), weights.data()));
|
||||
|
||||
@@ -407,7 +407,7 @@ uint32 Battlenet::Session::HandleGetAccountState(account::v1::GetAccountStateReq
|
||||
if (request->options().field_privacy_info())
|
||||
{
|
||||
response->mutable_state()->mutable_privacy_info()->set_is_using_rid(false);
|
||||
response->mutable_state()->mutable_privacy_info()->set_is_real_id_visible_for_view_friends(false);
|
||||
response->mutable_state()->mutable_privacy_info()->set_is_visible_for_view_friends(false);
|
||||
response->mutable_state()->mutable_privacy_info()->set_is_hidden_from_friend_finder(true);
|
||||
|
||||
response->mutable_tags()->set_privacy_info_tag(0xD7CA834D);
|
||||
|
||||
@@ -21,13 +21,13 @@ Battlenet::ServiceDispatcher::ServiceDispatcher()
|
||||
{
|
||||
AddService<Services::Account>();
|
||||
AddService<Services::Authentication>();
|
||||
AddService<Service<challenge::v1::ChallengeService>>();
|
||||
AddService<Service<channel::v1::ChannelService>>();
|
||||
AddService<Service<club::v1::membership::ClubMembershipService>>();
|
||||
AddService<Services::Connection>();
|
||||
AddService<Service<friends::v1::FriendsService>>();
|
||||
AddService<Services::GameUtilities>();
|
||||
AddService<Service<presence::v1::PresenceService>>();
|
||||
AddService<Service<report::v1::ReportService>>();
|
||||
AddService<Service<report::v2::ReportService>>();
|
||||
AddService<Service<resources::v1::ResourcesService>>();
|
||||
AddService<Service<user_manager::v1::UserManagerService>>();
|
||||
}
|
||||
|
||||
@@ -24,12 +24,15 @@
|
||||
#include "AccountService.h"
|
||||
#include "AuthenticationService.h"
|
||||
#include "challenge_service.pb.h"
|
||||
#include "channel_service.pb.h"
|
||||
#include "club_membership_listener.pb.h"
|
||||
#include "club_membership_service.pb.h"
|
||||
#include "ConnectionService.h"
|
||||
#include "friends_service.pb.h"
|
||||
#include "GameUtilitiesService.h"
|
||||
#include "presence_listener.pb.h"
|
||||
#include "presence_service.pb.h"
|
||||
#include "report_service.pb.h"
|
||||
#include "api/client/v2/report_service.pb.h"
|
||||
#include "resource_service.pb.h"
|
||||
#include "user_manager_service.pb.h"
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
"resettalents_time, primarySpecialization, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeonDifficulty, "
|
||||
"totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, "
|
||||
"health, power1, power2, power3, power4, power5, power6, instance_id, activeTalentGroup, lootSpecId, exploredZones, knownTitles, actionBars, grantableLevels, raidDifficulty, legacyRaidDifficulty, fishingSteps, "
|
||||
"honor, honorLevel, prestigeLevel, honorRestState, honorRestBonus "
|
||||
"honor, honorLevel, honorRestState, honorRestBonus "
|
||||
"FROM characters c LEFT JOIN character_fishingsteps cfs ON c.guid = cfs.guid WHERE c.guid = ?", CONNECTION_ASYNC);
|
||||
|
||||
PrepareStatement(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_BOTH);
|
||||
@@ -139,7 +139,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_BGDATA, "SELECT instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_GLYPHS, "SELECT talentGroup, glyphId FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_TALENTS, "SELECT talentId, talentGroup FROM character_talent WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_PVP_TALENTS, "SELECT talentId, talentGroup FROM character_pvp_talent WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_PVP_TALENTS, "SELECT talentId0, talentId1, talentId2, talentId3, talentGroup FROM character_pvp_talent WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_SKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_RANDOMBG, "SELECT guid FROM character_battleground_random WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_BANNED, "SELECT guid FROM character_banned WHERE guid = ? AND active = 1", CONNECTION_ASYNC);
|
||||
@@ -437,7 +437,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
"logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,primarySpecialization=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?,"
|
||||
"totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?,"
|
||||
"watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,power6=?,latency=?,activeTalentGroup=?,lootSpecId=?,exploredZones=?,"
|
||||
"equipmentCache=?,knownTitles=?,actionBars=?,grantableLevels=?,online=?,honor=?,honorLevel=?,prestigeLevel=?,honorRestState=?,honorRestBonus=?,lastLoginBuild=? WHERE guid=?", CONNECTION_ASYNC);
|
||||
"equipmentCache=?,knownTitles=?,actionBars=?,grantableLevels=?,online=?,honor=?,honorLevel=?,honorRestState=?,honorRestBonus=?,lastLoginBuild=? WHERE guid=?", CONNECTION_ASYNC);
|
||||
|
||||
PrepareStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG, "UPDATE characters SET at_login = at_login | ? WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_UPD_REM_AT_LOGIN_FLAG, "UPDATE characters set at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC);
|
||||
@@ -625,7 +625,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, "DELETE FROM petition_sign WHERE ownerguid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHAR_GLYPHS, "INSERT INTO character_glyphs VALUES(?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, talentId, talentGroup) VALUES (?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHAR_PVP_TALENT, "INSERT INTO character_pvp_talent (guid, talentId, talentGroup) VALUES (?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHAR_PVP_TALENT, "INSERT INTO character_pvp_talent (guid, talentId0, talentId1, talentId2, talentId3, talentGroup) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_UPD_CHAR_LIST_SLOT, "UPDATE characters SET slot = ? WHERE guid = ? AND account = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHAR_FISHINGSTEPS, "INSERT INTO character_fishingsteps (guid, fishingSteps) VALUES (?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_DEL_CHAR_FISHINGSTEPS, "DELETE FROM character_fishingsteps WHERE guid = ?", CONNECTION_ASYNC);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,8 @@ enum HotfixDatabaseStatements : uint32
|
||||
HOTFIX_SEL_ACHIEVEMENT,
|
||||
HOTFIX_SEL_ACHIEVEMENT_LOCALE,
|
||||
|
||||
HOTFIX_SEL_ANIMATION_DATA,
|
||||
|
||||
HOTFIX_SEL_ANIM_KIT,
|
||||
|
||||
HOTFIX_SEL_AREA_GROUP_MEMBER,
|
||||
@@ -126,6 +128,8 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_CINEMATIC_SEQUENCES,
|
||||
|
||||
HOTFIX_SEL_CONTENT_TUNING,
|
||||
|
||||
HOTFIX_SEL_CONVERSATION_LINE,
|
||||
|
||||
HOTFIX_SEL_CREATURE_DISPLAY_INFO,
|
||||
@@ -170,6 +174,10 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_EMOTES_TEXT_SOUND,
|
||||
|
||||
HOTFIX_SEL_EXPECTED_STAT,
|
||||
|
||||
HOTFIX_SEL_EXPECTED_STAT_MOD,
|
||||
|
||||
HOTFIX_SEL_FACTION,
|
||||
HOTFIX_SEL_FACTION_LOCALE,
|
||||
|
||||
@@ -197,7 +205,6 @@ enum HotfixDatabaseStatements : uint32
|
||||
HOTFIX_SEL_GARR_FOLLOWER_X_ABILITY,
|
||||
|
||||
HOTFIX_SEL_GARR_PLOT,
|
||||
HOTFIX_SEL_GARR_PLOT_LOCALE,
|
||||
|
||||
HOTFIX_SEL_GARR_PLOT_BUILDING,
|
||||
|
||||
@@ -359,6 +366,8 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_NAMES_RESERVED_LOCALE,
|
||||
|
||||
HOTFIX_SEL_NUM_TALENTS_AT_LEVEL,
|
||||
|
||||
HOTFIX_SEL_OVERRIDE_SPELL_DATA,
|
||||
|
||||
HOTFIX_SEL_PHASE,
|
||||
@@ -379,12 +388,12 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_PVP_ITEM,
|
||||
|
||||
HOTFIX_SEL_PVP_REWARD,
|
||||
|
||||
HOTFIX_SEL_PVP_TALENT,
|
||||
HOTFIX_SEL_PVP_TALENT_LOCALE,
|
||||
|
||||
HOTFIX_SEL_PVP_TALENT_UNLOCK,
|
||||
HOTFIX_SEL_PVP_TALENT_CATEGORY,
|
||||
|
||||
HOTFIX_SEL_PVP_TALENT_SLOT_UNLOCK,
|
||||
|
||||
HOTFIX_SEL_QUEST_FACTION_REWARD,
|
||||
|
||||
@@ -409,8 +418,6 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_RULESET_ITEM_UPGRADE,
|
||||
|
||||
HOTFIX_SEL_SANDBOX_SCALING,
|
||||
|
||||
HOTFIX_SEL_SCALING_STAT_DISTRIBUTION,
|
||||
|
||||
HOTFIX_SEL_SCENARIO,
|
||||
@@ -439,9 +446,6 @@ enum HotfixDatabaseStatements : uint32
|
||||
HOTFIX_SEL_SPECIALIZATION_SPELLS,
|
||||
HOTFIX_SEL_SPECIALIZATION_SPELLS_LOCALE,
|
||||
|
||||
HOTFIX_SEL_SPELL,
|
||||
HOTFIX_SEL_SPELL_LOCALE,
|
||||
|
||||
HOTFIX_SEL_SPELL_AURA_OPTIONS,
|
||||
|
||||
HOTFIX_SEL_SPELL_AURA_RESTRICTIONS,
|
||||
@@ -481,6 +485,9 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_SPELL_MISC,
|
||||
|
||||
HOTFIX_SEL_SPELL_NAME,
|
||||
HOTFIX_SEL_SPELL_NAME_LOCALE,
|
||||
|
||||
HOTFIX_SEL_SPELL_POWER,
|
||||
|
||||
HOTFIX_SEL_SPELL_POWER_DIFFICULTY,
|
||||
@@ -543,6 +550,15 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_TRANSPORT_ROTATION,
|
||||
|
||||
HOTFIX_SEL_UI_MAP,
|
||||
HOTFIX_SEL_UI_MAP_LOCALE,
|
||||
|
||||
HOTFIX_SEL_UI_MAP_ASSIGNMENT,
|
||||
|
||||
HOTFIX_SEL_UI_MAP_LINK,
|
||||
|
||||
HOTFIX_SEL_UI_MAP_X_MAP_ART,
|
||||
|
||||
HOTFIX_SEL_UNIT_POWER_BAR,
|
||||
HOTFIX_SEL_UNIT_POWER_BAR_LOCALE,
|
||||
|
||||
@@ -555,12 +571,8 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_WORLD_EFFECT,
|
||||
|
||||
HOTFIX_SEL_WORLD_MAP_AREA,
|
||||
|
||||
HOTFIX_SEL_WORLD_MAP_OVERLAY,
|
||||
|
||||
HOTFIX_SEL_WORLD_MAP_TRANSFORMS,
|
||||
|
||||
HOTFIX_SEL_WORLD_SAFE_LOCS,
|
||||
HOTFIX_SEL_WORLD_SAFE_LOCS_LOCALE,
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ void WorldDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID, "SELECT id FROM waypoint_scripts WHERE guid = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_DEL_CREATURE, "DELETE FROM creature WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(WORLD_SEL_COMMANDS, "SELECT name, permission, help FROM command", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, femaleName, subname, TitleAlt, IconName, gossip_menu_id, minlevel, maxlevel, HealthScalingExpansion, RequiredExpansion, VignetteID, faction, npcflag, speed_walk, speed_run, scale, rank, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, unit_flags3, dynamicflags, family, trainer_class, type, type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, ArmorModifier, DamageModifier, ExperienceModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, name, femaleName, subname, TitleAlt, IconName, gossip_menu_id, minlevel, maxlevel, HealthScalingExpansion, RequiredExpansion, VignetteID, faction, npcflag, speed_walk, speed_run, scale, rank, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, unit_flags3, dynamicflags, family, trainer_class, type, type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, ArmorModifier, DamageModifier, ExperienceModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_GAMEOBJECT_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM gameobject WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_", CONNECTION_SYNCH);
|
||||
|
||||
@@ -412,10 +412,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature))
|
||||
{
|
||||
uint32 displayId = ObjectMgr::ChooseDisplayId(ci);
|
||||
(*itr)->ToCreature()->SetDisplayId(displayId);
|
||||
CreatureModel const* model = ObjectMgr::ChooseDisplayId(ci);
|
||||
(*itr)->ToCreature()->SetDisplayId(model->CreatureDisplayID, model->DisplayScale);
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, %s set displayid to %u",
|
||||
(*itr)->GetEntry(), (*itr)->GetGUID().ToString().c_str(), displayId);
|
||||
(*itr)->GetEntry(), (*itr)->GetGUID().ToString().c_str(), model->CreatureDisplayID);
|
||||
}
|
||||
}
|
||||
//if no param1, then use value from param2 (modelId)
|
||||
@@ -1291,7 +1291,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (e.action.morphOrMount.creature > 0)
|
||||
{
|
||||
if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature))
|
||||
(*itr)->ToUnit()->Mount(ObjectMgr::ChooseDisplayId(cInfo));
|
||||
(*itr)->ToUnit()->Mount(ObjectMgr::ChooseDisplayId(cInfo)->CreatureDisplayID);
|
||||
}
|
||||
else
|
||||
(*itr)->ToUnit()->Mount(e.action.morphOrMount.model);
|
||||
|
||||
@@ -597,7 +597,7 @@ void PlayerAchievementMgr::SendAchievementEarned(AchievementEntry const* achieve
|
||||
if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH))
|
||||
{
|
||||
// broadcast realm first reached
|
||||
WorldPackets::Achievement::ServerFirstAchievement serverFirstAchievement;
|
||||
WorldPackets::Achievement::BroadcastAchievement serverFirstAchievement;
|
||||
serverFirstAchievement.Name = _owner->GetName();
|
||||
serverFirstAchievement.PlayerGUID = _owner->GetGUID();
|
||||
serverFirstAchievement.AchievementID = achievement->ID;
|
||||
@@ -945,7 +945,7 @@ void GuildAchievementMgr::SendAchievementEarned(AchievementEntry const* achievem
|
||||
if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH))
|
||||
{
|
||||
// broadcast realm first reached
|
||||
WorldPackets::Achievement::ServerFirstAchievement serverFirstAchievement;
|
||||
WorldPackets::Achievement::BroadcastAchievement serverFirstAchievement;
|
||||
serverFirstAchievement.Name = _owner->GetName();
|
||||
serverFirstAchievement.PlayerGUID = _owner->GetGUID();
|
||||
serverFirstAchievement.AchievementID = achievement->ID;
|
||||
|
||||
@@ -107,7 +107,7 @@ bool CriteriaData::IsValid(Criteria const* criteria)
|
||||
criteria->ID, criteria->Entry->Type, DataType, ClassRace.Class);
|
||||
return false;
|
||||
}
|
||||
if (ClassRace.Race && ((1 << (ClassRace.Race-1)) & RACEMASK_ALL_PLAYABLE) == 0)
|
||||
if (ClassRace.Race && ((UI64LIT(1) << (ClassRace.Race-1)) & RACEMASK_ALL_PLAYABLE) == 0)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `criteria_data` (Entry: %u Type: %u) for data type CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) contains a non-existing race in value2 (%u), ignored.",
|
||||
criteria->ID, criteria->Entry->Type, DataType, ClassRace.Race);
|
||||
@@ -252,7 +252,7 @@ bool CriteriaData::IsValid(Criteria const* criteria)
|
||||
criteria->ID, criteria->Entry->Type, DataType, ClassRace.Class);
|
||||
return false;
|
||||
}
|
||||
if (ClassRace.Race && ((1 << (ClassRace.Race-1)) & RACEMASK_ALL_PLAYABLE) == 0)
|
||||
if (ClassRace.Race && ((UI64LIT(1) << (ClassRace.Race-1)) & RACEMASK_ALL_PLAYABLE) == 0)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `criteria_data` (Entry: %u Type: %u) for data type CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) contains a non-existing race entry in value2 (%u), ignored.",
|
||||
criteria->ID, criteria->Entry->Type, DataType, ClassRace.Race);
|
||||
@@ -504,6 +504,8 @@ void CriteriaHandler::UpdateCriteria(CriteriaTypes type, uint64 miscValue1 /*= 0
|
||||
case CRITERIA_TYPE_OWN_BATTLE_PET_COUNT:
|
||||
case CRITERIA_TYPE_HONOR_LEVEL_REACHED:
|
||||
case CRITERIA_TYPE_PRESTIGE_REACHED:
|
||||
case CRITERIA_TYPE_APPEARANCE_UNLOCKED_BY_SLOT:
|
||||
case CRITERIA_TYPE_TRANSMOG_SET_UNLOCKED:
|
||||
SetCriteriaProgress(criteria, 1, referencePlayer, PROGRESS_ACCUMULATE);
|
||||
break;
|
||||
// std case: increment at miscValue1
|
||||
@@ -593,7 +595,7 @@ void CriteriaHandler::UpdateCriteria(CriteriaTypes type, uint64 miscValue1 /*= 0
|
||||
for (RewardedQuestSet::const_iterator itr = rewQuests.begin(); itr != rewQuests.end(); ++itr)
|
||||
{
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(*itr);
|
||||
if (quest && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == criteria->Entry->Asset.ZoneID)
|
||||
if (quest && quest->GetZoneOrSort() >= 0 && quest->GetZoneOrSort() == criteria->Entry->Asset.ZoneID)
|
||||
++counter;
|
||||
}
|
||||
SetCriteriaProgress(criteria, counter, referencePlayer);
|
||||
@@ -655,7 +657,7 @@ void CriteriaHandler::UpdateCriteria(CriteriaTypes type, uint64 miscValue1 /*= 0
|
||||
SetCriteriaProgress(criteria, referencePlayer->GetReputationMgr().GetVisibleFactionCount(), referencePlayer);
|
||||
break;
|
||||
case CRITERIA_TYPE_EARN_HONORABLE_KILL:
|
||||
SetCriteriaProgress(criteria, referencePlayer->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS), referencePlayer);
|
||||
SetCriteriaProgress(criteria, referencePlayer->GetUInt32Value(ACTIVE_PLAYER_FIELD_LIFETIME_HONORABLE_KILLS), referencePlayer);
|
||||
break;
|
||||
case CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED:
|
||||
SetCriteriaProgress(criteria, referencePlayer->GetMoney(), referencePlayer, PROGRESS_HIGHEST);
|
||||
@@ -700,16 +702,6 @@ void CriteriaHandler::UpdateCriteria(CriteriaTypes type, uint64 miscValue1 /*= 0
|
||||
case CRITERIA_TYPE_REACH_GUILD_LEVEL:
|
||||
SetCriteriaProgress(criteria, miscValue1, referencePlayer);
|
||||
break;
|
||||
case CRITERIA_TYPE_TRANSMOG_SET_UNLOCKED:
|
||||
if (miscValue1 != criteria->Entry->Asset.TransmogSetGroupID)
|
||||
continue;
|
||||
SetCriteriaProgress(criteria, 1, referencePlayer, PROGRESS_ACCUMULATE);
|
||||
break;
|
||||
case CRITERIA_TYPE_APPEARANCE_UNLOCKED_BY_SLOT:
|
||||
if (!miscValue2 /*login case*/ || miscValue1 != criteria->Entry->Asset.EquipmentSlot)
|
||||
continue;
|
||||
SetCriteriaProgress(criteria, 1, referencePlayer, PROGRESS_ACCUMULATE);
|
||||
break;
|
||||
// FIXME: not triggered in code as result, need to implement
|
||||
case CRITERIA_TYPE_COMPLETE_RAID:
|
||||
case CRITERIA_TYPE_PLAY_ARENA:
|
||||
@@ -789,6 +781,9 @@ void CriteriaHandler::UpdateCriteria(CriteriaTypes type, uint64 miscValue1 /*= 0
|
||||
case CRITERIA_TYPE_GAIN_PARAGON_REPUTATION:
|
||||
case CRITERIA_TYPE_EARN_HONOR_XP:
|
||||
case CRITERIA_TYPE_RELIC_TALENT_UNLOCKED:
|
||||
case CRITERIA_TYPE_REACH_ACCOUNT_HONOR_LEVEL:
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_ARTIFACT_POWER_EARNED:
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_LEVEL_REACHED:
|
||||
break; // Not implemented yet :(
|
||||
}
|
||||
|
||||
@@ -1151,6 +1146,9 @@ bool CriteriaHandler::IsCompletedCriteria(Criteria const* criteria, uint64 requi
|
||||
case CRITERIA_TYPE_GAIN_PARAGON_REPUTATION:
|
||||
case CRITERIA_TYPE_EARN_HONOR_XP:
|
||||
case CRITERIA_TYPE_RELIC_TALENT_UNLOCKED:
|
||||
case CRITERIA_TYPE_REACH_ACCOUNT_HONOR_LEVEL:
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_ARTIFACT_POWER_EARNED:
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_LEVEL_REACHED:
|
||||
return progress->Counter >= requiredAmount;
|
||||
case CRITERIA_TYPE_COMPLETE_ACHIEVEMENT:
|
||||
case CRITERIA_TYPE_COMPLETE_QUEST:
|
||||
@@ -1335,22 +1333,22 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
case CRITERIA_TYPE_WIN_BG:
|
||||
case CRITERIA_TYPE_COMPLETE_BATTLEGROUND:
|
||||
case CRITERIA_TYPE_DEATH_AT_MAP:
|
||||
if (!miscValue1 || criteria->Entry->Asset.MapID != referencePlayer->GetMapId())
|
||||
if (!miscValue1 || uint32(criteria->Entry->Asset.MapID) != referencePlayer->GetMapId())
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_KILL_CREATURE:
|
||||
case CRITERIA_TYPE_KILLED_BY_CREATURE:
|
||||
if (!miscValue1 || criteria->Entry->Asset.CreatureID != miscValue1)
|
||||
if (!miscValue1 || uint32(criteria->Entry->Asset.CreatureID) != miscValue1)
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_REACH_SKILL_LEVEL:
|
||||
case CRITERIA_TYPE_LEARN_SKILL_LEVEL:
|
||||
// update at loading or specific skill update
|
||||
if (miscValue1 && miscValue1 != criteria->Entry->Asset.SkillID)
|
||||
if (miscValue1 && miscValue1 != uint32(criteria->Entry->Asset.SkillID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE:
|
||||
if (miscValue1 && miscValue1 != criteria->Entry->Asset.ZoneID)
|
||||
if (miscValue1 && miscValue1 != uint32(criteria->Entry->Asset.ZoneID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_DEATH:
|
||||
@@ -1369,7 +1367,7 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
return false;
|
||||
|
||||
//FIXME: work only for instances where max == min for players
|
||||
if (map->ToInstanceMap()->GetMaxPlayers() != criteria->Entry->Asset.GroupSize)
|
||||
if (map->ToInstanceMap()->GetMaxPlayers() != uint32(criteria->Entry->Asset.GroupSize))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
@@ -1378,7 +1376,7 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_DEATHS_FROM:
|
||||
if (!miscValue1 || miscValue2 != criteria->Entry->Asset.DamageType)
|
||||
if (!miscValue1 || miscValue2 != uint32(criteria->Entry->Asset.DamageType))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_COMPLETE_QUEST:
|
||||
@@ -1386,7 +1384,7 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
// if miscValues != 0, it contains the questID.
|
||||
if (miscValue1)
|
||||
{
|
||||
if (miscValue1 != criteria->Entry->Asset.QuestID)
|
||||
if (miscValue1 != uint32(criteria->Entry->Asset.QuestID))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -1405,11 +1403,11 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
case CRITERIA_TYPE_BE_SPELL_TARGET2:
|
||||
case CRITERIA_TYPE_CAST_SPELL:
|
||||
case CRITERIA_TYPE_CAST_SPELL2:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.SpellID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.SpellID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_LEARN_SPELL:
|
||||
if (miscValue1 && miscValue1 != criteria->Entry->Asset.SpellID)
|
||||
if (miscValue1 && miscValue1 != uint32(criteria->Entry->Asset.SpellID))
|
||||
return false;
|
||||
|
||||
if (!referencePlayer->HasSpell(criteria->Entry->Asset.SpellID))
|
||||
@@ -1418,17 +1416,17 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
case CRITERIA_TYPE_LOOT_TYPE:
|
||||
// miscValue1 = itemId - miscValue2 = count of item loot
|
||||
// miscValue3 = loot_type (note: 0 = LOOT_CORPSE and then it ignored)
|
||||
if (!miscValue1 || !miscValue2 || !miscValue3 || miscValue3 != criteria->Entry->Asset.LootType)
|
||||
if (!miscValue1 || !miscValue2 || !miscValue3 || miscValue3 != uint32(criteria->Entry->Asset.LootType))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_OWN_ITEM:
|
||||
if (miscValue1 && criteria->Entry->Asset.ItemID != miscValue1)
|
||||
if (miscValue1 && uint32(criteria->Entry->Asset.ItemID) != miscValue1)
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_USE_ITEM:
|
||||
case CRITERIA_TYPE_LOOT_ITEM:
|
||||
case CRITERIA_TYPE_EQUIP_ITEM:
|
||||
if (!miscValue1 || criteria->Entry->Asset.ItemID != miscValue1)
|
||||
if (!miscValue1 || uint32(criteria->Entry->Asset.ItemID )!= miscValue1)
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_EXPLORE_AREA:
|
||||
@@ -1452,7 +1450,7 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
continue;
|
||||
|
||||
uint32 mask = 1 << (uint32(area->AreaBit) % 32);
|
||||
if (referencePlayer->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask)
|
||||
if (referencePlayer->GetUInt32Value(ACTIVE_PLAYER_FIELD_EXPLORED_ZONES + playerIndexOffset) & mask)
|
||||
{
|
||||
matchFound = true;
|
||||
break;
|
||||
@@ -1464,19 +1462,19 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
break;
|
||||
}
|
||||
case CRITERIA_TYPE_GAIN_REPUTATION:
|
||||
if (miscValue1 && miscValue1 != criteria->Entry->Asset.FactionID)
|
||||
if (miscValue1 && miscValue1 != uint32(criteria->Entry->Asset.FactionID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_EQUIP_EPIC_ITEM:
|
||||
// miscValue1 = itemid miscValue2 = itemSlot
|
||||
if (!miscValue1 || miscValue2 != criteria->Entry->Asset.ItemSlot)
|
||||
if (!miscValue1 || miscValue2 != uint32(criteria->Entry->Asset.ItemSlot))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_ROLL_NEED_ON_LOOT:
|
||||
case CRITERIA_TYPE_ROLL_GREED_ON_LOOT:
|
||||
{
|
||||
// miscValue1 = itemid miscValue2 = diced value
|
||||
if (!miscValue1 || miscValue2 != criteria->Entry->Asset.RollValue)
|
||||
if (!miscValue1 || miscValue2 != uint32(criteria->Entry->Asset.RollValue))
|
||||
return false;
|
||||
|
||||
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(uint32(miscValue1));
|
||||
@@ -1485,7 +1483,7 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
break;
|
||||
}
|
||||
case CRITERIA_TYPE_DO_EMOTE:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.EmoteID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.EmoteID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_DAMAGE_DONE:
|
||||
@@ -1505,12 +1503,12 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
break;
|
||||
case CRITERIA_TYPE_USE_GAMEOBJECT:
|
||||
case CRITERIA_TYPE_FISH_IN_GAMEOBJECT:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.GameObjectID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.GameObjectID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS:
|
||||
case CRITERIA_TYPE_LEARN_SKILL_LINE:
|
||||
if (miscValue1 && miscValue1 != criteria->Entry->Asset.SkillID)
|
||||
if (miscValue1 && miscValue1 != uint32(criteria->Entry->Asset.SkillID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_LOOT_EPIC_ITEM:
|
||||
@@ -1524,34 +1522,42 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
break;
|
||||
}
|
||||
case CRITERIA_TYPE_HK_CLASS:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.ClassID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.ClassID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_HK_RACE:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.RaceID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.RaceID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.ObjectiveId)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.ObjectiveId))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_HONORABLE_KILL_AT_AREA:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.AreaID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.AreaID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_CURRENCY:
|
||||
if (!miscValue1 || !miscValue2 || int64(miscValue2) < 0
|
||||
|| miscValue1 != criteria->Entry->Asset.CurrencyID)
|
||||
|| miscValue1 != uint32(criteria->Entry->Asset.CurrencyID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_WIN_ARENA:
|
||||
if (miscValue1 != criteria->Entry->Asset.MapID)
|
||||
if (miscValue1 != uint32(criteria->Entry->Asset.MapID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_HIGHEST_TEAM_RATING:
|
||||
return false;
|
||||
case CRITERIA_TYPE_PLACE_GARRISON_BUILDING:
|
||||
if (miscValue1 != criteria->Entry->Asset.GarrBuildingID)
|
||||
if (miscValue1 != uint32(criteria->Entry->Asset.GarrBuildingID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_TRANSMOG_SET_UNLOCKED:
|
||||
if (miscValue1 != uint32(criteria->Entry->Asset.TransmogSetGroupID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_APPEARANCE_UNLOCKED_BY_SLOT:
|
||||
if (!miscValue2 /*login case*/ || miscValue1 != uint32(criteria->Entry->Asset.EquipmentSlot))
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
@@ -1781,9 +1787,7 @@ bool CriteriaHandler::AdditionalRequirementsSatisfied(ModifierTreeNode const* tr
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_ADDITIONAL_CONDITION_PRESTIGE_LEVEL: // 194
|
||||
if (!referencePlayer || referencePlayer->GetPrestigeLevel() != reqValue)
|
||||
return false;
|
||||
break;
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2157,6 +2161,12 @@ char const* CriteriaMgr::GetCriteriaTypeString(CriteriaTypes type)
|
||||
return "EARN_HONOR_XP";
|
||||
case CRITERIA_TYPE_RELIC_TALENT_UNLOCKED:
|
||||
return "RELIC_TALENT_UNLOCKED";
|
||||
case CRITERIA_TYPE_REACH_ACCOUNT_HONOR_LEVEL:
|
||||
return "REACH_ACCOUNT_HONOR_LEVEL";
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_ARTIFACT_POWER_EARNED:
|
||||
return "HEART_OF_AZEROTH_ARTIFACT_POWER_EARNED";
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_LEVEL_REACHED:
|
||||
return "HEART_OF_AZEROTH_LEVEL_REACHED";
|
||||
}
|
||||
return "MISSING_TYPE";
|
||||
}
|
||||
|
||||
@@ -444,7 +444,7 @@ void BattlePetMgr::SummonPet(ObjectGuid guid)
|
||||
return;
|
||||
|
||||
// TODO: set proper CreatureID for spell DEFAULT_SUMMON_BATTLE_PET_SPELL (default EffectMiscValueA is 40721 - Murkimus the Gladiator)
|
||||
_owner->GetPlayer()->SetGuidValue(PLAYER_FIELD_SUMMONED_BATTLE_PET_ID, guid);
|
||||
_owner->GetPlayer()->SetGuidValue(ACTIVE_PLAYER_FIELD_SUMMONED_BATTLE_PET_ID, guid);
|
||||
_owner->GetPlayer()->CastSpell(_owner->GetPlayer(), speciesEntry->SummonSpellID ? speciesEntry->SummonSpellID : uint32(DEFAULT_SUMMON_BATTLE_PET_SPELL));
|
||||
|
||||
// TODO: set pet level, quality... update fields
|
||||
@@ -454,10 +454,10 @@ void BattlePetMgr::DismissPet()
|
||||
{
|
||||
Player* ownerPlayer = _owner->GetPlayer();
|
||||
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*ownerPlayer, ownerPlayer->GetCritterGUID());
|
||||
if (pet && ownerPlayer->GetGuidValue(PLAYER_FIELD_SUMMONED_BATTLE_PET_ID) == pet->GetGuidValue(UNIT_FIELD_BATTLE_PET_COMPANION_GUID))
|
||||
if (pet && ownerPlayer->GetGuidValue(ACTIVE_PLAYER_FIELD_SUMMONED_BATTLE_PET_ID) == pet->GetGuidValue(UNIT_FIELD_BATTLE_PET_COMPANION_GUID))
|
||||
{
|
||||
pet->DespawnOrUnsummon();
|
||||
ownerPlayer->SetGuidValue(PLAYER_FIELD_SUMMONED_BATTLE_PET_ID, ObjectGuid::Empty);
|
||||
ownerPlayer->SetGuidValue(ACTIVE_PLAYER_FIELD_SUMMONED_BATTLE_PET_ID, ObjectGuid::Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1289,9 +1289,10 @@ void Battleground::BuildPvPLogDataPacket(WorldPackets::Battleground::PVPLogData&
|
||||
{
|
||||
playerData.IsInWorld = true;
|
||||
playerData.PrimaryTalentTree = player->GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID);
|
||||
playerData.PrimaryTalentTreeNameIndex = 0;
|
||||
playerData.Sex = player->getGender();
|
||||
playerData.Race = player->getRace();
|
||||
playerData.Prestige = player->GetPrestigeLevel();
|
||||
playerData.Class = player->getClass();
|
||||
playerData.HonorLevel = player->GetHonorLevel();
|
||||
}
|
||||
|
||||
pvpLogData.Players.push_back(playerData);
|
||||
|
||||
@@ -463,6 +463,7 @@ void CalendarMgr::SendCalendarEventUpdateAlert(CalendarEvent const& calendarEven
|
||||
packet.ClearPending = true; // FIXME
|
||||
packet.Date = calendarEvent.GetDate();
|
||||
packet.Description = calendarEvent.GetDescription();
|
||||
packet.EventClubID = calendarEvent.GetGuildId();
|
||||
packet.EventID = calendarEvent.GetEventId();
|
||||
packet.EventName = calendarEvent.GetTitle();
|
||||
packet.EventType = calendarEvent.GetType();
|
||||
@@ -534,18 +535,15 @@ void CalendarMgr::SendCalendarEventInviteAlert(CalendarEvent const& calendarEven
|
||||
packet.OwnerGuid = calendarEvent.GetOwnerGUID();
|
||||
packet.Status = invite.GetStatus();
|
||||
packet.TextureID = calendarEvent.GetTextureId();
|
||||
|
||||
Guild* guild = sGuildMgr->GetGuildById(calendarEvent.GetGuildId());
|
||||
packet.EventGuildID = guild ? guild->GetGUID() : ObjectGuid::Empty;
|
||||
packet.EventClubID = calendarEvent.GetGuildId();
|
||||
|
||||
if (calendarEvent.IsGuildEvent() || calendarEvent.IsGuildAnnouncement())
|
||||
{
|
||||
if (guild)
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(calendarEvent.GetGuildId()))
|
||||
guild->BroadcastPacket(packet.Write());
|
||||
}
|
||||
else
|
||||
if (Player* player = ObjectAccessor::FindConnectedPlayer(invite.GetInviteeGUID()))
|
||||
player->SendDirectMessage(packet.Write());
|
||||
else if (Player* player = ObjectAccessor::FindConnectedPlayer(invite.GetInviteeGUID()))
|
||||
player->SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
void CalendarMgr::SendCalendarEvent(ObjectGuid guid, CalendarEvent const& calendarEvent, CalendarSendEventType sendType)
|
||||
@@ -567,9 +565,7 @@ void CalendarMgr::SendCalendarEvent(ObjectGuid guid, CalendarEvent const& calend
|
||||
packet.LockDate = calendarEvent.GetLockDate(); // Always 0 ?
|
||||
packet.OwnerGuid = calendarEvent.GetOwnerGUID();
|
||||
packet.TextureID = calendarEvent.GetTextureId();
|
||||
|
||||
Guild* guild = sGuildMgr->GetGuildById(calendarEvent.GetGuildId());
|
||||
packet.EventGuildID = (guild ? guild->GetGUID() : ObjectGuid::Empty);
|
||||
packet.EventClubID = calendarEvent.GetGuildId();
|
||||
|
||||
for (auto const& calendarInvite : eventInviteeList)
|
||||
{
|
||||
|
||||
@@ -455,7 +455,7 @@ bool ChatHandler::isValidChatMessage(char const* message)
|
||||
/*
|
||||
Valid examples:
|
||||
|cffa335ee|Hitem:812:0:0:0:0:0:0:0:70|h[Glowing Brightwood Staff]|h|r
|
||||
|cff808080|Hquest:2278:47|h[The Platinum Discs]|h|r
|
||||
|cffffff00|Hquest:51101:-1:110:120:5|h[The Wounded King]|h|r
|
||||
|cffffd000|Htrade:4037:1:150:1:6AAAAAAAAAAAAAAAAAAAAAAOAADAAAAAAAAAAAAAAAAIAAAAAAAAA|h[Engineering]|h|r
|
||||
|cff4e96f7|Htalent:2232:-1|h[Taste for Blood]|h|r
|
||||
|cff71d5ff|Hspell:21563|h[Command]|h|r
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
// - client, item icon shift click
|
||||
// |color|Hitemset:itemset_id|h[name]|h|r
|
||||
// |color|Hplayer:name|h[name]|h|r - client, in some messages, at click copy only name instead link
|
||||
// |color|Hquest:quest_id:quest_level|h[name]|h|r - client, quest list name shift-click
|
||||
// |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r
|
||||
// - client, quest list name shift-click
|
||||
// |color|Hskill:skill_id|h[name]|h|r
|
||||
// |color|Hspell:spell_id|h[name]|h|r - client, spellbook spell icon shift-click
|
||||
// |color|Htalent:talent_id, rank|h[name]|h|r - client, talent icon shift-click
|
||||
@@ -395,8 +396,8 @@ bool ItemChatLink::ValidateName(char* buffer, char const* context)
|
||||
return false;
|
||||
}
|
||||
|
||||
// |color|Hquest:quest_id:quest_level|h[name]|h|r
|
||||
// |cff808080|Hquest:2278:47|h[The Platinum Discs]|h|r
|
||||
// |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r
|
||||
// |cffffff00|Hquest:51101:-1:110:120:5|h[The Wounded King]|h|r
|
||||
bool QuestChatLink::Initialize(std::istringstream& iss)
|
||||
{
|
||||
// Read quest id
|
||||
@@ -428,6 +429,21 @@ bool QuestChatLink::Initialize(std::istringstream& iss)
|
||||
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): quest level %d is too big", iss.str().c_str(), _questLevel);
|
||||
return false;
|
||||
}
|
||||
if (!ReadInt32(iss, _minLevel))
|
||||
{
|
||||
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest min level", iss.str().c_str());
|
||||
return false;
|
||||
}
|
||||
if (!ReadInt32(iss, _maxLevel))
|
||||
{
|
||||
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest max level", iss.str().c_str());
|
||||
return false;
|
||||
}
|
||||
if (!ReadInt32(iss, _scalingFaction))
|
||||
{
|
||||
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest scaling faction", iss.str().c_str());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,13 +90,16 @@ protected:
|
||||
class TC_GAME_API QuestChatLink : public ChatLink
|
||||
{
|
||||
public:
|
||||
QuestChatLink() : ChatLink(), _quest(nullptr), _questLevel(0) { }
|
||||
QuestChatLink() : ChatLink(), _quest(nullptr), _questLevel(0), _minLevel(0), _maxLevel(0), _scalingFaction(0) { }
|
||||
virtual bool Initialize(std::istringstream& iss) override;
|
||||
virtual bool ValidateName(char* buffer, const char* context) override;
|
||||
|
||||
protected:
|
||||
Quest const* _quest;
|
||||
int32 _questLevel;
|
||||
int32 _minLevel;
|
||||
int32 _maxLevel;
|
||||
int32 _scalingFaction;
|
||||
};
|
||||
|
||||
// SpellChatLink - link to quest
|
||||
|
||||
@@ -2002,7 +2002,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
|
||||
}
|
||||
case CONDITION_CLASS:
|
||||
{
|
||||
if (!(cond->ConditionValue1 & CLASSMASK_ALL_PLAYABLE))
|
||||
if (cond->ConditionValue1 & ~CLASSMASK_ALL_PLAYABLE)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "%s has non existing classmask (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1 & ~CLASSMASK_ALL_PLAYABLE);
|
||||
return false;
|
||||
@@ -2011,9 +2011,9 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
|
||||
}
|
||||
case CONDITION_RACE:
|
||||
{
|
||||
if (!(cond->ConditionValue1 & RACEMASK_ALL_PLAYABLE))
|
||||
if (cond->ConditionValue1 & ~RACEMASK_ALL_PLAYABLE)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "%s has non existing racemask (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1 & ~RACEMASK_ALL_PLAYABLE);
|
||||
TC_LOG_ERROR("sql.sql", "%s has non existing racemask (" UI64FMTD "), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1 & ~RACEMASK_ALL_PLAYABLE);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -2590,10 +2590,10 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditio
|
||||
}
|
||||
}
|
||||
|
||||
if (condition->PvpMedal && !((1 << (condition->PvpMedal - 1)) & player->GetUInt32Value(PLAYER_FIELD_PVP_MEDALS)))
|
||||
if (condition->PvpMedal && !((1 << (condition->PvpMedal - 1)) & player->GetUInt32Value(ACTIVE_PLAYER_FIELD_PVP_MEDALS)))
|
||||
return false;
|
||||
|
||||
if (condition->LifetimeMaxPVPRank && player->GetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_LIFETIME_MAX_PVP_RANK) != condition->LifetimeMaxPVPRank)
|
||||
if (condition->LifetimeMaxPVPRank && player->GetByteValue(ACTIVE_PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_LIFETIME_MAX_PVP_RANK) != condition->LifetimeMaxPVPRank)
|
||||
return false;
|
||||
|
||||
if (condition->MovementFlags[0] && !(player->GetUnitMovementFlags() & condition->MovementFlags[0]))
|
||||
@@ -2647,7 +2647,7 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditio
|
||||
results.fill(true);
|
||||
for (std::size_t i = 0; i < PrevQuestCount::value; ++i)
|
||||
if (uint32 questBit = sDB2Manager.GetQuestUniqueBitFlag(condition->PrevQuestID[i]))
|
||||
results[i] = (player->GetUInt32Value(PLAYER_FIELD_QUEST_COMPLETED + ((questBit - 1) >> 5)) & (1 << ((questBit - 1) & 31))) != 0;
|
||||
results[i] = (player->GetUInt32Value(ACTIVE_PLAYER_FIELD_QUEST_COMPLETED + ((questBit - 1) >> 5)) & (1 << ((questBit - 1) & 31))) != 0;
|
||||
|
||||
if (!PlayerConditionLogic(condition->PrevQuestLogic, results))
|
||||
return false;
|
||||
@@ -2731,7 +2731,7 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditio
|
||||
for (std::size_t i = 0; i < ExploredCount::value; ++i)
|
||||
{
|
||||
if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(condition->Explored[i]))
|
||||
if (area->AreaBit != -1 && !(player->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + area->AreaBit / 32) & (1 << (uint32(area->AreaBit) % 32))))
|
||||
if (area->AreaBit != -1 && !(player->GetUInt32Value(ACTIVE_PLAYER_FIELD_EXPLORED_ZONES + area->AreaBit / 32) & (1 << (uint32(area->AreaBit) % 32))))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+7286
-1896
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -35,6 +35,7 @@
|
||||
class DB2HotfixGeneratorBase;
|
||||
|
||||
TC_GAME_API extern DB2Storage<AchievementEntry> sAchievementStore;
|
||||
TC_GAME_API extern DB2Storage<AnimationDataEntry> sAnimationDataStore;
|
||||
TC_GAME_API extern DB2Storage<AnimKitEntry> sAnimKitStore;
|
||||
TC_GAME_API extern DB2Storage<AreaTableEntry> sAreaTableStore;
|
||||
TC_GAME_API extern DB2Storage<AreaTriggerEntry> sAreaTriggerStore;
|
||||
@@ -65,6 +66,7 @@ TC_GAME_API extern DB2Storage<ChrRacesEntry> sChrRacesSto
|
||||
TC_GAME_API extern DB2Storage<ChrSpecializationEntry> sChrSpecializationStore;
|
||||
TC_GAME_API extern DB2Storage<CinematicCameraEntry> sCinematicCameraStore;
|
||||
TC_GAME_API extern DB2Storage<CinematicSequencesEntry> sCinematicSequencesStore;
|
||||
TC_GAME_API extern DB2Storage<ContentTuningEntry> sContentTuningStore;
|
||||
TC_GAME_API extern DB2Storage<ConversationLineEntry> sConversationLineStore;
|
||||
TC_GAME_API extern DB2Storage<CreatureDisplayInfoEntry> sCreatureDisplayInfoStore;
|
||||
TC_GAME_API extern DB2Storage<CreatureDisplayInfoExtraEntry> sCreatureDisplayInfoExtraStore;
|
||||
@@ -148,14 +150,14 @@ TC_GAME_API extern DB2Storage<PhaseEntry> sPhaseStore;
|
||||
TC_GAME_API extern DB2Storage<PlayerConditionEntry> sPlayerConditionStore;
|
||||
TC_GAME_API extern DB2Storage<PowerDisplayEntry> sPowerDisplayStore;
|
||||
TC_GAME_API extern DB2Storage<PvpTalentEntry> sPvpTalentStore;
|
||||
TC_GAME_API extern DB2Storage<PvpTalentUnlockEntry> sPvpTalentUnlockStore;
|
||||
TC_GAME_API extern DB2Storage<PvpTalentCategoryEntry> sPvpTalentCategoryStore;
|
||||
TC_GAME_API extern DB2Storage<PvpTalentSlotUnlockEntry> sPvpTalentSlotUnlockStore;
|
||||
TC_GAME_API extern DB2Storage<QuestFactionRewardEntry> sQuestFactionRewardStore;
|
||||
TC_GAME_API extern DB2Storage<QuestMoneyRewardEntry> sQuestMoneyRewardStore;
|
||||
TC_GAME_API extern DB2Storage<QuestSortEntry> sQuestSortStore;
|
||||
TC_GAME_API extern DB2Storage<QuestXPEntry> sQuestXPStore;
|
||||
TC_GAME_API extern DB2Storage<RandPropPointsEntry> sRandPropPointsStore;
|
||||
TC_GAME_API extern DB2Storage<RewardPackEntry> sRewardPackStore;
|
||||
TC_GAME_API extern DB2Storage<SandboxScalingEntry> sSandboxScalingStore;
|
||||
TC_GAME_API extern DB2Storage<ScalingStatDistributionEntry> sScalingStatDistributionStore;
|
||||
TC_GAME_API extern DB2Storage<ScenarioEntry> sScenarioStore;
|
||||
TC_GAME_API extern DB2Storage<ScenarioStepEntry> sScenarioStepStore;
|
||||
@@ -164,7 +166,6 @@ TC_GAME_API extern DB2Storage<SceneScriptPackageEntry> sSceneScript
|
||||
TC_GAME_API extern DB2Storage<SkillLineAbilityEntry> sSkillLineAbilityStore;
|
||||
TC_GAME_API extern DB2Storage<SkillRaceClassInfoEntry> sSkillRaceClassInfoStore;
|
||||
TC_GAME_API extern DB2Storage<SoundKitEntry> sSoundKitStore;
|
||||
TC_GAME_API extern DB2Storage<SpellEntry> sSpellStore;
|
||||
TC_GAME_API extern DB2Storage<SpellAuraOptionsEntry> sSpellAuraOptionsStore;
|
||||
TC_GAME_API extern DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore;
|
||||
TC_GAME_API extern DB2Storage<SpellCastTimesEntry> sSpellCastTimesStore;
|
||||
@@ -183,6 +184,7 @@ TC_GAME_API extern DB2Storage<SpellItemEnchantmentConditionEntry> sSpellItemEn
|
||||
TC_GAME_API extern DB2Storage<SpellLearnSpellEntry> sSpellLearnSpellStore;
|
||||
TC_GAME_API extern DB2Storage<SpellLevelsEntry> sSpellLevelsStore;
|
||||
TC_GAME_API extern DB2Storage<SpellMiscEntry> sSpellMiscStore;
|
||||
TC_GAME_API extern DB2Storage<SpellNameEntry> sSpellNameStore;
|
||||
TC_GAME_API extern DB2Storage<SpellPowerEntry> sSpellPowerStore;
|
||||
TC_GAME_API extern DB2Storage<SpellProcsPerMinuteEntry> sSpellProcsPerMinuteStore;
|
||||
TC_GAME_API extern DB2Storage<SpellRadiusEntry> sSpellRadiusStore;
|
||||
@@ -208,7 +210,6 @@ TC_GAME_API extern DB2Storage<UnitPowerBarEntry> sUnitPowerBa
|
||||
TC_GAME_API extern DB2Storage<VehicleEntry> sVehicleStore;
|
||||
TC_GAME_API extern DB2Storage<VehicleSeatEntry> sVehicleSeatStore;
|
||||
TC_GAME_API extern DB2Storage<WorldEffectEntry> sWorldEffectStore;
|
||||
TC_GAME_API extern DB2Storage<WorldMapAreaEntry> sWorldMapAreaStore;
|
||||
TC_GAME_API extern DB2Storage<WorldMapOverlayEntry> sWorldMapOverlayStore;
|
||||
TC_GAME_API extern DB2Storage<WorldSafeLocsEntry> sWorldSafeLocsStore;
|
||||
|
||||
@@ -257,7 +258,9 @@ public:
|
||||
DB2StorageBase const* GetStorage(uint32 type) const;
|
||||
|
||||
void LoadHotfixData();
|
||||
void LoadHotfixBlob();
|
||||
std::map<uint64, int32> const& GetHotfixData() const;
|
||||
std::vector<uint8> const* GetHotfixBlobData(uint32 tableHash, int32 recordId);
|
||||
|
||||
std::vector<uint32> GetAreasForGroup(uint32 areaGroupId) const;
|
||||
static bool IsInArea(uint32 objectAreaId, uint32 areaId);
|
||||
@@ -277,6 +280,7 @@ public:
|
||||
static char const* GetCreatureFamilyPetName(uint32 petfamily, uint32 locale);
|
||||
float GetCurveValueAt(uint32 curveId, float x) const;
|
||||
EmotesTextSoundEntry const* GetTextSoundEmoteFor(uint32 emote, uint8 race, uint8 gender, uint8 class_) const;
|
||||
float EvaluateExpectedStat(ExpectedStatType stat, uint32 level, int32 expansion, uint32 contentTuningId, Classes unitClass) const;
|
||||
std::vector<uint32> const* GetFactionTeamList(uint32 faction) const;
|
||||
HeirloomEntry const* GetHeirloomByItemId(uint32 itemId) const;
|
||||
std::vector<uint32> const* GetGlyphBindableSpells(uint32 glyphPropertiesId) const;
|
||||
@@ -300,28 +304,28 @@ public:
|
||||
MapDifficultyEntry const* GetDefaultMapDifficulty(uint32 mapId, Difficulty* difficulty = nullptr) const;
|
||||
MapDifficultyEntry const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty) const;
|
||||
MapDifficultyEntry const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty) const;
|
||||
std::string GetNameGenEntry(uint8 race, uint8 gender) const;
|
||||
MountEntry const* GetMount(uint32 spellId) const;
|
||||
MountEntry const* GetMountById(uint32 id) const;
|
||||
MountTypeXCapabilitySet const* GetMountCapabilities(uint32 mountType) const;
|
||||
MountXDisplayContainer const* GetMountDisplays(uint32 mountId) const;
|
||||
std::string GetNameGenEntry(uint8 race, uint8 gender) const;
|
||||
ResponseCodes ValidateName(std::wstring const& name, LocaleConstant locale) const;
|
||||
static int32 GetNumTalentsAtLevel(uint32 level, Classes playerClass);
|
||||
std::vector<uint32> const* GetPhasesForGroup(uint32 group) const;
|
||||
PowerTypeEntry const* GetPowerTypeEntry(Powers power) const;
|
||||
PowerTypeEntry const* GetPowerTypeByName(std::string const& name) const;
|
||||
uint8 GetPvpItemLevelBonus(uint32 itemId) const;
|
||||
uint8 GetMaxPrestige() const;
|
||||
static PVPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level);
|
||||
static PVPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
|
||||
uint32 GetRewardPackIDForPvpRewardByHonorLevelAndPrestige(uint8 honorLevel, uint8 prestige) const;
|
||||
uint32 GetRequiredHonorLevelForPvpTalent(PvpTalentEntry const* talentInfo) const;
|
||||
std::vector<PvpTalentEntry const*> const& GetPvpTalentsByPosition(uint32 class_, uint32 tier, uint32 column) const;
|
||||
uint32 GetRequiredLevelForPvpTalentSlot(uint8 slot, Classes class_) const;
|
||||
int32 GetPvpTalentNumSlotsAtLevel(uint32 level, Classes class_) const;
|
||||
std::vector<QuestPackageItemEntry const*> const* GetQuestPackageItems(uint32 questPackageID) const;
|
||||
std::vector<QuestPackageItemEntry const*> const* GetQuestPackageItemsFallback(uint32 questPackageID) const;
|
||||
uint32 GetQuestUniqueBitFlag(uint32 questId);
|
||||
std::vector<RewardPackXCurrencyTypeEntry const*> const* GetRewardPackCurrencyTypesByRewardID(uint32 rewardPackID) const;
|
||||
std::vector<RewardPackXItemEntry const*> const* GetRewardPackItemsByRewardID(uint32 rewardPackID) const;
|
||||
uint32 GetRulesetItemUpgrade(uint32 itemId) const;
|
||||
std::vector<SkillLineAbilityEntry const*> const* GetSkillLineAbilitiesBySkill(uint32 skillId) const;
|
||||
SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, uint8 class_);
|
||||
std::vector<SpecializationSpellsEntry const*> const* GetSpecializationSpells(uint32 specId) const;
|
||||
static bool IsValidSpellFamiliyName(SpellFamilyNames family);
|
||||
@@ -332,11 +336,12 @@ public:
|
||||
bool IsToyItem(uint32 toy) const;
|
||||
std::vector<TransmogSetEntry const*> const* GetTransmogSetsForItemModifiedAppearance(uint32 itemModifiedAppearanceId) const;
|
||||
std::vector<TransmogSetItemEntry const*> const* GetTransmogSetItems(uint32 transmogSetId) const;
|
||||
WMOAreaTableEntry const* GetWMOAreaTable(int32 rootId, int32 adtId, int32 groupId) const;
|
||||
uint32 GetVirtualMapForMapAndZone(uint32 mapId, uint32 zoneId) const;
|
||||
static bool GetUiMapPosition(float x, float y, float z, int32 mapId, int32 areaId, int32 wmoDoodadPlacementId, int32 wmoGroupId, UiMapSystem system, bool local,
|
||||
int32* uiMapId = nullptr, DBCPosition2D* newPos = nullptr);
|
||||
void Zone2MapCoordinates(uint32 areaId, float& x, float& y) const;
|
||||
void Map2ZoneCoordinates(uint32 areaId, float& x, float& y) const;
|
||||
static void DeterminaAlternateMapPosition(uint32 mapId, float x, float y, float z, uint32* newMapId = nullptr, DBCPosition2D* newPos = nullptr);
|
||||
bool IsUiMapPhase(uint32 phaseId) const;
|
||||
WMOAreaTableEntry const* GetWMOAreaTable(int32 rootId, int32 adtId, int32 groupId) const;
|
||||
|
||||
private:
|
||||
friend class DB2HotfixGeneratorBase;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -44,11 +44,11 @@ enum LevelLimit
|
||||
// Client expected level limitation, like as used in DBC item max levels for "until max player level"
|
||||
// use as default max player level, must be fit max level for used client
|
||||
// also see MAX_LEVEL and STRONG_MAX_LEVEL define
|
||||
DEFAULT_MAX_LEVEL = 110,
|
||||
DEFAULT_MAX_LEVEL = 120,
|
||||
|
||||
// client supported max level for player/pets/etc. Avoid overflow or client stability affected.
|
||||
// also see GT_MAX_LEVEL define
|
||||
MAX_LEVEL = 110,
|
||||
MAX_LEVEL = 120,
|
||||
|
||||
// Server side limitation. Base at used code requirements.
|
||||
// also see MAX_LEVEL and GT_MAX_LEVEL define
|
||||
@@ -58,7 +58,7 @@ enum LevelLimit
|
||||
enum BattlegroundBracketId // bracketId for level ranges
|
||||
{
|
||||
BG_BRACKET_ID_FIRST = 0,
|
||||
BG_BRACKET_ID_LAST = 11,
|
||||
BG_BRACKET_ID_LAST = 12,
|
||||
|
||||
// must be max value in PvPDificulty slot + 1
|
||||
MAX_BATTLEGROUND_BRACKETS
|
||||
@@ -166,7 +166,7 @@ enum ArtifactPowerFlag : uint8
|
||||
|
||||
#define MAX_ARTIFACT_TIER 1
|
||||
|
||||
#define BATTLE_PET_SPECIES_MAX_ID 2164
|
||||
#define BATTLE_PET_SPECIES_MAX_ID 2480
|
||||
|
||||
enum ChrSpecializationFlag
|
||||
{
|
||||
@@ -502,10 +502,13 @@ enum CriteriaTypes : uint8
|
||||
CRITERIA_TYPE_TRANSMOG_SET_UNLOCKED = 205,
|
||||
CRITERIA_TYPE_GAIN_PARAGON_REPUTATION = 206,
|
||||
CRITERIA_TYPE_EARN_HONOR_XP = 207,
|
||||
CRITERIA_TYPE_RELIC_TALENT_UNLOCKED = 211
|
||||
CRITERIA_TYPE_RELIC_TALENT_UNLOCKED = 211,
|
||||
CRITERIA_TYPE_REACH_ACCOUNT_HONOR_LEVEL = 213,
|
||||
CRITERIA_TREE_HEART_OF_AZEROTH_ARTIFACT_POWER_EARNED= 214,
|
||||
CRITERIA_TREE_HEART_OF_AZEROTH_LEVEL_REACHED = 215
|
||||
};
|
||||
|
||||
#define CRITERIA_TYPE_TOTAL 213
|
||||
#define CRITERIA_TYPE_TOTAL 216
|
||||
|
||||
enum CriteriaTreeFlags : uint16
|
||||
{
|
||||
@@ -608,6 +611,11 @@ enum Difficulty : uint8
|
||||
DIFFICULTY_WORLD_PVP_SCENARIO_2 = 32,
|
||||
DIFFICULTY_TIMEWALKING_RAID = 33,
|
||||
DIFFICULTY_PVP = 34,
|
||||
DIFFICULTY_NORMAL_ISLAND = 38,
|
||||
DIFFICULTY_HEROIC_ISLAND = 39,
|
||||
DIFFICULTY_MYTHIC_ISLAND = 40,
|
||||
DIFFICULTY_PVP_ISLAND = 45,
|
||||
DIFFICULTY_NORMAL_WARFRONT = 147,
|
||||
|
||||
MAX_DIFFICULTY
|
||||
};
|
||||
@@ -643,6 +651,20 @@ enum SpawnMask
|
||||
SPAWNMASK_RAID_ALL = (SPAWNMASK_RAID_NORMAL_ALL | SPAWNMASK_RAID_HEROIC_ALL)
|
||||
};
|
||||
|
||||
enum class ExpectedStatType : uint8
|
||||
{
|
||||
CreatureHealth = 0,
|
||||
PlayerHealth = 1,
|
||||
CreatureAutoAttackDps = 2,
|
||||
CreatureArmor = 3,
|
||||
PlayerMana = 4,
|
||||
PlayerPrimaryStat = 5,
|
||||
PlayerSecondaryStat = 6,
|
||||
ArmorConstant = 7,
|
||||
None = 8,
|
||||
CreatureSpellDamage = 9
|
||||
};
|
||||
|
||||
enum FactionTemplateFlags
|
||||
{
|
||||
FACTION_TEMPLATE_ENEMY_SPAR = 0x00000020, // guessed, sparring with enemies?
|
||||
@@ -745,6 +767,68 @@ enum ItemBonusType
|
||||
ITEM_BONUS_OVERRIDE_REQUIRED_LEVEL = 18
|
||||
};
|
||||
|
||||
enum class ItemContext : uint8
|
||||
{
|
||||
NONE = 0,
|
||||
Dungeon_Normal = 1,
|
||||
Dungeon_Heroic = 2,
|
||||
Raid_Normal = 3,
|
||||
Raid_Raid_Finder = 4,
|
||||
Raid_Heroic = 5,
|
||||
Raid_Mythic = 6,
|
||||
PVP_Unranked_1 = 7,
|
||||
PVP_Ranked_1 = 8,
|
||||
Scenario_Normal = 9,
|
||||
Scenario_Heroic = 10,
|
||||
Quest_Reward = 11,
|
||||
Store = 12,
|
||||
Trade_Skill = 13,
|
||||
Vendor = 14,
|
||||
Black_Market = 15,
|
||||
Challenge_Mode_1 = 16,
|
||||
Dungeon_Lvl_Up_1 = 17,
|
||||
Dungeon_Lvl_Up_2 = 18,
|
||||
Dungeon_Lvl_Up_3 = 19,
|
||||
Dungeon_Lvl_Up_4 = 20,
|
||||
Force_to_NONE = 21,
|
||||
TimeWalker = 22,
|
||||
Dungeon_Mythic = 23,
|
||||
Pvp_Honor_Reward = 24,
|
||||
World_Quest_1 = 25,
|
||||
World_Quest_2 = 26,
|
||||
World_Quest_3 = 27,
|
||||
World_Quest_4 = 28,
|
||||
World_Quest_5 = 29,
|
||||
World_Quest_6 = 30,
|
||||
Mission_Reward_1 = 31,
|
||||
Mission_Reward_2 = 32,
|
||||
Challenge_Mode_2 = 33,
|
||||
Challenge_Mode_3 = 34,
|
||||
Challenge_Mode_Jackpot = 35,
|
||||
World_Quest_7 = 36,
|
||||
World_Quest_8 = 37,
|
||||
PVP_Ranked_2 = 38,
|
||||
PVP_Ranked_3 = 39,
|
||||
PVP_Ranked_4 = 40,
|
||||
PVP_Unranked_2 = 41,
|
||||
World_Quest_9 = 42,
|
||||
World_Quest_10 = 43,
|
||||
PVP_Ranked_5 = 44,
|
||||
PVP_Ranked_6 = 45,
|
||||
PVP_Ranked_7 = 46,
|
||||
PVP_Unranked_3 = 47,
|
||||
PVP_Unranked_4 = 48,
|
||||
PVP_Unranked_5 = 49,
|
||||
PVP_Unranked_6 = 50,
|
||||
PVP_Unranked_7 = 51,
|
||||
PVP_Ranked_8 = 52,
|
||||
World_Quest_11 = 53,
|
||||
World_Quest_12 = 54,
|
||||
World_Quest_13 = 55,
|
||||
PVP_Ranked_Jackpot = 56,
|
||||
Tournament_Realm = 57,
|
||||
};
|
||||
|
||||
enum ItemLimitCategoryMode
|
||||
{
|
||||
ITEM_LIMIT_CATEGORY_MODE_HAVE = 0, // limit applied to amount items in inventory/bank
|
||||
@@ -917,7 +1001,7 @@ enum SpellShapeshiftFormFlags
|
||||
SHAPESHIFT_FORM_PREVENT_EMOTE_SOUNDS = 0x1000
|
||||
};
|
||||
|
||||
#define TaxiMaskSize 258
|
||||
#define TaxiMaskSize 286
|
||||
typedef std::array<uint8, TaxiMaskSize> TaxiMask;
|
||||
|
||||
enum TotemCategoryType
|
||||
@@ -989,8 +1073,7 @@ enum SummonPropFlags
|
||||
|
||||
#define MAX_TALENT_TIERS 7
|
||||
#define MAX_TALENT_COLUMNS 3
|
||||
#define MAX_PVP_TALENT_TIERS 6
|
||||
#define MAX_PVP_TALENT_COLUMNS 3
|
||||
#define MAX_PVP_TALENT_SLOTS 4
|
||||
|
||||
enum TaxiNodeFlags
|
||||
{
|
||||
@@ -1005,6 +1088,25 @@ enum TaxiPathNodeFlags
|
||||
TAXI_PATH_NODE_FLAG_STOP = 0x2
|
||||
};
|
||||
|
||||
enum UiMapSystem : int8
|
||||
{
|
||||
UI_MAP_SYSTEM_WORLD = 0,
|
||||
UI_MAP_SYSTEM_TAXI = 1,
|
||||
UI_MAP_SYSTEM_ADVENTURE = 2,
|
||||
MAX_UI_MAP_SYSTEM = 3
|
||||
};
|
||||
|
||||
enum UiMapType : int8
|
||||
{
|
||||
UI_MAP_TYPE_COSMIC = 0,
|
||||
UI_MAP_TYPE_WORLD = 1,
|
||||
UI_MAP_TYPE_CONTINENT = 2,
|
||||
UI_MAP_TYPE_ZONE = 3,
|
||||
UI_MAP_TYPE_DUNGEON = 4,
|
||||
UI_MAP_TYPE_MICRO = 5,
|
||||
UI_MAP_TYPE_ORPHAN = 6,
|
||||
};
|
||||
|
||||
enum VehicleSeatFlags
|
||||
{
|
||||
VEHICLE_SEAT_FLAG_HAS_LOWER_ANIM_FOR_ENTER = 0x00000001,
|
||||
|
||||
@@ -29,7 +29,6 @@ GameTable<GtBarberShopCostBaseEntry> sBarberShopCostBaseGameTable;
|
||||
GameTable<GtBaseMPEntry> sBaseMPGameTable;
|
||||
GameTable<GtCombatRatingsEntry> sCombatRatingsGameTable;
|
||||
GameTable<GtCombatRatingsMultByILvl> sCombatRatingsMultByILvlGameTable;
|
||||
GameTable<GtHonorLevelEntry> sHonorLevelGameTable;
|
||||
GameTable<GtHpPerStaEntry> sHpPerStaGameTable;
|
||||
GameTable<GtItemSocketCostPerLevelEntry> sItemSocketCostPerLevelGameTable;
|
||||
GameTable<GtNpcDamageByClassEntry> sNpcDamageByClassGameTable[MAX_EXPANSIONS];
|
||||
@@ -118,7 +117,6 @@ void LoadGameTables(std::string const& dataPath)
|
||||
LOAD_GT(sCombatRatingsGameTable, "CombatRatings.txt");
|
||||
LOAD_GT(sCombatRatingsMultByILvlGameTable, "CombatRatingsMultByILvl.txt");
|
||||
LOAD_GT(sItemSocketCostPerLevelGameTable, "ItemSocketCostPerLevel.txt");
|
||||
LOAD_GT(sHonorLevelGameTable, "HonorLevel.txt");
|
||||
LOAD_GT(sHpPerStaGameTable, "HpPerSta.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[0], "NpcDamageByClass.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[1], "NpcDamageByClassExp1.txt");
|
||||
@@ -127,6 +125,7 @@ void LoadGameTables(std::string const& dataPath)
|
||||
LOAD_GT(sNpcDamageByClassGameTable[4], "NpcDamageByClassExp4.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[5], "NpcDamageByClassExp5.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[6], "NpcDamageByClassExp6.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[7], "NpcDamageByClassExp7.txt");
|
||||
LOAD_GT(sNpcManaCostScalerGameTable, "NPCManaCostScaler.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[0], "NpcTotalHp.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[1], "NpcTotalHpExp1.txt");
|
||||
@@ -135,6 +134,7 @@ void LoadGameTables(std::string const& dataPath)
|
||||
LOAD_GT(sNpcTotalHpGameTable[4], "NpcTotalHpExp4.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[5], "NpcTotalHpExp5.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[6], "NpcTotalHpExp6.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[7], "NpcTotalHpExp7.txt");
|
||||
LOAD_GT(sSpellScalingGameTable, "SpellScaling.txt");
|
||||
LOAD_GT(sXpGameTable, "xp.txt");
|
||||
|
||||
|
||||
@@ -103,12 +103,6 @@ struct GtCombatRatingsMultByILvl
|
||||
float JewelryMultiplier = 0.0f;
|
||||
};
|
||||
|
||||
uint8 constexpr PRESTIGE_COLUMN_COUNT = 33;
|
||||
struct GtHonorLevelEntry
|
||||
{
|
||||
float Prestige[PRESTIGE_COLUMN_COUNT] = { };
|
||||
};
|
||||
|
||||
struct GtHpPerStaEntry
|
||||
{
|
||||
float Health = 0.0f;
|
||||
@@ -176,6 +170,7 @@ struct GtSpellScalingEntry
|
||||
float Gem2 = 0.0f;
|
||||
float Gem3 = 0.0f;
|
||||
float Health = 0.0f;
|
||||
float DamageReplaceStat = 0.0f;
|
||||
};
|
||||
|
||||
struct GtXpEntry
|
||||
@@ -214,7 +209,6 @@ TC_GAME_API extern GameTable<GtBarberShopCostBaseEntry> sBarberShopC
|
||||
TC_GAME_API extern GameTable<GtBaseMPEntry> sBaseMPGameTable;
|
||||
TC_GAME_API extern GameTable<GtCombatRatingsEntry> sCombatRatingsGameTable;
|
||||
TC_GAME_API extern GameTable<GtCombatRatingsMultByILvl> sCombatRatingsMultByILvlGameTable;
|
||||
TC_GAME_API extern GameTable<GtHonorLevelEntry> sHonorLevelGameTable;
|
||||
TC_GAME_API extern GameTable<GtHpPerStaEntry> sHpPerStaGameTable;
|
||||
TC_GAME_API extern GameTable<GtItemSocketCostPerLevelEntry> sItemSocketCostPerLevelGameTable;
|
||||
TC_GAME_API extern GameTable<GtNpcDamageByClassEntry> sNpcDamageByClassGameTable[MAX_EXPANSIONS];
|
||||
@@ -290,6 +284,7 @@ inline float GetSpellScalingColumnForClass(GtSpellScalingEntry const* row, int32
|
||||
case CLASS_DEMON_HUNTER:
|
||||
return row->DemonHunter;
|
||||
case -1:
|
||||
case -7:
|
||||
return row->Item;
|
||||
case -2:
|
||||
return row->Consumable;
|
||||
@@ -301,6 +296,8 @@ inline float GetSpellScalingColumnForClass(GtSpellScalingEntry const* row, int32
|
||||
return row->Gem3;
|
||||
case -6:
|
||||
return row->Health;
|
||||
case -8:
|
||||
return row->DamageReplaceStat;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ requiredItemLevel(0)
|
||||
LFGDungeonData::LFGDungeonData(LFGDungeonsEntry const* dbc) : id(dbc->ID), name(dbc->Name->Str[sWorld->GetDefaultDbcLocale()]), map(dbc->MapID),
|
||||
type(uint8(dbc->TypeID)), expansion(uint8(dbc->ExpansionLevel)), group(uint8(dbc->GroupID)),
|
||||
minlevel(uint8(dbc->MinLevel)), maxlevel(uint8(dbc->MaxLevel)), difficulty(Difficulty(dbc->DifficultyID)),
|
||||
seasonal((dbc->Flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
|
||||
seasonal((dbc->Flags[0] & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
|
||||
requiredItemLevel(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ AreaTrigger::AreaTrigger() : WorldObject(false), MapObject(), _aurEff(nullptr),
|
||||
m_objectType |= TYPEMASK_AREATRIGGER;
|
||||
m_objectTypeId = TYPEID_AREATRIGGER;
|
||||
|
||||
m_updateFlag = UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_AREATRIGGER;
|
||||
m_updateFlag.Stationary = true;
|
||||
m_updateFlag.AreaTrigger = true;
|
||||
|
||||
m_valuesCount = AREATRIGGER_END;
|
||||
_dynamicValuesCount = AREATRIGGER_DYNAMIC_END;
|
||||
@@ -142,7 +143,7 @@ bool AreaTrigger::Create(uint32 spellMiscId, Unit* caster, Unit* target, SpellIn
|
||||
{
|
||||
AreaTriggerCircularMovementInfo cmi = GetMiscTemplate()->CircularMovementInfo;
|
||||
if (target && GetTemplate()->HasFlag(AREATRIGGER_FLAG_HAS_ATTACHED))
|
||||
cmi.TargetGUID = target->GetGUID();
|
||||
cmi.PathTarget = target->GetGUID();
|
||||
else
|
||||
cmi.Center = pos;
|
||||
|
||||
@@ -637,12 +638,12 @@ void AreaTrigger::InitSplines(std::vector<G3D::Vector3> splinePoints, uint32 tim
|
||||
{
|
||||
if (_reachedDestination)
|
||||
{
|
||||
WorldPackets::AreaTrigger::AreaTriggerReShape reshape;
|
||||
WorldPackets::AreaTrigger::AreaTriggerRePath reshape;
|
||||
reshape.TriggerGUID = GetGUID();
|
||||
SendMessageToSet(reshape.Write(), true);
|
||||
}
|
||||
|
||||
WorldPackets::AreaTrigger::AreaTriggerReShape reshape;
|
||||
WorldPackets::AreaTrigger::AreaTriggerRePath reshape;
|
||||
reshape.TriggerGUID = GetGUID();
|
||||
reshape.AreaTriggerSpline = boost::in_place();
|
||||
reshape.AreaTriggerSpline->ElapsedTimeForMovement = GetElapsedTimeForMovement();
|
||||
@@ -664,7 +665,7 @@ bool AreaTrigger::HasSplines() const
|
||||
void AreaTrigger::InitCircularMovement(AreaTriggerCircularMovementInfo const& cmi, uint32 timeToTarget)
|
||||
{
|
||||
// Circular movement requires either a center position or an attached unit
|
||||
ASSERT(cmi.Center.is_initialized() || cmi.TargetGUID.is_initialized());
|
||||
ASSERT(cmi.Center.is_initialized() || cmi.PathTarget.is_initialized());
|
||||
|
||||
// should be sent in object create packets only
|
||||
m_uint32Values[AREATRIGGER_TIME_TO_TARGET] = timeToTarget;
|
||||
@@ -676,7 +677,7 @@ void AreaTrigger::InitCircularMovement(AreaTriggerCircularMovementInfo const& cm
|
||||
|
||||
if (IsInWorld())
|
||||
{
|
||||
WorldPackets::AreaTrigger::AreaTriggerReShape reshape;
|
||||
WorldPackets::AreaTrigger::AreaTriggerRePath reshape;
|
||||
reshape.TriggerGUID = GetGUID();
|
||||
reshape.AreaTriggerCircularMovement = _circularMovementInfo;
|
||||
|
||||
@@ -691,11 +692,11 @@ bool AreaTrigger::HasCircularMovement() const
|
||||
|
||||
Position const* AreaTrigger::GetCircularMovementCenterPosition() const
|
||||
{
|
||||
if (_circularMovementInfo.is_initialized())
|
||||
if (!_circularMovementInfo.is_initialized())
|
||||
return nullptr;
|
||||
|
||||
if (_circularMovementInfo->TargetGUID.is_initialized())
|
||||
if (WorldObject* center = ObjectAccessor::GetWorldObject(*this, *_circularMovementInfo->TargetGUID))
|
||||
if (_circularMovementInfo->PathTarget.is_initialized())
|
||||
if (WorldObject* center = ObjectAccessor::GetWorldObject(*this, *_circularMovementInfo->PathTarget))
|
||||
return center;
|
||||
|
||||
if (_circularMovementInfo->Center.is_initialized())
|
||||
|
||||
@@ -96,6 +96,9 @@ AreaTriggerMiscTemplate::AreaTriggerMiscTemplate()
|
||||
MorphCurveId = 0;
|
||||
FacingCurveId = 0;
|
||||
|
||||
AnimId = 0;
|
||||
AnimKitId = 0;
|
||||
|
||||
DecalPropertiesId = 0;
|
||||
|
||||
TimeToTarget = 0;
|
||||
|
||||
@@ -36,10 +36,11 @@ enum AreaTriggerFlags
|
||||
AREATRIGGER_FLAG_HAS_FOLLOWS_TERRAIN = 0x00010, // NYI
|
||||
AREATRIGGER_FLAG_UNK1 = 0x00020,
|
||||
AREATRIGGER_FLAG_HAS_TARGET_ROLL_PITCH_YAW = 0x00040, // NYI
|
||||
AREATRIGGER_FLAG_UNK2 = 0x00080,
|
||||
AREATRIGGER_FLAG_HAS_ANIM_ID = 0x00080,
|
||||
AREATRIGGER_FLAG_UNK3 = 0x00100,
|
||||
AREATRIGGER_FLAG_UNK4 = 0x00200,
|
||||
AREATRIGGER_FLAG_HAS_CIRCULAR_MOVEMENT = 0x00400
|
||||
AREATRIGGER_FLAG_HAS_ANIM_KIT_ID = 0x00200,
|
||||
AREATRIGGER_FLAG_HAS_CIRCULAR_MOVEMENT = 0x00400,
|
||||
AREATRIGGER_FLAG_UNK5 = 0x00800,
|
||||
};
|
||||
|
||||
enum AreaTriggerTypes
|
||||
@@ -96,7 +97,7 @@ struct AreaTriggerScaleInfo
|
||||
|
||||
struct AreaTriggerCircularMovementInfo
|
||||
{
|
||||
Optional<ObjectGuid> TargetGUID;
|
||||
Optional<ObjectGuid> PathTarget;
|
||||
Optional<TaggedPosition<Position::XYZ>> Center;
|
||||
bool CounterClockwise = false;
|
||||
bool CanLoop = false;
|
||||
@@ -190,6 +191,9 @@ public:
|
||||
uint32 MorphCurveId;
|
||||
uint32 FacingCurveId;
|
||||
|
||||
int32 AnimId;
|
||||
int32 AnimKitId;
|
||||
|
||||
uint32 DecalPropertiesId;
|
||||
|
||||
uint32 TimeToTarget;
|
||||
|
||||
@@ -30,7 +30,8 @@ Conversation::Conversation() : WorldObject(false), _duration(0)
|
||||
m_objectType |= TYPEMASK_CONVERSATION;
|
||||
m_objectTypeId = TYPEID_CONVERSATION;
|
||||
|
||||
m_updateFlag = UPDATEFLAG_STATIONARY_POSITION;
|
||||
m_updateFlag.Stationary = true;
|
||||
m_updateFlag.Conversation = true;
|
||||
|
||||
m_valuesCount = CONVERSATION_END;
|
||||
_dynamicValuesCount = CONVERSATION_DYNAMIC_END;
|
||||
@@ -123,13 +124,15 @@ bool Conversation::Create(ObjectGuid::LowType lowGuid, uint32 conversationEntry,
|
||||
|
||||
SetUInt32Value(CONVERSATION_LAST_LINE_END_TIME, conversationTemplate->LastLineEndTime);
|
||||
_duration = conversationTemplate->LastLineEndTime;
|
||||
_textureKitId = conversationTemplate->TextureKitId;
|
||||
|
||||
for (uint16 actorIndex = 0; actorIndex < conversationTemplate->Actors.size(); ++actorIndex)
|
||||
{
|
||||
if (ConversationActorTemplate const* actor = conversationTemplate->Actors[actorIndex])
|
||||
{
|
||||
ConversationDynamicFieldActor actorField;
|
||||
actorField.ActorTemplate = *actor;
|
||||
actorField.ActorTemplate.CreatureId = actor->CreatureId;
|
||||
actorField.ActorTemplate.CreatureModelId = actor->CreatureModelId;
|
||||
actorField.Type = ConversationDynamicFieldActor::ActorType::CreatureActor;
|
||||
SetDynamicStructuredValue(CONVERSATION_DYNAMIC_FIELD_ACTORS, actorIndex, &actorField);
|
||||
}
|
||||
|
||||
@@ -47,8 +47,11 @@ struct ConversationDynamicFieldActor
|
||||
union
|
||||
{
|
||||
ObjectGuid ActorGuid;
|
||||
|
||||
ConversationActorTemplate ActorTemplate;
|
||||
struct
|
||||
{
|
||||
uint32 CreatureId;
|
||||
uint32 CreatureModelId;
|
||||
} ActorTemplate;
|
||||
|
||||
struct
|
||||
{
|
||||
@@ -75,6 +78,7 @@ class TC_GAME_API Conversation : public WorldObject, public GridObject<Conversat
|
||||
void Update(uint32 diff) override;
|
||||
void Remove();
|
||||
int32 GetDuration() const { return _duration; }
|
||||
uint32 GetTextureKitId() const { return _textureKitId; }
|
||||
|
||||
static Conversation* CreateConversation(uint32 conversationEntry, Unit* creator, Position const& pos, GuidUnorderedSet&& participants, SpellInfo const* spellInfo = nullptr);
|
||||
bool Create(ObjectGuid::LowType lowGuid, uint32 conversationEntry, Map* map, Unit* creator, Position const& pos, GuidUnorderedSet&& participants, SpellInfo const* spellInfo = nullptr);
|
||||
@@ -95,6 +99,7 @@ class TC_GAME_API Conversation : public WorldObject, public GridObject<Conversat
|
||||
Position _stationaryPosition;
|
||||
ObjectGuid _creatorGuid;
|
||||
uint32 _duration;
|
||||
uint32 _textureKitId;
|
||||
GuidUnorderedSet _participants;
|
||||
};
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES), m_type(type
|
||||
m_objectType |= TYPEMASK_CORPSE;
|
||||
m_objectTypeId = TYPEID_CORPSE;
|
||||
|
||||
m_updateFlag = UPDATEFLAG_STATIONARY_POSITION;
|
||||
m_updateFlag.Stationary = true;
|
||||
|
||||
m_valuesCount = CORPSE_END;
|
||||
_dynamicValuesCount = CORPSE_DYNAMIC_END;
|
||||
|
||||
@@ -77,68 +77,67 @@ VendorItem const* VendorItemData::FindItemCostPair(uint32 item_id, uint32 extend
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 CreatureTemplate::GetRandomValidModelId() const
|
||||
CreatureModel const CreatureModel::DefaultInvisibleModel(11686, 1.0f, 1.0f);
|
||||
CreatureModel const CreatureModel::DefaultVisibleModel(17519, 1.0f, 1.0f);
|
||||
|
||||
CreatureModel const* CreatureTemplate::GetModelByIdx(uint32 idx) const
|
||||
{
|
||||
uint8 c = 0;
|
||||
uint32 modelIDs[4];
|
||||
|
||||
if (Modelid1) modelIDs[c++] = Modelid1;
|
||||
if (Modelid2) modelIDs[c++] = Modelid2;
|
||||
if (Modelid3) modelIDs[c++] = Modelid3;
|
||||
if (Modelid4) modelIDs[c++] = Modelid4;
|
||||
|
||||
return ((c>0) ? modelIDs[urand(0, c-1)] : 0);
|
||||
return idx < Models.size() ? &Models[idx] : nullptr;
|
||||
}
|
||||
|
||||
uint32 CreatureTemplate::GetFirstValidModelId() const
|
||||
CreatureModel const* CreatureTemplate::GetRandomValidModel() const
|
||||
{
|
||||
if (Modelid1) return Modelid1;
|
||||
if (Modelid2) return Modelid2;
|
||||
if (Modelid3) return Modelid3;
|
||||
if (Modelid4) return Modelid4;
|
||||
return 0;
|
||||
if (!Models.size())
|
||||
return nullptr;
|
||||
|
||||
// If only one element, ignore the Probability (even if 0)
|
||||
if (Models.size() == 1)
|
||||
return &Models[0];
|
||||
|
||||
auto selectedItr = Trinity::Containers::SelectRandomWeightedContainerElement(Models, [](CreatureModel const& model)
|
||||
{
|
||||
return model.Probability;
|
||||
});
|
||||
|
||||
return &(*selectedItr);
|
||||
}
|
||||
|
||||
uint32 CreatureTemplate::GetFirstInvisibleModel() const
|
||||
CreatureModel const* CreatureTemplate::GetFirstValidModel() const
|
||||
{
|
||||
CreatureModelInfo const* modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid1);
|
||||
if (modelInfo && modelInfo->is_trigger)
|
||||
return Modelid1;
|
||||
for (CreatureModel const& model : Models)
|
||||
if (model.CreatureDisplayID)
|
||||
return &model;
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid2);
|
||||
if (modelInfo && modelInfo->is_trigger)
|
||||
return Modelid2;
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid3);
|
||||
if (modelInfo && modelInfo->is_trigger)
|
||||
return Modelid3;
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid4);
|
||||
if (modelInfo && modelInfo->is_trigger)
|
||||
return Modelid4;
|
||||
|
||||
return 11686;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 CreatureTemplate::GetFirstVisibleModel() const
|
||||
CreatureModel const* CreatureTemplate::GetModelWithDisplayId(uint32 displayId) const
|
||||
{
|
||||
CreatureModelInfo const* modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid1);
|
||||
if (modelInfo && !modelInfo->is_trigger)
|
||||
return Modelid1;
|
||||
for (CreatureModel const& model : Models)
|
||||
if (displayId == model.CreatureDisplayID)
|
||||
return &model;
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid2);
|
||||
if (modelInfo && !modelInfo->is_trigger)
|
||||
return Modelid2;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid3);
|
||||
if (modelInfo && !modelInfo->is_trigger)
|
||||
return Modelid3;
|
||||
CreatureModel const* CreatureTemplate::GetFirstInvisibleModel() const
|
||||
{
|
||||
for (CreatureModel const& model : Models)
|
||||
if (CreatureModelInfo const* modelInfo = sObjectMgr->GetCreatureModelInfo(model.CreatureDisplayID))
|
||||
if (modelInfo && modelInfo->is_trigger)
|
||||
return &model;
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid4);
|
||||
if (modelInfo && !modelInfo->is_trigger)
|
||||
return Modelid4;
|
||||
return &CreatureModel::DefaultInvisibleModel;
|
||||
}
|
||||
|
||||
return 17519;
|
||||
CreatureModel const* CreatureTemplate::GetFirstVisibleModel() const
|
||||
{
|
||||
for (CreatureModel const& model : Models)
|
||||
if (CreatureModelInfo const* modelInfo = sObjectMgr->GetCreatureModelInfo(model.CreatureDisplayID))
|
||||
if (modelInfo && !modelInfo->is_trigger)
|
||||
return &model;
|
||||
|
||||
return &CreatureModel::DefaultVisibleModel;
|
||||
}
|
||||
|
||||
bool AssistDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
@@ -347,22 +346,22 @@ bool Creature::InitEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, uint8(cinfo->unit_class));
|
||||
|
||||
// Cancel load if no model defined
|
||||
if (!(cinfo->GetFirstValidModelId()))
|
||||
if (!(cinfo->GetFirstValidModel()))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", entry);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 displayID = ObjectMgr::ChooseDisplayId(GetCreatureTemplate(), data);
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
|
||||
CreatureModel model = *ObjectMgr::ChooseDisplayId(cinfo, data);
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&model, cinfo);
|
||||
if (!minfo) // Cancel load if no model defined
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has invalid model %u defined in table `creature_template`, can't load.", entry, displayID);
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has invalid model %u defined in table `creature_template`, can't load.", entry, model.CreatureDisplayID);
|
||||
return false;
|
||||
}
|
||||
|
||||
SetDisplayId(displayID);
|
||||
SetNativeDisplayId(displayID);
|
||||
SetDisplayId(model.CreatureDisplayID, model.DisplayScale);
|
||||
SetNativeDisplayId(model.CreatureDisplayID, model.DisplayScale);
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
|
||||
|
||||
// Load creature equipment
|
||||
@@ -388,7 +387,7 @@ bool Creature::InitEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
|
||||
SetSpeedRate(MOVE_SWIM, 1.0f); // using 1.0 rate
|
||||
SetSpeedRate(MOVE_FLIGHT, 1.0f); // using 1.0 rate
|
||||
|
||||
// Will set UNIT_FIELD_BOUNDINGRADIUS and UNIT_FIELD_COMBATREACH
|
||||
// Will set UNIT_FIELD_BOUNDINGRADIUS, UNIT_FIELD_COMBATREACH and UNIT_FIELD_DISPLAYSCALE
|
||||
SetObjectScale(cinfo->scale);
|
||||
|
||||
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, cinfo->HoverHeight);
|
||||
@@ -434,6 +433,8 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,
|
||||
|
||||
SetUInt32Value(OBJECT_DYNAMIC_FLAGS, dynamicFlags);
|
||||
|
||||
SetUInt32Value(UNIT_FIELD_STATE_ANIM_ID, sAnimationDataStore.GetNumRows());
|
||||
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
|
||||
SetBaseAttackTime(BASE_ATTACK, cInfo->BaseAttackTime);
|
||||
@@ -894,7 +895,8 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 entry, float
|
||||
if (!CreateFromProto(guidlow, entry, data, vehId))
|
||||
return false;
|
||||
|
||||
switch (GetCreatureTemplate()->rank)
|
||||
cinfo = GetCreatureTemplate(); // might be different than initially requested
|
||||
switch (cinfo->rank)
|
||||
{
|
||||
case CREATURE_ELITE_RARE:
|
||||
m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RARE);
|
||||
@@ -924,12 +926,12 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 entry, float
|
||||
Relocate(x, y, z, ang);
|
||||
}
|
||||
|
||||
uint32 displayID = GetNativeDisplayId();
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
|
||||
CreatureModel display(GetNativeDisplayId(), GetNativeDisplayScale(), 1.0f);
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&display, cinfo);
|
||||
if (minfo && !IsTotem()) // Cancel load if no model defined or if totem
|
||||
{
|
||||
SetDisplayId(displayID);
|
||||
SetNativeDisplayId(displayID);
|
||||
SetDisplayId(display.CreatureDisplayID, display.DisplayScale);
|
||||
SetNativeDisplayId(display.CreatureDisplayID, display.DisplayScale);
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
|
||||
}
|
||||
|
||||
@@ -942,10 +944,10 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 entry, float
|
||||
m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST);
|
||||
}
|
||||
|
||||
if (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING)
|
||||
if (cinfo->flags_extra & CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING)
|
||||
AddUnitState(UNIT_STATE_IGNORE_PATHFINDING);
|
||||
|
||||
if (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK)
|
||||
if (cinfo->flags_extra & CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK)
|
||||
{
|
||||
ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
|
||||
ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true);
|
||||
@@ -1129,9 +1131,9 @@ void Creature::SaveToDB(uint32 mapid, std::vector<Difficulty> const& spawnDiffic
|
||||
CreatureTemplate const* cinfo = GetCreatureTemplate();
|
||||
if (cinfo)
|
||||
{
|
||||
if (displayId == cinfo->Modelid1 || displayId == cinfo->Modelid2 ||
|
||||
displayId == cinfo->Modelid3 || displayId == cinfo->Modelid4)
|
||||
displayId = 0;
|
||||
for (CreatureModel model : cinfo->Models)
|
||||
if (displayId && displayId == model.CreatureDisplayID)
|
||||
displayId = 0;
|
||||
|
||||
if (npcflag == cinfo->npcflag)
|
||||
npcflag = 0;
|
||||
@@ -1844,12 +1846,12 @@ void Creature::Respawn(bool force)
|
||||
|
||||
setDeathState(JUST_RESPAWNED);
|
||||
|
||||
uint32 displayID = GetNativeDisplayId();
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
|
||||
CreatureModel display(GetNativeDisplayId(), GetNativeDisplayScale(), 1.0f);
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&display, GetCreatureTemplate());
|
||||
if (minfo) // Cancel load if no model defined
|
||||
{
|
||||
SetDisplayId(displayID);
|
||||
SetNativeDisplayId(displayID);
|
||||
SetDisplayId(display.CreatureDisplayID, display.DisplayScale);
|
||||
SetNativeDisplayId(display.CreatureDisplayID, display.DisplayScale);
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
|
||||
}
|
||||
|
||||
@@ -2575,7 +2577,7 @@ uint8 Creature::GetLevelForTarget(WorldObject const* target) const
|
||||
uint8 targetLevelWithDelta = unitTarget->getLevel() + GetInt32Value(UNIT_FIELD_SCALING_LEVEL_DELTA);
|
||||
|
||||
if (target->IsPlayer())
|
||||
targetLevelWithDelta += target->GetUInt32Value(PLAYER_FIELD_SCALING_PLAYER_LEVEL_DELTA);
|
||||
targetLevelWithDelta += target->GetUInt32Value(ACTIVE_PLAYER_FIELD_SCALING_PLAYER_LEVEL_DELTA);
|
||||
|
||||
return RoundToInterval<uint8>(targetLevelWithDelta, GetUInt32Value(UNIT_FIELD_SCALING_LEVEL_MIN), GetUInt32Value(UNIT_FIELD_SCALING_LEVEL_MAX));
|
||||
}
|
||||
@@ -2853,9 +2855,9 @@ void Creature::SetObjectScale(float scale)
|
||||
}
|
||||
}
|
||||
|
||||
void Creature::SetDisplayId(uint32 modelId)
|
||||
void Creature::SetDisplayId(uint32 modelId, float displayScale /*= 1.f*/)
|
||||
{
|
||||
Unit::SetDisplayId(modelId);
|
||||
Unit::SetDisplayId(modelId, displayScale);
|
||||
|
||||
if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(modelId))
|
||||
{
|
||||
@@ -2864,6 +2866,12 @@ void Creature::SetDisplayId(uint32 modelId)
|
||||
}
|
||||
}
|
||||
|
||||
void Creature::SetDisplayFromModel(uint32 modelIdx)
|
||||
{
|
||||
if (CreatureModel const* model = GetCreatureTemplate()->GetModelByIdx(modelIdx))
|
||||
SetDisplayId(model->CreatureDisplayID, model->DisplayScale);
|
||||
}
|
||||
|
||||
void Creature::SetTarget(ObjectGuid const& guid)
|
||||
{
|
||||
if (IsFocusing(nullptr, true))
|
||||
|
||||
@@ -69,7 +69,8 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
|
||||
void RemoveFromWorld() override;
|
||||
|
||||
void SetObjectScale(float scale) override;
|
||||
void SetDisplayId(uint32 modelId) override;
|
||||
void SetDisplayId(uint32 displayId, float displayScale = 1.f) override;
|
||||
void SetDisplayFromModel(uint32 modelIdx);
|
||||
|
||||
void DisappearAndDie();
|
||||
|
||||
@@ -149,7 +150,6 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
|
||||
|
||||
bool UpdateStats(Stats stat) override;
|
||||
bool UpdateAllStats() override;
|
||||
void UpdateResistances(uint32 school) override;
|
||||
void UpdateArmor() override;
|
||||
void UpdateMaxHealth() override;
|
||||
void UpdateMaxPower(Powers power) override;
|
||||
|
||||
@@ -301,16 +301,29 @@ struct CreatureLevelScaling
|
||||
int16 DeltaLevelMax;
|
||||
};
|
||||
|
||||
struct CreatureModel
|
||||
{
|
||||
static CreatureModel const DefaultInvisibleModel;
|
||||
static CreatureModel const DefaultVisibleModel;
|
||||
|
||||
CreatureModel() :
|
||||
CreatureDisplayID(0), DisplayScale(0.0f), Probability(0.0f) { }
|
||||
|
||||
CreatureModel(uint32 creatureDisplayID, float displayScale, float probability) :
|
||||
CreatureDisplayID(creatureDisplayID), DisplayScale(displayScale), Probability(probability) { }
|
||||
|
||||
uint32 CreatureDisplayID;
|
||||
float DisplayScale;
|
||||
float Probability;
|
||||
};
|
||||
|
||||
// from `creature_template` table
|
||||
struct TC_GAME_API CreatureTemplate
|
||||
{
|
||||
uint32 Entry;
|
||||
uint32 DifficultyEntry[MAX_CREATURE_DIFFICULTIES];
|
||||
uint32 KillCredit[MAX_KILL_CREDIT];
|
||||
uint32 Modelid1;
|
||||
uint32 Modelid2;
|
||||
uint32 Modelid3;
|
||||
uint32 Modelid4;
|
||||
std::vector<CreatureModel> Models;
|
||||
std::string Name;
|
||||
std::string FemaleName;
|
||||
std::string SubName;
|
||||
@@ -369,10 +382,12 @@ struct TC_GAME_API CreatureTemplate
|
||||
uint32 MechanicImmuneMask;
|
||||
uint32 flags_extra;
|
||||
uint32 ScriptID;
|
||||
uint32 GetRandomValidModelId() const;
|
||||
uint32 GetFirstValidModelId() const;
|
||||
uint32 GetFirstInvisibleModel() const;
|
||||
uint32 GetFirstVisibleModel() const;
|
||||
CreatureModel const* GetModelByIdx(uint32 idx) const;
|
||||
CreatureModel const* GetRandomValidModel() const;
|
||||
CreatureModel const* GetFirstValidModel() const;
|
||||
CreatureModel const* GetModelWithDisplayId(uint32 displayId) const;
|
||||
CreatureModel const* GetFirstInvisibleModel() const;
|
||||
CreatureModel const* GetFirstVisibleModel() const;
|
||||
|
||||
// helpers
|
||||
SkillType GetRequiredLootSkill() const
|
||||
|
||||
@@ -286,6 +286,7 @@ void PlayerMenu::SendPointOfInterest(uint32 id) const
|
||||
}
|
||||
|
||||
WorldPackets::NPC::GossipPOI packet;
|
||||
packet.ID = pointOfInterest->ID;
|
||||
packet.Name = pointOfInterest->Name;
|
||||
|
||||
LocaleConstant localeConstant = _session->GetSessionDbLocaleIndex();
|
||||
@@ -438,6 +439,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
|
||||
packet.InformUnit = _session->GetPlayer()->GetDivider();
|
||||
packet.QuestID = quest->GetQuestId();
|
||||
packet.PortraitGiver = quest->GetQuestGiverPortrait();
|
||||
packet.PortraitGiverMount = quest->GetQuestGiverPortraitMount();
|
||||
packet.PortraitTurnIn = quest->GetQuestTurnInPortrait();
|
||||
packet.AutoLaunched = autoLaunched;
|
||||
packet.DisplayPopup = displayPopup;
|
||||
@@ -512,6 +514,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
packet.Info.QuestID = quest->GetQuestId();
|
||||
packet.Info.QuestType = quest->GetQuestType();
|
||||
packet.Info.QuestLevel = quest->GetQuestLevel();
|
||||
packet.Info.QuestScalingFactionGroup = quest->GetQuestScalingFactionGroup();
|
||||
packet.Info.QuestMaxScalingLevel = quest->GetQuestMaxScalingLevel();
|
||||
packet.Info.QuestPackageID = quest->GetQuestPackageID();
|
||||
packet.Info.QuestMinLevel = quest->GetMinLevel();
|
||||
@@ -543,12 +546,14 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
packet.Info.StartItem = quest->GetSrcItemId();
|
||||
packet.Info.Flags = quest->GetFlags();
|
||||
packet.Info.FlagsEx = quest->GetFlagsEx();
|
||||
packet.Info.FlagsEx2 = quest->GetFlagsEx2();
|
||||
packet.Info.RewardTitle = quest->GetRewTitle();
|
||||
packet.Info.RewardArenaPoints = quest->GetRewArenaPoints();
|
||||
packet.Info.RewardSkillLineID = quest->GetRewardSkillId();
|
||||
packet.Info.RewardNumSkillUps = quest->GetRewardSkillPoints();
|
||||
packet.Info.RewardFactionFlags = quest->GetRewardReputationMask();
|
||||
packet.Info.PortraitGiver = quest->GetQuestGiverPortrait();
|
||||
packet.Info.PortraitGiverMount = quest->GetQuestGiverPortraitMount();
|
||||
packet.Info.PortraitTurnIn = quest->GetQuestTurnInPortrait();
|
||||
|
||||
for (uint8 i = 0; i < QUEST_ITEM_DROP_COUNT; ++i)
|
||||
@@ -585,7 +590,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
packet.Info.POIPriority = quest->GetPOIPriority();
|
||||
|
||||
packet.Info.AllowableRaces = quest->GetAllowableRaces();
|
||||
packet.Info.QuestRewardID = quest->GetRewardId();
|
||||
packet.Info.TreasurePickerID = quest->GetTreasurePickerId();
|
||||
packet.Info.Expansion = quest->GetExpansion();
|
||||
|
||||
for (QuestObjective const& questObjective : quest->GetObjectives())
|
||||
@@ -666,6 +671,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
|
||||
|
||||
packet.PortraitTurnIn = quest->GetQuestTurnInPortrait();
|
||||
packet.PortraitGiver = quest->GetQuestGiverPortrait();
|
||||
packet.PortraitGiverMount = quest->GetQuestGiverPortraitMount();
|
||||
packet.QuestPackageID = quest->GetQuestPackageID();
|
||||
|
||||
_session->SendPacket(packet.Write());
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
|
||||
namespace Trainer
|
||||
{
|
||||
bool Spell::IsCastable() const
|
||||
{
|
||||
return sSpellMgr->AssertSpellInfo(SpellId)->HasEffect(SPELL_EFFECT_LEARN_SPELL);
|
||||
}
|
||||
|
||||
Trainer::Trainer(uint32 id, Type type, std::string greeting, std::vector<Spell> spells) : _id(id), _type(type), _spells(std::move(spells))
|
||||
{
|
||||
@@ -136,9 +140,30 @@ namespace Trainer
|
||||
return SpellState::Unavailable;
|
||||
|
||||
// check ranks
|
||||
if (uint32 previousRankSpellId = sSpellMgr->GetPrevSpellInChain(trainerSpell->LearnedSpellId))
|
||||
if (!player->HasSpell(previousRankSpellId))
|
||||
return SpellState::Unavailable;
|
||||
bool hasLearnSpellEffect = false;
|
||||
bool knowsAllLearnedSpells = true;
|
||||
for (SpellEffectInfo const* spellEffect : sSpellMgr->AssertSpellInfo(trainerSpell->SpellId)->GetEffectsForDifficulty(DIFFICULTY_NONE))
|
||||
{
|
||||
if (!spellEffect || !spellEffect->IsEffect(SPELL_EFFECT_LEARN_SPELL))
|
||||
continue;
|
||||
|
||||
hasLearnSpellEffect = true;
|
||||
if (!player->HasSpell(spellEffect->TriggerSpell))
|
||||
knowsAllLearnedSpells = false;
|
||||
|
||||
if (uint32 previousRankSpellId = sSpellMgr->GetPrevSpellInChain(spellEffect->TriggerSpell))
|
||||
if (!player->HasSpell(previousRankSpellId))
|
||||
return SpellState::Unavailable;
|
||||
}
|
||||
|
||||
if (!hasLearnSpellEffect)
|
||||
{
|
||||
if (uint32 previousRankSpellId = sSpellMgr->GetPrevSpellInChain(trainerSpell->SpellId))
|
||||
if (!player->HasSpell(previousRankSpellId))
|
||||
return SpellState::Unavailable;
|
||||
}
|
||||
else if (knowsAllLearnedSpells)
|
||||
return SpellState::Known;
|
||||
|
||||
// check additional spell requirement
|
||||
for (auto const& requirePair : sSpellMgr->GetSpellsRequiredForSpellBounds(trainerSpell->SpellId))
|
||||
|
||||
@@ -59,8 +59,7 @@ namespace Trainer
|
||||
std::array<uint32, 3> ReqAbility = { };
|
||||
uint8 ReqLevel = 0;
|
||||
|
||||
uint32 LearnedSpellId = 0;
|
||||
bool IsCastable() const { return LearnedSpellId != SpellId; }
|
||||
bool IsCastable() const;
|
||||
};
|
||||
|
||||
class Trainer
|
||||
|
||||
@@ -38,7 +38,7 @@ DynamicObject::DynamicObject(bool isWorldObject) : WorldObject(isWorldObject),
|
||||
m_objectType |= TYPEMASK_DYNAMICOBJECT;
|
||||
m_objectTypeId = TYPEID_DYNAMICOBJECT;
|
||||
|
||||
m_updateFlag = UPDATEFLAG_STATIONARY_POSITION;
|
||||
m_updateFlag.Stationary = true;
|
||||
|
||||
m_valuesCount = DYNAMICOBJECT_END;
|
||||
_dynamicValuesCount = DYNAMICOBJECT_DYNAMIC_END;
|
||||
|
||||
@@ -61,7 +61,8 @@ GameObject::GameObject() : WorldObject(false), MapObject(),
|
||||
m_objectType |= TYPEMASK_GAMEOBJECT;
|
||||
m_objectTypeId = TYPEID_GAMEOBJECT;
|
||||
|
||||
m_updateFlag = (UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_ROTATION);
|
||||
m_updateFlag.Stationary = true;
|
||||
m_updateFlag.Rotation = true;
|
||||
|
||||
m_valuesCount = GAMEOBJECT_END;
|
||||
_dynamicValuesCount = GAMEOBJECT_DYNAMIC_END;
|
||||
@@ -238,7 +239,7 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
|
||||
else
|
||||
{
|
||||
guid = ObjectGuid::Create<HighGuid::Transport>(map->GenerateLowGuid<HighGuid::Transport>());
|
||||
m_updateFlag |= UPDATEFLAG_TRANSPORT;
|
||||
m_updateFlag.ServerTime = true;
|
||||
}
|
||||
|
||||
Object::_Create(guid);
|
||||
@@ -271,7 +272,7 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
|
||||
|
||||
if (m_goTemplateAddon->WorldEffectID)
|
||||
{
|
||||
m_updateFlag |= UPDATEFLAG_GAMEOBJECT;
|
||||
m_updateFlag.GameObject = true;
|
||||
SetWorldEffectID(m_goTemplateAddon->WorldEffectID);
|
||||
}
|
||||
}
|
||||
@@ -292,6 +293,8 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
|
||||
SetGoState(goState);
|
||||
SetGoArtKit(artKit);
|
||||
|
||||
SetUInt32Value(GAMEOBJECT_STATE_ANIM_ID, sAnimationDataStore.GetNumRows());
|
||||
|
||||
switch (goInfo->type)
|
||||
{
|
||||
case GAMEOBJECT_TYPE_FISHINGHOLE:
|
||||
@@ -376,7 +379,7 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
|
||||
|
||||
if (gameObjectAddon && gameObjectAddon->WorldEffectID)
|
||||
{
|
||||
m_updateFlag |= UPDATEFLAG_GAMEOBJECT;
|
||||
m_updateFlag.GameObject = true;
|
||||
SetWorldEffectID(gameObjectAddon->WorldEffectID);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ struct GameObjectTemplate
|
||||
uint32 usegrouplootrules; // 15 use group loot rules, enum { false, true, }; Default: false
|
||||
uint32 floatingTooltip; // 16 floatingTooltip, enum { false, true, }; Default: false
|
||||
uint32 conditionID1; // 17 conditionID1, References: PlayerCondition, NoValue = 0
|
||||
int32 xpLevel; // 18 xpLevel, int, Min value: -1, Max value: 123, Default value: 0
|
||||
uint32 XPLevelRange; // 18 XP Level Range, References: ContentTuning, NoValue = 0
|
||||
uint32 xpDifficulty; // 19 xpDifficulty, enum { No Exp, Trivial, Very Small, Small, Substandard, Standard, High, Epic, Dungeon, 5, }; Default: No Exp
|
||||
uint32 lootLevel; // 20 lootLevel, int, Min value: 0, Max value: 123, Default value: 0
|
||||
uint32 GroupXP; // 21 Group XP, enum { false, true, }; Default: false
|
||||
@@ -120,6 +120,7 @@ struct GameObjectTemplate
|
||||
uint32 chestPersonalLoot; // 30 chest Personal Loot, References: Treasure, NoValue = 0
|
||||
uint32 turnpersonallootsecurityoff; // 31 turn personal loot security off, enum { false, true, }; Default: false
|
||||
uint32 ChestProperties; // 32 Chest Properties, References: ChestProperties, NoValue = 0
|
||||
uint32 chestPushLoot; // 33 chest Push Loot, References: Treasure, NoValue = 0
|
||||
} chest;
|
||||
// 4 GAMEOBJECT_TYPE_BINDER
|
||||
struct
|
||||
@@ -332,6 +333,7 @@ struct GameObjectTemplate
|
||||
{
|
||||
uint32 creatureID; // 0 creatureID, References: Creature, NoValue = 0
|
||||
uint32 charges; // 1 charges, int, Min value: 0, Max value: 65535, Default value: 1
|
||||
uint32 Preferonlyifinlineofsight; // 2 Prefer only if in line of sight (expensive), enum { false, true, }; Default: false
|
||||
} guardPost;
|
||||
// 22 GAMEOBJECT_TYPE_SPELLCASTER
|
||||
struct
|
||||
@@ -503,7 +505,10 @@ struct GameObjectTemplate
|
||||
uint32 startOpen; // 1 startOpen, enum { false, true, }; Default: false
|
||||
uint32 autoClose; // 2 autoClose (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
uint32 BlocksPathsDown; // 3 Blocks Paths Down, enum { false, true, }; Default: false
|
||||
uint32 PathBlockerBump; // 4 Path Blocker Bump (ft), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
|
||||
int32 PathBlockerBump; // 4 Path Blocker Bump (ft), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
|
||||
uint32 GiganticAOI; // 5 Gigantic AOI, enum { false, true, }; Default: false
|
||||
uint32 InfiniteAOI; // 6 Infinite AOI, enum { false, true, }; Default: false
|
||||
uint32 DoorisOpaque; // 7 Door is Opaque (Disable portal on close), enum { false, true, }; Default: false
|
||||
} trapdoor;
|
||||
// 36 GAMEOBJECT_TYPE_NEW_FLAG
|
||||
struct
|
||||
@@ -581,7 +586,7 @@ struct GameObjectTemplate
|
||||
struct
|
||||
{
|
||||
int32 SpawnMap; // 0 Spawn Map, References: Map, NoValue = -1
|
||||
uint32 AreaNameSet; // 1 Area Name Set (Index), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
|
||||
int32 AreaNameSet; // 1 Area Name Set (Index), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
|
||||
uint32 DoodadSetA; // 2 Doodad Set A, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
uint32 DoodadSetB; // 3 Doodad Set B, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
} phaseableMO;
|
||||
@@ -616,7 +621,7 @@ struct GameObjectTemplate
|
||||
// 48 GAMEOBJECT_TYPE_UI_LINK
|
||||
struct
|
||||
{
|
||||
uint32 UILinkType; // 0 UI Link Type, enum { Adventure Journal, Obliterum Forge, }; Default: Adventure Journal
|
||||
uint32 UILinkType; // 0 UI Link Type, enum { Adventure Journal, Obliterum Forge, Scrapping Machine, }; Default: Adventure Journal
|
||||
uint32 allowMounted; // 1 allowMounted, enum { false, true, }; Default: false
|
||||
uint32 GiganticAOI; // 2 Gigantic AOI, enum { false, true, }; Default: false
|
||||
uint32 spellFocusType; // 3 spellFocusType, References: SpellFocusObject, NoValue = 0
|
||||
@@ -641,7 +646,7 @@ struct GameObjectTemplate
|
||||
uint32 openTextID; // 9 openTextID, References: BroadcastText, NoValue = 0
|
||||
uint32 floatingTooltip; // 10 floatingTooltip, enum { false, true, }; Default: false
|
||||
uint32 conditionID1; // 11 conditionID1, References: PlayerCondition, NoValue = 0
|
||||
uint32 xpLevel; // 12 xpLevel, int, Min value: -1, Max value: 123, Default value: 0
|
||||
uint32 XPLevelRange; // 12 XP Level Range, References: ContentTuning, NoValue = 0
|
||||
uint32 xpDifficulty; // 13 xpDifficulty, enum { No Exp, Trivial, Very Small, Small, Substandard, Standard, High, Epic, Dungeon, 5, }; Default: No Exp
|
||||
uint32 spell; // 14 spell, References: Spell, NoValue = 0
|
||||
uint32 GiganticAOI; // 15 Gigantic AOI, enum { false, true, }; Default: false
|
||||
@@ -650,13 +655,45 @@ struct GameObjectTemplate
|
||||
uint32 MaxNumberofLoots; // 18 Max Number of Loots, int, Min value: 1, Max value: 40, Default value: 10
|
||||
uint32 logloot; // 19 log loot, enum { false, true, }; Default: false
|
||||
uint32 linkedTrap; // 20 linkedTrap, References: GameObjects, NoValue = 0
|
||||
uint32 PlayOpenAnimationonOpening; // 21 Play Open Animation on Opening, enum { false, true, }; Default: false
|
||||
} gatheringNode;
|
||||
// 51 GAMEOBJECT_TYPE_CHALLENGE_MODE_REWARD
|
||||
struct
|
||||
{
|
||||
uint32 chestLoot; // 0 chestLoot, References: Treasure, NoValue = 0
|
||||
uint32 WhenAvailable; // 1 When Available, References: GameObjectDisplayInfo, NoValue = 0
|
||||
uint32 open; // 2 open, References: Lock_, NoValue = 0
|
||||
uint32 openTextID; // 3 openTextID, References: BroadcastText, NoValue = 0
|
||||
} challengeModeReward;
|
||||
// 52 GAMEOBJECT_TYPE_MULTI
|
||||
struct
|
||||
{
|
||||
uint32 MultiProperties; // 0 Multi Properties, References: MultiProperties, NoValue = 0
|
||||
} multi;
|
||||
// 53 GAMEOBJECT_TYPE_SIEGEABLE_MULTI
|
||||
struct
|
||||
{
|
||||
uint32 MultiProperties; // 0 Multi Properties, References: MultiProperties, NoValue = 0
|
||||
uint32 InitialDamage; // 1 Initial Damage, enum { None, Raw, Ratio, }; Default: None
|
||||
} siegeableMulti;
|
||||
// 54 GAMEOBJECT_TYPE_SIEGEABLE_MO
|
||||
struct
|
||||
{
|
||||
uint32 SiegeableProperties; // 0 Siegeable Properties, References: SiegeableProperties, NoValue = 0
|
||||
uint32 DoodadSetA; // 1 Doodad Set A, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
uint32 DoodadSetB; // 2 Doodad Set B, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
uint32 DoodadSetC; // 3 Doodad Set C, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
int32 SpawnMap; // 4 Spawn Map, References: Map, NoValue = -1
|
||||
int32 AreaNameSet; // 5 Area Name Set (Index), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
|
||||
} siegeableMO;
|
||||
// 55 GAMEOBJECT_TYPE_PVP_REWARD
|
||||
struct
|
||||
{
|
||||
uint32 chestLoot; // 0 chestLoot, References: Treasure, NoValue = 0
|
||||
uint32 WhenAvailable; // 1 When Available, References: GameObjectDisplayInfo, NoValue = 0
|
||||
uint32 open; // 2 open, References: Lock_, NoValue = 0
|
||||
uint32 openTextID; // 3 openTextID, References: BroadcastText, NoValue = 0
|
||||
} pvpReward;
|
||||
struct
|
||||
{
|
||||
uint32 data[MAX_GAMEOBJECT_DATA];
|
||||
@@ -709,6 +746,8 @@ struct GameObjectTemplate
|
||||
case GAMEOBJECT_TYPE_NEW_FLAG_DROP: return newflagdrop.open;
|
||||
case GAMEOBJECT_TYPE_CAPTURE_POINT: return capturePoint.open;
|
||||
case GAMEOBJECT_TYPE_GATHERING_NODE: return gatheringNode.open;
|
||||
case GAMEOBJECT_TYPE_CHALLENGE_MODE_REWARD: return challengeModeReward.open;
|
||||
case GAMEOBJECT_TYPE_PVP_REWARD: return pvpReward.open;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,8 +275,6 @@ Item::Item()
|
||||
m_objectType |= TYPEMASK_ITEM;
|
||||
m_objectTypeId = TYPEID_ITEM;
|
||||
|
||||
m_updateFlag = 0;
|
||||
|
||||
m_valuesCount = ITEM_END;
|
||||
_dynamicValuesCount = ITEM_DYNAMIC_END;
|
||||
m_slot = 0;
|
||||
@@ -316,14 +314,8 @@ bool Item::Create(ObjectGuid::LowType guidlow, uint32 itemId, Player const* owne
|
||||
SetUInt32Value(ITEM_FIELD_DURABILITY, itemProto->MaxDurability);
|
||||
|
||||
for (std::size_t i = 0; i < itemProto->Effects.size(); ++i)
|
||||
{
|
||||
if (i < 5)
|
||||
SetSpellCharges(i, itemProto->Effects[i]->Charges);
|
||||
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemProto->Effects[i]->SpellID))
|
||||
if (owner && spellInfo->HasEffect(SPELL_EFFECT_GIVE_ARTIFACT_POWER))
|
||||
if (uint32 artifactKnowledgeLevel = sWorld->getIntConfig(CONFIG_CURRENCY_START_ARTIFACT_KNOWLEDGE))
|
||||
SetModifier(ITEM_MODIFIER_ARTIFACT_KNOWLEDGE_LEVEL, artifactKnowledgeLevel + 1);
|
||||
}
|
||||
|
||||
SetUInt32Value(ITEM_FIELD_DURATION, itemProto->GetDuration());
|
||||
SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, 0);
|
||||
@@ -1709,7 +1701,7 @@ bool Item::HasStats() const
|
||||
ItemTemplate const* proto = GetTemplate();
|
||||
Player const* owner = GetOwner();
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
if ((owner ? GetItemStatValue(i, owner) : proto->GetItemStatValue(i)) != 0)
|
||||
if ((owner ? GetItemStatValue(i, owner) : proto->GetItemStatAllocation(i)) != 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -1721,7 +1713,7 @@ bool Item::HasStats(WorldPackets::Item::ItemInstance const& itemInstance, BonusD
|
||||
return true;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
if (bonus->ItemStatValue[i] != 0)
|
||||
if (bonus->ItemStatAllocation[i] != 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -2231,9 +2223,9 @@ uint32 Item::GetItemLevel(ItemTemplate const* itemTemplate, BonusData const& bon
|
||||
else
|
||||
level = std::min(std::max(int32(level), ssd->MinLevel), ssd->MaxLevel);
|
||||
|
||||
if (SandboxScalingEntry const* sandbox = sSandboxScalingStore.LookupEntry(bonusData.SandboxScalingId))
|
||||
if ((sandbox->Flags & 2 || sandbox->MinLevel || sandbox->MaxLevel) && !(sandbox->Flags & 4))
|
||||
level = std::min(std::max(int32(level), sandbox->MinLevel), sandbox->MaxLevel);
|
||||
if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(bonusData.ContentTuningId))
|
||||
if ((contentTuning->Flags & 2 || contentTuning->MinLevel || contentTuning->MaxLevel) && !(contentTuning->Flags & 4))
|
||||
level = std::min(std::max(int32(level), contentTuning->MinLevel), contentTuning->MaxLevel);
|
||||
|
||||
if (uint32 heirloomIlvl = uint32(sDB2Manager.GetCurveValueAt(ssd->PlayerLevelToItemLevelCurveID, level)))
|
||||
itemLevel = heirloomIlvl;
|
||||
@@ -2276,7 +2268,7 @@ int32 Item::GetItemStatValue(uint32 index, Player const* owner) const
|
||||
return int32(std::floor(statValue + 0.5f));
|
||||
}
|
||||
|
||||
return _bonusData.ItemStatValue[index];
|
||||
return 0;
|
||||
}
|
||||
|
||||
ItemDisenchantLootEntry const* Item::GetDisenchantLoot(Player const* owner) const
|
||||
@@ -2565,8 +2557,6 @@ void Item::GiveArtifactXp(uint64 amount, Item* sourceItem, uint32 artifactCatego
|
||||
uint32 artifactKnowledgeLevel = 1;
|
||||
if (sourceItem && sourceItem->GetModifier(ITEM_MODIFIER_ARTIFACT_KNOWLEDGE_LEVEL))
|
||||
artifactKnowledgeLevel = sourceItem->GetModifier(ITEM_MODIFIER_ARTIFACT_KNOWLEDGE_LEVEL);
|
||||
else if (artifactCategoryId == ARTIFACT_CATEGORY_PRIMARY)
|
||||
artifactKnowledgeLevel = sWorld->getIntConfig(CONFIG_CURRENCY_START_ARTIFACT_KNOWLEDGE) + 1;
|
||||
|
||||
if (GtArtifactKnowledgeMultiplierEntry const* artifactKnowledge = sArtifactKnowledgeMultiplierGameTable.GetRow(artifactKnowledgeLevel))
|
||||
amount = uint64(amount * artifactKnowledge->Multiplier);
|
||||
@@ -2598,9 +2588,9 @@ void Item::SetFixedLevel(uint8 level)
|
||||
{
|
||||
level = std::min(std::max(int32(level), ssd->MinLevel), ssd->MaxLevel);
|
||||
|
||||
if (SandboxScalingEntry const* sandbox = sSandboxScalingStore.LookupEntry(_bonusData.SandboxScalingId))
|
||||
if ((sandbox->Flags & 2 || sandbox->MinLevel || sandbox->MaxLevel) && !(sandbox->Flags & 4))
|
||||
level = std::min(std::max(int32(level), sandbox->MinLevel), sandbox->MaxLevel);
|
||||
if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(_bonusData.ContentTuningId))
|
||||
if ((contentTuning->Flags & 2 || contentTuning->MinLevel || contentTuning->MaxLevel) && !(contentTuning->Flags & 4))
|
||||
level = std::min(std::max(int32(level), contentTuning->MinLevel), contentTuning->MaxLevel);
|
||||
|
||||
SetModifier(ITEM_MODIFIER_SCALING_STAT_DISTRIBUTION_FIXED_LEVEL, level);
|
||||
}
|
||||
@@ -2624,9 +2614,6 @@ void BonusData::Initialize(ItemTemplate const* proto)
|
||||
for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
ItemStatType[i] = proto->GetItemStatType(i);
|
||||
|
||||
for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
ItemStatValue[i] = proto->GetItemStatValue(i);
|
||||
|
||||
for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
ItemStatAllocation[i] = proto->GetItemStatAllocation(i);
|
||||
|
||||
@@ -2646,7 +2633,7 @@ void BonusData::Initialize(ItemTemplate const* proto)
|
||||
AppearanceModID = 0;
|
||||
RepairCostMultiplier = 1.0f;
|
||||
ScalingStatDistribution = proto->GetScalingStatDistribution();
|
||||
SandboxScalingId = 0;
|
||||
ContentTuningId = 0;
|
||||
RelicType = -1;
|
||||
HasItemLevelBonus = false;
|
||||
HasFixedLevel = false;
|
||||
@@ -2734,7 +2721,7 @@ void BonusData::AddBonus(uint32 type, int32 const (&values)[3])
|
||||
if (values[1] < _state.ScalingStatDistributionPriority)
|
||||
{
|
||||
ScalingStatDistribution = static_cast<uint32>(values[0]);
|
||||
SandboxScalingId = static_cast<uint32>(values[2]);
|
||||
ContentTuningId = static_cast<uint32>(values[2]);
|
||||
_state.ScalingStatDistributionPriority = values[1];
|
||||
HasFixedLevel = type == ITEM_BONUS_SCALING_STAT_DISTRIBUTION_FIXED;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ struct BonusData
|
||||
int32 ItemLevelBonus;
|
||||
int32 RequiredLevel;
|
||||
int32 ItemStatType[MAX_ITEM_PROTO_STATS];
|
||||
int32 ItemStatValue[MAX_ITEM_PROTO_STATS];
|
||||
int32 ItemStatAllocation[MAX_ITEM_PROTO_STATS];
|
||||
float ItemStatSocketCostMultiplier[MAX_ITEM_PROTO_STATS];
|
||||
uint32 SocketColor[MAX_ITEM_PROTO_SOCKETS];
|
||||
@@ -86,7 +85,7 @@ struct BonusData
|
||||
uint32 AppearanceModID;
|
||||
float RepairCostMultiplier;
|
||||
uint32 ScalingStatDistribution;
|
||||
uint32 SandboxScalingId;
|
||||
uint32 ContentTuningId;
|
||||
uint32 DisenchantLootId;
|
||||
uint32 GemItemLevelBonus[MAX_ITEM_PROTO_SOCKETS];
|
||||
int32 GemRelicType[MAX_ITEM_PROTO_SOCKETS];
|
||||
|
||||
@@ -51,79 +51,82 @@ enum InventoryResult : uint8
|
||||
EQUIP_ERR_TOO_FEW_TO_SPLIT = 26, // Tried to split more than number in stack.
|
||||
EQUIP_ERR_SPLIT_FAILED = 27, // Couldn't split those items.
|
||||
EQUIP_ERR_SPELL_FAILED_REAGENTS_GENERIC = 28, // Missing reagent
|
||||
EQUIP_ERR_NOT_ENOUGH_MONEY = 29, // You don't have enough money.
|
||||
EQUIP_ERR_NOT_A_BAG = 30, // Not a bag.
|
||||
EQUIP_ERR_DESTROY_NONEMPTY_BAG = 31, // You can only do that with empty bags.
|
||||
EQUIP_ERR_NOT_OWNER = 32, // You don't own that item.
|
||||
EQUIP_ERR_ONLY_ONE_QUIVER = 33, // You can only equip one quiver.
|
||||
EQUIP_ERR_NO_BANK_SLOT = 34, // You must purchase that bag slot first
|
||||
EQUIP_ERR_NO_BANK_HERE = 35, // You are too far away from a bank.
|
||||
EQUIP_ERR_ITEM_LOCKED = 36, // Item is locked.
|
||||
EQUIP_ERR_GENERIC_STUNNED = 37, // You are stunned
|
||||
EQUIP_ERR_PLAYER_DEAD = 38, // You can't do that when you're dead.
|
||||
EQUIP_ERR_CLIENT_LOCKED_OUT = 39, // You can't do that right now.
|
||||
EQUIP_ERR_INTERNAL_BAG_ERROR = 40, // Internal Bag Error
|
||||
EQUIP_ERR_ONLY_ONE_BOLT = 41, // You can only equip one quiver.
|
||||
EQUIP_ERR_ONLY_ONE_AMMO = 42, // You can only equip one ammo pouch.
|
||||
EQUIP_ERR_CANT_WRAP_STACKABLE = 43, // Stackable items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_EQUIPPED = 44, // Equipped items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_WRAPPED = 45, // Wrapped items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_BOUND = 46, // Bound items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_UNIQUE = 47, // Unique items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_BAGS = 48, // Bags can't be wrapped.
|
||||
EQUIP_ERR_LOOT_GONE = 49, // Already looted
|
||||
EQUIP_ERR_INV_FULL = 50, // Inventory is full.
|
||||
EQUIP_ERR_BANK_FULL = 51, // Your bank is full
|
||||
EQUIP_ERR_VENDOR_SOLD_OUT = 52, // That item is currently sold out.
|
||||
EQUIP_ERR_BAG_FULL_2 = 53, // That bag is full.
|
||||
EQUIP_ERR_ITEM_NOT_FOUND_2 = 54, // The item was not found.
|
||||
EQUIP_ERR_CANT_STACK_2 = 55, // This item cannot stack.
|
||||
EQUIP_ERR_BAG_FULL_3 = 56, // That bag is full.
|
||||
EQUIP_ERR_VENDOR_SOLD_OUT_2 = 57, // That item is currently sold out.
|
||||
EQUIP_ERR_OBJECT_IS_BUSY = 58, // That object is busy.
|
||||
EQUIP_ERR_CANT_BE_DISENCHANTED = 59,
|
||||
EQUIP_ERR_NOT_IN_COMBAT = 60, // You can't do that while in combat
|
||||
EQUIP_ERR_NOT_WHILE_DISARMED = 61, // You can't do that while disarmed
|
||||
EQUIP_ERR_BAG_FULL_4 = 62, // That bag is full.
|
||||
EQUIP_ERR_CANT_EQUIP_RANK = 63, // You don't have the required rank for that item
|
||||
EQUIP_ERR_CANT_EQUIP_REPUTATION = 64, // You don't have the required reputation for that item
|
||||
EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65, // You cannot equip another bag of that type
|
||||
EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66, // You can't loot that item now.
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE = 67, // You cannot equip more than one of those.
|
||||
EQUIP_ERR_VENDOR_MISSING_TURNINS = 68, // You do not have the required items for that purchase
|
||||
EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69, // You don't have enough honor points
|
||||
EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70, // You don't have enough arena points
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71, // You have the maximum number of those gems in your inventory or socketed into items.
|
||||
EQUIP_ERR_MAIL_BOUND_ITEM = 72, // You can't mail soulbound items.
|
||||
EQUIP_ERR_INTERNAL_BAG_ERROR_2 = 73, // Internal Bag Error
|
||||
EQUIP_ERR_BAG_FULL_5 = 74, // That bag is full.
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75, // You have the maximum number of those gems socketed into equipped items.
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76, // You cannot socket more than one of those gems into a single item.
|
||||
EQUIP_ERR_TOO_MUCH_GOLD = 77, // At gold limit
|
||||
EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78, // You can't do that while in an arena match
|
||||
EQUIP_ERR_TRADE_BOUND_ITEM = 79, // You can't trade a soulbound item.
|
||||
EQUIP_ERR_CANT_EQUIP_RATING = 80, // You don't have the personal, team, or battleground rating required to buy that item
|
||||
EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 81,
|
||||
EQUIP_ERR_NOT_SAME_ACCOUNT = 82, // Account-bound items can only be given to your own characters.
|
||||
EQUIP_ERR_NO_OUTPUT = 83,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 84, // You can only carry %d %s
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS = 85, // You can only equip %d |4item:items in the %s category
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86, // Your level is too high to use that item
|
||||
EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87, // You must reach level %d to purchase that item.
|
||||
EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88, // You do not have the required talent to equip that.
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS = 89, // You can only equip %d |4item:items in the %s category
|
||||
EQUIP_ERR_SHAPESHIFT_FORM_CANNOT_EQUIP = 90, // Cannot equip item in this form
|
||||
EQUIP_ERR_ITEM_INVENTORY_FULL_SATCHEL = 91, // Your inventory is full. Your satchel has been delivered to your mailbox.
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_TOO_LOW = 92, // Your level is too low to use that item
|
||||
EQUIP_ERR_CANT_BUY_QUANTITY = 93, // You can't buy the specified quantity of that item.
|
||||
EQUIP_ERR_ITEM_IS_BATTLE_PAY_LOCKED = 94, // Your purchased item is still waiting to be unlocked
|
||||
EQUIP_ERR_REAGENT_BANK_FULL = 95, // Your reagent bank is full
|
||||
EQUIP_ERR_REAGENT_BANK_LOCKED = 96,
|
||||
EQUIP_ERR_WRONG_BAG_TYPE_3 = 97,
|
||||
EQUIP_ERR_CANT_USE_ITEM = 98, // You can't use that item.
|
||||
EQUIP_ERR_CANT_BE_OBLITERATED = 99, // You can't obliterate that item
|
||||
EQUIP_ERR_GUILD_BANK_CONJURED_ITEM = 100,// You cannot store conjured items in the guild bank
|
||||
EQUIP_ERR_CANT_DO_THAT_RIGHT_NOW = 101,// You can't do that right now.
|
||||
EQUIP_ERR_CANT_TRADE_GOLD = 29, // Gold may only be offered by one trader.
|
||||
EQUIP_ERR_NOT_ENOUGH_MONEY = 30, // You don't have enough money.
|
||||
EQUIP_ERR_NOT_A_BAG = 31, // Not a bag.
|
||||
EQUIP_ERR_DESTROY_NONEMPTY_BAG = 32, // You can only do that with empty bags.
|
||||
EQUIP_ERR_NOT_OWNER = 33, // You don't own that item.
|
||||
EQUIP_ERR_ONLY_ONE_QUIVER = 34, // You can only equip one quiver.
|
||||
EQUIP_ERR_NO_BANK_SLOT = 35, // You must purchase that bag slot first
|
||||
EQUIP_ERR_NO_BANK_HERE = 36, // You are too far away from a bank.
|
||||
EQUIP_ERR_ITEM_LOCKED = 37, // Item is locked.
|
||||
EQUIP_ERR_GENERIC_STUNNED = 38, // You are stunned
|
||||
EQUIP_ERR_PLAYER_DEAD = 39, // You can't do that when you're dead.
|
||||
EQUIP_ERR_CLIENT_LOCKED_OUT = 40, // You can't do that right now.
|
||||
EQUIP_ERR_INTERNAL_BAG_ERROR = 41, // Internal Bag Error
|
||||
EQUIP_ERR_ONLY_ONE_BOLT = 42, // You can only equip one quiver.
|
||||
EQUIP_ERR_ONLY_ONE_AMMO = 43, // You can only equip one ammo pouch.
|
||||
EQUIP_ERR_CANT_WRAP_STACKABLE = 44, // Stackable items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_EQUIPPED = 45, // Equipped items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_WRAPPED = 46, // Wrapped items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_BOUND = 47, // Bound items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_UNIQUE = 48, // Unique items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_BAGS = 49, // Bags can't be wrapped.
|
||||
EQUIP_ERR_LOOT_GONE = 50, // Already looted
|
||||
EQUIP_ERR_INV_FULL = 51, // Inventory is full.
|
||||
EQUIP_ERR_BANK_FULL = 52, // Your bank is full
|
||||
EQUIP_ERR_VENDOR_SOLD_OUT = 53, // That item is currently sold out.
|
||||
EQUIP_ERR_BAG_FULL_2 = 54, // That bag is full.
|
||||
EQUIP_ERR_ITEM_NOT_FOUND_2 = 55, // The item was not found.
|
||||
EQUIP_ERR_CANT_STACK_2 = 56, // This item cannot stack.
|
||||
EQUIP_ERR_BAG_FULL_3 = 57, // That bag is full.
|
||||
EQUIP_ERR_VENDOR_SOLD_OUT_2 = 58, // That item is currently sold out.
|
||||
EQUIP_ERR_OBJECT_IS_BUSY = 59, // That object is busy.
|
||||
EQUIP_ERR_CANT_BE_DISENCHANTED = 60, // Item cannot be disenchanted
|
||||
EQUIP_ERR_NOT_IN_COMBAT = 61, // You can't do that while in combat
|
||||
EQUIP_ERR_NOT_WHILE_DISARMED = 62, // You can't do that while disarmed
|
||||
EQUIP_ERR_BAG_FULL_4 = 63, // That bag is full.
|
||||
EQUIP_ERR_CANT_EQUIP_RANK = 64, // You don't have the required rank for that item
|
||||
EQUIP_ERR_CANT_EQUIP_REPUTATION = 65, // You don't have the required reputation for that item
|
||||
EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 66, // You cannot equip another bag of that type
|
||||
EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 67, // You can't loot that item now.
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE = 68, // You cannot equip more than one of those.
|
||||
EQUIP_ERR_VENDOR_MISSING_TURNINS = 69, // You do not have the required items for that purchase
|
||||
EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 70, // You don't have enough honor points
|
||||
EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 71, // You don't have enough arena points
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 72, // You have the maximum number of those gems in your inventory or socketed into items.
|
||||
EQUIP_ERR_MAIL_BOUND_ITEM = 73, // You can't mail soulbound items.
|
||||
EQUIP_ERR_INTERNAL_BAG_ERROR_2 = 74, // Internal Bag Error
|
||||
EQUIP_ERR_BAG_FULL_5 = 75, // That bag is full.
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 76, // You have the maximum number of those gems socketed into equipped items.
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 77, // You cannot socket more than one of those gems into a single item.
|
||||
EQUIP_ERR_TOO_MUCH_GOLD = 78, // At gold limit
|
||||
EQUIP_ERR_NOT_DURING_ARENA_MATCH = 79, // You can't do that while in an arena match
|
||||
EQUIP_ERR_TRADE_BOUND_ITEM = 80, // You can't trade a soulbound item.
|
||||
EQUIP_ERR_CANT_EQUIP_RATING = 81, // You don't have the personal, team, or battleground rating required to buy that item
|
||||
EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 82,
|
||||
EQUIP_ERR_NOT_SAME_ACCOUNT = 83, // Account-bound items can only be given to your own characters.
|
||||
EQUIP_NONE_3 = 84,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 85, // You can only carry %d %s
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS = 86, // You can only equip %d |4item:items in the %s category
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 87, // Your level is too high to use that item
|
||||
EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 88, // You must reach level %d to purchase that item.
|
||||
EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 89, // You do not have the required talent to equip that.
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS = 90, // You can only equip %d |4item:items in the %s category
|
||||
EQUIP_ERR_SHAPESHIFT_FORM_CANNOT_EQUIP = 91, // Cannot equip item in this form
|
||||
EQUIP_ERR_ITEM_INVENTORY_FULL_SATCHEL = 92, // Your inventory is full. Your satchel has been delivered to your mailbox.
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_TOO_LOW = 93, // Your level is too low to use that item
|
||||
EQUIP_ERR_CANT_BUY_QUANTITY = 94, // You can't buy the specified quantity of that item.
|
||||
EQUIP_ERR_ITEM_IS_BATTLE_PAY_LOCKED = 95, // Your purchased item is still waiting to be unlocked
|
||||
EQUIP_ERR_REAGENT_BANK_FULL = 96, // Your reagent bank is full
|
||||
EQUIP_ERR_REAGENT_BANK_LOCKED = 97,
|
||||
EQUIP_ERR_WRONG_BAG_TYPE_3 = 98, // That item doesn't go in that container.
|
||||
EQUIP_ERR_CANT_USE_ITEM = 99, // You can't use that item.
|
||||
EQUIP_ERR_CANT_BE_OBLITERATED = 100,// You can't obliterate that item
|
||||
EQUIP_ERR_GUILD_BANK_CONJURED_ITEM = 101,// You cannot store conjured items in the guild bank
|
||||
EQUIP_ERR_CANT_DO_THAT_RIGHT_NOW = 102,// You can't do that right now.
|
||||
EQUIP_ERR_BAG_FULL_6 = 103,// That bag is full.
|
||||
EQUIP_ERR_CANT_BE_SCRAPPED = 104,// You can't scrap that item
|
||||
};
|
||||
|
||||
enum BuyResult
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "ItemTemplate.h"
|
||||
#include "Player.h"
|
||||
|
||||
uint32 const SocketColorToGemTypeMask[19] =
|
||||
int32 const SocketColorToGemTypeMask[19] =
|
||||
{
|
||||
0,
|
||||
SOCKET_COLOR_META,
|
||||
@@ -241,7 +241,7 @@ bool ItemTemplate::IsUsableByLootSpecialization(Player const* player, bool alway
|
||||
if (GetFlags() & ITEM_FLAG_IS_BOUND_TO_ACCOUNT && alwaysAllowBoundToAccount)
|
||||
return true;
|
||||
|
||||
uint32 spec = player->GetUInt32Value(PLAYER_FIELD_LOOT_SPEC_ID);
|
||||
uint32 spec = player->GetUInt32Value(ACTIVE_PLAYER_FIELD_LOOT_SPEC_ID);
|
||||
if (!spec)
|
||||
spec = player->GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID);
|
||||
if (!spec)
|
||||
|
||||
@@ -337,7 +337,7 @@ enum SocketColor
|
||||
SOCKET_COLOR_RELIC_HOLY = 0x10000
|
||||
};
|
||||
|
||||
extern uint32 const SocketColorToGemTypeMask[19];
|
||||
extern int32 const SocketColorToGemTypeMask[19];
|
||||
|
||||
#define SOCKET_COLOR_STANDARD (SOCKET_COLOR_RED | SOCKET_COLOR_YELLOW | SOCKET_COLOR_BLUE)
|
||||
|
||||
@@ -732,7 +732,6 @@ struct TC_GAME_API ItemTemplate
|
||||
uint32 GetMaxCount() const { return ExtendedData->MaxCount; }
|
||||
uint32 GetContainerSlots() const { return ExtendedData->ContainerSlots; }
|
||||
int32 GetItemStatType(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatModifierBonusStat[index]; }
|
||||
int32 GetItemStatValue(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->ItemStatValue[index]; }
|
||||
int32 GetItemStatAllocation(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatPercentEditor[index]; }
|
||||
float GetItemStatSocketCostMultiplier(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatPercentageOfSocket[index]; }
|
||||
uint32 GetScalingStatDistribution() const { return ExtendedData->ScalingStatDistributionID; }
|
||||
|
||||
@@ -55,7 +55,7 @@ Object::Object()
|
||||
{
|
||||
m_objectTypeId = TYPEID_OBJECT;
|
||||
m_objectType = TYPEMASK_OBJECT;
|
||||
m_updateFlag = UPDATEFLAG_NONE;
|
||||
m_updateFlag.Clear();
|
||||
|
||||
m_uint32Values = nullptr;
|
||||
_dynamicValues = nullptr;
|
||||
@@ -130,7 +130,6 @@ void Object::_Create(ObjectGuid const& guid)
|
||||
if (!m_uint32Values) _InitValues();
|
||||
|
||||
SetGuidValue(OBJECT_FIELD_GUID, guid);
|
||||
SetUInt16Value(OBJECT_FIELD_TYPE, 0, m_objectType);
|
||||
}
|
||||
|
||||
std::string Object::_ConcatFields(uint16 startIndex, uint16 size) const
|
||||
@@ -171,12 +170,19 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
uint8 updateType = UPDATETYPE_CREATE_OBJECT;
|
||||
uint32 flags = m_updateFlag;
|
||||
uint8 updateType = UPDATETYPE_CREATE_OBJECT;
|
||||
uint8 objectType = m_objectTypeId;
|
||||
uint16 objectTypeMask = m_objectType;
|
||||
CreateObjectBits flags = m_updateFlag;
|
||||
|
||||
/** lower flag1 **/
|
||||
if (target == this) // building packet for yourself
|
||||
flags |= UPDATEFLAG_SELF;
|
||||
{
|
||||
flags.ThisIsYou = true;
|
||||
flags.ActivePlayer = true;
|
||||
objectType = TYPEID_ACTIVE_PLAYER;
|
||||
objectTypeMask |= TYPEMASK_ACTIVE_PLAYER;
|
||||
}
|
||||
|
||||
switch (GetGUID().GetHigh())
|
||||
{
|
||||
@@ -209,15 +215,14 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
||||
|
||||
if (WorldObject const* worldObject = dynamic_cast<WorldObject const*>(this))
|
||||
{
|
||||
if (!(flags & UPDATEFLAG_LIVING))
|
||||
if (!worldObject->m_movementInfo.transport.guid.IsEmpty())
|
||||
flags |= UPDATEFLAG_TRANSPORT_POSITION;
|
||||
if (!flags.MovementUpdate && !worldObject->m_movementInfo.transport.guid.IsEmpty())
|
||||
flags.MovementTransport = true;
|
||||
|
||||
if (worldObject->GetAIAnimKitId() || worldObject->GetMovementAnimKitId() || worldObject->GetMeleeAnimKitId())
|
||||
flags |= UPDATEFLAG_ANIMKITS;
|
||||
flags.AnimKit = true;
|
||||
}
|
||||
|
||||
if (flags & UPDATEFLAG_STATIONARY_POSITION)
|
||||
if (flags.Stationary)
|
||||
{
|
||||
// UPDATETYPE_CREATE_OBJECT2 for some gameobject types...
|
||||
if (isType(TYPEMASK_GAMEOBJECT))
|
||||
@@ -238,12 +243,13 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
||||
|
||||
if (Unit const* unit = ToUnit())
|
||||
if (unit->GetVictim())
|
||||
flags |= UPDATEFLAG_HAS_TARGET;
|
||||
flags.CombatVictim = true;
|
||||
|
||||
ByteBuffer buf(0x400);
|
||||
buf << uint8(updateType);
|
||||
buf << GetGUID();
|
||||
buf << uint8(m_objectTypeId);
|
||||
buf << uint8(objectType);
|
||||
buf << uint32(objectTypeMask);
|
||||
|
||||
BuildMovementUpdate(&buf, flags);
|
||||
BuildValuesUpdate(updateType, &buf, target);
|
||||
@@ -338,25 +344,8 @@ ObjectGuid const& Object::GetGuidValue(uint16 index) const
|
||||
return *((ObjectGuid*)&(m_uint32Values[index]));
|
||||
}
|
||||
|
||||
void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
void Object::BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags) const
|
||||
{
|
||||
bool NoBirthAnim = false;
|
||||
bool EnablePortals = false;
|
||||
bool PlayHoverAnim = false;
|
||||
bool HasMovementUpdate = (flags & UPDATEFLAG_LIVING) != 0;
|
||||
bool HasMovementTransport = (flags & UPDATEFLAG_TRANSPORT_POSITION) != 0;
|
||||
bool Stationary = (flags & UPDATEFLAG_STATIONARY_POSITION) != 0;
|
||||
bool CombatVictim = (flags & UPDATEFLAG_HAS_TARGET) != 0;
|
||||
bool ServerTime = (flags & UPDATEFLAG_TRANSPORT) != 0;
|
||||
bool VehicleCreate = (flags & UPDATEFLAG_VEHICLE) != 0;
|
||||
bool AnimKitCreate = (flags & UPDATEFLAG_ANIMKITS) != 0;
|
||||
bool Rotation = (flags & UPDATEFLAG_ROTATION) != 0;
|
||||
bool HasAreaTrigger = (flags & UPDATEFLAG_AREATRIGGER) != 0;
|
||||
bool HasGameObject = (flags & UPDATEFLAG_GAMEOBJECT) != 0;
|
||||
bool ThisIsYou = (flags & UPDATEFLAG_SELF) != 0;
|
||||
bool SmoothPhasing = false;
|
||||
bool SceneObjCreate = false;
|
||||
bool PlayerCreateData = GetTypeId() == TYPEID_PLAYER && ToUnit()->GetPowerIndex(POWER_RUNES) != MAX_POWERS;
|
||||
std::vector<uint32> const* PauseTimes = nullptr;
|
||||
uint32 PauseTimesCount = 0;
|
||||
if (GameObject const* go = ToGameObject())
|
||||
@@ -368,26 +357,27 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
}
|
||||
}
|
||||
|
||||
data->WriteBit(NoBirthAnim);
|
||||
data->WriteBit(EnablePortals);
|
||||
data->WriteBit(PlayHoverAnim);
|
||||
data->WriteBit(HasMovementUpdate);
|
||||
data->WriteBit(HasMovementTransport);
|
||||
data->WriteBit(Stationary);
|
||||
data->WriteBit(CombatVictim);
|
||||
data->WriteBit(ServerTime);
|
||||
data->WriteBit(VehicleCreate);
|
||||
data->WriteBit(AnimKitCreate);
|
||||
data->WriteBit(Rotation);
|
||||
data->WriteBit(HasAreaTrigger);
|
||||
data->WriteBit(HasGameObject);
|
||||
data->WriteBit(SmoothPhasing);
|
||||
data->WriteBit(ThisIsYou);
|
||||
data->WriteBit(SceneObjCreate);
|
||||
data->WriteBit(PlayerCreateData);
|
||||
data->WriteBit(flags.NoBirthAnim);
|
||||
data->WriteBit(flags.EnablePortals);
|
||||
data->WriteBit(flags.PlayHoverAnim);
|
||||
data->WriteBit(flags.MovementUpdate);
|
||||
data->WriteBit(flags.MovementTransport);
|
||||
data->WriteBit(flags.Stationary);
|
||||
data->WriteBit(flags.CombatVictim);
|
||||
data->WriteBit(flags.ServerTime);
|
||||
data->WriteBit(flags.Vehicle);
|
||||
data->WriteBit(flags.AnimKit);
|
||||
data->WriteBit(flags.Rotation);
|
||||
data->WriteBit(flags.AreaTrigger);
|
||||
data->WriteBit(flags.GameObject);
|
||||
data->WriteBit(flags.SmoothPhasing);
|
||||
data->WriteBit(flags.ThisIsYou);
|
||||
data->WriteBit(flags.SceneObject);
|
||||
data->WriteBit(flags.ActivePlayer);
|
||||
data->WriteBit(flags.Conversation);
|
||||
data->FlushBits();
|
||||
|
||||
if (HasMovementUpdate)
|
||||
if (flags.MovementUpdate)
|
||||
{
|
||||
Unit const* unit = ToUnit();
|
||||
bool HasFallDirection = unit->HasUnitMovementFlag(MOVEMENTFLAG_FALLING);
|
||||
@@ -458,6 +448,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
// *data << uint32(TransportID);
|
||||
// *data << float(Magnitude);
|
||||
// data->WriteBits(Type, 2);
|
||||
// data->FlushBits();
|
||||
//}
|
||||
|
||||
if (HasSpline)
|
||||
@@ -466,7 +457,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
|
||||
*data << uint32(PauseTimesCount);
|
||||
|
||||
if (Stationary)
|
||||
if (flags.Stationary)
|
||||
{
|
||||
WorldObject const* self = static_cast<WorldObject const*>(this);
|
||||
*data << float(self->GetStationaryX());
|
||||
@@ -475,10 +466,10 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << float(self->GetStationaryO());
|
||||
}
|
||||
|
||||
if (CombatVictim)
|
||||
if (flags.CombatVictim)
|
||||
*data << ToUnit()->GetVictim()->GetGUID(); // CombatVictim
|
||||
|
||||
if (ServerTime)
|
||||
if (flags.ServerTime)
|
||||
{
|
||||
GameObject const* go = ToGameObject();
|
||||
/** @TODO Use IsTransport() to also handle type 11 (TRANSPORT)
|
||||
@@ -492,14 +483,14 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << uint32(getMSTime());
|
||||
}
|
||||
|
||||
if (VehicleCreate)
|
||||
if (flags.Vehicle)
|
||||
{
|
||||
Unit const* unit = ToUnit();
|
||||
*data << uint32(unit->GetVehicleKit()->GetVehicleInfo()->ID); // RecID
|
||||
*data << float(unit->GetOrientation()); // InitialRawFacing
|
||||
}
|
||||
|
||||
if (AnimKitCreate)
|
||||
if (flags.AnimKit)
|
||||
{
|
||||
WorldObject const* self = static_cast<WorldObject const*>(this);
|
||||
*data << uint16(self->GetAIAnimKitId()); // AiID
|
||||
@@ -507,19 +498,19 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << uint16(self->GetMeleeAnimKitId()); // MeleeID
|
||||
}
|
||||
|
||||
if (Rotation)
|
||||
if (flags.Rotation)
|
||||
*data << uint64(ToGameObject()->GetPackedWorldRotation()); // Rotation
|
||||
|
||||
if (PauseTimesCount)
|
||||
data->append(PauseTimes->data(), PauseTimes->size());
|
||||
|
||||
if (HasMovementTransport)
|
||||
if (flags.MovementTransport)
|
||||
{
|
||||
WorldObject const* self = static_cast<WorldObject const*>(this);
|
||||
*data << self->m_movementInfo.transport;
|
||||
}
|
||||
|
||||
if (HasAreaTrigger)
|
||||
if (flags.AreaTrigger)
|
||||
{
|
||||
AreaTrigger const* areaTrigger = ToAreaTrigger();
|
||||
AreaTriggerMiscTemplate const* areaTriggerMiscTemplate = areaTrigger->GetMiscTemplate();
|
||||
@@ -540,9 +531,10 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
bool hasMorphCurveID = areaTriggerMiscTemplate->MorphCurveId != 0;
|
||||
bool hasFacingCurveID = areaTriggerMiscTemplate->FacingCurveId != 0;
|
||||
bool hasMoveCurveID = areaTriggerMiscTemplate->MoveCurveId != 0;
|
||||
bool hasUnk2 = areaTriggerTemplate->HasFlag(AREATRIGGER_FLAG_UNK2);
|
||||
bool hasAnimation = areaTriggerTemplate->HasFlag(AREATRIGGER_FLAG_HAS_ANIM_ID);
|
||||
bool hasUnk3 = areaTriggerTemplate->HasFlag(AREATRIGGER_FLAG_UNK3);
|
||||
bool hasUnk4 = areaTriggerTemplate->HasFlag(AREATRIGGER_FLAG_UNK4);
|
||||
bool hasAnimKitID = areaTriggerTemplate->HasFlag(AREATRIGGER_FLAG_HAS_ANIM_KIT_ID);
|
||||
bool hasAnimProgress = false;
|
||||
bool hasAreaTriggerSphere = areaTriggerTemplate->IsSphere();
|
||||
bool hasAreaTriggerBox = areaTriggerTemplate->IsBox();
|
||||
bool hasAreaTriggerPolygon = areaTriggerTemplate->IsPolygon();
|
||||
@@ -561,9 +553,10 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
data->WriteBit(hasMorphCurveID);
|
||||
data->WriteBit(hasFacingCurveID);
|
||||
data->WriteBit(hasMoveCurveID);
|
||||
data->WriteBit(hasUnk2);
|
||||
data->WriteBit(hasAnimation);
|
||||
data->WriteBit(hasAnimKitID);
|
||||
data->WriteBit(hasUnk3);
|
||||
data->WriteBit(hasUnk4);
|
||||
data->WriteBit(hasAnimProgress);
|
||||
data->WriteBit(hasAreaTriggerSphere);
|
||||
data->WriteBit(hasAreaTriggerBox);
|
||||
data->WriteBit(hasAreaTriggerPolygon);
|
||||
@@ -599,10 +592,13 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
if (hasMoveCurveID)
|
||||
*data << uint32(areaTriggerMiscTemplate->MoveCurveId);
|
||||
|
||||
if (hasUnk2)
|
||||
*data << int32(0);
|
||||
if (hasAnimation)
|
||||
*data << int32(areaTriggerMiscTemplate->AnimId);
|
||||
|
||||
if (hasUnk4)
|
||||
if (hasAnimKitID)
|
||||
*data << int32(areaTriggerMiscTemplate->AnimKitId);
|
||||
|
||||
if (hasAnimProgress)
|
||||
*data << uint32(0);
|
||||
|
||||
if (hasAreaTriggerSphere)
|
||||
@@ -649,7 +645,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << *areaTrigger->GetCircularMovementInfo();
|
||||
}
|
||||
|
||||
if (HasGameObject)
|
||||
if (flags.GameObject)
|
||||
{
|
||||
bool bit8 = false;
|
||||
uint32 Int1 = 0;
|
||||
@@ -664,7 +660,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << uint32(Int1);
|
||||
}
|
||||
|
||||
//if (SmoothPhasing)
|
||||
//if (flags.SmoothPhasing)
|
||||
//{
|
||||
// data->WriteBit(ReplaceActive);
|
||||
// data->WriteBit(HasReplaceObject);
|
||||
@@ -673,7 +669,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
// *data << ObjectGuid(ReplaceObject);
|
||||
//}
|
||||
|
||||
//if (SceneObjCreate)
|
||||
//if (flags.SceneObject)
|
||||
//{
|
||||
// data->WriteBit(HasLocalScriptData);
|
||||
// data->WriteBit(HasPetBattleFullUpdate);
|
||||
@@ -783,7 +779,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
// }
|
||||
//}
|
||||
|
||||
if (PlayerCreateData)
|
||||
if (flags.ActivePlayer)
|
||||
{
|
||||
bool HasSceneInstanceIDs = false;
|
||||
bool HasRuneState = ToUnit()->GetPowerIndex(POWER_RUNES) != MAX_POWERS;
|
||||
@@ -810,6 +806,15 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << uint8((baseCd - float(player->GetRuneCooldown(i))) / baseCd * 255);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags.Conversation)
|
||||
{
|
||||
Conversation const* self = ToConversation();
|
||||
if (data->WriteBit(self->GetTextureKitId() != 0))
|
||||
*data << uint32(self->GetTextureKitId());
|
||||
|
||||
data->FlushBits();
|
||||
}
|
||||
}
|
||||
|
||||
void Object::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) const
|
||||
@@ -843,7 +848,11 @@ void Object::BuildDynamicValuesUpdate(uint8 updateType, ByteBuffer* data, Player
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
std::size_t blockCount = UpdateMask::GetBlockCount(_dynamicValuesCount);
|
||||
std::size_t valueCount = _dynamicValuesCount;
|
||||
if (target != this && GetTypeId() == TYPEID_PLAYER)
|
||||
valueCount = PLAYER_DYNAMIC_END;
|
||||
|
||||
std::size_t blockCount = UpdateMask::GetBlockCount(valueCount);
|
||||
|
||||
uint32* flags = nullptr;
|
||||
uint32 visibleFlag = GetDynamicUpdateFieldData(target, flags);
|
||||
@@ -852,7 +861,7 @@ void Object::BuildDynamicValuesUpdate(uint8 updateType, ByteBuffer* data, Player
|
||||
std::size_t maskPos = data->wpos();
|
||||
data->resize(data->size() + blockCount * sizeof(UpdateMask::BlockType));
|
||||
|
||||
for (uint16 index = 0; index < _dynamicValuesCount; ++index)
|
||||
for (uint16 index = 0; index < valueCount; ++index)
|
||||
{
|
||||
std::vector<uint32> const& values = _dynamicValues[index];
|
||||
if (_fieldNotifyFlags & flags[index] ||
|
||||
@@ -928,7 +937,17 @@ uint32 Object::GetUpdateFieldData(Player const* target, uint32*& flags) const
|
||||
{
|
||||
case TYPEID_ITEM:
|
||||
case TYPEID_CONTAINER:
|
||||
flags = ItemUpdateFieldFlags;
|
||||
flags = ContainerUpdateFieldFlags;
|
||||
if (((Item const*)this)->GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER;
|
||||
break;
|
||||
case TYPEID_AZERITE_EMPOWERED_ITEM:
|
||||
flags = AzeriteEmpoweredItemUpdateFieldFlags;
|
||||
if (((Item const*)this)->GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER;
|
||||
break;
|
||||
case TYPEID_AZERITE_ITEM:
|
||||
flags = AzeriteItemUpdateFieldFlags;
|
||||
if (((Item const*)this)->GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER;
|
||||
break;
|
||||
@@ -973,6 +992,7 @@ uint32 Object::GetUpdateFieldData(Player const* target, uint32*& flags) const
|
||||
flags = ConversationUpdateFieldFlags;
|
||||
break;
|
||||
case TYPEID_OBJECT:
|
||||
case TYPEID_ACTIVE_PLAYER:
|
||||
ABORT();
|
||||
break;
|
||||
}
|
||||
@@ -991,6 +1011,8 @@ uint32 Object::GetDynamicUpdateFieldData(Player const* target, uint32*& flags) c
|
||||
{
|
||||
case TYPEID_ITEM:
|
||||
case TYPEID_CONTAINER:
|
||||
case TYPEID_AZERITE_EMPOWERED_ITEM:
|
||||
case TYPEID_AZERITE_ITEM:
|
||||
flags = ItemDynamicUpdateFieldFlags;
|
||||
if (((Item const*)this)->GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER;
|
||||
@@ -2983,7 +3005,7 @@ struct WorldObjectChangeAccumulator
|
||||
{
|
||||
//Caster may be NULL if DynObj is in removelist
|
||||
if (Player* caster = ObjectAccessor::FindPlayer(guid))
|
||||
if (caster->GetGuidValue(PLAYER_FARSIGHT) == source->GetGUID())
|
||||
if (caster->GetGuidValue(ACTIVE_PLAYER_FIELD_FARSIGHT) == source->GetGUID())
|
||||
BuildPacket(caster);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,33 @@ struct QuaternionData;
|
||||
|
||||
typedef std::unordered_map<Player*, UpdateData> UpdateDataMapType;
|
||||
|
||||
struct CreateObjectBits
|
||||
{
|
||||
bool NoBirthAnim : 1;
|
||||
bool EnablePortals : 1;
|
||||
bool PlayHoverAnim : 1;
|
||||
bool MovementUpdate : 1;
|
||||
bool MovementTransport : 1;
|
||||
bool Stationary : 1;
|
||||
bool CombatVictim : 1;
|
||||
bool ServerTime : 1;
|
||||
bool Vehicle : 1;
|
||||
bool AnimKit : 1;
|
||||
bool Rotation : 1;
|
||||
bool AreaTrigger : 1;
|
||||
bool GameObject : 1;
|
||||
bool SmoothPhasing : 1;
|
||||
bool ThisIsYou : 1;
|
||||
bool SceneObject : 1;
|
||||
bool ActivePlayer : 1;
|
||||
bool Conversation : 1;
|
||||
|
||||
void Clear()
|
||||
{
|
||||
memset(this, 0, sizeof(CreateObjectBits));
|
||||
}
|
||||
};
|
||||
|
||||
namespace UpdateMask
|
||||
{
|
||||
typedef uint32 BlockType;
|
||||
@@ -299,14 +326,14 @@ class TC_GAME_API Object
|
||||
uint32 GetUpdateFieldData(Player const* target, uint32*& flags) const;
|
||||
uint32 GetDynamicUpdateFieldData(Player const* target, uint32*& flags) const;
|
||||
|
||||
void BuildMovementUpdate(ByteBuffer* data, uint32 flags) const;
|
||||
void BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags) const;
|
||||
virtual void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const;
|
||||
virtual void BuildDynamicValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const;
|
||||
|
||||
uint16 m_objectType;
|
||||
|
||||
TypeID m_objectTypeId;
|
||||
uint32 m_updateFlag;
|
||||
CreateObjectBits m_updateFlag;
|
||||
|
||||
union
|
||||
{
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace
|
||||
SET_GUID_NAME(CommerceObj);
|
||||
SET_GUID_NAME(ClientSession);
|
||||
SET_GUID_NAME(Cast);
|
||||
SET_GUID_NAME(ClientConnection);
|
||||
|
||||
#undef SET_GUID_NAME
|
||||
}
|
||||
|
||||
@@ -30,35 +30,41 @@
|
||||
|
||||
enum TypeID
|
||||
{
|
||||
TYPEID_OBJECT = 0,
|
||||
TYPEID_ITEM = 1,
|
||||
TYPEID_CONTAINER = 2,
|
||||
TYPEID_UNIT = 3,
|
||||
TYPEID_PLAYER = 4,
|
||||
TYPEID_GAMEOBJECT = 5,
|
||||
TYPEID_DYNAMICOBJECT = 6,
|
||||
TYPEID_CORPSE = 7,
|
||||
TYPEID_AREATRIGGER = 8,
|
||||
TYPEID_SCENEOBJECT = 9,
|
||||
TYPEID_CONVERSATION = 10
|
||||
TYPEID_OBJECT = 0,
|
||||
TYPEID_ITEM = 1,
|
||||
TYPEID_CONTAINER = 2,
|
||||
TYPEID_AZERITE_EMPOWERED_ITEM = 3,
|
||||
TYPEID_AZERITE_ITEM = 4,
|
||||
TYPEID_UNIT = 5,
|
||||
TYPEID_PLAYER = 6,
|
||||
TYPEID_ACTIVE_PLAYER = 7,
|
||||
TYPEID_GAMEOBJECT = 8,
|
||||
TYPEID_DYNAMICOBJECT = 9,
|
||||
TYPEID_CORPSE = 10,
|
||||
TYPEID_AREATRIGGER = 11,
|
||||
TYPEID_SCENEOBJECT = 12,
|
||||
TYPEID_CONVERSATION = 13
|
||||
};
|
||||
|
||||
#define NUM_CLIENT_OBJECT_TYPES 11
|
||||
#define NUM_CLIENT_OBJECT_TYPES 14
|
||||
|
||||
enum TypeMask
|
||||
{
|
||||
TYPEMASK_OBJECT = 0x0001,
|
||||
TYPEMASK_ITEM = 0x0002,
|
||||
TYPEMASK_CONTAINER = 0x0004,
|
||||
TYPEMASK_UNIT = 0x0008,
|
||||
TYPEMASK_PLAYER = 0x0010,
|
||||
TYPEMASK_GAMEOBJECT = 0x0020,
|
||||
TYPEMASK_DYNAMICOBJECT = 0x0040,
|
||||
TYPEMASK_CORPSE = 0x0080,
|
||||
TYPEMASK_AREATRIGGER = 0x0100,
|
||||
TYPEMASK_SCENEOBJECT = 0x0200,
|
||||
TYPEMASK_CONVERSATION = 0x0400,
|
||||
TYPEMASK_SEER = TYPEMASK_PLAYER | TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT
|
||||
TYPEMASK_OBJECT = 0x0001,
|
||||
TYPEMASK_ITEM = 0x0002,
|
||||
TYPEMASK_CONTAINER = 0x0004,
|
||||
TYPEMASK_AZERITE_EMPOWERED_ITEM = 0x0008,
|
||||
TYPEMASK_AZERITE_ITEM = 0x0010,
|
||||
TYPEMASK_UNIT = 0x0020,
|
||||
TYPEMASK_PLAYER = 0x0040,
|
||||
TYPEMASK_ACTIVE_PLAYER = 0x0080,
|
||||
TYPEMASK_GAMEOBJECT = 0x0100,
|
||||
TYPEMASK_DYNAMICOBJECT = 0x0200,
|
||||
TYPEMASK_CORPSE = 0x0400,
|
||||
TYPEMASK_AREATRIGGER = 0x0800,
|
||||
TYPEMASK_SCENEOBJECT = 0x1000,
|
||||
TYPEMASK_CONVERSATION = 0x2000,
|
||||
TYPEMASK_SEER = TYPEMASK_PLAYER | TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT
|
||||
};
|
||||
|
||||
enum class HighGuid
|
||||
@@ -111,6 +117,7 @@ enum class HighGuid
|
||||
CommerceObj = 45,
|
||||
ClientSession = 46,
|
||||
Cast = 47,
|
||||
ClientConnection = 48,
|
||||
|
||||
Count,
|
||||
};
|
||||
@@ -349,6 +356,7 @@ class TC_GAME_API ObjectGuidGeneratorBase
|
||||
{
|
||||
public:
|
||||
ObjectGuidGeneratorBase(ObjectGuid::LowType start = UI64LIT(1)) : _nextGuid(start) { }
|
||||
virtual ~ObjectGuidGeneratorBase() { }
|
||||
|
||||
virtual void Set(uint64 val) { _nextGuid = val; }
|
||||
virtual ObjectGuid::LowType Generate() = 0;
|
||||
|
||||
@@ -34,29 +34,6 @@ enum OBJECT_UPDATE_TYPE
|
||||
UPDATETYPE_OUT_OF_RANGE_OBJECTS = 3,
|
||||
};
|
||||
|
||||
enum OBJECT_UPDATE_FLAGS
|
||||
{
|
||||
UPDATEFLAG_NONE = 0x0000,
|
||||
UPDATEFLAG_SELF = 0x0001,
|
||||
UPDATEFLAG_TRANSPORT = 0x0002,
|
||||
UPDATEFLAG_HAS_TARGET = 0x0004,
|
||||
UPDATEFLAG_LIVING = 0x0008,
|
||||
UPDATEFLAG_STATIONARY_POSITION = 0x0010,
|
||||
UPDATEFLAG_VEHICLE = 0x0020,
|
||||
UPDATEFLAG_TRANSPORT_POSITION = 0x0040,
|
||||
UPDATEFLAG_ROTATION = 0x0080,
|
||||
UPDATEFLAG_ANIMKITS = 0x0100,
|
||||
UPDATEFLAG_AREATRIGGER = 0x0200,
|
||||
UPDATEFLAG_GAMEOBJECT = 0x0400,
|
||||
//UPDATEFLAG_REPLACE_ACTIVE = 0x0800,
|
||||
//UPDATEFLAG_NO_BIRTH_ANIM = 0x1000,
|
||||
//UPDATEFLAG_ENABLE_PORTALS = 0x2000,
|
||||
//UPDATEFLAG_PLAY_HOVER_ANIM = 0x4000,
|
||||
//UPDATEFLAG_IS_SUPPRESSING_GREETINGS = 0x8000
|
||||
//UPDATEFLAG_SCENEOBJECT = 0x10000,
|
||||
//UPDATEFLAG_SCENE_PENDING_INSTANCE = 0x20000
|
||||
};
|
||||
|
||||
class UpdateData
|
||||
{
|
||||
public:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,10 +37,12 @@ enum UpdatefieldFlags
|
||||
UF_FLAG_URGENT_SELF_ONLY = 0x400
|
||||
};
|
||||
|
||||
TC_GAME_API extern uint32 ItemUpdateFieldFlags[CONTAINER_END];
|
||||
TC_GAME_API extern uint32 ContainerUpdateFieldFlags[CONTAINER_END];
|
||||
TC_GAME_API extern uint32 AzeriteEmpoweredItemUpdateFieldFlags[AZERITE_EMPOWERED_ITEM_END];
|
||||
TC_GAME_API extern uint32 AzeriteItemUpdateFieldFlags[AZERITE_ITEM_END];
|
||||
TC_GAME_API extern uint32 ItemDynamicUpdateFieldFlags[CONTAINER_DYNAMIC_END];
|
||||
TC_GAME_API extern uint32 UnitUpdateFieldFlags[PLAYER_END];
|
||||
TC_GAME_API extern uint32 UnitDynamicUpdateFieldFlags[PLAYER_DYNAMIC_END];
|
||||
TC_GAME_API extern uint32 UnitUpdateFieldFlags[ACTIVE_PLAYER_END];
|
||||
TC_GAME_API extern uint32 UnitDynamicUpdateFieldFlags[ACTIVE_PLAYER_DYNAMIC_END];
|
||||
TC_GAME_API extern uint32 GameObjectUpdateFieldFlags[GAMEOBJECT_END];
|
||||
TC_GAME_API extern uint32 GameObjectDynamicUpdateFieldFlags[GAMEOBJECT_DYNAMIC_END];
|
||||
TC_GAME_API extern uint32 DynamicObjectUpdateFieldFlags[DYNAMICOBJECT_END];
|
||||
|
||||
@@ -19,17 +19,15 @@
|
||||
#ifndef _UPDATEFIELDS_H
|
||||
#define _UPDATEFIELDS_H
|
||||
|
||||
// Auto generated for version 7, 3, 5, 25928
|
||||
// Auto generated for version 8, 0, 1, 27980
|
||||
|
||||
enum ObjectFields
|
||||
{
|
||||
OBJECT_FIELD_GUID = 0x000, // Size: 4, Flags: PUBLIC
|
||||
OBJECT_FIELD_DATA = 0x004, // Size: 4, Flags: PUBLIC
|
||||
OBJECT_FIELD_TYPE = 0x008, // Size: 1, Flags: PUBLIC
|
||||
OBJECT_FIELD_ENTRY = 0x009, // Size: 1, Flags: DYNAMIC
|
||||
OBJECT_DYNAMIC_FLAGS = 0x00A, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
OBJECT_FIELD_SCALE_X = 0x00B, // Size: 1, Flags: PUBLIC
|
||||
OBJECT_END = 0x00C,
|
||||
OBJECT_FIELD_ENTRY = 0x004, // Size: 1, Flags: DYNAMIC
|
||||
OBJECT_DYNAMIC_FLAGS = 0x005, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
OBJECT_FIELD_SCALE_X = 0x006, // Size: 1, Flags: PUBLIC
|
||||
OBJECT_END = 0x007,
|
||||
};
|
||||
|
||||
enum ObjectDynamicFields
|
||||
@@ -66,8 +64,7 @@ enum ItemDynamicFields
|
||||
ITEM_DYNAMIC_FIELD_BONUSLIST_IDS = OBJECT_DYNAMIC_END + 0x001, // Flags: OWNER, 0x100
|
||||
ITEM_DYNAMIC_FIELD_ARTIFACT_POWERS = OBJECT_DYNAMIC_END + 0x002, // Flags: OWNER
|
||||
ITEM_DYNAMIC_FIELD_GEMS = OBJECT_DYNAMIC_END + 0x003, // Flags: OWNER
|
||||
ITEM_DYNAMIC_FIELD_RELIC_TALENT_DATA = OBJECT_DYNAMIC_END + 0x004, // Flags: OWNER
|
||||
ITEM_DYNAMIC_END = OBJECT_DYNAMIC_END + 0x005,
|
||||
ITEM_DYNAMIC_END = OBJECT_DYNAMIC_END + 0x004,
|
||||
};
|
||||
|
||||
enum ContainerFields
|
||||
@@ -82,6 +79,32 @@ enum ContainerDynamicFields
|
||||
CONTAINER_DYNAMIC_END = ITEM_DYNAMIC_END + 0x000,
|
||||
};
|
||||
|
||||
enum AzeriteEmpoweredItemField
|
||||
{
|
||||
AZERITE_EMPOWERED_ITEM_FIELD_SELECTIONS = ITEM_END + 0x000, // Size: 4, Flags: PUBLIC
|
||||
AZERITE_EMPOWERED_ITEM_END = ITEM_END + 0x004,
|
||||
};
|
||||
|
||||
enum AzeriteEmpoweredItemDynamicField
|
||||
{
|
||||
AZERITE_EMPOWERED_ITEM_DYNAMIC_END = ITEM_DYNAMIC_END + 0x000,
|
||||
};
|
||||
|
||||
enum AzeriteItemField
|
||||
{
|
||||
AZERITE_ITEM_FIELD_XP = ITEM_END + 0x000, // Size: 2, Flags: PUBLIC
|
||||
AZERITE_ITEM_FIELD_LEVEL = ITEM_END + 0x002, // Size: 1, Flags: PUBLIC
|
||||
AZERITE_ITEM_FIELD_AURA_LEVEL = ITEM_END + 0x003, // Size: 1, Flags: PUBLIC
|
||||
AZERITE_ITEM_FIELD_KNOWLEDGE_LEVEL = ITEM_END + 0x004, // Size: 1, Flags: OWNER
|
||||
AZERITE_ITEM_FIELD_DEBUG_KNOWLEDGE_WEEK = ITEM_END + 0x005, // Size: 1, Flags: OWNER
|
||||
AZERITE_ITEM_END = ITEM_END + 0x006,
|
||||
};
|
||||
|
||||
enum AzeriteItemDynamicField
|
||||
{
|
||||
AZERITE_ITEM_DYNAMIC_END = ITEM_DYNAMIC_END + 0x000,
|
||||
};
|
||||
|
||||
enum UnitFields
|
||||
{
|
||||
UNIT_FIELD_CHARM = OBJECT_END + 0x000, // Size: 4, Flags: PUBLIC
|
||||
@@ -91,98 +114,106 @@ enum UnitFields
|
||||
UNIT_FIELD_SUMMONEDBY = OBJECT_END + 0x010, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_CREATEDBY = OBJECT_END + 0x014, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_DEMON_CREATOR = OBJECT_END + 0x018, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_TARGET = OBJECT_END + 0x01C, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLE_PET_COMPANION_GUID = OBJECT_END + 0x020, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLE_PET_DB_ID = OBJECT_END + 0x024, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_CHANNEL_DATA = OBJECT_END + 0x026, // Size: 2, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_SUMMONED_BY_HOME_REALM = OBJECT_END + 0x028, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BYTES_0 = OBJECT_END + 0x029, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_DISPLAY_POWER = OBJECT_END + 0x02A, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_OVERRIDE_DISPLAY_POWER_ID = OBJECT_END + 0x02B, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_HEALTH = OBJECT_END + 0x02C, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_POWER = OBJECT_END + 0x02E, // Size: 6, Flags: PUBLIC, URGENT_SELF_ONLY
|
||||
UNIT_FIELD_MAXHEALTH = OBJECT_END + 0x034, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_MAXPOWER = OBJECT_END + 0x036, // Size: 6, Flags: PUBLIC
|
||||
UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER = OBJECT_END + 0x03C, // Size: 6, Flags: PRIVATE, OWNER, UNIT_ALL
|
||||
UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER = OBJECT_END + 0x042, // Size: 6, Flags: PRIVATE, OWNER, UNIT_ALL
|
||||
UNIT_FIELD_LEVEL = OBJECT_END + 0x048, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_EFFECTIVE_LEVEL = OBJECT_END + 0x049, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SANDBOX_SCALING_ID = OBJECT_END + 0x04A, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_MIN = OBJECT_END + 0x04B, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_MAX = OBJECT_END + 0x04C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_DELTA = OBJECT_END + 0x04D, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x04E, // Size: 1, Flags: PUBLIC
|
||||
UNIT_VIRTUAL_ITEM_SLOT_ID = OBJECT_END + 0x04F, // Size: 6, Flags: PUBLIC
|
||||
UNIT_FIELD_FLAGS = OBJECT_END + 0x055, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_FLAGS_2 = OBJECT_END + 0x056, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_FLAGS_3 = OBJECT_END + 0x057, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_AURASTATE = OBJECT_END + 0x058, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BASEATTACKTIME = OBJECT_END + 0x059, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_RANGEDATTACKTIME = OBJECT_END + 0x05B, // Size: 1, Flags: PRIVATE
|
||||
UNIT_FIELD_BOUNDINGRADIUS = OBJECT_END + 0x05C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_COMBATREACH = OBJECT_END + 0x05D, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_DISPLAYID = OBJECT_END + 0x05E, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_NATIVEDISPLAYID = OBJECT_END + 0x05F, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_MOUNTDISPLAYID = OBJECT_END + 0x060, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_MINDAMAGE = OBJECT_END + 0x061, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MAXDAMAGE = OBJECT_END + 0x062, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MINOFFHANDDAMAGE = OBJECT_END + 0x063, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MAXOFFHANDDAMAGE = OBJECT_END + 0x064, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_BYTES_1 = OBJECT_END + 0x065, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PETNUMBER = OBJECT_END + 0x066, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PET_NAME_TIMESTAMP = OBJECT_END + 0x067, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PETEXPERIENCE = OBJECT_END + 0x068, // Size: 1, Flags: OWNER
|
||||
UNIT_FIELD_PETNEXTLEVELEXP = OBJECT_END + 0x069, // Size: 1, Flags: OWNER
|
||||
UNIT_MOD_CAST_SPEED = OBJECT_END + 0x06A, // Size: 1, Flags: PUBLIC
|
||||
UNIT_MOD_CAST_HASTE = OBJECT_END + 0x06B, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_HASTE = OBJECT_END + 0x06C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_RANGED_HASTE = OBJECT_END + 0x06D, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_HASTE_REGEN = OBJECT_END + 0x06E, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_TIME_RATE = OBJECT_END + 0x06F, // Size: 1, Flags: PUBLIC
|
||||
UNIT_CREATED_BY_SPELL = OBJECT_END + 0x070, // Size: 1, Flags: PUBLIC
|
||||
UNIT_NPC_FLAGS = OBJECT_END + 0x071, // Size: 2, Flags: PUBLIC, DYNAMIC
|
||||
UNIT_NPC_EMOTESTATE = OBJECT_END + 0x073, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_STAT = OBJECT_END + 0x074, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POSSTAT = OBJECT_END + 0x078, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_NEGSTAT = OBJECT_END + 0x07C, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RESISTANCES = OBJECT_END + 0x080, // Size: 7, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE = OBJECT_END + 0x087, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE = OBJECT_END + 0x08E, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MOD_BONUS_ARMOR = OBJECT_END + 0x095, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_BASE_MANA = OBJECT_END + 0x096, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BASE_HEALTH = OBJECT_END + 0x097, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_BYTES_2 = OBJECT_END + 0x098, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_ATTACK_POWER = OBJECT_END + 0x099, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MOD_POS = OBJECT_END + 0x09A, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x09B, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x09C, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER = OBJECT_END + 0x09D, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MOD_POS = OBJECT_END + 0x09E, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x09F, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0A0, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_SPEED_AURA = OBJECT_END + 0x0A1, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MINRANGEDDAMAGE = OBJECT_END + 0x0A2, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MAXRANGEDDAMAGE = OBJECT_END + 0x0A3, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POWER_COST_MODIFIER = OBJECT_END + 0x0A4, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POWER_COST_MULTIPLIER = OBJECT_END + 0x0AB, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MAXHEALTHMODIFIER = OBJECT_END + 0x0B2, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_HOVERHEIGHT = OBJECT_END + 0x0B3, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MIN_ITEM_LEVEL_CUTOFF = OBJECT_END + 0x0B4, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MIN_ITEM_LEVEL = OBJECT_END + 0x0B5, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MAXITEMLEVEL = OBJECT_END + 0x0B6, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_WILD_BATTLEPET_LEVEL = OBJECT_END + 0x0B7, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLEPET_COMPANION_NAME_TIMESTAMP = OBJECT_END + 0x0B8, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_INTERACT_SPELLID = OBJECT_END + 0x0B9, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_STATE_SPELL_VISUAL_ID = OBJECT_END + 0x0BA, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_ANIM_ID = OBJECT_END + 0x0BB, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_ANIM_KIT_ID = OBJECT_END + 0x0BC, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_WORLD_EFFECT_ID = OBJECT_END + 0x0BD, // Size: 4, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_SCALE_DURATION = OBJECT_END + 0x0C1, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOKS_LIKE_MOUNT_ID = OBJECT_END + 0x0C2, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOKS_LIKE_CREATURE_ID = OBJECT_END + 0x0C3, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOK_AT_CONTROLLER_ID = OBJECT_END + 0x0C4, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOK_AT_CONTROLLER_TARGET = OBJECT_END + 0x0C5, // Size: 4, Flags: PUBLIC
|
||||
UNIT_END = OBJECT_END + 0x0C9,
|
||||
UNIT_FIELD_LOOK_AT_CONTROLLER_TARGET = OBJECT_END + 0x01C, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_TARGET = OBJECT_END + 0x020, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLE_PET_COMPANION_GUID = OBJECT_END + 0x024, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLE_PET_DB_ID = OBJECT_END + 0x028, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_CHANNEL_DATA = OBJECT_END + 0x02A, // Size: 2, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_SUMMONED_BY_HOME_REALM = OBJECT_END + 0x02C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BYTES_0 = OBJECT_END + 0x02D, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_DISPLAY_POWER = OBJECT_END + 0x02E, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_OVERRIDE_DISPLAY_POWER_ID = OBJECT_END + 0x02F, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_HEALTH = OBJECT_END + 0x030, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_POWER = OBJECT_END + 0x032, // Size: 6, Flags: PUBLIC, URGENT_SELF_ONLY
|
||||
UNIT_FIELD_MAXHEALTH = OBJECT_END + 0x038, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_MAXPOWER = OBJECT_END + 0x03A, // Size: 6, Flags: PUBLIC
|
||||
UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER = OBJECT_END + 0x040, // Size: 6, Flags: PRIVATE, OWNER, UNIT_ALL
|
||||
UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER = OBJECT_END + 0x046, // Size: 6, Flags: PRIVATE, OWNER, UNIT_ALL
|
||||
UNIT_FIELD_LEVEL = OBJECT_END + 0x04C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_EFFECTIVE_LEVEL = OBJECT_END + 0x04D, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_CONTENT_TUNING_ID = OBJECT_END + 0x04E, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_MIN = OBJECT_END + 0x04F, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_MAX = OBJECT_END + 0x050, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_DELTA = OBJECT_END + 0x051, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_FACTION_GROUP = OBJECT_END + 0x052, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_HEALTH_ITEM_LEVEL_CURVE_ID = OBJECT_END + 0x053, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_DAMAGE_ITEM_LEVEL_CURVE_ID = OBJECT_END + 0x054, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x055, // Size: 1, Flags: PUBLIC
|
||||
UNIT_VIRTUAL_ITEM_SLOT_ID = OBJECT_END + 0x056, // Size: 6, Flags: PUBLIC
|
||||
UNIT_FIELD_FLAGS = OBJECT_END + 0x05C, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_FLAGS_2 = OBJECT_END + 0x05D, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_FLAGS_3 = OBJECT_END + 0x05E, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_AURASTATE = OBJECT_END + 0x05F, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BASEATTACKTIME = OBJECT_END + 0x060, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_RANGEDATTACKTIME = OBJECT_END + 0x062, // Size: 1, Flags: PRIVATE
|
||||
UNIT_FIELD_BOUNDINGRADIUS = OBJECT_END + 0x063, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_COMBATREACH = OBJECT_END + 0x064, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_DISPLAYID = OBJECT_END + 0x065, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_DISPLAY_SCALE = OBJECT_END + 0x066, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_NATIVEDISPLAYID = OBJECT_END + 0x067, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_NATIVE_X_DISPLAY_SCALE = OBJECT_END + 0x068, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_MOUNTDISPLAYID = OBJECT_END + 0x069, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_MINDAMAGE = OBJECT_END + 0x06A, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MAXDAMAGE = OBJECT_END + 0x06B, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MINOFFHANDDAMAGE = OBJECT_END + 0x06C, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MAXOFFHANDDAMAGE = OBJECT_END + 0x06D, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_BYTES_1 = OBJECT_END + 0x06E, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PETNUMBER = OBJECT_END + 0x06F, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PET_NAME_TIMESTAMP = OBJECT_END + 0x070, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PETEXPERIENCE = OBJECT_END + 0x071, // Size: 1, Flags: OWNER
|
||||
UNIT_FIELD_PETNEXTLEVELEXP = OBJECT_END + 0x072, // Size: 1, Flags: OWNER
|
||||
UNIT_MOD_CAST_SPEED = OBJECT_END + 0x073, // Size: 1, Flags: PUBLIC
|
||||
UNIT_MOD_CAST_HASTE = OBJECT_END + 0x074, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_HASTE = OBJECT_END + 0x075, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_RANGED_HASTE = OBJECT_END + 0x076, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_HASTE_REGEN = OBJECT_END + 0x077, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_TIME_RATE = OBJECT_END + 0x078, // Size: 1, Flags: PUBLIC
|
||||
UNIT_CREATED_BY_SPELL = OBJECT_END + 0x079, // Size: 1, Flags: PUBLIC
|
||||
UNIT_NPC_FLAGS = OBJECT_END + 0x07A, // Size: 2, Flags: PUBLIC, DYNAMIC
|
||||
UNIT_NPC_EMOTESTATE = OBJECT_END + 0x07C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_STAT = OBJECT_END + 0x07D, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POSSTAT = OBJECT_END + 0x081, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_NEGSTAT = OBJECT_END + 0x085, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RESISTANCES = OBJECT_END + 0x089, // Size: 7, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_BONUS_RESISTANCE_MODS = OBJECT_END + 0x090, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_BASE_MANA = OBJECT_END + 0x097, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BASE_HEALTH = OBJECT_END + 0x098, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_BYTES_2 = OBJECT_END + 0x099, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_ATTACK_POWER = OBJECT_END + 0x09A, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MOD_POS = OBJECT_END + 0x09B, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x09C, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x09D, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER = OBJECT_END + 0x09E, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MOD_POS = OBJECT_END + 0x09F, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x0A0, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0A1, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MAIN_HAND_WEAPON_ATTACK_POWER = OBJECT_END + 0x0A2, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_OFF_HAND_WEAPON_ATTACK_POWER = OBJECT_END + 0x0A3, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_HAND_WEAPON_ATTACK_POWER = OBJECT_END + 0x0A4, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_SPEED_AURA = OBJECT_END + 0x0A5, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_LIFESTEAL = OBJECT_END + 0x0A6, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MINRANGEDDAMAGE = OBJECT_END + 0x0A7, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MAXRANGEDDAMAGE = OBJECT_END + 0x0A8, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POWER_COST_MODIFIER = OBJECT_END + 0x0A9, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POWER_COST_MULTIPLIER = OBJECT_END + 0x0B0, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MAXHEALTHMODIFIER = OBJECT_END + 0x0B7, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_HOVERHEIGHT = OBJECT_END + 0x0B8, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MIN_ITEM_LEVEL_CUTOFF = OBJECT_END + 0x0B9, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MIN_ITEM_LEVEL = OBJECT_END + 0x0BA, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MAXITEMLEVEL = OBJECT_END + 0x0BB, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_WILD_BATTLEPET_LEVEL = OBJECT_END + 0x0BC, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLEPET_COMPANION_NAME_TIMESTAMP = OBJECT_END + 0x0BD, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_INTERACT_SPELLID = OBJECT_END + 0x0BE, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_STATE_SPELL_VISUAL_ID = OBJECT_END + 0x0BF, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_ANIM_ID = OBJECT_END + 0x0C0, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_ANIM_KIT_ID = OBJECT_END + 0x0C1, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_WORLD_EFFECT_ID = OBJECT_END + 0x0C2, // Size: 4, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_SCALE_DURATION = OBJECT_END + 0x0C6, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOKS_LIKE_MOUNT_ID = OBJECT_END + 0x0C7, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOKS_LIKE_CREATURE_ID = OBJECT_END + 0x0C8, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOK_AT_CONTROLLER_ID = OBJECT_END + 0x0C9, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_GUILD_GUID = OBJECT_END + 0x0CA, // Size: 4, Flags: PUBLIC
|
||||
UNIT_END = OBJECT_END + 0x0CE,
|
||||
};
|
||||
|
||||
enum UnitDynamicFields
|
||||
@@ -209,141 +240,152 @@ enum PlayerFields
|
||||
PLAYER_BYTES_4 = UNIT_END + 0x014, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_DUEL_TEAM = UNIT_END + 0x015, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_GUILD_TIMESTAMP = UNIT_END + 0x016, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_QUEST_LOG = UNIT_END + 0x017, // Size: 800, Flags: PARTY_MEMBER
|
||||
PLAYER_VISIBLE_ITEM = UNIT_END + 0x337, // Size: 38, Flags: PUBLIC
|
||||
PLAYER_CHOSEN_TITLE = UNIT_END + 0x35D, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FAKE_INEBRIATION = UNIT_END + 0x35E, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_VIRTUAL_PLAYER_REALM = UNIT_END + 0x35F, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_CURRENT_SPEC_ID = UNIT_END + 0x360, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_TAXI_MOUNT_ANIM_KIT_ID = UNIT_END + 0x361, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_AVG_ITEM_LEVEL = UNIT_END + 0x362, // Size: 4, Flags: PUBLIC
|
||||
PLAYER_FIELD_CURRENT_BATTLE_PET_BREED_QUALITY = UNIT_END + 0x366, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_PRESTIGE = UNIT_END + 0x367, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_HONOR_LEVEL = UNIT_END + 0x368, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_INV_SLOT_HEAD = UNIT_END + 0x369, // Size: 780, Flags: PRIVATE
|
||||
PLAYER_FIELD_END_NOT_SELF = UNIT_END + 0x369,
|
||||
PLAYER_FARSIGHT = UNIT_END + 0x675, // Size: 4, Flags: PRIVATE
|
||||
PLAYER_FIELD_SUMMONED_BATTLE_PET_ID = UNIT_END + 0x679, // Size: 4, Flags: PRIVATE
|
||||
PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x67D, // Size: 12, Flags: PRIVATE
|
||||
PLAYER_FIELD_COINAGE = UNIT_END + 0x689, // Size: 2, Flags: PRIVATE
|
||||
PLAYER_XP = UNIT_END + 0x68B, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_NEXT_LEVEL_XP = UNIT_END + 0x68C, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_TRIAL_XP = UNIT_END + 0x68D, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_SKILL_LINEID = UNIT_END + 0x68E, // Size: 448, Flags: PRIVATE
|
||||
PLAYER_CHARACTER_POINTS = UNIT_END + 0x84E, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MAX_TALENT_TIERS = UNIT_END + 0x84F, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_TRACK_CREATURES = UNIT_END + 0x850, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_TRACK_RESOURCES = UNIT_END + 0x851, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_EXPERTISE = UNIT_END + 0x852, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_OFFHAND_EXPERTISE = UNIT_END + 0x853, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_RANGED_EXPERTISE = UNIT_END + 0x854, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_COMBAT_RATING_EXPERTISE = UNIT_END + 0x855, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_BLOCK_PERCENTAGE = UNIT_END + 0x856, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_DODGE_PERCENTAGE = UNIT_END + 0x857, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_DODGE_PERCENTAGE_FROM_ATTRIBUTE = UNIT_END + 0x858, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_PARRY_PERCENTAGE = UNIT_END + 0x859, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_PARRY_PERCENTAGE_FROM_ATTRIBUTE = UNIT_END + 0x85A, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_CRIT_PERCENTAGE = UNIT_END + 0x85B, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_RANGED_CRIT_PERCENTAGE = UNIT_END + 0x85C, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_OFFHAND_CRIT_PERCENTAGE = UNIT_END + 0x85D, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_SPELL_CRIT_PERCENTAGE1 = UNIT_END + 0x85E, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_SHIELD_BLOCK = UNIT_END + 0x85F, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_SHIELD_BLOCK_CRIT_PERCENTAGE = UNIT_END + 0x860, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_MASTERY = UNIT_END + 0x861, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_SPEED = UNIT_END + 0x862, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_LIFESTEAL = UNIT_END + 0x863, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_AVOIDANCE = UNIT_END + 0x864, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_STURDINESS = UNIT_END + 0x865, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_VERSATILITY = UNIT_END + 0x866, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_VERSATILITY_BONUS = UNIT_END + 0x867, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_PVP_POWER_DAMAGE = UNIT_END + 0x868, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_PVP_POWER_HEALING = UNIT_END + 0x869, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_EXPLORED_ZONES_1 = UNIT_END + 0x86A, // Size: 320, Flags: PRIVATE
|
||||
PLAYER_FIELD_REST_INFO = UNIT_END + 0x9AA, // Size: 4, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_DAMAGE_DONE_POS = UNIT_END + 0x9AE, // Size: 7, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = UNIT_END + 0x9B5, // Size: 7, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = UNIT_END + 0x9BC, // Size: 7, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_HEALING_DONE_POS = UNIT_END + 0x9C3, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_HEALING_PCT = UNIT_END + 0x9C4, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_HEALING_DONE_PCT = UNIT_END + 0x9C5, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_PERIODIC_HEALING_DONE_PERCENT = UNIT_END + 0x9C6, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_WEAPON_DMG_MULTIPLIERS = UNIT_END + 0x9C7, // Size: 3, Flags: PRIVATE
|
||||
PLAYER_FIELD_WEAPON_ATK_SPEED_MULTIPLIERS = UNIT_END + 0x9CA, // Size: 3, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_SPELL_POWER_PCT = UNIT_END + 0x9CD, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_RESILIENCE_PERCENT = UNIT_END + 0x9CE, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT = UNIT_END + 0x9CF, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_OVERRIDE_AP_BY_SPELL_POWER_PERCENT = UNIT_END + 0x9D0, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_TARGET_RESISTANCE = UNIT_END + 0x9D1, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = UNIT_END + 0x9D2, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_LOCAL_FLAGS = UNIT_END + 0x9D3, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_BYTES = UNIT_END + 0x9D4, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_PVP_MEDALS = UNIT_END + 0x9D5, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_BUYBACK_PRICE_1 = UNIT_END + 0x9D6, // Size: 12, Flags: PRIVATE
|
||||
PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = UNIT_END + 0x9E2, // Size: 12, Flags: PRIVATE
|
||||
PLAYER_FIELD_KILLS = UNIT_END + 0x9EE, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_LIFETIME_HONORABLE_KILLS = UNIT_END + 0x9EF, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_WATCHED_FACTION_INDEX = UNIT_END + 0x9F0, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_COMBAT_RATING_1 = UNIT_END + 0x9F1, // Size: 32, Flags: PRIVATE
|
||||
PLAYER_FIELD_ARENA_TEAM_INFO_1_1 = UNIT_END + 0xA11, // Size: 42, Flags: PRIVATE
|
||||
PLAYER_FIELD_MAX_LEVEL = UNIT_END + 0xA3B, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_SCALING_PLAYER_LEVEL_DELTA = UNIT_END + 0xA3C, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MAX_CREATURE_SCALING_LEVEL = UNIT_END + 0xA3D, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_NO_REAGENT_COST_1 = UNIT_END + 0xA3E, // Size: 4, Flags: PRIVATE
|
||||
PLAYER_PET_SPELL_POWER = UNIT_END + 0xA42, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_RESEARCHING_1 = UNIT_END + 0xA43, // Size: 10, Flags: PRIVATE
|
||||
PLAYER_PROFESSION_SKILL_LINE_1 = UNIT_END + 0xA4D, // Size: 2, Flags: PRIVATE
|
||||
PLAYER_FIELD_UI_HIT_MODIFIER = UNIT_END + 0xA4F, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_UI_SPELL_HIT_MODIFIER = UNIT_END + 0xA50, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_HOME_REALM_TIME_OFFSET = UNIT_END + 0xA51, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_PET_HASTE = UNIT_END + 0xA52, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_BYTES2 = UNIT_END + 0xA53, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_BYTES3 = UNIT_END + 0xA54, // Size: 1, Flags: PRIVATE, URGENT_SELF_ONLY
|
||||
PLAYER_FIELD_LFG_BONUS_FACTION_ID = UNIT_END + 0xA55, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_LOOT_SPEC_ID = UNIT_END + 0xA56, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_OVERRIDE_ZONE_PVP_TYPE = UNIT_END + 0xA57, // Size: 1, Flags: PRIVATE, URGENT_SELF_ONLY
|
||||
PLAYER_FIELD_BAG_SLOT_FLAGS = UNIT_END + 0xA58, // Size: 4, Flags: PRIVATE
|
||||
PLAYER_FIELD_BANK_BAG_SLOT_FLAGS = UNIT_END + 0xA5C, // Size: 7, Flags: PRIVATE
|
||||
PLAYER_FIELD_INSERT_ITEMS_LEFT_TO_RIGHT = UNIT_END + 0xA63, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_QUEST_COMPLETED = UNIT_END + 0xA64, // Size: 1750, Flags: PRIVATE
|
||||
PLAYER_FIELD_HONOR = UNIT_END + 0x113A, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_HONOR_NEXT_LEVEL = UNIT_END + 0x113B, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_END = UNIT_END + 0x113C,
|
||||
PLAYER_QUEST_LOG = UNIT_END + 0x017, // Size: 1600, Flags: PARTY_MEMBER
|
||||
PLAYER_VISIBLE_ITEM = UNIT_END + 0x657, // Size: 38, Flags: PUBLIC
|
||||
PLAYER_CHOSEN_TITLE = UNIT_END + 0x67D, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FAKE_INEBRIATION = UNIT_END + 0x67E, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_VIRTUAL_PLAYER_REALM = UNIT_END + 0x67F, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_CURRENT_SPEC_ID = UNIT_END + 0x680, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_TAXI_MOUNT_ANIM_KIT_ID = UNIT_END + 0x681, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_AVG_ITEM_LEVEL = UNIT_END + 0x682, // Size: 4, Flags: PUBLIC
|
||||
PLAYER_FIELD_CURRENT_BATTLE_PET_BREED_QUALITY = UNIT_END + 0x686, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_HONOR_LEVEL = UNIT_END + 0x687, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_END = UNIT_END + 0x688,
|
||||
};
|
||||
|
||||
enum PlayerDynamicFields
|
||||
{
|
||||
PLAYER_DYNAMIC_FIELD_RESERACH_SITE = UNIT_DYNAMIC_END + 0x000, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_RESEARCH_SITE_PROGRESS = UNIT_DYNAMIC_END + 0x001, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_DAILY_QUESTS = UNIT_DYNAMIC_END + 0x002, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_AVAILABLE_QUEST_LINE_X_QUEST_ID = UNIT_DYNAMIC_END + 0x003, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_HEIRLOOMS = UNIT_DYNAMIC_END + 0x004, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS = UNIT_DYNAMIC_END + 0x005, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_TOYS = UNIT_DYNAMIC_END + 0x006, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_TRANSMOG = UNIT_DYNAMIC_END + 0x007, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG = UNIT_DYNAMIC_END + 0x008, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_SELF_RES_SPELLS = UNIT_DYNAMIC_END + 0x009, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_CHARACTER_RESTRICTIONS = UNIT_DYNAMIC_END + 0x00A, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_SPELL_PCT_MOD_BY_LABEL = UNIT_DYNAMIC_END + 0x00B, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_SPELL_FLAT_MOD_BY_LABEL = UNIT_DYNAMIC_END + 0x00C, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_ARENA_COOLDOWNS = UNIT_DYNAMIC_END + 0x00D, // Flags: PUBLIC
|
||||
PLAYER_DYNAMIC_END = UNIT_DYNAMIC_END + 0x00E,
|
||||
PLAYER_DYNAMIC_FIELD_ARENA_COOLDOWNS = UNIT_DYNAMIC_END + 0x000, // Flags: PUBLIC
|
||||
PLAYER_DYNAMIC_END = UNIT_DYNAMIC_END + 0x001,
|
||||
};
|
||||
|
||||
enum ActivePlayerField
|
||||
{
|
||||
ACTIVE_PLAYER_FIELD_INV_SLOT_HEAD = PLAYER_END + 0x000, // Size: 780, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_FARSIGHT = PLAYER_END + 0x30C, // Size: 4, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SUMMONED_BATTLE_PET_ID = PLAYER_END + 0x310, // Size: 4, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_KNOWN_TITLES = PLAYER_END + 0x314, // Size: 12, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_COINAGE = PLAYER_END + 0x320, // Size: 2, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_XP = PLAYER_END + 0x322, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_NEXT_LEVEL_XP = PLAYER_END + 0x323, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_TRIAL_XP = PLAYER_END + 0x324, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SKILL_LINEID = PLAYER_END + 0x325, // Size: 896, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_CHARACTER_POINTS = PLAYER_END + 0x6A5, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MAX_TALENT_TIERS = PLAYER_END + 0x6A6, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_TRACK_CREATURES = PLAYER_END + 0x6A7, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_TRACK_RESOURCES = PLAYER_END + 0x6A8, // Size: 2, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_EXPERTISE = PLAYER_END + 0x6AA, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_OFFHAND_EXPERTISE = PLAYER_END + 0x6AB, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_RANGED_EXPERTISE = PLAYER_END + 0x6AC, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_COMBAT_RATING_EXPERTISE = PLAYER_END + 0x6AD, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BLOCK_PERCENTAGE = PLAYER_END + 0x6AE, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_DODGE_PERCENTAGE = PLAYER_END + 0x6AF, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_DODGE_PERCENTAGE_FROM_ATTRIBUTE = PLAYER_END + 0x6B0, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PARRY_PERCENTAGE = PLAYER_END + 0x6B1, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PARRY_PERCENTAGE_FROM_ATTRIBUTE = PLAYER_END + 0x6B2, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_CRIT_PERCENTAGE = PLAYER_END + 0x6B3, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_RANGED_CRIT_PERCENTAGE = PLAYER_END + 0x6B4, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_OFFHAND_CRIT_PERCENTAGE = PLAYER_END + 0x6B5, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SPELL_CRIT_PERCENTAGE1 = PLAYER_END + 0x6B6, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SHIELD_BLOCK = PLAYER_END + 0x6B7, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SHIELD_BLOCK_CRIT_PERCENTAGE = PLAYER_END + 0x6B8, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MASTERY = PLAYER_END + 0x6B9, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SPEED = PLAYER_END + 0x6BA, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_AVOIDANCE = PLAYER_END + 0x6BB, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_STURDINESS = PLAYER_END + 0x6BC, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_VERSATILITY = PLAYER_END + 0x6BD, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_VERSATILITY_BONUS = PLAYER_END + 0x6BE, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PVP_POWER_DAMAGE = PLAYER_END + 0x6BF, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PVP_POWER_HEALING = PLAYER_END + 0x6C0, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_EXPLORED_ZONES = PLAYER_END + 0x6C1, // Size: 320, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_REST_INFO = PLAYER_END + 0x801, // Size: 4, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS = PLAYER_END + 0x805, // Size: 7, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = PLAYER_END + 0x80C, // Size: 7, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = PLAYER_END + 0x813, // Size: 7, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_POS = PLAYER_END + 0x81A, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_HEALING_PCT = PLAYER_END + 0x81B, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_PCT = PLAYER_END + 0x81C, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_PERIODIC_HEALING_DONE_PERCENT = PLAYER_END + 0x81D, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_WEAPON_DMG_MULTIPLIERS = PLAYER_END + 0x81E, // Size: 3, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_WEAPON_ATK_SPEED_MULTIPLIERS = PLAYER_END + 0x821, // Size: 3, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_SPELL_POWER_PCT = PLAYER_END + 0x824, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_RESILIENCE_PERCENT = PLAYER_END + 0x825, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT = PLAYER_END + 0x826, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_OVERRIDE_AP_BY_SPELL_POWER_PERCENT = PLAYER_END + 0x827, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_TARGET_RESISTANCE = PLAYER_END + 0x828, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = PLAYER_END + 0x829, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_LOCAL_FLAGS = PLAYER_END + 0x82A, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BYTES = PLAYER_END + 0x82B, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PVP_MEDALS = PLAYER_END + 0x82C, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BUYBACK_PRICE = PLAYER_END + 0x82D, // Size: 12, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BUYBACK_TIMESTAMP = PLAYER_END + 0x839, // Size: 12, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_KILLS = PLAYER_END + 0x845, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_LIFETIME_HONORABLE_KILLS = PLAYER_END + 0x846, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_WATCHED_FACTION_INDEX = PLAYER_END + 0x847, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_COMBAT_RATING = PLAYER_END + 0x848, // Size: 32, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_ARENA_TEAM_INFO = PLAYER_END + 0x868, // Size: 54, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MAX_LEVEL = PLAYER_END + 0x89E, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SCALING_PLAYER_LEVEL_DELTA = PLAYER_END + 0x89F, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MAX_CREATURE_SCALING_LEVEL = PLAYER_END + 0x8A0, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_NO_REAGENT_COST = PLAYER_END + 0x8A1, // Size: 4, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PET_SPELL_POWER = PLAYER_END + 0x8A5, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PROFESSION_SKILL_LINE = PLAYER_END + 0x8A6, // Size: 2, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_UI_HIT_MODIFIER = PLAYER_END + 0x8A8, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_UI_SPELL_HIT_MODIFIER = PLAYER_END + 0x8A9, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_HOME_REALM_TIME_OFFSET = PLAYER_END + 0x8AA, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_PET_HASTE = PLAYER_END + 0x8AB, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BYTES2 = PLAYER_END + 0x8AC, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BYTES3 = PLAYER_END + 0x8AD, // Size: 1, Flags: PUBLIC, URGENT_SELF_ONLY
|
||||
ACTIVE_PLAYER_FIELD_LFG_BONUS_FACTION_ID = PLAYER_END + 0x8AE, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_LOOT_SPEC_ID = PLAYER_END + 0x8AF, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_OVERRIDE_ZONE_PVP_TYPE = PLAYER_END + 0x8B0, // Size: 1, Flags: PUBLIC, URGENT_SELF_ONLY
|
||||
ACTIVE_PLAYER_FIELD_BAG_SLOT_FLAGS = PLAYER_END + 0x8B1, // Size: 4, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BANK_BAG_SLOT_FLAGS = PLAYER_END + 0x8B5, // Size: 7, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_INSERT_ITEMS_LEFT_TO_RIGHT = PLAYER_END + 0x8BC, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_QUEST_COMPLETED = PLAYER_END + 0x8BD, // Size: 1750, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_HONOR = PLAYER_END + 0xF93, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_HONOR_NEXT_LEVEL = PLAYER_END + 0xF94, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PVP_TIER_MAX_FROM_WINS = PLAYER_END + 0xF95, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PVP_LAST_WEEKS_TIER_MAX_FROM_WINS = PLAYER_END + 0xF96, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_END = PLAYER_END + 0xF97,
|
||||
};
|
||||
|
||||
enum ActivePlayerDynamicField
|
||||
{
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_RESERACH_SITE = PLAYER_DYNAMIC_END + 0x000, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_RESEARCH_SITE_PROGRESS = PLAYER_DYNAMIC_END + 0x001, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_DAILY_QUESTS = PLAYER_DYNAMIC_END + 0x002, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_AVAILABLE_QUEST_LINE_X_QUEST_ID = PLAYER_DYNAMIC_END + 0x003, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS = PLAYER_DYNAMIC_END + 0x005, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS = PLAYER_DYNAMIC_END + 0x006, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_TOYS = PLAYER_DYNAMIC_END + 0x007, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_TRANSMOG = PLAYER_DYNAMIC_END + 0x008, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG = PLAYER_DYNAMIC_END + 0x009, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_SELF_RES_SPELLS = PLAYER_DYNAMIC_END + 0x00A, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_CHARACTER_RESTRICTIONS = PLAYER_DYNAMIC_END + 0x00B, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_SPELL_PCT_MOD_BY_LABEL = PLAYER_DYNAMIC_END + 0x00C, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_SPELL_FLAT_MOD_BY_LABEL = PLAYER_DYNAMIC_END + 0x00D, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_RESERACH = PLAYER_DYNAMIC_END + 0x00E, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_END = PLAYER_DYNAMIC_END + 0x00F,
|
||||
};
|
||||
|
||||
enum GameObjectFields
|
||||
{
|
||||
GAMEOBJECT_FIELD_CREATED_BY = OBJECT_END + 0x000, // Size: 4, Flags: PUBLIC
|
||||
GAMEOBJECT_DISPLAYID = OBJECT_END + 0x004, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_FLAGS = OBJECT_END + 0x005, // Size: 1, Flags: PUBLIC, URGENT
|
||||
GAMEOBJECT_PARENTROTATION = OBJECT_END + 0x006, // Size: 4, Flags: PUBLIC
|
||||
GAMEOBJECT_FACTION = OBJECT_END + 0x00A, // Size: 1, Flags: PUBLIC
|
||||
GAMEOBJECT_LEVEL = OBJECT_END + 0x00B, // Size: 1, Flags: PUBLIC
|
||||
GAMEOBJECT_BYTES_1 = OBJECT_END + 0x00C, // Size: 1, Flags: PUBLIC, URGENT
|
||||
GAMEOBJECT_SPELL_VISUAL_ID = OBJECT_END + 0x00D, // Size: 1, Flags: PUBLIC, DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_SPELL_VISUAL_ID = OBJECT_END + 0x00E, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_ANIM_ID = OBJECT_END + 0x00F, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_ANIM_KIT_ID = OBJECT_END + 0x010, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_WORLD_EFFECT_ID = OBJECT_END + 0x011, // Size: 4, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_END = OBJECT_END + 0x015,
|
||||
GAMEOBJECT_FIELD_GUILD_GUID = OBJECT_END + 0x004, // Size: 4, Flags: PUBLIC
|
||||
GAMEOBJECT_DISPLAYID = OBJECT_END + 0x008, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_FLAGS = OBJECT_END + 0x009, // Size: 1, Flags: PUBLIC, URGENT
|
||||
GAMEOBJECT_PARENTROTATION = OBJECT_END + 0x00A, // Size: 4, Flags: PUBLIC
|
||||
GAMEOBJECT_FACTION = OBJECT_END + 0x00E, // Size: 1, Flags: PUBLIC
|
||||
GAMEOBJECT_LEVEL = OBJECT_END + 0x00F, // Size: 1, Flags: PUBLIC
|
||||
GAMEOBJECT_BYTES_1 = OBJECT_END + 0x010, // Size: 1, Flags: PUBLIC, URGENT
|
||||
GAMEOBJECT_SPELL_VISUAL_ID = OBJECT_END + 0x011, // Size: 1, Flags: PUBLIC, DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_SPELL_VISUAL_ID = OBJECT_END + 0x012, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_ANIM_ID = OBJECT_END + 0x013, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_ANIM_KIT_ID = OBJECT_END + 0x014, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_WORLD_EFFECT_ID = OBJECT_END + 0x015, // Size: 4, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_FIELD_CUSTOM_PARAM = OBJECT_END + 0x019, // Size: 1, Flags: PUBLIC, URGENT
|
||||
GAMEOBJECT_END = OBJECT_END + 0x01A,
|
||||
};
|
||||
|
||||
enum GameObjectDynamicFields
|
||||
@@ -372,15 +414,16 @@ enum CorpseFields
|
||||
{
|
||||
CORPSE_FIELD_OWNER = OBJECT_END + 0x000, // Size: 4, Flags: PUBLIC
|
||||
CORPSE_FIELD_PARTY = OBJECT_END + 0x004, // Size: 4, Flags: PUBLIC
|
||||
CORPSE_FIELD_DISPLAY_ID = OBJECT_END + 0x008, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_ITEM = OBJECT_END + 0x009, // Size: 19, Flags: PUBLIC
|
||||
CORPSE_FIELD_BYTES_1 = OBJECT_END + 0x01C, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_BYTES_2 = OBJECT_END + 0x01D, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_FLAGS = OBJECT_END + 0x01E, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_DYNAMIC_FLAGS = OBJECT_END + 0x01F, // Size: 1, Flags: DYNAMIC
|
||||
CORPSE_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x020, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_CUSTOM_DISPLAY_OPTION = OBJECT_END + 0x021, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_END = OBJECT_END + 0x022,
|
||||
CORPSE_FIELD_GUILD_GUID = OBJECT_END + 0x008, // Size: 4, Flags: PUBLIC
|
||||
CORPSE_FIELD_DISPLAY_ID = OBJECT_END + 0x00C, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_ITEM = OBJECT_END + 0x00D, // Size: 19, Flags: PUBLIC
|
||||
CORPSE_FIELD_BYTES_1 = OBJECT_END + 0x020, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_BYTES_2 = OBJECT_END + 0x021, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_FLAGS = OBJECT_END + 0x022, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_DYNAMIC_FLAGS = OBJECT_END + 0x023, // Size: 1, Flags: DYNAMIC
|
||||
CORPSE_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x024, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_CUSTOM_DISPLAY_OPTION = OBJECT_END + 0x025, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_END = OBJECT_END + 0x026,
|
||||
};
|
||||
|
||||
enum CorpseDynamicFields
|
||||
|
||||
@@ -891,7 +891,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
SetPowerType(POWER_ENERGY);
|
||||
else if (IsPetImp() || IsPetFelhunter() || IsPetVoidwalker() || IsPetSuccubus() || IsPetDoomguard() || IsPetFelguard()) // Warlock pets have energy (since 5.x)
|
||||
SetPowerType(POWER_ENERGY);
|
||||
else
|
||||
else
|
||||
SetPowerType(POWER_MANA);
|
||||
|
||||
// Damage
|
||||
@@ -901,8 +901,8 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
case SUMMON_PET:
|
||||
{
|
||||
// the damage bonus used for pets is either fire or shadow damage, whatever is higher
|
||||
int32 fire = GetOwner()->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE);
|
||||
int32 shadow = GetOwner()->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW);
|
||||
int32 fire = GetOwner()->GetUInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE);
|
||||
int32 shadow = GetOwner()->GetUInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW);
|
||||
int32 val = (fire > shadow) ? fire : shadow;
|
||||
if (val < 0)
|
||||
val = 0;
|
||||
@@ -1780,9 +1780,9 @@ Player* Pet::GetOwner() const
|
||||
return Minion::GetOwner()->ToPlayer();
|
||||
}
|
||||
|
||||
void Pet::SetDisplayId(uint32 modelId)
|
||||
void Pet::SetDisplayId(uint32 modelId, float displayScale /*= 1.f*/)
|
||||
{
|
||||
Guardian::SetDisplayId(modelId);
|
||||
Guardian::SetDisplayId(modelId, displayScale);
|
||||
|
||||
if (!isControlled())
|
||||
return;
|
||||
|
||||
@@ -52,7 +52,7 @@ class TC_GAME_API Pet : public Guardian
|
||||
void AddToWorld() override;
|
||||
void RemoveFromWorld() override;
|
||||
|
||||
void SetDisplayId(uint32 modelId) override;
|
||||
void SetDisplayId(uint32 modelId, float displayScale = 1.f) override;
|
||||
|
||||
PetType getPetType() const { return m_petType; }
|
||||
void setPetType(PetType type) { m_petType = type; }
|
||||
|
||||
@@ -81,14 +81,14 @@ CollectionMgr::~CollectionMgr()
|
||||
void CollectionMgr::LoadToys()
|
||||
{
|
||||
for (auto const& t : _toys)
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_TOYS, t.first);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TOYS, t.first);
|
||||
}
|
||||
|
||||
bool CollectionMgr::AddToy(uint32 itemId, bool isFavourite /*= false*/)
|
||||
{
|
||||
if (UpdateAccountToys(itemId, isFavourite))
|
||||
{
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_TOYS, itemId);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TOYS, itemId);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -204,8 +204,8 @@ void CollectionMgr::LoadHeirlooms()
|
||||
{
|
||||
for (auto const& item : _heirlooms)
|
||||
{
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOMS, item.first);
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, item.second.flags);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS, item.first);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, item.second.flags);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,8 +213,8 @@ void CollectionMgr::AddHeirloom(uint32 itemId, uint32 flags)
|
||||
{
|
||||
if (UpdateAccountHeirlooms(itemId, flags))
|
||||
{
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOMS, itemId);
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, flags);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS, itemId);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, flags);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,10 +255,10 @@ void CollectionMgr::UpgradeHeirloom(uint32 itemId, int32 castItem)
|
||||
item->AddBonuses(bonusId);
|
||||
|
||||
// Get heirloom offset to update only one part of dynamic field
|
||||
std::vector<uint32> const& fields = player->GetDynamicValues(PLAYER_DYNAMIC_FIELD_HEIRLOOMS);
|
||||
std::vector<uint32> const& fields = player->GetDynamicValues(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS);
|
||||
uint16 offset = uint16(std::find(fields.begin(), fields.end(), itemId) - fields.begin());
|
||||
|
||||
player->SetDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, offset, flags);
|
||||
player->SetDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, offset, flags);
|
||||
itr->second.flags = flags;
|
||||
itr->second.bonusId = bonusId;
|
||||
}
|
||||
@@ -295,11 +295,11 @@ void CollectionMgr::CheckHeirloomUpgrades(Item* item)
|
||||
|
||||
if (newItemId)
|
||||
{
|
||||
std::vector<uint32> const& fields = player->GetDynamicValues(PLAYER_DYNAMIC_FIELD_HEIRLOOMS);
|
||||
std::vector<uint32> const& fields = player->GetDynamicValues(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS);
|
||||
uint16 offset = uint16(std::find(fields.begin(), fields.end(), itr->first) - fields.begin());
|
||||
|
||||
player->SetDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOMS, offset, newItemId);
|
||||
player->SetDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, offset, 0);
|
||||
player->SetDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS, offset, newItemId);
|
||||
player->SetDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, offset, 0);
|
||||
|
||||
_heirlooms.erase(itr);
|
||||
_heirlooms[newItemId] = 0;
|
||||
@@ -460,11 +460,11 @@ void CollectionMgr::LoadItemAppearances()
|
||||
{
|
||||
boost::to_block_range(*_appearances, DynamicBitsetBlockOutputIterator([this](uint32 blockValue)
|
||||
{
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_TRANSMOG, blockValue);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TRANSMOG, blockValue);
|
||||
}));
|
||||
|
||||
for (auto itr = _temporaryAppearances.begin(); itr != _temporaryAppearances.end(); ++itr)
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itr->first);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itr->first);
|
||||
}
|
||||
|
||||
void CollectionMgr::LoadAccountItemAppearances(PreparedQueryResult knownAppearances, PreparedQueryResult favoriteAppearances)
|
||||
@@ -738,18 +738,18 @@ void CollectionMgr::AddItemAppearance(ItemModifiedAppearanceEntry const* itemMod
|
||||
_appearances->resize(itemModifiedAppearance->ID + 1);
|
||||
numBlocks = _appearances->num_blocks() - numBlocks;
|
||||
while (numBlocks--)
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_TRANSMOG, 0);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TRANSMOG, 0);
|
||||
}
|
||||
|
||||
_appearances->set(itemModifiedAppearance->ID);
|
||||
uint32 blockIndex = itemModifiedAppearance->ID / 32;
|
||||
uint32 bitIndex = itemModifiedAppearance->ID % 32;
|
||||
uint32 currentMask = _owner->GetPlayer()->GetDynamicValue(PLAYER_DYNAMIC_FIELD_TRANSMOG, blockIndex);
|
||||
_owner->GetPlayer()->SetDynamicValue(PLAYER_DYNAMIC_FIELD_TRANSMOG, blockIndex, currentMask | (1 << bitIndex));
|
||||
uint32 currentMask = _owner->GetPlayer()->GetDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TRANSMOG, blockIndex);
|
||||
_owner->GetPlayer()->SetDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TRANSMOG, blockIndex, currentMask | (1 << bitIndex));
|
||||
auto temporaryAppearance = _temporaryAppearances.find(itemModifiedAppearance->ID);
|
||||
if (temporaryAppearance != _temporaryAppearances.end())
|
||||
{
|
||||
_owner->GetPlayer()->RemoveDynamicValue(PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
_owner->GetPlayer()->RemoveDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
_temporaryAppearances.erase(temporaryAppearance);
|
||||
}
|
||||
|
||||
@@ -770,7 +770,7 @@ void CollectionMgr::AddTemporaryAppearance(ObjectGuid const& itemGuid, ItemModif
|
||||
{
|
||||
std::unordered_set<ObjectGuid>& itemsWithAppearance = _temporaryAppearances[itemModifiedAppearance->ID];
|
||||
if (itemsWithAppearance.empty())
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
|
||||
itemsWithAppearance.insert(itemGuid);
|
||||
}
|
||||
@@ -788,7 +788,7 @@ void CollectionMgr::RemoveTemporaryAppearance(Item* item)
|
||||
itr->second.erase(item->GetGUID());
|
||||
if (itr->second.empty())
|
||||
{
|
||||
_owner->GetPlayer()->RemoveDynamicValue(PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
_owner->GetPlayer()->RemoveDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
_temporaryAppearances.erase(itr);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -101,16 +101,23 @@ namespace WorldPackets
|
||||
|
||||
typedef std::deque<Mail*> PlayerMails;
|
||||
|
||||
#define PLAYER_MAX_SKILLS 128
|
||||
enum SkillFieldOffset
|
||||
#define PLAYER_MAX_SKILLS 256
|
||||
|
||||
template<typename SkillArrayType>
|
||||
constexpr std::size_t CalculateSkillFieldArraySize()
|
||||
{
|
||||
SKILL_ID_OFFSET = 0,
|
||||
SKILL_STEP_OFFSET = 64,
|
||||
SKILL_RANK_OFFSET = SKILL_STEP_OFFSET + 64,
|
||||
SUBSKILL_START_RANK_OFFSET = SKILL_RANK_OFFSET + 64,
|
||||
SKILL_MAX_RANK_OFFSET = SUBSKILL_START_RANK_OFFSET + 64,
|
||||
SKILL_TEMP_BONUS_OFFSET = SKILL_MAX_RANK_OFFSET + 64,
|
||||
SKILL_PERM_BONUS_OFFSET = SKILL_TEMP_BONUS_OFFSET + 64
|
||||
return PLAYER_MAX_SKILLS / sizeof(uint32) * sizeof(SkillArrayType);
|
||||
}
|
||||
|
||||
enum SkillFieldOffset : uint16
|
||||
{
|
||||
SKILL_ID_OFFSET = 0,
|
||||
SKILL_STEP_OFFSET = SKILL_ID_OFFSET + CalculateSkillFieldArraySize<uint16>(),
|
||||
SKILL_RANK_OFFSET = SKILL_STEP_OFFSET + CalculateSkillFieldArraySize<uint16>(),
|
||||
SUBSKILL_START_RANK_OFFSET = SKILL_RANK_OFFSET + CalculateSkillFieldArraySize<uint16>(),
|
||||
SKILL_MAX_RANK_OFFSET = SUBSKILL_START_RANK_OFFSET + CalculateSkillFieldArraySize<uint16>(),
|
||||
SKILL_TEMP_BONUS_OFFSET = SKILL_MAX_RANK_OFFSET + CalculateSkillFieldArraySize<uint16>(),
|
||||
SKILL_PERM_BONUS_OFFSET = SKILL_TEMP_BONUS_OFFSET + CalculateSkillFieldArraySize<uint16>()
|
||||
};
|
||||
|
||||
#define PLAYER_EXPLORED_ZONES_SIZE 320
|
||||
@@ -240,6 +247,7 @@ struct PlayerCurrency
|
||||
};
|
||||
|
||||
typedef std::unordered_map<uint32, PlayerSpellState> PlayerTalentMap;
|
||||
typedef std::array<uint32, MAX_PVP_TALENT_SLOTS> PlayerPvpTalentMap;
|
||||
typedef std::unordered_map<uint32, PlayerSpell*> PlayerSpellMap;
|
||||
typedef std::unordered_set<SpellModifier*> SpellModContainer;
|
||||
typedef std::unordered_map<uint32, PlayerCurrency> PlayerCurrenciesMap;
|
||||
@@ -391,7 +399,7 @@ enum PlayerFlags
|
||||
PLAYER_FLAGS_GM = 0x00000008,
|
||||
PLAYER_FLAGS_GHOST = 0x00000010,
|
||||
PLAYER_FLAGS_RESTING = 0x00000020,
|
||||
PLAYER_FLAGS_UNK6 = 0x00000040,
|
||||
PLAYER_FLAGS_VOICE_CHAT = 0x00000040,
|
||||
PLAYER_FLAGS_UNK7 = 0x00000080, // pre-3.0.3 PLAYER_FLAGS_FFA_PVP flag for FFA PVP state
|
||||
PLAYER_FLAGS_CONTESTED_PVP = 0x00000100, // Player has been involved in a PvP combat and will be attacked by contested guards
|
||||
PLAYER_FLAGS_IN_PVP = 0x00000200,
|
||||
@@ -422,7 +430,8 @@ enum PlayerFlags
|
||||
enum PlayerFlagsEx
|
||||
{
|
||||
PLAYER_FLAGS_EX_REAGENT_BANK_UNLOCKED = 0x0001,
|
||||
PLAYER_FLAGS_EX_MERCENARY_MODE = 0x0002
|
||||
PLAYER_FLAGS_EX_MERCENARY_MODE = 0x0002,
|
||||
PLAYER_FLAGS_EX_ARTIFACT_FORGE_CHEAT = 0x0004
|
||||
};
|
||||
|
||||
enum PlayerLocalFlags
|
||||
@@ -1001,10 +1010,6 @@ enum TalentLearnResult
|
||||
TALENT_FAILED_REST_AREA = 8
|
||||
};
|
||||
|
||||
static uint32 const DefaultTalentRowLevels[MAX_TALENT_TIERS] = { 15, 30, 45, 60, 75, 90, 100 };
|
||||
static uint32 const DKTalentRowLevels[MAX_TALENT_TIERS] = { 57, 58, 59, 60, 75, 90, 100 };
|
||||
static uint32 const DHTalentRowLevels[MAX_TALENT_TIERS] = { 99, 100, 102, 104, 106, 108, 110 };
|
||||
|
||||
struct TC_GAME_API SpecializationInfo
|
||||
{
|
||||
SpecializationInfo() : ResetTalentsCost(0), ResetTalentsTime(0), PrimarySpecialization(0), ActiveGroup(0)
|
||||
@@ -1012,7 +1017,7 @@ struct TC_GAME_API SpecializationInfo
|
||||
}
|
||||
|
||||
PlayerTalentMap Talents[MAX_SPECIALIZATIONS];
|
||||
PlayerTalentMap PvpTalents[MAX_SPECIALIZATIONS];
|
||||
PlayerPvpTalentMap PvpTalents[MAX_SPECIALIZATIONS];
|
||||
std::vector<uint32> Glyphs[MAX_SPECIALIZATIONS];
|
||||
uint32 ResetTalentsCost;
|
||||
time_t ResetTalentsTime;
|
||||
@@ -1033,7 +1038,7 @@ struct PlayerDynamicFieldSpellModByLabel
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
uint8 constexpr PLAYER_MAX_HONOR_LEVEL = 50;
|
||||
uint32 constexpr PLAYER_MAX_HONOR_LEVEL = 500;
|
||||
uint8 constexpr PLAYER_LEVEL_MIN_HONOR = 110;
|
||||
uint32 constexpr SPELL_PVP_RULES_ENABLED = 134735;
|
||||
|
||||
@@ -1188,7 +1193,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
static bool IsChildEquipmentPos(uint8 bag, uint8 slot);
|
||||
bool IsValidPos(uint16 pos, bool explicit_pos) const { return IsValidPos(pos >> 8, pos & 255, explicit_pos); }
|
||||
bool IsValidPos(uint8 bag, uint8 slot, bool explicit_pos) const;
|
||||
uint8 GetInventorySlotCount() const { return GetByteValue(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_NUM_BACKPACK_SLOTS); }
|
||||
uint8 GetInventorySlotCount() const { return GetByteValue(ACTIVE_PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_NUM_BACKPACK_SLOTS); }
|
||||
void SetInventorySlotCount(uint8 slots);
|
||||
uint8 GetBankBagSlotCount() const { return GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_BANK_BAG_SLOTS); }
|
||||
void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_BANK_BAG_SLOTS, count); }
|
||||
@@ -1349,13 +1354,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
/*** QUEST SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
int32 GetQuestLevel(Quest const* quest) const
|
||||
{
|
||||
if (!quest)
|
||||
return getLevel();
|
||||
return quest->GetQuestLevel() > 0 ? quest->GetQuestLevel() : std::min<int32>(getLevel(), quest->GetQuestMaxScalingLevel());
|
||||
}
|
||||
|
||||
int32 GetQuestMinLevel(Quest const* quest) const;
|
||||
int32 GetQuestLevel(Quest const* quest) const;
|
||||
void PrepareQuestMenu(ObjectGuid guid);
|
||||
void SendPreparedQuest(WorldObject* source);
|
||||
bool IsActiveQuest(uint32 quest_id) const;
|
||||
@@ -1501,7 +1501,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
|
||||
static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE; }
|
||||
static bool IsValidClass(uint8 Class) { return ((1 << (Class - 1)) & CLASSMASK_ALL_PLAYABLE) != 0; }
|
||||
static bool IsValidRace(uint8 Race) { return ((1 << (Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0; }
|
||||
static bool IsValidRace(uint8 Race) { return ((UI64LIT(1) << (Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0; }
|
||||
static bool ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 hairID, uint8 hairColor, uint8 faceID, uint8 facialHair, uint8 skinColor, std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> const& customDisplay, bool create = false);
|
||||
|
||||
/*********************************************************/
|
||||
@@ -1530,7 +1530,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void setRegenTimerCount(uint32 time) {m_regenTimerCount = time;}
|
||||
void setWeaponChangeTimer(uint32 time) {m_weaponChangeTimer = time;}
|
||||
|
||||
uint64 GetMoney() const { return GetUInt64Value(PLAYER_FIELD_COINAGE); }
|
||||
uint64 GetMoney() const { return GetUInt64Value(ACTIVE_PLAYER_FIELD_COINAGE); }
|
||||
bool ModifyMoney(int64 amount, bool sendError = true);
|
||||
bool HasEnoughMoney(uint64 amount) const { return (GetMoney() >= amount); }
|
||||
bool HasEnoughMoney(int64 amount) const;
|
||||
@@ -1622,8 +1622,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
std::string GetGuildName() const;
|
||||
|
||||
// Loot Spec
|
||||
void SetLootSpecId(uint32 id) { SetUInt32Value(PLAYER_FIELD_LOOT_SPEC_ID, id); }
|
||||
uint32 GetLootSpecId() const { return GetUInt32Value(PLAYER_FIELD_LOOT_SPEC_ID); }
|
||||
void SetLootSpecId(uint32 id) { SetUInt32Value(ACTIVE_PLAYER_FIELD_LOOT_SPEC_ID, id); }
|
||||
uint32 GetLootSpecId() const { return GetUInt32Value(ACTIVE_PLAYER_FIELD_LOOT_SPEC_ID); }
|
||||
|
||||
// Talents
|
||||
uint32 GetTalentResetCost() const { return _specializationInfo.ResetTalentsCost; }
|
||||
@@ -1645,11 +1645,10 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
bool AddTalent(TalentEntry const* talent, uint8 spec, bool learning);
|
||||
bool HasTalent(uint32 spell_id, uint8 spec) const;
|
||||
void RemoveTalent(TalentEntry const* talent);
|
||||
uint32 CalculateTalentsTiers() const;
|
||||
void ResetTalentSpecialization();
|
||||
|
||||
TalentLearnResult LearnPvpTalent(uint32 talentID, int32* spellOnCooldown);
|
||||
bool AddPvpTalent(PvpTalentEntry const* talent, uint8 activeTalentGroup, bool learning);
|
||||
TalentLearnResult LearnPvpTalent(uint32 talentID, uint8 slot, int32* spellOnCooldown);
|
||||
bool AddPvpTalent(PvpTalentEntry const* talent, uint8 activeTalentGroup, uint8 slot);
|
||||
void RemovePvpTalent(PvpTalentEntry const* talent);
|
||||
void TogglePvpTalents(bool enable);
|
||||
bool HasPvpTalent(uint32 talentID, uint8 activeTalentGroup) const;
|
||||
@@ -1664,14 +1663,14 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
|
||||
PlayerTalentMap const* GetTalentMap(uint8 spec) const { return &_specializationInfo.Talents[spec]; }
|
||||
PlayerTalentMap* GetTalentMap(uint8 spec) { return &_specializationInfo.Talents[spec]; }
|
||||
PlayerTalentMap const* GetPvpTalentMap(uint8 spec) const { return &_specializationInfo.PvpTalents[spec]; }
|
||||
PlayerTalentMap* GetPvpTalentMap(uint8 spec) { return &_specializationInfo.PvpTalents[spec]; }
|
||||
PlayerPvpTalentMap const& GetPvpTalentMap(uint8 spec) const { return _specializationInfo.PvpTalents[spec]; }
|
||||
PlayerPvpTalentMap& GetPvpTalentMap(uint8 spec) { return _specializationInfo.PvpTalents[spec]; }
|
||||
std::vector<uint32> const& GetGlyphs(uint8 spec) const { return _specializationInfo.Glyphs[spec]; }
|
||||
std::vector<uint32>& GetGlyphs(uint8 spec) { return _specializationInfo.Glyphs[spec]; }
|
||||
ActionButtonList const& GetActionButtons() const { return m_actionButtons; }
|
||||
|
||||
uint32 GetFreePrimaryProfessionPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS); }
|
||||
void SetFreePrimaryProfessions(uint16 profs) { SetUInt32Value(PLAYER_CHARACTER_POINTS, profs); }
|
||||
uint32 GetFreePrimaryProfessionPoints() const { return GetUInt32Value(ACTIVE_PLAYER_FIELD_CHARACTER_POINTS); }
|
||||
void SetFreePrimaryProfessions(uint16 profs) { SetUInt32Value(ACTIVE_PLAYER_FIELD_CHARACTER_POINTS, profs); }
|
||||
void InitPrimaryProfessions();
|
||||
|
||||
PlayerSpellMap const& GetSpellMap() const { return m_spells; }
|
||||
@@ -1756,7 +1755,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void SetGuildLevel(uint32 level) { SetUInt32Value(PLAYER_GUILDLEVEL, level); }
|
||||
uint32 GetGuildLevel() const { return GetUInt32Value(PLAYER_GUILDLEVEL); }
|
||||
void SetGuildIdInvited(ObjectGuid::LowType GuildId) { m_GuildIdInvited = GuildId; }
|
||||
ObjectGuid::LowType GetGuildId() const { return GetUInt64Value(OBJECT_FIELD_DATA); /* return only lower part */ }
|
||||
ObjectGuid::LowType GetGuildId() const { return GetUInt64Value(UNIT_FIELD_GUILD_GUID); /* return only lower part */ }
|
||||
Guild* GetGuild();
|
||||
Guild const* GetGuild() const;
|
||||
static ObjectGuid::LowType GetGuildIdFromDB(ObjectGuid guid);
|
||||
@@ -1769,8 +1768,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value);
|
||||
static uint32 GetArenaTeamIdFromDB(ObjectGuid guid, uint8 slot);
|
||||
static void LeaveAllArenaTeams(ObjectGuid guid);
|
||||
uint32 GetArenaTeamId(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); }
|
||||
uint32 GetArenaPersonalRating(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); }
|
||||
uint32 GetArenaTeamId(uint8 slot) const { return GetUInt32Value(ACTIVE_PLAYER_FIELD_ARENA_TEAM_INFO + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); }
|
||||
uint32 GetArenaPersonalRating(uint8 slot) const { return GetUInt32Value(ACTIVE_PLAYER_FIELD_ARENA_TEAM_INFO + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); }
|
||||
void SetArenaTeamIdInvited(uint32 ArenaTeamId) { m_ArenaTeamIdInvited = ArenaTeamId; }
|
||||
uint32 GetArenaTeamIdInvited() const { return m_ArenaTeamIdInvited; }
|
||||
uint32 GetRBGPersonalRating() const { return 0; }
|
||||
@@ -1787,9 +1786,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
static Difficulty CheckLoadedLegacyRaidDifficultyID(Difficulty difficulty);
|
||||
void SendRaidGroupOnlyMessage(RaidGroupReason reason, int32 delay) const;
|
||||
|
||||
bool UpdateSkill(uint32 skill_id, uint32 step);
|
||||
bool UpdateSkillPro(uint16 skillId, int32 chance, uint32 step);
|
||||
|
||||
bool UpdateCraftSkill(uint32 spellid);
|
||||
bool UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLevel, uint32 Multiplicator = 1);
|
||||
bool UpdateFishingSkill();
|
||||
@@ -1929,6 +1926,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
uint16 GetSkillStep(uint16 skill) const; // 0...6
|
||||
bool HasSkill(uint32 skill) const;
|
||||
void LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue);
|
||||
int32 FindProfessionSlotFor(uint32 skillId) const;
|
||||
|
||||
WorldLocation& GetTeleportDest() { return m_teleport_dest; }
|
||||
bool IsBeingTeleported() const { return mSemaphoreTeleport_Near || mSemaphoreTeleport_Far; }
|
||||
@@ -1985,15 +1983,11 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void RestoreHealthAfterDuel() { SetHealth(healthBeforeDuel); }
|
||||
void RestoreManaAfterDuel() { SetPower(POWER_MANA, manaBeforeDuel); }
|
||||
|
||||
uint32 GetPrestigeLevel() const { return GetUInt32Value(PLAYER_FIELD_PRESTIGE); }
|
||||
uint32 GetHonorLevel() const { return GetUInt32Value(PLAYER_FIELD_HONOR_LEVEL); }
|
||||
void AddHonorXP(uint32 xp);
|
||||
void SetHonorLevel(uint8 honorLevel);
|
||||
void Prestige();
|
||||
bool CanPrestige() const;
|
||||
bool IsMaxPrestige() const;
|
||||
bool IsMaxHonorLevelAndPrestige() const { return IsMaxPrestige() && GetHonorLevel() == PLAYER_MAX_HONOR_LEVEL; }
|
||||
// Updates PLAYER_FIELD_HONOR_NEXT_LEVEL based on PLAYER_FIELD_HONOR_LEVEL and the smallest value of PLAYER_FIELD_PRESTIGE and (PRESTIGE_COLUMN_COUNT - 1)
|
||||
bool IsMaxHonorLevel() const { return GetHonorLevel() == PLAYER_MAX_HONOR_LEVEL; }
|
||||
// Updates PLAYER_FIELD_HONOR_NEXT_LEVEL based on PLAYER_FIELD_HONOR_LEVEL
|
||||
void UpdateHonorNextLevel();
|
||||
//End of PvP System
|
||||
|
||||
@@ -2010,7 +2004,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
int32 CalculateCorpseReclaimDelay(bool load = false) const;
|
||||
void SendCorpseReclaimDelay(uint32 delay) const;
|
||||
|
||||
uint32 GetBlockPercent() const override { return GetUInt32Value(PLAYER_SHIELD_BLOCK); }
|
||||
uint32 GetBlockPercent() const override { return GetUInt32Value(ACTIVE_PLAYER_FIELD_SHIELD_BLOCK); }
|
||||
bool CanParry() const { return m_canParry; }
|
||||
void SetCanParry(bool value);
|
||||
bool CanBlock() const { return m_canBlock; }
|
||||
@@ -2727,7 +2721,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
|
||||
std::unordered_map<ObjectGuid /*LootObject*/, ObjectGuid /*world object*/> m_AELootView;
|
||||
|
||||
void _InitHonorLevelOnLoadFromDB(uint32 /*honor*/, uint32 /*honorLevel*/, uint32 /*prestigeLevel*/);
|
||||
void _InitHonorLevelOnLoadFromDB(uint32 honor, uint32 honorLevel);
|
||||
std::unique_ptr<RestMgr> _restMgr;
|
||||
|
||||
bool _usePvpItemLevels;
|
||||
|
||||
@@ -111,13 +111,13 @@ void PlayerTaxi::AppendTaximaskTo(WorldPackets::Taxi::ShowTaxiNodes& data, bool
|
||||
{
|
||||
if (all)
|
||||
{
|
||||
data.CanLandNodes = &sTaxiNodesMask; // all existed nodes
|
||||
data.CanUseNodes = &sTaxiNodesMask;
|
||||
data.CanLandNodes = sTaxiNodesMask; // all existed nodes
|
||||
data.CanUseNodes = sTaxiNodesMask;
|
||||
}
|
||||
else
|
||||
{
|
||||
data.CanLandNodes = &m_taximask; // known nodes
|
||||
data.CanUseNodes = &m_taximask;
|
||||
data.CanLandNodes = m_taximask; // known nodes
|
||||
data.CanUseNodes = m_taximask;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,13 +44,13 @@ class TC_GAME_API PlayerTaxi
|
||||
|
||||
bool IsTaximaskNodeKnown(uint32 nodeidx) const
|
||||
{
|
||||
uint8 field = uint8((nodeidx - 1) / 8);
|
||||
uint32 field = uint32((nodeidx - 1) / 8);
|
||||
uint32 submask = 1 << ((nodeidx-1) % 8);
|
||||
return (m_taximask[field] & submask) == submask;
|
||||
}
|
||||
bool SetTaximaskNode(uint32 nodeidx)
|
||||
{
|
||||
uint8 field = uint8((nodeidx - 1) / 8);
|
||||
uint32 field = uint32((nodeidx - 1) / 8);
|
||||
uint32 submask = 1 << ((nodeidx- 1) % 8);
|
||||
if ((m_taximask[field] & submask) != submask)
|
||||
{
|
||||
|
||||
@@ -44,17 +44,17 @@ void RestMgr::SetRestBonus(RestTypes restType, float restBonus)
|
||||
|
||||
rest_rested_offset = REST_RESTED_XP;
|
||||
rest_state_offset = REST_STATE_XP;
|
||||
next_level_xp_field = PLAYER_NEXT_LEVEL_XP;
|
||||
next_level_xp_field = ACTIVE_PLAYER_FIELD_NEXT_LEVEL_XP;
|
||||
affectedByRaF = true;
|
||||
break;
|
||||
case REST_TYPE_HONOR:
|
||||
// Reset restBonus (Honor only) for players with max honor level.
|
||||
if (_player->IsMaxHonorLevelAndPrestige())
|
||||
if (_player->IsMaxHonorLevel())
|
||||
restBonus = 0;
|
||||
|
||||
rest_rested_offset = REST_RESTED_HONOR;
|
||||
rest_state_offset = REST_STATE_HONOR;
|
||||
next_level_xp_field = PLAYER_FIELD_HONOR_NEXT_LEVEL;
|
||||
next_level_xp_field = ACTIVE_PLAYER_FIELD_HONOR_NEXT_LEVEL;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
@@ -72,17 +72,17 @@ void RestMgr::SetRestBonus(RestTypes restType, float restBonus)
|
||||
|
||||
// update data for client
|
||||
if (affectedByRaF && _player->GetsRecruitAFriendBonus(true) && (_player->GetSession()->IsARecruiter() || _player->GetSession()->GetRecruiterId() != 0))
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_RAF_LINKED);
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_RAF_LINKED);
|
||||
else
|
||||
{
|
||||
if (_restBonus[restType] > 10)
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_RESTED);
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_RESTED);
|
||||
else if (_restBonus[restType] <= 1)
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_NOT_RAF_LINKED);
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_NOT_RAF_LINKED);
|
||||
}
|
||||
|
||||
// RestTickUpdate
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + rest_rested_offset, uint32(_restBonus[restType]));
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + rest_rested_offset, uint32(_restBonus[restType]));
|
||||
}
|
||||
|
||||
void RestMgr::AddRestBonus(RestTypes restType, float restBonus)
|
||||
@@ -153,8 +153,8 @@ void RestMgr::Update(time_t now)
|
||||
void RestMgr::LoadRestBonus(RestTypes restType, PlayerRestState state, float restBonus)
|
||||
{
|
||||
_restBonus[restType] = restBonus;
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + restType * 2, state);
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + restType * 2 + 1, uint32(restBonus));
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + restType * 2, state);
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + restType * 2 + 1, uint32(restBonus));
|
||||
}
|
||||
|
||||
float RestMgr::CalcExtraPerSec(RestTypes restType, float bubble) const
|
||||
@@ -162,9 +162,9 @@ float RestMgr::CalcExtraPerSec(RestTypes restType, float bubble) const
|
||||
switch (restType)
|
||||
{
|
||||
case REST_TYPE_HONOR:
|
||||
return float(_player->GetUInt32Value(PLAYER_FIELD_HONOR_NEXT_LEVEL)) / 72000.0f * bubble;
|
||||
return float(_player->GetUInt32Value(ACTIVE_PLAYER_FIELD_HONOR_NEXT_LEVEL)) / 72000.0f * bubble;
|
||||
case REST_TYPE_XP:
|
||||
return float(_player->GetUInt32Value(PLAYER_NEXT_LEVEL_XP)) / 72000.0f * bubble;
|
||||
return float(_player->GetUInt32Value(ACTIVE_PLAYER_FIELD_NEXT_LEVEL_XP)) / 72000.0f * bubble;
|
||||
default:
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "DB2Stores.h"
|
||||
#include "Config.h"
|
||||
#include "Util.h"
|
||||
#include <boost/graph/depth_first_search.hpp>
|
||||
#include <boost/graph/dijkstra_shortest_paths.hpp>
|
||||
#include <boost/property_map/transform_value_property_map.hpp>
|
||||
|
||||
@@ -32,7 +33,7 @@ TaxiPathGraph& TaxiPathGraph::Instance()
|
||||
|
||||
void TaxiPathGraph::Initialize()
|
||||
{
|
||||
if (GetVertexCount() > 0)
|
||||
if (boost::num_vertices(m_graph) > 0)
|
||||
return;
|
||||
|
||||
std::vector<std::pair<edge, EdgeCost>> edges;
|
||||
@@ -47,7 +48,7 @@ void TaxiPathGraph::Initialize()
|
||||
}
|
||||
|
||||
// create graph
|
||||
m_graph = Graph(GetVertexCount());
|
||||
m_graph = Graph(m_nodesByVertex.size());
|
||||
WeightMap weightmap = boost::get(boost::edge_weight, m_graph);
|
||||
|
||||
for (std::size_t j = 0; j < edges.size(); ++j)
|
||||
@@ -59,21 +60,22 @@ void TaxiPathGraph::Initialize()
|
||||
|
||||
uint32 TaxiPathGraph::GetNodeIDFromVertexID(vertex_descriptor vertexID)
|
||||
{
|
||||
if (vertexID < m_vertices.size())
|
||||
return m_vertices[vertexID]->ID;
|
||||
if (vertexID < m_nodesByVertex.size())
|
||||
return m_nodesByVertex[vertexID]->ID;
|
||||
|
||||
return std::numeric_limits<uint32>::max();
|
||||
}
|
||||
|
||||
TaxiPathGraph::vertex_descriptor TaxiPathGraph::GetVertexIDFromNodeID(TaxiNodesEntry const* node)
|
||||
{
|
||||
return node->CharacterBitNumber;
|
||||
auto itr = m_verticesByNode.find(node->ID);
|
||||
return itr != m_verticesByNode.end() ? itr->second : std::numeric_limits<vertex_descriptor>::max();
|
||||
}
|
||||
|
||||
std::size_t TaxiPathGraph::GetVertexCount()
|
||||
void GetTaxiMapPosition(DBCPosition3D const& position, int32 mapId, DBCPosition2D* uiMapPosition, int32* uiMapId)
|
||||
{
|
||||
//So we can use this function for readability, we define either max defined vertices or already loaded in graph count
|
||||
return std::max(boost::num_vertices(m_graph), m_vertices.size());
|
||||
if (!DB2Manager::GetUiMapPosition(position.X, position.Y, position.Z, mapId, 0, 0, 0, UI_MAP_SYSTEM_ADVENTURE, false, uiMapId, uiMapPosition))
|
||||
DB2Manager::GetUiMapPosition(position.X, position.Y, position.Z, mapId, 0, 0, 0, UI_MAP_SYSTEM_TAXI, false, uiMapId, uiMapPosition);
|
||||
}
|
||||
|
||||
void TaxiPathGraph::AddVerticeAndEdgeFromNodeInfo(TaxiNodesEntry const* from, TaxiNodesEntry const* to, uint32 pathId, std::vector<std::pair<edge, EdgeCost>>& edges)
|
||||
@@ -104,22 +106,21 @@ void TaxiPathGraph::AddVerticeAndEdgeFromNodeInfo(TaxiNodesEntry const* from, Ta
|
||||
if (nodes[i - 1]->Flags & TAXI_PATH_NODE_FLAG_TELEPORT)
|
||||
continue;
|
||||
|
||||
uint32 map1, map2;
|
||||
int32 uiMap1, uiMap2;
|
||||
DBCPosition2D pos1, pos2;
|
||||
|
||||
DB2Manager::DeterminaAlternateMapPosition(nodes[i - 1]->ContinentID, nodes[i - 1]->Loc.X, nodes[i - 1]->Loc.Y, nodes[i - 1]->Loc.Z, &map1, &pos1);
|
||||
DB2Manager::DeterminaAlternateMapPosition(nodes[i]->ContinentID, nodes[i]->Loc.X, nodes[i]->Loc.Y, nodes[i]->Loc.Z, &map2, &pos2);
|
||||
GetTaxiMapPosition(nodes[i - 1]->Loc, nodes[i - 1]->ContinentID, &pos1, &uiMap1);
|
||||
GetTaxiMapPosition(nodes[i]->Loc, nodes[i]->ContinentID, &pos2, &uiMap2);
|
||||
|
||||
if (map1 != map2)
|
||||
if (uiMap1 != uiMap2)
|
||||
continue;
|
||||
|
||||
totalDist += std::sqrt(
|
||||
std::pow(pos2.X - pos1.X, 2) +
|
||||
std::pow(pos2.Y - pos1.Y, 2) +
|
||||
std::pow(nodes[i]->Loc.Z - nodes[i - 1]->Loc.Z, 2));
|
||||
std::pow(pos2.Y - pos1.Y, 2));
|
||||
}
|
||||
|
||||
uint32 dist = uint32(totalDist);
|
||||
uint32 dist = uint32(totalDist * 32767.0f);
|
||||
if (dist > 0xFFFF)
|
||||
dist = 0xFFFF;
|
||||
|
||||
@@ -176,14 +177,50 @@ std::size_t TaxiPathGraph::GetCompleteNodeRoute(TaxiNodesEntry const* from, Taxi
|
||||
return shortestPath.size();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct DiscoverVertexVisitor : public boost::base_visitor<DiscoverVertexVisitor<T>>
|
||||
{
|
||||
using event_filter = boost::on_discover_vertex;
|
||||
|
||||
DiscoverVertexVisitor(T&& func) : _func(std::forward<T>(func)) { }
|
||||
|
||||
template <class Vertex, class Graph>
|
||||
void operator()(Vertex v, Graph& /*g*/)
|
||||
{
|
||||
_func(v);
|
||||
}
|
||||
|
||||
private:
|
||||
T _func;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
inline auto make_discover_vertex_dfs_visitor(T&& t)
|
||||
{
|
||||
return boost::make_dfs_visitor(DiscoverVertexVisitor<T>(std::forward<T>(t)));
|
||||
}
|
||||
|
||||
void TaxiPathGraph::GetReachableNodesMask(TaxiNodesEntry const* from, TaxiMask* mask)
|
||||
{
|
||||
boost::vector_property_map<boost::default_color_type> color(boost::num_vertices(m_graph));
|
||||
std::fill(color.storage_begin(), color.storage_end(), boost::white_color);
|
||||
boost::depth_first_visit(m_graph, GetVertexIDFromNodeID(from), make_discover_vertex_dfs_visitor([this, mask](vertex_descriptor vertex)
|
||||
{
|
||||
if (TaxiNodesEntry const* taxiNode = sTaxiNodesStore.LookupEntry(GetNodeIDFromVertexID(vertex)))
|
||||
(*mask)[(taxiNode->ID - 1) / 8] |= 1 << ((taxiNode->ID - 1) % 8);
|
||||
}), color);
|
||||
}
|
||||
|
||||
TaxiPathGraph::vertex_descriptor TaxiPathGraph::CreateVertexFromFromNodeInfoIfNeeded(TaxiNodesEntry const* node)
|
||||
{
|
||||
//Check if we need a new one or if it may be already created
|
||||
if (m_vertices.size() <= node->CharacterBitNumber)
|
||||
m_vertices.resize(node->CharacterBitNumber + 1);
|
||||
auto itr = m_verticesByNode.find(node->ID);
|
||||
if (itr == m_verticesByNode.end())
|
||||
{
|
||||
itr = m_verticesByNode.emplace(node->ID, m_nodesByVertex.size()).first;
|
||||
m_nodesByVertex.push_back(node);
|
||||
}
|
||||
|
||||
m_vertices[node->CharacterBitNumber] = node;
|
||||
return node->CharacterBitNumber;
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
uint32 TaxiPathGraph::EdgeCost::EvaluateDistance(Player const* player) const
|
||||
|
||||
@@ -20,7 +20,10 @@
|
||||
|
||||
#include "Position.h"
|
||||
#include "Define.h"
|
||||
#include "DBCEnums.h"
|
||||
#include <boost/graph/adjacency_list.hpp>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
class Player;
|
||||
struct TaxiNodesEntry;
|
||||
@@ -32,6 +35,7 @@ public:
|
||||
|
||||
void Initialize();
|
||||
std::size_t GetCompleteNodeRoute(TaxiNodesEntry const* from, TaxiNodesEntry const* to, Player const* player, std::vector<uint32>& shortestPath);
|
||||
void GetReachableNodesMask(TaxiNodesEntry const* from, TaxiMask* mask);
|
||||
|
||||
private:
|
||||
struct EdgeCost
|
||||
@@ -53,10 +57,10 @@ private:
|
||||
vertex_descriptor GetVertexIDFromNodeID(TaxiNodesEntry const* node);
|
||||
uint32 GetNodeIDFromVertexID(vertex_descriptor vertexID);
|
||||
vertex_descriptor CreateVertexFromFromNodeInfoIfNeeded(TaxiNodesEntry const* node);
|
||||
std::size_t GetVertexCount();
|
||||
|
||||
Graph m_graph;
|
||||
std::vector<TaxiNodesEntry const*> m_vertices;
|
||||
std::vector<TaxiNodesEntry const*> m_nodesByVertex;
|
||||
std::unordered_map<uint32, vertex_descriptor> m_verticesByNode;
|
||||
|
||||
TaxiPathGraph(TaxiPathGraph const&) = delete;
|
||||
TaxiPathGraph& operator=(TaxiPathGraph const&) = delete;
|
||||
|
||||
@@ -38,7 +38,9 @@ Transport::Transport() : GameObject(),
|
||||
_triggeredArrivalEvent(false), _triggeredDepartureEvent(false),
|
||||
_passengerTeleportItr(_passengers.begin()), _delayedAddModel(false), _delayedTeleport(false)
|
||||
{
|
||||
m_updateFlag = UPDATEFLAG_TRANSPORT | UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_ROTATION;
|
||||
m_updateFlag.ServerTime = true;
|
||||
m_updateFlag.Stationary = true;
|
||||
m_updateFlag.Rotation = true;
|
||||
}
|
||||
|
||||
Transport::~Transport()
|
||||
|
||||
@@ -160,9 +160,9 @@ void Player::ApplySpellPowerBonus(int32 amount, bool apply)
|
||||
apply = _ModifyUInt32(apply, m_baseSpellPower, amount);
|
||||
|
||||
// For speed just update for client
|
||||
ApplyModUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, amount, apply);
|
||||
ApplyModUInt32Value(ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_POS, amount, apply);
|
||||
for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, amount, apply);
|
||||
ApplyModUInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, amount, apply);
|
||||
|
||||
if (HasAuraType(SPELL_AURA_OVERRIDE_ATTACK_POWER_BY_SP_PCT))
|
||||
{
|
||||
@@ -176,18 +176,18 @@ void Player::UpdateSpellDamageAndHealingBonus()
|
||||
// Magic damage modifiers implemented in Unit::SpellDamageBonusDone
|
||||
// This information for client side use only
|
||||
// Get healing bonus for all schools
|
||||
SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_ALL));
|
||||
SetStatInt32Value(ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_ALL));
|
||||
// Get damage bonus for all schools
|
||||
Unit::AuraEffectList const& modDamageAuras = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE);
|
||||
for (uint16 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
{
|
||||
SetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i, std::accumulate(modDamageAuras.begin(), modDamageAuras.end(), 0, [i](int32 negativeMod, AuraEffect const* aurEff)
|
||||
SetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i, std::accumulate(modDamageAuras.begin(), modDamageAuras.end(), 0, [i](int32 negativeMod, AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetAmount() < 0 && aurEff->GetMiscValue() & (1 << i))
|
||||
negativeMod += aurEff->GetAmount();
|
||||
return negativeMod;
|
||||
}));
|
||||
SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i)) - GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i));
|
||||
SetStatInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i)) - GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i));
|
||||
}
|
||||
|
||||
if (HasAuraType(SPELL_AURA_OVERRIDE_ATTACK_POWER_BY_SP_PCT))
|
||||
@@ -231,7 +231,7 @@ bool Player::UpdateAllStats()
|
||||
|
||||
void Player::ApplySpellPenetrationBonus(int32 amount, bool apply)
|
||||
{
|
||||
ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, -amount, apply);
|
||||
ApplyModInt32Value(ACTIVE_PLAYER_FIELD_MOD_TARGET_RESISTANCE, -amount, apply);
|
||||
m_spellPenetrationItemMod += apply ? amount : -amount;
|
||||
}
|
||||
|
||||
@@ -239,8 +239,7 @@ void Player::UpdateResistances(uint32 school)
|
||||
{
|
||||
if (school > SPELL_SCHOOL_NORMAL)
|
||||
{
|
||||
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
|
||||
SetResistance(SpellSchools(school), int32(value));
|
||||
Unit::UpdateResistances(school);
|
||||
|
||||
Pet* pet = GetPet();
|
||||
if (pet)
|
||||
@@ -255,6 +254,7 @@ void Player::UpdateArmor()
|
||||
UnitMods unitMod = UNIT_MOD_ARMOR;
|
||||
|
||||
float value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items)
|
||||
float baseValue = value;
|
||||
value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items
|
||||
value += GetModifierValue(unitMod, TOTAL_VALUE);
|
||||
|
||||
@@ -268,7 +268,7 @@ void Player::UpdateArmor()
|
||||
|
||||
value *= GetModifierValue(unitMod, TOTAL_PCT);
|
||||
|
||||
SetArmor(int32(value));
|
||||
SetArmor(int32(baseValue), int32(value - baseValue));
|
||||
|
||||
Pet* pet = GetPet();
|
||||
if (pet)
|
||||
@@ -360,11 +360,11 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
}
|
||||
else
|
||||
{
|
||||
int32 minSpellPower = GetInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS);
|
||||
int32 minSpellPower = GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_POS);
|
||||
for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
minSpellPower = std::min(minSpellPower, GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i));
|
||||
minSpellPower = std::min(minSpellPower, GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i));
|
||||
|
||||
val2 = CalculatePct(float(minSpellPower), GetFloatValue(PLAYER_FIELD_OVERRIDE_AP_BY_SPELL_POWER_PERCENT));
|
||||
val2 = CalculatePct(float(minSpellPower), GetFloatValue(ACTIVE_PLAYER_FIELD_OVERRIDE_AP_BY_SPELL_POWER_PERCENT));
|
||||
}
|
||||
|
||||
SetModifierValue(unitMod, BASE_VALUE, val2);
|
||||
@@ -488,7 +488,7 @@ void Player::UpdateBlockPercentage()
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
}
|
||||
SetStatFloatValue(PLAYER_BLOCK_PERCENTAGE, value);
|
||||
SetStatFloatValue(ACTIVE_PLAYER_FIELD_BLOCK_PERCENTAGE, value);
|
||||
}
|
||||
|
||||
void Player::UpdateCritPercentage(WeaponAttackType attType)
|
||||
@@ -501,18 +501,18 @@ void Player::UpdateCritPercentage(WeaponAttackType attType)
|
||||
{
|
||||
case OFF_ATTACK:
|
||||
modGroup = OFFHAND_CRIT_PERCENTAGE;
|
||||
index = PLAYER_OFFHAND_CRIT_PERCENTAGE;
|
||||
index = ACTIVE_PLAYER_FIELD_OFFHAND_CRIT_PERCENTAGE;
|
||||
cr = CR_CRIT_MELEE;
|
||||
break;
|
||||
case RANGED_ATTACK:
|
||||
modGroup = RANGED_CRIT_PERCENTAGE;
|
||||
index = PLAYER_RANGED_CRIT_PERCENTAGE;
|
||||
index = ACTIVE_PLAYER_FIELD_RANGED_CRIT_PERCENTAGE;
|
||||
cr = CR_CRIT_RANGED;
|
||||
break;
|
||||
case BASE_ATTACK:
|
||||
default:
|
||||
modGroup = CRIT_PERCENTAGE;
|
||||
index = PLAYER_CRIT_PERCENTAGE;
|
||||
index = ACTIVE_PLAYER_FIELD_CRIT_PERCENTAGE;
|
||||
cr = CR_CRIT_MELEE;
|
||||
break;
|
||||
}
|
||||
@@ -545,13 +545,13 @@ void Player::UpdateMastery()
|
||||
{
|
||||
if (!CanUseMastery())
|
||||
{
|
||||
SetFloatValue(PLAYER_MASTERY, 0.0f);
|
||||
SetFloatValue(ACTIVE_PLAYER_FIELD_MASTERY, 0.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
float value = GetTotalAuraModifier(SPELL_AURA_MASTERY);
|
||||
value += GetRatingBonusValue(CR_MASTERY);
|
||||
SetFloatValue(PLAYER_MASTERY, value);
|
||||
SetFloatValue(ACTIVE_PLAYER_FIELD_MASTERY, value);
|
||||
|
||||
ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID));
|
||||
if (!chrSpec)
|
||||
@@ -579,7 +579,7 @@ void Player::UpdateMastery()
|
||||
void Player::UpdateVersatilityDamageDone()
|
||||
{
|
||||
// No proof that CR_VERSATILITY_DAMAGE_DONE is allways = PLAYER_VERSATILITY
|
||||
SetUInt32Value(PLAYER_VERSATILITY, GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_VERSATILITY_DAMAGE_DONE));
|
||||
SetUInt32Value(ACTIVE_PLAYER_FIELD_VERSATILITY, GetUInt32Value(ACTIVE_PLAYER_FIELD_COMBAT_RATING + CR_VERSATILITY_DAMAGE_DONE));
|
||||
|
||||
if (getClass() == CLASS_HUNTER)
|
||||
UpdateDamagePhysical(RANGED_ATTACK);
|
||||
@@ -596,7 +596,7 @@ void Player::UpdateHealingDonePercentMod()
|
||||
for (AuraEffect const* auraEffect : GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT))
|
||||
AddPct(value, auraEffect->GetAmount());
|
||||
|
||||
SetStatFloatValue(PLAYER_FIELD_MOD_HEALING_DONE_PCT, value);
|
||||
SetStatFloatValue(ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_PCT, value);
|
||||
}
|
||||
|
||||
const float m_diminishing_k[MAX_CLASSES] =
|
||||
@@ -651,7 +651,7 @@ void Player::UpdateParryPercentage()
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
}
|
||||
SetStatFloatValue(PLAYER_PARRY_PERCENTAGE, value);
|
||||
SetStatFloatValue(ACTIVE_PLAYER_FIELD_PARRY_PERCENTAGE, value);
|
||||
}
|
||||
|
||||
void Player::UpdateDodgePercentage()
|
||||
@@ -686,7 +686,7 @@ void Player::UpdateDodgePercentage()
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) : value;
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value);
|
||||
SetStatFloatValue(ACTIVE_PLAYER_FIELD_DODGE_PERCENTAGE, value);
|
||||
}
|
||||
|
||||
void Player::UpdateSpellCritChance()
|
||||
@@ -700,13 +700,13 @@ void Player::UpdateSpellCritChance()
|
||||
crit += GetRatingBonusValue(CR_CRIT_SPELL);
|
||||
|
||||
// Store crit value
|
||||
SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1, crit);
|
||||
SetFloatValue(ACTIVE_PLAYER_FIELD_SPELL_CRIT_PERCENTAGE1, crit);
|
||||
}
|
||||
|
||||
void Player::UpdateArmorPenetration(int32 amount)
|
||||
{
|
||||
// Store Rating Value
|
||||
SetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_ARMOR_PENETRATION, amount);
|
||||
SetUInt32Value(ACTIVE_PLAYER_FIELD_COMBAT_RATING + CR_ARMOR_PENETRATION, amount);
|
||||
}
|
||||
|
||||
void Player::UpdateMeleeHitChances()
|
||||
@@ -746,10 +746,10 @@ void Player::UpdateExpertise(WeaponAttackType attack)
|
||||
switch (attack)
|
||||
{
|
||||
case BASE_ATTACK:
|
||||
SetUInt32Value(PLAYER_EXPERTISE, expertise);
|
||||
SetUInt32Value(ACTIVE_PLAYER_FIELD_EXPERTISE, expertise);
|
||||
break;
|
||||
case OFF_ATTACK:
|
||||
SetUInt32Value(PLAYER_OFFHAND_EXPERTISE, expertise);
|
||||
SetUInt32Value(ACTIVE_PLAYER_FIELD_OFFHAND_EXPERTISE, expertise);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -855,21 +855,11 @@ bool Creature::UpdateAllStats()
|
||||
return true;
|
||||
}
|
||||
|
||||
void Creature::UpdateResistances(uint32 school)
|
||||
{
|
||||
if (school > SPELL_SCHOOL_NORMAL)
|
||||
{
|
||||
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
|
||||
SetResistance(SpellSchools(school), int32(value));
|
||||
}
|
||||
else
|
||||
UpdateArmor();
|
||||
}
|
||||
|
||||
void Creature::UpdateArmor()
|
||||
{
|
||||
float baseValue = GetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE);
|
||||
float value = GetTotalAuraModValue(UNIT_MOD_ARMOR);
|
||||
SetArmor(int32(value));
|
||||
SetArmor(int32(baseValue), int32(value - baseValue));
|
||||
}
|
||||
|
||||
void Creature::UpdateMaxHealth()
|
||||
@@ -1077,13 +1067,18 @@ void Guardian::UpdateResistances(uint32 school)
|
||||
{
|
||||
if (school > SPELL_SCHOOL_NORMAL)
|
||||
{
|
||||
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
|
||||
float baseValue = GetModifierValue(UnitMods(UNIT_MOD_RESISTANCE_START + school), BASE_VALUE);
|
||||
float bonusValue = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school)) - baseValue;
|
||||
|
||||
// hunter and warlock pets gain 40% of owner's resistance
|
||||
if (IsPet())
|
||||
value += float(CalculatePct(m_owner->GetResistance(SpellSchools(school)), 40));
|
||||
{
|
||||
baseValue += float(CalculatePct(m_owner->GetResistance(SpellSchools(school)), 40));
|
||||
bonusValue += float(CalculatePct(m_owner->GetBonusResistanceMod(SpellSchools(school)), 40));
|
||||
}
|
||||
|
||||
SetResistance(SpellSchools(school), int32(value));
|
||||
SetResistance(SpellSchools(school), int32(baseValue));
|
||||
SetBonusResistanceMod(SpellSchools(school), int32(bonusValue));
|
||||
}
|
||||
else
|
||||
UpdateArmor();
|
||||
@@ -1091,6 +1086,7 @@ void Guardian::UpdateResistances(uint32 school)
|
||||
|
||||
void Guardian::UpdateArmor()
|
||||
{
|
||||
float baseValue = 0.0f;
|
||||
float value = 0.0f;
|
||||
float bonus_armor = 0.0f;
|
||||
UnitMods unitMod = UNIT_MOD_ARMOR;
|
||||
@@ -1102,11 +1098,12 @@ void Guardian::UpdateArmor()
|
||||
bonus_armor = m_owner->GetArmor();
|
||||
|
||||
value = GetModifierValue(unitMod, BASE_VALUE);
|
||||
baseValue = value;
|
||||
value *= GetModifierValue(unitMod, BASE_PCT);
|
||||
value += GetModifierValue(unitMod, TOTAL_VALUE) + bonus_armor;
|
||||
value *= GetModifierValue(unitMod, TOTAL_PCT);
|
||||
|
||||
SetArmor(int32(value));
|
||||
SetArmor(int32(baseValue), int32(value - baseValue));
|
||||
}
|
||||
|
||||
void Guardian::UpdateMaxHealth()
|
||||
@@ -1186,8 +1183,8 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged)
|
||||
//demons benefit from warlocks shadow or fire damage
|
||||
else if (IsPet())
|
||||
{
|
||||
int32 fire = owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
|
||||
int32 shadow = owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW) - owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW);
|
||||
int32 fire = owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
|
||||
int32 shadow = owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW) - owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW);
|
||||
int32 maximum = (fire > shadow) ? fire : shadow;
|
||||
if (maximum < 0)
|
||||
maximum = 0;
|
||||
@@ -1197,7 +1194,7 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged)
|
||||
//water elementals benefit from mage's frost damage
|
||||
else if (GetEntry() == ENTRY_WATER_ELEMENTAL)
|
||||
{
|
||||
int32 frost = owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST) - owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FROST);
|
||||
int32 frost = owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST) - owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FROST);
|
||||
if (frost < 0)
|
||||
frost = 0;
|
||||
SetBonusDamage(int32(frost * 0.4f));
|
||||
@@ -1230,14 +1227,14 @@ void Guardian::UpdateDamagePhysical(WeaponAttackType attType)
|
||||
//force of nature
|
||||
if (GetEntry() == ENTRY_TREANT)
|
||||
{
|
||||
int32 spellDmg = m_owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_NATURE) - m_owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_NATURE);
|
||||
int32 spellDmg = m_owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_NATURE) - m_owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_NATURE);
|
||||
if (spellDmg > 0)
|
||||
bonusDamage = spellDmg * 0.09f;
|
||||
}
|
||||
//greater fire elemental
|
||||
else if (GetEntry() == ENTRY_FIRE_ELEMENTAL)
|
||||
{
|
||||
int32 spellDmg = m_owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - m_owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
|
||||
int32 spellDmg = m_owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - m_owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
|
||||
if (spellDmg > 0)
|
||||
bonusDamage = spellDmg * 0.4f;
|
||||
}
|
||||
@@ -1266,5 +1263,5 @@ void Guardian::SetBonusDamage(int32 damage)
|
||||
{
|
||||
m_bonusSpellDamage = damage;
|
||||
if (GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
GetOwner()->SetUInt32Value(PLAYER_PET_SPELL_POWER, damage);
|
||||
GetOwner()->SetUInt32Value(ACTIVE_PLAYER_FIELD_PET_SPELL_POWER, damage);
|
||||
}
|
||||
|
||||
@@ -111,13 +111,13 @@ bool DispelableAura::RollDispel() const
|
||||
}
|
||||
|
||||
DamageInfo::DamageInfo(Unit* attacker, Unit* victim, uint32 damage, SpellInfo const* spellInfo, SpellSchoolMask schoolMask, DamageEffectType damageType, WeaponAttackType attackType)
|
||||
: m_attacker(attacker), m_victim(victim), m_damage(damage), m_spellInfo(spellInfo), m_schoolMask(schoolMask), m_damageType(damageType), m_attackType(attackType),
|
||||
: m_attacker(attacker), m_victim(victim), m_damage(damage), m_originalDamage(damage), m_spellInfo(spellInfo), m_schoolMask(schoolMask), m_damageType(damageType), m_attackType(attackType),
|
||||
m_absorb(0), m_resist(0), m_block(0), m_hitMask(0)
|
||||
{
|
||||
}
|
||||
|
||||
DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo)
|
||||
: m_attacker(dmgInfo.attacker), m_victim(dmgInfo.target), m_damage(dmgInfo.damage), m_spellInfo(nullptr), m_schoolMask(SpellSchoolMask(dmgInfo.damageSchoolMask)),
|
||||
: m_attacker(dmgInfo.attacker), m_victim(dmgInfo.target), m_damage(dmgInfo.damage), m_originalDamage(dmgInfo.damage), m_spellInfo(nullptr), m_schoolMask(SpellSchoolMask(dmgInfo.damageSchoolMask)),
|
||||
m_damageType(DIRECT_DAMAGE), m_attackType(dmgInfo.attackType), m_absorb(dmgInfo.absorb), m_resist(dmgInfo.resist), m_block(dmgInfo.blocked_amount), m_hitMask(0)
|
||||
{
|
||||
switch (dmgInfo.TargetState)
|
||||
@@ -171,7 +171,7 @@ DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo)
|
||||
}
|
||||
|
||||
DamageInfo::DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEffectType damageType, WeaponAttackType attackType, uint32 hitMask)
|
||||
: m_attacker(spellNonMeleeDamage.attacker), m_victim(spellNonMeleeDamage.target), m_damage(spellNonMeleeDamage.damage),
|
||||
: m_attacker(spellNonMeleeDamage.attacker), m_victim(spellNonMeleeDamage.target), m_damage(spellNonMeleeDamage.damage), m_originalDamage(spellNonMeleeDamage.originalDamage),
|
||||
m_spellInfo(sSpellMgr->GetSpellInfo(spellNonMeleeDamage.SpellID)), m_schoolMask(SpellSchoolMask(spellNonMeleeDamage.schoolMask)), m_damageType(damageType),
|
||||
m_attackType(attackType), m_absorb(spellNonMeleeDamage.absorb), m_resist(spellNonMeleeDamage.resist), m_block(spellNonMeleeDamage.blocked), m_hitMask(hitMask)
|
||||
{
|
||||
@@ -226,7 +226,7 @@ uint32 DamageInfo::GetHitMask() const
|
||||
}
|
||||
|
||||
HealInfo::HealInfo(Unit* healer, Unit* target, uint32 heal, SpellInfo const* spellInfo, SpellSchoolMask schoolMask)
|
||||
: _healer(healer), _target(target), _heal(heal), _effectiveHeal(0), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0)
|
||||
: _healer(healer), _target(target), _heal(heal), _originalHeal(heal), _effectiveHeal(0), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -279,8 +279,8 @@ SpellSchoolMask ProcEventInfo::GetSchoolMask() const
|
||||
}
|
||||
|
||||
SpellNonMeleeDamage::SpellNonMeleeDamage(Unit* _attacker, Unit* _target, uint32 _SpellID, uint32 _SpellXSpellVisualID, uint32 _schoolMask, ObjectGuid _castId)
|
||||
: target(_target), attacker(_attacker), castId(_castId), SpellID(_SpellID), SpellXSpellVisualID(_SpellXSpellVisualID), damage(0), schoolMask(_schoolMask),
|
||||
absorb(0), resist(0), periodicLog(false), blocked(0), HitInfo(0), cleanDamage(0), fullBlock(false), preHitHealth(_target->GetHealth())
|
||||
: target(_target), attacker(_attacker), castId(_castId), SpellID(_SpellID), SpellXSpellVisualID(_SpellXSpellVisualID), damage(0), originalDamage(0),
|
||||
schoolMask(_schoolMask), absorb(0), resist(0), periodicLog(false), blocked(0), HitInfo(0), cleanDamage(0), fullBlock(false), preHitHealth(_target->GetHealth())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ Unit::Unit(bool isWorldObject) :
|
||||
m_objectType |= TYPEMASK_UNIT;
|
||||
m_objectTypeId = TYPEID_UNIT;
|
||||
|
||||
m_updateFlag = UPDATEFLAG_LIVING;
|
||||
m_updateFlag.MovementUpdate = true;
|
||||
|
||||
for (uint32 i = 0; i < MAX_ATTACK; ++i)
|
||||
{
|
||||
@@ -1181,6 +1181,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
|
||||
damage = 0;
|
||||
|
||||
damageInfo->damage = damage;
|
||||
damageInfo->originalDamage = damage;
|
||||
DamageInfo dmgInfo(*damageInfo, SPELL_DIRECT_DAMAGE, BASE_ATTACK, PROC_HIT_NONE);
|
||||
CalcAbsorbResist(dmgInfo);
|
||||
damageInfo->absorb = dmgInfo.GetAbsorb();
|
||||
@@ -1227,6 +1228,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
damageInfo->damageSchoolMask = GetMeleeDamageSchoolMask();
|
||||
damageInfo->attackType = attackType;
|
||||
damageInfo->damage = 0;
|
||||
damageInfo->originalDamage = 0;
|
||||
damageInfo->cleanDamage = 0;
|
||||
damageInfo->absorb = 0;
|
||||
damageInfo->resist = 0;
|
||||
@@ -1295,17 +1297,20 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
case MELEE_HIT_EVADE:
|
||||
damageInfo->HitInfo |= HITINFO_MISS | HITINFO_SWINGNOHITSOUND;
|
||||
damageInfo->TargetState = VICTIMSTATE_EVADES;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
damageInfo->damage = 0;
|
||||
damageInfo->cleanDamage = 0;
|
||||
return;
|
||||
case MELEE_HIT_MISS:
|
||||
damageInfo->HitInfo |= HITINFO_MISS;
|
||||
damageInfo->TargetState = VICTIMSTATE_INTACT;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
damageInfo->damage = 0;
|
||||
damageInfo->cleanDamage = 0;
|
||||
break;
|
||||
case MELEE_HIT_NORMAL:
|
||||
damageInfo->TargetState = VICTIMSTATE_HIT;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
break;
|
||||
case MELEE_HIT_CRIT:
|
||||
{
|
||||
@@ -1320,21 +1325,26 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
|
||||
if (mod != 0)
|
||||
AddPct(damageInfo->damage, mod);
|
||||
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
break;
|
||||
}
|
||||
case MELEE_HIT_PARRY:
|
||||
damageInfo->TargetState = VICTIMSTATE_PARRY;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
damageInfo->cleanDamage += damageInfo->damage;
|
||||
damageInfo->damage = 0;
|
||||
break;
|
||||
case MELEE_HIT_DODGE:
|
||||
damageInfo->TargetState = VICTIMSTATE_DODGE;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
damageInfo->cleanDamage += damageInfo->damage;
|
||||
damageInfo->damage = 0;
|
||||
break;
|
||||
case MELEE_HIT_BLOCK:
|
||||
damageInfo->TargetState = VICTIMSTATE_HIT;
|
||||
damageInfo->HitInfo |= HITINFO_BLOCK;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
// 30% damage blocked, double blocked amount if block is critical
|
||||
damageInfo->blocked_amount = CalculatePct(damageInfo->damage, damageInfo->target->isBlockCritical() ? damageInfo->target->GetBlockPercent() * 2 : damageInfo->target->GetBlockPercent());
|
||||
damageInfo->damage -= damageInfo->blocked_amount;
|
||||
@@ -1344,6 +1354,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
{
|
||||
damageInfo->HitInfo |= HITINFO_GLANCING;
|
||||
damageInfo->TargetState = VICTIMSTATE_HIT;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
int32 leveldif = int32(victim->getLevel()) - int32(getLevel());
|
||||
if (leveldif > 3)
|
||||
leveldif = 3;
|
||||
@@ -1358,6 +1369,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
damageInfo->TargetState = VICTIMSTATE_HIT;
|
||||
// 150% normal damage
|
||||
damageInfo->damage += (damageInfo->damage / 2);
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1372,6 +1384,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
resilienceReduction = damageInfo->damage - resilienceReduction;
|
||||
damageInfo->damage -= resilienceReduction;
|
||||
damageInfo->cleanDamage += resilienceReduction;
|
||||
damageInfo->originalDamage -= resilienceReduction;
|
||||
|
||||
// Calculate absorb resist
|
||||
if (int32(damageInfo->damage) > 0)
|
||||
@@ -1514,7 +1527,6 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
DamageInfo damageInfo(this, victim, damage, spellInfo, spellInfo->GetSchoolMask(), SPELL_DIRECT_DAMAGE, BASE_ATTACK);
|
||||
victim->CalcAbsorbResist(damageInfo);
|
||||
damage = damageInfo.GetDamage();
|
||||
// No Unit::CalcAbsorbResist here - opcode doesn't send that data - this damage is probably not affected by that
|
||||
victim->DealDamageMods(this, damage, nullptr);
|
||||
|
||||
WorldPackets::CombatLog::SpellDamageShield damageShield;
|
||||
@@ -1522,6 +1534,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
damageShield.Defender = GetGUID();
|
||||
damageShield.SpellID = spellInfo->Id;
|
||||
damageShield.TotalDamage = damage;
|
||||
damageShield.OriginalDamage = damageInfo.GetOriginalDamage();
|
||||
damageShield.OverKill = std::max(int32(damage) - int32(GetHealth()), 0);
|
||||
damageShield.SchoolMask = spellInfo->SchoolMask;
|
||||
damageShield.LogAbsorbed = damageInfo.GetAbsorb();
|
||||
@@ -1881,6 +1894,7 @@ void Unit::CalcAbsorbResist(DamageInfo& damageInfo)
|
||||
CleanDamage cleanDamage = CleanDamage(splitDamage, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
|
||||
DealDamage(caster, splitDamage, &cleanDamage, DIRECT_DAMAGE, damageInfo.GetSchoolMask(), (*itr)->GetSpellInfo(), false);
|
||||
log.damage = splitDamage;
|
||||
log.originalDamage = splitDamage;
|
||||
log.absorb = split_absorb;
|
||||
SendSpellNonMeleeDamageLog(&log);
|
||||
|
||||
@@ -2016,6 +2030,7 @@ void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BA
|
||||
damageInfo.damageSchoolMask = GetMeleeDamageSchoolMask();
|
||||
damageInfo.attackType = attType;
|
||||
damageInfo.damage = 0;
|
||||
damageInfo.originalDamage = 0;
|
||||
damageInfo.cleanDamage = 0;
|
||||
damageInfo.absorb = 0;
|
||||
damageInfo.resist = 0;
|
||||
@@ -2573,7 +2588,7 @@ float Unit::GetUnitDodgeChance(WeaponAttackType attType, Unit const* victim) con
|
||||
float chance = 0.0f;
|
||||
float levelBonus = 0.0f;
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
chance = victim->GetFloatValue(PLAYER_DODGE_PERCENTAGE);
|
||||
chance = victim->GetFloatValue(ACTIVE_PLAYER_FIELD_DODGE_PERCENTAGE);
|
||||
else
|
||||
{
|
||||
if (!victim->IsTotem())
|
||||
@@ -2617,7 +2632,7 @@ float Unit::GetUnitParryChance(WeaponAttackType attType, Unit const* victim) con
|
||||
tmpitem = playerVictim->GetWeaponForAttack(OFF_ATTACK, true);
|
||||
|
||||
if (tmpitem)
|
||||
chance = playerVictim->GetFloatValue(PLAYER_PARRY_PERCENTAGE);
|
||||
chance = playerVictim->GetFloatValue(ACTIVE_PLAYER_FIELD_PARRY_PERCENTAGE);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2666,7 +2681,7 @@ float Unit::GetUnitBlockChance(WeaponAttackType /*attType*/, Unit const* victim)
|
||||
{
|
||||
Item* tmpitem = playerVictim->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
|
||||
if (tmpitem && !tmpitem->IsBroken() && tmpitem->GetTemplate()->GetInventoryType() == INVTYPE_SHIELD)
|
||||
chance = playerVictim->GetFloatValue(PLAYER_BLOCK_PERCENTAGE);
|
||||
chance = playerVictim->GetFloatValue(ACTIVE_PLAYER_FIELD_BLOCK_PERCENTAGE);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2693,13 +2708,13 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, Unit const* victi
|
||||
switch (attackType)
|
||||
{
|
||||
case BASE_ATTACK:
|
||||
chance = GetFloatValue(PLAYER_CRIT_PERCENTAGE);
|
||||
chance = GetFloatValue(ACTIVE_PLAYER_FIELD_CRIT_PERCENTAGE);
|
||||
break;
|
||||
case OFF_ATTACK:
|
||||
chance = GetFloatValue(PLAYER_OFFHAND_CRIT_PERCENTAGE);
|
||||
chance = GetFloatValue(ACTIVE_PLAYER_FIELD_OFFHAND_CRIT_PERCENTAGE);
|
||||
break;
|
||||
case RANGED_ATTACK:
|
||||
chance = GetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE);
|
||||
chance = GetFloatValue(ACTIVE_PLAYER_FIELD_RANGED_CRIT_PERCENTAGE);
|
||||
break;
|
||||
// Just for good manner
|
||||
default:
|
||||
@@ -4724,26 +4739,6 @@ int32 Unit::GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo
|
||||
});
|
||||
}
|
||||
|
||||
float Unit::GetResistanceBuffMods(SpellSchools school, bool positive) const
|
||||
{
|
||||
return GetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school);
|
||||
}
|
||||
|
||||
void Unit::SetResistanceBuffMods(SpellSchools school, bool positive, float val)
|
||||
{
|
||||
SetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val);
|
||||
}
|
||||
|
||||
void Unit::ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply)
|
||||
{
|
||||
ApplyModSignedFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply);
|
||||
}
|
||||
|
||||
void Unit::ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply)
|
||||
{
|
||||
ApplyPercentModFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply);
|
||||
}
|
||||
|
||||
void Unit::InitStatBuffMods()
|
||||
{
|
||||
for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i)
|
||||
@@ -5005,6 +5000,7 @@ void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const* log)
|
||||
packet.CastID = log->castId;
|
||||
packet.SpellID = log->SpellID;
|
||||
packet.Damage = log->damage;
|
||||
packet.OriginalDamage = log->originalDamage;
|
||||
if (log->damage > log->preHitHealth)
|
||||
packet.Overkill = log->damage - log->preHitHealth;
|
||||
else
|
||||
@@ -5017,9 +5013,9 @@ void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const* log)
|
||||
packet.Periodic = log->periodicLog;
|
||||
packet.Flags = log->HitInfo;
|
||||
|
||||
WorldPackets::Spells::SandboxScalingData sandboxScalingData;
|
||||
if (sandboxScalingData.GenerateDataForUnits(log->attacker, log->target))
|
||||
packet.SandboxScaling = sandboxScalingData;
|
||||
WorldPackets::Spells::ContentTuningParams contentTuningParams;
|
||||
if (contentTuningParams.GenerateDataForUnits(log->attacker, log->target))
|
||||
packet.ContentTuning = contentTuningParams;
|
||||
|
||||
SendCombatLogMessage(&packet);
|
||||
}
|
||||
@@ -5045,10 +5041,10 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* info)
|
||||
data.SpellID = aura->GetId();
|
||||
data.LogData.Initialize(this);
|
||||
|
||||
/// @todo: should send more logs in one packet when multistrike
|
||||
WorldPackets::CombatLog::SpellPeriodicAuraLog::SpellLogEffect spellLogEffect;
|
||||
spellLogEffect.Effect = aura->GetAuraType();
|
||||
spellLogEffect.Amount = info->damage;
|
||||
spellLogEffect.OriginalDamage = info->originalDamage;
|
||||
spellLogEffect.OverHealOrKill = info->overDamage;
|
||||
spellLogEffect.SchoolMaskOrPower = aura->GetSpellInfo()->GetSchoolMask();
|
||||
spellLogEffect.AbsorbedOrAmplitude = info->absorb;
|
||||
@@ -5056,10 +5052,10 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* info)
|
||||
spellLogEffect.Crit = info->critical;
|
||||
/// @todo: implement debug info
|
||||
|
||||
WorldPackets::Spells::SandboxScalingData sandboxScalingData;
|
||||
WorldPackets::Spells::ContentTuningParams contentTuningParams;
|
||||
if (Unit* caster = ObjectAccessor::GetUnit(*this, aura->GetCasterGUID()))
|
||||
if (sandboxScalingData.GenerateDataForUnits(caster, this))
|
||||
spellLogEffect.SandboxScaling = sandboxScalingData;
|
||||
if (contentTuningParams.GenerateDataForUnits(caster, this))
|
||||
spellLogEffect.ContentTuning = contentTuningParams;
|
||||
|
||||
data.Effects.push_back(spellLogEffect);
|
||||
|
||||
@@ -5101,6 +5097,7 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo)
|
||||
packet.AttackerGUID = damageInfo->attacker->GetGUID();
|
||||
packet.VictimGUID = damageInfo->target->GetGUID();
|
||||
packet.Damage = damageInfo->damage;
|
||||
packet.OriginalDamage = damageInfo->originalDamage;
|
||||
int32 overkill = damageInfo->damage - damageInfo->target->GetHealth();
|
||||
packet.OverDamage = (overkill < 0 ? -1 : overkill);
|
||||
|
||||
@@ -5116,9 +5113,9 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo)
|
||||
|
||||
packet.LogData.Initialize(damageInfo->attacker);
|
||||
|
||||
WorldPackets::Spells::SandboxScalingData sandboxScalingData;
|
||||
if (sandboxScalingData.GenerateDataForUnits(damageInfo->attacker, damageInfo->target))
|
||||
packet.SandboxScaling = sandboxScalingData;
|
||||
WorldPackets::Spells::ContentTuningParams contentTuningParams;
|
||||
if (contentTuningParams.GenerateDataForUnits(damageInfo->attacker, damageInfo->target))
|
||||
packet.ContentTuning = contentTuningParams;
|
||||
|
||||
SendCombatLogMessage(&packet);
|
||||
}
|
||||
@@ -5130,6 +5127,7 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType
|
||||
dmgInfo.attacker = this;
|
||||
dmgInfo.target = target;
|
||||
dmgInfo.damage = Damage - AbsorbDamage - Resist - BlockedAmount;
|
||||
dmgInfo.originalDamage = Damage;
|
||||
dmgInfo.damageSchoolMask = damageSchoolMask;
|
||||
dmgInfo.absorb = AbsorbDamage;
|
||||
dmgInfo.resist = Resist;
|
||||
@@ -5899,7 +5897,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
{
|
||||
SetCritterGUID(minion->GetGUID());
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
minion->SetGuidValue(UNIT_FIELD_BATTLE_PET_COMPANION_GUID, GetGuidValue(PLAYER_FIELD_SUMMONED_BATTLE_PET_ID));
|
||||
minion->SetGuidValue(UNIT_FIELD_BATTLE_PET_COMPANION_GUID, GetGuidValue(ACTIVE_PLAYER_FIELD_SUMMONED_BATTLE_PET_ID));
|
||||
}
|
||||
|
||||
// PvP, FFAPvP
|
||||
@@ -6354,32 +6352,12 @@ void Unit::SendHealSpellLog(HealInfo& healInfo, bool critical /*= false*/)
|
||||
|
||||
spellHealLog.TargetGUID = healInfo.GetTarget()->GetGUID();
|
||||
spellHealLog.CasterGUID = healInfo.GetHealer()->GetGUID();
|
||||
|
||||
spellHealLog.SpellID = healInfo.GetSpellInfo()->Id;
|
||||
spellHealLog.Health = healInfo.GetHeal();
|
||||
spellHealLog.OriginalHeal = healInfo.GetOriginalHeal();
|
||||
spellHealLog.OverHeal = int32(healInfo.GetHeal()) - healInfo.GetEffectiveHeal();
|
||||
spellHealLog.Absorbed = healInfo.GetAbsorb();
|
||||
|
||||
spellHealLog.Crit = critical;
|
||||
|
||||
/// @todo: 6.x Has to be implemented
|
||||
/*
|
||||
packet.ReadBit("Multistrike");
|
||||
|
||||
var hasCritRollMade = packet.ReadBit("HasCritRollMade");
|
||||
var hasCritRollNeeded = packet.ReadBit("HasCritRollNeeded");
|
||||
var hasLogData = packet.ReadBit("HasLogData");
|
||||
|
||||
if (hasCritRollMade)
|
||||
packet.ReadSingle("CritRollMade");
|
||||
|
||||
if (hasCritRollNeeded)
|
||||
packet.ReadSingle("CritRollNeeded");
|
||||
|
||||
if (hasLogData)
|
||||
SpellParsers.ReadSpellCastLogData(packet);
|
||||
*/
|
||||
|
||||
spellHealLog.LogData.Initialize(healInfo.GetTarget());
|
||||
SendCombatLogMessage(&spellHealLog);
|
||||
}
|
||||
@@ -6514,7 +6492,7 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_SPELL_SCHOOL; ++i)
|
||||
if (spellProto->GetSchoolMask() & (1 << i))
|
||||
maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, GetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i));
|
||||
maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, GetFloatValue(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i));
|
||||
}
|
||||
else
|
||||
maxModDamagePercentSchool = GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, spellProto->GetSchoolMask());
|
||||
@@ -6654,7 +6632,7 @@ int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
|
||||
{
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
float overrideSP = GetFloatValue(PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT);
|
||||
float overrideSP = GetFloatValue(ACTIVE_PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT);
|
||||
if (overrideSP > 0.0f)
|
||||
return int32(CalculatePct(GetTotalAttackPowerValue(BASE_ATTACK), overrideSP) + 0.5f);
|
||||
}
|
||||
@@ -6734,7 +6712,7 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto
|
||||
crit_chance = 0.0f;
|
||||
// For other schools
|
||||
else if (GetTypeId() == TYPEID_PLAYER)
|
||||
crit_chance = GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1);
|
||||
crit_chance = GetFloatValue(ACTIVE_PLAYER_FIELD_SPELL_CRIT_PERCENTAGE1);
|
||||
else
|
||||
crit_chance = (float)m_baseSpellCritChance;
|
||||
// taken
|
||||
@@ -6975,7 +6953,7 @@ float Unit::SpellHealingPctDone(Unit* /*victim*/, SpellInfo const* spellProto) c
|
||||
return 1.0f;
|
||||
|
||||
if (IsPlayer())
|
||||
return GetFloatValue(PLAYER_FIELD_MOD_HEALING_DONE_PCT);
|
||||
return GetFloatValue(ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_PCT);
|
||||
|
||||
float DoneTotalMod = 1.0f;
|
||||
|
||||
@@ -7074,7 +7052,7 @@ int32 Unit::SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const
|
||||
{
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
float overrideSP = GetFloatValue(PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT);
|
||||
float overrideSP = GetFloatValue(ACTIVE_PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT);
|
||||
if (overrideSP > 0.0f)
|
||||
return int32(CalculatePct(GetTotalAttackPowerValue(BASE_ATTACK), overrideSP) + 0.5f);
|
||||
}
|
||||
@@ -7346,7 +7324,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType
|
||||
{
|
||||
for (uint32 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
if (spellProto->GetSchoolMask() & (1 << i))
|
||||
maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, GetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i));
|
||||
maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, GetFloatValue(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i));
|
||||
}
|
||||
else
|
||||
maxModDamagePercentSchool = GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, spellProto->GetSchoolMask());
|
||||
@@ -9337,6 +9315,19 @@ Stats Unit::GetStatByAuraGroup(UnitMods unitMod) const
|
||||
return stat;
|
||||
}
|
||||
|
||||
void Unit::UpdateResistances(uint32 school)
|
||||
{
|
||||
if (school > SPELL_SCHOOL_NORMAL)
|
||||
{
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_RESISTANCE_START + school);
|
||||
|
||||
SetResistance(SpellSchools(school), int32(m_auraModifiersGroup[unitMod][BASE_VALUE]));
|
||||
SetBonusResistanceMod(SpellSchools(school), int32(GetTotalAuraModValue(unitMod) - GetResistance(SpellSchools(school))));
|
||||
}
|
||||
else
|
||||
UpdateArmor();
|
||||
}
|
||||
|
||||
float Unit::GetTotalAttackPowerValue(WeaponAttackType attType) const
|
||||
{
|
||||
if (attType == RANGED_ATTACK)
|
||||
@@ -10340,9 +10331,11 @@ bool Unit::IsPolymorphed() const
|
||||
return spellInfo->GetSpellSpecific() == SPELL_SPECIFIC_MAGE_POLYMORPH;
|
||||
}
|
||||
|
||||
void Unit::SetDisplayId(uint32 modelId)
|
||||
void Unit::SetDisplayId(uint32 modelId, float displayScale /*= 1.f*/)
|
||||
{
|
||||
SetUInt32Value(UNIT_FIELD_DISPLAYID, modelId);
|
||||
SetFloatValue(UNIT_FIELD_DISPLAY_SCALE, displayScale);
|
||||
|
||||
// Set Gender by modelId
|
||||
if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(modelId))
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
|
||||
@@ -10365,7 +10358,7 @@ void Unit::RestoreDisplayId(bool ignorePositiveAurasPreventingMounting /*= false
|
||||
if (!ignorePositiveAurasPreventingMounting)
|
||||
handledAura = (*i);
|
||||
else if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate((*i)->GetMiscValue()))
|
||||
if (!IsDisallowedMountForm((*i)->GetId(), FORM_NONE, sObjectMgr->ChooseDisplayId(ci)))
|
||||
if (!IsDisallowedMountForm((*i)->GetId(), FORM_NONE, ObjectMgr::ChooseDisplayId(ci)->CreatureDisplayID))
|
||||
handledAura = (*i);
|
||||
}
|
||||
// prefer negative auras
|
||||
@@ -11686,7 +11679,7 @@ bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading /*= fa
|
||||
return false;
|
||||
|
||||
m_vehicleKit = new Vehicle(this, vehInfo, creatureEntry);
|
||||
m_updateFlag |= UPDATEFLAG_VEHICLE;
|
||||
m_updateFlag.Vehicle = true;
|
||||
m_unitTypeMask |= UNIT_MASK_VEHICLE;
|
||||
|
||||
if (!loading)
|
||||
@@ -11708,7 +11701,7 @@ void Unit::RemoveVehicleKit(bool onRemoveFromWorld /*= false*/)
|
||||
|
||||
m_vehicleKit = NULL;
|
||||
|
||||
m_updateFlag &= ~UPDATEFLAG_VEHICLE;
|
||||
m_updateFlag.Vehicle = false;
|
||||
m_unitTypeMask &= ~UNIT_MASK_VEHICLE;
|
||||
RemoveFlag64(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK | UNIT_NPC_FLAG_PLAYER_VEHICLE);
|
||||
}
|
||||
@@ -13121,15 +13114,17 @@ void Unit::SendClearTarget()
|
||||
SendMessageToSet(breakTarget.Write(), false);
|
||||
}
|
||||
|
||||
uint32 Unit::GetResistance(SpellSchoolMask mask) const
|
||||
int32 Unit::GetResistance(SpellSchoolMask mask) const
|
||||
{
|
||||
int32 resist = -1;
|
||||
Optional<int32> resist;
|
||||
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
|
||||
if (mask & (1 << i) && (resist < 0 || resist > int32(GetResistance(SpellSchools(i)))))
|
||||
resist = int32(GetResistance(SpellSchools(i)));
|
||||
{
|
||||
int32 schoolResistance = GetResistance(SpellSchools(i)) + GetBonusResistanceMod(SpellSchools(i));
|
||||
if (mask & (1 << i) && (!resist || *resist > schoolResistance))
|
||||
resist = schoolResistance;
|
||||
}
|
||||
|
||||
// resist value will never be negative here
|
||||
return uint32(resist);
|
||||
return resist ? *resist : 0;
|
||||
}
|
||||
|
||||
void CharmInfo::SetIsCommandAttack(bool val)
|
||||
@@ -13673,7 +13668,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
|
||||
if (target == this)
|
||||
visibleFlag |= UF_FLAG_PRIVATE;
|
||||
else if (GetTypeId() == TYPEID_PLAYER)
|
||||
valCount = PLAYER_FIELD_END_NOT_SELF;
|
||||
valCount = PLAYER_END;
|
||||
|
||||
std::size_t blockCount = UpdateMask::GetBlockCount(valCount);
|
||||
|
||||
@@ -13721,8 +13716,6 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
|
||||
// FIXME: Some values at server stored in float format but must be sent to client in uint32 format
|
||||
// there are some float values which may be negative or can't get negative due to other checks
|
||||
else if ((index >= UNIT_FIELD_NEGSTAT && index < UNIT_FIELD_NEGSTAT + MAX_STATS) ||
|
||||
(index >= UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE && index < (UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + MAX_SPELL_SCHOOL)) ||
|
||||
(index >= UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE && index < (UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE + MAX_SPELL_SCHOOL)) ||
|
||||
(index >= UNIT_FIELD_POSSTAT && index < UNIT_FIELD_POSSTAT + MAX_STATS))
|
||||
{
|
||||
*data << uint32(m_floatValues[index]);
|
||||
@@ -13756,7 +13749,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
|
||||
|
||||
if (cinfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
|
||||
if (target->IsGameMaster())
|
||||
displayId = cinfo->GetFirstVisibleModel();
|
||||
displayId = cinfo->GetFirstVisibleModel()->CreatureDisplayID;
|
||||
}
|
||||
|
||||
*data << uint32(displayId);
|
||||
|
||||
@@ -576,6 +576,7 @@ class TC_GAME_API DamageInfo
|
||||
Unit* const m_attacker;
|
||||
Unit* const m_victim;
|
||||
uint32 m_damage;
|
||||
uint32 const m_originalDamage;
|
||||
SpellInfo const* const m_spellInfo;
|
||||
SpellSchoolMask const m_schoolMask;
|
||||
DamageEffectType const m_damageType;
|
||||
@@ -601,6 +602,7 @@ class TC_GAME_API DamageInfo
|
||||
DamageEffectType GetDamageType() const { return m_damageType; }
|
||||
WeaponAttackType GetAttackType() const { return m_attackType; }
|
||||
uint32 GetDamage() const { return m_damage; }
|
||||
uint32 GetOriginalDamage() const { return m_originalDamage; }
|
||||
uint32 GetAbsorb() const { return m_absorb; }
|
||||
uint32 GetResist() const { return m_resist; }
|
||||
uint32 GetBlock() const { return m_block; }
|
||||
@@ -614,6 +616,7 @@ class TC_GAME_API HealInfo
|
||||
Unit* const _healer;
|
||||
Unit* const _target;
|
||||
uint32 _heal;
|
||||
uint32 const _originalHeal;
|
||||
uint32 _effectiveHeal;
|
||||
uint32 _absorb;
|
||||
SpellInfo const* const _spellInfo;
|
||||
@@ -629,6 +632,7 @@ class TC_GAME_API HealInfo
|
||||
Unit* GetHealer() const { return _healer; }
|
||||
Unit* GetTarget() const { return _target; }
|
||||
uint32 GetHeal() const { return _heal; }
|
||||
uint32 GetOriginalHeal() const { return _originalHeal; }
|
||||
uint32 GetEffectiveHeal() const { return _effectiveHeal; }
|
||||
uint32 GetAbsorb() const { return _absorb; }
|
||||
SpellInfo const* GetSpellInfo() const { return _spellInfo; };
|
||||
@@ -682,6 +686,7 @@ struct CalcDamageInfo
|
||||
Unit *target; // Target for damage
|
||||
uint32 damageSchoolMask;
|
||||
uint32 damage;
|
||||
uint32 originalDamage;
|
||||
uint32 absorb;
|
||||
uint32 resist;
|
||||
uint32 blocked_amount;
|
||||
@@ -706,6 +711,7 @@ struct TC_GAME_API SpellNonMeleeDamage
|
||||
uint32 SpellID;
|
||||
uint32 SpellXSpellVisualID;
|
||||
uint32 damage;
|
||||
uint32 originalDamage;
|
||||
uint32 schoolMask;
|
||||
uint32 absorb;
|
||||
uint32 resist;
|
||||
@@ -720,11 +726,12 @@ struct TC_GAME_API SpellNonMeleeDamage
|
||||
|
||||
struct SpellPeriodicAuraLogInfo
|
||||
{
|
||||
SpellPeriodicAuraLogInfo(AuraEffect const* _auraEff, uint32 _damage, uint32 _overDamage, uint32 _absorb, uint32 _resist, float _multiplier, bool _critical)
|
||||
: auraEff(_auraEff), damage(_damage), overDamage(_overDamage), absorb(_absorb), resist(_resist), multiplier(_multiplier), critical(_critical){ }
|
||||
SpellPeriodicAuraLogInfo(AuraEffect const* _auraEff, uint32 _damage, uint32 _originalDamage, uint32 _overDamage, uint32 _absorb, uint32 _resist, float _multiplier, bool _critical)
|
||||
: auraEff(_auraEff), damage(_damage), originalDamage(_originalDamage), overDamage(_overDamage), absorb(_absorb), resist(_resist), multiplier(_multiplier), critical(_critical){ }
|
||||
|
||||
AuraEffect const* auraEff;
|
||||
uint32 damage;
|
||||
uint32 originalDamage;
|
||||
uint32 overDamage; // overkill/overheal
|
||||
uint32 absorb;
|
||||
uint32 resist;
|
||||
@@ -1033,12 +1040,18 @@ class TC_GAME_API Unit : public WorldObject
|
||||
|
||||
float GetStat(Stats stat) const { return float(GetUInt32Value(UNIT_FIELD_STAT+stat)); }
|
||||
void SetStat(Stats stat, int32 val) { SetStatInt32Value(UNIT_FIELD_STAT+stat, val); }
|
||||
uint32 GetArmor() const { return GetResistance(SPELL_SCHOOL_NORMAL); }
|
||||
void SetArmor(int32 val) { SetResistance(SPELL_SCHOOL_NORMAL, val); }
|
||||
uint32 GetArmor() const { return GetResistance(SPELL_SCHOOL_NORMAL) + GetBonusResistanceMod(SPELL_SCHOOL_NORMAL); }
|
||||
void SetArmor(int32 val, int32 bonusVal)
|
||||
{
|
||||
SetResistance(SPELL_SCHOOL_NORMAL, val);
|
||||
SetBonusResistanceMod(SPELL_SCHOOL_NORMAL, bonusVal);
|
||||
}
|
||||
|
||||
uint32 GetResistance(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_RESISTANCES+school); }
|
||||
uint32 GetResistance(SpellSchoolMask mask) const;
|
||||
void SetResistance(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_RESISTANCES+school, val); }
|
||||
int32 GetResistance(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_RESISTANCES + school); }
|
||||
int32 GetBonusResistanceMod(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_BONUS_RESISTANCE_MODS + school); }
|
||||
int32 GetResistance(SpellSchoolMask mask) const;
|
||||
void SetResistance(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_RESISTANCES + school, val); }
|
||||
void SetBonusResistanceMod(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_BONUS_RESISTANCE_MODS + school, val); }
|
||||
|
||||
uint64 GetHealth() const { return GetUInt64Value(UNIT_FIELD_HEALTH); }
|
||||
uint64 GetMaxHealth() const { return GetUInt64Value(UNIT_FIELD_MAXHEALTH); }
|
||||
@@ -1533,10 +1546,6 @@ class TC_GAME_API Unit : public WorldObject
|
||||
int32 GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
|
||||
int32 GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
|
||||
|
||||
float GetResistanceBuffMods(SpellSchools school, bool positive) const;
|
||||
void SetResistanceBuffMods(SpellSchools school, bool positive, float val);
|
||||
void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply);
|
||||
void ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply);
|
||||
void InitStatBuffMods();
|
||||
void ApplyStatBuffMod(Stats stat, float val, bool apply);
|
||||
void ApplyStatPercentBuffMod(Stats stat, float val, bool apply);
|
||||
@@ -1620,7 +1629,7 @@ class TC_GAME_API Unit : public WorldObject
|
||||
void SetCanModifyStats(bool modifyStats) { m_canModifyStats = modifyStats; }
|
||||
virtual bool UpdateStats(Stats stat) = 0;
|
||||
virtual bool UpdateAllStats() = 0;
|
||||
virtual void UpdateResistances(uint32 school) = 0;
|
||||
virtual void UpdateResistances(uint32 school);
|
||||
virtual void UpdateAllResistances();
|
||||
virtual void UpdateArmor() = 0;
|
||||
virtual void UpdateMaxHealth() = 0;
|
||||
@@ -1675,10 +1684,11 @@ class TC_GAME_API Unit : public WorldObject
|
||||
void UpdateInterruptMask();
|
||||
|
||||
uint32 GetDisplayId() const { return GetUInt32Value(UNIT_FIELD_DISPLAYID); }
|
||||
virtual void SetDisplayId(uint32 modelId);
|
||||
virtual void SetDisplayId(uint32 modelId, float displayScale = 1.f);
|
||||
uint32 GetNativeDisplayId() const { return GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID); }
|
||||
float GetNativeDisplayScale() const { return GetFloatValue(UNIT_FIELD_NATIVE_X_DISPLAY_SCALE); }
|
||||
void RestoreDisplayId(bool ignorePositiveAurasPreventingMounting = false);
|
||||
void SetNativeDisplayId(uint32 modelId) { SetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID, modelId); }
|
||||
void SetNativeDisplayId(uint32 displayId, float displayScale = 1.f) { SetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID, displayId); SetFloatValue(UNIT_FIELD_NATIVE_X_DISPLAY_SCALE, displayScale); }
|
||||
void setTransForm(uint32 spellid) { m_transform = spellid;}
|
||||
uint32 getTransForm() const { return m_transform;}
|
||||
|
||||
|
||||
@@ -147,8 +147,8 @@ void AreaTriggerDataStore::LoadAreaTriggerTemplates()
|
||||
while (templates->NextRow());
|
||||
}
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
if (QueryResult areatriggerSpellMiscs = WorldDatabase.Query("SELECT SpellMiscId, AreaTriggerId, MoveCurveId, ScaleCurveId, MorphCurveId, FacingCurveId, DecalPropertiesId, TimeToTarget, TimeToTargetScale FROM `spell_areatrigger`"))
|
||||
// 0 1 2 3 4 5 6 7 8 9 10
|
||||
if (QueryResult areatriggerSpellMiscs = WorldDatabase.Query("SELECT SpellMiscId, AreaTriggerId, MoveCurveId, ScaleCurveId, MorphCurveId, FacingCurveId, AnimId, AnimKitId, DecalPropertiesId, TimeToTarget, TimeToTargetScale FROM `spell_areatrigger`"))
|
||||
{
|
||||
do
|
||||
{
|
||||
@@ -182,10 +182,13 @@ void AreaTriggerDataStore::LoadAreaTriggerTemplates()
|
||||
|
||||
#undef VALIDATE_AND_SET_CURVE
|
||||
|
||||
miscTemplate.DecalPropertiesId = areatriggerSpellMiscFields[6].GetUInt32();
|
||||
miscTemplate.AnimId = areatriggerSpellMiscFields[6].GetInt32();
|
||||
miscTemplate.AnimKitId = areatriggerSpellMiscFields[7].GetInt32();
|
||||
|
||||
miscTemplate.TimeToTarget = areatriggerSpellMiscFields[7].GetUInt32();
|
||||
miscTemplate.TimeToTargetScale = areatriggerSpellMiscFields[8].GetUInt32();
|
||||
miscTemplate.DecalPropertiesId = areatriggerSpellMiscFields[8].GetUInt32();
|
||||
|
||||
miscTemplate.TimeToTarget = areatriggerSpellMiscFields[9].GetUInt32();
|
||||
miscTemplate.TimeToTargetScale = areatriggerSpellMiscFields[10].GetUInt32();
|
||||
|
||||
miscTemplate.SplinePoints = std::move(splinesBySpellMisc[miscTemplate.MiscId]);
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ void ConversationDataStore::LoadConversationTemplates()
|
||||
TC_LOG_INFO("server.loading", ">> Loaded 0 Conversation actors. DB table `conversation_actors` is empty.");
|
||||
}
|
||||
|
||||
if (QueryResult templates = WorldDatabase.Query("SELECT Id, FirstLineId, LastLineEndTime, ScriptName FROM conversation_template"))
|
||||
if (QueryResult templates = WorldDatabase.Query("SELECT Id, FirstLineId, LastLineEndTime, TextureKitId, ScriptName FROM conversation_template"))
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
@@ -162,7 +162,8 @@ void ConversationDataStore::LoadConversationTemplates()
|
||||
conversationTemplate.Id = fields[0].GetUInt32();
|
||||
conversationTemplate.FirstLineId = fields[1].GetUInt32();
|
||||
conversationTemplate.LastLineEndTime = fields[2].GetUInt32();
|
||||
conversationTemplate.ScriptId = sObjectMgr->GetScriptId(fields[3].GetString());
|
||||
conversationTemplate.TextureKitId = fields[3].GetUInt32();
|
||||
conversationTemplate.ScriptId = sObjectMgr->GetScriptId(fields[4].GetString());
|
||||
|
||||
conversationTemplate.Actors = std::move(actorsByConversation[conversationTemplate.Id]);
|
||||
conversationTemplate.ActorGuids = std::move(actorGuidsByConversation[conversationTemplate.Id]);
|
||||
@@ -184,7 +185,7 @@ void ConversationDataStore::LoadConversationTemplates()
|
||||
currentConversationLine = sConversationLineStore.AssertEntry(currentConversationLine->NextConversationLineID);
|
||||
}
|
||||
|
||||
_conversationTemplateStore[conversationTemplate.Id] = conversationTemplate;
|
||||
_conversationTemplateStore[conversationTemplate.Id] = std::move(conversationTemplate);
|
||||
}
|
||||
while (templates->NextRow());
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ enum ConversationLineFlags
|
||||
CONVERSATION_LINE_FLAG_NOTIFY_STARTED = 0x1 // Client will send CMSG_CONVERSATION_LINE_STARTED when it runs this line
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct ConversationActorTemplate
|
||||
{
|
||||
uint32 Id;
|
||||
@@ -36,6 +35,7 @@ struct ConversationActorTemplate
|
||||
uint32 CreatureModelId;
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct ConversationLineTemplate
|
||||
{
|
||||
uint32 Id; // Link to ConversationLine.db2
|
||||
@@ -52,6 +52,7 @@ struct ConversationTemplate
|
||||
uint32 Id;
|
||||
uint32 FirstLineId; // Link to ConversationLine.db2
|
||||
uint32 LastLineEndTime; // Time in ms after conversation creation the last line fades out
|
||||
uint32 TextureKitId; // Background texture
|
||||
|
||||
std::vector<ConversationActorTemplate const*> Actors;
|
||||
std::vector<ObjectGuid::LowType> ActorGuids;
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#include "VMapFactory.h"
|
||||
#include "World.h"
|
||||
#include <G3D/g3dmath.h>
|
||||
#include <numeric>
|
||||
|
||||
ScriptMapMap sSpellScripts;
|
||||
ScriptMapMap sEventScripts;
|
||||
@@ -171,30 +172,37 @@ ExtendedPlayerName ExtractExtendedPlayerName(std::string const& name)
|
||||
|
||||
LanguageDesc lang_description[LANGUAGES_COUNT] =
|
||||
{
|
||||
{ LANG_ADDON, 0, 0 },
|
||||
{ LANG_UNIVERSAL, 0, 0 },
|
||||
{ LANG_ORCISH, 669, SKILL_LANG_ORCISH },
|
||||
{ LANG_DARNASSIAN, 671, SKILL_LANG_DARNASSIAN },
|
||||
{ LANG_TAURAHE, 670, SKILL_LANG_TAURAHE },
|
||||
{ LANG_DWARVISH, 672, SKILL_LANG_DWARVEN },
|
||||
{ LANG_COMMON, 668, SKILL_LANG_COMMON },
|
||||
{ LANG_DEMONIC, 815, SKILL_LANG_DEMON_TONGUE },
|
||||
{ LANG_TITAN, 816, SKILL_LANG_TITAN },
|
||||
{ LANG_THALASSIAN, 813, SKILL_LANG_THALASSIAN },
|
||||
{ LANG_DRACONIC, 814, SKILL_LANG_DRACONIC },
|
||||
{ LANG_KALIMAG, 817, SKILL_LANG_OLD_TONGUE },
|
||||
{ LANG_GNOMISH, 7340, SKILL_LANG_GNOMISH },
|
||||
{ LANG_TROLL, 7341, SKILL_LANG_TROLL },
|
||||
{ LANG_GUTTERSPEAK, 17737, SKILL_LANG_FORSAKEN },
|
||||
{ LANG_DRAENEI, 29932, SKILL_LANG_DRAENEI },
|
||||
{ LANG_ZOMBIE, 0, 0 },
|
||||
{ LANG_GNOMISH_BINARY, 0, 0 },
|
||||
{ LANG_GOBLIN_BINARY, 0, 0 },
|
||||
{ LANG_WORGEN, 69270, SKILL_LANG_GILNEAN },
|
||||
{ LANG_GOBLIN, 69269, SKILL_LANG_GOBLIN },
|
||||
{ LANG_PANDAREN_NEUTRAL, 108127, SKILL_LANG_PANDAREN_NEUTRAL },
|
||||
{ LANG_PANDAREN_ALLIANCE, 108130, SKILL_LANG_PANDAREN_ALLIANCE },
|
||||
{ LANG_PANDAREN_HORDE, 108131, SKILL_LANG_PANDAREN_HORDE }
|
||||
{ LANG_ADDON, 0, 0 },
|
||||
{ LANG_ADDON_LOGGED, 0, 0 },
|
||||
{ LANG_UNIVERSAL, 0, 0 },
|
||||
{ LANG_ORCISH, 669, SKILL_LANGUAGE_ORCISH },
|
||||
{ LANG_DARNASSIAN, 671, SKILL_LANGUAGE_DARNASSIAN },
|
||||
{ LANG_TAURAHE, 670, SKILL_LANGUAGE_TAURAHE },
|
||||
{ LANG_DWARVISH, 672, SKILL_LANGUAGE_DWARVEN },
|
||||
{ LANG_COMMON, 668, SKILL_LANGUAGE_COMMON },
|
||||
{ LANG_DEMONIC, 815, SKILL_LANGUAGE_DEMON_TONGUE },
|
||||
{ LANG_TITAN, 816, SKILL_LANGUAGE_TITAN },
|
||||
{ LANG_THALASSIAN, 813, SKILL_LANGUAGE_THALASSIAN },
|
||||
{ LANG_DRACONIC, 814, SKILL_LANGUAGE_DRACONIC },
|
||||
{ LANG_KALIMAG, 265462, SKILL_LANGUAGE_OLD_TONGUE },
|
||||
{ LANG_GNOMISH, 7340, SKILL_LANGUAGE_GNOMISH },
|
||||
{ LANG_TROLL, 7341, SKILL_LANGUAGE_TROLL },
|
||||
{ LANG_GUTTERSPEAK, 17737, SKILL_LANGUAGE_FORSAKEN },
|
||||
{ LANG_DRAENEI, 29932, SKILL_LANGUAGE_DRAENEI },
|
||||
{ LANG_ZOMBIE, 265467, 0 },
|
||||
{ LANG_GNOMISH_BINARY, 265460, 0 },
|
||||
{ LANG_GOBLIN_BINARY, 265461, 0 },
|
||||
{ LANG_WORGEN, 69270, SKILL_LANGUAGE_GILNEAN },
|
||||
{ LANG_GOBLIN, 69269, SKILL_LANGUAGE_GOBLIN },
|
||||
{ LANG_PANDAREN_NEUTRAL, 108127, SKILL_LANGUAGE_PANDAREN_NEUTRAL },
|
||||
{ LANG_PANDAREN_ALLIANCE, 108130, 0 },
|
||||
{ LANG_PANDAREN_HORDE, 108131, 0 },
|
||||
{ LANG_SPRITE, 265466, 0 },
|
||||
{ LANG_SHATH_YAR, 265465, 0 },
|
||||
{ LANG_NERGLISH, 265464, 0 },
|
||||
{ LANG_MOONKIN, 265463, 0 },
|
||||
{ LANG_SHALASSIAN, 262439, SKILL_LANGUAGE_SHALASSIAN },
|
||||
{ LANG_THALASSIAN_2, 262454, SKILL_LANGUAGE_THALASSIAN_2 }
|
||||
};
|
||||
|
||||
LanguageDesc const* GetLanguageDescByID(uint32 lang)
|
||||
@@ -404,21 +412,21 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, "
|
||||
// 9 10 11 12 13 14 15 16 17 18 19 20
|
||||
"modelid4, name, femaleName, subname, TitleAlt, IconName, gossip_menu_id, minlevel, maxlevel, HealthScalingExpansion, RequiredExpansion, VignetteID, "
|
||||
// 21 22 23 24 25 26 27 28 29 30 31
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, name, femaleName, subname, "
|
||||
// 9 10 11 12 13 14 15 16
|
||||
"TitleAlt, IconName, gossip_menu_id, minlevel, maxlevel, HealthScalingExpansion, RequiredExpansion, VignetteID, "
|
||||
// 17 18 19 20 21 22 23 24 25 26 27
|
||||
"faction, npcflag, speed_walk, speed_run, scale, rank, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, "
|
||||
// 32 33 34 35 36 37 38 39
|
||||
// 28 29 30 31 32 33 34 35
|
||||
"unit_class, unit_flags, unit_flags2, unit_flags3, dynamicflags, family, trainer_class, type, "
|
||||
// 40 41 42 43 44 45 46 47 48 49 50
|
||||
// 36 37 38 39 40 41 42 43 44 45 46
|
||||
"type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, "
|
||||
// 51 52 53 54 55 56 57 58 59 60 61 62 63
|
||||
// 47 48 49 50 51 52 53 54 55 56 57 58 59
|
||||
"spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, VehicleId, mingold, maxgold, AIName, MovementType, "
|
||||
// 64 65 66 67 68 69 70 71 72
|
||||
// 60 61 62 63 64 65 66 67 68
|
||||
"InhabitType, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, ArmorModifier, DamageModifier, ExperienceModifier, "
|
||||
// 73 74 75 76 77 78
|
||||
// 69 70 71 72 73 74
|
||||
"RacialLeader, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template");
|
||||
|
||||
if (!result)
|
||||
@@ -435,6 +443,9 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
// We load the creature models after loading but before checking
|
||||
LoadCreatureTemplateModels();
|
||||
|
||||
// Checking needs to be done after loading because of the difficulty self referencing
|
||||
for (CreatureTemplateContainer::const_iterator itr = _creatureTemplateStore.begin(); itr != _creatureTemplateStore.end(); ++itr)
|
||||
CheckCreatureTemplate(&itr->second);
|
||||
@@ -456,72 +467,121 @@ void ObjectMgr::LoadCreatureTemplate(Field* fields)
|
||||
for (uint8 i = 0; i < MAX_KILL_CREDIT; ++i)
|
||||
creatureTemplate.KillCredit[i] = fields[4 + i].GetUInt32();
|
||||
|
||||
creatureTemplate.Modelid1 = fields[6].GetUInt32();
|
||||
creatureTemplate.Modelid2 = fields[7].GetUInt32();
|
||||
creatureTemplate.Modelid3 = fields[8].GetUInt32();
|
||||
creatureTemplate.Modelid4 = fields[9].GetUInt32();
|
||||
creatureTemplate.Name = fields[10].GetString();
|
||||
creatureTemplate.FemaleName = fields[11].GetString();
|
||||
creatureTemplate.SubName = fields[12].GetString();
|
||||
creatureTemplate.TitleAlt = fields[13].GetString();
|
||||
creatureTemplate.IconName = fields[14].GetString();
|
||||
creatureTemplate.GossipMenuId = fields[15].GetUInt32();
|
||||
creatureTemplate.minlevel = fields[16].GetInt16();
|
||||
creatureTemplate.maxlevel = fields[17].GetInt16();
|
||||
creatureTemplate.HealthScalingExpansion = fields[18].GetInt32();
|
||||
creatureTemplate.RequiredExpansion = fields[19].GetUInt32();
|
||||
creatureTemplate.VignetteID = fields[20].GetUInt32();
|
||||
creatureTemplate.faction = fields[21].GetUInt16();
|
||||
creatureTemplate.npcflag = fields[22].GetUInt64();
|
||||
creatureTemplate.speed_walk = fields[23].GetFloat();
|
||||
creatureTemplate.speed_run = fields[24].GetFloat();
|
||||
creatureTemplate.scale = fields[25].GetFloat();
|
||||
creatureTemplate.rank = uint32(fields[26].GetUInt8());
|
||||
creatureTemplate.dmgschool = uint32(fields[27].GetInt8());
|
||||
creatureTemplate.BaseAttackTime = fields[28].GetUInt32();
|
||||
creatureTemplate.RangeAttackTime = fields[29].GetUInt32();
|
||||
creatureTemplate.BaseVariance = fields[30].GetFloat();
|
||||
creatureTemplate.RangeVariance = fields[31].GetFloat();
|
||||
creatureTemplate.unit_class = uint32(fields[32].GetUInt8());
|
||||
creatureTemplate.unit_flags = fields[33].GetUInt32();
|
||||
creatureTemplate.unit_flags2 = fields[34].GetUInt32();
|
||||
creatureTemplate.unit_flags3 = fields[35].GetUInt32();
|
||||
creatureTemplate.dynamicflags = fields[36].GetUInt32();
|
||||
creatureTemplate.family = CreatureFamily(fields[37].GetUInt8());
|
||||
creatureTemplate.trainer_class = uint32(fields[38].GetUInt8());
|
||||
creatureTemplate.type = uint32(fields[39].GetUInt8());
|
||||
creatureTemplate.type_flags = fields[40].GetUInt32();
|
||||
creatureTemplate.type_flags2 = fields[41].GetUInt32();
|
||||
creatureTemplate.lootid = fields[42].GetUInt32();
|
||||
creatureTemplate.pickpocketLootId = fields[43].GetUInt32();
|
||||
creatureTemplate.SkinLootId = fields[44].GetUInt32();
|
||||
creatureTemplate.Name = fields[6].GetString();
|
||||
creatureTemplate.FemaleName = fields[7].GetString();
|
||||
creatureTemplate.SubName = fields[8].GetString();
|
||||
creatureTemplate.TitleAlt = fields[9].GetString();
|
||||
creatureTemplate.IconName = fields[10].GetString();
|
||||
creatureTemplate.GossipMenuId = fields[11].GetUInt32();
|
||||
creatureTemplate.minlevel = fields[12].GetInt16();
|
||||
creatureTemplate.maxlevel = fields[13].GetInt16();
|
||||
creatureTemplate.HealthScalingExpansion = fields[14].GetInt32();
|
||||
creatureTemplate.RequiredExpansion = fields[15].GetUInt32();
|
||||
creatureTemplate.VignetteID = fields[16].GetUInt32();
|
||||
creatureTemplate.faction = fields[17].GetUInt16();
|
||||
creatureTemplate.npcflag = fields[18].GetUInt64();
|
||||
creatureTemplate.speed_walk = fields[19].GetFloat();
|
||||
creatureTemplate.speed_run = fields[20].GetFloat();
|
||||
creatureTemplate.scale = fields[21].GetFloat();
|
||||
creatureTemplate.rank = uint32(fields[22].GetUInt8());
|
||||
creatureTemplate.dmgschool = uint32(fields[23].GetInt8());
|
||||
creatureTemplate.BaseAttackTime = fields[24].GetUInt32();
|
||||
creatureTemplate.RangeAttackTime = fields[25].GetUInt32();
|
||||
creatureTemplate.BaseVariance = fields[26].GetFloat();
|
||||
creatureTemplate.RangeVariance = fields[27].GetFloat();
|
||||
creatureTemplate.unit_class = uint32(fields[28].GetUInt8());
|
||||
creatureTemplate.unit_flags = fields[29].GetUInt32();
|
||||
creatureTemplate.unit_flags2 = fields[30].GetUInt32();
|
||||
creatureTemplate.unit_flags3 = fields[31].GetUInt32();
|
||||
creatureTemplate.dynamicflags = fields[32].GetUInt32();
|
||||
creatureTemplate.family = CreatureFamily(fields[33].GetUInt8());
|
||||
creatureTemplate.trainer_class = uint32(fields[34].GetUInt8());
|
||||
creatureTemplate.type = uint32(fields[35].GetUInt8());
|
||||
creatureTemplate.type_flags = fields[36].GetUInt32();
|
||||
creatureTemplate.type_flags2 = fields[37].GetUInt32();
|
||||
creatureTemplate.lootid = fields[38].GetUInt32();
|
||||
creatureTemplate.pickpocketLootId = fields[39].GetUInt32();
|
||||
creatureTemplate.SkinLootId = fields[40].GetUInt32();
|
||||
|
||||
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
creatureTemplate.resistance[i] = fields[45 + i - 1].GetInt16();
|
||||
creatureTemplate.resistance[i] = fields[41 + i - 1].GetInt16();
|
||||
|
||||
for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i)
|
||||
creatureTemplate.spells[i] = fields[51 + i].GetUInt32();
|
||||
creatureTemplate.spells[i] = fields[47 + i].GetUInt32();
|
||||
|
||||
creatureTemplate.VehicleId = fields[59].GetUInt32();
|
||||
creatureTemplate.mingold = fields[60].GetUInt32();
|
||||
creatureTemplate.maxgold = fields[61].GetUInt32();
|
||||
creatureTemplate.AIName = fields[62].GetString();
|
||||
creatureTemplate.MovementType = uint32(fields[63].GetUInt8());
|
||||
creatureTemplate.InhabitType = uint32(fields[64].GetUInt8());
|
||||
creatureTemplate.HoverHeight = fields[65].GetFloat();
|
||||
creatureTemplate.ModHealth = fields[66].GetFloat();
|
||||
creatureTemplate.ModHealthExtra = fields[67].GetFloat();
|
||||
creatureTemplate.ModMana = fields[68].GetFloat();
|
||||
creatureTemplate.ModManaExtra = fields[69].GetFloat();
|
||||
creatureTemplate.ModArmor = fields[70].GetFloat();
|
||||
creatureTemplate.ModDamage = fields[71].GetFloat();
|
||||
creatureTemplate.ModExperience = fields[72].GetFloat();
|
||||
creatureTemplate.RacialLeader = fields[73].GetBool();
|
||||
creatureTemplate.movementId = fields[74].GetUInt32();
|
||||
creatureTemplate.RegenHealth = fields[75].GetBool();
|
||||
creatureTemplate.MechanicImmuneMask = fields[76].GetUInt32();
|
||||
creatureTemplate.flags_extra = fields[77].GetUInt32();
|
||||
creatureTemplate.ScriptID = GetScriptId(fields[78].GetString());
|
||||
creatureTemplate.VehicleId = fields[55].GetUInt32();
|
||||
creatureTemplate.mingold = fields[56].GetUInt32();
|
||||
creatureTemplate.maxgold = fields[57].GetUInt32();
|
||||
creatureTemplate.AIName = fields[58].GetString();
|
||||
creatureTemplate.MovementType = uint32(fields[59].GetUInt8());
|
||||
creatureTemplate.InhabitType = uint32(fields[60].GetUInt8());
|
||||
creatureTemplate.HoverHeight = fields[61].GetFloat();
|
||||
creatureTemplate.ModHealth = fields[62].GetFloat();
|
||||
creatureTemplate.ModHealthExtra = fields[63].GetFloat();
|
||||
creatureTemplate.ModMana = fields[64].GetFloat();
|
||||
creatureTemplate.ModManaExtra = fields[65].GetFloat();
|
||||
creatureTemplate.ModArmor = fields[66].GetFloat();
|
||||
creatureTemplate.ModDamage = fields[67].GetFloat();
|
||||
creatureTemplate.ModExperience = fields[68].GetFloat();
|
||||
creatureTemplate.RacialLeader = fields[69].GetBool();
|
||||
creatureTemplate.movementId = fields[70].GetUInt32();
|
||||
creatureTemplate.RegenHealth = fields[71].GetBool();
|
||||
creatureTemplate.MechanicImmuneMask = fields[72].GetUInt32();
|
||||
creatureTemplate.flags_extra = fields[73].GetUInt32();
|
||||
creatureTemplate.ScriptID = GetScriptId(fields[74].GetString());
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadCreatureTemplateModels()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT CreatureID, CreatureDisplayID, DisplayScale, Probability FROM creature_template_model ORDER BY Idx ASC");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
TC_LOG_INFO("server.loading", ">> Loaded 0 creature template model definitions. DB table `creature_template_model` is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 count = 0;
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 creatureId = fields[0].GetUInt32();
|
||||
uint32 creatureDisplayId = fields[1].GetUInt32();
|
||||
float displayScale = fields[2].GetFloat();
|
||||
float probability = fields[3].GetFloat();
|
||||
|
||||
CreatureTemplate const* cInfo = GetCreatureTemplate(creatureId);
|
||||
if (!cInfo)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature template (Entry: %u) does not exist but has a record in `creature_template_model`", creatureId);
|
||||
continue;
|
||||
}
|
||||
|
||||
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(creatureDisplayId);
|
||||
if (!displayEntry)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists non-existing CreatureDisplayID id (%u), this can crash the client.", creatureId, creatureDisplayId);
|
||||
continue;
|
||||
}
|
||||
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(creatureDisplayId);
|
||||
if (!modelInfo)
|
||||
TC_LOG_ERROR("sql.sql", "No model data exist for `CreatureDisplayID` = %u listed by creature (Entry: %u).", creatureDisplayId, creatureId);
|
||||
|
||||
if (displayScale <= 0.0f)
|
||||
displayScale = 1.0f;
|
||||
|
||||
const_cast<CreatureTemplate*>(cInfo)->Models.emplace_back(creatureDisplayId, displayScale, probability);
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
TC_LOG_INFO("server.loading", ">> Loaded %u creature template models in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadCreatureTemplateAddons()
|
||||
@@ -860,76 +920,6 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
||||
const_cast<CreatureTemplate*>(cInfo)->faction = sFactionTemplateStore.AssertEntry(35)->ID; // this might seem stupid but all shit will would break if faction 35 did not exist
|
||||
}
|
||||
|
||||
// used later for scale
|
||||
CreatureDisplayInfoEntry const* displayScaleEntry = nullptr;
|
||||
|
||||
if (cInfo->Modelid1)
|
||||
{
|
||||
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid1);
|
||||
if (!displayEntry)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists non-existing Modelid1 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid1);
|
||||
const_cast<CreatureTemplate*>(cInfo)->Modelid1 = 0;
|
||||
}
|
||||
else
|
||||
displayScaleEntry = displayEntry;
|
||||
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid1);
|
||||
if (!modelInfo)
|
||||
TC_LOG_ERROR("sql.sql", "No model data exist for `Modelid1` = %u listed by creature (Entry: %u).", cInfo->Modelid1, cInfo->Entry);
|
||||
}
|
||||
|
||||
if (cInfo->Modelid2)
|
||||
{
|
||||
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid2);
|
||||
if (!displayEntry)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists non-existing Modelid2 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid2);
|
||||
const_cast<CreatureTemplate*>(cInfo)->Modelid2 = 0;
|
||||
}
|
||||
else if (!displayScaleEntry)
|
||||
displayScaleEntry = displayEntry;
|
||||
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2);
|
||||
if (!modelInfo)
|
||||
TC_LOG_ERROR("sql.sql", "No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry);
|
||||
}
|
||||
|
||||
if (cInfo->Modelid3)
|
||||
{
|
||||
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid3);
|
||||
if (!displayEntry)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists non-existing Modelid3 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid3);
|
||||
const_cast<CreatureTemplate*>(cInfo)->Modelid3 = 0;
|
||||
}
|
||||
else if (!displayScaleEntry)
|
||||
displayScaleEntry = displayEntry;
|
||||
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid3);
|
||||
if (!modelInfo)
|
||||
TC_LOG_ERROR("sql.sql", "No model data exist for `Modelid3` = %u listed by creature (Entry: %u).", cInfo->Modelid3, cInfo->Entry);
|
||||
}
|
||||
|
||||
if (cInfo->Modelid4)
|
||||
{
|
||||
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid4);
|
||||
if (!displayEntry)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists non-existing Modelid4 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid4);
|
||||
const_cast<CreatureTemplate*>(cInfo)->Modelid4 = 0;
|
||||
}
|
||||
else if (!displayScaleEntry)
|
||||
displayScaleEntry = displayEntry;
|
||||
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4);
|
||||
if (!modelInfo)
|
||||
TC_LOG_ERROR("sql.sql", "No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry);
|
||||
}
|
||||
|
||||
if (!displayScaleEntry)
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) does not have any existing display id in Modelid1/Modelid2/Modelid3/Modelid4.", cInfo->Entry);
|
||||
|
||||
for (uint8 k = 0; k < MAX_KILL_CREDIT; ++k)
|
||||
{
|
||||
if (cInfo->KillCredit[k])
|
||||
@@ -942,6 +932,11 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if (!cInfo->Models.size())
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) does not have any existing display id in creature_template_model.", cInfo->Entry);
|
||||
else if (std::accumulate(cInfo->Models.begin(), cInfo->Models.end(), 0.0f, [](float sum, CreatureModel const& model) { return sum + model.Probability; }) <= 0.0f)
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has zero total chance for all models in creature_template_model.", cInfo->Entry);
|
||||
|
||||
if (!cInfo->unit_class || ((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 0)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has invalid unit_class (%u) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class);
|
||||
@@ -1022,15 +1017,6 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
||||
const_cast<CreatureTemplate*>(cInfo)->MovementType = IDLE_MOTION_TYPE;
|
||||
}
|
||||
|
||||
/// if not set custom creature scale then load scale from CreatureDisplayInfo.dbc
|
||||
if (cInfo->scale <= 0.0f)
|
||||
{
|
||||
if (displayScaleEntry)
|
||||
const_cast<CreatureTemplate*>(cInfo)->scale = displayScaleEntry->CreatureModelScale;
|
||||
else
|
||||
const_cast<CreatureTemplate*>(cInfo)->scale = 1.0f;
|
||||
}
|
||||
|
||||
if (cInfo->HealthScalingExpansion < EXPANSION_LEVEL_CURRENT || cInfo->HealthScalingExpansion > (MAX_EXPANSIONS - 1))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature_template` lists creature (ID: %u) with invalid `HealthScalingExpansion` %i. Ignored and set to 0.", cInfo->Entry, cInfo->HealthScalingExpansion);
|
||||
@@ -1402,14 +1388,16 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data /*= nullptr*/)
|
||||
CreatureModel const* ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data /*= nullptr*/)
|
||||
{
|
||||
// Load creature model (display id)
|
||||
if (data && data->displayid)
|
||||
return data->displayid;
|
||||
if (CreatureModel const* model = cinfo->GetModelWithDisplayId(data->displayid))
|
||||
return model;
|
||||
|
||||
if (!(cinfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER))
|
||||
return cinfo->GetRandomValidModelId();
|
||||
if (CreatureModel const* model = cinfo->GetRandomValidModel())
|
||||
return model;
|
||||
|
||||
// Triggers by default receive the invisible model
|
||||
return cinfo->GetFirstInvisibleModel();
|
||||
@@ -1442,9 +1430,9 @@ void ObjectMgr::ChooseCreatureFlags(CreatureTemplate const* cInfo, uint64& npcFl
|
||||
}
|
||||
}
|
||||
|
||||
CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* displayID) const
|
||||
CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(CreatureModel* model, CreatureTemplate const* creatureTemplate) const
|
||||
{
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(*displayID);
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(model->CreatureDisplayID);
|
||||
if (!modelInfo)
|
||||
return nullptr;
|
||||
|
||||
@@ -1453,11 +1441,20 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* display
|
||||
{
|
||||
CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(modelInfo->displayId_other_gender);
|
||||
if (!minfo_tmp)
|
||||
TC_LOG_ERROR("sql.sql", "Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->displayId_other_gender);
|
||||
TC_LOG_ERROR("sql.sql", "Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", model->CreatureDisplayID, modelInfo->displayId_other_gender);
|
||||
else
|
||||
{
|
||||
// DisplayID changed
|
||||
*displayID = modelInfo->displayId_other_gender;
|
||||
model->CreatureDisplayID = modelInfo->displayId_other_gender;
|
||||
if (creatureTemplate)
|
||||
{
|
||||
auto itr = std::find_if(creatureTemplate->Models.begin(), creatureTemplate->Models.end(), [&](CreatureModel const& templateModel)
|
||||
{
|
||||
return templateModel.CreatureDisplayID == modelInfo->displayId_other_gender;
|
||||
});
|
||||
if (itr != creatureTemplate->Models.end())
|
||||
*model = *itr;
|
||||
}
|
||||
return minfo_tmp;
|
||||
}
|
||||
}
|
||||
@@ -3492,13 +3489,13 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
uint32 raceMask = fields[0].GetUInt32();
|
||||
uint64 raceMask = fields[0].GetUInt64();
|
||||
uint32 classMask = fields[1].GetUInt32();
|
||||
uint32 spellId = fields[2].GetUInt32();
|
||||
|
||||
if (raceMask != 0 && !(raceMask & RACEMASK_ALL_PLAYABLE))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Wrong race mask %u in `playercreateinfo_spell_custom` table, ignoring.", raceMask);
|
||||
TC_LOG_ERROR("sql.sql", "Wrong race mask " UI64FMTD " in `playercreateinfo_spell_custom` table, ignoring.", raceMask);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3510,7 +3507,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
|
||||
for (uint32 raceIndex = RACE_HUMAN; raceIndex < MAX_RACES; ++raceIndex)
|
||||
{
|
||||
if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
|
||||
if (raceMask == 0 || ((UI64LIT(1) << (raceIndex - 1)) & raceMask))
|
||||
{
|
||||
for (uint32 classIndex = CLASS_WARRIOR; classIndex < MAX_CLASSES; ++classIndex)
|
||||
{
|
||||
@@ -3552,13 +3549,13 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
uint32 raceMask = fields[0].GetUInt32();
|
||||
uint64 raceMask = fields[0].GetUInt64();
|
||||
uint32 classMask = fields[1].GetUInt32();
|
||||
uint32 spellId = fields[2].GetUInt32();
|
||||
|
||||
if (raceMask != 0 && !(raceMask & RACEMASK_ALL_PLAYABLE))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Wrong race mask %u in `playercreateinfo_cast_spell` table, ignoring.", raceMask);
|
||||
TC_LOG_ERROR("sql.sql", "Wrong race mask " UI64FMTD " in `playercreateinfo_cast_spell` table, ignoring.", raceMask);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3570,7 +3567,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
|
||||
for (uint32 raceIndex = RACE_HUMAN; raceIndex < MAX_RACES; ++raceIndex)
|
||||
{
|
||||
if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
|
||||
if (raceMask == 0 || ((UI64LIT(1) << (raceIndex - 1)) & raceMask))
|
||||
{
|
||||
for (uint32 classIndex = CLASS_WARRIOR; classIndex < MAX_CLASSES; ++classIndex)
|
||||
{
|
||||
@@ -3924,35 +3921,35 @@ void ObjectMgr::LoadQuests()
|
||||
mExclusiveQuestGroups.clear();
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT "
|
||||
//0 1 2 3 4 5 6 7 8 9 10 11
|
||||
"ID, QuestType, QuestLevel, MaxScalingLevel, QuestPackageID, MinLevel, QuestSortID, QuestInfoID, SuggestedGroupNum, RewardNextQuest, RewardXPDifficulty, RewardXPMultiplier, "
|
||||
//12 13 14 15 16 17 18 19 20 21 22
|
||||
//0 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
"ID, QuestType, QuestLevel, ScalingFactionGroup, MaxScalingLevel, QuestPackageID, MinLevel, QuestSortID, QuestInfoID, SuggestedGroupNum, RewardNextQuest, RewardXPDifficulty, RewardXPMultiplier, "
|
||||
//13 14 15 16 17 18 19 20 21 22 23
|
||||
"RewardMoney, RewardMoneyDifficulty, RewardMoneyMultiplier, RewardBonusMoney, RewardDisplaySpell1, RewardDisplaySpell2, RewardDisplaySpell3, RewardSpell, RewardHonor, RewardKillHonor, StartItem, "
|
||||
//23 24 25 26 27
|
||||
"RewardArtifactXPDifficulty, RewardArtifactXPMultiplier, RewardArtifactCategoryID, Flags, FlagsEx, "
|
||||
//28 29 30 31 32 33 34 35
|
||||
//24 25 26 27 28 29
|
||||
"RewardArtifactXPDifficulty, RewardArtifactXPMultiplier, RewardArtifactCategoryID, Flags, FlagsEx, FlagsEx2, "
|
||||
//30 31 32 33 34 35 36 37
|
||||
"RewardItem1, RewardAmount1, ItemDrop1, ItemDropQuantity1, RewardItem2, RewardAmount2, ItemDrop2, ItemDropQuantity2, "
|
||||
//36 37 38 39 40 41 42 43
|
||||
//38 39 40 41 42 43 44 45
|
||||
"RewardItem3, RewardAmount3, ItemDrop3, ItemDropQuantity3, RewardItem4, RewardAmount4, ItemDrop4, ItemDropQuantity4, "
|
||||
//44 45 46 47 48 49
|
||||
//46 47 48 49 50 51
|
||||
"RewardChoiceItemID1, RewardChoiceItemQuantity1, RewardChoiceItemDisplayID1, RewardChoiceItemID2, RewardChoiceItemQuantity2, RewardChoiceItemDisplayID2, "
|
||||
//50 51 52 53 54 55
|
||||
//52 53 54 55 56 57
|
||||
"RewardChoiceItemID3, RewardChoiceItemQuantity3, RewardChoiceItemDisplayID3, RewardChoiceItemID4, RewardChoiceItemQuantity4, RewardChoiceItemDisplayID4, "
|
||||
//56 57 58 59 60 61
|
||||
//58 59 60 61 62 63
|
||||
"RewardChoiceItemID5, RewardChoiceItemQuantity5, RewardChoiceItemDisplayID5, RewardChoiceItemID6, RewardChoiceItemQuantity6, RewardChoiceItemDisplayID6, "
|
||||
//62 63 64 65 66 67 68 69 70 71
|
||||
"POIContinent, POIx, POIy, POIPriority, RewardTitle, RewardArenaPoints, RewardSkillLineID, RewardNumSkillUps, PortraitGiver, PortraitTurnIn, "
|
||||
//72 73 74 75 76 77 78 79
|
||||
//64 65 66 67 68 69 70 71 72 73 74
|
||||
"POIContinent, POIx, POIy, POIPriority, RewardTitle, RewardArenaPoints, RewardSkillLineID, RewardNumSkillUps, PortraitGiver, PortraitGiverMount, PortraitTurnIn, "
|
||||
//75 76 77 78 79 80 81 82
|
||||
"RewardFactionID1, RewardFactionValue1, RewardFactionOverride1, RewardFactionCapIn1, RewardFactionID2, RewardFactionValue2, RewardFactionOverride2, RewardFactionCapIn2, "
|
||||
//80 81 82 83 84 85 86 87
|
||||
//83 84 85 86 87 88 89 90
|
||||
"RewardFactionID3, RewardFactionValue3, RewardFactionOverride3, RewardFactionCapIn3, RewardFactionID4, RewardFactionValue4, RewardFactionOverride4, RewardFactionCapIn4, "
|
||||
//88 89 90 91 92
|
||||
//91 92 93 94 95
|
||||
"RewardFactionID5, RewardFactionValue5, RewardFactionOverride5, RewardFactionCapIn5, RewardFactionFlags, "
|
||||
//93 94 95 96 97 98 99 100
|
||||
//96 97 98 99 100 101 102 103
|
||||
"RewardCurrencyID1, RewardCurrencyQty1, RewardCurrencyID2, RewardCurrencyQty2, RewardCurrencyID3, RewardCurrencyQty3, RewardCurrencyID4, RewardCurrencyQty4, "
|
||||
//101 102 103 104 105 106 107
|
||||
"AcceptedSoundKitID, CompleteSoundKitID, AreaGroupID, TimeAllowed, AllowableRaces, QuestRewardID, Expansion, "
|
||||
//108 109 110 111 112 113 114 115 116
|
||||
//104 105 106 107 108 109 110
|
||||
"AcceptedSoundKitID, CompleteSoundKitID, AreaGroupID, TimeAllowed, AllowableRaces, TreasurePickerID, Expansion, "
|
||||
//111 112 113 114 115 116 117 118 119
|
||||
"LogTitle, LogDescription, QuestDescription, AreaDescription, PortraitGiverText, PortraitGiverName, PortraitTurnInText, PortraitTurnInName, QuestCompletionLog"
|
||||
" FROM quest_template");
|
||||
if (!result)
|
||||
@@ -6174,7 +6171,7 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui
|
||||
if (!node || node->ContinentID != mapid || !(node->Flags & requireFlag))
|
||||
continue;
|
||||
|
||||
uint8 field = (uint8)((node->ID - 1) / 8);
|
||||
uint32 field = uint32((node->ID - 1) / 8);
|
||||
uint32 submask = 1 << ((node->ID - 1) % 8);
|
||||
|
||||
// skip not taxi network nodes
|
||||
@@ -6227,7 +6224,8 @@ void ObjectMgr::GetTaxiPath(uint32 source, uint32 destination, uint32 &path, uin
|
||||
|
||||
uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt_team /* = false */)
|
||||
{
|
||||
uint32 mount_id = 0;
|
||||
CreatureModel mountModel;
|
||||
CreatureTemplate const* mount_info = nullptr;
|
||||
|
||||
// select mount creature id
|
||||
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(id);
|
||||
@@ -6247,22 +6245,23 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt
|
||||
mount_entry = team == ALLIANCE ? node->MountCreatureID[0] : node->MountCreatureID[1];
|
||||
}
|
||||
|
||||
CreatureTemplate const* mount_info = GetCreatureTemplate(mount_entry);
|
||||
mount_info = GetCreatureTemplate(mount_entry);
|
||||
if (mount_info)
|
||||
{
|
||||
mount_id = mount_info->GetRandomValidModelId();
|
||||
if (!mount_id)
|
||||
CreatureModel const* model = mount_info->GetRandomValidModel();
|
||||
if (!model)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry);
|
||||
return 0;
|
||||
}
|
||||
mountModel = *model;
|
||||
}
|
||||
}
|
||||
|
||||
// minfo is not actually used but the mount_id was updated
|
||||
GetCreatureModelRandomGender(&mount_id);
|
||||
GetCreatureModelRandomGender(&mountModel, mount_info);
|
||||
|
||||
return mount_id;
|
||||
return mountModel.CreatureDisplayID;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadGraveyardZones()
|
||||
@@ -7027,8 +7026,8 @@ void ObjectMgr::LoadGameObjectTemplate()
|
||||
"Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11, Data12, "
|
||||
// 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
||||
"Data13, Data14, Data15, Data16, Data17, Data18, Data19, Data20, Data21, Data22, Data23, Data24, Data25, Data26, Data27, Data28, "
|
||||
// 37 38 39 40 41 42 43
|
||||
"Data29, Data30, Data31, Data32, RequiredLevel, AIName, ScriptName "
|
||||
// 37 38 39 40 41 42 43 44
|
||||
"Data29, Data30, Data31, Data32, Data33, RequiredLevel, AIName, ScriptName "
|
||||
"FROM gameobject_template");
|
||||
|
||||
if (!result)
|
||||
@@ -7058,9 +7057,9 @@ void ObjectMgr::LoadGameObjectTemplate()
|
||||
for (uint8 i = 0; i < MAX_GAMEOBJECT_DATA; ++i)
|
||||
got.raw.data[i] = fields[8 + i].GetUInt32();
|
||||
|
||||
got.RequiredLevel = fields[41].GetInt32();
|
||||
got.AIName = fields[42].GetString();
|
||||
got.ScriptId = GetScriptId(fields[43].GetString());
|
||||
got.RequiredLevel = fields[42].GetInt32();
|
||||
got.AIName = fields[43].GetString();
|
||||
got.ScriptId = GetScriptId(fields[44].GetString());
|
||||
|
||||
// Checks
|
||||
|
||||
@@ -7696,8 +7695,8 @@ void ObjectMgr::LoadQuestPOI()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
||||
QueryResult result = WorldDatabase.Query("SELECT QuestID, BlobIndex, Idx1, ObjectiveIndex, QuestObjectiveID, QuestObjectID, MapID, WorldMapAreaId, Floor, Priority, Flags, WorldEffectID, PlayerConditionID, WoDUnk1, AlwaysAllowMergingBlobs FROM quest_poi order by QuestID, Idx1");
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
QueryResult result = WorldDatabase.Query("SELECT QuestID, BlobIndex, Idx1, ObjectiveIndex, QuestObjectiveID, QuestObjectID, MapID, UiMapID, Priority, Flags, WorldEffectID, PlayerConditionID, SpawnTrackingID, AlwaysAllowMergingBlobs FROM quest_poi order by QuestID, Idx1");
|
||||
if (!result)
|
||||
{
|
||||
TC_LOG_ERROR("server.loading", ">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty.");
|
||||
@@ -7737,33 +7736,32 @@ void ObjectMgr::LoadQuestPOI()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
int32 QuestID = fields[0].GetInt32();
|
||||
int32 BlobIndex = fields[1].GetInt32();
|
||||
int32 Idx1 = fields[2].GetInt32();
|
||||
int32 ObjectiveIndex = fields[3].GetInt32();
|
||||
int32 QuestObjectiveID = fields[4].GetInt32();
|
||||
int32 QuestObjectID = fields[5].GetInt32();
|
||||
int32 MapID = fields[6].GetInt32();
|
||||
int32 WorldMapAreaId = fields[7].GetInt32();
|
||||
int32 Floor = fields[8].GetInt32();
|
||||
int32 Priority = fields[9].GetInt32();
|
||||
int32 Flags = fields[10].GetInt32();
|
||||
int32 WorldEffectID = fields[11].GetInt32();
|
||||
int32 PlayerConditionID = fields[12].GetInt32();
|
||||
int32 WoDUnk1 = fields[13].GetInt32();
|
||||
bool AlwaysAllowMergingBlobs = fields[14].GetBool();
|
||||
int32 questID = fields[0].GetInt32();
|
||||
int32 blobIndex = fields[1].GetInt32();
|
||||
int32 idx1 = fields[2].GetInt32();
|
||||
int32 objectiveIndex = fields[3].GetInt32();
|
||||
int32 questObjectiveID = fields[4].GetInt32();
|
||||
int32 questObjectID = fields[5].GetInt32();
|
||||
int32 mapID = fields[6].GetInt32();
|
||||
int32 uiMapID = fields[7].GetInt32();
|
||||
int32 priority = fields[8].GetInt32();
|
||||
int32 flags = fields[9].GetInt32();
|
||||
int32 worldEffectID = fields[10].GetInt32();
|
||||
int32 playerConditionID = fields[11].GetInt32();
|
||||
int32 spawnTrackingID = fields[12].GetInt32();
|
||||
bool alwaysAllowMergingBlobs = fields[13].GetBool();
|
||||
|
||||
if (!sObjectMgr->GetQuestTemplate(QuestID))
|
||||
TC_LOG_ERROR("sql.sql", "`quest_poi` quest id (%u) Idx1 (%u) does not exist in `quest_template`", QuestID, Idx1);
|
||||
if (!sObjectMgr->GetQuestTemplate(questID))
|
||||
TC_LOG_ERROR("sql.sql", "`quest_poi` quest id (%u) Idx1 (%u) does not exist in `quest_template`", questID, idx1);
|
||||
|
||||
QuestPOI POI(BlobIndex, ObjectiveIndex, QuestObjectiveID, QuestObjectID, MapID, WorldMapAreaId, Floor, Priority, Flags, WorldEffectID, PlayerConditionID, WoDUnk1, AlwaysAllowMergingBlobs);
|
||||
if (QuestID < int32(POIs.size()) && Idx1 < int32(POIs[QuestID].size()))
|
||||
QuestPOI POI(blobIndex, objectiveIndex, questObjectiveID, questObjectID, mapID, uiMapID, priority, flags, worldEffectID, playerConditionID, spawnTrackingID, alwaysAllowMergingBlobs);
|
||||
if (questID < int32(POIs.size()) && idx1 < int32(POIs[questID].size()))
|
||||
{
|
||||
POI.points = POIs[QuestID][Idx1];
|
||||
_questPOIStore[QuestID].push_back(POI);
|
||||
POI.points = POIs[questID][idx1];
|
||||
_questPOIStore[questID].push_back(POI);
|
||||
}
|
||||
else
|
||||
TC_LOG_ERROR("sql.sql", "Table quest_poi references unknown quest points for quest %i POI id %i", QuestID, BlobIndex);
|
||||
TC_LOG_ERROR("sql.sql", "Table quest_poi references unknown quest points for quest %i POI id %i", questID, blobIndex);
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
@@ -8578,7 +8576,7 @@ void ObjectMgr::LoadMailLevelRewards()
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint8 level = fields[0].GetUInt8();
|
||||
uint32 raceMask = fields[1].GetUInt32();
|
||||
uint64 raceMask = fields[1].GetUInt64();
|
||||
uint32 mailTemplateId = fields[2].GetUInt32();
|
||||
uint32 senderEntry = fields[3].GetUInt32();
|
||||
|
||||
@@ -8590,7 +8588,7 @@ void ObjectMgr::LoadMailLevelRewards()
|
||||
|
||||
if (!(raceMask & RACEMASK_ALL_PLAYABLE))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `mail_level_reward` has raceMask (%u) for level %u that not include any player races, ignoring.", raceMask, level);
|
||||
TC_LOG_ERROR("sql.sql", "Table `mail_level_reward` has raceMask (" UI64FMTD ") for level %u that not include any player races, ignoring.", raceMask, level);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -8669,18 +8667,6 @@ void ObjectMgr::LoadTrainers()
|
||||
if (!allReqValid)
|
||||
continue;
|
||||
|
||||
spell.LearnedSpellId = spell.SpellId;
|
||||
for (SpellEffectInfo const* spellEffect : spellInfo->GetEffectsForDifficulty(DIFFICULTY_NONE))
|
||||
{
|
||||
if (spellEffect && spellEffect->IsEffect(SPELL_EFFECT_LEARN_SPELL))
|
||||
{
|
||||
ASSERT(spell.LearnedSpellId == spell.SpellId,
|
||||
"Only one learned spell is currently supported - spell %u already teaches %u but it tried to overwrite it with %u",
|
||||
spell.SpellId, spell.LearnedSpellId, spellEffect->TriggerSpell);
|
||||
spell.LearnedSpellId = spellEffect->TriggerSpell;
|
||||
}
|
||||
}
|
||||
|
||||
spellsByTrainer[trainerId].push_back(spell);
|
||||
|
||||
} while (trainerSpellsResult->NextRow());
|
||||
@@ -9282,8 +9268,8 @@ CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unit
|
||||
void ObjectMgr::LoadCreatureClassLevelStats()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11
|
||||
QueryResult result = WorldDatabase.Query("SELECT level, class, basemana, basearmor, attackpower, rangedattackpower, damage_base, damage_exp1, damage_exp2, damage_exp3, damage_exp4, damage_exp5 FROM creature_classlevelstats");
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult result = WorldDatabase.Query("SELECT level, class, basemana, basearmor, attackpower, rangedattackpower FROM creature_classlevelstats");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -9581,7 +9567,7 @@ void ObjectMgr::LoadTerrainWorldMaps()
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1
|
||||
QueryResult result = WorldDatabase.Query("SELECT TerrainSwapMap, WorldMapArea FROM `terrain_worldmap`");
|
||||
QueryResult result = WorldDatabase.Query("SELECT TerrainSwapMap, UiMapPhaseId FROM `terrain_worldmap`");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -9595,7 +9581,7 @@ void ObjectMgr::LoadTerrainWorldMaps()
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 mapId = fields[0].GetUInt32();
|
||||
uint32 worldMapArea = fields[1].GetUInt32();
|
||||
uint32 uiMapPhaseId = fields[1].GetUInt32();
|
||||
|
||||
if (!sMapStore.LookupEntry(mapId))
|
||||
{
|
||||
@@ -9603,15 +9589,15 @@ void ObjectMgr::LoadTerrainWorldMaps()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!sWorldMapAreaStore.LookupEntry(worldMapArea))
|
||||
if (!sDB2Manager.IsUiMapPhase(uiMapPhaseId))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "WorldMapArea %u defined in `terrain_worldmap` does not exist, skipped.", worldMapArea);
|
||||
TC_LOG_ERROR("sql.sql", "Phase %u defined in `terrain_worldmap` is not a valid terrain swap phase, skipped.", uiMapPhaseId);
|
||||
continue;
|
||||
}
|
||||
|
||||
TerrainSwapInfo* terrainSwapInfo = &_terrainSwapInfoById[mapId];
|
||||
terrainSwapInfo->Id = mapId;
|
||||
terrainSwapInfo->UiWorldMapAreaIDSwaps.push_back(worldMapArea);
|
||||
terrainSwapInfo->UiMapPhaseIDs.push_back(uiMapPhaseId);
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
@@ -9758,11 +9744,6 @@ TerrainSwapInfo const* ObjectMgr::GetTerrainSwapInfo(uint32 terrainSwapId) const
|
||||
return Trinity::Containers::MapGetValuePtr(_terrainSwapInfoById, terrainSwapId);
|
||||
}
|
||||
|
||||
std::vector<TerrainSwapInfo*> const* ObjectMgr::GetTerrainSwapsForMap(uint32 mapId) const
|
||||
{
|
||||
return Trinity::Containers::MapGetValuePtr(_terrainSwapInfoByMap, mapId);
|
||||
}
|
||||
|
||||
GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry) const
|
||||
{
|
||||
GameObjectTemplateContainer::const_iterator itr = _gameObjectTemplateStore.find(entry);
|
||||
@@ -10104,7 +10085,7 @@ void ObjectMgr::LoadPlayerChoices()
|
||||
uint32 oldMSTime = getMSTime();
|
||||
_playerChoices.clear();
|
||||
|
||||
QueryResult choices = WorldDatabase.Query("SELECT ChoiceId, UiTextureKitId, Question, HideWarboardHeader FROM playerchoice");
|
||||
QueryResult choices = WorldDatabase.Query("SELECT ChoiceId, UiTextureKitId, Question, HideWarboardHeader, KeepOpenAfterChoice FROM playerchoice");
|
||||
|
||||
if (!choices)
|
||||
{
|
||||
@@ -10129,10 +10110,11 @@ void ObjectMgr::LoadPlayerChoices()
|
||||
choice.UiTextureKitId = fields[1].GetInt32();
|
||||
choice.Question = fields[2].GetString();
|
||||
choice.HideWarboardHeader = fields[3].GetBool();
|
||||
choice.KeepOpenAfterChoice = fields[4].GetBool();
|
||||
|
||||
} while (choices->NextRow());
|
||||
|
||||
if (QueryResult responses = WorldDatabase.Query("SELECT ChoiceId, ResponseId, ChoiceArtFileId, Header, Answer, Description, Confirmation FROM playerchoice_response ORDER BY `Index` ASC"))
|
||||
if (QueryResult responses = WorldDatabase.Query("SELECT ChoiceId, ResponseId, ChoiceArtFileId, Flags, WidgetSetID, GroupID, Header, Answer, Description, Confirmation FROM playerchoice_response ORDER BY `Index` ASC"))
|
||||
{
|
||||
do
|
||||
{
|
||||
@@ -10153,10 +10135,13 @@ void ObjectMgr::LoadPlayerChoices()
|
||||
PlayerChoiceResponse& response = choice->Responses.back();
|
||||
response.ResponseId = responseId;
|
||||
response.ChoiceArtFileId = fields[2].GetInt32();
|
||||
response.Header = fields[3].GetString();
|
||||
response.Answer = fields[4].GetString();
|
||||
response.Description = fields[5].GetString();
|
||||
response.Confirmation = fields[6].GetString();
|
||||
response.Flags = fields[3].GetInt32();
|
||||
response.WidgetSetID = fields[4].GetUInt32();
|
||||
response.GroupID = fields[5].GetUInt8();
|
||||
response.Header = fields[6].GetString();
|
||||
response.Answer = fields[7].GetString();
|
||||
response.Description = fields[8].GetString();
|
||||
response.Confirmation = fields[9].GetString();
|
||||
++responseCount;
|
||||
|
||||
} while (responses->NextRow());
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user