blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 2
247
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
57
| license_type
stringclasses 2
values | repo_name
stringlengths 4
111
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
58
| visit_date
timestamp[ns]date 2015-07-25 18:16:41
2023-09-06 10:45:08
| revision_date
timestamp[ns]date 1970-01-14 14:03:36
2023-09-06 06:22:19
| committer_date
timestamp[ns]date 1970-01-14 14:03:36
2023-09-06 06:22:19
| github_id
int64 3.89k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 25
values | gha_event_created_at
timestamp[ns]date 2012-06-07 00:51:45
2023-09-14 21:58:52
⌀ | gha_created_at
timestamp[ns]date 2008-03-27 23:40:48
2023-08-24 19:49:39
⌀ | gha_language
stringclasses 159
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
10.5M
| extension
stringclasses 111
values | filename
stringlengths 1
195
| text
stringlengths 7
10.5M
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5969c8d5535bf0dceae64957e282a27095ea4dcb
|
65c8d78de22bc1f933cca06e8981f1dae756f3db
|
/Chapter 14/Handle.cpp
|
1bf4e54908312e6839b672e4fadac9901ba252dc
|
[] |
no_license
|
iStephenKing/AcceleratedCpp
|
119b017aebe44851cce065019639927b1d480a40
|
578ca1fbfb72cfac473c813a086aa6cfc61bb7cb
|
refs/heads/master
| 2021-01-20T12:15:54.911478
| 2017-12-13T14:01:34
| 2017-12-13T14:01:34
| 101,706,078
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 99
|
cpp
|
Handle.cpp
|
//
// Handle.cpp
//
//
// Created by Stephen King on 12/12/17.
//
//
#include "Handle.hpp"
|
09fbf5a300683d8be89ff4c553477bd351313611
|
1f2f7e4203b5548f2d2ebf203685dd9a802e9331
|
/ACW Project Framework/Model.h
|
561612954af492cd3e98d89f4a91962be25ea2f4
|
[
"MIT"
] |
permissive
|
Lentono/PhysicsSimulationACW
|
fa0020a0ee5e41753dd5c6304111d2d1e7a15165
|
a73d22571a0742fd960740f04689f6ee095c3986
|
refs/heads/master
| 2020-05-02T15:31:33.304214
| 2019-03-27T17:50:47
| 2019-03-27T17:50:47
| 178,043,597
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 961
|
h
|
Model.h
|
#pragma once
#include <d3d11.h>
#include <DirectXMath.h>
#include <vector>
#include <fstream>
#include "Texture.h"
#include "ResourceManager.h"
using namespace DirectX;
using namespace std;
class Model
{
public:
enum ModelType
{
Sphere,
Cube,
Plane,
Cylinder
};
Model(ID3D11Device* device, ModelType modelType, ResourceManager* resourceManager);
Model(const Model& other); // Copy Constructor
Model(Model && other) noexcept; // Move Constructor
~Model(); // Destructor
Model& operator = (const Model& other); // Copy Assignment Operator
Model& operator = (Model&& other) noexcept; // Move Assignment Operator
void Render(ID3D11DeviceContext* deviceContext);
bool GetInitializationState() const;
int GetIndexCount() const;
ModelType GetModelType() const;
private:
bool m_initializationFailed;
int m_sizeOfVertexType;
int m_indexCount;
ModelType m_modelType;
ID3D11Buffer *m_vertexBuffer;
ID3D11Buffer *m_indexBuffer;
};
|
5072ebc035c409437fb771d2b6b47e493959f87d
|
aa21ed74ee6c52fca89f3ea8a7fd99d096626fe6
|
/sourceCode/myTracer.h
|
6adadf8b4ffd50d63ddb64f9e5390869b711dd47
|
[] |
no_license
|
ccyyljj/collector
|
0ee8a61d59fc0e7ff7b04df1159a31657a3fdf64
|
ad3ee182fc4835b3d4a15a595e97f9a8cc041e18
|
refs/heads/master
| 2020-04-23T14:20:02.784671
| 2019-02-20T01:47:28
| 2019-02-20T01:47:28
| 171,228,136
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 884
|
h
|
myTracer.h
|
#ifndef MYTRACER_H
#define MYTRACER_H
#include <QObject>
#include "qcustomplot.h"
class MyTracer : public QObject
{
Q_OBJECT
public:
enum TracerType
{
XAxisTracer,
YAxisTracer,
DataTracer,
CrossLine
};
explicit MyTracer(QCustomPlot *_plot, TracerType _type, QObject *parent = nullptr);
~MyTracer();
void setPen(const QPen &pen);
void setBrush(const QBrush &brush);
void setText(const QString &text);
void setLabelPen(const QPen &pen);
void updatePosition(double xValue, double yValue);
protected:
void setVisible(bool visible);
protected:
QCustomPlot *plot = nullptr;
QCPItemTracer *tracer = nullptr;// 跟踪的点
QCPItemText *label = nullptr; // 显示的数值
QCPItemLine *arrow = nullptr; // 箭头
QCPItemStraightLine *line = nullptr; //无限延长的直线
TracerType type = DataTracer;
bool visible = false;
};
#endif // MYTRACER_H
|
7c018bc521ecc155e3e00e1f2a9b38b5a8a9bf7e
|
cd9d3171fbe3002c25e57975913202744c4b360b
|
/ROS/src/hexapod_app/old_cpp/HexapodFrameListener.cpp
|
763621499f3e9cb266b412e7736a99a331f1b7fa
|
[
"MIT"
] |
permissive
|
jeremygold/hexapod
|
b6ecfa74cd7fd5e568dc063482850a51c17a2bdf
|
ffbe24c504504cdebb5fbc0f6d5b31c61a453902
|
refs/heads/master
| 2021-07-08T07:51:21.865420
| 2017-10-05T08:26:25
| 2017-10-05T08:26:25
| 105,865,304
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,204
|
cpp
|
HexapodFrameListener.cpp
|
#include "HexapodFrameListener.h"
#include "CrabCrawlLeft.h"
#include "CrabCrawlRight.h"
#include "ForwardLeft.h"
#include "ForwardRight.h"
#include "Jump.h"
#include "Pressup.h"
#include "Rock.h"
#include "RotateLeft.h"
#include "RotateRight.h"
#include "WalkBackwards.h"
#include "Walk.h"
////////////////////////////////////////////////////////////////////////////////
bool HexapodFrameListener::frameStarted(const FrameEvent &evt)
{
currentGait_->handleFrameCallback(robot_,evt);
return ExampleFrameListener::frameStarted(evt);
}
////////////////////////////////////////////////////////////////////////////////
bool HexapodFrameListener::processUnbufferedKeyInput(const FrameEvent& evt)
{
Real moveScale = mMoveScale;
//Real bodyRotate = 60.0 * evt.timeSinceLastFrame;
if(mKeyboard->isKeyDown(OIS::KC_LSHIFT))
moveScale *= 10;
if(mKeyboard->isKeyDown(OIS::KC_A))
mTranslateVector.x = -moveScale; // Move camera left
if(mKeyboard->isKeyDown(OIS::KC_D))
mTranslateVector.x = moveScale; // Move camera RIGHT
/*
if(mKeyboard->isKeyDown(OIS::KC_UP) || mKeyboard->isKeyDown(OIS::KC_W) )
bodyNode_->pitch(Degree(bodyRotate), Node::TS_LOCAL);
if(mKeyboard->isKeyDown(OIS::KC_DOWN) || mKeyboard->isKeyDown(OIS::KC_S) )
bodyNode_->pitch(-Degree(bodyRotate), Node::TS_LOCAL);
*/
if(mKeyboard->isKeyDown(OIS::KC_PGUP))
mTranslateVector.y = moveScale; // Move camera up
if(mKeyboard->isKeyDown(OIS::KC_PGDOWN))
mTranslateVector.y = -moveScale; // Move camera down
/*
if(mKeyboard->isKeyDown(OIS::KC_RIGHT))
bodyNode_->yaw(Degree(bodyRotate), Node::TS_LOCAL);
if(mKeyboard->isKeyDown(OIS::KC_LEFT))
bodyNode_->yaw(-Degree(bodyRotate), Node::TS_LOCAL);
*/
/*
if(mKeyboard->isKeyDown(OIS::KC_RIGHT))
mCamera->yaw(-mRotScale);
if(mKeyboard->isKeyDown(OIS::KC_LEFT))
mCamera->yaw(mRotScale);
*/
if( mKeyboard->isKeyDown(OIS::KC_NUMPAD8))
{
currentGait_ = Walk::instance();
}
if( mKeyboard->isKeyDown(OIS::KC_NUMPAD5))
{
currentGait_ = Pressup::instance();
}
if( mKeyboard->isKeyDown(OIS::KC_NUMPAD0))
{
currentGait_ = Rock::instance();
}
if( mKeyboard->isKeyDown(OIS::KC_NUMPAD9))
{
currentGait_ = ForwardRight::instance();
}
if( mKeyboard->isKeyDown(OIS::KC_NUMPAD7))
{
currentGait_ = ForwardLeft::instance();
}
if( mKeyboard->isKeyDown(OIS::KC_NUMPAD1))
{
currentGait_ = RotateLeft::instance();
}
if( mKeyboard->isKeyDown(OIS::KC_NUMPAD3))
{
currentGait_ = RotateRight::instance();
}
if( mKeyboard->isKeyDown(OIS::KC_NUMPAD2))
{
currentGait_ = WalkBackwards::instance();
}
if( mKeyboard->isKeyDown(OIS::KC_NUMPAD6))
{
currentGait_ = CrabCrawlRight::instance();
}
if( mKeyboard->isKeyDown(OIS::KC_NUMPAD4))
{
currentGait_ = CrabCrawlLeft::instance();
}
if( mKeyboard->isKeyDown(OIS::KC_ADD))
{
currentGait_ = Jump::instance();
}
if( mKeyboard->isKeyDown(OIS::KC_ESCAPE) || mKeyboard->isKeyDown(OIS::KC_Q) )
return false;
// Return true to continue rendering
return true;
}
////////////////////////////////////////////////////////////////////////////////
bool HexapodFrameListener::processUnbufferedMouseInput(const FrameEvent& evt)
{
// Rotation factors, may not be used if the second mouse button is pressed
// 2nd mouse button - slide, otherwise rotate
const OIS::MouseState &ms = mMouse->getMouseState();
if( ms.buttonDown( OIS::MB_Right ) )
{
mTranslateVector.x += ms.X.rel * 0.13;
mTranslateVector.y -= ms.Y.rel * 0.13;
}
else
{
mRotX = Degree(-ms.X.rel * 0.13);
mRotY = Degree(-ms.Y.rel * 0.13);
#if OGRE_PLATFORM == OGRE_PLATFORM_IPHONE
// Adjust the input depending upon viewport orientation
Radian origRotY, origRotX;
switch(mCamera->getViewport()->getOrientation())
{
case Viewport::OR_LANDSCAPELEFT:
origRotY = mRotY;
origRotX = mRotX;
mRotX = origRotY;
mRotY = -origRotX;
break;
case Viewport::OR_LANDSCAPERIGHT:
origRotY = mRotY;
origRotX = mRotX;
mRotX = -origRotY;
mRotY = origRotX;
break;
// Portrait doesn't need any change
case Viewport::OR_PORTRAIT:
default:
break;
}
#endif
}
return true;
}
////////////////////////////////////////////////////////////////////////////////
|
d7a6feeb414d8429a8595c688bdce9c588d1efe2
|
41ae2d97eac869c34881058db1b96a51c7e66067
|
/include/graphics/CubeMap.hpp
|
f3c91bf0d637c26c54098338683b94f52efc3247
|
[
"MIT"
] |
permissive
|
Guarneri1743/CPU-Rasterizer
|
815772f51ded129279ca5701225abb0ef92c0585
|
d7a7344e43d91ce575724cc1d121551e6008dc01
|
refs/heads/main
| 2023-09-03T15:48:37.640026
| 2021-10-30T03:32:24
| 2021-10-30T03:32:24
| 306,829,410
| 31
| 2
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,364
|
hpp
|
CubeMap.hpp
|
#pragma once
#include <memory>
#include <vector>
#include <string>
#include "Define.hpp"
#include "tinymath.h"
namespace CpuRasterizer
{
class Texture;
class CubeMap {
public:
CubeMap(const char* path);
void reload(const std::string& path);
bool sample(const tinymath::vec3f& dir, tinymath::Color& ret);
bool sample_irradiance_map(const tinymath::vec3f& dir, tinymath::Color& ret);
bool sample_prefilter_map(const tinymath::vec3f& dir, tinymath::Color& ret);
bool sample_prefilter_map_lod(const tinymath::vec3f& dir, float lod, tinymath::Color& ret);
bool sample_brdf(const tinymath::vec2f& uv, tinymath::Color& ret);
void precompute_ibl_textures();
void precompute_irradiance_map();
void precompute_prefilter_map(size_t mip);
void precompute_prefilter_map_fast(size_t mip);
void precompute_brdf_lut();
std::string texture_path;
std::string meta_path;
std::string name;
void copy_from(const CubeMap& cubemap);
static std::shared_ptr<CubeMap> load_asset(const char* path);
static std::shared_ptr<CubeMap> load_asset(std::string path);
static void spawn(std::string path, std::shared_ptr<CubeMap>& cubemap);
private:
std::shared_ptr<Texture> texture;
std::shared_ptr<Texture> irradiance_map;
std::vector<std::shared_ptr<Texture>> prefiltered_maps;
std::shared_ptr<Texture> brdf_lut;
private:
CubeMap();
};
}
|
499a531443aa787f2a53a261165f5b5c22c3b9ea
|
f3ed7845a11539950e0949af308e86c0350daed3
|
/lockfree/lockfree.hpp
|
1fbbb817db6d9a2da1f98d5b0224411988e7a963
|
[
"MIT"
] |
permissive
|
DNedic/lockfree
|
3d215f80b5631df5048348ddf42c6be368ceaa60
|
8495a38ac1b96b9f125aeee538cef6ea499f5438
|
refs/heads/main
| 2023-08-17T21:52:50.515921
| 2023-08-09T23:35:36
| 2023-08-09T23:35:36
| 638,640,063
| 495
| 24
|
MIT
| 2023-07-16T21:59:56
| 2023-05-09T19:30:50
|
C++
|
UTF-8
|
C++
| false
| false
| 2,302
|
hpp
|
lockfree.hpp
|
/**************************************************************
* @file lockfree.hpp
* @brief A collection of lock free data structures written in
* standard c++11 suitable for all systems, from low-end
* microcontrollers to HPC machines.
* @version 2.0.4
* @date 10. August 2023
* @author Djordje Nedic
**************************************************************/
/**************************************************************
* Copyright (c) 2023 Djordje Nedic
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, subject to the
* following conditions:
*
* The above copyright notice and this permission notice shall
* be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
* KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* This file is part of lockfree
*
* Author: Djordje Nedic <nedic.djordje2@gmail.com>
* Version: v2.0.4
**************************************************************/
#ifndef LOCKFREE_HPP
#define LOCKFREE_HPP
/************************** DEFINE ****************************/
#ifndef LOCKFREE_CACHE_COHERENT
#define LOCKFREE_CACHE_COHERENT true
#endif
#ifndef LOCKFREE_CACHELINE_LENGTH
#define LOCKFREE_CACHELINE_LENGTH 64U
#endif
/************************** INCLUDE ***************************/
#include "spsc/bipartite_buf.hpp"
#include "spsc/priority_queue.hpp"
#include "spsc/queue.hpp"
#include "spsc/ring_buf.hpp"
#include "mpmc/priority_queue.hpp"
#include "mpmc/queue.hpp"
#endif /* LOCKFREE_HPP */
|
4cb6aee3c2cbef90e39518358836037b4fe0d9df
|
f34384484f6bd0098e8cf6e359d89779a66d152b
|
/src/characters/character.cpp
|
6670066c12ba4996294ac717b20b8237f4272122
|
[] |
no_license
|
gofish543/ISUComS327
|
9a0d538183e556a99d2d29b648c87e4d519a19eb
|
295f4ec6a6182ee650a9187d9a3b26dd01416305
|
refs/heads/master
| 2020-04-17T01:58:24.175220
| 2019-04-17T21:30:04
| 2019-04-17T21:30:04
| 166,115,793
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,025
|
cpp
|
character.cpp
|
#include "character.h"
#include "../floor.h"
Character::Character(Floor* floor, u_char x, u_char y, u_char character, u_char speed, bool isPlayer, bool isMonster) {
this->floor = floor;
this->x = x;
this->y = y;
this->character = character;
this->speed = speed;
this->alive = true;
this->player = isPlayer;
this->monster = isMonster;
}
Character::~Character() = default;
Character* Character::killCharacter() {
this->alive = false;
return this;
}
bool Character::hasLineOfSightTo(u_char width, u_char height) {
Floor* floor = this->getFloor();
double slope;
double error = 0.0;
u_char x;
u_char y;
u_char x0 = this->getX();
u_char x1 = width;
u_char y0 = this->getY();
u_char y1 = height;
char deltaX = x1 - x0;
char deltaY = y1 - y0;
if (this->isPlayer()) {
// Player can only see so far
// Player* player = (Player*) this;
if (std::sqrt(deltaX * deltaX + deltaY * deltaY) > PLAYER_DEFAULT_LIGHT_RADIUS) {
return false;
}
if (abs(deltaX) >= PLAYER_DEFAULT_LIGHT_RADIUS) {
return false;
}
if (abs(deltaY) >= PLAYER_DEFAULT_LIGHT_RADIUS) {
return false;
}
}
if (!floor->getTerrainAt(width, height)->isWalkable()) {
return false;
}
if (deltaX == 0 && deltaY == 0) {
// Standing on the point
return true;
}
if (deltaX == 0) {
// If horizontal line
x = x0;
for (y = y0; y != y1; y += get_sign(deltaY)) {
if (!floor->getTerrainAt(x, y)->isWalkable()) {
return false;
}
}
return true;
} else if (deltaY == 0) {
// If vertical line
y = y0;
for (x = x0; x != x1; x += get_sign(deltaX)) {
if (!floor->getTerrainAt(x, y)->isWalkable()) {
return false;
}
}
return true;
} else {
slope = double(deltaY) / double(deltaX);
if (slope < 0) {
// DOWN TO LEFT || UP TO RIGHT //
if (deltaX > 0) {
// UP TO RIGHT //
y = y0;
for (x = x0; x < x1; x++) {
if (!floor->getTerrainAt(x, y)->isWalkable()) {
return false;
}
error += slope;
if (error <= -.50) {
y--;
error += 1.0;
}
}
// Burn through remaining Y until you reach it
for (; y > y1; y--) {
if (!floor->getTerrainAt(x, y)->isWalkable()) {
return false;
}
}
return true;
} else {
// DOWN TO LEFT //
y = y0;
for (x = x0; x > x1; x--) {
if (!floor->getTerrainAt(x, y)->isWalkable()) {
return false;
}
error += slope;
if (error <= -.50) {
y++;
error += 1.0;
}
}
// Burn through remaining Y until you reach it
for (; y < y1; y++) {
if (!floor->getTerrainAt(x, y)->isWalkable()) {
return false;
}
}
return true;
}
} else {
// DOWN TO RIGHT || UP TO LEFT //
if (deltaX > 0) {
// DOWN TO RIGHT //
y = y0;
for (x = x0; x < x1; x++) {
if (!floor->getTerrainAt(x, y)->isWalkable()) {
return false;
}
error += slope;
if (error >= .50) {
y++;
error -= 1.0;
}
}
// Burn through remaining Y until you reach it
for (; y < y1; y++) {
if (!floor->getTerrainAt(x, y)->isWalkable()) {
return false;
}
}
return true;
} else {
// UP TO LEFT //
y = y0;
for (x = x0; x > x1; x--) {
if (!floor->getTerrainAt(x, y)->isWalkable()) {
return false;
}
error += slope;
if (error >= .50) {
y--;
error -= 1.0;
}
}
// Burn through remaining Y until you reach it
for (; y > y1; y--) {
if (!floor->getTerrainAt(x, y)->isWalkable()) {
return false;
}
}
return true;
}
}
}
}
u_int Character::getColor() {
return EFD_COLOR_WHITE;
}
/** GETTERS **/
Floor* Character::getFloor() {
return this->floor;
}
u_char Character::getX() {
return this->x;
}
u_char Character::getY() {
return this->y;
}
u_char Character::getCharacter() {
return this->character;
}
u_char Character::getSpeed() {
return this->speed;
}
bool Character::isAlive() {
return this->alive;
}
bool Character::isPlayer() {
return this->player;
}
bool Character::isMonster() {
return this->monster;
}
/** GETTERS **/
/** SETTERS **/
Character* Character::setX(u_char x) {
this->x = x;
return this;
}
Character* Character::setY(u_char y) {
this->y = y;
return this;
}
Character* Character::setCharacter(u_char character) {
this->character = character;
return this;
}
Character* Character::setSpeed(u_char speed) {
this->speed = speed;
return this;
}
/** SETTERS **/
|
c71512a1c25f9b80fe805c18ece63f31198c1095
|
3ba107c1bd048eaa54ac7d2dd30b1fdc1e3eb1d6
|
/src/Camera.h
|
f3df7818d49f5b94b599c37fd2b2d986438318c5
|
[
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] |
permissive
|
LeoTPayne/glex
|
76f0191dab24f68cea583dd541b7da938cdfe6e7
|
e5e34280a643de0789387ab3ee033361dee16d5b
|
refs/heads/master
| 2021-01-11T21:51:09.451599
| 2017-05-04T21:07:24
| 2017-05-04T21:07:24
| 78,865,619
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 337
|
h
|
Camera.h
|
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#include <glm/mat4x4.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <memory>
#ifndef SRC_CAMERA_H_
#define SRC_CAMERA_H_
class Camera : public GameAsset {
public:
Camera();~Camera();
glm::mat4 getViewMatrix();
private:
std::unique_ptr<glm::mat4> view;
};
#endif // CAMERA_H
|
5c0390fa5173276f45062612af20e9cfc51c1a1d
|
c328e861209c79447de1843e01e99c1c8084423d
|
/examples/CW02_instr_test/sw01_sl01-serial-log.ino
|
d30ecec0530492b4122649f4c50a61b1fdc4dada
|
[] |
no_license
|
xinabox/arduino-xInstrument
|
b0ba7ffd29fda93e024222c6dd7afc67c2450ce0
|
7d32fc17c9cbb17c064e4c5cb3a1dd53b2a8ede8
|
refs/heads/master
| 2022-09-30T19:15:13.160692
| 2020-05-27T16:08:00
| 2020-05-27T16:08:00
| 262,951,823
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 869
|
ino
|
sw01_sl01-serial-log.ino
|
#include "xInstrument.h"
#include "xSW01.h"
#include "xSL01.h"
double tempC, press, hum;
double lux, uva, uvb;
xInstrument instr;
xSW01 SW01;
xSL01 SL01;
void setup() {
// put your setup code here, to run once
// Create variables to store sensor values
// (no_of_vars, var1, var2, ...)
instr.createVariables(6, "temp", "pressure","humidity", "lux", "uva", "uvb");
instr.enableLEDS();
instr.begin();
Wire.begin();
SW01.begin();
SL01.begin();
instr.enableSerial();
}
void loop() {
// put your main code here, to run repeatedly:
SW01.poll();
SL01.poll();
tempC = SW01.getTempC();
press = SW01.getPressure();
hum = SW01.getHumidity();
lux = SL01.getLUX();
uva = SL01.getUVA();
uvb = SL01.getUVB();
// update variables with sensor values
instr.updateVariables(6, tempC, press, hum, lux, uva, uvb);
instr.loop();
}
|
ef31ecf12078bc334457ed9d56be70813e425549
|
6cc3adc1824cef10794aa887d27455c28acdc446
|
/register.cpp
|
0d7ed2a2570b4e086f50a3f35c87a59a4e2e9305
|
[] |
no_license
|
PixelScrounger/Sphinx
|
2dd646896b15788982040367368a3164ceb88df1
|
31f45c1fa7fea442c851db13f1a654170c1b4b5c
|
refs/heads/master
| 2016-09-12T09:11:14.894771
| 2016-05-18T16:16:08
| 2016-05-18T16:16:08
| 59,130,677
| 1
| 0
| null | 2016-05-18T16:09:15
| 2016-05-18T15:57:26
| null |
UTF-8
|
C++
| false
| false
| 6,744
|
cpp
|
register.cpp
|
#include "register.h"
#include "ui_register.h"
Register::Register(QWidget *parent) :
QDialog(parent),
ui(new Ui::Register)
{
ui->setupUi(this);
this->setWhatsThis(tr("Форма, що слугує для реєстрації новоих користувачів, а також редагування існуючих."));
ui->crLogin->setWhatsThis(tr("Поле для введення логіну користувача."));
ui->crEmail->setWhatsThis(tr("Поле для введення електронної пошти користувача."));
ui->crName->setWhatsThis(tr("Поле для введення прізвища, ім'я та по-батькові користувача."));
ui->crPasswd->setWhatsThis(tr("Поле для введення пароля користувача."));
ui->crPasswd2->setWhatsThis(tr("Поле для підтвердження пароля користувача. Значення цього поля повинне співпадати зі значенням попереднього."));
ui->regButton->setWhatsThis(tr("Натисніть для реєстрації/редагування користувача."));
ui->cancelButton->setWhatsThis(tr("Натисніть для відміни дій реєстрації/редагування."));
QRegExp expLogin("^[a-zA-Z0-9]{2,20}\\S+$");
ui->crLogin->setValidator(new QRegExpValidator(expLogin,this));
ui->crPasswd->setValidator(new QRegExpValidator(expLogin,this));
QRegExp expName("[a-zA-Zа-яА-ЯіІїЇєЄ]{1,15}\\s[a-zA-Zа-яА-ЯіІїЇєЄ]{1,15}\\s[a-zA-Zа-яА-ЯіІїЇєЄ]{1,15}");
ui->crName->setValidator(new QRegExpValidator(expName,this));
idUser = 0;
}
Register::~Register()
{
delete ui;
}
void Register::on_regButton_clicked()
{
if (ui->crEmail->text().isEmpty() || ui->crLogin->text().isEmpty() || ui->crName->text().isEmpty() || ui->crPasswd->text().isEmpty())
{
QMessageBox::critical(this,tr("Невірний ввід"),tr("Заповніть всі поля"));
return;
}
if (ui->crPasswd->text() != ui->crPasswd2->text())
{
QMessageBox::critical(this,tr("Невірний ввід"),tr("Введені паролі не співпадають"));
ui->crPasswd->setFocus();
return;
}
QString strPatt = "\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b";
QRegExp rx("\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b", Qt::CaseInsensitive);
if(!rx.exactMatch(ui->crEmail->text()))
{
QMessageBox::critical(this,tr("Невірний ввід"),tr("Направильна електронна пошта. \nПриклад правильної електронної пошти:\n example@gmail.com"));
ui->crEmail->setFocus();
return;
}
QSqlQuery q;
if(ui->crLogin->text() != uLogin)
{
q.prepare("select login from users where login = :login and deleted = 0");
q.bindValue(":login", ui->crLogin->text());
if(!q.exec())
{
throwDBError(q.lastError());
return;
}
if(MainWindow::qSize(q) > 0)
{
QMessageBox::critical(this,tr("Невірний ввід"),tr("Такий логін вже існує"));
ui->crLogin->setFocus();
return;
}
}
if(ui->crEmail->text() != uEmail)
{
q.prepare("select email from users where email = :email and deleted = 0");
q.bindValue(":email", ui->crEmail->text());
if(!q.exec())
{
throwDBError(q.lastError());
return;
}
if(MainWindow::qSize(q) > 0)
{
QMessageBox::critical(this,tr("Невірний ввід"),tr("Такий e-mail вже зареестрований"));
ui->crEmail->setFocus();
return;
}
}
QCryptographicHash md5(QCryptographicHash::Md5);
md5.addData(ui->crLogin->text().toLatin1() + ui->crPasswd->text().toLatin1());
if(idUser == 0)
{
q.prepare(QString("INSERT INTO users (login, md5, username, email, createat%1)"
"VALUES (:login, :md5, :username, :email, %2%3)")
.arg((SelectDatabase::getDBLocation() == true)?", lastLogin":"",
(SelectDatabase::getDBLocation() == true)?"datetime('now','localtime')":"now()",
(SelectDatabase::getDBLocation() == true)?",datetime('now','localtime')":""));
q.bindValue(":login", ui->crLogin->text());
q.bindValue(":md5", md5.result().toHex());
q.bindValue(":username", ui->crName->text());
q.bindValue(":email", ui->crEmail->text());
}
else
{
q.prepare("UPDATE users SET login = :login, md5 = :md5, username = :username, email = :email WHERE id = :id");
q.bindValue(":login", ui->crLogin->text());
q.bindValue(":md5", md5.result().toHex());
q.bindValue(":username", ui->crName->text());
q.bindValue(":email", ui->crEmail->text());
q.bindValue(":id", idUser);
}
if(q.exec())
{
QMessageBox::information(this,tr("Операція успішна"), (idUser == 0)?tr("Реєстрація пройшла успішно"):tr("Користувач успішно відредагований"));
this->close();
}
else
{
throwDBError(q.lastError());
return;
}
}
void Register::throwDBError(QSqlError error)
{
MyMsgBox *msg = new MyMsgBox(this);
msg->setIcon(QMessageBox::Critical);
msg->setWindowTitle(tr("Проблема зі з'єднанням"));
msg->setText(tr("Не вдалося під'єднатися бази даних."));
msg->setInformativeText(tr("У разі використання серверної бази даних, перевірте своє з'єднання з Інтернетом. \nВ іншому ж випадку переконайтесь, що локальну базу даних не було переміщено."));
msg->setDetailedText(tr("Код помилки: ") + QString::number(error.number()) + tr(";\nТекст помилки: ") + error.text());
msg->setDetailsButtonText(tr("Детальніше"), tr("Приховати"));
msg->exec();
delete msg;
}
void Register::recieveData(int id, QString login, QString username, QString email, QString wndTitle, QString btnText)
{
idUser = id;
uLogin = login;
ui->crLogin->setText(login);
uEmail = email;
ui->crEmail->setText(email);
ui->crName->setText(username);
this->setWindowTitle(wndTitle);
ui->regButton->setText(btnText);
}
|
d3337bdb202fffa064438fec8ed174dd5ac50c56
|
dccd1058e723b6617148824dc0243dbec4c9bd48
|
/atcoder/abc038/d.cpp
|
95a08aecfe726e9f68431b27ef998fd521519594
|
[] |
no_license
|
imulan/procon
|
488e49de3bcbab36c624290cf9e370abfc8735bf
|
2a86f47614fe0c34e403ffb35108705522785092
|
refs/heads/master
| 2021-05-22T09:24:19.691191
| 2021-01-02T14:27:13
| 2021-01-02T14:27:13
| 46,834,567
| 7
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 745
|
cpp
|
d.cpp
|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef pair<int,int> pi;
const int INF=12345678;
int main()
{
int n;
cin >>n;
vector<pi> p(n);
rep(i,n) scanf(" %d %d", &p[i].fi, &p[i].se);
rep(i,n) p[i].se=-p[i].se;
sort(all(p));
vector<int> h(n);
rep(i,n) h[i]=-p[i].se;
vector<int> dp(n+1,INF);
rep(i,n)
{
*lower_bound(all(dp),h[i])=h[i];
}
printf("%d\n", lower_bound(all(dp),INF)-dp.begin());
return 0;
}
|
b84a2be234a195e1c6d647f1b6c951cb3ec51852
|
07702d5c9493300058b748173e7b0db0214f5fb9
|
/include/log.h
|
964f11660922bcad82cd17b754dd63dfaf61a96f
|
[] |
no_license
|
ZhaoAoWHUT/SpellCorrect
|
cec10584a9dca235c836aa1d9372ac7b1834aa18
|
0993b8d6bf5261780d27a74e813fb3af8e32ee86
|
refs/heads/master
| 2023-03-03T02:29:12.810370
| 2021-02-10T17:05:33
| 2021-02-10T17:05:33
| 203,077,516
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 496
|
h
|
log.h
|
#pragma once
#include <stdio.h>
#include <iostream>
using namespace std;
#define INFO(msg) cout << "info --> " << msg << endl
#define DEBUG(msg) cout << "debug --> file : " << __FILE__ << " , " << "function : " << __FUNCTION__ << " , " << "line : " << __LINE__ << " , " << "reason : " << msg << endl
#define ERROR(msg) { cerr << "error --> file : " << __FILE__ << " , " << "function : " << __FUNCTION__ << " , " << "line : " << __LINE__ << " , " << "reason : " << msg << endl , _Exit(-1);}
|
928b6bc819252d1abe10c29a53f14117771c5af3
|
e86ca17662bea3491caf50302916609e6b11e56a
|
/HomeWork3/Ex.1/Rhombus.cpp
|
e6057e1c2d2ba2a09029499b9b845200b78316f9
|
[] |
no_license
|
Elohai/testRepository
|
47b64c192a63835cfccb40c085aa9925d7c4ca32
|
0f16efacc2e97673be75015f18c77fedcef4bcb2
|
refs/heads/main
| 2023-01-18T18:10:02.526720
| 2020-11-23T15:34:09
| 2020-11-23T15:34:09
| 306,462,972
| 0
| 0
| null | 2020-11-24T14:17:47
| 2020-10-22T21:30:17
|
C++
|
UTF-8
|
C++
| false
| false
| 90
|
cpp
|
Rhombus.cpp
|
#include "Rhombus.h"
float Rhombus::area() const{
return Parallelogramm::area();
}
|
725c8853cc1b243fdc3f6fd49b94a2f0836f18f1
|
b3c47795e8b6d95ae5521dcbbb920ab71851a92f
|
/Leetcode/Algorithm/cpp/00336-Palindrome Pairs.cc
|
cdcd221c47ca95967e7822f389d6dcb2b8181ce5
|
[
"LicenseRef-scancode-warranty-disclaimer"
] |
no_license
|
Wizmann/ACM-ICPC
|
6afecd0fd09918c53a2a84c4d22c244de0065710
|
7c30454c49485a794dcc4d1c09daf2f755f9ecc1
|
refs/heads/master
| 2023-07-15T02:46:21.372860
| 2023-07-09T15:30:27
| 2023-07-09T15:30:27
| 3,009,276
| 51
| 23
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,141
|
cc
|
00336-Palindrome Pairs.cc
|
class Solution {
public:
vector<vector<int>> palindromePairs(vector<string>& words) {
vector<vector<int>> ans;
unordered_map<string, int> mp;
int n = words.size();
for (int i = 0; i < n; i++) {
auto& word = words[i];
mp[word] = i;
}
for (int i = 0; i < n; i++) {
auto& word = words[i];
vector<string> prefixs, suffixs;
get_prefix(word, prefixs, suffixs);
for (auto prefix: prefixs) {
//printf("%s ", prefix.c_str());
reverse(prefix.begin(), prefix.end());
if (mp.find(prefix) != mp.end() && mp[prefix] != i) {
ans.push_back({i, mp[prefix]});
}
}
for (auto suffix: suffixs) {
reverse(suffix.begin(), suffix.end());
if (mp.find(suffix) != mp.end() && mp[suffix] != i) {
ans.push_back({mp[suffix], i});
}
}
}
return ans;
}
private:
void get_prefix(const string& word, vector<string>& prefix, vector<string>& suffix) {
memset(dp, 0, sizeof(dp));
int n = word.size();
for (int i = 0; i < n; i++) {
dp[i][i] = 1;
}
for (int i = 1; i < n; i++) {
for (int j = 0; i + j < n; j++) {
if (word[j] != word[i + j]) {
continue;
}
if (i > 1 && !dp[j + 1][i + j - 1]) {
continue;
}
dp[j][j + i] = 1;
}
}
for (int i = 1; i < n; i++) {
if (dp[i][n - 1]) {
prefix.push_back(word.substr(0, i));
}
}
prefix.push_back(word);
for (int i = 0; i < n - 1; i++) {
if (dp[0][i]) {
suffix.push_back(word.substr(i + 1));
}
}
if (dp[0][n - 1]) {
prefix.push_back("");
suffix.push_back("");
}
}
char dp[222][222];
};
|
84efbc466d240cc1cd2c5fd8ba250f609c1628c4
|
f89b03dd7ce186caf3f5e249cc0b63579ae22186
|
/Chatting_Client_0/TDebugString.cpp
|
d647ccd22c7de42bcc7dc802c7ca494cf761cbbb
|
[] |
no_license
|
yura0525/01_YuraHomework
|
cdf8c645c47c71f39bf7edf44093977b9c7d273c
|
7f2a37ee19e1a00eb301ff676f7fbaf8f9954b22
|
refs/heads/master
| 2021-07-12T07:12:24.630819
| 2019-02-26T08:11:15
| 2019-02-26T08:11:15
| 146,382,373
| 0
| 0
| null | null | null | null |
UHC
|
C++
| false
| false
| 3,497
|
cpp
|
TDebugString.cpp
|
#define _CRT_SECURE_NO_WARNINGS
#include "TDebugString.h"
#include "TSynchronize.h"
void TDebugString::DisplayText(char* fmt, ...)
{
{
TSynchronize sync(this);
va_list arg;
va_start(arg, fmt);
char buf[256] = { 0, };
vsprintf(buf, fmt, arg);
int nLen = GetWindowTextLength(m_hEdit);
//SendMessage( m_hEdit, EM_SETSEL, nLen, nLen);
if (nLen > 256)
{
SendMessage(m_hEdit, EM_SETSEL, 0, -1);
SendMessage(m_hEdit, WM_CLEAR, 0, 0);
}
SendMessage(m_hEdit, EM_REPLACESEL, 0, (LPARAM)GetMbtoWcs(buf));
va_end(arg);
}
}
void TDebugString::Print(const char* fmt, ...)
{
{
TSynchronize sync(this);
va_list arg;
va_start(arg, fmt);
char buf[256] = { 0, };
vsprintf(buf, fmt, arg);
SendMessage(m_hList, LB_ADDSTRING, 0, (LPARAM)GetMbtoWcs(buf));
va_end(arg);
}
}
TCHAR* TDebugString::GetMbtoWcs(const char* srcmsg)
{
// 멀티바이트 => 유니코드 변환.
TCHAR msg[4096] = { 0, };
ConvertAnsiStringToWideCh(msg, srcmsg, strlen(srcmsg));
return msg;
}
char* TDebugString::GetWcstoMbs(WCHAR* srcmsg)
{
// 멀티바이트 => 유니코드 변환.
char msg[1024] = { 0, };
ConvertWideStringToAnsiCh(msg, srcmsg, 1024);
return msg;
}
HRESULT TDebugString::ConvertAnsiStringToWideCh(WCHAR* wstrDestination, const CHAR* strSource, int cchDestChar)
{
if (wstrDestination == NULL || strSource == NULL || cchDestChar < 1)
return E_INVALIDARG;
int nResult = MultiByteToWideChar(CP_ACP, 0, strSource, -1, wstrDestination, cchDestChar);
wstrDestination[cchDestChar - 1] = 0;
if (nResult == 0)
return E_FAIL;
return S_OK;
}
HRESULT TDebugString::ConvertWideStringToAnsiCh(CHAR* strDestination, const WCHAR* wstrSource, int cchDestChar)
{
if (strDestination == NULL || wstrSource == NULL || cchDestChar < 1)
return E_INVALIDARG;
int nResult = WideCharToMultiByte(CP_ACP, 0, wstrSource, -1, strDestination, cchDestChar * sizeof(CHAR), NULL, NULL);
strDestination[cchDestChar - 1] = 0;
if (nResult == 0)
return E_FAIL;
return S_OK;
}
bool TDebugString::Init()
{
// 에디터 컨트롤 윈도우 생성
m_hEdit = CreateWindow(L"edit", NULL,
WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_AUTOVSCROLL,
0, 320,
400,//this->m_iWidth,
100,//this->m_iHeight,
g_hWnd, (HMENU)0,
g_hInstance,
NULL);
m_hButton = CreateWindow(L"button", L"전송",
WS_CHILD | WS_VISIBLE,
403, 320,
90,//this->m_iWidth,
100,//this->m_iHeight,
g_hWnd, (HMENU)1,
g_hInstance,
NULL);
// 에디터 컨트롤 윈도우 생성
m_hList = CreateWindow(L"listbox", NULL,
WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL,
/*| ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY
| ES_AUTOHSCROLL,*/
0, 0,
500,//this->m_iWidth,
300,//this->m_iHeight,
g_hWnd, (HMENU)2,
g_hInstance,
NULL);
SendMessage(m_hList, LB_RESETCONTENT, 0, 0);
SendMessage(m_hList, LB_SETCOLUMNWIDTH, 100, 0);
return true;
}
bool TDebugString::Frame()
{
return true;
}
bool TDebugString::Release()
{
return true;
}
void TDebugString::T_ERROR(bool bPrint)
{
if (WSAGetLastError() != WSA_IO_PENDING)
{
setlocale(LC_ALL, "KOREAN");
char* lpMsgBuf;
FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL, WSAGetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(char*)&lpMsgBuf, 0, NULL);
if (bPrint)
I_DebugStr.Print("\nERROR WSASend:%s\n", (char*)lpMsgBuf);
else
OutputDebugStringA((char*)lpMsgBuf);
LocalFree(lpMsgBuf);
}
}
TDebugString::TDebugString()
{
}
TDebugString::~TDebugString()
{
}
|
035e5c37206b40e6692ab2b598c98a0144d89ddf
|
fb6251837c15a0ee0b28b15d214599165e11de83
|
/UVA/11456 - Trainsorting.cpp
|
d26eaa77f69be422904ed054cf0c02147509ab74
|
[] |
no_license
|
CDPS/Competitive-Programming
|
de72288b8dc02ca2a45ed40491ce1839e983b765
|
24c046cbde7fea04a6c0f22518a688faf7521e2e
|
refs/heads/master
| 2023-08-09T09:57:15.368959
| 2023-08-05T00:44:41
| 2023-08-05T00:44:41
| 104,966,014
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 971
|
cpp
|
11456 - Trainsorting.cpp
|
#include <bits/stdc++.h>
using namespace std;
int a[2000], memo[2000][2000];
int n;
int dp(int idx,int first,int last,int idxp){
if(idx ==n)
return 0;
if(memo[idx][idxp]!=-1) return memo[idx][idxp];
if(a[idx]< a[first] || a[idx]> a[last])
return dp(idx+1,first,last,idxp);
if(a[idx]> a[first])
return memo[idx][idxp] = max( dp(idx+1,first,last,idxp), dp(idx+1,idx,last,idx) +1);
return memo[idx][idxp] = max( dp(idx+1,first,last,idxp),dp(idx+1,first,idx,idx) +1);
}
void rmemo(){
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
memo[i][j]=-1;
}
int main(){
int t;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
if(n ==0 ) {printf("0\n"); continue;}
for(int i=0;i<n;i++)
scanf("%d",a+i);
rmemo();int maxi=1;
for(int i=0;i<n-1;i++)
maxi = max(dp(i+1,i,i,i)+1,maxi);
printf("%d\n",maxi);
}
return 0;
}
|
ad4310805103951447d4c27e867e0e181602b6a9
|
906f63c09d2bddbc8a54e63b66021cd451a01f2e
|
/luna2d/math/lunasplines.cpp
|
06d7cba26ba190e1730d0272f7741ea179d5a2a3
|
[
"MIT"
] |
permissive
|
stepanp/luna2d
|
d4b0cec0dd7045c1f5f45af7123805f66495980a
|
b9dbec8cabaaf4c3c0a4f99720350d25a8b42fcf
|
refs/heads/master
| 2021-01-23T20:55:44.246817
| 2018-10-09T09:13:12
| 2018-10-09T09:13:12
| 28,882,415
| 33
| 13
| null | 2016-04-28T12:51:34
| 2015-01-06T20:38:37
|
C++
|
UTF-8
|
C++
| false
| false
| 2,502
|
cpp
|
lunasplines.cpp
|
//-----------------------------------------------------------------------------
// luna2d engine
// Copyright 2014-2017 Stepan Prokofjev
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "lunasplines.h"
using namespace luna2d;
using namespace luna2d::splines;
// Quadratic B-Spline
// "p0" - i-1 point
// "p1" - i point
// "p2" - i+1 point
// "t" - time from 0.0 to 1.0
glm::vec2 luna2d::splines::QuadraticBSpline(const glm::vec2& p0, const glm::vec2& p1, const glm::vec2& p2, float t)
{
float x0 = (p0.x - 2.0f * p1.x + p2.x) / 2.0f;
float x1 = (-2.0f * p0.x + 2.0f * p1.x) / 2.0f;
float x2 = (p0.x + p1.x) / 2.0f;
float y0 = (p0.y - 2.0f * p1.y + p2.y) / 2.0f;
float y1 = (-2.0f * p0.y + 2.0f * p1.y) / 2.0f;
float y2 = (p0.y + p1.y) / 2.0f;
float x = t * t * x0 + t * x1 + x2;
float y = t * t * y0 + t * y1 + y2;
return glm::vec2(x, y);
}
// Cubic Bezier function
glm::vec2 luna2d::splines::CubicBezier(const glm::vec2& p0, const glm::vec2& p1,
const glm::vec2& p2, const glm::vec2& p3, float t)
{
float x0 = p3.x + 3 * (p1.x - p2.x) - p0.x;
float x1 = p0.x - 2 * p1.x + p2.x;
float x2 = p1.x - p0.x;
float y0 = p3.y + 3 * (p1.y - p2.y) - p0.y;
float y1 = p0.y - 2 * p1.y + p2.y;
float y2 = p1.y - p0.y;
float x = t * t * t * x0 + 3 * t * t * x1 + 3 * t * x2 + p0.x;
float y = t * t * t * y0 + 3 * t * t * y1 + 3 * t * y2 + p0.y;
return glm::vec2(x, y);
}
|
af77eebe094a6090fbc48b9d7d70cf2f236cf85e
|
519f553b9a35fd0d90ec2a8589c7260585caec90
|
/archive/game/indexed_object.h
|
6b843536a82b11af79d3988874a6bd0bfc8d7e07
|
[
"MIT"
] |
permissive
|
brettonw/Bedrock-C
|
f8c169f3529b9af1ef9e6cebc1abc5ce2d94a0b5
|
54e0140db14dcf7c498ae150a113745f2c242b82
|
refs/heads/master
| 2022-08-15T10:37:03.958674
| 2022-07-19T18:25:23
| 2022-07-19T18:25:23
| 139,098,842
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 8,050
|
h
|
indexed_object.h
|
//-----------------------------------------------------------------------------
// Copyright (C) 1997-2006 Bretton Wade
// All Rights Reserved
//-----------------------------------------------------------------------------
#ifndef _INDEXED_OBJECT_H_
#define _INDEXED_OBJECT_H_
//-----------------------------------------------------------------------------
// include files
//-----------------------------------------------------------------------------
#ifndef _XML_NODE_H_
#include "xml_node.h"
#endif // _XML_NODE_H_
//-----------------------------------------------------------------------------
// class definitions
//-----------------------------------------------------------------------------
template<class someType>
class IndexedObject : public CountedObject
{
// inherited interface for individual objects
public:
const Text& GetName (void) const;
uInt2 GetID (void) const;
protected:
Text m_name;
uInt2 m_ID;
// inherited interface for classwide indexing
public:
static PtrTo<someType> Create (const PtrToXMLNode& pXMLNode);
static PtrTo<someType> Find (const Text& name);
static PtrTo<someType> Find (uInt2 ID);
static void Remove (const Text& name);
static void Remove (uInt2 ID);
static void Remove (const PtrTo<someType>& pObject);
static void RemoveAll (void);
protected:
static TextMap<PtrTo<someType> > s_indexByName;
static Map<uInt2, PtrTo<someType> >s_indexByID;
static uInt2 s_ID;
// what follows here is a support class for automatic registration of a
// factory object for each subclass of indexed object. The general idea
// is that XML nodes will be used for building the objects, and we want
// to add them to the index as they are created, so we must control the
// construction and destruction.
protected:
/* void */ IndexedObject (const PtrToXMLNode& pXMLNode);
virtual /* void */ ~IndexedObject (void) {}
protected:
struct Factory
{
Text m_type;
// this constructor allocates the factory map if it isn't
// already in existence, and then installs the type factory
// object in the map. Factory objects should only be created
// during static initialization using the support macros
// provided below.
/* void */ Factory (const Text& type) :
m_type (type)
{
if (not s_pFactoryMap)
s_pFactoryMap = NewCall TextMap<Factory*>;
(*s_pFactoryMap)[m_type] = this;
}
// this destructor removes the factory object from the map,
// and deletes the map if it is empty. As with the constructor,
// factory objects should only be getting destroyed during
// static shutdown.
virtual /* void */ ~Factory (void)
{
Assert (s_pFactoryMap);
TextMap<Factory*>::iterator iter = s_pFactoryMap->find (m_type);
Assert (iter != s_pFactoryMap->end ());
s_pFactoryMap->erase (iter);
if (s_pFactoryMap->size () == 0)
{
delete s_pFactoryMap;
s_pFactoryMap = 0;
}
}
// these methods do the actual work of creating a PtrTo<aType>
// from an xml node
virtual PtrTo<someType> Build (const PtrToXMLNode& pXMLNode) = 0;
static PtrTo<someType> Create (const PtrToXMLNode& pXMLNode)
{
PtrTo<someType> pSomeType;
Text type = pXMLNode->GetAttribute ("type");
if (type.Length () == 0)
type = pXMLNode->GetName ();
TextMap<Factory*>::iterator iter = s_pFactoryMap->find (type);
if (iter != s_pFactoryMap->end ())
{
Factory* pFactory = iter->second;
pSomeType = pFactory->Build (pXMLNode);
}
return pSomeType;
}
};
static TextMap<Factory*>* s_pFactoryMap;
};
//-----------------------------------------------------------------------------
// macros
//-----------------------------------------------------------------------------
// use this macro at the bottom of class definitions for classes that
// should be creatable from an XML node - it declares the constructor
// and destructor for your class, so be sure those are defined
// elsewhere.
#define DECLARE_FACTORY(BaseObjectName, ObjectName) \
public: \
ObjectName (const PtrToXMLNode& pXMLNode); \
~ObjectName (void); \
struct Factory : public IndexedObject<BaseObjectName>::Factory \
{ \
/* void */ Factory (void) : \
IndexedObject<BaseObjectName>::Factory (#ObjectName) {} \
virtual /* void */ ~Factory (void) {} \
virtual PtrTo<BaseObjectName> Build (const PtrToXMLNode& pXMLNode) \
{ return NewCall ObjectName (pXMLNode); } \
}; \
static Factory s_Factory ## ObjectName
// use this macro at the top of the source file that contains
// definitions of your class methods - it completes the static
// declaration of a factory object in class scope.
#define DEFINE_FACTORY(ObjectName) \
ObjectName::Factory ObjectName::s_Factory ## ObjectName
// use this macro to load an object from an xml node (pXMLNode)
#define LOAD_FROM_XML(Object, pXMLNode) \
{ \
const XMLNodeList* pObjectList = pXMLNode->GetChildren (#Object); \
if (pObjectList) \
{ \
XMLNodeList::const_iterator iter = pObjectList->begin (); \
XMLNodeList::const_iterator end = pObjectList->end (); \
while (iter != end) \
{ \
PtrToXMLNode pObjectNode = *iter++; \
Object::Create (pObjectNode); \
} \
} \
}
//-----------------------------------------------------------------------------
// inlines
//-----------------------------------------------------------------------------
#ifndef _INDEXED_OBJECT_INL_
#include "indexed_object.inl"
#endif // _INDEXED_OBJECT_INL_
//-----------------------------------------------------------------------------
#endif // _INDEXED_OBJECT_H_
|
151cdfda7b450b04dca4f0a358c0d043f7d003ba
|
3d3eab662ead62c878981dcc9291af2f33ccaeb3
|
/src/common/include/kim/KimConfig.h
|
2870e4779495749dac3c7f9bb0c789aac19e00fe
|
[] |
no_license
|
Halo1234/Avalanches
|
85bf2f1e95b47a35381f877f51e56fd9a4251f2c
|
e6316ea649f101b3226d226e7fbf8b86ed762aeb
|
refs/heads/master
| 2023-08-31T15:59:26.637704
| 2023-08-29T22:08:52
| 2023-08-29T22:08:52
| 45,299,977
| 6
| 0
| null | 2021-05-29T13:38:07
| 2015-10-31T12:00:58
|
HTML
|
UTF-8
|
C++
| false
| false
| 4,396
|
h
|
KimConfig.h
|
/**
* $Revision: 161 $
**/
#if !defined(GUARD_KIMCONFIG_H)
#define GUARD_KIMCONFIG_H
#if defined(DEBUG) || defined(_DEBUG)
# if defined(NDEBUG)
# undef NDEBUG
# endif
#else
# if !defined(NDEBUG)
# define NDEBUG
# endif
#endif
#if defined(UNICODE) || defined(_UNICODE)
# define KIM_UNICODE
#endif
#if !defined(WIN32) && !defined(WINDOWS) && !defined(_WINDOWS)
# error "-DWIN32 should be employed."
#endif
#if defined(_MSC_VER) // For MicroSoft Visual C++
# if(_MSC_VER < 1300)
# error "VC++ 7.0 or later is necessary to compile"
# endif
# define KIM_MSVC_COMPILER
# define KIM_HAS_INT64
# define KIM_NORETURN __declspec(noreturn) void
# if(_MSC_VER < 1310)
# define KIM_W64
# endif // _MSC_VER < 1310
# if(_MSC_VER >= 1300) // VC7 or later
# endif // _MSC_VER >= 1300
# if(_MSC_VER >= 1310) // VC7.1 or later
# define KIM_POSSIBLE_TEMPLATE_PARAMETERS_IN_TEMPLATE
# define KIM_HAS_ISO_CPLUS2_CRT
# define KIM_W64 __w64
# endif // _MSC_VER >= 1310
# if(_MSC_VER >= 1400) // VC8.0 or later
# define KIM_HAS_SECURE_CRT
# endif // _MSC_VER >= 1400
# if defined(_MT) // Using Multi-Thread liblary.
# define KIM_USING_MT_LIBLARY
# endif // _MT
// End of MSVC++ configure.
#elif defined(__GNUC__) // For GNU C
# if(__GNUC__ < 3)
# error "gcc 3.x or later is necessary to compile."
# endif
# define KIM_POSSIBLE_TEMPLATE_PARAMETERS_IN_TEMPLATE
# if(_FILE_OFFSET_BITS < 64)
# error "-D_FILE_OFFSET_BITS=64 should be employed."
# endif
# define KIM_GNUC_COMPILER
# define KIM_HAS_LONGLONG
# define KIM_PACK1 __attribute__((__packed__, __aligned__(1)))
# define KIM_PACK2 __attribute__((__packed__, __aligned__(2)))
# define KIM_PACK4 __attribute__((__packed__, __aligned__(4)))
# define KIM_PACK8 __attribute__((__packed__, __aligned__(8)))
// End of GNU-C configure.
#else // other compiler
# error "Sorry. Not wrote config for your compiler."
#endif
#if !defined(KIM_NORETURN)
# define KIM_NORETURN void
#endif
#if !defined(KIM_W64)
# define KIM_W64
#endif
#if !defined(KIM_PACK1)
# define KIM_PACK1
#endif
#if !defined(KIM_PACK2)
# define KIM_PACK2
#endif
#if !defined(KIM_PACK4)
# define KIM_PACK4
#endif
#if !defined(KIM_PACK8)
# define KIM_PACK8
#endif
namespace kim {
#if defined(KIM_MSVC_COMPILER)
typedef __int8 kim_int8;
typedef __int16 kim_int16;
typedef __int32 kim_int32;
typedef unsigned __int8 kim_uint8;
typedef unsigned __int16 kim_uint16;
typedef unsigned __int32 kim_uint32;
typedef __wchar_t kim_wchar; // __wchar_t is always built-in type.
#elif defined(__GNUC__)
typedef char kim_int8;
typedef short kim_int16;
typedef int kim_int32;
typedef unsigned char kim_uint8;
typedef unsigned short kim_uint16;
typedef unsigned int kim_uint32;
typedef wchar_t kim_wchar;
#endif
typedef char kim_achar;
#if defined(KIM_HAS_INT64)
typedef __int64 kim_int64;
typedef unsigned __int64 kim_uint64;
#elif defined(KIM_HAS_LONGLONG)
typedef long long kim_int64;
typedef unsigned long long kim_uint64;
#else
# error "It doesn't have a 64-bit variable in your compiler."
#endif
#if defined(_WIN64)
typedef kim_int64 kim_w64int;
typedef kim_int64 kim_w64long;
typedef kim_uint64 kim_w64uint;
typedef kim_uint64 kim_w64ulong;
typedef kim_int64 kim_native;
#else
typedef int KIM_W64 kim_w64int;
typedef long KIM_W64 kim_w64long;
typedef unsigned int KIM_W64 kim_w64uint;
typedef unsigned long KIM_W64 kim_w64ulong;
typedef kim_int32 KIM_W64 kim_native;
#endif /* _WIN64 */
typedef kim_uint8 kim_byte;
typedef kim_uint16 kim_word;
typedef kim_uint32 kim_dword;
typedef kim_uint64 kim_qword;
#if defined(KIM_MSVC_COMPILER)
typedef kim_w64uint kim_size;
typedef kim_w64int kim_off;
#elif defined(KIM_GNUC_COMPILER)
typedef kim_w64uint kim_size;
typedef kim_int64 kim_off;
#endif
#define KIM_STRDUMP16(ptr) ((kim_word)(*(kim_word*)(ptr)))
#define KIM_STRDUMP32(ptr) ((kim_dword)(*(kim_dword*)(ptr)))
#define KIM_STRDUMP64(ptr) ((kim_qword)(*(kim_qword*)(ptr)))
#define KIM_TAG(name) tag_##name
#define KIM_TAG_A(name) tag_##name##_a
#define KIM_TAG_W(name) tag_##name##_w
#define KIM_WT(text) L##text
#define KIM_AT(text) text
#define KIM_UNUSED(v) (void)v
#define KIM_ARRAY_COUNT(a) (kim::kim_size)(sizeof(a)/sizeof(a[0]))
}
#endif /* GUARD_KIMCONFIG_H */
|
436d0f44d60202bb8ae7a7e5a27fe3e05c61fae8
|
299fd4eb7b335064cee53d6b29e3c8646313e717
|
/AnnService/src/SSDServing/SelectHead_BKT/BootSelectHead.cpp
|
003ebfc87ba8130d1235b882868b6105fd9dd10c
|
[
"MIT"
] |
permissive
|
CloudBreadPaPa/SPTAG
|
b932c7df84508daa8c7f3230b033bcfbd3325ea8
|
99ce4709e9198b2563a0f34efa3297923de3a916
|
refs/heads/master
| 2022-02-22T15:30:46.519542
| 2021-12-22T02:05:38
| 2021-12-22T02:05:38
| 187,119,488
| 0
| 0
|
MIT
| 2019-05-17T00:29:08
| 2019-05-17T00:29:08
| null |
UTF-8
|
C++
| false
| false
| 7,265
|
cpp
|
BootSelectHead.cpp
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "inc/Helper/CommonHelper.h"
#include "inc/Helper/VectorSetReader.h"
#include "inc/SSDServing/SelectHead_BKT/BootSelectHead.h"
#include "inc/SSDServing/SelectHead_BKT/BuildBKT.h"
#include "inc/SSDServing/SelectHead_BKT/AnalyzeTree.h"
#include "inc/SSDServing/SelectHead_BKT/SelectHead.h"
#include "inc/SSDServing/VectorSearch/TimeUtils.h"
#include "inc/SSDServing/IndexBuildManager/CommonDefines.h"
namespace SPTAG {
namespace SSDServing {
namespace SelectHead_BKT {
void AdjustOptions(Options& p_opts, int p_vectorCount)
{
if (p_opts.m_headVectorCount != 0) p_opts.m_ratio = p_opts.m_headVectorCount * 1.0 / p_vectorCount;
int headCnt = CalcHeadCnt(p_opts.m_ratio, p_vectorCount);
if (headCnt == 0)
{
for (double minCnt = 1; headCnt == 0; minCnt += 0.2)
{
p_opts.m_ratio = minCnt / p_vectorCount;
headCnt = CalcHeadCnt(p_opts.m_ratio, p_vectorCount);
}
LOG(Helper::LogLevel::LL_Info, "Setting requires to select none vectors as head, adjusted it to %d vectors\n", headCnt);
}
if (p_opts.m_iBKTKmeansK > headCnt)
{
p_opts.m_iBKTKmeansK = headCnt;
LOG(Helper::LogLevel::LL_Info, "Setting of cluster number is less than head count, adjust it to %d\n", headCnt);
}
if (p_opts.m_selectThreshold == 0)
{
p_opts.m_selectThreshold = min(p_vectorCount - 1, static_cast<int>(1 / p_opts.m_ratio));
LOG(Helper::LogLevel::LL_Info, "Set SelectThreshold to %d\n", p_opts.m_selectThreshold);
}
if (p_opts.m_splitThreshold == 0)
{
p_opts.m_splitThreshold = min(p_vectorCount - 1, static_cast<int>(p_opts.m_selectThreshold * 2));
LOG(Helper::LogLevel::LL_Info, "Set SplitThreshold to %d\n", p_opts.m_splitThreshold);
}
if (p_opts.m_splitFactor == 0)
{
p_opts.m_splitFactor = min(p_vectorCount - 1, static_cast<int>(std::round(1 / p_opts.m_ratio) + 0.5));
LOG(Helper::LogLevel::LL_Info, "Set SplitFactor to %d\n", p_opts.m_splitFactor);
}
}
ErrorCode Bootstrap(Options& opts) {
VectorSearch::TimeUtils::StopW sw;
LOG(Helper::LogLevel::LL_Info, "Start loading vector file.\n");
auto valueType = COMMON::DistanceUtils::Quantizer ? SPTAG::VectorValueType::UInt8 : COMMON_OPTS.m_valueType;
std::shared_ptr<Helper::ReaderOptions> options(new Helper::ReaderOptions(valueType, COMMON_OPTS.m_dim, COMMON_OPTS.m_vectorType, COMMON_OPTS.m_vectorDelimiter));
auto vectorReader = Helper::VectorSetReader::CreateInstance(options);
if (ErrorCode::Success != vectorReader->LoadFile(COMMON_OPTS.m_vectorPath))
{
LOG(Helper::LogLevel::LL_Error, "Failed to read vector file.\n");
exit(1);
}
auto vectorSet = vectorReader->GetVectorSet();
if (COMMON_OPTS.m_distCalcMethod == DistCalcMethod::Cosine) vectorSet->Normalize(opts.m_iNumberOfThreads);
LOG(Helper::LogLevel::LL_Info, "Finish loading vector file.\n");
AdjustOptions(opts, vectorSet->Count());
std::vector<int> selected;
if (Helper::StrUtils::StrEqualIgnoreCase(opts.m_selectType.c_str(), "Random")) {
LOG(Helper::LogLevel::LL_Info, "Start generating Random head.\n");
selected.resize(vectorSet->Count());
for (int i = 0; i < vectorSet->Count(); i++) selected[i] = i;
std::random_shuffle(selected.begin(), selected.end());
int headCnt = CalcHeadCnt(opts.m_ratio, vectorSet->Count());
selected.resize(headCnt);
} else if (Helper::StrUtils::StrEqualIgnoreCase(opts.m_selectType.c_str(), "Clustering")) {
LOG(Helper::LogLevel::LL_Info, "Start generating Clustering head.\n");
int headCnt = CalcHeadCnt(opts.m_ratio, vectorSet->Count());
switch (valueType)
{
#define DefineVectorValueType(Name, Type) \
case VectorValueType::Name: \
Clustering<Type>(vectorSet, opts, selected, headCnt); \
break;
#include "inc/Core/DefinitionList.h"
#undef DefineVectorValueType
default: break;
}
} else if (Helper::StrUtils::StrEqualIgnoreCase(opts.m_selectType.c_str(), "BKT")) {
LOG(Helper::LogLevel::LL_Info, "Start generating BKT.\n");
std::shared_ptr<COMMON::BKTree> bkt;
switch (valueType)
{
#define DefineVectorValueType(Name, Type) \
case VectorValueType::Name: \
bkt = BuildBKT<Type>(vectorSet, opts); \
break;
#include "inc/Core/DefinitionList.h"
#undef DefineVectorValueType
default: break;
}
LOG(Helper::LogLevel::LL_Info, "Finish generating BKT.\n");
std::unordered_map<int, int> counter;
if (opts.m_calcStd)
{
CalcLeafSize(0, bkt, counter);
}
if (opts.m_analyzeOnly)
{
LOG(Helper::LogLevel::LL_Info, "Analyze Only.\n");
std::vector<BKTNodeInfo> bktNodeInfos(bkt->size());
// Always use the first tree
DfsAnalyze(0, bkt, vectorSet, opts, 0, bktNodeInfos);
LOG(Helper::LogLevel::LL_Info, "Analyze Finish.\n");
}
else {
if (SelectHead(vectorSet, bkt, opts, counter, selected) != ErrorCode::Success)
{
LOG(Helper::LogLevel::LL_Error, "Failed to select head.\n");
return ErrorCode::Fail;
}
}
}
LOG(Helper::LogLevel::LL_Info,
"Seleted Nodes: %u, about %.2lf%% of total.\n",
static_cast<unsigned int>(selected.size()),
selected.size() * 100.0 / vectorSet->Count());
if (!opts.m_noOutput)
{
std::sort(selected.begin(), selected.end());
std::shared_ptr<Helper::DiskPriorityIO> output = SPTAG::f_createIO(), outputIDs = SPTAG::f_createIO();
if (output == nullptr || outputIDs == nullptr ||
!output->Initialize(COMMON_OPTS.m_headVectorFile.c_str(), std::ios::binary | std::ios::out) ||
!outputIDs->Initialize(COMMON_OPTS.m_headIDFile.c_str(), std::ios::binary | std::ios::out)) {
LOG(Helper::LogLevel::LL_Error, "Failed to create output file:%s %s\n", COMMON_OPTS.m_headVectorFile.c_str(), COMMON_OPTS.m_headIDFile.c_str());
exit(1);
}
SizeType val = static_cast<SizeType>(selected.size());
if (output->WriteBinary(sizeof(val), reinterpret_cast<char*>(&val)) != sizeof(val)) {
LOG(Helper::LogLevel::LL_Error, "Failed to write output file!\n");
exit(1);
}
DimensionType dt = vectorSet->Dimension();
if (output->WriteBinary(sizeof(dt), reinterpret_cast<char*>(&dt)) != sizeof(dt)) {
LOG(Helper::LogLevel::LL_Error, "Failed to write output file!\n");
exit(1);
}
for (auto& ele : selected)
{
uint64_t vid = static_cast<uint64_t>(ele);
if (outputIDs->WriteBinary(sizeof(vid), reinterpret_cast<char*>(&vid)) != sizeof(vid)) {
LOG(Helper::LogLevel::LL_Error, "Failed to write output file!\n");
exit(1);
}
if (output->WriteBinary(vectorSet->PerVectorDataSize(), (char*)(vectorSet->GetVector((SizeType)vid))) != vectorSet->PerVectorDataSize()) {
LOG(Helper::LogLevel::LL_Error, "Failed to write output file!\n");
exit(1);
}
}
}
double elapsedMinutes = sw.getElapsedMin();
LOG(Helper::LogLevel::LL_Info, "Total used time: %.2lf minutes (about %.2lf hours).\n", elapsedMinutes, elapsedMinutes / 60.0);
return ErrorCode::Success;
}
}
}
}
|
4200ad7faa522ef81a22e0dc8be9576f11c858a9
|
fc46c59352e198fbcf39b5c7979fa10df40457d5
|
/Graphics For Games/Graphics Coursework/Renderer.h
|
e7717161ad7fa1cb410d03a0c5814cb81f245a50
|
[] |
no_license
|
cometto2007/Graphics
|
7d2ba3f12b257030fb283ec757b0d8313b93e919
|
6d1e51d5b6a97e01c45a15d8d28088dc652c566c
|
refs/heads/master
| 2020-09-11T06:17:14.968041
| 2019-11-27T00:21:12
| 2019-11-27T00:21:12
| 221,967,965
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,681
|
h
|
Renderer.h
|
#pragma once
#include "../../nclgl/Frustum.h"
#include "../../nclgl/Camera.h"
#include "Landscape.h"
#include "Loader.h"
#include <algorithm>
#include "Rain.h"
#define SHADOWSIZE 2048
class Renderer : public OGLRenderer {
public:
int post_passes = 10;
void configureCameraPositions();
Renderer(Window& parent);
virtual ~Renderer(void);
virtual void RenderScene();
virtual void UpdateScene(float msec);
void toggleBlur() { isBlur = !isBlur; };
void toggleSplitScreen() { isSplitScreen = !isSplitScreen; };
void setPostPasses(int post_passes) { post_passes = post_passes; };
static void setCameraConfsIndex(Camera* cam, int i) {
cam->setCameraIndex(i);
};
static void setCameraAuto(Camera* cam, bool b) {
cam->setAutoCam(b);
};
void activateSlideshow(bool active);
void setCameraPosFromIndex(int i)
{
camera->setCameraIndex(i);
camera2->setCameraIndex(0);
};
protected:
Loader loader = Loader::getInstance();
Landscape* root;
Camera* camera;
Camera* camera2;
Mesh* quadPost;
Light* light;
Light* light2;
Rain* rain;
GLuint shadowTex;
GLuint shadowFBO;
GLuint bufferDepthTex;
GLuint bufferColourTex[2];
GLuint bufferFBO;
GLuint processFBO;
Frustum frameFrustum;
vector<SceneNode*> transparentNodeList;
vector<SceneNode*> nodeList;
bool isSplitScreen;
bool isBlur;
void DrawShadowScene();
void DrawCombinedScene();
void DrawSplitScreenScene();
void PresentScene();
void DrawPostProcess();
void DrawNode(SceneNode* n, bool isShadow);
void BuildNodeLists(SceneNode* from);
void SortNodeLists();
void ClearNodeLists();
void DrawNodes(bool isShadow);
void configureShadow();
void configurePostProcessing();
};
|
9101b40c6ddb5e3ab79ce154e15f85f1686e1c18
|
c92aeae16efe1dab64faffe9732d6d7ccfa9bccc
|
/CompilerTask/CompilerTask/SemanticsParser/IdentifierDefineListSemanticser.cpp
|
91f28accc9b0359166ca3b44854756878481cf43
|
[] |
no_license
|
ChinaZZH/MyCompilerTask
|
cda6420e3fe5d0d6c6181a98673b279fc1bd157e
|
51b837f330e9982261a08349dac2e0934281b06b
|
refs/heads/master
| 2021-01-19T01:28:10.239013
| 2016-05-22T02:58:54
| 2016-05-22T02:58:54
| 52,652,875
| 3
| 1
| null | null | null | null |
GB18030
|
C++
| false
| false
| 11,484
|
cpp
|
IdentifierDefineListSemanticser.cpp
|
#include "IdentifierDefineListSemanticser.h"
#include "SemanticsParserMgr.h"
#include "../SymbolTable/SymbolTable.h"
#include "../Log/LogFile.h"
#include "../SyntaxParser/SyntaxParser.h"
#include "../GlobalData/WordStreamTable.h"
#include "../Common/ErrorProcess.h"
IdentifierDefineListSemanticser::IdentifierDefineListSemanticser()
{
}
IdentifierDefineListSemanticser::~IdentifierDefineListSemanticser()
{
}
bool IdentifierDefineListSemanticser::processSemanticsParser()
{
bool bProcessSemanticser = false;
IdentifierListFlagHandler& flagIdStack = SemanticsParserMgrInst::instance().getIdentifierListFlagHandler();
eSemanticsStackIdFlag flagId = flagIdStack.getCurrentSemanticsParserId();
switch(flagId){
case eSPIF_EnumIdentifierListStart:
bProcessSemanticser = this->processEnumTypeIdentifierList();
break;
case eSPIF_RecordIdentifierListStart:
bProcessSemanticser = this->processRecordIdentifierList();
break;
case eSPIF_FieldOfRecordListStart:
bProcessSemanticser = this->processFieldOfRecordList();
break;
case eSPIF_ParamOfProcListStart:
case eSPIF_ParamOfFunctionListStart:
bProcessSemanticser = this->processParamTypeOfFunction();
break;
case eSPIF_VarIdentifierListStart:
bProcessSemanticser = this->processVarIdentifierList();
break;
case eSPIF_FileIdentifierListStart:
bProcessSemanticser = this->processFileIdentifierList();
break;
default:
bProcessSemanticser = true;
break;
}
return bProcessSemanticser;
}
// 标识符列表->标识符 012 标识符列表1 标识符列表1->, 标识符 012 标识符列表1
eSemansticeParserTypeValue IdentifierDefineListSemanticser::returnSemanticserEnumValue()
{
return eSemansticeParserTypeValue::eSPEV_IdentifierTypeDefineList;
}
bool IdentifierDefineListSemanticser::processEnumTypeIdentifierList()
{
bool bProcessSemanticser = false;
const CToken* pConstTokenWord = this->getTokenWordByLastWordIndex();
if(NULL == pConstTokenWord){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processEnumTypeIdentifierList pConstTokenWord null", __FILE__, __LINE__);
return bProcessSemanticser;
}
// 正在分析的过程Id
ProcStackParserHandler& procStackParserHandler = SemanticsParserMgrInst::instance().getProcStackParserHandler();
int nStackTopProcId = procStackParserHandler.getTopProcStackProcAddress();
if(nStackTopProcId < 0){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processEnumTypeIdentifierList getProcStackTop error", __FILE__, __LINE__);
return bProcessSemanticser;
}
// 是否同名
bool bCompareNameWithWord = checkCompareIsSameNameWithWord(nStackTopProcId, pConstTokenWord->m_szContentValue);
if(true == bCompareNameWithWord){
EmitErrorFile::EmitError("该标识符已经定义");
return bProcessSemanticser;
}
// 判断地址是否合法
int nNewlyEnumAddress = SymbolTableInst::instance().getEmptyOrNewEnumAddressValue();
if(nNewlyEnumAddress < 0){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processEnumTypeIdentifierList nNewlyEnumAddress error", __FILE__, __LINE__);
return bProcessSemanticser;
}
int nNewlyBeginEnumAddress = SymbolTableInst::instance().getNewEnumBeginAddressValue();
if((nNewlyEnumAddress - nNewlyBeginEnumAddress) > 256){
EmitErrorFile::EmitError("枚举类型已经超过标号最大个数的限制:256");
return bProcessSemanticser;
}
// 初始化内容
EnumInfo* pEmptyEnumValue = SymbolTableInst::instance().getEnumInfoByEnumAddress(nNewlyEnumAddress);
if(NULL == pEmptyEnumValue){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processEnumTypeIdentifierList pEmptyEnumValue null", __FILE__, __LINE__);
return bProcessSemanticser;
}
pEmptyEnumValue->initStrName(pConstTokenWord->m_szContentValue);
pEmptyEnumValue->initProcIndex(nStackTopProcId);
bProcessSemanticser = true;
return bProcessSemanticser;
}
bool IdentifierDefineListSemanticser::processRecordIdentifierList()
{
bool bProcessSemanticser = false;
const CToken* pParserWord = this->getTokenWordByLastWordIndex();
if(NULL == pParserWord){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processRecordIdentifierList pParserWord null", __FILE__, __LINE__);
return bProcessSemanticser;
}
TypeInfo* pUserDefineTypeInfo = this->getTypeInfoByParsingTypePosition();
if(NULL == pUserDefineTypeInfo){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processRecordIdentifierList pUserDefineTypeInfo null ", __FILE__, __LINE__);
return bProcessSemanticser;
}
FieldInfo newFieldInfo;
newFieldInfo.initStrName(pParserWord->m_szContentValue);
ProcStackParserHandler& procStackHandler = SemanticsParserMgrInst::instance().getProcStackParserHandler();
newFieldInfo.initProcIndex(procStackHandler.getTopProcStackProcAddress());
newFieldInfo.m_nProcessState = 0;
// 验证域名是否存在
FieldInfoVec& vecFieldInfo = pUserDefineTypeInfo->m_FieldInfo;
for(unsigned int i = 0; i < vecFieldInfo.size(); ++i){
const std::string& strFieldStringName = vecFieldInfo[i].m_strName;
int nCompareResult = strFieldStringName.compare(newFieldInfo.m_strName);
if(0 == nCompareResult){
std::string strErrorData("域名已经存在,重复定义 字段名:");
strErrorData.append(newFieldInfo.m_strName);
EmitErrorFile::EmitError(strErrorData);
return bProcessSemanticser;
}
}
vecFieldInfo.push_back(newFieldInfo);
bProcessSemanticser = true;
return bProcessSemanticser;
}
//变量列表的标识符
bool IdentifierDefineListSemanticser::processVarIdentifierList()
{
bool bProcessSemanticser = false;
const CToken* pConstTokenWord = this->getTokenWordByLastWordIndex();
if (NULL == pConstTokenWord){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processVarIdentifierList pConstTokenWord null", __FILE__, __LINE__);
return bProcessSemanticser;
}
// 正在分析的过程Id
ProcStackParserHandler& procStackParserHandler = SemanticsParserMgrInst::instance().getProcStackParserHandler();
int nStackTopProcId = procStackParserHandler.getTopProcStackProcAddress();
if(nStackTopProcId < 0){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processVarIdentifierList getProcStackTop error", __FILE__, __LINE__);
return bProcessSemanticser;
}
// 是否同名
bool bCompareNameWithWord = checkCompareIsSameNameWithWord(nStackTopProcId, pConstTokenWord->m_szContentValue);
if(true == bCompareNameWithWord){
return bProcessSemanticser;
}
// 检查完成 没有跟该变量名同名的 则将该变量放入变量表(存在,则定义失败)
VarInfo newVarInfo;
newVarInfo.initStrName(pConstTokenWord->m_szContentValue);
newVarInfo.initProcIndex(nStackTopProcId);
newVarInfo.m_eRank = VarInfo::eR_Var;
SymbolTableInst::instance().addNewVarToSpecficProcId(newVarInfo);
bProcessSemanticser = true;
return bProcessSemanticser;
}
//处理USES模块包含声明
bool IdentifierDefineListSemanticser::processFileIdentifierList()
{
bool bProcessSemanticser = false;
const CToken* pConstTokenWord = this->getTokenWordByLastWordIndex();
if (NULL == pConstTokenWord){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processFileIdentifierList pConstTokenWord null", __FILE__, __LINE__);
return bProcessSemanticser;
}
// 查询符号表是否已经包含该使用文件
int nUseFileAddressValue = SymbolTableInst::instance().searchUseFileTable(pConstTokenWord->m_szContentValue);
if(nUseFileAddressValue > 0){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processFileIdentifierList 模块已经包含了 null", __FILE__, __LINE__);
return bProcessSemanticser;
}
// 没有的话 符号表进行包含
SymbolTableInst::instance().addNewUseFlieData(pConstTokenWord->m_szContentValue);
bProcessSemanticser = true;
return bProcessSemanticser;
}
bool IdentifierDefineListSemanticser::processFieldOfRecordList()
{
bool bProcessSemanticser = false;
const CToken* pParserWord = this->getTokenWordByLastWordIndex();
if(NULL == pParserWord){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processRecordIdentifierList pParserWord null", __FILE__, __LINE__);
return bProcessSemanticser;
}
TypeInfo* pUserDefineTypeInfo = this->getTypeInfoByParsingTypePosition();
if(NULL == pUserDefineTypeInfo){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processRecordIdentifierList pUserDefineTypeInfo null ", __FILE__, __LINE__);
return bProcessSemanticser;
}
FieldOfRecordParserHandler& fieldOfRecordHandler = SemanticsParserMgrInst::instance().getFieldOfRecordParserHandler();
FieldInfo newFieldInfo;
newFieldInfo.initStrName(pParserWord->m_szContentValue);
ProcStackParserHandler& procStackHandler = SemanticsParserMgrInst::instance().getProcStackParserHandler();
newFieldInfo.initProcIndex(procStackHandler.getTopProcStackProcAddress());
newFieldInfo.m_nProcessState = 0;
newFieldInfo.m_strVarFieldConst = fieldOfRecordHandler.getConstFieldStackTop();
newFieldInfo.m_strVarFieldFlag = fieldOfRecordHandler.getFlagFieldStackTop();
// 验证域名是否存在
FieldInfoVec& vecFieldInfo = pUserDefineTypeInfo->m_FieldInfo;
for (unsigned int i = 0; i < vecFieldInfo.size(); ++i){
const std::string& strFieldStringName = vecFieldInfo[i].m_strName;
int nCompareResult = strFieldStringName.compare(newFieldInfo.m_strName);
if (0 == nCompareResult){
std::string strErrorData("域名已经存在,重复定义 字段名:");
strErrorData.append(newFieldInfo.m_strName);
EmitErrorFile::EmitError(strErrorData);
return bProcessSemanticser;
}
}
vecFieldInfo.push_back(newFieldInfo);
bProcessSemanticser = true;
return bProcessSemanticser;
}
bool IdentifierDefineListSemanticser::processParamTypeOfFunction()
{
bool bProcessSemanticser = false;
const CToken* pParserWord = this->getTokenWordByLastWordIndex();
if(NULL == pParserWord){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processParamTypeOfFunction pParserWord null", __FILE__, __LINE__);
return bProcessSemanticser;
}
ProcInfo* pNewProcInfo = SymbolTableInst::instance().getRecenetlyProcIndex();
if(NULL == pNewProcInfo){
LogFileInst::instance().logError("IdentifierDefineListSemanticser::processParamTypeOfFunction pNewProcInfo null", __FILE__, __LINE__);
return bProcessSemanticser;
}
// 校验
const ParaInfoVec& vecParamInfo = pNewProcInfo->m_ParaTable;
int nParamInfoSize = static_cast<int>(vecParamInfo.size());
for (int i = 0; i < nParamInfoSize; ++i){
const ParaInfo& checkParamInfo = vecParamInfo[i];
if(0 != checkParamInfo.m_strParamName.compare(pParserWord->m_szContentValue)){
EmitErrorFile::EmitError("标识符名已经存在");
return bProcessSemanticser;
}
}
// 将新的参数放入参数列表
ParaInfo::AssignType assignType = ParaInfo::VAR;
IdentifierListFlagHandler& identifierListHandler = SemanticsParserMgrInst::instance().getIdentifierListFlagHandler();
eSemanticsStackIdFlag flagValueOfIdentifier = identifierListHandler.getCurrentSemanticsParserId();
if(eSPIF_ParamOfProcListStart == flagValueOfIdentifier){
assignType = ParaInfo::VAL;
}
ParaInfo newParamInfo;
newParamInfo.m_strParamName = (pParserWord->m_szContentValue);
newParamInfo.m_eAssignType = assignType;
newParamInfo.m_nParamType = -1;
pNewProcInfo->m_ParaTable.push_back(newParamInfo);
bProcessSemanticser = true;
return bProcessSemanticser;
}
|
cb90398535a5b4045da923735767d1054a108ddc
|
8af0899645498df2ee91ef0b9d71242738ab3c7a
|
/Source/TestTaskAnvioVR/SlotsWidgetBase.h
|
3853ee88fcde40cc5400b08a4187ade26fbd79dd
|
[] |
no_license
|
lpestl/TestTaskAnvioVR
|
535547b39c75ee18fbc55837003975aec7151f26
|
6029a31db08095baf26dcc89bd77280a6f74f9c1
|
refs/heads/master
| 2023-07-20T09:25:07.901048
| 2019-06-17T11:24:05
| 2019-06-17T11:24:05
| 191,898,100
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 302
|
h
|
SlotsWidgetBase.h
|
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "SlotsWidgetBase.generated.h"
/**
*
*/
UCLASS()
class TESTTASKANVIOVR_API USlotsWidgetBase : public UUserWidget
{
GENERATED_BODY()
};
|
cf3309e0781ecc49467eb0b85b325cccbb114c07
|
dbaf034882bc34311cba72833d2c94b45765452d
|
/string/split.cpp
|
1d2bfc88a4ef18cada96bb6dd29196c3457cbafd
|
[] |
no_license
|
chikashimiyama/sandbox
|
ad5c3c1b08c52678ebc46df5fea64f6325743e5a
|
00c632114650ea166b8653030c4543286e0dda96
|
refs/heads/master
| 2016-09-06T17:13:47.954494
| 2015-03-24T15:48:09
| 2015-03-24T15:48:09
| 11,373,835
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 382
|
cpp
|
split.cpp
|
#include <string>
#include <sstream>
#include <iostream>
using namespace std;
int main(){
string str = "media direct-to-one interpolation";
istringstream iss(str);
while(iss.good()){
string split;
iss >> split;
cout << split << endl;
}
string s1 = "miyama";
string s2 = "chikashi";
if(s1 < s2){
cout << "true" << endl;
}
return 0;
}
|
c81e149d3341922f8338306c83d781c8581a303e
|
4f98a9bd165236fd5f4d12d6c2c852f42841f5a9
|
/rush01/GraphicalMode.cpp
|
68c586719144f4e69b1c19ace68ded842901ea30
|
[] |
no_license
|
tsergien/cpp_learning
|
74c0800b4b86fffc698de2de5ed3a094ad548b32
|
5cc814e65b486f1c1096902a08731f3fedc5d885
|
refs/heads/master
| 2020-04-01T17:15:45.084209
| 2018-10-17T10:26:00
| 2018-10-17T10:26:00
| 153,278,621
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,284
|
cpp
|
GraphicalMode.cpp
|
//
// Created by Andrii BYTKO on 13.10.2018.
//
#include "GraphicalMode.hpp"
GraphicalMode::GraphicalMode() {
HostnameModule hostname;
OsInfoModule os;
DateTimeModule date;
CPUModule cpu;
RAMModule ram;
DiskModule disk;
NetworkModule net;
hostname.set_data();
os.set_data();
date.set_data();
_loop = 1;
if (SDL_Init(SDL_INIT_EVERYTHING) != 0){
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
return ;
}
_win = SDL_CreateWindow("ft_gkrellm", 100, 100, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
if (_win == nullptr) {
logSDLError(std::cout, "CreateWindow");
return ;
}
_renderer = SDL_CreateRenderer(_win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
if (TTF_Init() != 0){
logSDLError(std::cout, "TTF_Init");
SDL_Quit();
return ;
}
//_renderer = SDL_CreateRenderer(_win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
SDL_Color color = { 255, 255, 255, 255 };
const std::string path = "./raleway/Raleway-Black.ttf";
_username = renderText("Username:", path,
color, 15, _renderer);
_username_v = renderText(hostname.get_user_s(), path,
color, 15, _renderer);
_hostname = renderText("Hostname:", path,
color, 15, _renderer);
_hostname_v = renderText(hostname.get_host_s(), path,
color, 15, _renderer);
_system = renderText("OsInfo", path,
color, 15, _renderer);
_system_v = renderText(os.get_system_version(), path,
color, 15, _renderer);
_kernel = renderText(os.get_kernel_version(), path,
color, 15, _renderer);
_dateTime = renderText("Date/Time", path,
color, 15, _renderer);
_date = renderText(date.get_date(), path,
color, 15, _renderer);
_time = renderText(date.get_time(), path,
color, 15, _renderer);
if (_username == nullptr || _hostname == nullptr){
TTF_Quit();
SDL_Quit();
return ;
}
//Get the texture w/h so we can center it in the screen
int iW, iH;
SDL_QueryTexture(_username, NULL, NULL, &iW, &iH);
_x = SCREEN_WIDTH / 2 - iW / 2;
_y = SCREEN_HEIGHT / 2 - iH / 2;
SDL_RenderClear(_renderer);
//We can draw our message as we do any other texture, since it's been
//rendered to a texture
renderTexture(_username, _renderer, _x - 100, _y - 400);
renderTexture(_username_v, _renderer, _x, _y - 400);
renderTexture(_hostname, _renderer, _x - 100, _y - 380);
renderTexture(_hostname_v, _renderer, _x, _y - 380);
renderTexture(_system, _renderer, _x, _y - 340);
renderTexture(_system_v, _renderer, _x - 40, _y - 320);
renderTexture(_kernel, _renderer, _x - 20, _y - 300);
renderTexture(_dateTime, _renderer, _x - 10, _y - 260);
renderTexture(_date, _renderer, _x - 40, _y - 240);
renderTexture(_time, _renderer, _x, _y - 220);
SDL_RenderPresent(_renderer);
}
void GraphicalMode::logSDLError(std::ostream &os, const std::string &msg) {
os << msg << " error: " << SDL_GetError() << std::endl;
}
SDL_Texture* GraphicalMode::loadTexture(const std::string &file, SDL_Renderer *ren)
{
//Initialize to nullptr to avoid dangling pointer issues
_texture = nullptr;
//Load the image
SDL_Surface *loadedImage = SDL_LoadBMP(file.c_str());
//If the loading went ok, convert to texture and return the texture
if (loadedImage != nullptr){
_texture = SDL_CreateTextureFromSurface(ren, loadedImage);
SDL_FreeSurface(loadedImage);
//Make sure converting went ok too
if (_texture == nullptr){
logSDLError(std::cout, "CreateTextureFromSurface");
}
}
else {
logSDLError(std::cout, "LoadBMP");
}
return _texture;
}
void GraphicalMode::renderTexture(SDL_Texture *tex, SDL_Renderer *ren, int x, int y)
{
SDL_Rect dst;
dst.x = x;
dst.y = y;
//Query the texture to get its width and height to use
SDL_QueryTexture(tex, NULL, NULL, &dst.w, &dst.h);
SDL_RenderCopy(ren, tex, NULL, &dst);
}
GraphicalMode& GraphicalMode::operator=(GraphicalMode const &other) {
_loop = other._loop;
_pic = other._pic;
_ren = other._ren;
_win = other._win;
return *this;
}
GraphicalMode::GraphicalMode(GraphicalMode const &other) {
*this = other;
return ;
}
SDL_Texture * GraphicalMode::renderText(const std::string &message, const std::string &fontFile, SDL_Color color,
int fontSize, SDL_Renderer *renderer)
{
//Open the font
TTF_Font *font = TTF_OpenFont(fontFile.c_str(), fontSize);
if (font == nullptr){
logSDLError(std::cout, "TTF_OpenFont");
return nullptr;
}
//We need to first render to a surface as that's what TTF_RenderText
//returns, then load that surface into a texture
SDL_Surface *surf = TTF_RenderText_Blended(font, message.c_str(), color);
if (surf == nullptr){
logSDLError(std::cout, "TTF_RenderText");
TTF_CloseFont(font);
return nullptr;
}
SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer, surf);
if (texture == nullptr){
logSDLError(std::cout, "CreateTexture");
}
//Clean up the surface and font
SDL_FreeSurface(surf);
TTF_CloseFont(font);
return texture;
}
void GraphicalMode::run() {
while(_loop)
{
while (SDL_PollEvent(&e) && _loop)
{
if (e.type == SDL_QUIT)
_loop = 0;
else if (e.type == SDL_KEYDOWN)
{
if (e.key.keysym.sym == SDLK_ESCAPE)
_loop = 0;
}
}
}
}
GraphicalMode::~GraphicalMode() {
SDL_DestroyWindow(_win);
SDL_Quit();
}
|
d51d591c7c01d2d94aae6b5914b4ece653e3a831
|
d70100fa746894bae2cf455953d7c74484fabddf
|
/destructor.cpp
|
9ef9c004d51a19b52d21b51a6ec34b3b76a1d401
|
[] |
no_license
|
tonyhoangdev/cpp_ipc
|
77cd365c8a294475985bda901fecf6b85ba60a4c
|
d920baf0106ac10e007888b2a0b3cf2069a14625
|
refs/heads/master
| 2020-06-02T04:00:55.679693
| 2019-06-09T16:22:28
| 2019-06-09T16:24:55
| 191,028,907
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 808
|
cpp
|
destructor.cpp
|
#include <iostream>
class BaseClass {
public:
BaseClass() {
std::cout << "Constructor Base Class" << std::endl;
}
virtual ~BaseClass() {
std::cout << "Destructor Base Class" << std::endl;
}
};
class DerivedClass : public BaseClass {
public:
DerivedClass() {
std::cout << "Constructor Derived Class" << std::endl;
}
virtual ~DerivedClass() {
std::cout << "Destructor Derived Class" << std::endl;
}
};
class DerivedClass2: public DerivedClass {
public:
DerivedClass2() {
std::cout << "Constructor Derived Class2" << std::endl;
}
virtual ~DerivedClass2() {
std::cout << "Destructor Derived Class2" << std::endl;
}
};
int main() {
BaseClass *base = new DerivedClass2();
delete base;
return 0;
}
|
8fa141eda8c32387d35a43321b79bda98d5f41a5
|
832023582a7d90c1ebaec5973faece820fd4ba2b
|
/practise/net/mc_tcp.cpp
|
1d3d4250e263801ccda280a3129fcf2afdd33358
|
[] |
no_license
|
starcity/mycode
|
9e2d0a67804c15294a5389fe39b5af2121afe702
|
5eef140bb1dd58f976a686711c2ee8954459f150
|
refs/heads/master
| 2021-01-23T03:53:28.228038
| 2020-02-28T08:25:37
| 2020-02-28T08:25:37
| 16,724,767
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 731
|
cpp
|
mc_tcp.cpp
|
#include "mc_tcp.h"
#define LISTEN_EVENTS 512
mc_tcp::mc_tcp(mc_tcp::TYPE type,const char *ip,uint16_t port)
{
m_type = type;
m_ip = inet_addr(ip);
m_port = port;
m_fd = socket(AF_INET, SOCK_STREAM, 0);
}
mc_tcp::~mc_tcp()
{
}
int32_t mc_tcp::init()
{
if( m_fd < 0 )
return m_fd;
struct sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_port = htons(m_port);
addr.sin_addr.s_addr = m_ip;
if(type == TCP_SERVER){
int ret = bind(m_fd,(struct sockaddr *)&addr,sizeof(addr));
if( ret < 0 )
return ret;
ret = listen(m_fd,LISTEN_EVENTS);
if( ret < 0 )
return ret;
}
else {
connect(m_fd,(struct sockaddr *)&addr,sizeof(addr));
}
return 0;
}
int32_t mc_tcp::get_socket_fd()
{
return m_fd;
}
|
3b719bd2ca2ba0d26ee82f0b694bba73d06bbed6
|
e0eb5d1a84daa73096a2e54f143d09f22e138a6c
|
/src/giovanni/robot_control.cc
|
bc6acfb67948a0e1cd74d188fc89abee85573e44
|
[] |
no_license
|
intsven/ARTPraktikum
|
18fa128eda83812ff2f04e74e105603f3b8c546c
|
9881ef1f0fb841f0e34c07c1fc0a200d2188917e
|
refs/heads/master
| 2022-12-21T09:56:33.058569
| 2020-09-29T11:47:43
| 2020-09-29T11:47:43
| 298,018,892
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,859
|
cc
|
robot_control.cc
|
#include <iostream>
using std::cerr;
using std::endl;
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
using std::max;
using std::min;
#include "gio_path.cpp"
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "nav_msgs/Odometry.h"
#include <tf/transform_broadcaster.h>
#include "volksbot/vels.h"
#include "volksbot/velocities.h"
#include "tf/transform_datatypes.h"
#include <tf/LinearMath/Matrix3x3.h>
#include <sstream>
ofstream giofile;
double gio_u = 0.0;
double gio_omega = 0.0;
double gio_vleft = 0.0;
double gio_vright = 0.0;
int drive_a_path = 0;
double x = 0, y = 0, theta = 0; //-1.51;
void odomCallback(const nav_msgs::Odometry::ConstPtr& msg)
{
x = msg->pose.pose.position.x;
y = msg->pose.pose.position.y;
theta = tf::getYaw(msg->pose.pose.orientation);
//x = (x * cos(theta)) + (y * sin(theta));
//y = (-x * sin(theta)) + (y * cos(theta));
ROS_INFO("Pose-> x: [%f], y: [%f], theta: [%f]", x, y, theta);
}
int main(int argc, char **argv)
{
double leftspeed, rightspeed, v_diff;
double scale_factor;
double u, omega;
double u_max = 1.0;
ros::init(argc, argv, "robot_control");
ros::NodeHandle n;
ros::Publisher vels_pub = n.advertise<volksbot::vels>("Vel", 100);
ros::Subscriber sub = n.subscribe("odom", 10, odomCallback);
ros::Rate loop_rate(5);
CGioController *gio_control = new CGioController(); // object and also init function
if (!gio_control->getPathFromFile("path.dat"))
cout<<"ERROR: Can not open GioPath File\n";
else
drive_a_path = 1;
gio_control->setCurrentVelocity(u_max);
gio_control->setAxisLength(0.485);
// debugging
giofile.open("pos_odom.dat");
int count = 0;
//loop
while (drive_a_path && ros::ok()) {
// gio_control->setPose(x * 0.001, y_from_encoder*0.001,theta_from_encoder);
gio_control->setPose(x, y, theta);
// get trajectory
if (gio_control->getNextState(gio_u, gio_omega, leftspeed, rightspeed, 0)==0) {
cout<<"finish";
drive_a_path = 0;
}
scale_factor = 1.0;
if (fabs(leftspeed) > u_max) scale_factor = fabs(u_max / leftspeed);
if (fabs(rightspeed) > u_max) scale_factor = fabs(u_max / rightspeed);
leftspeed *= scale_factor;
rightspeed *= scale_factor;
giofile << gio_u << " " << gio_omega << " "
<< x << " " << y << " " << theta << " "
<< leftspeed << " " << rightspeed << endl;
cout.flush();
giofile.flush();
double motor_scale = -20;
volksbot::vels velocity;
velocity.left = leftspeed * motor_scale;
velocity.right = rightspeed * motor_scale;
vels_pub.publish(velocity);
ros::spinOnce();
loop_rate.sleep();
++count;
}
volksbot::vels velocity;
velocity.left = 0;
velocity.right = 0;
vels_pub.publish(velocity);
giofile.close();
giofile.clear();
return 0;
}
|
68da57f0ff115623f9959602ce7d7a94fa05241c
|
16e90b3fb905350bdfe012f786ed24d83ee7d00c
|
/service/Exception.cc
|
e54d4a60117a9ccd121d816e2386bc6a5f42f6b0
|
[] |
no_license
|
lcls-daq/ami
|
b216fac06164d4e860d8bf385b381d01a15719da
|
4b46b80970fec84979be24eedea8639bd90a9748
|
refs/heads/master
| 2023-08-03T00:30:36.833126
| 2023-07-29T09:28:36
| 2023-07-29T09:28:36
| 87,128,480
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 296
|
cc
|
Exception.cc
|
#include "Exception.hh"
#include <string.h>
using namespace Ami;
Event::Event(const char* who, const char* what)
{
strncpy(_who , who , MaxLength);
strncpy(_what, what, MaxLength);
}
const char* Event::who () const { return _who ; }
const char* Event::what() const { return _what; }
|
0fc5c8e6974aef6b6c73d6bfcfc72f6e6755b94b
|
6e28829dbe2782de31b250ed60cad36fd4e3cdb1
|
/14-PokemonAR/Classes/Native/Bulk_Vuforia.UnityExtensions_2.cpp
|
c08cf780bb9f7c8084359252a8eebfd77e821140
|
[] |
no_license
|
henry2423/2018-Spring-Swift
|
b37f594db4420b5299bcf320b998565914f7399b
|
be2ff08c8486b05ed3c05f381d3c783b7442f97d
|
refs/heads/master
| 2021-01-24T04:20:21.495493
| 2018-06-23T16:23:46
| 2018-06-23T16:23:46
| 122,933,557
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 132
|
cpp
|
Bulk_Vuforia.UnityExtensions_2.cpp
|
version https://git-lfs.github.com/spec/v1
oid sha256:105bb51b7948cf60b33def7db8bdeeb5df65c51878c1932bba464b4d257dbfa8
size 1645637
|
cfadd4490934c38213edbc3af3d70cddfe20fddf
|
ca21d51502ca531a6190fba03df4a7e4ca4cc546
|
/src/sound/impl/mixer_core.h
|
0fe1fa16615e31ac881f2a6ee80f46a3922318c9
|
[] |
no_license
|
wothke/spectrezx
|
4b53e42dbf6d159a20b991a8082dc796ae15232c
|
1878c17cdb2619a1c90d60b101c4951c790e226b
|
refs/heads/master
| 2021-07-11T18:43:38.044905
| 2021-04-17T00:37:47
| 2021-04-17T00:37:47
| 36,067,729
| 8
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,842
|
h
|
mixer_core.h
|
/**
*
* @file
*
* @brief Declaration of fast mixer
*
* @author vitamin.caig@gmail.com
*
**/
#pragma once
//library includes
#include <sound/gain.h>
#include <sound/multichannel_sample.h>
//boost includes
#include <boost/static_assert.hpp>
namespace Sound
{
template<int_t ChannelsCount>
class MixerCore
{
public:
typedef boost::array<Gain, ChannelsCount> MatrixType;
typedef typename MultichannelSample<ChannelsCount>::Type InType;
MixerCore()
{
const Coeff val = Coeff(1, ChannelsCount);
for (uint_t inChan = 0; inChan != ChannelsCount; ++inChan)
{
CoeffRow& row = Matrix[inChan];
for (uint_t outChan = 0; outChan != row.size(); ++outChan)
{
row[outChan] = val;
}
}
}
Sample Mix(const InType& in) const
{
Coeff out[Sample::CHANNELS];
for (uint_t inChan = 0; inChan != ChannelsCount; ++inChan)
{
const int_t val = in[inChan];
const CoeffRow& row = Matrix[inChan];
for (uint_t outChan = 0; outChan != row.size(); ++outChan)
{
out[outChan] += row[outChan] * val;
}
}
BOOST_STATIC_ASSERT(Sample::CHANNELS == 2);
return Sample(out[0].Integer(), out[1].Integer());
}
void SetMatrix(const MatrixType& matrix)
{
for (uint_t inChan = 0; inChan != ChannelsCount; ++inChan)
{
const Gain& in = matrix[inChan];
CoeffRow& out = Matrix[inChan];
out[0] = Coeff(in.Left() / ChannelsCount);
out[1] = Coeff(in.Right() / ChannelsCount);
}
}
private:
static const int_t PRECISION = 256;
typedef Math::FixedPoint<int_t, PRECISION> Coeff;
typedef boost::array<Coeff, Sample::CHANNELS> CoeffRow;
typedef boost::array<CoeffRow, ChannelsCount> CoeffMatrix;
CoeffMatrix Matrix;
};
}
|
e225fac7041e8db2a524cdb595a30a9ba84e263b
|
a666a2bb3043ed12d58bd98d2e4325b0cd1f1986
|
/ch13.c++ primer/ex13_43.cpp
|
c8cc1d7d8c0733b7afbda412d2a5af28f19e5a64
|
[] |
no_license
|
uglychen/Cpp-Primer-5th-Edition-Answer
|
fe0b31e730374430c6630c96c034484a9ecda43d
|
3e34db06f8111dca02c141088fd3bcb10ff2fceb
|
refs/heads/master
| 2021-01-18T21:35:14.330782
| 2016-05-12T02:31:14
| 2016-05-12T02:31:14
| 32,642,450
| 1
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,769
|
cpp
|
ex13_43.cpp
|
#include <iostream>
#include <string>
#include <memory>
#include <utility>
#include <vector>
#include <algorithm>
class StrVec
{
public:
//! Big 3/5.
StrVec() :
element(nullptr), first_free(nullptr), cap(nullptr)
{}
StrVec(std::initializer_list<std::string> l);
StrVec(const StrVec& s);
StrVec& operator =(const StrVec& rhs);
~StrVec();
//! public members
void push_back(const std::string &s);
std::size_t size() const { return first_free - element; }
std::size_t capacity() const { return cap - element; }
std::string* begin() const { return element; }
std::string* end() const { return first_free; }
//! preallocate enough memory for specified number of elements
void reserve(std::size_t n);
//! resize as required.
void resize(std::size_t n);
void resize(std::size_t n, const std::string& s);
private:
//! data members
std::string* element; // pointer to the first element
std::string* first_free; // pointer to the first free element
std::string* cap; // pointer to one past the end
std::allocator<std::string> alloc;
//! utilities for Big 3/5
void reallocate();
void chk_n_alloc() { if (size() == capacity()) reallocate(); }
void free();
//! utilities added
//! used in reallocate() reserve() and resize().
void wy_alloc_n_move(std::size_t n);
std::pair<std::string*, std::string*>
alloc_n_copy(std::string* b, std::string* e);
};
//! copy constructor
StrVec::StrVec(const StrVec &s)
{
/**
* @brief newData is a pair of pointers pointing to newly allocated and copied
* range : [b, e)
*/
std::pair<std::string*, std::string*>
newData = alloc_n_copy(s.begin(), s.end());
element = newData.first;
first_free = cap = newData.second;
}
/**
* @brief constructor taking initializer_list<string>
* for ex 13.40
* @param l
*/
StrVec::StrVec(std::initializer_list<std::string> l)
{
//! allocate memory as large as l.size()
std::string * const
newData = alloc.allocate(l.size());
//! copy elements from l to the address allocated
auto p = newData;
for (const auto &s : l)
alloc.construct(p++, s);
//! build the data structure
element = newData;
first_free = cap = element + l.size();
}
//! operator =
StrVec&
StrVec::operator =(const StrVec& rhs)
{
//! allocate and copy first to protect against self-assignment
std::pair<std::string*, std::string*>
newData = alloc_n_copy(rhs.begin(), rhs.end());
//! destroy and deallocate
free();
element = newData.first;
first_free = cap = newData.second;
return *this;
}
//! destructor
StrVec::~StrVec()
{
free();
}
/**
* @brief allocate new room if nessary and push back the new string
* @param s new string
*/
void StrVec::push_back(const std::string& s)
{
chk_n_alloc();
alloc.construct(first_free++, s);
}
/**
* @brief preallocate enough memory for specified number of elements
* @param n number of elements required
* @note this function is implemented refering to StrVec::reallocate().
*/
void StrVec::reserve(std::size_t n)
{
//! if the n is too small, just ignore it.
if (n <= capacity()) return;
//! allocate and move old ones into the new address.
wy_alloc_n_move(n);
}
/**
* @brief Resizes to the specified number of elements.
* @param n Number of elements the %vector should contain.
*
* This function will resize it to the specified
* number of elements. If the number is smaller than the
* current size it is truncated, otherwise
* default constructed elements are appended.
*/
void StrVec::resize(std::size_t n)
{
resize(n, std::string());
}
/**
* @brief Resizes it to the specified number of elements.
* @param __new_size Number of elements it should contain.
* @param __x Data with which new elements should be populated.
*
* This function will resize it to the specified
* number of elements. If the number is smaller than the
* current size the it is truncated, otherwise
* the it is extended and new elements are populated with
* given data.
*/
void StrVec::resize(std::size_t n, const std::string &s)
{
if (n < size())
{
//! destroy the range : [element+n, first_free) using destructor
for (auto p = element + n; p != first_free; /* empty */)
alloc.destroy(p++);
//! move frist_free point to the new address element + n
first_free = element + n;
}
else if (n > size())
{
for (auto i = size(); i != n; ++i)
push_back(std::string(s));
}
}
/**
* @brief Double the capacity and using std::move move the original strings to the newly
* allocated memory
*/
void StrVec::reallocate()
{
//! calculate the new capacity required.
std::size_t newCapacity = size() ? 2 * size() : 1;
//! allocate and move old ones into the new address.
wy_alloc_n_move(newCapacity);
}
/**
* @brief allocate new space for the given range and copy them into it
* @param b
* @param e
* @return a pair of pointers pointing to [first element , one past the last) in the new space
*/
std::pair<std::string *, std::string *>
StrVec::alloc_n_copy(std::string *b, std::string *e)
{
//! calculate the size needed and allocate space accordingly
std::string* data = alloc.allocate(e - b);
return{ data, std::uninitialized_copy(b, e, data) };
//! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//! which copies the range [first,last) into the space of which
//! the starting address p_data is pointing to.
//! This function returns a pointer pointing to one past the last element.
}
/**
* @brief destroy the elements and deallocate the space previously allocated.
*/
void StrVec::free()
{
if (element) // if not nullptr
{
//! destory it in reverse order.
for (auto p = first_free; p != element; /* empty */)
alloc.destroy(--p);
// std::for_each(&element, &first_free, [&](std::string* p){
// alloc.destroy(p);
// });
alloc.deallocate(element, capacity());
}
}
/**
* @brief allocate memory for spicified number of elements
* @param n
* @note it's user's responsibility to ensure that @param n is greater than
* the current capacity.
*/
void StrVec::wy_alloc_n_move(std::size_t n)
{
std::size_t newCapacity = n;
std::string*
newData = alloc.allocate(newCapacity);
std::string*
dest = newData;
std::string*
elem = element;
//! move the old to newly allocated space.
for (std::size_t i = 0; i != size(); ++i)
alloc.construct(dest++, std::move(*elem++));
free();
//! update data structure
element = newData;
first_free = dest;
cap = element + newCapacity;
}
int main()
{
StrVec v{ "1\n", "2\n", "3\n", "4\n", "5\n" }, v2;
v = v2;
v.push_back("alan\n");
std::cout << v.size() << "\n";
std::cout << v.capacity() << "\n";
std::cout << "=============\n";
for (const auto &s : v)
std::cout << s;
return 0;
}
|
e4602bd04df190532ac9d62b3ea52ce7434e354e
|
79691efa7e09766474403b513126d07482fdb561
|
/Yahtzee/main.cpp
|
d5e2da6bbd17ed6d0774e3048db2a5b304af9492
|
[] |
no_license
|
yerlanyr/uva-submissions
|
fb1baab448b5c298ef747a731c2bf729ad3e4980
|
c46f69449ff6afee9dce402fa26875dcf87ea770
|
refs/heads/master
| 2020-04-21T07:50:20.159019
| 2019-10-15T05:00:26
| 2019-10-15T05:00:26
| 169,402,059
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,151
|
cpp
|
main.cpp
|
#include<sstream>
#include<iterator>
#include<functional>
#include<map>
#include<cassert>
#include<iostream>
#include<vector>
#include<set>
#include<cmath>
using namespace std;
map<int,int> getCount(vector<int> cube){
map<int,int> count;
for(int x:cube){
count[x]++;
}
return count;
}
int ofAKind(int i,vector<int> cube, int res){
auto count = getCount(cube);
for(auto x: count){
if(x.second >=i) return res;
}
return 0;
}
int longestSequence(vector<int> cube){
auto count = getCount(cube);
int len = 1;
int maxLen = 0;
for(int i=1;i<6;i++){
if(count.count(i) && count.count(i+1)){
len ++;
maxLen = max(len, maxLen);
} else {
len = 1;
}
}
return maxLen;
}
int getScore(int category, vector<int> cube){
int res = 0;
switch(category){
case 6:
for(int x: cube){
res += x;
}
return res;
case 7:
return ofAKind(3, cube, getScore(6, cube));
case 8:
return ofAKind(4, cube, getScore(6, cube));
case 9:
return ofAKind(5, cube, 50);
case 10:
if(longestSequence(cube) >= 4) return 25;
else return 0;
case 11:
if(longestSequence(cube) >= 5) return 35;
else return 0;
case 12:
{
auto count = getCount(cube);
bool hasThree = false, hasFive= false, hasTwo= false;
for(auto x: count){
if(x.second == 2) hasTwo = true;
if(x.second == 3) hasThree = true;
if(x.second == 5) hasFive = true;
}
if((hasTwo && hasThree) || hasFive) return 40;
return 0;
}
default: // 0 - 5
for(int x: cube){
if(x == (category + 1)){
res += x;
}
}
return res;
}
}
vector<int> getHighestScore(vector<vector<int> > cubes){
map<pair<int, int>, vector<int> > memo;
vector<vector<int> > ratings(13,vector<int>(13, 0));
for(int cubeI=0;cubeI<13;cubeI++){
for(int categoryI = 0; categoryI < 13; categoryI++){
ratings[cubeI][categoryI] = getScore(categoryI, cubes[cubeI]);
}
}
function<vector<int>(int, int)> subProblema = [&](int cubesLeft, int category){
auto key = make_pair(cubesLeft, category);
if(memo.count(key)){
return memo[key];
}
if(category == 0){
vector<int> score(15,0);
score[0] = ratings[(int)log2(cubesLeft)][0];
score[14] = score[0];
return score;
}
vector<int> maxScore(15,0);
for(int i=0;i<13;i++){
if(0 == (cubesLeft & (1<<i))){
continue;
}
auto subScore = subProblema(cubesLeft ^ (1<<i), category - 1);
subScore[category] = ratings[i][category];
subScore[14] += ratings[i][category];
if(category == 5 && subScore[14] >= 63){
subScore[13] = 35;
subScore[14] += subScore[13];
}
if(maxScore[14] < subScore[14]){
maxScore = subScore;
}
}
memo[key] = maxScore;
return maxScore;
};
return subProblema(((1<<13) - 1), 12);
}
int main(){
int t = 0;
cin >> t;
cin.ignore();
string line;
vector<vector<int> > cubes;
while(true){
getline(cin, line);
if(line == "") break;
istringstream ss(line);
vector<int> cube(5);
for(int i=0;i<5;i++) ss >> cube[i];
cubes.push_back(cube);
if(cubes.size() == 13){
bool first = true;
ostringstream result;
ostream_iterator<int> oit(result, " ");
auto highestScore = getHighestScore(cubes);
copy(highestScore.begin(), highestScore.end(), oit);
cout << result.str().substr(0, result.str().length() - 1) << endl;
cubes.clear();
}
}
}
|
bf2b9fe16c6b5d4b95ae71ad795ee9f0a3c77f25
|
6bcdb9e8836cd60e972be865beb50fbfefdfa650
|
/libs/core/include/fcppt/detail/string_literal.hpp
|
1ed7eacebb845944c394ec3ea7632350580402b7
|
[
"BSL-1.0"
] |
permissive
|
pmiddend/fcppt
|
4dbba03f7386c1e0d35c21aa0e88e96ed824957f
|
9f437acbb10258e6df6982a550213a05815eb2be
|
refs/heads/master
| 2020-09-22T08:54:49.438518
| 2019-11-30T14:14:04
| 2019-11-30T14:14:04
| 225,129,546
| 0
| 0
|
BSL-1.0
| 2019-12-01T08:31:12
| 2019-12-01T08:31:11
| null |
UTF-8
|
C++
| false
| false
| 872
|
hpp
|
string_literal.hpp
|
// Copyright Carl Philipp Reh 2009 - 2018.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef FCPPT_DETAIL_STRING_LITERAL_HPP_INCLUDED
#define FCPPT_DETAIL_STRING_LITERAL_HPP_INCLUDED
#include <fcppt/config/external_begin.hpp>
#include <type_traits>
#include <fcppt/config/external_end.hpp>
namespace fcppt
{
namespace detail
{
template<
typename Type
>
inline
std::enable_if_t<
std::is_same_v<
Type,
char
>,
char const *
>
string_literal(
char const *const _literal,
wchar_t const *
)
{
return
_literal;
}
template<
typename Type
>
inline
std::enable_if_t<
std::is_same_v<
Type,
wchar_t
>,
wchar_t const *
>
string_literal(
char const *,
wchar_t const *const _literal
)
{
return
_literal;
}
}
}
#endif
|
ce58f4c73603d794bf02c6bc529f6a97e8dd4bfc
|
8402b846cd8f86034d16d72809a1483c603a9019
|
/XSY/2305.cpp
|
e7a64ef2990a3a7e2a53e62320afebd09297e962
|
[] |
no_license
|
syniox/Online_Judge_solutions
|
6f0f3b5603c5e621f72cb1c8952ffbcbb94e3ea6
|
c4265f23823e7f1c87141f5a7429b8e55e906ac6
|
refs/heads/master
| 2021-08-29T05:40:06.071468
| 2021-08-28T03:05:28
| 2021-08-28T03:05:28
| 136,417,266
| 2
| 3
| null | 2018-06-10T09:33:57
| 2018-06-07T03:31:17
|
C++
|
UTF-8
|
C++
| false
| false
| 3,901
|
cpp
|
2305.cpp
|
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <set>
typedef long long lint;
const int N=1e5+5;
const int M=505;
int n,m,jmp[M];
struct vec{
int x,y;
friend vec operator - (const vec &a,const vec &b){
return (vec){a.x-b.x,a.y-b.y};
}
friend bool operator < (const vec &a,const vec &b){
return a.x==b.x?a.y<b.y:a.x<b.x;
}
friend bool operator == (const vec &a,const vec &b){
return a.x==b.x&&a.y==b.y;
}
}pnt[M],bd[N];
std::set <vec> wpos;
inline int nxi(){
int x=0;
char c;
while(((c=getchar())>'9'||c<'0')&&c!='-');
const bool f=(c=='-')&&(c=getchar());
while(x=x*10-48+c,(c=getchar())>='0'&&c<='9');
return f?-x:x;
}
template <class T> inline void apn(T &x,const T y){
x>y?x=y:0;
}
inline bool _vec_cp_pos(const vec &a,const vec &b){
return a.x==b.x?a.y<b.y:a.x<b.x;
}
inline lint crs(const vec &a,const vec &b){
return (lint)a.x*b.y-(lint)a.y*b.x;
}
int andrew(vec *v,int &n){
static vec que[N];
std::sort(v+1,v+n+1,_vec_cp_pos);
int top=0;
for(int i=1; i<=n; ++i){
for(; top>1&&crs(que[top]-que[top-1],v[i]-que[top-1])<=0; --top);
que[++top]=v[i];
}
int turn_p=top;
for(int i=n-1; i>1; --i){
for(; top>turn_p&&crs(que[top]-que[top-1],v[i]-que[top-1])<=0; --top);
que[++top]=v[i];
}
for(; top>turn_p&&crs(que[top]-que[top-1],que[1]-que[top-1])<=0; --top);
n=0;
for(int i=1; i<=top; ++i){
if(i!=1&&que[i]==que[i-1]&&i<=turn_p) --turn_p;
else v[++n]=que[i];
}
return turn_p;
}
bool bd_same(){
for(int i=2; i<=n; ++i){
if(!(bd[i]==bd[1])) return 0;
}
for(int i=1; i<=m; ++i){
if(bd[1]==pnt[i]) return 1;
}
return 0;
}
inline bool inside(const vec &x,const vec *v,const int len,const int turn_p){
if(x.x<v[1].x||x.x>v[turn_p].x) return 0;
if(v[1].x==x.x&&v[len].x==x.x){
return v[1].y<=x.y&&v[len].y>=x.y;
}
if(turn_p>1&&v[turn_p].x==x.x&&v[turn_p-1].x==x.x){
return v[turn_p].y>=x.y&&v[turn_p-1].y<=x.y;
}
//考虑边界
{
int l=1,r=turn_p,mid;
//线段左端点
//最后一个横座标小于x的点(在边界处卡成等于)
while(l!=r){
mid=(l+r+1)>>1;
if(v[mid].x>=x.x) r=mid-1;
else l=mid;
}
assert(l!=turn_p);
if(crs(v[l+1]-v[l],x-v[l])<0) return 0;
}
{
int l=turn_p,r=len,mid;
//线段右端点
//最后一个横座标大于x的点(在边界处卡成等于)
while(l!=r){
mid=(l+r+1)>>1;
if(v[mid].x<=x.x) r=mid-1;
else l=mid;
}
if(crs(v[l==len?1:l+1]-v[l],x-v[l])<0) return 0;
}
return 1;
}
int prework(){
int turn_pt=andrew(pnt,m);
if(m==1) return -bd_same();
andrew(bd,n);
for(int i=1; i<=n; ++i){
if(!inside(bd[i],pnt,m,turn_pt)) return 0;
}
return 1;
}
inline bool need_go(const vec &pre,const vec &nxt,const vec &cur){
if(nxt==cur) return 0;
return crs(pre-cur,nxt-cur)<=0;
}
bool getjmp(){
for(int i=1,j=1,k=1; i<=m; ++i){
//j: 内凸包最近点
for(; j<n&&need_go(bd[j],bd[j+1],pnt[i]); ++j);
if(j==n&&need_go(bd[n],bd[1],pnt[i])){
for(j=1; j<n&&need_go(bd[j],bd[j+1],pnt[i]); ++j);
}
for(; k<m&&crs(bd[j]-pnt[i],pnt[k+1]-pnt[i])<=0; ++k);
if(k==m&&i!=1&&crs(bd[j]-pnt[i],pnt[1]-pnt[i])<=0){
for(k=1; k+1<i&&crs(bd[j]-pnt[i],pnt[k+1]-pnt[i])<=0; ++k);
}
jmp[i]=k;
if(k==i) ++k;
}
return 1;
}
inline int getans(const int p){
int res=0,step=0;
for(int x=p; step<m; x=jmp[x]){
++res;
if(jmp[x]==x) return 1e9;
step+=(jmp[x]-x+m)%m;
}
return res;
}
int main(){
#ifndef ONLINE_JUDGE
freopen("d.in","r",stdin);
#endif
n=nxi(),m=nxi();
if(!n||!m){
puts(n?"-1":"0");
return 0;
}
for(int i=1; i<=n; ++i){
bd[i].x=nxi(),bd[i].y=nxi();
}
for(int i=1; i<=m; ++i){
pnt[i].x=nxi(),pnt[i].y=nxi();
}
if(bd_same()){
puts("1");
return 0;
}
switch(prework()){
case -1: puts("1"); return 0;
case 0: puts("-1"); return 0;
}
getjmp();
int ans=1e9;
for(int i=1; i<=m; ++i){
apn(ans,getans(i));
}
printf("%d\n",ans==1e9?-1:ans);
return 0;
}
|
4659e8c703c60e8c04d16ad409816d536ababc9c
|
95a43c10c75b16595c30bdf6db4a1c2af2e4765d
|
/codecrawler/_code/hdu4939/16215012.cpp
|
d0a9978ff7e5630ee2e49ea938050e1176f28f6d
|
[] |
no_license
|
kunhuicho/crawl-tools
|
945e8c40261dfa51fb13088163f0a7bece85fc9d
|
8eb8c4192d39919c64b84e0a817c65da0effad2d
|
refs/heads/master
| 2021-01-21T01:05:54.638395
| 2016-08-28T17:01:37
| 2016-08-28T17:01:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,220
|
cpp
|
16215012.cpp
|
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 1505;
typedef __int64 LL;
LL dp[N][N];
int main()
{
LL x, y, z, t, n, i, j;
int T, cas = 0;
scanf("%d",&T);
while(T--)
{
scanf("%I64d%I64d%I64d%I64d%I64d",&n,&x,&y,&z,&t);
memset(dp, 0, sizeof(dp));
LL ans = n * t * x; //å
¨é¨æ¾çº¢å¡
for(i = 1; i <= n; i++) //åi个åä½é¿åº¦
{
for(j = 0; j <= i; j++) // è塿°é
{
if(j == 0)
dp[i][j] = dp[i-1][j] + (i - j - 1) * y * t;
else
{
LL tmp1 = dp[i-1][j-1] + (i - j) * y * (t + (j - 1) * z); //第j个åä½é¿åº¦æ¾èå¡
LL tmp2 = dp[i-1][j] + (i - j - 1) * y * (t + j * z); //第j个åä½é¿åº¦ä¸æ¾èå¡
dp[i][j] = max(tmp1, tmp2);
}
ans = max(ans, dp[i][j] + (n - i) * x * (t + j * z) + (n - i) * (t + j * z) * (i - j) * y);
}
}
printf("Case #%d: %I64d\n", ++cas, ans);
}
return 0;
}
|
23710ea557dde050023f28e045020851d1d00722
|
033beb1ecf6dd347a4fe608ef33a2a224776ef69
|
/darknet/src/main.cc
|
9fbdceedb370e2421f4815e91d16c8026f0faad7
|
[
"MIT"
] |
permissive
|
MojaX2/vision_module
|
b9ab9a87af8b3e29a0cc84cb8dad05b998b56d7f
|
607bbcc9a799c47ac2cd6d142d68d0d47a457e36
|
refs/heads/master
| 2020-04-01T19:36:14.039736
| 2018-10-24T15:42:25
| 2018-10-24T15:42:25
| 153,562,271
| 0
| 0
| null | 2018-10-18T04:10:57
| 2018-10-18T04:10:57
| null |
UTF-8
|
C++
| false
| false
| 10,037
|
cc
|
main.cc
|
// Begin Main.cpp
#include <ros/ros.h>
#include <std_srvs/Trigger.h>//追加トゥアン
#include <dynamic_reconfigure/server.h>
#include <vision_module/darknetConfig.h>
#include <config.h>
#include <vision_module/VisionOrder.h>
#include <vision_module/ImageInfo.h>
#include <vision_module/ObjectInfo.h>
#include <vision_module/common/VisionProcess.h>
#include <vision_module/common/ROSImageConverter.h>
#include <darknet/detector_class.h>
#include <vector>
#include <string>
#include <algorithm>
#define CV_OBJECT_WINDOW "ObjectImage"
#define NODE_NAME "darknet"
#define OBJECT_DETECTION vision_module::VisionOrder::OBJECT_DETECTION
#define SUB_TOPIC vision_module::VisionOrder::IMAGE_CAPTURE_INFO.c_str()
#define PUB_TOPIC vision_module::VisionOrder::OBJECT_DETECTION_INFO.c_str()
bool closer(const vision_module::ObjectData &left,
const vision_module::ObjectData &right){
return left.camera.z < right.camera.z;
}
template <class SUB, class PUB>
class CProcess : public CVisionProcess<SUB, PUB> {
public:
CProcess(const char *nodeName,
const char *subTopic, const char *pubTopic);
~CProcess();
protected:
CDetector net;
float m_maxWidth;
float m_maxHeight;
float m_minHeight;
float m_maxDepth;
int m_numPoint;
float m_maxDist;
bool m_display;
bool m_server_command; //追加トゥアン
dynamic_reconfigure::Server<
vision_module::darknetConfig> m_server;
dynamic_reconfigure::Server<
vision_module::darknetConfig>::CallbackType m_f;
float dotProduct(vision_module::Vector vec1, vision_module::Vector vec2);
public:
friend vision_module::Vector operator-(const vision_module::Vector &vec1,
const vision_module::Vector &vec2);
//追加トゥアン
bool start_call(std_srvs::Trigger::Request &req,
std_srvs::Trigger::Response &res);
bool stop_call(std_srvs::Trigger::Request &req,
std_srvs::Trigger::Response &res);
//追加トゥアン
void callback(const SUB &msg);
void dcfg(vision_module::darknetConfig &config,
uint32_t level);
};
int main(int argc, char **argv){
ros::init(argc, argv, NODE_NAME);
CProcess<vision_module::ImageInfoConstPtr,
vision_module::ObjectInfo> proc(NODE_NAME, SUB_TOPIC, PUB_TOPIC);
//追加トゥアン
ros::NodeHandle n;
ros::ServiceServer service_start = n.advertiseService("darknet/start", &CProcess<vision_module::ImageInfoConstPtr,
vision_module::ObjectInfo>::start_call, &proc);
ros::ServiceServer service_stop = n.advertiseService("darknet/stop", &CProcess<vision_module::ImageInfoConstPtr,
vision_module::ObjectInfo>::stop_call, &proc);
//追加トゥアン
ros::spin();
return 0;
}
template <class SUB, class PUB>
CProcess<SUB, PUB>::CProcess(const char *nodeName,
const char *subTopic, const char *pubTopic)
: CVisionProcess<SUB, PUB>(nodeName,
subTopic, pubTopic),
net(COCO_DATA, YOLO_CFG, WEIGHT, THRESH) {
m_server_command = true;//追加トゥアン
m_f = boost::bind(&CProcess::dcfg, this, _1, _2);
m_server.setCallback(m_f);
}
template <class SUB, class PUB>
CProcess<SUB, PUB>::~CProcess(){
}
//追加トゥアン
template <class SUB, class PUB>
bool CProcess<SUB, PUB>::start_call(std_srvs::Trigger::Request &req,
std_srvs::Trigger::Response &res)
{
m_server_command = true;
return true;
}
template <class SUB, class PUB>
bool CProcess<SUB, PUB>::stop_call(std_srvs::Trigger::Request &req,
std_srvs::Trigger::Response &res)
{
m_server_command = false;
return true;
}
//追加トゥアン
template <class SUB, class PUB>
float CProcess<SUB, PUB>::dotProduct(vision_module::Vector vec1,
vision_module::Vector vec2){
return (vec1.x * vec2.x) + (vec1.y * vec2.y) + (vec1.z * vec2.z);
}
vision_module::Vector operator-(const vision_module::Vector &vec1,
const vision_module::Vector &vec2){
vision_module::Vector result;
result.x = vec1.x - vec2.x;
result.y = vec1.y - vec2.y;
result.z = vec1.z - vec2.z;
return result;
}
template <class SUB, class PUB>
void CProcess<SUB, PUB>::callback(const SUB &msg){
if (m_server_command){//追加トゥアン
int image_size = msg->width * msg->height;
CvPoint3D32f points[image_size];
vision_module::ObjectInfo res;
cv::Mat colorMat = cv::Mat::zeros(msg->height, msg->width, CV_8UC3);
cv::Mat objectMat = cv::Mat::zeros(msg->height, msg->width, CV_8UC3);
int objCount = 0;
try{
//メッセージをOpenCV形式に変換
if(convertToCvPC(msg, points, image_size));
else throw "convertTo";
if(convertToMat(msg, colorMat));
else throw "convertToMat";
objectMat = colorMat.clone();
//タイムスタンプを受け継ぐ
res.header = msg->header;
//darknetによる物体検出
net.detect(colorMat);
//処理結果を取得
std::vector<cv::Mat> rois = net.getRois();
std::vector<float> probs = net.getProbs();
std::vector<std::string> names = net.getNames();
std::vector<struct bbox> bboxes = net.getBBoxes();
objCount = rois.size();
res.objects.clear();
//検出された物体ごとに処理
for(int i = 0; i < objCount; i++){
vision_module::ObjectData data;
data.szwht.x = 0.0;
data.szwht.y = 0.0;
data.szwht.z = 0.0;
data.normal.x = 0.0;
data.normal.y = 0.0;
data.normal.z = 0.0;
data.planeNum = -1;
data.width = rois[i].cols;
data.height = rois[i].rows;
setToVector(rois[i], data.bgr);
struct bbox bbox = bboxes[i];
int centerX = (bbox.left + bbox.right) / 2;
int centerY = (bbox.top + bbox.bottom) / 2;
CvPoint3D32f p = points[(centerY * msg->width) + centerX];
data.camera.x = p.x;
data.camera.y = p.y;
data.camera.z = p.z;
char t[128];
sprintf(t, "%s: %.3f", names[i].c_str(), probs[i]);
int top = bbox.top;
if(top + 20 < msg->height)top += 20;
else top = msg->height - 1;
vision_module::NBest generic;
generic.id = -1;
generic.name = names[i];
generic.score = probs[i];
data.generic.push_back(generic);
// point cloudが取得できなかった物体を白で囲む publishはしない
if(data.camera.x == 0 && data.camera.y == 0 && data.camera.x==0){
cv::rectangle(objectMat,
cv::Point(bbox.left, bbox.top),
cv::Point(bbox.right, bbox.bottom),
cv::Scalar(200, 200, 200), 1, 4);
cv::putText(objectMat, t,
cv::Point(bbox.left, top),
cv::FONT_HERSHEY_SIMPLEX, 0.6,
cv::Scalar(200, 200, 200), 1, CV_AA);
// personのみ緑枠
}else if(strcmp(names[i].c_str(), "person") == 0){
cv::rectangle(objectMat,
cv::Point(bbox.left, bbox.top),
cv::Point(bbox.right, bbox.bottom),
cv::Scalar(0, 200, 0), 1, 4);
cv::putText(objectMat, t,
cv::Point(bbox.left, top),
cv::FONT_HERSHEY_SIMPLEX, 0.6,
cv::Scalar(0, 200, 0), 1, CV_AA);
res.objects.push_back(data);
}else{
cv::rectangle(objectMat,
cv::Point(bbox.left, bbox.top),
cv::Point(bbox.right, bbox.bottom),
cv::Scalar(0, 0, 200), 1, 4);
cv::putText(objectMat, t,
cv::Point(bbox.left, top),
cv::FONT_HERSHEY_SIMPLEX, 0.6,
cv::Scalar(0, 0, 200), 1, CV_AA);
res.objects.push_back(data);
}
// res.objects.push_back(data);
}
//近い順にソート
std::sort(res.objects.begin(), res.objects.end(), closer);
//publish
this->_pub.publish(res);
/*
//処理結果をプリント
// printf("-------%s: NUM OF OBJECTS: %d-------\n",
// this->_nodeName, objCount);
//
// for(int i = 0; i < objCount; i++){
// vision_module::ObjectData *data = &res.objects[i];
// ROS_INFO("%s : NUM_OBJ %d:\n\
// POS %.2f, %.2f, %.2f: NORMAL %.2f, %.2f, %.2f: PlaneNum %2d\n\
// SIZE %.2f, %.2f, %.2f",
// this->_nodeName, i,
// data->camera.x, data->camera.y, data->camera.z,
// data->normal.x, data->normal.y, data->normal.z,
// data->planeNum,
// data->szwht.x, data->szwht.y, data->szwht.z);
// }
// printf("\n");
*/
//処理結果を保存
cv::imwrite(OBJECT_IMAGE, objectMat);
//処理結果を表示
if(m_display){
cv::imshow(CV_OBJECT_WINDOW, objectMat);
cv::waitKey(10);
}
}catch(char *e){
ROS_ERROR("ERROR: %s : %s", this->_nodeName, e);
}
}//追加トゥアン
}
template <class SUB, class PUB>
void CProcess<SUB, PUB>::dcfg(vision_module::darknetConfig &config,
uint32_t level){
ROS_INFO("\
Reconfigure Request: %s\n\
MAX_WIDTH : %f\n\
MAX_HEIGHT: %f\n\
MIN_HEIGHT: %f\n\
MAX_DEPTH : %f\n\
MIN_POINT : %d\n\
MAX_DIST : %f\n\
DISPLAY : %d",
NODE_NAME,
config.MAX_WIDTH,
config.MAX_HEIGHT,
config.MIN_HEIGHT,
config.MAX_DEPTH,
config.MIN_POINT,
config.MAX_DIST,
config.DISPLAY
);
m_maxWidth = config.MAX_WIDTH;
m_maxHeight = config.MAX_HEIGHT;
m_minHeight = config.MIN_HEIGHT;
m_maxDepth = config.MAX_DEPTH;
m_numPoint = config.MIN_POINT;
m_maxDist = config.MAX_DIST;
m_display = config.DISPLAY;
if(m_display);
else cv::destroyAllWindows();
}
|
0ea1ed09d239088e813a37c3f31e54288e457240
|
5af37ea53571bfbf7fd9880da81f8e0e37534867
|
/PTA/advanced_level/1089_insertOrMerge.cpp
|
1fa9553f2104389db0eb5d5b5692ef311b140e5c
|
[] |
no_license
|
RickyL-2000/Algorithm
|
4a67b970a1ccf6a3199b3d01e11ba3877e094fab
|
32afaf6dded6543cb80c63219c0ddac40d393462
|
refs/heads/master
| 2023-05-09T14:22:55.078626
| 2021-06-02T03:37:43
| 2021-06-02T03:37:43
| 280,323,530
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,096
|
cpp
|
1089_insertOrMerge.cpp
|
#include <iostream>
#include <vector>
using namespace std;
int n;
vector<int> origin, partial;
void partialInsertSort(vector<int>& array, int j) {
int key = array[j];
int i = j-1;
while (i >= 0 && array[i] > key) {
array[i+1] = array[i];
i--;
}
array[i+1] = key;
}
void partialMergeSort(vector<int>& array, int partlen) {
if (partlen >= n) return;
vector<int> cpy = array;
int p1, p2, index;
for (int i = 0; i < n; i += partlen) {
p1 = i;
p2 = i + partlen / 2;
index = i;
while (p1 < i + partlen / 2 && p1 < n && p2 < i + partlen && p2 < n) {
if (cpy[p1] < cpy[p2]) {
array[index++] = cpy[p1++];
} else {
array[index++] = cpy[p2++];
}
}
while (p1 < i + partlen / 2 && p1 < n) {
array[index++] = cpy[p1++];
}
while (p2 < i + partlen && p2 < n) {
array[index++] = cpy[p2++];
}
}
}
int main() {
cin >> n;
int temp;
for (int i = 0; i < n; i++) {
cin >> temp;
origin.push_back(temp);
}
for (int i = 0; i < n; i++) {
cin >> temp;
partial.push_back(temp);
}
vector<int> tempArray = origin;
for (int j = 1; j < n; j++) {
partialInsertSort(tempArray, j);
if (tempArray == partial) {
cout << "Insertion Sort" << endl;
partialInsertSort(tempArray, j+1);
printf("%d", tempArray[0]);
for (size_t i = 1; i < n; i++) {
printf(" %d", tempArray[i]);
}
return 0;
}
}
tempArray = origin;
for (int len = 2; len <= n; len *= 2) {
partialMergeSort(tempArray, len);
if (tempArray == partial) {
cout << "Merge Sort" << endl;
partialMergeSort(tempArray, 2*len);
printf("%d", tempArray[0]);
for (size_t i = 1; i < n; i++) {
printf(" %d", tempArray[i]);
}
return 0;
}
}
return 0;
}
|
abb8d7c799b7bd003d9c9ea341b0c96442b8bd1b
|
f52c5bd8b1e65483d1e2b258526a9cc5fbaf001c
|
/dataaccess.cpp
|
38cf8d93a6dc97c578b248311058f3955c15484a
|
[] |
no_license
|
clogwog/drive
|
811f65af0883ff1f1a4bf640e995dd3ea383918d
|
a6a7f3cfa17eae09d4f86192a2c26c06362baa09
|
refs/heads/master
| 2021-08-19T12:35:08.575267
| 2017-11-26T09:08:04
| 2017-11-26T09:08:04
| 112,069,011
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 990
|
cpp
|
dataaccess.cpp
|
#include "dataaccess.h"
DataAccess::DataAccess(QObject *parent) : QObject(parent)
{
m_ToDoItems = new QQmlObjectListModel<ToDoItem> (this);
//------
ToDoItem* list1 = new ToDoItem(m_ToDoItems);
list1->set_done(true);
list1->set_description("bla bla");
m_ToDoItems->append(list1);
list1 = new ToDoItem(m_ToDoItems);
list1->set_done(false);
list1->set_description("finish drawing");
m_ToDoItems->append(list1);
//-----
m_CurrentTheme = new Theme();
}
void DataAccess::addNewTodo(int index)
{
ToDoItem* newTodo = new ToDoItem(m_ToDoItems);
if ( index < 0 || index > m_ToDoItems->count() - 1 )
m_ToDoItems->append(newTodo);
else
{
m_ToDoItems->insert(index,newTodo);
}
}
void DataAccess::deleteDoneTodos()
{
for( int i = 0 ; i < m_ToDoItems->size();)
{
if (m_ToDoItems->at(i)->get_done() )
m_ToDoItems->remove(m_ToDoItems->at(i));
else
++i;
}
}
|
f1bea6dd595607941b2c6e12a86271ded0fb8cf3
|
4a193c0992276fc133bc6e1d737f9fc30a71bef4
|
/Game/Kayak/Source/Kayak/Private/Mix/GameMode/KayakGameModeLogin.cpp
|
435e61026d2b527b2a5a5b472bd1ed0833c4a75e
|
[] |
no_license
|
liulianyou/KayakGame
|
ff13ac212f311fe388d071151048aad99634054c
|
54264f06e23759c68013df92cbef0e77870c37d8
|
refs/heads/master
| 2022-03-16T16:05:20.782725
| 2022-02-14T11:01:37
| 2022-02-14T11:01:37
| 136,556,867
| 1
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 153
|
cpp
|
KayakGameModeLogin.cpp
|
#include "KayakGameModeLogin.h"
AKayakGameModeLogin::AKayakGameModeLogin( const FObjectInitializer& ObjectInitializer )
:Super(ObjectInitializer)
{
}
|
4153cfe11fe74b66864c73b2b04c50f2c379578b
|
73650c0a7a565f36f627609d00149192b5e64c4b
|
/LinkedList/LL2/moveElementToFront.cpp
|
c3472f0eb1050ac3072f183039c7beed7e80d13d
|
[] |
no_license
|
MahirRatanpara/LBPGFG
|
b1ebbb23c10cdbb6e1fdea09dced704437cd627c
|
cd4b8edf140c75f883ff2f82c47db2d6342124e7
|
refs/heads/master
| 2023-06-17T16:36:57.126838
| 2021-07-22T07:55:24
| 2021-07-22T07:55:24
| 357,083,173
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,069
|
cpp
|
moveElementToFront.cpp
|
#include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
};
void moveToFront(Node **head_ref)
{
Node* temp=*head_ref;
Node* prev=temp;
while(temp->next!=NULL)
{
prev=temp;
temp=temp->next;
}
prev->next=NULL;
temp->next=*head_ref;
*head_ref=temp;
}
void push(Node** head_ref, int new_data)
{
Node* new_node = new Node();
new_node->data = new_data;
new_node->next = (*head_ref);
(*head_ref) = new_node;
}
void printList(Node *node)
{
while(node != NULL)
{
cout << node->data << " ";
node = node->next;
}
}
/* Driver code */
int main()
{
Node *start = NULL;
/* The constructed linked list is:
1->2->3->4->5 */
push(&start, 5);
push(&start, 4);
push(&start, 3);
push(&start, 2);
push(&start, 1);
cout<<"Linked list before moving last to front\n";
printList(start);
moveToFront(&start);
cout<<"\nLinked list after removing last to front\n";
printList(start);
return 0;
}
|
729d43e993773f4f169159fb1bde83c840d1ee56
|
726d8518a8c7a38b0db6ba9d4326cec172a6dde6
|
/0641. Design Circular Deque/Solution.cpp
|
2c699bc4a403583ba42f93cdcfe254c139387606
|
[] |
no_license
|
faterazer/LeetCode
|
ed01ef62edbcfba60f5e88aad401bd00a48b4489
|
d7ba416d22becfa8f2a2ae4eee04c86617cd9332
|
refs/heads/master
| 2023-08-25T19:14:03.494255
| 2023-08-25T03:34:44
| 2023-08-25T03:34:44
| 128,856,315
| 4
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,707
|
cpp
|
Solution.cpp
|
#include <vector>
using namespace std;
class MyCircularDeque {
public:
MyCircularDeque(int k)
: Q(k)
{
}
bool insertFront(int value)
{
if (isFull())
return false;
front = (front - 1 + Q.size()) % Q.size();
Q[front] = value;
++size;
return true;
}
bool insertLast(int value)
{
if (isFull())
return false;
Q[rear] = value;
rear = (rear + 1) % Q.size();
++size;
return true;
}
bool deleteFront()
{
if (isEmpty())
return false;
front = (front + 1) % Q.size();
--size;
return true;
}
bool deleteLast()
{
if (isEmpty())
return false;
rear = (rear - 1 + Q.size()) % Q.size();
--size;
return true;
}
int getFront()
{
if (isEmpty())
return -1;
return Q[front];
}
int getRear()
{
if (isEmpty())
return -1;
return Q[(rear - 1 + Q.size()) % Q.size()];
}
bool isEmpty()
{
return size == 0;
}
bool isFull()
{
return size == Q.size();
}
private:
vector<int> Q;
int front = 0, rear = 0, size = 0;
};
/**
* Your MyCircularDeque object will be instantiated and called as such:
* MyCircularDeque* obj = new MyCircularDeque(k);
* bool param_1 = obj->insertFront(value);
* bool param_2 = obj->insertLast(value);
* bool param_3 = obj->deleteFront();
* bool param_4 = obj->deleteLast();
* int param_5 = obj->getFront();
* int param_6 = obj->getRear();
* bool param_7 = obj->isEmpty();
* bool param_8 = obj->isFull();
*/
|
11e86f3dfe7e6f443988c15f61bfc828a895a6fa
|
1cba40be0095359b6ea74c8bb4c9562371bc0316
|
/Programmers/짝지어 제거하기.cpp
|
b5dcc008d8b6a22f5244583b72e0e7c9bd8c3af9
|
[] |
no_license
|
dgandrewc/leetcode
|
4934b7700c4e8b6bce5be2ae2232794a03d0e00b
|
00c834222e16dd4e57e5ac11bb438a2ecec99375
|
refs/heads/main
| 2023-06-09T17:05:03.329571
| 2021-07-05T03:45:02
| 2021-07-05T03:45:02
| 357,297,233
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 573
|
cpp
|
짝지어 제거하기.cpp
|
#include <iostream>
#include <stack>
using namespace std;
int solution(string s)
{
int answer = -1;
stack<char> st;
for(int i=0; i<s.size(); i++)
{
if(st.empty() || st.top()!=s[i])
{
st.push(s[i]);
continue;
}
while(!st.empty() && st.top()==s[i])
{
i++;
st.pop();
}
i--;
}
// [실행] 버튼을 누르면 출력 값을 볼 수 있습니다.
if(st.empty())
answer=1;
else
answer=0;
return answer;
}
|
b07869f58dcb62fa59fc343e3a35925c7ee219e4
|
5730d9527dda5b2d2803f24de3856c0ab64332ae
|
/ResourceControl.h
|
35adc9ed13ac231939f3b70e6c172db5a1341c33
|
[] |
no_license
|
LEEEUNSOUL/-2D-Game-TeamProject2
|
b282b3d87c4115a458dd3e4c19ac7b241e8344bc
|
041fe0e662f92bd4bcbcc789cd0ed9442b13b4f2
|
refs/heads/master
| 2021-05-20T15:12:41.314648
| 2020-04-02T03:37:28
| 2020-04-02T03:37:28
| 252,344,863
| 0
| 0
| null | null | null | null |
UHC
|
C++
| false
| false
| 507
|
h
|
ResourceControl.h
|
#pragma once
#include "Script.h"
#include "Observer.h"
//생산시간 RealTime 3분에(180초) 2개씩
#define PRODUCTIONTIME 5
class ResourceControl : public Script, public Observer
{
private:
map<string, int> _mResourceSave;
bool isDayToProduce = false;
bool isProducing = false;
int _producingnStartTime = 0;
int _startTime = 0;
public:
virtual void Init() override;
virtual void Update() override;
virtual void OnNotify(MSGTYPE type, string event) override;
void MakeResource();
};
|
36b30e4099bfa433e9f1e7b8aeae1797ddbb2e79
|
91ca3afc2ca5c56b60a8d3ede77676907fb71a81
|
/C++ ALGORITHMS/eulerian_path, lca using rmq segment tree.cpp
|
c7672e3dff17218106592ec6d461a7196eb2e980
|
[] |
no_license
|
valeri2000/Algorithms-collection
|
aa15ac780604f54fa208932f158f1d129a02518e
|
7042abfe26ea02a4e7749d7d273b2069e267dbf4
|
refs/heads/master
| 2021-10-08T16:23:15.213495
| 2018-12-14T15:04:50
| 2018-12-14T15:04:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,022
|
cpp
|
eulerian_path, lca using rmq segment tree.cpp
|
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <ctime>
#include <climits>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cmath>
#include <utility>
#define endl '\n'
#define _ ios::sync_with_stdio(false), cin.tie(NULL)
#define iread(sss) freopen((sss), "r", stdin)
#define ff first
#define ss second
#define all(abcc) (abcc).begin(), (abcc).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
// clock_t tstart;void sc(){tstart=clock();} void pc(){printf("time=%.3f\n", (clock()-tstart)/(CLOCKS_PER_SEC*1.0));}
const int N=(int)1e5+3;
int n, m, a, b;
vector<int> neigh[N], path;
int level[N], foccur[N];
bool used[N];
void eul(int curr, int prev, int lvl) {
used[curr]=1;
level[curr]=lvl;
path.push_back(curr);
foccur[curr]=(int)path.size()-1;
for(int i:neigh[curr]) {
if(!used[i]) {
eul(i, curr, lvl+1);
}
}
if(prev!=-1) path.push_back(prev);
}
pii tree[4*N];
void buildTree(int node, int l, int r) {
if(l>=r) return;
if(l+1==r) {
tree[node]={level[path[l]], path[l]};
return;
}
buildTree(node+node, l, (l+r)>>1);
buildTree(node+node+1, (l+r)>>1, r);
if(tree[node+node].ff<tree[node+node+1].ff) tree[node]=tree[node+node];
else tree[node]=tree[node+node+1];
}
pii query(int node, int ql, int qr, int l, int r) {
if(ql>=r || qr<=l) return {INT_MAX, 0};
if(ql<=l && r<=qr) return tree[node];
pii aa=query(node+node, ql, qr, l, (l+r)>>1);
pii bb=query(node+node+1, ql, qr, (l+r)>>1, r);
if(aa.ff<bb.ff) return aa;
return bb;
}
int main() {
//iread("i1.txt");
_;
cin>>n>>m;
for(int i=0; i<m; ++i) {
cin>>a>>b;
neigh[a].push_back(b);
neigh[b].push_back(a);
}
eul(1, -1, 0);
for(auto i:path) cout<<i<<" ";
cout<<endl;
buildTree(1, 0, (int)path.size());
while(cin>>a>>b) {
if(foccur[a]>foccur[b]) swap(a, b);
cout<<query(1, foccur[a], foccur[b]+1, 0, (int)path.size()).ss<<endl;
}
return 0;
}
|
d0aed9e0ce063b3432e3c42fb51c3bb6ad5cffbe
|
d915b8d0432189bc05021f1b8209fdc4a710f961
|
/2017/23.explicit.cpp
|
0c01443599630f40cdb55c21899364c11d98c540
|
[
"WTFPL"
] |
permissive
|
wgevaert/AOC
|
cd77ed1848f73c78790bbfb6379b25832e1015e1
|
1f6cb2c2a134725bffbc6ce430899dcd9f03b8f7
|
refs/heads/master
| 2022-12-27T17:12:34.839336
| 2022-12-27T12:43:27
| 2022-12-27T12:43:27
| 225,715,331
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 13,393
|
cpp
|
23.explicit.cpp
|
#include <iostream>
#include <fstream>
#include <string>
const unsigned primes[1455]={105701 , 105727 , 105733 , 105751 , 105761 , 105767 , 105769 , 105817 , 105829 , 105863 , 105871 , 105883 , 105899 , 105907 , 105913 , 105929 , 105943 , 105953 , 105967 , 105971 , 105977 , 105983 , 105997 , 106013 , 106019 , 106031 , 106033 , 106087 , 106103 , 106109 , 106121 , 106123 , 106129 , 106163 , 106181 , 106187 , 106189 , 106207 , 106213 , 106217 , 106219 , 106243 , 106261 , 106273 , 106277 , 106279 , 106291 , 106297 , 106303 , 106307 , 106319 , 106321 , 106331 , 106349 , 106357 , 106363 , 106367 , 106373 , 106391 , 106397 , 106411 , 106417 , 106427 , 106433 , 106441 , 106451 , 106453 , 106487 , 106501 , 106531 , 106537 , 106541 , 106543 , 106591 , 106619 , 106621 , 106627 , 106637 , 106649 , 106657 , 106661 , 106663 , 106669 , 106681 , 106693 , 106699 , 106703 , 106721 , 106727 , 106739 , 106747 , 106751 , 106753 , 106759 , 106781 , 106783 , 106787 , 106801 , 106823 , 106853 , 106859 , 106861 , 106867 , 106871 , 106877 , 106903 , 106907 , 106921 , 106937 , 106949 , 106957 , 106961 , 106963 , 106979 , 106993 , 107021 , 107033 , 107053 , 107057 , 107069 , 107071 , 107077 , 107089 , 107099 , 107101 , 107119 , 107123 , 107137 , 107171 , 107183 , 107197 , 107201 , 107209 , 107227 , 107243 , 107251 , 107269 , 107273 , 107279 , 107309 , 107323 , 107339 , 107347 , 107351 , 107357 , 107377 , 107441 , 107449 , 107453 , 107467 , 107473 , 107507 , 107509 , 107563 , 107581 , 107599 , 107603 , 107609 , 107621 , 107641 , 107647 , 107671 , 107687 , 107693 , 107699 , 107713 , 107717 , 107719 , 107741 , 107747 , 107761 , 107773 , 107777 , 107791 , 107827 , 107837 , 107839 , 107843 , 107857 , 107867 , 107873 , 107881 , 107897 , 107903 , 107923 , 107927 , 107941 , 107951 , 107971 , 107981 , 107999 , 108007 , 108011 , 108013 , 108023 , 108037 , 108041 , 108061 , 108079 , 108089 , 108107 , 108109 , 108127 , 108131 , 108139 , 108161 , 108179 , 108187 , 108191 , 108193 , 108203 , 108211 , 108217 , 108223 , 108233 , 108247 , 108263 , 108271 , 108287 , 108289 , 108293 , 108301 , 108343 , 108347 , 108359 , 108377 , 108379 , 108401 , 108413 , 108421 , 108439 , 108457 , 108461 , 108463 , 108497 , 108499 , 108503 , 108517 , 108529 , 108533 , 108541 , 108553 , 108557 , 108571 , 108587 , 108631 , 108637 , 108643 , 108649 , 108677 , 108707 , 108709 , 108727 , 108739 , 108751 , 108761 , 108769 , 108791 , 108793 , 108799 , 108803 , 108821 , 108827 , 108863 , 108869 , 108877 , 108881 , 108883 , 108887 , 108893 , 108907 , 108917 , 108923 , 108929 , 108943 , 108947 , 108949 , 108959 , 108961 , 108967 , 108971 , 108991 , 109001 , 109013 , 109037 , 109049 , 109063 , 109073 , 109097 , 109103 , 109111 , 109121 , 109133 , 109139 , 109141 , 109147 , 109159 , 109169 , 109171 , 109199 , 109201 , 109211 , 109229 , 109253 , 109267 , 109279 , 109297 , 109303 , 109313 , 109321 , 109331 , 109357 , 109363 , 109367 , 109379 , 109387 , 109391 , 109397 , 109423 , 109433 , 109441 , 109451 , 109453 , 109469 , 109471 , 109481 , 109507 , 109517 , 109519 , 109537 , 109541 , 109547 , 109567 , 109579 , 109583 , 109589 , 109597 , 109609 , 109619 , 109621 , 109639 , 109661 , 109663 , 109673 , 109717 , 109721 , 109741 , 109751 , 109789 , 109793 , 109807 , 109819 , 109829 , 109831 , 109841 , 109843 , 109847 , 109849 , 109859 , 109873 , 109883 , 109891 , 109897 , 109903 , 109913 , 109919 , 109937 , 109943 , 109961 , 109987 , 110017 , 110023 , 110039 , 110051 , 110059 , 110063 , 110069 , 110083 , 110119 , 110129 , 110161 , 110183 , 110221 , 110233 , 110237 , 110251 , 110261 , 110269 , 110273 , 110281 , 110291 , 110311 , 110321 , 110323 , 110339 , 110359 , 110419 , 110431 , 110437 , 110441 , 110459 , 110477 , 110479 , 110491 , 110501 , 110503 , 110527 , 110533 , 110543 , 110557 , 110563 , 110567 , 110569 , 110573 , 110581 , 110587 , 110597 , 110603 , 110609 , 110623 , 110629 , 110641 , 110647 , 110651 , 110681 , 110711 , 110729 , 110731 , 110749 , 110753 , 110771 , 110777 , 110807 , 110813 , 110819 , 110821 , 110849 , 110863 , 110879 , 110881 , 110899 , 110909 , 110917 , 110921 , 110923 , 110927 , 110933 , 110939 , 110947 , 110951 , 110969 , 110977 , 110989 , 111029 , 111031 , 111043 , 111049 , 111053 , 111091 , 111103 , 111109 , 111119 , 111121 , 111127 , 111143 , 111149 , 111187 , 111191 , 111211 , 111217 , 111227 , 111229 , 111253 , 111263 , 111269 , 111271 , 111301 , 111317 , 111323 , 111337 , 111341 , 111347 , 111373 , 111409 , 111427 , 111431 , 111439 , 111443 , 111467 , 111487 , 111491 , 111493 , 111497 , 111509 , 111521 , 111533 , 111539 , 111577 , 111581 , 111593 , 111599 , 111611 , 111623 , 111637 , 111641 , 111653 , 111659 , 111667 , 111697 , 111721 , 111731 , 111733 , 111751 , 111767 , 111773 , 111779 , 111781 , 111791 , 111799 , 111821 , 111827 , 111829 , 111833 , 111847 , 111857 , 111863 , 111869 , 111871 , 111893 , 111913 , 111919 , 111949 , 111953 , 111959 , 111973 , 111977 , 111997 , 112019 , 112031 , 112061 , 112067 , 112069 , 112087 , 112097 , 112103 , 112111 , 112121 , 112129 , 112139 , 112153 , 112163 , 112181 , 112199 , 112207 , 112213 , 112223 , 112237 , 112241 , 112247 , 112249 , 112253 , 112261 , 112279 , 112289 , 112291 , 112297 , 112303 , 112327 , 112331 , 112337 , 112339 , 112349 , 112361 , 112363 , 112397 , 112403 , 112429 , 112459 , 112481 , 112501 , 112507 , 112543 , 112559 , 112571 , 112573 , 112577 , 112583 , 112589 , 112601 , 112603 , 112621 , 112643 , 112657 , 112663 , 112687 , 112691 , 112741 , 112757 , 112759 , 112771 , 112787 , 112799 , 112807 , 112831 , 112843 , 112859 , 112877 , 112901 , 112909 , 112913 , 112919 , 112921 , 112927 , 112939 , 112951 , 112967 , 112979 , 112997 , 113011 , 113017 , 113021 , 113023 , 113027 , 113039 , 113041 , 113051 , 113063 , 113081 , 113083 , 113089 , 113093 , 113111 , 113117 , 113123 , 113131 , 113143 , 113147 , 113149 , 113153 , 113159 , 113161 , 113167 , 113171 , 113173 , 113177 , 113189 , 113209 , 113213 , 113227 , 113233 , 113279 , 113287 , 113327 , 113329 , 113341 , 113357 , 113359 , 113363 , 113371 , 113381 , 113383 , 113417 , 113437 , 113453 , 113467 , 113489 , 113497 , 113501 , 113513 , 113537 , 113539 , 113557 , 113567 , 113591 , 113621 , 113623 , 113647 , 113657 , 113683 , 113717 , 113719 , 113723 , 113731 , 113749 , 113759 , 113761 , 113777 , 113779 , 113783 , 113797 , 113809 , 113819 , 113837 , 113843 , 113891 , 113899 , 113903 , 113909 , 113921 , 113933 , 113947 , 113957 , 113963 , 113969 , 113983 , 113989 , 114001 , 114013 , 114031 , 114041 , 114043 , 114067 , 114073 , 114077 , 114083 , 114089 , 114113 , 114143 , 114157 , 114161 , 114167 , 114193 , 114197 , 114199 , 114203 , 114217 , 114221 , 114229 , 114259 , 114269 , 114277 , 114281 , 114299 , 114311 , 114319 , 114329 , 114343 , 114371 , 114377 , 114407 , 114419 , 114451 , 114467 , 114473 , 114479 , 114487 , 114493 , 114547 , 114553 , 114571 , 114577 , 114593 , 114599 , 114601 , 114613 , 114617 , 114641 , 114643 , 114649 , 114659 , 114661 , 114671 , 114679 , 114689 , 114691 , 114713 , 114743 , 114749 , 114757 , 114761 , 114769 , 114773 , 114781 , 114797 , 114799 , 114809 , 114827 , 114833 , 114847 , 114859 , 114883 , 114889 , 114901 , 114913 , 114941 , 114967 , 114973 , 114997 , 115001 , 115013 , 115019 , 115021 , 115057 , 115061 , 115067 , 115079 , 115099 , 115117 , 115123 , 115127 , 115133 , 115151 , 115153 , 115163 , 115183 , 115201 , 115211 , 115223 , 115237 , 115249 , 115259 , 115279 , 115301 , 115303 , 115309 , 115319 , 115321 , 115327 , 115331 , 115337 , 115343 , 115361 , 115363 , 115399 , 115421 , 115429 , 115459 , 115469 , 115471 , 115499 , 115513 , 115523 , 115547 , 115553 , 115561 , 115571 , 115589 , 115597 , 115601 , 115603 , 115613 , 115631 , 115637 , 115657 , 115663 , 115679 , 115693 , 115727 , 115733 , 115741 , 115751 , 115757 , 115763 , 115769 , 115771 , 115777 , 115781 , 115783 , 115793 , 115807 , 115811 , 115823 , 115831 , 115837 , 115849 , 115853 , 115859 , 115861 , 115873 , 115877 , 115879 , 115883 , 115891 , 115901 , 115903 , 115931 , 115933 , 115963 , 115979 , 115981 , 115987 , 116009 , 116027 , 116041 , 116047 , 116089 , 116099 , 116101 , 116107 , 116113 , 116131 , 116141 , 116159 , 116167 , 116177 , 116189 , 116191 , 116201 , 116239 , 116243 , 116257 , 116269 , 116273 , 116279 , 116293 , 116329 , 116341 , 116351 , 116359 , 116371 , 116381 , 116387 , 116411 , 116423 , 116437 , 116443 , 116447 , 116461 , 116471 , 116483 , 116491 , 116507 , 116531 , 116533 , 116537 , 116539 , 116549 , 116579 , 116593 , 116639 , 116657 , 116663 , 116681 , 116687 , 116689 , 116707 , 116719 , 116731 , 116741 , 116747 , 116789 , 116791 , 116797 , 116803 , 116819 , 116827 , 116833 , 116849 , 116867 , 116881 , 116903 , 116911 , 116923 , 116927 , 116929 , 116933 , 116953 , 116959 , 116969 , 116981 , 116989 , 116993 , 117017 , 117023 , 117037 , 117041 , 117043 , 117053 , 117071 , 117101 , 117109 , 117119 , 117127 , 117133 , 117163 , 117167 , 117191 , 117193 , 117203 , 117209 , 117223 , 117239 , 117241 , 117251 , 117259 , 117269 , 117281 , 117307 , 117319 , 117329 , 117331 , 117353 , 117361 , 117371 , 117373 , 117389 , 117413 , 117427 , 117431 , 117437 , 117443 , 117497 , 117499 , 117503 , 117511 , 117517 , 117529 , 117539 , 117541 , 117563 , 117571 , 117577 , 117617 , 117619 , 117643 , 117659 , 117671 , 117673 , 117679 , 117701 , 117703 , 117709 , 117721 , 117727 , 117731 , 117751 , 117757 , 117763 , 117773 , 117779 , 117787 , 117797 , 117809 , 117811 , 117833 , 117839 , 117841 , 117851 , 117877 , 117881 , 117883 , 117889 , 117899 , 117911 , 117917 , 117937 , 117959 , 117973 , 117977 , 117979 , 117989 , 117991 , 118033 , 118037 , 118043 , 118051 , 118057 , 118061 , 118081 , 118093 , 118127 , 118147 , 118163 , 118169 , 118171 , 118189 , 118211 , 118213 , 118219 , 118247 , 118249 , 118253 , 118259 , 118273 , 118277 , 118297 , 118343 , 118361 , 118369 , 118373 , 118387 , 118399 , 118409 , 118411 , 118423 , 118429 , 118453 , 118457 , 118463 , 118471 , 118493 , 118529 , 118543 , 118549 , 118571 , 118583 , 118589 , 118603 , 118619 , 118621 , 118633 , 118661 , 118669 , 118673 , 118681 , 118687 , 118691 , 118709 , 118717 , 118739 , 118747 , 118751 , 118757 , 118787 , 118799 , 118801 , 118819 , 118831 , 118843 , 118861 , 118873 , 118891 , 118897 , 118901 , 118903 , 118907 , 118913 , 118927 , 118931 , 118967 , 118973 , 119027 , 119033 , 119039 , 119047 , 119057 , 119069 , 119083 , 119087 , 119089 , 119099 , 119101 , 119107 , 119129 , 119131 , 119159 , 119173 , 119179 , 119183 , 119191 , 119227 , 119233 , 119237 , 119243 , 119267 , 119291 , 119293 , 119297 , 119299 , 119311 , 119321 , 119359 , 119363 , 119389 , 119417 , 119419 , 119429 , 119447 , 119489 , 119503 , 119513 , 119533 , 119549 , 119551 , 119557 , 119563 , 119569 , 119591 , 119611 , 119617 , 119627 , 119633 , 119653 , 119657 , 119659 , 119671 , 119677 , 119687 , 119689 , 119699 , 119701 , 119723 , 119737 , 119747 , 119759 , 119771 , 119773 , 119783 , 119797 , 119809 , 119813 , 119827 , 119831 , 119839 , 119849 , 119851 , 119869 , 119881 , 119891 , 119921 , 119923 , 119929 , 119953 , 119963 , 119971 , 119981 , 119983 , 119993 , 120011 , 120017 , 120041 , 120047 , 120049 , 120067 , 120077 , 120079 , 120091 , 120097 , 120103 , 120121 , 120157 , 120163 , 120167 , 120181 , 120193 , 120199 , 120209 , 120223 , 120233 , 120247 , 120277 , 120283 , 120293 , 120299 , 120319 , 120331 , 120349 , 120371 , 120383 , 120391 , 120397 , 120401 , 120413 , 120427 , 120431 , 120473 , 120503 , 120511 , 120539 , 120551 , 120557 , 120563 , 120569 , 120577 , 120587 , 120607 , 120619 , 120623 , 120641 , 120647 , 120661 , 120671 , 120677 , 120689 , 120691 , 120709 , 120713 , 120721 , 120737 , 120739 , 120749 , 120763 , 120767 , 120779 , 120811 , 120817 , 120823 , 120829 , 120833 , 120847 , 120851 , 120863 , 120871 , 120877 , 120889 , 120899 , 120907 , 120917 , 120919 , 120929 , 120937 , 120941 , 120943 , 120947 , 120977 , 120997 , 121001 , 121007 , 121013 , 121019 , 121021 , 121039 , 121061 , 121063 , 121067 , 121081 , 121123 , 121139 , 121151 , 121157 , 121169 , 121171 , 121181 , 121189 , 121229 , 121259 , 121267 , 121271 , 121283 , 121291 , 121309 , 121313 , 121321 , 121327 , 121333 , 121343 , 121349 , 121351 , 121357 , 121367 , 121369 , 121379 , 121403 , 121421 , 121439 , 121441 , 121447 , 121453 , 121469 , 121487 , 121493 , 121501 , 121507 , 121523 , 121531 , 121547 , 121553 , 121559 , 121571 , 121577 , 121579 , 121591 , 121607 , 121609 , 121621 , 121631 , 121633 , 121637 , 121661 , 121687 , 121697 , 121711 , 121721 , 121727 , 121763 , 121787 , 121789 , 121843 , 121853 , 121867 , 121883 , 121889 , 121909 , 121921 , 121931 , 121937 , 121949 , 121951 , 121963 , 121967 , 121993 , 121997 , 122011 , 122021 , 122027 , 122029 , 122033 , 122039 , 122041 , 122051 , 122053 , 122069 , 122081 , 122099 , 122117 , 122131 , 122147 , 122149 , 122167 , 122173 , 122201 , 122203 , 122207 , 122209 , 122219 , 122231 , 122251 , 122263 , 122267 , 122273 , 122279 , 122299 , 122321 , 122323 , 122327 , 122347 , 122363 , 122387 , 122389 , 122393 , 122399 , 122401 , 122443 , 122449 , 122453 , 122471 , 122477 , 122489 , 122497 , 122501 , 122503 , 122509 , 122527 , 122533 , 122557 , 122561 , 122579 , 122597 , 122599 , 122609 , 122611 , 122651 , 122653 , 122663 , 122693};
int main() {
unsigned h=0;
for(int i=0;i<1455;i++)if(primes[i]%17 == 11)std::cout<<"THE "<<++h<<"th PRIME IS "<<primes[i]<<std::endl;
std::cout<<"THE ANSWER IS "<<1001-h<<std::endl;
return 0;
}
|
7301245839cf50bdc9c7f9a5248224e79499d215
|
1b5ce323ef7ad1bdb55f2eec0c0d916dedc405d8
|
/src/ray.h
|
c0e108d3588eae1ba8dd39c0ed2ec03831e7692b
|
[] |
no_license
|
arthur-liu-lsh/RayTracing-Nicolas-Arthur
|
3ba1303a6eb553d8dba66581a3587a70bc4965f5
|
487ca6e2f1272cafc045f805bc1c68c698ece77a
|
refs/heads/main
| 2023-03-19T13:25:57.956233
| 2021-03-07T13:58:10
| 2021-03-07T13:58:10
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 785
|
h
|
ray.h
|
#ifndef RAY_H
#define RAY_H
#include <cstdio>
#include <vector>
#include "Eigen/Dense"
#include "shapes.h"
#ifndef M_PI
#define M_PI 3.141592653589793
#endif
#ifndef INFINITY
#define INFINITY 1e8
#endif
//Profondeur maximale de récursion
#ifndef MAX_RAY_DEPTH
#define MAX_RAY_DEPTH 3
#endif
using namespace Eigen;
using namespace std;
float mix(const float &a, const float &b, const float &mix);
//Trace un rayon en prenant en compte les sphères placées et renvoie une couleur qui correspondra à un pixel
Vector3f trace_sphere(const Vector3f &rayorig, const Vector3f &raydir, vector<Sphere> &spheres, const int &depth);
//Non implémenté
Vector3f trace_cube(const Vector3f &rayorig, const Vector3f &raydir, const std::vector<Cube> &cubes, const int &depth);
#endif
|
450baca8bba74768005d99a584491ed57fc9777d
|
a7b25756754024ed9a3990784de1d4d9482d703a
|
/src/Textures/PerlinNoise.h
|
d1dd3597e55be13cf4174ccb4d2e539d96f03d3f
|
[] |
no_license
|
5433D-R32433/RayTracingTheNextWeek
|
eaf2b43515d8f14d38157d42100284a8f7ddc617
|
2d7a5915094ad8b2be636dd620c5538519d3608f
|
refs/heads/master
| 2022-02-24T00:39:09.386270
| 2019-10-29T22:02:49
| 2019-10-29T22:02:49
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,397
|
h
|
PerlinNoise.h
|
#pragma once
#include "Random.h"
#include "Vec3.h"
#include <vector>
#include <numeric>
class PerlinNoise final
{
public:
explicit PerlinNoise(Random& random) :
randomVectors_(CreateRandomVectors(random)),
permutationsX_(CreatePermutations(random)),
permutationsY_(CreatePermutations(random)),
permutationsZ_(CreatePermutations(random))
{
}
float Turbulence(const Vec3& point, const int depth = 7) const
{
Vec3 tempPoint = point;
float accum = 0;
float weight = 1;
for (int i = 0; i != depth; ++i)
{
accum += weight * Noise(tempPoint);
weight *= 0.5f;
tempPoint *= 2;
}
return std::abs(accum);
}
float Noise(const Vec3& point) const
{
const Vec3 floor = Floor(point);
const Vec3 coord = point - floor;
const int i = int(floor.x());
const int j = int(floor.y());
const int k = int(floor.z());
Vec3 c[2][2][2];
for (int di = 0; di != 2; ++di)
for (int dj = 0; dj != 2; ++dj)
for (int dk = 0; dk != 2; ++dk)
c[di][dj][dk] = randomVectors_[
permutationsX_[(i + di) & 255] ^
permutationsY_[(j + dj) & 255] ^
permutationsZ_[(k + dk) & 255]];
return PerlinInterpolate(c, coord);
}
private:
static std::vector<Vec3> CreateRandomVectors(Random& random)
{
std::vector<Vec3> floats(256);
std::generate(floats.begin(), floats.end(), [&random]()
{
return UnitVector(Vec3(-1 + 2 * Uniform(random), -1 + 2 * Uniform(random), -1 + 2 * Uniform(random)));
});
return floats;
}
static std::vector<int> CreatePermutations(Random& random)
{
std::vector<int> permutations(256);
std::iota(permutations.begin(), permutations.end(), 0);
std::shuffle(permutations.begin(), permutations.end(), random);
return permutations;
}
static float PerlinInterpolate(const Vec3 c[2][2][2], const Vec3 coord)
{
const Vec3 t = coord * coord*(3 - 2 * coord);
float accum = 0;
for (int i = 0; i != 2; ++i)
for (int j = 0; j != 2; ++j)
for (int k = 0; k != 2; ++k)
{
const Vec3 weight = t - Vec3(float(i), float(j), float(k));
accum +=
(i*t.x() + (1 - i)*(1 - t.x()))*
(j*t.y() + (1 - j)*(1 - t.y()))*
(k*t.z() + (1 - k)*(1 - t.z()))*
Dot(c[i][j][k], weight);
}
return accum;
}
const std::vector<Vec3> randomVectors_;
const std::vector<int> permutationsX_;
const std::vector<int> permutationsY_;
const std::vector<int> permutationsZ_;
};
|
e50ad0f2ee971f102369c0ca1c67ae54f3d4946e
|
b63de759905854e95265ae48afeed93b0105dd70
|
/Engine/shadermanagerclass.h
|
68db7323448f11c6d853645597f88dcbc9fa5c44
|
[] |
no_license
|
Barry-Hoyd/Real-Time-Graphics
|
1ca34daf37f72cb148a8db3c0ee088702a618341
|
1ea2e675cbe1f515f120459ae976ed3cf98b4681
|
refs/heads/master
| 2023-04-19T06:25:15.016558
| 2021-04-27T19:45:03
| 2021-04-27T19:45:03
| 357,917,490
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,430
|
h
|
shadermanagerclass.h
|
////////////////////////////////////////////////////////////////////////////////
// Filename: shadermanagerclass.h
////////////////////////////////////////////////////////////////////////////////
#ifndef _SHADERMANAGERCLASS_H_
#define _SHADERMANAGERCLASS_H_
///////////////////////
// MY CLASS INCLUDES //
///////////////////////
#include "d3dclass.h"
#include "textureshaderclass.h"
#include "lightshaderclass.h"
#include "skydomeshaderclass.h"
#include "bumpmapshaderclass.h"
#include "fireshaderclass.h"
////////////////////////////////////////////////////////////////////////////////
// Class name: ShaderManagerClass
////////////////////////////////////////////////////////////////////////////////
class ShaderManagerClass
{
public:
ShaderManagerClass();
ShaderManagerClass(const ShaderManagerClass&);
~ShaderManagerClass();
bool Initialize(ID3D11Device*, HWND);
void Shutdown();
bool RenderTextureShader(ID3D11DeviceContext*, int, const XMMATRIX&, const XMMATRIX&, const XMMATRIX&, ID3D11ShaderResourceView*);
bool RenderLightShader(ID3D11DeviceContext*, int, const XMMATRIX&, const XMMATRIX&, const XMMATRIX&, ID3D11ShaderResourceView*,
XMFLOAT3, XMFLOAT4, XMFLOAT4, XMFLOAT3, XMFLOAT4, float);
bool RenderBumpMapShader(ID3D11DeviceContext*, int, const XMMATRIX&, const XMMATRIX&, const XMMATRIX&, ID3D11ShaderResourceView*,
ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4);
bool RenderSkyDomeShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, XMFLOAT4, XMFLOAT4);
bool RenderFireShader(ID3D11DeviceContext* deviceContext, int indexCount, const XMMATRIX& worldMatrix, const XMMATRIX& viewMatrix, const XMMATRIX& projectionMatrix, ID3D11ShaderResourceView* fireTexture, ID3D11ShaderResourceView* noiseTexture, ID3D11ShaderResourceView* alphaTexture, float frameTime, XMFLOAT3 scrollSpeeds, XMFLOAT3 scales, XMFLOAT2 distortion1, XMFLOAT2 distortion2, XMFLOAT2 distortion3, float distortionScale, float distortionBias);
bool RenderPointLights(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix, ID3D11ShaderResourceView* texture, XMFLOAT4 diffuseColor[], XMFLOAT4 lightPosition[]);
private:
TextureShaderClass* m_TextureShader;
LightShaderClass* m_LightShader;
LightShaderClass* m_LightShaderPoint;
BumpMapShaderClass* m_BumpMapShader;
SkyDomeShaderClass* m_SkyDomeShader;
FireShaderClass* m_FireShader;
};
#endif
|
ef3ba50333240239b7c28abbddd653a2312b278d
|
1562887c93a84858225f2d0de8a062310575b944
|
/3D Basics/UI_InputField.cpp
|
fc2204dbeab251c6a7eb9794f96be78d291ab7e8
|
[
"MIT"
] |
permissive
|
Csumbavamba/Terrain-Generation
|
a7af87cf3df93463513f5e8f1afd855ebb3ffa0c
|
8a3d86494d5ce0f9a0294210aba8464edabc57da
|
refs/heads/master
| 2020-05-21T02:41:05.874392
| 2019-05-09T23:42:42
| 2019-05-09T23:42:42
| 185,883,489
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,713
|
cpp
|
UI_InputField.cpp
|
#include "UI_InputField.h"
#include "TextLabel.h"
#include "Input.h"
UI_InputField::UI_InputField(glm::vec2 position, std::string menuTitle)
{
std::string font = "Dependencies/Fonts/DWARVESC.TTF";
positionOnScreen = position;
isTyping = false;
displayText = new TextLabel(menuTitle, font, position);
displayText->Initialise();
text = menuTitle;
AdjustTextPosition();
}
UI_InputField::~UI_InputField()
{
delete displayText;
displayText = NULL;
}
void UI_InputField::Render(GLuint program)
{
displayText->Render(NULL);
}
void UI_InputField::Update(float deltaTime)
{
displayText->Update();
// Get Input from player if it's in typing mode
if (isTyping)
{
InputText();
}
}
void UI_InputField::Reset()
{
isTyping = false;
text = "Default ";
displayText->SetText(text);
}
void UI_InputField::AdjustTextPosition()
{
displayText->CalculateDimensions();
glm::vec2 adjustedPosition = glm::vec2(
positionOnScreen.x - displayText->GetTextWidth() / 2,
positionOnScreen.y - displayText->GetTextHeight() / 2);
displayText->SetPosition(adjustedPosition);
}
void UI_InputField::SetIsTyping(bool isModifying)
{
this->isTyping = isModifying;
if (!isTyping)
{
displayText->SetColor(glm::vec3(0.8f, 0.8f, 0.8f));
}
else
{
displayText->SetColor(glm::vec3(1.0f, 1.0f, 1.0f));
text = "";
displayText->SetText(text);
}
}
bool UI_InputField::IsTyping() const
{
return isTyping;
}
void UI_InputField::InputText()
{
// Get the last key that was pressed
char letter(Input::GetLastKeyDown());
// Erase last character if BackSpace is pressed
if (Input::GetKeyState(8) == DOWN_FIRST || Input::GetKeyState(127) == DOWN_FIRST)
{
// Only erase if it's not empty
if (!text.empty())
{
// Erase last character
text.erase(text.end() - 1);
// Display characters
displayText->SetText(text);
}
}
// Add character based on user press
else if (letter != 'Null' && Input::GetKeyState(letter) == DOWN_FIRST)
{
std::string stringLetter(1, letter);
// Append the text by the key that was pressed
text.append(stringLetter);
displayText->SetText(text);
}
}
std::string UI_InputField::GetText() const
{
return text;
}
void UI_InputField::SetFont(std::string font)
{
displayText->SetFont(font);
}
void UI_InputField::SetText(std::string text)
{
this->text = text;
displayText->SetText(text);
// Add Adjustment based on alignment
}
void UI_InputField::SetColor(glm::vec3 color)
{
displayText->SetColor(color);
}
void UI_InputField::SetScale(float scale)
{
displayText->SetScale(scale);
AdjustTextPosition();
}
|
02cb054579b9c89ae8e8e8c5e243a2978dbacf91
|
ff9e7a7b77db7c46ceeb538e903b9817c379082e
|
/Greedy Algorithm/Maximum Trains for which stoppage can be provided.cpp
|
6b0ac0296886b277d051d5bf3181bb9c7c8a9ce6
|
[
"MIT"
] |
permissive
|
itaniyagupta/Famous_Programming_Problems
|
c3faa55e00e4348de690ac96b0aecc311385d919
|
0038af77c95069f0889abf5bfc4e928bc290bfa4
|
refs/heads/main
| 2023-06-19T13:00:29.441331
| 2021-07-19T09:30:58
| 2021-07-19T09:30:58
| 314,440,158
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 657
|
cpp
|
Maximum Trains for which stoppage can be provided.cpp
|
class Solution {
public:
int maxStop(vector<vector<int>>& arr, int n, int m) // n = no. of platforms; m = no. of trains;
{
vector<pair<int, int> > vect[n + 1];
for (int i = 0; i < m; i++)
vect[arr[i][2]].push_back(make_pair(arr[i][1], arr[i][0]));
for (int i = 0; i <= n; i++)
sort(vect[i].begin(), vect[i].end());
int count = 0;
for (int i = 0; i <= n; i++)
{
if (vect[i].size() == 0)
continue;
int x = 0;
count++;
for (int j = 1; j < vect[i].size(); j++)
{
if (vect[i][j].second >= vect[i][x].first)
{
x = j;
count++;
}
}
}
return count;
}
};
|
012986e96d6f02678ed259cc07a7191e83c1e6ac
|
6e887cc1c6b722f1dc8566946ae0af57052528be
|
/src/ig_simulator/multiplicity_creator.hpp
|
45ef3e6bfaac52481d617b0181e77850906c577d
|
[] |
no_license
|
yana-safonova/ig_simulator
|
ab4cc596c651c84f1ff038e5a85f8dbe23f7366c
|
c3778b74f459927cc2e2f1cce45e9b3ddd3932d7
|
refs/heads/master
| 2021-01-17T13:12:19.678776
| 2015-07-11T19:23:22
| 2015-07-11T19:23:22
| 30,644,246
| 14
| 8
| null | 2016-11-25T17:43:44
| 2015-02-11T11:15:03
|
C++
|
UTF-8
|
C++
| false
| false
| 3,006
|
hpp
|
multiplicity_creator.hpp
|
#pragma once
#include "repertoire.hpp"
template<class IgVariableRegionPtr>
class BaseMultiplicityCreator {
public:
virtual size_t AssignMultiplicity(IgVariableRegionPtr ig_variable_region_ptr) = 0;
};
//-------------------------------------------------------------------------------------------
template<class IgVariableRegionPtr>
class ExponentialMultiplicityCreator : public BaseMultiplicityCreator<IgVariableRegionPtr> {
double lambda_;
public:
ExponentialMultiplicityCreator(size_t n1, size_t n2) :
lambda_(double(n1) / n2) { }
size_t AssignMultiplicity(IgVariableRegionPtr ig_variable_region_ptr) {
return size_t((-1) * log(1 - double(rand()) / RAND_MAX) / lambda_) + 1;
}
};
typedef ExponentialMultiplicityCreator<HC_VariableRegionPtr> HC_ExponentialMultiplicityCreator;
typedef ExponentialMultiplicityCreator<LC_VariableRegionPtr> LC_ExponentialMultiplicityCreator;
//-------------------------------------------------------------------------------------------
template<class IgVariableRegionPtr>
class PowerLawMultiplicityCreator : public BaseMultiplicityCreator<IgVariableRegionPtr> {
double T_;
double lambda_;
double C_;
double mult_;
double FindLambda(double M, double N) {
double l = 1;
double r = 1000;
for (size_t i = 0; i < 100; i++) {
double s = (l + r) / 2;
double tmp = (s - 1) / (s - 2) * (1 - pow(T_, 2 - s)) / (1 - pow(T_, 1 - s));
//cout << tmp << " " << s << endl;
if(tmp < M / N)
r = s;
else
l = s;
}
//cout << l - 2 << endl;
return l; //(N + 2) / (N + 1);
}
double s(double n) {
return (1 - pow(n + 1, 1 - lambda_)) * C_ / (lambda_ - 1);
}
double p(double n) {
return pow(n, - lambda_) * C_;
}
public:
PowerLawMultiplicityCreator(size_t n1, size_t n2) :
T_(double(n2) * 0.3),
lambda_(FindLambda(n2, n1)),
C_((lambda_ - 1) / (1 - pow(double(T_), 1 - lambda_))),
mult_(1 / (1 - lambda_)) {
// srand (time(NULL));
// cout << lambda_ << " " << C_ << endl;
// cout << (lambda_ + 1) / lambda_ * (1 - pow(T_, -lambda_)) << endl;
double sum0 = 0;
double sum1 = 0;
double div = 0;
for(double i = T_; i > .5; i -= 1) {
sum0 += p(i);
sum1 += (s(i) - s(i - 1)) * i;
div += (s(i) - s(i - 1)) * i * i;
}
// cout << sum0 << " " << sum1 << " " << sqrt(div - sum1 * sum1) << endl;
}
size_t AssignMultiplicity(IgVariableRegionPtr ig_variable_region_ptr) {
double base = 1 - double(rand()) / RAND_MAX * (-1 + lambda_) / C_; //double(i + .5) / n1_;
return size_t(pow(base, mult_));
}
};
typedef PowerLawMultiplicityCreator<HC_VariableRegionPtr> HC_PowerLawMultiplicityCreator;
typedef PowerLawMultiplicityCreator<LC_VariableRegionPtr> LC_PowerLawMultiplicityCreator;
|
03c2e3b50a67a366d26030b50224e07c7a5244da
|
10a1aee57185b62e3b9a55d3e65240f6431178fd
|
/libcrafter/crafter/Protocols/ICMPExtensionCraft.cpp
|
9ab75996ea4a6de7a6d3f416b7704e45d6a6e43d
|
[
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
pellegre/libcrafter
|
08876649860e45a449f2e67f9ef15f7bcb0957fa
|
821a933cfcfc8dc0337d8bd3a6db3a5e2f063258
|
refs/heads/master
| 2023-08-05T06:28:16.148414
| 2023-05-30T22:47:21
| 2023-05-30T22:47:21
| 6,434,669
| 264
| 81
| null | 2021-11-13T00:19:25
| 2012-10-29T02:24:14
|
C++
|
UTF-8
|
C++
| false
| false
| 2,390
|
cpp
|
ICMPExtensionCraft.cpp
|
/*
Copyright (c) 2012, Bruno Nery
Copyright (c) 2012, Esteban Pellegrino
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL ESTEBAN PELLEGRINO BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "ICMPExtension.h"
#include "ICMPExtensionObject.h"
using namespace Crafter;
using namespace std;
void ICMPExtension::ReDefineActiveFields() {
}
void ICMPExtension::Craft() {
SetPayload(NULL, 0);
if (!IsFieldSet(FieldCheckSum) || (GetCheckSum() == 0)) {
/* Total size */
size_t total_size = GetRemainingSize();
if ( (total_size%2) != 0 ) total_size++;
byte* buff_data = new byte[total_size];
buff_data[total_size - 1] = 0x00;
/* Compute the 16 bit checksum */
SetCheckSum(0);
GetData(buff_data);
short_word checksum = CheckSum((unsigned short *)buff_data,total_size/2);
SetCheckSum(ntohs(checksum));
ResetField(FieldCheckSum);
delete [] buff_data;
}
}
void ICMPExtension::ParseLayerData(ParseInfo* info) {
info->next_layer = Protocol::AccessFactory()->GetLayerByID(ICMPExtensionObject::PROTO);
}
|
45df7693cd96527d0762054a554a63a436828dde
|
307118ad212baf525c1c0728ffebc87f494d4f61
|
/test_finger/TempDialog.cpp
|
974f96a484f6117be0b60b2a621599c9fc9f4923
|
[] |
no_license
|
YouDad/test_finger
|
8fb732feaa0170d173d3d1546e03646a38355758
|
dc61f61666637505e2dd5e503860080f63ba9263
|
refs/heads/master
| 2022-12-12T01:18:24.485565
| 2020-06-16T15:27:58
| 2020-09-13T18:08:59
| 188,590,410
| 0
| 1
| null | null | null | null |
GB18030
|
C++
| false
| false
| 3,399
|
cpp
|
TempDialog.cpp
|
#include "stdafx.h"
IMPLEMENT_DYNAMIC(TempDialog,CDialogEx)
// 构造函数
TempDialog::TempDialog(CWnd* pParent)
: CDialogEx(IDD_TempDialog,pParent){}
// 析构函数
TempDialog::~TempDialog(){
//TODO 析构
}
LRESULT TempDialog::response(WPARAM w,LPARAM l){
return TRUE;
}
// 初始化事件
BOOL TempDialog::OnInitDialog(){
CDialogEx::OnInitDialog();
setText(GetDlgItem(IDC_EDITBufferID),"1");
return 0;
}
// 阻止Enter关闭窗口
void TempDialog::OnOK(){}
// 消息映射
BEGIN_MESSAGE_MAP(TempDialog,CDialogEx)
RESPONSE_USER_MESSAGE(response)
ON_BN_CLICKED(IDC_BTNDownImage,&TempDialog::OnBnClickedBtnDownImage)
ON_BN_CLICKED(IDC_BTNWriteNotepad,&TempDialog::OnBnClickedBtnWriteNotepad)
ON_BN_CLICKED(IDC_BTNDownChar,&TempDialog::OnBnClickedBtnDownChar)
END_MESSAGE_MAP()
void TempDialog::OnBnClickedBtnDownImage(){
MyString SelectedImagePath;
if(!MyFile::OpenFileDialog("bmp",this,SelectedImagePath)){
MyLog::error("未选择图片");
return;
}
if(MyFile::ReadImage(SelectedImagePath,tempCommDataPacket)){
isFreeRequest=2;
comm.request(0x0b);
MyLog::user("发送图像成功!");
} else{
MyLog::error("所选图像不能用于发送");
}
}
void TempDialog::OnBnClickedBtnWriteNotepad(){
MyString SelectedNotepadPath;
if(!MyFile::OpenFileDialog("txt",this,SelectedNotepadPath)){
MyLog::error("未选择记事本");
return;
}
int NotepadID=MyString::AutoParseInt(getText(GetDlgItem(IDC_EDITNotepadID)));
if(0>NotepadID||NotepadID>15){
MyLog::error("NotepadID只能在[0,15]的范围内");
return;
}
DataPacket data;
MyString msg="";
auto f=[&](FILE* fp)->bool{
uint8_t pData[33];
int ret,t;
for(int i=0;i<32;i++){
ret=fscanf(fp,"%x",&t);
pData[i+1]=t;
if(t<0||t>255){
msg=MyString::Format("第%d个十六进制数未在[0x00,0xFF]范围内",i);
return false;
}
if(ret==EOF){
msg="十六进制数个数不足";
return false;
}
}
ret=fscanf(fp,"%*x");
if(ret!=EOF){
msg="十六进制数个数超过32个";
return false;
} else{
pData[0]=NotepadID;
data=DataPacket(pData,33);
return true;
}
};
if(MyFile::Read(SelectedNotepadPath,f)){
isFreeRequest=2;
comm.request(0x18,data);
MyLog::user("发送Notepad成功!");
} else{
MyLog::error("该记事本格式不正确:%s",(const char*)msg);
}
}
void TempDialog::OnBnClickedBtnDownChar(){
MyString SelectedCharPath;
if(!MyFile::OpenFileDialog("char",this,SelectedCharPath)){
MyLog::error("未选择特征文件");
return;
}
uint8_t BufferID=MyString::AutoParseInt(getText(GetDlgItem(IDC_EDITBufferID)));
DataPacket data(&BufferID,1);
if(MyFile::LoadCharFile(SelectedCharPath,tempCommDataPacket)){
isFreeRequest=2;
comm.request(0x09,data);
MyLog::user("发送特征文件成功!");
} else{
MyLog::error("所选特征文件不能用于发送");
}
}
|
cda9165ca31c255133bec011e48730a66987f41a
|
11eea8da1b414871e0f8608dd61ee543e81b4b19
|
/P1106.cpp
|
2db861ec83b6109908d8e1bd8e54382a703a6a60
|
[] |
no_license
|
Tomistong/MyLuoguRepo
|
57ed57ad504978f7402bd1bbeba30b2f4ae32a22
|
5dfe5e99b0909f9fe5416d5eaad01f368a2bf891
|
refs/heads/master
| 2023-08-29T05:18:29.981970
| 2021-10-06T04:23:02
| 2021-10-06T04:23:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 463
|
cpp
|
P1106.cpp
|
#include <algorithm>
#include <iostream>
using namespace std;
int a[300], k;
int main() {
int n;
for (int i = 0;; ++i) {
char c = (char)getchar();
if (c == '\n' || c == '\r' || c == ' ') {
n = i;
break;
} else
a[i] = c - '0';
}
cin >> k;
sort(a, a + n);
// cout << n << " ";
for (int i = 0; i < n - k; i++) {
cout << a[i];
}
return 0;
}
|
60e2fd178ee0e74f6c0e4f0144ceb344b87619ef
|
2e5bc0ec41f772109b48082961b791ce8ef13e37
|
/classes/Alignment.h
|
1e5ef721b923f441b3eae5b883382ee557e09491
|
[] |
no_license
|
Chefslayer/Translator
|
41fde25e143218c4cdd4cb9cf4889dadf31848d7
|
7ecf27cbc0dffedb4cf9b624cb50d6aab979443f
|
refs/heads/master
| 2016-09-05T14:18:12.645917
| 2009-07-31T17:01:38
| 2009-07-31T17:01:38
| 190,734
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,041
|
h
|
Alignment.h
|
/**
* @file
* @author Gruppe 2
* @version 1.0
*
* @section DESCRIPTION
*
* This file implements the Alignment Class, which handels the reading for a alignment-file.
*/
#ifndef __ALIGNMENT_H__
#define __ALIGNMENT_H__
#include <vector>
#include <string>
#include "../lib/gzstream.h"
#include "../includes/PhrasePair.h"
using namespace std;
/**
* This file implements the Alignment Class, which handels the reading for a alignment-file.
*/
class Alignment
{
private:
/// holds the alignment for a sentence first: src, second: target
vector<pair<unsigned int, unsigned int> > aligVec;
/// holds the alignment for the target lang
// vector<unsigned int> targetVec;
/// current sentence
unsigned int sentenceNum;
/// length of the current source-line
unsigned int srcLength;
/// length of the current target-ine
unsigned int targetLength;
public:
/// the file with the alignment
char* fileName;
/// the file-stream with the alignment
igzstream* file;
/** Constructor inits the class
*
* \param fileName the alignment file
* \throws bool openFileFail if the file cannot be opened
*/
Alignment(char* fileName);
/** sets up the class for for the next sentence
*
* \param srcLength length of the source-sentence
* \param targetLength length of the target-sentence
*/
void nextSentence(unsigned int srcLength, unsigned int targetLength);
/** first aligned word in target lang.
*
* \param j1 first pointer in source sentence
* \param j2 second pointer in source sentence
* \return first aligned word in target lang
*/
unsigned int getMinTargetAlig(unsigned int j1, unsigned int j2);
/** last aligned word in target lang.
*
* \param j1 first pointer in source sentence
* \param j2 second pointer in source sentence
* \return last aligned word in target lang
*/
unsigned int getMaxTargetAlig(unsigned int j1, unsigned int j2);
/** first aligned word in source lang.
*
* \param i1 first pointer in target sentence
* \param i2 second pointer in target sentence
* \return first aligned word in source lang
*/
unsigned int getMinSrcAlig(unsigned int i1, unsigned int i2);
/** last aligned word in source lang.
*
* \param i1 first pointer in target sentence
* \param i2 second pointer in target sentence
* \return last aligned word in source lang
*/
unsigned int getMaxSrcAlig(unsigned int i1, unsigned int i2);
/** Outputs a phrase
*
* \param j1 first pointer in source sentence
* \param j2 second pointer in source sentence
* \param i1 first pointer in target sentence
* \param i2 second pointer in target sentence
* \param srcWords words of the source line
* \param targetWords words of the target line
* \return a PhrasePair which contains the words of the phrase in src and target lang
*/
PhrasePair* outputPhrase(unsigned int j1, unsigned int j2, unsigned int i1, unsigned int i2, vector<unsigned int> &srcWords, vector<unsigned int> &targetWords);
};
#endif
|
f829a83a360492c69662a583b46adc9b68895247
|
422f41495876d9250770ad5d4d829c49e4c99a3c
|
/FlirOneControl/cpicture.h
|
4e647082b716c4a9fea6ad07f176bd5e272558ab
|
[
"MIT"
] |
permissive
|
da-nie/FlirOneControlForLinux
|
d87f901321dd5bc52df441557b5259f7012eb81d
|
e3460d97da3e6330b898eb0374a7837790538865
|
refs/heads/master
| 2022-08-28T20:34:31.739236
| 2020-05-24T14:06:19
| 2020-05-24T14:06:19
| 265,639,283
| 16
| 2
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,472
|
h
|
cpicture.h
|
#ifndef C_PICTURE_H
#define C_PICTURE_H
//****************************************************************************************************
//Класс простого изображения
//****************************************************************************************************
//****************************************************************************************************
//подключаемые библиотеки
//****************************************************************************************************
#include "iimage.h"
#include <vector>
#include <stdint.h>
//****************************************************************************************************
//макроопределения
//****************************************************************************************************
//****************************************************************************************************
//константы
//****************************************************************************************************
//****************************************************************************************************
//предварительные объявления
//****************************************************************************************************
//****************************************************************************************************
//Класс простого изображения
//****************************************************************************************************
class CPicture:public IImage
{
public:
//-перечисления---------------------------------------------------------------------------------------
//-структуры------------------------------------------------------------------------------------------
//-константы------------------------------------------------------------------------------------------
private:
//-переменные-----------------------------------------------------------------------------------------
uint32_t Width;//ширина
uint32_t Height;//высота
std::vector<uint32_t> vector_Image;//данные изображения
public:
//-конструктор----------------------------------------------------------------------------------------
CPicture(void);
//-деструктор-----------------------------------------------------------------------------------------
~CPicture();
public:
//-открытые функции-----------------------------------------------------------------------------------
void GetRGBAImage(uint32_t &width,uint32_t &height,std::vector<uint32_t> &vector_image);//получить изображение в формате RGBA
void SetRGBAImage(const uint32_t &width,const uint32_t &height,const std::vector<uint32_t> &vector_image);//задать изображение в формате RGBA
void SetSize(uint32_t width,uint32_t height);//задать размер изображения и выделить память
void SetRGBAPixel(uint32_t x,uint32_t y,uint32_t color);//задать точку
uint32_t GetRGBAPixel(uint32_t x,uint32_t y);//получить точку
private:
//-закрытые функции-----------------------------------------------------------------------------------
};
#endif
|
bd69a5f27b3180ce8bee5226af98a447a9b13ed7
|
7a28a00bd395977d2004361b480c5c9c226b06b0
|
/nebulosity4/cameras/AOSX/Imager100.h
|
37f9b005b169ac149b2a5208bdb241e1420ab2ec
|
[
"BSD-3-Clause"
] |
permissive
|
supritsingh/OpenNebulosity
|
99d3b037ec33a66bf079643d536790d85daa64b8
|
fa5cc91aec0cbb9e8cac7fdc434d617b02ee8175
|
refs/heads/main
| 2023-08-27T19:47:35.879790
| 2021-11-07T21:55:11
| 2021-11-07T21:55:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,453
|
h
|
Imager100.h
|
//
// Imager100.h
// ATIKOSXDrivers
//
// Created by Nick Kitchener on 18/12/2014.
// Copyright (c) 2014 ATIK. All rights reserved.
//
#ifndef ATIKOSXDrivers_Imager100_h
#define ATIKOSXDrivers_Imager100_h
#include "ImageFrame.h"
#include "ServiceInterface.h"
#include "Cooling100.h"
#include "GuidePort100.h"
#include "StateObserver.h"
const std::string kATIKProtocolNameImagerAnyVersion = std::string("Imager");
// Provides useful camera imager properties.
class ImagerProperties100 {
public:
virtual ~ImagerProperties100() {};
virtual uint32_t xPixels()=0; // total number of X pixels
virtual uint32_t yPixels()=0; // total number of Y pixels
virtual uint32_t maxBinX()=0; // maximum binning in X supported
virtual uint32_t maxBinY()=0; // maximum binning in Y supported
virtual float xPixelSize()=0; // pixel X size in microns*100, ie 740 would be 7.4um.
virtual float yPixelSize()=0; // pixel Y size in microns*100, ie 740 would be 7.4um.
// properties to show if these are supported.
virtual bool isBinningSupported()=0;
virtual bool isSubframingSupported()=0;
virtual bool isPreviewSupported()=0;
virtual bool isFIFOProgrammable()=0;
virtual bool hasInternalFilterControl()=0;
};
class Imager100 : virtual public ServiceInterface, virtual public ImagerProperties100 {
public:
virtual ~Imager100() {};
// This allows the camera to peform some validation checking and buffer
// size allocation with the image frame.
// This should be called each time a frame is used.
virtual void prepare(ImageFrame* image)=0;
// This allows the camera to perform any post processing required.
// It should be called each time a frame snapshot have been completed.
virtual void postProcess(ImageFrame* image)=0;
// This takes an image
virtual void snapShot(ImageFrame* image, bool shouldBlock)=0;
// abort the current exposure, the exposure timer is aborted but download still occurs.
virtual void abortCapture()=0;
// return the cooling interface for the device
virtual Cooling100* cooling()=0;
// return the guide port for this imager
virtual GuidePort100* guidePort()=0;
virtual void setExtension(const char* extension, const char* value)=0;
virtual const std::string state()=0;
virtual void setStateObserver(StateObserver* observer)=0;
};
#endif
|
84b98237f182bfc91d7d71a1164ce3d8cebf7eea
|
fc034918d460f218be1456cf7a8f9ffbed01830f
|
/octosim/octosimtest/DnsRealisticTest.cpp
|
211388fdeda53f60c946f01a4aabf0a8075224c3
|
[] |
no_license
|
private-octopus/octosim
|
649a2e14be937e1a24be9e8066ed274e3723e129
|
ef1b8ab22cac7cf387bbe711a97fa1fbd46cdc2f
|
refs/heads/master
| 2021-01-19T23:00:01.844936
| 2017-05-06T19:07:14
| 2017-05-06T19:07:14
| 88,905,334
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,246
|
cpp
|
DnsRealisticTest.cpp
|
/*
* Copyright (c) 2017, Private Octopus, Inc.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL Private Octopus, Inc. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
#include "../octosimlib/IModels.h"
#include "../octosimlib/SimulationLoop.h"
#include "../octosimlib/RandomByCFD.h"
#include "../octosimlib/DnsRecursive.h"
#include "../octosimlib/DnsStub.h"
#include "../octosimlib/TcpSim.h"
#include "../octosimlib/DnsUdpTransport.h"
#include "../octosimlib/LossyLink.h"
#include "ReferenceCfd.h"
#include "DnsRealisticTest.h"
DnsRealisticTest::DnsRealisticTest()
{
}
DnsRealisticTest::~DnsRealisticTest()
{
}
const unsigned int nb_variants = 4;
bool DnsRealisticTest::DnsRealisticDoTest()
{
bool ret = true;
for (unsigned int i = 0; ret && i < nb_variants; i++)
{
ret = DnsRealisticOneTest(i, 1000, 15000, 0.01);
}
return ret;
}
char * csv_variant[] = {
"dnsUdpRealistic.csv",
"dnsTcpRealistic.csv",
"dnsQuicRealistic.csv",
"dnsQuic0RttRealistic.csv"
};
char * traces_variant[] = {
"dnsUdpRealisticTraces.txt",
"dnsTcpRealisticTraces.txt",
"dnsQuicRealisticTraces.txt",
"dnsQuic0RttRealisticTraces.txt"
};
bool DnsRealisticTest::DnsRealisticOneTest(unsigned int variant,
unsigned int nb_packets, unsigned int delay, double lossRate)
{
bool ret = variant < nb_variants;
FILE * CsvLog = NULL;
FILE * TraceLog = NULL;
if (ret)
{
errno_t err = fopen_s(&TraceLog, traces_variant[variant], "w");
ret = (err == 0);
}
if (ret)
{
errno_t err = fopen_s(&CsvLog, csv_variant[variant], "w");
ret = (err == 0);
}
SimulationLoop * loop = new SimulationLoop(TraceLog);
RandomDelayByCFD * arrival_process = new RandomDelayByCFD(loop);
RandomDelayByCFD * authoritative_process = new RandomDelayByCFD(loop);
RandomLengthByCFD * source_length = new RandomLengthByCFD(loop);
RandomLengthByCFD * response_length = new RandomLengthByCFD(loop);
DnsStub * stub = new DnsStub(loop, CsvLog, nb_packets, arrival_process, source_length);
DnsRecursive * recursive = new DnsRecursive(loop, authoritative_process, response_length);
ITransport * transport1 = NULL;
ITransport * transport2 = NULL;
switch (variant)
{
case 0:
transport1 = new DnsUdpTransport(loop);
transport2 = new DnsUdpTransport(loop);
break;
case 1:
transport1 = new TcpSim(loop, false);
transport2 = new TcpSim(loop, false);
break;
case 2:
transport1 = new TcpSim(loop, true);
transport2 = new TcpSim(loop, true);
break;
case 3:
transport1 = new TcpSim(loop, true, true);
transport2 = new TcpSim(loop, true, true);
break;
default:
ret = false;
break;
}
LossyLink * path1 = new LossyLink(loop, lossRate, delay);
LossyLink * path2 = new LossyLink(loop, lossRate, delay);
if (loop == NULL || arrival_process == NULL || authoritative_process == NULL ||
source_length == NULL || response_length == NULL ||
stub == NULL || recursive == NULL ||
transport1 == NULL || transport2 == NULL || path1 == NULL || path2 == NULL)
{
ret = false;
}
else
{
/* Creating a two way network. */
stub->SetTransport(transport1);
transport1->SetApplication(stub);
transport1->SetPath(path1);
path1->SetTransport(transport2);
recursive->SetTransport(transport2);
transport2->SetApplication(recursive);
transport2->SetPath(path2);
path2->SetTransport(transport1);
ret = loop->Init();
if (ret)
{
ret = arrival_process->Init(ReferenceCfd::NbPoints(),
ReferenceCfd::Proba(), ReferenceCfd::Arrival()) &&
authoritative_process->Init(ReferenceCfd::NbPoints(),
ReferenceCfd::Proba(), ReferenceCfd::Authoritative()) &&
source_length->Init(ReferenceCfd::NbPoints(),
ReferenceCfd::Proba(), ReferenceCfd::QueryLength()) &&
response_length->Init(ReferenceCfd::NbPoints(),
ReferenceCfd::Proba(), ReferenceCfd::ResponseLength());
}
if (ret)
{
loop->RequestTimer(0, stub);
while (loop->DoLoop());
if (stub->nb_packets_sent != stub->nb_packets_to_send ||
stub->nb_transactions_complete != stub->nb_packets_sent)
{
ret = false;
}
}
}
if (path1 != NULL)
delete path1;
if (path2 != NULL)
delete path2;
if (transport1 != NULL)
delete transport1;
if (transport2 != NULL)
delete transport2;
if (recursive != NULL)
delete recursive;
if (stub != NULL)
delete stub;
if (arrival_process != NULL)
delete arrival_process;
if (authoritative_process != NULL)
delete authoritative_process;
if (source_length != NULL)
delete source_length;
if (response_length != NULL)
delete response_length;
if (loop != NULL)
delete loop;
if (CsvLog != NULL)
{
fclose(CsvLog);
}
if (TraceLog != NULL)
{
fclose(TraceLog);
}
return ret;
}
|
ed64b2af24d3344bd518aa39bd419416bd217b61
|
559117b8479d2c6bc58936472da03285eef0174c
|
/OpenFrameworks/addons/augmentedMirror/src/amCalibrationApp.cpp
|
5bd8d427d012ff3856b04d08eb2387d4c7fa2feb
|
[] |
no_license
|
fidiniaina/AugmentedMirror
|
f9e9c5a0ab842c047af9403fae17bb0ff601b83a
|
deaf7491f97739e53e9ea5800e97458c14597173
|
refs/heads/master
| 2021-01-21T00:12:21.343530
| 2014-05-06T16:05:56
| 2014-05-06T16:05:56
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 25,521
|
cpp
|
amCalibrationApp.cpp
|
#include "amCalibrationApp.h"
ofxMSAShape3D shape3d;
//--------------------------------------------------------------
void amCalibrationApp::setup(){
//ofSetLogLevel(OF_LOG_NOTICE);
ofSetVerticalSync(true);
amsetting = new amSetting("amSetting.xml");
numOfCapture = 20;
captureInterval = 2;
patternSize.width = 8;
patternSize.height = 6;
squareSize = 2.457; //cm
captureTimer = new ofxTimer();
ofAddListener(captureTimer->TIMER_REACHED,this,&amCalibrationApp::handleTimer);
capturedCvImages[0].resize(numOfCapture);
capturedCvImages[1].resize(numOfCapture);
isCaptured[0].resize(numOfCapture);
isCaptured[1].resize(numOfCapture);
bigFont.loadFont("automat.ttf",32);
//init all the camera pairs
amCameraPair* amCamPair;
for (int camPair = 0 ; camPair < amsetting->cameraPairs.size(); camPair++) {
amCamPair = amsetting->cameraPairs[camPair];
amCamPair->init();
}
//setup display images
amCamPair = amsetting->cameraPairs[0];
amCamera* cam;
for (int num = 0 ; num < 2 ; num++) {
cam = amCamPair->getCamera(num);
displayImages[num].allocate(cam->getCaptureWidth(), cam->getCaptureHeight());
}
//set background color to black
float* bgColor = ofBgColorPtr();
bgColor[0] = bgColor[1] = bgColor[2] = 0;
//prepare captured message
capturedMsg = "captured!";
ofRectangle rect = bigFont.getStringBoundingBox(capturedMsg,0,0);
capturedMsgCX = rect.width*0.5;
capturedMsgCY = rect.height*0.5;
ofSetVerticalSync(true);
centerX = ofGetWidth()/2;
centerY = ofGetHeight()/2;
centerZ = 0;
camera.position(10, 850, 20);
camera.eye(815,1230,-5320);
camera.up(0,1,0);
camera.perspective(140,4/3,0,10000.0f);
light.directionalLight(255, 0, 0, 1, 0, 0);
//setup the server to listen on 11999
TCP.setup(11999);
}
//--------------------------------------------------------------
void amCalibrationApp::update(){
if (!gui->mIsActive) return;
amCameraPair* amCamPair;
amCamera* cam;
//call all the camera pairs to grab frame
for (int camPair = 0 ; camPair < amsetting->cameraPairs.size(); camPair++) {
amCamPair = amsetting->cameraPairs[camPair];
amCamPair->grabFrames();
//for selected pair, copy the frames to cvImages
if (camPair == guiPairMatrix->mValue) {
for (int num = 0 ; num < 2 ; num++) {
cam = amCamPair->getCamera(num);
displayImages[num].setFromPixels(cam->getPixels(), cam->getCaptureWidth(), cam->getCaptureHeight());
}
}
}
//handle capturing
if (guiCapturePairButton->mValue) {
amCamPair = getSelectedCameraPair();
int captureId = getFirstUncheckedId(guiCapturePairMatrix);
if (captureId == -1) { //if all are captured
guiCapturePairButton->setValue(false); //stop capturing
return;
}
//detect and draw corners
vector<CvPoint2D32f> temp(patternSize.width*patternSize.height);
int count = 0;
bool checkboardResults[2];
for (int num = 0 ; num < 2 ; num++) {
checkboardResults[num] = cvFindChessboardCorners(displayImages[num].getCvImage(),
patternSize,
&temp[0],
&count,
CV_CALIB_CB_ADAPTIVE_THRESH |
CV_CALIB_CB_NORMALIZE_IMAGE);
cvDrawChessboardCorners(displayImages[num].getCvImage(),
patternSize,
&temp[0],
count,
checkboardResults[num] );
}
//capture
if (timeReached && checkboardResults[0] && checkboardResults[1]) {
ofxCvColorImage* saveImage;
for (int num = 0 ; num < 2 ; num++) {
saveImage = &capturedCvImages[num][captureId];
cam = amCamPair->getCamera(num);
saveImage->allocate(cam->getCaptureWidth(),cam->getCaptureHeight());
saveImage->setFromPixels(cam->getPixels(),cam->getCaptureWidth(),cam->getCaptureHeight());
isCaptured[num][captureId] = true;
}
firstCapture = false;
guiCapturePairMatrix->mBuffer[captureId] = true;
timeReached = false;
captureTimer->startTimer();
if (getFirstUncheckedId(guiCapturePairMatrix) == -1) { //if all are captured
guiCapturePairButton->setValue(false); //stop capturing
}
}
}
}
int amCalibrationApp::getFirstUncheckedId(ofxGuiMatrix* guiMat) {
for (int id = 0 ; id < guiMat->mBufferLength ; id++) {
if (guiMat->mBuffer[id] == false) return id;
}
return -1;
}
void amCalibrationApp::calibrateSelectedPair(){
amCameraPair* amCamPair = getSelectedCameraPair();
CvMat _M1 = cvMat(3, 3, CV_64F, amCamPair->getCamera0()->cameraMatrix.data.db );
CvMat _M2 = cvMat(3, 3, CV_64F, amCamPair->getCamera1()->cameraMatrix.data.db );
CvMat _D1 = cvMat(1, 5, CV_64F, amCamPair->getCamera0()->distCoeffs.data.db );
CvMat _D2 = cvMat(1, 5, CV_64F, amCamPair->getCamera1()->distCoeffs.data.db );
CvMat _R = cvMat(3, 3, CV_64F, amCamPair->rotationMatrix.data.db );
CvMat _T = cvMat(3, 1, CV_64F, amCamPair->translationVector.data.db );
CvMat _E = cvMat(3, 3, CV_64F, amCamPair->essentialMatrix.data.db );
CvMat _F = cvMat(3, 3, CV_64F, amCamPair->fundamentalMatrix.data.db );
ofxCvColorImage* cvImg;
ofxCvGrayscaleImage cvGrayImg;
cvGrayImg.allocate(capturedCvImages[0][0].width,capturedCvImages[0][0].height);
vector<CvPoint2D32f> temp;
vector<CvPoint3D32f> objectPoints;
vector<int> npoints;
vector<CvPoint2D32f> points[2];
int count = 0;
int i, j, cam, N, n;
n = patternSize.width*patternSize.height;
temp.resize(n);
for (i = 0; i < numOfCapture ; i++) {
for (cam = 0; cam < 2; cam++){
vector<CvPoint2D32f>& pts = points[cam%2];
cvImg = &capturedCvImages[cam][i];
int result = cvFindChessboardCorners(cvImg->getCvImage(),
patternSize,
&temp[0],
&count,
CV_CALIB_CB_ADAPTIVE_THRESH |
CV_CALIB_CB_NORMALIZE_IMAGE);
N = pts.size();
pts.resize(N + n, cvPoint2D32f(0,0));
if (result != 1) {
ofLog(OF_LOG_ERROR, "Only " + ofToString(count) + " points is detected in " + ofToString(i) + " of camera" + ofToString(cam));
return;
}
//cvFindCornerSubPix can make the points more accurate
cvGrayImg = *cvImg;
cvFindCornerSubPix(cvGrayImg.getCvImage(),
&temp[0],
count,
cvSize(5, 5), //search window
cvSize(-1,-1),
cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 30, 0.01) );
copy( temp.begin(), temp.end(), pts.begin() + N );
}
}
//cvGrayImg is only used for cvFindCornerSubPix, so we can clear it now
cvGrayImg.clear();
objectPoints.resize(numOfCapture*n);
for( i = 0; i < patternSize.height; i++ )
for( j = 0; j < patternSize.width; j++ )
objectPoints[i*patternSize.width + j] =
cvPoint3D32f(i*squareSize, j*squareSize, 0);
for( i = 1; i < numOfCapture; i++ )
copy( objectPoints.begin(), objectPoints.begin() + n,
objectPoints.begin() + i*n );
npoints.resize(numOfCapture, n);
N = numOfCapture*n;
CvMat _objectPoints = cvMat(1, N, CV_32FC3, &objectPoints[0] );
CvMat _imagePoints1 = cvMat(1, N, CV_32FC2, &points[0][0] );
CvMat _imagePoints2 = cvMat(1, N, CV_32FC2, &points[1][0] );
CvMat _npoints = cvMat(1, npoints.size(), CV_32S, &npoints[0] );
cvSetIdentity(&_M1);
cvSetIdentity(&_M2);
cvZero(&_D1);
cvZero(&_D2);
// CALIBRATE THE STEREO CAMERAS
ofLog(OF_LOG_NOTICE, "Running stereo calibration ...");
cvStereoCalibrate(&_objectPoints,
&_imagePoints1,
&_imagePoints2, &_npoints,
&_M1, &_D1, &_M2, &_D2,
cvSize(cvImg->width,cvImg->height), &_R, &_T, &_E, &_F,
cvTermCriteria(CV_TERMCRIT_ITER+
CV_TERMCRIT_EPS, 100, 1e-5),
CV_CALIB_FIX_ASPECT_RATIO +
CV_CALIB_SAME_FOCAL_LENGTH );
ofLog(OF_LOG_NOTICE, "stereo calibration: done");
fflush(stdout);
// CALIBRATION QUALITY CHECK
// because the output fundamental matrix implicitly
// includes all the output information,
// we can check the quality of calibration using the
// epipolar geometry constraint: m2^t*F*m1=0
vector<CvPoint3D32f> lines[2];
points[0].resize(N);
points[1].resize(N);
_imagePoints1 = cvMat(1, N, CV_32FC2, &points[0][0] );
_imagePoints2 = cvMat(1, N, CV_32FC2, &points[1][0] );
lines[0].resize(N);
lines[1].resize(N);
CvMat _L1 = cvMat(1, N, CV_32FC3, &lines[0][0]);
CvMat _L2 = cvMat(1, N, CV_32FC3, &lines[1][0]);
//Always work in undistorted space
cvUndistortPoints( &_imagePoints1, &_imagePoints1,
&_M1, &_D1, 0, &_M1 );
cvUndistortPoints( &_imagePoints2, &_imagePoints2,
&_M2, &_D2, 0, &_M2 );
cvComputeCorrespondEpilines( &_imagePoints1, 1, &_F, &_L1 );
cvComputeCorrespondEpilines( &_imagePoints2, 2, &_F, &_L2 );
double avgErr = 0;
for( i = 0; i < N; i++ )
{
double err = fabs(points[0][i].x*lines[1][i].x +
points[0][i].y*lines[1][i].y + lines[1][i].z)
+ fabs(points[1][i].x*lines[0][i].x +
points[1][i].y*lines[0][i].y + lines[0][i].z);
avgErr += err;
}
string errStr = ofToString(avgErr/(numOfCapture*n),2);
ofLog(OF_LOG_NOTICE, "stereo calibration avg err = " + errStr);
guiCalibratePairButton->mParamName = "calibrate (avg err:" + errStr + ")";
//printf("%f %f %f %f %f %f %f %f %f \n",_M1.data.db[0],_M1.data.db[1],_M1.data.db[2],_M1.data.db[3],_M1.data.db[4],_M1.data.db[5],_M1.data.db[6],_M1.data.db[7],_M1.data.db[8],_M1.data.db[9]);
//printf("%f %f %f %f %f %f %f %f %f \n",amCamPair->getCamera0()->cameraMatrix.data.db[0],amCamPair->getCamera0()->cameraMatrix.data.db[1],amCamPair->getCamera0()->cameraMatrix.data.db[2],amCamPair->getCamera0()->cameraMatrix.data.db[3],amCamPair->getCamera0()->cameraMatrix.data.db[4],amCamPair->getCamera0()->cameraMatrix.data.db[5],amCamPair->getCamera0()->cameraMatrix.data.db[6],amCamPair->getCamera0()->cameraMatrix.data.db[7],amCamPair->getCamera0()->cameraMatrix.data.db[8],amCamPair->getCamera0()->cameraMatrix.data.db[9]);
}
//--------------------------------------------------------------
void amCalibrationApp::draw(){
static int paddingTop = 240;
static int camDisplayWidth = 320*0.6;
static int camDisplayHeight = 240*0.6;
amCamera* amCam;
amCameraPair* amCamPair;
for (int camPair = 0 ; camPair < amsetting->cameraPairs.size(); camPair++) {
amCamPair = amsetting->cameraPairs[camPair];
amCam = amCamPair->getCamera0();
//display the cameras side by side
if (guiCapturePairButton->mValue && camPair == guiPairMatrix->mValue) {
displayImages[0].draw(5,
paddingTop+20+camPair*(camDisplayHeight+20),
camDisplayWidth,
camDisplayHeight);
displayImages[1].draw(5+camDisplayWidth,
paddingTop+20+camPair*(camDisplayHeight+20),
camDisplayWidth,
camDisplayHeight);
if (guiCapturePairButton->mValue && !timeReached) {
if (!firstCapture){
//camera flash!
ofEnableAlphaBlending();
ofFill();
ofSetColor(255,255,255,200-captureTimer->getProgress()*200);
ofRect(5,
paddingTop+20+camPair*(camDisplayHeight+20),
camDisplayWidth*2,
camDisplayHeight);
ofDisableAlphaBlending();
//captured message
int msgPosX = 5+camDisplayWidth-capturedMsgCX;
int msgPosY = paddingTop+camDisplayHeight*0.5+camPair*(camDisplayHeight+20)+capturedMsgCY*2;
ofSetColor(0,0,0);
bigFont.drawString(capturedMsg, msgPosX+2, msgPosY+2);
ofSetColor(255,255,255);
bigFont.drawString(capturedMsg, msgPosX, msgPosY );
}
}
} else {
amCamPair->draw(5,
paddingTop+20+camPair*(camDisplayHeight+20),
camDisplayWidth*2,
camDisplayHeight);
}
ofSetColor(255,255,255);
//place a label on top of the displays
ofDrawBitmapString("amCameraPair id: "+ofToString(amCamPair->getId()),
5,
paddingTop+15+camPair*(camDisplayHeight+20));
}
//if the "show disparity" button is checked
if (guiShowDisparityButton->mValue) {
getSelectedCameraPair()->drawDisparityMap(amCam->getCaptureWidth(),10);
renderDisparityMap(getSelectedCameraPair());
}
//glEnable(GL_DEPTH_TEST);
//glDisable(GL_DEPTH_TEST);
}
void amCalibrationApp::renderDisparityMap(amCameraPair* camPair) {
CvMat* map = camPair->getDisparityMap();
int camW = camPair->getCamera0()->getCaptureWidth();
int camH = camPair->getCamera0()->getCaptureHeight();
ofImage colorImg;
colorImg.setFromPixels(camPair->getCameraPixels(0),camW,camH,OF_IMAGE_COLOR);
colorImg.resize(camW*0.1,camH*0.1);
IplImage* rit3dimage = cvCreateImage(cvSize(camW,camH),IPL_DEPTH_32F,3);
IplImage* rit3dimage_s = cvCreateImage(cvSize(camW*0.1,camH*0.1),IPL_DEPTH_32F,3);
//cvSet(rit3dimage, cvScalar(0, 0, 0));
for (int c = 0 ; c < TCP.getNumClients() ; c++){
int readyStr = 1;
TCP.receiveRawBytes(c, (char*)&readyStr, 1);
if (readyStr == 8){
cvReprojectImageTo3D(map, (CvMat*) rit3dimage, &camPair->getDisparityToDepthMatrix());
cvResize(rit3dimage,rit3dimage_s, CV_INTER_NN);
//((float *)(rit3dimage_s->imageData + 10*rit3dimage_s->widthStep))[10*rit3dimage_s->nChannels + 0] = 10;
TCP.sendRawBytes(c, (char*)rit3dimage_s->imageData, 32*24*3*4);
TCP.sendRawBytes(c, (char*)colorImg.getPixels(), 32*24*3);
//ofLog(OF_LOG_NOTICE,ofToString(c)+ofToString(readyStr)+ofToString(ofRandom(0,5)));
}
//ofLog(OF_LOG_ERROR, ofToString(int(((char*)colorImg.getPixels())[0])));
//if (!TCP.isClientConnected(c)) TCP.
}
/*
int i,j;
//ofxCvColorImage img;
//img.allocate(camW,camH);
//img.set(0);
//unsigned char * pixels = img.getPixels();
CvScalar s;
//shape3d.begin(GL_TRIANGLE_STRIP);
float min[3], max[3];
camera.place();
glEnable(GL_DEPTH_TEST);
//ofxMaterialSpecular(120, 120, 120); //how much specular light will be reflect by the surface
//ofxMaterialShininess(50); //how concentrated the reflexion will be (between 0 and 128
//ofxLightsOn();
int posX,posY;
posX = mouseX-320;
posY = mouseY-15;
ofxVec3f pt;
for (i = 0 ; i < camW ; i++) {
for (j = 0 ; j <camH ; j++) {
//s = cvGet2D(rit3dimage, j,i); // get the (i,j) pixel value
//pt.x = -s.val[0];
//pt.y = -s.val[1];
//pt.z = s.val[2];
pt.x = ((float *)(rit3dimage->imageData + j*rit3dimage->widthStep))[i*rit3dimage->nChannels + 0];
pt.y = ((float *)(rit3dimage->imageData + j*rit3dimage->widthStep))[i*rit3dimage->nChannels + 1];
pt.z = ((float *)(rit3dimage->imageData + j*rit3dimage->widthStep))[i*rit3dimage->nChannels + 2];
pt.x *= -1;
pt.y *= -1;
if (pt.z>-200){
int index = (j*camW+i)*3;//(i*camW+j)*3;
ofSetColor(colors[index],colors[index+1],colors[index+2]);
//ofxBox(pt,1);
ofxSphere(pt,0.5);
}
}
}
camera.remove();
glDisable(GL_DEPTH_TEST);
//ofxLightsOff();
if (posX >= 0 && posX < 320 && posY >= 0 && posY < 240) {
s = cvGet2D(rit3dimage, posY, posX);
pt.x = s.val[0];
pt.y = s.val[1];
pt.z = s.val[2];
ofSetColor(255,255,255);
ofRect(320+posX,10+posY,5,5);
ofDrawBitmapString("0:"+ofToString(pt.x)+"\n1:"+ofToString(pt.y)+"\n2:"+ofToString(pt.z)+"\ndist:"+ofToString(pt.distance(ofxVec3f(0,0,0))),
325+posX,
15+posY);
s = cvGet2D(map, posY, posX);
ofDrawBitmapString(ofToString(s.val[0]), 500, 500);
}
ofDrawBitmapString("Camera\nx:"+ofToString(camera.getPosition().x)+
"\ny:"+ofToString(camera.getPosition().y)+
"\nz:"+ofToString(camera.getPosition().z)+
"\ndirX:"+ofToString(camera.getDir().x)+
"\ndirY:"+ofToString(camera.getDir().y)+
"\ndirZ:"+ofToString(camera.getDir().z)+
"\neyeX"+ofToString(camera.getEye().x)+
"\neyeY:"+ofToString(camera.getEye().y)+
"\neyeZ:"+ofToString(camera.getEye().z)+
"\nupX"+ofToString(camera.getUp().x)+
"\nupY:"+ofToString(camera.getUp().y)+
"\nupZ:"+ofToString(camera.getUp().z),
10,10);
*/
cvReleaseImage(&rit3dimage);
cvReleaseImage(&rit3dimage_s);
}
void amCalibrationApp::setupGui() {
int guiId = 0;
ofxGuiPanel *guiPanel = gui->addPanel(0, "", 10, 20, 12, OFXGUI_PANEL_SPACING);
guiPairMatrix = guiPanel->addMatrix(guiId++, "cameraPair", 20*amsetting->cameraPairs.size(), 20, amsetting->cameraPairs.size(), 1, 0, kofxGui_Button_Trigger, 2);
guiCapturePairButton = guiPanel->addButton(guiId++, "capture", 10, 10, kofxGui_Button_Off, kofxGui_Button_Switch, "");
guiCapturePairMatrix = guiPanel->addMatrix(guiId++, "captures", 200, 40, 10, numOfCapture/10, 0, kofxGui_Button_Switch, 2);
guiCalibratePairButton = guiPanel->addButton(guiId++, "calibrate", 10, 10, kofxGui_Button_Off, kofxGui_Button_Trigger, "");
guiEnableRectifyButton = guiPanel->addButton(guiId++, "enable rectify", 10, 10, kofxGui_Button_Off, kofxGui_Button_Switch, "");
guiShowDisparityButton = guiPanel->addButton(guiId++, "show disparity", 10, 10, kofxGui_Button_Off, kofxGui_Button_Switch, "");
guiSaveSettingButton = guiPanel->addButton(guiId++, "save to "+amsetting->getFileName(), 10, 10, kofxGui_Button_Off, kofxGui_Button_Trigger, "");
gui->forceUpdate(false);
gui->activate(true);
//delete mover;
}
void amCalibrationApp::handleTimer(ofEventArgs &args) {
timeReached = true;
}
void amCalibrationApp::handleGui(int parameterId, int task, void* data, int length) {
if (!gui->mIsActive) return;
if (parameterId == guiPairMatrix->mParamId) {
//clear the capture matrix
for (int id = 0 ; id < guiCapturePairMatrix->mBufferLength ; id++) {
guiCapturePairMatrix->mBuffer[id] = false;
isCaptured[0][id] = false;
}
//clear the previous calibration result
guiCalibratePairButton->mParamName = "calibrate";
//stop capturing
guiCapturePairButton->setValue(false);
//setup display images
amCameraPair* amCamPair = getSelectedCameraPair();
amCamera* cam;
for (int num = 0 ; num < 2 ; num++) {
cam = amCamPair->getCamera(num);
displayImages[num].allocate(cam->getCaptureWidth(), cam->getCaptureHeight());
}
} else if (parameterId == guiCapturePairMatrix->mParamId) {
} else if (parameterId == guiEnableRectifyButton->mParamId) {
//you cannot enable rectify when capturing...
if (guiCapturePairButton->mValue) {
guiEnableRectifyButton->mValue = false;
}
for (int camPair = 0 ; camPair < amsetting->cameraPairs.size(); camPair++) {
amsetting->cameraPairs[camPair]->enableStereoRectify(guiEnableRectifyButton->mValue);
}
} else if (parameterId == guiCapturePairButton->mParamId) {
if (guiCapturePairButton->mValue) {
firstCapture = true;
timeReached = false;
//disable rectify
guiEnableRectifyButton->mValue = false;
amsetting->cameraPairs[0]->enableStereoRectify(false);
amsetting->cameraPairs[1]->enableStereoRectify(false);
//start the timer
captureTimer->setup(captureInterval,false);
} else {
captureTimer->stopTimer();
}
} else if (parameterId == guiCalibratePairButton->mParamId) {
if (guiCalibratePairButton->mValue){
//if not captured require number of image, don't calibrate
for (int num = 0 ; num < numOfCapture ; num++){
if (!(isCaptured[0][num] && isCaptured[1][num])) return;
}
calibrateSelectedPair();
}
} else if (parameterId == guiSaveSettingButton->mParamId) {
if (guiSaveSettingButton->mValue) {
amsetting->saveSetting();
ofLog(OF_LOG_NOTICE,"setting saved!");
}
}
//ofLog(OF_LOG_ERROR,ofToString(parameterId)+" "+ofToString(task));
//ofLog(OF_LOG_ERROR,ofToString(kofxGui_Set_Cell)+" "+ofToString(kofxGui_Set_Int));
}
//--------------------------------------------------------------
void amCalibrationApp::keyPressed(int key){
switch (key) {
case 'f':
//amsetting->setupWindow();
break;
}
CvStereoBMState* bmState = getSelectedCameraPair()->bmState;
if (key == 'q') {
ofLog(OF_LOG_NOTICE,"minDisparity:"+ofToString(++bmState->minDisparity));
} else if (key == 'a') {
ofLog(OF_LOG_NOTICE,"minDisparity:"+ofToString(--bmState->minDisparity));
} else if (key == 'w') {
bmState->SADWindowSize+=2;
ofLog(OF_LOG_NOTICE,"SADWindowSize:"+ofToString(bmState->SADWindowSize));
} else if (key == 's') {
if (bmState->SADWindowSize > 5)
bmState->SADWindowSize-=2;
ofLog(OF_LOG_NOTICE,"SADWindowSize:"+ofToString(bmState->SADWindowSize));
} else if (key == 'e') {
bmState->numberOfDisparities+=16;
ofLog(OF_LOG_NOTICE,"numberOfDisparities:"+ofToString(bmState->numberOfDisparities));
} else if (key == 'd') {
if (bmState->numberOfDisparities > 16)
bmState->numberOfDisparities-=16;
ofLog(OF_LOG_NOTICE,"numberOfDisparities:"+ofToString(bmState->numberOfDisparities));
} else if (key == 'r') {
bmState->speckleWindowSize+=2;
ofLog(OF_LOG_NOTICE,"speckleWindowSize:"+ofToString(bmState->speckleWindowSize));
} else if (key == 'f') {
if (bmState->speckleWindowSize > 5)
bmState->speckleWindowSize-=2;
ofLog(OF_LOG_NOTICE,"speckleWindowSize:"+ofToString(bmState->speckleWindowSize));
} else if (key == 't') {
ofLog(OF_LOG_NOTICE,"speckleRange:"+ofToString(++bmState->speckleRange));
} else if (key == 'g') {
ofLog(OF_LOG_NOTICE,"speckleRange:"+ofToString(--bmState->speckleRange));
} else if (key == 'i') {
camera.moveLocal(0,0,10);
} else if (key == 'j') {
camera.moveLocal(10,0,0);
} else if (key == 'l') {
camera.moveLocal(-10,0,0);
} else if (key == 'k') {
camera.moveLocal(0,0,-10);
} else if (key == 'y') {
camera.moveLocal(0,10,0);
} else if (key == 'h') {
camera.moveLocal(0,-10,0);
} else if (key == 'u') {
camera.rotate(ofxVec3f(0,1,0),5);
} else if (key == 'o') {
camera.rotate(ofxVec3f(0,1,0),-5);
}
}
//--------------------------------------------------------------
void amCalibrationApp::keyReleased(int key){
}
//--------------------------------------------------------------
void amCalibrationApp::mouseMoved(int x, int y ){
mouseX = x;
mouseY = y;
}
//--------------------------------------------------------------
void amCalibrationApp::mouseDragged(int x, int y, int button){
}
//--------------------------------------------------------------
void amCalibrationApp::mousePressed(int x, int y, int button){
}
//--------------------------------------------------------------
void amCalibrationApp::mouseReleased(int x, int y, int button){
}
//--------------------------------------------------------------
void amCalibrationApp::windowResized(int w, int h){
}
|
f43f720ea3dba4ad7ec8e86f864a5cfd63d628ca
|
549270020f6c8724e2ef1b12e38d11b025579f8d
|
/recipes/glshaderpp/all/test_package/test_package.cpp
|
e8dce6ff7068bd2bfe303f1f0bb766a983dc7c6e
|
[
"MIT"
] |
permissive
|
conan-io/conan-center-index
|
1bcec065ccd65aa38b1fed93fbd94d9d5fe6bc43
|
3b17e69bb4e5601a850b6e006e44775e690bac33
|
refs/heads/master
| 2023-08-31T11:34:45.403978
| 2023-08-31T11:13:23
| 2023-08-31T11:13:23
| 204,671,232
| 844
| 1,820
|
MIT
| 2023-09-14T21:22:42
| 2019-08-27T09:43:58
|
Python
|
UTF-8
|
C++
| false
| false
| 398
|
cpp
|
test_package.cpp
|
#include <GL/glew.h>
#include <GLShaderPP/Shader.h>
#include <GLShaderPP/ShaderException.h>
#include <GLShaderPP/ShaderProgram.h>
#include <iostream>
int main() {
GLShaderPP::CShaderException e("If you read this, GLShaderPP is happy :)",
GLShaderPP::CShaderException::ExceptionType::LinkError);
std::cout << e.what() << '\n';
return EXIT_SUCCESS;
}
|
6b2c4223669bd10bb40c7abb6fcbdcc1d9202526
|
ce1ca5c988c469b05d1c3d06354d5cd0fec221a0
|
/base_3D_1.0/DlgTeZongHeFenXi.cpp
|
a28fe50f61f4e97440ae0b42bda88e713dfcac54
|
[] |
no_license
|
radtek/haocai
|
77d529110b139421c401b2512f0ef1437756521c
|
9666192559de4689f51f33e27b7e30c922504021
|
refs/heads/master
| 2021-01-01T05:44:29.264459
| 2013-01-09T13:53:47
| 2013-01-09T13:53:47
| 58,142,390
| 0
| 1
| null | null | null | null |
GB18030
|
C++
| false
| false
| 5,173
|
cpp
|
DlgTeZongHeFenXi.cpp
|
// DlgTeZongHeFenXi.cpp : 实现文件
//
#include "stdafx.h"
#include "ShuangSeQiu.h"
#include "DlgTeZongHeFenXi.h"
#include "FormulaCenter.h"
// CDlgTeZongHeFenXi 对话框
IMPLEMENT_DYNAMIC(CDlgTeZongHeFenXi, CDialog)
CDlgTeZongHeFenXi::CDlgTeZongHeFenXi(CWnd* pParent /*=NULL*/)
: CDialog(CDlgTeZongHeFenXi::IDD, pParent)
{
m_IsInitData=false;
}
CDlgTeZongHeFenXi::~CDlgTeZongHeFenXi()
{
}
void CDlgTeZongHeFenXi::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST1, m_ListCtrl);
}
BEGIN_MESSAGE_MAP(CDlgTeZongHeFenXi, CDialog)
ON_WM_CLOSE()
ON_WM_SHOWWINDOW()
END_MESSAGE_MAP()
// 生成的消息映射函数
BOOL CDlgTeZongHeFenXi::OnInitDialog()
{
CDialog::OnInitDialog();
InitListHeader();
this->CenterWindow();
return true;
}
void CDlgTeZongHeFenXi::OnClose()
{
ShowWindow(SW_HIDE);
}
void CDlgTeZongHeFenXi::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
if(!m_IsInitData)
{
int OffsetCount = 1;
bool IsLast=false;
m_IsInitData = true;
vector<sShuangSeQiu>*DataList =CDataManageCenter::GetInstance()->GetDataList();
for(int Index =0; Index <= DataList->size(); Index++)
{
m_ListCtrl.InsertItem(Index,_T(""));
if(Index < DataList->size())
m_ListCtrl.SetItemText(Index,0,(*DataList)[Index].m_QiShu);
else
m_ListCtrl.SetItemText(Index,0,"下期预测");
sItemStyle Style;
Style.m_ItemType = TEXT_TYPE;
Style.m_DrawData.m_TextData.m_TextColor=RGB(0,0,0);
Style.m_DrawData.m_TextData.m_TextFont = NULL;
Style.m_DrawData.m_TextData.m_TextFormat=DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_END_ELLIPSIS;
map<int,vector<int>> TempMapList;
int DataArray[33][33]={0};
for(int i=0; i < 33; i++)
{
for(int j = 0 ; j < (int)Index; j++)
{
bool IsWant=false;
for(int k = 0; k < 6; k++)
{
if((*DataList)[j].m_HongQiu[k] == i+1)
IsWant=true;
}
if(!IsWant)
continue;
int Max=0;
for(int k = 0; k < 6; k++)
{
int TempData = (*DataList)[j].m_HongQiu[k]-1;
if(TempData != -1)
DataArray[i][TempData]++;
}
}
}
int MaxData[33]={0};
for(int i = 0; i < 33; i++)
{
int TempMax=0;
for(int j =0; j < 33; j++)
{
if(TempMax < DataArray[i][j] && i != j)
{
TempMax=DataArray[i][j];
MaxData[i]=j+1;
}
}
}
for(int i = 0; i < 33; i++)
{
int TempData = DataArray[i][i];
TempMapList[TempData].push_back(i+1);
}
map<int,vector<int>>::iterator it=TempMapList.begin();
int Start = it->first;
int LemitData=16;
int LemitDataCount=0;
int LemitCount=0;
for(it; it != TempMapList.end(); it++)
{
int Count=it->first-Start+1;
int OutCount=0;
for(int i=0; i < it->second.size(); i++)
{
if(Index < DataList->size())
{
if(CDataManageCenter::IsHongQiuInData((*DataList)[Index],it->second[i]))
OutCount++;
}
else
OutCount=0;
}
if(Index == 137)
{
int a=0;
int b=a;
}
int DataCount=it->second.size();
if(Count >= 16)
{
LemitDataCount+=OutCount;
OutCount=LemitDataCount;
DataCount+=LemitCount;
LemitCount=DataCount;
Count=16;
}
CString Str;
Str.Format("%02d:%02d",DataCount,OutCount);
m_ListCtrl.SetItemText(Index,Count,Str);
Style.m_DrawData.m_TextData.m_BGColor = GetColor(OutCount);
m_ListCtrl.SetItemSpecialStyle(Index,Count,Style);
}
}
}
}
//初始化列表头
void CDlgTeZongHeFenXi::InitListHeader()
{
CRect Rect;
//初始化应用程序列表控件
m_ListCtrl.GetWindowRect(&Rect);
int nWidth = Rect.Width()/18;
sItemStyle Style;
Style.m_ItemType = TEXT_TYPE;
Style.m_DrawData.m_TextData.m_TextColor=RGB(0,0,0);
Style.m_DrawData.m_TextData.m_TextFont = NULL;
Style.m_DrawData.m_TextData.m_TextFormat=DT_LEFT |DT_WORDBREAK|DT_EDITCONTROL|DT_EDITCONTROL|DT_CENTER;;
m_ListCtrl.InsertColumn(0,_TEXT("期号"), LVCFMT_CENTER, 2*nWidth);
m_ListCtrl.SetColumStyle(0,Style);
int QingCount=16;
for(int Index = 1; Index <= QingCount; Index++)
{
CString Text;
Text.Format("遗漏%2d层",Index);
m_ListCtrl.SetColumStyle(Index,Style);
m_ListCtrl.InsertColumn(Index,Text, LVCFMT_CENTER, nWidth);
}
m_ListCtrl.SetRowHeight(30);
sItemBkData ItemBkData;
ItemBkData.m_BkFillMode = MODE_FILL_RGB;
ItemBkData.m_HeightColor = RGB(222,22,100);
ItemBkData.m_HeightFillMode = MODE_FILL_RGB;
ItemBkData.m_HeightColor = RGB(100,100,100);
ItemBkData.m_BkColor = RGB(222,222,222);
m_ListCtrl.SetItemBkData(ItemBkData);
}
//获取颜色值
COLORREF CDlgTeZongHeFenXi::GetColor(int Data)
{
switch(Data)
{
case 0:
return RGB(112,48,160);
case 1:
return RGB(255,0,0);
case 2:
return RGB(198,198,200);
case 3:
return RGB(255,192,0);
case 4:
return RGB(128,128,128);
default:
return RGB(248,183,173);
}
}
|
127f7d2187f028f6c4793b6439f10064beed31d4
|
a743284c2681e1a0cc918f4b00b95a8cc009fd57
|
/test/SQLiteColumnTest.cpp
|
d12023fe613fb302e158dfcb46164af75c4c1bf8
|
[
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] |
permissive
|
sung-gon-kim/SQLiteWrapper
|
18fe07da544d6354c5ac888daa9da8bad264c153
|
463b788e8cfc70f95a531e9755b616d8728fdc2e
|
refs/heads/master
| 2022-02-20T00:47:38.068821
| 2019-10-08T15:48:45
| 2019-10-08T15:48:45
| null | 0
| 0
| null | null | null | null |
WINDOWS-1252
|
C++
| false
| false
| 824
|
cpp
|
SQLiteColumnTest.cpp
|
#include <gtest/gtest.h>
#include <memory>
#include <string>
#include "Constants.hpp"
#include "../SQLiteWrapper/SQLiteDatabase.hpp"
class SQLiteColumnTest : public ::testing::Test {
protected:
void SetUp() override {
database = std::make_unique<SQLite::Database>(Constants::DB_FILE);
database->execute(Constants::CREATE_TABLE);
}
std::unique_ptr<SQLite::Database> database;
};
TEST_F(SQLiteColumnTest, testGetColumnData) {
database->execute(Constants::INSERT_DATA);
auto stmt = database->prepare(Constants::SELECT_ALL_DATA);
stmt.fetch();
EXPECT_STREQ("first", stmt.getColumn(0).getName());
EXPECT_EQ(1, stmt.getColumn(0).getInt());
EXPECT_EQ(2.0, stmt.getColumn(1).getDouble());
EXPECT_STREQ("three", stmt.getColumn("third").getText());
EXPECT_EQ("³×¹øÂ°", stmt.getColumn("fourth").getString());
}
|
56769b7721a56198db9bb47f1abca55975dba1fd
|
b6e40801b34b7b3e48a43de22ed9dca05ee72119
|
/test/token.cpp
|
0551d4028aa6ec8085270235311100eedba65cbe
|
[] |
no_license
|
thomashilke/lexer
|
af2d342ad046be634c0a7efca3d215d8369286f1
|
77c457baca7430c52aab143010019ea0e26f451c
|
refs/heads/master
| 2021-10-19T06:41:39.634595
| 2019-02-18T21:08:55
| 2019-02-18T21:08:55
| 108,874,715
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 586
|
cpp
|
token.cpp
|
#include <iostream>
#include "../src/token.hpp"
enum class symbol {
integer, comma
};
std::ostream& operator<<(std::ostream& stream, symbol s) {
switch (s) {
case symbol::integer: stream << "integer"; break;
case symbol::comma: stream << "comma"; break;
default:
break;
};
return stream;
}
int main(int argc, char** argv) {
typedef symbol symbol_type;
typedef repl_token<symbol_type> token_type;
token_type t(symbol::integer, "42429", 1, 1, 3);
std::cout << t.render_coordinates() << std::endl;
std::cout << t << std::endl;
return 0;
}
|
5fc2024cf69f86c2875a9854bfb36eb2abee88ee
|
6b2a8dd202fdce77c971c412717e305e1caaac51
|
/solutions_1483485_0/C++/kcd/main.cpp
|
7b76dffb9b49fef50ab0ae05ffd8075d625ee736
|
[] |
no_license
|
alexandraback/datacollection
|
0bc67a9ace00abbc843f4912562f3a064992e0e9
|
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
|
refs/heads/master
| 2021-01-24T18:27:24.417992
| 2017-05-23T09:23:38
| 2017-05-23T09:23:38
| 84,313,442
| 2
| 4
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,977
|
cpp
|
main.cpp
|
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <utility>
#include <cstring>
using namespace std;
typedef long long LL;
#define x1 gjigu
#define y1 djigd
template<typename T>
inline T Abs(const T& value) { return value < 0 ? -value : value; }
template<typename T>
inline T Sqr(const T& value) { return value * value; }
int a[256];
int b[256];
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
a['a'] = 'y';
a['b'] = 'h';
a['c'] = 'e';
a['d'] = 's';
a['e'] = 'o';
a['f'] = 'c';
a['g'] = 'v';
a['h'] = 'x';
a['i'] = 'd';
a['j'] = 'u';
a['k'] = 'i';
a['l'] = 'g';
a['m'] = 'l';
a['n'] = 'b';
a['o'] = 'k';
a['p'] = 'r';
a['q'] = 'z';
a['r'] = 't';
a['s'] = 'n';
a['t'] = 'w';
a['u'] = 'j';
a['v'] = 'p';
a['w'] = 'f';
a['x'] = 'm';
a['y'] = 'a';
a['z'] = 'q';
/* vector< vector<string> > s(2);
for (int j = 0; j < 2; ++j) {
s[j].resize(3);
for (int i = 0; i < 3; ++i)
getline(cin, s[j][i]);
}
for (int i = 0; i < 3; ++i)
for (int j = 0; j < s[0][i].length(); ++j)
if (s[0][i][j] != ' ')
a[s[0][i][j]] = s[1][i][j];
for (int i = 0; i < 26; ++i) {
cout << "a['" << char(i+'a') << "'] = '" << char(a[i+'a']) << "';" << endl;
}
for (int i = 'a'; i <= 'z'; ++i)
b[a[i]] = 1;
for (int i = 'a'; i <= 'z'; ++i)
if (!b[i])
cout << char(i) << endl;
*/
int n;
cin >> n;
string s;
getline(cin, s);
for (int i = 0; i < n; ++i) {
getline(cin, s);
for (int j = 0; j < s.length(); ++j)
if (s[j] != ' ')
s[j] = a[s[j]];
cout << "Case #" << i+1 << ": " << s << endl;
}
return 0;
}
|
9de6db4e9d1c46d003897ea017ce64e593e96d7d
|
7a84c0e8bc128e4e5aa824d4f9ddcf667280f777
|
/gen_test/common.cpp
|
4b0edd243b2fa4b4a2bc4254d5db9bd2de638174
|
[] |
no_license
|
fcua/x8623
|
bea592a608b451d9eb4f33b2efa34f676410d643
|
d7f0c8347629879cbff14dec8b080b1cccf31668
|
refs/heads/master
| 2020-03-21T08:10:35.749426
| 2017-10-12T03:16:39
| 2017-10-12T03:16:39
| 138,325,785
| 0
| 5
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 10,336
|
cpp
|
common.cpp
|
#include "common.h"
#include <stdlib.h>
void string_split(const std::string& src, const std::string& s, std::vector<std::string>& result) {
result.clear();
std::string::size_type pos1 = 0;
std::string::size_type pos2 = src.find(s);
while (pos2 != std::string::npos) {
result.push_back(src.substr(pos1, pos2 - pos1));
pos1 = pos2 + s.size();
pos2 = src.find(s, pos1);
}
if (pos1 != src.length()) {
result.push_back(src.substr(pos1));
}
}
int cmp(const void * a, const void * b) {
return (*(int*)b - *(int*)a); // b > a 返回正值
}
long long sort_sequence(long long sequence) {
int num[5] = {0};
int index = 0;
while (sequence > 0) {
num[index++] = sequence % 1000;
// sequence /= 1000;
sequence *= 0.001;
}
qsort(num, 5, sizeof(int), &cmp);
long long new_sequence = num[4] * 1000000000000LL + num[3] * 1000000000LL + num[2] * 1000000LL + num[1] * 1000LL + num[0];
//long long new_sequence = 0;
//for (int i=4; i >= 0; --i) {
// if (num[i] > 0) {
// new_sequence = new_sequence * 1000 + num[i];
// }
//}
return new_sequence;
}
std::vector<int> split_sequence(long long sequence) {
int num[5] = {0};
int index = 0;
while (sequence > 0) {
num[index++] = sequence % 1000;
//sequence /= 1000;
sequence *= 0.001;
}
std::vector<int> ret;
for (int i=0; i < 5; ++i) {
if (num[i] > 0) {
ret.push_back(num[i]);
}
}
return ret;
}
/* itoa: convert n to characters in s */
char* itoa(int n, char s[]) {
int i, sign;
if ((sign = n) < 0) /* record sign */
n = -n; /* make n positive */
i = 0;
do { /* generate digits in reverse order */
s[i++] = n % 10 + '0'; /* get next digit */
} while ((n /= 10) > 0); /* delete it */
if (sign < 0)
s[i++] = '-';
s[i] = '\0';
reverse(s);
return s;
}
/* reverse: reverse string s in place */
void reverse(char s[]) {
int i, j;
char c;
for (i = 0, j = strlen(s)-1; i<j; i++, j--) {
c = s[i];
s[i] = s[j];
s[j] = c;
}
}
bool is_the_same_sequence(const std::list<int>& s1, const std::list<int>& s2) {
if (s1.size() != s2.size()) {
return false;
}
std::list<int>::const_iterator iter1 = s1.begin();
std::list<int>::const_iterator iter2 = s2.begin();
for (; iter1 != s1.end(); ++iter1, ++iter2) {
if ((*iter1) != (*iter2)) {
return false;
}
}
return true;
}
/*
void save_new_data_binary(const char* filename, const std::unordered_map< int, std::list<GenStyleInfo> >& all_styles) {
FILE* fp = fopen(filename, "wb");
//
int all_styles_length = (int)all_styles.size();
fwrite(&all_styles_length, sizeof(int), 1, fp);
for (const auto& iter_1 : all_styles) {
fwrite(&iter_1.first, sizeof(int), 1, fp); // win style
int si_length = (int)iter_1.second.size();
fwrite(&si_length, sizeof(int), 1, fp);
for (const auto& iter_2 : iter_1.second) {
int ghost_num = iter_2.ghost_num;
bool has_eyes = iter_2.has_eyes;
std::list<long long> card_styles = iter_2.card_styles;
fwrite(&ghost_num, sizeof(int), 1, fp);
fwrite(&has_eyes, sizeof(bool), 1, fp);
int all_sequence_length = (int)iter_2.card_styles.size(); // 鬼牌+是否带眼下,所有的胡牌序列
fwrite(&all_sequence_length, sizeof(int), 1, fp);
for (const auto& iter_3 : card_styles) {
std::vector<int> one_sequence = split_sequence(iter_3);
int all_meld_length = (int)one_sequence.size(); // 一个序列有多个 顺子、刻子 组成
fwrite(&all_meld_length, sizeof(int), 1, fp);
for (const auto& iter_4 : one_sequence) {
int id_1 = iter_4 % 10;
int id_3 = iter_4 / 100;
int id_2 = (iter_4 - id_3 * 100) / 10;
// 一个刻子/顺子/眼
if (id_3 == 0) { // 这代表只有两个 id 是有效的
int count = 2;
fwrite(&count, sizeof(int), 1, fp);
fwrite(&id_2, sizeof(int), 1, fp);
fwrite(&id_1, sizeof(int), 1, fp);
} else {
int count = 3;
fwrite(&count, sizeof(int), 1, fp);
fwrite(&id_3, sizeof(int), 1, fp);
fwrite(&id_2, sizeof(int), 1, fp);
fwrite(&id_1, sizeof(int), 1, fp);
}
}
}
}
}
fclose(fp);
printf("saved!");
}
void load_new_data_binary(const char* filename, std::unordered_map<int, std::vector<StyleInfo>>& all_styles) {
FILE* fp = fopen(filename, "rb");
int all_styles_length = 0;
fread(&all_styles_length, sizeof(int), 1, fp);
for (int i=0; i < all_styles_length; ++i) {
int win_style = 0;
fread(&win_style, sizeof(int), 1, fp);
int si_length = 0;
fread(&si_length, sizeof(int), 1, fp);
std::vector<StyleInfo> style_infos;
style_infos.resize(si_length);
for (int j=0; j < si_length; ++j) {
fread(&style_infos[j].ghost_num, sizeof(int), 1, fp);
fread(&style_infos[j].has_eyes, sizeof(bool), 1, fp);
int all_sequence_length = 0;
fread(&all_styles_length, sizeof(int), 1, fp);
style_infos[j].sequences.resize(all_sequence_length);
for (int k=0; k < all_sequence_length; ++k) {
// 一个序列有多个顺子
int all_meld_length = 0;
fread(&all_meld_length, sizeof(int), 1, fp);
style_infos[j].sequences[k].resize(all_meld_length);
for (int m=0; m < all_meld_length; ++m) {
// 一个顺子有多张牌
int count = 0;
fread(&count, sizeof(int), 1, fp);
style_infos[j].sequences[k][m].resize(count);
// 不是 2,就是 3
fread(&style_infos[j].sequences[k][m][0], sizeof(int), 1, fp);
fread(&style_infos[j].sequences[k][m][1], sizeof(int), 1, fp);
if (count == 3) {
fread(&style_infos[j].sequences[k][m][2], sizeof(int), 1, fp);
}
}
}
}
//
all_styles[win_style] = style_infos;
}
}
*/
void save_data_text_no_eyes(const char* filename, const std::unordered_map<int, std::vector<long long>> all_styles[]) {
FILE* fp = fopen(filename, "w");
for (int i=0; i < 9; ++i) {
for (const auto& iter_1 : all_styles[i]) {
for (const auto& iter_2 : iter_1.second) {
fprintf(fp, "%d|false|%d|%lld\n", iter_1.first, i, iter_2);
}
}
}
fclose(fp);
printf("saved!\n");
}
void save_data_text_with_eyes(const char* filename, const std::unordered_map<int, std::vector<long long>> all_styles[]) {
FILE* fp = fopen(filename, "w");
for (int i=0; i < 9; ++i) {
for (const auto& iter_1 : all_styles[i]) {
for (const auto& iter_2 : iter_1.second) {
fprintf(fp, "%d|true|%d|%lld\n", iter_1.first, i, iter_2);
}
}
}
fclose(fp);
printf("saved!\n");
}
void save_data_text_wtt_no_eyes(const char* filename, const std::unordered_map<int, std::unordered_set<long long>> all_styles[]) {
FILE* fp = fopen(filename, "w");
for (int i=0; i < 9; ++i) {
for (const auto& iter_1 : all_styles[i]) {
for (const auto& iter_2 : iter_1.second) {
fprintf(fp, "%d|false|%d|%lld\n", iter_1.first, i, iter_2);
}
}
}
fclose(fp);
printf("saved!\n");
}
void save_data_text_wtt_with_eyes(const char* filename, const std::unordered_map<int, std::unordered_set<long long>> all_styles[]) {
FILE* fp = fopen(filename, "w");
for (int i=0; i < 9; ++i) {
for (const auto& iter_1 : all_styles[i]) {
for (const auto& iter_2 : iter_1.second) {
fprintf(fp, "%d|true|%d|%lld\n", iter_1.first, i, iter_2);
}
}
}
fclose(fp);
printf("saved!\n");
}
/*
void load_new_data_text(const char* filename, std::unordered_map<int, std::list<GenStyleInfo>>& all_styles) {
char szBuf[1024];
FILE* fp = fopen(filename, "r");
while (!feof(fp)) {
fgets(szBuf, 1024, fp);
std::vector<std::string> result;
string_split(szBuf, "|", result);
int style = atoi(result[0].c_str());
bool has_eyes = (result[1].compare("true") == 0);
int ghost_num = atoi(result[2].c_str());
long long sequence = std::stoll(result[3]);
//
auto iter = all_styles.find(style);
if (iter == all_styles.end()) {
std::list<GenStyleInfo> style_infos;
style_infos.push_back(GenStyleInfo(ghost_num, has_eyes, sequence));
all_styles[style] = style_infos;
} else {
bool flag = false;
for (auto& iter_1 : iter->second) {
int num = iter_1.ghost_num;
bool eyes = iter_1.has_eyes;
if (num == ghost_num && eyes == has_eyes) {
iter_1.card_styles.push_back(sequence);
flag = true;
break;
}
}
if (!flag) {
iter->second.push_back(GenStyleInfo(ghost_num, has_eyes, sequence));
}
}
}
fclose(fp);
}
*/
void binary_to_text(const char* src_file, const char* dest_file) {
//std::unordered_map<int, std::vector<StyleInfo>> all_styles;
//load_new_data_binary(src_file, all_styles);
}
void text_to_binary(const char* src_file, const char* dest_file) {
//std::unordered_map<int, std::list<GenStyleInfo>> all_styles;
//load_new_data_text(src_file, all_styles);
//save_new_data_binary(dest_file, all_styles);
}
|
b0c7315a07050dc6a100f290a1c2d2fa99a72e57
|
5e8d200078e64b97e3bbd1e61f83cb5bae99ab6e
|
/main/source/src/protocols/topology_broker/Exceptions.hh
|
265449c7a5ec0b168ffd6c6dd405266dd2398daf
|
[] |
no_license
|
MedicaicloudLink/Rosetta
|
3ee2d79d48b31bd8ca898036ad32fe910c9a7a28
|
01affdf77abb773ed375b83cdbbf58439edd8719
|
refs/heads/master
| 2020-12-07T17:52:01.350906
| 2020-01-10T08:24:09
| 2020-01-10T08:24:09
| 232,757,729
| 2
| 6
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,224
|
hh
|
Exceptions.hh
|
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
// (c) addressed to University of Washington CoMotion, email: license@uw.edu.
/// @file TopologyBroker
/// @brief top-class (Organizer) of the TopologyBroker mechanism
/// @details responsibilities:
/// @author Oliver Lange
#ifndef INCLUDED_protocols_topology_broker_Exceptions_hh
#define INCLUDED_protocols_topology_broker_Exceptions_hh
// Unit Headers
//#include <protocols/topology_broker/Exceptions.fwd.hh>
// Utility Headers
#include <utility/excn/Exceptions.hh>
namespace protocols {
namespace topology_broker {
class EXCN_TopologyBroker : public utility::excn::Exception {
public:
EXCN_TopologyBroker(char const *file, int line, std::string const & m) : utility::excn::Exception(file, line, "\n[TopologyBroker Exception]: " + m) {}
};
class EXCN_Input : public utility::excn::BadInput {
public:
EXCN_Input(char const *file, int line, std::string const& msg ) : utility::excn::BadInput(file, line, "") {
add_msg("*************** Error in Broker Setup: *************** \n");
add_msg(msg);
add_msg("\n\n********** Check your (inconsistent) input *************** \n");
}
};
// this is more like a range error --- asking for something which isn't there
class EXCN_Unknown : public EXCN_TopologyBroker {
public:
using EXCN_TopologyBroker::EXCN_TopologyBroker;
};
class EXCN_FailedBroking : public EXCN_TopologyBroker {
public:
EXCN_FailedBroking(char const *file, int line, std::string const& msg) : EXCN_TopologyBroker(file, line, msg) {
add_msg("\nFailed to mediate between different Claimers...");
}
};
class EXCN_FilterFailed : public EXCN_TopologyBroker {
public:
EXCN_FilterFailed(char const *file, int line, std::string const& msg) : EXCN_TopologyBroker(file, line, msg) {
add_msg("\n[FILTER] failed... ");
}
};
}
}
#endif
|
fefbc625fd0173036a9a3ea64b3d971fc9d1c80e
|
44ab57520bb1a9b48045cb1ee9baee8816b44a5b
|
/Engine/Code/Network/Interface/SockAddress.cpp
|
b14d8fa99699789af8e403ec00c36a4105888131
|
[
"BSD-3-Clause"
] |
permissive
|
WuyangPeng/Engine
|
d5d81fd4ec18795679ce99552ab9809f3b205409
|
738fde5660449e87ccd4f4878f7bf2a443ae9f1f
|
refs/heads/master
| 2023-08-17T17:01:41.765963
| 2023-08-16T07:27:05
| 2023-08-16T07:27:05
| 246,266,843
| 10
| 0
| null | null | null | null |
GB18030
|
C++
| false
| false
| 2,227
|
cpp
|
SockAddress.cpp
|
/// Copyright (c) 2010-2023
/// Threading Core Render Engine
///
/// 作者:彭武阳,彭晔恩,彭晔泽
/// 联系作者:94458936@qq.com
///
/// 标准:std:c++20
/// 引擎版本:0.9.0.8 (2023/05/09 09:00)
#include "Network/NetworkExport.h"
#include "SockAddress.h"
#include "Detail/SockAddressFactory.h"
#include "Detail/SockAddressImpl.h"
#include "CoreTools/Contract/Flags/ImplFlags.h"
#include "CoreTools/Helper/ClassInvariant/NetworkClassInvariantMacro.h"
#include "CoreTools/Helper/MemberFunctionMacro.h"
COPY_UNSHARED_CLONE_SELF_USE_CLONE_DEFINE(Network, SockAddress)
Network::SockAddress::SockAddress(const std::string& hostName, int port, const ConfigurationStrategy& configurationStrategy)
: impl{ CoreTools::ImplCreateUseFactory::Default, hostName, port, configurationStrategy }
{
NETWORK_SELF_CLASS_IS_VALID_1;
}
Network::SockAddress::SockAddress(int port, const ConfigurationStrategy& configurationStrategy)
: impl{ CoreTools::ImplCreateUseFactory::Default, port, configurationStrategy }
{
NETWORK_SELF_CLASS_IS_VALID_1;
}
Network::SockAddress::SockAddress(const ConfigurationStrategy& configurationStrategy)
: impl{ CoreTools::ImplCreateUseFactory::Default, configurationStrategy }
{
NETWORK_SELF_CLASS_IS_VALID_1;
}
CLASS_INVARIANT_STUB_DEFINE(Network, SockAddress)
IMPL_CONST_MEMBER_FUNCTION_DEFINE_0(Network, SockAddress, GetACEInternetAddress, const Network::ACEInternetAddressType&)
IMPL_NON_CONST_MEMBER_FUNCTION_DEFINE_0(Network, SockAddress, GetACEInternetAddress, Network::ACEInternetAddressType&)
IMPL_CONST_MEMBER_FUNCTION_DEFINE_0(Network, SockAddress, GetBoostInternetAddress, const Network::BoostInternetAddressType&)
IMPL_NON_CONST_MEMBER_FUNCTION_DEFINE_0(Network, SockAddress, GetBoostInternetAddress, Network::BoostInternetAddressType&)
IMPL_CONST_MEMBER_FUNCTION_DEFINE_0(Network, SockAddress, GetWinSockInternetAddress, const Network::WinSockInternetAddressType&)
IMPL_NON_CONST_MEMBER_FUNCTION_DEFINE_0(Network, SockAddress, GetWinSockInternetAddress, Network::WinSockInternetAddressType&)
IMPL_CONST_MEMBER_FUNCTION_DEFINE_0(Network, SockAddress, GetAddress, std::string)
IMPL_CONST_MEMBER_FUNCTION_DEFINE_0(Network, SockAddress, GetPort, int)
|
5789bb22ba2d2398c3e8cf01b35c7c3abed10c18
|
a2d5ba8ea19067aeea79a89145cc860b75800ba7
|
/src/core/include/dataset_filter_numeric.h
|
a33606b0029db9d991aa73bc8c7b84ef1575c341
|
[
"MIT"
] |
permissive
|
veg/hyphy
|
a2f6d1c822af47f4fa28c1b11d241faa5b7193e0
|
8b224d5b1d684fc6dce86548a2101a24ef6777f6
|
refs/heads/master
| 2023-08-09T14:23:21.057172
| 2023-07-27T19:10:51
| 2023-07-27T19:10:51
| 2,304,875
| 192
| 64
|
NOASSERTION
| 2023-08-21T17:01:21
| 2011-08-31T23:41:55
|
HyPhy
|
UTF-8
|
C++
| false
| false
| 2,228
|
h
|
dataset_filter_numeric.h
|
/*
HyPhy - Hypothesis Testing Using Phylogenies.
Copyright (C) 1997-now
Core Developers:
Sergei L Kosakovsky Pond (sergeilkp@icloud.com)
Art FY Poon (apoon42@uwo.ca)
Steven Weaver (sweaver@temple.edu)
Module Developers:
Lance Hepler (nlhepler@gmail.com)
Martin Smith (martin.audacis@gmail.com)
Significant contributions from:
Spencer V Muse (muse@stat.ncsu.edu)
Simon DW Frost (sdf22@cam.ac.uk)
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include "dataset_filter.h"
#include "matrix.h"
class _DataSetFilterNumeric : public _DataSetFilter {
public:
_DataSetFilterNumeric(void) {}
_DataSetFilterNumeric(_Matrix *, _List &, _DataSet *, long);
virtual ~_DataSetFilterNumeric(void);
virtual bool IsNormalFilter(void) const { return false; }
virtual BaseRef makeDynamic(void) const;
virtual unsigned long GetDimension(bool) const { return dimension; }
hyFloat *getProbabilityVector(long, long, long = 0);
virtual bool CompareTwoSites(unsigned long, unsigned long,
unsigned long) const;
long shifter, categoryShifter, categoryCount;
_Matrix probabilityVectors;
// N x M dense matrix
// N = spec count
// M = unique sites * dimension
};
|
8c76158eabd64e9da394ffd6c05bff0c0d6e3ca4
|
66e7571a8f5f0ca18f749063747a4143ca720c42
|
/A/A1002.cpp
|
314ef63b0da047723f72b7a793d18e98d18f9dcf
|
[] |
no_license
|
Athrun1027/pat
|
a862559b4e0bbbf61e7b932c95dae00d6e8ef8e5
|
42faeee117e571928cfa27dfa16f772c5c7cb620
|
refs/heads/master
| 2020-06-21T20:41:56.760394
| 2018-08-29T17:02:34
| 2018-08-29T17:02:34
| 197,547,769
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 681
|
cpp
|
A1002.cpp
|
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
int n;
double hash[1001] = {0.0};
scanf("%d", &n);
int max=0, count=0;
for(int i = 0; i<n; i++){
int co;
double ex;
scanf("%d %lf", &co, &ex);
hash[co] += ex;
}
int m;
scanf("%d", &m);
for(int i = 0; i<m; i++){
int co;
double ex;
scanf("%d %lf", &co, &ex);
hash[co] += ex;
}
vector<int> cos;
for (int i = 1000; i >= 0; --i){
if(hash[i] != 0) {
cos.push_back(i);
}
}
printf("%d", (int)cos.size());
for (int i = 0; i < cos.size(); ++i){
printf(" %d %.1f", cos[i], hash[cos[i]]);
}
printf("\n");
return 0;
}
|
9c6a7ca6a10d604f8a1aab61cefd253581fa7fbe
|
4f4ed3810bd65a9b0abaa4b4f26a6022826d2a0a
|
/manager/common/SpooferUI.cpp
|
76f914c94b484c425f905f2e616e97cdb38d4309
|
[] |
no_license
|
unsernetz/spoofer
|
12cdbae8b36736555e9e453a56dbce67ee6df04a
|
cfc9af3dd09c93a55b56deda3e7d1ef9fd92adef
|
refs/heads/master
| 2021-05-14T18:14:43.061466
| 2018-01-02T23:06:25
| 2018-01-02T23:06:25
| 116,066,117
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,549
|
cpp
|
SpooferUI.cpp
|
/*
* Copyright 2015-2017 The Regents of the University of California
* All rights reserved.
*
* This file is part of Spoofer.
*
* Spoofer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Spoofer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Spoofer. If not, see <http://www.gnu.org/licenses/>.
*/
#include <time.h>
#include "spoof_qt.h"
#include <QCommandLineParser>
#include <QtGlobal>
#include <QDir>
#include <QProcess>
#ifdef VISIT_URL
#ifdef Q_OS_WIN32
#include <windows.h> // for shellapi.h
#include <shellapi.h> // for ShellExecute()
#endif
#ifdef Q_OS_UNIX
#include <sys/wait.h>
#endif
#endif
#include "../../config.h"
#include "SpooferUI.h"
#include "FileTailThread.h"
#include "BlockReader.h"
static const char cvsid[] ATR_USED = "$Id: SpooferUI.cpp,v 1.34 2017/09/29 19:04:10 kkeys Exp $";
#ifdef VISIT_URL
// Visit a URL using the default web browser. (Unlike
// QDesktopServices::openUrl(), this does not require linking with QtGui.)
bool SpooferUI::visitURL(const char *url)
{
#if defined(Q_OS_WIN32)
return (int)ShellExecuteA(nullptr, nullptr, url, nullptr, nullptr,
SW_SHOWNORMAL) > 32;
#else
char buf[1024];
#if defined(Q_OS_MAC)
snprintf(buf, sizeof(buf), "open '%s'", url);
#elif defined(Q_OS_UNIX)
snprintf(buf, sizeof(buf), "xdg-open '%s'", url);
#endif
int rc = system(buf);
return rc != -1 && WIFEXITED(rc) && WEXITSTATUS(rc) == 0;
#endif
}
void SpooferUI::visitEmbeddedURLs(const QString *text)
{
// If text contains a URL, open it in a web browser.
static QString prefix("http://");
int i = 0;
while (i < text->size()) {
if ((*text)[i].isSpace()) {
i++; // skip leading space on a line
} else {
int n = text->indexOf("\n", i);
if (n < 0) n = text->size();
QStringRef line = text->midRef(i, n-i);
if (line.startsWith(prefix))
visitURL(qPrintable(line.toString()));
i = n+1; // jump to next line
}
}
}
#endif
void SpooferUI::printNextProberStart()
{
time_t when = nextProberStart.when;
if (when)
spout << "Next prober scheduled for " << qPrintable(ftime(QString(), &when)) << endl;
else
spout << "No prober scheduled." << endl;
}
void SpooferUI::readScheduler()
{
qint32 type;
sc_msg_text msg;
QStringList keys;
while (!scheduler->atEnd()) {
BlockReader in(scheduler);
in >> type;
switch (type) {
case SC_DONE_CMD:
doneCmd(0);
break;
case SC_CONFIG_CHANGED:
spout << "Settings changed." << endl;
config->sync();
configChanged();
break;
case SC_ERROR:
in >> msg;
qCritical() << "Error:" << qPrintable(msg.text);
doneCmd(1);
break;
case SC_TEXT:
in >> msg;
spout << "Scheduler: " << msg.text << endl;
doneCmd(0);
break;
case SC_PROBER_STARTED:
in >> msg;
spout << "Prober started; log: " <<
QDir::toNativeSeparators(msg.text) << endl;
nextProberStart.when = 0;
proberExitCode = 0;
proberExitStatus = QProcess::CrashExit;
startFileTail(msg.text);
break;
case SC_PROBER_FINISHED:
// Don't print exit code/status, just store them, and ask
// fileTail to stop. When fileTail is done reading the log,
// it will signal finished, and finishProber() will run.
in >> proberExitCode >> proberExitStatus;
if (fileTail && fileTail->isRunning())
fileTail->requestInterruption();
else // fileTail failed to start or exited early
finishProber();
break;
case SC_PROBER_ERROR:
in >> msg;
qWarning() << "Prober error:" << qPrintable(msg.text);
doneCmd(1);
break;
case SC_SCHEDULED:
in >> nextProberStart;
if (!fileTail || !fileTail->isRunning()) printNextProberStart();
// else, wait until finishProber()
break;
case SC_PAUSED:
spout << "Scheduler paused." << endl;
nextProberStart.when = 0;
schedulerPaused = true;
printNextProberStart();
break;
case SC_RESUMED:
spout << "Scheduler resumed." << endl;
schedulerPaused = false;
break;
case SC_NEED_CONFIG:
for (auto m : config->members) {
if (!m->isSet() && m->required)
keys << m->key;
}
spout << "The following required settings must be set: " <<
keys.join(QSL(", ")) << endl;
schedulerNeedsConfig = true;
needConfig();
break;
case SC_CONFIGED:
spout << "Scheduler is configured." << endl;
schedulerNeedsConfig = false;
break;
default:
qCritical() << "Illegal message from scheduler.";
scheduler->abort();
}
}
}
void SpooferUI::handleProberText(QString *text)
{
// remove each backspace and the character before it
int n = 1;
while ((n = text->indexOf(QSL("\b"))) > 0) {
text->remove(n-1, 2);
}
spout << *text << flush;
#ifdef VISIT_URL
visitEmbeddedURLs(text);
#endif
delete text;
}
bool SpooferUI::finishProber()
{
if (proberExitStatus == QProcess::NormalExit) {
spout << "prober exited normally, exit code " << proberExitCode << endl;
} else {
sperr << "prober exited abnormally" << endl;
}
if (fileTail) fileTail->deleteLater();
fileTail = nullptr;
printNextProberStart();
doneCmd(0);
return true;
}
|
3203b1137a201506c582824fb5ac9b9230096d86
|
758dc88cbc0e8d28d70ce4cd1b5c0cfe2ab92399
|
/FusionMath.h
|
510f340a0ddc9368dc0c2139ef58940deb70513f
|
[
"MIT"
] |
permissive
|
nanospork/OSVR-fusion
|
40707fe674b6490d42fb522033f0696f285950c3
|
a0ddf1e93218b6d7d4e3ebc8cf52b2a4854fadc5
|
refs/heads/master
| 2021-01-02T19:52:17.650523
| 2018-01-28T19:28:43
| 2018-01-28T19:28:43
| 99,310,849
| 6
| 2
| null | 2018-01-28T19:28:44
| 2017-08-04T06:27:28
|
C++
|
UTF-8
|
C++
| false
| false
| 238
|
h
|
FusionMath.h
|
#include "stdafx.h"
namespace je_nourish_fusion {
void rpyFromQuaternion(OSVR_Quaternion* quaternion, OSVR_Vec3* rpy);
void quaternionFromRPY(OSVR_Vec3* rpy, OSVR_Quaternion* quaternion);
double fixAngleWrap(double angle);
}
|
ac45ff194af3a036935537a22ae3da73eb0e7429
|
2ed4b541c28a9621593df04c2ee3e9368b6304a7
|
/src/dxvk/dxvk_meta_mipgen.cpp
|
46c2dd73ccf1e30040645bd2c0f31617a174fb00
|
[
"LicenseRef-scancode-warranty-disclaimer",
"Zlib"
] |
permissive
|
doitsujin/dxvk
|
ab07647fed6f6e960d225872fb752c572d7c5b0e
|
bbd1d84cd0e0a083a4d162c7207f81cf6604940d
|
refs/heads/master
| 2023-08-28T05:22:37.602631
| 2023-08-26T07:24:09
| 2023-08-26T08:43:42
| 106,558,568
| 11,382
| 1,055
|
Zlib
| 2023-09-13T21:29:26
| 2017-10-11T13:34:29
|
C++
|
UTF-8
|
C++
| false
| false
| 3,689
|
cpp
|
dxvk_meta_mipgen.cpp
|
#include "dxvk_meta_mipgen.h"
namespace dxvk {
DxvkMetaMipGenRenderPass::DxvkMetaMipGenRenderPass(
const Rc<vk::DeviceFn>& vkd,
const Rc<DxvkImageView>& view)
: m_vkd(vkd), m_view(view) {
// Determine view type based on image type
const std::array<std::pair<VkImageViewType, VkImageViewType>, 3> viewTypes = {{
{ VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_1D_ARRAY },
{ VK_IMAGE_VIEW_TYPE_2D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY },
{ VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_2D_ARRAY },
}};
m_srcViewType = viewTypes.at(uint32_t(view->imageInfo().type)).first;
m_dstViewType = viewTypes.at(uint32_t(view->imageInfo().type)).second;
// Create image views and framebuffers
m_passes.resize(view->info().numLevels - 1);
for (uint32_t i = 0; i < m_passes.size(); i++)
m_passes[i] = createViews(i);
}
DxvkMetaMipGenRenderPass::~DxvkMetaMipGenRenderPass() {
for (const auto& views : m_passes) {
m_vkd->vkDestroyImageView(m_vkd->device(), views.src, nullptr);
m_vkd->vkDestroyImageView(m_vkd->device(), views.dst, nullptr);
}
}
VkExtent3D DxvkMetaMipGenRenderPass::computePassExtent(uint32_t passId) const {
VkExtent3D extent = m_view->mipLevelExtent(passId + 1);
if (m_view->imageInfo().type != VK_IMAGE_TYPE_3D)
extent.depth = m_view->info().numLayers;
return extent;
}
DxvkMetaMipGenRenderPass::PassViews DxvkMetaMipGenRenderPass::createViews(uint32_t pass) const {
PassViews result = { };
VkImageViewUsageCreateInfo usageInfo = { VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO };
VkImageViewCreateInfo viewInfo = { VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, &usageInfo };
viewInfo.image = m_view->imageHandle();
viewInfo.format = m_view->info().format;
// Create source image view, which points to
// the one mip level we're going to sample.
VkImageSubresourceRange srcSubresources;
srcSubresources.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
srcSubresources.baseMipLevel = m_view->info().minLevel + pass;
srcSubresources.levelCount = 1;
srcSubresources.baseArrayLayer = m_view->info().minLayer;
srcSubresources.layerCount = m_view->info().numLayers;
usageInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT;
viewInfo.viewType = m_srcViewType;
viewInfo.subresourceRange = srcSubresources;
if (m_vkd->vkCreateImageView(m_vkd->device(), &viewInfo, nullptr, &result.src) != VK_SUCCESS)
throw DxvkError("DxvkMetaMipGenRenderPass: Failed to create source image view");
// Create destination image view, which points
// to the mip level we're going to render to.
VkExtent3D dstExtent = m_view->mipLevelExtent(pass + 1);
VkImageSubresourceRange dstSubresources;
dstSubresources.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
dstSubresources.baseMipLevel = m_view->info().minLevel + pass + 1;
dstSubresources.levelCount = 1;
if (m_view->imageInfo().type != VK_IMAGE_TYPE_3D) {
dstSubresources.baseArrayLayer = m_view->info().minLayer;
dstSubresources.layerCount = m_view->info().numLayers;
} else {
dstSubresources.baseArrayLayer = 0;
dstSubresources.layerCount = dstExtent.depth;
}
usageInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
viewInfo.viewType = m_dstViewType;
viewInfo.subresourceRange = dstSubresources;
if (m_vkd->vkCreateImageView(m_vkd->device(), &viewInfo, nullptr, &result.dst) != VK_SUCCESS)
throw DxvkError("DxvkMetaMipGenRenderPass: Failed to create destination image view");
return result;
}
}
|
1a627b1817a47fd9cba289bf0d4e4e14d610077c
|
d25bec99b74dde069bded8e74ed942c614e44f0c
|
/Training Code/2019.11.06 Pacific Northwest 2018/I.cpp
|
5243812ae35b26d42a588071fec893c1b59d9e77
|
[] |
no_license
|
RobeZH/Team-Model-Solution
|
f05461561b5e84249a28e78d89034f76ba5ca6ce
|
deca8054c83c25447f997fbda4ade3141ab0ce32
|
refs/heads/master
| 2023-01-31T05:26:44.773841
| 2019-12-24T01:48:16
| 2019-12-24T01:48:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,639
|
cpp
|
I.cpp
|
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> Pll;
const int maxn = 2e5 + 5;
const ll inf = (ll)1e13;
struct Line {
ll k, m;
Line(ll _k, ll _m) {
k = _k; m = _m;
}
Pll inter(Line o) {
return {m-o.m, o.k-k};
}
};
struct Hull {
deque<Line> que;
bool leq(Pll a, Pll b) {
return a.first * b.second <= a.second * b.first;
}
void add(ll k, ll m) {
while(que.size() > 1) {
int ls = que.size() - 1;
if(leq(que[ls].inter(Line(k,m)), que[ls-1].inter(que[ls]))) que.pop_back();
else break;
}
que.push_back({k, m});
}
ll query_bin(ll x) {
if(que.empty()) return -inf;
int l = 0, r = que.size() - 1;
while(l<r) {
int mi = (l+r)/2;
if(que[mi].k * x+ que[mi].m < que[mi+1].k * x + que[mi+1].m) l = mi+1;
else r = mi;
}
return que[l].k * x + que[l].m;
}
};
int n, m;
int a[maxn];
int cnt[105];
int sz;
int id[maxn];
int wow[maxn];
ll dp[maxn][2];
int main() {
scanf("%d%d",&n,&m);
// for(int i=1;i<=n;i++) scanf("%d",&a[i]);
ll ans = 0;
// initial
for(int i=1;i<=n;i++) {
if(a[i] != 0) {
cnt[a[i]]++;
for(int x=a[i]+1;x<=m;x++) ans += cnt[x];
}
else id[i] = ++sz;
}
/*// extra
for(int x=1;x<=sz;x++) {
for(int val=m;val>=1;val--) {
dp[x][val] = dp[x][val+1];
for(int y=0;y<x;y++) {
dp[x][val] = max(dp[x][val], dp[y][val+1] - sum_wow[y][val] - y*y + x*y + sum_wow[x][val]);
}
}
}*/
for(int x=1;x<=sz;x++) dp[x][0] = dp[x][1] = -inf;
for(int val=m;val>=1;val--) {
for(int x=1;x<=sz;x++) wow[x] = 0;
memset(cnt,0,sizeof(cnt));
for(int x=1;x<=n;x++) {
if(a[x] != 0) cnt[a[x]]++;
else {
for(int y=val+1;y<=m;y++) wow[id[x]] += cnt[y];
}
}
memset(cnt,0,sizeof(cnt));
for(int x=n;x>=1;x--) {
if(a[x] != 0) cnt[a[x]]++;
else {
for(int y=val-1;y>=1;y--) wow[id[x]] += cnt[y];
}
}
Hull hull;
ll sum = 0;
int t = val&1;
for(int x=1;x<=sz;x++) {
if(dp[x-1][!t] != -inf) hull.add(x-1, dp[x-1][!t] - sum - (ll)(x-1)*(x-1));
sum += wow[x];
ll qr = hull.query_bin(x);
dp[x][t] = dp[x][!t];
if(qr != -inf) dp[x][t] = max(dp[x][t], qr + sum);
}
}
printf("%I64d",dp[sz][1] + ans);
}
|
fb1a97b61293d961fdf0f50571c745d8363f83c4
|
7b3929c90a6324a09fc1d9c179e7b6540c1951f5
|
/CSES/Sorting and Searching/Movie Festival II.cpp
|
062ad782170ded6c5f159a71f48b8c6f7847a1d9
|
[
"MIT"
] |
permissive
|
the-hyp0cr1t3/CC
|
ff65ef193f051ea9b10dfd4d3291828d83d33bff
|
ee52f56540b7630c3a42a6762c93ed8b842e2adc
|
refs/heads/master
| 2023-09-04T11:52:33.989806
| 2023-06-05T15:57:03
| 2023-06-05T15:57:03
| 236,227,119
| 786
| 205
|
MIT
| 2023-08-29T18:29:24
| 2020-01-25T20:41:36
|
C++
|
UTF-8
|
C++
| false
| false
| 854
|
cpp
|
Movie Festival II.cpp
|
/**
🍪 thew6rst
🍪 10.02.2021 16:31:28
**/
#ifdef W
#include "k_II.h"
#else
#include <bits/stdc++.h>
using namespace std;
#endif
#define pb emplace_back
#define all(x) x.begin(), x.end()
#define sz(x) static_cast<int32_t>(x.size())
const int64_t DESPACITO = 2e18;
const int INF = 2e9, MOD = 1e9+7;
const int N = 2e5 + 5;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int i, n, k, ans = 0;
cin >> n >> k;
vector<pair<int, int>> a(n);
for(auto& [r, l]: a) cin >> l >> r;
sort(all(a));
multiset<int> have;
for(i = 0; i < k; i++)
have.insert(0);
for(auto& [r, l]: a) {
auto it = have.upper_bound(l);
if(it != have.begin()) {
have.erase(--it);
ans++; have.insert(r);
}
} cout << ans;
} // ~W
|
df434af8962c98ab758977b18a31b074384f096b
|
8648f3ac8ea7ab82e3b70f98e599057b030c359c
|
/src/software/world/team_test.cpp
|
b474d8bb0a3bbdf2ae479ee2b917fb159f384e6b
|
[
"LGPL-3.0-only"
] |
permissive
|
jsn0716/Software
|
d8d9b7ee9be06a0ba698b1668a00667e3312272b
|
9789622851b757cf1061d841355ed549e3e60894
|
refs/heads/master
| 2021-08-17T08:35:08.406668
| 2021-05-19T17:00:50
| 2021-05-19T17:00:50
| 210,057,457
| 1
| 0
|
MIT
| 2019-09-21T21:48:28
| 2019-09-21T21:48:27
| null |
UTF-8
|
C++
| false
| false
| 23,673
|
cpp
|
team_test.cpp
|
#include "software/world/team.h"
#include <gtest/gtest.h>
#include <stdexcept>
#include <unordered_set>
class TeamTest : public ::testing::Test
{
protected:
void SetUp() override
{
current_time = Timestamp::fromSeconds(123);
one_second_future = current_time + Duration::fromSeconds(1);
two_seconds_future = current_time + Duration::fromSeconds(2);
two_seconds_100ms_future = current_time + Duration::fromMilliseconds(2100);
three_seconds_future = current_time + Duration::fromSeconds(3);
one_second_past = current_time - Duration::fromSeconds(1);
}
Timestamp current_time;
Timestamp one_second_future;
Timestamp two_seconds_future;
Timestamp two_seconds_100ms_future;
Timestamp three_seconds_future;
Timestamp one_second_past;
};
TEST_F(TeamTest, construction_with_expiry_duration)
{
Team team = Team(Duration::fromMilliseconds(1000));
EXPECT_EQ(0, team.numRobots());
EXPECT_EQ(std::nullopt, team.getRobotById(0));
EXPECT_EQ(std::nullopt, team.getRobotById(2));
EXPECT_EQ(std::nullopt, team.goalie());
EXPECT_EQ(std::vector<Robot>(), team.getAllRobots());
EXPECT_EQ(Duration::fromMilliseconds(1000), team.getRobotExpiryBufferDuration());
}
TEST_F(TeamTest, construction_with_expiry_duration_and_team_robots)
{
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(), Vector(-0.5, 4), Angle::quarter(),
AngularVelocity::half(), current_time);
std::vector<Robot> robot_list = {robot_0, robot_1, robot_2};
Team team = Team(robot_list, Duration::fromMilliseconds(1000));
EXPECT_EQ(Duration::fromMilliseconds(1000), team.getRobotExpiryBufferDuration());
EXPECT_EQ(3, team.numRobots());
EXPECT_EQ(robot_0, team.getRobotById(0));
EXPECT_EQ(robot_1, team.getRobotById(1));
EXPECT_EQ(robot_2, team.getRobotById(2));
EXPECT_EQ(std::nullopt, team.getRobotById(3));
EXPECT_EQ(std::nullopt, team.goalie());
EXPECT_EQ(robot_list, team.getAllRobots());
}
TEST_F(TeamTest, update_with_3_robots)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(), Vector(-0.5, 4), Angle::quarter(),
AngularVelocity::half(), current_time);
std::vector<Robot> robot_list = {robot_0, robot_1, robot_2};
team.updateRobots(robot_list);
EXPECT_EQ(3, team.numRobots());
EXPECT_EQ(robot_0, team.getRobotById(0));
EXPECT_EQ(robot_1, team.getRobotById(1));
EXPECT_EQ(robot_2, team.getRobotById(2));
EXPECT_EQ(std::nullopt, team.getRobotById(3));
EXPECT_EQ(std::nullopt, team.goalie());
EXPECT_EQ(robot_list, team.getAllRobots());
}
TEST_F(TeamTest, update_with_new_team)
{
Team team_update = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(), Vector(-0.5, 4), Angle::quarter(),
AngularVelocity::half(), current_time);
std::vector<Robot> robot_list = {robot_0, robot_1, robot_2};
team_update.updateRobots(robot_list);
Team team = Team(Duration::fromMilliseconds(1000));
team.updateState(team_update);
EXPECT_EQ(3, team.numRobots());
EXPECT_EQ(robot_0, team.getRobotById(0));
EXPECT_EQ(robot_1, team.getRobotById(1));
EXPECT_EQ(robot_2, team.getRobotById(2));
EXPECT_EQ(std::nullopt, team.getRobotById(3));
EXPECT_EQ(std::nullopt, team.goalie());
EXPECT_EQ(robot_list, team.getAllRobots());
EXPECT_EQ(team_update, team);
}
TEST_F(TeamTest, remove_expired_robots_at_current_time_so_no_robots_expire)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
team.updateRobots({robot_0, robot_1});
team.removeExpiredRobots(current_time);
EXPECT_EQ(2, team.numRobots());
EXPECT_EQ(robot_0, team.getRobotById(0));
EXPECT_EQ(robot_1, team.getRobotById(1));
}
TEST_F(TeamTest, remove_expired_robots_in_future_before_expiry_time_so_no_robots_expire)
{
Team team = Team(Duration::fromMilliseconds(2100));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
team.updateRobots({robot_0, robot_1});
team.removeExpiredRobots(two_seconds_future);
EXPECT_EQ(2, team.numRobots());
EXPECT_EQ(robot_0, team.getRobotById(0));
EXPECT_EQ(robot_1, team.getRobotById(1));
}
TEST_F(TeamTest, remove_expired_robots_in_past_so_no_robots_expire)
{
Team team = Team(Duration::fromMilliseconds(2000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
team.updateRobots({robot_0, robot_1});
EXPECT_EQ(2, team.numRobots());
EXPECT_EQ(robot_0, team.getRobotById(0));
EXPECT_EQ(robot_1, team.getRobotById(1));
}
TEST_F(TeamTest, remove_expired_robots_in_future_so_all_robots_expire)
{
Team team = Team(Duration::fromMilliseconds(2000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
team.updateRobots({robot_0, robot_1});
team.removeExpiredRobots(two_seconds_100ms_future);
EXPECT_EQ(0, team.numRobots());
EXPECT_EQ(std::nullopt, team.getRobotById(0));
EXPECT_EQ(std::nullopt, team.getRobotById(1));
}
TEST_F(TeamTest, remove_expired_robots_in_future_so_1_robot_expires_1_robot_does_not)
{
Team team = Team(Duration::fromMilliseconds(2000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), one_second_future);
team.updateRobots({robot_0, robot_1});
team.removeExpiredRobots(two_seconds_100ms_future);
EXPECT_EQ(1, team.numRobots());
EXPECT_EQ(std::nullopt, team.getRobotById(0));
EXPECT_EQ(robot_1, team.getRobotById(1));
}
TEST_F(TeamTest, removeRobotWithId_robot_with_id_on_team)
{
Team team = Team(Duration::fromMilliseconds(2000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), one_second_future);
team.updateRobots({robot_0, robot_1});
team.removeRobotWithId(0);
EXPECT_EQ(1, team.getAllRobots().size());
EXPECT_EQ(std::vector<Robot>{robot_1}, team.getAllRobots());
}
TEST_F(TeamTest, removeRobotWithId_robot_with_id_not_on_team)
{
Team team = Team(Duration::fromMilliseconds(2000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), one_second_future);
team.updateRobots({robot_0, robot_1});
team.removeRobotWithId(2);
EXPECT_EQ(2, team.getAllRobots().size());
EXPECT_EQ(std::vector<Robot>({robot_0, robot_1}), team.getAllRobots());
}
TEST_F(TeamTest, clear_all_robots)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
std::vector<Robot> robot_list = {robot_0, robot_1};
team.updateRobots(robot_list);
EXPECT_EQ(2, team.numRobots());
EXPECT_EQ(robot_0, team.getRobotById(0));
EXPECT_EQ(robot_1, team.getRobotById(1));
EXPECT_EQ(std::nullopt, team.getRobotById(2));
EXPECT_EQ(std::nullopt, team.goalie());
EXPECT_EQ(robot_list, team.getAllRobots());
team.clearAllRobots();
EXPECT_EQ(0, team.numRobots());
EXPECT_EQ(std::nullopt, team.getRobotById(0));
EXPECT_EQ(std::nullopt, team.getRobotById(1));
EXPECT_EQ(std::nullopt, team.getRobotById(2));
EXPECT_EQ(std::nullopt, team.goalie());
EXPECT_EQ(std::vector<Robot>(), team.getAllRobots());
}
TEST_F(TeamTest, assign_goalie_starting_with_no_goalie)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
std::vector<Robot> robot_list = {robot_0, robot_1};
team.updateRobots(robot_list);
EXPECT_EQ(std::nullopt, team.goalie());
team.assignGoalie(0);
EXPECT_EQ(robot_0, team.goalie());
}
TEST_F(TeamTest, assign_goalie_starting_with_different_robot_as_goalie)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
std::vector<Robot> robot_list = {robot_0, robot_1};
team.updateRobots(robot_list);
team.assignGoalie(0);
EXPECT_EQ(robot_0, team.goalie());
team.assignGoalie(1);
EXPECT_EQ(robot_1, team.goalie());
}
TEST_F(TeamTest, clear_goalie)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
std::vector<Robot> robot_list = {robot_0, robot_1};
team.updateRobots(robot_list);
team.assignGoalie(0);
EXPECT_EQ(robot_0, team.goalie());
team.clearGoalie();
EXPECT_EQ(std::nullopt, team.goalie());
}
TEST_F(TeamTest, get_goalie_id_with_no_goalie)
{
Team team = Team(Duration::fromMilliseconds(1000));
EXPECT_EQ(std::nullopt, team.getGoalieId());
}
TEST_F(TeamTest, get_goalie_id_with_goalie)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
team.updateRobots({robot_0});
team.assignGoalie(0);
EXPECT_EQ(0, team.getGoalieId());
}
TEST_F(TeamTest, get_robot_expiry_buffer)
{
Team team = Team(Duration::fromMilliseconds(500));
EXPECT_EQ(Duration::fromMilliseconds(500), team.getRobotExpiryBufferDuration());
}
TEST_F(TeamTest, set_robot_expiry_buffer)
{
Team team = Team(Duration::fromMilliseconds(0));
team.setRobotExpiryBuffer(Duration::fromMilliseconds(831));
EXPECT_EQ(Duration::fromMilliseconds(831), team.getRobotExpiryBufferDuration());
}
TEST_F(TeamTest, set_unavailable_robot_capabilities_multiple_robots)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(3, -1), Vector(), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(1, 0), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
team.updateRobots({robot_0, robot_1});
std::set<RobotCapability> unavailableCapabilities_0;
std::set<RobotCapability> unavailableCapabilities_1;
unavailableCapabilities_0.insert(RobotCapability::Move);
unavailableCapabilities_0.insert(RobotCapability::Kick);
unavailableCapabilities_1.insert(RobotCapability::Chip);
unavailableCapabilities_1.insert(RobotCapability::Dribble);
team.setUnavailableRobotCapabilities(0, unavailableCapabilities_0);
team.setUnavailableRobotCapabilities(1, unavailableCapabilities_1);
EXPECT_EQ(unavailableCapabilities_0,
team.getRobotById(0).value().getUnavailableCapabilities());
EXPECT_EQ(unavailableCapabilities_1,
team.getRobotById(1).value().getUnavailableCapabilities());
}
TEST_F(TeamTest, set_unavailable_robot_capabilities_to_none)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(3, -1), Vector(), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
team.updateRobots({robot_0});
// Make Move unavailable
std::set<RobotCapability> unavailableCapabilities;
unavailableCapabilities.insert(RobotCapability::Move);
team.setUnavailableRobotCapabilities(0, unavailableCapabilities);
EXPECT_EQ(unavailableCapabilities,
team.getRobotById(0).value().getUnavailableCapabilities());
// Reset unavailable capabilities
std::set<RobotCapability> unavailableCapabilitiesEmpty;
team.setUnavailableRobotCapabilities(0, unavailableCapabilitiesEmpty);
EXPECT_EQ(unavailableCapabilitiesEmpty,
team.getRobotById(0).value().getUnavailableCapabilities());
}
TEST_F(TeamTest, nearest_friendy_one_robot)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
team.updateRobots({robot_0});
EXPECT_EQ(robot_0, team.getNearestRobot(Point(0, 0)));
}
TEST_F(TeamTest, nearest_friendy_multiple_robots)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(3, -1), Vector(), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(1, 0), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(4, 6), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
team.updateRobots({robot_0, robot_1, robot_2});
EXPECT_EQ(robot_1, team.getNearestRobot(Point(0, 0)));
}
TEST_F(TeamTest, nearest_friendy_multiple_robots_closest_is_moving)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(3, -1), Vector(), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(1, 0), Vector(3, 3), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(4, 6), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
team.updateRobots({robot_0, robot_1, robot_2});
EXPECT_EQ(robot_1, team.getNearestRobot(Point(0, 0)));
}
TEST_F(TeamTest, nearest_friendy_multiple_robots_all_moving)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(3, -1), Vector(3, 3), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(4, 6), Vector(3, 3), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(0, 1), Vector(3, 3), Angle::zero(),
AngularVelocity::zero(), current_time);
team.updateRobots({robot_0, robot_1, robot_2});
EXPECT_EQ(robot_2, team.getNearestRobot(Point(0, 0)));
}
TEST_F(TeamTest, nearest_friendy_one_robot_on_ball)
{
Team team = Team(Duration::fromMilliseconds(1000));
Robot robot_0 = Robot(0, Point(0, 0), Vector(), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(1, 0), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(4, 6), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
team.updateRobots({robot_0, robot_1, robot_2});
EXPECT_EQ(robot_0, team.getNearestRobot(Point(0, 0)));
}
TEST_F(TeamTest, nearest_robot_zero_robots)
{
Team team = Team(Duration::fromMilliseconds(1000));
EXPECT_EQ(std::nullopt, team.getNearestRobot(Point(0, 0)));
}
TEST_F(TeamTest, equality_operator_compare_team_with_itself)
{
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Team team = Team(Duration::fromMilliseconds(1000));
team.updateRobots({robot_0});
team.assignGoalie(0);
EXPECT_EQ(Team(Duration::fromMilliseconds(500)),
Team(Duration::fromMilliseconds(500)));
EXPECT_EQ(team, team);
}
TEST_F(TeamTest, equality_operator_teams_with_different_expiry_buffers)
{
EXPECT_NE(Team(Duration::fromMilliseconds(50)),
Team(Duration::fromMilliseconds(1000)));
}
TEST_F(TeamTest, equality_operator_teams_with_different_number_of_robots)
{
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(), Vector(-0.5, 4), Angle::quarter(),
AngularVelocity::half(), current_time);
Team team_0 = Team(Duration::fromMilliseconds(1000));
team_0.updateRobots({robot_0, robot_1, robot_2});
Team team_1 = Team(Duration::fromMilliseconds(1000));
team_1.updateRobots({robot_0, robot_2});
EXPECT_NE(team_0, team_1);
}
TEST_F(TeamTest, equality_operator_teams_with_same_number_of_robots_but_different_robots)
{
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(), Vector(-0.5, 4), Angle::quarter(),
AngularVelocity::half(), current_time);
Team team_0 = Team(Duration::fromMilliseconds(1000));
team_0.updateRobots({robot_0, robot_1});
Team team_1 = Team(Duration::fromMilliseconds(1000));
team_1.updateRobots({robot_0, robot_2});
EXPECT_NE(team_0, team_1);
}
TEST_F(TeamTest, equality_operator_teams_with_different_goalie)
{
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(), Vector(-0.5, 4), Angle::quarter(),
AngularVelocity::half(), current_time);
Team team_0 = Team(Duration::fromMilliseconds(1000));
team_0.updateRobots({robot_0, robot_1});
team_0.assignGoalie(0);
Team team_1 = Team(Duration::fromMilliseconds(1000));
team_1.updateRobots({robot_0, robot_1});
team_1.assignGoalie(1);
EXPECT_NE(team_0, team_1);
}
TEST_F(TeamTest, get_most_recent_timestamp)
{
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), one_second_future);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), one_second_past);
Robot robot_2 = Robot(2, Point(), Vector(-0.5, 4), Angle::quarter(),
AngularVelocity::half(), current_time);
Team team = Team(Duration::fromMilliseconds(1000));
team.updateRobots({robot_0, robot_1, robot_2});
team.assignGoalie(0);
EXPECT_EQ(one_second_future, team.getMostRecentTimestamp());
}
TEST_F(TeamTest, get_all_robots_except_goalie_in_team_of_3)
{
Team team = Team(Duration::fromMilliseconds(2000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
team.updateRobots({robot_0, robot_1, robot_2});
team.assignGoalie(0);
std::unordered_set<int> returned_robot_ids;
for (const auto& robot : team.getAllRobotsExceptGoalie())
{
returned_robot_ids.emplace(robot.id());
}
EXPECT_EQ(returned_robot_ids.find(0), returned_robot_ids.end());
EXPECT_NE(returned_robot_ids.find(1), returned_robot_ids.end());
EXPECT_NE(returned_robot_ids.find(2), returned_robot_ids.end());
}
TEST_F(TeamTest, get_all_robots_except_goalie_in_team_of_4)
{
Team team = Team(Duration::fromMilliseconds(2000));
Robot robot_0 = Robot(0, Point(0, 1), Vector(-1, -2), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
Robot robot_1 = Robot(1, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_2 = Robot(2, Point(3, -1), Vector(), Angle::zero(),
AngularVelocity::zero(), current_time);
Robot robot_3 = Robot(3, Point(2, 4), Vector(), Angle::half(),
AngularVelocity::threeQuarter(), current_time);
team.updateRobots({robot_0, robot_1, robot_2, robot_3});
team.assignGoalie(2);
std::unordered_set<int> returned_robot_ids;
for (const auto& robot : team.getAllRobotsExceptGoalie())
{
returned_robot_ids.emplace(robot.id());
}
EXPECT_EQ(returned_robot_ids.find(2), returned_robot_ids.end());
EXPECT_NE(returned_robot_ids.find(0), returned_robot_ids.end());
EXPECT_NE(returned_robot_ids.find(1), returned_robot_ids.end());
EXPECT_NE(returned_robot_ids.find(3), returned_robot_ids.end());
}
|
2e8e28721965fe2a139b1164909bac21d45b6edd
|
0b66399ced2c7b50f5ee53c81562dab79b33ed67
|
/MyCardDemo2/MainPage.h
|
6c0a1a9aae9e3889fbe720633e8bf5f988aa0902
|
[] |
no_license
|
wcj233/MyCardDemo_winrt
|
091bab68e175ef15592ec577238fddd18f98d011
|
194aabb320949e7b7fcffec0f5b47a3a0ab87c58
|
refs/heads/master
| 2020-06-23T09:13:13.642856
| 2019-07-24T07:20:21
| 2019-07-24T07:20:21
| 198,580,469
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,014
|
h
|
MainPage.h
|
#pragma once
#include "CardModel.h"
#include "MainPage.g.h"
#include "CardViewModel.h"
#include "CardListViewModel.h"
#include <winrt/coroutine.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Foundation.h>
#include "winrt/Windows.Data.Json.h"
#include <time.h>
#include <winrt/Windows.UI.Notifications.h>
#include <winrt/Windows.Data.Xml.Dom.h>
//#include <SingleCardUserControl.h>
namespace winrt::MyCardDemo2::implementation
{
/*public static MyCardDemo2::MainPage Current();*/
struct MainPage : MainPageT<MainPage>
{
MainPage();
public:
//static MyCardDemo2::MainPage mycurrent;
MyCardDemo2::CardListViewModel CardListVM();
void CardListVM(MyCardDemo2::CardListViewModel value);
void AddListButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
void AddSuccess_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
Windows::Foundation::IAsyncAction getJsonFile();
private:
MyCardDemo2::CardListViewModel cardListViewModel{ nullptr };
Windows::Foundation::Collections::IObservableVector<Windows::Foundation::IInspectable> cardLists{ nullptr };
Windows::Foundation::Collections::IObservableVector<Windows::Foundation::IInspectable> cardUCLists{ nullptr };
MyCardDemo2::CardModel dragCardContent{ nullptr };
Windows::Foundation::IAsyncAction MainPage::DeleteCardList(int index, std::string headTitle);
MyCardDemo2::CardViewModel originalCardTitleVM{ nullptr };
hstring tbname;
//MyCardDemo2::MainPage current;
public:
void SureButton_Tapped(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Input::TappedRoutedEventArgs const& e);
void Image_Tapped(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Input::TappedRoutedEventArgs const& e);
};
}
namespace winrt::MyCardDemo2::factory_implementation
{
struct MainPage : MainPageT<MainPage, implementation::MainPage>
{
};
}
|
0a64542471715e9fc8224bbe10eb4ef46bcdd07f
|
84e0d7758245f18fc02184a1d39ef17173c98dfa
|
/fms-dev-5777-305266462-328582127/dat.cpp
|
80293d626ccaac31de3577373c4c24192d1f22ef
|
[] |
no_license
|
ChaskyH/FMS
|
cba3f2efad51a66146c6b756cd8eb9635e11d9ef
|
ee83017853136aebe5cb3d8e71403a7645fe1077
|
refs/heads/master
| 2020-12-07T17:10:47.596566
| 2017-07-24T12:27:04
| 2017-07-24T12:27:04
| 95,438,618
| 0
| 0
| null | 2017-07-24T12:27:05
| 2017-06-26T11:13:15
|
C++
|
UTF-8
|
C++
| false
| false
| 653
|
cpp
|
dat.cpp
|
#include "dat.h"
using namespace fms;
DAT::DAT()
{
sectorNr = 1;
formatDat(0, 1);
}
void DAT::formatDat(int addrDatCpy, int addrRootDirCpy)
{
table.set();
table.set(addrDatCpy, 0);
table.set(addrRootDirCpy, 0);
}
int DAT::place_fits_all(int needClusters)
{
int needClustTmp = needClusters;
int firstClust = -1;
//check if we have continuity of clusters
for (int i = 0; i < NUM_CLUSTERS; i++)
{
if (table[i] == 1)
{
if (firstClust == -1)
firstClust = i;
needClustTmp--;
if (needClustTmp == 0)
return firstClust;
}
else //if(cluster[i]==0)
{
firstClust = -1;
needClustTmp = needClusters;
}
}
return 0;
}
|
6f53ea8cd671c93cce6eadcc14151e7de974b349
|
c270ab152b48a5c484a04eed61e9cea5fccdfa3b
|
/nginx/program/page-speed-1.9/third_party/instaweb/src/net/instaweb/rewriter/elide_attributes_filter.cc
|
94878836f512ab611da96debb7f49d26b32208f4
|
[
"Apache-2.0"
] |
permissive
|
ganq/image-server
|
38fe38521933bce4c4c07311a4a4ac5f326fa977
|
0d49f8de669f9eb203c420f8086ea611430ab8b4
|
refs/heads/master
| 2021-01-01T17:16:28.744237
| 2014-12-30T08:52:47
| 2014-12-30T08:52:47
| 28,624,061
| 1
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,765
|
cc
|
elide_attributes_filter.cc
|
/**
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Author: mdsteele@google.com (Matthew D. Steele)
#include "net/instaweb/rewriter/public/elide_attributes_filter.h"
#include "net/instaweb/htmlparse/public/html_parse.h"
#include "net/instaweb/htmlparse/public/html_element.h"
#include "net/instaweb/htmlparse/public/html_node.h"
#include <string>
#include "net/instaweb/util/public/string_util.h"
namespace {
// An attribute can be simplified if it can have only one value, like
// <option selected=selected> can be simplified to <option selected>.
// The list is derived from <http://www.w3.org/TR/html4/loose.dtd>.
struct TagAttr {
const char* tag_name;
const char* attr_name;
};
const TagAttr kOneValueList[] = {
{"area", "nohref"},
{"img", "ismap"},
{"object", "declare"},
{"hr", "noshade"},
{"dl", "compact"},
{"ol", "compact"},
{"ul", "compact"},
{"dir", "compact"},
{"menu", "compact"},
{"input", "checked"},
{"input", "disabled"},
{"input", "readonly"},
{"input", "ismap"},
{"select", "multiple"},
{"select", "disabled"},
{"optgroup", "disabled"},
{"option", "selected"},
{"option", "disabled"},
{"textarea", "disabled"},
{"textarea", "readonly"},
{"button", "disabled"},
{"th", "nowrap"},
{"td", "nowrap"},
{"frame", "noresize"},
{"script", "defer"},
};
// An attribute can be removed from a tag if its name and value is in
// kDefaultList. If attr_value is NULL, it means matching just attribute name
// is enough. The list is derived from <http://www.w3.org/TR/html4/loose.dtd>.
//
// Note: It is important that this list not include attributes that can be
// inherited. Otherwise something like this could fail:
// <div attr="non_default_value">
// <div attr="default_value"> <!-- must not be elided -->
// </div>
// </div>
struct TagAttrValue {
const char* tag_name;
const char* attr_name;
const char* attr_value;
};
const TagAttrValue kDefaultList[] = {
{"script", "language", NULL},
{"script", "type", NULL},
{"style", "type", NULL},
{"br", "clear", "none"},
{"a", "shape", "rect"},
{"area", "shape", "rect"},
{"param", "valuetype", "data"},
{"form", "method", "get"},
{"form", "enctype", "application/x-www-form-urlencoded"},
{"input", "type", "text"},
{"button", "type", "submit"},
{"colgroup", "span", "1"},
{"col", "span", "1"},
{"th", "rowspan", "1"},
{"th", "colspan", "1"},
{"td", "rowspan", "1"},
{"td", "colspan", "1"},
{"frame", "frameborder", "1"},
{"frame", "scrolling", "auto"},
{"iframe", "frameborder", "1"},
{"iframe", "scrolling", "auto"},
};
} // namespace
namespace net_instaweb {
ElideAttributesFilter::ElideAttributesFilter(HtmlParse* html_parse)
: xhtml_mode_(false) {
// Populate one_value_attrs_map_
for (size_t i = 0; i < arraysize(kOneValueList); ++i) {
const TagAttr& entry = kOneValueList[i];
one_value_attrs_map_[html_parse->Intern(entry.tag_name)].insert(
html_parse->Intern(entry.attr_name));
}
// Populate default_value_map_
for (size_t i = 0; i < arraysize(kDefaultList); ++i) {
const TagAttrValue& entry = kDefaultList[i];
default_value_map_[html_parse->Intern(entry.tag_name)]
[html_parse->Intern(entry.attr_name)] = entry.attr_value;
}
}
void ElideAttributesFilter::StartDocument() {
xhtml_mode_ = false;
}
void ElideAttributesFilter::Directive(HtmlDirectiveNode* directive) {
// If this is an XHTML doctype directive, then put us into XHTML mode.
std::string lowercase = directive->contents();
LowerString(&lowercase);
// TODO(mdsteele): This is probably not very robust; we should find a more
// reliable way to test for XHTML doctypes.
if (HasPrefixString(lowercase, "doctype") &&
lowercase.find("xhtml") != std::string::npos) {
xhtml_mode_ = true;
}
}
void ElideAttributesFilter::StartElement(HtmlElement* element) {
if (!xhtml_mode_) {
// Check for one-value attributes.
AtomSetMap::const_iterator iter =
one_value_attrs_map_.find(element->tag());
if (iter != one_value_attrs_map_.end()) {
const AtomSet& oneValueAttrs = iter->second;
for (int i = 0, end = element->attribute_size(); i < end; ++i) {
HtmlElement::Attribute& attribute = element->attribute(i);
if (attribute.value() != NULL &&
oneValueAttrs.count(attribute.name()) > 0) {
attribute.SetValue(NULL);
}
}
}
}
// Check for attributes with default values.
AtomMapMap::const_iterator iter1 = default_value_map_.find(element->tag());
if (iter1 != default_value_map_.end()) {
const AtomMap& default_values = iter1->second;
for (int i = 0; i < element->attribute_size(); ++i) {
HtmlElement::Attribute& attribute = element->attribute(i);
AtomMap::const_iterator iter2 = default_values.find(attribute.name());
if (iter2 != default_values.end()) {
const char* default_value = iter2->second;
if (default_value == NULL ||
(attribute.value() != NULL &&
strcasecmp(attribute.value(), iter2->second) == 0)) {
element->DeleteAttribute(i);
--i;
}
}
}
}
}
} // namespace net_instaweb
|
cdc28aec1658bb9d89b39bc79a92ec9410303df2
|
520b75c144414d2af5a655e592fa65787ee89aaa
|
/AOJ/Volume26/2600.cpp
|
32ab0e7ef71f3f96bca25497da63286065dae4b6
|
[] |
no_license
|
arrows-1011/CPro
|
4ac069683c672ba685534444412aa2e28026879d
|
2e1a9242b2433851f495468e455ee854a8c4dac7
|
refs/heads/master
| 2020-04-12T09:36:40.846130
| 2017-06-10T08:02:10
| 2017-06-10T08:02:10
| 46,426,455
| 1
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 766
|
cpp
|
2600.cpp
|
#include <bits/stdc++.h>
using namespace std;
#define MAX 100010
int main(){
int N,W,H;
int X[MAX],Y[MAX];
for(int i = 0 ; i < MAX ; i++){
X[i] = Y[i] = 0;
}
cin >> N >> W >> H;
for(int i = 0 ; i < N ; i++){
int x,y,w;
cin >> x >> y >> w;
X[max(0,x-w)]++;
Y[max(0,y-w)]++;
X[min(W,x+w)]--;
Y[min(H,y+w)]--;
}
for(int i = 0 ; i < W ; i++){
X[i+1] += X[i];
}
for(int i = 0 ; i < H ; i++){
Y[i+1] += Y[i];
}
bool can = false, f = true;
for(int i = 0 ; i < W ; i++){
if(X[i] == 0){
f = false;
break;
}
}
can |= f; f = true;
for(int i = 0 ; i < H ; i++){
if(Y[i] == 0){
f = false;
break;
}
}
can |= f;
cout << (can ? "Yes" : "No") << endl;
return 0;
}
|
e5dcc233b72e03130f535fdbaace8966d5bfd770
|
c6dbbb08e9547a471187605d87336d7b0fa58845
|
/system_filters/Notifier/ConfigView.cpp
|
258165af0f68a18fa12547a22e47c9ee42fb7f02
|
[] |
no_license
|
HaikuArchives/BeMailDaemon
|
625faa4a22122a4c3e7b557356a25ef571653565
|
2fd5cd8e114a9e7ae96b3369b25cfea0af66b88b
|
refs/heads/master
| 2016-09-06T04:31:35.558754
| 2008-08-17T19:49:55
| 2008-08-17T19:49:55
| 39,097,297
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,607
|
cpp
|
ConfigView.cpp
|
/* ConfigView - the configuration view for the Notifier filter
**
** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
*/
#include "ConfigView.h"
#include <CheckBox.h>
#include <PopUpMenu.h>
#include <MenuItem.h>
#include <MenuField.h>
#include <String.h>
#include <Message.h>
#include <MDRLanguage.h>
#include <MailAddon.h>
const uint32 kMsgNotifyMethod = 'nomt';
ConfigView::ConfigView()
: BView(BRect(0,0,10,10),"notifier_config",B_FOLLOW_LEFT | B_FOLLOW_TOP,0)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
// determine font height
font_height fontHeight;
GetFontHeight(&fontHeight);
float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent + fontHeight.leading) + 6;
BRect frame(5,2,250,itemHeight + 2);
BPopUpMenu *menu = new BPopUpMenu(B_EMPTY_STRING,false,false);
const char *notifyMethods[] = {
MDR_DIALECT_CHOICE ("Beep","音"),
MDR_DIALECT_CHOICE ("Alert","窓(メール毎)"),
MDR_DIALECT_CHOICE ("Keyboard LEDs","キーボードLED"),
MDR_DIALECT_CHOICE ("Central Alert","窓(一括)"),
"Central Beep","Log Window"};
for (int32 i = 0,j = 1;i < 6;i++,j *= 2)
menu->AddItem(new BMenuItem(notifyMethods[i],new BMessage(kMsgNotifyMethod)));
BMenuField *field = new BMenuField(frame,"notify",
MDR_DIALECT_CHOICE ("Method:","方法:"),menu);
field->ResizeToPreferred();
field->SetDivider(field->StringWidth(
MDR_DIALECT_CHOICE ("Method:","方法:")) + 6);
AddChild(field);
ResizeToPreferred();
}
void ConfigView::AttachedToWindow()
{
if (BMenuField *field = dynamic_cast<BMenuField *>(FindView("notify")))
field->Menu()->SetTargetForItems(this);
}
void ConfigView::SetTo(BMessage *archive)
{
int32 method = archive->FindInt32("notification_method");
if (method < 0)
method = 1;
BMenuField *field;
if ((field = dynamic_cast<BMenuField *>(FindView("notify"))) == NULL)
return;
for (int32 i = field->Menu()->CountItems();i-- > 0;)
{
BMenuItem *item = field->Menu()->ItemAt(i);
item->SetMarked((method & (1L << i)) != 0);
}
UpdateNotifyText();
}
void ConfigView::UpdateNotifyText()
{
BMenuField *field;
if ((field = dynamic_cast<BMenuField *>(FindView("notify"))) == NULL)
return;
BString label;
for (int32 i = field->Menu()->CountItems();i-- > 0;)
{
BMenuItem *item = field->Menu()->ItemAt(i);
if (!item->IsMarked())
continue;
if (label != "")
label.Prepend(" + ");
label.Prepend(item->Label());
}
if (label == "")
label = "none";
field->MenuItem()->SetLabel(label.String());
}
void ConfigView::MessageReceived(BMessage *msg)
{
switch (msg->what)
{
case kMsgNotifyMethod:
{
msg->PrintToStream();
BMenuItem *item;
if (msg->FindPointer("source",(void **)&item) < B_OK)
break;
item->SetMarked(!item->IsMarked());
UpdateNotifyText();
break;
}
default:
BView::MessageReceived(msg);
}
}
status_t ConfigView::Archive(BMessage *into,bool) const
{
int32 method = 0;
BMenuField *field;
if ((field = dynamic_cast<BMenuField *>(FindView("notify"))) != NULL)
{
for (int32 i = field->Menu()->CountItems();i-- > 0;)
{
BMenuItem *item = field->Menu()->ItemAt(i);
if (item->IsMarked())
method |= 1L << i;
}
}
if (into->ReplaceInt32("notification_method",method) != B_OK)
into->AddInt32("notification_method",method);
return B_OK;
}
void ConfigView::GetPreferredSize(float *width, float *height)
{
*width = 258;
*height = ChildAt(0)->Bounds().Height() + 8;
}
BView* instantiate_config_panel(BMessage *settings,BMessage *)
{
ConfigView *view = new ConfigView();
view->SetTo(settings);
return view;
}
|
0b207287845ca037e888724d93f570d15a071b5c
|
cc7661edca4d5fb2fc226bd6605a533f50a2fb63
|
/Assembly-CSharp/DecayEntity.h
|
8969258b02fa196a4f84613bbc1b54c9f89da63c
|
[
"MIT"
] |
permissive
|
g91/Rust-C-SDK
|
698e5b573285d5793250099b59f5453c3c4599eb
|
d1cce1133191263cba5583c43a8d42d8d65c21b0
|
refs/heads/master
| 2020-03-27T05:49:01.747456
| 2017-08-23T09:07:35
| 2017-08-23T09:07:35
| 146,053,940
| 1
| 0
| null | 2018-08-25T01:13:44
| 2018-08-25T01:13:44
| null |
UTF-8
|
C++
| false
| false
| 184
|
h
|
DecayEntity.h
|
#pragma once
namespace rust
{
class DecayEntity : public BaseCombatEntity // 0x1e8
{
public:
float decayTimer; // 0x1e8 (size: 0x4, flags: 0x1, type: 0xc)
}; // size = 0x1f0
}
|
e008f4679012c6a7858dafe1f97d49480ceeb356
|
5d39aac0342107599009dc47c7acb56851f482d2
|
/piece.cpp
|
0c569c3762e6140950ef3f27b7460a7bb8832068
|
[] |
no_license
|
Quantum64/Chess
|
0821facb07bba8c027bec2cede1dcb286c2d3e83
|
1213f3bdd42d79d70b898ef2174c32a2b2ff93dd
|
refs/heads/master
| 2020-07-14T20:08:52.406992
| 2019-08-30T13:49:38
| 2019-08-30T13:49:38
| 205,391,289
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,639
|
cpp
|
piece.cpp
|
#include <functional>
#include <algorithm>
#include <chrono>
#include "piece.h"
#include "game.h"
#include "console.h"
const PieceType PieceType::PAWN = PieceType("P", "Pawn");
const PieceType PieceType::ROOK = PieceType("R", "Rook");
const PieceType PieceType::KNIGHT = PieceType("N", "Knight");
const PieceType PieceType::BISHOP = PieceType("B", "Bishop");
const PieceType PieceType::QUEEN = PieceType("Q", "Queen");
const PieceType PieceType::KING = PieceType("K", "King");
const PieceType PieceType::EMPTY = PieceType(" ", "");
bool isValidLocation(int x, int y) {
if (x < 0 || x >= BOARD_WIDTH) {
return false;
}
if (y < 0 || y >= BOARD_HEIGHT) {
return false;
}
return true;
}
void Piece::lookInDirection(Game& game, std::vector<Point>& result, Point location, int right, int up, int max) {
if (right == 0 && up == 0) {
return;
}
int x = location.x, y = location.y, count = 0;
while (true) {
if (max > 0 && count >= max) {
break;
}
count++;
x += right;
y += up;
if (!isValidLocation(x, y)) {
break;
}
Point point(x, y);
if (!game.hasPiece(point)) {
result.push_back(point);
continue;
}
Piece piece = game.getPiece(point);
if (piece.getColor() != getColor()) {
result.push_back(point);
}
break;
}
}
void runForValidOffset(Point location, int offsetX, int offsetY, std::function<void(Point loc)> action) {
int x = location.x + offsetX, y = location.y + offsetY;
if (isValidLocation(x, y)) {
action(Point(x, y));
}
}
std::vector<Point> Piece::getValidMoves(Game& game, Point location) {
std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();
std::vector<Point> result = getMoves(game, location);
std::vector<Point> checked;
std::copy_if(result.begin(), result.end(), std::back_inserter(checked), [&](Point point) {
Game copy = game;
copy.setSelectedPiece(location);
copy.setSelectedTarget(point);
copy.moveToTarget();
return !copy.isInCheck(getColor());
});
std::chrono::high_resolution_clock::time_point end = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
std::string debug = "Calculating valid moves took ";
debug += std::to_string(duration);
debug += " microseconds (" + std::to_string(duration / 1000) + " milliseconds).\n";
getConsole().debug(debug);
return checked;
}
std::vector<Point> Piece::getMoves(Game& game, Point location) {
std::vector<Point> result;
auto pawnLogicCapture = [&](Point loc) {
if (game.hasPiece(loc)) {
if (game.getPiece(loc).getColor() != getColor()) {
result.push_back(loc);
}
}
};
auto pawnLogicForward = [&](Point loc) {
if (!game.hasPiece(loc)) {
result.push_back(loc);
}
};
auto pawnLogicForwardFirst = [&](Point loc) {
if (isFirstMove()) {
if (game.hasPiece(Point(loc.x, loc.y + (getColor() == PieceColor::WHITE ? 1 : -1)))) {
return;
}
if (!game.hasPiece(loc)) {
result.push_back(loc);
}
}
};
auto kingCastleLogic = [&](Point loc) {
if (isFirstMove()) {
Point rookRight(loc.x + 3, loc.y);
if (game.hasPiece(rookRight)) {
if (game.getPiece(rookRight).isFirstMove()) {
if (!game.hasPiece(Point(loc.x + 2, loc.y)) && !game.hasPiece(Point(loc.x + 1, loc.y))) {
result.push_back(Point(loc.x + 2, loc.y));
}
}
}
Point rookLeft(loc.x - 4, loc.y);
if (game.hasPiece(rookLeft)) {
if (game.getPiece(rookLeft).isFirstMove()) {
if (!game.hasPiece(Point(loc.x - 3, loc.y)) && !game.hasPiece(Point(loc.x - 2, loc.y)) && !game.hasPiece(Point(loc.x - 1, loc.y))) {
result.push_back(Point(loc.x - 2, loc.y));
}
}
}
}
};
if (getType() == PieceType::PAWN && getColor() == PieceColor::WHITE) {
runForValidOffset(location, 0, -1, pawnLogicForward);
runForValidOffset(location, 0, -2, pawnLogicForwardFirst);
runForValidOffset(location, 1, -1, pawnLogicCapture);
runForValidOffset(location, -1, -1, pawnLogicCapture);
}
else if (getType() == PieceType::PAWN && getColor() == PieceColor::BLACK) {
runForValidOffset(location, 0, 1, pawnLogicForward);
runForValidOffset(location, 0, 2, pawnLogicForwardFirst);
runForValidOffset(location, 1, 1, pawnLogicCapture);
runForValidOffset(location, -1, 1, pawnLogicCapture);
}
else if (getType() == PieceType::ROOK) {
int options[4][2] = { {1, 0}, { -1, 0 }, {0, 1 }, {0, -1} };
for (int* r : options) {
lookInDirection(game, result, location, r[0], r[1], -1);
}
}
else if (getType() == PieceType::BISHOP) {
int options[4][2] = { {1, 1}, { -1, -1 }, {-1, 1 }, {1, -1} };
for (int* r : options) {
lookInDirection(game, result, location, r[0], r[1], -1);
}
}
else if (getType() == PieceType::QUEEN) {
int options[8][2] = { {1, 1}, { -1, -1 }, {-1, 1 }, {1, -1}, {1, 0}, { -1, 0 }, {0, 1 }, {0, -1} };
for (int* r : options) {
lookInDirection(game, result, location, r[0], r[1], -1);
}
}
else if (getType() == PieceType::KNIGHT) {
int options[8][2] = { {1, 2}, {1, -2}, {-1, 2}, {-1, -2}, {2, 1}, {2, -1}, {-2, 1}, {-2, -1} };
for (int* r : options) {
runForValidOffset(location, r[0], r[1], [&](Point loc) {
if (game.hasPiece(loc)) {
if (game.getPiece(loc).getColor() == getColor()) {
return;
}
}
result.push_back(loc);
});
}
}
else if (getType() == PieceType::KING) {
int options[8][2] = { {1, 1}, { -1, -1 }, {-1, 1 }, {1, -1}, {1, 0}, { -1, 0 }, {0, 1 }, {0, -1} };
for (int* r : options) {
lookInDirection(game, result, location, r[0], r[1], 1);
}
runForValidOffset(location, 0, 0, kingCastleLogic);
}
return result;
}
|
3133f52e04e894c58068a0db87da712733d0289f
|
3342f131ff45c74ef7d533196b82aef9a0568a4e
|
/src/hitbox.cpp
|
265509f192b884dfd08dfbdaa7d07b071045a9f3
|
[] |
no_license
|
NPThompson/tanks
|
03571bad05aa247bfb178ccd4ce4489ef73517ce
|
1c41b5cec26733c70492ba99760d18dc9c15614a
|
refs/heads/master
| 2023-06-15T09:42:03.239611
| 2021-07-13T01:53:37
| 2021-07-13T01:53:37
| 384,304,742
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,199
|
cpp
|
hitbox.cpp
|
#include<hitbox.h>
rect rect_overlap(rect A, rect B)
{
rect overlap(point(0,0), point(0,0));
double x0 = 0.0,
x1 = B.position.x - A.position.x,
w0 = A.size.x,
w1 = B.size.x + (B.position.x - A.position.x);
if(x1 > x0){
overlap.position.x = x1;
overlap.size.x = w0 - x1;
}
else{
overlap.position.x = x0;
overlap.size.x = w1 - x0;
}
x0 = 0.0;
x1 = B.position.y - A.position.y;
w0 = A.size.y;
w1 = B.size.y + (B.position.y - A.position.y);
if(x1 > x0){
overlap.position.y = x1;
overlap.size.y = w0 - x1;
}
else{
overlap.position.y = x0;
overlap.size.y = w1 - x0;
}
overlap.position = overlap.position + A.position;
return overlap;
}
hbox::hbox(coord sz)
{
type = hbox_t::rectangle;
rect_size = sz;
}
bool hbox::touching(hbox other, point offset){
rect _overlap = overlap(other,offset);
return _overlap.size.x > 0 && _overlap.size.y > 0;
}
rect hbox::overlap(hbox other, point offset)
{
point p = point(0,0) - (rect_size/2.0f);
rect A = {p, rect_size};
p = offset - (other.rect_size/2.0f);
rect B = {p, other.rect_size};
return rect_overlap(A,B);
}
|
ab348ab57c55ebc2c846a2b85e4ec323e4ee57c7
|
59d26f54e985df3a0df505827b25da0c5ff586e8
|
/External/algorithm-master/number_theory/modular_arithmetics.cc
|
5110efe0e0609fd1c0ccbb1fa605887b05c7d336
|
[] |
no_license
|
minhaz1217/My-C-Journey
|
820f7b284e221eff2595611b2e86dc9e32f90278
|
3c8d998ede172e9855dc6bd02cb468d744a9cad6
|
refs/heads/master
| 2022-12-06T06:12:30.823678
| 2022-11-27T12:09:03
| 2022-11-27T12:09:03
| 160,788,252
| 2
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 11,183
|
cc
|
modular_arithmetics.cc
|
//
// Modular Arithmetics
//
// long long: 10^18 < 2^63-1 < 10^19 (strict inequality)
// __int128_t: 10^38 < 2^127-1 < 10^39
//
// g++ -std=c++17 -O3 -fmax-errors=1 -fsanitize=undefined
#include <bits/stdc++.h>
#pragma GCC optimize ("O3")
using namespace std;
#define fst first
#define snd second
#define all(c) begin(c), end(c)
// === tick a time ===
#include <ctime>
double tick() {
static clock_t oldtick;
clock_t newtick = clock();
double diff = 1.0*(newtick - oldtick) / CLOCKS_PER_SEC;
oldtick = newtick;
return diff;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
os << "[";
for (int i = 0; i < v.size(); os << v[i++])
if (i > 0) os << " ";
os << "]";
return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
os << "[";
for (int i = 0; i < v.size(); os << v[i++])
if (i > 0) os << endl << " ";
os << "]";
return os;
}
using Int = long long;
struct ModInt {
static Int mod; // Set this value
Int val;
ModInt(Int v=0) : val(v%mod) { }
ModInt operator-() const { return ModInt(val?mod-val:val); }
ModInt &operator+=(ModInt a) {
if ((val += a.val) >= mod) val -= mod;
return *this;
}
ModInt &operator-=(ModInt a) {
if ((val -= a.val) < 0) val += mod;
return *this;
}
ModInt &operator*=(ModInt a) {
val = (__uint128_t(val) * a.val) % mod;
return *this;
}
ModInt &operator/=(ModInt a) {
Int u = 1, v = a.val, s = 0, t = mod;
while (v) {
Int q = t / v;
swap(s -= u * q, u);
swap(t -= v * q, v);
}
a.val = (s < 0 ? s + mod : s);
val /= t;
return (*this) *= a;
}
ModInt inv() const { return ModInt(1) /= (*this); }
bool operator<(ModInt x) const { return val < x.val; }
};
Int ModInt::mod = 1e9+7;
ostream &operator<<(ostream &os, ModInt a) { os << a.val; return os; }
ModInt operator+(ModInt a, ModInt b) { return a += b; }
ModInt operator-(ModInt a, ModInt b) { return a -= b; }
ModInt operator*(ModInt a, ModInt b) { return a *= b; }
ModInt operator/(ModInt a, ModInt b) { return a /= b; }
ModInt pow(ModInt a, Int e) {
ModInt x(1);
for (; e > 0; e /= 2) {
if (e % 2 == 1) x *= a;
a *= a;
}
return x;
}
ModInt stringToModInt(string s) {
Int val = 0;
for (int i = 0; i < s.size(); ++i)
val = (val*10 + (s[i]-'0')) % ModInt::mod;
return ModInt(val);
}
// compute inv[1], inv[2], ..., inv[mod-1] in O(n) time
vector<ModInt> inverse() {
Int mod = ModInt::mod;
vector<ModInt> inv(mod);
inv[1].val = 1;
for (Int a = 2; a < mod; ++a)
inv[a] = inv[mod % a] * ModInt(mod - mod/a);
return inv;
}
//
// Solve x^2 = n; mod should be a prime
//
// Verified: Code Forces Quadratic Equations
//
bool isQuadraticResidue(ModInt n) {
return n.val == 0 || n.mod == 2 || pow(n, (n.mod-1)/2).val == 1;
}
ModInt sqrt(ModInt n) {
const Int mod = ModInt::mod;
if (n.val == 0 || mod == 2) return n;
int M = __builtin_ctz(mod-1), Q = (mod-1)>>M;
ModInt z(2);
while (isQuadraticResidue(z)) ++z.val;
ModInt c = pow(z, Q);
ModInt t = pow(n, Q);
ModInt R = pow(n, (Q+1)/2);
while (t.val != 1) {
int i = 0;
for (ModInt s = t; s.val != 1; s *= s) ++i;
if (M == i) exit(0);
ModInt b = pow(c, 1<<(M-i-1));
M = i;
c = b*b;
t *= c;
R *= b;
}
return R;
}
vector<ModInt> quadraticEquation(ModInt a, ModInt b, ModInt c) {
if (ModInt::mod == 2) {
vector<ModInt> ans;
if (c.val == 0) ans.push_back(c);
if ((a + b + c).val == 0) ans.push_back(ModInt(1));
return ans;
} else {
b /= (a+a); c /= a;
ModInt D = b*b - c;
if (!isQuadraticResidue(D)) return {};
ModInt s = sqrt(D), x = -b+s, y = -b-s;
return (x.val < y.val) ? vector<ModInt>({x, y}) :
(x.val > y.val) ? vector<ModInt>({y, x}) :
vector<ModInt>({x});
}
}
// Discrete Logarithm by Shanks' Baby-Step Giant-Step
// Find k such that a^k == b
Int log(ModInt a, ModInt b) {
Int h = ceil(sqrt(ModInt::mod+1e-9));
unordered_map<Int,Int> hash;
ModInt x(1);
for (Int i = 0; i < h; ++i) {
if (!hash.count(x.val)) hash[x.val] = i;
x *= a;
}
x = x.inv();
ModInt y = b;
for (int i = 0; i < h; ++i) {
if (hash.count(y.val)) return i*h+hash[y.val];
y *= x;
}
return -1;
}
struct ModMatrix {
int m, n; // m times n matrix
vector<vector<ModInt>> val;
ModInt &operator()(int i, int j) { return val[i][j]; }
ModMatrix(int m, int n) :
m(m), n(n), val(m, vector<ModInt>(n)) { }
ModMatrix operator-() const {
ModMatrix A(m, n);
for (int i = 0; i < m; ++i)
for (int j = 0; j < n; ++j)
A.val[i][j] = -val[i][j];
return A;
}
ModMatrix &operator+=(ModMatrix A) {
for (int i = 0; i < m; ++i)
for (int j = 0; j < n; ++j)
val[i][j] += A.val[i][j];
return *this;
}
ModMatrix &operator-=(ModMatrix A) {
for (int i = 0; i < m; ++i)
for (int j = 0; j < n; ++j)
val[i][j] -= A.val[i][j];
return *this;
}
ModMatrix &operator*=(ModMatrix A) {
for (int i = 0; i < m; ++i) {
vector<ModInt> row(A.n);
for (int j = 0; j < A.n; ++j) {
for (int k = 0; k < A.m; ++k)
row[j] += val[i][k] * A.val[k][j];
}
val[i] = row;
}
return *this;
}
static ModMatrix eye(int n) {
ModMatrix I(n, n);
for (int i = 0; i < n; ++i) I.val[i][i].val = 1;
return I;
}
static ModMatrix zero(int n) {
return ModMatrix(n, n);
}
// mod should be prime
ModMatrix inv() const {
ModMatrix B = eye(n);
vector<vector<ModInt>> a = val;
vector<vector<ModInt>> &b = B.val;
for (int i = 0, j, k; i < n; ++i) {
for (j = i; j < n && a[j][i].val == 0; ++j);
if (j == n) return ModMatrix(0,0); // regularity is checked by m = 0
swap(a[i], a[j]);
swap(b[i], b[j]);
ModInt inv = a[i][i].inv();
for (k = i; k < n; ++k) a[i][k] *= inv;
for (k = 0; k < n; ++k) b[i][k] *= inv;
for (j = 0; j < n; ++j) {
if (i == j || a[j][i].val == 0) continue;
ModInt c = a[j][i];
for (k = i; k < n; ++k) a[j][k] -= c * a[i][k];
for (k = 0; k < n; ++k) b[j][k] -= c * b[i][k];
}
}
return B;
}
// It can be used for any composite modulo.
ModInt det() const {
vector<vector<ModInt>> a = val;
ModInt D(1);
for (int j = 0; j < n; ++j) {
for (int i = j+1; i < n; ++i) {
while (a[i][j].val) {
D = -D;
ModInt t(a[j][j].val/a[i][j].val);
for (int k = j; k < n; ++k)
swap(a[i][k], a[j][k] -= t * a[i][k]);
}
}
D *= a[j][j];
}
return D;
}
};
ModMatrix operator+(ModMatrix A, ModMatrix B) { return A += B; }
ModMatrix operator-(ModMatrix A, ModMatrix B) { return A -= B; }
ModMatrix operator*(ModMatrix A, ModMatrix B) { return A *= B; }
ModMatrix pow(ModMatrix A, int k) {
ModMatrix X = ModMatrix::eye(A.n);
for (; k > 0; k /= 2) {
if (k % 2 == 1) X *= A;
A *= A;
}
return X;
}
ModInt dot(ModMatrix A, ModMatrix B) {
ModInt val;
for (int i = 0; i < A.m; ++i)
for (int j = 0; j < A.n; ++j)
val += A.val[i][j] * B.val[i][j];
return val;
}
using ModVector = vector<ModInt>;
ModVector operator*(ModMatrix A, ModVector x) {
vector<ModInt> y(A.m);
for (int i = 0; i < A.m; ++i)
for (int j = 0; j < A.n; ++j)
y[i] += A.val[i][j] * x[j];
return y;
}
ModInt dot(ModVector a, ModVector b) {
ModInt val;
for (int i = 0; i < a.size(); ++i)
val += a[i] * b[i];
return val;
}
//
// Only available for prime modulos.
// If you want to compute multiple inverses,
// use LU decomposition instead of computing the inverse.
//
struct LUDecomposition {
int n;
vector<int> pi;
vector<vector<ModInt>> val;
LUDecomposition(ModMatrix A) : n(A.n), val(A.val) {
pi.resize(n+1);
iota(all(pi), 0);
for (int i = 0, j, k; i < n; ++i) {
for (k = i; k < n; ++k)
if (val[k][i].val) break;
if (k == n) { pi[n] = -1; return; } // NG
if (k != i) {
swap(pi[i], pi[k]);
swap(val[i], val[k]);
++pi[n];
}
for (j = i+1; j < n; ++j) {
if (val[j][i].val == 0) continue;
val[j][i]/= val[i][i];
for (k = i+1; k < n; ++k)
val[j][k] -= val[j][i] * val[i][k];
}
}
}
bool isRegular() const { return pi[n] >= 0; }
ModVector solve(ModVector b) {
vector<ModInt> x(b.size());
for (int i = 0; i < n; ++i) {
x[i] = b[pi[i]];
for (int k = 0; k < i; ++k)
x[i] -= val[i][k] * x[k];
}
for (int i = n-1; i >= 0; --i) {
for (int k = i+1; k < n; ++k)
x[i] -= val[i][k] * x[k];
x[i] /= val[i][i];
}
return x;
}
ModMatrix inverse() { // do not compute the inverse
ModMatrix B(n, n);
for (int j = 0; j < n; ++j) {
for (int i = 0; i < n; ++i) {
if (pi[i] == j) B.val[i][j].val = 1;
for (int k = 0; k < i; k++)
B.val[i][j] -= val[i][k] * B.val[k][j];
}
for (int i = n-1; i >= 0; --i) {
for (int k = i+1; k < n; ++k)
B.val[i][j] -= val[i][k] * B.val[k][j];
B.val[i][j] /= val[i][i];
}
}
return B;
}
ModInt det() {
ModInt D = val[0][0];
for (int i = 1; i < n; i++)
D *= val[i][i];
return ((pi[n] - n) % 2 != 0) ? -D : D;
}
};
void mulTest() {
ModInt::mod = 1e9+7;
int m = 4, n = 4;
ModMatrix A(m,n);
ModMatrix B(m,n);
vector<ModInt> b(n);
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) {
A(i,j).val = rand() % ModInt::mod;
B(i,j).val = rand() % ModInt::mod;
}
b[i].val = rand() % ModInt::mod;
}
ModMatrix C = A * B;
for (int i = 0; i < C.m; ++i) {
for (int j = 0; j < C.n; ++j) {
cout << C(i,j) << " ";
}
cout << endl;
}
cout << C.det() << endl;
LUDecomposition LU(C);
cout << LU.det() << endl;
// A^{-1} b = x
auto x = LU.solve(b);
cout << b << " " << (C * x) << endl;
cout << "end" << endl;
}
void CF_QUADRATIC_EQUATIONS() {
int ncase; cin >> ncase;
for (int icase = 0; icase < ncase; ++icase) {
Int a, b, c, p;
cin >> a >> b >> c >> p;
ModInt::mod = p;
vector<ModInt> ans = quadraticEquation(
ModInt(a), ModInt(b), ModInt(c));
cout << ans.size();
for (int i = 0; i < ans.size(); ++i)
cout << " " << ans[i].val;
cout << endl;
}
}
void CF_DISCLOG() {
ModInt::mod = 999998999999;
ModInt a(21309), b(696969);
cout << log(a, b) << endl;
}
int SPOJ_MIFF() {
for (int icase = 0; ; ++icase) {
int n, p; scanf("%d %d", &n, &p);
if (n == 0 && p == 0) break;
if (icase > 0) printf("\n");
ModInt::mod = p;
ModMatrix A(n, n);
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j)
scanf("%d", &A(i,j));
ModMatrix B = A.inv();
if (B.m > 0) {
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
printf("%d ", B(i,j));
}
printf("\n");
}
} else {
printf("singular\n");
}
}
}
int main() {
SPOJ_MIFF();
//CF_DISCLOG();
//CF_QUADRATIC_EQUATIONS();
//mulTest();
}
|
e313cb03abe7612016e6d44cd716b2f676934c27
|
7c2ddd6ec37e0c46742de39b7874dea26358dad8
|
/KSBindata.h
|
4f36cc7eb29e269f3d9b677a73a70db1fcfc539d
|
[] |
no_license
|
kuldeep6445/c-data-handling-library
|
a11f21e64e223e577ea54b1230a5cb4ac2541ea0
|
31bf42467bf5e82ea6fb9dea9e876abce62d1e3c
|
refs/heads/master
| 2021-01-01T01:47:19.854440
| 2020-02-10T15:57:22
| 2020-02-10T15:57:22
| 239,128,048
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 654
|
h
|
KSBindata.h
|
#include<iostream>
using namespace std;
string find_data(ifstream *myfile , string title ){
string total;
char track[2];
int start =0;
int a=0;
int b=0;
char buffer[50];
while(!(myfile->eof())){
getline(*myfile , total );
start = total.find(title);
if(start != std::string::npos){
a = total.find(":",start);
a = total.find('"',a);
b = total.find('"' ,a+1);
if(b-a == 3){
track[0] = total[a+1];
track[1] = total[a+2];
return track;
}
else if(b-a == 2){
track[0] = total[a+1];
return track;
}
total.copy(buffer ,b-a-1,a+1);
}
}
return buffer;
}
|
6842bc73826fa1f5d7188a57d645fba831d2a649
|
a92b18defb50c5d1118a11bc364f17b148312028
|
/src/prod/test/FabricTest/TestStoreClient.cpp
|
a4d502e5dc073d6d036ebc6134c385d9ebc1a5e8
|
[
"MIT"
] |
permissive
|
KDSBest/service-fabric
|
34694e150fde662286e25f048fb763c97606382e
|
fe61c45b15a30fb089ad891c68c893b3a976e404
|
refs/heads/master
| 2023-01-28T23:19:25.040275
| 2020-11-30T11:11:58
| 2020-11-30T11:11:58
| 301,365,601
| 1
| 0
|
MIT
| 2020-11-30T11:11:59
| 2020-10-05T10:05:53
| null |
UTF-8
|
C++
| false
| false
| 33,783
|
cpp
|
TestStoreClient.cpp
|
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#include "stdafx.h"
using namespace Common;
using namespace FabricTest;
using namespace std;
using namespace Transport;
using namespace Naming;
using namespace TestCommon;
const StringLiteral TraceSource("FabricTest.TestClient");
std::wstring const TestStoreClient::InitialValue = L"";
FABRIC_SEQUENCE_NUMBER const TestStoreClient::InitialVersion = 0;
ULONGLONG const TestStoreClient::InitialDataLossVersion = 0;
int const TestStoreClient::RetryWaitMilliSeconds = 2000;
class TestStoreClient::TestClientEntry
{
public:
TestClientEntry()
{
}
TestClientEntry(Guid fuId, wstring const& value, int64 version, ITestStoreServiceWPtr && storeServiceWPtr, int64 dataLossVersion)
: fuId_ (fuId), value_(value), version_(version), storeServiceWPtr_(move(storeServiceWPtr)), dataLossVersion_(dataLossVersion)
{
}
__declspec (property(get=get_FUId)) Guid const& Id;
Guid const& get_FUId() const {return fuId_;}
__declspec (property(get=get_Value, put=put_Value)) wstring const& Value;
wstring const& get_Value() const {return value_;}
void put_Value(wstring const & value) { value_ = value; }
__declspec (property(get=get_Version, put=put_Version)) FABRIC_SEQUENCE_NUMBER Version;
FABRIC_SEQUENCE_NUMBER get_Version() const {return version_;}
void put_Version(FABRIC_SEQUENCE_NUMBER const& version) { version_ = version; }
__declspec (property(get=get_DataLossVersion, put=put_DataLossVersion)) ULONGLONG DataLossVersion;
ULONGLONG get_DataLossVersion() const {return dataLossVersion_;}
void put_DataLossVersion(ULONGLONG const& dataLossVersion) { dataLossVersion_ = dataLossVersion; }
__declspec (property(get=get_StoreService, put=put_StoreService)) ITestStoreServiceWPtr const& StoreService;
ITestStoreServiceWPtr const& get_StoreService() const {return storeServiceWPtr_;}
void put_StoreService(ITestStoreServiceWPtr && storeServiceWPtr) { storeServiceWPtr_ = move(storeServiceWPtr); }
private:
wstring value_;
FABRIC_SEQUENCE_NUMBER version_;
ITestStoreServiceWPtr storeServiceWPtr_;
ULONGLONG dataLossVersion_;
Guid fuId_;
};
class TestStoreClient::StoreServiceEntry
{
public:
StoreServiceEntry(ITestStoreServiceSPtr && service)
: service_(move(service))
, root_()
{
// Create a ComponentRoot for debugging leaks via
// reference tracking traces
//
auto casted = dynamic_cast<ComponentRoot*>(service_.get());
if (casted)
{
root_ = casted->CreateComponentRoot();
}
}
__declspec (property(get=get_Service, put=put_Service)) ITestStoreServiceSPtr const & StoreService;
ITestStoreServiceSPtr const & get_Service() const { return service_; }
private:
ITestStoreServiceSPtr service_;
ComponentRootSPtr root_;
};
TestStoreClient::TestStoreClient(wstring const& serviceName)
:serviceName_(serviceName),
entryMapLock_(),
entryMap_(),
activeThreads_(0),
noActiveThreadsEvent_(true),
clientLock_(),
clientActive_(false),
random_((int)Common::SequenceNumber::GetNext())
{
srand(static_cast<unsigned int>(time(NULL)));
}
TestStoreClient::~TestStoreClient()
{
}
void TestStoreClient::Reset()
{
AcquireExclusiveLock lock1(clientLock_);
AcquireExclusiveLock lock2(entryMapLock_);
TestSession::FailTestIf(clientActive_, "Clients should not be active when calling TestStoreClient::Reset for {0}", serviceName_);
entryMap_.clear();
}
void TestStoreClient::Backup(
__int64 key,
std::wstring const & dir,
Store::StoreBackupOption::Enum backupOption,
bool postBackupReturn,
ErrorCodeValue::Enum expectedError)
{
wstring unusedValue;
FABRIC_SEQUENCE_NUMBER unusedSequenceNumber;
ULONGLONG unusedDataLossVersion;
TimeoutHelper timeout(FabricTestSessionConfig::GetConfig().StoreClientTimeout);
while (!timeout.IsExpired)
{
auto entry = GetCurrentEntry(key, true, unusedValue, unusedSequenceNumber, unusedDataLossVersion);
if(entry)
{
auto const & storeService = entry->StoreService;
Common::ComPointer<IFabricStorePostBackupHandler> comImpl =
Common::make_com<ComTestPostBackupHandler, IFabricStorePostBackupHandler>(postBackupReturn);
Api::IStorePostBackupHandlerPtr postBackupHandler = Api::WrapperFactory::create_rooted_com_proxy(comImpl.GetRawPointer());
ManualResetEvent waiter;
auto operation = storeService->BeginBackup(
dir,
backupOption,
postBackupHandler,
[&](Common::AsyncOperationSPtr const &)
{
waiter.Set();
},
nullptr);
waiter.WaitOne();
auto error = storeService->EndBackup(operation);
waiter.Reset();
TestSession::FailTestIf(
!error.IsError(expectedError),
"Backup: Unexpected error: {0} != {1}",
error,
expectedError);
return;
}
else
{
TestSession::WriteInfo(TraceSource, "Test Store Service not ready");
Sleep(RetryWaitMilliSeconds);
}
}
TestSession::FailTest("Timed out waiting for Test Store Service to be ready");
}
void TestStoreClient::Restore(__int64 key, std::wstring const & dir, ErrorCodeValue::Enum expectedError)
{
wstring unusedValue;
FABRIC_SEQUENCE_NUMBER unusedSequenceNumber;
ULONGLONG unusedDataLossVersion;
TimeoutHelper timeout(FabricTestSessionConfig::GetConfig().StoreClientTimeout);
while (!timeout.IsExpired)
{
auto entry = GetCurrentEntry(key, true, unusedValue, unusedSequenceNumber, unusedDataLossVersion);
if(entry)
{
auto const & storeService = entry->StoreService;
ManualResetEvent waiter;
auto operation = storeService->BeginRestore(
dir,
[&](Common::AsyncOperationSPtr const &)
{
waiter.Set();
},
nullptr);
waiter.WaitOne();
auto error = storeService->EndRestore(operation);
TestSession::FailTestIf(
!error.IsError(expectedError),
"Restore: Unexpected error: {0} != {1}",
error,
expectedError);
return;
}
else
{
TestSession::WriteInfo(TraceSource, "Test Store Service not ready");
Sleep(RetryWaitMilliSeconds);
}
}
TestSession::FailTest("Timed out waiting for Test Store Service to be ready");
}
void TestStoreClient::CompressionTest(__int64 key, std::vector<std::wstring> const & params, ErrorCodeValue::Enum expectedError)
{
wstring unusedValue;
FABRIC_SEQUENCE_NUMBER unusedSequenceNumber;
ULONGLONG unusedDataLossVersion;
auto entry = GetCurrentEntry(key, true, unusedValue, unusedSequenceNumber, unusedDataLossVersion);
if(entry)
{
auto const & storeService = entry->StoreService;
auto error = storeService->CompressionTest(params);
TestSession::FailTestIf(
!error.IsError(expectedError),
"CompressionTest: Unexpected error: {0} != {1}",
error,
expectedError);
}
else
{
TestSession::FailTest("Test Store Service not ready");
}
}
void TestStoreClient::Put(__int64 key, int keyCount, wstring const & value, bool useDefaultNamedClient, __out bool & quorumLost, Common::ErrorCode expectedErrorCode, bool allowAllError)
{
for (auto kk=key; kk<key+keyCount; ++kk)
{
this->Put(kk, value, useDefaultNamedClient, quorumLost, expectedErrorCode, allowAllError);
}
}
void TestStoreClient::Put(__int64 key, int keyCount, wstring const & value, bool useDefaultNamedClient, __out bool & quorumLost, vector<ErrorCodeValue::Enum> const & expectedErrors, bool allowAllError)
{
for (auto kk=key; kk<key+keyCount; ++kk)
{
this->Put(kk, value, useDefaultNamedClient, quorumLost, expectedErrors, allowAllError);
}
}
void TestStoreClient::Put(__int64 key, wstring const & value, bool useDefaultNamedClient, __out bool & quorumLost, ErrorCode expectedError, bool allowAllError)
{
vector<ErrorCodeValue::Enum> expectedErrors;
expectedErrors.push_back(expectedError.ReadValue());
return Put(key, value, useDefaultNamedClient, quorumLost, expectedErrors, allowAllError);
}
void TestStoreClient::Put(__int64 key, wstring const & value, bool useDefaultNamedClient, __out bool & quorumLost, vector<ErrorCodeValue::Enum> const & expectedErrors, bool allowAllError)
{
quorumLost = false;
TestSession::WriteNoise(TraceSource, "Put at service {0} for key {1}", serviceName_, key);
ErrorCode error;
TimeoutHelper timeout(FabricTestSessionConfig::GetConfig().StoreClientTimeout);
bool done = false;
bool matchedExpectedError = false;
do
{
wstring currentValue;
FABRIC_SEQUENCE_NUMBER currentVersion;
ULONGLONG currentDataLossVersion;
FABRIC_SEQUENCE_NUMBER newVersion = 0;
ULONGLONG dataLossVersion = 0;
wstring partitionId;
// Don't hold onto store service reference while retrying resolution
//
{
auto entry = GetCurrentEntry(key, useDefaultNamedClient, currentValue, currentVersion, currentDataLossVersion);
if (entry)
{
auto const & storeService = entry->StoreService;
partitionId = storeService->GetPartitionId();
error = storeService->Put(key, value, currentVersion, serviceName_, newVersion, dataLossVersion);
}
else
{
error = ErrorCodeValue::FabricTestServiceNotOpen;
}
}
bool updated = true;
if (error.IsSuccess())
{
UpdateEntry(key, value, newVersion, dataLossVersion);
}
else if (error.IsError(ErrorCodeValue::FabricTestVersionDoesNotMatch))
{
TestSession::WriteNoise(TraceSource, "Put for service {0} at key {1} resulted in error FabricTestVersionDoesNotMatch", serviceName_, key);
TestSession::FailTestIf(newVersion == currentVersion, "Versions cannot match because Put returned FabricTestVersionDoesNotMatch");
TestSession::FailTestIf(partitionId.empty(), "Empty partitionId for service {0} while putting key {1}", serviceName_, key);
if (newVersion < currentVersion)
{
CheckForDataLoss(key, partitionId, currentDataLossVersion, dataLossVersion);
}
//If newVersion is > then currentVersion that means the entry we have is out of date and
//some other thread updated value before us or that although replication failed (possibly due to a node closing)
//the new primary did receive the operation
UpdateEntry(key);
}
else
{
updated = false;
}
auto findIt = find_if(expectedErrors.begin(), expectedErrors.end(), [&error](ErrorCodeValue::Enum item) { return error.IsError(item); });
matchedExpectedError = (findIt != expectedErrors.end());
if (!updated && !matchedExpectedError)
{
TestSession::WriteNoise(TraceSource, "Put for service {0} at key {1} resulted in error {2}", serviceName_, key, error);
Guid fuId = GetFUId(key);
if(FABRICSESSION.FabricDispatcher.IsQuorumLostFU(fuId) || FABRICSESSION.FabricDispatcher.IsRebuildLostFU(fuId))
{
TestSession::WriteNoise(TraceSource, "Quorum or Rebuild lost at {0}:{1} for key {2} so skipping operation", serviceName_, fuId, key);
Sleep(RetryWaitMilliSeconds);
quorumLost = true;
return;
}
else
{
//We might have out of date pointer to StoreService. Need to resolve again
ResolveService(key, useDefaultNamedClient, allowAllError);
}
}
done = (matchedExpectedError || timeout.IsExpired);
if(!done)
{
//Sleep before retrying.
Sleep(RetryWaitMilliSeconds);
}
} while(!done);
if (matchedExpectedError)
{
TestSession::WriteNoise(TraceSource, "Put at service {0} for key {1} succeeded with expectedErrors {2}", serviceName_, key, expectedErrors);
}
else
{
TestSession::FailTest("Failed to write to key {0} at service {1} because of error {2}, expectedErrors {3}", key, serviceName_, error, expectedErrors);
}
}
void TestStoreClient::Get(__int64 key, int keyCount, bool useDefaultNamedClient, __out vector<wstring> & values, __out vector<bool> & exists, __out bool & quorumLost)
{
values.clear();
exists.clear();
values.resize(keyCount);
exists.resize(keyCount);
for (auto kk=key; kk<key+keyCount; ++kk)
{
wstring value;
bool keyExists;
this->Get(kk, useDefaultNamedClient, value, keyExists, quorumLost);
values[kk-key] = value;
exists[kk-key] = keyExists;
}
}
void TestStoreClient::Get(__int64 key, bool useDefaultNamedClient, __out wstring & value, __out bool & keyExists, __out bool & quorumLost)
{
quorumLost = false;
keyExists = false;
TestSession::WriteNoise(TraceSource, "Get at service {0} for key {1}", serviceName_, key);
//TODO: Make timeout value configurable if required
TimeoutHelper timeout(FabricTestSessionConfig::GetConfig().StoreClientTimeout);
bool isSuccess = false;
bool done = false;
do
{
wstring currentValue;
FABRIC_SEQUENCE_NUMBER currentVersion;
ULONGLONG currentDataLossVersion;
FABRIC_SEQUENCE_NUMBER version = 0;
ULONGLONG dataLossVersion = 0;
ErrorCode error;
wstring partitionId;
{
auto entry = GetCurrentEntry(key, useDefaultNamedClient, currentValue, currentVersion, currentDataLossVersion);
if(entry)
{
auto const & storeService = entry->StoreService;
partitionId = storeService->GetPartitionId();
error = storeService->Get(key, serviceName_, value, version, dataLossVersion);
}
else
{
error = ErrorCode(ErrorCodeValue::FabricTestServiceNotOpen);
}
}
bool resolve = false;
if(error.IsSuccess())
{
//Only do value validation if there hasn't been any data loss AND no other new version for the given key is inserted into the map.
if(dataLossVersion == currentDataLossVersion && version == currentVersion)
{
TestSession::FailTestIf(value.compare(currentValue) != 0, "Value in store at service {0} for key {1} does not match expected {2}, actual {3}",
serviceName_,
key,
currentValue.length(),
currentValue,
value.length(),
value);
isSuccess = true;
}
else if(version < currentVersion)
{
CheckForDataLoss(key, partitionId, currentDataLossVersion, dataLossVersion);
}
//If version is > then currentVersion that means the entry we have is out of date and
//some other thread updated value before us or that although replication failed (possibly due to a node closing)
//the new primary did receive the operation
UpdateEntry(key);
}
else if(error.ReadValue() == ErrorCodeValue::FabricTestKeyDoesNotExist)
{
TestSession::WriteNoise(TraceSource, "Get for service {0} at key {1} resulted in error {2}", serviceName_, key, error.ReadValue());
bool isInitialEntry = (currentVersion == InitialVersion && currentValue.compare(InitialValue) == 0);
if(!isInitialEntry)
{
CheckForDataLoss(key, partitionId, currentDataLossVersion, dataLossVersion);
}
keyExists = false;
return;
}
else
{
resolve = true;
}
if (resolve)
{
TestSession::WriteNoise(TraceSource, "Get for service {0} at key {1} resulted in error {2}", serviceName_, key, error.ReadValue());
Guid fuId = GetFUId(key);
if(FABRICSESSION.FabricDispatcher.IsQuorumLostFU(fuId) || FABRICSESSION.FabricDispatcher.IsRebuildLostFU(fuId))
{
TestSession::WriteNoise(TraceSource, "Quorum or Rebuild lost at {0}:{1} for key {2} so skipping operation", serviceName_, fuId, key);
Sleep(RetryWaitMilliSeconds);
quorumLost = true;
return;
}
else
{
//We might have out of date pointer to StoreService. Need to resolve again
ResolveService(key, useDefaultNamedClient);
}
}
done = (isSuccess || timeout.IsExpired);
if(!done)
{
//Sleep before retrying.
Sleep(RetryWaitMilliSeconds);
}
} while(!done);
if(!isSuccess)
{
TestSession::FailTest("Failed to read key {0} at service {1}", key, serviceName_);
}
keyExists = true;
TestSession::WriteNoise(TraceSource, "Get at service {0} for key {1} succeeded", serviceName_, key);
}
void TestStoreClient::GetAll(__out vector<pair<__int64, wstring>> & kvpairs, __out bool & quorumLost)
{
quorumLost = false;
TestSession::WriteNoise(TraceSource, "GetAll at service {0}", serviceName_);
ErrorCode error;
vector<ITestStoreServiceSPtr> storeServices = GetAllEntries();
for (auto & storeService : storeServices)
{
// GetAll should append whatever key value pairs it found to the specified 'kvpairs'
error = storeService->GetAll(serviceName_, kvpairs);
if (!error.IsSuccess())
{
TestSession::FailTest("Failed to getAll at service {0}", serviceName_);
}
}
TestSession::WriteNoise(TraceSource, "GetAll at service {0} succeeded", serviceName_);
}
void TestStoreClient::GetKeys(__int64 first, __int64 last, __out vector<__int64> & keys, __out bool & quorumLost)
{
quorumLost = false;
TestSession::WriteNoise(TraceSource, "GetKeys at service {0}", serviceName_);
ErrorCode error;
vector<ITestStoreServiceSPtr> storeServices = GetAllEntries();
for (auto & storeService : storeServices)
{
// GetRange should append whatever key value pairs it found to the specified 'kvpairs'
error = storeService->GetKeys(serviceName_, first, last, keys);
if (!error.IsSuccess())
{
TestSession::FailTest("Failed to getKeys at service {0}", serviceName_);
}
}
TestSession::WriteNoise(TraceSource, "GetKeys at service {0} succeeded", serviceName_);
}
void TestStoreClient::Delete(__int64 key, int keyCount, bool useDefaultNamedClient, __out bool & quorumLost, Common::ErrorCode expectedErrorCode, bool allowAllError)
{
for (auto kk=key; kk<key+keyCount; ++kk)
{
this->Delete(kk, useDefaultNamedClient, quorumLost, expectedErrorCode, allowAllError);
}
}
void TestStoreClient::Delete(__int64 key, bool useDefaultNamedClient, __out bool & quorumLost, Common::ErrorCode expectedErrorCode, bool allowAllError)
{
quorumLost = false;
TestSession::WriteNoise(TraceSource, "Delete at service {0} for key {1}", serviceName_, key);
//TODO: Make timeout value configurable if required
TimeoutHelper timeout(FabricTestSessionConfig::GetConfig().StoreClientTimeout);
ErrorCode error;
bool done = false;
do
{
wstring currentValue;
FABRIC_SEQUENCE_NUMBER currentVersion;
ULONGLONG currentDataLossVersion;
FABRIC_SEQUENCE_NUMBER newVersion = 0;
ULONGLONG dataLossVersion = 0;
wstring partitionId;
{
auto entry = GetCurrentEntry(key, useDefaultNamedClient, currentValue, currentVersion, currentDataLossVersion);
if(entry)
{
auto const & storeService = entry->StoreService;
partitionId = storeService->GetPartitionId();
error = storeService->Delete(key, currentVersion, serviceName_, newVersion, dataLossVersion);
}
else
{
error = ErrorCode(ErrorCodeValue::FabricTestServiceNotOpen);
}
}
bool resolve = false;
if(error.IsSuccess())
{
DeleteEntry(key);
}
else if(error.ReadValue() == ErrorCodeValue::FabricTestVersionDoesNotMatch)
{
TestSession::WriteNoise(TraceSource, "Delete for service {0} at key {1} resulted in error FabricTestVersionDoesNotMatch", serviceName_, key);
TestSession::FailTestIf(newVersion == currentVersion, "Versions cannot match because Delete returned FabricTestVersionDoesNotMatch");
if(newVersion < currentVersion)
{
CheckForDataLoss(key, partitionId, currentDataLossVersion, dataLossVersion);
}
//If newVersion is > then currentVersion that means the entry we have is out of date and
//some other thread updated value before us or that although replication failed (possibly due to a node closing)
//the new primary did receive the operation
UpdateEntry(key);
}
else if (error.ReadValue() != expectedErrorCode.ReadValue())
{
resolve = true;
}
if (resolve)
{
TestSession::WriteNoise(TraceSource, "Delete for service {0} at key {1} resulted in error {2}", serviceName_, key, error.ReadValue());
Guid fuId = GetFUId(key);
if(FABRICSESSION.FabricDispatcher.IsQuorumLostFU(fuId) || FABRICSESSION.FabricDispatcher.IsRebuildLostFU(fuId))
{
TestSession::WriteNoise(TraceSource, "Quorum or Rebuild lost at {0}:{1} for key {2} so skipping operation", serviceName_, fuId, key);
Sleep(RetryWaitMilliSeconds);
quorumLost = true;
return;
}
else
{
//We might have out of date pointer to StoreService. Need to resolve again
ResolveService(key, useDefaultNamedClient, allowAllError);
}
}
done = (error.ReadValue() == expectedErrorCode.ReadValue() || timeout.IsExpired);
if(!done)
{
//Sleep before retrying.
Sleep(RetryWaitMilliSeconds);
}
} while(!done);
if(error.ReadValue() != expectedErrorCode.ReadValue())
{
TestSession::FailTest("Failed to write to key {0} at service {1} because of error {2}, expectedErrorCode {3}", key, serviceName_, error.ReadValue(), expectedErrorCode.ReadValue());
}
TestSession::WriteNoise(TraceSource, "Delete at service {0} for key {1} succeeded with expectedError {2}", serviceName_, key, expectedErrorCode.ReadValue());
}
void TestStoreClient::StartClient()
{
AcquireExclusiveLock lock(clientLock_);
clientActive_ = true;
}
void TestStoreClient::WaitForActiveThreadsToFinish()
{
{
AcquireExclusiveLock lock(clientLock_);
clientActive_ = false;
}
//TODO: Make timeout value confiurable if required
bool result = noActiveThreadsEvent_.WaitOne(TimeSpan::FromSeconds(900));
TestSession::FailTestIfNot(result, "Clients did not finish in time");
TestSession::WriteInfo(TraceSource, "All Client threads for {0} done", serviceName_);
}
void TestStoreClient::DoWork(ULONG threadId, __int64 key, bool doPut)
{
{
AcquireExclusiveLock lock(clientLock_);
if(!clientActive_)
{
return;
}
if(activeThreads_ == 0)
{
noActiveThreadsEvent_.Reset();
}
activeThreads_++;
}
TestSession::WriteNoise(TraceSource, "Client thread {0} for {1} invoked", threadId, serviceName_);
bool useDefaultNamedClient = true;
if(!EntryExists(key) || doPut)
{
bool quorumLost;
wstring data;
if (FabricTestSessionConfig::GetConfig().MinClientPutDataSizeInBytes >= 0)
{
GenerateRandomClientPutData(data);
}
else
{
data = Guid::NewGuid().ToString();
}
Put(key, data, useDefaultNamedClient, quorumLost);
}
else
{
wstring value;
bool keyExists;
bool quorumLost;
Get(key, useDefaultNamedClient, value, keyExists, quorumLost);
}
{
AcquireExclusiveLock lock(clientLock_);
activeThreads_--;
TestSession::FailTestIf(activeThreads_ < 0, "ActiveThreads can never be less than zero");
if(activeThreads_ == 0)
{
noActiveThreadsEvent_.Set();
}
}
}
void TestStoreClient::GenerateRandomClientPutData(__out wstring & data)
{
int minDataSize = FabricTestSessionConfig::GetConfig().MinClientPutDataSizeInBytes;
int maxDataSize = FabricTestSessionConfig::GetConfig().MaxClientPutDataSizeInBytes;
int dataSize = random_.Next(minDataSize, maxDataSize);
data.reserve(dataSize);
for (int i = 0; i < dataSize; ++i)
{
// ASCII alphanumeric chars between 32 and 126
data.push_back((char)((rand() % 94) + 32));
}
}
bool TestStoreClient::EntryExists(__int64 key)
{
AcquireExclusiveLock lock(entryMapLock_);
auto iterator = entryMap_.find(key);
if(iterator == entryMap_.end())
{
return false;
}
if(entryMap_[key]->Version == InitialVersion && entryMap_[key]->Value.compare(InitialValue) == 0)
{
return false;
}
return true;
}
shared_ptr<TestStoreClient::StoreServiceEntry> TestStoreClient::GetCurrentEntry(__int64 key, bool useDefaultNamedClient, __out wstring & value, __out FABRIC_SEQUENCE_NUMBER & version, __out ULONGLONG & dataLossVersion)
{
bool newEntryOrEmptyStoreServiceWPtr = false;
{
AcquireExclusiveLock lock(entryMapLock_);
auto iterator = entryMap_.find(key);
newEntryOrEmptyStoreServiceWPtr = (iterator == entryMap_.end()) || (!entryMap_[key]->StoreService.lock());
}
ITestStoreServiceWPtr storeServiceWPtr;
//Blocking call to resolve should not be under a lock
Guid fuId;
if(newEntryOrEmptyStoreServiceWPtr)
{
fuId = FABRICSESSION.FabricDispatcher.ServiceMap.ResolveFuidForKey(serviceName_, key);
ITestStoreServiceSPtr storeServiceSPtr = FABRICSESSION.FabricDispatcher.ResolveService(serviceName_, key, fuId, useDefaultNamedClient);
if(storeServiceSPtr)
{
storeServiceWPtr = weak_ptr<ITestStoreService>(storeServiceSPtr);
}
}
AcquireExclusiveLock lock(entryMapLock_);
auto iterator = entryMap_.find(key);
if(iterator == entryMap_.end())
{
entryMap_[key] = make_shared<TestClientEntry>(fuId, InitialValue, InitialVersion, move(storeServiceWPtr), InitialDataLossVersion);
}
else if (storeServiceWPtr.lock())
{
// We resolved a new weak pointer so it should be set
entryMap_[key]->StoreService = move(storeServiceWPtr);
}
value = entryMap_[key]->Value;
version = entryMap_[key]->Version;
dataLossVersion = entryMap_[key]->DataLossVersion;
auto storeServiceSPtr = entryMap_[key]->StoreService.lock();
return (storeServiceSPtr ? make_shared<StoreServiceEntry>(move(storeServiceSPtr)) : nullptr);
}
vector<ITestStoreServiceSPtr> TestStoreClient::GetAllEntries()
{
vector<ITestStoreServiceSPtr> result;
set<Guid> guids;
AcquireExclusiveLock lock(entryMapLock_);
for (auto & entry : entryMap_)
{
ITestStoreServiceSPtr temp = entry.second->StoreService.lock();
if (!temp || guids.find(entry.second->Id) != guids.end())
{
continue;
}
result.push_back(temp);
guids.insert(entry.second->Id);
}
return result;
}
Guid TestStoreClient::GetFUId(__int64 key)
{
AcquireExclusiveLock lock(entryMapLock_);
return entryMap_[key]->Id;
}
void TestStoreClient::ResolveService(__int64 key, bool useDefaultNamedClient, bool allowAllError)
{
ITestStoreServiceWPtr storeServiceWPtr = weak_ptr<ITestStoreService>(FABRICSESSION.FabricDispatcher.ResolveService(serviceName_, key, GetFUId(key), useDefaultNamedClient, allowAllError));
AcquireExclusiveLock lock(entryMapLock_);
entryMap_[key]->StoreService = move(storeServiceWPtr);
}
void TestStoreClient::DeleteEntry(__int64 key)
{
ITestStoreServiceSPtr storeServiceSPtr;
{
AcquireExclusiveLock lock(entryMapLock_);
storeServiceSPtr = entryMap_[key]->StoreService.lock();
}
if(storeServiceSPtr)
{
AcquireExclusiveLock lock(entryMapLock_);
entryMap_.erase(key);
}
}
void TestStoreClient::UpdateEntry(__int64 key)
{
FABRIC_SEQUENCE_NUMBER version;
wstring value;
ULONGLONG dataLossVersion;
ITestStoreServiceSPtr storeServiceSPtr;
{
AcquireExclusiveLock lock(entryMapLock_);
storeServiceSPtr = entryMap_[key]->StoreService.lock();
}
if(storeServiceSPtr)
{
ErrorCode error = storeServiceSPtr->Get(key, serviceName_, value, version, dataLossVersion);
AcquireExclusiveLock lock(entryMapLock_);
if(error.IsSuccess())
{
entryMap_[key]->Value = value;
entryMap_[key]->Version = version;
entryMap_[key]->DataLossVersion = dataLossVersion;
}
}
}
void TestStoreClient::UpdateEntry(__int64 key, wstring const& value, FABRIC_SEQUENCE_NUMBER version, ULONGLONG dataLossVersion)
{
AcquireExclusiveLock lock(entryMapLock_);
if(version == entryMap_[key]->Version && dataLossVersion == entryMap_[key]->DataLossVersion)
{
TestSession::FailTestIf(value.compare(entryMap_[key]->Value) != 0, "Value in store at service {0} for key {1} does not match expected {2}, actual {3}",
serviceName_,
key,
entryMap_[key]->Value,
value);
}
else if(version >= entryMap_[key]->Version)
{
entryMap_[key]->Value = value;
entryMap_[key]->Version = version;
entryMap_[key]->DataLossVersion = dataLossVersion;
}
else if(version < entryMap_[key]->Version)
{
//There is a more up to date version in our map
//Dont need to update
}
}
void TestStoreClient::CheckForDataLoss(__int64 key, wstring const& partitionId, ULONGLONG clientDataLossVersion, ULONGLONG serviceDataLossVersion)
{
TestSession::WriteNoise(TraceSource, "CheckForDataLoss called for {0}:{1} for key {2}", serviceName_, partitionId, key);
//serviceDataLossVersion == clientDataLossVersion that means data loss is not expected and we should fail fast here
TestSession::FailTestIf(serviceDataLossVersion == clientDataLossVersion,
"Data loss: Service {0}, key {1} and partition {2}. ClientDataLossVersion {3}, serviceDataLossVersion {4}",
serviceName_, key, partitionId, clientDataLossVersion, serviceDataLossVersion);
//serviceDataLossVersion < clientDataLossVersion: This should not happen so fail.
TestSession::FailTestIf(serviceDataLossVersion < clientDataLossVersion, "Clients DataLossVersion {0} is greater than the version in FailoverUnit {1}", clientDataLossVersion, serviceDataLossVersion);
//Data loss is expected so we updat our entry with the current one at the service
if(entryMap_[key]->DataLossVersion < serviceDataLossVersion)
{
FABRIC_SEQUENCE_NUMBER version;
wstring value;
ULONGLONG dataLossVersion;
ITestStoreServiceSPtr storeServiceSPtr;
{
AcquireExclusiveLock lock(entryMapLock_);
storeServiceSPtr = entryMap_[key]->StoreService.lock();
}
if(storeServiceSPtr)
{
ErrorCode error = storeServiceSPtr->Get(key, serviceName_, value, version, dataLossVersion);
AcquireExclusiveLock lock(entryMapLock_);
if(error.IsSuccess())
{
entryMap_[key]->Value = value;
entryMap_[key]->Version = version;
entryMap_[key]->DataLossVersion = dataLossVersion;
}
else if(error.ReadValue() == ErrorCodeValue::FabricTestKeyDoesNotExist)
{
entryMap_[key]->Value = InitialValue;
entryMap_[key]->Version = InitialVersion;
entryMap_[key]->DataLossVersion = dataLossVersion;
}
else
{
TestSession::WriteInfo(TraceSource, "Get for service {0}, key {1} resulted in error {2} inside of CheckForDataLoss", serviceName_, key, error.ReadValue());
}
}
else
{
TestSession::WriteInfo(TraceSource, "Service pointer null for service {0}, key {1} inside of CheckForDataLoss", serviceName_, key);
}
}
}
|
f9542fd57694ebe1569c789aa091cfafad4da18c
|
94969d4a95340fa62e95c3222e86554050cac030
|
/rush00/Player.hpp
|
e09af86f816300d012bc0417f635d65ed3d3039f
|
[] |
no_license
|
dborysen/pool_c-
|
34c8246dcd8b8bacff78c7329690bcd47fc9bf27
|
f796c79f4c6b430912197df71727f5d6718f02b7
|
refs/heads/master
| 2020-03-19T06:41:26.452028
| 2018-07-02T11:49:49
| 2018-07-02T11:49:49
| 136,045,982
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,108
|
hpp
|
Player.hpp
|
// ************************************************************************** //
// //
// ::: :::::::: //
// Player.hpp :+: :+: :+: //
// +:+ +:+ +:+ //
// By: dborysen <marvin@42.fr> +#+ +:+ +#+ //
// +#+#+#+#+#+ +#+ //
// Created: 2018/06/05 11:55:46 by dborysen #+# #+# //
/* Updated: 2018/06/24 21:06:03 by bcherkas ### ########.fr */
// //
// ************************************************************************** //
#ifndef PLAYER_HPP
# define PLAYER_HPP
# define GAME_SPEED 15000
# define ENEMY_COUNT 100
# define BULLET_NUM 10
# include <iostream>
# include <string>
# include <ncurses.h>
# include <cmath>
# include <cstdlib>
# include <unistd.h>
class Player
{
public:
Player(void);
Player(WINDOW *window, int y, int x, char c, int num);
Player(const Player &other);
~Player();
Player &operator= (const Player &other);
int getPlayer() const;
int getLives() const;
int getAmmo() const;
int getMaxAmmo() const;
int getYPlayer() const;
int getXPlayer() const;
int getYMax() const;
int getXMax() const;
int getScore() const;
char getHero() const;
WINDOW *getWindow() const;
float getPlaytime() const;
void getDamage(int dmg);
void addScore(int score);
void moveUp();
void moveDown();
void moveLeft();
void moveRight();
void changeAmmo(bool i);
void showPlayerPosition() const;
void showPlayerInfo(int frames, int pos);
private:
float _playtime;
int _player;
int _lives;
int _ammo;
int _maxAmmo;
int _yPlayer, _xPlayer;
int _yMax, _xMax;
int _score;
char _hero;
WINDOW *_current_window;
};
#endif
|
366d6eea4a3fa32333df9ca811da591976da3142
|
63ec63120c746c569599f2d4a4a53ce290b76c94
|
/screens/others/menuScreen.cpp
|
b794555da07ad64e0ef29da1be6a6a7832c4aa82
|
[] |
no_license
|
DantElemer/AJADEBA
|
51c67bd1c31dc67b9ad03290623a8c15ed92026d
|
2933b5fb394e3e44eba0a73119fba37c2d154168
|
refs/heads/master
| 2021-01-20T08:30:44.595359
| 2017-05-14T18:23:51
| 2017-05-14T18:23:51
| 90,156,875
| 0
| 1
| null | 2017-05-14T18:23:52
| 2017-05-03T14:15:51
|
C
|
ISO-8859-2
|
C++
| false
| false
| 1,850
|
cpp
|
menuScreen.cpp
|
#include "menuScreen.h"
menuScreen::menuScreen()
{
int buttonWidth=200;
int buttonHeight=80;
int startY=200;
//widgetBase* playButton=new button((vFunctionCall)switchToDifficultySettingScreen, makeCoor(WINDOW_X/2,240),buttonWidth,buttonHeight/*makeCoor((windowX-buttonWidth)/2,200),makeCoor((windowX+buttonWidth)/2,200+buttonHeight)*/,"Play");
//widgetBase* playButton=new button((vFunctionCall)switchToGameScreen, makeCoor(WINDOW_X/2,240),buttonWidth,buttonHeight,"Play");
widgets.push_back(new lButton([](){screen::switchTo=screen::SETTINGS_SCREEN;},makeCoor(WINDOW_X/2,240),buttonWidth,buttonHeight,"Play"));
widgetBase* howToPlayButton=new button((vFunctionCall)subToHowToPlayScreen, makeCoor(WINDOW_X/2,390),buttonWidth,buttonHeight/*makeCoor((windowX-buttonWidth)/2,350),makeCoor((windowX+buttonWidth)/2,350+buttonHeight)*/,"Help");
widgets.push_back(howToPlayButton);
//widgetBase* exitButton=new button((vFunctionCall)exitRequest, makeCoor(WINDOW_X/2,540),buttonWidth,buttonHeight/*makeCoor((windowX-buttonWidth)/2,500),makeCoor((windowX+buttonWidth)/2,500+buttonHeight)*/,"Exit");
//widgets.push_back(exitButton);
widgets.push_back(new lButton([](){switchTo=screen::MAP_EDITOR;}, makeCoor(WINDOW_X/2,540),buttonWidth,buttonHeight,"Editor"));
draw();
}
void menuScreen::draw()
{
clearScreen();
drawFatLine(makeCoor(560,20), makeCoor(550,40),4); //ékezet...
addTitle("AJADEBA");
mWriteText(WINDOW_ORIGO-makeCoor(0,150),"(A Jatek, Amit Domonkos Es Balazs Alkotott)",12);
//ékezetek -_-
drawLine(makeCoor(405,143),makeCoor(404,145));
drawLine(makeCoor(415,143),makeCoor(414,145));
drawLine(makeCoor(521,140),makeCoor(520,142));
drawLine(makeCoor(555,143),makeCoor(554,145));
screen::draw();
}
void menuScreen::onTick()
{
screen::onTick();
}
|
8d9b38f328dead8838bae1176f0aebed742b8492
|
470fae08316b55246ab01675ac5013febfb13eee
|
/src/server/game/Miscellaneous/SharedDefines.h
|
13957cb8194dc2a5857b3627a6a561e7db51d668
|
[] |
no_license
|
adde13372/shadowcore
|
8db6fb6ccc99821e6bd40237a0c284ce7cf543c2
|
aa87944193ce02f6e99f7b35eceac5023abfca1b
|
refs/heads/main
| 2023-04-01T07:38:39.359558
| 2021-04-03T07:54:17
| 2021-04-03T07:54:17
| 354,320,611
| 4
| 8
| null | 2021-04-03T15:02:49
| 2021-04-03T15:02:49
| null |
UTF-8
|
C++
| false
| false
| 470,040
|
h
|
SharedDefines.h
|
/*
* Copyright 2021 ShadowCore
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITY_SHAREDDEFINES_H
#define TRINITY_SHAREDDEFINES_H
#include "DBCEnums.h"
#include "Define.h"
#include "DetourNavMesh.h"
enum SpellEffIndex : uint8
{
EFFECT_0 = 0,
EFFECT_1 = 1,
EFFECT_2 = 2,
EFFECT_3 = 3,
EFFECT_4 = 4,
EFFECT_5 = 5,
EFFECT_6 = 6,
EFFECT_7 = 7,
EFFECT_8 = 8,
EFFECT_9 = 9,
EFFECT_10 = 10,
EFFECT_11 = 11,
EFFECT_12 = 12,
EFFECT_13 = 13,
EFFECT_14 = 14,
EFFECT_15 = 15,
EFFECT_16 = 16,
EFFECT_17 = 17,
EFFECT_18 = 18,
EFFECT_19 = 19,
EFFECT_20 = 20,
EFFECT_21 = 21,
EFFECT_22 = 22,
EFFECT_23 = 23,
EFFECT_24 = 24,
EFFECT_25 = 25,
EFFECT_26 = 26,
EFFECT_27 = 27,
EFFECT_28 = 28,
EFFECT_29 = 29,
EFFECT_30 = 30,
EFFECT_31 = 31
};
// used in script definitions
#define EFFECT_FIRST_FOUND 282
#define EFFECT_ALL 283
enum Roles
{
ROLE_TANK = 0,
ROLE_HEALER = 1,
ROLE_DAMAGE = 2
};
// loot modes for creatures and gameobjects, bitmask!
enum LootModes
{
LOOT_MODE_DEFAULT = 1,
LOOT_MODE_HEROIC = 2, //LOOT_MODE_HARD_MODE_1
LOOT_MODE_10_N = 3,
LOOT_MODE_25_N = 4, //LOOT_MODE_HARD_MODE_2
LOOT_MODE_10_HC = 5,
LOOT_MODE_25_HC = 6,
LOOT_MODE_LFR = 7,
LOOT_MODE_MYTHIC_KEYSTONE = 8, //LOOT_MODE_HARD_MODE_3
LOOT_MODE_40 = 9,
LOOT_MODE_3_MAN_SCENARIO_HC = 11,
LOOT_MODE_3_MAN_SCENARIO_N = 12,
LOOT_MODE_NORMAL_RAID = 14,
LOOT_MODE_HEROIC_RAID = 15,
LOOT_MODE_MYTHIC_RAID = 16, //LOOT_MODE_HARD_MODE_4
LOOT_MODE_LFR_NEW = 17,
LOOT_MODE_EVENT_RAID = 18,
LOOT_MODE_EVENT_DUNGEON = 19,
LOOT_MODE_EVENT_SCENARIO = 20,
LOOT_MODE_MYTHIC_DUNGEON = 23,
LOOT_MODE_TIMEWALKING = 24,
LOOT_MODE_WORLD_PVP_SCENARIO = 25,
LOOT_MODE_5_MAN_SCENARIO_N = 26,
LOOT_MODE_20_MAN_SCENARIO_N = 27,
LOOT_MODE_PVEVP_SCENARIO = 29,
LOOT_MODE_EVENT_SCENARIO_6 = 30,
LOOT_MODE_WORLD_PVP_SCENARIO_2 = 32,
LOOT_MODE_TIMEWALKING_RAID = 33,
LOOT_MODE_PVP = 34,
LOOT_MODE_NORMAL_ISLAND = 38,
LOOT_MODE_HEROIC_ISLAND = 39,
LOOT_MODE_MYTHIC_ISLAND = 40,
LOOT_MODE_PVP_ISLAND = 45,
LOOT_MODE_NORMAL_WARFRONT = 147,
LOOT_MODE_HEROIC_WARFRONT = 149,
LOOT_MODE_LFR_15TH_ANNIVERSARY = 151,
LOOT_MODE_VISIONS_OF_NZOTH = 152,
LOOT_MODE_TEEMING_ISLAND = 153,
LOOT_MODE_JUNK_FISH = 0x8000,
};
#define MAX_CHARACTERS_PER_REALM 200
enum Expansions
{
EXPANSION_LEVEL_CURRENT = -1,
EXPANSION_CLASSIC = 0,
EXPANSION_THE_BURNING_CRUSADE = 1,
EXPANSION_WRATH_OF_THE_LICH_KING = 2,
EXPANSION_CATACLYSM = 3,
EXPANSION_MISTS_OF_PANDARIA = 4,
EXPANSION_WARLORDS_OF_DRAENOR = 5,
EXPANSION_LEGION = 6,
EXPANSION_BATTLE_FOR_AZEROTH = 7,
EXPANSION_SHADOWLANDS = 8,
MAX_EXPANSIONS,
MAX_ACCOUNT_EXPANSIONS
};
#define CURRENT_EXPANSION EXPANSION_SHADOWLANDS
constexpr uint32 GetMaxLevelForExpansion(uint32 expansion)
{
switch (expansion)
{
case EXPANSION_CLASSIC:
return 30;
case EXPANSION_THE_BURNING_CRUSADE:
return 30;
case EXPANSION_WRATH_OF_THE_LICH_KING:
return 30;
case EXPANSION_CATACLYSM:
return 35;
case EXPANSION_MISTS_OF_PANDARIA:
return 35;
case EXPANSION_WARLORDS_OF_DRAENOR:
return 40;
case EXPANSION_LEGION:
return 45;
case EXPANSION_BATTLE_FOR_AZEROTH:
return 50;
case EXPANSION_SHADOWLANDS:
return 60;
default:
break;
}
return 0;
}
enum Gender
{
GENDER_UNKNOWN = -1,
GENDER_MALE = 0,
GENDER_FEMALE = 1,
GENDER_NONE = 2
};
// Class value is index in ChrClasses.dbc (9.0.2)
enum Classes : uint8
{
CLASS_NONE = 0,
CLASS_WARRIOR = 1,
CLASS_PALADIN = 2,
CLASS_HUNTER = 3,
CLASS_ROGUE = 4,
CLASS_PRIEST = 5,
CLASS_DEATH_KNIGHT = 6,
CLASS_SHAMAN = 7,
CLASS_MAGE = 8,
CLASS_WARLOCK = 9,
CLASS_MONK = 10,
CLASS_DRUID = 11,
CLASS_DEMON_HUNTER = 12
};
// max1 for player class
#define MAX_CLASSES 13
#define CLASSMASK_ALL_PLAYABLE \
((1<<(CLASS_WARRIOR-1)) | \
(1<<(CLASS_PALADIN-1)) | \
(1<<(CLASS_HUNTER-1)) | \
(1<<(CLASS_ROGUE-1)) | \
(1<<(CLASS_PRIEST-1)) | \
(1<<(CLASS_DEATH_KNIGHT-1)) | \
(1<<(CLASS_SHAMAN-1)) | \
(1<<(CLASS_MAGE-1)) | \
(1<<(CLASS_WARLOCK-1)) | \
(1<<(CLASS_MONK-1)) | \
(1<<(CLASS_DRUID-1)) | \
(1<<(CLASS_DEMON_HUNTER-1)))
// valid classes for creature_template.unit_class
enum UnitClass
{
UNIT_CLASS_WARRIOR = 1,
UNIT_CLASS_PALADIN = 2,
UNIT_CLASS_ROGUE = 4,
UNIT_CLASS_MAGE = 8
};
#define CLASSMASK_ALL_CREATURES ((1<<(UNIT_CLASS_WARRIOR-1)) | (1<<(UNIT_CLASS_PALADIN-1)) | (1<<(UNIT_CLASS_ROGUE-1)) | (1<<(UNIT_CLASS_MAGE-1)))
#define CLASSMASK_WAND_USERS ((1<<(CLASS_PRIEST-1)) | (1<<(CLASS_MAGE-1)) | (1<<(CLASS_WARLOCK-1)))
#define PLAYER_MAX_BATTLEGROUND_QUEUES 2
enum ReputationRank
{
REP_HATED = 0,
REP_HOSTILE = 1,
REP_UNFRIENDLY = 2,
REP_NEUTRAL = 3,
REP_FRIENDLY = 4,
REP_HONORED = 5,
REP_REVERED = 6,
REP_EXALTED = 7
};
#define MIN_REPUTATION_RANK (REP_HATED)
#define MAX_REPUTATION_RANK 8
#define MAX_SPILLOVER_FACTIONS 5
enum MoneyConstants
{
COPPER = 1,
SILVER = COPPER*100,
GOLD = SILVER*100
};
enum Stats : uint16
{
STAT_STRENGTH = 0,
STAT_AGILITY = 1,
STAT_STAMINA = 2,
STAT_INTELLECT = 3,
};
#define MAX_STATS 4
enum Powers : int8
{
POWER_MANA = 0,
POWER_RAGE = 1,
POWER_FOCUS = 2,
POWER_ENERGY = 3,
POWER_COMBO_POINTS = 4,
POWER_RUNES = 5,
POWER_RUNIC_POWER = 6,
POWER_SOUL_SHARDS = 7,
POWER_LUNAR_POWER = 8,
POWER_HOLY_POWER = 9,
POWER_ALTERNATE_POWER = 10, // Used in some quests
POWER_MAELSTROM = 11,
POWER_CHI = 12,
POWER_INSANITY = 13,
POWER_BURNING_EMBERS = 14,
POWER_DEMONIC_FURY = 15,
POWER_ARCANE_CHARGES = 16,
POWER_FURY = 17,
POWER_PAIN = 18,
MAX_POWERS = 19,
POWER_ALL = 127, // default for class?
POWER_HEALTH = -2 // (-2 as signed value)
};
#define MAX_POWERS_PER_CLASS 6
enum PowerColorOverrides
{
AURA_OVERRIDE_POWER_COLOR_GREEN = 306944,
AURA_OVERRIDE_POWER_COLOR_PURPLE = 301659,
AURA_OVERRIDE_POWER_COLOR_PINK = 290273,
AURA_OVERRIDE_POWER_COLOR_LIGHT_BLUE = 292658,
AURA_OVERRIDE_POWER_COLOR_OCEAN = 241486, //darker than light blue
AURA_OVERRIDE_POWER_COLOR_ORANGE = 315294,
AURA_OVERRIDE_POWER_COLOR_PURPLE2 = 245029,
AURA_OVERRIDE_POWER_COLOR_RAGE = 299970,
AURA_OVERRIDE_POWER_COLOR_DEMONIC = 301660,
AURA_OVERRIDE_POWER_COLOR_ENTROPIC = 306945, //very dark blue
AURA_OVERRIDE_POWER_COLOR_BROWN = 272627
};
enum Currencies
{
CURRENCY_TITAN_RESIDUUM = 1718,
CURRENCY_AZERITE = 1553,
CURRENCY_ECHOES_OF_NYALOTHA = 1803,
};
enum Pathfinder
{
SPELL_DRAENOR_PATHFINDER = 191645,
SPELL_BROKEN_ISLES_PATHFINDER = 233368,
SPELL_BATTLE_FOR_AZEROTH_PATHFINDER = 278833,
};
enum SpellSchools : uint16
{
SPELL_SCHOOL_NORMAL = 0,
SPELL_SCHOOL_HOLY = 1,
SPELL_SCHOOL_FIRE = 2,
SPELL_SCHOOL_NATURE = 3,
SPELL_SCHOOL_FROST = 4,
SPELL_SCHOOL_SHADOW = 5,
SPELL_SCHOOL_ARCANE = 6
};
#define MAX_SPELL_SCHOOL 7
enum SpellSchoolMask : uint16
{
SPELL_SCHOOL_MASK_NONE = 0x00, // not exist
SPELL_SCHOOL_MASK_NORMAL = (1 << SPELL_SCHOOL_NORMAL), // PHYSICAL (Armor)
SPELL_SCHOOL_MASK_HOLY = (1 << SPELL_SCHOOL_HOLY),
SPELL_SCHOOL_MASK_FIRE = (1 << SPELL_SCHOOL_FIRE),
SPELL_SCHOOL_MASK_NATURE = (1 << SPELL_SCHOOL_NATURE),
SPELL_SCHOOL_MASK_FROST = (1 << SPELL_SCHOOL_FROST),
SPELL_SCHOOL_MASK_SHADOW = (1 << SPELL_SCHOOL_SHADOW),
SPELL_SCHOOL_MASK_ARCANE = (1 << SPELL_SCHOOL_ARCANE),
// unions
// 124, not include normal and holy damage
SPELL_SCHOOL_MASK_SPELL = (SPELL_SCHOOL_MASK_FIRE |
SPELL_SCHOOL_MASK_NATURE | SPELL_SCHOOL_MASK_FROST |
SPELL_SCHOOL_MASK_SHADOW | SPELL_SCHOOL_MASK_ARCANE),
// 126
SPELL_SCHOOL_MASK_MAGIC = (SPELL_SCHOOL_MASK_HOLY | SPELL_SCHOOL_MASK_SPELL),
// 127
SPELL_SCHOOL_MASK_ALL = (SPELL_SCHOOL_MASK_NORMAL | SPELL_SCHOOL_MASK_MAGIC)
};
inline SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask)
{
for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
if (mask & (1 << i))
return SpellSchools(i);
return SPELL_SCHOOL_NORMAL;
}
enum ItemQualities
{
ITEM_QUALITY_POOR = 0, // GREY
ITEM_QUALITY_NORMAL = 1, // WHITE
ITEM_QUALITY_UNCOMMON = 2, // GREEN
ITEM_QUALITY_RARE = 3, // BLUE
ITEM_QUALITY_EPIC = 4, // PURPLE
ITEM_QUALITY_LEGENDARY = 5, // ORANGE
ITEM_QUALITY_ARTIFACT = 6, // LIGHT YELLOW
ITEM_QUALITY_HEIRLOOM = 7, // LIGHT BLUE
ITEM_QUALITY_WOW_TOKEN = 8 // LIGHT BLUE
};
#define MAX_ITEM_QUALITY 9
enum SpellCategory
{
SPELL_CATEGORY_FOOD = 11,
SPELL_CATEGORY_DRINK = 59
};
enum WorgenRacialSpells
{
SPELL_RUNNING_WILD_LEARN = 94098,
SPELL_TWO_FORMS_RACIAL = 68996,
SPELL_ALTERED_FORM_RACIAL = 97709
};
const uint32 ItemQualityColors[MAX_ITEM_QUALITY] =
{
0xff9d9d9d, // GREY
0xffffffff, // WHITE
0xff1eff00, // GREEN
0xff0070dd, // BLUE
0xffa335ee, // PURPLE
0xffff8000, // ORANGE
0xffe6cc80, // LIGHT YELLOW
0xff00ccff, // LIGHT BLUE
0xff00ccff // LIGHT BLUE
};
// ***********************************
// Spell Attributes definitions
// ***********************************
enum SpellAttr0
{
SPELL_ATTR0_UNK0 = 0x00000001, // 0
SPELL_ATTR0_REQ_AMMO = 0x00000002, // 1 on next ranged
SPELL_ATTR0_ON_NEXT_SWING = 0x00000004, // 2
SPELL_ATTR0_IS_REPLENISHMENT = 0x00000008, // 3 not set in 3.0.3
SPELL_ATTR0_ABILITY = 0x00000010, // 4 client puts 'ability' instead of 'spell' in game strings for these spells
SPELL_ATTR0_TRADESPELL = 0x00000020, // 5 trade spells (recipes), will be added by client to a sublist of profession spell
SPELL_ATTR0_PASSIVE = 0x00000040, // 6 Passive spell
SPELL_ATTR0_HIDDEN_CLIENTSIDE = 0x00000080, // 7 Spells with this attribute are not visible in spellbook or aura bar
SPELL_ATTR0_HIDE_IN_COMBAT_LOG = 0x00000100, // 8 This attribite controls whether spell appears in combat logs
SPELL_ATTR0_TARGET_MAINHAND_ITEM = 0x00000200, // 9 Client automatically selects item from mainhand slot as a cast target
SPELL_ATTR0_ON_NEXT_SWING_2 = 0x00000400, // 10
SPELL_ATTR0_UNK11 = 0x00000800, // 11
SPELL_ATTR0_DAYTIME_ONLY = 0x00001000, // 12 only useable at daytime, not set in 2.4.2
SPELL_ATTR0_NIGHT_ONLY = 0x00002000, // 13 only useable at night, not set in 2.4.2
SPELL_ATTR0_INDOORS_ONLY = 0x00004000, // 14 only useable indoors, not set in 2.4.2
SPELL_ATTR0_OUTDOORS_ONLY = 0x00008000, // 15 Only useable outdoors.
SPELL_ATTR0_NOT_SHAPESHIFT = 0x00010000, // 16 Not while shapeshifted
SPELL_ATTR0_ONLY_STEALTHED = 0x00020000, // 17 Must be in stealth
SPELL_ATTR0_DONT_AFFECT_SHEATH_STATE = 0x00040000, // 18 client won't hide unit weapons in sheath on cast/channel
SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION = 0x00080000, // 19 spelldamage depends on caster level
SPELL_ATTR0_STOP_ATTACK_TARGET = 0x00100000, // 20 Stop attack after use this spell (and not begin attack if use)
SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK = 0x00200000, // 21 Cannot be dodged/parried/blocked
SPELL_ATTR0_CAST_TRACK_TARGET = 0x00400000, // 22 Client automatically forces player to face target when casting
SPELL_ATTR0_CASTABLE_WHILE_DEAD = 0x00800000, // 23 castable while dead?
SPELL_ATTR0_CASTABLE_WHILE_MOUNTED = 0x01000000, // 24 castable while mounted
SPELL_ATTR0_DISABLED_WHILE_ACTIVE = 0x02000000, // 25 Activate and start cooldown after aura fade or remove summoned creature or go
SPELL_ATTR0_NEGATIVE_1 = 0x04000000, // 26 Many negative spells have this attr
SPELL_ATTR0_CASTABLE_WHILE_SITTING = 0x08000000, // 27 castable while sitting
SPELL_ATTR0_CANT_USED_IN_COMBAT = 0x10000000, // 28 Cannot be used in combat
SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY = 0x20000000, // 29 unaffected by invulnerability (hmm possible not...)
SPELL_ATTR0_HEARTBEAT_RESIST_CHECK = 0x40000000, // 30 random chance the effect will end TODO: implement core support
SPELL_ATTR0_CANT_CANCEL = 0x80000000 // 31 positive aura can't be canceled
};
enum SpellAttr1
{
SPELL_ATTR1_DISMISS_PET = 0x00000001, // 0 for spells without this flag client doesn't allow to summon pet if caster has a pet
SPELL_ATTR1_DRAIN_ALL_POWER = 0x00000002, // 1 use all power (Only paladin Lay of Hands and Bunyanize)
SPELL_ATTR1_CHANNELED_1 = 0x00000004, // 2 clientside checked? cancelable?
SPELL_ATTR1_CANT_BE_REDIRECTED = 0x00000008, // 3
SPELL_ATTR1_UNK4 = 0x00000010, // 4 stealth and whirlwind
SPELL_ATTR1_NOT_BREAK_STEALTH = 0x00000020, // 5 Not break stealth
SPELL_ATTR1_CHANNELED_2 = 0x00000040, // 6
SPELL_ATTR1_CANT_BE_REFLECTED = 0x00000080, // 7
SPELL_ATTR1_CANT_TARGET_IN_COMBAT = 0x00000100, // 8 can target only out of combat units
SPELL_ATTR1_MELEE_COMBAT_START = 0x00000200, // 9 player starts melee combat after this spell is cast
SPELL_ATTR1_NO_THREAT = 0x00000400, // 10 no generates threat on cast 100% (old NO_INITIAL_AGGRO)
SPELL_ATTR1_DONT_REFRESH_DURATION_ON_RECAST = 0x00000800, // 11 aura will not refresh its duration when recast
SPELL_ATTR1_IS_PICKPOCKET = 0x00001000, // 12 Pickpocket
SPELL_ATTR1_FARSIGHT = 0x00002000, // 13 Client removes farsight on aura loss
SPELL_ATTR1_CHANNEL_TRACK_TARGET = 0x00004000, // 14 Client automatically forces player to face target when channeling
SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY = 0x00008000, // 15 remove auras on immunity
SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE = 0x00010000, // 16 on immuniy
SPELL_ATTR1_UNAUTOCASTABLE_BY_PET = 0x00020000, // 17
SPELL_ATTR1_UNK18 = 0x00040000, // 18 stun, polymorph, daze, hex
SPELL_ATTR1_CANT_TARGET_SELF = 0x00080000, // 19
SPELL_ATTR1_REQ_COMBO_POINTS1 = 0x00100000, // 20 Req combo points on target
SPELL_ATTR1_UNK21 = 0x00200000, // 21
SPELL_ATTR1_REQ_COMBO_POINTS2 = 0x00400000, // 22 Req combo points on target
SPELL_ATTR1_UNK23 = 0x00800000, // 23
SPELL_ATTR1_IS_FISHING = 0x01000000, // 24 only fishing spells
SPELL_ATTR1_UNK25 = 0x02000000, // 25
SPELL_ATTR1_UNK26 = 0x04000000, // 26 works correctly with [target=focus] and [target=mouseover] macros?
SPELL_ATTR1_UNK27 = 0x08000000, // 27 melee spell?
SPELL_ATTR1_DONT_DISPLAY_IN_AURA_BAR = 0x10000000, // 28 client doesn't display these spells in aura bar
SPELL_ATTR1_CHANNEL_DISPLAY_SPELL_NAME = 0x20000000, // 29 spell name is displayed in cast bar instead of 'channeling' text
SPELL_ATTR1_ENABLE_AT_DODGE = 0x40000000, // 30 Overpower
SPELL_ATTR1_UNK31 = 0x80000000 // 31
};
enum SpellAttr2
{
SPELL_ATTR2_CAN_TARGET_DEAD = 0x00000001, // 0 can target dead unit or corpse
SPELL_ATTR2_UNK1 = 0x00000002, // 1 vanish, shadowform, Ghost Wolf and other
SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS = 0x00000004, // 2 26368 4.0.1 dbc change
SPELL_ATTR2_UNK3 = 0x00000008, // 3
SPELL_ATTR2_DISPLAY_IN_STANCE_BAR = 0x00000010, // 4 client displays icon in stance bar when learned, even if not shapeshift
SPELL_ATTR2_AUTOREPEAT_FLAG = 0x00000020, // 5
SPELL_ATTR2_CANT_TARGET_TAPPED = 0x00000040, // 6 target must be tapped by caster
SPELL_ATTR2_UNK7 = 0x00000080, // 7
SPELL_ATTR2_UNK8 = 0x00000100, // 8 not set in 3.0.3
SPELL_ATTR2_UNK9 = 0x00000200, // 9
SPELL_ATTR2_UNK10 = 0x00000400, // 10 related to tame
SPELL_ATTR2_HEALTH_FUNNEL = 0x00000800, // 11
SPELL_ATTR2_UNK12 = 0x00001000, // 12 Cleave, Heart Strike, Maul, Sunder Armor, Swipe
SPELL_ATTR2_PRESERVE_ENCHANT_IN_ARENA = 0x00002000, // 13 Items enchanted by spells with this flag preserve the enchant to arenas
SPELL_ATTR2_UNK14 = 0x00004000, // 14
SPELL_ATTR2_UNK15 = 0x00008000, // 15 not set in 3.0.3
SPELL_ATTR2_TAME_BEAST = 0x00010000, // 16
SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS = 0x00020000, // 17 don't reset timers for melee autoattacks (swings) or ranged autoattacks (autoshoots)
SPELL_ATTR2_REQ_DEAD_PET = 0x00040000, // 18 Only Revive pet and Heart of the Pheonix
SPELL_ATTR2_NOT_NEED_SHAPESHIFT = 0x00080000, // 19 does not necessarly need shapeshift
SPELL_ATTR2_UNK20 = 0x00100000, // 20
SPELL_ATTR2_DAMAGE_REDUCED_SHIELD = 0x00200000, // 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure!
SPELL_ATTR2_UNK22 = 0x00400000, // 22 Ambush, Backstab, Cheap Shot, Death Grip, Garrote, Judgements, Mutilate, Pounce, Ravage, Shiv, Shred
SPELL_ATTR2_IS_ARCANE_CONCENTRATION = 0x00800000, // 23 Only mage Arcane Concentration have this flag
SPELL_ATTR2_UNK24 = 0x01000000, // 24
SPELL_ATTR2_UNK25 = 0x02000000, // 25
SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE = 0x04000000, // 26 unaffected by school immunity
SPELL_ATTR2_UNK27 = 0x08000000, // 27
SPELL_ATTR2_IGNORE_ITEM_CHECK = 0x10000000, // 28 Spell is cast without checking item requirements (charges/reagents/totem)
SPELL_ATTR2_CANT_CRIT = 0x20000000, // 29 Spell can't crit
SPELL_ATTR2_TRIGGERED_CAN_TRIGGER_PROC = 0x40000000, // 30 spell can trigger even if triggered
SPELL_ATTR2_FOOD_BUFF = 0x80000000 // 31 Food or Drink Buff (like Well Fed)
};
enum SpellAttr3
{
SPELL_ATTR3_UNK0 = 0x00000001, // 0
SPELL_ATTR3_UNK1 = 0x00000002, // 1
SPELL_ATTR3_UNK2 = 0x00000004, // 2
SPELL_ATTR3_BLOCKABLE_SPELL = 0x00000008, // 3 Only dmg class melee in 3.1.3
SPELL_ATTR3_IGNORE_RESURRECTION_TIMER = 0x00000010, // 4 you don't have to wait to be resurrected with these spells
SPELL_ATTR3_UNK5 = 0x00000020, // 5
SPELL_ATTR3_UNK6 = 0x00000040, // 6
SPELL_ATTR3_STACK_FOR_DIFF_CASTERS = 0x00000080, // 7 separate stack for every caster
SPELL_ATTR3_ONLY_TARGET_PLAYERS = 0x00000100, // 8 can only target players
SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_PROC_2 = 0x00000200, // 9 triggered from effect?
SPELL_ATTR3_MAIN_HAND = 0x00000400, // 10 Main hand weapon required
SPELL_ATTR3_BATTLEGROUND = 0x00000800, // 11 Can only be cast in battleground
SPELL_ATTR3_ONLY_TARGET_GHOSTS = 0x00001000, // 12
SPELL_ATTR3_DONT_DISPLAY_CHANNEL_BAR = 0x00002000, // 13 Clientside attribute - will not display channeling bar
SPELL_ATTR3_IS_HONORLESS_TARGET = 0x00004000, // 14 "Honorless Target" only this spells have this flag
SPELL_ATTR3_UNK15 = 0x00008000, // 15 Auto Shoot, Shoot, Throw, - this is autoshot flag
SPELL_ATTR3_CANT_TRIGGER_PROC = 0x00010000, // 16 confirmed with many patchnotes
SPELL_ATTR3_NO_INITIAL_AGGRO = 0x00020000, // 17 Soothe Animal, 39758, Mind Soothe
SPELL_ATTR3_IGNORE_HIT_RESULT = 0x00040000, // 18 Spell should always hit its target
SPELL_ATTR3_DISABLE_PROC = 0x00080000, // 19 during aura proc no spells can trigger (20178, 20375)
SPELL_ATTR3_DEATH_PERSISTENT = 0x00100000, // 20 Death persistent spells
SPELL_ATTR3_UNK21 = 0x00200000, // 21 unused
SPELL_ATTR3_REQ_WAND = 0x00400000, // 22 Req wand
SPELL_ATTR3_UNK23 = 0x00800000, // 23
SPELL_ATTR3_REQ_OFFHAND = 0x01000000, // 24 Req offhand weapon
SPELL_ATTR3_TREAT_AS_PERIODIC = 0x02000000, // 25 Makes the spell appear as periodic in client combat logs - used by spells that trigger another spell on each tick
SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED = 0x04000000, // 26 auras with this attribute can proc from triggered spell casts with SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_PROC_2 (67736 52999)
SPELL_ATTR3_DRAIN_SOUL = 0x08000000, // 27 only drain soul has this flag
SPELL_ATTR3_UNK28 = 0x10000000, // 28
SPELL_ATTR3_NO_DONE_BONUS = 0x20000000, // 29 Ignore caster spellpower and done damage mods? client doesn't apply spellmods for those spells
SPELL_ATTR3_DONT_DISPLAY_RANGE = 0x40000000, // 30 client doesn't display range in tooltip for those spells
SPELL_ATTR3_UNK31 = 0x80000000 // 31
};
enum SpellAttr4
{
SPELL_ATTR4_IGNORE_RESISTANCES = 0x00000001, // 0 spells with this attribute will completely ignore the target's resistance (these spells can't be resisted)
SPELL_ATTR4_PROC_ONLY_ON_CASTER = 0x00000002, // 1 proc only on effects with TARGET_UNIT_CASTER?
SPELL_ATTR4_UNK2 = 0x00000004, // 2
SPELL_ATTR4_UNK3 = 0x00000008, // 3
SPELL_ATTR4_UNK4 = 0x00000010, // 4 This will no longer cause guards to attack on use??
SPELL_ATTR4_UNK5 = 0x00000020, // 5
SPELL_ATTR4_NOT_STEALABLE = 0x00000040, // 6 although such auras might be dispellable, they cannot be stolen
SPELL_ATTR4_CAN_CAST_WHILE_CASTING = 0x00000080, // 7 Can be cast while another cast is in progress - see CanCastWhileCasting(SpellRec const*,CGUnit_C *,int &)
SPELL_ATTR4_FIXED_DAMAGE = 0x00000100, // 8 Ignores resilience and any (except mechanic related) damage or % damage taken auras on target.
SPELL_ATTR4_TRIGGER_ACTIVATE = 0x00000200, // 9 initially disabled / trigger activate from event (Execute, Riposte, Deep Freeze end other)
SPELL_ATTR4_SPELL_VS_EXTEND_COST = 0x00000400, // 10 Rogue Shiv have this flag
SPELL_ATTR4_UNK11 = 0x00000800, // 11
SPELL_ATTR4_UNK12 = 0x00001000, // 12
SPELL_ATTR4_COMBAT_LOG_NO_CASTER = 0x00002000, // 13 No caster object is sent to client combat log
SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS = 0x00004000, // 14 doesn't break auras by damage from these spells
SPELL_ATTR4_UNK15 = 0x00008000, // 15
SPELL_ATTR4_NOT_USABLE_IN_ARENA_OR_RATED_BG = 0x00010000, // 16 Cannot be used in both Arenas or Rated Battlegrounds
SPELL_ATTR4_USABLE_IN_ARENA = 0x00020000, // 17
SPELL_ATTR4_AREA_TARGET_CHAIN = 0x00040000, // 18 (NYI)hits area targets one after another instead of all at once
SPELL_ATTR4_UNK19 = 0x00080000, // 19 proc dalayed, after damage or don't proc on absorb?
SPELL_ATTR4_NOT_CHECK_SELFCAST_POWER = 0x00100000, // 20 supersedes message "More powerful spell applied" for self casts.
SPELL_ATTR4_DONT_REMOVE_IN_ARENA = 0x00200000, // 21 Pally aura, dk presence, dudu form, warrior stance, shadowform, hunter track
SPELL_ATTR4_UNK22 = 0x00400000, // 22 Seal of Command (42058, 57770) and Gymer's Smash 55426
SPELL_ATTR4_UNK23 = 0x00800000, // 23
SPELL_ATTR4_UNK24 = 0x01000000, // 24 some shoot spell
SPELL_ATTR4_IS_PET_SCALING = 0x02000000, // 25 pet scaling auras
SPELL_ATTR4_CAST_ONLY_IN_OUTLAND = 0x04000000, // 26 Can only be used in Outland.
SPELL_ATTR4_UNK27 = 0x08000000, // 27
SPELL_ATTR4_UNK28 = 0x10000000, // 28 Aimed Shot
SPELL_ATTR4_UNK29 = 0x20000000, // 29
SPELL_ATTR4_UNK30 = 0x40000000, // 30
SPELL_ATTR4_UNK31 = 0x80000000 // 31 Polymorph (chicken) 228 and Sonic Boom (38052, 38488)
};
enum SpellAttr5
{
SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING = 0x00000001, // 0 available casting channel spell when moving
SPELL_ATTR5_NO_REAGENT_WHILE_PREP = 0x00000002, // 1 not need reagents if UNIT_FLAG_PREPARATION
SPELL_ATTR5_UNK2 = 0x00000004, // 2
SPELL_ATTR5_USABLE_WHILE_STUNNED = 0x00000008, // 3 usable while stunned
SPELL_ATTR5_UNK4 = 0x00000010, // 4
SPELL_ATTR5_SINGLE_TARGET_SPELL = 0x00000020, // 5 Only one target can be apply at a time
SPELL_ATTR5_UNK6 = 0x00000040, // 6
SPELL_ATTR5_UNK7 = 0x00000080, // 7
SPELL_ATTR5_CANT_TARGET_PLAYER_CONTROLLED = 0x00000100, // 8 cannot target player controlled units but can target players
SPELL_ATTR5_START_PERIODIC_AT_APPLY = 0x00000200, // 9 begin periodic tick at aura apply
SPELL_ATTR5_HIDE_DURATION = 0x00000400, // 10 do not send duration to client
SPELL_ATTR5_ALLOW_TARGET_OF_TARGET_AS_TARGET = 0x00000800, // 11 (NYI) uses target's target as target if original target not valid (intervene for example)
SPELL_ATTR5_UNK12 = 0x00001000, // 12 Cleave related?
SPELL_ATTR5_HASTE_AFFECT_DURATION = 0x00002000, // 13 haste effects decrease duration of this
SPELL_ATTR5_NOT_USABLE_WHILE_CHARMED = 0x00004000, // 14 Charmed units cannot cast this spell
SPELL_ATTR5_UNK15 = 0x00008000, // 15 Inflits on multiple targets?
SPELL_ATTR5_UNK16 = 0x00010000, // 16
SPELL_ATTR5_USABLE_WHILE_FEARED = 0x00020000, // 17 usable while feared
SPELL_ATTR5_USABLE_WHILE_CONFUSED = 0x00040000, // 18 usable while confused
SPELL_ATTR5_DONT_TURN_DURING_CAST = 0x00080000, // 19 Blocks caster's turning when casting (client does not automatically turn caster's model to face UNIT_FIELD_TARGET)
SPELL_ATTR5_UNK20 = 0x00100000, // 20
SPELL_ATTR5_UNK21 = 0x00200000, // 21
SPELL_ATTR5_UNK22 = 0x00400000, // 22
SPELL_ATTR5_UNK23 = 0x00800000, // 23
SPELL_ATTR5_UNK24 = 0x01000000, // 24
SPELL_ATTR5_UNK25 = 0x02000000, // 25
SPELL_ATTR5_UNK26 = 0x04000000, // 26 aoe related - Boulder, Cannon, Corpse Explosion, Fire Nova, Flames, Frost Bomb, Living Bomb, Seed of Corruption, Starfall, Thunder Clap, Volley
SPELL_ATTR5_DONT_SHOW_AURA_IF_SELF_CAST = 0x08000000, // 27 Auras with this attribute are not visible on units that are the caster
SPELL_ATTR5_DONT_SHOW_AURA_IF_NOT_SELF_CAST = 0x10000000, // 28 Auras with this attribute are not visible on units that are not the caster
SPELL_ATTR5_UNK29 = 0x20000000, // 29
SPELL_ATTR5_UNK30 = 0x40000000, // 30
SPELL_ATTR5_UNK31 = 0x80000000 // 31 Forces all nearby enemies to focus attacks caster
};
enum SpellAttr6
{
SPELL_ATTR6_DONT_DISPLAY_COOLDOWN = 0x00000001, // 0 client doesn't display cooldown in tooltip for these spells
SPELL_ATTR6_ONLY_IN_ARENA = 0x00000002, // 1 only usable in arena
SPELL_ATTR6_IGNORE_CASTER_AURAS = 0x00000004, // 2
SPELL_ATTR6_ASSIST_IGNORE_IMMUNE_FLAG = 0x00000008, // 3 skips checking UNIT_FLAG_IMMUNE_TO_PC and UNIT_FLAG_IMMUNE_TO_NPC flags on assist
SPELL_ATTR6_UNK4 = 0x00000010, // 4
SPELL_ATTR6_UNK5 = 0x00000020, // 5
SPELL_ATTR6_USE_SPELL_CAST_EVENT = 0x00000040, // 6 Auras with this attribute trigger SPELL_CAST combat log event instead of SPELL_AURA_START (clientside attribute)
SPELL_ATTR6_UNK7 = 0x00000080, // 7
SPELL_ATTR6_CANT_TARGET_CROWD_CONTROLLED = 0x00000100, // 8
SPELL_ATTR6_UNK9 = 0x00000200, // 9
SPELL_ATTR6_CAN_TARGET_POSSESSED_FRIENDS = 0x00000400, // 10 NYI!
SPELL_ATTR6_NOT_IN_RAID_INSTANCE = 0x00000800, // 11 not usable in raid instance
SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE = 0x00001000, // 12 castable while caster is on vehicle
SPELL_ATTR6_CAN_TARGET_INVISIBLE = 0x00002000, // 13 ignore visibility requirement for spell target (phases, invisibility, etc.)
SPELL_ATTR6_UNK14 = 0x00004000, // 14
SPELL_ATTR6_UNK15 = 0x00008000, // 15 only 54368, 67892
SPELL_ATTR6_UNK16 = 0x00010000, // 16
SPELL_ATTR6_UNK17 = 0x00020000, // 17 Mount spell
SPELL_ATTR6_CAST_BY_CHARMER = 0x00040000, // 18 client won't allow to cast these spells when unit is not possessed && charmer of caster will be original caster
SPELL_ATTR6_UNK19 = 0x00080000, // 19 only 47488, 50782
SPELL_ATTR6_ONLY_VISIBLE_TO_CASTER = 0x00100000, // 20 Auras with this attribute are only visible to their caster (or pet's owner)
SPELL_ATTR6_CLIENT_UI_TARGET_EFFECTS = 0x00200000, // 21 it's only client-side attribute
SPELL_ATTR6_UNK22 = 0x00400000, // 22 only 72054
SPELL_ATTR6_UNK23 = 0x00800000, // 23
SPELL_ATTR6_CAN_TARGET_UNTARGETABLE = 0x01000000, // 24
SPELL_ATTR6_NOT_RESET_SWING_IF_INSTANT = 0x02000000, // 25 Exorcism, Flash of Light
SPELL_ATTR6_UNK26 = 0x04000000, // 26 related to player castable positive buff
SPELL_ATTR6_UNK27 = 0x08000000, // 27
SPELL_ATTR6_UNK28 = 0x10000000, // 28 Death Grip
SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS = 0x20000000, // 29 ignores done percent damage mods?
SPELL_ATTR6_UNK30 = 0x40000000, // 30
SPELL_ATTR6_IGNORE_CATEGORY_COOLDOWN_MODS = 0x80000000 // 31 Spells with this attribute skip applying modifiers to category cooldowns
};
enum SpellAttr7
{
SPELL_ATTR7_UNK0 = 0x00000001, // 0 Shaman's new spells (Call of the ...), Feign Death.
SPELL_ATTR7_IGNORE_DURATION_MODS = 0x00000002, // 1 Duration is not affected by duration modifiers
SPELL_ATTR7_REACTIVATE_AT_RESURRECT = 0x00000004, // 2 Paladin's auras and 65607 only.
SPELL_ATTR7_IS_CHEAT_SPELL = 0x00000008, // 3 Cannot cast if caster doesn't have UnitFlag2 & UNIT_FLAG2_ALLOW_CHEAT_SPELLS
SPELL_ATTR7_UNK4 = 0x00000010, // 4 Only 47883 (Soulstone Resurrection) and test spell.
SPELL_ATTR7_SUMMON_TOTEM = 0x00000020, // 5 Only Shaman totems.
SPELL_ATTR7_NO_PUSHBACK_ON_DAMAGE = 0x00000040, // 6 Does not cause spell pushback on damage
SPELL_ATTR7_UNK7 = 0x00000080, // 7 66218 (Launch) spell.
SPELL_ATTR7_HORDE_ONLY = 0x00000100, // 8 Teleports, mounts and other spells.
SPELL_ATTR7_ALLIANCE_ONLY = 0x00000200, // 9 Teleports, mounts and other spells.
SPELL_ATTR7_DISPEL_CHARGES = 0x00000400, // 10 Dispel and Spellsteal individual charges instead of whole aura.
SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER = 0x00000800, // 11 Only non-player casts interrupt, though Feral Charge - Bear has it.
SPELL_ATTR7_SILENCE_ONLY_NONPLAYER = 0x00001000, // 12 Not set in 3.2.2a.
SPELL_ATTR7_UNK13 = 0x00002000, // 13 Not set in 3.2.2a.
SPELL_ATTR7_UNK14 = 0x00004000, // 14 Only 52150 (Raise Dead - Pet) spell.
SPELL_ATTR7_UNK15 = 0x00008000, // 15 Exorcism. Usable on players? 100% crit chance on undead and demons?
SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER = 0x00010000, // 16 These spells can replenish a powertype, which is not the current powertype.
SPELL_ATTR7_UNK17 = 0x00020000, // 17 Only 27965 (Suicide) spell.
SPELL_ATTR7_HAS_CHARGE_EFFECT = 0x00040000, // 18 Only spells that have Charge among effects.
SPELL_ATTR7_ZONE_TELEPORT = 0x00080000, // 19 Teleports to specific zones.
SPELL_ATTR7_UNK20 = 0x00100000, // 20 Blink, Divine Shield, Ice Block
SPELL_ATTR7_UNK21 = 0x00200000, // 21 Not set
SPELL_ATTR7_UNK22 = 0x00400000, // 22
SPELL_ATTR7_UNK23 = 0x00800000, // 23 Motivate, Mutilate, Shattering Throw
SPELL_ATTR7_UNK24 = 0x01000000, // 24 Motivate, Mutilate, Perform Speech, Shattering Throw
SPELL_ATTR7_UNK25 = 0x02000000, // 25
SPELL_ATTR7_UNK26 = 0x04000000, // 26
SPELL_ATTR7_UNK27 = 0x08000000, // 27 Not set
SPELL_ATTR7_CONSOLIDATED_RAID_BUFF = 0x10000000, // 28 May be collapsed in raid buff frame (clientside attribute)
SPELL_ATTR7_UNK29 = 0x20000000, // 29 only 69028, 71237
SPELL_ATTR7_UNK30 = 0x40000000, // 30 Burning Determination, Divine Sacrifice, Earth Shield, Prayer of Mending
SPELL_ATTR7_CLIENT_INDICATOR = 0x80000000
};
enum SpellAttr8
{
SPELL_ATTR8_CANT_MISS = 0x00000001, // 0
SPELL_ATTR8_UNK1 = 0x00000002, // 1
SPELL_ATTR8_UNK2 = 0x00000004, // 2
SPELL_ATTR8_UNK3 = 0x00000008, // 3
SPELL_ATTR8_UNK4 = 0x00000010, // 4
SPELL_ATTR8_UNK5 = 0x00000020, // 5
SPELL_ATTR8_UNK6 = 0x00000040, // 6
SPELL_ATTR8_UNK7 = 0x00000080, // 7
SPELL_ATTR8_AFFECT_PARTY_AND_RAID = 0x00000100, // 8 Nearly all spells have "all party and raid" in description
SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER = 0x00000200, // 9 Periodic auras with this flag keep old periodic timer when refreshing at close to one tick remaining (kind of anti DoT clipping)
SPELL_ATTR8_NAME_CHANGED_DURING_TRANSFORM = 0x00000400, // 10 according to wowhead comments, name changes, title remains
SPELL_ATTR8_UNK11 = 0x00000800, // 11
SPELL_ATTR8_AURA_SEND_AMOUNT = 0x00001000, // 12 Aura must have flag AFLAG_ANY_EFFECT_AMOUNT_SENT to send amount
SPELL_ATTR8_UNK13 = 0x00002000, // 13
SPELL_ATTR8_UNK14 = 0x00004000, // 14
SPELL_ATTR8_WATER_MOUNT = 0x00008000, // 15 only one River Boat used in Thousand Needles
SPELL_ATTR8_UNK16 = 0x00010000, // 16
SPELL_ATTR8_UNK17 = 0x00020000, // 17
SPELL_ATTR8_REMEMBER_SPELLS = 0x00040000, // 18 at some point in time, these auras remember spells and allow to cast them later
SPELL_ATTR8_USE_COMBO_POINTS_ON_ANY_TARGET = 0x00080000, // 19 allows to consume combo points from dead targets
SPELL_ATTR8_ARMOR_SPECIALIZATION = 0x00100000, // 20
SPELL_ATTR8_UNK21 = 0x00200000, // 21
SPELL_ATTR8_UNK22 = 0x00400000, // 22
SPELL_ATTR8_BATTLE_RESURRECTION = 0x00800000, // 23 Used to limit the Amount of Resurrections in Boss Encounters
SPELL_ATTR8_HEALING_SPELL = 0x01000000, // 24
SPELL_ATTR8_UNK25 = 0x02000000, // 25
SPELL_ATTR8_RAID_MARKER = 0x04000000, // 26 probably spell no need learn to cast
SPELL_ATTR8_UNK27 = 0x08000000, // 27
SPELL_ATTR8_NOT_IN_BG_OR_ARENA = 0x10000000, // 28 not allow to cast or deactivate currently active effect, not sure about Fast Track
SPELL_ATTR8_MASTERY_SPECIALIZATION = 0x20000000, // 29
SPELL_ATTR8_UNK30 = 0x40000000, // 30
SPELL_ATTR8_ATTACK_IGNORE_IMMUNE_TO_PC_FLAG = 0x80000000 // 31 Do not check UNIT_FLAG_IMMUNE_TO_PC in IsValidAttackTarget
};
enum SpellAttr9
{
SPELL_ATTR9_UNK0 = 0x00000001, // 0
SPELL_ATTR9_UNK1 = 0x00000002, // 1
SPELL_ATTR9_RESTRICTED_FLIGHT_AREA = 0x00000004, // 2 Dalaran and Wintergrasp flight area auras have it
SPELL_ATTR9_UNK3 = 0x00000008, // 3
SPELL_ATTR9_SPECIAL_DELAY_CALCULATION = 0x00000010, // 4
SPELL_ATTR9_SUMMON_PLAYER_TOTEM = 0x00000020, // 5
SPELL_ATTR9_UNK6 = 0x00000040, // 6
SPELL_ATTR9_UNK7 = 0x00000080, // 7
SPELL_ATTR9_AIMED_SHOT = 0x00000100, // 8
SPELL_ATTR9_NOT_USABLE_IN_ARENA = 0x00000200, // 9 Cannot be used in arenas
SPELL_ATTR9_UNK10 = 0x00000400, // 10
SPELL_ATTR9_UNK11 = 0x00000800, // 11
SPELL_ATTR9_UNK12 = 0x00001000, // 12
SPELL_ATTR9_SLAM = 0x00002000, // 13
SPELL_ATTR9_USABLE_IN_RATED_BATTLEGROUNDS = 0x00004000, // 14 Can be used in Rated Battlegrounds
SPELL_ATTR9_UNK15 = 0x00008000, // 15
SPELL_ATTR9_UNK16 = 0x00010000, // 16
SPELL_ATTR9_UNK17 = 0x00020000, // 17
SPELL_ATTR9_UNK18 = 0x00040000, // 18
SPELL_ATTR9_UNK19 = 0x00080000, // 19
SPELL_ATTR9_UNK20 = 0x00100000, // 20
SPELL_ATTR9_UNK21 = 0x00200000, // 21
SPELL_ATTR9_UNK22 = 0x00400000, // 22
SPELL_ATTR9_UNK23 = 0x00800000, // 23
SPELL_ATTR9_UNK24 = 0x01000000, // 24
SPELL_ATTR9_UNK25 = 0x02000000, // 25
SPELL_ATTR9_UNK26 = 0x04000000, // 26
SPELL_ATTR9_UNK27 = 0x08000000, // 27
SPELL_ATTR9_UNK28 = 0x10000000, // 28
SPELL_ATTR9_UNK29 = 0x20000000, // 29
SPELL_ATTR9_UNK30 = 0x40000000, // 30
SPELL_ATTR9_UNK31 = 0x80000000 // 31
};
enum SpellAttr10
{
SPELL_ATTR10_UNK0 = 0x00000001, // 0
SPELL_ATTR10_UNK1 = 0x00000002, // 1
SPELL_ATTR10_UNK2 = 0x00000004, // 2
SPELL_ATTR10_UNK3 = 0x00000008, // 3
SPELL_ATTR10_WATER_SPOUT = 0x00000010, // 4
SPELL_ATTR10_UNK5 = 0x00000020, // 5
SPELL_ATTR10_UNK6 = 0x00000040, // 6
SPELL_ATTR10_TELEPORT_PLAYER = 0x00000080, // 7 4 Teleport Player spells
SPELL_ATTR10_UNK8 = 0x00000100, // 8
SPELL_ATTR10_UNK9 = 0x00000200, // 9
SPELL_ATTR10_UNK10 = 0x00000400, // 10
SPELL_ATTR10_HERB_GATHERING_MINING = 0x00000800, // 11 Only Herb Gathering and Mining
SPELL_ATTR10_USE_SPELL_BASE_LEVEL_FOR_SCALING= 0x00001000, // 12
SPELL_ATTR10_RESET_COOLDOWN_ON_ENCOUNTER_END = 0x00002000, // 13
SPELL_ATTR10_UNK14 = 0x00004000, // 14
SPELL_ATTR10_UNK15 = 0x00008000, // 15
SPELL_ATTR10_UNK16 = 0x00010000, // 16
SPELL_ATTR10_CAN_DODGE_PARRY_WHILE_CASTING = 0x00020000, // 17
SPELL_ATTR10_UNK18 = 0x00040000, // 18
SPELL_ATTR10_UNK19 = 0x00080000, // 19
SPELL_ATTR10_UNK20 = 0x00100000, // 20
SPELL_ATTR10_UNK21 = 0x00200000, // 21
SPELL_ATTR10_UNK22 = 0x00400000, // 22
SPELL_ATTR10_UNK23 = 0x00800000, // 23
SPELL_ATTR10_UNK24 = 0x01000000, // 24
SPELL_ATTR10_UNK25 = 0x02000000, // 25
SPELL_ATTR10_UNK26 = 0x04000000, // 26
SPELL_ATTR10_UNK27 = 0x08000000, // 27
SPELL_ATTR10_UNK28 = 0x10000000, // 28
SPELL_ATTR10_MOUNT_IS_NOT_ACCOUNT_WIDE = 0x20000000, // 29 This mount is stored per-character
SPELL_ATTR10_UNK30 = 0x40000000, // 30
SPELL_ATTR10_UNK31 = 0x80000000 // 31
};
enum SpellAttr11
{
SPELL_ATTR11_UNK0 = 0x00000001, // 0
SPELL_ATTR11_UNK1 = 0x00000002, // 1
SPELL_ATTR11_SCALES_WITH_ITEM_LEVEL = 0x00000004, // 2
SPELL_ATTR11_UNK3 = 0x00000008, // 3
SPELL_ATTR11_UNK4 = 0x00000010, // 4
SPELL_ATTR11_ABSORB_ENVIRONMENTAL_DAMAGE = 0x00000020, // 5
SPELL_ATTR11_UNK6 = 0x00000040, // 6
SPELL_ATTR11_RANK_IGNORES_CASTER_LEVEL = 0x00000080, // 7 Spell_C_GetSpellRank returns SpellLevels->MaxLevel * 5 instead of std::min(SpellLevels->MaxLevel, caster->Level) * 5
SPELL_ATTR11_UNK8 = 0x00000100, // 8
SPELL_ATTR11_UNK9 = 0x00000200, // 9
SPELL_ATTR11_UNK10 = 0x00000400, // 10
SPELL_ATTR11_NOT_USABLE_IN_INSTANCES = 0x00000800, // 11
SPELL_ATTR11_UNK12 = 0x00001000, // 12
SPELL_ATTR11_UNK13 = 0x00002000, // 13
SPELL_ATTR11_UNK14 = 0x00004000, // 14
SPELL_ATTR11_UNK15 = 0x00008000, // 15
SPELL_ATTR11_NOT_USABLE_IN_CHALLENGE_MODE = 0x00010000, // 16
SPELL_ATTR11_UNK17 = 0x00020000, // 17
SPELL_ATTR11_UNK18 = 0x00040000, // 18
SPELL_ATTR11_UNK19 = 0x00080000, // 19
SPELL_ATTR11_UNK20 = 0x00100000, // 20
SPELL_ATTR11_UNK21 = 0x00200000, // 21
SPELL_ATTR11_UNK22 = 0x00400000, // 22
SPELL_ATTR11_UNK23 = 0x00800000, // 23
SPELL_ATTR11_UNK24 = 0x01000000, // 24
SPELL_ATTR11_UNK25 = 0x02000000, // 25
SPELL_ATTR11_UNK26 = 0x04000000, // 26
SPELL_ATTR11_UNK27 = 0x08000000, // 27
SPELL_ATTR11_UNK28 = 0x10000000, // 28
SPELL_ATTR11_UNK29 = 0x20000000, // 29
SPELL_ATTR11_UNK30 = 0x40000000, // 30
SPELL_ATTR11_UNK31 = 0x80000000 // 31
};
enum SpellAttr12
{
SPELL_ATTR12_UNK0 = 0x00000001, // 0
SPELL_ATTR12_UNK1 = 0x00000002, // 1
SPELL_ATTR12_UNK2 = 0x00000004, // 2
SPELL_ATTR12_UNK3 = 0x00000008, // 3
SPELL_ATTR12_UNK4 = 0x00000010, // 4
SPELL_ATTR12_UNK5 = 0x00000020, // 5
SPELL_ATTR12_UNK6 = 0x00000040, // 6
SPELL_ATTR12_UNK7 = 0x00000080, // 7
SPELL_ATTR12_UNK8 = 0x00000100, // 8
SPELL_ATTR12_UNK9 = 0x00000200, // 9
SPELL_ATTR12_UNK10 = 0x00000400, // 10
SPELL_ATTR12_UNK11 = 0x00000800, // 11
SPELL_ATTR12_UNK12 = 0x00001000, // 12
SPELL_ATTR12_UNK13 = 0x00002000, // 13
SPELL_ATTR12_UNK14 = 0x00004000, // 14
SPELL_ATTR12_UNK15 = 0x00008000, // 15
SPELL_ATTR12_UNK16 = 0x00010000, // 16
SPELL_ATTR12_UNK17 = 0x00020000, // 17
SPELL_ATTR12_UNK18 = 0x00040000, // 18
SPELL_ATTR12_UNK19 = 0x00080000, // 19
SPELL_ATTR12_UNK20 = 0x00100000, // 20
SPELL_ATTR12_UNK21 = 0x00200000, // 21
SPELL_ATTR12_UNK22 = 0x00400000, // 22
SPELL_ATTR12_START_COOLDOWN_ON_CAST_START = 0x00800000, // 23
SPELL_ATTR12_IS_GARRISON_BUFF = 0x01000000, // 24
SPELL_ATTR12_UNK25 = 0x02000000, // 25
SPELL_ATTR12_UNK26 = 0x04000000, // 26
SPELL_ATTR12_IS_READINESS_SPELL = 0x08000000, // 27
SPELL_ATTR12_UNK28 = 0x10000000, // 28
SPELL_ATTR12_UNK29 = 0x20000000, // 29
SPELL_ATTR12_UNK30 = 0x40000000, // 30
SPELL_ATTR12_UNK31 = 0x80000000 // 31
};
enum SpellAttr13
{
SPELL_ATTR13_UNK0 = 0x00000001, // 0
SPELL_ATTR13_UNK1 = 0x00000002, // 1
SPELL_ATTR13_UNK2 = 0x00000004, // 2
SPELL_ATTR13_UNK3 = 0x00000008, // 3
SPELL_ATTR13_UNK4 = 0x00000010, // 4
SPELL_ATTR13_UNK5 = 0x00000020, // 5
SPELL_ATTR13_UNK6 = 0x00000040, // 6
SPELL_ATTR13_UNK7 = 0x00000080, // 7
SPELL_ATTR13_UNK8 = 0x00000100, // 8
SPELL_ATTR13_UNK9 = 0x00000200, // 9
SPELL_ATTR13_UNK10 = 0x00000400, // 10
SPELL_ATTR13_UNK11 = 0x00000800, // 11
SPELL_ATTR13_UNK12 = 0x00001000, // 12
SPELL_ATTR13_UNK13 = 0x00002000, // 13
SPELL_ATTR13_UNK14 = 0x00004000, // 14
SPELL_ATTR13_UNK15 = 0x00008000, // 15
SPELL_ATTR13_UNK16 = 0x00010000, // 16
SPELL_ATTR13_UNK17 = 0x00020000, // 17
SPELL_ATTR13_ACTIVATES_REQUIRED_SHAPESHIFT = 0x00040000, // 18
SPELL_ATTR13_UNK19 = 0x00080000, // 19
SPELL_ATTR13_UNK20 = 0x00100000, // 20
SPELL_ATTR13_UNK21 = 0x00200000, // 21
SPELL_ATTR13_UNK22 = 0x00400000, // 22
SPELL_ATTR13_UNK23 = 0x00800000 // 23
};
enum SpellAttr14
{
SPELL_ATTR14_UNK0 = 0, // 0
SPELL_ATTR14_UNK1 = 1, // 1
SPELL_ATTR14_UNK2 = 2, // 2
SPELL_ATTR14_UNK3 = 3, // 3
SPELL_ATTR14_UNK4 = 4, // 4
SPELL_ATTR14_UNK5 = 5, // 5
SPELL_ATTR14_UNK6 = 6, // 6
SPELL_ATTR14_UNK7 = 7, // 7
SPELL_ATTR14_UNK8 = 8, // 8
};
#define MIN_SPECIALIZATION_LEVEL 10
#define MAX_SPECIALIZATIONS 5
#define PET_SPEC_OVERRIDE_CLASS_INDEX MAX_CLASSES
#define INITIAL_SPECIALIZATION_INDEX 4
// Custom values
enum SpellClickUserTypes
{
SPELL_CLICK_USER_ANY = 0,
SPELL_CLICK_USER_FRIEND = 1,
SPELL_CLICK_USER_RAID = 2,
SPELL_CLICK_USER_PARTY = 3,
SPELL_CLICK_USER_MAX = 4
};
enum SpellClickCastFlags
{
NPC_CLICK_CAST_CASTER_CLICKER = 0x01,
NPC_CLICK_CAST_TARGET_CLICKER = 0x02,
NPC_CLICK_CAST_ORIG_CASTER_OWNER = 0x04
};
enum SheathTypes
{
SHEATHETYPE_NONE = 0,
SHEATHETYPE_MAINHAND = 1,
SHEATHETYPE_OFFHAND = 2,
SHEATHETYPE_LARGEWEAPONLEFT = 3,
SHEATHETYPE_LARGEWEAPONRIGHT = 4,
SHEATHETYPE_HIPWEAPONLEFT = 5,
SHEATHETYPE_HIPWEAPONRIGHT = 6,
SHEATHETYPE_SHIELD = 7
};
#define MAX_SHEATHETYPE 8
enum CharacterFlags
{
CHARACTER_FLAG_NONE = 0x00000000,
CHARACTER_FLAG_UNK1 = 0x00000001,
CHARACTER_FLAG_UNK2 = 0x00000002,
CHARACTER_FLAG_LOCKED_FOR_TRANSFER = 0x00000004,
CHARACTER_FLAG_UNK4 = 0x00000008,
CHARACTER_FLAG_UNK5 = 0x00000010,
CHARACTER_FLAG_UNK6 = 0x00000020,
CHARACTER_FLAG_UNK7 = 0x00000040,
CHARACTER_FLAG_UNK8 = 0x00000080,
CHARACTER_FLAG_UNK9 = 0x00000100,
CHARACTER_FLAG_UNK10 = 0x00000200,
CHARACTER_FLAG_HIDE_HELM = 0x00000400,
CHARACTER_FLAG_HIDE_CLOAK = 0x00000800,
CHARACTER_FLAG_UNK13 = 0x00001000,
CHARACTER_FLAG_GHOST = 0x00002000,
CHARACTER_FLAG_RENAME = 0x00004000,
CHARACTER_FLAG_UNK16 = 0x00008000,
CHARACTER_FLAG_UNK17 = 0x00010000,
CHARACTER_FLAG_UNK18 = 0x00020000,
CHARACTER_FLAG_UNK19 = 0x00040000,
CHARACTER_FLAG_UNK20 = 0x00080000,
CHARACTER_FLAG_UNK21 = 0x00100000,
CHARACTER_FLAG_UNK22 = 0x00200000,
CHARACTER_FLAG_UNK23 = 0x00400000,
CHARACTER_FLAG_UNK24 = 0x00800000,
CHARACTER_FLAG_LOCKED_BY_BILLING = 0x01000000,
CHARACTER_FLAG_DECLINED = 0x02000000,
CHARACTER_FLAG_UNK27 = 0x04000000,
CHARACTER_FLAG_UNK28 = 0x08000000,
CHARACTER_FLAG_UNK29 = 0x10000000,
CHARACTER_FLAG_UNK30 = 0x20000000,
CHARACTER_FLAG_UNK31 = 0x40000000,
CHARACTER_FLAG_UNK32 = 0x80000000
};
enum CharacterCustomizeFlags
{
CHAR_CUSTOMIZE_FLAG_NONE = 0x00000000,
CHAR_CUSTOMIZE_FLAG_CUSTOMIZE = 0x00000001, // name, gender, etc...
CHAR_CUSTOMIZE_FLAG_FACTION = 0x00010000, // name, gender, faction, etc...
CHAR_CUSTOMIZE_FLAG_RACE = 0x00100000 // name, gender, race, etc...
};
enum CharacterFlags3 : uint32
{
CHARACTER_FLAG_3_LOCKED_BY_REVOKED_VAS_TRANSACTION = 0x00100000,
CHARACTER_FLAG_3_LOCKED_BY_REVOKED_CHARACTER_UPGRADE = 0x80000000,
};
enum CharacterFlags4 : uint32
{
CHARACTER_FLAG_4_TRIAL_BOOST = 0x00000080,
CHARACTER_FLAG_4_TRIAL_BOOST_LOCKED = 0x00040000,
CHARACTER_FLAG_4_EXPANSION_TRIAL = 0x00080000,
};
#define PLAYER_CUSTOM_DISPLAY_SIZE 3
enum CharacterSlot
{
SLOT_HEAD = 0,
SLOT_NECK = 1,
SLOT_SHOULDERS = 2,
SLOT_SHIRT = 3,
SLOT_CHEST = 4,
SLOT_WAIST = 5,
SLOT_LEGS = 6,
SLOT_FEET = 7,
SLOT_WRISTS = 8,
SLOT_HANDS = 9,
SLOT_FINGER1 = 10,
SLOT_FINGER2 = 11,
SLOT_TRINKET1 = 12,
SLOT_TRINKET2 = 13,
SLOT_BACK = 14,
SLOT_MAIN_HAND = 15,
SLOT_OFF_HAND = 16,
SLOT_RANGED = 17,
SLOT_TABARD = 18,
SLOT_EMPTY = 19
};
// Languages.dbc (9.0.2)
enum Language : uint32
{
LANG_UNIVERSAL = 0,
LANG_ORCISH = 1,
LANG_DARNASSIAN = 2,
LANG_TAURAHE = 3,
LANG_DWARVISH = 6,
LANG_COMMON = 7,
LANG_DEMONIC = 8,
LANG_TITAN = 9,
LANG_THALASSIAN = 10,
LANG_DRACONIC = 11,
LANG_KALIMAG = 12,
LANG_GNOMISH = 13,
LANG_TROLL = 14,
LANG_GUTTERSPEAK = 33,
LANG_DRAENEI = 35,
LANG_ZOMBIE = 36,
LANG_GNOMISH_BINARY = 37,
LANG_GOBLIN_BINARY = 38,
LANG_WORGEN = 39,
LANG_GOBLIN = 40,
LANG_PANDAREN_NEUTRAL = 42,
LANG_PANDAREN_ALLIANCE = 43,
LANG_PANDAREN_HORDE = 44,
LANG_SPRITE = 168,
LANG_SHATH_YAR = 178,
LANG_NERGLISH = 179,
LANG_MOONKIN = 180,
LANG_SHALASSIAN = 181,
LANG_THALASSIAN_2 = 182,
LANG_ADDON = 183,
LANG_ADDON_LOGGED = 184,
LANG_VULPERA = 285
};
#define LANGUAGES_COUNT 32
enum FactionSelection
{
JOIN_HORDE = 0,
JOIN_ALLIANCE = 1
};
enum TeamId
{
TEAM_ALLIANCE = 0,
TEAM_HORDE,
TEAM_NEUTRAL,
TEAM_MAX = TEAM_NEUTRAL
};
enum Team
{
HORDE = 67,
ALLIANCE = 469,
//TEAM_STEAMWHEEDLE_CARTEL = 169, // not used in code
//TEAM_ALLIANCE_FORCES = 891,
//TEAM_HORDE_FORCES = 892,
//TEAM_SANCTUARY = 936,
//TEAM_OUTLAND = 980,
TEAM_OTHER = 0 // if ReputationListId > 0 && Flags != FACTION_FLAG_TEAM_HEADER
};
enum SpellEffectName
{
SPELL_EFFECT_INSTAKILL = 1,
SPELL_EFFECT_SCHOOL_DAMAGE = 2,
SPELL_EFFECT_DUMMY = 3,
SPELL_EFFECT_PORTAL_TELEPORT = 4, // Unused (4.3.4)
SPELL_EFFECT_TELEPORT_UNITS_OLD = 5, // Unused (7.0.3)
SPELL_EFFECT_APPLY_AURA = 6,
SPELL_EFFECT_ENVIRONMENTAL_DAMAGE = 7,
SPELL_EFFECT_POWER_DRAIN = 8,
SPELL_EFFECT_HEALTH_LEECH = 9,
SPELL_EFFECT_HEAL = 10,
SPELL_EFFECT_BIND = 11,
SPELL_EFFECT_PORTAL = 12,
SPELL_EFFECT_RITUAL_BASE = 13, // Unused (4.3.4)
SPELL_EFFECT_INCREASE_CURRENCY_CAP = 14,
SPELL_EFFECT_RITUAL_ACTIVATE_PORTAL = 15,
SPELL_EFFECT_QUEST_COMPLETE = 16,
SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL = 17,
SPELL_EFFECT_RESURRECT = 18,
SPELL_EFFECT_ADD_EXTRA_ATTACKS = 19,
SPELL_EFFECT_DODGE = 20,
SPELL_EFFECT_EVADE = 21,
SPELL_EFFECT_PARRY = 22,
SPELL_EFFECT_BLOCK = 23,
SPELL_EFFECT_CREATE_ITEM = 24,
SPELL_EFFECT_WEAPON = 25,
SPELL_EFFECT_DEFENSE = 26,
SPELL_EFFECT_PERSISTENT_AREA_AURA = 27,
SPELL_EFFECT_SUMMON = 28,
SPELL_EFFECT_LEAP = 29,
SPELL_EFFECT_ENERGIZE = 30,
SPELL_EFFECT_WEAPON_PERCENT_DAMAGE = 31,
SPELL_EFFECT_TRIGGER_MISSILE = 32,
SPELL_EFFECT_OPEN_LOCK = 33,
SPELL_EFFECT_SUMMON_CHANGE_ITEM = 34,
SPELL_EFFECT_APPLY_AREA_AURA_PARTY = 35,
SPELL_EFFECT_LEARN_SPELL = 36,
SPELL_EFFECT_SPELL_DEFENSE = 37,
SPELL_EFFECT_DISPEL = 38,
SPELL_EFFECT_LANGUAGE = 39,
SPELL_EFFECT_DUAL_WIELD = 40,
SPELL_EFFECT_JUMP = 41,
SPELL_EFFECT_JUMP_DEST = 42,
SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER = 43,
SPELL_EFFECT_SKILL_STEP = 44,
SPELL_EFFECT_PLAY_MOVIE = 45,
SPELL_EFFECT_SPAWN = 46,
SPELL_EFFECT_TRADE_SKILL = 47,
SPELL_EFFECT_STEALTH = 48,
SPELL_EFFECT_DETECT = 49,
SPELL_EFFECT_TRANS_DOOR = 50,
SPELL_EFFECT_FORCE_CRITICAL_HIT = 51, // Unused (4.3.4)
SPELL_EFFECT_SET_MAX_BATTLE_PET_COUNT = 52,
SPELL_EFFECT_ENCHANT_ITEM = 53,
SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY = 54,
SPELL_EFFECT_TAMECREATURE = 55,
SPELL_EFFECT_SUMMON_PET = 56,
SPELL_EFFECT_LEARN_PET_SPELL = 57,
SPELL_EFFECT_WEAPON_DAMAGE = 58,
SPELL_EFFECT_CREATE_RANDOM_ITEM = 59,
SPELL_EFFECT_PROFICIENCY = 60,
SPELL_EFFECT_SEND_EVENT = 61,
SPELL_EFFECT_POWER_BURN = 62,
SPELL_EFFECT_THREAT = 63,
SPELL_EFFECT_TRIGGER_SPELL = 64,
SPELL_EFFECT_APPLY_AREA_AURA_RAID = 65,
SPELL_EFFECT_RECHARGE_ITEM = 66,
SPELL_EFFECT_HEAL_MAX_HEALTH = 67,
SPELL_EFFECT_INTERRUPT_CAST = 68,
SPELL_EFFECT_DISTRACT = 69,
SPELL_EFFECT_PULL = 70,
SPELL_EFFECT_PICKPOCKET = 71,
SPELL_EFFECT_ADD_FARSIGHT = 72,
SPELL_EFFECT_UNTRAIN_TALENTS = 73,
SPELL_EFFECT_APPLY_GLYPH = 74,
SPELL_EFFECT_HEAL_MECHANICAL = 75,
SPELL_EFFECT_SUMMON_OBJECT_WILD = 76,
SPELL_EFFECT_SCRIPT_EFFECT = 77,
SPELL_EFFECT_ATTACK = 78,
SPELL_EFFECT_SANCTUARY = 79,
SPELL_EFFECT_ADD_COMBO_POINTS = 80,
SPELL_EFFECT_PUSH_ABILITY_TO_ACTION_BAR = 81,
SPELL_EFFECT_BIND_SIGHT = 82,
SPELL_EFFECT_DUEL = 83,
SPELL_EFFECT_STUCK = 84,
SPELL_EFFECT_SUMMON_PLAYER = 85,
SPELL_EFFECT_ACTIVATE_OBJECT = 86,
SPELL_EFFECT_GAMEOBJECT_DAMAGE = 87,
SPELL_EFFECT_GAMEOBJECT_REPAIR = 88,
SPELL_EFFECT_GAMEOBJECT_SET_DESTRUCTION_STATE = 89,
SPELL_EFFECT_KILL_CREDIT = 90,
SPELL_EFFECT_THREAT_ALL = 91,
SPELL_EFFECT_ENCHANT_HELD_ITEM = 92,
SPELL_EFFECT_FORCE_DESELECT = 93,
SPELL_EFFECT_SELF_RESURRECT = 94,
SPELL_EFFECT_SKINNING = 95,
SPELL_EFFECT_CHARGE = 96,
SPELL_EFFECT_CAST_BUTTON = 97,
SPELL_EFFECT_KNOCK_BACK = 98,
SPELL_EFFECT_DISENCHANT = 99,
SPELL_EFFECT_INEBRIATE = 100,
SPELL_EFFECT_FEED_PET = 101,
SPELL_EFFECT_DISMISS_PET = 102,
SPELL_EFFECT_REPUTATION = 103,
SPELL_EFFECT_SUMMON_OBJECT_SLOT1 = 104,
SPELL_EFFECT_SURVEY = 105,
SPELL_EFFECT_CHANGE_RAID_MARKER = 106,
SPELL_EFFECT_SHOW_CORPSE_LOOT = 107,
SPELL_EFFECT_DISPEL_MECHANIC = 108,
SPELL_EFFECT_RESURRECT_PET = 109,
SPELL_EFFECT_DESTROY_ALL_TOTEMS = 110,
SPELL_EFFECT_DURABILITY_DAMAGE = 111,
SPELL_EFFECT_112 = 112,
SPELL_EFFECT_113 = 113,
SPELL_EFFECT_ATTACK_ME = 114,
SPELL_EFFECT_DURABILITY_DAMAGE_PCT = 115,
SPELL_EFFECT_SKIN_PLAYER_CORPSE = 116,
SPELL_EFFECT_SPIRIT_HEAL = 117,
SPELL_EFFECT_SKILL = 118,
SPELL_EFFECT_APPLY_AREA_AURA_PET = 119,
SPELL_EFFECT_TELEPORT_GRAVEYARD = 120,
SPELL_EFFECT_NORMALIZED_WEAPON_DMG = 121,
SPELL_EFFECT_122 = 122, // Unused (4.3.4)
SPELL_EFFECT_SEND_TAXI = 123,
SPELL_EFFECT_PULL_TOWARDS = 124,
SPELL_EFFECT_MODIFY_THREAT_PERCENT = 125,
SPELL_EFFECT_STEAL_BENEFICIAL_BUFF = 126,
SPELL_EFFECT_PROSPECTING = 127,
SPELL_EFFECT_APPLY_AREA_AURA_FRIEND = 128,
SPELL_EFFECT_APPLY_AREA_AURA_ENEMY = 129,
SPELL_EFFECT_REDIRECT_THREAT = 130,
SPELL_EFFECT_PLAY_SOUND = 131,
SPELL_EFFECT_PLAY_MUSIC = 132,
SPELL_EFFECT_UNLEARN_SPECIALIZATION = 133,
SPELL_EFFECT_KILL_CREDIT2 = 134,
SPELL_EFFECT_CALL_PET = 135,
SPELL_EFFECT_HEAL_PCT = 136,
SPELL_EFFECT_ENERGIZE_PCT = 137,
SPELL_EFFECT_LEAP_BACK = 138,
SPELL_EFFECT_CLEAR_QUEST = 139,
SPELL_EFFECT_FORCE_CAST = 140,
SPELL_EFFECT_FORCE_CAST_WITH_VALUE = 141,
SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE = 142,
SPELL_EFFECT_APPLY_AREA_AURA_OWNER = 143,
SPELL_EFFECT_KNOCK_BACK_DEST = 144,
SPELL_EFFECT_PULL_TOWARDS_DEST = 145,
SPELL_EFFECT_ACTIVATE_RUNE = 146,
SPELL_EFFECT_QUEST_FAIL = 147,
SPELL_EFFECT_TRIGGER_MISSILE_SPELL_WITH_VALUE = 148,
SPELL_EFFECT_CHARGE_DEST = 149,
SPELL_EFFECT_QUEST_START = 150,
SPELL_EFFECT_TRIGGER_SPELL_2 = 151,
SPELL_EFFECT_SUMMON_RAF_FRIEND = 152,
SPELL_EFFECT_CREATE_TAMED_PET = 153,
SPELL_EFFECT_DISCOVER_TAXI = 154,
SPELL_EFFECT_TITAN_GRIP = 155,
SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC = 156,
SPELL_EFFECT_CREATE_LOOT = 157, // crafting loot
SPELL_EFFECT_MILLING = 158,
SPELL_EFFECT_ALLOW_RENAME_PET = 159,
SPELL_EFFECT_FORCE_CAST_2 = 160,
SPELL_EFFECT_TALENT_SPEC_COUNT = 161,
SPELL_EFFECT_TALENT_SPEC_SELECT = 162,
SPELL_EFFECT_OBLITERATE_ITEM = 163,
SPELL_EFFECT_REMOVE_AURA = 164,
SPELL_EFFECT_DAMAGE_FROM_MAX_HEALTH_PCT = 165,
SPELL_EFFECT_GIVE_CURRENCY = 166,
SPELL_EFFECT_UPDATE_PLAYER_PHASE = 167,
SPELL_EFFECT_ALLOW_CONTROL_PET = 168, // NYI
SPELL_EFFECT_DESTROY_ITEM = 169,
SPELL_EFFECT_UPDATE_ZONE_AURAS_AND_PHASES = 170, // NYI
SPELL_EFFECT_SUMMON_OBJECT_PERSONNAL = 171, // Summons gamebject visible by summoner only
SPELL_EFFECT_RESURRECT_WITH_AURA = 172,
SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB = 173, // Guild tab unlocked (guild perk)
SPELL_EFFECT_APPLY_AURA_ON_PET = 174, // NYI
SPELL_EFFECT_175 = 175, // Unused (4.3.4)
SPELL_EFFECT_SANCTUARY_2 = 176, // NYI
SPELL_EFFECT_177 = 177,
SPELL_EFFECT_178 = 178, // Unused (4.3.4)
SPELL_EFFECT_CREATE_AREATRIGGER = 179,
SPELL_EFFECT_UPDATE_AREATRIGGER = 180, // NYI
SPELL_EFFECT_REMOVE_TALENT = 181,
SPELL_EFFECT_DESPAWN_AREATRIGGER = 182,
SPELL_EFFECT_183 = 183,
SPELL_EFFECT_REPUTATION_2 = 184, // NYI
SPELL_EFFECT_185 = 185,
SPELL_EFFECT_186 = 186,
SPELL_EFFECT_RANDOMIZE_ARCHAEOLOGY_DIGSITES = 187, // NYI
SPELL_EFFECT_188 = 188,
SPELL_EFFECT_LOOT = 189, // NYI, lootid in MiscValue ?
SPELL_EFFECT_190 = 190,
SPELL_EFFECT_TELEPORT_TO_DIGSITE = 191, // NYI
SPELL_EFFECT_UNCAGE_BATTLEPET = 192,
SPELL_EFFECT_START_PET_BATTLE = 193,
SPELL_EFFECT_194 = 194,
SPELL_EFFECT_195 = 195,
SPELL_EFFECT_196 = 196,
SPELL_EFFECT_197 = 197,
SPELL_EFFECT_PLAY_SCENE = 198,
SPELL_EFFECT_199 = 199,
SPELL_EFFECT_HEAL_BATTLEPET_PCT = 200, // NYI
SPELL_EFFECT_ENABLE_BATTLE_PETS = 201, // NYI
SPELL_EFFECT_APPLY_AURA_WITH_AMOUNT = 202,
SPELL_EFFECT_REMOVE_AURA_2 = 203,
SPELL_EFFECT_CHANGE_BATTLEPET_QUALITY = 204,
SPELL_EFFECT_LAUNCH_QUEST_CHOICE = 205,
SPELL_EFFECT_ALTER_ITEM = 206, // NYI
SPELL_EFFECT_LAUNCH_QUEST_TASK = 207, // Starts one of the "progress bar" quests
SPELL_EFFECT_208 = 208,
SPELL_EFFECT_209 = 209,
SPELL_EFFECT_LEARN_GARRISON_BUILDING = 210,
SPELL_EFFECT_LEARN_GARRISON_SPECIALIZATION = 211,
SPELL_EFFECT_212 = 212,
SPELL_EFFECT_213 = 213,
SPELL_EFFECT_CREATE_GARRISON = 214,
SPELL_EFFECT_UPGRADE_CHARACTER_SPELLS = 215, // Unlocks boosted players' spells (ChrUpgrade*.db2)
SPELL_EFFECT_CREATE_SHIPMENT = 216,
SPELL_EFFECT_UPGRADE_GARRISON = 217,
SPELL_EFFECT_218 = 218,
SPELL_EFFECT_CREATE_CONVERSATION = 219,
SPELL_EFFECT_ADD_GARRISON_FOLLOWER = 220,
SPELL_EFFECT_221 = 221,
SPELL_EFFECT_CREATE_HEIRLOOM_ITEM = 222,
SPELL_EFFECT_CHANGE_ITEM_BONUSES = 223,
SPELL_EFFECT_ACTIVATE_GARRISON_BUILDING = 224,
SPELL_EFFECT_GRANT_BATTLEPET_LEVEL = 225,
SPELL_EFFECT_226 = 226,
SPELL_EFFECT_TELEPORT_TO_LFG_DUNGEON = 227,
SPELL_EFFECT_228 = 228,
SPELL_EFFECT_SET_FOLLOWER_QUALITY = 229,
SPELL_EFFECT_INCREASE_FOLLOWER_ITEM_LEVEL = 230,
SPELL_EFFECT_INCREASE_FOLLOWER_EXPERIENCE = 231,
SPELL_EFFECT_REMOVE_PHASE = 232,
SPELL_EFFECT_RANDOMIZE_FOLLOWER_ABILITIES = 233,
SPELL_EFFECT_234 = 234,
SPELL_EFFECT_235 = 235,
SPELL_EFFECT_GIVE_EXPERIENCE = 236, // Increases players XP
SPELL_EFFECT_GIVE_RESTED_EXPERIENCE_BONUS = 237,
SPELL_EFFECT_INCREASE_SKILL = 238,
SPELL_EFFECT_END_GARRISON_BUILDING_CONSTRUCTION = 239, // Instantly finishes building construction
SPELL_EFFECT_GIVE_ARTIFACT_POWER = 240,
SPELL_EFFECT_241 = 241,
SPELL_EFFECT_GIVE_ARTIFACT_POWER_NO_BONUS = 242, // Unaffected by Artifact Knowledge
SPELL_EFFECT_APPLY_ENCHANT_ILLUSION = 243,
SPELL_EFFECT_LEARN_FOLLOWER_ABILITY = 244,
SPELL_EFFECT_UPGRADE_HEIRLOOM = 245,
SPELL_EFFECT_FINISH_GARRISON_MISSION = 246,
SPELL_EFFECT_ADD_GARRISON_MISSION = 247,
SPELL_EFFECT_FINISH_SHIPMENT = 248,
SPELL_EFFECT_FORCE_EQUIP_ITEM = 249,
SPELL_EFFECT_TAKE_SCREENSHOT = 250, // Serverside marker for selfie screenshot - achievement check
SPELL_EFFECT_SET_GARRISON_CACHE_SIZE = 251,
SPELL_EFFECT_TELEPORT_UNITS = 252,
SPELL_EFFECT_GIVE_HONOR = 253,
SPELL_EFFECT_DASH = 254,
SPELL_EFFECT_LEARN_TRANSMOG_SET = 255,
SPELL_EFFECT_256 = 256,
SPELL_EFFECT_257 = 257,
SPELL_EFFECT_MODIFY_KEYSTONE = 258,
SPELL_EFFECT_RESPEC_AZERITE_EMPOWERED_ITEM = 259,
SPELL_EFFECT_SUMMON_STABLED_PET = 260,
SPELL_EFFECT_SCRAP_ITEM = 261,
SPELL_EFFECT_262 = 262,
SPELL_EFFECT_REPAIR_ITEM = 263,
SPELL_EFFECT_REMOVE_GEM = 264,
SPELL_EFFECT_LEARN_AZERITE_ESSENCE_POWER = 265,
SPELL_EFFECT_266 = 266,
SPELL_EFFECT_CREATE_CONVERSATION_GLOBAL = 267,
SPELL_EFFECT_APPLY_MOUNT_EQUIPMENT = 268,
SPELL_EFFECT_UPGRADE_ITEM = 269,
SPELL_EFFECT_270 = 270,
SPELL_EFFECT_APPLY_AREA_AURA_PARTY_NONRANDOM = 271,
SPELL_EFFECT_SET_COVENANT = 272,
SPELL_EFFECT_CRAFT_RUNEFORGE_LEGENDARY = 273,
SPELL_EFFECT_274 = 274,
SPELL_EFFECT_275 = 275,
SPELL_EFFECT_LEARN_TRANSMOG_ILLUSION = 276,
SPELL_EFFECT_SET_CHROMIE_TIME = 277,
SPELL_EFFECT_278 = 278,
SPELL_EFFECT_LEARN_GARR_TALENT = 279,
SPELL_EFFECT_280 = 280,
SPELL_EFFECT_LEARN_SOULBIND_CONDUIT = 281,
SPELL_EFFECT_CONVERT_ITEMS_TO_CURRENCY = 282,
SPELL_EFFECT_283 = 283,
TOTAL_SPELL_EFFECTS
};
enum SpellCastResult
{
SPELL_FAILED_SUCCESS = 0,
SPELL_FAILED_AFFECTING_COMBAT = 1,
SPELL_FAILED_ALREADY_AT_FULL_HEALTH = 2,
SPELL_FAILED_ALREADY_AT_FULL_MANA = 3,
SPELL_FAILED_ALREADY_AT_FULL_POWER = 4,
SPELL_FAILED_ALREADY_BEING_TAMED = 5,
SPELL_FAILED_ALREADY_HAVE_CHARM = 6,
SPELL_FAILED_ALREADY_HAVE_SUMMON = 7,
SPELL_FAILED_ALREADY_HAVE_PET = 8,
SPELL_FAILED_ALREADY_OPEN = 9,
SPELL_FAILED_AURA_BOUNCED = 10,
SPELL_FAILED_AUTOTRACK_INTERRUPTED = 11,
SPELL_FAILED_BAD_IMPLICIT_TARGETS = 12,
SPELL_FAILED_BAD_TARGETS = 13,
SPELL_FAILED_PVP_TARGET_WHILE_UNFLAGGED = 14,
SPELL_FAILED_CANT_BE_CHARMED = 15,
SPELL_FAILED_CANT_BE_DISENCHANTED = 16,
SPELL_FAILED_CANT_BE_DISENCHANTED_SKILL = 17,
SPELL_FAILED_CANT_BE_ENCHANTED = 18,
SPELL_FAILED_CANT_BE_MILLED = 19,
SPELL_FAILED_CANT_BE_PROSPECTED = 20,
SPELL_FAILED_CANT_CAST_ON_TAPPED = 21,
SPELL_FAILED_CANT_DUEL_WHILE_INVISIBLE = 22,
SPELL_FAILED_CANT_DUEL_WHILE_STEALTHED = 23,
SPELL_FAILED_CANT_STEALTH = 24,
SPELL_FAILED_CANT_UNTALENT = 25,
SPELL_FAILED_CASTER_AURASTATE = 26,
SPELL_FAILED_CASTER_DEAD = 27,
SPELL_FAILED_CHARMED = 28,
SPELL_FAILED_CHEST_IN_USE = 29,
SPELL_FAILED_CONFUSED = 30,
SPELL_FAILED_DISABLED_BY_POWER_SCALING = 31,
SPELL_FAILED_DONT_REPORT = 32,
SPELL_FAILED_EQUIPPED_ITEM = 33,
SPELL_FAILED_EQUIPPED_ITEM_CLASS = 34,
SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND = 35,
SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND = 36,
SPELL_FAILED_ERROR = 37,
SPELL_FAILED_FALLING = 38,
SPELL_FAILED_FIZZLE = 39,
SPELL_FAILED_FLEEING = 40,
SPELL_FAILED_FOOD_LOWLEVEL = 41,
SPELL_FAILED_GARRISON_NOT_OWNED = 42,
SPELL_FAILED_GARRISON_OWNED = 43,
SPELL_FAILED_GARRISON_MAX_LEVEL = 44,
SPELL_FAILED_GARRISON_NOT_UPGRADEABLE = 45,
SPELL_FAILED_GARRISON_FOLLOWER_ON_MISSION = 46,
SPELL_FAILED_GARRISON_FOLLOWER_IN_BUILDING = 47,
SPELL_FAILED_GARRISON_FOLLOWER_MAX_LEVEL = 48,
SPELL_FAILED_GARRISON_FOLLOWER_MIN_ITEM_LEVEL = 49,
SPELL_FAILED_GARRISON_FOLLOWER_MAX_ITEM_LEVEL = 50,
SPELL_FAILED_GARRISON_FOLLOWER_MAX_QUALITY = 51,
SPELL_FAILED_GARRISON_FOLLOWER_NOT_MAX_LEVEL = 52,
SPELL_FAILED_GARRISON_FOLLOWER_HAS_ABILITY = 53,
SPELL_FAILED_GARRISON_FOLLOWER_HAS_SINGLE_MISSION_ABILITY = 54,
SPELL_FAILED_GARRISON_FOLLOWER_REQUIRES_EPIC = 55,
SPELL_FAILED_GARRISON_MISSION_NOT_IN_PROGRESS = 56,
SPELL_FAILED_GARRISON_MISSION_COMPLETE = 57,
SPELL_FAILED_GARRISON_NO_MISSIONS_AVAILABLE = 58,
SPELL_FAILED_HIGHLEVEL = 59,
SPELL_FAILED_HUNGER_SATIATED = 60,
SPELL_FAILED_IMMUNE = 61,
SPELL_FAILED_INCORRECT_AREA = 62,
SPELL_FAILED_INTERRUPTED = 63,
SPELL_FAILED_INTERRUPTED_COMBAT = 64,
SPELL_FAILED_ITEM_ALREADY_ENCHANTED = 65,
SPELL_FAILED_ITEM_GONE = 66,
SPELL_FAILED_ITEM_NOT_FOUND = 67,
SPELL_FAILED_ITEM_NOT_READY = 68,
SPELL_FAILED_LEVEL_REQUIREMENT = 69,
SPELL_FAILED_LINE_OF_SIGHT = 70,
SPELL_FAILED_LOWLEVEL = 71,
SPELL_FAILED_LOW_CASTLEVEL = 72,
SPELL_FAILED_MAINHAND_EMPTY = 73,
SPELL_FAILED_MOVING = 74,
SPELL_FAILED_NEED_AMMO = 75,
SPELL_FAILED_NEED_AMMO_POUCH = 76,
SPELL_FAILED_NEED_EXOTIC_AMMO = 77,
SPELL_FAILED_NEED_MORE_ITEMS = 78,
SPELL_FAILED_NOPATH = 79,
SPELL_FAILED_NOT_BEHIND = 80,
SPELL_FAILED_NOT_FISHABLE = 81,
SPELL_FAILED_NOT_FLYING = 82,
SPELL_FAILED_NOT_HERE = 83,
SPELL_FAILED_NOT_INFRONT = 84,
SPELL_FAILED_NOT_IN_CONTROL = 85,
SPELL_FAILED_NOT_KNOWN = 86,
SPELL_FAILED_NOT_MOUNTED = 87,
SPELL_FAILED_NOT_ON_TAXI = 88,
SPELL_FAILED_NOT_ON_TRANSPORT = 89,
SPELL_FAILED_NOT_READY = 90,
SPELL_FAILED_NOT_SHAPESHIFT = 91,
SPELL_FAILED_NOT_STANDING = 92,
SPELL_FAILED_NOT_TRADEABLE = 93,
SPELL_FAILED_NOT_TRADING = 94,
SPELL_FAILED_NOT_UNSHEATHED = 95,
SPELL_FAILED_NOT_WHILE_GHOST = 96,
SPELL_FAILED_NOT_WHILE_LOOTING = 97,
SPELL_FAILED_NO_AMMO = 98,
SPELL_FAILED_NO_CHARGES_REMAIN = 99,
SPELL_FAILED_NO_COMBO_POINTS = 100,
SPELL_FAILED_NO_DUELING = 101,
SPELL_FAILED_NO_ENDURANCE = 102,
SPELL_FAILED_NO_FISH = 103,
SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED = 104,
SPELL_FAILED_NO_MOUNTS_ALLOWED = 105,
SPELL_FAILED_NO_PET = 106,
SPELL_FAILED_NO_POWER = 107,
SPELL_FAILED_NOTHING_TO_DISPEL = 108,
SPELL_FAILED_NOTHING_TO_STEAL = 109,
SPELL_FAILED_ONLY_ABOVEWATER = 110,
SPELL_FAILED_ONLY_INDOORS = 111,
SPELL_FAILED_ONLY_MOUNTED = 112,
SPELL_FAILED_ONLY_OUTDOORS = 113,
SPELL_FAILED_ONLY_SHAPESHIFT = 114,
SPELL_FAILED_ONLY_STEALTHED = 115,
SPELL_FAILED_ONLY_UNDERWATER = 116,
SPELL_FAILED_OUT_OF_RANGE = 117,
SPELL_FAILED_PACIFIED = 118,
SPELL_FAILED_POSSESSED = 119,
SPELL_FAILED_REAGENTS = 120,
SPELL_FAILED_REQUIRES_AREA = 121,
SPELL_FAILED_REQUIRES_SPELL_FOCUS = 122,
SPELL_FAILED_ROOTED = 123,
SPELL_FAILED_SILENCED = 124,
SPELL_FAILED_SPELL_IN_PROGRESS = 125,
SPELL_FAILED_SPELL_LEARNED = 126,
SPELL_FAILED_SPELL_UNAVAILABLE = 127,
SPELL_FAILED_STUNNED = 128,
SPELL_FAILED_TARGETS_DEAD = 129,
SPELL_FAILED_TARGET_AFFECTING_COMBAT = 130,
SPELL_FAILED_TARGET_AURASTATE = 131,
SPELL_FAILED_TARGET_DUELING = 132,
SPELL_FAILED_TARGET_ENEMY = 133,
SPELL_FAILED_TARGET_ENRAGED = 134,
SPELL_FAILED_TARGET_FRIENDLY = 135,
SPELL_FAILED_TARGET_IN_COMBAT = 136,
SPELL_FAILED_TARGET_IN_PET_BATTLE = 137,
SPELL_FAILED_TARGET_IS_PLAYER = 138,
SPELL_FAILED_TARGET_IS_PLAYER_CONTROLLED = 139,
SPELL_FAILED_TARGET_NOT_DEAD = 140,
SPELL_FAILED_TARGET_NOT_IN_PARTY = 141,
SPELL_FAILED_TARGET_NOT_LOOTED = 142,
SPELL_FAILED_TARGET_NOT_PLAYER = 143,
SPELL_FAILED_TARGET_NO_POCKETS = 144,
SPELL_FAILED_TARGET_NO_WEAPONS = 145,
SPELL_FAILED_TARGET_NO_RANGED_WEAPONS = 146,
SPELL_FAILED_TARGET_UNSKINNABLE = 147,
SPELL_FAILED_THIRST_SATIATED = 148,
SPELL_FAILED_TOO_CLOSE = 149,
SPELL_FAILED_TOO_MANY_OF_ITEM = 150,
SPELL_FAILED_TOTEM_CATEGORY = 151,
SPELL_FAILED_TOTEMS = 152,
SPELL_FAILED_TRY_AGAIN = 153,
SPELL_FAILED_UNIT_NOT_BEHIND = 154,
SPELL_FAILED_UNIT_NOT_INFRONT = 155,
SPELL_FAILED_VISION_OBSCURED = 156,
SPELL_FAILED_WRONG_PET_FOOD = 157,
SPELL_FAILED_NOT_WHILE_FATIGUED = 158,
SPELL_FAILED_TARGET_NOT_IN_INSTANCE = 159,
SPELL_FAILED_NOT_WHILE_TRADING = 160,
SPELL_FAILED_TARGET_NOT_IN_RAID = 161,
SPELL_FAILED_TARGET_FREEFORALL = 162,
SPELL_FAILED_NO_EDIBLE_CORPSES = 163,
SPELL_FAILED_ONLY_BATTLEGROUNDS = 164,
SPELL_FAILED_TARGET_NOT_GHOST = 165,
SPELL_FAILED_TRANSFORM_UNUSABLE = 166,
SPELL_FAILED_WRONG_WEATHER = 167,
SPELL_FAILED_DAMAGE_IMMUNE = 168,
SPELL_FAILED_PREVENTED_BY_MECHANIC = 169,
SPELL_FAILED_PLAY_TIME = 170,
SPELL_FAILED_REPUTATION = 171,
SPELL_FAILED_MIN_SKILL = 172,
SPELL_FAILED_NOT_IN_RATED_BATTLEGROUND = 173,
SPELL_FAILED_NOT_ON_SHAPESHIFT = 174,
SPELL_FAILED_NOT_ON_STEALTHED = 175,
SPELL_FAILED_NOT_ON_DAMAGE_IMMUNE = 176,
SPELL_FAILED_NOT_ON_MOUNTED = 177,
SPELL_FAILED_TOO_SHALLOW = 178,
SPELL_FAILED_TARGET_NOT_IN_SANCTUARY = 179,
SPELL_FAILED_TARGET_IS_TRIVIAL = 180,
SPELL_FAILED_BM_OR_INVISGOD = 181,
SPELL_FAILED_GROUND_MOUNT_NOT_ALLOWED = 182,
SPELL_FAILED_FLOATING_MOUNT_NOT_ALLOWED = 183,
SPELL_FAILED_UNDERWATER_MOUNT_NOT_ALLOWED = 184,
SPELL_FAILED_FLYING_MOUNT_NOT_ALLOWED = 185,
SPELL_FAILED_APPRENTICE_RIDING_REQUIREMENT = 186,
SPELL_FAILED_JOURNEYMAN_RIDING_REQUIREMENT = 187,
SPELL_FAILED_EXPERT_RIDING_REQUIREMENT = 188,
SPELL_FAILED_ARTISAN_RIDING_REQUIREMENT = 189,
SPELL_FAILED_MASTER_RIDING_REQUIREMENT = 190,
SPELL_FAILED_COLD_RIDING_REQUIREMENT = 191,
SPELL_FAILED_FLIGHT_MASTER_RIDING_REQUIREMENT = 192,
SPELL_FAILED_CS_RIDING_REQUIREMENT = 193,
SPELL_FAILED_PANDA_RIDING_REQUIREMENT = 194,
SPELL_FAILED_DRAENOR_RIDING_REQUIREMENT = 195,
SPELL_FAILED_BROKEN_ISLES_RIDING_REQUIREMENT = 196,
SPELL_FAILED_MOUNT_NO_FLOAT_HERE = 197,
SPELL_FAILED_MOUNT_NO_UNDERWATER_HERE = 198,
SPELL_FAILED_MOUNT_ABOVE_WATER_HERE = 199,
SPELL_FAILED_MOUNT_COLLECTED_ON_OTHER_CHAR = 200,
SPELL_FAILED_NOT_IDLE = 201,
SPELL_FAILED_NOT_INACTIVE = 202,
SPELL_FAILED_PARTIAL_PLAYTIME = 203,
SPELL_FAILED_NO_PLAYTIME = 204,
SPELL_FAILED_NOT_IN_BATTLEGROUND = 205,
SPELL_FAILED_NOT_IN_RAID_INSTANCE = 206,
SPELL_FAILED_ONLY_IN_ARENA = 207,
SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE = 208,
SPELL_FAILED_ON_USE_ENCHANT = 209,
SPELL_FAILED_NOT_ON_GROUND = 210,
SPELL_FAILED_CUSTOM_ERROR = 211,
SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW = 212,
SPELL_FAILED_TOO_MANY_SOCKETS = 213,
SPELL_FAILED_INVALID_GLYPH = 214,
SPELL_FAILED_UNIQUE_GLYPH = 215,
SPELL_FAILED_GLYPH_SOCKET_LOCKED = 216,
SPELL_FAILED_GLYPH_EXCLUSIVE_CATEGORY = 217,
SPELL_FAILED_GLYPH_INVALID_SPEC = 218,
SPELL_FAILED_GLYPH_NO_SPEC = 219,
SPELL_FAILED_NO_ACTIVE_GLYPHS = 220,
SPELL_FAILED_NO_VALID_TARGETS = 221,
SPELL_FAILED_ITEM_AT_MAX_CHARGES = 222,
SPELL_FAILED_NOT_IN_BARBERSHOP = 223,
SPELL_FAILED_FISHING_TOO_LOW = 224,
SPELL_FAILED_ITEM_ENCHANT_TRADE_WINDOW = 225,
SPELL_FAILED_SUMMON_PENDING = 226,
SPELL_FAILED_MAX_SOCKETS = 227,
SPELL_FAILED_PET_CAN_RENAME = 228,
SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED = 229,
SPELL_FAILED_TARGET_HAS_RESURRECT_PENDING = 230,
SPELL_FAILED_NO_ACTIONS = 231,
SPELL_FAILED_CURRENCY_WEIGHT_MISMATCH = 232,
SPELL_FAILED_WEIGHT_NOT_ENOUGH = 233,
SPELL_FAILED_WEIGHT_TOO_MUCH = 234,
SPELL_FAILED_NO_VACANT_SEAT = 235,
SPELL_FAILED_NO_LIQUID = 236,
SPELL_FAILED_ONLY_NOT_SWIMMING = 237,
SPELL_FAILED_BY_NOT_MOVING = 238,
SPELL_FAILED_IN_COMBAT_RES_LIMIT_REACHED = 239,
SPELL_FAILED_NOT_IN_ARENA = 240,
SPELL_FAILED_TARGET_NOT_GROUNDED = 241,
SPELL_FAILED_EXCEEDED_WEEKLY_USAGE = 242,
SPELL_FAILED_NOT_IN_LFG_DUNGEON = 243,
SPELL_FAILED_BAD_TARGET_FILTER = 244,
SPELL_FAILED_NOT_ENOUGH_TARGETS = 245,
SPELL_FAILED_NO_SPEC = 246,
SPELL_FAILED_CANT_ADD_BATTLE_PET = 247,
SPELL_FAILED_CANT_UPGRADE_BATTLE_PET = 248,
SPELL_FAILED_WRONG_BATTLE_PET_TYPE = 249,
SPELL_FAILED_NO_DUNGEON_ENCOUNTER = 250,
SPELL_FAILED_NO_TELEPORT_FROM_DUNGEON = 251,
SPELL_FAILED_MAX_LEVEL_TOO_LOW = 252,
SPELL_FAILED_CANT_REPLACE_ITEM_BONUS = 253,
GRANT_PET_LEVEL_FAIL = 254,
SPELL_FAILED_SKILL_LINE_NOT_KNOWN = 255,
SPELL_FAILED_BLUEPRINT_KNOWN = 256,
SPELL_FAILED_FOLLOWER_KNOWN = 257,
SPELL_FAILED_CANT_OVERRIDE_ENCHANT_VISUAL = 258,
SPELL_FAILED_ITEM_NOT_A_WEAPON = 259,
SPELL_FAILED_SAME_ENCHANT_VISUAL = 260,
SPELL_FAILED_TOY_USE_LIMIT_REACHED = 261,
SPELL_FAILED_TOY_ALREADY_KNOWN = 262,
SPELL_FAILED_SHIPMENTS_FULL = 263,
SPELL_FAILED_NO_SHIPMENTS_FOR_CONTAINER = 264,
SPELL_FAILED_NO_BUILDING_FOR_SHIPMENT = 265,
SPELL_FAILED_NOT_ENOUGH_SHIPMENTS_FOR_CONTAINER = 266,
SPELL_FAILED_HAS_MISSION = 267,
SPELL_FAILED_BUILDING_ACTIVATE_NOT_READY = 268,
SPELL_FAILED_NOT_SOULBOUND = 269,
SPELL_FAILED_RIDING_VEHICLE = 270,
SPELL_FAILED_VETERAN_TRIAL_ABOVE_SKILL_RANK_MAX = 271,
SPELL_FAILED_NOT_WHILE_MERCENARY = 272,
SPELL_FAILED_SPEC_DISABLED = 273,
SPELL_FAILED_CANT_BE_OBLITERATED = 274,
SPELL_FAILED_CANT_BE_SCRAPPED = 275,
SPELL_FAILED_FOLLOWER_CLASS_SPEC_CAP = 276,
SPELL_FAILED_TRANSPORT_NOT_READY = 277,
SPELL_FAILED_TRANSMOG_SET_ALREADY_KNOWN = 278,
SPELL_FAILED_DISABLED_BY_AURA_LABEL = 279,
SPELL_FAILED_DISABLED_BY_MAX_USABLE_LEVEL = 280,
SPELL_FAILED_SPELL_ALREADY_KNOWN = 281,
SPELL_FAILED_MUST_KNOW_SUPERCEDING_SPELL = 282,
SPELL_FAILED_YOU_CANNOT_USE_THAT_IN_PVP_INSTANCE = 283,
SPELL_FAILED_NO_ARTIFACT_EQUIPPED = 284,
SPELL_FAILED_WRONG_ARTIFACT_EQUIPPED = 285,
SPELL_FAILED_TARGET_IS_UNTARGETABLE_BY_ANYONE = 286,
SPELL_FAILED_SPELL_EFFECT_FAILED = 287,
SPELL_FAILED_NEED_ALL_PARTY_MEMBERS = 288,
SPELL_FAILED_ARTIFACT_AT_FULL_POWER = 289,
SPELL_FAILED_AP_ITEM_FROM_PREVIOUS_TIER = 290,
SPELL_FAILED_AREA_TRIGGER_CREATION = 291,
SPELL_FAILED_AZERITE_EMPOWERED_ONLY = 292,
SPELL_FAILED_AZERITE_EMPOWERED_NO_CHOICES_TO_UNDO = 293,
SPELL_FAILED_WRONG_FACTION = 294,
SPELL_FAILED_NOT_ENOUGH_CURRENCY = 295,
SPELL_FAILED_BATTLE_FOR_AZEROTH_RIDING_REQUIREMENT = 296,
SPELL_FAILED_MOUNT_EQUIPMENT_ERROR = 297,
SPELL_FAILED_NOT_WHILE_LEVEL_LINKED = 298,
SPELL_FAILED_LEVEL_LINKED_LOW_LEVEL = 299,
SPELL_FAILED_SUMMON_MAP_CONDITION = 300,
SPELL_FAILED_SET_COVENANT_ERROR = 301,
SPELL_FAILED_RUNEFORGE_LEGENDARY_UPGRADE = 302,
SPELL_FAILED_SET_CHROMIE_TIME_ERROR = 303,
SPELL_FAILED_INELIGIBLE_WEAPON_APPEARANCE = 304,
SPELL_FAILED_PLAYER_CONDITION = 305,
SPELL_FAILED_NOT_WHILE_CHROMIE_TIMED = 306,
SPELL_FAILED_OPTIONAL_REAGENTS = 307,
SPELL_FAILED_UNKNOWN = 308,
// ok cast value - here in case a future version removes SPELL_FAILED_SUCCESS and we need to use a custom value (not sent to client either way)
SPELL_CAST_OK = SPELL_FAILED_SUCCESS
};
enum SpellCustomErrors
{
SPELL_CUSTOM_ERROR_NONE = 0,
SPELL_CUSTOM_ERROR_CUSTOM_MSG = 1, // Something bad happened, and we want to display a custom message!
SPELL_CUSTOM_ERROR_ALEX_BROKE_QUEST = 2, // Alex broke your quest! Thank him later!
SPELL_CUSTOM_ERROR_NEED_HELPLESS_VILLAGER = 3, // This spell may only be used on Helpless Wintergarde Villagers that have not been rescued.
SPELL_CUSTOM_ERROR_NEED_WARSONG_DISGUISE = 4, // Requires that you be wearing the Warsong Orc Disguise.
SPELL_CUSTOM_ERROR_REQUIRES_PLAGUE_WAGON = 5, // You must be closer to a plague wagon in order to drop off your 7th Legion Siege Engineer.
SPELL_CUSTOM_ERROR_CANT_TARGET_FRIENDLY_NONPARTY = 6, // You cannot target friendly units outside your party.
SPELL_CUSTOM_ERROR_NEED_CHILL_NYMPH = 7, // You must target a weakened chill nymph.
SPELL_CUSTOM_ERROR_MUST_BE_IN_ENKILAH = 8, // The Imbued Scourge Shroud will only work when equipped in the Temple City of En'kilah.
SPELL_CUSTOM_ERROR_REQUIRES_CORPSE_DUST = 9, // Requires Corpse Dust
SPELL_CUSTOM_ERROR_CANT_SUMMON_GARGOYLE = 10, // You cannot summon another gargoyle yet.
SPELL_CUSTOM_ERROR_NEED_CORPSE_DUST_IF_NO_TARGET = 11, // Requires Corpse Dust if the target is not dead and humanoid.
SPELL_CUSTOM_ERROR_MUST_BE_AT_SHATTERHORN = 12, // Can only be placed near Shatterhorn
SPELL_CUSTOM_ERROR_MUST_TARGET_PROTO_DRAKE_EGG = 13, // You must first select a Proto-Drake Egg.
SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_TREE = 14, // You must be close to a marked tree.
SPELL_CUSTOM_ERROR_MUST_TARGET_TURKEY = 15, // You must target a Fjord Turkey.
SPELL_CUSTOM_ERROR_MUST_TARGET_HAWK = 16, // You must target a Fjord Hawk.
SPELL_CUSTOM_ERROR_TOO_FAR_FROM_BOUY = 17, // You are too far from the bouy.
SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_OIL_SLICK = 18, // Must be used near an oil slick.
SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_BOUY = 19, // You must be closer to the buoy!
SPELL_CUSTOM_ERROR_WYRMREST_VANQUISHER = 20, // You may only call for the aid of a Wyrmrest Vanquisher in Wyrmrest Temple, The Dragon Wastes, Galakrond's Rest or The Wicked Coil.
SPELL_CUSTOM_ERROR_MUST_TARGET_ICE_HEART_JORMUNGAR = 21, // That can only be used on a Ice Heart Jormungar Spawn.
SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_SINKHOLE = 22, // You must be closer to a sinkhole to use your map.
SPELL_CUSTOM_ERROR_REQUIRES_HAROLD_LANE = 23, // You may only call down a stampede on Harold Lane.
SPELL_CUSTOM_ERROR_REQUIRES_GAMMOTH_MAGNATAUR = 24, // You may only use the Pouch of Crushed Bloodspore on Gammothra or other magnataur in the Bloodspore Plains and Gammoth.
SPELL_CUSTOM_ERROR_MUST_BE_IN_RESURRECTION_CHAMBER = 25, // Requires the magmawyrm resurrection chamber in the back of the Maw of Neltharion.
SPELL_CUSTOM_ERROR_CANT_CALL_WINTERGARDE_HERE = 26, // You may only call down a Wintergarde Gryphon in Wintergarde Keep or the Carrion Fields.
SPELL_CUSTOM_ERROR_MUST_TARGET_WILHELM = 27, // What are you doing? Only aim that thing at Wilhelm!
SPELL_CUSTOM_ERROR_NOT_ENOUGH_HEALTH = 28, // Not enough health!
SPELL_CUSTOM_ERROR_NO_NEARBY_CORPSES = 29, // There are no nearby corpses to use.
SPELL_CUSTOM_ERROR_TOO_MANY_GHOULS = 30, // You've created enough ghouls. Return to Gothik the Harvester at Death's Breach.
SPELL_CUSTOM_ERROR_GO_FURTHER_FROM_SUNDERED_SHARD = 31, // Your companion does not want to come here. Go further from the Sundered Shard.
SPELL_CUSTOM_ERROR_MUST_BE_IN_CAT_FORM = 32, // Must be in Cat Form
SPELL_CUSTOM_ERROR_MUST_BE_DEATH_KNIGHT = 33, // Only Death Knights may enter Ebon Hold.
SPELL_CUSTOM_ERROR_MUST_BE_IN_BEAR_FORM = 34, // Must be in Bear Form
SPELL_CUSTOM_ERROR_MUST_BE_NEAR_HELPLESS_VILLAGER = 35, // You must be within range of a Helpless Wintergarde Villager.
SPELL_CUSTOM_ERROR_CANT_TARGET_ELEMENTAL_MECHANICAL = 36, // You cannot target an elemental or mechanical corpse.
SPELL_CUSTOM_ERROR_MUST_HAVE_USED_DALARAN_CRYSTAL = 37, // This teleport crystal cannot be used until the teleport crystal in Dalaran has been used at least once.
SPELL_CUSTOM_ERROR_YOU_ALREADY_HOLD_SOMETHING = 38, // You are already holding something in your hand. You must throw the creature in your hand before picking up another.
SPELL_CUSTOM_ERROR_YOU_DONT_HOLD_ANYTHING = 39, // You don't have anything to throw! Find a Vargul and use Gymer Grab to pick one up!
SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_VALDURAN = 40, // Bouldercrag's War Horn can only be used within 10 yards of Valduran the Stormborn.
SPELL_CUSTOM_ERROR_NO_PASSENGER = 41, // You are not carrying a passenger. There is nobody to drop off.
SPELL_CUSTOM_ERROR_CANT_BUILD_MORE_VEHICLES = 42, // You cannot build any more siege vehicles.
SPELL_CUSTOM_ERROR_ALREADY_CARRYING_CRUSADER = 43, // You are already carrying a captured Argent Crusader. You must return to the Argent Vanguard infirmary and drop off your passenger before you may pick up another.
SPELL_CUSTOM_ERROR_CANT_DO_WHILE_ROOTED = 44, // You can't do that while rooted.
SPELL_CUSTOM_ERROR_REQUIRES_NEARBY_TARGET = 45, // Requires a nearby target.
SPELL_CUSTOM_ERROR_NOTHING_TO_DISCOVER = 46, // Nothing left to discover.
SPELL_CUSTOM_ERROR_NOT_ENOUGH_TARGETS = 47, // No targets close enough to bluff.
SPELL_CUSTOM_ERROR_CONSTRUCT_TOO_FAR = 48, // Your Iron Rune Construct is out of range.
SPELL_CUSTOM_ERROR_REQUIRES_GRAND_MASTER_ENGINEER = 49, // Requires Engineering (350)
SPELL_CUSTOM_ERROR_CANT_USE_THAT_MOUNT = 50, // You can't use that mount.
SPELL_CUSTOM_ERROR_NOONE_TO_EJECT = 51, // There is nobody to eject!
SPELL_CUSTOM_ERROR_TARGET_MUST_BE_BOUND = 52, // The target must be bound to you.
SPELL_CUSTOM_ERROR_TARGET_MUST_BE_UNDEAD = 53, // Target must be undead.
SPELL_CUSTOM_ERROR_TARGET_TOO_FAR = 54, // You have no target or your target is too far away.
SPELL_CUSTOM_ERROR_MISSING_DARK_MATTER = 55, // Missing Reagents: Dark Matter
SPELL_CUSTOM_ERROR_CANT_USE_THAT_ITEM = 56, // You can't use that item
SPELL_CUSTOM_ERROR_CANT_DO_WHILE_CYCYLONED = 57, // You can't do that while Cycloned
SPELL_CUSTOM_ERROR_TARGET_HAS_SCROLL = 58, // Target is already affected by a similar effect
SPELL_CUSTOM_ERROR_POISON_TOO_STRONG = 59, // That anti-venom is not strong enough to dispel that poison
SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED = 60, // You must have a lance equipped.
SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_MAIDEN = 61, // You must be near the Maiden of Winter's Breath Lake.
SPELL_CUSTOM_ERROR_LEARNED_EVERYTHING = 62, // You have learned everything from that book
SPELL_CUSTOM_ERROR_PET_IS_DEAD = 63, // Your pet is dead
SPELL_CUSTOM_ERROR_NO_VALID_TARGETS = 64, // There are no valid targets within range.
SPELL_CUSTOM_ERROR_GM_ONLY = 65, // Only GMs may use that. Your account has been reported for investigation.
SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_58 = 66, // You must reach level 58 to use this portal.
SPELL_CUSTOM_ERROR_AT_HONOR_CAP = 67, // You already have the maximum amount of honor.
SPELL_CUSTOM_ERROR_HAVE_HOT_ROD = 68, // You already have a Hot Rod.
SPELL_CUSTOM_ERROR_PARTYGOER_MORE_BUBBLY = 69, // This partygoer wants some more bubbly.
SPELL_CUSTOM_ERROR_PARTYGOER_NEED_BUCKET = 70, // This partygoer needs a bucket!
SPELL_CUSTOM_ERROR_PARTYGOER_WANT_TO_DANCE = 71, // This partygoer wants to dance with you.
SPELL_CUSTOM_ERROR_PARTYGOER_WANT_FIREWORKS = 72, // This partygoer wants to see some fireworks.
SPELL_CUSTOM_ERROR_PARTYGOER_WANT_APPETIZER = 73, // This partygoer wants some more hors d'oeuvres.
SPELL_CUSTOM_ERROR_GOBLIN_BATTERY_DEPLETED = 74, // The Goblin All-In-1-Der Belt's battery is depleted.
SPELL_CUSTOM_ERROR_MUST_HAVE_DEMONIC_CIRCLE = 75, // You must have a demonic circle active.
SPELL_CUSTOM_ERROR_AT_MAX_RAGE = 76, // You already have maximum rage
SPELL_CUSTOM_ERROR_REQUIRES_350_ENGINEERING = 77, // Requires Engineering (350)
SPELL_CUSTOM_ERROR_SOUL_BELONGS_TO_LICH_KING = 78, // Your soul belongs to the Lich King
SPELL_CUSTOM_ERROR_ATTENDANT_HAS_PONY = 79, // Your attendant already has an Argent Pony
SPELL_CUSTOM_ERROR_GOBLIN_STARTING_MISSION = 80, // First, Overload the Defective Generator, Activate the Leaky Stove, and Drop a Cigar on the Flammable Bed.
SPELL_CUSTOM_ERROR_GASBOT_ALREADY_SENT = 81, // You've already sent in the Gasbot and destroyed headquarters!
SPELL_CUSTOM_ERROR_GOBLIN_IS_PARTIED_OUT = 82, // This goblin is all partied out!
SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM = 83, // You must have a Magma, Flametongue, or Fire Elemental Totem active.
SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES = 84, // You may not bite other vampires.
SPELL_CUSTOM_ERROR_PET_ALREADY_AT_YOUR_LEVEL = 85, // Your pet is already at your level.
SPELL_CUSTOM_ERROR_MISSING_ITEM_REQUIREMENS = 86, // You do not meet the level requirements for this item.
SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS = 87, // There are too many Mutated Abominations.
SPELL_CUSTOM_ERROR_ALL_POTIONS_USED = 88, // The potions have all been depleted by Professor Putricide.
SPELL_CUSTOM_ERROR_DEFEATED_ENOUGH_ALREADY = 89, // You have already defeated enough of them.
SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_65 = 90, // Requires level 65
SPELL_CUSTOM_ERROR_DESTROYED_KTC_OIL_PLATFORM = 91, // You have already destroyed the KTC Oil Platform.
SPELL_CUSTOM_ERROR_LAUNCHED_ENOUGH_CAGES = 92, // You have already launched enough cages.
SPELL_CUSTOM_ERROR_REQUIRES_BOOSTER_ROCKETS = 93, // Requires Single-Stage Booster Rockets. Return to Hobart Grapplehammer to get more.
SPELL_CUSTOM_ERROR_ENOUGH_WILD_CLUCKERS = 94, // You have already captured enough wild cluckers.
SPELL_CUSTOM_ERROR_REQUIRES_CONTROL_FIREWORKS = 95, // Requires Remote Control Fireworks. Return to Hobart Grapplehammer to get more.
SPELL_CUSTOM_ERROR_MAX_NUMBER_OF_RECRUITS = 96, // You already have the max number of recruits.
SPELL_CUSTOM_ERROR_MAX_NUMBER_OF_VOLUNTEERS = 97, // You already have the max number of volunteers.
SPELL_CUSTOM_ERROR_FROSTMOURNE_RENDERED_RESURRECT = 98, // Frostmourne has rendered you unable to resurrect.
SPELL_CUSTOM_ERROR_CANT_MOUNT_WITH_SHAPESHIFT = 99, // You can't mount while affected by that shapeshift.
SPELL_CUSTOM_ERROR_FAWNS_ALREADY_FOLLOWING = 100, // Three fawns are already following you!
SPELL_CUSTOM_ERROR_ALREADY_HAVE_RIVER_BOAT = 101, // You already have a River Boat.
SPELL_CUSTOM_ERROR_NO_ACTIVE_ENCHANTMENT = 102, // You have no active enchantment to unleash.
SPELL_CUSTOM_ERROR_ENOUGH_HIGHBOURNE_SOULS = 103, // You have bound enough Highborne souls. Return to Arcanist Valdurian.
SPELL_CUSTOM_ERROR_ATLEAST_40YD_FROM_OIL_DRILLING = 104, // You must be at least 40 yards away from all other Oil Drilling Rigs.
SPELL_CUSTOM_ERROR_ABOVE_ENSLAVED_PEARL_MINER = 106, // You must be above the Enslaved Pearl Miner.
SPELL_CUSTOM_ERROR_MUST_TARGET_CORPSE_SPECIAL_1 = 107, // You must target the corpse of a Seabrush Terrapin, Scourgut Remora, or Spinescale Hammerhead.
SPELL_CUSTOM_ERROR_SLAGHAMMER_ALREADY_PRISONER = 108, // Ambassador Slaghammer is already your prisoner.
SPELL_CUSTOM_ERROR_REQUIRE_ATTUNED_LOCATION_1 = 109, // Requires a location that is attuned with the Naz'jar Battlemaiden.
SPELL_CUSTOM_ERROR_NEED_TO_FREE_DRAKE_FIRST = 110, // Free the Drake from the net first!
SPELL_CUSTOM_ERROR_DRAGONMAW_ALLIES_ALREADY_FOLLOW = 111, // You already have three Dragonmaw allies following you.
SPELL_CUSTOM_ERROR_REQUIRE_OPPOSABLE_THUMBS = 112, // Requires Opposable Thumbs.
SPELL_CUSTOM_ERROR_NOT_ENOUGH_HEALTH_2 = 113, // Not enough health
SPELL_CUSTOM_ERROR_ENOUGH_FORSAKEN_TROOPERS = 114, // You already have enough Forsaken Troopers.
SPELL_CUSTOM_ERROR_CANNOT_JUMP_TO_BOULDER = 115, // You cannot jump to another boulder yet.
SPELL_CUSTOM_ERROR_SKILL_TOO_HIGH = 116, // Skill too high.
SPELL_CUSTOM_ERROR_ALREADY_6_SURVIVORS_RESCUED = 117, // You have already rescued 6 Survivors.
SPELL_CUSTOM_ERROR_MUST_FACE_SHIPS_FROM_BALLOON = 118, // You need to be facing the ships from the rescue balloon.
SPELL_CUSTOM_ERROR_CANNOT_SUPERVISE_MORE_CULTISTS = 119, // You cannot supervise more than 5 Arrested Cultists at a time.
SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_85 = 120, // You must reach level 85 to use this portal.
SPELL_CUSTOM_ERROR_MUST_BE_BELOW_35_HEALTH = 121, // Your target must be below 35% health.
SPELL_CUSTOM_ERROR_MUST_SELECT_SPECIALIZATION = 122, // You must select a specialization first.
SPELL_CUSTOM_ERROR_TOO_WISE_AND_POWERFUL = 123, // You are too wise and powerful to gain any benefit from that item.
SPELL_CUSTOM_ERROR_TOO_CLOSE_ARGENT_LIGHTWELL = 124, // You are within 10 yards of another Argent Lightwell.
SPELL_CUSTOM_ERROR_NOT_WHILE_SHAPESHIFTED = 125, // You can't do that while shapeshifted.
SPELL_CUSTOM_ERROR_MANA_GEM_IN_BANK = 126, // You already have a Mana Gem in your bank.
SPELL_CUSTOM_ERROR_FLAME_SHOCK_NOT_ACTIVE = 127, // You must have at least one Flame Shock active.
SPELL_CUSTOM_ERROR_CANT_TRANSFORM = 128, // You cannot transform right now
SPELL_CUSTOM_ERROR_PET_MUST_BE_ATTACKING = 129, // Your pet must be attacking a target.
SPELL_CUSTOM_ERROR_GNOMISH_ENGINEERING = 130, // Requires Gnomish Engineering
SPELL_CUSTOM_ERROR_GOBLIN_ENGINEERING = 131, // Requires Goblin Engineering
SPELL_CUSTOM_ERROR_NO_TARGET = 132, // You have no target.
SPELL_CUSTOM_ERROR_PET_OUT_OF_RANGE = 133, // Your Pet is out of range of the target.
SPELL_CUSTOM_ERROR_HOLDING_FLAG = 134, // You can't do that while holding the flag.
SPELL_CUSTOM_ERROR_TARGET_HOLDING_FLAG = 135, // You can't do that to targets holding the flag.
SPELL_CUSTOM_ERROR_PORTAL_NOT_OPEN = 136, // The portal is not yet open. Continue helping the druids at the Sanctuary of Malorne.
SPELL_CUSTOM_ERROR_AGGRA_AIR_TOTEM = 137, // You need to be closer to Aggra's Air Totem, in the west.
SPELL_CUSTOM_ERROR_AGGRA_WATER_TOTEM = 138, // You need to be closer to Aggra's Water Totem, in the north.
SPELL_CUSTOM_ERROR_AGGRA_EARTH_TOTEM = 139, // You need to be closer to Aggra's Earth Totem, in the east.
SPELL_CUSTOM_ERROR_AGGRA_FIRE_TOTEM = 140, // You need to be closer to Aggra's Fire Totem, near Thrall.
SPELL_CUSTOM_ERROR_FACING_WRONG_WAY = 141, // You are facing the wrong way.
SPELL_CUSTOM_ERROR_TOO_CLOSE_TO_MAKESHIFT_DYNAMITE = 142, // You are within 10 yards of another Makeshift Dynamite.
SPELL_CUSTOM_ERROR_NOT_NEAR_SAPPHIRE_SUNKEN_SHIP = 143, // You must be near the sunken ship at Sapphire's End in the Jade Forest.
SPELL_CUSTOM_ERROR_DEMONS_HEALTH_FULL = 144, // That demon's health is already full.
SPELL_CUSTOM_ERROR_ONYX_SERPENT_NOT_OVERHEAD = 145, // Wait until the Onyx Serpent is directly overhead.
SPELL_CUSTOM_ERROR_OBJECTIVE_ALREADY_COMPLETE = 146, // Your objective is already complete.
SPELL_CUSTOM_ERROR_PUSH_SAD_PANDA_TOWARDS_TOWN = 147, // You can only push Sad Panda towards Sad Panda Town!
SPELL_CUSTOM_ERROR_TARGET_HAS_STARTDUST_2 = 148, // Target is already affected by Stardust No. 2.
SPELL_CUSTOM_ERROR_ELEMENTIUM_GEM_CLUSTERS = 149, // You cannot deconstruct Elementium Gem Clusters while collecting them!
SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_ENOUGH_HEALTH = 150, // You don't have enough health.
SPELL_CUSTOM_ERROR_YOU_CANNOT_USE_THE_GATEWAY_YET = 151, // You cannot use the gateway yet.
SPELL_CUSTOM_ERROR_CHOOSE_SPEC_FOR_ASCENDANCE = 152, // You must choose a specialization to use Ascendance.
SPELL_CUSTOM_ERROR_INSUFFICIENT_BLOOD_CHARGES = 153, // You have insufficient Blood Charges.
SPELL_CUSTOM_ERROR_NO_FULLY_DEPLETED_RUNES = 154, // No fully depleted runes.
SPELL_CUSTOM_ERROR_NO_MORE_CHARGES = 155, // No more charges.
SPELL_CUSTOM_ERROR_STATUE_IS_OUT_OF_RANGE_OF_TARGET = 156, // Statue is out of range of the target.
SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_A_STATUE_SUMMONED = 157, // You don't have a statue summoned.
SPELL_CUSTOM_ERROR_YOU_HAVE_NO_SPIRIT_ACTIVE = 158, // You have no spirit active.
SPELL_CUSTOM_ERROR_BOTH_DISESASES_MUST_BE_ON_TARGET = 159, // Both Frost Fever and Blood Plague must be present on the target.
SPELL_CUSTOM_ERROR_CANT_DO_THAT_WITH_ORB_OF_POWER = 160, // You can't do that while holding an Orb of Power.
SPELL_CUSTOM_ERROR_CANT_DO_THAT_WHILE_JUMPING_OR_FALLING = 161, // You can't do that while jumping or falling.
SPELL_CUSTOM_ERROR_MUST_BE_TRANSFORMED_BY_POLYFORMIC_ACID = 162, // You must be transformed by Polyformic Acid.
SPELL_CUSTOM_ERROR_NOT_ENOUGH_ACID_TO_STORE_TRANSFORMATION = 163, // There isn't enough acid left to store this transformation.
SPELL_CUSTOM_ERROR_MUST_HAVE_FLIGHT_MASTERS_LICENSE = 164, // You must obtain a Flight Master's License before using this spell.
SPELL_CUSTOM_ERROR_ALREADY_SAMPLED_SAP_FROM_FEEDER = 165, // You have already sampled sap from this Feeder.
SPELL_CUSTOM_ERROR_MUST_BE_NEWR_MANTID_FEEDER = 166, // Requires you to be near a Mantid Feeder in the Heart of Fear.
SPELL_CUSTOM_ERROR_TARGET_MUST_BE_IN_DIRECTLY_FRONT = 167, // Target must be directly in front of you.
SPELL_CUSTOM_ERROR_CANT_DO_THAT_WHILE_MYTHIC_KEYSTONE_IS_ACTIVE = 168, // You can't do that while a Mythic Keystone is active.
SPELL_CUSTOM_ERROR_WRONG_CLASS_FOR_MOUNT = 169, // You are not the correct class for that mount.
SPELL_CUSTOM_ERROR_NOTHING_LEFT_TO_DISCOVER = 170, // Nothing left to discover.
SPELL_CUSTOM_ERROR_NO_EXPLOSIVES_AVAILABLE = 171, // There are no explosives available.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_FLAGGED_FOR_PVP = 172, // You must be flagged for PvP.
SPELL_CUSTOM_ERROR_REQUIRES_BATTLE_RATIONS = 173, // Requires Battle Rations or Meaty Haunch
SPELL_CUSTOM_ERROR_REQUIRES_BRITTLE_ROOT = 174, // Requires Brittle Root
SPELL_CUSTOM_ERROR_REQUIRES_LABORERS_TOOL = 175, // Requires Laborer's Tool
SPELL_CUSTOM_ERROR_REQUIRES_UNEXPLODED_CANNONBALL = 176, // Requires Unexploded Cannonball
SPELL_CUSTOM_ERROR_REQUIRES_MISPLACED_KEG = 177, // Requires Misplaced Keg
SPELL_CUSTOM_ERROR_REQUIRES_LIQUID_FIRE = 178, // Requires Liquid Fire, Jungle Hops, or Spirit-kissed Water
SPELL_CUSTOM_ERROR_REQUIRES_KRASARI_IRON = 179, // Requires Krasari Iron
SPELL_CUSTOM_ERROR_REQUIRES_SPIRIT_KISSED_WATER = 180, // Requires Spirit-Kissed Water
SPELL_CUSTOM_ERROR_REQUIRES_SNAKE_OIL = 181, // Requires Snake Oil
SPELL_CUSTOM_ERROR_SCENARIO_IS_IN_PROGRESS = 182, // You can't do that while a Scenario is in progress.
SPELL_CUSTOM_ERROR_REQUIRES_DARKMOON_FAIRE_OPEN = 183, // Requires the Darkmoon Faire to be open.
SPELL_CUSTOM_ERROR_ALREADY_AT_VALOR_CAP = 184, // Already at Valor cap
SPELL_CUSTOM_ERROR_ALREADY_COMMENDED_BY_THIS_FACTION = 185, // Already commended by this faction
SPELL_CUSTOM_ERROR_OUT_OF_COINS = 186, // Out of coins! Pickpocket humanoids to get more.
SPELL_CUSTOM_ERROR_ONLY_ONE_ELEMENTAL_SPIRIT = 187, // Only one elemental spirit on a target at a time.
SPELL_CUSTOM_ERROR_DONT_KNOW_HOW_TO_TAME_DIREHORNS = 188, // You do not know how to tame Direhorns.
SPELL_CUSTOM_ERROR_MUST_BE_NEAR_BLOODIED_COURT_GATE = 189, // You must be near the Bloodied Court gate.
SPELL_CUSTOM_ERROR_YOU_ARE_NOT_ELECTRIFIED = 190, // You are not Electrified.
SPELL_CUSTOM_ERROR_THERE_IS_NOTHING_TO_BE_FETCHED = 191, // There is nothing to be fetched.
SPELL_CUSTOM_ERROR_REQUIRES_THE_THUNDER_FORGE = 192, // Requires The Thunder Forge.
SPELL_CUSTOM_ERROR_CANNOT_USE_THE_DICE_AGAIN_YET = 193, // You cannot use the dice again yet.
SPELL_CUSTOM_ERROR_ALREADY_MEMBER_OF_BRAWLERS_GUILD = 194, // You are already a member of the Brawler's Guild.
SPELL_CUSTOM_ERROR_CANT_CHANGE_SPEC_IN_CELESTIAL_CHALLENGE = 195, // You may not change talent specializations during a celestial challenge.
SPELL_CUSTOM_ERROR_SPEC_DOES_MATCH_CHALLENGE = 196, // Your talent specialization does not match the selected challenge.
SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_ENOUGH_CURRENCY = 197, // You don't have enough currency to do that.
SPELL_CUSTOM_ERROR_TARGET_CANNOT_BENEFIT_FROM_SPELL = 198, // Target cannot benefit from that spell
SPELL_CUSTOM_ERROR_YOU_CAN_ONLY_HAVE_ONE_HEALING_RAIN = 199, // You can only have one Healing Rain active at a time.
SPELL_CUSTOM_ERROR_THE_DOOR_IS_LOCKED = 200, // The door is locked.
SPELL_CUSTOM_ERROR_YOU_NEED_TO_SELECT_WAITING_CUSTOMER = 201, // You need to select a customer who is waiting in line first.
SPELL_CUSTOM_ERROR_CANT_CHANGE_SPEC_DURING_TRIAL = 202, // You may not change specialization while a trial is in progress.
SPELL_CUSTOM_ERROR_CUSTOMER_NEED_TO_GET_IN_LINE = 203, // You must wait for customers to get in line before you can select them to be seated.
SPELL_CUSTOM_ERROR_MUST_BE_CLOSER_TO_GAZLOWE_OBJECTIVE = 204, // Must be closer to one of Gazlowe's objectives to deploy!
SPELL_CUSTOM_ERROR_MUST_BE_CLOSER_TO_THAELIN_OBJECTIVE = 205, // Must be closer to one of Thaelin's objectives to deploy!
SPELL_CUSTOM_ERROR_YOUR_PACK_OF_VOLEN_IS_FULL = 206, // Your pack of volen is already full!
SPELL_CUSTOM_ERROR_REQUIRES_600_MINING_OR_BLACKSMITHING = 207, // Requires 600 Mining or Blacksmithing
SPELL_CUSTOM_ERROR_ARKONITE_PROTECTOR_NOT_IN_RANGE = 208, // The Arkonite Protector is not in range.
SPELL_CUSTOM_ERROR_TARGET_CANNOT_HAVE_BOTH_BEACONS = 209, // You are unable to have both Beacon of Light and Beacon of Faith on the same target.
SPELL_CUSTOM_ERROR_CAN_ONLY_USE_ON_AFK_PLAYER = 210, // Can only be used on AFK players.
SPELL_CUSTOM_ERROR_NO_LOOTABLE_CORPSES_IN_RANGE = 211, // No lootable corpse in range
SPELL_CUSTOM_ERROR_CHIMAERON_TOO_CALM_TO_TAME = 212, // Chimaeron is too calm to tame right now.
SPELL_CUSTOM_ERROR_CAN_ONLY_CARRY_ONE_TYPE_OF_MUNITIONS = 213, // You may only carry one type of Blackrock Munitions.
SPELL_CUSTOM_ERROR_OUT_OF_BLACKROCK_MUNITIONS = 214, // You have run out of Blackrock Munitions.
SPELL_CUSTOM_ERROR_CARRYING_MAX_AMOUNT_OF_MUNITIONS = 215, // You are carrying the maximum amount of Blackrock Munitions.
SPELL_CUSTOM_ERROR_TARGET_IS_TOO_FAR_AWAY = 216, // Target is too far away.
SPELL_CUSTOM_ERROR_CANNOT_USE_DURING_BOSS_ENCOUNTER = 217, // Cannot use during a boss encounter.
SPELL_CUSTOM_ERROR_MUST_HAVE_MELEE_WEAPON_IN_BOTH_HANDS = 218, // Must have a Melee Weapon equipped in both hands
SPELL_CUSTOM_ERROR_YOUR_WEAPON_HAS_OVERHEATED = 219, // Your weapon has overheated.
SPELL_CUSTOM_ERROR_MUST_BE_PARTY_LEADER_TO_QUEUE = 220, // You must be a party leader to queue your group.
SPELL_CUSTOM_ERROR_NOT_ENOUGH_FUEL = 221, // Not enough fuel
SPELL_CUSTOM_ERROR_YOU_ARE_ALREADY_DISGUISED = 222, // You are already disguised!
SPELL_CUSTOM_ERROR_YOU_NEED_TO_BE_IN_SHREDDER = 223, // You need to be in a Shredder to chop this up!
SPELL_CUSTOM_ERROR_FOOD_CANNOT_EAT_FOOD = 224, // Food cannot eat food
SPELL_CUSTOM_ERROR_MYSTERIOUS_FORCE_PREVENTS_OPENING_CHEST = 225, // A mysterious force prevents you from opening the chest.
SPELL_CUSTOM_ERROR_CANT_DO_THAT_WHILE_HOLDING_EMPOWERED_ORE = 226, // You can't do that while holding Empowered Ore.
SPELL_CUSTOM_ERROR_NOT_ENOUGH_AMMUNITION = 227, // Not enough Ammunition!
SPELL_CUSTOM_ERROR_YOU_NEED_BEATFACE_THE_GLADIATOR = 228, // You need Beatface the Sparring Arena gladiator to break this!
SPELL_CUSTOM_ERROR_YOU_CAN_ONLY_HAVE_ONE_WAYGATE = 229, // You can only have one waygate open. Disable an activated waygate first.
SPELL_CUSTOM_ERROR_YOU_CAN_ONLY_HAVE_TWO_WAYGATES = 230, // You can only have two waygates open. Disable an activated waygate first.
SPELL_CUSTOM_ERROR_YOU_CAN_ONLY_HAVE_THREE_WAYGATES = 231, // You can only have three waygates open. Disable an activated waygate first.
SPELL_CUSTOM_ERROR_REQUIRES_MAGE_TOWER = 232, // Requires Mage Tower
SPELL_CUSTOM_ERROR_REQUIRES_SPIRIT_LODGE = 233, // Requires Spirit Lodge
SPELL_CUSTOM_ERROR_FROST_WYRM_ALREADY_ACTIVE = 234, // A Frost Wyrm is already active.
SPELL_CUSTOM_ERROR_NOT_ENOUGH_RUNIC_POWER = 235, // Not enough Runic Power
SPELL_CUSTOM_ERROR_YOU_ARE_THE_PARTY_LEADER = 236, // You are the Party Leader.
SPELL_CUSTOM_ERROR_YULON_IS_ALREADY_ACTIVE = 237, // Yu'lon is already active.
SPELL_CUSTOM_ERROR_A_STAMPEDE_IS_ALREADY_ACTIVE = 238, // A Stampede is already active.
SPELL_CUSTOM_ERROR_YOU_ARE_ALREADY_WELL_FED = 239, // You are already Well Fed.
SPELL_CUSTOM_ERROR_CANT_DO_THAT_UNDER_SUPPRESSIVE_FIRE = 240, // You cannot do that while under Suppressive Fire.
SPELL_CUSTOM_ERROR_YOU_ALREADY_HAVE_MURLOC_SLOP = 241, // You already have a piece of Murloc Slop.
SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_ARTIFACT_FRAGMENTS = 242, // You don't have any Artifact Fragments.
SPELL_CUSTOM_ERROR_YOU_ARENT_IN_A_PARTY = 243, // You aren't in a Party.
SPELL_CUSTOM_ERROR_REQUIRES_20_AMMUNITION = 244, // Requires 30 Ammunition!
SPELL_CUSTOM_ERROR_REQUIRES_30_AMMUNITION = 245, // Requires 20 Ammunition!
SPELL_CUSTOM_ERROR_YOU_ALREADY_HAVE_MAX_OUTCAST_FOLLOWERS = 246, // You already have the maximum amount of Outcasts following you.
SPELL_CUSTOM_ERROR_NOT_IN_WORLD_PVP_ZONE = 247, // Not in World PvP zone.
SPELL_CUSTOM_ERROR_ALREADY_AT_RESOURCE_CAP = 248, // Already at Resource cap
SPELL_CUSTOM_ERROR_APEXIS_SENTINEL_REQUIRES_ENERGY = 249, // This Apexis Sentinel requires energy from a nearby Apexis Pylon to be powered up.
SPELL_CUSTOM_ERROR_YOU_MUST_HAVE_3_OR_FEWER_PLAYER = 250, // You must have 3 or fewer players.
SPELL_CUSTOM_ERROR_YOU_ALREADY_READ_TREASURE_MAP = 251, // You have already read that treasure map.
SPELL_CUSTOM_ERROR_MAY_ONLY_USE_WHILE_GARRISON_UNDER_ATTACK = 252, // You may only use this item while your garrison is under attack.
SPELL_CUSTOM_ERROR_REQUIRES_ACTIVE_MUSHROOMS = 253, // This spell requires active mushrooms for you to detonate.
SPELL_CUSTOM_ERROR_REQUIRES_FASTER_TIME_WITH_RACER = 254, // Requires a faster time with the basic racer
SPELL_CUSTOM_ERROR_REQUIRES_INFERNO_SHOT_AMMO = 255, // Requires Inferno Shot Ammo!
SPELL_CUSTOM_ERROR_YOU_CANNOT_DO_THAT_RIGHT_NOW = 256, // You cannot do that right now.
SPELL_CUSTOM_ERROR_A_TRAP_IS_ALREADY_PLACED_THERE = 257, // A trap is already placed there.
SPELL_CUSTOM_ERROR_YOU_ARE_ALREADY_ON_THAT_QUEST = 258, // You are already on that quest.
SPELL_CUSTOM_ERROR_REQUIRES_FELFORGED_CUDGEL = 259, // Requires a Felforged Cudgel!
SPELL_CUSTOM_ERROR_CANT_TAKE_WHILE_BEING_DAMAGED = 260, // Can't take while being damaged!
SPELL_CUSTOM_ERROR_YOU_ARE_BOUND_TO_DRAENOR = 261, // You are bound to Draenor by Archimonde's magic.
SPELL_CUSTOM_ERROR_ALREAY_HAVE_MAX_NUMBER_OF_SHIPS = 262, // You already have the maximum number of ships your shipyard can support.
SPELL_CUSTOM_ERROR_MUST_BE_AT_SHIPYARD = 263, // You must be at your shipyard.
SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_3_MAGE_TOWER = 264, // Requires a level 3 Mage Tower.
SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_3_SPIRIT_LODGE = 265, // Requires a level 3 Spirit Lodge.
SPELL_CUSTOM_ERROR_YOU_DO_NOT_LIKE_FEL_EGGS_AND_HAM = 266, // You do not like Fel Eggs and Ham.
SPELL_CUSTOM_ERROR_ALREADY_ENTERED_IN_THIS_AGREEMENT = 267, // You have already entered in to this trade agreement.
SPELL_CUSTOM_ERROR_CANNOT_STEAL_THAT_WHILE_GUARDS_ARE_ON_DUTY = 268, // You cannot steal that while guards are on duty.
SPELL_CUSTOM_ERROR_YOU_ALREADY_USED_VANTUS_RUNE = 269, // You have already used a Vantus Rune this week.
SPELL_CUSTOM_ERROR_THAT_ITEM_CANNOT_BE_OBLITERATED = 270, // That item cannot be obliterated.
SPELL_CUSTOM_ERROR_NO_SKINNABLE_CORPSE_IN_RANGE = 271, // No skinnable corpse in range
SPELL_CUSTOM_ERROR_MUST_BE_MERCENARY_TO_USE_TRINKET = 272, // You must be a Mercenary to use this trinket.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_IN_COMBAT = 273, // You must be in combat.
SPELL_CUSTOM_ERROR_NO_ENEMIES_NEAR_TARGET = 274, // No enemies near target.
SPELL_CUSTOM_ERROR_REQUIRES_LEYSPINE_MISSILE = 275, // Requires a Leyspine Missile
SPELL_CUSTOM_ERROR_REQUIRES_BOTH_CURRENTS_CONNECTED = 276, // Requires both currents connected.
SPELL_CUSTOM_ERROR_CANT_DO_THAT_IN_DEMON_FORM = 277, // Can't do that while in demon form (yet)
SPELL_CUSTOM_ERROR_YOU_DONT_KNOW_HOW_TO_TAME_MECHS = 278, // You do not know how to tame or obtain lore about Mechs.
SPELL_CUSTOM_ERROR_CANNOT_CHARM_ANY_MORE_WITHERED = 279, // You cannot charm any more withered.
SPELL_CUSTOM_ERROR_REQUIRES_ACTIVE_HEALING_RAIN = 280, // Requires an active Healing Rain.
SPELL_CUSTOM_ERROR_ALREADY_COLLECTED_APPEARANCES = 281, // You've already collected these appearances
SPELL_CUSTOM_ERROR_CANNOT_RESURRECT_SURRENDERED_TO_MADNESS = 282, // Cannot resurrect someone who has surrendered to madness
SPELL_CUSTOM_ERROR_YOU_MUST_BE_IN_CAT_FORM = 283, // You must be in Cat Form.
SPELL_CUSTOM_ERROR_YOU_CANNOT_RELEASE_SPIRIT_YET = 284, // You cannot Release Spirit yet.
SPELL_CUSTOM_ERROR_NO_FISHING_NODES_NEARBY = 285, // No fishing nodes nearby.
SPELL_CUSTOM_ERROR_YOU_ARE_NOT_IN_CORRECT_SPEC = 286, // You are not the correct specialization.
SPELL_CUSTOM_ERROR_ULTHALESH_HAS_NO_POWER_WITHOUT_SOULS = 287, // Ulthalesh has no power without souls.
SPELL_CUSTOM_ERROR_CANNOT_CAST_THAT_WITH_VOODOO_TOTEM = 288, // You cannot cast that while talented into Voodoo Totem.
SPELL_CUSTOM_ERROR_ALREADY_COLLECTED_THIS_APPEARANCE = 289, // You've already collected this appearance.
SPELL_CUSTOM_ERROR_YOUR_PET_MAXIMUM_IS_ALREADY_HIGH = 290, // Your total pet maximum is already this high.
SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_ENOUGH_WITHERED = 291, // You do not have enough withered to do that.
SPELL_CUSTOM_ERROR_REQUIRES_NEARBY_SOUL_FRAGMENT = 292, // Requires a nearby Soul Fragment.
SPELL_CUSTOM_ERROR_REQUIRES_AT_LEAST_10_WITHERED = 293, // Requires at least 10 living withered
SPELL_CUSTOM_ERROR_REQUIRES_AT_LEAST_14_WITHERED = 294, // Requires at least 14 living withered
SPELL_CUSTOM_ERROR_REQUIRES_AT_LEAST_18_WITHERED = 295, // Requires at least 18 living withered
SPELL_CUSTOM_ERROR_REQUIRES_2_WITHERED_MANA_RAGERS = 296, // Requires 2 Withered Mana-Ragers
SPELL_CUSTOM_ERROR_REQUIRES_1_WITHERED_BERSERKE = 297, // Requires 1 Withered Berserker
SPELL_CUSTOM_ERROR_REQUIRES_2_WITHERED_BERSERKER = 298, // Requires 2 Withered Berserkers
SPELL_CUSTOM_ERROR_TARGET_HEALTH_IS_TOO_LOW = 299, // Target's health is too low
SPELL_CUSTOM_ERROR_CANNOT_SHAPESHIFT_WHILE_RIDING_STORMTALON = 300, // You cannot shapeshift while riding Stormtalon
SPELL_CUSTOM_ERROR_CANNOT_CHANGE_SPEC_IN_COMBAT_TRAINING = 301, // You can not change specializations while in Combat Training.
SPELL_CUSTOM_ERROR_UNKNOWN_PHENOMENON_PREVENTS_LEYLINE_CONNECTION = 302, // Unknown phenomenon is preventing a connection to the Leyline.
SPELL_CUSTOM_ERROR_THE_NIGHTMARE_OBSCURES_YOUR_VISION = 303, // The Nightmare obscures your vision.
SPELL_CUSTOM_ERROR_YOU_ARE_IN_WRONG_CLASS_SPEC = 304, // You are in the wrong class specialization.
SPELL_CUSTOM_ERROR_THERE_ARE_NO_VALID_CORPSES_NEARBY = 305, // There are no valid corpses nearby.
SPELL_CUSTOM_ERROR_CANT_CAST_THAT_RIGHT_NOW = 306, // Can't cast that right now.
SPELL_CUSTOM_ERROR_NOT_ENOUGH_ANCIENT_MAN = 307, // Not enough Ancient Mana.
SPELL_CUSTOM_ERROR_REQUIRES_SONG_SCROLL = 308, // Requires a Song Scroll to function.
SPELL_CUSTOM_ERROR_MUST_HAVE_ARTIFACT_EQUIPPED = 309, // You must have an artifact weapon equipped.
SPELL_CUSTOM_ERROR_REQUIRES_CAT_FORM = 310, // Requires Cat Form.
SPELL_CUSTOM_ERROR_REQUIRES_BEAR_FORM = 311, // Requires Bear Form.
SPELL_CUSTOM_ERROR_REQUIRES_CONJURED_FOOD = 312, // Requires either a Conjured Mana Pudding or Conjured Mana Fritter.
SPELL_CUSTOM_ERROR_REQUIRES_ARTIFACT_WEAPON = 313, // Requires an artifact weapon.
SPELL_CUSTOM_ERROR_YOU_CANT_CAST_THAT_HERE = 314, // You can't cast that here
SPELL_CUSTOM_ERROR_CANT_DO_THAT_ON_CLASS_TRIAL = 315, // You cannot do that while on a Class Trial.
SPELL_CUSTOM_ERROR_RITUAL_OF_DOOM_ONCE_PER_DAY = 316, // You can only benefit from the Ritual of Doom once per day.
SPELL_CUSTOM_ERROR_CANNOT_RITUAL_OF_DOOM_WHILE_SUMMONING_SITERS = 317, // You cannot perform the Ritual of Doom while attempting to summon the sisters.
SPELL_CUSTOM_ERROR_LEARNED_ALL_THAT_YOU_CAN_ABOUT_YOUR_ARTIFACT = 318, // You have learned all that you can about your artifact.
SPELL_CUSTOM_ERROR_CANT_CALL_PET_WITH_LONE_WOLF = 319, // You cannot use Call Pet while Lone Wolf is active.
SPELL_CUSTOM_ERROR_TARGET_CANNOT_ALREADY_HAVE_ORB_OF_POWER = 320, // Target cannot already have a Orb of Power.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_IN_AN_INN_TO_STRUM_THAT_GUITAR = 321, // You must be in an inn to strum that guitar.
SPELL_CUSTOM_ERROR_YOU_CANNOT_REACH_THE_LATCH = 322, // You cannot reach the latch.
SPELL_CUSTOM_ERROR_REQUIRES_A_BRIMMING_KEYSTONE = 323, // Requires a Brimming Keystone.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_WIELDING_THE_UNDERLIGHT_ANGLER = 324, // You must be wielding the Underlight Angler.
SPELL_CUSTOM_ERROR_YOUR_TARGET_MUST_BE_SHACKLED = 325, // Your target must be Shackled.
SPELL_CUSTOM_ERROR_YOU_ALREADY_POSSES_ALL_OF_THE_KNOWLEDGE_CONTAINED_IN_THOSE_PAGES = 326, // You already possess all of the knowledge contained in these pages.
SPELL_CUSTOM_ERROR_YOU_CANT_RISK_GETTING_THE_GRUMMELS_WET = 327, // You can't risk getting the grummels wet!
SPELL_CUSTOM_ERROR_YOU_CANNOT_CHANGE_SPECIALIZATION_RIGHT_NOW = 328, // You cannot change specializations right now.
SPELL_CUSTOM_ERROR_YOUVE_REACHED_THE_MAXIMUM_NUMBER_OF_ARTIFACT_RESEARCH_NOTES_AVAILABLE = 329, // You've reached the maximum number of Artifact Research Notes available.
SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_ENOUGH_NETHERSHARDS = 330, // You don't have enough Nethershards.
SPELL_CUSTOM_ERROR_THE_SENTINAX_IS_NOT_PATROLLING_THIS_AREA = 331, // The Sentinax is not patrolling this area.
SPELL_CUSTOM_ERROR_THE_SENTINAX_CANNOT_OPEN_ANOTHER_PORTAL_RIGHT_NOW = 332, // The Sentinax cannot open another portal right now.
SPELL_CUSTOM_ERROR_YOU_CANNOT_GAIN_ADDITIONAL_REPUTATION_WITH_THIS_ITEM = 333, // You cannot gain additional reputation with this item.
SPELL_CUSTOM_ERROR_CANT_DO_THAT_WHILE_GHOST_WOLF_FORM = 334, // Can't do that while in Ghost Wolf form.
SPELL_CUSTOM_ERROR_YOUR_SUPPLIES_ARE_FROZEN = 335, // Your supplies are frozen.
SPELL_CUSTOM_ERROR_YOU_DO_NOT_KNOW_HOW_TO_TAME_FEATHERMANES = 336, // You do not know how to tame Feathermanes.
SPELL_CUSTOM_ERROR_YOU_MUST_REACH_ARTIFACT_KNOWLEDGE_LEVEL_25 = 337, // You must reach Artifact Knowledge level 25 to use the Tome.
SPELL_CUSTOM_ERROR_REQUIRES_A_NETHER_PORTAL_DISRUPTOR = 338, // Requires a Nether Portal Disruptor.
SPELL_CUSTOM_ERROR_YOU_ARE_NOT_THE_CORRECT_RANK_TO_USE_THIS_ITEM = 339, // You are not the correct Rank to use this item.
SPELL_CUSTOM_ERROR_MUST_BE_STANDING_NEAR_INJURED_CHROMIE_IN_MOUNT_HYJAL = 340, // Must be standing near the injured Chromie in Mount Hyjal.
SPELL_CUSTOM_ERROR_THERES_NOTHING_FURTHER_YOU_CAN_LEARN = 341, // There's nothing further you can learn.
SPELL_CUSTOM_ERROR_REMOVE_CANNONS_HEAVY_IRON_PLATING_FIRST = 342, // You should remove the cannon's Heavy Iron Plating first.
SPELL_CUSTOM_ERROR_REMOVE_CANNONS_ELECTROKINETIC_DEFENSE_GRID_FIRST = 343, // You should remove the cannon's Electrokinetic Defense Grid first.
SPELL_CUSTOM_ERROR_REQUIRES_THE_ARMORY_KEY_AND_DENDRITE_CLUSTERS = 344, // You are missing pieces of the Armory Key or do not have enough Dendrite Clusters.
SPELL_CUSTOM_ERROR_THIS_ITEM_REQUIRES_BASIC_OBLITERUM_TO_UPGRADE = 345, // This item requires basic Obliterum to upgrade.
SPELL_CUSTOM_ERROR_THIS_ITEM_REQUIRES_PRIMAL_OBLITERUM_TO_UPGRADE = 346, // This item requires Primal Obliterum to upgrade.
SPELL_CUSTOM_ERROR_THIS_ITEM_REQUIRES_FLIGHT_MASTERS_WHISTLE = 347, // This item requires a Flight Master's Whistle.
SPELL_CUSTOM_ERROR_REQUIRES_MORRISONS_MASTER_KEY = 348, // Requires Morrison's Master Key.
SPELL_CUSTOM_ERROR_REQUIRES_POWER_THAT_ECHOES_THAT_OF_THE_AUGARI = 349, // Will only open to one wielding the power that echoes that of the Augari.
SPELL_CUSTOM_ERROR_THAT_PLAYER_HAS_A_PENDING_TOTEMIC_REVIVAL = 350, // That player has a pending Totemic Revival.
SPELL_CUSTOM_ERROR_YOU_HAVE_NO_FIRE_MINES_DEPLOYED = 351, // You have no Fire Mines deployed.
SPELL_CUSTOM_ERROR_MUST_BE_AFFECTED_BY_SPIRIT_POWDER = 352, // You must be affected by the Spirit Powder to take the phylactery.
SPELL_CUSTOM_ERROR_YOU_ARE_BLOCKED_BY_A_STRUCTURE_ABOVE_YOU = 353, // You are blocked by a structure above you.
SPELL_CUSTOM_ERROR_REQUIRES_100_IMP_MEAT = 354, // Requires 100 Imp Meat.
SPELL_CUSTOM_ERROR_YOU_HAVE_NOT_OBTAINED_ANY_BACKGROUND_FILTERS = 355, // You have not obtained any background filters.
SPELL_CUSTOM_ERROR_NOTHING_INTERESTING_POSTED_HERE_RIGHT_NOW = 356, // There is nothing interesting posted here right now.
SPELL_CUSTOM_ERROR_PARAGON_REPUTATION_REQUIRES_HIGHER_LEVEL = 357, // Paragon Reputation is not available until a higher level.
SPELL_CUSTOM_ERROR_UUNA_IS_MISSING = 358, // Uuna is missing.
SPELL_CUSTOM_ERROR_ONLY_OTHER_HIVEMIND_MEMBERS_MAY_JOIN = 359, // Only other members of their Hivemind may join with them.
SPELL_CUSTOM_ERROR_NO_VALID_FLASK_PRESENT = 360, // No valid flask present.
SPELL_CUSTOM_ERROR_NO_WILD_IMPS_TO_SACRIFICE = 361, // There are no Wild Imps to sacrifice.
SPELL_CUSTOM_ERROR_YOU_ARE_CARRYING_TOO_MUCH_IRON = 362, // You are carrying too much Iron
SPELL_CUSTOM_ERROR_YOU_HAVE_NO_IRON_TO_COLLECT = 363, // You have no Iron to collect
SPELL_CUSTOM_ERROR_YOU_HAVE_NO_WILD_IMPS = 364, // You have no available Wild Imps.
SPELL_CUSTOM_ERROR_NEEDS_REPAIRS = 365, // Needs repairs.
SPELL_CUSTOM_ERROR_YOU_ARE_CARRYING_TOO_MUCH_WOOD = 366, // You're carrying too much wood.
SPELL_CUSTOM_ERROR_YOU_ARE_ALREADY_CARRYING_REPAIR_PARTS = 367, // You're already carrying repair parts.
SPELL_CUSTOM_ERROR_YOU_HAVE_NOT_UNLOCKED_FLIGHT_WHISTLE_FOR_ZONE = 368, // You have not unlocked the Flight Whistle for this zone.
SPELL_CUSTOM_ERROR_THERE_ARE_NO_UNLOCKED_FLIGHT_POINTS_NEARBY = 369, // There are no unlocked flight points nearby to take you to.
SPELL_CUSTOM_ERROR_YOU_MUST_HAVE_A_FELGUARD = 370, // You must have a Felguard.
SPELL_CUSTOM_ERROR_TARGET_HAS_NO_FESTERING_WOUNDS = 371, // The target has no Festering Wounds.
SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_DEADLY_OR_WOUND_POISON_ACTIVE = 372, // You do not have Deadly Poison or Wound Poison active.
SPELL_CUSTOM_ERROR_CANNOT_READ_SOLDIER_DOG_TAG_WITHOUT_HEADLAMP_ON = 373, // You cannot read the soldier's dog tag without your headlamp on.
SPELL_CUSTOM_ERROR_YOU_HAVE_NO_WOOD_TO_COLLECT = 374, // You have no Wood to collect.
SPELL_CUSTOM_ERROR_YOU_ARE_NOT_WEARING_A_SHIRT = 375, // You are not wearing a shirt!
SPELL_CUSTOM_ERROR_TARGET_MUST_BE_DEAD = 376, // Target must be dead.
SPELL_CUSTOM_ERROR_YOUR_TARGET_IS_ALREADY_EMBIGGIFIED = 377, // Your target is already embiggified.
SPELL_CUSTOM_ERROR_YOU_MUST_TARGET_A_SINISTER_GLADIATOR_ITEM = 378, // You must target a Sinister Gladiator's item to upgrade.
SPELL_CUSTOM_ERROR_THIS_ITEM_LEVEL_IS_TOO_HIGH_FOR_THIS_UPGRADE = 379, // This item's level is too high for this upgrade.
SPELL_CUSTOM_ERROR_THE_BALLISTA_CANNOT_BE_USED_WHILE_ON_FIRE = 380, // The ballista cannot be used while on fire.
SPELL_CUSTOM_ERROR_YOU_MUST_TARGET_A_DREAD_GLADIATOR_ITEM = 381, // You must target a Dread Gladiator's item to upgrade.
SPELL_CUSTOM_ERROR_YOU_DO_KNOT_KNOW_HOW_TO_TAME_BLOOD_BEASTS = 382, // You do not know how to tame Blood Beasts.
SPELL_CUSTOM_ERROR_CAN_ONLY_BE_USED_IN_THE_EVENING = 385, // Can only be used in the evening.
SPELL_CUSTOM_ERROR_REQUIRES_PAKU_TO_BE_YOUR_CHOSEN_LOA = 386, // Requires Pa'ku to be your chosen loa.
SPELL_CUSTOM_ERROR_REQUIRES_VIGOR_ENGAGED = 387, // Requires V.I.G.O.R. Engaged.
SPELL_CUSTOM_ERROR_YOUR_TARGET_IS_NOT_HUNGRY = 388, // Your target is not hungry.
SPELL_CUSTOM_ERROR_YOU_CAN_ONLY_HAVE_ON_TREASURE_MAP_MISSION = 389, // You can only have one treasure map mission at a time.
SPELL_CUSTOM_ERROR_YOU_ALREADY_HAVE_A_SILAS_SPHERE_OF_TRANSMUTATION = 390, // You already have a Silas' Sphere of Transmuation.
SPELL_CUSTOM_ERROR_YOU_DO_NOT_HAVE_THE_MALLET_OF_THUNDEROUS_SKINS = 391, // You do not have the Mallet of Thunderous Skins.
SPELL_CUSTOM_ERROR_YOU_MUST_HAVE_AN_OPEN_STABLE_SLOT = 393, // You must have an open stable slot.
SPELL_CUSTOM_ERROR_DOES_NOT_WORK_ON_CRITTERS = 394, // Does not work on critters.
SPELL_CUSTOM_ERROR_CAN_ONLY_BE_USED_ON_HATI = 395, // Can only be used on Hati.
SPELL_CUSTOM_ERROR_YOU_ALREADY_HAVE_IWENS_ENCHANTING_ROD = 396, // You already have an Iwen's Enchanting Rod.
SPELL_CUSTOM_ERROR_YOU_ALREADY_HAVE_MALLET_OF_THUNDEROUS_SKINS = 397, // You already have a Mallet of Thunderous Skins.
SPELL_CUSTOM_ERROR_CAN_ONLY_BE_USED_ON_INERT_TIDE_WATCHERS_OR_VOODOO_MASKS = 398, // Can only be used on Inert Tide Watchers or Inert Voodoo Masks.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_AT_SHRINE_TO_MAKE_OFFERING_TO_LOA = 399, // You must be at a Shrine to make an offering to a Loa.
SPELL_CUSTOM_ERROR_REQUIRES_EMERALD_EMPOWERMENT = 400, // Requires Emerald Empowerment.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_AN_HONORED_TAUREN = 401, // You must be an honored tauren.
SPELL_CUSTOM_ERROR_REQUIRES_CHITTERSPINE_MEAT = 402, // Requires Chitterspine Meat.
SPELL_CUSTOM_ERROR_REQUIRES_HEART_FORGE = 403, // Requires Heart Forge.
SPELL_CUSTOM_ERROR_NOT_AUTHORIZED_TO_ACCESS_CHARGING_STATION = 405, // You are not authorized to access this Charging Station. Speak to Flux.
SPELL_CUSTOM_ERROR_REQUIRES_MARDIVAS_ARCANE_COFFER = 406, // Requires Mardivas's Arcane Coffer
SPELL_CUSTOM_ERROR_REQUIRES_HEART_OF_AZEROTH_ATOP_HEART_FORGE = 407, // Requires Heart of Azeroth placed atop Heart Forge.
SPELL_CUSTOM_ERROR_REQUIRES_BRINESTONE_PICKAXE = 408, // Requires a Brinestone Pickaxe.
SPELL_CUSTOM_ERROR_YOU_ALREADY_COLLECTED_DATA_ON_THIS_TARGET = 409, // You have already collected data on this target.
SPELL_CUSTOM_ERROR_YOU_ALREADY_HAVE_THIS_ESSENCE_FOR_CURRENT_SPEC = 410, // You already have this Essence for your current loot specialization
SPELL_CUSTOM_ERROR_YOU_CANNOT_SUMMON_ANOTHER_PET_WHILE_RIDING_HATI = 411, // You cannot summon another pet while riding Hati.
SPELL_CUSTOM_ERROR_YOU_HAVE_ALREADY_COLLECTED_THIS_AZEROTH_MINI = 422, // You have already collected this Azeroth Mini
SPELL_CUSTOM_ERROR_YOUR_TARGET_IS_ALREADY_AFFECTED_BY_TEA_TIME = 412, // Your target is already affected by Tea Time!
SPELL_CUSTOM_ERROR_YOU_MUST_COMPLETE_QUEST_THE_HEART_FORGE_TO_INFUSE_ESSENCE = 413, // You must complete the quest "The Heart Forge" to infuse an Essence
SPELL_CUSTOM_ERROR_THIS_TARGET_DOES_NOT_HAVE_YOUR_RAZOR_CORAL = 414, // This target does not have your Razor Coral.
SPELL_CUSTOM_ERROR_YOU_DO_NOT_HAVE_ENOUGH_OF_THAT_ITEM = 415, // You do not have enough of that item.
SPELL_CUSTOM_ERROR_YOUR_TARGET_IS_NOT_WEARING_UNBOUND_CURSED_LOVERS_RING = 417, // Your target is not wearing an unbound Cursed Lover's Ring
SPELL_CUSTOM_ERROR_YOUR_CURSED_LOVERS_RING_IS_ALREDY_BOUND = 418, // Your Cursed Lover's Ring is already bound
SPELL_CUSTOM_ERROR_YOU_MUST_TARGET_A_NOTORIUS_GLADIATOR_ITEM = 421, // You must target a Notorious Gladiator's item to upgrade.
SPELL_CUSTOM_ERROR_YOU_CANT_CARRY_MORE_PICKAXES_CHUM_SEEDS = 423, // You can't carry any more Brinestone Pickaxes, Chum, or Germinating Seeds.
SPELL_CUSTOM_ERROR_REQUIRES_HOLIDAY_FEAST_OF_WINTER_WEIL = 424, // Requires holiday: Feast of Winter Veil
SPELL_CUSTOM_ERROR_REQUIRES_ASHJRAKAMAS_SHROUD_OF_RESOLVE = 425, // Requires Ashjra'kamas, Shroud of Resolve.
SPELL_CUSTOM_ERROR_REQUIRES_WAR_MODE = 426, // Requires War Mode.
SPELL_CUSTOM_ERROR_ONLY_ONE_OF_THIS_MASK_MAY_BE_WORN = 427, // Only one of this mask may be worn.
SPELL_CUSTOM_ERROR_YOU_CANNOT_ASCEND_WHILE_THE_TARRAGRUE_IS_NEARBY = 428, // You cannot ascend while the Tarragrue is nearby.
SPELL_CUSTOM_ERROR_TARGET_DOES_NOT_HAVE_A_VALID_AZERITE_ESSENCE = 429, // Target does not have a valid Azerite Essence.
SPELL_CUSTOM_ERROR_YOUR_MIND_IS_STILL_RECOVERING_FROM_RECENT_VISION = 430, // Your mind is still recovering from a recent vision.
SPELL_CUSTOM_ERROR_REQUIRES_VESSEL_OF_HORRIFIC_VISIONS = 431, // Requires Vessel of Horrific Visions.
SPELL_CUSTOM_ERROR_REQUIRES_ALL_PARTY_MEMBERS_TO_BE_WEARING_ASHJRAKAMAS_SHROUD_OF_RESOLVE = 432, // Requires all party members to be wearing Ashjra'kamas, Shroud of Resolve.
SPELL_CUSTOM_ERROR_REQUIRES_ALL_PARTY_MEMBERS_TO_POSSESS_A_VESSEL_OF_HORRIFIC_VISIONS = 434, // Requires all party members to possess a Vessel of Horrific Visions.
SPELL_CUSTOM_ERROR_YOU_ALREADY_HAVE_THE_HIGHEST_RANKED_ESSENCE_AVAILABLE_FROM_THIS_SOURCE = 435, // You already have the highest ranked Essence available from this source.
SPELL_CUSTOM_ERROR_REQUIRES_DARKMOON_GAME_TOKEN = 436, // Requires Darkmoon Game Token.
SPELL_CUSTOM_ERROR_YOU_ARE_NOT_THE_RIGHT_PROFESSION = 437, // You are not the right profession.
SPELL_CUSTOM_ERROR_YOU_ALREADY_KNOW_HOW_TO_CRAFT_A_VOID_FOCUS = 438, // You already know how to craft a Void Focus.
SPELL_CUSTOM_ERROR_YOU_ALREADY_KNOW_THE_RECIPES_IN_THIS_BOOK = 439, // You already know the recipes in this book.
SPELL_CUSTOM_ERROR_YOU_MUST_TARGET_A_CORRUPTED_GLADIATORS_ITEM = 440, // You must target a Corrupted Gladiator's item to upgrade.
SPELL_CUSTOM_ERROR_REQUIRES_THE_FIX_IT_STICK = 441, // Requires the Fix-It-Stick.
SPELL_CUSTOM_ERROR_THAT_ITEM_CANNOT_RECEIVE_ADDITIONAL_SOCKETS = 442, // That item cannot receive additional sockets.
SPELL_CUSTOM_ERROR_YOU_ALREADY_HAVE_A_CONTRACTED_VETERAN_TROOP = 443, // You already have a contracted veteran troop.
SPELL_CUSTOM_ERROR_YOU_ARE_CURRENTLY_AT_YOUR_TROOP_CAPACITY = 444, // You are currently at your troop capacity.
SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_ENOUGH_ANIMA = 445, // You don't have enough Anima
SPELL_CUSTOM_ERROR_TARGET_ALREADY_HOLDING_VOID_TOUCHED_SKULL = 446, // That player is already holding a void-touched skull.
SPELL_CUSTOM_ERROR_TARGETS_INVENTORY_IS_FULL = 447, // Target's inventory is full.
SPELL_CUSTOM_ERROR_TARGETS_MIND_IS_PROTECTED_BY_NEURAL_SILENCER = 448, // Your target's mind is protected by a neural silencer.
SPELL_CUSTOM_ERROR_ALL_TARGETS_MINDS_ARE_PROTECTED_BY_NEURAL_SILENCERS = 449, // All of your targets' minds are protected by neural silencers.
SPELL_CUSTOM_ERROR_YOU_MUST_FIND_A_MORE_POWERFUL_CORE_TO_PROGRESS_YOUR_CLOAK_RANKS_FURTHER = 450, // You must find a more powerful core to progress your cloak ranks further.
SPELL_CUSTOM_ERROR_YOU_CANNOT_USE_THIS_ITEM_IN_WAR_MODE = 451, // You cannot use this item in War Mode.
SPELL_CUSTOM_ERROR_YOU_CANNOT_MAKE_YOUR_CAMP_HERE = 452, // You cannot make your camp here.
SPELL_CUSTOM_ERROR_REQUIRES_TITANIC_BEACON = 453, // Requires Titanic Beacon
SPELL_CUSTOM_ERROR_THAT_OBJECT_IS_LOCKED = 454, // That Object is Locked.
SPELL_CUSTOM_ERROR_INVALID_COMBINATION = 455, // Invalid Combination.
SPELL_CUSTOM_ERROR_NO_NEARBY_ENEMY_PLAYERS_ARE_CORRUPTED = 456, // No nearby enemy players are corrupted.
SPELL_CUSTOM_ERROR_THAT_SPELL_IS_ALREADY_ACTIVE = 457, // That spell is already active
SPELL_CUSTOM_ERROR_YOU_CANNOT_USE_THIS_WHEN_THE_TARRAGRUE_HAS_BEEN_ALERTED = 458, // You cannot use this when the Tarragrue has been alerted.
SPELL_CUSTOM_ERROR_THAT_GUEST_ALREADY_HAS_TEA = 459, // That guest already has tea.
SPELL_CUSTOM_ERROR_REQUIRES_SHADOWLANDS_SKINNING = 460, // Requires Shadowlands Skinning.
SPELL_CUSTOM_ERROR_REQUIRES_HUNTERS_MARK_ON_A_TARGET = 461, // Requires Hunter's Mark on a target.
SPELL_CUSTOM_ERROR_HOUNDMASTER_LOKSEY_IS_BUSY = 462, // Houndmaster Loksey is busy.
SPELL_CUSTOM_ERROR_REQUIRES_COIL_OF_ROPE = 463, // Requires Coil of Rope.
SPELL_CUSTOM_ERROR_MUST_BE_IN_A_REST_AREA = 464, // Must be in a rest area.
SPELL_CUSTOM_ERROR_TARGET_IS_LINKED_TO_SOMEBODY_ELSE = 465, // Target is linked to somebody else.
SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_A_SUMMONED_GHOUL = 466, // You don't have a summoned Ghoul.
SPELL_CUSTOM_ERROR_ONE_OF_YOUR_PARTY_MEMBERS_IS_AN_INELIGIBLE_CLASS = 467, // One of your party members is an ineligible class.
SPELL_CUSTOM_ERROR_YOU_MUST_SELECT_A_SOULBIND_BOSS_AND_TIER_FIRST = 468, // You must select a soulbind, boss, and tier first.
SPELL_CUSTOM_ERROR_THAT_GUEST_DOESNT_WANT_THIS = 469, // That guest doesn't want this.
SPELL_CUSTOM_ERROR_YOU_MUST_DEFEAT_THE_EMPOWERED_GUARD_TO_ASCEND = 470, // You must defeat the Empowered guard to ascend.
SPELL_CUSTOM_ERROR_REQUIRES_SOULSTEEL_FORGE = 471, // Requires Soulsteel Forge.
SPELL_CUSTOM_ERROR_REQUIRES_PROOF_OF_PURITY = 472, // Requires Proof of Purity
SPELL_CUSTOM_ERROR_REQUIRES_PROOF_OF_HUMILITY = 473, // Requires Proof of Humility
SPELL_CUSTOM_ERROR_REQUIRES_PROOF_OF_COURAGE = 474, // Requires Proof of Courage
SPELL_CUSTOM_ERROR_REQUIRES_PROOF_OF_WISDOM = 475, // Requires Proof of Wisdom
SPELL_CUSTOM_ERROR_REQUIRES_PROOF_OF_LOYALTY = 476, // Requires Proof of Loyalty
SPELL_CUSTOM_ERROR_REQUIRES_ARCANE_SPECILIZATION = 477, // Requires Arcane Specilization.
SPELL_CUSTOM_ERROR_PLEASE_GATHER_YOUR_PARTY_BEFORE_QUEUING = 478, // Please gather your party before queuing.
SPELL_CUSTOM_ERROR_YOU_DO_NOT_KNOW_HOW_TO_TAME_GARGON = 479, // You do not know how to tame Gargon.
SPELL_CUSTOM_ERROR_REQUIRES_DEAD_SPRIGGAN = 480, // Requires Dead Spriggan
SPELL_CUSTOM_ERROR_YOU_ALREADY_USED_A_PROFESSION_JOURNAL_THIS_WEEK = 481, // You have already used a Profession Journal this week.
SPELL_CUSTOM_ERROR_REQUIRES_MORDRETHAR_THE_DEATH_GATE = 482, // Requires Mord'rethar: The Death Gate.
SPELL_CUSTOM_ERROR_REQUIRES_PLAGUEFALLEN = 483, // Requires Plaguefallen
SPELL_CUSTOM_ERROR_YOU_CANNOT_FIT_THROUGH_THERE = 484, // You cannot fit through there.
SPELL_CUSTOM_ERROR_A_BINDING_RITUAL_PREVENTS_THIS_FROM_OPENING = 485, // A binding ritual prevents this from opening.
SPELL_CUSTOM_ERROR_THAT_CHARM_IS_ALREADY_APPLIED = 486, // That charm is already applied.
SPELL_CUSTOM_ERROR_THAT_SIGIL_IS_ALREADY_APPLIED = 487, // That sigil is already applied.
SPELL_CUSTOM_ERROR_AT_LEAST_ONE_GUEST_MUST_RSVP_BEFORE_YOU_OPEN_COURT = 488, // At least one guest must RSVP before you open court.
SPELL_CUSTOM_ERROR_THERE_IS_NO_TIME_LIMIT_TO_INCREASE = 489, // There is no time limit to increase.
SPELL_CUSTOM_ERROR_YOUR_HEART_OF_AZEROTH_IS_CURRENTLY_DISABLED = 490, // Your Heart of Azeroth is currently disabled.
SPELL_CUSTOM_ERROR_ESSENCE_YOU_ARE_TRYING_TO_ACTIVATE_IS_INVALID = 491, // The Essence you are trying to activate is invalid.
SPELL_CUSTOM_ERROR_REQUIRES_MEDALLION_OF_SERVICE = 492, // Requires Medallion of Service
SPELL_CUSTOM_ERROR_ALL_PLAYERS_MUST_HAVE_QUEST_TORGHAST_TOWER_OF_THE_DAMNED = 493, // All players must have quest - Torghast: Tower of the Damned.
SPELL_CUSTOM_ERROR_REQUIRES_SHADOWLANDS_ENGINEERING = 494, // Requires Shadowlands Engineering
SPELL_CUSTOM_ERROR_YOU_ARE_NOT_IN_DEEP_ENOUGH_WATER = 495, // You are not in deep enough water.
SPELL_CUSTOM_ERROR_REQUIRES_FRESH_WATERS_OF_ARDENWEALD_OR_BASTION = 496, // Requires the fresh waters of Ardenweald or Bastion
SPELL_CUSTOM_ERROR_REQUIRES_30_INFUSED_RUBIES = 497, // Requires 30 Infused Rubies
SPELL_CUSTOM_ERROR_THE_CURSE_OF_TERAMANIKS_LEGACY_IS_KEEPING_YOUR_MOUNTS_FROM_HEEDING_YOUR_CALL = 498, // The Curse of Teramanik's Legacy is keeping your mounts from heeding your call.
SPELL_CUSTOM_ERROR_YOU_DO_NOT_KNOW_HOW_TO_TAME_CLOUD_SERPENTS = 499, // You do not know how to tame Cloud Serpents.
SPELL_CUSTOM_ERROR_YOU_DO_NOT_KNOW_HOW_TO_TAME_UNDEAD_CREATURES = 500, // You do not know how to tame Undead creatures.
SPELL_CUSTOM_ERROR_REQUIRES_THE_FORGE_OF_BONDS = 501, // Requires the Forge of Bonds
SPELL_CUSTOM_ERROR_REQUIRES_GATAMATOS = 502, // Requires Gatamatos
SPELL_CUSTOM_ERROR_MUST_BE_CHANNELLING_MIND_SEAR = 503, // Must be channelling Mind Sear.
SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_ANY_PERIODIC_EFFECTS_ACTIVE = 504, // You don't have any periodic effects active.
SPELL_CUSTOM_ERROR_YOU_ARE_NOT_BEST_FRIENDS_WITH_ANY_EMBER_COURT_GUESTS = 505, // You are not Best Friends with any Ember Court guests.
SPELL_CUSTOM_ERROR_YOU_MUST_OBTAIN_VENOMOUS_SOLVENTS = 506, // You must obtain Venomous Solvents.
SPELL_CUSTOM_ERROR_YOU_MUST_OBTAIN_DREAD_POLLEN = 507, // You must obtain Dread Pollen.
SPELL_CUSTOM_ERROR_A_PARTY_MEMBER_DOES_NOT_HAVE_THAT_LAYER_UNLOCKED = 508, // A party member does not have that layer unlocked
SPELL_CUSTOM_ERROR_INVENTORY_IS_FULL = 509, // Inventory is full.
SPELL_CUSTOM_ERROR_YOU_HAVE_NO_ANIMA_TO_DEPOSIT = 510, // You have no Anima to deposit
SPELL_CUSTOM_ERROR_YOUR_MOUNT_IGNORES_YOUR_CALL_WITHIN_THE_MAW = 511, // Your mount ignores your call within The Maw.
SPELL_CUSTOM_ERROR_YOUR_BUTLER_IS_ALREADY_PRESENT_SOMEWHERE_IN_THE_EMBER_COURT = 512, // Your butler is already present somewhere in the Ember Court.
SPELL_CUSTOM_ERROR_YOU_HAVE_ALREADY_BUILT_THIS_CONSTRUCT = 513, // You have already built this construct
SPELL_CUSTOM_ERROR_REQUIRES_INNER_ALTAR_OF_DOMINATION = 514, // Requires Inner Altar of Domination
SPELL_CUSTOM_ERROR_PARTY_MEMBER_DOES_NOT_MEET_REQUIREMENTS_TO_QUEUE = 515, // A party member does not meet the requirements to queue
SPELL_CUSTOM_ERROR_NO_CONSTRUCT_CURRENTLY_ACTIVE = 516, // No construct currently active
SPELL_CUSTOM_ERROR_COMPLETE_THE_QUEST_LINE_WELCOME_TO_ZANDALAR = 517, // Complete the quest line "Welcome to Zandalar" to use this spell.
SPELL_CUSTOM_ERROR_COMPLETE_THE_QUEST_LINE_A_NATION_DIVIDED = 518, // Complete the quest line "A Nation Divided" to use this spell.
SPELL_CUSTOM_ERROR_CANNOT_BE_USED_ON_COMMON_QUALITY_ITEMS = 519, // Cannot be used on Common quality items.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_PLEDGED_TO_THE_VENTHYR = 520, // You must be pledged to the Venthyr.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_PLEDGED_TO_THE_NIGHT_FAE = 521, // You must be pledged to the Night Fae.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_PLEDGED_TO_THE_KYRIAN = 522, // You must be pledged to the Kyrian.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_PLEDGED_TO_THE_NECROLORDS = 523, // You must be pledged to the Necrolords.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_IN_THE_SHADOWLANDS = 524, // You must be in the Shadowlands.
SPELL_CUSTOM_ERROR_REQUIRES_SANCTUM_RESERVOIR = 525, // Requires Sanctum Reservoir.
SPELL_CUSTOM_ERROR_THIS_WILDSEED_OF_REGROWTH_IS_STILL_INCUBATING = 526, // This Wildseed of Regrowth is still incubating.
SPELL_CUSTOM_ERROR_THIS_WILDSEED_OF_REGROWTH_IS_STILL_GROWING = 527, // This Wildseed of Regrowth is still growing.
SPELL_CUSTOM_ERROR_YOU_MUST_BE_PARTY_LEADER_TO_START_THIS_ESCORT = 528, // You must be the party leader to start this escort.
SPELL_CUSTOM_ERROR_YOU_HAVE_FULLY_UPGRADED_ALL_OF_YOUR_CONDUITS = 529, // You have fully upgraded all of your Conduits.
SPELL_CUSTOM_ERROR_YOU_HAVE_ALREADY_ADDED_THAT_CONDUIT = 530, // You have already added that Conduit to the Forge of Bonds.
SPELL_CUSTOM_ERROR_TARGET_MUST_BE_WEAKENED = 531, // Target must be weakened.
SPELL_CUSTOM_ERROR_YOU_CANNOT_ADD_THAT_CONDUIT_TO_FORGE_OF_BONDS = 532, // You cannot add that Conduit to the Forge of Bonds.
SPELL_CUSTOM_ERROR_YOU_CANNOT_SOULSHAPE_DURING_LICHBORNE = 533, // You cannot Soulshape during Lichborne.
SPELL_CUSTOM_ERROR_YOU_CANT_DO_THAT_WHILE_CARRYING_AN_ANIMACONE = 534, // You can't do that while carrying an Animacone.
SPELL_CUSTOM_ERROR_NECESSARY_CONSTRUCT_NOT_PRESENT = 535, // Necessary construct not present.
};
enum StealthType
{
STEALTH_GENERAL = 0,
STEALTH_TRAP = 1,
TOTAL_STEALTH_TYPES = 2
};
enum InvisibilityType
{
INVISIBILITY_GENERAL = 0,
INVISIBILITY_UNK1 = 1,
INVISIBILITY_UNK2 = 2,
INVISIBILITY_TRAP = 3,
INVISIBILITY_UNK4 = 4,
INVISIBILITY_UNK5 = 5,
INVISIBILITY_DRUNK = 6,
INVISIBILITY_UNK7 = 7,
INVISIBILITY_UNK8 = 8,
INVISIBILITY_UNK9 = 9,
INVISIBILITY_UNK10 = 10,
INVISIBILITY_UNK11 = 11,
INVISIBILITY_UNK12 = 12,
INVISIBILITY_TRA13 = 13,
INVISIBILITY_UNK14 = 14,
INVISIBILITY_UNK15 = 15,
INVISIBILITY_UNK16 = 16,
INVISIBILITY_UNK17 = 17,
INVISIBILITY_UNK18 = 18,
INVISIBILITY_UNK19 = 19,
INVISIBILITY_UNK20 = 20,
INVISIBILITY_UNK21 = 21,
INVISIBILITY_UNK22 = 22,
INVISIBILITY_TRA23 = 23,
INVISIBILITY_UNK24 = 24,
INVISIBILITY_UNK25 = 25,
INVISIBILITY_UNK26 = 26,
INVISIBILITY_UNK27 = 27,
INVISIBILITY_UNK28 = 28,
INVISIBILITY_UNK29 = 29,
INVISIBILITY_UNK30 = 30,
INVISIBILITY_UNK31 = 31,
INVISIBILITY_UNK32 = 32,
INVISIBILITY_UNK33 = 33,
INVISIBILITY_UNK34 = 34,
INVISIBILITY_UNK35 = 35,
INVISIBILITY_UNK36 = 36,
INVISIBILITY_UNK37 = 37,
TOTAL_INVISIBILITY_TYPES = 38
};
enum ServerSideVisibilityType
{
SERVERSIDE_VISIBILITY_GM = 0,
SERVERSIDE_VISIBILITY_GHOST = 1,
TOTAL_SERVERSIDE_VISIBILITY_TYPES = 2
};
enum GhostVisibilityType
{
GHOST_VISIBILITY_ALIVE = 0x1,
GHOST_VISIBILITY_GHOST = 0x2
};
// Spell aura states
enum AuraStateType
{ // (C) used in caster aura state (T) used in target aura state
// (c) used in caster aura state-not (t) used in target aura state-not
AURA_STATE_NONE = 0, // C |
AURA_STATE_DEFENSE = 1, // C |
AURA_STATE_HEALTHLESS_20_PERCENT = 2, // CcT |
AURA_STATE_BERSERKING = 3, // C T |
AURA_STATE_FROZEN = 4, // c t| frozen target
AURA_STATE_JUDGEMENT = 5, // C |
AURA_STATE_HEALTHLESS_25_PERCENT = 6, // CcT |
AURA_STATE_HUNTER_PARRY = 7, // C |
//AURA_STATE_UNKNOWN7 = 7, // c | creature cheap shot / focused bursts spells
//AURA_STATE_UNKNOWN8 = 8, // t| test spells
//AURA_STATE_UNKNOWN9 = 9, // |
AURA_STATE_WARRIOR_VICTORY_RUSH = 10, // C | warrior victory rush
//AURA_STATE_UNKNOWN11 = 11, // C t| 60348 - Maelstrom Ready!, test spells
AURA_STATE_FAERIE_FIRE = 12, // c t|
AURA_STATE_HEALTHLESS_35_PERCENT = 13, // C T |
AURA_STATE_CONFLAGRATE = 14, // T |
AURA_STATE_SWIFTMEND = 15, // T |
AURA_STATE_DEADLY_POISON = 16, // T |
AURA_STATE_ENRAGE = 17, // C |
AURA_STATE_BLEEDING = 18, // T|
AURA_STATE_UNKNOWN19 = 19, // |
//AURA_STATE_UNKNOWN20 = 20, // c | only (45317 Suicide)
//AURA_STATE_UNKNOWN21 = 21, // | not used
AURA_STATE_UNKNOWN22 = 22, // C t| varius spells (63884, 50240)
AURA_STATE_HEALTH_ABOVE_75_PERCENT = 23 // C |
};
#define PER_CASTER_AURA_STATE_MASK (\
(1<<(AURA_STATE_CONFLAGRATE-1))|(1<<(AURA_STATE_DEADLY_POISON-1)))
// Spell mechanics
enum Mechanics
{
MECHANIC_NONE = 0,
MECHANIC_CHARM = 1,
MECHANIC_DISORIENTED = 2,
MECHANIC_DISARM = 3,
MECHANIC_DISTRACT = 4,
MECHANIC_FEAR = 5,
MECHANIC_GRIP = 6,
MECHANIC_ROOT = 7,
MECHANIC_SLOW_ATTACK = 8,
MECHANIC_SILENCE = 9,
MECHANIC_SLEEP = 10,
MECHANIC_SNARE = 11,
MECHANIC_STUN = 12,
MECHANIC_FREEZE = 13,
MECHANIC_KNOCKOUT = 14,
MECHANIC_BLEED = 15,
MECHANIC_BANDAGE = 16,
MECHANIC_POLYMORPH = 17,
MECHANIC_BANISH = 18,
MECHANIC_SHIELD = 19,
MECHANIC_SHACKLE = 20,
MECHANIC_MOUNT = 21,
MECHANIC_INFECTED = 22,
MECHANIC_TURN = 23,
MECHANIC_HORROR = 24,
MECHANIC_INVULNERABILITY = 25,
MECHANIC_INTERRUPT = 26,
MECHANIC_DAZE = 27,
MECHANIC_DISCOVERY = 28,
MECHANIC_IMMUNE_SHIELD = 29, // Divine (Blessing) Shield/Protection and Ice Block
MECHANIC_SAPPED = 30,
MECHANIC_ENRAGED = 31,
MECHANIC_WOUNDED = 32,
MAX_MECHANIC = 33
};
// Used for spell 42292 Immune Movement Impairment and Loss of Control (0x49967ca6)
#define IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK (\
(1<<MECHANIC_CHARM)|(1<<MECHANIC_DISORIENTED)|(1<<MECHANIC_FEAR)| \
(1<<MECHANIC_ROOT)|(1<<MECHANIC_SLEEP)|(1<<MECHANIC_SNARE)| \
(1<<MECHANIC_STUN)|(1<<MECHANIC_FREEZE)|(1<<MECHANIC_SILENCE)|(1<<MECHANIC_DISARM)|(1<<MECHANIC_KNOCKOUT)| \
(1<<MECHANIC_POLYMORPH)|(1<<MECHANIC_BANISH)|(1<<MECHANIC_SHACKLE)| \
(1<<MECHANIC_TURN)|(1<<MECHANIC_HORROR)|(1<<MECHANIC_DAZE)| \
(1<<MECHANIC_SAPPED))
// Spell dispel type
enum DispelType
{
DISPEL_NONE = 0,
DISPEL_MAGIC = 1,
DISPEL_CURSE = 2,
DISPEL_DISEASE = 3,
DISPEL_POISON = 4,
DISPEL_STEALTH = 5,
DISPEL_INVISIBILITY = 6,
DISPEL_ALL = 7,
DISPEL_SPE_NPC_ONLY = 8,
DISPEL_ENRAGE = 9,
DISPEL_ZG_TICKET = 10,
DESPEL_OLD_UNUSED = 11
};
#define DISPEL_ALL_MASK ((1<<DISPEL_MAGIC) | (1<<DISPEL_CURSE) | (1<<DISPEL_DISEASE) | (1<<DISPEL_POISON))
//To all Immune system, if target has immunes,
//some spell that related to ImmuneToDispel or ImmuneToSchool or ImmuneToDamage type can't cast to it,
//some spell_effects that related to ImmuneToEffect<effect>(only this effect in the spell) can't cast to it,
//some aura(related to Mechanics or ImmuneToState<aura>) can't apply to it.
enum SpellImmunity
{
IMMUNITY_EFFECT = 0, // enum SpellEffects
IMMUNITY_STATE = 1, // enum AuraType
IMMUNITY_SCHOOL = 2, // enum SpellSchoolMask
IMMUNITY_DAMAGE = 3, // enum SpellSchoolMask
IMMUNITY_DISPEL = 4, // enum DispelType
IMMUNITY_MECHANIC = 5, // enum Mechanics
IMMUNITY_ID = 6,
MAX_SPELL_IMMUNITY
};
// target enum name consist of:
// TARGET_[OBJECT_TYPE]_[REFERENCE_TYPE(skipped for caster)]_[SELECTION_TYPE(skipped for default)]_[additional specifiers(friendly, BACK_LEFT, etc.]
enum Targets
{
TARGET_UNIT_CASTER = 1,
TARGET_UNIT_NEARBY_ENEMY = 2,
TARGET_UNIT_NEARBY_PARTY = 3,
TARGET_UNIT_NEARBY_ALLY = 4,
TARGET_UNIT_PET = 5,
TARGET_UNIT_TARGET_ENEMY = 6,
TARGET_UNIT_SRC_AREA_ENTRY = 7,
TARGET_UNIT_DEST_AREA_ENTRY = 8,
TARGET_DEST_HOME = 9,
TARGET_UNIT_SRC_AREA_UNK_11 = 11,
TARGET_UNIT_SRC_AREA_ENEMY = 15,
TARGET_UNIT_DEST_AREA_ENEMY = 16,
TARGET_DEST_DB = 17,
TARGET_DEST_CASTER = 18,
TARGET_UNIT_CASTER_AREA_PARTY = 20,
TARGET_UNIT_TARGET_ALLY = 21,
TARGET_SRC_CASTER = 22,
TARGET_GAMEOBJECT_TARGET = 23,
TARGET_UNIT_CONE_ENEMY_24 = 24,
TARGET_UNIT_TARGET_ANY = 25,
TARGET_GAMEOBJECT_ITEM_TARGET = 26,
TARGET_UNIT_MASTER = 27,
TARGET_DEST_DYNOBJ_ENEMY = 28,
TARGET_DEST_DYNOBJ_ALLY = 29,
TARGET_UNIT_SRC_AREA_ALLY = 30,
TARGET_UNIT_DEST_AREA_ALLY = 31,
TARGET_DEST_CASTER_SUMMON = 32, // front left, doesn't use radius
TARGET_UNIT_SRC_AREA_PARTY = 33,
TARGET_UNIT_DEST_AREA_PARTY = 34,
TARGET_UNIT_TARGET_PARTY = 35,
TARGET_DEST_CASTER_UNK_36 = 36,
TARGET_UNIT_LASTTARGET_AREA_PARTY = 37,
TARGET_UNIT_NEARBY_ENTRY = 38,
TARGET_DEST_CASTER_FISHING = 39,
TARGET_GAMEOBJECT_NEARBY_ENTRY = 40,
TARGET_DEST_CASTER_FRONT_RIGHT = 41,
TARGET_DEST_CASTER_BACK_RIGHT = 42,
TARGET_DEST_CASTER_BACK_LEFT = 43,
TARGET_DEST_CASTER_FRONT_LEFT = 44,
TARGET_UNIT_TARGET_CHAINHEAL_ALLY = 45,
TARGET_DEST_NEARBY_ENTRY = 46,
TARGET_DEST_CASTER_FRONT = 47,
TARGET_DEST_CASTER_BACK = 48,
TARGET_DEST_CASTER_RIGHT = 49,
TARGET_DEST_CASTER_LEFT = 50,
TARGET_GAMEOBJECT_SRC_AREA = 51,
TARGET_GAMEOBJECT_DEST_AREA = 52,
TARGET_DEST_TARGET_ENEMY = 53,
TARGET_UNIT_CONE_ENEMY_54 = 54,
TARGET_DEST_CASTER_FRONT_LEAP = 55, // for a leap spell
TARGET_UNIT_CASTER_AREA_RAID = 56,
TARGET_UNIT_TARGET_RAID = 57,
TARGET_UNIT_NEARBY_RAID = 58,
TARGET_UNIT_CONE_ALLY = 59,
TARGET_UNIT_CONE_ENTRY = 60,
TARGET_UNIT_TARGET_AREA_RAID_CLASS = 61,
TARGET_UNK_62 = 62,
TARGET_DEST_TARGET_ANY = 63,
TARGET_DEST_TARGET_FRONT = 64,
TARGET_DEST_TARGET_BACK = 65,
TARGET_DEST_TARGET_RIGHT = 66,
TARGET_DEST_TARGET_LEFT = 67,
TARGET_DEST_TARGET_FRONT_RIGHT = 68,
TARGET_DEST_TARGET_BACK_RIGHT = 69,
TARGET_DEST_TARGET_BACK_LEFT = 70,
TARGET_DEST_TARGET_FRONT_LEFT = 71,
TARGET_DEST_CASTER_RANDOM = 72,
TARGET_DEST_CASTER_RADIUS = 73,
TARGET_DEST_TARGET_RANDOM = 74,
TARGET_DEST_TARGET_RADIUS = 75,
TARGET_DEST_CHANNEL_TARGET = 76,
TARGET_UNIT_CHANNEL_TARGET = 77,
TARGET_DEST_DEST_FRONT = 78,
TARGET_DEST_DEST_BACK = 79,
TARGET_DEST_DEST_RIGHT = 80,
TARGET_DEST_DEST_LEFT = 81,
TARGET_DEST_DEST_FRONT_RIGHT = 82,
TARGET_DEST_DEST_BACK_RIGHT = 83,
TARGET_DEST_DEST_BACK_LEFT = 84,
TARGET_DEST_DEST_FRONT_LEFT = 85,
TARGET_DEST_DEST_RANDOM = 86,
TARGET_DEST_DEST = 87,
TARGET_DEST_DYNOBJ_NONE = 88,
TARGET_DEST_TRAJ = 89,
TARGET_UNIT_TARGET_MINIPET = 90,
TARGET_DEST_DEST_RADIUS = 91,
TARGET_UNIT_SUMMONER = 92,
TARGET_CORPSE_SRC_AREA_ENEMY = 93, // NYI
TARGET_UNIT_VEHICLE = 94,
TARGET_UNIT_TARGET_PASSENGER = 95,
TARGET_UNIT_PASSENGER_0 = 96,
TARGET_UNIT_PASSENGER_1 = 97,
TARGET_UNIT_PASSENGER_2 = 98,
TARGET_UNIT_PASSENGER_3 = 99,
TARGET_UNIT_PASSENGER_4 = 100,
TARGET_UNIT_PASSENGER_5 = 101,
TARGET_UNIT_PASSENGER_6 = 102,
TARGET_UNIT_PASSENGER_7 = 103,
TARGET_UNIT_CONE_ENEMY_104 = 104,
TARGET_UNIT_UNK_105 = 105, // 1 spell
TARGET_DEST_CHANNEL_CASTER = 106,
TARGET_UNK_DEST_AREA_UNK_107 = 107, // not enough info - only generic spells avalible
TARGET_GAMEOBJECT_CONE_108 = 108,
TARGET_GAMEOBJECT_CONE_109 = 109,
TARGET_UNIT_CONE_ENTRY_110 = 110,
TARGET_UNK_111 = 111,
TARGET_UNK_112 = 112,
TARGET_UNK_113 = 113,
TARGET_UNK_114 = 114,
TARGET_UNK_115 = 115,
TARGET_UNK_116 = 116,
TARGET_UNK_117 = 117,
TARGET_UNIT_TARGET_ALLY_OR_RAID = 118, // If target is in your party or raid, all party and raid members will be affected
TARGET_CORPSE_SRC_AREA_RAID = 119,
TARGET_UNIT_CASTER_AND_SUMMONS = 120,
TARGET_UNIT_TARGET_DEAD = 121,
TARGET_UNIT_AREA_THREAT_LIST = 122, // any unit on threat list
TARGET_UNIT_AREA_TAP_LIST = 123,
TARGET_UNK_124 = 124,
TARGET_DEST_CASTER_GROUND = 125,
TARGET_UNK_126 = 126,
TARGET_DEST_CASTER_ENEMY_CENTROID = 127,
TARGET_UNK_128 = 128,
TARGET_UNIT_CONE_ENTRY_129 = 129,
TARGET_UNK_130 = 130,
TARGET_DEST_SUMMONER = 131,
TARGET_DEST_TARGET_ALLY = 132,
TARGET_UNK_133 = 133,
TARGET_UNIT_LINE_ENEMY_134 = 134,
TARGET_UNK_135 = 135,
TARGET_UNK_136 = 136,
TARGET_UNK_137 = 137,
TARGET_UNK_138 = 138,
TARGET_UNK_139 = 139,
TARGET_UNK_140 = 140,
TARGET_UNK_141 = 141,
TARGET_DEST_LAST_QUEST_GIVER = 142,
TARGET_UNK_143 = 143,
TARGET_UNK_144 = 144,
TARGET_UNK_145 = 145,
TARGET_UNK_146 = 146,
TARGET_UNK_147 = 147,
TARGET_UNK_148 = 148,
TARGET_UNK_149 = 149,
TARGET_UNIT_OWN_CRITTER = 150, // own battle pet from UNIT_FIELD_CRITTER
TARGET_UNK_151 = 151,
TOTAL_SPELL_TARGETS
};
enum SpellMissInfo : uint8
{
SPELL_MISS_NONE = 0,
SPELL_MISS_MISS = 1,
SPELL_MISS_RESIST = 2,
SPELL_MISS_DODGE = 3,
SPELL_MISS_PARRY = 4,
SPELL_MISS_BLOCK = 5,
SPELL_MISS_EVADE = 6,
SPELL_MISS_IMMUNE = 7,
SPELL_MISS_IMMUNE2 = 8, // one of these 2 is MISS_TEMPIMMUNE
SPELL_MISS_DEFLECT = 9,
SPELL_MISS_ABSORB = 10,
SPELL_MISS_REFLECT = 11
};
enum SpellHitType
{
SPELL_HIT_TYPE_CRIT_DEBUG = 0x01,
SPELL_HIT_TYPE_CRIT = 0x02,
SPELL_HIT_TYPE_HIT_DEBUG = 0x04,
SPELL_HIT_TYPE_SPLIT = 0x08,
SPELL_HIT_TYPE_VICTIM_IS_ATTACKER = 0x10,
SPELL_HIT_TYPE_ATTACK_TABLE_DEBUG = 0x20,
SPELL_HIT_TYPE_UNK = 0x40,
SPELL_HIT_TYPE_NO_ATTACKER = 0x80, // does the same as SPELL_ATTR4_COMBAT_LOG_NO_CASTER
};
enum SpellDmgClass
{
SPELL_DAMAGE_CLASS_NONE = 0,
SPELL_DAMAGE_CLASS_MAGIC = 1,
SPELL_DAMAGE_CLASS_MELEE = 2,
SPELL_DAMAGE_CLASS_RANGED = 3
};
enum SpellPreventionType
{
SPELL_PREVENTION_TYPE_SILENCE = 1,
SPELL_PREVENTION_TYPE_PACIFY = 2,
SPELL_PREVENTION_TYPE_NO_ACTIONS = 4
};
enum GameobjectTypes : uint8
{
GAMEOBJECT_TYPE_DOOR = 0,
GAMEOBJECT_TYPE_BUTTON = 1,
GAMEOBJECT_TYPE_QUESTGIVER = 2,
GAMEOBJECT_TYPE_CHEST = 3,
GAMEOBJECT_TYPE_BINDER = 4,
GAMEOBJECT_TYPE_GENERIC = 5,
GAMEOBJECT_TYPE_TRAP = 6,
GAMEOBJECT_TYPE_CHAIR = 7,
GAMEOBJECT_TYPE_SPELL_FOCUS = 8,
GAMEOBJECT_TYPE_TEXT = 9,
GAMEOBJECT_TYPE_GOOBER = 10,
GAMEOBJECT_TYPE_TRANSPORT = 11,
GAMEOBJECT_TYPE_AREADAMAGE = 12,
GAMEOBJECT_TYPE_CAMERA = 13,
GAMEOBJECT_TYPE_MAP_OBJECT = 14,
GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT = 15,
GAMEOBJECT_TYPE_DUEL_ARBITER = 16,
GAMEOBJECT_TYPE_FISHINGNODE = 17,
GAMEOBJECT_TYPE_RITUAL = 18,
GAMEOBJECT_TYPE_MAILBOX = 19,
GAMEOBJECT_TYPE_DO_NOT_USE = 20,
GAMEOBJECT_TYPE_GUARDPOST = 21,
GAMEOBJECT_TYPE_SPELLCASTER = 22,
GAMEOBJECT_TYPE_MEETINGSTONE = 23,
GAMEOBJECT_TYPE_FLAGSTAND = 24,
GAMEOBJECT_TYPE_FISHINGHOLE = 25,
GAMEOBJECT_TYPE_FLAGDROP = 26,
GAMEOBJECT_TYPE_MINI_GAME = 27,
GAMEOBJECT_TYPE_DO_NOT_USE_2 = 28,
GAMEOBJECT_TYPE_CONTROL_ZONE = 29,
GAMEOBJECT_TYPE_AURA_GENERATOR = 30,
GAMEOBJECT_TYPE_DUNGEON_DIFFICULTY = 31,
GAMEOBJECT_TYPE_BARBER_CHAIR = 32,
GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING = 33,
GAMEOBJECT_TYPE_GUILD_BANK = 34,
GAMEOBJECT_TYPE_TRAPDOOR = 35,
GAMEOBJECT_TYPE_NEW_FLAG = 36,
GAMEOBJECT_TYPE_NEW_FLAG_DROP = 37,
GAMEOBJECT_TYPE_GARRISON_BUILDING = 38,
GAMEOBJECT_TYPE_GARRISON_PLOT = 39,
GAMEOBJECT_TYPE_CLIENT_CREATURE = 40,
GAMEOBJECT_TYPE_CLIENT_ITEM = 41,
GAMEOBJECT_TYPE_CAPTURE_POINT = 42,
GAMEOBJECT_TYPE_PHASEABLE_MO = 43,
GAMEOBJECT_TYPE_GARRISON_MONUMENT = 44,
GAMEOBJECT_TYPE_GARRISON_SHIPMENT = 45,
GAMEOBJECT_TYPE_GARRISON_MONUMENT_PLAQUE = 46,
GAMEOBJECT_TYPE_ITEM_FORGE = 47,
GAMEOBJECT_TYPE_UI_LINK = 48,
GAMEOBJECT_TYPE_KEYSTONE_RECEPTACLE = 49,
GAMEOBJECT_TYPE_GATHERING_NODE = 50,
GAMEOBJECT_TYPE_CHALLENGE_MODE_REWARD = 51,
GAMEOBJECT_TYPE_MULTI = 52,
GAMEOBJECT_TYPE_SIEGEABLE_MULTI = 53,
GAMEOBJECT_TYPE_SIEGEABLE_MO = 54,
GAMEOBJECT_TYPE_PVP_REWARD = 55,
GAMEOBJECT_TYPE_PLAYER_CHOICE_CHEST = 56,
GAMEOBJECT_TYPE_LEGENDARY_FORGE = 57,
GAMEOBJECT_TYPE_GARR_TALENT_TREE = 58,
GAMEOBJECT_TYPE_WEEKLY_REWARD_CHEST = 59,
GAMEOBJECT_TYPE_CLIENT_MODEL = 60
};
#define MAX_GAMEOBJECT_TYPE 61 // sending to client this or greater value can crash client.
#define MAX_GAMEOBJECT_DATA 34 // Max number of uint32 vars in gameobject_template data field
enum GameObjectFlags
{
GO_FLAG_IN_USE = 0x00000001, // disables interaction while animated
GO_FLAG_LOCKED = 0x00000002, // require key, spell, event, etc to be opened. Makes "Locked" appear in tooltip
GO_FLAG_INTERACT_COND = 0x00000004, // cannot interact (condition to interact - requires GO_DYNFLAG_LO_ACTIVATE to enable interaction clientside)
GO_FLAG_TRANSPORT = 0x00000008, // any kind of transport? Object can transport (elevator, boat, car)
GO_FLAG_NOT_SELECTABLE = 0x00000010, // not selectable even in GM mode
GO_FLAG_NODESPAWN = 0x00000020, // never despawn, typically for doors, they just change state
GO_FLAG_AI_OBSTACLE = 0x00000040, // makes the client register the object in something called AIObstacleMgr, unknown what it does
GO_FLAG_FREEZE_ANIMATION = 0x00000080,
// for object types GAMEOBJECT_TYPE_GARRISON_BUILDING, GAMEOBJECT_TYPE_GARRISON_PLOT and GAMEOBJECT_TYPE_PHASEABLE_MO flag bits 8 to 12 are used as WMOAreaTable::NameSetID
GO_FLAG_DAMAGED = 0x00000200,
GO_FLAG_DESTROYED = 0x00000400,
GO_FLAG_INTERACT_DISTANCE_USES_TEMPLATE_MODEL = 0x00080000, // client checks interaction distance from model sent in SMSG_QUERY_GAMEOBJECT_RESPONSE instead of GAMEOBJECT_DISPLAYID
GO_FLAG_MAP_OBJECT = 0x00100000 // pre-7.0 model loading used to be controlled by file extension (wmo vs m2)
};
enum GameObjectDynamicLowFlags
{
GO_DYNFLAG_LO_HIDE_MODEL = 0x02, // Object model is not shown with this flag
GO_DYNFLAG_LO_ACTIVATE = 0x04, // enables interaction with GO
GO_DYNFLAG_LO_ANIMATE = 0x08, // possibly more distinct animation of GO
GO_DYNFLAG_LO_NO_INTERACT = 0x10, // appears to disable interaction (not fully verified)
GO_DYNFLAG_LO_SPARKLE = 0x20, // makes GO sparkle
GO_DYNFLAG_LO_STOPPED = 0x40 // Transport is stopped
};
// client side GO show states
enum GOState : uint8
{
GO_STATE_ACTIVE = 0, // show in world as used and not reset (closed door open)
GO_STATE_READY = 1, // show in world as ready (closed door close)
GO_STATE_ACTIVE_ALTERNATIVE = 2, // show in world as used in alt way and not reset (closed door open by cannon fire)
GO_STATE_TRANSPORT_ACTIVE = 24,
GO_STATE_TRANSPORT_STOPPED = 25
};
#define MAX_GO_STATE 3
#define MAX_GO_STATE_TRANSPORT_STOP_FRAMES 9
enum GameObjectDestructibleState
{
GO_DESTRUCTIBLE_INTACT = 0,
GO_DESTRUCTIBLE_DAMAGED = 1,
GO_DESTRUCTIBLE_DESTROYED = 2,
GO_DESTRUCTIBLE_REBUILDING = 3
};
enum GameObjectBytes1Offsets : uint8
{
GO_BYTES_1_OFFSET_STATE = 0,
GO_BYTES_1_OFFSET_GO_TYPE = 1,
GO_BYTES_1_OFFSET_ART_KIT = 2,
GO_BYTES_1_OFFSET_ANIM_PROGRESS = 3,
};
// EmotesText.dbc (9.0.2)
enum TextEmotes
{
TEXT_EMOTE_AGREE = 1,
TEXT_EMOTE_AMAZE = 2,
TEXT_EMOTE_ANGRY = 3,
TEXT_EMOTE_APOLOGIZE = 4,
TEXT_EMOTE_APPLAUD = 5,
TEXT_EMOTE_BASHFUL = 6,
TEXT_EMOTE_BECKON = 7,
TEXT_EMOTE_BEG = 8,
TEXT_EMOTE_BITE = 9,
TEXT_EMOTE_BLEED = 10,
TEXT_EMOTE_BLINK = 11,
TEXT_EMOTE_BLUSH = 12,
TEXT_EMOTE_BONK = 13,
TEXT_EMOTE_BORED = 14,
TEXT_EMOTE_BOUNCE = 15,
TEXT_EMOTE_BRB = 16,
TEXT_EMOTE_BOW = 17,
TEXT_EMOTE_BURP = 18,
TEXT_EMOTE_BYE = 19,
TEXT_EMOTE_CACKLE = 20,
TEXT_EMOTE_CHEER = 21,
TEXT_EMOTE_CHICKEN = 22,
TEXT_EMOTE_CHUCKLE = 23,
TEXT_EMOTE_CLAP = 24,
TEXT_EMOTE_CONFUSED = 25,
TEXT_EMOTE_CONGRATULATE = 26,
TEXT_EMOTE_COUGH = 27,
TEXT_EMOTE_COWER = 28,
TEXT_EMOTE_CRACK = 29,
TEXT_EMOTE_CRINGE = 30,
TEXT_EMOTE_CRY = 31,
TEXT_EMOTE_CURIOUS = 32,
TEXT_EMOTE_CURTSEY = 33,
TEXT_EMOTE_DANCE = 34,
TEXT_EMOTE_DRINK = 35,
TEXT_EMOTE_DROOL = 36,
TEXT_EMOTE_EAT = 37,
TEXT_EMOTE_EYE = 38,
TEXT_EMOTE_FART = 39,
TEXT_EMOTE_FIDGET = 40,
TEXT_EMOTE_FLEX = 41,
TEXT_EMOTE_FROWN = 42,
TEXT_EMOTE_GASP = 43,
TEXT_EMOTE_GAZE = 44,
TEXT_EMOTE_GIGGLE = 45,
TEXT_EMOTE_GLARE = 46,
TEXT_EMOTE_GLOAT = 47,
TEXT_EMOTE_GREET = 48,
TEXT_EMOTE_GRIN = 49,
TEXT_EMOTE_GROAN = 50,
TEXT_EMOTE_GROVEL = 51,
TEXT_EMOTE_GUFFAW = 52,
TEXT_EMOTE_HAIL = 53,
TEXT_EMOTE_HAPPY = 54,
TEXT_EMOTE_HELLO = 55,
TEXT_EMOTE_HUG = 56,
TEXT_EMOTE_HUNGRY = 57,
TEXT_EMOTE_KISS = 58,
TEXT_EMOTE_KNEEL = 59,
TEXT_EMOTE_LAUGH = 60,
TEXT_EMOTE_LAYDOWN = 61,
TEXT_EMOTE_MESSAGE = 62,
TEXT_EMOTE_MOAN = 63,
TEXT_EMOTE_MOON = 64,
TEXT_EMOTE_MOURN = 65,
TEXT_EMOTE_NO = 66,
TEXT_EMOTE_NOD = 67,
TEXT_EMOTE_NOSEPICK = 68,
TEXT_EMOTE_PANIC = 69,
TEXT_EMOTE_PEER = 70,
TEXT_EMOTE_PLEAD = 71,
TEXT_EMOTE_POINT = 72,
TEXT_EMOTE_POKE = 73,
TEXT_EMOTE_PRAY = 74,
TEXT_EMOTE_ROAR = 75,
TEXT_EMOTE_ROFL = 76,
TEXT_EMOTE_RUDE = 77,
TEXT_EMOTE_SALUTE = 78,
TEXT_EMOTE_SCRATCH = 79,
TEXT_EMOTE_SEXY = 80,
TEXT_EMOTE_SHAKE = 81,
TEXT_EMOTE_SHOUT = 82,
TEXT_EMOTE_SHRUG = 83,
TEXT_EMOTE_SHY = 84,
TEXT_EMOTE_SIGH = 85,
TEXT_EMOTE_SIT = 86,
TEXT_EMOTE_SLEEP = 87,
TEXT_EMOTE_SNARL = 88,
TEXT_EMOTE_SPIT = 89,
TEXT_EMOTE_STARE = 90,
TEXT_EMOTE_SURPRISED = 91,
TEXT_EMOTE_SURRENDER = 92,
TEXT_EMOTE_TALK = 93,
TEXT_EMOTE_TALKEX = 94,
TEXT_EMOTE_TALKQ = 95,
TEXT_EMOTE_TAP = 96,
TEXT_EMOTE_THANK = 97,
TEXT_EMOTE_THREATEN = 98,
TEXT_EMOTE_TIRED = 99,
TEXT_EMOTE_VICTORY = 100,
TEXT_EMOTE_WAVE = 101,
TEXT_EMOTE_WELCOME = 102,
TEXT_EMOTE_WHINE = 103,
TEXT_EMOTE_WHISTLE = 104,
TEXT_EMOTE_WORK = 105,
TEXT_EMOTE_YAWN = 106,
TEXT_EMOTE_BOGGLE = 107,
TEXT_EMOTE_CALM = 108,
TEXT_EMOTE_COLD = 109,
TEXT_EMOTE_COMFORT = 110,
TEXT_EMOTE_CUDDLE = 111,
TEXT_EMOTE_DUCK = 112,
TEXT_EMOTE_INSULT = 113,
TEXT_EMOTE_INTRODUCE = 114,
TEXT_EMOTE_JK = 115,
TEXT_EMOTE_LICK = 116,
TEXT_EMOTE_LISTEN = 117,
TEXT_EMOTE_LOST = 118,
TEXT_EMOTE_MOCK = 119,
TEXT_EMOTE_PONDER = 120,
TEXT_EMOTE_POUNCE = 121,
TEXT_EMOTE_PRAISE = 122,
TEXT_EMOTE_PURR = 123,
TEXT_EMOTE_PUZZLE = 124,
TEXT_EMOTE_RAISE = 125,
TEXT_EMOTE_READY = 126,
TEXT_EMOTE_SHIMMY = 127,
TEXT_EMOTE_SHIVER = 128,
TEXT_EMOTE_SHOO = 129,
TEXT_EMOTE_SLAP = 130,
TEXT_EMOTE_SMIRK = 131,
TEXT_EMOTE_SNIFF = 132,
TEXT_EMOTE_SNUB = 133,
TEXT_EMOTE_SOOTHE = 134,
TEXT_EMOTE_STINK = 135,
TEXT_EMOTE_TAUNT = 136,
TEXT_EMOTE_TEASE = 137,
TEXT_EMOTE_THIRSTY = 138,
TEXT_EMOTE_VETO = 139,
TEXT_EMOTE_SNICKER = 140,
TEXT_EMOTE_STAND = 141,
TEXT_EMOTE_TICKLE = 142,
TEXT_EMOTE_VIOLIN = 143,
TEXT_EMOTE_SMILE = 163,
TEXT_EMOTE_RASP = 183,
TEXT_EMOTE_PITY = 203,
TEXT_EMOTE_GROWL = 204,
TEXT_EMOTE_BARK = 205,
TEXT_EMOTE_SCARED = 223,
TEXT_EMOTE_FLOP = 224,
TEXT_EMOTE_LOVE = 225,
TEXT_EMOTE_MOO = 226,
TEXT_EMOTE_COMMEND = 243,
TEXT_EMOTE_TRAIN = 264,
TEXT_EMOTE_HELPME = 303,
TEXT_EMOTE_INCOMING = 304,
TEXT_EMOTE_CHARGE = 305,
TEXT_EMOTE_FLEE = 306,
TEXT_EMOTE_ATTACKMYTARGET = 307,
TEXT_EMOTE_OOM = 323,
TEXT_EMOTE_FOLLOW = 324,
TEXT_EMOTE_WAIT = 325,
TEXT_EMOTE_HEALME = 326,
TEXT_EMOTE_OPENFIRE = 327,
TEXT_EMOTE_FLIRT = 328,
TEXT_EMOTE_JOKE = 329,
TEXT_EMOTE_GOLFCLAP = 343,
TEXT_EMOTE_WINK = 363,
TEXT_EMOTE_PAT = 364,
TEXT_EMOTE_SERIOUS = 365,
TEXT_EMOTE_MOUNT_SPECIAL = 366,
TEXT_EMOTE_GOODLUCK = 367,
TEXT_EMOTE_BLAME = 368,
TEXT_EMOTE_BLANK = 369,
TEXT_EMOTE_BRANDISH = 370,
TEXT_EMOTE_BREATH = 371,
TEXT_EMOTE_DISAGREE = 372,
TEXT_EMOTE_DOUBT = 373,
TEXT_EMOTE_EMBARRASS = 374,
TEXT_EMOTE_ENCOURAGE = 375,
TEXT_EMOTE_ENEMY = 376,
TEXT_EMOTE_EYEBROW = 377,
TEXT_EMOTE_TOAST = 378,
TEXT_EMOTE_FAIL = 379,
TEXT_EMOTE_HIGHFIVE = 380,
TEXT_EMOTE_ABSENT = 381,
TEXT_EMOTE_ARM = 382,
TEXT_EMOTE_AWE = 383,
TEXT_EMOTE_BACKPACK = 384,
TEXT_EMOTE_BADFEELING = 385,
TEXT_EMOTE_CHALLENGE = 386,
TEXT_EMOTE_CHUG = 387,
TEXT_EMOTE_DING = 389,
TEXT_EMOTE_FACEPALM = 390,
TEXT_EMOTE_FAINT = 391,
TEXT_EMOTE_GO = 392,
TEXT_EMOTE_GOING = 393,
TEXT_EMOTE_GLOWER = 394,
TEXT_EMOTE_HEADACHE = 395,
TEXT_EMOTE_HICCUP = 396,
TEXT_EMOTE_HISS = 398,
TEXT_EMOTE_HOLDHAND = 399,
TEXT_EMOTE_HURRY = 401,
TEXT_EMOTE_IDEA = 402,
TEXT_EMOTE_JEALOUS = 403,
TEXT_EMOTE_LUCK = 404,
TEXT_EMOTE_MAP = 405,
TEXT_EMOTE_MERCY = 406,
TEXT_EMOTE_MUTTER = 407,
TEXT_EMOTE_NERVOUS = 408,
TEXT_EMOTE_OFFER = 409,
TEXT_EMOTE_PET = 410,
TEXT_EMOTE_PINCH = 411,
TEXT_EMOTE_PROUD = 413,
TEXT_EMOTE_PROMISE = 414,
TEXT_EMOTE_PULSE = 415,
TEXT_EMOTE_PUNCH = 416,
TEXT_EMOTE_POUT = 417,
TEXT_EMOTE_REGRET = 418,
TEXT_EMOTE_REVENGE = 420,
TEXT_EMOTE_ROLLEYES = 421,
TEXT_EMOTE_RUFFLE = 422,
TEXT_EMOTE_SAD = 423,
TEXT_EMOTE_SCOFF = 424,
TEXT_EMOTE_SCOLD = 425,
TEXT_EMOTE_SCOWL = 426,
TEXT_EMOTE_SEARCH = 427,
TEXT_EMOTE_SHAKEFIST = 428,
TEXT_EMOTE_SHIFTY = 429,
TEXT_EMOTE_SHUDDER = 430,
TEXT_EMOTE_SIGNAL = 431,
TEXT_EMOTE_SILENCE = 432,
TEXT_EMOTE_SING = 433,
TEXT_EMOTE_SMACK = 434,
TEXT_EMOTE_SNEAK = 435,
TEXT_EMOTE_SNEEZE = 436,
TEXT_EMOTE_SNORT = 437,
TEXT_EMOTE_SQUEAL = 438,
TEXT_EMOTE_STOPATTACK = 439,
TEXT_EMOTE_SUSPICIOUS = 440,
TEXT_EMOTE_THINK = 441,
TEXT_EMOTE_TRUCE = 442,
TEXT_EMOTE_TWIDDLE = 443,
TEXT_EMOTE_WARN = 444,
TEXT_EMOTE_SNAP = 445,
TEXT_EMOTE_CHARM = 446,
TEXT_EMOTE_COVEREARS = 447,
TEXT_EMOTE_CROSSARMS = 448,
TEXT_EMOTE_LOOK = 449,
TEXT_EMOTE_OBJECT = 450,
TEXT_EMOTE_SWEAT = 451,
TEXT_EMOTE_YW = 453,
TEXT_EMOTE_READ = 456,
TEXT_EMOTE_BOOT = 506,
TEXT_EMOTE_FORTHEALLIANCE = 507,
TEXT_EMOTE_FORTHEHORDE = 508,
TEXT_EMOTE_WHOA = 517,
TEXT_EMOTE_OOPS = 518,
TEXT_EMOTE_ALLIANCE = 519,
TEXT_EMOTE_HORDE = 520,
TEXT_EMOTE_MEOW = 521,
TEXT_EMOTE_BOOP = 522
};
// Emotes.dbc (9.0.2)
enum Emote
{
EMOTE_ONESHOT_NONE = 0,
EMOTE_ONESHOT_TALK = 1,
EMOTE_ONESHOT_BOW = 2,
EMOTE_ONESHOT_WAVE = 3,
EMOTE_ONESHOT_CHEER = 4,
EMOTE_ONESHOT_EXCLAMATION = 5,
EMOTE_ONESHOT_QUESTION = 6,
EMOTE_ONESHOT_EAT = 7,
EMOTE_STATE_DANCE = 10,
EMOTE_ONESHOT_LAUGH = 11,
EMOTE_STATE_SLEEP = 12,
EMOTE_STATE_SIT = 13,
EMOTE_ONESHOT_RUDE = 14,
EMOTE_ONESHOT_ROAR = 15,
EMOTE_ONESHOT_KNEEL = 16,
EMOTE_ONESHOT_KISS = 17,
EMOTE_ONESHOT_CRY = 18,
EMOTE_ONESHOT_CHICKEN = 19,
EMOTE_ONESHOT_BEG = 20,
EMOTE_ONESHOT_APPLAUD = 21,
EMOTE_ONESHOT_SHOUT = 22,
EMOTE_ONESHOT_FLEX = 23,
EMOTE_ONESHOT_SHY = 24,
EMOTE_ONESHOT_POINT = 25,
EMOTE_STATE_STAND = 26,
EMOTE_STATE_READY_UNARMED = 27,
EMOTE_STATE_WORK_SHEATHED = 28,
EMOTE_STATE_POINT = 29,
EMOTE_STATE_NONE = 30,
EMOTE_ONESHOT_WOUND = 33,
EMOTE_ONESHOT_WOUND_CRITICAL = 34,
EMOTE_ONESHOT_ATTACK_UNARMED = 35,
EMOTE_ONESHOT_ATTACK1H = 36,
EMOTE_ONESHOT_ATTACK2HTIGHT = 37,
EMOTE_ONESHOT_ATTACK2H_LOOSE = 38,
EMOTE_ONESHOT_PARRY_UNARMED = 39,
EMOTE_ONESHOT_PARRY_SHIELD = 43,
EMOTE_ONESHOT_READY_UNARMED = 44,
EMOTE_ONESHOT_READY1H = 45,
EMOTE_ONESHOT_READY_BOW = 48,
EMOTE_ONESHOT_SPELL_PRECAST = 50,
EMOTE_ONESHOT_SPELL_CAST = 51,
EMOTE_ONESHOT_BATTLE_ROAR = 53,
EMOTE_ONESHOT_SPECIALATTACK1H = 54,
EMOTE_ONESHOT_KICK = 60,
EMOTE_ONESHOT_ATTACK_THROWN = 61,
EMOTE_STATE_STUN = 64,
EMOTE_STATE_DEAD = 65,
EMOTE_ONESHOT_SALUTE = 66,
EMOTE_STATE_KNEEL = 68,
EMOTE_STATE_USE_STANDING = 69,
EMOTE_ONESHOT_WAVE_NO_SHEATHE = 70,
EMOTE_ONESHOT_CHEER_NO_SHEATHE = 71,
EMOTE_ONESHOT_EAT_NO_SHEATHE = 92,
EMOTE_STATE_STUN_NO_SHEATHE = 93,
EMOTE_ONESHOT_DANCE = 94,
EMOTE_ONESHOT_SALUTE_NO_SHEATH = 113,
EMOTE_STATE_USE_STANDING_NO_SHEATHE = 133,
EMOTE_ONESHOT_LAUGH_NO_SHEATHE = 153,
EMOTE_STATE_WORK = 173,
EMOTE_STATE_SPELL_PRECAST = 193,
EMOTE_ONESHOT_READY_RIFLE = 213,
EMOTE_STATE_READY_RIFLE = 214,
EMOTE_STATE_WORK_MINING = 233,
EMOTE_STATE_WORK_CHOPWOOD = 234,
EMOTE_STATE_APPLAUD = 253,
EMOTE_ONESHOT_LIFTOFF = 254,
EMOTE_ONESHOT_YES = 273,
EMOTE_ONESHOT_NO = 274,
EMOTE_ONESHOT_TRAIN = 275,
EMOTE_ONESHOT_LAND = 293,
EMOTE_STATE_AT_EASE = 313,
EMOTE_STATE_READY1H = 333,
EMOTE_STATE_SPELL_KNEEL_START = 353,
EMOTE_STATE_SUBMERGED = 373,
EMOTE_ONESHOT_SUBMERGE = 374,
EMOTE_STATE_READY2H = 375,
EMOTE_STATE_READY_BOW = 376,
EMOTE_ONESHOT_MOUNT_SPECIAL = 377,
EMOTE_STATE_TALK = 378,
EMOTE_STATE_FISHING = 379,
EMOTE_ONESHOT_FISHING = 380,
EMOTE_ONESHOT_LOOT = 381,
EMOTE_STATE_WHIRLWIND = 382,
EMOTE_STATE_DROWNED = 383,
EMOTE_STATE_HOLD_BOW = 384,
EMOTE_STATE_HOLD_RIFLE = 385,
EMOTE_STATE_HOLD_THROWN = 386,
EMOTE_ONESHOT_DROWN = 387,
EMOTE_ONESHOT_STOMP = 388,
EMOTE_ONESHOT_ATTACK_OFF = 389,
EMOTE_ONESHOT_ATTACK_OFF_PIERCE = 390,
EMOTE_STATE_ROAR = 391,
EMOTE_STATE_LAUGH = 392,
EMOTE_ONESHOT_CREATURE_SPECIAL = 393,
EMOTE_ONESHOT_JUMPLANDRUN = 394,
EMOTE_ONESHOT_JUMPEND = 395,
EMOTE_ONESHOT_TALK_NO_SHEATHE = 396,
EMOTE_ONESHOT_POINT_NO_SHEATHE = 397,
EMOTE_STATE_CANNIBALIZE = 398,
EMOTE_ONESHOT_JUMPSTART = 399,
EMOTE_STATE_DANCESPECIAL = 400,
EMOTE_ONESHOT_DANCESPECIAL = 401,
EMOTE_ONESHOT_CUSTOM_SPELL_01 = 402,
EMOTE_ONESHOT_CUSTOM_SPELL_02 = 403,
EMOTE_ONESHOT_CUSTOM_SPELL_03 = 404,
EMOTE_ONESHOT_CUSTOM_SPELL_04 = 405,
EMOTE_ONESHOT_CUSTOM_SPELL_05 = 406,
EMOTE_ONESHOT_CUSTOM_SPELL_06 = 407,
EMOTE_ONESHOT_CUSTOM_SPELL_07 = 408,
EMOTE_ONESHOT_CUSTOM_SPELL_08 = 409,
EMOTE_ONESHOT_CUSTOM_SPELL_09 = 410,
EMOTE_ONESHOT_CUSTOM_SPELL_10 = 411,
EMOTE_STATE_EXCLAIM = 412,
EMOTE_STATE_DANCE_CUSTOM = 413,
EMOTE_STATE_SIT_CHAIR_MED = 415,
EMOTE_STATE_CUSTOM_SPELL_01 = 416,
EMOTE_STATE_CUSTOM_SPELL_02 = 417,
EMOTE_STATE_EAT = 418,
EMOTE_STATE_CUSTOM_SPELL_04 = 419,
EMOTE_STATE_CUSTOM_SPELL_03 = 420,
EMOTE_STATE_CUSTOM_SPELL_05 = 421,
EMOTE_STATE_SPELLEFFECT_HOLD = 422,
EMOTE_STATE_EAT_NO_SHEATHE = 423,
EMOTE_STATE_MOUNT = 424,
EMOTE_STATE_READY2HL = 425,
EMOTE_STATE_SIT_CHAIR_HIGH = 426,
EMOTE_STATE_FALL = 427,
EMOTE_STATE_LOOT = 428,
EMOTE_STATE_SUBMERGED_NEW = 429,
EMOTE_ONESHOT_COWER = 430,
EMOTE_STATE_COWER = 431,
EMOTE_ONESHOT_USE_STANDING = 432,
EMOTE_STATE_STEALTH_STAND = 433,
EMOTE_ONESHOT_OMNICAST_GHOUL = 434,
EMOTE_ONESHOT_ATTACK_BOW = 435,
EMOTE_ONESHOT_ATTACK_RIFLE = 436,
EMOTE_STATE_SWIM_IDLE = 437,
EMOTE_STATE_ATTACK_UNARMED = 438,
EMOTE_ONESHOT_SPELL_CAST_W_SOUND = 439,
EMOTE_ONESHOT_DODGE = 440,
EMOTE_ONESHOT_PARRY1H = 441,
EMOTE_ONESHOT_PARRY2H = 442,
EMOTE_ONESHOT_PARRY2HL = 443,
EMOTE_STATE_FLYFALL = 444,
EMOTE_ONESHOT_FLYDEATH = 445,
EMOTE_STATE_FLY_FALL = 446,
EMOTE_ONESHOT_FLY_SIT_GROUND_DOWN = 447,
EMOTE_ONESHOT_FLY_SIT_GROUND_UP = 448,
EMOTE_ONESHOT_EMERGE = 449,
EMOTE_ONESHOT_DRAGON_SPIT = 450,
EMOTE_STATE_SPECIAL_UNARMED = 451,
EMOTE_ONESHOT_FLYGRAB = 452,
EMOTE_STATE_FLYGRABCLOSED = 453,
EMOTE_ONESHOT_FLYGRABTHROWN = 454,
EMOTE_STATE_FLY_SIT_GROUND = 455,
EMOTE_STATE_WALK_BACKWARDS = 456,
EMOTE_ONESHOT_FLYTALK = 457,
EMOTE_ONESHOT_FLYATTACK1H = 458,
EMOTE_STATE_CUSTOM_SPELL_08 = 459,
EMOTE_ONESHOT_FLY_DRAGON_SPIT = 460,
EMOTE_STATE_SIT_CHAIR_LOW = 461,
EMOTE_ONESHOT_STUN = 462,
EMOTE_ONESHOT_SPELL_CAST_OMNI = 463,
EMOTE_STATE_READY_THROWN = 465,
EMOTE_ONESHOT_WORK_CHOPWOOD = 466,
EMOTE_ONESHOT_WORK_MINING = 467,
EMOTE_STATE_SPELL_CHANNEL_OMNI = 468,
EMOTE_STATE_SPELL_CHANNEL_DIRECTED = 469,
EMOTE_STAND_STATE_NONE = 470,
EMOTE_STATE_READYJOUST = 471,
EMOTE_STATE_STRANGULATE = 472,
EMOTE_STATE_STRANGULATE2 = 473,
EMOTE_STATE_READY_SPELL_OMNI = 474,
EMOTE_STATE_HOLD_JOUST = 475,
EMOTE_ONESHOT_CRY_JAINA = 476,
EMOTE_ONESHOT_SPECIAL_UNARMED = 477,
EMOTE_STATE_DANCE_NOSHEATHE = 478,
EMOTE_ONESHOT_SNIFF = 479,
EMOTE_ONESHOT_DRAGONSTOMP = 480,
EMOTE_ONESHOT_KNOCKDOWN = 482,
EMOTE_STATE_READ = 483,
EMOTE_ONESHOT_FLYEMOTETALK = 485,
EMOTE_STATE_READ_ALLOWMOVEMENT = 492,
EMOTE_STATE_CUSTOM_SPELL_06 = 498,
EMOTE_STATE_CUSTOM_SPELL_07 = 499,
EMOTE_STATE_CUSTOM_SPELL_08_2 = 500,
EMOTE_STATE_CUSTOM_SPELL_09 = 501,
EMOTE_STATE_CUSTOM_SPELL_10 = 502,
EMOTE_STATE_READY1H_ALLOW_MOVEMENT = 505,
EMOTE_STATE_READY2H_ALLOW_MOVEMENT = 506,
EMOTE_ONESHOT_MONKOFFENSE_ATTACKUNARMED = 507,
EMOTE_ONESHOT_MONKOFFENSE_SPECIALUNARMED = 508,
EMOTE_ONESHOT_MONKOFFENSE_PARRYUNARMED = 509,
EMOTE_STATE_MONKOFFENSE_READYUNARMED = 510,
EMOTE_ONESHOT_PALMSTRIKE = 511,
EMOTE_STATE_CRANE = 512,
EMOTE_ONESHOT_OPEN = 517,
EMOTE_STATE_READ_CHRISTMAS = 518,
EMOTE_ONESHOT_FLYATTACK2HL = 526,
EMOTE_ONESHOT_FLYATTACKTHROWN = 527,
EMOTE_STATE_FLYREADYSPELLDIRECTED = 528,
EMOTE_STATE_FLY_READY_1H = 531,
EMOTE_STATE_MEDITATE = 533,
EMOTE_STATE_FLY_READY_2HL = 534,
EMOTE_ONESHOT_TOGROUND = 535,
EMOTE_ONESHOT_TOFLY = 536,
EMOTE_STATE_ATTACKTHROWN = 537,
EMOTE_STATE_SPELL_CHANNEL_DIRECTED_NOSOUND = 538,
EMOTE_ONESHOT_WORK = 539,
EMOTE_STATE_READYUNARMED_NOSOUND = 540,
EMOTE_ONESHOT_MONKOFFENSE_ATTACKUNARMEDOFF = 543,
EMOTE_RECLINED_MOUNT_PASSENGER = 546,
EMOTE_ONESHOT_QUESTION_2 = 547,
EMOTE_ONESHOT_SPELL_CHANNEL_DIRECTED_NOSOUND = 549,
EMOTE_STATE_KNEEL_2 = 550,
EMOTE_ONESHOT_FLYATTACKUNARMED = 551,
EMOTE_ONESHOT_FLYCOMBATWOUND = 552,
EMOTE_ONESHOT_MOUNTSELFSPECIAL = 553,
EMOTE_ONESHOT_ATTACKUNARMED_NOSOUND = 554,
EMOTE_STATE_WOUNDCRITICAL_DOESNT_WORK = 555,
EMOTE_ONESHOT_ATTACK1H_NO_SOUND = 556,
EMOTE_STATE_MOUNT_SELF_IDLE = 557,
EMOTE_ONESHOT_WALK = 558,
EMOTE_STATE_OPENED = 559,
EMOTE_STATE_CUSTOMSPELL03 = 564,
EMOTE_ONESHOT_BREATHOFFIRE = 565,
EMOTE_STATE_ATTACK1H = 567,
EMOTE_STATE_WORK_CHOPWOOD_2 = 568,
EMOTE_STATE_USESTANDING_LOOP = 569,
EMOTE_STATE_USESTANDING = 572,
EMOTE_ONESHOT_SHEATH = 573,
EMOTE_ONESHOT_LAUGH_NO_SOUND = 574,
EMOTE_RECLINED_MOUNT = 575,
EMOTE_ONESHOT_ATTACK1H_2 = 577,
EMOTE_STATE_CRY_NOSOUND = 578,
EMOTE_ONESHOT_CRY_NOSOUND = 579,
EMOTE_ONESHOT_COMBATCRITICAL = 584,
EMOTE_STATE_TRAIN = 585,
EMOTE_STATE_WORK_CHOPWOOD_LUMBER_AXE = 586,
EMOTE_ONESHOT_SPECIALATTACK2H = 587,
EMOTE_STATE_READ_AND_TALK = 588,
EMOTE_ONESHOT_STAND_VAR1 = 589,
EMOTE_REXXAR_STRANGLES_GOBLIN = 590,
EMOTE_ONESHOT_STAND_VAR2 = 591,
EMOTE_ONESHOT_DEATH = 592,
EMOTE_STATE_TALKONCE = 595,
EMOTE_STATE_ATTACK2H = 596,
EMOTE_STATE_SIT_GROUND = 598,
EMOTE_STATE_WORK_CHOPWOOD3 = 599,
EMOTE_STATE_CUSTOMSPELL01 = 601,
EMOTE_ONESHOT_COMBATWOUND = 602,
EMOTE_ONESHOT_TALK_EXCLAMATION = 603,
EMOTE_ONESHOT_QUESTION2 = 604,
EMOTE_STATE_CRY = 605,
EMOTE_STATE_USESTANDING_LOOP2 = 606,
EMOTE_STATE_WORK_SMITH = 613,
EMOTE_STATE_WORK_CHOPWOOD4 = 614,
EMOTE_STATE_CUSTOMSPELL02 = 615,
EMOTE_STATE_READ_AND_SIT = 616,
EMOTE_STATE_PARRY_UNARMED = 619,
EMOTE_STATE_BLOCK_SHIELD = 620,
EMOTE_STATE_SIT_GROUND_2 = 621,
EMOTE_ONESHOT_MOUNTSPECIAL = 628,
EMOTE_ONESHOT_SETTLE = 636,
EMOTE_STATE_ATTACK_UNARMED_STILL = 638,
EMOTE_STATE_READ_BOOK_AND_TALK = 641,
EMOTE_ONESHOT_SLAM = 642,
EMOTE_ONESHOT_GRABTHROWN = 643,
EMOTE_ONESHOT_READYSPELLDIRECTED_NOSOUND = 644,
EMOTE_STATE_READYSPELLOMNI_WITH_SOUND = 645,
EMOTE_ONESHOT_TALK_BARSERVER = 646,
EMOTE_ONESHOT_WAVE_BARSERVER = 647,
EMOTE_STATE_WORK_MINING_2 = 648,
EMOTE_STATE_READY2HL_ALLOW_MOVEMENT = 654,
EMOTE_STATE_USESTANDING_NOSHEATHE_STILL = 655,
EMOTE_ONESHOT_WORK_STILL = 657,
EMOTE_STATE_HOLD_THROWN_INTERRUPTS = 658,
EMOTE_ONESHOT_CANNIBALIZE = 659,
EMOTE_ONESHOT_NO_NOT_SWIMMING = 661,
EMOTE_STATE_READYGLV = 663,
EMOTE_ONESHOT_COMBATABILITYGLV01 = 664,
EMOTE_ONESHOT_COMBATABILITYGLVOFF01 = 665,
EMOTE_ONESHOT_COMBATABILITYGLVBIG02 = 666,
EMOTE_ONESHOT_PARRYGLV = 667,
EMOTE_STATE_WORK_MINING_3 = 668,
EMOTE_ONESHOT_TALK_NOSHEATHE = 669,
EMOTE_ONESHOT_STAND_VAR3 = 671,
EMOTE_STATE_KNEEL_3 = 672,
EMOTE_ONESHOT_CUSTOM0 = 673,
EMOTE_ONESHOT_CUSTOM1 = 674,
EMOTE_ONESHOT_CUSTOM2 = 675,
EMOTE_ONESHOT_CUSTOM3 = 676,
EMOTE_STATE_FLY_READY_UNARMED = 677,
EMOTE_ONESHOT_CHEER_FORTHEALLIANCE = 679,
EMOTE_ONESHOT_CHEER_FORTHEHORDE = 680,
EMOTE_ONESHOT_STAND_VAR4 = 690,
EMOTE_ONESHOT_FLYEMOTEEXCLAMATION = 691,
EMOTE_STATE_EMOTEEAT = 700,
EMOTE_STATE_MONKHEAL_CHANNELOMNI = 705,
EMOTE_STATE_MONKDEFENSE_READYUNARMED = 706,
EMOTE_ONESHOT_STAND = 707,
EMOTE_STATE_WAPOURHOLD = 709,
EMOTE_STATE_READYBLOWDART = 710,
EMOTE_STATE_WORK_CHOPMEAT = 711,
EMOTE_STATE_MONK2HLIDLE = 712,
EMOTE_STATE_WAPERCH = 713,
EMOTE_STATE_WAGUARDSTAND01 = 714,
EMOTE_STATE_READ_AND_SIT_CHAIR_MED = 715,
EMOTE_STATE_WAGUARDSTAND02 = 716,
EMOTE_STATE_WAGUARDSTAND03 = 717,
EMOTE_STATE_WAGUARDSTAND04 = 718,
EMOTE_STATE_WACHANT02 = 719,
EMOTE_STATE_WALEAN01 = 720,
EMOTE_STATE_DRUNKWALK = 721,
EMOTE_STATE_WASCRUBBING = 722,
EMOTE_STATE_WACHANT01 = 723,
EMOTE_STATE_WACHANT03 = 724,
EMOTE_STATE_WASUMMON01 = 725,
EMOTE_STATE_WATRANCE01 = 726,
EMOTE_STATE_CUSTOMSPELL05 = 727,
EMOTE_STATE_WAHAMMERLOOP = 728,
EMOTE_STATE_WABOUND01 = 729,
EMOTE_STATE_WABOUND02 = 730,
EMOTE_STATE_WASACKHOLD = 731,
EMOTE_STATE_WASIT01 = 732,
EMOTE_STATE_WAROWINGSTANDLEFT = 733,
EMOTE_STATE_WAROWINGSTANDRIGHT = 734,
EMOTE_STATE_LOOT_BITE_SOUND = 735,
EMOTE_ONESHOT_WASUMMON01 = 736,
EMOTE_ONESHOT_STAND_VAR2_2 = 737,
EMOTE_ONESHOT_FALCONEER_START = 738,
EMOTE_STATE_FALCONEER_LOOP = 739,
EMOTE_ONESHOT_FALCONEER_END = 740,
EMOTE_STATE_WAPERCH_NOINTERACT = 741,
EMOTE_ONESHOT_WASTANDDRINK = 742,
EMOTE_STATE_WALEAN02 = 743,
EMOTE_ONESHOT_READ_END = 744,
EMOTE_STATE_WAGUARDSTAND04_ALLOW_MOVEMENT = 745,
EMOTE_STATE_READYCROSSBOW = 747,
EMOTE_ONESHOT_WASTANDDRINK_NOSHEATH = 748,
EMOTE_STATE_WAHANG01 = 749,
EMOTE_STATE_WABEGGARSTAND = 750,
EMOTE_STATE_WADRUNKSTAND = 751,
EMOTE_ONESHOT_WACRIERTALK = 753,
EMOTE_STATE_HOLD_CROSSBOW = 754,
EMOTE_STATE_WASIT02 = 757,
EMOTE_STATE_WACRANKSTAND = 761,
EMOTE_ONESHOT_READ_START = 762,
EMOTE_ONESHOT_READ_LOOP = 763,
EMOTE_ONESHOT_WADRUNKDRINK = 765,
EMOTE_STATE_SIT_CHAIR_MED_EAT = 766,
EMOTE_STATE_KNEEL_COPY = 867,
EMOTE_STATE_WORK_CHOPMEAT_NOSHEATHE = 868,
EMOTE_ONESHOT_BARPATRON_POINT = 870,
EMOTE_STATE_STAND_NOSOUND = 871,
EMOTE_STATE_MOUNT_FLIGHT_IDLE_NOSOUND = 872,
EMOTE_STATE_USESTANDING_LOOP_2 = 873,
EMOTE_ONESHOT_VEHICLEGRAB = 874,
EMOTE_STATE_USESTANDING_LOOP_3 = 875,
EMOTE_STATE_BARPATRON_STAND = 876,
EMOTE_ONESHOT_WABEGGARPOINT = 877,
EMOTE_STATE_WACRIERSTAND01 = 878,
EMOTE_ONESHOT_WABEGGARBEG = 879,
EMOTE_STATE_WABOATWHEELSTAND = 880,
EMOTE_STATE_WASIT03 = 882,
EMOTE_STATE_BARSWEEP_STAND = 883,
EMOTE_STATE_WAGUARDSTAND03_2 = 884,
EMOTE_STATE_WAGUARDSTAND02_2 = 885,
EMOTE_STATE_BARTENDSTAND = 886,
EMOTE_STATE_WAHAMMERLOOP_2 = 887,
EMOTE_STATE_READYTHROWN = 890,
EMOTE_STATE_WORK_MINING_4 = 893,
EMOTE_ONESHOT_CASTSTRONG = 894,
EMOTE_STATE_CUSTOMSPELL07 = 895,
EMOTE_STATE_WALK = 897,
EMOTE_ONESHOT_CLOSE = 898,
EMOTE_STATE_WACRATEHOLD = 900,
EMOTE_STATE_FLYCUSTOMSPELL02 = 901,
EMOTE_ONESHOT_SLEEP = 902,
EMOTE_STATE_STAND_SETEMOTESTATE = 903,
EMOTE_ONESHOT_WAWALKTALK = 904,
EMOTE_ONESHOT_TAKE_OFF_FINISH = 905,
EMOTE_ONESHOT_ATTACK2H = 906,
EMOTE_STATE_WA_BARREL_HOLD = 908,
EMOTE_STATE_WA_BARREL_WALK = 909,
EMOTE_STATE_CUSTOMSPELL04 = 910,
EMOTE_STATE_FLYWAPERCH01 = 912,
EMOTE_ONESHOT_PALSPELLCAST1HUP = 916,
EMOTE_ONESHOT_READYSPELLOMNI = 917,
EMOTE_ONESHOT_SPELLCAST_DIRECTED = 961,
EMOTE_STATE_FLYCUSTOMSPELL07 = 977,
EMOTE_STATE_FLYCHANNELCASTOMNI = 978,
EMOTE_STATE_CLOSED = 979,
EMOTE_STATE_CUSTOMSPELL10 = 980,
EMOTE_STATE_WAWHEELBARROWSTAND = 981,
EMOTE_STATE_CUSTOMSPELL06 = 982,
EMOTE_STATE_CUSTOM1 = 983,
EMOTE_STATE_WASIT04 = 986,
EMOTE_ONESHOT_BARSWEEP_STAND = 987,
EMOTE_TORGHAST_TALKING_HEAD_MAW_CAST_SOUND = 989,
EMOTE_TORGHAST_TALKING_HEAD_MAW_CAST_SOUND_2 = 990
};
// AnimationData.dbc (9.0.2)
enum Anim
{
ANIM_STAND = 0,
ANIM_DEATH = 1,
ANIM_SPELL = 2,
ANIM_STOP = 3,
ANIM_WALK = 4,
ANIM_RUN = 5,
ANIM_DEAD = 6,
ANIM_RISE = 7,
ANIM_STAND_WOUND = 8,
ANIM_COMBAT_WOUND = 9,
ANIM_COMBAT_CRITICAL = 10,
ANIM_SHUFFLE_LEFT = 11,
ANIM_SHUFFLE_RIGHT = 12,
ANIM_WALK_BACKWARDS = 13,
ANIM_STUN = 14,
ANIM_HANDS_CLOSED = 15,
ANIM_ATTACK_UNARMED = 16,
ANIM_ATTACK1H = 17,
ANIM_ATTACK2H = 18,
ANIM_ATTACK2HL = 19,
ANIM_PARRY_UNARMED = 20,
ANIM_PARRY1H = 21,
ANIM_PARRY2H = 22,
ANIM_PARRY2HL = 23,
ANIM_SHIELD_BLOCK = 24,
ANIM_READY_UNARMED = 25,
ANIM_READY1H = 26,
ANIM_READY2H = 27,
ANIM_READY2HL = 28,
ANIM_READY_BOW = 29,
ANIM_DODGE = 30,
ANIM_SPELL_PRECAST = 31,
ANIM_SPELL_CAST = 32,
ANIM_SPELL_CAST_AREA = 33,
ANIM_NPC_WELCOME = 34,
ANIM_NPC_GOODBYE = 35,
ANIM_BLOCK = 36,
ANIM_JUMP_START = 37,
ANIM_JUMP = 38,
ANIM_JUMP_END = 39,
ANIM_FALL = 40,
ANIM_SWIM_IDLE = 41,
ANIM_SWIM = 42,
ANIM_SWIM_LEFT = 43,
ANIM_SWIM_RIGHT = 44,
ANIM_SWIM_BACKWARDS = 45,
ANIM_ATTACK_BOW = 46,
ANIM_FIRE_BOW = 47,
ANIM_READY_RIFLE = 48,
ANIM_ATTACK_RIFLE = 49,
ANIM_LOOT = 50,
ANIM_READY_SPELL_DIRECTED = 51,
ANIM_READY_SPELL_OMNI = 52,
ANIM_SPELL_CAST_DIRECTED = 53,
ANIM_SPELL_CAST_OMNI = 54,
ANIM_BATTLE_ROAR = 55,
ANIM_READY_ABILITY = 56,
ANIM_SPECIAL1H = 57,
ANIM_SPECIAL2H = 58,
ANIM_SHIELD_BASH = 59,
ANIM_EMOTE_TALK = 60,
ANIM_EMOTE_EAT = 61,
ANIM_EMOTE_WORK = 62,
ANIM_EMOTE_USE_STANDING = 63,
ANIM_EMOTE_TALK_EXCLAMATION = 64,
ANIM_EMOTE_TALK_QUESTION = 65,
ANIM_EMOTE_BOW = 66,
ANIM_EMOTE_WAVE = 67,
ANIM_EMOTE_CHEER = 68,
ANIM_EMOTE_DANCE = 69,
ANIM_EMOTE_LAUGH = 70,
ANIM_EMOTE_SLEEP = 71,
ANIM_EMOTE_SIT_GROUND = 72,
ANIM_EMOTE_RUDE = 73,
ANIM_EMOTE_ROAR = 74,
ANIM_EMOTE_KNEEL = 75,
ANIM_EMOTE_KISS = 76,
ANIM_EMOTE_CRY = 77,
ANIM_EMOTE_CHICKEN = 78,
ANIM_EMOTE_BEG = 79,
ANIM_EMOTE_APPLAUD = 80,
ANIM_EMOTE_SHOUT = 81,
ANIM_EMOTE_FLEX = 82,
ANIM_EMOTE_SHY = 83,
ANIM_EMOTE_POINT = 84,
ANIM_ATTACK1H_PIERCE = 85,
ANIM_ATTACK2H_LOOSE_PIERCE = 86,
ANIM_ATTACK_OFF = 87,
ANIM_ATTACK_OFF_PIERCE = 88,
ANIM_SHEATHE = 89,
ANIM_HIP_SHEATHE = 90,
ANIM_MOUNT = 91,
ANIM_RUN_RIGHT = 92,
ANIM_RUN_LEFT = 93,
ANIM_MOUNT_SPECIAL = 94,
ANIM_KICK = 95,
ANIM_SIT_GROUND_DOWN = 96,
ANIM_SIT_GROUND = 97,
ANIM_SIT_GROUND_UP = 98,
ANIM_SLEEP_DOWN = 99,
ANIM_SLEEP = 100,
ANIM_SLEEP_UP = 101,
ANIM_SIT_CHAIR_LOW = 102,
ANIM_SIT_CHAIR_MED = 103,
ANIM_SIT_CHAIR_HIGH = 104,
ANIM_LOAD_BOW = 105,
ANIM_LOAD_RIFLE = 106,
ANIM_ATTACK_THROWN = 107,
ANIM_READY_THROWN = 108,
ANIM_HOLD_BOW = 109,
ANIM_HOLD_RIFLE = 110,
ANIM_HOLD_THROWN = 111,
ANIM_LOAD_THROWN = 112,
ANIM_EMOTE_SALUTE = 113,
ANIM_KNEEL_START = 114,
ANIM_KNEEL_LOOP = 115,
ANIM_KNEEL_END = 116,
ANIM_ATTACK_UNARMED_OFF = 117,
ANIM_SPECIAL_UNARMED = 118,
ANIM_STEALTH_WALK = 119,
ANIM_STEALTH_STAND = 120,
ANIM_KNOCKDOWN = 121,
ANIM_EATING_LOOP = 122,
ANIM_USE_STANDING_LOOP = 123,
ANIM_CHANNEL_CAST_DIRECTED = 124,
ANIM_CHANNEL_CAST_OMNI = 125,
ANIM_WHIRLWIND = 126,
ANIM_BIRTH = 127,
ANIM_USE_STANDING_START = 128,
ANIM_USE_STANDING_END = 129,
ANIM_CREATURE_SPECIAL = 130,
ANIM_DROWN = 131,
ANIM_DROWNED = 132,
ANIM_FISHING_CAST = 133,
ANIM_FISHING_LOOP = 134,
ANIM_FLY = 135,
ANIM_EMOTE_WORK_NO_SHEATHE = 136,
ANIM_EMOTE_STUN_NO_SHEATHE = 137,
ANIM_EMOTE_USE_STANDING_NO_SHEATHE = 138,
ANIM_SPELL_SLEEP_DOWN = 139,
ANIM_SPELL_KNEEL_START = 140,
ANIM_SPELL_KNEEL_LOOP = 141,
ANIM_SPELL_KNEEL_END = 142,
ANIM_SPRINT = 143,
ANIM_IN_FLIGHT = 144,
ANIM_SPAWN = 145,
ANIM_CLOSE = 146,
ANIM_CLOSED = 147,
ANIM_OPEN = 148,
ANIM_OPENED = 149,
ANIM_DESTROY = 150,
ANIM_DESTROYED = 151,
ANIM_REBUILD = 152,
ANIM_CUSTOM_0 = 153,
ANIM_CUSTOM_1 = 154,
ANIM_CUSTOM_2 = 155,
ANIM_CUSTOM_3 = 156,
ANIM_DESPAWN = 157,
ANIM_HOLD = 158,
ANIM_DECAY = 159,
ANIM_BOW_PULL = 160,
ANIM_BOW_RELEASE = 161,
ANIM_SHIP_START = 162,
ANIM_SHIP_MOVING = 163,
ANIM_SHIP_STOP = 164,
ANIM_GROUP_ARROW = 165,
ANIM_ARROW = 166,
ANIM_CORPSE_ARROW = 167,
ANIM_GUIDE_ARROW = 168,
ANIM_SWAY = 169,
ANIM_DRUID_CAT_POUNCE = 170,
ANIM_DRUID_CAT_RIP = 171,
ANIM_DRUID_CAT_RAKE = 172,
ANIM_DRUID_CAT_RAVAGE = 173,
ANIM_DRUID_CAT_CLAW = 174,
ANIM_DRUID_CAT_COWER = 175,
ANIM_DRUID_BEAR_SWIPE = 176,
ANIM_DRUID_BEAR_BITE = 177,
ANIM_DRUID_BEAR_MAUL = 178,
ANIM_DRUID_BEAR_BASH = 179,
ANIM_DRAGON_TAIL = 180,
ANIM_DRAGON_STOMP = 181,
ANIM_DRAGON_SPIT = 182,
ANIM_DRAGON_SPIT_HOVER = 183,
ANIM_DRAGON_SPIT_FLY = 184,
ANIM_EMOTE_YES = 185,
ANIM_EMOTE_NO = 186,
ANIM_JUMP_LAND_RUN = 187,
ANIM_LOOT_HOLD = 188,
ANIM_LOOT_UP = 189,
ANIM_STAND_HIGH = 190,
ANIM_IMPACT = 191,
ANIM_LIFTOFF = 192,
ANIM_HOVER = 193,
ANIM_SUCCUBUS_ENTICE = 194,
ANIM_EMOTE_TRAIN = 195,
ANIM_EMOTE_DEAD = 196,
ANIM_EMOTE_DANCE_ONCE = 197,
ANIM_DEFLECT = 198,
ANIM_EMOTE_EAT_NO_SHEATHE = 199,
ANIM_LAND = 200,
ANIM_SUBMERGE = 201,
ANIM_SUBMERGED = 202,
ANIM_CANNIBALIZE = 203,
ANIM_ARROW_BIRTH = 204,
ANIM_GROUP_ARROW_BIRTH = 205,
ANIM_CORPSE_ARROW_BIRTH = 206,
ANIM_GUIDE_ARROW_BIRTH = 207,
ANIM_EMOTE_TALK_NO_SHEATHE = 208,
ANIM_EMOTE_POINT_NO_SHEATHE = 209,
ANIM_EMOTE_SALUTE_NO_SHEATHE = 210,
ANIM_EMOTE_DANCE_SPECIAL = 211,
ANIM_MUTILATE = 212,
ANIM_CUSTOM_SPELL_01 = 213,
ANIM_CUSTOM_SPELL_02 = 214,
ANIM_CUSTOM_SPELL_03 = 215,
ANIM_CUSTOM_SPELL_04 = 216,
ANIM_CUSTOM_SPELL_05 = 217,
ANIM_CUSTOM_SPELL_06 = 218,
ANIM_CUSTOM_SPELL_07 = 219,
ANIM_CUSTOM_SPELL_08 = 220,
ANIM_CUSTOM_SPELL_09 = 221,
ANIM_CUSTOM_SPELL_10 = 222,
ANIM_STEALTH_RUN = 223,
ANIM_EMERGE = 224,
ANIM_COWER = 225,
ANIM_GRAB = 226,
ANIM_GRAB_CLOSED = 227,
ANIM_GRAB_THROWN = 228,
ANIM_FLY_STAND = 229,
ANIM_FLY_DEATH = 230,
ANIM_FLY_SPELL = 231,
ANIM_FLY_STOP = 232,
ANIM_FLY_WALK = 233,
ANIM_FLY_RUN = 234,
ANIM_FLY_DEAD = 235,
ANIM_FLY_RISE = 236,
ANIM_FLY_STAND_WOUND = 237,
ANIM_FLY_COMBAT_WOUND = 238,
ANIM_FLY_COMBAT_CRITICAL = 239,
ANIM_FLY_SHUFFLE_LEFT = 240,
ANIM_FLY_SHUFFLE_RIGHT = 241,
ANIM_FLY_WALK_BACKWARDS = 242,
ANIM_FLY_STUN = 243,
ANIM_FLY_HANDS_CLOSED = 244,
ANIM_FLY_ATTACK_UNARMED = 245,
ANIM_FLY_ATTACK1H = 246,
ANIM_FLY_ATTACK2H = 247,
ANIM_FLY_ATTACK2HL = 248,
ANIM_FLY_PARRY_UNARMED = 249,
ANIM_FLY_PARRY1H = 250,
ANIM_FLY_PARRY2H = 251,
ANIM_FLY_PARRY2HL = 252,
ANIM_FLY_SHIELD_BLOCK = 253,
ANIM_FLY_READY_UNARMED = 254,
ANIM_FLY_READY1H = 255,
ANIM_FLY_READY2H = 256,
ANIM_FLY_READY2HL = 257,
ANIM_FLY_READY_BOW = 258,
ANIM_FLY_DODGE = 259,
ANIM_FLY_SPELL_PRECAST = 260,
ANIM_FLY_SPELL_CAST = 261,
ANIM_FLY_SPELL_CAST_AREA = 262,
ANIM_FLY_NPC_WELCOME = 263,
ANIM_FLY_NPC_GOODBYE = 264,
ANIM_FLY_BLOCK = 265,
ANIM_FLY_JUMP_START = 266,
ANIM_FLY_JUMP = 267,
ANIM_FLY_JUMP_END = 268,
ANIM_FLY_FALL = 269,
ANIM_FLY_SWIM_IDLE = 270,
ANIM_FLY_SWIM = 271,
ANIM_FLY_SWIM_LEFT = 272,
ANIM_FLY_SWIM_RIGHT = 273,
ANIM_FLY_SWIM_BACKWARDS = 274,
ANIM_FLY_ATTACK_BOW = 275,
ANIM_FLY_FIRE_BOW = 276,
ANIM_FLY_READY_RIFLE = 277,
ANIM_FLY_ATTACK_RIFLE = 278,
ANIM_FLY_LOOT = 279,
ANIM_FLY_READY_SPELL_DIRECTED = 280,
ANIM_FLY_READY_SPELL_OMNI = 281,
ANIM_FLY_SPELL_CAST_DIRECTED = 282,
ANIM_FLY_SPELL_CAST_OMNI = 283,
ANIM_FLY_SPELL_BATTLE_ROAR = 284,
ANIM_FLY_READY_ABILITY = 285,
ANIM_FLY_SPECIAL1H = 286,
ANIM_FLY_SPECIAL2H = 287,
ANIM_FLY_SHIELD_BASH = 288,
ANIM_FLY_EMOTE_TALK = 289,
ANIM_FLY_EMOTE_EAT = 290,
ANIM_FLY_EMOTE_WORK = 291,
ANIM_FLY_USE_STANDING = 292,
ANIM_FLY_EMOTE_TALK_EXCLAMATION = 293,
ANIM_FLY_EMOTE_TALK_QUESTION = 294,
ANIM_FLY_EMOTE_BOW = 295,
ANIM_FLY_EMOTE_WAVE = 296,
ANIM_FLY_EMOTE_CHEER = 297,
ANIM_FLY_EMOTE_DANCE = 298,
ANIM_FLY_EMOTE_LAUGH = 299,
ANIM_FLY_EMOTE_SLEEP = 300,
ANIM_FLY_EMOTE_SIT_GROUND = 301,
ANIM_FLY_EMOTE_RUDE = 302,
ANIM_FLY_EMOTE_ROAR = 303,
ANIM_FLY_EMOTE_KNEEL = 304,
ANIM_FLY_EMOTE_KISS = 305,
ANIM_FLY_EMOTE_CRY = 306,
ANIM_FLY_EMOTE_CHICKEN = 307,
ANIM_FLY_EMOTE_BEG = 308,
ANIM_FLY_EMOTE_APPLAUD = 309,
ANIM_FLY_EMOTE_SHOUT = 310,
ANIM_FLY_EMOTE_FLEX = 311,
ANIM_FLY_EMOTE_SHY = 312,
ANIM_FLY_EMOTE_POINT = 313,
ANIM_FLY_ATTACK1H_PIERCE = 314,
ANIM_FLY_ATTACK2H_LOOSE_PIERCE = 315,
ANIM_FLY_ATTACK_OFF = 316,
ANIM_FLY_ATTACK_OFF_PIERCE = 317,
ANIM_FLY_SHEATH = 318,
ANIM_FLY_HIP_SHEATH = 319,
ANIM_FLY_MOUNT = 320,
ANIM_FLY_RUN_RIGHT = 321,
ANIM_FLY_RUN_LEFT = 322,
ANIM_FLY_MOUNT_SPECIAL = 323,
ANIM_FLY_KICK = 324,
ANIM_FLY_SIT_GROUND_DOWN = 325,
ANIM_FLY_SIT_GROUND = 326,
ANIM_FLY_SIT_GROUND_UP = 327,
ANIM_FLY_SLEEP_DOWN = 328,
ANIM_FLY_SLEEP = 329,
ANIM_FLY_SLEEP_UP = 330,
ANIM_FLY_SIT_CHAIR_LOW = 331,
ANIM_FLY_SIT_CHAIR_MED = 332,
ANIM_FLY_SIT_CHAIR_HIGH = 333,
ANIM_FLY_LOAD_BOW = 334,
ANIM_FLY_LOAD_RIFLE = 335,
ANIM_FLY_ATTACK_THROWN = 336,
ANIM_FLY_READY_THROWN = 337,
ANIM_FLY_HOLD_BOW = 338,
ANIM_FLY_HOLD_RIFLE = 339,
ANIM_FLY_HOLD_THROWN = 340,
ANIM_FLY_LOAD_THROWN = 341,
ANIM_FLY_EMOTE_SALUTE = 342,
ANIM_FLY_KNEEL_START = 343,
ANIM_FLY_KNEEL_LOOP = 344,
ANIM_FLY_KNEEL_END = 345,
ANIM_FLY_ATTACK_UNARMED_OFF = 346,
ANIM_FLY_SPECIAL_UNARMED = 347,
ANIM_FLY_STEALTH_WALK = 348,
ANIM_FLY_STEALTH_STAND = 349,
ANIM_FLY_KNOCKDOWN = 350,
ANIM_FLY_EATING_LOOP = 351,
ANIM_FLY_USE_STANDING_LOOP = 352,
ANIM_FLY_CHANNEL_CAST_DIRECTED = 353,
ANIM_FLY_CHANNEL_CAST_OMNI = 354,
ANIM_FLY_WHIRLWIND = 355,
ANIM_FLY_BIRTH = 356,
ANIM_FLY_USE_STANDING_START = 357,
ANIM_FLY_USE_STANDING_END = 358,
ANIM_FLY_CREATURE_SPECIAL = 359,
ANIM_FLY_DROWN = 360,
ANIM_FLY_DROWNED = 361,
ANIM_FLY_FISHING_CAST = 362,
ANIM_FLY_FISHING_LOOP = 363,
ANIM_FLY_FLY = 364,
ANIM_FLY_EMOTE_WORK_NO_SHEATHE = 365,
ANIM_FLY_EMOTE_STUN_NO_SHEATHE = 366,
ANIM_FLY_EMOTE_USE_STANDING_NO_SHEATHE = 367,
ANIM_FLY_SPELL_SLEEP_DOWN = 368,
ANIM_FLY_SPELL_KNEEL_START = 369,
ANIM_FLY_SPELL_KNEEL_LOOP = 370,
ANIM_FLY_SPELL_KNEEL_END = 371,
ANIM_FLY_SPRINT = 372,
ANIM_FLY_IN_FLIGHT = 373,
ANIM_FLY_SPAWN = 374,
ANIM_FLY_CLOSE = 375,
ANIM_FLY_CLOSED = 376,
ANIM_FLY_OPEN = 377,
ANIM_FLY_OPENED = 378,
ANIM_FLY_DESTROY = 379,
ANIM_FLY_DESTROYED = 380,
ANIM_FLY_REBUILD = 381,
ANIM_FLY_CUSTOM_0 = 382,
ANIM_FLY_CUSTOM_1 = 383,
ANIM_FLY_CUSTOM_2 = 384,
ANIM_FLY_CUSTOM_3 = 385,
ANIM_FLY_DESPAWN = 386,
ANIM_FLY_HOLD = 387,
ANIM_FLY_DECAY = 388,
ANIM_FLY_BOW_PULL = 389,
ANIM_FLY_BOW_RELEASE = 390,
ANIM_FLY_SHIP_START = 391,
ANIM_FLY_SHIP_MOVING = 392,
ANIM_FLY_SHIP_STOP = 393,
ANIM_FLY_GROUP_ARROW = 394,
ANIM_FLY_ARROW = 395,
ANIM_FLY_CORPSE_ARROW = 396,
ANIM_FLY_GUIDE_ARROW = 397,
ANIM_FLY_SWAY = 398,
ANIM_FLY_DRUID_CAT_POUNCE = 399,
ANIM_FLY_DRUID_CAT_RIP = 400,
ANIM_FLY_DRUID_CAT_RAKE = 401,
ANIM_FLY_DRUID_CAT_RAVAGE = 402,
ANIM_FLY_DRUID_CAT_CLAW = 403,
ANIM_FLY_DRUID_CAT_COWER = 404,
ANIM_FLY_DRUID_BEAR_SWIPE = 405,
ANIM_FLY_DRUID_BEAR_BITE = 406,
ANIM_FLY_DRUID_BEAR_MAUL = 407,
ANIM_FLY_DRUID_BEAR_BASH = 408,
ANIM_FLY_DRAGON_TAIL = 409,
ANIM_FLY_DRAGON_STOMP = 410,
ANIM_FLY_DRAGON_SPIT = 411,
ANIM_FLY_DRAGON_SPIT_HOVER = 412,
ANIM_FLY_DRAGON_SPIT_FLY = 413,
ANIM_FLY_EMOTE_YES = 414,
ANIM_FLY_EMOTE_NO = 415,
ANIM_FLY_JUMP_LAND_RUN = 416,
ANIM_FLY_LOOT_HOLD = 417,
ANIM_FLY_LOOT_UP = 418,
ANIM_FLY_STAND_HIGH = 419,
ANIM_FLY_IMPACT = 420,
ANIM_FLY_LIFTOFF = 421,
ANIM_FLY_HOVER = 422,
ANIM_FLY_SUCCUBUS_ENTICE = 423,
ANIM_FLY_EMOTE_TRAIN = 424,
ANIM_FLY_EMOTE_DEAD = 425,
ANIM_FLY_EMOTE_DANCE_ONCE = 426,
ANIM_FLY_DEFLECT = 427,
ANIM_FLY_EMOTE_EAT_NO_SHEATHE = 428,
ANIM_FLY_LAND = 429,
ANIM_FLY_SUBMERGE = 430,
ANIM_FLY_SUBMERGED = 431,
ANIM_FLY_CANNIBALIZE = 432,
ANIM_FLY_ARROW_BIRTH = 433,
ANIM_FLY_GROUP_ARROW_BIRTH = 434,
ANIM_FLY_CORPSE_ARROW_BIRTH = 435,
ANIM_FLY_GUIDE_ARROW_BIRTH = 436,
ANIM_FLY_EMOTE_TALK_NO_SHEATHE = 437,
ANIM_FLY_EMOTE_POINT_NO_SHEATHE = 438,
ANIM_FLY_EMOTE_SALUTE_NO_SHEATHE = 439,
ANIM_FLY_EMOTE_DANCE_SPECIAL = 440,
ANIM_FLY_MUTILATE = 441,
ANIM_FLY_CUSTOM_SPELL_01 = 442,
ANIM_FLY_CUSTOM_SPELL_02 = 443,
ANIM_FLY_CUSTOM_SPELL_03 = 444,
ANIM_FLY_CUSTOM_SPELL_04 = 445,
ANIM_FLY_CUSTOM_SPELL_05 = 446,
ANIM_FLY_CUSTOM_SPELL_06 = 447,
ANIM_FLY_CUSTOM_SPELL_07 = 448,
ANIM_FLY_CUSTOM_SPELL_08 = 449,
ANIM_FLY_CUSTOM_SPELL_09 = 450,
ANIM_FLY_CUSTOM_SPELL_10 = 451,
ANIM_FLY_STEALTH_RUN = 452,
ANIM_FLY_EMERGE = 453,
ANIM_FLY_COWER = 454,
ANIM_FLY_GRAB = 455,
ANIM_FLY_GRAB_CLOSED = 456,
ANIM_FLY_GRAB_THROWN = 457,
ANIM_TO_FLY = 458,
ANIM_TO_HOVER = 459,
ANIM_TO_GROUND = 460,
ANIM_FLY_TO_FLY = 461,
ANIM_FLY_TO_HOVER = 462,
ANIM_FLY_TO_GROUND = 463,
ANIM_SETTLE = 464,
ANIM_FLY_SETTLE = 465,
ANIM_DEATH_START = 466,
ANIM_DEATH_LOOP = 467,
ANIM_DEATH_END = 468,
ANIM_FLY_DEATH_START = 469,
ANIM_FLY_DEATH_LOOP = 470,
ANIM_FLY_DEATH_END = 471,
ANIM_DEATH_END_HOLD = 472,
ANIM_FLY_DEATH_END_HOLD = 473,
ANIM_STRANGULATE = 474,
ANIM_FLY_STRANGULATE = 475,
ANIM_READY_JOUST = 476,
ANIM_LOAD_JOUST = 477,
ANIM_HOLD_JOUST = 478,
ANIM_FLY_READY_JOUST = 479,
ANIM_FLY_LOAD_JOUST = 480,
ANIM_FLY_HOLD_JOUST = 481,
ANIM_ATTACK_JOUST = 482,
ANIM_FLY_ATTACK_JOUST = 483,
ANIM_RECLINED_MOUNT = 484,
ANIM_FLY_RECLINED_MOUNT = 485,
ANIM_TO_ALTERED = 486,
ANIM_FROM_ALTERED = 487,
ANIM_FLY_TO_ALTERED = 488,
ANIM_FLY_FROM_ALTERED = 489,
ANIM_IN_STOCKS = 490,
ANIM_FLY_IN_STOCKS = 491,
ANIM_VEHICLE_GRAB = 492,
ANIM_VEHICLE_THROW = 493,
ANIM_FLY_VEHICLE_GRAB = 494,
ANIM_FLY_VEHICLE_THROW = 495,
ANIM_TO_ALTERED_POST_SWAP = 496,
ANIM_FROM_ALTERED_POST_SWAP = 497,
ANIM_FLY_TO_ALTERED_POST_SWAP = 498,
ANIM_FLY_FROM_ALTERED_POST_SWAP = 499,
ANIM_RECLINED_MOUNT_PASSENGER = 500,
ANIM_FLY_RECLINED_MOUNT_PASSENGER = 501,
ANIM_CARRY2H = 502,
ANIM_CARRIED2H = 503,
ANIM_FLY_CARRY2H = 504,
ANIM_FLY_CARRIED2H = 505,
ANIM_EMOTE_SNIFF = 506,
ANIM_EMOTE_FLY_SNIFF = 507,
ANIM_ATTACK_FIST1H = 508,
ANIM_FLY_ATTACK_FIST1H = 509,
ANIM_ATTACK_FIST_1H_OFF = 510,
ANIM_FLY_ATTACK_FIST_1H_OFF = 511,
ANIM_PARRY_FIST1H = 512,
ANIM_FLY_PARRY_FIST1H = 513,
ANIM_READY_FIST1H = 514,
ANIM_FLY_READY_FIST1H = 515,
ANIM_SPECIAL_FIST1H = 516,
ANIM_FLY_SPECIAL_FIST1H = 517,
ANIM_EMOTE_READ_START = 518,
ANIM_FLY_EMOTE_READ_START = 519,
ANIM_EMOTE_READ_LOOP = 520,
ANIM_FLY_EMOTE_READ_LOOP = 521,
ANIM_EMOTE_READ_END = 522,
ANIM_FLY_EMOTE_READ_END = 523,
ANIM_SWIM_RUN = 524,
ANIM_FLY_SWIM_RUN = 525,
ANIM_SWIM_WALK = 526,
ANIM_FLY_SWIM_WALK = 527,
ANIM_SWIM_WALK_BACKWARDS = 528,
ANIM_FLY_SWIM_WALK_BACKWARDS = 529,
ANIM_SWIM_SPRINT = 530,
ANIM_FLY_SWIM_SPRINT = 531,
ANIM_MOUNT_SWIM_IDLE = 532,
ANIM_FLY_MOUNT_SWIM_IDLE = 533,
ANIM_MOUNT_SWIM_BACKWARDS = 534,
ANIM_FLY_MOUNT_SWIM_BACKWARDS = 535,
ANIM_MOUNT_SWIM_LEFT = 536,
ANIM_FLY_MOUNT_SWIM_LEFT = 537,
ANIM_MOUNT_SWIM_RIGHT = 538,
ANIM_FLY_MOUNT_SWIM_RIGHT = 539,
ANIM_MOUNT_SWIM_RUN = 540,
ANIM_FLY_MOUNT_SWIM_RUN = 541,
ANIM_MOUNT_SWIM_SPRINT = 542,
ANIM_FLY_MOUNT_SWIM_SPRINT = 543,
ANIM_MOUNT_SWIM_WALK = 544,
ANIM_FLY_MOUNT_SWIM_WALK = 545,
ANIM_MOUNT_SWIM_WALK_BACKWARDS = 546,
ANIM_FLY_MOUNT_SWIM_WALK_BACKWARDS = 547,
ANIM_MOUNT_FLIGHT_IDLE = 548,
ANIM_FLY_MOUNT_FLIGHT_IDLE = 549,
ANIM_MOUNT_FLIGHT_BACKWARDS = 550,
ANIM_FLY_MOUNT_FLIGHT_BACKWARDS = 551,
ANIM_MOUNT_FLIGHT_LEFT = 552,
ANIM_FLY_MOUNT_FLIGHT_LEFT = 553,
ANIM_MOUNT_FLIGHT_RIGHT = 554,
ANIM_FLY_MOUNT_FLIGHT_RIGHT = 555,
ANIM_MOUNT_FLIGHT_RUN = 556,
ANIM_FLY_MOUNT_FLIGHT_RUN = 557,
ANIM_MOUNT_FLIGHT_SPRINT = 558,
ANIM_FLY_MOUNT_FLIGHT_SPRINT = 559,
ANIM_MOUNT_FLIGHT_WALK = 560,
ANIM_FLY_MOUNT_FLIGHT_WALK = 561,
ANIM_MOUNT_FLIGHT_WALK_BACKWARDS = 562,
ANIM_FLY_MOUNT_FLIGHT_WALK_BACKWARDS = 563,
ANIM_MOUNT_FLIGHT_START = 564,
ANIM_FLY_MOUNT_FLIGHT_START = 565,
ANIM_MOUNT_SWIM_START = 566,
ANIM_FLY_MOUNT_SWIM_START = 567,
ANIM_MOUNT_SWIM_LAND = 568,
ANIM_FLY_MOUNT_SWIM_LAND = 569,
ANIM_MOUNT_SWIM_LAND_RUN = 570,
ANIM_FLY_MOUNT_SWIM_LAND_RUN = 571,
ANIM_MOUNT_FLIGHT_LAND = 572,
ANIM_FLY_MOUNT_FLIGHT_LAND = 573,
ANIM_MOUNT_FLIGHT_LAND_RUN = 574,
ANIM_FLY_MOUNT_FLIGHT_LAND_RUN = 575,
ANIM_READY_BLOW_DART = 576,
ANIM_FLY_READY_BLOW_DART = 577,
ANIM_LOAD_BLOW_DART = 578,
ANIM_FLY_LOAD_BLOW_DART = 579,
ANIM_HOLD_BLOW_DART = 580,
ANIM_FLY_HOLD_BLOW_DART = 581,
ANIM_ATTACK_BLOW_DART = 582,
ANIM_FLY_ATTACK_BLOW_DART = 583,
ANIM_CARRIAGE_MOUNT = 584,
ANIM_FLY_CARRIAGE_MOUNT = 585,
ANIM_CARRIAGE_PASSENGER_MOUNT = 586,
ANIM_FLY_CARRIAGE_PASSENGER_MOUNT = 587,
ANIM_CARRIAGE_MOUNT_ATTACK = 588,
ANIM_FLY_CARRIAGE_MOUNT_ATTACK = 589,
ANIM_BARTENDER_STAND = 590,
ANIM_FLY_BARTENDER_STAND = 591,
ANIM_BARTENDER_WALK = 592,
ANIM_FLY_BARTENDER_WALK = 593,
ANIM_BARTENDER_RUN = 594,
ANIM_FLY_BARTENDER_RUN = 595,
ANIM_BARTENDER_SHUFFLE_LEFT = 596,
ANIM_FLY_BARTENDER_SHUFFLE_LEFT = 597,
ANIM_BARTENDER_SHUFFLE_RIGHT = 598,
ANIM_FLY_BARTENDER_SHUFFLE_RIGHT = 599,
ANIM_BARTENDER_EMOTE_TALK = 600,
ANIM_FLY_BARTENDER_EMOTE_TALK = 601,
ANIM_BARTENDER_EMOTE_POINT = 602,
ANIM_FLY_BARTENDER_EMOTE_POINT = 603,
ANIM_BARMAID_STAND = 604,
ANIM_FLY_BARMAID_STAND = 605,
ANIM_BARMAID_WALK = 606,
ANIM_FLY_BARMAID_WALK = 607,
ANIM_BARMAID_RUN = 608,
ANIM_FLY_BARMAID_RUN = 609,
ANIM_BARMAID_SHUFFLE_LEFT = 610,
ANIM_FLY_BARMAID_SHUFFLE_LEFT = 611,
ANIM_BARMAID_SHUFFLE_RIGHT = 612,
ANIM_FLY_BARMAID_SHUFFLE_RIGHT = 613,
ANIM_BARMAID_EMOTE_TALK = 614,
ANIM_FLY_BARMAID_EMOTE_TALK = 615,
ANIM_BARMAID_EMOTE_POINT = 616,
ANIM_FLY_BARMAID_EMOTE_POINT = 617,
ANIM_MOUNT_SELF_IDLE = 618,
ANIM_FLY_MOUNT_SELF_IDLE = 619,
ANIM_MOUNT_SELF_WALK = 620,
ANIM_FLY_MOUNT_SELF_WALK = 621,
ANIM_MOUNT_SELF_RUN = 622,
ANIM_FLY_MOUNT_SELF_RUN = 623,
ANIM_MOUNT_SELF_SPRINT = 624,
ANIM_FLY_MOUNT_SELF_SPRINT = 625,
ANIM_MOUNT_SELF_RUN_LEFT = 626,
ANIM_FLY_MOUNT_SELF_RUN_LEFT = 627,
ANIM_MOUNT_SELF_RUN_RIGHT = 628,
ANIM_FLY_MOUNT_SELF_RUN_RIGHT = 629,
ANIM_MOUNT_SELF_SHUFFLE_LEFT = 630,
ANIM_FLY_MOUNT_SELF_SHUFFLE_LEFT = 631,
ANIM_MOUNT_SELF_SHUFFLE_RIGHT = 632,
ANIM_FLY_MOUNT_SELF_SHUFFLE_RIGHT = 633,
ANIM_MOUNT_SELF_WALK_BACKWARDS = 634,
ANIM_FLY_MOUNT_SELF_WALK_BACKWARDS = 635,
ANIM_MOUNT_SELF_SPECIAL = 636,
ANIM_FLY_MOUNT_SELF_SPECIAL = 637,
ANIM_MOUNT_SELF_JUMP = 638,
ANIM_FLY_MOUNT_SELF_JUMP = 639,
ANIM_MOUNT_SELF_JUMP_START = 640,
ANIM_FLY_MOUNT_SELF_JUMP_START = 641,
ANIM_MOUNT_SELF_JUMP_END = 642,
ANIM_FLY_MOUNT_SELF_JUMP_END = 643,
ANIM_MOUNT_SELF_JUMP_LAND_RUN = 644,
ANIM_FLY_MOUNT_SELF_JUMP_LAND_RUN = 645,
ANIM_MOUNT_SELF_START = 646,
ANIM_FLY_MOUNT_SELF_START = 647,
ANIM_MOUNT_SELF_FALL = 648,
ANIM_FLY_MOUNT_SELF_FALL = 649,
ANIM_STORMSTRIKE = 650,
ANIM_FLY_STORMSTRIKE = 651,
ANIM_READY_JOUST_NO_SHEATHE = 652,
ANIM_FLY_READY_JOUST_NO_SHEATHE = 653,
ANIM_SLAM = 654,
ANIM_FLY_SLAM = 655,
ANIM_DEATH_STRIKE = 656,
ANIM_FLY_DEATH_STRIKE = 657,
ANIM_SWIM_ATTACK_UNARMED = 658,
ANIM_FLY_SWIM_ATTACK_UNARMED = 659,
ANIM_SPINNING_KICK = 660,
ANIM_FLY_SPINNING_KICK = 661,
ANIM_ROUND_HOUSE_KICK = 662,
ANIM_FLY_ROUND_HOUSE_KICK = 663,
ANIM_ROLL_START = 664,
ANIM_FLY_ROLL_START = 665,
ANIM_ROLL = 666,
ANIM_FLY_ROLL = 667,
ANIM_ROLL_END = 668,
ANIM_FLY_ROLL_END = 669,
ANIM_PALM_STRIKE = 670,
ANIM_FLY_PALM_STRIKE = 671,
ANIM_MONK_OFFENSE_ATTACK_UNARMED = 672,
ANIM_FLY_MONK_OFFENSE_ATTACK_UNARMED = 673,
ANIM_MONK_OFFENSE_ATTACK_UNARMED_OFF = 674,
ANIM_FLY_MONK_OFFENSE_ATTACK_UNARMED_OFF = 675,
ANIM_MONK_OFFENSE_PARRY_UNARMED = 676,
ANIM_FLY_MONK_OFFENSE_PARRY_UNARMED = 677,
ANIM_MONK_OFFENSE_READY_UNARMED = 678,
ANIM_FLY_MONK_OFFENSE_READY_UNARMED = 679,
ANIM_MONK_OFFENSE_SPECIAL_UNARMED = 680,
ANIM_FLY_MONK_OFFENSE_SPECIAL_UNARMED = 681,
ANIM_MONK_DEFENSE_ATTACK_UNARMED = 682,
ANIM_FLY_MONK_DEFENSE_ATTACK_UNARMED = 683,
ANIM_MONK_DEFENSE_ATTACK_UNARMED_OFF = 684,
ANIM_FLY_MONK_DEFENSE_ATTACK_UNARMED_OFF = 685,
ANIM_MONK_DEFENSE_PARRY_UNARMED = 686,
ANIM_FLY_MONK_DEFENSE_PARRY_UNARMED = 687,
ANIM_MONK_DEFENSE_READY_UNARMED = 688,
ANIM_FLY_MONK_DEFENSE_READY_UNARMED = 689,
ANIM_MONK_DEFENSE_SPECIAL_UNARMED = 690,
ANIM_FLY_MONK_DEFENSE_SPECIAL_UNARMED = 691,
ANIM_MONK_HEAL_ATTACK_UNARMED = 692,
ANIM_FLY_MONK_HEAL_ATTACK_UNARMED = 693,
ANIM_MONK_HEAL_ATTACK_UNARMED_OFF = 694,
ANIM_FLY_MONK_HEAL_ATTACK_UNARMED_OFF = 695,
ANIM_MONK_HEAL_PARRY_UNARMED = 696,
ANIM_FLY_MONK_HEAL_PARRY_UNARMED = 697,
ANIM_MONK_HEAL_READY_UNARMED = 698,
ANIM_FLY_MONK_HEAL_READY_UNARMED = 699,
ANIM_MONK_HEAL_SPECIAL_UNARMED = 700,
ANIM_FLY_MONK_HEAL_SPECIAL_UNARMED = 701,
ANIM_FLYING_KICK = 702,
ANIM_FLY_FLYING_KICK = 703,
ANIM_FLYING_KICK_START = 704,
ANIM_FLY_FLYING_KICK_START = 705,
ANIM_FLYING_KICK_END = 706,
ANIM_FLY_FLYING_KICK_END = 707,
ANIM_CRANE_START = 708,
ANIM_FLY_CRANE_START = 709,
ANIM_CRANE_LOOP = 710,
ANIM_FLY_CRANE_LOOP = 711,
ANIM_CRANE_END = 712,
ANIM_FLY_CRANE_END = 713,
ANIM_DESPAWNED = 714,
ANIM_FLY_DESPAWNED = 715,
ANIM_THOUSAND_FISTS = 716,
ANIM_FLY_THOUSAND_FISTS = 717,
ANIM_MONK_HEAL_READY_SPELL_DIRECTED = 718,
ANIM_FLY_MONK_HEAL_READY_SPELL_DIRECTED = 719,
ANIM_MONK_HEAL_READY_SPELL_OMNI = 720,
ANIM_FLY_MONK_HEAL_READY_SPELL_OMNI = 721,
ANIM_MONK_HEAL_SPELL_CAST_DIRECTED = 722,
ANIM_FLY_MONK_HEAL_SPELL_CAST_DIRECTED = 723,
ANIM_MONK_HEAL_SPELL_CAST_OMNI = 724,
ANIM_FLY_MONK_HEAL_SPELL_CAST_OMNI = 725,
ANIM_MONK_HEAL_CHANNEL_CAST_DIRECTED = 726,
ANIM_FLY_MONK_HEAL_CHANNEL_CAST_DIRECTED = 727,
ANIM_MONK_HEAL_CHANNEL_CAST_OMNI = 728,
ANIM_FLY_MONK_HEAL_CHANNEL_CAST_OMNI = 729,
ANIM_TORPEDO = 730,
ANIM_FLY_TORPEDO = 731,
ANIM_MEDITATE = 732,
ANIM_FLY_MEDITATE = 733,
ANIM_BREATH_OF_FIRE = 734,
ANIM_FLY_BREATH_OF_FIRE = 735,
ANIM_RISING_SUN_KICK = 736,
ANIM_FLY_RISING_SUN_KICK = 737,
ANIM_GROUND_KICK = 738,
ANIM_FLY_GROUND_KICK = 739,
ANIM_KICK_BACK = 740,
ANIM_FLY_KICK_BACK = 741,
ANIM_PET_BATTLE_STAND = 742,
ANIM_FLY_PET_BATTLE_STAND = 743,
ANIM_PET_BATTLE_DEATH = 744,
ANIM_FLY_PET_BATTLE_DEATH = 745,
ANIM_PET_BATTLE_RUN = 746,
ANIM_FLY_PET_BATTLE_RUN = 747,
ANIM_PET_BATTLE_WOUND = 748,
ANIM_FLY_PET_BATTLE_WOUND = 749,
ANIM_PET_BATTLE_ATTACK = 750,
ANIM_FLY_PET_BATTLE_ATTACK = 751,
ANIM_PET_BATTLE_READY_SPELL = 752,
ANIM_FLY_PET_BATTLE_READY_SPELL = 753,
ANIM_PET_BATTLE_SPELL_CAST = 754,
ANIM_FLY_PET_BATTLE_SPELL_CAST = 755,
ANIM_PET_BATTLE_CUSTOM0 = 756,
ANIM_FLY_PET_BATTLE_CUSTOM0 = 757,
ANIM_PET_BATTLE_CUSTOM1 = 758,
ANIM_FLY_PET_BATTLE_CUSTOM1 = 759,
ANIM_PET_BATTLE_CUSTOM2 = 760,
ANIM_FLY_PET_BATTLE_CUSTOM2 = 761,
ANIM_PET_BATTLE_CUSTOM3 = 762,
ANIM_FLY_PET_BATTLE_CUSTOM3 = 763,
ANIM_PET_BATTLE_VICTORY = 764,
ANIM_FLY_PET_BATTLE_VICTORY = 765,
ANIM_PET_BATTLE_LOSS = 766,
ANIM_FLY_PET_BATTLE_LOSS = 767,
ANIM_PET_BATTLE_STUN = 768,
ANIM_FLY_PET_BATTLE_STUN = 769,
ANIM_PET_BATTLE_DEAD = 770,
ANIM_FLY_PET_BATTLE_DEAD = 771,
ANIM_PET_BATTLE_FREEZE = 772,
ANIM_FLY_PET_BATTLE_FREEZE = 773,
ANIM_MONK_OFFENSE_ATTACK_WEAPON = 774,
ANIM_FLY_MONK_OFFENSE_ATTACK_WEAPON = 775,
ANIM_BAR_TEND_EMOTE_WAVE = 776,
ANIM_FLY_BAR_TEND_EMOTE_WAVE = 777,
ANIM_BAR_SERVER_EMOTE_TALK = 778,
ANIM_FLY_BAR_SERVER_EMOTE_TALK = 779,
ANIM_BAR_SERVER_EMOTE_WAVE = 780,
ANIM_FLY_BAR_SERVER_EMOTE_WAVE = 781,
ANIM_BAR_SERVER_POUR_DRINKS = 782,
ANIM_FLY_BAR_SERVER_POUR_DRINKS = 783,
ANIM_BAR_SERVER_PICKUP = 784,
ANIM_FLY_BAR_SERVER_PICKUP = 785,
ANIM_BAR_SERVER_PUT_DOWN = 786,
ANIM_FLY_BAR_SERVER_PUT_DOWN = 787,
ANIM_BAR_SWEEP_STAND = 788,
ANIM_FLY_BAR_SWEEP_STAND = 789,
ANIM_BAR_PATRON_SIT = 790,
ANIM_FLY_BAR_PATRON_SIT = 791,
ANIM_BAR_PATRON_SIT_EMOTE_TALK = 792,
ANIM_FLY_BAR_PATRON_SIT_EMOTE_TALK = 793,
ANIM_BAR_PATRON_STAND = 794,
ANIM_FLY_BAR_PATRON_STAND = 795,
ANIM_BAR_PATRON_STAND_EMOTE_TALK = 796,
ANIM_FLY_BAR_PATRON_STAND_EMOTE_TALK = 797,
ANIM_BAR_PATRON_STAND_EMOTE_POINT = 798,
ANIM_FLY_BAR_PATRON_STAND_EMOTE_POINT = 799,
ANIM_CARRION_SWARM = 800,
ANIM_FLY_CARRION_SWARM = 801,
ANIM_WHEEL_LOOP = 802,
ANIM_FLY_WHEEL_LOOP = 803,
ANIM_STAND_CHARACTER_CREATE = 804,
ANIM_FLY_STAND_CHARACTER_CREATE = 805,
ANIM_MOUNT_CHOPPER = 806,
ANIM_FLY_MOUNT_CHOPPER = 807,
ANIM_FACE_POSE = 808,
ANIM_FLY_FACE_POSE = 809,
ANIM_WARRIOR_COLOSSUS_SMASH = 810,
ANIM_FLY_WARRIOR_COLOSSUS_SMASH = 811,
ANIM_WARRIOR_MORTAL_STRIKE = 812,
ANIM_FLY_WARRIOR_MORTAL_STRIKE = 813,
ANIM_WARRIOR_WHIRLWIND = 814,
ANIM_FLY_WARRIOR_WHIRLWIND = 815,
ANIM_WARRIOR_CHARGE = 816,
ANIM_FLY_WARRIOR_CHARGE = 817,
ANIM_WARRIOR_CHARGE_START = 818,
ANIM_FLY_WARRIOR_CHARGE_START = 819,
ANIM_WARRIOR_CHARGE_END = 820,
ANIM_FLY_WARRIOR_CHARGE_END = 821
};
enum LockKeyType
{
LOCK_KEY_NONE = 0,
LOCK_KEY_ITEM = 1,
LOCK_KEY_SKILL = 2,
LOCK_KEY_SPELL = 3 // BFA
};
// this is important type for npcs!
enum TrainerType
{
TRAINER_TYPE_CLASS = 0,
};
// CreatureType.dbc (9.0.2)
enum CreatureType
{
CREATURE_TYPE_BEAST = 1,
CREATURE_TYPE_DRAGONKIN = 2,
CREATURE_TYPE_DEMON = 3,
CREATURE_TYPE_ELEMENTAL = 4,
CREATURE_TYPE_GIANT = 5,
CREATURE_TYPE_UNDEAD = 6,
CREATURE_TYPE_HUMANOID = 7,
CREATURE_TYPE_CRITTER = 8,
CREATURE_TYPE_MECHANICAL = 9,
CREATURE_TYPE_NOT_SPECIFIED = 10,
CREATURE_TYPE_TOTEM = 11,
CREATURE_TYPE_NON_COMBAT_PET = 12,
CREATURE_TYPE_GAS_CLOUD = 13,
CREATURE_TYPE_WILD_PET = 14,
CREATURE_TYPE_ABERRATION = 15
};
uint32 const CREATURE_TYPEMASK_DEMON_OR_UNDEAD = (1 << (CREATURE_TYPE_DEMON-1)) | (1 << (CREATURE_TYPE_UNDEAD-1));
uint32 const CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD = (1 << (CREATURE_TYPE_HUMANOID-1)) | (1 << (CREATURE_TYPE_UNDEAD-1));
uint32 const CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL = (1 << (CREATURE_TYPE_MECHANICAL-1)) | (1 << (CREATURE_TYPE_ELEMENTAL-1));
// CreatureFamily.dbc (9.0.2)
enum CreatureFamily
{
CREATURE_FAMILY_NONE = 0,
CREATURE_FAMILY_WOLF = 1,
CREATURE_FAMILY_CAT = 2,
CREATURE_FAMILY_SPIDER = 3,
CREATURE_FAMILY_BEAR = 4,
CREATURE_FAMILY_BOAR = 5,
CREATURE_FAMILY_CROCOLISK = 6,
CREATURE_FAMILY_CARRION_BIRD = 7,
CREATURE_FAMILY_CRAB = 8,
CREATURE_FAMILY_GORILLA = 9,
CREATURE_FAMILY_HORSE_CUSTOM = 10, // Does not exist in DBC but used for horse like beasts in DB
CREATURE_FAMILY_RAPTOR = 11,
CREATURE_FAMILY_TALLSTRIDER = 12,
CREATURE_FAMILY_FELHUNTER = 15,
CREATURE_FAMILY_VOIDWALKER = 16,
CREATURE_FAMILY_SUCCUBUS = 17,
CREATURE_FAMILY_DOOMGUARD = 19,
CREATURE_FAMILY_SCORPID = 20,
CREATURE_FAMILY_TURTLE = 21,
CREATURE_FAMILY_IMP = 23,
CREATURE_FAMILY_BAT = 24,
CREATURE_FAMILY_HYENA = 25,
CREATURE_FAMILY_BIRD_OF_PREY = 26,
CREATURE_FAMILY_WIND_SERPENT = 27,
CREATURE_FAMILY_REMOTE_CONTROL = 28,
CREATURE_FAMILY_FELGUARD = 29,
CREATURE_FAMILY_DRAGONHAWK = 30,
CREATURE_FAMILY_RAVAGER = 31,
CREATURE_FAMILY_WARP_STALKER = 32,
CREATURE_FAMILY_SPOREBAT = 33,
CREATURE_FAMILY_NETHER_RAY = 34,
CREATURE_FAMILY_SERPENT = 35,
CREATURE_FAMILY_MOTH = 37,
CREATURE_FAMILY_CHIMAERA = 38,
CREATURE_FAMILY_DEVILSAUR = 39,
CREATURE_FAMILY_GHOUL = 40,
CREATURE_FAMILY_SILITHID = 41,
CREATURE_FAMILY_WORM = 42,
CREATURE_FAMILY_RHINO = 43,
CREATURE_FAMILY_WASP = 44,
CREATURE_FAMILY_CORE_HOUND = 45,
CREATURE_FAMILY_SPIRIT_BEAST = 46,
CREATURE_FAMILY_WATER_ELEMENTAL = 49,
CREATURE_FAMILY_FOX = 50,
CREATURE_FAMILY_MONKEY = 51,
CREATURE_FAMILY_DOG = 52,
CREATURE_FAMILY_BEETLE = 53,
CREATURE_FAMILY_SHALE_SPIDER = 55,
CREATURE_FAMILY_ZOMBIE = 56,
CREATURE_FAMILY_BEETLE_OLD = 57,
CREATURE_FAMILY_SILITHID2 = 59,
CREATURE_FAMILY_WASP2 = 66,
CREATURE_FAMILY_HYDRA = 68,
CREATURE_FAMILY_FELIMP = 100,
CREATURE_FAMILY_VOIDLORD = 101,
CREATURE_FAMILY_SHIVARA = 102,
CREATURE_FAMILY_OBSERVER = 103,
CREATURE_FAMILY_WRATHGUARD = 104,
CREATURE_FAMILY_INFERNAL = 108,
CREATURE_FAMILY_FIREELEMENTAL = 116,
CREATURE_FAMILY_EARTHELEMENTAL = 117,
CREATURE_FAMILY_CRANE = 125,
CREATURE_FAMILY_WATERSTRIDER = 126,
CREATURE_FAMILY_PORCUPINE = 127,
CREATURE_FAMILY_QUILEN = 128,
CREATURE_FAMILY_GOAT = 129,
CREATURE_FAMILY_BASILISK = 130,
CREATURE_FAMILY_DIREHORN = 138,
CREATURE_FAMILY_STORMELEMENTAL = 145,
CREATURE_FAMILY_MTWATERELEMENTAL = 146,
CREATURE_FAMILY_TORRORGUARD = 147,
CREATURE_FAMILY_ABYSSAL = 148,
CREATURE_FAMILY_RYLAK = 149,
CREATURE_FAMILY_RIVERBEAST = 150,
CREATURE_FAMILY_STAG = 151,
CREATURE_FAMILY_MECHANICAL = 154,
CREATURE_FAMILY_ABOMINATION = 155,
CREATURE_FAMILY_SCALEHIDE = 156,
CREATURE_FAMILY_OXEN = 157,
CREATURE_FAMILY_FEATHERMANE = 160,
CREATURE_FAMILY_LIZARD = 288,
CREATURE_FAMILY_PTERRORDAX = 290,
CREATURE_FAMILY_TOAD = 291,
CREATURE_FAMILY_CARAPID = 292,
CREATURE_FAMILY_BLOOD_BEAST = 296,
CREATURE_FAMILY_CAMEL = 298,
CREATURE_FAMILY_COURSER = 299,
CREATURE_FAMILY_MAMMOTH = 300
};
enum CreatureTypeFlags
{
CREATURE_TYPE_FLAG_TAMEABLE_PET = 0x00000001, // Makes the mob tameable (must also be a beast and have family set)
CREATURE_TYPE_FLAG_GHOST_VISIBLE = 0x00000002, // Creature are also visible for not alive player. Allow gossip interaction if npcflag allow?
CREATURE_TYPE_FLAG_BOSS_MOB = 0x00000004, // Changes creature's visible level to "??" in the creature's portrait - Immune Knockback.
CREATURE_TYPE_FLAG_DO_NOT_PLAY_WOUND_PARRY_ANIMATION = 0x00000008,
CREATURE_TYPE_FLAG_HIDE_FACTION_TOOLTIP = 0x00000010,
CREATURE_TYPE_FLAG_UNK5 = 0x00000020, // Sound related
CREATURE_TYPE_FLAG_SPELL_ATTACKABLE = 0x00000040,
CREATURE_TYPE_FLAG_CAN_INTERACT_WHILE_DEAD = 0x00000080, // Player can interact with the creature if its dead (not player dead)
CREATURE_TYPE_FLAG_HERB_SKINNING_SKILL = 0x00000100, // Can be looted by herbalist
CREATURE_TYPE_FLAG_MINING_SKINNING_SKILL = 0x00000200, // Can be looted by miner
CREATURE_TYPE_FLAG_DO_NOT_LOG_DEATH = 0x00000400, // Death event will not show up in combat log
CREATURE_TYPE_FLAG_MOUNTED_COMBAT_ALLOWED = 0x00000800, // Creature can remain mounted when entering combat
CREATURE_TYPE_FLAG_CAN_ASSIST = 0x00001000, // ? Can aid any player in combat if in range?
CREATURE_TYPE_FLAG_IS_PET_BAR_USED = 0x00002000,
CREATURE_TYPE_FLAG_MASK_UID = 0x00004000,
CREATURE_TYPE_FLAG_ENGINEERING_SKINNING_SKILL = 0x00008000, // Can be looted by engineer
CREATURE_TYPE_FLAG_EXOTIC_PET = 0x00010000, // Can be tamed by hunter as exotic pet
CREATURE_TYPE_FLAG_USE_DEFAULT_COLLISION_BOX = 0x00020000, // Collision related. (always using default collision box?)
CREATURE_TYPE_FLAG_IS_SIEGE_WEAPON = 0x00040000,
CREATURE_TYPE_FLAG_CAN_COLLIDE_WITH_MISSILES = 0x00080000, // Projectiles can collide with this creature - interacts with TARGET_DEST_TRAJ
CREATURE_TYPE_FLAG_HIDE_NAME_PLATE = 0x00100000,
CREATURE_TYPE_FLAG_DO_NOT_PLAY_MOUNTED_ANIMATIONS = 0x00200000,
CREATURE_TYPE_FLAG_IS_LINK_ALL = 0x00400000,
CREATURE_TYPE_FLAG_INTERACT_ONLY_WITH_CREATOR = 0x00800000,
CREATURE_TYPE_FLAG_DO_NOT_PLAY_UNIT_EVENT_SOUNDS = 0x01000000,
CREATURE_TYPE_FLAG_HAS_NO_SHADOW_BLOB = 0x02000000,
CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT = 0x04000000, //! Creature can be targeted by spells that require target to be in caster's party/raid
CREATURE_TYPE_FLAG_FORCE_GOSSIP = 0x08000000, // Allows the creature to display a single gossip option.
CREATURE_TYPE_FLAG_DO_NOT_SHEATHE = 0x10000000,
CREATURE_TYPE_FLAG_DO_NOT_TARGET_ON_INTERACTION = 0x20000000,
CREATURE_TYPE_FLAG_DO_NOT_RENDER_OBJECT_NAME = 0x40000000,
CREATURE_TYPE_FLAG_UNIT_IS_QUEST_BOSS = 0x80000000 // Not verified
};
enum CreatureTypeFlags2
{
CREATURE_TYPE_FLAG_2_UNK1 = 0x00000001,
CREATURE_TYPE_FLAG_2_UNK2 = 0x00000002,
CREATURE_TYPE_FLAG_2_UNK3 = 0x00000004,
CREATURE_TYPE_FLAG_2_UNK4 = 0x00000008,
CREATURE_TYPE_FLAG_2_UNK5 = 0x00000010,
CREATURE_TYPE_FLAG_2_UNK6 = 0x00000020,
CREATURE_TYPE_FLAG_2_UNK7 = 0x00000040,
CREATURE_TYPE_FLAG_2_UNK8 = 0x00000080
};
enum CreatureEliteType
{
CREATURE_ELITE_NORMAL = 0,
CREATURE_ELITE_ELITE = 1,
CREATURE_ELITE_RAREELITE = 2,
CREATURE_ELITE_WORLDBOSS = 3,
CREATURE_ELITE_RARE = 4,
CREATURE_UNKNOWN = 5, // found in 2.2.3 for 2 mobs
CREATURE_WEAK = 6
};
// Holidays.dbc (9.0.2.37176)
enum HolidayIds
{
HOLIDAY_NONE = 0,
HOLIDAY_FIREWORKS_SPECTACULAR = 62,
HOLIDAY_FEAST_OF_WINTER_VEIL = 141,
HOLIDAY_NOBLEGARDEN = 181,
HOLIDAY_CHILDRENS_WEEK = 201,
HOLIDAY_CALL_TO_ARMS_AV_OLD = 283,
HOLIDAY_CALL_TO_ARMS_WG_OLD = 284,
HOLIDAY_CALL_TO_ARMS_AB_OLD = 285,
HOLIDAY_HARVEST_FESTIVAL = 321,
HOLIDAY_HALLOWS_END = 324,
HOLIDAY_LUNAR_FESTIVAL = 327,
HOLIDAY_LOVE_IS_IN_THE_AIR_OLD = 335,
HOLIDAY_MIDSUMMER_FIRE_FESTIVAL = 341,
HOLIDAY_CALL_TO_ARMS_ES_OLD = 353,
HOLIDAY_BREWFEST = 372,
HOLIDAY_DARKMOON_FAIRE_ELWYNN = 374,
HOLIDAY_DARKMOON_FAIRE_THUNDER = 375,
HOLIDAY_DARKMOON_FAIRE_SHATTRATH = 376,
HOLIDAY_PIRATES_DAY = 398,
HOLIDAY_CALL_TO_ARMS_SA_OLD = 400,
HOLIDAY_PILGRIMS_BOUNTY = 404,
HOLIDAY_LK_LAUNCH = 406,
HOLIDAY_DAY_OF_THE_DEAD = 409,
HOLIDAY_CALL_TO_ARMS_IC_OLD = 420,
HOLIDAY_LOVE_IS_IN_THE_AIR = 423,
HOLIDAY_KALU_AK_FISHING_DERBY = 424,
HOLIDAY_CALL_TO_ARMS_BG = 435,
HOLIDAY_CALL_TO_ARMS_TP = 436,
HOLIDAY_RATED_BG_15_VS_15 = 442,
HOLIDAY_RATED_BG_25_VS_25 = 443,
HOLIDAY_WOW_7TH_ANNIVERSARY = 467,
HOLIDAY_DARKMOON_FAIRE = 479,
HOLIDAY_WOW_8TH_ANNIVERSARY = 484,
HOLIDAY_CALL_TO_ARMS_SM = 488,
HOLIDAY_CALL_TO_ARMS_TK = 489,
HOLIDAY_CALL_TO_ARMS_AV = 490,
HOLIDAY_CALL_TO_ARMS_AB = 491,
HOLIDAY_CALL_TO_ARMS_ES = 492,
HOLIDAY_CALL_TO_ARMS_IC = 493,
HOLIDAY_CALL_TO_ARMS_SM_OLD = 494,
HOLIDAY_CALL_TO_ARMS_SA = 495,
HOLIDAY_CALL_TO_ARMS_TK_OLD = 496,
HOLIDAY_CALL_TO_ARMS_BG_OLD = 497,
HOLIDAY_CALL_TO_ARMS_TP_OLD = 498,
HOLIDAY_CALL_TO_ARMS_WG = 499,
HOLIDAY_WOW_9TH_ANNIVERSARY = 509,
HOLIDAY_WOW_10TH_ANNIVERSARY = 514,
HOLIDAY_CALL_TO_ARMS_DG = 515,
HOLIDAY_CALL_TO_ARMS_DG_OLD = 516,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_BC_DEFAULT = 559,
HOLIDAY_APEXIS_BONUS_EVENT_DEFAULT = 560,
HOLIDAY_ARENA_SKIRMISH_BONUS_EVENT = 561,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_LK_DEFAULT = 562,
HOLIDAY_BATTLEGROUND_BONUS_EVENT_DEFAULT = 563,
HOLIDAY_DRAENOR_DUNGEON_EVENT_DEFAULT = 564,
HOLIDAY_PET_BATTLE_BONUS_EVENT_DEFAULT = 565,
HOLIDAY_WOW_11TH_ANNIVERSARY = 566,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_CATA_DEFAULT = 587,
HOLIDAY_WOW_12TH_ANNIVERSARY = 589,
HOLIDAY_WOW_ANNIVERSARY = 590,
HOLIDAY_LEGION_DUNGEON_EVENT_DEFAULT = 591,
HOLIDAY_WORLD_QUEST_BONUS_EVENT_DEFAULT = 592,
HOLIDAY_APEXIS_BONUS_EVENT_EU = 593,
HOLIDAY_APEXIS_BONUS_EVENT_TW_CN = 594,
HOLIDAY_APEXIS_BONUS_EVENT_KR = 595,
HOLIDAY_DRAENOR_DUNGEON_EVENT_EU = 596,
HOLIDAY_DRAENOR_DUNGEON_EVENT_TW_CN = 597,
HOLIDAY_DRAENOR_DUNGEON_EVENT_KR = 598,
HOLIDAY_PET_BATTLE_BONUS_EVENT_EU = 599,
HOLIDAY_PET_BATTLE_BONUS_EVENT_TW_CN = 600,
HOLIDAY_PET_BATTLE_BONUS_EVENT_KR = 601,
HOLIDAY_BATTLEGROUND_BONUS_EVENT_EU = 602,
HOLIDAY_BATTLEGROUND_BONUS_EVENT_TW_CN = 603,
HOLIDAY_BATTLEGROUND_BONUS_EVENT_KR = 604,
HOLIDAY_LEGION_DUNGEON_EVENT_EU = 605,
HOLIDAY_LEGION_DUNGEON_EVENT_TW_CN = 606,
HOLIDAY_LEGION_DUNGEON_EVENT_KR = 607,
HOLIDAY_ARENA_SKIRMISH_BONUS_EVENT_EU = 610,
HOLIDAY_ARENA_SKIRMISH_BONUS_EVENT_TW_CN = 611,
HOLIDAY_ARENA_SKIRMISH_BONUS_EVENT_KR = 612,
HOLIDAY_WORLD_QUEST_BONUS_EVENT_EU = 613,
HOLIDAY_WORLD_QUEST_BONUS_EVENT_TW_CN = 614,
HOLIDAY_WORLD_QUEST_BONUS_EVENT_KR = 615,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_LK_EU = 616,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_LK_TW_CN = 617,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_LK_KR = 618,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_BC_EU = 622,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_BC_TW_CN = 623,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_BC_KR = 624,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_CATA_EU = 628,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_CATA_TW_CN = 629,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_CATA_KR = 630,
HOLIDAY_HATCHING_OF_THE_HIPPOGRYPHS = 634,
HOLIDAY_VOLUNTEER_GUARD_DAY = 635,
HOLIDAY_CALL_OF_THE_SCARAB = 638,
HOLIDAY_THOUSAND_BOAT_BASH = 642,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_MOP_DEFAULT = 643,
HOLIDAY_UNGORO_MADNESS = 644,
HOLIDAY_SPRING_BALLOON_FESTIVAL = 645,
HOLIDAY_KIRIN_TOR_TAVERN_CRAWL = 646,
HOLIDAY_MARCH_OF_THE_TADPOLES = 647,
HOLIDAY_GLOWCAP_FESTIVAL = 648,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_MOP_EU = 652,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_MOP_TW_CN = 654,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_MOP_KR = 656,
HOLIDAY_FIREWORKS_CELEBRATION = 658,
HOLIDAY_PVP_BRAWL_GL_1984 = 659,
HOLIDAY_PVP_BRAWL_SS_VS_TM_1984 = 660,
HOLIDAY_PVP_BRAWL_SS_VS_TM_US = 662,
HOLIDAY_PVP_BRAWL_GL_US = 663,
HOLIDAY_PVP_BRAWL_WS_US = 664,
HOLIDAY_PVP_BRAWL_AB_US = 666,
HOLIDAY_PVP_BRAWL_PH_US = 667,
HOLIDAY_PVP_BRAWL_SS_VS_TM_EU = 669,
HOLIDAY_PVP_BRAWL_GL_EU = 670,
HOLIDAY_PVP_BRAWL_WS_EU = 671,
HOLIDAY_PVP_BRAWL_AB_EU = 673,
HOLIDAY_PVP_BRAWL_PH_EU = 674,
HOLIDAY_PVP_BRAWL_SS_VS_TM_TW_CN = 676,
HOLIDAY_PVP_BRAWL_GL_TW_CN = 677,
HOLIDAY_PVP_BRAWL_WS_TW_CN = 678,
HOLIDAY_PVP_BRAWL_AB_TW_CN = 680,
HOLIDAY_PVP_BRAWL_PH_TW_CN = 681,
HOLIDAY_PVP_BRAWL_SS_VS_TM_KR = 683,
HOLIDAY_PVP_BRAWL_GL_KR = 684,
HOLIDAY_PVP_BRAWL_WS_KR = 685,
HOLIDAY_PVP_BRAWL_AB_KR = 687,
HOLIDAY_PVP_BRAWL_PH_KR = 688,
HOLIDAY_TRIAL_OF_STYLE = 691,
HOLIDAY_AUCTION_HOUSE_DANCE_PARTY = 692,
HOLIDAY_WOW_13TH_ANNIVERSARY = 693,
HOLIDAY_MOOKIN_FESTIVAL = 694,
HOLIDAY_THE_GREAT_GNOMEREGAN_RUN = 696,
HOLIDAY_PVP_BRAWL_WS_1984 = 701,
HOLIDAY_PVP_BRAWL_DS_US = 702,
HOLIDAY_PVP_BRAWL_DS_EU = 704,
HOLIDAY_PVP_BRAWL_DS_TW_CN = 705,
HOLIDAY_PVP_BRAWL_DS_KR = 706,
HOLIDAY_TOMB_OF_SARGERAS_NORMAL_HEROIC_DEFAULT = 710, // Tomb of Sargeras: Kil'jaeden awaits!
HOLIDAY_TOMB_OF_SARGERAS_NORMAL_HEROIC_EU = 711, // Tomb of Sargeras: Kil'jaeden awaits!
HOLIDAY_TOMB_OF_SARGERAS_NORMAL_HEROIC_TW_CN = 712, // Tomb of Sargeras: Kil'jaeden awaits!
HOLIDAY_TOMB_OF_SARGERAS_NORMAL_HEROIC_KR = 713, // Tomb of Sargeras: Kil'jaeden awaits!
HOLIDAY_TOMB_OF_SARGERAS_RF_1_SECTION_DEFAULT = 714, // Tomb of Sargeras: The Gates of Hell.
HOLIDAY_TOMB_OF_SARGERAS_RF_1_SECTION_EU = 715, // Tomb of Sargeras: The Gates of Hell.
HOLIDAY_TOMB_OF_SARGERAS_RF_1_SECTION_TW_CN = 716, // Tomb of Sargeras: The Gates of Hell.
HOLIDAY_TOMB_OF_SARGERAS_RF_1_SECTION_KR = 717, // Tomb of Sargeras: The Gates of Hell.
HOLIDAY_TOMB_OF_SARGERAS_RF_2_SECTION_DEFAULT = 718, // Tomb of Sargeras: Wailing Halls.
HOLIDAY_TOMB_OF_SARGERAS_RF_2_SECTION_EU = 719, // Tomb of Sargeras: Wailing Halls.
HOLIDAY_TOMB_OF_SARGERAS_RF_2_SECTION_TW_CN = 720, // Tomb of Sargeras: Wailing Halls.
HOLIDAY_TOMB_OF_SARGERAS_RF_2_SECTION_KR = 721, // Tomb of Sargeras: Wailing Halls.
HOLIDAY_TOMB_OF_SARGERAS_RF_3_SECTION_DEFAULT = 722, // Tomb of Sargeras: Chamber of the Avatar.
HOLIDAY_TOMB_OF_SARGERAS_RF_3_SECTION_EU = 723, // Tomb of Sargeras: Chamber of the Avatar.
HOLIDAY_TOMB_OF_SARGERAS_RF_3_SECTION_TW_CN = 724, // Tomb of Sargeras: Chamber of the Avatar.
HOLIDAY_TOMB_OF_SARGERAS_RF_3_SECTION_KR = 725, // Tomb of Sargeras: Chamber of the Avatar.
HOLIDAY_TOMB_OF_SARGERAS_FINAL_ENCOUNTER_DEFAULT = 726, // Tomb of Sargeras: Deceiver's Fall. Kil'jaeden awaits!
HOLIDAY_TOMB_OF_SARGERAS_FINAL_ENCOUNTER_EU = 727, // Tomb of Sargeras: Deceiver's Fall. Kil'jaeden awaits!
HOLIDAY_TOMB_OF_SARGERAS_FINAL_ENCOUNTER_TW_CN = 728, // Tomb of Sargeras: Deceiver's Fall. Kil'jaeden awaits!
HOLIDAY_TOMB_OF_SARGERAS_FINAL_ENCOUNTER_KR = 729, // Tomb of Sargeras: Deceiver's Fall. Kil'jaeden awaits!
HOLIDAY_TOMB_OF_SARGERAS_NORMAL_HEROIC_768 = 730, // Tomb of Sargeras: Kil'jaeden awaits!
HOLIDAY_PVP_BRAWL_DS_1984 = 736,
HOLIDAY_PVP_BRAWL_AB_1984 = 737,
HOLIDAY_7_3_SHADOWS_OF_ARGUS_WEEK_2_UNLOCKS_DEFAULT = 744, // In part 2 of Shadows of Argus, finish the story of Krokuun and travel to the ruined draenei city of Mac'Aree. Gain access to Invasion Points and thwart the Burning Legion's plans on other worlds. Additional World Quests become available.
HOLIDAY_7_3_SHADOWS_OF_ARGUS_WEEK_3_UNLOCKS_DEFAULT = 745, // In part 3 of Shadows of Argus, finish the Shadows of Argus storyline, unlock all World Quests, and venture into the new dungeon, the Seat of the Triumvirate. Activate your Netherlight Crucible on the Vindicaar to begin forging Relics.
HOLIDAY_7_3_SHADOWS_OF_ARGUS_WEEK_2_UNLOCKS_KR = 746, // In part 2 of Shadows of Argus, finish the story of Krokuun and travel to the ruined draenei city of Mac'Aree. Gain access to Invasion Points and thwart the Burning Legion's plans on other worlds. Additional World Quests become available.
HOLIDAY_7_3_SHADOWS_OF_ARGUS_WEEK_2_UNLOCKS_EU = 747, // In part 2 of Shadows of Argus, finish the story of Krokuun and travel to the ruined draenei city of Mac'Aree. Gain access to Invasion Points and thwart the Burning Legion's plans on other worlds. Additional World Quests become available.
HOLIDAY_7_3_SHADOWS_OF_ARGUS_WEEK_2_UNLOCKS_TW_CN = 748, // In part 2 of Shadows of Argus, finish the story of Krokuun and travel to the ruined draenei city of Mac'Aree. Gain access to Invasion Points and thwart the Burning Legion's plans on other worlds. Additional World Quests become available.
HOLIDAY_7_3_SHADOWS_OF_ARGUS_WEEK_3_UNLOCKS_TW_CN = 749, // In part 3 of Shadows of Argus, finish the Shadows of Argus storyline, unlock all World Quests, and venture into the new dungeon, the Seat of the Triumvirate. Activate your Netherlight Crucible on the Vindicaar to begin forging Relics.
HOLIDAY_7_3_SHADOWS_OF_ARGUS_WEEK_3_UNLOCKS_KR = 750, // In part 3 of Shadows of Argus, finish the Shadows of Argus storyline, unlock all World Quests, and venture into the new dungeon, the Seat of the Triumvirate. Activate your Netherlight Crucible on the Vindicaar to begin forging Relics.
HOLIDAY_7_3_SHADOWS_OF_ARGUS_WEEK_3_UNLOCKS_EU = 751, // In part 3 of Shadows of Argus, finish the Shadows of Argus storyline, unlock all World Quests, and venture into the new dungeon, the Seat of the Triumvirate. Activate your Netherlight Crucible on the Vindicaar to begin forging Relics.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_2_SECTION_TW_CN = 756, // Antorus, the Burning Throne: Forbidden Descent.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_2_SECTION_EU = 757, // Antorus, the Burning Throne: Forbidden Descent.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_2_SECTION_KR = 758, // Antorus, the Burning Throne: Forbidden Descent.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_2_SECTION_DEFAULT = 759, // Antorus, the Burning Throne: Forbidden Descent.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_3_SECTION_TW_CN = 760, // Antorus, the Burning Throne: Hope's End.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_3_SECTION_EU = 761, // Antorus, the Burning Throne: Hope's End.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_3_SECTION_KR = 762, // Antorus, the Burning Throne: Hope's End.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_3_SECTION_DEFAULT = 763, // Antorus, the Burning Throne: Hope's End.
HOLIDAY_ANTORUS_BURNING_THRONE_FINAL_SECTION_TW_CN = 764, // Antorus, the Burning Throne: Seat of the Pantheon.
HOLIDAY_ANTORUS_BURNING_THRONE_FINAL_SECTION_EU = 765, // Antorus, the Burning Throne: Seat of the Pantheon.
HOLIDAY_ANTORUS_BURNING_THRONE_FINAL_SECTION_KR = 766, // Antorus, the Burning Throne: Seat of the Pantheon.
HOLIDAY_ANTORUS_BURNING_THRONE_FINAL_SECTION_DEFAULT= 767, // Antorus, the Burning Throne: Seat of the Pantheon.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_1_SECTION_TW_CN = 768, // Antorus, the Burning Throne: Light's Breach.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_1_SECTION_EU = 769, // Antorus, the Burning Throne: Light's Breach.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_1_SECTION_KR = 770, // Antorus, the Burning Throne: Light's Breach.
HOLIDAY_ANTORUS_BURNING_THRONE_RF_1_SECTION_DEFAULT = 771, // Antorus, the Burning Throne: Light's Breach.
HOLIDAY_ANTORUS_BURNING_THRONE_NORMAL_HEROIC_TW_CN = 772, // Antorus, the Burning Throne: Argus awaits!
HOLIDAY_ANTORUS_BURNING_THRONE_NORMAL_HEROIC_EU = 773, // Antorus, the Burning Throne: Argus awaits!
HOLIDAY_ANTORUS_BURNING_THRONE_NORMAL_HEROIC_KR = 774, // Antorus, the Burning Throne: Argus awaits!
HOLIDAY_ANTORUS_BURNING_THRONE_NORMAL_HEROIC_DEFAULT= 775, // Antorus, the Burning Throne: Argus awaits!
HOLIDAY_ANTORUS_BURNING_THRONE_NORMAL_HEROIC_768 = 776, // Antorus, the Burning Throne: Argus awaits!
HOLIDAY_WOW_14TH_ANNIVERSARY = 807,
HOLIDAY_WOW_15TH_ANNIVERSARY = 808,
HOLIDAY_WAR_OF_THE_THORNS = 918, // Conflict emerges in Darkshore as the Horde and Alliance battle for control over Teldrassil in this limited time event!
HOLIDAY_ULDIR_NORMAL_HEROIC_768 = 920, // Uldir: G'huun awaits!
HOLIDAY_ULDIR_NORMAL_HEROIC_DEFAULT = 921, // Uldir: G'huun awaits!
HOLIDAY_ULDIR_NORMAL_HEROIC_KR = 922, // Uldir: G'huun awaits!
HOLIDAY_ULDIR_NORMAL_HEROIC_EU = 923, // Uldir: G'huun awaits!
HOLIDAY_ULDIR_NORMAL_HEROIC_TW_CN = 924, // Uldir: G'huun awaits!
HOLIDAY_ULDIR_RF_1_SECTION_DEFAULT = 925, // Uldir: Halls of Containment.
HOLIDAY_ULDIR_RF_1_SECTION_KR = 926, // Uldir: Halls of Containment.
HOLIDAY_ULDIR_RF_1_SECTION_EU = 927, // Uldir: Halls of Containment.
HOLIDAY_ULDIR_RF_1_SECTION_TW_CN = 928, // Uldir: Halls of Containment.
HOLIDAY_ULDIR_RF_2_SECTION_DEFAULT = 929, // Uldir: Crimson Descent.
HOLIDAY_ULDIR_RF_2_SECTION_KR = 930, // Uldir: Crimson Descent.
HOLIDAY_ULDIR_RF_2_SECTION_EU = 931, // Uldir: Crimson Descent.
HOLIDAY_ULDIR_RF_2_SECTION_TW_CN = 932, // Uldir: Crimson Descent.
HOLIDAY_ULDIR_FINAL_SECTION_DEFAULT = 933, // Uldir: Heart of Corruption.
HOLIDAY_ULDIR_FINAL_SECTION_KR = 934, // Uldir: Heart of Corruption.
HOLIDAY_ULDIR_FINAL_SECTION_EU = 935, // Uldir: Heart of Corruption.
HOLIDAY_ULDIR_FINAL_SECTION_TW_CN = 936, // Uldir: Heart of Corruption.
HOLIDAY_BATTLE_FOR_AZEROTH_DUNGEON_EVENT_EU = 938,
HOLIDAY_BATTLE_FOR_AZEROTH_DUNGEON_EVENT_TW_CN = 939,
HOLIDAY_BATTLE_FOR_AZEROTH_DUNGEON_EVENT_KR = 940,
HOLIDAY_BATTLE_FOR_AZEROTH_DUNGEON_EVENT_DEFAULT = 941,
HOLIDAY_WAR_OF_THE_THORNS_EU = 956, // Conflict emerges in Darkshore as the Horde and Alliance battle for control over Teldrassil in this limited time event!
HOLIDAY_WAR_OF_THE_THORNS_TW_CN = 957, // Conflict emerges in Darkshore as the Horde and Alliance battle for control over Teldrassil in this limited time event!
HOLIDAY_WAR_OF_THE_THORNS_KR = 958, // Conflict emerges in Darkshore as the Horde and Alliance battle for control over Teldrassil in this limited time event!
HOLIDAY_WAR_OF_THE_THORNS_320 = 959, // Conflict emerges in Darkshore as the Horde and Alliance battle for control over Teldrassil in this limited time event!
HOLIDAY_WAR_OF_THE_THORNS_US = 965, // Conflict emerges in Darkshore as the Horde and Alliance battle for control over Teldrassil in this limited time event!
HOLIDAY_WAR_OF_THE_THORNS_512 = 967, // Conflict emerges in Darkshore as the Horde and Alliance battle for control over Teldrassil in this limited time event!
HOLIDAY_WAR_OF_THE_THORNS_128 = 973, // Conflict emerges in Darkshore as the Horde and Alliance battle for control over Teldrassil in this limited time event!
HOLIDAY_ULDIR_NORMAL_HEROIC = 979, // Uldir: G'huun awaits!
HOLIDAY_BATTLE_OF_DAZARALOR_NORMAL_HEROIC_DEFAULT = 1025, // Battle of Dazar'alor raid
HOLIDAY_BATTLE_OF_DAZARALOR_NORMAL_HEROIC_KR = 1026, // Battle of Dazar'alor raid
HOLIDAY_BATTLE_OF_DAZARALOR_NORMAL_HEROIC_EU = 1027, // Battle of Dazar'alor raid
HOLIDAY_BATTLE_OF_DAZARALOR_NORMAL_HEROIC_TW_CN = 1028, // Battle of Dazar'alor raid
HOLIDAY_BATTLE_OF_DAZARALOR_NORMAL_HEROIC_768 = 1029, // Battle of Dazar'alor raid
HOLIDAY_BATTLE_OF_DAZARALOR_RF_1_SECTION_DEFAULT = 1030, // Battle of Dazar'alor: Siege of Dazar'alor.
HOLIDAY_BATTLE_OF_DAZARALOR_RF_1_SECTION_KR = 1031, // Battle of Dazar'alor: Siege of Dazar'alor.
HOLIDAY_BATTLE_OF_DAZARALOR_RF_1_SECTION_EU = 1032, // Battle of Dazar'alor: Siege of Dazar'alor.
HOLIDAY_BATTLE_OF_DAZARALOR_RF_1_SECTION_TW_CN = 1033, // Battle of Dazar'alor: Siege of Dazar'alor.
HOLIDAY_BATTLE_OF_DAZARALOR_RF_2_SECTION_DEFAULT = 1034, // Battle of Dazar'alor: Empire's Fall.
HOLIDAY_BATTLE_OF_DAZARALOR_RF_2_SECTION_KR = 1035, // Battle of Dazar'alor: Empire's Fall.
HOLIDAY_BATTLE_OF_DAZARALOR_RF_2_SECTION_EU = 1036, // Battle of Dazar'alor: Empire's Fall.
HOLIDAY_BATTLE_OF_DAZARALOR_RF_2_SECTION_TW_CN = 1037, // Battle of Dazar'alor: Empire's Fall.
HOLIDAY_BATTLE_OF_DAZARALOR_RF_3_SECTION_DEFAULT = 1038, // Battle of Dazar'alor: Might of the Alliance for Alliance players, and Victory or Death for Horde players.
HOLIDAY_BATTLE_OF_DAZARALOR_RF_3_SECTION_KR = 1039, // Battle of Dazar'alor: Might of the Alliance for Alliance players, and Victory or Death for Horde players.
HOLIDAY_BATTLE_OF_DAZARALOR_RF_3_SECTION_EU = 1040, // Battle of Dazar'alor: Might of the Alliance for Alliance players, and Victory or Death for Horde players.
HOLIDAY_BATTLE_OF_DAZARALOR_RF_3_SECTION_TW_CN = 1041, // Battle of Dazar'alor: Might of the Alliance for Alliance players, and Victory or Death for Horde players.
HOLIDAY_PVP_BRAWL_COOKING_IMPOSSIBLE_US = 1047,
HOLIDAY_PVP_BRAWL_COOKING_IMPOSSIBLE_KR = 1048,
HOLIDAY_PVP_BRAWL_COOKING_IMPOSSIBLE_EU = 1049,
HOLIDAY_PVP_BRAWL_COOKING_IMPOSSIBLE_1984 = 1050,
HOLIDAY_PVP_BRAWL_COOKING_IMPOSSIBLE_TW_CN = 1051,
HOLIDAY_WANDERERS_FESTIVAL = 1052,
HOLIDAY_FREE_TSHIRT_DAY = 1053,
HOLIDAY_LUMINOUS_LUMINARIES = 1054,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_WOD_DEFAULT = 1056,
HOLIDAY_LUMINOUS_LUMINARIES_64 = 1062,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_WOD_EU = 1063,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_WOD_KR = 1065,
HOLIDAY_TIMEWALKING_DUNGEON_EVENT_WOD_TW_CN = 1068,
HOLIDAY_CRUCIBLE_OF_STORMS_NORMAL_HEROIC_DEFAULT = 1069, // Delve into the chambers beneath Stormsong Valley to uncover the source of the shadow spreading across the land, now available on Normal or Heroic difficulty.
HOLIDAY_CRUCIBLE_OF_STORMS_NORMAL_HEROIC_KR = 1070, // Delve into the chambers beneath Stormsong Valley to uncover the source of the shadow spreading across the land, now available on Normal or Heroic difficulty.
HOLIDAY_CRUCIBLE_OF_STORMS_NORMAL_HEROIC_EU = 1071, // Delve into the chambers beneath Stormsong Valley to uncover the source of the shadow spreading across the land, now available on Normal or Heroic difficulty.
HOLIDAY_CRUCIBLE_OF_STORMS_NORMAL_HEROIC_TW_CN = 1072, // Delve into the chambers beneath Stormsong Valley to uncover the source of the shadow spreading across the land, now available on Normal or Heroic difficulty.
HOLIDAY_CRUCIBLE_OF_STORMS_NORMAL_HEROIC = 1073, // Delve into the chambers beneath Stormsong Valley to uncover the source of the shadow spreading across the land, now available on Normal or Heroic difficulty.
HOLIDAY_CRUCIBLE_OF_STORMS_RAID_FINDER_DEFAULT = 1074, // Mythic difficulty of the Crucible of Storms raid awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_CRUCIBLE_OF_STORMS_RAID_FINDER_EU = 1075, // Mythic difficulty of the Crucible of Storms raid awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_CRUCIBLE_OF_STORMS_RAID_FINDER_KR = 1076, // Mythic difficulty of the Crucible of Storms raid awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_CRUCIBLE_OF_STORMS_RAID_FINDER_TW_CN = 1077, // Mythic difficulty of the Crucible of Storms raid awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_CRUCIBLE_OF_STORMS_RAID_FINDER = 1078, // Mythic difficulty of the Crucible of Storms raid awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_THE_ETERNAL_PALACE_DEFAULT = 1098, // The dangers of Nazjatar were merely preamble. Breach the palace gates and descend into Azshara's deadly domain.
HOLIDAY_THE_ETERNAL_PALACE_KR = 1099, // The dangers of Nazjatar were merely preamble. Breach the palace gates and descend into Azshara's deadly domain.
HOLIDAY_THE_ETERNAL_PALACE_EU = 1100, // The dangers of Nazjatar were merely preamble. Breach the palace gates and descend into Azshara's deadly domain.
HOLIDAY_THE_ETERNAL_PALACE_TW_CN = 1101, // The dangers of Nazjatar were merely preamble. Breach the palace gates and descend into Azshara's deadly domain.
HOLIDAY_THE_ETERNAL_PALACE_RAID_FINDER_DEFAULT = 1102, // Mythic difficulty of The Eternal Palace raid awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_THE_ETERNAL_PALACE_RAID_FINDER_KR = 1103, // Mythic difficulty of The Eternal Palace raid awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_THE_ETERNAL_PALACE_RAID_FINDER_EU = 1104, // Mythic difficulty of The Eternal Palace raid awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_THE_ETERNAL_PALACE_RAID_FINDER_TW_CN = 1105, // Mythic difficulty of The Eternal Palace raid awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_THE_ETERNAL_PALACE_RF_2_SECTION_EU = 1106, // The Eternal Palace: Depths of the Devoted.
HOLIDAY_THE_ETERNAL_PALACE_RF_2_SECTION_TW_CN = 1107, // The Eternal Palace: Depths of the Devoted.
HOLIDAY_THE_ETERNAL_PALACE_FINAL_SECTION_DEFAULT = 1108, // The Eternal Palace: The Circle of Stars.
HOLIDAY_THE_ETERNAL_PALACE_FINAL_SECTION_KR = 1109, // The Eternal Palace: The Circle of Stars.
HOLIDAY_THE_ETERNAL_PALACE_FINAL_SECTION_EU = 1110, // The Eternal Palace: The Circle of Stars.
HOLIDAY_THE_ETERNAL_PALACE_FINAL_SECTION_TW_CN = 1111, // The Eternal Palace: The Circle of Stars.
HOLIDAY_THE_ETERNAL_PALACE_RF_2_SECTION_KR = 1112, // The Eternal Palace: Depths of the Devoted.
HOLIDAY_THE_ETERNAL_PALACE_RF_2_SECTION_DEFAULT = 1113, // The Eternal Palace: Depths of the Devoted.
HOLIDAY_PVP_BRAWL_CLASSIC_ASHRAN_US = 1120,
HOLIDAY_PVP_BRAWL_CLASSIC_ASHRAN_KR = 1121,
HOLIDAY_PVP_BRAWL_CLASSIC_ASHRAN_EU = 1122,
HOLIDAY_PVP_BRAWL_CLASSIC_ASHRAN_1984 = 1123,
HOLIDAY_PVP_BRAWL_CLASSIC_ASHRAN_TW_CN = 1124,
HOLIDAY_NYALOTHA_WALKING_CITY_DEFAULT = 1140, // Descend into Ny'alotha, the Waking City and face N'Zoth in his own realm.
HOLIDAY_NYALOTHA_WALKING_CITY_KR = 1141, // Descend into Ny'alotha, the Waking City and face N'Zoth in his own realm.
HOLIDAY_NYALOTHA_WALKING_CITY_EU = 1142, // Descend into Ny'alotha, the Waking City and face N'Zoth in his own realm.
HOLIDAY_NYALOTHA_WALKING_CITY_TW_CN = 1143, // Descend into Ny'alotha, the Waking City and face N'Zoth in his own realm.
HOLIDAY_NYALOTHA_WALKING_CITY_RAID_FINDER_DEFAULT = 1144, // Mythic difficulty of Ny'alotha, the Waking City awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_NYALOTHA_WALKING_CITY_RAID_FINDER_KR = 1145, // Mythic difficulty of Ny'alotha, the Waking City awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_NYALOTHA_WALKING_CITY_RAID_FINDER_EU = 1146, // Mythic difficulty of Ny'alotha, the Waking City awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_NYALOTHA_WALKING_CITY_RAID_FINDER_TW_CN = 1147, // Mythic difficulty of Ny'alotha, the Waking City awaits the boldest of adventurers, and players may now use the Raid Finder to access the raid.
HOLIDAY_NYALOTHA_WALKING_CITY_RF_2_SECTION_DEFAULT = 1148, // Ny'alotha, the Waking City: Halls of Devotion.
HOLIDAY_NYALOTHA_WALKING_CITY_RF_2_SECTION_KR = 1149, // Ny'alotha, the Waking City: Halls of Devotion.
HOLIDAY_NYALOTHA_WALKING_CITY_RF_2_SECTION_EU = 1150, // Ny'alotha, the Waking City: Halls of Devotion.
HOLIDAY_NYALOTHA_WALKING_CITY_RF_2_SECTION_TW_CN = 1151, // Ny'alotha, the Waking City: Halls of Devotion.
HOLIDAY_NYALOTHA_WALKING_CITY_RF_3_SECTION_DEFAULT = 1152, // Ny'alotha, the Waking City: Gift of Flesh.
HOLIDAY_NYALOTHA_WALKING_CITY_RF_3_SECTION_KR = 1153, // Ny'alotha, the Waking City: Gift of Flesh.
HOLIDAY_NYALOTHA_WALKING_CITY_RF_3_SECTION_EU = 1154, // Ny'alotha, the Waking City: Gift of Flesh.
HOLIDAY_NYALOTHA_WALKING_CITY_RF_3_SECTION_TW_CN = 1155, // Ny'alotha, the Waking City: Gift of Flesh.
HOLIDAY_NYALOTHA_WALKING_CITY_FINAL_SECTION_DEFAULT = 1156, // Ny'alotha, the Waking City: The Waking Dream.
HOLIDAY_NYALOTHA_WALKING_CITY_FINAL_SECTION_KR = 1157, // Ny'alotha, the Waking City: The Waking Dream.
HOLIDAY_NYALOTHA_WALKING_CITY_FINAL_SECTION_EU = 1158, // Ny'alotha, the Waking City: The Waking Dream.
HOLIDAY_NYALOTHA_WALKING_CITY_FINAL_SECTION_TW_CN = 1159, // Ny'alotha, the Waking City: The Waking Dream.
HOLIDAY_PVP_BRAWL_TH_1984 = 1166,
HOLIDAY_PVP_BRAWL_TH_KR = 1167,
HOLIDAY_PVP_BRAWL_TH_TW_CN = 1168,
HOLIDAY_PVP_BRAWL_TH_EU = 1169,
HOLIDAY_PVP_BRAWL_TH_US = 1170,
HOLIDAY_WOW_16TH_ANNIVERSARY = 1181,
HOLIDAY_CASTLE_NATHRIA_DEFAULT = 1194, // Enter Castle Nathria and confront Sire Denathrius in his citadel.
HOLIDAY_CASTLE_NATHRIA_RF_1_SECTION_DEFAULT = 1195, // Castle Nathria: The Leeching Vaults.
HOLIDAY_CASTLE_NATHRIA_RF_2_SECTION_DEFAULT = 1196, // Castle Nathria: Reliquary of Opulence.
HOLIDAY_CASTLE_NATHRIA_RF_3_SECTION_DEFAULT = 1197, // Castle Nathria: Blood from Stone.
HOLIDAY_CASTLE_NATHRIA_EU = 1198, // Enter Castle Nathria and confront Sire Denathrius in his citadel.
HOLIDAY_CASTLE_NATHRIA_RF_1_SECTION_EU = 1199, // Castle Nathria: The Leeching Vaults.
HOLIDAY_CASTLE_NATHRIA_RF_2_SECTION_EU = 1200, // Castle Nathria: Reliquary of Opulence.
HOLIDAY_CASTLE_NATHRIA_RF_3_SECTION_EU = 1201, // Castle Nathria: Blood from Stone.
HOLIDAY_CASTLE_NATHRIA_KR = 1202, // Enter Castle Nathria and confront Sire Denathrius in his citadel.
HOLIDAY_CASTLE_NATHRIA_RF_1_SECTION_KR = 1203, // Castle Nathria: The Leeching Vaults.
HOLIDAY_CASTLE_NATHRIA_RF_2_SECTION_KR = 1204, // Castle Nathria: Reliquary of Opulence.
HOLIDAY_CASTLE_NATHRIA_RF_3_SECTION_KR = 1205, // Castle Nathria: Blood from Stone.
HOLIDAY_CASTLE_NATHRIA_TW_CN = 1206, // Enter Castle Nathria and confront Sire Denathrius in his citadel.
HOLIDAY_CASTLE_NATHRIA_RF_1_SECTION_TW_CN = 1207, // Castle Nathria: The Leeching Vaults.
HOLIDAY_CASTLE_NATHRIA_RF_2_SECTION_TW_CN = 1208, // Castle Nathria: Reliquary of Opulence.
HOLIDAY_CASTLE_NATHRIA_RF_3_SECTION_TW_CN = 1209, // Castle Nathria: Blood from Stone.
HOLIDAY_CASTLE_NATHRIA_FINAL_SECTION_DEFAULT = 1210, // Castle Nathria: An Audience with Arrogance.
HOLIDAY_CASTLE_NATHRIA_FINAL_SECTION_EU = 1211, // Castle Nathria: An Audience with Arrogance.
HOLIDAY_CASTLE_NATHRIA_FINAL_SECTION_KR = 1212, // Castle Nathria: An Audience with Arrogance.
HOLIDAY_CASTLE_NATHRIA_FINAL_SECTION_TW_CN = 1213, // Castle Nathria: An Audience with Arrogance.
HOLIDAY_TORGHAST_BEASTS_OF_PRODIGUM = 1214,
HOLIDAY_TORGHAST_UNBRIDLED_DARKNESS = 1215,
HOLIDAY_TORGHAST_CHORUS_OF_DEAD_SOULS = 1216,
HOLIDAY_SHADOWLANDS_DUNGEON_EVENT_DEFAULT = 1217,
HOLIDAY_SHADOWLANDS_DUNGEON_EVENT_EU = 1218,
HOLIDAY_SHADOWLANDS_DUNGEON_EVENT_TW_CN = 1219,
HOLIDAY_SHADOWLANDS_DUNGEON_EVENT_KR = 1220,
HOLIDAY_PVP_BRAWL_WS_1984_2 = 1221,
HOLIDAY_CASTLE_NATHRIA_32 = 1222 // Enter Castle Nathria and confront Sire Denathrius in his citadel.
};
enum QuestType
{
QUEST_TYPE_AUTOCOMPLETE = 0,
QUEST_TYPE_DISABLED = 1,
QUEST_TYPE_NORMAL = 2,
QUEST_TYPE_TASK = 3,
MAX_QUEST_TYPES = 4
};
// QuestInfo.db2 (9.0.2)
enum QuestInfo
{
QUEST_INFO_GROUP = 1,
QUEST_INFO_CLASS = 21,
QUEST_INFO_PVP = 41,
QUEST_INFO_RAID = 62,
QUEST_INFO_DUNGEON = 81,
QUEST_INFO_WORLD_EVENT = 82,
QUEST_INFO_LEGENDARY = 83,
QUEST_INFO_ESCORT = 84,
QUEST_INFO_HEROIC = 85,
QUEST_INFO_RAID_10 = 88,
QUEST_INFO_RAID_25 = 89,
QUEST_INFO_SCENARIO = 98,
QUEST_INFO_ACCOUNT = 102,
QUEST_INFO_SIDE_QUEST = 104,
QUEST_INFO_ARTIFACT = 107,
QUEST_INFO_WORLD_QUEST = 109,
QUEST_INFO_WORLD_QUEST_EPIC = 110,
QUEST_INFO_WORLD_QUEST_ELITE = 111,
QUEST_INFO_WORLD_QUEST_RARE_ELITE = 112,
QUEST_INFO_WORLD_QUEST_PVP = 113,
QUEST_INFO_WORLD_QUEST_FIRST_AID = 114,
QUEST_INFO_WORLD_QUEST_BATTLEPET = 115,
QUEST_INFO_WORLD_QUEST_BLACKSMITHING = 116,
QUEST_INFO_WORLD_QUEST_LEATHERWORKING = 117,
QUEST_INFO_WORLD_QUEST_ALCHEMY = 118,
QUEST_INFO_WORLD_QUEST_HERBALISM = 119,
QUEST_INFO_WORLD_QUEST_MINING = 120,
QUEST_INFO_WORLD_QUEST_TAILORING = 121,
QUEST_INFO_WORLD_QUEST_ENGINEERING = 122,
QUEST_INFO_WORLD_QUEST_ENCHANTING = 123,
QUEST_INFO_WORLD_QUEST_SKINNINg = 124,
QUEST_INFO_WORLD_QUEST_JEWELCRAFTING = 125,
QUEST_INFO_WORLD_QUEST_INSCRIPTION = 126,
QUEST_INFO_EMISSARY = 128,
QUEST_INFO_WORLD_QUEST_ARCHEOLOGY = 129,
QUEST_INFO_WORLD_QUEST_FISHING = 130,
QUEST_INFO_WORLD_QUEST_COOKING = 131,
QUEST_INFO_WORLD_QUEST_RARE_2 = 135,
QUEST_INFO_WORLD_QUEST_RARE_ELITE_2 = 136,
QUEST_INFO_WORLD_QUEST_DUNGEON = 137,
QUEST_INFO_WORLD_QUEST_LEGION_INVASION = 139,
QUEST_INFO_RATED_REWARD = 140,
QUEST_INFO_WORLD_QUEST_RAID = 141,
QUEST_INFO_WORLD_QUEST_LEGION_INVASION_ELITE = 142,
QUEST_INFO_WORLD_QUEST_LEGIONFALL_CONTRIBUTION = 143,
QUEST_INFO_WORLD_QUEST_LEGIONFALL = 144,
QUEST_INFO_WORLD_QUEST_LEGIONFALL_DUNGEON = 145,
QUEST_INFO_WORLD_QUEST_LEGION_INVASION_WRAPPER = 146,
QUEST_INFO_PICK_POCKET = 148,
QUEST_INFO_MAGNI_WORLD_QUEST = 151,
QUEST_INFO_TORTOLLAN_WORLD_QUEST = 152,
QUEST_INFO_WARFRONT_CONTRIBUTION = 153,
QUEST_INFO_ISLAND_QUEST = 254,
QUEST_INFO_WAR_MODE_PVP = 255,
QUEST_INFO_PVP_CONQUEST = 256,
QUEST_INFO_FACTION_ASSAULT_WORLD_QUEST = 259,
QUEST_INFO_FACTION_ASSAULT_ELITE_WORLD_QUEST = 260,
QUEST_INFO_ISLAND_WEEKLY_QUEST = 261,
QUEST_INFO_PUBLIC_QUEST = 263,
QUEST_INFO_THREAT_OBJECTIVE = 264,
QUEST_INFO_HIDDEN_QUEST = 265,
QUEST_INFO_COMBAT_ALLY_QUEST = 266,
QUEST_INFO_PROFESSIONS = 267,
QUEST_INFO_THREAT_WRAPPER = 268,
QUEST_INFO_THREAT_EMISSARY_QUEST = 270,
QUEST_INFO_CALLING_QUEST = 271,
QUEST_INFO_VENTHYR_PARTY_QUEST = 272,
QUEST_INFO_MAW_SOUL_SPAWN_TRACKER = 273
};
// QuestSort.db2 (9.0.2)
enum QuestSort
{
QUEST_SORT_EPIC = 1,
QUEST_SORT_HALLOWS_END = 21,
QUEST_SORT_SEASONAL = 22,
QUEST_SORT_CATACLYSM = 23,
QUEST_SORT_HERBALISM = 24,
QUEST_SORT_BATTLEGROUNDS = 25,
QUEST_SORT_DAY_OF_THE_DEAD = 41,
QUEST_SORT_WARLOCK = 61,
QUEST_SORT_WARRIOR = 81,
QUEST_SORT_SHAMAN = 82,
QUEST_SORT_FISHING = 101,
QUEST_SORT_BLACKSMITHING = 121,
QUEST_SORT_PALADIN = 141,
QUEST_SORT_MAGE = 161,
QUEST_SORT_ROGUE = 162,
QUEST_SORT_ALCHEMY = 181,
QUEST_SORT_LEATHERWORKING = 182,
QUEST_SORT_ENGINEERING = 201,
QUEST_SORT_TREASURE_MAP = 221,
QUEST_SORT_TOURNAMENT = 241,
QUEST_SORT_HUNTER = 261,
QUEST_SORT_PRIEST = 262,
QUEST_SORT_DRUID = 263,
QUEST_SORT_TAILORING = 264,
QUEST_SORT_SPECIAL = 284,
QUEST_SORT_COOKING = 304,
QUEST_SORT_FIRST_AID = 324,
QUEST_SORT_LEGENDARY = 344,
QUEST_SORT_DARKMOON_FAIRE = 364,
QUEST_SORT_AHN_QIRAJ_WAR = 365,
QUEST_SORT_LUNAR_FESTIVAL = 366,
QUEST_SORT_REPUTATION = 367,
QUEST_SORT_INVASION = 368,
QUEST_SORT_MIDSUMMER = 369,
QUEST_SORT_BREWFEST = 370,
QUEST_SORT_INSCRIPTION = 371,
QUEST_SORT_DEATH_KNIGHT = 372,
QUEST_SORT_JEWELCRAFTING = 373,
QUEST_SORT_NOBLEGARDEN = 374,
QUEST_SORT_PILGRIMS_BOUNTY = 375,
QUEST_SORT_LOVE_IS_IN_THE_AIR = 376,
QUEST_SORT_ARCHAEOLOGY = 377,
QUEST_SORT_CHILDRENS_WEEK = 378,
QUEST_SORT_FIRELANDS_INVASION = 379,
QUEST_SORT_THE_ZANDALARI = 380,
QUEST_SORT_ELEMENTAL_BONDS = 381,
QUEST_SORT_PANDAREN_BREWMASTER = 391,
QUEST_SORT_SCENARIO = 392,
QUEST_SORT_BATTLE_PETS = 394,
QUEST_SORT_MONK = 395,
QUEST_SORT_LANDFALL = 396,
QUEST_SORT_PANDAREN_CAMPAIGN = 397,
QUEST_SORT_RIDING = 398,
QUEST_SORT_BRAWLERS_GUILD = 399,
QUEST_SORT_PROVING_GROUNDS = 400,
QUEST_SORT_GARRISON_CAMPAIGN = 401,
QUEST_SORT_ASSAULT_ON_THE_DARK_PORTAL = 402,
QUEST_SORT_GARRISON_SUPPORT = 403,
QUEST_SORT_LOGGING = 404,
QUEST_SORT_PICKPOCKETING = 405,
QUEST_SORT_ARTIFACT = 406,
QUEST_SORT_DEMON_HUNTER = 407,
QUEST_SORT_MINING = 408,
QUEST_SORT_WEEKEND_EVENT = 409,
QUEST_SORT_ENCHANTING = 410,
QUEST_SORT_SKINNING = 411,
QUEST_SORT_WORLD_QUEST = 412,
QUEST_SORT_DEATH_KNIGHT_CAMPAIGN = 413,
QUEST_SORT_DEMON_HUNTER_CAMPAIGN = 416,
QUEST_SORT_DRUID_CAMPAIGN = 417,
QUEST_SORT_HUNTER_CAMPAIGN = 418,
QUEST_SORT_MONK_CAMPAIGN = 419,
QUEST_SORT_MAGE_CAMPAIGN = 420,
QUEST_SORT_PRIEST_CAMPAIGN = 421,
QUEST_SORT_PALADIN_CAMPAIGN = 422,
QUEST_SORT_SHAMAN_CAMPAIGN = 423,
QUEST_SORT_ROGUE_CAMPAIGN = 424,
QUEST_SORT_WARLOCK_CAMPAIGN = 425,
QUEST_SORT_WARRIOR_CAMPAIGN = 426,
QUEST_SORT_ORDER_HALL = 427,
QUEST_SORT_LEGIONFALL_CAMPAIGN = 428,
QUEST_SORT_HUNT_FOR_ILLIDAN = 429,
QUEST_SORT_PIRATES_DAY = 430,
QUEST_SORT_ARGUS_EXPEDITION = 431,
QUEST_SORT_MOONKIN_FESTIVAL = 433,
QUEST_SORT_KINGS_PATH = 434,
QUEST_SORT_DEATHS_OF_CHROMIE = 435,
QUEST_SORT_ROCKET_CHICKEN = 436,
QUEST_SORT_LIGHTFORGED_DRAENEI = 437,
QUEST_SORT_HIGHMOUNTAIN_TAUREN = 438,
QUEST_SORT_VOID_ELF = 439,
QUEST_SORT_NIGHTBORNE = 440,
QUEST_SORT_DUNGEON = 441,
QUEST_SORT_RAID = 442,
QUEST_SORT_ALLIED_RACES = 444,
QUEST_SORT_THE_WARCHIEF_S_AGENDA = 445,
QUEST_SORT_ADVENTURE_JOURNEY = 446,
QUEST_SORT_ALLIANCE_WAR_CAMPAIGN = 447,
QUEST_SORT_HORDE_WAR_CAMPAIGN = 448,
QUEST_SORT_DARK_IRON_DWARF = 449,
QUEST_SORT_MAG_HAR_ORC = 450,
QUEST_SORT_THE_SHADOW_HUNTER = 451,
QUEST_SORT_ISLAND_EXPEDITIONS = 453,
QUEST_SORT_WORLD_PVP = 555,
QUEST_SORT_THE_PRIDE_OF_KUL_TIRAS = 556,
QUEST_SORT_RATED_PVP = 557,
QUEST_SORT_ZANDALARI_TROLL = 559,
QUEST_SORT_HERITAGE = 560,
QUEST_SORT_QUESTFALL = 561,
QUEST_SORT_TYRANDE_S_VENGEANCE = 562,
QUEST_SORT_THE_FATE_OF_SAURFANG = 563,
QUEST_SORT_FREE_T_SHIRT_DAY = 564,
QUEST_SORT_CRUCIBLE_OF_STORMS = 565,
QUEST_SORT_KUL_TIRAN = 566,
QUEST_SORT_ASSAULT = 567,
QUEST_SORT_HEART_OF_AZEROTH = 569,
QUEST_SORT_PROFESSIONS = 571,
QUEST_SORT_NAZJATAR_FOLLOWERS = 573,
QUEST_SORT_SINFALL = 574,
QUEST_SORT_KORRAK_S_REVENGE = 575,
QUEST_SORT_COVENANT_SANCTUM = 576,
QUEST_SORT_REFER_A_FRIEND = 579,
QUEST_SORT_VISIONS_OF_N_ZOTH = 580,
QUEST_SORT_VULPERA = 582,
QUEST_SORT_MECHAGNOME = 583,
QUEST_SORT_BLACK_EMPIRE_CAMPAIGN = 584,
QUEST_SORT_EMBER_COURT = 586,
QUEST_SORT_THROUGH_THE_SHATTERED_SKY = 587,
QUEST_SORT_DEATH_RISING = 588,
QUEST_SORT_KYRIAN_CALLINGS = 589,
QUEST_SORT_NIGHT_FAE_CALLINGS = 590,
QUEST_SORT_NECROLORD_CALLINGS = 591,
QUEST_SORT_VENTHYR_CALLINGS = 592,
QUEST_SORT_ABOMINABLE_STITCHING = 593,
QUEST_SORT_TIMEWALKING_CAMPAIGN = 594,
QUEST_SORT_PATH_OF_ASCENSION = 595,
QUEST_SORT_LEGENDARY_CRAFTING = 596
};
inline uint8 ClassByQuestSort(int32 QuestSort)
{
switch (QuestSort)
{
case QUEST_SORT_WARLOCK: return CLASS_WARLOCK;
case QUEST_SORT_WARRIOR: return CLASS_WARRIOR;
case QUEST_SORT_SHAMAN: return CLASS_SHAMAN;
case QUEST_SORT_PALADIN: return CLASS_PALADIN;
case QUEST_SORT_MAGE: return CLASS_MAGE;
case QUEST_SORT_ROGUE: return CLASS_ROGUE;
case QUEST_SORT_HUNTER: return CLASS_HUNTER;
case QUEST_SORT_PRIEST: return CLASS_PRIEST;
case QUEST_SORT_DRUID: return CLASS_DRUID;
case QUEST_SORT_DEATH_KNIGHT: return CLASS_DEATH_KNIGHT;
case QUEST_SORT_DEMON_HUNTER: return CLASS_DEMON_HUNTER;
}
return 0;
}
// SkillLine.dbc (9.0.2)
enum SkillType
{
SKILL_NONE = 0,
SKILL_SWORDS = 43,
SKILL_AXES = 44,
SKILL_BOWS = 45,
SKILL_GUNS = 46,
SKILL_MACES = 54,
SKILL_TWO_HANDED_SWORDS = 55,
SKILL_DEFENSE = 95,
SKILL_LANGUAGE_COMMON = 98,
SKILL_RACIAL_DWARF = 101,
SKILL_LANGUAGE_ORCISH = 109,
SKILL_LANGUAGE_DWARVEN = 111,
SKILL_LANGUAGE_DARNASSIAN = 113,
SKILL_LANGUAGE_TAURAHE = 115,
SKILL_DUAL_WIELD = 118,
SKILL_RACIAL_TAUREN = 124,
SKILL_RACIAL_ORC = 125,
SKILL_RACIAL_NIGHT_ELF = 126,
SKILL_STAVES = 136,
SKILL_LANGUAGE_THALASSIAN = 137,
SKILL_LANGUAGE_DRACONIC = 138,
SKILL_LANGUAGE_DEMON_TONGUE = 139,
SKILL_LANGUAGE_TITAN = 140,
SKILL_LANGUAGE_OLD_TONGUE = 141,
SKILL_SURVIVAL = 142,
SKILL_HORSE_RIDING = 148,
SKILL_WOLF_RIDING = 149,
SKILL_TIGER_RIDING = 150,
SKILL_RAM_RIDING = 152,
SKILL_SWIMMING = 155,
SKILL_TWO_HANDED_MACES = 160,
SKILL_UNARMED = 162,
SKILL_BLACKSMITHING = 164,
SKILL_LEATHERWORKING = 165,
SKILL_ALCHEMY = 171,
SKILL_TWO_HANDED_AXES = 172,
SKILL_DAGGERS = 173,
SKILL_HERBALISM = 182,
SKILL_GENERIC_DND = 183,
SKILL_COOKING = 185,
SKILL_MINING = 186,
SKILL_PET_IMP = 188,
SKILL_PET_FELHUNTER = 189,
SKILL_TAILORING = 197,
SKILL_ENGINEERING = 202,
SKILL_PET_SPIDER = 203,
SKILL_PET_VOIDWALKER = 204,
SKILL_PET_SUCCUBUS = 205,
SKILL_PET_INFERNAL = 206,
SKILL_PET_DOOMGUARD = 207,
SKILL_PET_WOLF = 208,
SKILL_PET_CAT = 209,
SKILL_PET_BEAR = 210,
SKILL_PET_BOAR = 211,
SKILL_PET_CROCOLISK = 212,
SKILL_PET_CARRION_BIRD = 213,
SKILL_PET_CRAB = 214,
SKILL_PET_GORILLA = 215,
SKILL_PET_RAPTOR = 217,
SKILL_PET_TALLSTRIDER = 218,
SKILL_RACIAL_UNDEAD = 220,
SKILL_CROSSBOWS = 226,
SKILL_WANDS = 228,
SKILL_POLEARMS = 229,
SKILL_PET_SCORPID = 236,
SKILL_PET_TURTLE = 251,
SKILL_PET_GENERIC_HUNTER = 270,
SKILL_PLATE_MAIL = 293,
SKILL_LANGUAGE_GNOMISH = 313,
SKILL_LANGUAGE_TROLL = 315,
SKILL_ENCHANTING = 333,
SKILL_FISHING = 356,
SKILL_SKINNING = 393,
SKILL_MAIL = 413,
SKILL_LEATHER = 414,
SKILL_CLOTH = 415,
SKILL_SHIELD = 433,
SKILL_FIST_WEAPONS = 473,
SKILL_RAPTOR_RIDING = 533,
SKILL_MECHANOSTRIDER_PILOTING = 553,
SKILL_UNDEAD_HORSEMANSHIP = 554,
SKILL_LOCKPICKING = 633,
SKILL_PET_BAT = 653,
SKILL_PET_HYENA = 654,
SKILL_PET_BIRD_OF_PREY = 655,
SKILL_PET_WIND_SERPENT = 656,
SKILL_LANGUAGE_FORSAKEN = 673,
SKILL_KODO_RIDING = 713,
SKILL_RACIAL_TROLL = 733,
SKILL_RACIAL_GNOME = 753,
SKILL_RACIAL_HUMAN = 754,
SKILL_JEWELCRAFTING = 755,
SKILL_RACIAL_BLOOD_ELF = 756,
SKILL_PET_EVENT_REMOTE_CONTROL = 758,
SKILL_LANGUAGE_DRAENEI = 759,
SKILL_RACIAL_DRAENEI = 760,
SKILL_PET_FELGUARD = 761,
SKILL_RIDING = 762,
SKILL_PET_DRAGONHAWK = 763,
SKILL_PET_NETHER_RAY = 764,
SKILL_PET_SPOREBAT = 765,
SKILL_PET_WARP_STALKER = 766,
SKILL_PET_RAVAGER = 767,
SKILL_PET_SERPENT = 768,
SKILL_INTERNAL = 769,
SKILL_INSCRIPTION = 773,
SKILL_PET_MOTH = 775,
SKILL_MOUNTS = 777,
SKILL_COMPANIONS = 778,
SKILL_PET_EXOTIC_CHIMAERA = 780,
SKILL_PET_EXOTIC_DEVILSAUR = 781,
SKILL_PET_GHOUL = 782,
SKILL_PET_EXOTIC_SILITHID = 783,
SKILL_PET_EXOTIC_WORM = 784,
SKILL_PET_WASP = 785,
SKILL_PET_EXOTIC_CLEFTHOOF = 786,
SKILL_PET_EXOTIC_CORE_HOUND = 787,
SKILL_PET_EXOTIC_SPIRIT_BEAST = 788,
SKILL_RACIAL_WORGEN = 789,
SKILL_RACIAL_GOBLIN = 790,
SKILL_LANGUAGE_GILNEAN = 791,
SKILL_LANGUAGE_GOBLIN = 792,
SKILL_ARCHAEOLOGY = 794,
SKILL_HUNTER = 795,
SKILL_DEATH_KNIGHT = 796,
SKILL_DRUID = 798,
SKILL_PALADIN = 800,
SKILL_PRIEST = 804,
SKILL_PET_WATER_ELEMENTAL = 805,
SKILL_PET_FOX = 808,
SKILL_ALL_GLYPHS = 810,
SKILL_PET_DOG = 811,
SKILL_PET_MONKEY = 815,
SKILL_PET_EXOTIC_SHALE_SPIDER = 817,
SKILL_BEETLE = 818,
SKILL_ALL_GUILD_PERKS = 821,
SKILL_PET_HYDRA = 824,
SKILL_MONK = 829,
SKILL_WARRIOR = 840,
SKILL_WARLOCK = 849,
SKILL_RACIAL_PANDAREN = 899,
SKILL_MAGE = 904,
SKILL_LANGUAGE_PANDAREN_NEUTRAL = 905,
SKILL_ROGUE = 921,
SKILL_SHAMAN = 924,
SKILL_FEL_IMP = 927,
SKILL_VOIDLORD = 928,
SKILL_SHIVARRA = 929,
SKILL_OBSERVER = 930,
SKILL_WRATHGUARD = 931,
SKILL_ALL_SPECIALIZATIONS = 934,
SKILL_RUNEFORGING = 960,
SKILL_PET_PRIMAL_FIRE_ELEMENTAL = 962,
SKILL_PET_PRIMAL_EARTH_ELEMENTAL = 963,
SKILL_WAY_OF_THE_GRILL = 975,
SKILL_WAY_OF_THE_WOK = 976,
SKILL_WAY_OF_THE_POT = 977,
SKILL_WAY_OF_THE_STEAMER = 978,
SKILL_WAY_OF_THE_OVEN = 979,
SKILL_WAY_OF_THE_BREW = 980,
SKILL_APPRENTICE_COOKING = 981,
SKILL_JOURNEYMAN_COOKBOOK = 982,
SKILL_PET_RODENT = 983,
SKILL_PET_CRANE = 984,
SKILL_PET_WATER_STRIDER = 985,
SKILL_PET_EXOTIC_QUILEN = 986,
SKILL_PET_GOAT = 987,
SKILL_PET_BASILISK = 988,
SKILL_NO_PLAYERS = 999,
SKILL_PET_DIREHORN = 1305,
SKILL_PET_PRIMAL_STORM_ELEMENTAL = 1748,
SKILL_PET_WATER_ELEMENTAL_MINOR_TALENT_VERSION = 1777,
SKILL_PET_RIVERBEAST = 1819,
SKILL_UNUSED = 1830,
SKILL_DEMON_HUNTER = 1848,
SKILL_LOGGING = 1945,
SKILL_PET_TERRORGUARD = 1981,
SKILL_PET_ABYSSAL = 1982,
SKILL_PET_STAG = 1993,
SKILL_TRADING_POST = 2000,
SKILL_WARGLAIVES = 2152,
SKILL_PET_MECHANICAL = 2189,
SKILL_PET_ABOMINATION = 2216,
SKILL_PET_OXEN = 2279,
SKILL_PET_SCALEHIDE = 2280,
SKILL_PET_FEATHERMANE = 2361,
SKILL_RACIAL_NIGHTBORNE = 2419,
SKILL_RACIAL_HIGHMOUNTAIN_TAUREN = 2420,
SKILL_RACIAL_LIGHTFORGED_DRAENEI = 2421,
SKILL_RACIAL_VOID_ELF = 2423,
SKILL_KUL_TIRAN_BLACKSMITHING = 2437,
SKILL_LEGION_BLACKSMITHING = 2454,
SKILL_LANGUAGE_SHALASSIAN = 2464,
SKILL_LANGUAGE_THALASSIAN_2 = 2465,
SKILL_DRAENOR_BLACKSMITHING = 2472,
SKILL_PANDARIA_BLACKSMITHING = 2473,
SKILL_CATACLYSM_BLACKSMITHING = 2474,
SKILL_NORTHREND_BLACKSMITHING = 2475,
SKILL_OUTLAND_BLACKSMITHING = 2476,
SKILL_BLACKSMITHING_2 = 2477,
SKILL_KUL_TIRAN_ALCHEMY = 2478,
SKILL_LEGION_ALCHEMY = 2479,
SKILL_DRAENOR_ALCHEMY = 2480,
SKILL_PANDARIA_ALCHEMY = 2481,
SKILL_CATACLYSM_ALCHEMY = 2482,
SKILL_NORTHREND_ALCHEMY = 2483,
SKILL_OUTLAND_ALCHEMY = 2484,
SKILL_ALCHEMY_2 = 2485,
SKILL_KUL_TIRAN_ENCHANTING = 2486,
SKILL_LEGION_ENCHANTING = 2487,
SKILL_DRAENOR_ENCHANTING = 2488,
SKILL_PANDARIA_ENCHANTING = 2489,
SKILL_CATACLYSM_ENCHANTING = 2491,
SKILL_NORTHREND_ENCHANTING = 2492,
SKILL_OUTLAND_ENCHANTING = 2493,
SKILL_ENCHANTING_2 = 2494,
SKILL_KUL_TIRAN_ENGINEERING = 2499,
SKILL_LEGION_ENGINEERING = 2500,
SKILL_DRAENOR_ENGINEERING = 2501,
SKILL_PANDARIA_ENGINEERING = 2502,
SKILL_CATACLYSM_ENGINEERING = 2503,
SKILL_NORTHREND_ENGINEERING = 2504,
SKILL_OUTLAND_ENGINEERING = 2505,
SKILL_ENGINEERING_2 = 2506,
SKILL_KUL_TIRAN_INSCRIPTION = 2507,
SKILL_LEGION_INSCRIPTION = 2508,
SKILL_DRAENOR_INSCRIPTION = 2509,
SKILL_PANDARIA_INSCRIPTION = 2510,
SKILL_CATACLYSM_INSCRIPTION = 2511,
SKILL_NORTHREND_INSCRIPTION = 2512,
SKILL_OUTLAND_INSCRIPTION = 2513,
SKILL_INSCRIPTION_2 = 2514,
SKILL_KUL_TIRAN_JEWELCRAFTING = 2517,
SKILL_LEGION_JEWELCRAFTING = 2518,
SKILL_DRAENOR_JEWELCRAFTING = 2519,
SKILL_PANDARIA_JEWELCRAFTING = 2520,
SKILL_CATACLYSM_JEWELCRAFTING = 2521,
SKILL_NORTHREND_JEWELCRAFTING = 2522,
SKILL_OUTLAND_JEWELCRAFTING = 2523,
SKILL_JEWELCRAFTING_2 = 2524,
SKILL_KUL_TIRAN_LEATHERWORKING = 2525,
SKILL_LEGION_LEATHERWORKING = 2526,
SKILL_DRAENOR_LEATHERWORKING = 2527,
SKILL_PANDARIA_LEATHERWORKING = 2528,
SKILL_CATACLYSM_LEATHERWORKING = 2529,
SKILL_NORTHREND_LEATHERWORKING = 2530,
SKILL_OUTLAND_LEATHERWORKING = 2531,
SKILL_LEATHERWORKING_2 = 2532,
SKILL_KUL_TIRAN_TAILORING = 2533,
SKILL_LEGION_TAILORING = 2534,
SKILL_DRAENOR_TAILORING = 2535,
SKILL_PANDARIA_TAILORING = 2536,
SKILL_CATACLYSM_TAILORING = 2537,
SKILL_NORTHREND_TAILORING = 2538,
SKILL_OUTLAND_TAILORING = 2539,
SKILL_TAILORING_2 = 2540,
SKILL_KUL_TIRAN_COOKING = 2541,
SKILL_LEGION_COOKING = 2542,
SKILL_DRAENOR_COOKING = 2543,
SKILL_PANDARIA_COOKING = 2544,
SKILL_CATACLYSM_COOKING = 2545,
SKILL_NORTHREND_COOKING = 2546,
SKILL_OUTLAND_COOKING = 2547,
SKILL_COOKING_2 = 2548,
SKILL_KUL_TIRAN_HERBALISM = 2549,
SKILL_LEGION_HERBALISM = 2550,
SKILL_DRAENOR_HERBALISM = 2551,
SKILL_PANDARIA_HERBALISM = 2552,
SKILL_CATACLYSM_HERBALISM = 2553,
SKILL_NORTHREND_HERBALISM = 2554,
SKILL_OUTLAND_HERBALISM = 2555,
SKILL_HERBALISM_2 = 2556,
SKILL_KUL_TIRAN_SKINNING = 2557,
SKILL_LEGION_SKINNING = 2558,
SKILL_DRAENOR_SKINNING = 2559,
SKILL_PANDARIA_SKINNING = 2560,
SKILL_CATACLYSM_SKINNING = 2561,
SKILL_NORTHREND_SKINNING = 2562,
SKILL_OUTLAND_SKINNING = 2563,
SKILL_SKINNING_2 = 2564,
SKILL_KUL_TIRAN_MINING = 2565,
SKILL_LEGION_MINING = 2566,
SKILL_DRAENOR_MINING = 2567,
SKILL_PANDARIA_MINING = 2568,
SKILL_CATACLYSM_MINING = 2569,
SKILL_NORTHREND_MINING = 2570,
SKILL_OUTLAND_MINING = 2571,
SKILL_MINING_2 = 2572,
SKILL_KUL_TIRAN_FISHING = 2585,
SKILL_LEGION_FISHING = 2586,
SKILL_DRAENOR_FISHING = 2587,
SKILL_PANDARIA_FISHING = 2588,
SKILL_CATACLYSM_FISHING = 2589,
SKILL_NORTHREND_FISHING = 2590,
SKILL_OUTLAND_FISHING = 2591,
SKILL_FISHING_2 = 2592,
SKILL_RACIAL_DARK_IRON_DWARF = 2597,
SKILL_RACIAL_MAG_HAR_ORC = 2598,
SKILL_PET_LIZARD = 2703,
SKILL_PET_HORSE = 2704,
SKILL_PET_EXOTIC_PTERRORDAX = 2705,
SKILL_PET_TOAD = 2706,
SKILL_PET_EXOTIC_KROLUSK = 2707,
SKILL_SECOND_PET_HUNTER = 2716,
SKILL_PET_BLOOD_BEAST = 2719,
SKILL_JUNKYARD_TINKERING = 2720,
SKILL_RACIAL_ZANDALARI_TROLL = 2721,
SKILL_RACIAL_KUL_TIRAN = 2723,
SKILL_ALL_CLASS = 2727,
SKILL_KYRIAN = 2730,
SKILL_VENTHYR = 2731,
SKILL_NIGHT_FAE = 2732,
SKILL_NECROLORD = 2733,
SKILL_MOUNT_EQUIPMENT = 2734,
SKILL_SHADOWLANDS_ALCHEMY = 2750,
SKILL_SHADOWLANDS_BLACKSMITHING = 2751,
SKILL_SHADOWLANDS_COOKING = 2752,
SKILL_SHADOWLANDS_ENCHANTING = 2753,
SKILL_SHADOWLANDS_FISHING = 2754,
SKILL_SHADOWLANDS_ENGINEERING = 2755,
SKILL_SHADOWLANDS_INSCRIPTION = 2756,
SKILL_SHADOWLANDS_JEWELCRAFTING = 2757,
SKILL_SHADOWLANDS_LEATHERWORKING = 2758,
SKILL_SHADOWLANDS_TAILLORING = 2759,
SKILL_SHADOWLANDS_HERBALISM = 2760,
SKILL_SHADOWLANDS_MINING = 2761,
SKILL_SHADOWLANDS_SKINNING = 2762,
SKILL_RACIAL_DARK_IRON_DWARF_2 = 2773,
SKILL_RACIAL_MECHGNOME = 2774,
SKILL_RACIAL_VULPERA = 2775,
SKILL_LANGUAGE_VULPERA = 2776,
SKILL_SOUL_CYPHERING = 2777,
SKILL_ABOMINABLE_STICHING = 2787,
SKILL_ASCENSION_CRAFTING = 2791,
SKILL_PET_MAMMOTH = 2805,
SKILL_PET_COURSER = 2806,
SKILL_PET_CAMEL = 2807
};
inline SkillType SkillByLockType(LockType locktype)
{
switch (locktype)
{
case LOCKTYPE_HERBALISM: return SKILL_HERBALISM;
case LOCKTYPE_MINING: return SKILL_MINING;
case LOCKTYPE_FISHING: return SKILL_FISHING;
case LOCKTYPE_INSCRIPTION: return SKILL_INSCRIPTION;
case LOCKTYPE_ARCHAEOLOGY: return SKILL_ARCHAEOLOGY;
case LOCKTYPE_LUMBER_MILL: return SKILL_LOGGING;
case LOCKTYPE_CLASSIC_HERBALISM: return SKILL_HERBALISM_2;
case LOCKTYPE_OUTLAND_HERBALISM: return SKILL_OUTLAND_HERBALISM;
case LOCKTYPE_NORTHREND_HERBALISM: return SKILL_NORTHREND_HERBALISM;
case LOCKTYPE_CATACLYSM_HERBALISM: return SKILL_CATACLYSM_HERBALISM;
case LOCKTYPE_PANDARIA_HERBALISM: return SKILL_PANDARIA_HERBALISM;
case LOCKTYPE_DRAENOR_HERBALISM: return SKILL_DRAENOR_HERBALISM;
case LOCKTYPE_LEGION_HERBALISM: return SKILL_LEGION_HERBALISM;
case LOCKTYPE_KUL_TIRAN_HERBALISM: return SKILL_KUL_TIRAN_HERBALISM;
case LOCKTYPE_CLASSIC_MINING: return SKILL_MINING_2;
case LOCKTYPE_OUTLAND_MINING: return SKILL_OUTLAND_MINING;
case LOCKTYPE_NORTHREND_MINING: return SKILL_NORTHREND_MINING;
case LOCKTYPE_CATACLYSM_MINING: return SKILL_CATACLYSM_MINING;
case LOCKTYPE_PANDARIA_MINING: return SKILL_PANDARIA_MINING;
case LOCKTYPE_DRAENOR_MINING: return SKILL_DRAENOR_MINING;
case LOCKTYPE_LEGION_MINING: return SKILL_LEGION_MINING;
case LOCKTYPE_KUL_TIRAN_MINING: return SKILL_KUL_TIRAN_MINING;
default: break;
}
return SKILL_NONE;
}
inline uint32 SkillByQuestSort(int32 QuestSort)
{
switch (QuestSort)
{
case QUEST_SORT_HERBALISM: return SKILL_HERBALISM;
case QUEST_SORT_FISHING: return SKILL_FISHING;
case QUEST_SORT_BLACKSMITHING: return SKILL_BLACKSMITHING;
case QUEST_SORT_ALCHEMY: return SKILL_ALCHEMY;
case QUEST_SORT_LEATHERWORKING: return SKILL_LEATHERWORKING;
case QUEST_SORT_ENGINEERING: return SKILL_ENGINEERING;
case QUEST_SORT_TAILORING: return SKILL_TAILORING;
case QUEST_SORT_COOKING: return SKILL_COOKING;
case QUEST_SORT_JEWELCRAFTING: return SKILL_JEWELCRAFTING;
case QUEST_SORT_INSCRIPTION: return SKILL_INSCRIPTION;
case QUEST_SORT_ARCHAEOLOGY: return SKILL_ARCHAEOLOGY;
}
return 0;
}
enum SkillCategory
{
SKILL_CATEGORY_UNK1 = 0,
SKILL_CATEGORY_ATTRIBUTES = 5,
SKILL_CATEGORY_WEAPON = 6,
SKILL_CATEGORY_CLASS = 7,
SKILL_CATEGORY_ARMOR = 8,
SKILL_CATEGORY_SECONDARY = 9, // secondary professions
SKILL_CATEGORY_LANGUAGES = 10,
SKILL_CATEGORY_PROFESSION = 11, // primary professions
SKILL_CATEGORY_GENERIC = 12
};
// TotemCategory.dbc (9.0.2)
enum TotemCategory
{
TC_SKINNING_SKIFE_OLD = 1,
TC_EARTH_TOTEM = 2,
TC_AIR_TOTEM = 3,
TC_FIRE_TOTEM = 4,
TC_WATER_TOTEM = 5,
TC_COPPER_ROD = 6,
TC_SILVER_ROD = 7,
TC_GOLDEN_ROD = 8,
TC_TRUESILVER_ROD = 9,
TC_ARCANITE_ROD = 10,
TC_MINING_PICK_OLD = 11,
TC_PHILOSOPHERS_STONE = 12,
TC_BLACKSMITH_HAMMER_OLD = 13,
TC_ARCLIGHT_SPANNER = 14,
TC_GYROMATIC_MA = 15,
TC_MASTER_TOTEM = 21,
TC_FEL_IRON_ROD = 41,
TC_ADAMANTITE_ROD = 62,
TC_ETERNIUM_ROD = 63,
TC_HOLLOW_QUILL = 81,
TC_RUNED_AZURITE_ROD = 101,
TC_VIRTUOSO_INKING_SET = 121,
TC_DRUMS = 141,
TC_GNOMISH_ARMY_KNIFE = 161,
TC_BLACKSMITH_HAMMER = 162,
TC_MINING_PICK = 165,
TC_SKINNING_KNIFE = 166,
TC_HAMMER_PICK = 167,
TC_BLADED_PICKAXE = 168,
TC_FLINT_AND_TINDER = 169,
TC_RUNED_COBALT_ROD = 189,
TC_RUNED_TITANIUM_ROD = 190,
TC_RUNED_ELEMENTIUM_ROD = 209,
TC_HIGH_POWERED_BOLT_GUN = 210,
TC_RUNED_COPPER_ROD = 230,
TC_JEWELERS_KIT = 238,
TC_ULTIMATE_GNOMISH_ARMY_KNIFE = 250,
TC_SANGUINE_FEATHER_QUILL_OF_LANA_THEL = 253,
TC_UB3R_SPANNER = 354,
TC_VOID_FOCUS = 355,
TC_EMPOWERED_VOID_FOCUS = 356,
TC_UNLEASHED_VOID_FOCUS = 357,
TC_MASTERCRAFT = 358,
TC_VIRTUOSO_ENGRAVING_SET = 359
};
enum UnitDynFlags
{
UNIT_DYNFLAG_NONE = 0x0000,
UNIT_DYNFLAG_HIDE_MODEL = 0x0002, // Object model is not shown with this flag
UNIT_DYNFLAG_LOOTABLE = 0x0004,
UNIT_DYNFLAG_TRACK_UNIT = 0x0008,
UNIT_DYNFLAG_TAPPED = 0x0010, // Lua_UnitIsTapped
UNIT_DYNFLAG_SPECIALINFO = 0x0020,
UNIT_DYNFLAG_DEAD = 0x0040,
UNIT_DYNFLAG_REFER_A_FRIEND = 0x0080
};
enum CorpseDynFlags
{
CORPSE_DYNFLAG_LOOTABLE = 0x0001
};
#define PLAYER_CORPSE_LOOT_ENTRY 1
enum WeatherType
{
WEATHER_TYPE_FINE = 0,
WEATHER_TYPE_RAIN = 1,
WEATHER_TYPE_SNOW = 2,
WEATHER_TYPE_STORM = 3,
WEATHER_TYPE_THUNDERS = 86,
WEATHER_TYPE_BLACKRAIN = 90
};
#define MAX_WEATHER_TYPE 4
enum ChatMsg : int32
{
CHAT_MSG_ADDON = -1,
CHAT_MSG_SYSTEM = 0x00,
CHAT_MSG_SAY = 0x01,
CHAT_MSG_PARTY = 0x02,
CHAT_MSG_RAID = 0x03,
CHAT_MSG_GUILD = 0x04,
CHAT_MSG_OFFICER = 0x05,
CHAT_MSG_YELL = 0x06,
CHAT_MSG_WHISPER = 0x07,
CHAT_MSG_WHISPER_FOREIGN = 0x08,
CHAT_MSG_WHISPER_INFORM = 0x09,
CHAT_MSG_EMOTE = 0x0A,
CHAT_MSG_TEXT_EMOTE = 0x0B,
CHAT_MSG_MONSTER_SAY = 0x0C,
CHAT_MSG_MONSTER_PARTY = 0x0D,
CHAT_MSG_MONSTER_YELL = 0x0E,
CHAT_MSG_MONSTER_WHISPER = 0x0F,
CHAT_MSG_MONSTER_EMOTE = 0x10,
CHAT_MSG_CHANNEL = 0x11,
CHAT_MSG_CHANNEL_JOIN = 0x12,
CHAT_MSG_CHANNEL_LEAVE = 0x13,
CHAT_MSG_CHANNEL_LIST = 0x14,
CHAT_MSG_CHANNEL_NOTICE = 0x15,
CHAT_MSG_CHANNEL_NOTICE_USER = 0x16,
CHAT_MSG_AFK = 0x17,
CHAT_MSG_DND = 0x18,
CHAT_MSG_IGNORED = 0x19,
CHAT_MSG_SKILL = 0x1A,
CHAT_MSG_LOOT = 0x1B,
CHAT_MSG_MONEY = 0x1C,
CHAT_MSG_OPENING = 0x1D,
CHAT_MSG_TRADESKILLS = 0x1E,
CHAT_MSG_PET_INFO = 0x1F,
CHAT_MSG_COMBAT_MISC_INFO = 0x20,
CHAT_MSG_COMBAT_XP_GAIN = 0x21,
CHAT_MSG_COMBAT_HONOR_GAIN = 0x22,
CHAT_MSG_COMBAT_FACTION_CHANGE = 0x23,
CHAT_MSG_BG_SYSTEM_NEUTRAL = 0x24,
CHAT_MSG_BG_SYSTEM_ALLIANCE = 0x25,
CHAT_MSG_BG_SYSTEM_HORDE = 0x26,
CHAT_MSG_RAID_LEADER = 0x27,
CHAT_MSG_RAID_WARNING = 0x28,
CHAT_MSG_RAID_BOSS_EMOTE = 0x29,
CHAT_MSG_RAID_BOSS_WHISPER = 0x2A,
CHAT_MSG_FILTERED = 0x2B,
CHAT_MSG_RESTRICTED = 0x2C,
CHAT_MSG_BATTLENET = 0x2D,
CHAT_MSG_ACHIEVEMENT = 0x2E,
CHAT_MSG_GUILD_ACHIEVEMENT = 0x2F,
CHAT_MSG_ARENA_POINTS = 0x30,
CHAT_MSG_PARTY_LEADER = 0x31,
CHAT_MSG_TARGETICONS = 0x32,
CHAT_MSG_BN_WHISPER = 0x33,
CHAT_MSG_BN_WHISPER_INFORM = 0x34,
CHAT_MSG_BN_CONVERSATION = 0x35,
CHAT_MSG_BN_CONVERSATION_NOTICE = 0x36,
CHAT_MSG_BN_CONVERSATION_LIST = 0x37,
CHAT_MSG_BN_INLINE_TOAST_ALERT = 0x38,
CHAT_MSG_BN_INLINE_TOAST_BROADCAST = 0x39,
CHAT_MSG_BN_INLINE_TOAST_BROADCAST_INFORM = 0x3A,
CHAT_MSG_BN_INLINE_TOAST_CONVERSATION = 0x3B,
CHAT_MSG_BN_WHISPER_PLAYER_OFFLINE = 0x3C,
CHAT_MSG_COMBAT_GUILD_XP_GAIN = 0x3D,
CHAT_MSG_CURRENCY = 0x3E,
CHAT_MSG_QUEST_BOSS_EMOTE = 0x3F,
CHAT_MSG_PET_BATTLE_COMBAT_LOG = 0x40,
CHAT_MSG_PET_BATTLE_INFO = 0x41,
CHAT_MSG_INSTANCE_CHAT = 0x42,
CHAT_MSG_INSTANCE_CHAT_LEADER = 0x43,
MAX_CHAT_MSG_TYPE
};
#define GM_SILENCE_AURA 1852
enum ChatFlags
{
CHAT_FLAG_NONE = 0x00,
CHAT_FLAG_AFK = 0x01,
CHAT_FLAG_DND = 0x02,
CHAT_FLAG_GM = 0x04,
CHAT_FLAG_COM = 0x08, // Commentator
CHAT_FLAG_DEV = 0x10,
CHAT_FLAG_BOSS_SOUND = 0x20, // Plays "RaidBossEmoteWarning" sound on raid boss emote/whisper
CHAT_FLAG_MOBILE = 0x40
};
enum ChatLinkColors
{
CHAT_LINK_COLOR_TRADE = 0xffffd000, // orange
CHAT_LINK_COLOR_TALENT = 0xff4e96f7, // blue
CHAT_LINK_COLOR_SPELL = 0xff71d5ff, // bright blue
CHAT_LINK_COLOR_ENCHANT = 0xffffd000, // orange
CHAT_LINK_COLOR_ACHIEVEMENT = 0xffffff00,
CHAT_LINK_COLOR_GLYPH = 0xff66bbff
};
// Values from ItemPetFood (power of (value-1) used for compare with CreatureFamilyEntry.petDietMask
enum PetDiet
{
PET_DIET_MEAT = 1,
PET_DIET_FISH = 2,
PET_DIET_CHEESE = 3,
PET_DIET_BREAD = 4,
PET_DIET_FUNGAS = 5,
PET_DIET_FRUIT = 6,
PET_DIET_RAW_MEAT = 7,
PET_DIET_RAW_FISH = 8
};
#define MAX_PET_DIET 9
#define CHAIN_SPELL_JUMP_RADIUS 8
enum GuildLogs
{
GUILD_BANKLOG_MAX_RECORDS = 25,
GUILD_EVENTLOG_MAX_RECORDS = 100,
GUILD_NEWSLOG_MAX_RECORDS = 250
};
enum AiReaction
{
AI_REACTION_ALERT = 0, // pre-aggro (used in client packet handler)
AI_REACTION_FRIENDLY = 1, // (NOT used in client packet handler)
AI_REACTION_HOSTILE = 2, // sent on every attack, triggers aggro sound (used in client packet handler)
AI_REACTION_AFRAID = 3, // seen for polymorph (when AI not in control of self?) (NOT used in client packet handler)
AI_REACTION_DESTROY = 4 // used on object destroy (NOT used in client packet handler)
};
// Diminishing Returns Types
enum DiminishingReturnsType
{
DRTYPE_NONE = 0, // this spell is not diminished, but may have its duration limited
DRTYPE_PLAYER = 1, // this spell is diminished only when applied on players
DRTYPE_ALL = 2 // this spell is diminished in every case
};
// Diminishing Return Groups
enum DiminishingGroup : uint16
{
DIMINISHING_NONE = 0,
DIMINISHING_ROOT = 1,
DIMINISHING_STUN = 2,
DIMINISHING_INCAPACITATE = 3,
DIMINISHING_DISORIENT = 4,
DIMINISHING_SILENCE = 5,
DIMINISHING_AOE_KNOCKBACK = 6,
DIMINISHING_TAUNT = 7,
DIMINISHING_LIMITONLY = 8,
DIMINISHING_MAX
};
enum SummonCategory
{
SUMMON_CATEGORY_WILD = 0,
SUMMON_CATEGORY_ALLY = 1,
SUMMON_CATEGORY_PET = 2,
SUMMON_CATEGORY_PUPPET = 3,
SUMMON_CATEGORY_VEHICLE = 4,
SUMMON_CATEGORY_UNK = 5 // as of patch 3.3.5a only Bone Spike in Icecrown Citadel
// uses this category
};
enum class SummonTitle : int32
{
None = 0,
Pet = 1,
Guardian = 2,
Minion = 3,
Totem = 4,
Companion = 5,
Runeblade = 6,
Construct = 7,
Opponent = 8, // Related to phases and DK prequest line (3.3.5a)
Vehicle = 9,
Mount = 10, // Oculus and Argent Tournament vehicles (3.3.5a)
Lightwell = 11,
Butler = 12,
aka = 13,
Gateway = 14,
Hatred = 15,
Statue = 16,
Spirit = 17,
WarBanner = 18,
Heartwarmer = 19,
HiredBy = 20,
PurchasedBy = 21,
Pride = 22,
TwistedImage = 23,
NoodleCart = 24,
InnerDemon = 25,
Bodyguard = 26,
Name = 27,
Squire = 28,
Champion = 29,
TheBetrayer = 30,
EruptingReflection = 31,
HopelessReflection = 32,
MalignantReflection = 33,
WailingReflection = 34,
Assistant = 35,
Enforcer = 36,
Recruit = 37,
Admirer = 38,
EvilTwin = 39,
Greed = 40,
LostMind = 41,
ServantOfNZoth = 44
};
enum EventId
{
EVENT_CHARGE = 1003,
EVENT_JUMP = 1004,
/// Special charge event which is used for charge spells that have explicit targets
/// and had a path already generated - using it in PointMovementGenerator will not
/// create a new spline and launch it
EVENT_CHARGE_PREPATH = 1005
};
enum ResponseCodes
{
RESPONSE_SUCCESS = 0,
RESPONSE_FAILURE = 1,
RESPONSE_CANCELLED = 2,
RESPONSE_DISCONNECTED = 3,
RESPONSE_FAILED_TO_CONNECT = 4,
RESPONSE_CONNECTED = 5,
RESPONSE_VERSION_MISMATCH = 6,
CSTATUS_CONNECTING = 7,
CSTATUS_NEGOTIATING_SECURITY = 8,
CSTATUS_NEGOTIATION_COMPLETE = 9,
CSTATUS_NEGOTIATION_FAILED = 10,
CSTATUS_AUTHENTICATING = 11,
REALM_LIST_IN_PROGRESS = 12,
REALM_LIST_SUCCESS = 13,
REALM_LIST_FAILED = 14,
REALM_LIST_INVALID = 15,
REALM_LIST_REALM_NOT_FOUND = 16,
ACCOUNT_CREATE_IN_PROGRESS = 17,
ACCOUNT_CREATE_SUCCESS = 18,
ACCOUNT_CREATE_FAILED = 19,
CHAR_LIST_RETRIEVING = 20,
CHAR_LIST_RETRIEVED = 21,
CHAR_LIST_FAILED = 22,
CHAR_CREATE_IN_PROGRESS = 23,
CHAR_CREATE_SUCCESS = 24,
CHAR_CREATE_ERROR = 25,
CHAR_CREATE_FAILED = 26,
CHAR_CREATE_NAME_IN_USE = 27,
CHAR_CREATE_DISABLED = 28,
CHAR_CREATE_PVP_TEAMS_VIOLATION = 29,
CHAR_CREATE_SERVER_LIMIT = 30,
CHAR_CREATE_ACCOUNT_LIMIT = 31,
CHAR_CREATE_SERVER_QUEUE = 32,
CHAR_CREATE_ONLY_EXISTING = 33,
CHAR_CREATE_EXPANSION = 34,
CHAR_CREATE_EXPANSION_CLASS = 35,
CHAR_CREATE_CHARACTER_IN_GUILD = 36,
CHAR_CREATE_RESTRICTED_RACECLASS = 37,
CHAR_CREATE_CHARACTER_CHOOSE_RACE = 38,
CHAR_CREATE_CHARACTER_ARENA_LEADER = 39,
CHAR_CREATE_CHARACTER_DELETE_MAIL = 40,
CHAR_CREATE_CHARACTER_SWAP_FACTION = 41,
CHAR_CREATE_CHARACTER_RACE_ONLY = 42,
CHAR_CREATE_CHARACTER_GOLD_LIMIT = 43,
CHAR_CREATE_FORCE_LOGIN = 44,
CHAR_CREATE_TRIAL = 45,
CHAR_CREATE_TIMEOUT = 46,
CHAR_CREATE_THROTTLE = 47,
CHAR_CREATE_ALLIED_RACE_ACHIEVEMENT = 48,
CHAR_CREATE_CHARACTER_IN_COMMUNITY = 49,
CHAR_CREATE_NEW_PLAYER = 50,
CHAR_DELETE_IN_PROGRESS = 51,
CHAR_DELETE_SUCCESS = 52,
CHAR_DELETE_FAILED = 53,
CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER = 54,
CHAR_DELETE_FAILED_GUILD_LEADER = 55,
CHAR_DELETE_FAILED_ARENA_CAPTAIN = 56,
CHAR_DELETE_FAILED_HAS_HEIRLOOM_OR_MAIL = 57,
CHAR_DELETE_FAILED_UPGRADE_IN_PROGRESS = 58,
CHAR_DELETE_FAILED_HAS_WOW_TOKEN = 59,
CHAR_DELETE_FAILED_VAS_TRANSACTION_IN_PROGRESS = 60,
CHAR_DELETE_FAILED_COMMUNITY_OWNER = 61,
CHAR_LOGIN_IN_PROGRESS = 62,
CHAR_LOGIN_SUCCESS = 63,
CHAR_LOGIN_NO_WORLD = 64,
CHAR_LOGIN_DUPLICATE_CHARACTER = 65,
CHAR_LOGIN_NO_INSTANCES = 66,
CHAR_LOGIN_FAILED = 67,
CHAR_LOGIN_DISABLED = 68,
CHAR_LOGIN_NO_CHARACTER = 69,
CHAR_LOGIN_LOCKED_FOR_TRANSFER = 70,
CHAR_LOGIN_LOCKED_BY_BILLING = 71,
CHAR_LOGIN_LOCKED_BY_MOBILE_AH = 72,
CHAR_LOGIN_TEMPORARY_GM_LOCK = 73,
CHAR_LOGIN_LOCKED_BY_CHARACTER_UPGRADE = 74,
CHAR_LOGIN_LOCKED_BY_REVOKED_CHARACTER_UPGRADE = 75,
CHAR_LOGIN_LOCKED_BY_REVOKED_VAS_TRANSACTION = 76,
CHAR_LOGIN_LOCKED_BY_RESTRICTION = 77,
CHAR_NAME_SUCCESS = 78,
CHAR_NAME_FAILURE = 79,
CHAR_NAME_NO_NAME = 80,
CHAR_NAME_TOO_SHORT = 81,
CHAR_NAME_TOO_LONG = 82,
CHAR_NAME_INVALID_CHARACTER = 83,
CHAR_NAME_MIXED_LANGUAGES = 84,
CHAR_NAME_PROFANE = 85,
CHAR_NAME_RESERVED = 86,
CHAR_NAME_INVALID_APOSTROPHE = 87,
CHAR_NAME_MULTIPLE_APOSTROPHES = 88,
CHAR_NAME_THREE_CONSECUTIVE = 89,
CHAR_NAME_INVALID_SPACE = 90,
CHAR_NAME_CONSECUTIVE_SPACES = 91,
CHAR_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 92,
CHAR_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 93,
CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 94,
CHAR_NAME_SPACES_DISALLOWED = 95
};
enum CharacterUndeleteResult
{
CHARACTER_UNDELETE_RESULT_OK = 0,
CHARACTER_UNDELETE_RESULT_ERROR_COOLDOWN = 1,
CHARACTER_UNDELETE_RESULT_ERROR_CHAR_CREATE = 2,
CHARACTER_UNDELETE_RESULT_ERROR_DISABLED = 3,
CHARACTER_UNDELETE_RESULT_ERROR_NAME_TAKEN_BY_THIS_ACCOUNT = 4,
CHARACTER_UNDELETE_RESULT_ERROR_UNKNOWN = 5
};
enum CharacterUpgrade
{
CHARACTER_UPGRADE_RESULT_OK = 1,
CHARACTER_UPGRADE_RESULT_DB_ERROR = 2,
CHARACTER_UPGRADE_RESULT_TRIAL_THROTTLE_HOUR = 3,
CHARACTER_UPGRADE_RESULT_TRIAL_THROTTLE_DAY = 4,
CHARACTER_UPGRADE_RESULT_TRIAL_THROTTLE_WEEK = 5,
CHARACTER_UPGRADE_RESULT_TRIAL_THROTTLE_ACCOUNT = 6,
CHARACTER_UPGRADE_RESULT_BOX_LEVEL = 7,
CHARACTER_UPGRADE_RESULT_TRIAL_BOOST_DISABLED = 8,
CHARACTER_UPGRADE_RESULT_TRIAL_ACCOUNT = 9,
CHARACTER_UPGRADE_RESULT_UPGRADE_PENDING = 10,
CHARACTER_UPGRADE_RESULT_INVALID_CHARACTER = 11,
CHARACTER_UPGRADE_RESULT_NOT_FRESH_CHARACTER = 12,
NUM_CHARACTER_UPGRADE_RESULT = 13
};
/// Ban function modes
enum BanMode
{
BAN_ACCOUNT,
BAN_CHARACTER,
BAN_IP
};
/// Ban function return codes
enum BanReturn
{
BAN_SUCCESS,
BAN_SYNTAX_ERROR,
BAN_NOTFOUND,
BAN_EXISTS
};
enum BattlegroundTeamId : uint8
{
BG_TEAM_HORDE = 0, // Battleground: Horde, Arena: Green
BG_TEAM_ALLIANCE = 1, // Battleground: Alliance, Arena: Gold
BG_TEAM_NEUTRAL = 2 // Battleground: Neutral, Arena: None
};
#define BG_TEAMS_COUNT 2
// Indexes of BattlemasterList.db2 (9.0.2.37176)
enum BattlegroundTypeId : uint32
{
BATTLEGROUND_TYPE_NONE = 0, // None
BATTLEGROUND_AV = 1, // Alterac Valley
BATTLEGROUND_WS = 2, // Warsong Gulch
BATTLEGROUND_AB = 3, // Arathi Basin
BATTLEGROUND_NA = 4, // Nagrand Arena
BATTLEGROUND_BE = 5, // Blade's Edge Arena
BATTLEGROUND_AA = 6, // All Arenas
BATTLEGROUND_EY = 7, // Eye of the Storm
BATTLEGROUND_RL = 8, // Ruins of Lordaernon
BATTLEGROUND_SA = 9, // Strand of the Ancients
BATTLEGROUND_DS = 10, // Dalaran Sewers
BATTLEGROUND_RV = 11, // The Ring of Valor
BATTLEGROUND_IC = 30, // Isle of Conquest
BATTLEGROUND_RB = 32, // Random Battleground
BATTLEGROUND_RATED_10_VS_10 = 100, // Rated Battleground 10 vs 10
BATTLEGROUND_RATED_15_VS_15 = 101, // Rated Battleground 15 vs 15
BATTLEGROUND_RATED_25_VS_25 = 102, // Rated Battleground 25 vs 25
BATTLEGROUND_TP = 108, // Twin Peaks
BATTLEGROUND_BFG = 120, // Battle For Gilneas
// 656 = "Rated Eye of the Storm"
BATTLEGROUND_TK = 699, // Temple of Kotmogu
// 706 = "CTF3"
BATTLEGROUND_SM = 708, // Silvershard Mines
BATTLEGROUND_TVA = 719, // Tol'Viron Arena
BATTLEGROUND_DG = 754, // Deepwind Gorge
BATTLEGROUND_TTP = 757, // The Tiger's Peak
BATTLEGROUND_SS_VS_TM = 789, // Southshore vs. Tarren Mill
BATTLEGROUND_SMALL_D = 803, // Small Battleground D
BATTLEGROUND_BRH = 808, // Black Rook Hold Arena
BATTLEGROUND_NNA = 809, // New Nagrand Arena (Legion)
BATTLEGROUND_AF = 816, // Ashamane's Fall
BATTLEGROUND_BEG = 844, //New Blade's Edge Arena (Legion)
BATTLEGROUND_BRAWL_TBG = 846, // Brawl - The Battle for Gilneas (Old City Map)
BATTLEGROUND_BRAWL_ABW = 847, // Brawl - Arathi Basin Winter
// 848 = "AI Test - Arathi Basin"
BATTLEGROUND_BRAWL_DD = 849, // Brawl - Deepwind Dunk
BATTLEGROUND_BRAWL_SPS = 853, // Brawl - Shadow-Pan Showdown
// 856 = "[TEMP] RaceTrackBG"
BATTLEGROUND_BR = 857, // Blackrock
BATTLEGROUND_BRAWL_TH = 858, // Brawl - Temple of Hotmogu
BATTLEGROUND_BRAWL_GL = 859, // Brawl - Gravity Lapse
BATTLEGROUND_BRAWL_DD2 = 860, // Brawl - Deepwind Dunk
BATTLEGROUND_BRAWL_WS = 861, // Brawl - Warsong Scramble
BATTLEGROUND_BRAWL_EH = 862, // Brawl - Eye of the Horn
BATTLEGROUND_BRAWL_AA = 866, // Brawl - All Arenas
BATTLEGROUND_RL2 = 868, // Ruins of Lordaeron
BATTLEGROUND_DS2 = 869, // Dalaran Sewers
BATTLEGROUND_TVA2 = 870, // Tol'Viron Arena
BATTLEGROUND_TTP2 = 871, // The Tiger's Peak
BATTLEGROUND_BRHA2 = 872, // Black Rook Hold Arena
BATTLEGROUND_NA2 = 873, // Nagrand Arena
BATTLEGROUND_AF2 = 874, // Ashamane's Fall
BATTLEGROUND_BEA2 = 875, // Blade's Edge Arena
// 878 = "AI Test - Warsong Gulch"
BATTLEGROUND_BRAWL_DS = 879, // Brawl - Deep Six
BATTLEGROUND_BRAWL_AB = 880, // Brawl - Arathi Basin
BATTLEGROUND_BRAWL_DG = 881, // Brawl - Deepwind Gorge
BATTLEGROUND_BRAWL_ES = 882, // Brawl - Eye of the Storm
BATTLEGROUND_BRAWL_SM = 883, // Brawl - Silvershard Mines
BATTLEGROUND_BRAWL_TK = 884, // Brawl - Temple of Kotmogue
BATTLEGROUND_BRAWL_TBG2 = 885, // Brawl - The Battle for Gilneas
BATTLEGROUND_BRAWL_WG = 886, // Brawl - Warsong Gulch
BATTLEGROUND_CI = 887, // Cooking: Impossible
BATTLEGROUND_DOM_SS = 890, // Domination - Seething Strand
// 893 = "8.0 BG Temp"
BATTLEGROUND_SS = 894, // Seething Shore
BATTLEGROUND_HP = 897, // Hooking Point
BATTLEGROUND_RANDOM_EPIC = 901, // Random Epic Battleground
BATTLEGROUND_TTP3 = 902, // The Tiger's Peak
BATTLEGROUND_MB = 903, // Mugambala
BATTLEGROUND_BRAWL_AA2 = 904, // Brawl - All Arenas
BATTLEGROUND_BRAWL_AASH = 905, // Brawl - All Arenas - Stocked House
BATTLEGROUND_AF3 = 906, // Ashamane's Fall
BATTLEGROUND_BEA3 = 907, // Blade's Edge Arena
BATTLEGROUND_BE2 = 908, // Blade's Edge
BATTLEGROUND_DS3 = 909, // Dalaran Sewers
BATTLEGROUND_NA3 = 910, // Nagrand Arena
BATTLEGROUND_RL3 = 911, // Ruins of Lordaeron
BATTLEGROUND_TVA3 = 912, // Tol'Viron Arena
BATTLEGROUND_BRHA3 = 913, // Black Rook Hold Arena
BATTLEGROUND_WG_CTF = 1014, // Warsong Gulch Capture the Flag
BATTLEGROUND_EB_BW = 1017, // Epic Battleground - Battle for Wintergrasp
BATTLEGROUND_DOM_AB = 1018, // Domination - Arathi Basin
BATTLEGROUND_AB_CS = 1019, // Arathi Basin Comp Stomp
BATTLEGROUND_EB_A = 1020, // Epic Battleground - Ashran
BATTLEGROUND_CA = 1021, // Classic Ashran (Endless)
BATTLEGROUND_BRAWL_AB2 = 1022, // Brawl - Arathi Basin
BATTLEGROUND_TR = 1025, // The Robodrome (Arena)
BATTLEGROUND_RANDOM_BG = 1029, // Random Battleground
BATTLEGROUND_EB_BW2 = 1030, // Epic Battleground - Battle for Wintergrasp
// 1031 = "Programmer Map - Battlefield"
BATTLEGROUND_KR = 1033, // Korrak's Revenge
BATTLEGROUND_EPIC_BG_WF = 1036, // Epic Battleground - Warfront Arathi (PvP)
BATTLEGROUND_DOM_DG = 1037, // Domination - Deepwind Gorge
BATTLEGROUND_DOM_DG2 = 1039, // Domination - Deepwind Gorge
BATTLEGROUND_ED = 1041, // Empyrean Domain
};
#define MAX_BATTLEGROUND_TYPE_ID 1041
enum MailResponseType
{
MAIL_SEND = 0,
MAIL_MONEY_TAKEN = 1,
MAIL_ITEM_TAKEN = 2,
MAIL_RETURNED_TO_SENDER = 3,
MAIL_DELETED = 4,
MAIL_MADE_PERMANENT = 5
};
enum MailResponseResult
{
MAIL_OK = 0,
MAIL_ERR_EQUIP_ERROR = 1,
MAIL_ERR_CANNOT_SEND_TO_SELF = 2,
MAIL_ERR_NOT_ENOUGH_MONEY = 3,
MAIL_ERR_RECIPIENT_NOT_FOUND = 4,
MAIL_ERR_NOT_YOUR_TEAM = 5,
MAIL_ERR_INTERNAL_ERROR = 6,
MAIL_ERR_DISABLED_FOR_TRIAL_ACC = 14,
MAIL_ERR_RECIPIENT_CAP_REACHED = 15,
MAIL_ERR_CANT_SEND_WRAPPED_COD = 16,
MAIL_ERR_MAIL_AND_CHAT_SUSPENDED = 17,
MAIL_ERR_TOO_MANY_ATTACHMENTS = 18,
MAIL_ERR_MAIL_ATTACHMENT_INVALID = 19,
MAIL_ERR_ITEM_HAS_EXPIRED = 21
};
enum SpellFamilyNames : uint8
{
SPELLFAMILY_GENERIC = 0,
SPELLFAMILY_EVENTS = 1, // events, holidays
// 2 - unused
SPELLFAMILY_MAGE = 3,
SPELLFAMILY_WARRIOR = 4,
SPELLFAMILY_WARLOCK = 5,
SPELLFAMILY_PRIEST = 6,
SPELLFAMILY_DRUID = 7,
SPELLFAMILY_ROGUE = 8,
SPELLFAMILY_HUNTER = 9,
SPELLFAMILY_PALADIN = 10,
SPELLFAMILY_SHAMAN = 11,
SPELLFAMILY_UNK12 = 12, // 2 spells (silence resistance)
SPELLFAMILY_POTION = 13,
// 14 - unused
SPELLFAMILY_DEATHKNIGHT = 15,
// 16 - unused
SPELLFAMILY_PET = 17,
SPELLFAMILY_TOTEMS = 50,
SPELLFAMILY_MONK = 53,
SPELLFAMILY_WARLOCK_PET = 57,
SPELLFAMILY_UNK66 = 66,
SPELLFAMILY_UNK71 = 71,
SPELLFAMILY_UNK78 = 78,
SPELLFAMILY_UNK91 = 91,
SPELLFAMILY_UNK100 = 100,
SPELLFAMILY_DEMON_HUNTER = 107,
};
enum TradeStatus
{
TRADE_STATUS_PLAYER_BUSY = 0,
TRADE_STATUS_PROPOSED = 1,
TRADE_STATUS_INITIATED = 2,
TRADE_STATUS_CANCELLED = 3,
TRADE_STATUS_ACCEPTED = 4,
TRADE_STATUS_ALREADY_TRADING = 5,
TRADE_STATUS_NO_TARGET = 6,
TRADE_STATUS_UNACCEPTED = 7,
TRADE_STATUS_COMPLETE = 8,
TRADE_STATUS_STATE_CHANGED = 9,
TRADE_STATUS_TOO_FAR_AWAY = 10,
TRADE_STATUS_WRONG_FACTION = 11,
TRADE_STATUS_FAILED = 12,
TRADE_STATUS_PETITION = 13,
TRADE_STATUS_PLAYER_IGNORED = 14,
TRADE_STATUS_STUNNED = 15,
TRADE_STATUS_TARGET_STUNNED = 16,
TRADE_STATUS_DEAD = 17,
TRADE_STATUS_TARGET_DEAD = 18,
TRADE_STATUS_LOGGING_OUT = 19,
TRADE_STATUS_TARGET_LOGGING_OUT = 20,
TRADE_STATUS_RESTRICTED_ACCOUNT = 21,
TRADE_STATUS_WRONG_REALM = 22,
TRADE_STATUS_NOT_ON_TAPLIST = 23,
TRADE_STATUS_CURRENCY_NOT_TRADABLE = 24,
TRADE_STATUS_NOT_ENOUGH_CURRENCY = 25,
};
enum XPColorChar : uint8
{
XP_RED,
XP_ORANGE,
XP_YELLOW,
XP_GREEN,
XP_GRAY
};
enum RemoveMethod : uint8
{
GROUP_REMOVEMETHOD_DEFAULT = 0,
GROUP_REMOVEMETHOD_KICK = 1,
GROUP_REMOVEMETHOD_LEAVE = 2,
GROUP_REMOVEMETHOD_KICK_LFG = 3
};
enum ActivateTaxiReply
{
ERR_TAXIOK = 0,
ERR_TAXIUNSPECIFIEDSERVERERROR = 1,
ERR_TAXINOSUCHPATH = 2,
ERR_TAXINOTENOUGHMONEY = 3,
ERR_TAXITOOFARAWAY = 4,
ERR_TAXINOVENDORNEARBY = 5,
ERR_TAXINOTVISITED = 6,
ERR_TAXIPLAYERBUSY = 7,
ERR_TAXIPLAYERALREADYMOUNTED = 8,
ERR_TAXIPLAYERSHAPESHIFTED = 9,
ERR_TAXIPLAYERMOVING = 10,
ERR_TAXISAMENODE = 11,
ERR_TAXINOTSTANDING = 12
};
enum TaxiNodeStatus
{
TAXISTATUS_NONE = 0,
TAXISTATUS_LEARNED = 1,
TAXISTATUS_UNLEARNED = 2,
TAXISTATUS_NOT_ELIGIBLE = 3,
};
enum ProfessionUI
{
MAX_PRIMARY_PROFESSIONS = 2,
MAX_SECONDARY_SKILLS = 5
};
enum DuelCompleteType : uint8
{
DUEL_INTERRUPTED = 0,
DUEL_WON = 1,
DUEL_FLED = 2
};
// handle the queue types and bg types separately to enable joining queue for different sized arenas at the same time
enum BattlegroundQueueTypeId
{
BATTLEGROUND_QUEUE_NONE = 0,
BATTLEGROUND_QUEUE_AV = 1,
BATTLEGROUND_QUEUE_WS = 2,
BATTLEGROUND_QUEUE_AB = 3,
BATTLEGROUND_QUEUE_EY = 4,
BATTLEGROUND_QUEUE_SA = 5,
BATTLEGROUND_QUEUE_IC = 6,
BATTLEGROUND_QUEUE_TP = 7,
BATTLEGROUND_QUEUE_BFG = 8,
BATTLEGROUND_QUEUE_RB = 9,
BATTLEGROUND_QUEUE_2v2 = 10,
BATTLEGROUND_QUEUE_3v3 = 11,
BATTLEGROUND_QUEUE_5v5 = 12,
MAX_BATTLEGROUND_QUEUE_TYPES
};
enum GroupJoinBattlegroundResult
{
ERR_BATTLEGROUND_NONE = 0,
ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS = 2, // You cannot join the battleground yet because you or one of your party members is flagged as a Deserter.
ERR_ARENA_TEAM_PARTY_SIZE = 3, // Incorrect party size for this arena.
ERR_BATTLEGROUND_TOO_MANY_QUEUES = 4, // You can only be queued for 2 battles at once
ERR_BATTLEGROUND_CANNOT_QUEUE_FOR_RATED = 5, // You cannot queue for a rated match while queued for other battles
ERR_BATTLEDGROUND_QUEUED_FOR_RATED = 6, // You cannot queue for another battle while queued for a rated arena match
ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = 7, // Your team has left the arena queue
ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND = 8, // You can't do that in a battleground.
ERR_BATTLEGROUND_JOIN_XP_GAIN = 9, // wtf, doesn't exist in client...
ERR_BATTLEGROUND_JOIN_RANGE_INDEX = 10, // Cannot join the queue unless all members of your party are in the same battleground level range.
ERR_BATTLEGROUND_JOIN_TIMED_OUT = 11, // %s was unavailable to join the queue. (ObjectGuid exist in client cache)
//ERR_BATTLEGROUND_JOIN_TIMED_OUT = 12, // same as 11
//ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = 13, // same as 7
ERR_LFG_CANT_USE_BATTLEGROUND = 14, // You cannot queue for a battleground or arena while using the dungeon system.
ERR_IN_RANDOM_BG = 15, // Can't do that while in a Random Battleground queue.
ERR_IN_NON_RANDOM_BG = 16, // Can't queue for Random Battleground while in another Battleground queue.
ERR_BG_DEVELOPER_ONLY = 17,
ERR_BATTLEGROUND_INVITATION_DECLINED = 18,
ERR_MEETING_STONE_NOT_FOUND = 19,
ERR_WARGAME_REQUEST_FAILURE = 20,
ERR_BATTLEFIELD_TEAM_PARTY_SIZE = 22,
ERR_NOT_ON_TOURNAMENT_REALM = 23,
ERR_BATTLEGROUND_PLAYERS_FROM_DIFFERENT_REALMS = 24,
ERR_REMOVE_FROM_PVP_QUEUE_GRANT_LEVEL = 33,
ERR_REMOVE_FROM_PVP_QUEUE_FACTION_CHANGE = 34,
ERR_BATTLEGROUND_JOIN_FAILED = 35,
ERR_BATTLEGROUND_DUPE_QUEUE = 43,
ERR_BATTLEGROUND_JOIN_NO_VALID_SPEC_FOR_ROLE = 44,
ERR_BATTLEGROUND_JOIN_RESPEC = 45,
ERR_ALREADY_USING_LFG_LIST = 46,
ERR_BATTLEGROUND_JOIN_MUST_COMPLETE_QUEST = 47
};
enum PetNameInvalidReason
{
// custom, not send
PET_NAME_SUCCESS = 0,
PET_NAME_INVALID = 1,
PET_NAME_NO_NAME = 2,
PET_NAME_TOO_SHORT = 3,
PET_NAME_TOO_LONG = 4,
PET_NAME_MIXED_LANGUAGES = 6,
PET_NAME_PROFANE = 7,
PET_NAME_RESERVED = 8,
PET_NAME_THREE_CONSECUTIVE = 11,
PET_NAME_INVALID_SPACE = 12,
PET_NAME_CONSECUTIVE_SPACES = 13,
PET_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 14,
PET_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 15,
PET_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 16
};
enum DungeonStatusFlag
{
DUNGEON_STATUSFLAG_NORMAL = 0x01,
DUNGEON_STATUSFLAG_HEROIC = 0x02,
RAID_STATUSFLAG_10MAN_NORMAL = 0x01,
RAID_STATUSFLAG_25MAN_NORMAL = 0x02,
RAID_STATUSFLAG_10MAN_HEROIC = 0x04,
RAID_STATUSFLAG_25MAN_HEROIC = 0x08
};
enum VoidStorageConstants
{
VOID_STORAGE_UNLOCK_COST = 100 * GOLD,
VOID_STORAGE_STORE_ITEM_COST = 10 * GOLD,
VOID_STORAGE_MAX_DEPOSIT = 9,
VOID_STORAGE_MAX_WITHDRAW = 9,
VOID_STORAGE_MAX_SLOT = 160
};
enum VoidTransferError
{
VOID_TRANSFER_ERROR_NO_ERROR = 0,
VOID_TRANSFER_ERROR_INTERNAL_ERROR_1 = 1,
VOID_TRANSFER_ERROR_INTERNAL_ERROR_2 = 2,
VOID_TRANSFER_ERROR_FULL = 3,
VOID_TRANSFER_ERROR_INTERNAL_ERROR_3 = 4,
VOID_TRANSFER_ERROR_INTERNAL_ERROR_4 = 5,
VOID_TRANSFER_ERROR_NOT_ENOUGH_MONEY = 6,
VOID_TRANSFER_ERROR_INVENTORY_FULL = 7,
VOID_TRANSFER_ERROR_ITEM_INVALID = 8,
VOID_TRANSFER_ERROR_TRANSFER_UNKNOWN = 9
};
enum ChallengeMode
{
CHALLENGE_NOT_IN_TIMER = 0,
CHALLENGE_TIMER_LEVEL_1 = 1,
CHALLENGE_TIMER_LEVEL_2 = 2,
CHALLENGE_TIMER_LEVEL_3 = 3,
GOB_CHALLENGER_DOOR = 239408,
GOB_CHALLENGER_DOOR_LINE235 = 239323,
GO_FONT_OF_POWER = 246779,
SPELL_CHALLENGER_MIGHT = 206150,
SPELL_CHALLENGER_BURDEN = 206151
};
enum TimerType : uint32
{
WORLD_TIMER_TYPE_PVP = 0,
WORLD_TIMER_TYPE_CHALLENGE_MODE = 1,
WORLD_TIMER_TIMER_TYPE_PROVING_GROUND = 2,
};
#define CURRENCY_PRECISION 100
enum PartyResult
{
ERR_PARTY_RESULT_OK = 0,
ERR_BAD_PLAYER_NAME_S = 1,
ERR_TARGET_NOT_IN_GROUP_S = 2,
ERR_TARGET_NOT_IN_INSTANCE_S = 3,
ERR_GROUP_FULL = 4,
ERR_ALREADY_IN_GROUP_S = 5,
ERR_NOT_IN_GROUP = 6,
ERR_NOT_LEADER = 7,
ERR_PLAYER_WRONG_FACTION = 8,
ERR_IGNORING_YOU_S = 9,
ERR_LFG_PENDING = 12,
ERR_INVITE_RESTRICTED = 13,
ERR_GROUP_SWAP_FAILED = 14, // if (PartyOperation == PARTY_OP_SWAP) ERR_GROUP_SWAP_FAILED else ERR_INVITE_IN_COMBAT
ERR_INVITE_UNKNOWN_REALM = 15,
ERR_INVITE_NO_PARTY_SERVER = 16,
ERR_INVITE_PARTY_BUSY = 17,
ERR_PARTY_TARGET_AMBIGUOUS = 18,
ERR_PARTY_LFG_INVITE_RAID_LOCKED = 19,
ERR_PARTY_LFG_BOOT_LIMIT = 20,
ERR_PARTY_LFG_BOOT_COOLDOWN_S = 21,
ERR_PARTY_LFG_BOOT_IN_PROGRESS = 22,
ERR_PARTY_LFG_BOOT_TOO_FEW_PLAYERS = 23,
ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S = 24,
ERR_RAID_DISALLOWED_BY_LEVEL = 25,
ERR_PARTY_LFG_BOOT_IN_COMBAT = 26,
ERR_VOTE_KICK_REASON_NEEDED = 27,
ERR_PARTY_LFG_BOOT_DUNGEON_COMPLETE = 28,
ERR_PARTY_LFG_BOOT_LOOT_ROLLS = 29,
ERR_PARTY_LFG_TELEPORT_IN_COMBAT = 30
};
enum DiminishingLevels
{
DIMINISHING_LEVEL_1 = 0,
DIMINISHING_LEVEL_2 = 1,
DIMINISHING_LEVEL_3 = 2,
DIMINISHING_LEVEL_IMMUNE = 3,
DIMINISHING_LEVEL_4 = 3,
DIMINISHING_LEVEL_TAUNT_IMMUNE = 4
};
enum WeaponAttackType : uint8
{
BASE_ATTACK = 0,
OFF_ATTACK = 1,
RANGED_ATTACK = 2,
MAX_ATTACK
};
enum class TrainerFailReason : uint32
{
Unavailable = 0,
NotEnoughMoney = 1,
NoFail = 2
};
enum TokenResult
{
TOKEN_RESULT_SUCCESS = 0,
TOKEN_RESULT_ERROR_DISABLED = 1,
TOKEN_RESULT_ERROR_OTHER = 2,
TOKEN_RESULT_ERROR_NONE_FOR_SALE = 3,
TOKEN_RESULT_ERROR_TOO_MANY_TOKENS = 4,
TOKEN_RESULT_SUCCESS_NO = 5,
TOKEN_RESULT_ERROR_TRANSACTION_IN_PROGRESS = 6,
TOKEN_RESULT_ERROR_AUCTIONABLE_TOKEN_OWNED = 7,
TOKEN_RESULT_ERROR_TRIAL_RESTRICTED = 8
};
enum TutorialAction : uint8
{
TUTORIAL_ACTION_UPDATE = 0,
TUTORIAL_ACTION_CLEAR = 1,
TUTORIAL_ACTION_RESET = 2
};
enum Tutorials : uint32
{
TUTORIAL_TALENT = 1,
TUTORIAL_SPEC = 2,
TUTORIAL_GLYPH = 3,
TUTORIAL_SPELLBOOK = 4,
TUTORIAL_PROFESSIONS = 5,
TUTORIAL_CORE_ABILITITES = 6,
TUTORIAL_PET_JOURNAL = 7,
TUTORIAL_WHAT_HAS_CHANGED = 8,
TUTORIAL_GARRISON_BUILDING = 9,
TUTORIAL_GARRISON_MISSION_LIST = 10,
TUTORIAL_GARRISON_MISSION_PAGE = 11,
TUTORIAL_GARRISON_LANDING = 12,
TUTORIAL_GARRISON_ZONE_ABILITY = 13,
TUTORIAL_WORLD_MAP_FRAME = 14,
TUTORIAL_CLEAN_UP_BAGS = 15,
TUTORIAL_BAG_SETTINGS = 16,
TUTORIAL_REAGENT_BANK_UNLOCK = 17,
TUTORIAL_TOYBOX_FAVORITE = 18,
TUTORIAL_TOYBOX_MOUSEWHEEL_PAGING = 19,
TUTORIAL_LFG_LIST = 20,
TUTORIAL_TOYBOX = 21,
TUTORIAL_HEIRLOOM_JOURNAL = 22,
TUTORIAL_HEIRLOOM_JOURNAL_TAB = 23,
TUTORIAL_HEIRLOOM_JOURNAL_LEVEL = 24,
TUTORIAL_GAME_TIME_AUCTION_HOUSE = 25,
TUTORIAL_BOOSTED_SPELL_BOOK = 26,
TUTORIAL_ARTIFACT_KNOWLEDGE_LEVEL_LIMIT = 27,
TUTORIAL_WRAPPED_COLLECTION_ITEMS = 28,
TUTORIAL_VIEWABLE_ARTIFACT = 29,
TUTORIAL_ARTIFACT_APPEARANCE_TAB = 30,
TUTORIAL_ARTIFACT_RELIC_MATCH = 31,
TUTORIAL_BOUNTY_INTRO = 32,
TUTORIAL_BOUNTY_FINISHED = 33,
TUTORIAL_IGNORE_QUEST = 34,
TUTORIAL_TRANSMOG_JOURNAL_TAB = 35,
TUTORIAL_TRANSMOG_MODEL_CLICK = 36,
TUTORIAL_TRANSMOG_SPECS_BUTTON = 37,
TUTORIAL_TRANSMOG_OUTFIT_DROPDOWN = 38,
TUTORIAL_HONOR_TALENT_FIRST_TALENT = 39,
TUTORIAL_HONOR_TALENT_HONOR_LEVELS = 40,
TUTORIAL_ARTIFACT_KNOWLEDGE = 41,
TUTORIAL_INVENTORY_FIXUP_EXPANSION_LEGION = 42,
TUTORIAL_INVENTORY_FIXUP_CHECK_EXPANSION_LEGION = 43,
TUTORIAL_BONUS_ROLL_ENCOUNTER_JOURNAL_LINK = 44,
TUTORIAL_FRIENDS_LIST_QUICK_JOIN = 45,
TUTORIAL_REPUTATION_EXALTED_PLUS = 46,
TUTORIAL_TRANSMOG_SETS_TAB = 47,
TUTORIAL_TRANSMOG_SETS_VENDOR_TAB = 48,
TUTORIAL_BRAWL = 49,
TUTORIAL_RELIC_FORGE_LEARN_TRAIT = 50,
TUTORIAL_RELIC_FORGE_SOCKETED_RELIC = 51,
TUTORIAL_RELIC_FORGE_PREVIEW_RELIC = 52,
TUTORIAL_BAG_SLOTS_AUTHENTICATOR = 53,
TUTORIAL_TRIAL_BANKED_XP = 54,
TUTORIAL_TRADESKILL_UNLEARNED_TAB = 55,
TUTORIAL_TRADESKILL_RANK_STAR = 56,
TUTORIAL_AZERITE_RESPEC = 57,
TUTORIAL_PVP_TALENTS_FIRST_UNLOCK = 58,
TUTORIAL_PVP_WARMODE_UNLOCK = 59,
TUTORIAL_WARFRONT_RESOURCES = 60,
TUTORIAL_WARFRONT_CONSTRUCTION = 61,
TUTORIAL_AZERITE_ITEM_IN_BAG = 62,
TUTORIAL_AZERITE_ITEM_IN_SLOT = 63,
TUTORIAL_AZERITE_FIRST_POWER_LOCKED_IN = 64,
TUTORIAL_CHAT_CHANNELS = 65,
TUTORIAL_ISLANDS_QUEUE_BUTTON = 66,
TUTORIAL_ISLANDS_QUEUE_INFO_FRAME = 67,
TUTORIAL_MOUNT_EQUIPMENT_SLOT_FRAME = 68,
TUTORIAL_QUEST_SESSION = 69,
TUTORIAL_CLUB_FINDER_NEW_GUILD_LEADER = 70,
TUTORIAL_CLUB_FINDER_NEW_COMMUNITY_LEADER = 71,
TUTORIAL_CLUB_FINDER_NEW_APPLICANTS_GUILD_LEADER = 72,
TUTORIAL_CLUB_FINDER_LINKING = 73,
TUTORIAL_PVP_SPECIAL_EVENT = 74,
TUTORIAL_WORLD_MAP_THREAT_ICON = 75,
TUTORIAL_CORRUPTION_CLEANSER = 76,
TUTORIAL_CLUB_FINDER_NEW_LANGUAGE_FILTER = 77,
TUTORIAL_OPTIONAL_REAGENT_CRAFTING = 78,
TUTORIAL_CAMPAIGN_LORE_TEXT = 79,
TUTORIAL_NEWCOMER_GRADUATION = 80,
TUTORIAL_NEWCOMER_GRADUATION_REMINDER = 81,
TUTORIAL_RUNEFORGE_LEGENDARY_CRAFT = 82,
TUTORIAL_ANIMA_DIVERSION_SPEND_ANIMA = 83,
TUTORIAL_ANIMA_DIVERSION_FILL_BAR = 84,
TUTORIAL_ANIMA_DIVERSION_ACTIVATE_LOCATION = 85,
TUTORIAL_ANIMA_DIVERSION_REINFORCE_LOCATION = 86,
TUTORIAL_9_0_GRRISON_LANDING_PAGE_BUTTON_CALLINGS = 87,
TUTORIAL_9_0_GRRISON_LANDING_PAGE_CALLINGS = 88,
TUTORIAL_9_0_JAILERS_TOWER_BUFFS = 89,
TUTORIAL_EMBER_COURT_MAP = 90,
TUTORIAL_EYE_OF_JAILER = 91,
TUTORIAL_SOULBIND_PATH_SELECT = 92,
TUTORIAL_SOULBIND_CONDUIT_INSTALL = 93,
TUTORIAL_SOULBIND_CONDUIT_LEARN = 94,
TUTORIAL_FIRST_RUNEFORGE_LEGENDARY_POWER = 95,
TUTORIAL_COVENANT_RENOWN_REWARDS = 96,
TUTORIAL_COVENANT_RENOWN_PROGRESS = 97,
TUTORIAL_COVENANT_RESERVOIR_DEPOSIT = 98,
TUTORIAL_COVENANT_RESERVOIR_FEATURES = 99
};
#define MAX_ACCOUNT_TUTORIAL_VALUES 8
#define CURRENCY_PRECISION 100
enum RaidGroupReason
{
RAID_GROUP_ERR_NONE = 0,
RAID_GROUP_ERR_LOWLEVEL = 1, // "You are too low level to enter this instance."
RAID_GROUP_ERR_ONLY = 2, // "You must be in a raid group to enter this instance."
RAID_GROUP_ERR_FULL = 3, // "The instance is full."
RAID_GROUP_ERR_REQUIREMENTS_UNMATCH = 4 // "You do not meet the requirements to enter this instance."
};
enum ResetFailedReason : uint8
{
INSTANCE_RESET_FAILED = 0, // "Cannot reset %s. There are players still inside the instance."
INSTANCE_RESET_FAILED_ZONING = 1, // "Cannot reset %s. There are players in your party attempting to zone into an instance."
INSTANCE_RESET_FAILED_OFFLINE = 2 // "Cannot reset %s. There are players offline in your party."
};
enum ObjectDBState
{
DB_STATE_UNCHANGED = 0,
DB_STATE_CHANGED = 1,
DB_STATE_NEW = 2,
DB_STATE_REMOVED = 3
};
enum class GameError : uint32
{
ERR_SYSTEM = 0,
ERR_INTERNAL_ERROR = 1,
ERR_INV_FULL = 2,
ERR_BANK_FULL = 3,
ERR_CANT_EQUIP_LEVEL_I = 4,
ERR_CANT_EQUIP_SKILL = 5,
ERR_CANT_EQUIP_EVER = 6,
ERR_CANT_EQUIP_RANK = 7,
ERR_CANT_EQUIP_RATING = 8,
ERR_CANT_EQUIP_REPUTATION = 9,
ERR_PROFICIENCY_NEEDED = 10,
ERR_WRONG_SLOT = 11,
ERR_CANT_EQUIP_NEED_TALENT = 12,
ERR_BAG_FULL = 13,
ERR_INTERNAL_BAG_ERROR = 14,
ERR_DESTROY_NONEMPTY_BAG = 15,
ERR_BAG_IN_BAG = 16,
ERR_TOO_MANY_SPECIAL_BAGS = 17,
ERR_TRADE_EQUIPPED_BAG = 18,
ERR_AMMO_ONLY = 19,
ERR_NO_SLOT_AVAILABLE = 20,
ERR_WRONG_BAG_TYPE = 21,
ERR_ITEM_MAX_COUNT = 22,
ERR_NOT_EQUIPPABLE = 23,
ERR_CANT_STACK = 24,
ERR_CANT_SWAP = 25,
ERR_SLOT_EMPTY = 26,
ERR_ITEM_NOT_FOUND = 27,
ERR_TOO_FEW_TO_SPLIT = 28,
ERR_SPLIT_FAILED = 29,
ERR_NOT_A_BAG = 30,
ERR_NOT_OWNER = 31,
ERR_ONLY_ONE_QUIVER = 32,
ERR_NO_BANK_SLOT = 33,
ERR_NO_BANK_HERE = 34,
ERR_ITEM_LOCKED = 35,
ERR_2HANDED_EQUIPPED = 36,
ERR_VENDOR_NOT_INTERESTED = 37,
ERR_VENDOR_REFUSE_SCRAPPABLE_AZERITE = 38,
ERR_VENDOR_HATES_YOU = 39,
ERR_VENDOR_SOLD_OUT = 40,
ERR_VENDOR_TOO_FAR = 41,
ERR_VENDOR_DOESNT_BUY = 42,
ERR_NOT_ENOUGH_MONEY = 43,
ERR_RECEIVE_ITEM_S = 44,
ERR_DROP_BOUND_ITEM = 45,
ERR_TRADE_BOUND_ITEM = 46,
ERR_TRADE_QUEST_ITEM = 47,
ERR_TRADE_TEMP_ENCHANT_BOUND = 48,
ERR_TRADE_GROUND_ITEM = 49,
ERR_TRADE_BAG = 50,
ERR_SPELL_FAILED_S = 51,
ERR_ITEM_COOLDOWN = 52,
ERR_POTION_COOLDOWN = 53,
ERR_FOOD_COOLDOWN = 54,
ERR_SPELL_COOLDOWN = 55,
ERR_ABILITY_COOLDOWN = 56,
ERR_SPELL_ALREADY_KNOWN_S = 57,
ERR_PET_SPELL_ALREADY_KNOWN_S = 58,
ERR_PROFICIENCY_GAINED_S = 59,
ERR_SKILL_GAINED_S = 60,
ERR_SKILL_UP_SI = 61,
ERR_LEARN_SPELL_S = 62,
ERR_LEARN_ABILITY_S = 63,
ERR_LEARN_PASSIVE_S = 64,
ERR_LEARN_RECIPE_S = 65,
ERR_LEARN_COMPANION_S = 66,
ERR_LEARN_MOUNT_S = 67,
ERR_LEARN_TOY_S = 68,
ERR_LEARN_HEIRLOOM_S = 69,
ERR_LEARN_TRANSMOG_S = 70,
ERR_COMPLETED_TRANSMOG_SET_S = 71,
ERR_REVOKE_TRANSMOG_S = 72,
ERR_INVITE_PLAYER_S = 73,
ERR_INVITE_SELF = 74,
ERR_INVITED_TO_GROUP_SS = 75,
ERR_INVITED_ALREADY_IN_GROUP_SS = 76,
ERR_ALREADY_IN_GROUP_S = 77,
ERR_CROSS_REALM_RAID_INVITE = 78,
ERR_PLAYER_BUSY_S = 79,
ERR_NEW_LEADER_S = 80,
ERR_NEW_LEADER_YOU = 81,
ERR_NEW_GUIDE_S = 82,
ERR_NEW_GUIDE_YOU = 83,
ERR_LEFT_GROUP_S = 84,
ERR_LEFT_GROUP_YOU = 85,
ERR_GROUP_DISBANDED = 86,
ERR_DECLINE_GROUP_S = 87,
ERR_JOINED_GROUP_S = 88,
ERR_UNINVITE_YOU = 89,
ERR_BAD_PLAYER_NAME_S = 90,
ERR_NOT_IN_GROUP = 91,
ERR_TARGET_NOT_IN_GROUP_S = 92,
ERR_TARGET_NOT_IN_INSTANCE_S = 93,
ERR_NOT_IN_INSTANCE_GROUP = 94,
ERR_GROUP_FULL = 95,
ERR_NOT_LEADER = 96,
ERR_PLAYER_DIED_S = 97,
ERR_GUILD_CREATE_S = 98,
ERR_GUILD_INVITE_S = 99,
ERR_INVITED_TO_GUILD_SSS = 100,
ERR_ALREADY_IN_GUILD_S = 101,
ERR_ALREADY_INVITED_TO_GUILD_S = 102,
ERR_INVITED_TO_GUILD = 103,
ERR_ALREADY_IN_GUILD = 104,
ERR_GUILD_ACCEPT = 105,
ERR_GUILD_DECLINE_S = 106,
ERR_GUILD_DECLINE_AUTO_S = 107,
ERR_GUILD_PERMISSIONS = 108,
ERR_GUILD_JOIN_S = 109,
ERR_GUILD_FOUNDER_S = 110,
ERR_GUILD_PROMOTE_SSS = 111,
ERR_GUILD_DEMOTE_SS = 112,
ERR_GUILD_DEMOTE_SSS = 113,
ERR_GUILD_INVITE_SELF = 114,
ERR_GUILD_QUIT_S = 115,
ERR_GUILD_LEAVE_S = 116,
ERR_GUILD_REMOVE_SS = 117,
ERR_GUILD_REMOVE_SELF = 118,
ERR_GUILD_DISBAND_S = 119,
ERR_GUILD_DISBAND_SELF = 120,
ERR_GUILD_LEADER_S = 121,
ERR_GUILD_LEADER_SELF = 122,
ERR_GUILD_PLAYER_NOT_FOUND_S = 123,
ERR_GUILD_PLAYER_NOT_IN_GUILD_S = 124,
ERR_GUILD_PLAYER_NOT_IN_GUILD = 125,
ERR_GUILD_CANT_PROMOTE_S = 126,
ERR_GUILD_CANT_DEMOTE_S = 127,
ERR_GUILD_NOT_IN_A_GUILD = 128,
ERR_GUILD_INTERNAL = 129,
ERR_GUILD_LEADER_IS_S = 130,
ERR_GUILD_LEADER_CHANGED_SS = 131,
ERR_GUILD_DISBANDED = 132,
ERR_GUILD_NOT_ALLIED = 133,
ERR_GUILD_LEADER_LEAVE = 134,
ERR_GUILD_RANKS_LOCKED = 135,
ERR_GUILD_RANK_IN_USE = 136,
ERR_GUILD_RANK_TOO_HIGH_S = 137,
ERR_GUILD_RANK_TOO_LOW_S = 138,
ERR_GUILD_NAME_EXISTS_S = 139,
ERR_GUILD_WITHDRAW_LIMIT = 140,
ERR_GUILD_NOT_ENOUGH_MONEY = 141,
ERR_GUILD_TOO_MUCH_MONEY = 142,
ERR_GUILD_BANK_CONJURED_ITEM = 143,
ERR_GUILD_BANK_EQUIPPED_ITEM = 144,
ERR_GUILD_BANK_BOUND_ITEM = 145,
ERR_GUILD_BANK_QUEST_ITEM = 146,
ERR_GUILD_BANK_WRAPPED_ITEM = 147,
ERR_GUILD_BANK_FULL = 148,
ERR_GUILD_BANK_WRONG_TAB = 149,
ERR_NO_GUILD_CHARTER = 150,
ERR_OUT_OF_RANGE = 151,
ERR_PLAYER_DEAD = 152,
ERR_CLIENT_LOCKED_OUT = 153,
ERR_CLIENT_ON_TRANSPORT = 154,
ERR_KILLED_BY_S = 155,
ERR_LOOT_LOCKED = 156,
ERR_LOOT_TOO_FAR = 157,
ERR_LOOT_DIDNT_KILL = 158,
ERR_LOOT_BAD_FACING = 159,
ERR_LOOT_NOTSTANDING = 160,
ERR_LOOT_STUNNED = 161,
ERR_LOOT_NO_UI = 162,
ERR_LOOT_WHILE_INVULNERABLE = 163,
ERR_NO_LOOT = 164,
ERR_QUEST_ACCEPTED_S = 165,
ERR_QUEST_COMPLETE_S = 166,
ERR_QUEST_FAILED_S = 167,
ERR_QUEST_FAILED_BAG_FULL_S = 168,
ERR_QUEST_FAILED_MAX_COUNT_S = 169,
ERR_QUEST_FAILED_LOW_LEVEL = 170,
ERR_QUEST_FAILED_MISSING_ITEMS = 171,
ERR_QUEST_FAILED_WRONG_RACE = 172,
ERR_QUEST_FAILED_NOT_ENOUGH_MONEY = 173,
ERR_QUEST_FAILED_EXPANSION = 174,
ERR_QUEST_ONLY_ONE_TIMED = 175,
ERR_QUEST_NEED_PREREQS = 176,
ERR_QUEST_NEED_PREREQS_CUSTOM = 177,
ERR_QUEST_ALREADY_ON = 178,
ERR_QUEST_ALREADY_DONE = 179,
ERR_QUEST_ALREADY_DONE_DAILY = 180,
ERR_QUEST_HAS_IN_PROGRESS = 181,
ERR_QUEST_REWARD_EXP_I = 182,
ERR_QUEST_REWARD_MONEY_S = 183,
ERR_QUEST_MUST_CHOOSE = 184,
ERR_QUEST_LOG_FULL = 185,
ERR_COMBAT_DAMAGE_SSI = 186,
ERR_INSPECT_S = 187,
ERR_CANT_USE_ITEM = 188,
ERR_CANT_USE_ITEM_IN_ARENA = 189,
ERR_CANT_USE_ITEM_IN_RATED_BATTLEGROUND = 190,
ERR_MUST_EQUIP_ITEM = 191,
ERR_PASSIVE_ABILITY = 192,
ERR_2HSKILLNOTFOUND = 193,
ERR_NO_ATTACK_TARGET = 194,
ERR_INVALID_ATTACK_TARGET = 195,
ERR_ATTACK_PVP_TARGET_WHILE_UNFLAGGED = 196,
ERR_ATTACK_STUNNED = 197,
ERR_ATTACK_PACIFIED = 198,
ERR_ATTACK_MOUNTED = 199,
ERR_ATTACK_FLEEING = 200,
ERR_ATTACK_CONFUSED = 201,
ERR_ATTACK_CHARMED = 202,
ERR_ATTACK_DEAD = 203,
ERR_ATTACK_PREVENTED_BY_MECHANIC_S = 204,
ERR_ATTACK_CHANNEL = 205,
ERR_TAXISAMENODE = 206,
ERR_TAXINOSUCHPATH = 207,
ERR_TAXIUNSPECIFIEDSERVERERROR = 208,
ERR_TAXINOTENOUGHMONEY = 209,
ERR_TAXITOOFARAWAY = 210,
ERR_TAXINOVENDORNEARBY = 211,
ERR_TAXINOTVISITED = 212,
ERR_TAXIPLAYERBUSY = 213,
ERR_TAXIPLAYERALREADYMOUNTED = 214,
ERR_TAXIPLAYERSHAPESHIFTED = 215,
ERR_TAXIPLAYERMOVING = 216,
ERR_TAXINOPATHS = 217,
ERR_TAXINOTELIGIBLE = 218,
ERR_TAXINOTSTANDING = 219,
ERR_NO_REPLY_TARGET = 220,
ERR_GENERIC_NO_TARGET = 221,
ERR_INITIATE_TRADE_S = 222,
ERR_TRADE_REQUEST_S = 223,
ERR_TRADE_BLOCKED_S = 224,
ERR_TRADE_TARGET_DEAD = 225,
ERR_TRADE_TOO_FAR = 226,
ERR_TRADE_CANCELLED = 227,
ERR_TRADE_COMPLETE = 228,
ERR_TRADE_BAG_FULL = 229,
ERR_TRADE_TARGET_BAG_FULL = 230,
ERR_TRADE_MAX_COUNT_EXCEEDED = 231,
ERR_TRADE_TARGET_MAX_COUNT_EXCEEDED = 232,
ERR_ALREADY_TRADING = 233,
ERR_MOUNT_INVALIDMOUNTEE = 234,
ERR_MOUNT_TOOFARAWAY = 235,
ERR_MOUNT_ALREADYMOUNTED = 236,
ERR_MOUNT_NOTMOUNTABLE = 237,
ERR_MOUNT_NOTYOURPET = 238,
ERR_MOUNT_OTHER = 239,
ERR_MOUNT_LOOTING = 240,
ERR_MOUNT_RACECANTMOUNT = 241,
ERR_MOUNT_SHAPESHIFTED = 242,
ERR_MOUNT_NO_FAVORITES = 243,
ERR_DISMOUNT_NOPET = 244,
ERR_DISMOUNT_NOTMOUNTED = 245,
ERR_DISMOUNT_NOTYOURPET = 246,
ERR_SPELL_FAILED_TOTEMS = 247,
ERR_SPELL_FAILED_REAGENTS = 248,
ERR_SPELL_FAILED_REAGENTS_GENERIC = 249,
ERR_SPELL_FAILED_OPTIONAL_REAGENTS = 250,
ERR_CANT_TRADE_GOLD = 251,
ERR_SPELL_FAILED_EQUIPPED_ITEM = 252,
ERR_SPELL_FAILED_EQUIPPED_ITEM_CLASS_S = 253,
ERR_SPELL_FAILED_SHAPESHIFT_FORM_S = 254,
ERR_SPELL_FAILED_ANOTHER_IN_PROGRESS = 255,
ERR_BADATTACKFACING = 256,
ERR_BADATTACKPOS = 257,
ERR_CHEST_IN_USE = 258,
ERR_USE_CANT_OPEN = 259,
ERR_USE_LOCKED = 260,
ERR_DOOR_LOCKED = 261,
ERR_BUTTON_LOCKED = 262,
ERR_USE_LOCKED_WITH_ITEM_S = 263,
ERR_USE_LOCKED_WITH_SPELL_S = 264,
ERR_USE_LOCKED_WITH_SPELL_KNOWN_SI = 265,
ERR_USE_TOO_FAR = 266,
ERR_USE_BAD_ANGLE = 267,
ERR_USE_OBJECT_MOVING = 268,
ERR_USE_SPELL_FOCUS = 269,
ERR_USE_DESTROYED = 270,
ERR_SET_LOOT_FREEFORALL = 271,
ERR_SET_LOOT_ROUNDROBIN = 272,
ERR_SET_LOOT_MASTER = 273,
ERR_SET_LOOT_GROUP = 274,
ERR_SET_LOOT_THRESHOLD_S = 275,
ERR_NEW_LOOT_MASTER_S = 276,
ERR_SPECIFY_MASTER_LOOTER = 277,
ERR_LOOT_SPEC_CHANGED_S = 278,
ERR_TAME_FAILED = 279,
ERR_CHAT_WHILE_DEAD = 280,
ERR_CHAT_PLAYER_NOT_FOUND_S = 281,
ERR_NEWTAXIPATH = 282,
ERR_NO_PET = 283,
ERR_NOTYOURPET = 284,
ERR_PET_NOT_RENAMEABLE = 285,
ERR_QUEST_OBJECTIVE_COMPLETE_S = 286,
ERR_QUEST_UNKNOWN_COMPLETE = 287,
ERR_QUEST_ADD_KILL_SII = 288,
ERR_QUEST_ADD_FOUND_SII = 289,
ERR_QUEST_ADD_ITEM_SII = 290,
ERR_QUEST_ADD_PLAYER_KILL_SII = 291,
ERR_CANNOTCREATEDIRECTORY = 292,
ERR_CANNOTCREATEFILE = 293,
ERR_PLAYER_WRONG_FACTION = 294,
ERR_PLAYER_IS_NEUTRAL = 295,
ERR_BANKSLOT_FAILED_TOO_MANY = 296,
ERR_BANKSLOT_INSUFFICIENT_FUNDS = 297,
ERR_BANKSLOT_NOTBANKER = 298,
ERR_FRIEND_DB_ERROR = 299,
ERR_FRIEND_LIST_FULL = 300,
ERR_FRIEND_ADDED_S = 301,
ERR_BATTLETAG_FRIEND_ADDED_S = 302,
ERR_FRIEND_ONLINE_SS = 303,
ERR_FRIEND_OFFLINE_S = 304,
ERR_FRIEND_NOT_FOUND = 305,
ERR_FRIEND_WRONG_FACTION = 306,
ERR_FRIEND_REMOVED_S = 307,
ERR_BATTLETAG_FRIEND_REMOVED_S = 308,
ERR_FRIEND_ERROR = 309,
ERR_FRIEND_ALREADY_S = 310,
ERR_FRIEND_SELF = 311,
ERR_FRIEND_DELETED = 312,
ERR_IGNORE_FULL = 313,
ERR_IGNORE_SELF = 314,
ERR_IGNORE_NOT_FOUND = 315,
ERR_IGNORE_ALREADY_S = 316,
ERR_IGNORE_ADDED_S = 317,
ERR_IGNORE_REMOVED_S = 318,
ERR_IGNORE_AMBIGUOUS = 319,
ERR_IGNORE_DELETED = 320,
ERR_ONLY_ONE_BOLT = 321,
ERR_ONLY_ONE_AMMO = 322,
ERR_SPELL_FAILED_EQUIPPED_SPECIFIC_ITEM = 323,
ERR_WRONG_BAG_TYPE_SUBCLASS = 324,
ERR_CANT_WRAP_STACKABLE = 325,
ERR_CANT_WRAP_EQUIPPED = 326,
ERR_CANT_WRAP_WRAPPED = 327,
ERR_CANT_WRAP_BOUND = 328,
ERR_CANT_WRAP_UNIQUE = 329,
ERR_CANT_WRAP_BAGS = 330,
ERR_OUT_OF_MANA = 331,
ERR_OUT_OF_RAGE = 332,
ERR_OUT_OF_FOCUS = 333,
ERR_OUT_OF_ENERGY = 334,
ERR_OUT_OF_CHI = 335,
ERR_OUT_OF_HEALTH = 336,
ERR_OUT_OF_RUNES = 337,
ERR_OUT_OF_RUNIC_POWER = 338,
ERR_OUT_OF_SOUL_SHARDS = 339,
ERR_OUT_OF_LUNAR_POWER = 340,
ERR_OUT_OF_HOLY_POWER = 341,
ERR_OUT_OF_MAELSTROM = 342,
ERR_OUT_OF_COMBO_POINTS = 343,
ERR_OUT_OF_INSANITY = 344,
ERR_OUT_OF_ARCANE_CHARGES = 345,
ERR_OUT_OF_FURY = 346,
ERR_OUT_OF_PAIN = 347,
ERR_OUT_OF_POWER_DISPLAY = 348,
ERR_LOOT_GONE = 349,
ERR_MOUNT_FORCEDDISMOUNT = 350,
ERR_AUTOFOLLOW_TOO_FAR = 351,
ERR_UNIT_NOT_FOUND = 352,
ERR_INVALID_FOLLOW_TARGET = 353,
ERR_INVALID_FOLLOW_PVP_COMBAT = 354,
ERR_INVALID_FOLLOW_TARGET_PVP_COMBAT = 355,
ERR_INVALID_INSPECT_TARGET = 356,
ERR_GUILDEMBLEM_SUCCESS = 357,
ERR_GUILDEMBLEM_INVALID_TABARD_COLORS = 358,
ERR_GUILDEMBLEM_NOGUILD = 359,
ERR_GUILDEMBLEM_NOTGUILDMASTER = 360,
ERR_GUILDEMBLEM_NOTENOUGHMONEY = 361,
ERR_GUILDEMBLEM_INVALIDVENDOR = 362,
ERR_EMBLEMERROR_NOTABARDGEOSET = 363,
ERR_SPELL_OUT_OF_RANGE = 364,
ERR_COMMAND_NEEDS_TARGET = 365,
ERR_NOAMMO_S = 366,
ERR_TOOBUSYTOFOLLOW = 367,
ERR_DUEL_REQUESTED = 368,
ERR_DUEL_CANCELLED = 369,
ERR_DEATHBINDALREADYBOUND = 370,
ERR_DEATHBIND_SUCCESS_S = 371,
ERR_NOEMOTEWHILERUNNING = 372,
ERR_ZONE_EXPLORED = 373,
ERR_ZONE_EXPLORED_XP = 374,
ERR_INVALID_ITEM_TARGET = 375,
ERR_INVALID_QUEST_TARGET = 376,
ERR_IGNORING_YOU_S = 377,
ERR_FISH_NOT_HOOKED = 378,
ERR_FISH_ESCAPED = 379,
ERR_SPELL_FAILED_NOTUNSHEATHED = 380,
ERR_PETITION_OFFERED_S = 381,
ERR_PETITION_SIGNED = 382,
ERR_PETITION_SIGNED_S = 383,
ERR_PETITION_DECLINED_S = 384,
ERR_PETITION_ALREADY_SIGNED = 385,
ERR_PETITION_RESTRICTED_ACCOUNT_TRIAL = 386,
ERR_PETITION_ALREADY_SIGNED_OTHER = 387,
ERR_PETITION_IN_GUILD = 388,
ERR_PETITION_CREATOR = 389,
ERR_PETITION_NOT_ENOUGH_SIGNATURES = 390,
ERR_PETITION_NOT_SAME_SERVER = 391,
ERR_PETITION_FULL = 392,
ERR_PETITION_ALREADY_SIGNED_BY_S = 393,
ERR_GUILD_NAME_INVALID = 394,
ERR_SPELL_UNLEARNED_S = 395,
ERR_PET_SPELL_ROOTED = 396,
ERR_PET_SPELL_AFFECTING_COMBAT = 397,
ERR_PET_SPELL_OUT_OF_RANGE = 398,
ERR_PET_SPELL_NOT_BEHIND = 399,
ERR_PET_SPELL_TARGETS_DEAD = 400,
ERR_PET_SPELL_DEAD = 401,
ERR_PET_SPELL_NOPATH = 402,
ERR_ITEM_CANT_BE_DESTROYED = 403,
ERR_TICKET_ALREADY_EXISTS = 404,
ERR_TICKET_CREATE_ERROR = 405,
ERR_TICKET_UPDATE_ERROR = 406,
ERR_TICKET_DB_ERROR = 407,
ERR_TICKET_NO_TEXT = 408,
ERR_TICKET_TEXT_TOO_LONG = 409,
ERR_OBJECT_IS_BUSY = 410,
ERR_EXHAUSTION_WELLRESTED = 411,
ERR_EXHAUSTION_RESTED = 412,
ERR_EXHAUSTION_NORMAL = 413,
ERR_EXHAUSTION_TIRED = 414,
ERR_EXHAUSTION_EXHAUSTED = 415,
ERR_NO_ITEMS_WHILE_SHAPESHIFTED = 416,
ERR_CANT_INTERACT_SHAPESHIFTED = 417,
ERR_REALM_NOT_FOUND = 418,
ERR_MAIL_QUEST_ITEM = 419,
ERR_MAIL_BOUND_ITEM = 420,
ERR_MAIL_CONJURED_ITEM = 421,
ERR_MAIL_BAG = 422,
ERR_MAIL_TO_SELF = 423,
ERR_MAIL_TARGET_NOT_FOUND = 424,
ERR_MAIL_DATABASE_ERROR = 425,
ERR_MAIL_DELETE_ITEM_ERROR = 426,
ERR_MAIL_WRAPPED_COD = 427,
ERR_MAIL_CANT_SEND_REALM = 428,
ERR_MAIL_TEMP_RETURN_OUTAGE = 429,
ERR_MAIL_SENT = 430,
ERR_NOT_HAPPY_ENOUGH = 431,
ERR_USE_CANT_IMMUNE = 432,
ERR_CANT_BE_DISENCHANTED = 433,
ERR_CANT_USE_DISARMED = 434,
ERR_AUCTION_QUEST_ITEM = 435,
ERR_AUCTION_BOUND_ITEM = 436,
ERR_AUCTION_CONJURED_ITEM = 437,
ERR_AUCTION_LIMITED_DURATION_ITEM = 438,
ERR_AUCTION_WRAPPED_ITEM = 439,
ERR_AUCTION_LOOT_ITEM = 440,
ERR_AUCTION_BAG = 441,
ERR_AUCTION_EQUIPPED_BAG = 442,
ERR_AUCTION_DATABASE_ERROR = 443,
ERR_AUCTION_BID_OWN = 444,
ERR_AUCTION_BID_INCREMENT = 445,
ERR_AUCTION_HIGHER_BID = 446,
ERR_AUCTION_MIN_BID = 447,
ERR_AUCTION_REPAIR_ITEM = 448,
ERR_AUCTION_USED_CHARGES = 449,
ERR_AUCTION_ALREADY_BID = 450,
ERR_AUCTION_HOUSE_UNAVAILABLE = 451,
ERR_AUCTION_ITEM_HAS_QUOTE = 452,
ERR_AUCTION_HOUSE_BUSY = 453,
ERR_AUCTION_STARTED = 454,
ERR_AUCTION_REMOVED = 455,
ERR_AUCTION_OUTBID_S = 456,
ERR_AUCTION_WON_S = 457,
ERR_AUCTION_COMMODITY_WON_S = 458,
ERR_AUCTION_SOLD_S = 459,
ERR_AUCTION_EXPIRED_S = 460,
ERR_AUCTION_REMOVED_S = 461,
ERR_AUCTION_BID_PLACED = 462,
ERR_LOGOUT_FAILED = 463,
ERR_QUEST_PUSH_SUCCESS_S = 464,
ERR_QUEST_PUSH_INVALID_S = 465,
ERR_QUEST_PUSH_ACCEPTED_S = 466,
ERR_QUEST_PUSH_DECLINED_S = 467,
ERR_QUEST_PUSH_BUSY_S = 468,
ERR_QUEST_PUSH_DEAD_S = 469,
ERR_QUEST_PUSH_LOG_FULL_S = 470,
ERR_QUEST_PUSH_ONQUEST_S = 471,
ERR_QUEST_PUSH_ALREADY_DONE_S = 472,
ERR_QUEST_PUSH_NOT_DAILY_S = 473,
ERR_QUEST_PUSH_TIMER_EXPIRED_S = 474,
ERR_QUEST_PUSH_NOT_IN_PARTY_S = 475,
ERR_QUEST_PUSH_DIFFERENT_SERVER_DAILY_S = 476,
ERR_QUEST_PUSH_NOT_ALLOWED_S = 477,
ERR_RAID_GROUP_LOWLEVEL = 478,
ERR_RAID_GROUP_ONLY = 479,
ERR_RAID_GROUP_FULL = 480,
ERR_RAID_GROUP_REQUIREMENTS_UNMATCH = 481,
ERR_CORPSE_IS_NOT_IN_INSTANCE = 482,
ERR_PVP_KILL_HONORABLE = 483,
ERR_PVP_KILL_DISHONORABLE = 484,
ERR_SPELL_FAILED_ALREADY_AT_FULL_HEALTH = 485,
ERR_SPELL_FAILED_ALREADY_AT_FULL_MANA = 486,
ERR_SPELL_FAILED_ALREADY_AT_FULL_POWER_S = 487,
ERR_AUTOLOOT_MONEY_S = 488,
ERR_GENERIC_STUNNED = 489,
ERR_GENERIC_THROTTLE = 490,
ERR_CLUB_FINDER_SEARCHING_TOO_FAST = 491,
ERR_TARGET_STUNNED = 492,
ERR_MUST_REPAIR_DURABILITY = 493,
ERR_RAID_YOU_JOINED = 494,
ERR_RAID_YOU_LEFT = 495,
ERR_INSTANCE_GROUP_JOINED_WITH_PARTY = 496,
ERR_INSTANCE_GROUP_JOINED_WITH_RAID = 497,
ERR_RAID_MEMBER_ADDED_S = 498,
ERR_RAID_MEMBER_REMOVED_S = 499,
ERR_INSTANCE_GROUP_ADDED_S = 500,
ERR_INSTANCE_GROUP_REMOVED_S = 501,
ERR_CLICK_ON_ITEM_TO_FEED = 502,
ERR_TOO_MANY_CHAT_CHANNELS = 503,
ERR_LOOT_ROLL_PENDING = 504,
ERR_LOOT_PLAYER_NOT_FOUND = 505,
ERR_NOT_IN_RAID = 506,
ERR_LOGGING_OUT = 507,
ERR_TARGET_LOGGING_OUT = 508,
ERR_NOT_WHILE_MOUNTED = 509,
ERR_NOT_WHILE_SHAPESHIFTED = 510,
ERR_NOT_IN_COMBAT = 511,
ERR_NOT_WHILE_DISARMED = 512,
ERR_PET_BROKEN = 513,
ERR_TALENT_WIPE_ERROR = 514,
ERR_SPEC_WIPE_ERROR = 515,
ERR_GLYPH_WIPE_ERROR = 516,
ERR_PET_SPEC_WIPE_ERROR = 517,
ERR_FEIGN_DEATH_RESISTED = 518,
ERR_MEETING_STONE_IN_QUEUE_S = 519,
ERR_MEETING_STONE_LEFT_QUEUE_S = 520,
ERR_MEETING_STONE_OTHER_MEMBER_LEFT = 521,
ERR_MEETING_STONE_PARTY_KICKED_FROM_QUEUE = 522,
ERR_MEETING_STONE_MEMBER_STILL_IN_QUEUE = 523,
ERR_MEETING_STONE_SUCCESS = 524,
ERR_MEETING_STONE_IN_PROGRESS = 525,
ERR_MEETING_STONE_MEMBER_ADDED_S = 526,
ERR_MEETING_STONE_GROUP_FULL = 527,
ERR_MEETING_STONE_NOT_LEADER = 528,
ERR_MEETING_STONE_INVALID_LEVEL = 529,
ERR_MEETING_STONE_TARGET_NOT_IN_PARTY = 530,
ERR_MEETING_STONE_TARGET_INVALID_LEVEL = 531,
ERR_MEETING_STONE_MUST_BE_LEADER = 532,
ERR_MEETING_STONE_NO_RAID_GROUP = 533,
ERR_MEETING_STONE_NEED_PARTY = 534,
ERR_MEETING_STONE_NOT_FOUND = 535,
ERR_MEETING_STONE_TARGET_IN_VEHICLE = 536,
ERR_GUILDEMBLEM_SAME = 537,
ERR_EQUIP_TRADE_ITEM = 538,
ERR_PVP_TOGGLE_ON = 539,
ERR_PVP_TOGGLE_OFF = 540,
ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS = 541,
ERR_GROUP_JOIN_BATTLEGROUND_DEAD = 542,
ERR_GROUP_JOIN_BATTLEGROUND_S = 543,
ERR_GROUP_JOIN_BATTLEGROUND_FAIL = 544,
ERR_GROUP_JOIN_BATTLEGROUND_TOO_MANY = 545,
ERR_SOLO_JOIN_BATTLEGROUND_S = 546,
ERR_JOIN_SINGLE_SCENARIO_S = 547,
ERR_BATTLEGROUND_TOO_MANY_QUEUES = 548,
ERR_BATTLEGROUND_CANNOT_QUEUE_FOR_RATED = 549,
ERR_BATTLEDGROUND_QUEUED_FOR_RATED = 550,
ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = 551,
ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND = 552,
ERR_ALREADY_IN_ARENA_TEAM_S = 553,
ERR_INVALID_PROMOTION_CODE = 554,
ERR_BG_PLAYER_JOINED_SS = 555,
ERR_BG_PLAYER_LEFT_S = 556,
ERR_RESTRICTED_ACCOUNT = 557,
ERR_RESTRICTED_ACCOUNT_TRIAL = 558,
ERR_PLAY_TIME_EXCEEDED = 559,
ERR_APPROACHING_PARTIAL_PLAY_TIME = 560,
ERR_APPROACHING_PARTIAL_PLAY_TIME_2 = 561,
ERR_APPROACHING_NO_PLAY_TIME = 562,
ERR_APPROACHING_NO_PLAY_TIME_2 = 563,
ERR_UNHEALTHY_TIME = 564,
ERR_CHAT_RESTRICTED_TRIAL = 565,
ERR_CHAT_THROTTLED = 566,
ERR_MAIL_REACHED_CAP = 567,
ERR_INVALID_RAID_TARGET = 568,
ERR_RAID_LEADER_READY_CHECK_START_S = 569,
ERR_READY_CHECK_IN_PROGRESS = 570,
ERR_READY_CHECK_THROTTLED = 571,
ERR_DUNGEON_DIFFICULTY_FAILED = 572,
ERR_DUNGEON_DIFFICULTY_CHANGED_S = 573,
ERR_TRADE_WRONG_REALM = 574,
ERR_TRADE_NOT_ON_TAPLIST = 575,
ERR_CHAT_PLAYER_AMBIGUOUS_S = 576,
ERR_LOOT_CANT_LOOT_THAT_NOW = 577,
ERR_LOOT_MASTER_INV_FULL = 578,
ERR_LOOT_MASTER_UNIQUE_ITEM = 579,
ERR_LOOT_MASTER_OTHER = 580,
ERR_FILTERING_YOU_S = 581,
ERR_USE_PREVENTED_BY_MECHANIC_S = 582,
ERR_ITEM_UNIQUE_EQUIPPABLE = 583,
ERR_LFG_LEADER_IS_LFM_S = 584,
ERR_LFG_PENDING = 585,
ERR_CANT_SPEAK_LANGAGE = 586,
ERR_VENDOR_MISSING_TURNINS = 587,
ERR_BATTLEGROUND_NOT_IN_TEAM = 588,
ERR_NOT_IN_BATTLEGROUND = 589,
ERR_NOT_ENOUGH_HONOR_POINTS = 590,
ERR_NOT_ENOUGH_ARENA_POINTS = 591,
ERR_SOCKETING_REQUIRES_META_GEM = 592,
ERR_SOCKETING_META_GEM_ONLY_IN_METASLOT = 593,
ERR_SOCKETING_REQUIRES_HYDRAULIC_GEM = 594,
ERR_SOCKETING_HYDRAULIC_GEM_ONLY_IN_HYDRAULICSLOT = 595,
ERR_SOCKETING_REQUIRES_COGWHEEL_GEM = 596,
ERR_SOCKETING_COGWHEEL_GEM_ONLY_IN_COGWHEELSLOT = 597,
ERR_SOCKETING_ITEM_TOO_LOW_LEVEL = 598,
ERR_ITEM_MAX_COUNT_SOCKETED = 599,
ERR_SYSTEM_DISABLED = 600,
ERR_QUEST_FAILED_TOO_MANY_DAILY_QUESTS_I = 601,
ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 602,
ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 603,
ERR_USER_SQUELCHED = 604,
ERR_ACCOUNT_SILENCED = 605,
ERR_TOO_MUCH_GOLD = 606,
ERR_NOT_BARBER_SITTING = 607,
ERR_QUEST_FAILED_CAIS = 608,
ERR_INVITE_RESTRICTED_TRIAL = 609,
ERR_VOICE_IGNORE_FULL = 610,
ERR_VOICE_IGNORE_SELF = 611,
ERR_VOICE_IGNORE_NOT_FOUND = 612,
ERR_VOICE_IGNORE_ALREADY_S = 613,
ERR_VOICE_IGNORE_ADDED_S = 614,
ERR_VOICE_IGNORE_REMOVED_S = 615,
ERR_VOICE_IGNORE_AMBIGUOUS = 616,
ERR_VOICE_IGNORE_DELETED = 617,
ERR_UNKNOWN_MACRO_OPTION_S = 618,
ERR_NOT_DURING_ARENA_MATCH = 619,
ERR_PLAYER_SILENCED = 620,
ERR_PLAYER_UNSILENCED = 621,
ERR_COMSAT_DISCONNECT = 622,
ERR_COMSAT_RECONNECT_ATTEMPT = 623,
ERR_COMSAT_CONNECT_FAIL = 624,
ERR_MAIL_INVALID_ATTACHMENT_SLOT = 625,
ERR_MAIL_TOO_MANY_ATTACHMENTS = 626,
ERR_MAIL_INVALID_ATTACHMENT = 627,
ERR_MAIL_ATTACHMENT_EXPIRED = 628,
ERR_VOICE_CHAT_PARENTAL_DISABLE_MIC = 629,
ERR_PROFANE_CHAT_NAME = 630,
ERR_PLAYER_SILENCED_ECHO = 631,
ERR_PLAYER_UNSILENCED_ECHO = 632,
ERR_LOOT_CANT_LOOT_THAT = 633,
ERR_ARENA_EXPIRED_CAIS = 634,
ERR_GROUP_ACTION_THROTTLED = 635,
ERR_ALREADY_PICKPOCKETED = 636,
ERR_NAME_INVALID = 637,
ERR_NAME_NO_NAME = 638,
ERR_NAME_TOO_SHORT = 639,
ERR_NAME_TOO_LONG = 640,
ERR_NAME_MIXED_LANGUAGES = 641,
ERR_NAME_PROFANE = 642,
ERR_NAME_RESERVED = 643,
ERR_NAME_THREE_CONSECUTIVE = 644,
ERR_NAME_INVALID_SPACE = 645,
ERR_NAME_CONSECUTIVE_SPACES = 646,
ERR_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 647,
ERR_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 648,
ERR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 649,
ERR_RECRUIT_A_FRIEND_NOT_LINKED = 650,
ERR_RECRUIT_A_FRIEND_NOT_NOW = 651,
ERR_RECRUIT_A_FRIEND_SUMMON_LEVEL_MAX = 652,
ERR_RECRUIT_A_FRIEND_SUMMON_COOLDOWN = 653,
ERR_RECRUIT_A_FRIEND_SUMMON_OFFLINE = 654,
ERR_RECRUIT_A_FRIEND_INSUF_EXPAN_LVL = 655,
ERR_RECRUIT_A_FRIEND_MAP_INCOMING_TRANSFER_NOT_ALLOWED = 656,
ERR_NOT_SAME_ACCOUNT = 657,
ERR_BAD_ON_USE_ENCHANT = 658,
ERR_TRADE_SELF = 659,
ERR_TOO_MANY_SOCKETS = 660,
ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 661,
ERR_TRADE_TARGET_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 662,
ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS = 663,
ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS = 664,
ERR_SHAPESHIFT_FORM_CANNOT_EQUIP = 665,
ERR_ITEM_INVENTORY_FULL_SATCHEL = 666,
ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 667,
ERR_SCALING_STAT_ITEM_LEVEL_TOO_LOW = 668,
ERR_PURCHASE_LEVEL_TOO_LOW = 669,
ERR_GROUP_SWAP_FAILED = 670,
ERR_INVITE_IN_COMBAT = 671,
ERR_INVALID_GLYPH_SLOT = 672,
ERR_GENERIC_NO_VALID_TARGETS = 673,
ERR_CALENDAR_EVENT_ALERT_S = 674,
ERR_PET_LEARN_SPELL_S = 675,
ERR_PET_LEARN_ABILITY_S = 676,
ERR_PET_SPELL_UNLEARNED_S = 677,
ERR_INVITE_UNKNOWN_REALM = 678,
ERR_INVITE_NO_PARTY_SERVER = 679,
ERR_INVITE_PARTY_BUSY = 680,
ERR_PARTY_TARGET_AMBIGUOUS = 681,
ERR_PARTY_LFG_INVITE_RAID_LOCKED = 682,
ERR_PARTY_LFG_BOOT_LIMIT = 683,
ERR_PARTY_LFG_BOOT_COOLDOWN_S = 684,
ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S = 685,
ERR_PARTY_LFG_BOOT_INPATIENT_TIMER_S = 686,
ERR_PARTY_LFG_BOOT_IN_PROGRESS = 687,
ERR_PARTY_LFG_BOOT_TOO_FEW_PLAYERS = 688,
ERR_PARTY_LFG_BOOT_VOTE_SUCCEEDED = 689,
ERR_PARTY_LFG_BOOT_VOTE_FAILED = 690,
ERR_PARTY_LFG_BOOT_IN_COMBAT = 691,
ERR_PARTY_LFG_BOOT_DUNGEON_COMPLETE = 692,
ERR_PARTY_LFG_BOOT_LOOT_ROLLS = 693,
ERR_PARTY_LFG_BOOT_VOTE_REGISTERED = 694,
ERR_PARTY_PRIVATE_GROUP_ONLY = 695,
ERR_PARTY_LFG_TELEPORT_IN_COMBAT = 696,
ERR_RAID_DISALLOWED_BY_LEVEL = 697,
ERR_RAID_DISALLOWED_BY_CROSS_REALM = 698,
ERR_PARTY_ROLE_NOT_AVAILABLE = 699,
ERR_JOIN_LFG_OBJECT_FAILED = 700,
ERR_LFG_REMOVED_LEVELUP = 701,
ERR_LFG_REMOVED_XP_TOGGLE = 702,
ERR_LFG_REMOVED_FACTION_CHANGE = 703,
ERR_BATTLEGROUND_INFO_THROTTLED = 704,
ERR_BATTLEGROUND_ALREADY_IN = 705,
ERR_ARENA_TEAM_CHANGE_FAILED_QUEUED = 706,
ERR_ARENA_TEAM_PERMISSIONS = 707,
ERR_NOT_WHILE_FALLING = 708,
ERR_NOT_WHILE_MOVING = 709,
ERR_NOT_WHILE_FATIGUED = 710,
ERR_MAX_SOCKETS = 711,
ERR_MULTI_CAST_ACTION_TOTEM_S = 712,
ERR_BATTLEGROUND_JOIN_LEVELUP = 713,
ERR_REMOVE_FROM_PVP_QUEUE_XP_GAIN = 714,
ERR_BATTLEGROUND_JOIN_XP_GAIN = 715,
ERR_BATTLEGROUND_JOIN_MERCENARY = 716,
ERR_BATTLEGROUND_JOIN_TOO_MANY_HEALERS = 717,
ERR_BATTLEGROUND_JOIN_RATED_TOO_MANY_HEALERS = 718,
ERR_BATTLEGROUND_JOIN_TOO_MANY_TANKS = 719,
ERR_BATTLEGROUND_JOIN_TOO_MANY_DAMAGE = 720,
ERR_RAID_DIFFICULTY_FAILED = 721,
ERR_RAID_DIFFICULTY_CHANGED_S = 722,
ERR_LEGACY_RAID_DIFFICULTY_CHANGED_S = 723,
ERR_RAID_LOCKOUT_CHANGED_S = 724,
ERR_RAID_CONVERTED_TO_PARTY = 725,
ERR_PARTY_CONVERTED_TO_RAID = 726,
ERR_PLAYER_DIFFICULTY_CHANGED_S = 727,
ERR_GMRESPONSE_DB_ERROR = 728,
ERR_BATTLEGROUND_JOIN_RANGE_INDEX = 729,
ERR_ARENA_JOIN_RANGE_INDEX = 730,
ERR_REMOVE_FROM_PVP_QUEUE_FACTION_CHANGE = 731,
ERR_BATTLEGROUND_JOIN_FAILED = 732,
ERR_BATTLEGROUND_JOIN_NO_VALID_SPEC_FOR_ROLE = 733,
ERR_BATTLEGROUND_JOIN_RESPEC = 734,
ERR_BATTLEGROUND_INVITATION_DECLINED = 735,
ERR_BATTLEGROUND_JOIN_TIMED_OUT = 736,
ERR_BATTLEGROUND_DUPE_QUEUE = 737,
ERR_BATTLEGROUND_JOIN_MUST_COMPLETE_QUEST = 738,
ERR_IN_BATTLEGROUND_RESPEC = 739,
ERR_MAIL_LIMITED_DURATION_ITEM = 740,
ERR_YELL_RESTRICTED_TRIAL = 741,
ERR_CHAT_RAID_RESTRICTED_TRIAL = 742,
ERR_LFG_ROLE_CHECK_FAILED = 743,
ERR_LFG_ROLE_CHECK_FAILED_TIMEOUT = 744,
ERR_LFG_ROLE_CHECK_FAILED_NOT_VIABLE = 745,
ERR_LFG_READY_CHECK_FAILED = 746,
ERR_LFG_READY_CHECK_FAILED_TIMEOUT = 747,
ERR_LFG_GROUP_FULL = 748,
ERR_LFG_NO_LFG_OBJECT = 749,
ERR_LFG_NO_SLOTS_PLAYER = 750,
ERR_LFG_NO_SLOTS_PARTY = 751,
ERR_LFG_NO_SPEC = 752,
ERR_LFG_MISMATCHED_SLOTS = 753,
ERR_LFG_MISMATCHED_SLOTS_LOCAL_XREALM = 754,
ERR_LFG_PARTY_PLAYERS_FROM_DIFFERENT_REALMS = 755,
ERR_LFG_MEMBERS_NOT_PRESENT = 756,
ERR_LFG_GET_INFO_TIMEOUT = 757,
ERR_LFG_INVALID_SLOT = 758,
ERR_LFG_DESERTER_PLAYER = 759,
ERR_LFG_DESERTER_PARTY = 760,
ERR_LFG_DEAD = 761,
ERR_LFG_RANDOM_COOLDOWN_PLAYER = 762,
ERR_LFG_RANDOM_COOLDOWN_PARTY = 763,
ERR_LFG_TOO_MANY_MEMBERS = 764,
ERR_LFG_TOO_FEW_MEMBERS = 765,
ERR_LFG_PROPOSAL_FAILED = 766,
ERR_LFG_PROPOSAL_DECLINED_SELF = 767,
ERR_LFG_PROPOSAL_DECLINED_PARTY = 768,
ERR_LFG_NO_SLOTS_SELECTED = 769,
ERR_LFG_NO_ROLES_SELECTED = 770,
ERR_LFG_ROLE_CHECK_INITIATED = 771,
ERR_LFG_READY_CHECK_INITIATED = 772,
ERR_LFG_PLAYER_DECLINED_ROLE_CHECK = 773,
ERR_LFG_PLAYER_DECLINED_READY_CHECK = 774,
ERR_LFG_JOINED_QUEUE = 775,
ERR_LFG_JOINED_FLEX_QUEUE = 776,
ERR_LFG_JOINED_RF_QUEUE = 777,
ERR_LFG_JOINED_SCENARIO_QUEUE = 778,
ERR_LFG_JOINED_WORLD_PVP_QUEUE = 779,
ERR_LFG_JOINED_BATTLEFIELD_QUEUE = 780,
ERR_LFG_JOINED_LIST = 781,
ERR_LFG_LEFT_QUEUE = 782,
ERR_LFG_LEFT_LIST = 783,
ERR_LFG_ROLE_CHECK_ABORTED = 784,
ERR_LFG_READY_CHECK_ABORTED = 785,
ERR_LFG_CANT_USE_BATTLEGROUND = 786,
ERR_LFG_CANT_USE_DUNGEONS = 787,
ERR_LFG_REASON_TOO_MANY_LFG = 788,
ERR_INVALID_TELEPORT_LOCATION = 789,
ERR_TOO_FAR_TO_INTERACT = 790,
ERR_BATTLEGROUND_PLAYERS_FROM_DIFFERENT_REALMS = 791,
ERR_DIFFICULTY_CHANGE_COOLDOWN_S = 792,
ERR_DIFFICULTY_CHANGE_COMBAT_COOLDOWN_S = 793,
ERR_DIFFICULTY_CHANGE_WORLDSTATE = 794,
ERR_DIFFICULTY_CHANGE_ENCOUNTER = 795,
ERR_DIFFICULTY_CHANGE_COMBAT = 796,
ERR_DIFFICULTY_CHANGE_PLAYER_BUSY = 797,
ERR_DIFFICULTY_CHANGE_ALREADY_STARTED = 798,
ERR_DIFFICULTY_CHANGE_OTHER_HEROIC_S = 799,
ERR_DIFFICULTY_CHANGE_HEROIC_INSTANCE_ALREADY_RUNNING = 800,
ERR_ARENA_TEAM_PARTY_SIZE = 801,
ERR_QUEST_FORCE_REMOVED_S = 802,
ERR_ATTACK_NO_ACTIONS = 803,
ERR_IN_RANDOM_BG = 804,
ERR_IN_NON_RANDOM_BG = 805,
ERR_AUCTION_ENOUGH_ITEMS = 806,
ERR_BN_FRIEND_SELF = 807,
ERR_BN_FRIEND_ALREADY = 808,
ERR_BN_FRIEND_BLOCKED = 809,
ERR_BN_FRIEND_LIST_FULL = 810,
ERR_BN_FRIEND_REQUEST_SENT = 811,
ERR_BN_BROADCAST_THROTTLE = 812,
ERR_BG_DEVELOPER_ONLY = 813,
ERR_CURRENCY_SPELL_SLOT_MISMATCH = 814,
ERR_CURRENCY_NOT_TRADABLE = 815,
ERR_REQUIRES_EXPANSION_S = 816,
ERR_QUEST_FAILED_SPELL = 817,
ERR_TALENT_FAILED_NOT_ENOUGH_TALENTS_IN_PRIMARY_TREE = 818,
ERR_TALENT_FAILED_NO_PRIMARY_TREE_SELECTED = 819,
ERR_TALENT_FAILED_CANT_REMOVE_TALENT = 820,
ERR_TALENT_FAILED_UNKNOWN = 821,
ERR_WARGAME_REQUEST_FAILURE = 822,
ERR_RANK_REQUIRES_AUTHENTICATOR = 823,
ERR_GUILD_BANK_VOUCHER_FAILED = 824,
ERR_WARGAME_REQUEST_SENT = 825,
ERR_REQUIRES_ACHIEVEMENT_I = 826,
ERR_REFUND_RESULT_EXCEED_MAX_CURRENCY = 827,
ERR_CANT_BUY_QUANTITY = 828,
ERR_ITEM_IS_BATTLE_PAY_LOCKED = 829,
ERR_PARTY_ALREADY_IN_BATTLEGROUND_QUEUE = 830,
ERR_PARTY_CONFIRMING_BATTLEGROUND_QUEUE = 831,
ERR_BATTLEFIELD_TEAM_PARTY_SIZE = 832,
ERR_INSUFF_TRACKED_CURRENCY_IS = 833,
ERR_NOT_ON_TOURNAMENT_REALM = 834,
ERR_GUILD_TRIAL_ACCOUNT_TRIAL = 835,
ERR_GUILD_TRIAL_ACCOUNT_VETERAN = 836,
ERR_GUILD_UNDELETABLE_DUE_TO_LEVEL = 837,
ERR_CANT_DO_THAT_IN_A_GROUP = 838,
ERR_GUILD_LEADER_REPLACED = 839,
ERR_TRANSMOGRIFY_CANT_EQUIP = 840,
ERR_TRANSMOGRIFY_INVALID_ITEM_TYPE = 841,
ERR_TRANSMOGRIFY_NOT_SOULBOUND = 842,
ERR_TRANSMOGRIFY_INVALID_SOURCE = 843,
ERR_TRANSMOGRIFY_INVALID_DESTINATION = 844,
ERR_TRANSMOGRIFY_MISMATCH = 845,
ERR_TRANSMOGRIFY_LEGENDARY = 846,
ERR_TRANSMOGRIFY_SAME_ITEM = 847,
ERR_TRANSMOGRIFY_SAME_APPEARANCE = 848,
ERR_TRANSMOGRIFY_NOT_EQUIPPED = 849,
ERR_VOID_DEPOSIT_FULL = 850,
ERR_VOID_WITHDRAW_FULL = 851,
ERR_VOID_STORAGE_WRAPPED = 852,
ERR_VOID_STORAGE_STACKABLE = 853,
ERR_VOID_STORAGE_UNBOUND = 854,
ERR_VOID_STORAGE_REPAIR = 855,
ERR_VOID_STORAGE_CHARGES = 856,
ERR_VOID_STORAGE_QUEST = 857,
ERR_VOID_STORAGE_CONJURED = 858,
ERR_VOID_STORAGE_MAIL = 859,
ERR_VOID_STORAGE_BAG = 860,
ERR_VOID_TRANSFER_STORAGE_FULL = 861,
ERR_VOID_TRANSFER_INV_FULL = 862,
ERR_VOID_TRANSFER_INTERNAL_ERROR = 863,
ERR_VOID_TRANSFER_ITEM_INVALID = 864,
ERR_DIFFICULTY_DISABLED_IN_LFG = 865,
ERR_VOID_STORAGE_UNIQUE = 866,
ERR_VOID_STORAGE_LOOT = 867,
ERR_VOID_STORAGE_HOLIDAY = 868,
ERR_VOID_STORAGE_DURATION = 869,
ERR_VOID_STORAGE_LOAD_FAILED = 870,
ERR_VOID_STORAGE_INVALID_ITEM = 871,
ERR_PARENTAL_CONTROLS_CHAT_MUTED = 872,
ERR_SOR_START_EXPERIENCE_INCOMPLETE = 873,
ERR_SOR_INVALID_EMAIL = 874,
ERR_SOR_INVALID_COMMENT = 875,
ERR_CHALLENGE_MODE_RESET_COOLDOWN_S = 876,
ERR_CHALLENGE_MODE_RESET_KEYSTONE = 877,
ERR_PET_JOURNAL_ALREADY_IN_LOADOUT = 878,
ERR_REPORT_SUBMITTED_SUCCESSFULLY = 879,
ERR_REPORT_SUBMISSION_FAILED = 880,
ERR_SUGGESTION_SUBMITTED_SUCCESSFULLY = 881,
ERR_BUG_SUBMITTED_SUCCESSFULLY = 882,
ERR_CHALLENGE_MODE_ENABLED = 883,
ERR_CHALLENGE_MODE_DISABLED = 884,
ERR_PETBATTLE_CREATE_FAILED = 885,
ERR_PETBATTLE_NOT_HERE = 886,
ERR_PETBATTLE_NOT_HERE_ON_TRANSPORT = 887,
ERR_PETBATTLE_NOT_HERE_UNEVEN_GROUND = 888,
ERR_PETBATTLE_NOT_HERE_OBSTRUCTED = 889,
ERR_PETBATTLE_NOT_WHILE_IN_COMBAT = 890,
ERR_PETBATTLE_NOT_WHILE_DEAD = 891,
ERR_PETBATTLE_NOT_WHILE_FLYING = 892,
ERR_PETBATTLE_TARGET_INVALID = 893,
ERR_PETBATTLE_TARGET_OUT_OF_RANGE = 894,
ERR_PETBATTLE_TARGET_NOT_CAPTURABLE = 895,
ERR_PETBATTLE_NOT_A_TRAINER = 896,
ERR_PETBATTLE_DECLINED = 897,
ERR_PETBATTLE_IN_BATTLE = 898,
ERR_PETBATTLE_INVALID_LOADOUT = 899,
ERR_PETBATTLE_ALL_PETS_DEAD = 900,
ERR_PETBATTLE_NO_PETS_IN_SLOTS = 901,
ERR_PETBATTLE_NO_ACCOUNT_LOCK = 902,
ERR_PETBATTLE_WILD_PET_TAPPED = 903,
ERR_PETBATTLE_RESTRICTED_ACCOUNT = 904,
ERR_PETBATTLE_OPPONENT_NOT_AVAILABLE = 905,
ERR_PETBATTLE_NOT_WHILE_IN_MATCHED_BATTLE = 906,
ERR_CANT_HAVE_MORE_PETS_OF_THAT_TYPE = 907,
ERR_CANT_HAVE_MORE_PETS = 908,
ERR_PVP_MAP_NOT_FOUND = 909,
ERR_PVP_MAP_NOT_SET = 910,
ERR_PETBATTLE_QUEUE_QUEUED = 911,
ERR_PETBATTLE_QUEUE_ALREADY_QUEUED = 912,
ERR_PETBATTLE_QUEUE_JOIN_FAILED = 913,
ERR_PETBATTLE_QUEUE_JOURNAL_LOCK = 914,
ERR_PETBATTLE_QUEUE_REMOVED = 915,
ERR_PETBATTLE_QUEUE_PROPOSAL_DECLINED = 916,
ERR_PETBATTLE_QUEUE_PROPOSAL_TIMEOUT = 917,
ERR_PETBATTLE_QUEUE_OPPONENT_DECLINED = 918,
ERR_PETBATTLE_QUEUE_REQUEUED_INTERNAL = 919,
ERR_PETBATTLE_QUEUE_REQUEUED_REMOVED = 920,
ERR_PETBATTLE_QUEUE_SLOT_LOCKED = 921,
ERR_PETBATTLE_QUEUE_SLOT_EMPTY = 922,
ERR_PETBATTLE_QUEUE_SLOT_NO_TRACKER = 923,
ERR_PETBATTLE_QUEUE_SLOT_NO_SPECIES = 924,
ERR_PETBATTLE_QUEUE_SLOT_CANT_BATTLE = 925,
ERR_PETBATTLE_QUEUE_SLOT_REVOKED = 926,
ERR_PETBATTLE_QUEUE_SLOT_DEAD = 927,
ERR_PETBATTLE_QUEUE_SLOT_NO_PET = 928,
ERR_PETBATTLE_QUEUE_NOT_WHILE_NEUTRAL = 929,
ERR_PETBATTLE_GAME_TIME_LIMIT_WARNING = 930,
ERR_PETBATTLE_GAME_ROUNDS_LIMIT_WARNING = 931,
ERR_HAS_RESTRICTION = 932,
ERR_ITEM_UPGRADE_ITEM_TOO_LOW_LEVEL = 933,
ERR_ITEM_UPGRADE_NO_PATH = 934,
ERR_ITEM_UPGRADE_NO_MORE_UPGRADES = 935,
ERR_BONUS_ROLL_EMPTY = 936,
ERR_CHALLENGE_MODE_FULL = 937,
ERR_CHALLENGE_MODE_IN_PROGRESS = 938,
ERR_CHALLENGE_MODE_INCORRECT_KEYSTONE = 939,
ERR_BATTLETAG_FRIEND_NOT_FOUND = 940,
ERR_BATTLETAG_FRIEND_NOT_VALID = 941,
ERR_BATTLETAG_FRIEND_NOT_ALLOWED = 942,
ERR_BATTLETAG_FRIEND_THROTTLED = 943,
ERR_BATTLETAG_FRIEND_SUCCESS = 944,
ERR_PET_TOO_HIGH_LEVEL_TO_UNCAGE = 945,
ERR_PETBATTLE_INTERNAL = 946,
ERR_CANT_CAGE_PET_YET = 947,
ERR_NO_LOOT_IN_CHALLENGE_MODE = 948,
ERR_QUEST_PET_BATTLE_VICTORIES_PVP_II = 949,
ERR_ROLE_CHECK_ALREADY_IN_PROGRESS = 950,
ERR_RECRUIT_A_FRIEND_ACCOUNT_LIMIT = 951,
ERR_RECRUIT_A_FRIEND_FAILED = 952,
ERR_SET_LOOT_PERSONAL = 953,
ERR_SET_LOOT_METHOD_FAILED_COMBAT = 954,
ERR_REAGENT_BANK_FULL = 955,
ERR_REAGENT_BANK_LOCKED = 956,
ERR_GARRISON_BUILDING_EXISTS = 957,
ERR_GARRISON_INVALID_PLOT = 958,
ERR_GARRISON_INVALID_BUILDINGID = 959,
ERR_GARRISON_INVALID_PLOT_BUILDING = 960,
ERR_GARRISON_REQUIRES_BLUEPRINT = 961,
ERR_GARRISON_NOT_ENOUGH_CURRENCY = 962,
ERR_GARRISON_NOT_ENOUGH_GOLD = 963,
ERR_GARRISON_COMPLETE_MISSION_WRONG_FOLLOWER_TYPE = 964,
ERR_ALREADY_USING_LFG_LIST = 965,
ERR_RESTRICTED_ACCOUNT_LFG_LIST_TRIAL = 966,
ERR_TOY_USE_LIMIT_REACHED = 967,
ERR_TOY_ALREADY_KNOWN = 968,
ERR_TRANSMOG_SET_ALREADY_KNOWN = 969,
ERR_NOT_ENOUGH_CURRENCY = 970,
ERR_SPEC_IS_DISABLED = 971,
ERR_FEATURE_RESTRICTED_TRIAL = 972,
ERR_CANT_BE_OBLITERATED = 973,
ERR_CANT_BE_SCRAPPED = 974,
ERR_ARTIFACT_RELIC_DOES_NOT_MATCH_ARTIFACT = 975,
ERR_MUST_EQUIP_ARTIFACT = 976,
ERR_CANT_DO_THAT_RIGHT_NOW = 977,
ERR_AFFECTING_COMBAT = 978,
ERR_EQUIPMENT_MANAGER_COMBAT_SWAP_S = 979,
ERR_EQUIPMENT_MANAGER_BAGS_FULL = 980,
ERR_EQUIPMENT_MANAGER_MISSING_ITEM_S = 981,
ERR_MOVIE_RECORDING_WARNING_PERF = 982,
ERR_MOVIE_RECORDING_WARNING_DISK_FULL = 983,
ERR_MOVIE_RECORDING_WARNING_NO_MOVIE = 984,
ERR_MOVIE_RECORDING_WARNING_REQUIREMENTS = 985,
ERR_MOVIE_RECORDING_WARNING_COMPRESSING = 986,
ERR_NO_CHALLENGE_MODE_REWARD = 987,
ERR_CLAIMED_CHALLENGE_MODE_REWARD = 988,
ERR_CHALLENGE_MODE_PERIOD_RESET_SS = 989,
ERR_CANT_DO_THAT_CHALLENGE_MODE_ACTIVE = 990,
ERR_TALENT_FAILED_REST_AREA = 991,
ERR_CANNOT_ABANDON_LAST_PET = 992,
ERR_TEST_CVAR_SET_SSS = 993,
ERR_QUEST_TURN_IN_FAIL_REASON = 994,
ERR_CLAIMED_CHALLENGE_MODE_REWARD_OLD = 995,
ERR_TALENT_GRANTED_BY_AURA = 996,
ERR_CHALLENGE_MODE_ALREADY_COMPLETE = 997,
ERR_GLYPH_TARGET_NOT_AVAILABLE = 998,
ERR_PVP_WARMODE_TOGGLE_ON = 999,
ERR_PVP_WARMODE_TOGGLE_OFF = 1000,
ERR_SPELL_FAILED_LEVEL_REQUIREMENT = 1001,
ERR_BATTLEGROUND_JOIN_REQUIRES_LEVEL = 1002,
ERR_BATTLEGROUND_JOIN_DISQUALIFIED = 1003,
ERR_BATTLEGROUND_JOIN_DISQUALIFIED_NO_NAME = 1004,
ERR_VOICE_CHAT_GENERIC_UNABLE_TO_CONNECT = 1005,
ERR_VOICE_CHAT_SERVICE_LOST = 1006,
ERR_VOICE_CHAT_CHANNEL_NAME_TOO_SHORT = 1007,
ERR_VOICE_CHAT_CHANNEL_NAME_TOO_LONG = 1008,
ERR_VOICE_CHAT_CHANNEL_ALREADY_EXISTS = 1009,
ERR_VOICE_CHAT_TARGET_NOT_FOUND = 1010,
ERR_VOICE_CHAT_TOO_MANY_REQUESTS = 1011,
ERR_VOICE_CHAT_PLAYER_SILENCED = 1012,
ERR_VOICE_CHAT_PARENTAL_DISABLE_ALL = 1013,
ERR_VOICE_CHAT_DISABLED = 1014,
ERR_NO_PVP_REWARD = 1015,
ERR_CLAIMED_PVP_REWARD = 1016,
ERR_AZERITE_ESSENCE_SELECTION_FAILED_ESSENCE_NOT_UNLOCKED = 1017,
ERR_AZERITE_ESSENCE_SELECTION_FAILED_CANT_REMOVE_ESSENCE = 1018,
ERR_AZERITE_ESSENCE_SELECTION_FAILED_CONDITION_FAILED = 1019,
ERR_AZERITE_ESSENCE_SELECTION_FAILED_REST_AREA = 1020,
ERR_AZERITE_ESSENCE_SELECTION_FAILED_SLOT_LOCKED = 1021,
ERR_AZERITE_ESSENCE_SELECTION_FAILED_NOT_AT_FORGE = 1022,
ERR_AZERITE_ESSENCE_SELECTION_FAILED_HEART_LEVEL_TOO_LOW = 1023,
ERR_AZERITE_ESSENCE_SELECTION_FAILED_NOT_EQUIPPED = 1024,
ERR_SOCKETING_REQUIRES_PUNCHCARDRED_GEM = 1025,
ERR_SOCKETING_PUNCHCARDRED_GEM_ONLY_IN_PUNCHCARDREDSLOT = 1026,
ERR_SOCKETING_REQUIRES_PUNCHCARDYELLOW_GEM = 1027,
ERR_SOCKETING_PUNCHCARDYELLOW_GEM_ONLY_IN_PUNCHCARDYELLOWSLOT = 1028,
ERR_SOCKETING_REQUIRES_PUNCHCARDBLUE_GEM = 1029,
ERR_SOCKETING_PUNCHCARDBLUE_GEM_ONLY_IN_PUNCHCARDBLUESLOT = 1030,
ERR_LEVEL_LINKING_RESULT_LINKED = 1031,
ERR_LEVEL_LINKING_RESULT_UNLINKED = 1032,
ERR_CLUB_FINDER_ERROR_POST_CLUB = 1033,
ERR_CLUB_FINDER_ERROR_APPLY_CLUB = 1034,
ERR_CLUB_FINDER_ERROR_RESPOND_APPLICANT = 1035,
ERR_CLUB_FINDER_ERROR_CANCEL_APPLICATION = 1036,
ERR_CLUB_FINDER_ERROR_TYPE_ACCEPT_APPLICATION = 1037,
ERR_CLUB_FINDER_ERROR_TYPE_NO_INVITE_PERMISSIONS = 1038,
ERR_CLUB_FINDER_ERROR_TYPE_NO_POSTING_PERMISSIONS = 1039,
ERR_CLUB_FINDER_ERROR_TYPE_APPLICANT_LIST = 1040,
ERR_CLUB_FINDER_ERROR_TYPE_APPLICANT_LIST_NO_PERM = 1041,
ERR_CLUB_FINDER_ERROR_TYPE_FINDER_NOT_AVAILABLE = 1042,
ERR_CLUB_FINDER_ERROR_TYPE_GET_POSTING_IDS = 1043,
ERR_CLUB_FINDER_ERROR_TYPE_JOIN_APPLICATION = 1044,
ERR_CLUB_FINDER_ERROR_TYPE_FLAGGED_RENAME = 1045,
ERR_CLUB_FINDER_ERROR_TYPE_FLAGGED_DESCRIPTION_CHANGE = 1046,
ERR_ITEM_INTERACTION_NOT_ENOUGH_GOLD = 1047,
ERR_ITEM_INTERACTION_NOT_ENOUGH_CURRENCY = 1048,
ERR_PLAYER_CHOICE_ERROR_PENDING_CHOICE = 1049,
ERR_SOULBIND_INVALID_CONDUIT = 1050,
ERR_SOULBIND_INVALID_CONDUIT_ITEM = 1051,
ERR_SOULBIND_INVALID_TALENT = 1052,
ERR_SOULBIND_DUPLICATE_CONDUIT = 1053,
ERR_ACTIVATE_SOULBIND_FAILED_REST_AREA = 1054,
ERR_CANT_USE_PROFANITY = 1055,
ERR_NOT_IN_PET_BATTLE = 1056,
ERR_NOT_IN_NPE = 1057,
};
enum Maps : uint32
{
MAP_EASTERN_KINGDOMS = 0,
MAP_KALIMDOR = 1,
MAP_OUTLAND = 530,
MAP_NORTHREND = 571,
MAP_EBON_HOLD_DK_START_ZONE = 609,
MAP_PANDARIA = 870,
MAP_DRAENOR = 1116,
MAP_WOD_BLASTED_LANDS_PHASE = 1190,
MAP_BROKEN_ISLANDS = 1220,
MAP_TANAAN_JUNGLE_INTRO = 1265,
MAP_TANAAN_DAM_EXPLODED = 1307,
MAP_NELTHARION_LAIR = 1458,
MAP_TANAAN_JUNGLE = 1464,
MAP_DALARAN_UNDERBELLY = 1502,
MAP_ZULDAZAR = 1642,
MAP_KUL_TIRAS = 1643,
MAP_ULDIR = 1861,
MAP_CRUCIBLE_OF_STORMS = 2096,
MAP_BATTLE_OF_DAZARALOR = 2070,
MAP_ETERNAL_PALACE = 2164,
MAP_NYALOTHA = 2217,
MAP_NPE = 2175,
MAP_CASTLE_NATHRIA = 2296,
};
enum AreaName : uint32
{
ZONE_DUN_MOROGH = 1,
ZONE_ELWYNN_FOREST = 12,
ZONE_DUROTAR = 14,
AREA_BARRENS_MERCHANT_COAST = 391,
ZONE_HOWLING_FJORD = 495,
AREA_DUN_MOROGH_GATES_OF_IRONFORGE = 809,
AREA_DUROTAR_ROCKTUSK_FARM = 1296,
ZONE_UNDERCITY = 1497,
ZONE_STORMWIND_CITY = 1519,
ZONE_ORGRIMMAR = 1637,
ZONE_THUNDER_BLUFF = 1638,
ZONE_DARNASSUS = 1657,
ZONE_EVERSONG_WOODS = 3430,
ZONE_NAGRAND = 3518,
ZONE_NETHERSTORM = 3523,
ZONE_AZUREMYST_ISLE = 3524,
ZONE_EXODAR = 3557,
AREA_AZUREMYST_ISLE_TRAITOR_COVE = 3579,
AREA_HALAA = 3628,
AREA_AZUREMYST_ISLE_SILVERMYST_ISLE = 3639,
ZONE_SHATTRATH = 3703,
AREA_NETHERSTORM_SOCRETHAR_SEAT = 3742,
AREA_NETHERSTORM_INVASION_POINT_OVERLORD = 3900,
AREA_HOWLING_FJORD_SHATTERED_STRAITS = 4064,
ZONE_ISLE_OF_QUEL_DANAS = 4080,
AREA_BOREAN_TUNDRA_NAXXANAR = 4128,
ZONE_WINTERGRASP = 4197,
ZONE_DALARAN_WOTLK = 4395,
AREA_STORM_PEAKS_VALLEY_ANCIENT_WINTERS = 4437,
AREA_WINTERGRASP_THE_SUNKEN_RING = 4538,
AREA_WINTERGRASP_THE_BROKEN_TEMPLATE = 4539,
AREA_WINTERGRASP_FORTRESS = 4575,
AREA_WINTERGRASP_THE_CHILLED_QUAGMIRE = 4589,
AREA_WINTERGRASP_WESTPARK_WORKSHOP = 4611,
AREA_WINTERGRASP_EASTPARK_WORKSHOP = 4612,
AREA_VARGOTH_RETREAT = 4637,
AREA_ULDUAR_FORMATION_GROUNDS = 4652,
AREA_ICECROWN_ARGENT_TOURNAMENT_FIELDS = 4658,
AREA_ICECROWN_RING_OF_ASPIRANTS = 4670,
AREA_ICECROWN_RING_OF_ARGENT_VALIANTS = 4671,
AREA_ICECROWN_RING_OF_ALLIANCE_VALIANTS = 4672,
AREA_ICECROWN_RING_OF_HORDE_VALIANTS = 4673,
AREA_ICECROWN_RING_OF_CHAMPIONS = 4669,
AREA_ICECROWN_SUNREAVER_PAVILION = 4676,
AREA_ICECROWN_SILVER_COVENANT_PAVILION = 4677,
ZONE_GILNEAS = 4714,
AREA_GILNEAS_DUSKHAVEN = 4786,
ZONE_TOL_BARAD_PENINSULA = 5389,
AREA_WANDERING_ISLE_WRECK_OF_THE_SKYSEEKER = 5833,
ZONE_TEMPLE_JADE_SERPENT = 5956,
AREA_TEMPLE_JADE_SERPENT_SCROLLKEEPER_SANCTUM = 6118,
AREA_TEMPLE_JADE_SERPENT_TERRACE_TWIN_DRAGONS = 6119,
AREA_MOGUSHAN_PALACE_CRIMSON_ASSEMBLY_HALL = 6471,
ZONE_HIGHMAUL = 6996,
ZONE_TANAAN_JUNGLE = 7025,
AREA_TANAAN_DARK_PORTAL = 7037,
AREA_TANAAN_BLEEDING_ALTAR = 7039,
AREA_TANAAN_KARGATHAR_PROVING_GROUNDS = 7040,
AREA_TANAAN_HEARTH_BLOOD = 7041,
AREA_TANAAN_UMBRAL_HALLS = 7042,
AREA_TANAAN_BLACKROCK_QUARRY = 7043,
AREA_TANAAN_PATH_OF_GLORY = 7044,
AREA_TANAAN_TARTHOG_BRIDGE = 7129,
AREA_HIGHMAUL_COLLISEUM = 7395,
ZONE_MARDUM = 7705,
AREA_MARDUM_CRYPTIC_HOLLOW = 7754,
ZONE_DALARAN_LEGION = 7886,
AREA_BROKEN_TEETH = 8339,
ZONE_KROKUUN = 8574,
AREA_KROKUUN_VINDICAAR = 8714,
ZONE_MACARE = 8701,
ZONE_ANTORAN_WASTES = 8899,
AREA_MACAREE_VINDICAAR = 8915,
AREA_ANTORAN_WASTES_VINDICAAR = 8916,
AREA_THE_OBSERVATORIUM = 13434,
};
enum SpecialSpells : uint32
{
SPELL_MERCENARY_CONTRACT_HORDE = 193472,
SPELL_MERCENARY_CONTRACT_ALLIANCE = 193475,
};
enum class MountResult : uint32
{
InvalidMountee = 0,
TooFarAway = 1,
AlreadyMounted = 2,
NotMountable = 3,
NotYourPet = 4,
Other = 5,
Looting = 6,
RaceCantMount = 7,
Shapeshifted = 8,
ForcedDismount = 9,
Ok = 10 // never sent
};
#endif
|
255c323c51fc61b562537e7d9665f3d60abed8b2
|
f00f2b22d82ba93e9e73f1642bbd1eaf40c9d02e
|
/FourierTransform.cpp
|
fffa37b9de728c0e52292b8c4a13da14ef4ea564
|
[] |
no_license
|
marcelra/plingtheory
|
a09708bc917f9af70e69960984174f219fd6ea7c
|
66d175b5fd6d125302fb3b9ab216c800ba8a555d
|
refs/heads/master
| 2021-05-16T03:04:29.445126
| 2015-08-29T21:03:40
| 2015-08-29T21:03:40
| 16,084,299
| 1
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,637
|
cpp
|
FourierTransform.cpp
|
#include "FourierTransform.h"
namespace WaveAnalysis
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Notes:
/// * Builds frequency list during initialisation
/// * Works on the internal FFTW algorithms for efficiency (less copy-operations of data)
/// Initialises the whole internal array with zeroes so that zero-padding is for free
/// During reverse transform some of these zero-padded samples may become small, but non-zero, for this reason the array
/// needs reinitialisation after a reverse transform.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
FourierTransform::FourierTransform( const SamplingInfo& samplingInfo, size_t windowSize, const WindowFuncDef& windowFuncDef, size_t numSamplesZeroPadding ) :
m_config( new FourierConfig( samplingInfo, windowSize, windowFuncDef, numSamplesZeroPadding ) ),
m_algorithm( m_config->getTotalFourierSize() ),
m_needsInitTimeArr( true )
{}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
FourierTransform::FourierTransform( FourierConfig::CSPtr config ) :
m_config( config ),
m_algorithm( m_config->getTotalFourierSize() ),
m_needsInitTimeArr( true )
{}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// initFftwArrays
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void FourierTransform::initFftwArrays()
{
double* arr = m_algorithm.getTimeDataWorkingArray();
for ( size_t i = 0; i < m_config->getTotalFourierSize(); ++i )
{
arr[i] = 0;
}
m_needsInitTimeArr = false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// transform
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
FourierSpectrum::Ptr FourierTransform::transform( const double* data )
{
if ( m_needsInitTimeArr )
{
initFftwArrays();
}
double* arr = m_algorithm.getTimeDataWorkingArray();
const WindowFunction& winFunc = m_config->getWindowFunction();
for ( size_t iSample = 0; iSample < m_config->getWindowSize(); ++iSample )
{
arr[iSample] = data[iSample] * winFunc.calc( iSample );
}
m_algorithm.transform();
Complex* resultFirst = m_algorithm.getFourierDataWorkingArray();
Complex* resultLast = m_algorithm.getFourierDataWorkingArray() + m_algorithm.getSpectrumDimension();
return FourierSpectrum::Ptr( new FourierSpectrum( m_config, resultFirst, resultLast ) );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// transform (reverse)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
RealVectorPtr FourierTransform::transform( const FourierSpectrum& spectrum )
{
/// Check conditions
assert( m_config->isInvertible() );
assert( spectrum.size() == m_config->getSpectrumDimension() );
/// Fill complex Fftw array with spectrum data
Complex* arr = m_algorithm.getFourierDataWorkingArray();
for ( size_t i = 0; i < spectrum.size(); ++i )
{
arr[i] = spectrum[i];
}
/// Transform
m_algorithm.reverseTransform();
m_needsInitTimeArr = true;
/// Get sizes
size_t windowSize = m_config->getWindowSize();
size_t totalFourierSize = m_config->getTotalFourierSize();
/// Build result, this is still multiplied by WindowFunction
double* first = m_algorithm.getTimeDataWorkingArray();
double* last = m_algorithm.getTimeDataWorkingArray() + windowSize;
RealVector* result = new RealVector( first, last );
/// Undo windowing
const WindowFunction& winFunc = m_config->getWindowFunction();
for ( size_t iSample = 0; iSample < windowSize; ++iSample )
{
(*result)[iSample] /= ( winFunc.calc( iSample ) * totalFourierSize );
}
return RealVectorPtr( result );
}
} /// namespace WaveAnalysis
|
ccd094f2aef449b1b47a0bdb84bd437f61c20120
|
70e9da06a454fc399eee5fb247ca8d362685d470
|
/Problems/0048_Rotate_Image.h
|
8bc3564a73caff4ffd9adbf2b56b46bd8e5768ba
|
[] |
no_license
|
YejingWang/Leetcode
|
38499a5d5376e3f18ccece87f70722705771c9ee
|
b93e914e2acb418f9cdf84b3e6365db68a75e4b0
|
refs/heads/master
| 2023-08-05T04:43:45.596671
| 2021-08-31T09:30:53
| 2021-08-31T09:30:53
| 256,743,256
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,792
|
h
|
0048_Rotate_Image.h
|
#pragma once
/*
48. Rotate Image
https://leetcode.com/problems/rotate-image/
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).
You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.
Example 1:
-------------
| 1 | 2 | 3 |
-------------
| 4 | 5 | 6 |
-------------
| 7 | 8 | 9 |
-------------
Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
Output: [[7,4,1],[8,5,2],[9,6,3]]
Example 2:
---------------------
| 5 | 1 | 9 | 11 |
---------------------
| 2 | 4 | 8 | 10 |
---------------------
| 13 | 3 | 6 | 7 |
---------------------
| 15 | 14 | 12 | 16|
Input: matrix = [[5,1,9,11],[2,4,8,10],[13,3,6,7],[15,14,12,16]]
Output: [[15,13,2,5],[14,3,4,1],[12,6,8,9],[16,7,10,11]]
Example 3:
Input: matrix = [[1]]
Output: [[1]]
Example 4:
Input: matrix = [[1,2],[3,4]]
Output: [[3,1],[4,2]]
Constraints:
matrix.length == n
matrix[i].length == n
1 <= n <= 20
-1000 <= matrix[i][j] <= 1000
*/
#include <vector>
class Solution {
public:
void rotate(std::vector<std::vector<int>>& matrix) {
// 1. Starightforward
// Time complexity: O(N)
// Space complexity: O(1)
int sz = matrix.size() - 1;
int n = sz;
for (int i = 0; i <= n - 1; ++i) {
for (int j = i; j <= n - 1; ++j) {
int tmp = matrix[i][j];
for (int k = 0; k < 4; ++k) {
int curTmp = matrix[j][sz - i];
matrix[j][sz - i] = tmp;
tmp = curTmp;
int tmpI = i;
i = j;
j = sz - tmpI;
}
}
--n;
}
}
};
/*
Tips:
*/
|
6990c46c162f25284e669597bf390bbbab5fcd79
|
051211c627f63aa37cce1cf085bf8b33cd6494af
|
/EPI/EPI_bak/03_ArrayString/src/3_10_Permutation_array.cpp
|
1915dc025d0740a030060bb7efb551da4b924819
|
[] |
no_license
|
roykim0823/Interview
|
32994ea0ec341ec19a644c7f3ef3b0774b228f2c
|
660ab546a72ca86b4c4a91d3c7279a8171398652
|
refs/heads/master
| 2020-03-24T02:37:01.125120
| 2019-11-19T05:25:15
| 2019-11-19T05:25:15
| 139,811,693
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,491
|
cpp
|
3_10_Permutation_array.cpp
|
// Copyright (c) 2013 Elements of Programming Interviews. All rights reserved.
#include <algorithm>
#include <cassert>
#include <iostream>
#include <iterator>
#include <random>
#include <vector>
using std::cout;
using std::default_random_engine;
using std::endl;
using std::ostream_iterator;
using std::random_device;
using std::uniform_int_distribution;
using std::vector;
using std::swap;
template<typename T>
vector<T> permutate(vector<T> &vec) { // random shuffle
vector<T> t(vec);
int n=t.size();
default_random_engine gen((random_device())());
for(int i=0; i<n; ++i) {
//int j = rand() % (n-i) + i;
uniform_int_distribution<int> dis(i, n-1);
int j = dis(gen);
swap(t[i], t[j]);
}
return t;
}
int main(int argc, char *argv[]) {
default_random_engine gen((random_device())());
int n;
for (int times = 0; times < 10; ++times) {
if (argc == 2) {
n = atoi(argv[1]);
} else {
uniform_int_distribution<int> dis(1, 20);
n = dis(gen);
}
vector<int> A, perm;
for (int i = 0; i < n; ++i) {
A.emplace_back(i);
perm.emplace_back(i);
}
copy(A.begin(), A.end(), ostream_iterator<int>(cout, " "));
cout << endl;
// knuth shuffle
random_shuffle(perm.begin(), perm.end());
copy(perm.begin(), perm.end(), ostream_iterator<int>(cout, " "));
cout << endl;
vector<int> B;
B = permutate(A);
copy(B.begin(), B.end(), ostream_iterator<int>(cout, " "));
cout << endl;
}
return 0;
}
|
48f125904b083072151364785c5a87003d880e1c
|
87e8d04c5c32dab8182ba3fcd573a1753d39e185
|
/test/benchmark/protobuf_benchmark.cc
|
2ba217bac38d4a3ddde713b6aceb873d2a7456ea
|
[
"MIT"
] |
permissive
|
onedata/oneclient
|
ce3842f1b6ecdd9c0f25c127970d1a56dd9a1966
|
12e564741797e0f702b36475e9ead73b78b367c2
|
refs/heads/develop
| 2023-08-31T01:45:41.784802
| 2023-08-29T13:46:50
| 2023-08-29T13:46:50
| 45,646,655
| 5
| 3
|
MIT
| 2020-05-14T16:32:36
| 2015-11-05T23:34:28
|
C++
|
UTF-8
|
C++
| false
| false
| 2,356
|
cc
|
protobuf_benchmark.cc
|
/**
* @file protobuf_benchmark.cc
* @author Bartek Kryza
* @copyright (C) 2018 ACK CYFRONET AGH
* @copyright This software is released under the MIT license cited in
* 'LICENSE.txt'
*/
#include "messages/fuse/fileBlock.h"
#include "messages/fuse/fileLocation.h"
#include <boost/random.hpp>
#include <boost/range/irange.hpp>
#include <folly/Benchmark.h>
#include <folly/container/Foreach.h>
#include <utility>
using namespace one::messages::fuse;
constexpr auto blockSize = 1024; // 1KB
std::string prepareFileLocation(const int blocksCount)
{
auto serverMsg = std::make_unique<one::clproto::ServerMessage>();
auto fuseResponse = serverMsg->mutable_fuse_response();
fuseResponse->mutable_status()->set_code(one::clproto::Status_Code_ok);
auto fl = fuseResponse->mutable_file_location();
fl->set_uuid("FileUuid1");
fl->set_file_id("File1");
fl->set_provider_id("Provider1");
fl->set_space_id("Space1");
fl->set_storage_id("Storage1");
fl->set_version(1);
for (auto i : boost::irange(0, blocksCount)) {
auto newBlock = fl->add_blocks();
newBlock->set_file_id("File1");
newBlock->set_storage_id("Storage1");
newBlock->set_offset(i * 2);
newBlock->set_size(blockSize);
}
return serverMsg->SerializeAsString();
}
BENCHMARK(benchmarkDeserializeFileLocation1KBlocks)
{
std::string serverMessage;
BENCHMARK_SUSPEND { serverMessage = prepareFileLocation(1000); }
auto serverMsg = std::make_unique<one::clproto::ServerMessage>();
auto success = serverMsg->ParseFromString(serverMessage);
folly::doNotOptimizeAway(success);
}
BENCHMARK(benchmarkDeserializeFileLocation100KBlocks)
{
std::string serverMessage;
BENCHMARK_SUSPEND { serverMessage = prepareFileLocation(100'000); }
auto serverMsg = std::make_unique<one::clproto::ServerMessage>();
auto success = serverMsg->ParseFromString(serverMessage);
folly::doNotOptimizeAway(success);
}
BENCHMARK(benchmarkDeserializeFileLocation1MBlocks)
{
std::string serverMessage;
BENCHMARK_SUSPEND { serverMessage = prepareFileLocation(1'000'000); }
auto serverMsg = std::make_unique<one::clproto::ServerMessage>();
auto success = serverMsg->ParseFromString(serverMessage);
folly::doNotOptimizeAway(success);
}
int main() { folly::runBenchmarks(); }
|
a97623e263706b45b0cf9f47819a5d23b910662d
|
407a6e8ba2327e2817794df046ea6461c43e6fa7
|
/P04/full_credit/modulo.cpp
|
96ac4bca7d574d7e2f103383cdede93bbb08a639
|
[] |
no_license
|
DaltonSparks/cse1325
|
d076cab6020a335bbb110d3df20c66691fb20c8f
|
0aceb9217bd34e57d47786d46763b4b925dc4484
|
refs/heads/master
| 2023-01-24T12:22:01.489666
| 2020-11-17T10:38:55
| 2020-11-17T10:38:55
| 291,524,918
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,107
|
cpp
|
modulo.cpp
|
#include <iomanip>
#include <iostream>
#include "modulo.h"
Modulo::Modulo(int modulo, int value, int offset)
: _modulo{modulo}, _value{value % modulo}, _offset{offset}, _nmsd{nullptr} //directly initialize member variables
{
_value = (_value - offset) % _modulo;
}
int Modulo::value()
{
return _value + _offset;
}
void Modulo::set_nmsd(Modulo* nmsd)
{
_nmsd=nmsd;
}
Modulo& Modulo::operator+=(int rhs)
{
int sum = _value + rhs;
if((sum>= _modulo) && _nmsd) (*_nmsd) += (sum / _modulo);
_value = sum % _modulo;
return *this;
}
Modulo Modulo::operator+(int rhs)
{
Modulo d{*this};
d += rhs;
return d;
}
Modulo& Modulo::operator++()
{
*this += 1;
return *this;
}
int Modulo::compare(const int rhs)
{
int i = _value + _offset; // compare what the caller sees, not internal value
return (i > rhs) ? 1 : ((i < rhs) ? -1 : 0);
}
std::ostream& operator<<(std::ostream& ost, Modulo& m)
{
ost << m._value + m._offset;
return ost;
}
std::istream& operator>>(std::istream& ist, Modulo& m)
{
ist >> m._value;
m._value = (m._value - m._offset) % m._modulo;
return ist;
}
|
bef0eb9a5c7e0c68430c4b1539810ebc60022b9c
|
d13add88195840fd06e9827dd5b5521956b2d068
|
/cpps/FFANN.cpp
|
7498ad982c5e471b7e81e41a5d1b35aba1ea2f91
|
[] |
no_license
|
aboody2009/FFANN
|
3a3a8aa84a319330d902c05fcda926843efc7208
|
8c9b9006e0ad9977889955fd5bd55ed2695c05ab
|
refs/heads/master
| 2020-07-31T23:00:00.946795
| 2016-05-19T21:03:57
| 2016-05-19T21:03:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 31,258
|
cpp
|
FFANN.cpp
|
//Sully Chen 2015
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <fstream>
#include "MatrixMath.h"
#include "FFANN.h"
FFANN::FFANN()
{
}
FFANN::FFANN(int* dimensions, int num_layers)
{
Dimensions = dimensions;
Num_Layers = num_layers;
//the first elements of the weights matrix vector object is just a filler to make the math look cleaner, it's not actually used
Matrix temp;
Weights.push_back(temp);
//create randomized weight matrices
for (int i = 0; i < num_layers - 1; i++)
{
Matrix m(dimensions[i], dimensions[i + 1]);
for (int j = 0; j < dimensions[i]; j++)
{
for (int k = 0; k < dimensions[i + 1]; k++)
{
m.Elements[j * m.Dimensions[1] + k] = (rand() % 200 - 100) / 1000.0f;
}
}
Weights.push_back(m);
}
//create biases
for (int i = 0; i < num_layers; i++)
{
Matrix m(dimensions[i], 1);
for (int j = 0; j < dimensions[i]; j++)
{
m.Elements[j] = (rand() % 200 - 100) / 1000.0f;
}
Biases.push_back(m);
}
}
std::vector<Matrix> FFANN::FeedForward(Matrix input)
{
std::vector<Matrix> outputs;
//Add biases and apply activation function to each input element
for (int i = 0; i < input.Dimensions[0]; i++)
{
input.Elements[i] += Biases[0].Elements[i];
input.Elements[i] = 1 / (1 + pow(2.718281828459f, -input.Elements[i]));
}
outputs.push_back(input);
//feed forward calculation
for (int i = 1; i < Num_Layers; i++)
{
//feed forward
Matrix z;
z = Weights[i].Transpose() * outputs[i - 1] + Biases[i];
outputs.push_back(z);
//Apply activation function
for (int j = 0; j < outputs[i].Dimensions[0]; j++)
{
outputs[i].Elements[j] = 1 / (1 + pow(2.718281828459f, -outputs[i].Elements[j]));
}
}
return outputs;
}
double FFANN::TrainWithBackPropagation(Matrix input, Matrix output, double learning_rate)
{
std::vector<Matrix> outputs = FeedForward(input);
std::vector<Matrix> temp_deltas; //layer deltas stored backwards in order
//calculate cost function
double cost = 0.0f;
Matrix partial_cost_matrix(Dimensions[Num_Layers - 1], 1);
partial_cost_matrix = output + (outputs[outputs.size() - 1] * -1);
for (int i = 0; i < partial_cost_matrix.Elements.size(); i++)
{
cost += 0.5f * partial_cost_matrix.Elements[i] * partial_cost_matrix.Elements[i];
}
//calculate last layer deltas
Matrix lld(Dimensions[Num_Layers - 1], 1);
lld = outputs[outputs.size() - 1] + (output * -1);
for (int i = 0; i < lld.Dimensions[0]; i++)
{
double a = outputs[outputs.size() - 1].Elements[i];
lld.Elements[i] *= a * (1 - a); //derivative of activation function
}
temp_deltas.push_back(lld);
//calculate the rest of the deltas through back propagation
int j = 0; //this keeps track of the index for the next layer's delta
for (int i = Num_Layers - 2; i >= 0; i--) //start at the second to last layer
{
Matrix delta(Dimensions[i], 1);
delta = Weights[i + 1] * temp_deltas[j];
j++;
for (int k = 0; k < delta.Dimensions[0]; k++)
{
double a = outputs[i].Elements[k];
delta.Elements[k] *= a * (1 - a); //derivative of activation function
}
temp_deltas.push_back(delta);
}
//put the deltas into a new vector object in the correct order
std::vector<Matrix> deltas;
for (int i = (int)temp_deltas.size() - 1; i >= 0; i--)
{
deltas.push_back(temp_deltas[i]);
}
//update biases
for (int i = 0; i < Biases.size(); i++)
{
Biases[i] = Biases[i] + deltas[i] * (-1.0f * learning_rate);
}
//update weights
for (int i = 1; i < Weights.size(); i++)
{
Weights[i] = Weights[i] + ((outputs[i - 1] * deltas[i].Transpose()) * (-1.0f * learning_rate));
}
return cost;
}
double FFANN::TrainWithBackPropagation(Matrix input, Matrix output, std::vector<Matrix> outputs, double learning_rate, Matrix* FirstLayerDeltas) //used for CovNet, returns the delta values of the first layer;
{
std::vector<Matrix> temp_deltas; //layer deltas stored backwards in order
//calculate cost function
double cost = 0.0f;
Matrix partial_cost_matrix(Dimensions[Num_Layers - 1], 1);
partial_cost_matrix = output + (outputs[outputs.size() - 1] * -1);
for (int i = 0; i < partial_cost_matrix.Elements.size(); i++)
{
cost += 0.5f * partial_cost_matrix.Elements[i] * partial_cost_matrix.Elements[i];
}
//calculate last layer deltas
Matrix lld(Dimensions[Num_Layers - 1], 1);
lld = outputs[outputs.size() - 1] + (output * -1);
for (int i = 0; i < lld.Dimensions[0]; i++)
{
double a = outputs[outputs.size() - 1].Elements[i];
lld.Elements[i] *= a * (1 - a); //derivative of activation function
}
temp_deltas.push_back(lld);
//calculate the rest of the deltas through back propagation
int j = 0; //this keeps track of the index for the next layer's delta
for (int i = Num_Layers - 2; i >= 0; i--) //start at the second to last layer
{
Matrix delta(Dimensions[i], 1);
delta = Weights[i + 1] * temp_deltas[j];
j++;
for (int k = 0; k < delta.Dimensions[0]; k++)
{
double a = outputs[i].Elements[k];
delta.Elements[k] *= a * (1 - a); //derivative of activation function
}
temp_deltas.push_back(delta);
}
//put the deltas into a new vector object in the correct order
std::vector<Matrix> deltas;
for (int i = (int)temp_deltas.size() - 1; i >= 0; i--)
{
deltas.push_back(temp_deltas[i]);
}
//update biases
for (int i = 0; i < Biases.size(); i++)
{
Biases[i] = Biases[i] + deltas[i] * (-1.0f * learning_rate);
}
//update weights
for (int i = 1; i < Weights.size(); i++)
{
Weights[i] = Weights[i] + ((outputs[i - 1] * deltas[i].Transpose()) * (-1.0f * learning_rate));
}
*FirstLayerDeltas = deltas[0]; //save first layer deltas
return cost;
}
FFANN BreedNetworks(FFANN Parent1, FFANN Parent2, double mutation_probability, double mutation_range)
{
if (mutation_probability > 1.0f)
{
mutation_probability = 1.0f;
std::cout << "Warning: keep mutation probability between 0.0 and 1.0. Capping to 1.0" << std::endl;
}
else if (mutation_probability < 0.0f)
{
mutation_probability = 0.0f;
std::cout << "Warning: keep mutation probability between 0.0 and 1.0. Flooring to 0.0" << std::endl;
}
//Make sure the networks are the same size
if (Parent1.Num_Layers != Parent2.Num_Layers)
{
std::cout << "Error! Cannot breed due to network formating!" << std::endl;
FFANN ffann(0, 0);
return ffann;
}
for (int i = 0; i < Parent1.Num_Layers; i++)
{
if (Parent1.Dimensions[i] != Parent2.Dimensions[i])
{
std::cout << "Error! Cannot breed due to network formating!" << std::endl;
FFANN ffann(0, 0);
return ffann;
}
}
//Genetic algorithm
FFANN offspringnetwork(Parent1.Dimensions, Parent1.Num_Layers); //initialize offspring network
//crossover the genes of the weights
for (int i = 1; i < Parent1.Num_Layers; i++) //we start at 1 because weights[0] is a filler matrix and does not contain any elements
{
int crossoverpoint = rand() % Parent1.Weights[i].Elements.size();
for (int j = 0; j < crossoverpoint; j++)
{
offspringnetwork.Weights[i].Elements[j] = Parent1.Weights[i].Elements[j]; //one part of the gene is from parent 1
}
for (int j = crossoverpoint; j < offspringnetwork.Weights[i].Elements.size(); j++)
{
offspringnetwork.Weights[i].Elements[j] = Parent2.Weights[i].Elements[j]; //the other part of the gene is from parent 2
}
//randomly mutate genes
for (int k = 0; k < offspringnetwork.Weights[i].Elements.size(); k++)
{
int random_int = rand() % (int)((1.01f - mutation_probability) * 1000); //we round mutation_probability * 1000 to an integer to ensure it is not a double
for (int j = 0; j < 10; j++) //we're choosing out of 1000 to get precision up to the hundredth place, so we must take 10 samples to get a probability out of 100
{
//random selection of gene
if (random_int == rand() % (int)(mutation_probability * 1000))
{
offspringnetwork.Weights[i].Elements[k] += (rand() % (int)(mutation_range * 20000 - mutation_range * 10000)) / 10000.0f; //mutate the gene
}
}
}
}
//crossover the genes of the biases
for (int i = 0; i < Parent1.Num_Layers; i++)
{
int crossoverpoint = rand() % Parent1.Biases[i].Elements.size();
for (int j = 0; j < crossoverpoint; j++)
{
offspringnetwork.Biases[i].Elements[j] = Parent1.Biases[i].Elements[j]; //one part of the gene is from parent 1
}
for (int j = crossoverpoint; j < offspringnetwork.Biases[i].Elements.size(); j++)
{
offspringnetwork.Biases[i].Elements[j] = Parent2.Biases[i].Elements[j]; //the other part of the gene is from parent 2
}
//randomly mutate genes
for (int k = 0; k < offspringnetwork.Biases[i].Elements.size(); k++)
{
int random_int = rand() % (int)((1.01f - mutation_probability) * 1000); //we round mutation_probability * 1000 to an integer to ensure it is not a double
for (int j = 0; j < 10; j++) //we're choosing out of 1000 to get precision up to the hundredth place, so we must take 10 samples to get a probability out of 100
{
//random selection of gene
if (random_int == rand() % (int)(mutation_probability * 1000))
{
offspringnetwork.Biases[i].Elements[k] += (rand() % (int)(mutation_range * 20000 - mutation_range * 10000)) / 10000.0f; //mutate the gene
}
}
}
}
return offspringnetwork;
}
//This RNN code is not implemented correctly and does not function correctly
/*
RNN::RNN(int input_vector_size, int num_layers) : InputVectorSize(input_vector_size), Num_Layers(num_layers)
{
//the first elements of the weights matrix vector object is just a filler to make the math look cleaner, it's not actually used
Matrix temp;
Weights.push_back(temp);
//create randomized weight matrices
for (int i = 0; i < num_layers - 1; i++)
{
Matrix m(input_vector_size, input_vector_size);
for (int j = 0; j < input_vector_size; j++)
{
for (int k = 0; k < input_vector_size; k++)
{
m.Elements[j * m.Dimensions[1] + k] = (rand() % 200 - 100) / 1000.0f;
}
}
Weights.push_back(m);
}
//create recurrent weights
//the first and last recurrent weight matrices are placeholders, they are not used
for (int i = 0; i < num_layers; i++)
{
Matrix m(input_vector_size, 1);
for (int j = 0; j < input_vector_size; j++)
{
m.Elements[j] = (rand() % 200 - 100) / 1000.0f;
}
RecurrentWeights.push_back(m);
}
//create biases
for (int i = 0; i < num_layers; i++)
{
Matrix m(input_vector_size, 1);
for (int j = 0; j < input_vector_size; j++)
{
m.Elements[j] = (rand() % 200 - 100) / 1000.0f;
}
Biases.push_back(m);
}
}
RNN RNNBreedNetworks(RNN Parent1, RNN Parent2, double mutation_probability, double mutation_range)
{
if (mutation_probability > 1.0f)
{
mutation_probability = 1.0f;
std::cout << "Warning: keep mutation probability between 0.0 and 1.0. Capping to 1.0" << std::endl;
}
else if (mutation_probability < 0.0f)
{
mutation_probability = 0.0f;
std::cout << "Warning: keep mutation probability between 0.0 and 1.0. Flooring to 0.0" << std::endl;
}
//Make sure the networks are the same size
if (Parent1.Num_Layers != Parent2.Num_Layers)
{
std::cout << "Error! Cannot breed due to network formating!" << std::endl;
RNN rnn(0, 0);
return rnn;
}
if (Parent1.Num_Layers != Parent2.Num_Layers || Parent1.InputVectorSize != Parent2.InputVectorSize)
{
std::cout << "Error! Cannot breed due to network formating!" << std::endl;
RNN rnn(0, 0);
return rnn;
}
//Genetic algorithm
RNN offspringnetwork(Parent1.InputVectorSize, Parent1.Num_Layers); //initialize offspring network
//crossover the genes of the weights
for (int i = 1; i < Parent1.Num_Layers; i++) //we start at 1 because weights[0] is a filler matrix and does not contain any elements
{
int crossoverpoint = rand() % Parent1.Weights[i].Elements.size();
for (int j = 0; j < crossoverpoint; j++)
{
offspringnetwork.Weights[i].Elements[j] = Parent1.Weights[i].Elements[j]; //one part of the gene is from parent 1
}
for (int j = crossoverpoint; j < offspringnetwork.Weights[i].Elements.size(); j++)
{
offspringnetwork.Weights[i].Elements[j] = Parent2.Weights[i].Elements[j]; //the other part of the gene is from parent 2
}
//randomly mutate genes
for (int k = 0; k < offspringnetwork.Weights[i].Elements.size(); k++)
{
int random_int = rand() % (int)((1.01f - mutation_probability) * 1000); //we round mutation_probability * 1000 to an integer to ensure it is not a double
for (int j = 0; j < 10; j++) //we're choosing out of 1000 to get precision up to the hundredth place, so we must take 10 samples to get a probability out of 100
{
//random selection of gene
if (random_int == rand() % (int)(mutation_probability * 1000))
{
offspringnetwork.Weights[i].Elements[k] += (rand() % (int)(mutation_range * 20000 - mutation_range * 10000)) / 10000.0f; //mutate the gene
}
}
}
}
//crossover the genes of the biases and recurrent weights
for (int i = 0; i < Parent1.Num_Layers; i++)
{
int crossoverpoint = rand() % Parent1.Biases[i].Elements.size();
for (int j = 0; j < crossoverpoint; j++)
{
offspringnetwork.Biases[i].Elements[j] = Parent1.Biases[i].Elements[j]; //one part of the gene is from parent 1
offspringnetwork.RecurrentWeights[i].Elements[j] = Parent1.RecurrentWeights[i].Elements[j];
}
for (int j = crossoverpoint; j < offspringnetwork.Biases[i].Elements.size(); j++)
{
offspringnetwork.Biases[i].Elements[j] = Parent2.Biases[i].Elements[j]; //the other part of the gene is from parent 2
offspringnetwork.RecurrentWeights[i].Elements[j] = Parent2.RecurrentWeights[i].Elements[j];
}
//randomly mutate genes
for (int k = 0; k < offspringnetwork.Biases[i].Elements.size(); k++)
{
int random_int = rand() % (int)((1.01f - mutation_probability) * 1000); //we round mutation_probability * 1000 to an integer to ensure it is not a double
for (int j = 0; j < 10; j++) //we're choosing out of 1000 to get precision up to the hundredth place, so we must take 10 samples to get a probability out of 100
{
//random selection of gene
if (random_int == rand() % (int)(mutation_probability * 1000))
{
offspringnetwork.Biases[i].Elements[k] += (rand() % (int)(mutation_range * 20000 - mutation_range * 10000)) / 10000.0f; //mutate the gene
offspringnetwork.RecurrentWeights[i].Elements[k] += (rand() % (int)(mutation_range * 20000 - mutation_range * 10000)) / 10000.0f; //mutate the gene
}
}
}
}
return offspringnetwork;
}
std::vector<std::vector<Matrix> > RNN::FeedForward(Matrix input, int num_passes)
{
std::vector<std::vector<Matrix> > networkdata;
Matrix prev_output;
for (int i = 0; i < num_passes; i++)
{
if (i == 0)
{
std::vector<Matrix> zerorecurrence;
for (int j = 0; j < Num_Layers; j++)
{
Matrix zr(InputVectorSize, 1);
zerorecurrence.push_back(zr);
}
networkdata.push_back(PartialFeedFoward(input, zerorecurrence));
}
else
{
Matrix m(networkdata[networkdata.size() - 1][Num_Layers - 1].Elements.size(), 1);
m.Elements[MaxElement(networkdata[networkdata.size() - 1][Num_Layers - 1])] = 1.0f;
networkdata.push_back(PartialFeedFoward(m, networkdata[networkdata.size() - 1]));
}
}
return networkdata;
}
std::vector<Matrix> RNN::PartialFeedFoward(Matrix input, std::vector<Matrix> recurrences)
{
std::vector<Matrix> outputs;
//Add biases and apply activation function to each input element
for (int i = 0; i < input.Dimensions[0]; i++)
{
input.Elements[i] += Biases[0].Elements[i];
input.Elements[i] = 1 / (1 + pow(2.718281828459f, -input.Elements[i]));
}
outputs.push_back(input);
//feed forward calculation
for (int i = 1; i < Num_Layers; i++)
{
//feed forward
Matrix z;
z = Weights[i].Transpose() * outputs[i - 1] + Biases[i];
if (i != Num_Layers - 1)
for (int j = 0; j < z.Dimensions[0]; j++)
z.Elements[j] += recurrences[i].Elements[j] * RecurrentWeights[i].Elements[j];
outputs.push_back(z);
//Apply activation function
for (int j = 0; j < outputs[i].Dimensions[0]; j++)
{
outputs[i].Elements[j] = 1 / (1 + pow(2.718281828459f, -outputs[i].Elements[j]));
}
}
return outputs;
}
double RNN::TrainWithBackPropagation(std::vector<Matrix> sequence, double learning_rate)
{
double cost = 0.0f;
BackpropagationData data1; //data from first step
BackpropagationData data2; //data from second step
for (int i = 0; i < sequence.size() - 2; i++)
{
if (i == 0)
{
std::vector<Matrix> zerorecurrence;
for (int j = 0; j < Num_Layers; j++)
{
Matrix zr(InputVectorSize, 1);
zerorecurrence.push_back(zr);
}
data1 = TrainStep(sequence[i], sequence[i + 1], zerorecurrence);
data2 = TrainStep(sequence[i + 1], sequence[i + 2], data1.activations);
}
else
{
data1 = TrainStep(sequence[i], sequence[i + 1], data2.activations);
data2 = TrainStep(sequence[i + 1], sequence[i + 2], data1.activations);
}
//update biases
for (int i = 0; i < Biases.size(); i++)
{
Biases[i] = Biases[i] + data1.deltas[i] * (-1.0f * learning_rate);
}
//update weights
for (int i = 1; i < Weights.size(); i++)
{
Weights[i] = Weights[i] + ((data1.activations[i - 1] * data1.deltas[i].Transpose()) * (-1.0f * learning_rate));
}
//update biases
for (int i = 0; i < Biases.size(); i++)
{
Biases[i] = Biases[i] + data2.deltas[i] * (-1.0f * learning_rate);
}
//update weights
for (int i = 1; i < Weights.size(); i++)
{
Weights[i] = Weights[i] + ((data2.activations[i - 1] * data2.deltas[i].Transpose()) * (-1.0f * learning_rate));
}
//update recurrent weights
for (int i = 1; i < RecurrentWeights.size() - 1; i++)
{
for (int j = 0; j < RecurrentWeights[i].Elements.size(); j++)
RecurrentWeights[i].Elements[j] -= data1.activations[i].Elements[j] * data2.deltas[i + 1].Elements[j] * learning_rate;
}
cost += data1.cost + data2.cost;
}
return cost;
}
BackpropagationData RNN::TrainStep(Matrix input, Matrix output, std::vector<Matrix> recurrences)
{
BackpropagationData data;
std::vector<Matrix> outputs = PartialFeedFoward(input, recurrences);
std::vector<Matrix> temp_deltas; //layer deltas stored backwards in order
//calculate cost function
double cost = 0.0f;
Matrix partial_cost_matrix(InputVectorSize, 1);
partial_cost_matrix = output + (outputs[outputs.size() - 1] * -1);
for (int i = 0; i < partial_cost_matrix.Elements.size(); i++)
{
cost += 0.5f * partial_cost_matrix.Elements[i] * partial_cost_matrix.Elements[i];
}
//calculate last layer deltas
Matrix lld(InputVectorSize, 1);
lld = outputs[outputs.size() - 1] + (output * -1);
for (int i = 0; i < lld.Dimensions[0]; i++)
{
double a = outputs[outputs.size() - 1].Elements[i];
lld.Elements[i] *= a * (1 - a); //derivative of activation function
}
temp_deltas.push_back(lld);
//calculate the rest of the deltas through back propagation
int j = 0; //this keeps track of the index for the next layer's delta
for (int i = Num_Layers - 2; i >= 0; i--) //start at the second to last layer
{
Matrix delta(InputVectorSize, 1);
delta = Weights[i + 1] * temp_deltas[j];
j++;
for (int k = 0; k < delta.Dimensions[0]; k++)
{
double a = outputs[i].Elements[k];
delta.Elements[k] *= a * (1 - a); //derivative of activation function
}
temp_deltas.push_back(delta);
}
//put the deltas into a new vector object in the correct order
std::vector<Matrix> deltas;
for (int i = (int)temp_deltas.size() - 1; i >= 0; i--)
{
deltas.push_back(temp_deltas[i]);
}
data.cost = cost;
data.activations = outputs;
data.deltas = deltas;
return data;
}
*/
//This convolutional neural network code is not implemented correctly and does not function correctly
/*
CovNet28x28::CovNet28x28()
{
Matrix l1b(28, 28);
l1b.Randomize();
Layer1_Bias = l1b;
for (int i = 0; i < 9; i++)
{
Matrix k5x5(5, 5);
k5x5.Randomize();
Kernels1.push_back(k5x5);
}
for (int i = 0; i < 9; i++)
{
Matrix l3b(12, 12);
l3b.Randomize();
Layer3_Biases.push_back(l3b);
}
for (int i = 0; i < 9; i++)
{
Matrix k3x3(3, 3);
k3x3.Randomize();
Kernels2.push_back(k3x3);
}
int dimensions[2] = {900, 10};
FFANN fullyconnectedlayer(dimensions, 2);
FullyConnectedLayer = fullyconnectedlayer;
}
//COVNET IS NOT WORKING WELL YET
std::vector<std::vector<Matrix> > CovNet28x28::FeedForward(Matrix input)
{
std::vector<std::vector<Matrix> > outputs;
//calculate first layer activations
input = input + Layer1_Bias;
for (int i = 0; i < input.Elements.size(); i++)
input.Elements[i] = 1 / (1 + pow(2.718281828459f, -input.Elements[i]));
std::vector<Matrix> input_vector;
input_vector.push_back(input);
outputs.push_back(input_vector);
std::vector<Matrix> Layers2;
for (int a = 0; a < 9; a++)
{
Matrix Layer2(24, 24);
//first convolution
for (int i = 0; i < 24; i++)
for (int j = 0; j < 24; j++)
for (int k = 0; k < 5; k++)
for (int l = 0; l < 5; l++)
Layer2.Elements[CoordinateToIndex(j, i, &Layer2)] += input.Elements[CoordinateToIndex(j + l, i + k, &input)]
* Kernels1[a].Elements[CoordinateToIndex(l, k, &Kernels1[a])];
Layers2.push_back(Layer2);
}
outputs.push_back(Layers2);
std::vector<Matrix> Layers3;
for (int a = 0; a < 9; a++)
{
//Max pooling
Matrix Layer3(12, 12);
for (int i = 0; i < 12; i++)
for (int j = 0; j < 12; j++)
{
Matrix m(2, 2);
for (int k = 0; k < 2; k++)
for (int l = 0; l < 2; l++)
m.Elements[CoordinateToIndex(l, k, &m)] = Layers2[a].Elements[CoordinateToIndex(j * 2 + l, i * 2 + k, &Layers2[a])];
Layer3.Elements[CoordinateToIndex(j, i, &Layer3)] = m.Elements[MaxElement(m)];
}
Layers3.push_back(Layer3);
}
for (int j = 0; j < 9; j++)
{
//calculate third layer activations
Layers3[j] = Layers3[j] + Layer3_Biases[j];
for (int i = 0; i < Layers3[j].Elements.size(); i++)
Layers3[j].Elements[i] = 1 / (1 + pow(2.718281828459f, -Layers3[j].Elements[i]));
}
outputs.push_back(Layers3);
std::vector<Matrix> Layers4;
for (int a = 0; a < 9; a++)
{
Matrix Layer4(10, 10);
//second convolution
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
for (int k = 0; k < 3; k++)
for (int l = 0; l < 3; l++)
Layer4.Elements[CoordinateToIndex(j, i, &Layer4)] += Layers3[a].Elements[CoordinateToIndex(j + l, i + k, &Layers3[a])]
* Kernels2[a].Elements[CoordinateToIndex(l, k, &Kernels2[a])];
Layers4.push_back(Layer4);
}
//full feed forward
Matrix fclinput(900, 1);
for (int j = 0; j < Layers4.size(); j++)
{
for (int i = 0; i < 100; i++)
{
fclinput.Elements[j * 100 + i] = Layers4[j].Elements[i];
}
}
std::vector<Matrix> fcloutput = FullyConnectedLayer.FeedForward(fclinput);
for (int i = 0; i < fcloutput.size(); i++)
{
std::vector<Matrix> fcloutput_vector;
fcloutput_vector.push_back(fcloutput[i]);
outputs.push_back(fcloutput_vector);
}
return outputs;
}
double CovNet28x28::TrainWithBackPropagation(Matrix input, Matrix output, double learning_rate)
{
std::vector<std::vector<Matrix> > outputs = FeedForward(input);
//train the fully connected layer and store the deltas of the first layer
Matrix lld(900, 1);
std::vector<Matrix> outputs_l2l; //outputs of the feedfoward network
outputs_l2l.push_back(outputs[outputs.size() - 2][0]);
outputs_l2l.push_back(outputs[outputs.size() - 1][0]);
double cost = FullyConnectedLayer.TrainWithBackPropagation(input, output, outputs_l2l, learning_rate, &lld);
std::vector<Matrix> llds;
for (int i = 0; i < 9; i++)
{
Matrix templld(10, 10);
for (int j = 0; j < 100; j++)
{
templld.Elements[j] = lld.Elements[i * 100 + j];
}
llds.push_back(templld);
}
//calculate Layer 3 deltas
std::vector<Matrix> layers3_deltas;
for (int b = 0; b < 9; b++)
{
Matrix layer3_deltas(12, 12);
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
for (int k = 0; k < 3; k++)
for (int l = 0; l < 3; l++)
{
double a = outputs[2][b].Elements[CoordinateToIndex(j + l, i + k, &outputs[2][b])];
double derivative = a * (1 - a);
layer3_deltas.Elements[CoordinateToIndex(j + l, i + k, &layer3_deltas)] += llds[b].Elements[CoordinateToIndex(j, i, &llds[b])] * derivative;
}
layers3_deltas.push_back(layer3_deltas);
}
//calculate Layer 2 deltas
std::vector<Matrix> layers2_deltas;
for (int a = 0; a < 9; a++)
{
Matrix layer2_deltas(24, 24);
for (int i = 0; i < 12; i++)
for (int j = 0; j < 12; j++)
{
Matrix m(2, 2);
int x;
int y;
for (int k = 0; k < 2; k++)
for (int l = 0; l < 2; l++)
m.Elements[CoordinateToIndex(l, k, &m)] = outputs[1][a].Elements[CoordinateToIndex(j * 2 + l, i * 2 + k, &outputs[1][a])];
x = j * 2 + MaxElement(m) % 2;
y = i * 2 + (int)(MaxElement(m) / 2);
layer2_deltas.Elements[CoordinateToIndex(x, y, &layer2_deltas)] = layers3_deltas[a].Elements[CoordinateToIndex(j, i, &layers3_deltas[a])];
}
layers2_deltas.push_back(layer2_deltas);
}
//calculate Layer 1 deltas
Matrix layer1_deltas(28, 28);
for (int b = 0; b < 9; b++)
{
for (int i = 0; i < 24; i++)
for (int j = 0; j < 24; j++)
for (int k = 0; k < 5; k++)
for (int l = 0; l < 5; l++)
{
double a = outputs[0][0].Elements[CoordinateToIndex(j + l, i + k, &outputs[0][0])];
double derivative = a * (1 - a);
layer1_deltas.Elements[CoordinateToIndex(j + l, i + k, &layer1_deltas)] += layers2_deltas[b].Elements[CoordinateToIndex(j, i, &layers2_deltas[b])] * derivative;
}
}
//update biases
for (int i = 0; i < Layer1_Bias.Elements.size(); i++)
Layer1_Bias.Elements[i] -= layer1_deltas.Elements[i] * learning_rate;
for (int a = 0; a < 9; a++)
for (int i = 0; i < Layer3_Biases[a].Elements.size(); i++)
Layer3_Biases[a].Elements[i] -= layers3_deltas[a].Elements[i] * learning_rate;
//update kernels
for (int a = 0; a < 9; a++)
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
for (int k = 0; k < 3; k++)
for (int l = 0; l < 3; l++)
Kernels2[a].Elements[CoordinateToIndex(l, k, &Kernels2[a])] -= outputs[2][a].Elements[CoordinateToIndex(j + l, i + k, &outputs[2][a])] * lld.Elements[CoordinateToIndex(j, i, &lld)] * learning_rate;
for (int a = 0; a < 9; a++)
for (int i = 0; i < 24; i++)
for (int j = 0; j < 24; j++)
for (int k = 0; k < 5; k++)
for (int l = 0; l < 5; l++)
Kernels1[a].Elements[CoordinateToIndex(l, k, &Kernels1[a])] -= outputs[0][0].Elements[CoordinateToIndex(j + l, i + k, &outputs[0][0])] * layers2_deltas[a].Elements[CoordinateToIndex(j, i, &layers2_deltas[a])] * learning_rate;
return cost;
}
*/
int MaxElement(Matrix m)
{
if (m.Elements.size() == 0)
return 0;
double max = m.Elements[0];
int max_i = 0;
for (int i = 0; i < m.Elements.size(); i++)
{
if (m.Elements[i] > max)
{
max = m.Elements[i];
max_i = i;
}
}
return max_i;
}
|
136e8f31b7969e7aa14dad9a61343e5b97574a32
|
abf421de8dfca4a433c99b1f21da8f6eec6be1f6
|
/SRUP_Syndicated_ID_REQ.h
|
2ec0cffb8f0d4054d0953e495819bf42d1427251
|
[
"MIT",
"LicenseRef-scancode-proprietary-license"
] |
permissive
|
dstl/srup
|
3bb336c2f335d8bb2146de8809069531239c33a4
|
ff478a2f689fcbfc459320d382fb90d5ecee9f0a
|
refs/heads/master
| 2021-10-12T00:13:18.280277
| 2021-09-27T13:12:41
| 2021-09-27T13:12:41
| 62,746,329
| 8
| 8
|
MIT
| 2021-05-11T08:19:23
| 2016-07-06T19:03:48
|
C++
|
UTF-8
|
C++
| false
| false
| 721
|
h
|
SRUP_Syndicated_ID_REQ.h
|
//
// Created by AJ Poulter on 10/11/2020.
//
#ifndef SRUP_LIBRARY_SRUP_SYNDICATED_ID_REQ_H
#define SRUP_LIBRARY_SRUP_SYNDICATED_ID_REQ_H
#include "SRUP_ID_REQ.h"
namespace SRUP
{
static uint8_t SRUP_MESSAGE_TYPE_SYNDICATED_ID_REQUEST = 0x26;
}
class SRUP_MSG_SYNDICATED_ID_REQ : public SRUP_MSG_ID_REQ
{
//using SRUP_MSG_ID_REQ::SRUP_MSG_ID_REQ;
public:
SRUP_MSG_SYNDICATED_ID_REQ();
~SRUP_MSG_SYNDICATED_ID_REQ() override;
bool DeSerialize(const uint8_t*) override;
const uint64_t* targetID();
bool targetID(const uint64_t*);
protected:
bool Serialize(bool) override;
bool DataCheck() override;
uint64_t* m_target_ID;
};
#endif //SRUP_LIBRARY_SRUP_SYNDICATED_ID_REQ_H
|
4814cece78d95d252df0d29bcd0eccc83a87e6f4
|
5b77bce5e44ccbeee424cbd84d460c0981684b46
|
/singleCall/singleCall.cpp
|
6e833023ca31eb218c75dbf9fc2ee3d29813f504
|
[] |
no_license
|
langya0/design_pattern_study
|
472660e68c7eaf95c80832c4991a000909dc0a62
|
5909ace92d1e98d330eba047871425e7d81ff715
|
refs/heads/master
| 2021-01-17T06:46:08.508300
| 2016-08-13T05:06:26
| 2016-08-13T05:06:26
| 65,263,608
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,038
|
cpp
|
singleCall.cpp
|
// 单来源调用:一个产品的生产只能由特定的生产车间生产。不能通过其他方式实现
#include <iostream>
#include <stdio.h>
using namespace std;
#include "../trace.h"
// base只能由driver产生,不能由其他途径产生
// 分解1
// 不能主动建立----protected屏蔽构造
// 留下的问题。可能会由本类静态方法调用产生
// 禁止静态方法。
// 分解2,与可以产生的对象类进行关联
// 方案一:保护继承
// 问题:这样就变成了同时存在了,且driver和base一一对应。需求偏离(特定工厂随时创建实例)
// 方案二:通过this指针进行关联,只要有this指针,那么就可以产生该base
// 此时不能有继承使用,那么只有通过静态方法获取了
// 此时唯一的问题就是临时对象可以生成了。那么应该如何处理呢
// 临时对象据有默认构造行为,所以,我们将构造的默认行为设置为false
class abstractDriver
{
protected:
bool _canCreate;
abstractDriver(bool can)
:_canCreate(can)
{}
public:
virtual bool canCreate(){
return _canCreate;
}
};
class base
{
protected:
base()
{
Trace("");
}
public:
static base* getInstance(abstractDriver*);
};
base* base::getInstance(abstractDriver*dr)
{
if (dr->canCreate())
/* code */
return new base();
else
return NULL;
}
class driver:public abstractDriver
{
public:
driver()
:abstractDriver(false)
{
Trace("");
}
base* getInstance()
{
_canCreate = true;
base* p =base::getInstance(this);
_canCreate = false;
return p;
}
};
int main(int argc, char const *argv[])
{
base* p = base::getInstance(new driver());
cout << p <<endl;
p = (driver()).getInstance();
cout << p <<endl;
return 0;
}
// // 通过静态方法获取,且依赖driver的this指针。
// // 但是此时也可以通过临时对象driver生成
// class driver;
// class base
// {
// protected:
// base()//driver*)
// {
// Trace("");
// }
// public:
// static base* getInstance(driver*);
// };
// base* base::getInstance(driver*)
// {
// return new base();
// }
// class driver
// {
// public:
// base* getInstance()
// {
// return base::getInstance(this);
// }
// };
// int main(int argc, char const *argv[])
// {
// base * p = (driver()).getInstance();
// return 0;
// }
// 实现通过driver产生,但是只因为继承而产生/换句话说,他和driver是一一对应的
// class base
// {
// protected:
// base()
// {
// Trace("");
// }
// };
// class driver:protected base
// {
// public:
// void test()
// {
// base b;
// }
// };
// int main(int argc, char const *argv[])
// {
// driver d;
// d.test();
// return 0;
// }
// 静态方法获取实例
// class base
// {
// protected:
// base()
// {
// Trace("");
// }
// public:
// static base* getInstance();
// };
// base* base::getInstance()
// {
// return new base();
// }
// int main(int argc, char const *argv[])
// {
// // base* p = new base();
// base * p = base::getInstance();
// return 0;
// }
|
8e3ff24b547d70fa6797c47772b2b34eb6c38594
|
b89a6a122a7b82e4fd0872f1ec935bc45633c9eb
|
/src/CompressedReader.cc
|
fab6212157829a1aa58b8e0d7e7011c673fda3a0
|
[
"BSD-2-Clause",
"MIT"
] |
permissive
|
rogerwang/rr
|
545f87ed75a00c8bf97ec31df1a826792f3cbd5b
|
619b8951d392b46c6f62b2bad7c0861a05d9f32e
|
refs/heads/master
| 2020-04-28T22:17:36.253926
| 2015-02-19T11:38:52
| 2015-02-25T04:49:44
| 31,494,918
| 3
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,382
|
cc
|
CompressedReader.cc
|
/* -*- Mode: C++; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */
//#define DEBUGTAG "CompressedReader"
#define _LARGEFILE64_SOURCE
#include "CompressedReader.h"
#include <assert.h>
#include <fcntl.h>
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <zlib.h>
#include "CompressedWriter.h"
CompressedReader::CompressedReader(const std::string& filename)
: fd(new ScopedFd(filename.c_str(), O_CLOEXEC | O_RDONLY | O_LARGEFILE)) {
fd_offset = 0;
error = !fd->is_open();
eof = false;
buffer_read_pos = 0;
have_saved_state = false;
}
CompressedReader::CompressedReader(const CompressedReader& other) {
fd = other.fd;
fd_offset = other.fd_offset;
error = other.error;
eof = other.eof;
buffer_read_pos = other.buffer_read_pos;
buffer = other.buffer;
have_saved_state = false;
assert(!other.have_saved_state);
}
CompressedReader::~CompressedReader() { close(); }
static bool read_all(const ScopedFd& fd, size_t size, void* data,
uint64_t* offset) {
while (size > 0) {
ssize_t result = pread(fd, data, size, *offset);
if (result <= 0) {
return false;
}
size -= result;
data = static_cast<uint8_t*>(data) + result;
*offset += result;
}
return true;
}
static bool do_decompress(std::vector<uint8_t>& compressed,
std::vector<uint8_t>& uncompressed) {
z_stream stream;
memset(&stream, 0, sizeof(stream));
int result = inflateInit(&stream);
if (result != Z_OK) {
assert(0 && "inflateInit failed!");
return false;
}
stream.next_in = &compressed[0];
stream.avail_in = compressed.size();
stream.next_out = &uncompressed[0];
stream.avail_out = uncompressed.size();
result = inflate(&stream, Z_FINISH);
if (result != Z_STREAM_END) {
assert(0 && "inflate failed!");
return false;
}
result = inflateEnd(&stream);
if (result != Z_OK) {
assert(0 && "inflateEnd failed!");
return false;
}
return true;
}
bool CompressedReader::read(void* data, size_t size) {
while (size > 0) {
if (error) {
return false;
}
if (buffer_read_pos < buffer.size()) {
size_t amount = std::min(size, buffer.size() - buffer_read_pos);
memcpy(data, &buffer[buffer_read_pos], amount);
size -= amount;
data = static_cast<char*>(data) + amount;
buffer_read_pos += amount;
continue;
}
if (have_saved_state && !have_saved_buffer) {
std::swap(buffer, saved_buffer);
have_saved_buffer = true;
}
CompressedWriter::BlockHeader header;
if (!read_all(*fd, sizeof(header), &header, &fd_offset)) {
error = true;
return false;
}
std::vector<uint8_t> compressed_buf;
compressed_buf.resize(header.compressed_length);
if (!read_all(*fd, compressed_buf.size(), &compressed_buf[0], &fd_offset)) {
error = true;
return false;
}
char ch;
if (pread(*fd, &ch, 1, fd_offset) == 0) {
eof = true;
}
buffer.resize(header.uncompressed_length);
buffer_read_pos = 0;
if (!do_decompress(compressed_buf, buffer)) {
error = true;
return false;
}
}
return true;
}
void CompressedReader::rewind() {
assert(!have_saved_state);
fd_offset = 0;
buffer_read_pos = 0;
buffer.clear();
eof = false;
}
void CompressedReader::close() { fd = nullptr; }
void CompressedReader::save_state() {
assert(!have_saved_state);
have_saved_state = true;
have_saved_buffer = false;
saved_fd_offset = fd_offset;
saved_buffer_read_pos = buffer_read_pos;
}
void CompressedReader::restore_state() {
assert(have_saved_state);
have_saved_state = false;
if (saved_fd_offset < fd_offset) {
eof = false;
}
fd_offset = saved_fd_offset;
if (have_saved_buffer) {
std::swap(buffer, saved_buffer);
saved_buffer.clear();
}
buffer_read_pos = saved_buffer_read_pos;
}
uint64_t CompressedReader::uncompressed_bytes() const {
uint64_t offset = 0;
uint64_t uncompressed_bytes = 0;
CompressedWriter::BlockHeader header;
while (read_all(*fd, sizeof(header), &header, &offset)) {
uncompressed_bytes += header.uncompressed_length;
offset += header.compressed_length;
}
return uncompressed_bytes;
}
uint64_t CompressedReader::compressed_bytes() const {
return lseek(*fd, 0, SEEK_END);
}
|
613448c4d107f1e466d46eac61321ab592b2ea53
|
29af718d33105bceddd488326e53dab24e1014ef
|
/Combinatorics/Hypergraphs/Generators/tests/GreenTao.hpp
|
2ed16d37c9c9dc4ffde696b7f05d8556d840e9bf
|
[] |
no_license
|
OKullmann/oklibrary
|
d0f422847f134705c0cd1eebf295434fe5ffe7ed
|
c578d0460c507f23b97329549a874aa0c0b0541b
|
refs/heads/master
| 2023-09-04T02:38:14.642785
| 2023-09-01T11:38:31
| 2023-09-01T11:38:31
| 38,629
| 21
| 64
| null | 2020-10-30T17:13:04
| 2008-07-30T18:20:06
|
C++
|
UTF-8
|
C++
| false
| false
| 985
|
hpp
|
GreenTao.hpp
|
// Oliver Kullmann, 17.10.2009 (Swansea)
/* Copyright 2009 Oliver Kullmann
This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation and included in this library; either version 3 of the
License, or any later version. */
/*!
\file OKlib/Combinatorics/Hypergraphs/Generators/tests/GreenTao.hpp
\brief Generic tests for algorithms generating GreenTao hypergraphs
*/
#ifndef GREENTAO_qlacsdwEsS
#define GREENTAO_qlacsdwEsS
#include <OKlib/TestSystem/TestBaseClass_DesignStudy.hpp>
namespace OKlib {
namespace Combinatorics {
namespace Hypergraphs {
namespace Generators {
namespace tests {
# define OKLIB_FILE_ID new ::OKlib::Messages::Utilities::FileIdentification \
(__FILE__, __DATE__, __TIME__, "$Date: 17.10.2009 20:35:00 $", "$Revision: 1 $")
}
}
}
}
}
# undef OKLIB_FILE_ID
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.