mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-05 23:42:31 +00:00
- License was intended to be GPLv3 per earlier commit of GPLv3 LICENSE FILE - This is confirmed by the inclusion of libraries that are incompatible with GPLv2 - This is also confirmed by KLS and the agreement of KLS's predecessors - Added GPLv3 license headers to the compilable source files - Removed Folly licensing in strings.h since the string functions do not match the Folly functions and are standard functions - this must have been left over from previous implementations - Removed individual contributor license headers since the project has been under the "developer" mantle for many years - Removed comments on files that were previously automatically generated since they've been manually modified multiple times and there are no automatic scripts referencing them (removed in 2023)
482 lines
16 KiB
C++
482 lines
16 KiB
C++
/* EQEmu: EQEmulator
|
|
|
|
Copyright (C) 2001-2026 EQEmu Development Team
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(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/>.
|
|
*/
|
|
#pragma once
|
|
|
|
#include <map>
|
|
#include <string>
|
|
|
|
class Client;
|
|
|
|
static const std::map<std::string, std::string> html_colors = {
|
|
{"black", "#000000"},
|
|
{"brown", "#804000"},
|
|
{"burgundy", "#800000"},
|
|
{"cadet_blue", "#77BFC7"},
|
|
{"cadet_blue_1", "#4C787E"},
|
|
{"chartreuse", "#8AFB17"},
|
|
{"chartreuse_1", "#7FE817"},
|
|
{"chartreuse_2", "#6CC417"},
|
|
{"chartreuse_3", "#437C17"},
|
|
{"chocolate", "#C85A17"},
|
|
{"coral", "#F76541"},
|
|
{"coral_1", "#E55B3C"},
|
|
{"coral_2", "#C34A2C"},
|
|
{"cornflower_blue", "#151B8D"},
|
|
{"cyan", "#00FFFF"},
|
|
{"cyan_1", "#57FEFF"},
|
|
{"cyan_2", "#50EBEC"},
|
|
{"cyan_3", "#46C7C7"},
|
|
{"cyan_4", "#307D7E"},
|
|
{"dark_blue", "#0000A0"},
|
|
{"dark_goldenrod", "#AF7817"},
|
|
{"dark_goldenrod_1", "#FBB117"},
|
|
{"dark_goldenrod_2", "#E8A317"},
|
|
{"dark_goldenrod_3", "#C58917"},
|
|
{"dark_goldenrod_4", "#7F5217"},
|
|
{"dark_green", "#254117"},
|
|
{"dark_grey", "#808080"},
|
|
{"dark_olive_green", "#CCFB5D"},
|
|
{"dark_olive_green_2", "#BCE954"},
|
|
{"dark_olive_green_3", "#A0C544"},
|
|
{"dark_olive_green_4", "#667C26"},
|
|
{"dark_orange", "#F88017"},
|
|
{"dark_orange_1", "#F87217"},
|
|
{"dark_orange_2", "#E56717"},
|
|
{"dark_orange_3", "#7E3117"},
|
|
{"dark_orange_3", "#C35617"},
|
|
{"dark_orchid", "#7D1B7E"},
|
|
{"dark_orchid_1", "#B041FF"},
|
|
{"dark_orchid_2", "#A23BEC"},
|
|
{"dark_orchid_3", "#8B31C7"},
|
|
{"dark_orchid_4", "#571B7e"},
|
|
{"dark_purple", "#800080"},
|
|
{"dark_salmon", "#E18B6B"},
|
|
{"dark_sea_green", "#8BB381"},
|
|
{"dark_sea_green_1", "#C3FDB8"},
|
|
{"dark_sea_green_2", "#B5EAAA"},
|
|
{"dark_sea_green_3", "#99C68E"},
|
|
{"dark_sea_green_4", "#617C58"},
|
|
{"dark_slate_blue", "#2B3856"},
|
|
{"dark_slate_gray", "#25383C"},
|
|
{"dark_slate_gray_1", "#9AFEFF"},
|
|
{"dark_slate_gray_2", "#8EEBEC"},
|
|
{"dark_slate_gray_3", "#78c7c7"},
|
|
{"dark_slate_gray_4", "#4C7D7E"},
|
|
{"dark_turquoise", "#3B9C9C"},
|
|
{"dark_violet", "#842DCE"},
|
|
{"deep_pink", "#F52887"},
|
|
{"deep_pink_1", "#E4287C"},
|
|
{"deep_pink_2", "#C12267"},
|
|
{"deep_pink_3", "#7D053F"},
|
|
{"deep_sky_blue", "#3BB9FF"},
|
|
{"deep_sky_blue_1", "#38ACEC"},
|
|
{"deep_sky_blue_2", "#3090C7"},
|
|
{"deep_sky_blue_3", "#25587E"},
|
|
{"dim_gray", "#463E41"},
|
|
{"dodger_blue", "#1589FF"},
|
|
{"dodger_blue_1", "#157DEC"},
|
|
{"dodger_blue_2", "#1569C7"},
|
|
{"dodger_blue_3", "#153E7E"},
|
|
{"firebrick", "#800517"},
|
|
{"firebrick_1", "#F62817"},
|
|
{"firebrick_2", "#E42217"},
|
|
{"firebrick_3", "#C11B17"},
|
|
{"forest_green", "#4E9258"},
|
|
{"forest_green_1", "#808000"},
|
|
{"gold", "#D4A017"},
|
|
{"gold_1", "#FDD017"},
|
|
{"gold_2", "#EAC117"},
|
|
{"gold_3", "#C7A317"},
|
|
{"gold_4", "#806517"},
|
|
{"goldenrod", "#EDDA74"},
|
|
{"goldenrod_1", "#FBB917"},
|
|
{"goldenrod_2", "#E9AB17"},
|
|
{"goldenrod_3", "#C68E17"},
|
|
{"goldenrod_4", "#805817"},
|
|
{"grass_green", "#408080"},
|
|
{"gray", "#736F6E"},
|
|
{"gray_1", "#150517"},
|
|
{"gray_2", "#250517"},
|
|
{"gray_3", "#2B1B17"},
|
|
{"gray_4", "#302217"},
|
|
{"gray_5", "#302226"},
|
|
{"gray_6", "#342826"},
|
|
{"gray_7", "#34282C"},
|
|
{"gray_8", "#382D2C"},
|
|
{"gray_9", "#3b3131"},
|
|
{"gray_10", "#3E3535"},
|
|
{"gray_11", "#413839"},
|
|
{"gray_12", "#41383C"},
|
|
{"gray_13", "#463E3F"},
|
|
{"gray_14", "#4A4344"},
|
|
{"gray_15", "#4C4646"},
|
|
{"gray_16", "#4E4848"},
|
|
{"gray_17", "#504A4B"},
|
|
{"gray_18", "#544E4F"},
|
|
{"gray_19", "#565051"},
|
|
{"gray_19", "#595454"},
|
|
{"gray_20", "#5C5858"},
|
|
{"gray_21", "#5F5A59"},
|
|
{"gray_22", "#625D5D"},
|
|
{"gray_23", "#646060"},
|
|
{"gray_24", "#666362"},
|
|
{"gray_25", "#696565"},
|
|
{"gray_26", "#6D6968"},
|
|
{"gray_27", "#6E6A6B"},
|
|
{"gray_28", "#726E6D"},
|
|
{"gray_29", "#747170"},
|
|
{"green", "#00FF00"},
|
|
{"green_1", "#5FFB17"},
|
|
{"green_2", "#59E817"},
|
|
{"green_3", "#4CC417"},
|
|
{"green_4", "#347C17"},
|
|
{"green_yellow", "#B1FB17"},
|
|
{"hot_pink", "#F660AB"},
|
|
{"hot_pink_1", "#F665AB"},
|
|
{"hot_pink_2", "#E45E9D"},
|
|
{"hot_pink_3", "#C25283"},
|
|
{"hot_pink_4", "#7D2252"},
|
|
{"indian_red", "#F75D59"},
|
|
{"indian_red_2", "#E55451"},
|
|
{"indian_red_3", "#C24641"},
|
|
{"indian_red_4", "#7E2217"},
|
|
{"khaki", "#ADA96E"},
|
|
{"khaki_1", "#FFF380"},
|
|
{"khaki_2", "#EDE275"},
|
|
{"khaki_3", "#C9BE62"},
|
|
{"khaki_4", "#827839"},
|
|
{"lavender", "#E3E4FA"},
|
|
{"lavender_blush", "#FDEEF4"},
|
|
{"lavender_blush_1", "#EBDDE2"},
|
|
{"lavender_blush_2", "#C8BBBE"},
|
|
{"lavender_blush_3", "#817679"},
|
|
{"lawn_green", "#87F717"},
|
|
{"lemon_chiffon", "#FFF8C6"},
|
|
{"lemon_chiffon_1", "#ECE5B6"},
|
|
{"lemon_chiffon_2", "#C9C299"},
|
|
{"lemon_chiffon_3", "#827B60"},
|
|
{"light_blue", "#0000FF"},
|
|
{"light_blue_1", "#ADDFFF"},
|
|
{"light_blue_2", "#BDEDFF"},
|
|
{"light_blue_3", "#AFDCEC"},
|
|
{"light_blue_4", "#95B9C7"},
|
|
{"light_blue_5", "#5E767E"},
|
|
{"light_coral", "#E77471"},
|
|
{"light_cyan", "#E0FFFF"},
|
|
{"light_cyan_1", "#CFECEC"},
|
|
{"light_cyan_2", "#AFC7C7"},
|
|
{"light_cyan_3", "#717D7D"},
|
|
{"light_golden", "#ECD672"},
|
|
{"light_goldenrod", "#ECD872"},
|
|
{"light_goldenrod_1", "#FFE87C"},
|
|
{"light_goldenrod_2", "#C8B560"},
|
|
{"light_goldenrod_3", "#817339"},
|
|
{"light_goldenrod_yellow", "#FAF8CC"},
|
|
{"light_grey", "#C0C0C0"},
|
|
{"light_pink", "#FAAFBA"},
|
|
{"light_pink_1", "#F9A7B0"},
|
|
{"light_pink_2", "#E799A3"},
|
|
{"light_pink_3", "#C48189"},
|
|
{"light_pink_4", "#7F4E52"},
|
|
{"light_purple", "#FF0080"},
|
|
{"light_salmon", "#F9966B"},
|
|
{"light_salmon_1", "#E78A61"},
|
|
{"light_salmon_2", "#C47451"},
|
|
{"light_salmon_3", "#7F462C"},
|
|
{"light_sea_green", "#3EA99F"},
|
|
{"light_sky_blue", "#82CAFA"},
|
|
{"light_sky_blue_1", "#A0CFEC"},
|
|
{"light_sky_blue_2", "#87AFC7"},
|
|
{"light_sky_blue_3", "#566D7E"},
|
|
{"light_slate_blue", "#736AFF"},
|
|
{"light_slate_gray", "#6D7B8D"},
|
|
{"light_steel_blue", "#728FCE"},
|
|
{"light_steel_blue_1", "#C6DEFF"},
|
|
{"light_steel_blue_2", "#B7CEEC"},
|
|
{"light_steel_blue_3", "#646D7E"},
|
|
{"lime_green", "#41A317"},
|
|
{"magenta", "#FF00FF"},
|
|
{"magenta_1", "#F433FF"},
|
|
{"magenta_2", "#E238EC"},
|
|
{"magenta_3", "#C031C7"},
|
|
{"maroon", "#810541"},
|
|
{"maroon_1", "#F535AA"},
|
|
{"maroon_2", "#E3319D"},
|
|
{"maroon_3", "#C12283"},
|
|
{"maroon_4", "#7D0552"},
|
|
{"medium_aquamarine", "#348781"},
|
|
{"medium_forest_green", "#347235"},
|
|
{"medium_orchid", "#B048B5"},
|
|
{"medium_orchid_1", "#D462FF"},
|
|
{"medium_orchid_2", "#C45AEC"},
|
|
{"medium_orchid_3", "#A74AC7"},
|
|
{"medium_orchid_4", "#6A287E"},
|
|
{"medium_purple", "#8467D7"},
|
|
{"medium_purple_1", "#9E7BFF"},
|
|
{"medium_purple_2", "#9172EC"},
|
|
{"medium_purple_3", "#7A5DC7"},
|
|
{"medium_purple_4", "#4E387E"},
|
|
{"medium_sea_green", "#306754"},
|
|
{"medium_slate_blue", "#5E5A80"},
|
|
{"medium_spring_green", "#348017"},
|
|
{"medium_turquoise", "#48CCCD"},
|
|
{"medium_violet_red", "#CA226B"},
|
|
{"midnight_blue", "#151B54"},
|
|
{"orange", "#FF8040"},
|
|
{"pale_turquoise", "#92C7C7"},
|
|
{"pale_turquoise_1", "#5E7D7E"},
|
|
{"pale_violet_red", "#D16587"},
|
|
{"pale_violet_red_1", "#F778A1"},
|
|
{"pale_violet_red_2", "#E56E94"},
|
|
{"pale_violet_red_3", "#C25A7C"},
|
|
{"pale_violet_red_4", "#7E354D"},
|
|
{"pastel_green", "#00FF00"},
|
|
{"pink", "#FAAFBE"},
|
|
{"pink_1", "#FF00FF"},
|
|
{"pink_2", "#E7A1B0"},
|
|
{"pink_3", "#C48793"},
|
|
{"pink_4", "#7F525D"},
|
|
{"plum", "#B93B8F"},
|
|
{"plum_1", "#F9B7FF"},
|
|
{"plum_2", "#E6A9EC"},
|
|
{"plum_3", "#C38EC7"},
|
|
{"plum_4", "#7E587E"},
|
|
{"purple", "#8E35EF"},
|
|
{"purple_1", "#893BFF"},
|
|
{"purple_2", "#7F38EC"},
|
|
{"purple_3", "#6C2DC7"},
|
|
{"purple_4", "#461B7E"},
|
|
{"red", "#FF0000"},
|
|
{"red_1", "#F62217"},
|
|
{"red_2", "#E41B17"},
|
|
{"rosy_brown", "#B38481"},
|
|
{"rosy_brown_1", "#FBBBB9"},
|
|
{"rosy_brown_2", "#E8ADAA"},
|
|
{"rosy_brown_3", "#C5908E"},
|
|
{"rosy_brown_4", "#7F5A58"},
|
|
{"royal_blue", "#2B60DE"},
|
|
{"royal_blue_1", "#306EFF"},
|
|
{"royal_blue_2", "#2B65EC"},
|
|
{"royal_blue_3", "#2554C7"},
|
|
{"royal_blue_4", "#15317E"},
|
|
{"salmon_1", "#F88158"},
|
|
{"salmon_2", "#E67451"},
|
|
{"salmon_3", "#C36241"},
|
|
{"salmon_4", "#7E3817"},
|
|
{"sandy_brown", "#EE9A4D"},
|
|
{"sea_green", "#4E8975"},
|
|
{"sea_green_1", "#6AFB92"},
|
|
{"sea_green_2", "#64E986"},
|
|
{"sea_green_3", "#54C571"},
|
|
{"sea_green_4", "#387C44"},
|
|
{"sienna", "#8A4117"},
|
|
{"sienna_1", "#F87431"},
|
|
{"sienna_2", "#E66C2C"},
|
|
{"sienna_3", "#C35817"},
|
|
{"sienna_4", "#7E3517"},
|
|
{"sky_blue", "#82CAFF"},
|
|
{"sky_blue_1", "#6698FF"},
|
|
{"sky_blue_2", "#79BAEC"},
|
|
{"sky_blue_3", "#659EC7"},
|
|
{"sky_blue_4", "#41627E"},
|
|
{"slate_blue", "#357EC7"},
|
|
{"slate_blue_1", "#737CA1"},
|
|
{"slate_blue_2", "#6960EC"},
|
|
{"slate_blue_3", "#342D7E"},
|
|
{"slate_gray", "#657383"},
|
|
{"slate_gray_1", "#C2DFFF"},
|
|
{"slate_gray_2", "#B4CFEC"},
|
|
{"slate_gray_3", "#98AFC7"},
|
|
{"slate_gray_4", "#616D7E"},
|
|
{"spring_green", "#4AA02C"},
|
|
{"spring_green_1", "#5EFB6E"},
|
|
{"spring_green_2", "#57E964"},
|
|
{"spring_green_3", "#4CC552"},
|
|
{"spring_green_4", "#347C2C"},
|
|
{"steel_blue", "#4863A0"},
|
|
{"steel_blue_1", "#5CB3FF"},
|
|
{"steel_blue_2", "#56A5EC"},
|
|
{"steel_blue_3", "#488AC7"},
|
|
{"steel_blue_4", "#2B547E"},
|
|
{"thistle", "#D2B9D3"},
|
|
{"thistle_1", "#FCDFFF"},
|
|
{"thistle_2", "#E9CFEC"},
|
|
{"thistle_3", "#C6AEC7"},
|
|
{"thistle_4", "#806D7E"},
|
|
{"turquoise", "#00FFFF"},
|
|
{"turquoise_1", "#43C6DB"},
|
|
{"turquoise_2", "#52F3FF"},
|
|
{"turquoise_3", "#4EE2EC"},
|
|
{"turquoise_4", "#43BFC7"},
|
|
{"violet", "#8D38C9"},
|
|
{"violet_red", "#F6358A"},
|
|
{"violet_red_1", "#F6358A"},
|
|
{"violet_red_2", "#E4317F"},
|
|
{"violet_red_3", "#C12869"},
|
|
{"violet_red_4", "#7D0541"},
|
|
{"white", "#FFFFFF"},
|
|
{"yellow", "#FFFF00"},
|
|
{"yellow_1", "#FFFC17"},
|
|
{"yellow_green", "#52D017"}
|
|
};
|
|
|
|
const std::map<std::string, int> animations = {
|
|
{"kick", 1},
|
|
{"pierce", 2},
|
|
{"2hslash", 3},
|
|
{"2hblunt", 4},
|
|
{"2hpierce", 4},
|
|
{"throw", 5},
|
|
{"offhand", 6},
|
|
{"bash", 7},
|
|
{"mainhand", 8},
|
|
{"bow", 9},
|
|
{"swim", 10},
|
|
{"roundkick", 11},
|
|
{"gethit", 12},
|
|
{"gethit2", 13},
|
|
{"falling", 14},
|
|
{"drowning", 15},
|
|
{"death", 16},
|
|
{"standby", 17},
|
|
{"standby2", 18},
|
|
{"lunge", 19},
|
|
{"jump", 20},
|
|
{"falling2", 21},
|
|
{"duckwalk", 22},
|
|
{"ladderclimb", 23},
|
|
{"crouch", 24},
|
|
{"swim2", 25},
|
|
{"idle", 26},
|
|
{"cheer", 27},
|
|
{"disgusted", 28},
|
|
{"wave", 29},
|
|
{"rude", 30},
|
|
{"yawn", 31},
|
|
{"movetoside", 33},
|
|
{"iceslide", 35},
|
|
{"kneel", 36},
|
|
{"swim3", 37},
|
|
{"sit", 38},
|
|
{"cast", 42},
|
|
{"cast2", 43},
|
|
{"cast3", 44},
|
|
{"flykick", 45},
|
|
{"tigerclaw", 46},
|
|
{"eaglestrike", 47},
|
|
{"nodyes", 48},
|
|
{"shakeno", 49},
|
|
{"plead", 50},
|
|
{"clap", 51},
|
|
{"blush", 52},
|
|
{"chuckle", 54},
|
|
{"headtilt", 57},
|
|
{"dance", 58},
|
|
{"disagree", 59},
|
|
{"glare", 60},
|
|
{"peer", 61},
|
|
{"kneel", 62},
|
|
{"laugh", 63},
|
|
{"point", 64},
|
|
{"shrug", 65},
|
|
{"handraise", 66},
|
|
{"salute", 67},
|
|
{"shiver", 68},
|
|
{"tapfoot", 69},
|
|
{"bowto", 70}
|
|
};
|
|
|
|
const std::map<int, std::string> animation_names_map = {
|
|
{ 1, "Kick" },
|
|
{ 2, "1H Piercing" },
|
|
{ 3, "2H Slashing" },
|
|
{ 4, "2H Blunt" },
|
|
{ 4, "2H Piercing" },
|
|
{ 5, "Throw" },
|
|
{ 6, "Off Hand" },
|
|
{ 7, "Bash" },
|
|
{ 8, "Main Hand" },
|
|
{ 9, "Bow" },
|
|
{ 10, "Swim" },
|
|
{ 11, "Round Kick" },
|
|
{ 12, "Get Hit" },
|
|
{ 13, "Get Hit" },
|
|
{ 14, "Falling" },
|
|
{ 15, "Drowning" },
|
|
{ 16, "Death" },
|
|
{ 17, "Stand By" },
|
|
{ 18, "Stand By" },
|
|
{ 19, "Lunge" },
|
|
{ 20, "Jump" },
|
|
{ 21, "Falling" },
|
|
{ 22, "Crouched Walk" },
|
|
{ 23, "Ladder Climb" },
|
|
{ 24, "Crouch" },
|
|
{ 25, "Swim" },
|
|
{ 26, "Idle" },
|
|
{ 27, "Cheer" },
|
|
{ 28, "Disgusted" },
|
|
{ 29, "Wave" },
|
|
{ 30, "Rude" },
|
|
{ 31, "Yawn" },
|
|
{ 33, "Move To Side" },
|
|
{ 35, "Ice Slide" },
|
|
{ 36, "Kneel" },
|
|
{ 37, "Swim" },
|
|
{ 38, "Sit" },
|
|
{ 42, "Cast" },
|
|
{ 43, "Cast" },
|
|
{ 44, "Cast" },
|
|
{ 45, "Flying Kick" },
|
|
{ 46, "Tiger Claw" },
|
|
{ 47, "Eagle Strike" },
|
|
{ 48, "Nod Yes" },
|
|
{ 49, "Shake No" },
|
|
{ 50, "Plead" },
|
|
{ 51, "Clap" },
|
|
{ 52, "Blush" },
|
|
{ 54, "Chuckle" },
|
|
{ 57, "Head Tilt" },
|
|
{ 58, "Dance" },
|
|
{ 59, "Disagree" },
|
|
{ 60, "Glare" },
|
|
{ 61, "Peer" },
|
|
{ 62, "Kneel" },
|
|
{ 63, "Laugh" },
|
|
{ 64, "Point" },
|
|
{ 65, "Shrug" },
|
|
{ 66, "Hand Raise" },
|
|
{ 67, "Salute" },
|
|
{ 68, "Shiver" },
|
|
{ 69, "Tap Foot" },
|
|
{ 70, "Bow To" }
|
|
};
|
|
|
|
class DialogueWindow {
|
|
public:
|
|
static void Render(Client *c, std::string markdown);
|
|
static std::string Break(uint32 break_count = 1);
|
|
static std::string CenterMessage(std::string message);
|
|
static std::string ColorMessage(std::string color, std::string message);
|
|
static std::string Indent(uint32 indent_count = 1);
|
|
static std::string Link(std::string link, std::string message = std::string());
|
|
static std::string Table(std::string message);
|
|
static std::string TableCell(std::string message = std::string());
|
|
static std::string TableRow(std::string message);
|
|
};
|